MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / update_sig_from_node

Function update_sig_from_node

tools/boilerplate.py:439–463  ·  view source on GitHub ↗
(node, sig)

Source from the content-addressed store, hash-verified

437
438
439def update_sig_from_node(node, sig):
440 params = dict(sig.parameters)
441 args = node.args
442 allargs = (
443 *args.posonlyargs,
444 *args.args,
445 args.vararg,
446 *args.kwonlyargs,
447 args.kwarg,
448 )
449 for param in allargs:
450 if param is None:
451 continue
452 if param.annotation is None:
453 continue
454 annotation = direct_repr(ast.unparse(param.annotation))
455 params[param.arg] = params[param.arg].replace(annotation=annotation)
456
457 if node.returns is not None:
458 return inspect.Signature(
459 params.values(),
460 return_annotation=direct_repr(ast.unparse(node.returns))
461 )
462 else:
463 return inspect.Signature(params.values())
464
465
466if __name__ == '__main__':

Callers 1

get_matching_signatureFunction · 0.85

Calls 2

direct_reprClass · 0.85
valuesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…