MCPcopy Create free account
hub / github.com/python-hyper/uritemplate / partial

Function partial

uritemplate/api.py:47–67  ·  view source on GitHub ↗

Partially expand the template with the given parameters. If all of the parameters for the template are not given, return a partially expanded template. :param dict var_dict: Optional dictionary with variables and values :param kwargs: Alternative way to pass arguments :returns:

(
    uri: str,
    var_dict: t.Optional[variable.VariableValueDict] = None,
    **kwargs: variable.VariableValue,
)

Source from the content-addressed store, hash-verified

45
46
47def partial(
48 uri: str,
49 var_dict: t.Optional[variable.VariableValueDict] = None,
50 **kwargs: variable.VariableValue,
51) -> URITemplate:
52 """Partially expand the template with the given parameters.
53
54 If all of the parameters for the template are not given, return a
55 partially expanded template.
56
57 :param dict var_dict: Optional dictionary with variables and values
58 :param kwargs: Alternative way to pass arguments
59 :returns: :class:`URITemplate`
60
61 Example::
62
63 t = URITemplate('https://api.github.com{/end}')
64 t.partial() # => URITemplate('https://api.github.com{/end}')
65
66 """
67 return URITemplate(uri).partial(var_dict, **kwargs)
68
69
70def variables(uri: str) -> OrderedSet:

Callers 1

test_partialMethod · 0.90

Calls 2

URITemplateClass · 0.90
partialMethod · 0.80

Tested by 1

test_partialMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…