nodes: 0, module; 1, function_definition; 2, function_name:extract_from_text; 3, parameters; 4, block; 5, identifier:text; 6, expression_statement; 7, return_statement; 8, comment:"""
      Extract HAL ids from a text.
  
      :param text: The text to extract HAL ids from.
      :returns: A list of matching HAL ids.
  
      >>> sorted(extract_from_text("hal-01258754 hal-01258754v2 foobar"))
      ['hal-01258754', 'hal-01258754v2']
      """; 9, call; 10, attribute; 11, argument_list; 12, identifier:tools; 13, identifier:remove_duplicates; 14, list_comprehension; 15, subscript; 16, for_in_clause; 17, if_clause; 18, identifier:i; 19, integer:0; 20, identifier:i; 21, call; 22, comparison_operator:i != ''; 23, attribute; 24, argument_list; 25, identifier:i; 26, string; 27, identifier:REGEX; 28, identifier:findall; 29, identifier:text
code: def extract_from_text(text):
      """
      Extract HAL ids from a text.
  
      :param text: The text to extract HAL ids from.
      :returns: A list of matching HAL ids.
  
      >>> sorted(extract_from_text("hal-01258754 hal-01258754v2 foobar"))
      ['hal-01258754', 'hal-01258754v2']
      """
      return tools.remove_duplicates([i[0]
                                      for i in REGEX.findall(text) if i != ''])