<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _CollectArguments(function, args, kwargs):
 """Merges positional and keyword arguments into a single dict."""

  all_args = dict(kwargs)
  arg_names = inspect.getargspec(function)[0]
  for position, arg in enumerate(args):
    if position < len(arg_names):
      all_args[arg_names[position]] = arg
  return all_args