nodes: 0, module; 1, function_definition; 2, function_name:sort_and_print_entries; 3, parameters; 4, block; 5, identifier:entries; 6, identifier:args; 7, expression_statement; 8, comment:# Extract the proper number type.; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, comment:# Pre-remove entries that don't pass the filtering criteria; 13, comment:# Make sure we use the same searching algorithm for filtering; 14, comment:# as for sorting.; 15, expression_statement; 16, if_statement; 17, comment:# Print off the sorted results; 18, for_statement; 19, comment:"""Sort the entries, applying the filters first if necessary."""; 20, assignment; 21, assignment; 22, assignment; 23, assignment; 24, boolean_operator; 25, block; 26, identifier:entry; 27, call; 28, block; 29, identifier:is_float; 30, comparison_operator:args.number_type in ("float", "real", "f", "r"); 31, identifier:signed; 32, boolean_operator; 33, identifier:alg; 34, parenthesized_expression; 35, identifier:do_filter; 36, boolean_operator; 37, identifier:do_filter; 38, attribute; 39, expression_statement; 40, expression_statement; 41, if_statement; 42, if_statement; 43, if_statement; 44, attribute; 45, argument_list; 46, expression_statement; 47, attribute; 48, tuple; 49, attribute; 50, comparison_operator:args.number_type in ("real", "r"); 51, binary_operator:natsort.ns.FLOAT * is_float
          | natsort.ns.SIGNED * signed
          | natsort.ns.NOEXP * (not args.exp)
          | natsort.ns.PATH * args.paths
          | natsort.ns.LOCALE * args.locale; 52, comparison_operator:args.filter is not None; 53, comparison_operator:args.reverse_filter is not None; 54, identifier:args; 55, identifier:exclude; 56, assignment; 57, assignment; 58, comparison_operator:args.filter is not None; 59, block; 60, comparison_operator:args.reverse_filter is not None; 61, block; 62, attribute; 63, block; 64, identifier:natsort; 65, identifier:natsorted; 66, identifier:entries; 67, keyword_argument; 68, keyword_argument; 69, call; 70, identifier:args; 71, identifier:number_type; 72, string:"float"; 73, string:"real"; 74, string:"f"; 75, string:"r"; 76, identifier:args; 77, identifier:signed; 78, attribute; 79, tuple; 80, binary_operator:natsort.ns.FLOAT * is_float
          | natsort.ns.SIGNED * signed
          | natsort.ns.NOEXP * (not args.exp)
          | natsort.ns.PATH * args.paths; 81, binary_operator:natsort.ns.LOCALE * args.locale; 82, attribute; 83, None; 84, attribute; 85, None; 86, identifier:inp_options; 87, parenthesized_expression; 88, identifier:regex; 89, call; 90, attribute; 91, None; 92, expression_statement; 93, expression_statement; 94, attribute; 95, None; 96, expression_statement; 97, expression_statement; 98, identifier:args; 99, identifier:exclude; 100, expression_statement; 101, expression_statement; 102, identifier:reverse; 103, attribute; 104, identifier:alg; 105, identifier:alg; 106, identifier:print; 107, argument_list; 108, identifier:args; 109, identifier:number_type; 110, string:"real"; 111, string:"r"; 112, binary_operator:natsort.ns.FLOAT * is_float
          | natsort.ns.SIGNED * signed
          | natsort.ns.NOEXP * (not args.exp); 113, binary_operator:natsort.ns.PATH * args.paths; 114, attribute; 115, attribute; 116, identifier:args; 117, identifier:filter; 118, identifier:args; 119, identifier:reverse_filter; 120, binary_operator:natsort.ns.FLOAT * is_float
              | natsort.ns.SIGNED * signed
              | natsort.ns.NOEXP * (not args.exp); 121, identifier:regex_chooser; 122, argument_list; 123, identifier:args; 124, identifier:filter; 125, assignment; 126, assignment; 127, identifier:args; 128, identifier:reverse_filter; 129, assignment; 130, assignment; 131, assignment; 132, assignment; 133, identifier:args; 134, identifier:reverse; 135, identifier:entry; 136, binary_operator:natsort.ns.FLOAT * is_float
          | natsort.ns.SIGNED * signed; 137, binary_operator:natsort.ns.NOEXP * (not args.exp); 138, attribute; 139, attribute; 140, attribute; 141, identifier:LOCALE; 142, identifier:args; 143, identifier:locale; 144, binary_operator:natsort.ns.FLOAT * is_float
              | natsort.ns.SIGNED * signed; 145, binary_operator:natsort.ns.NOEXP * (not args.exp); 146, identifier:inp_options; 147, pattern_list; 148, tuple; 149, identifier:entries; 150, list_comprehension; 151, pattern_list; 152, tuple; 153, identifier:entries; 154, list_comprehension; 155, identifier:exclude; 156, call; 157, identifier:entries; 158, list_comprehension; 159, binary_operator:natsort.ns.FLOAT * is_float; 160, binary_operator:natsort.ns.SIGNED * signed; 161, attribute; 162, parenthesized_expression; 163, attribute; 164, identifier:PATH; 165, identifier:args; 166, identifier:paths; 167, identifier:natsort; 168, identifier:ns; 169, binary_operator:natsort.ns.FLOAT * is_float; 170, binary_operator:natsort.ns.SIGNED * signed; 171, attribute; 172, parenthesized_expression; 173, identifier:lows; 174, identifier:highs; 175, list_comprehension; 176, list_comprehension; 177, identifier:entry; 178, for_in_clause; 179, if_clause; 180, identifier:lows; 181, identifier:highs; 182, list_comprehension; 183, list_comprehension; 184, identifier:entry; 185, for_in_clause; 186, if_clause; 187, identifier:set; 188, argument_list; 189, identifier:entry; 190, for_in_clause; 191, if_clause; 192, attribute; 193, identifier:is_float; 194, attribute; 195, identifier:signed; 196, attribute; 197, identifier:NOEXP; 198, not_operator; 199, identifier:natsort; 200, identifier:ns; 201, attribute; 202, identifier:is_float; 203, attribute; 204, identifier:signed; 205, attribute; 206, identifier:NOEXP; 207, not_operator; 208, subscript; 209, for_in_clause; 210, subscript; 211, for_in_clause; 212, identifier:entry; 213, identifier:entries; 214, call; 215, subscript; 216, for_in_clause; 217, subscript; 218, for_in_clause; 219, identifier:entry; 220, identifier:entries; 221, not_operator; 222, attribute; 223, identifier:entry; 224, identifier:entries; 225, call; 226, attribute; 227, identifier:FLOAT; 228, attribute; 229, identifier:SIGNED; 230, identifier:natsort; 231, identifier:ns; 232, attribute; 233, attribute; 234, identifier:FLOAT; 235, attribute; 236, identifier:SIGNED; 237, identifier:natsort; 238, identifier:ns; 239, attribute; 240, identifier:f; 241, integer:0; 242, identifier:f; 243, attribute; 244, identifier:f; 245, integer:1; 246, identifier:f; 247, attribute; 248, identifier:keep_entry_range; 249, argument_list; 250, identifier:f; 251, integer:0; 252, identifier:f; 253, attribute; 254, identifier:f; 255, integer:1; 256, identifier:f; 257, attribute; 258, call; 259, identifier:args; 260, identifier:exclude; 261, identifier:keep_entry_value; 262, argument_list; 263, identifier:natsort; 264, identifier:ns; 265, identifier:natsort; 266, identifier:ns; 267, identifier:args; 268, identifier:exp; 269, identifier:natsort; 270, identifier:ns; 271, identifier:natsort; 272, identifier:ns; 273, identifier:args; 274, identifier:exp; 275, identifier:args; 276, identifier:filter; 277, identifier:args; 278, identifier:filter; 279, identifier:entry; 280, identifier:lows; 281, identifier:highs; 282, identifier:float; 283, identifier:regex; 284, identifier:args; 285, identifier:reverse_filter; 286, identifier:args; 287, identifier:reverse_filter; 288, identifier:keep_entry_range; 289, argument_list; 290, identifier:entry; 291, identifier:exclude; 292, identifier:float; 293, identifier:regex; 294, identifier:entry; 295, identifier:lows; 296, identifier:highs; 297, identifier:float; 298, identifier:regex
code: def sort_and_print_entries(entries, args):
      """Sort the entries, applying the filters first if necessary."""
  
      # Extract the proper number type.
      is_float = args.number_type in ("float", "real", "f", "r")
      signed = args.signed or args.number_type in ("real", "r")
      alg = (
          natsort.ns.FLOAT * is_float
          | natsort.ns.SIGNED * signed
          | natsort.ns.NOEXP * (not args.exp)
          | natsort.ns.PATH * args.paths
          | natsort.ns.LOCALE * args.locale
      )
  
      # Pre-remove entries that don't pass the filtering criteria
      # Make sure we use the same searching algorithm for filtering
      # as for sorting.
      do_filter = args.filter is not None or args.reverse_filter is not None
      if do_filter or args.exclude:
          inp_options = (
              natsort.ns.FLOAT * is_float
              | natsort.ns.SIGNED * signed
              | natsort.ns.NOEXP * (not args.exp)
          )
          regex = regex_chooser(inp_options)
          if args.filter is not None:
              lows, highs = ([f[0] for f in args.filter], [f[1] for f in args.filter])
              entries = [
                  entry
                  for entry in entries
                  if keep_entry_range(entry, lows, highs, float, regex)
              ]
          if args.reverse_filter is not None:
              lows, highs = (
                  [f[0] for f in args.reverse_filter],
                  [f[1] for f in args.reverse_filter],
              )
              entries = [
                  entry
                  for entry in entries
                  if not keep_entry_range(entry, lows, highs, float, regex)
              ]
          if args.exclude:
              exclude = set(args.exclude)
              entries = [
                  entry
                  for entry in entries
                  if keep_entry_value(entry, exclude, float, regex)
              ]
  
      # Print off the sorted results
      for entry in natsort.natsorted(entries, reverse=args.reverse, alg=alg):
          print(entry)