code: def convert_keyword_arguments(function, args, kwargs):
      """Returns a pair of a tuple and a dictionary which would be equivalent
      passed as positional and keyword args to the function. Unless function has.
  
      **kwargs the dictionary will always be empty.
      """
      argspec = getfullargspec(function)
      new_args = []
      kwargs = dict(kwargs)
  
      defaults = dict(argspec.kwonlydefaults or {})
  
      if argspec.defaults:
          for name, value in zip(
              argspec.args[-len(argspec.defaults) :], argspec.defaults
          ):
              defaults[name] = value
  
      n = max(len(args), len(argspec.args))
  
      for i in hrange(n):
          if i < len(args):
              new_args.append(args[i])
          else:
              arg_name = argspec.args[i]
              if arg_name in kwargs:
                  new_args.append(kwargs.pop(arg_name))
              elif arg_name in defaults:
                  new_args.append(defaults[arg_name])
              else:
                  raise TypeError(
                      "No value provided for argument %r" % (arg_name)
                  )
  
      if kwargs and not (argspec.varkw or argspec.kwonlyargs):
          if len(kwargs) > 1:
              raise TypeError(
                  "%s() got unexpected keyword arguments %s"
                  % (function.__name__, ", ".join(map(repr, kwargs)))
              )
          else:
              bad_kwarg = next(iter(kwargs))
              raise TypeError(
                  "%s() got an unexpected keyword argument %r"
                  % (function.__name__, bad_kwarg)
              )
      return tuple(new_args), kwargs
  
imports: from __future__ import absolute_import, division, print_function
  import ast
  import hashlib
  import inspect
  import re
  import types
  from functools import wraps
  from types import ModuleType
  from hypothesis.internal.compat import ARG_NAME_ATTRIBUTE, PY2, getfullargspec, hrange, isidentifier, qualname, str_to_bytes, to_str, to_unicode, update_code_location
  from hypothesis.vendor.pretty import pretty
label_desc: Use image node_id 6 for calling a global function with example usage: convert_keyword_arguments(function, args, kwargs) and returns: tuple,  kwargs