nodes: 0, module; 1, function_definition; 2, function_name:gff3_to_recarray; 3, parameters; 4, block; 5, identifier:path; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, expression_statement; 14, comment:# read records; 15, expression_statement; 16, if_statement; 17, comment:# determine dtype; 18, if_statement; 19, expression_statement; 20, return_statement; 21, identifier:attributes; 22, None; 23, identifier:region; 24, None; 25, identifier:score_fill; 26, unary_operator; 27, identifier:phase_fill; 28, unary_operator; 29, identifier:attributes_fill; 30, string; 31, identifier:tabix; 32, string; 33, identifier:dtype; 34, None; 35, comment:"""Load data from a GFF3 into a NumPy recarray.
  
      Parameters
      ----------
      path : string
          Path to input file.
      attributes : list of strings, optional
          List of columns to extract from the "attributes" field.
      region : string, optional
          Genome region to extract. If given, file must be position
          sorted, bgzipped and tabix indexed. Tabix must also be installed
          and on the system path.
      score_fill : int, optional
          Value to use where score field has a missing value.
      phase_fill : int, optional
          Value to use where phase field has a missing value.
      attributes_fill : object or list of objects, optional
          Value(s) to use where attribute field(s) have a missing value.
      tabix : string, optional
          Tabix command.
      dtype : dtype, optional
          Override dtype.
  
      Returns
      -------
      np.recarray
  
      """; 36, assignment; 37, not_operator; 38, block; 39, comparison_operator:dtype is None; 40, block; 41, assignment; 42, identifier:a; 43, integer:1; 44, integer:1; 45, string_content:.; 46, string_content:tabix; 47, identifier:recs; 48, call; 49, identifier:recs; 50, return_statement; 51, identifier:dtype; 52, None; 53, expression_statement; 54, if_statement; 55, identifier:a; 56, call; 57, identifier:list; 58, argument_list; 59, None; 60, assignment; 61, identifier:attributes; 62, block; 63, attribute; 64, argument_list; 65, call; 66, identifier:dtype; 67, list; 68, for_statement; 69, attribute; 70, identifier:fromrecords; 71, identifier:recs; 72, keyword_argument; 73, identifier:iter_gff3; 74, argument_list; 75, tuple; 76, tuple; 77, tuple; 78, tuple; 79, tuple; 80, tuple; 81, tuple; 82, tuple; 83, identifier:n; 84, identifier:attributes; 85, block; 86, identifier:np; 87, identifier:rec; 88, identifier:dtype; 89, identifier:dtype; 90, identifier:path; 91, keyword_argument; 92, keyword_argument; 93, keyword_argument; 94, keyword_argument; 95, keyword_argument; 96, keyword_argument; 97, string; 98, identifier:object; 99, string; 100, identifier:object; 101, string; 102, identifier:object; 103, string; 104, identifier:int; 105, string; 106, identifier:int; 107, string; 108, identifier:float; 109, string; 110, identifier:object; 111, string; 112, identifier:int; 113, expression_statement; 114, identifier:attributes; 115, identifier:attributes; 116, identifier:region; 117, identifier:region; 118, identifier:score_fill; 119, identifier:score_fill; 120, identifier:phase_fill; 121, identifier:phase_fill; 122, identifier:attributes_fill; 123, identifier:attributes_fill; 124, identifier:tabix; 125, identifier:tabix; 126, string_content:seqid; 127, string_content:source; 128, string_content:type; 129, string_content:start; 130, string_content:end; 131, string_content:score; 132, string_content:strand; 133, string_content:phase; 134, call; 135, attribute; 136, argument_list; 137, identifier:dtype; 138, identifier:append; 139, tuple; 140, identifier:n; 141, identifier:object
code: def gff3_to_recarray(path, attributes=None, region=None, score_fill=-1,
                       phase_fill=-1, attributes_fill='.', tabix='tabix', dtype=None):
      """Load data from a GFF3 into a NumPy recarray.
  
      Parameters
      ----------
      path : string
          Path to input file.
      attributes : list of strings, optional
          List of columns to extract from the "attributes" field.
      region : string, optional
          Genome region to extract. If given, file must be position
          sorted, bgzipped and tabix indexed. Tabix must also be installed
          and on the system path.
      score_fill : int, optional
          Value to use where score field has a missing value.
      phase_fill : int, optional
          Value to use where phase field has a missing value.
      attributes_fill : object or list of objects, optional
          Value(s) to use where attribute field(s) have a missing value.
      tabix : string, optional
          Tabix command.
      dtype : dtype, optional
          Override dtype.
  
      Returns
      -------
      np.recarray
  
      """
  
      # read records
      recs = list(iter_gff3(path, attributes=attributes, region=region,
                            score_fill=score_fill, phase_fill=phase_fill,
                            attributes_fill=attributes_fill, tabix=tabix))
  
      if not recs:
          return None
  
      # determine dtype
      if dtype is None:
          dtype = [('seqid', object),
                   ('source', object),
                   ('type', object),
                   ('start', int),
                   ('end', int),
                   ('score', float),
                   ('strand', object),
                   ('phase', int)]
          if attributes:
              for n in attributes:
                  dtype.append((n, object))
  
      a = np.rec.fromrecords(recs, dtype=dtype)
      return a