parameters: (to_sort, key=None)
return_statement: return sorted(to_sort, key=key_callback)
docstring: Returns a naturally sorted list
docstring_summary: Returns a naturally sorted list
docstring_tokens: Returns a naturally sorted list
function: def nsorted(to_sort, key=None):
      """Returns a naturally sorted list"""
      if key is None:
          key_callback = _natural_keys
      else:
          def key_callback(item):
              return _natural_keys(key(item))
  
      return sorted(to_sort, key=key_callback)
function_tokens: def nsorted ( to_sort , key = None ) : if key is None : key_callback = _natural_keys else : def key_callback ( item ) : return _natural_keys ( key ( item ) ) return sorted ( to_sort , key = key_callback )