nodes: 0, module; 1, function_definition; 2, function_name:extract_from_text; 3, parameters; 4, block; 5, identifier:text; 6, expression_statement; 7, comment:# Remove the leading "arxiv:".; 8, return_statement; 9, comment:"""
      Extract arXiv IDs from a text.
  
      :param text: The text to extract arXiv IDs from.
      :returns: A list of matching arXiv IDs, in canonical form.
  
      >>> sorted(extract_from_text('1506.06690 1506.06690v1 arXiv:1506.06690 arXiv:1506.06690v1 arxiv:1506.06690 arxiv:1506.06690v1 math.GT/0309136 abcdf bar1506.06690foo mare.GG/0309136'))
      ['1506.06690', '1506.06690v1', 'math.GT/0309136']
      """; 10, call; 11, attribute; 12, argument_list; 13, identifier:tools; 14, identifier:remove_duplicates; 15, list_comprehension; 16, call; 17, for_in_clause; 18, if_clause; 19, attribute; 20, argument_list; 21, identifier:i; 22, call; 23, comparison_operator:i[0] != ''; 24, identifier:re; 25, identifier:sub; 26, string:"arxiv:"; 27, string:""; 28, subscript; 29, keyword_argument; 30, attribute; 31, argument_list; 32, subscript; 33, string; 34, identifier:i; 35, integer:0; 36, identifier:flags; 37, attribute; 38, identifier:REGEX; 39, identifier:findall; 40, identifier:text; 41, identifier:i; 42, integer:0; 43, identifier:re; 44, identifier:IGNORECASE
code: def extract_from_text(text):
      """
      Extract arXiv IDs from a text.
  
      :param text: The text to extract arXiv IDs from.
      :returns: A list of matching arXiv IDs, in canonical form.
  
      >>> sorted(extract_from_text('1506.06690 1506.06690v1 arXiv:1506.06690 arXiv:1506.06690v1 arxiv:1506.06690 arxiv:1506.06690v1 math.GT/0309136 abcdf bar1506.06690foo mare.GG/0309136'))
      ['1506.06690', '1506.06690v1', 'math.GT/0309136']
      """
      # Remove the leading "arxiv:".
      return tools.remove_duplicates([re.sub("arxiv:", "", i[0],
                                             flags=re.IGNORECASE)
                                      for i in REGEX.findall(text) if i[0] != ''])