nodes: 0, module; 1, function_definition; 2, function_name:fast_float; 3, parameters; 4, block; 5, identifier:x; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, if_statement; 13, identifier:key; 14, lambda; 15, identifier:nan; 16, None; 17, identifier:_uni; 18, attribute; 19, identifier:_nan_inf; 20, identifier:NAN_INF; 21, identifier:_first_char; 22, identifier:POTENTIAL_FIRST_CHAR; 23, comment:"""
      Convert a string to a float quickly, return input as-is if not possible.
  
      We don't need to accept all input that the real fast_int accepts because
      natsort is controlling what is passed to this function.
  
      Parameters
      ----------
      x : str
          String to attempt to convert to a float.
      key : callable
          Single-argument function to apply to *x* if conversion fails.
      nan : object
          Value to return instead of NaN if NaN would be returned.
  
      Returns
      -------
      *str* or *float*
  
      """; 24, boolean_operator; 25, block; 26, else_clause; 27, lambda_parameters; 28, identifier:x; 29, identifier:unicodedata; 30, identifier:numeric; 31, comparison_operator:x[0] in _first_char; 32, comparison_operator:x.lstrip()[:3] in _nan_inf; 33, try_statement; 34, block; 35, identifier:x; 36, subscript; 37, identifier:_first_char; 38, subscript; 39, identifier:_nan_inf; 40, block; 41, except_clause; 42, try_statement; 43, identifier:x; 44, integer:0; 45, call; 46, slice; 47, expression_statement; 48, return_statement; 49, identifier:ValueError; 50, block; 51, block; 52, except_clause; 53, attribute; 54, argument_list; 55, integer:3; 56, assignment; 57, conditional_expression:nan if nan is not None and x != x else x; 58, try_statement; 59, return_statement; 60, identifier:TypeError; 61, comment:# pragma: no cover; 62, block; 63, identifier:x; 64, identifier:lstrip; 65, identifier:x; 66, call; 67, identifier:nan; 68, boolean_operator; 69, identifier:x; 70, block; 71, except_clause; 72, conditional_expression:_uni(x, key(x)) if len(x) == 1 else key(x); 73, return_statement; 74, identifier:float; 75, argument_list; 76, comparison_operator:nan is not None; 77, comparison_operator:x != x; 78, return_statement; 79, identifier:TypeError; 80, comment:# pragma: no cover; 81, block; 82, call; 83, comparison_operator:len(x) == 1; 84, call; 85, call; 86, identifier:x; 87, identifier:nan; 88, None; 89, identifier:x; 90, identifier:x; 91, conditional_expression:_uni(x, key(x)) if len(x) == 1 else key(x); 92, return_statement; 93, identifier:_uni; 94, argument_list; 95, call; 96, integer:1; 97, identifier:key; 98, argument_list; 99, identifier:key; 100, argument_list; 101, call; 102, comparison_operator:len(x) == 1; 103, call; 104, call; 105, identifier:x; 106, call; 107, identifier:len; 108, argument_list; 109, identifier:x; 110, identifier:x; 111, identifier:_uni; 112, argument_list; 113, call; 114, integer:1; 115, identifier:key; 116, argument_list; 117, identifier:key; 118, argument_list; 119, identifier:key; 120, argument_list; 121, identifier:x; 122, identifier:x; 123, call; 124, identifier:len; 125, argument_list; 126, identifier:x; 127, identifier:x; 128, identifier:x; 129, identifier:key; 130, argument_list; 131, identifier:x; 132, identifier:x
code: def fast_float(
      x,
      key=lambda x: x,
      nan=None,
      _uni=unicodedata.numeric,
      _nan_inf=NAN_INF,
      _first_char=POTENTIAL_FIRST_CHAR,
  ):
      """
      Convert a string to a float quickly, return input as-is if not possible.
  
      We don't need to accept all input that the real fast_int accepts because
      natsort is controlling what is passed to this function.
  
      Parameters
      ----------
      x : str
          String to attempt to convert to a float.
      key : callable
          Single-argument function to apply to *x* if conversion fails.
      nan : object
          Value to return instead of NaN if NaN would be returned.
  
      Returns
      -------
      *str* or *float*
  
      """
      if x[0] in _first_char or x.lstrip()[:3] in _nan_inf:
          try:
              x = float(x)
              return nan if nan is not None and x != x else x
          except ValueError:
              try:
                  return _uni(x, key(x)) if len(x) == 1 else key(x)
              except TypeError:  # pragma: no cover
                  return key(x)
      else:
          try:
              return _uni(x, key(x)) if len(x) == 1 else key(x)
          except TypeError:  # pragma: no cover
              return key(x)