def resolve(self, dependency):
        """
        Resolve dependency as instance attribute 
        of given class.

        >>> class Users:
        ...     db = injector.resolve(user_db)
        ...
        ...     def get_by_id(self, user_id):
        ...         return self.db.get(user_id)

                
        When the attribute is first accessed, it 
        will be resolved from the corresponding 
        dependency function
        """        
        if isinstance(dependency, str):
            name = dependency
        else:
            name = dependency._giveme_registered_name
            
        return DeferredProperty(
            partial(self.get, name)
        )
def resolve ( self , dependency ) : if isinstance ( dependency , str ) : name = dependency else : name = dependency . _giveme_registered_name return DeferredProperty ( partial ( self . get , name ) )
Resolve dependency as instance attribute 
        of given class.

        >>> class Users:
        ...     db = injector.resolve(user_db)
        ...
        ...     def get_by_id(self, user_id):
        ...         return self.db.get(user_id)

                
        When the attribute is first accessed, it 
        will be resolved from the corresponding 
        dependency function