nodes: 0, module; 1, function_definition; 2, function_name:sort_ranges; 3, parameters; 4, block; 5, identifier:inranges; 6, expression_statement; 7, return_statement; 8, comment:"""from an array of ranges, make a sorted array of ranges
  
    :param inranges: List of GenomicRange data
    :type inranges: GenomicRange[]
    :returns: a new sorted GenomicRange list
    :rtype: GenomicRange[]
  
    """; 9, call; 10, identifier:sorted; 11, argument_list; 12, identifier:inranges; 13, keyword_argument; 14, identifier:key; 15, lambda; 16, lambda_parameters; 17, tuple; 18, identifier:x; 19, attribute; 20, attribute; 21, attribute; 22, attribute; 23, identifier:x; 24, identifier:chr; 25, identifier:x; 26, identifier:start; 27, identifier:x; 28, identifier:end; 29, identifier:x; 30, identifier:direction
code: def sort_ranges(inranges):
    """from an array of ranges, make a sorted array of ranges
  
    :param inranges: List of GenomicRange data
    :type inranges: GenomicRange[]
    :returns: a new sorted GenomicRange list
    :rtype: GenomicRange[]
  
    """
    return sorted(inranges,key=lambda x: (x.chr,x.start,x.end,x.direction))