MCPcopy Create free account
hub / github.com/aws/aws-cli / lazy_call

Function lazy_call

awscli/autocomplete/__init__.py:16–28  ·  view source on GitHub ↗

Import a callable and invoke it with the provided kwargs. :param import_name: A dotted string of the form ``package.module.Callable``. :type import_name: string :param kwargs: kwargs to pass to the callable once it's imported. :type kwargs: dict

(import_name, **kwargs)

Source from the content-addressed store, hash-verified

14
15
16def lazy_call(import_name, **kwargs):
17 """Import a callable and invoke it with the provided kwargs.
18
19 :param import_name: A dotted string of the form ``package.module.Callable``.
20 :type import_name: string
21 :param kwargs: kwargs to pass to the callable once it's imported.
22 :type kwargs: dict
23
24 """
25 module_name, callable_name = import_name.rsplit('.', 1)
26 __import__(module_name)
27 module = sys.modules[module_name]
28 return getattr(module, callable_name)(**kwargs)
29
30
31class LazyClientCreator:

Callers 1

create_sessionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected