sob/hooks.py
def write(model: Union[type, abc.Model], hooks: Optional[abc.Hooks]) -> None:
    """
    Write metadata to a class or instance
    """
    if hooks is not None:
        # Verify that the metadata is of the correct type
        hooks_type: type = type_(model)
        if not isinstance(hooks, hooks_type):
            raise ValueError(
                f"Hooks assigned to `{qualified_name(type(model))}` "
                f"must be of type `{qualified_name(hooks_type)}`"
            )
    setattr(model, "_hooks", hooks)

    Write metadata to a class or instance
    
Write metadata to a class or instance
Write metadata to a class or instance
def write(model: Union[type, abc.Model], hooks: Optional[abc.Hooks]) -> None:
    if hooks is not None:
        hooks_type: type = type_(model)
        if not isinstance(hooks, hooks_type):
            raise ValueError(
                f"Hooks assigned to `{qualified_name(type(model))}` "
                f"must be of type `{qualified_name(hooks_type)}`"
            )
    setattr(model, "_hooks", hooks)
def write ( model : Union [ type , abc . Model ] , hooks : Optional [ abc . Hooks ] ) -> None : if hooks is not None : hooks_type : type = type_ ( model ) if not isinstance ( hooks , hooks_type ) : raise ValueError ( f"Hooks assigned to `{qualified_name(type(model))}` " f"must be of type `{qualified_name(hooks_type)}`" ) setattr ( model , "_hooks" , hooks )
Write metadata to a class or instance
Write metadata to a class or instance
"""
    Write metadata to a class or instance
    """ # Verify that the metadata is of the correct type
model
Union[type, abc.Model]
hooks
Optional[abc.Hooks]