nodes: 0, module; 1, function_definition; 2, function_name:fast_int; 3, parameters; 4, block; 5, identifier:x; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, identifier:key; 12, lambda; 13, identifier:_uni; 14, attribute; 15, identifier:_first_char; 16, identifier:POTENTIAL_FIRST_CHAR; 17, comment:"""
      Convert a string to a int 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 an int.
      key : callable
          Single-argument function to apply to *x* if conversion fails.
  
      Returns
      -------
      *str* or *int*
  
      """; 18, comparison_operator:x[0] in _first_char; 19, block; 20, else_clause; 21, lambda_parameters; 22, identifier:x; 23, identifier:unicodedata; 24, identifier:digit; 25, subscript; 26, identifier:_first_char; 27, try_statement; 28, block; 29, identifier:x; 30, identifier:x; 31, integer:0; 32, block; 33, except_clause; 34, try_statement; 35, return_statement; 36, identifier:ValueError; 37, block; 38, block; 39, except_clause; 40, call; 41, try_statement; 42, return_statement; 43, identifier:TypeError; 44, comment:# pragma: no cover; 45, block; 46, identifier:long; 47, argument_list; 48, block; 49, except_clause; 50, conditional_expression:_uni(x, key(x)) if len(x) == 1 else key(x); 51, return_statement; 52, identifier:x; 53, return_statement; 54, identifier:TypeError; 55, comment:# pragma: no cover; 56, block; 57, call; 58, comparison_operator:len(x) == 1; 59, call; 60, call; 61, conditional_expression:_uni(x, key(x)) if len(x) == 1 else key(x); 62, return_statement; 63, identifier:_uni; 64, argument_list; 65, call; 66, integer:1; 67, identifier:key; 68, argument_list; 69, identifier:key; 70, argument_list; 71, call; 72, comparison_operator:len(x) == 1; 73, call; 74, call; 75, identifier:x; 76, call; 77, identifier:len; 78, argument_list; 79, identifier:x; 80, identifier:x; 81, identifier:_uni; 82, argument_list; 83, call; 84, integer:1; 85, identifier:key; 86, argument_list; 87, identifier:key; 88, argument_list; 89, identifier:key; 90, argument_list; 91, identifier:x; 92, identifier:x; 93, call; 94, identifier:len; 95, argument_list; 96, identifier:x; 97, identifier:x; 98, identifier:x; 99, identifier:key; 100, argument_list; 101, identifier:x; 102, identifier:x
code: def fast_int(
      x,
      key=lambda x: x,
      _uni=unicodedata.digit,
      _first_char=POTENTIAL_FIRST_CHAR,
  ):
      """
      Convert a string to a int 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 an int.
      key : callable
          Single-argument function to apply to *x* if conversion fails.
  
      Returns
      -------
      *str* or *int*
  
      """
      if x[0] in _first_char:
          try:
              return long(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)