MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / bind_args

Function bind_args

pythonwhat/checks/check_function.py:10–20  ·  view source on GitHub ↗
(signature, args_part)

Source from the content-addressed store, hash-verified

8
9
10def bind_args(signature, args_part):
11 pos_args = []
12 kw_args = {}
13 for k, arg in args_part.items():
14 if isinstance(k, int):
15 pos_args.append(arg)
16 else:
17 kw_args[k] = arg
18
19 bound_args = signature.bind(*pos_args, **kw_args)
20 return IndexedDict(bound_args.arguments)
21
22
23def get_mapped_name(name, mappings):

Callers 2

test_bind_argsFunction · 0.90
check_functionFunction · 0.85

Calls 1

IndexedDictClass · 0.90

Tested by 1

test_bind_argsFunction · 0.72