nodes: 0, module; 1, function_definition; 2, function_name:sort_kwargs; 3, parameters; 4, block; 5, identifier:kwargs; 6, list_splat_pattern; 7, expression_statement; 8, return_statement; 9, identifier:param_lists; 10, comment:"""Function to sort keyword arguments and sort them into dictionaries
  
      This function returns dictionaries that contain the keyword arguments
      from `kwargs` corresponding given iterables in ``*params``
  
      Parameters
      ----------
      kwargs: dict
          Original dictionary
      ``*param_lists``
          iterables of strings, each standing for a possible key in kwargs
  
      Returns
      -------
      list
          len(params) + 1 dictionaries. Each dictionary contains the items of
          `kwargs` corresponding to the specified list in ``*param_lists``. The
          last dictionary contains the remaining items"""; 11, call; 12, identifier:chain; 13, argument_list; 14, generator_expression; 15, list; 16, dictionary_comprehension; 17, for_in_clause; 18, identifier:kwargs; 19, pair; 20, for_in_clause; 21, identifier:params; 22, call; 23, identifier:key; 24, call; 25, identifier:key; 26, call; 27, identifier:map; 28, argument_list; 29, attribute; 30, argument_list; 31, attribute; 32, argument_list; 33, identifier:set; 34, identifier:param_lists; 35, identifier:kwargs; 36, identifier:pop; 37, identifier:key; 38, identifier:params; 39, identifier:intersection; 40, identifier:kwargs
code: def sort_kwargs(kwargs, *param_lists):
      """Function to sort keyword arguments and sort them into dictionaries
  
      This function returns dictionaries that contain the keyword arguments
      from `kwargs` corresponding given iterables in ``*params``
  
      Parameters
      ----------
      kwargs: dict
          Original dictionary
      ``*param_lists``
          iterables of strings, each standing for a possible key in kwargs
  
      Returns
      -------
      list
          len(params) + 1 dictionaries. Each dictionary contains the items of
          `kwargs` corresponding to the specified list in ``*param_lists``. The
          last dictionary contains the remaining items"""
      return chain(
          ({key: kwargs.pop(key) for key in params.intersection(kwargs)}
           for params in map(set, param_lists)), [kwargs])