nodes: 0, module; 1, function_definition; 2, function_name:parse_number_factory; 3, parameters; 4, block; 5, identifier:alg; 6, identifier:sep; 7, identifier:pre_sep; 8, expression_statement; 9, expression_statement; 10, function_definition; 11, comment:# Return the function, possibly wrapping in tuple if PATH is selected.; 12, if_statement; 13, comment:"""
      Create a function that will format a number into a tuple.
  
      Parameters
      ----------
      alg : ns enum
          Indicate how to format the *bytes*.
      sep : str
          The string character to be inserted before the number
          in the returned tuple.
      pre_sep : str
          In the event that *alg* contains ``UNGROUPLETTERS``, this
          string will be placed in a single-element tuple at the front
          of the returned nested tuple.
  
      Returns
      -------
      func : callable
          A function that accepts numeric input (e.g. *int* or *float*)
          and returns a tuple containing the number with the leading string
          *sep*. Intended to be used as the *num_func* argument to
          *natsort_key*.
  
      See Also
      --------
      natsort_key
  
      """; 14, assignment; 15, function_name:func; 16, parameters; 17, block; 18, boolean_operator; 19, block; 20, elif_clause; 21, elif_clause; 22, else_clause; 23, identifier:nan_replace; 24, conditional_expression:float("+inf") if alg & ns.NANLAST else float("-inf"); 25, identifier:val; 26, default_parameter; 27, default_parameter; 28, expression_statement; 29, return_statement; 30, boolean_operator; 31, binary_operator:alg & ns.LOCALEALPHA; 32, return_statement; 33, boolean_operator; 34, block; 35, binary_operator:alg & ns.PATH; 36, block; 37, block; 38, call; 39, binary_operator:alg & ns.NANLAST; 40, call; 41, identifier:_nan_replace; 42, identifier:nan_replace; 43, identifier:_sep; 44, identifier:sep; 45, comment:"""Given a number, place it in a tuple with a leading null string."""; 46, expression_list; 47, binary_operator:alg & ns.PATH; 48, binary_operator:alg & ns.UNGROUPLETTERS; 49, identifier:alg; 50, attribute; 51, lambda; 52, binary_operator:alg & ns.UNGROUPLETTERS; 53, binary_operator:alg & ns.LOCALEALPHA; 54, return_statement; 55, identifier:alg; 56, attribute; 57, return_statement; 58, return_statement; 59, identifier:float; 60, argument_list; 61, identifier:alg; 62, attribute; 63, identifier:float; 64, argument_list; 65, identifier:_sep; 66, conditional_expression:_nan_replace if val != val else val; 67, identifier:alg; 68, attribute; 69, identifier:alg; 70, attribute; 71, identifier:ns; 72, identifier:LOCALEALPHA; 73, lambda_parameters; 74, tuple; 75, identifier:alg; 76, attribute; 77, identifier:alg; 78, attribute; 79, lambda; 80, identifier:ns; 81, identifier:PATH; 82, lambda; 83, identifier:func; 84, string:"+inf"; 85, identifier:ns; 86, identifier:NANLAST; 87, string:"-inf"; 88, identifier:_nan_replace; 89, comparison_operator:val != val; 90, identifier:val; 91, identifier:ns; 92, identifier:PATH; 93, identifier:ns; 94, identifier:UNGROUPLETTERS; 95, identifier:x; 96, tuple; 97, identifier:ns; 98, identifier:UNGROUPLETTERS; 99, identifier:ns; 100, identifier:LOCALEALPHA; 101, lambda_parameters; 102, tuple; 103, lambda_parameters; 104, tuple; 105, identifier:val; 106, identifier:val; 107, tuple; 108, call; 109, identifier:x; 110, tuple; 111, call; 112, identifier:x; 113, call; 114, identifier:pre_sep; 115, identifier:func; 116, argument_list; 117, identifier:pre_sep; 118, identifier:func; 119, argument_list; 120, identifier:func; 121, argument_list; 122, identifier:x; 123, identifier:x; 124, identifier:x
code: def parse_number_factory(alg, sep, pre_sep):
      """
      Create a function that will format a number into a tuple.
  
      Parameters
      ----------
      alg : ns enum
          Indicate how to format the *bytes*.
      sep : str
          The string character to be inserted before the number
          in the returned tuple.
      pre_sep : str
          In the event that *alg* contains ``UNGROUPLETTERS``, this
          string will be placed in a single-element tuple at the front
          of the returned nested tuple.
  
      Returns
      -------
      func : callable
          A function that accepts numeric input (e.g. *int* or *float*)
          and returns a tuple containing the number with the leading string
          *sep*. Intended to be used as the *num_func* argument to
          *natsort_key*.
  
      See Also
      --------
      natsort_key
  
      """
      nan_replace = float("+inf") if alg & ns.NANLAST else float("-inf")
  
      def func(val, _nan_replace=nan_replace, _sep=sep):
          """Given a number, place it in a tuple with a leading null string."""
          return _sep, _nan_replace if val != val else val
  
      # Return the function, possibly wrapping in tuple if PATH is selected.
      if alg & ns.PATH and alg & ns.UNGROUPLETTERS and alg & ns.LOCALEALPHA:
          return lambda x: (((pre_sep,), func(x)),)
      elif alg & ns.UNGROUPLETTERS and alg & ns.LOCALEALPHA:
          return lambda x: ((pre_sep,), func(x))
      elif alg & ns.PATH:
          return lambda x: (func(x),)
      else:
          return func