def new_object_graph(
        modules=finding.ALL_IMPORTED_MODULES, classes=None, binding_specs=None,
        only_use_explicit_bindings=False, allow_injecting_none=False,
        configure_method_name='configure',
        dependencies_method_name='dependencies',
        get_arg_names_from_class_name=(
            bindings.default_get_arg_names_from_class_name),
        get_arg_names_from_provider_fn_name=(
            providing.default_get_arg_names_from_provider_fn_name),
        id_to_scope=None, is_scope_usable_from_scope=lambda _1, _2: True,
        use_short_stack_traces=True):
    try:
        if modules is not None and modules is not finding.ALL_IMPORTED_MODULES:
            _verify_types(modules, types.ModuleType, 'modules')
        if classes is not None:
            _verify_types(classes, types.TypeType, 'classes')
        if binding_specs is not None:
            _verify_subclasses(
                binding_specs, bindings.BindingSpec, 'binding_specs')
        if get_arg_names_from_class_name is not None:
            _verify_callable(get_arg_names_from_class_name,
                             'get_arg_names_from_class_name')
        if get_arg_names_from_provider_fn_name is not None:
            _verify_callable(get_arg_names_from_provider_fn_name,
                             'get_arg_names_from_provider_fn_name')
        if is_scope_usable_from_scope is not None:
            _verify_callable(is_scope_usable_from_scope,
                             'is_scope_usable_from_scope')
        injection_context_factory = injection_contexts.InjectionContextFactory(
            is_scope_usable_from_scope)
        id_to_scope = scoping.get_id_to_scope_with_defaults(id_to_scope)
        bindable_scopes = scoping.BindableScopes(id_to_scope)
        known_scope_ids = id_to_scope.keys()

        found_classes = finding.find_classes(modules, classes)
        if only_use_explicit_bindings:
            implicit_class_bindings = []
        else:
            implicit_class_bindings = bindings.get_implicit_class_bindings(
                found_classes, get_arg_names_from_class_name)
        explicit_bindings = bindings.get_explicit_class_bindings(
            found_classes, get_arg_names_from_class_name)
        binder = bindings.Binder(explicit_bindings, known_scope_ids)
        required_bindings = required_bindings_lib.RequiredBindings()
        if binding_specs is not None:
            binding_specs = list(binding_specs)
            processed_binding_specs = set()
            while binding_specs:
                binding_spec = binding_specs.pop()
                if binding_spec in processed_binding_specs:
                    continue
                processed_binding_specs.add(binding_spec)
                all_kwargs = {'bind': binder.bind,
                              'require': required_bindings.require}
                has_configure = hasattr(binding_spec, configure_method_name)
                if has_configure:
                    configure_method = getattr(binding_spec, configure_method_name)
                    configure_kwargs = _pare_to_present_args(
                        all_kwargs, configure_method)
                    if not configure_kwargs:
                        raise errors.ConfigureMethodMissingArgsError(
                            configure_method, all_kwargs.keys())
                    try:
                        configure_method(**configure_kwargs)
                    except NotImplementedError:
                        has_configure = False
                dependencies = None
                if hasattr(binding_spec, dependencies_method_name):
                    dependencies_method = (
                        getattr(binding_spec, dependencies_method_name))
                    dependencies = dependencies_method()
                    binding_specs.extend(dependencies)
                provider_bindings = bindings.get_provider_bindings(
                    binding_spec, known_scope_ids,
                    get_arg_names_from_provider_fn_name)
                explicit_bindings.extend(provider_bindings)
                if (not has_configure and
                    not dependencies and
                    not provider_bindings):
                    raise errors.EmptyBindingSpecError(binding_spec)
        binding_key_to_binding, collided_binding_key_to_bindings = (
            bindings.get_overall_binding_key_to_binding_maps(
                [implicit_class_bindings, explicit_bindings]))
        binding_mapping = bindings.BindingMapping(
            binding_key_to_binding, collided_binding_key_to_bindings)
        binding_mapping.verify_requirements(required_bindings.get())
    except errors.Error as e:
        if use_short_stack_traces:
            raise e
        else:
            raise

    is_injectable_fn = {True: decorators.is_explicitly_injectable,
                        False: (lambda cls: True)}[only_use_explicit_bindings]
    obj_provider = object_providers.ObjectProvider(
        binding_mapping, bindable_scopes, allow_injecting_none)
    return ObjectGraph(
        obj_provider, injection_context_factory, is_injectable_fn,
        use_short_stack_traces)
Generate the SHA-1 digest of specified file.
dataset/ETHPy150Open google/pinject/pinject/object_graph.py/new_object_graph--crossover with--dataset/ETHPy150Open XiaoMi/minos/client/deploy_utils.py/generate_checksum