sob/meta.py
def copy_to(source: abc.Model, target: abc.Model) -> None:
    """
    This function copies metadata from one model instance to another
    """
    # Verify both arguments are models
    argument_name: str
    value: MarshallableTypes
    target_value: MarshallableTypes
    argument_value: abc.Model
    for argument_name, argument_value in (
        ("source", source),
        ("target", target),
    ):
        assert_is_instance(argument_name, argument_value, abc.Model)
    # Verify both arguments are of of the same `type`
    assert type(source) is type(target)
    # Copy the metadata
    source_meta: Optional[abc.Meta] = read(source)
    target_meta: Optional[abc.Meta] = read(target)
    if source_meta is not target_meta:
        write(target, source_meta)
    # ... and recursively do the same for member data
    if isinstance(source_meta, abc.ObjectMeta) and (
        source_meta.properties is not None
    ):
        assert isinstance(source, abc.Object)
        assert isinstance(target, abc.Object)
        _copy_object_to(source, target)
    elif isinstance(source, abc.Array):
        assert isinstance(target, abc.Array)
        _copy_array_to(source, target)
    elif isinstance(source, abc.Dictionary):
        assert isinstance(target, abc.Dictionary)
        _copy_dictionary_to(source, target)

    This function copies metadata from one model instance to another
    
This function copies metadata from one model instance to another
This function copies metadata from one model instance to another
def copy_to(source: abc.Model, target: abc.Model) -> None:
    argument_name: str
    value: MarshallableTypes
    target_value: MarshallableTypes
    argument_value: abc.Model
    for argument_name, argument_value in (
        ("source", source),
        ("target", target),
    ):
        assert_is_instance(argument_name, argument_value, abc.Model)
    assert type(source) is type(target)
    source_meta: Optional[abc.Meta] = read(source)
    target_meta: Optional[abc.Meta] = read(target)
    if source_meta is not target_meta:
        write(target, source_meta)
    if isinstance(source_meta, abc.ObjectMeta) and (
        source_meta.properties is not None
    ):
        assert isinstance(source, abc.Object)
        assert isinstance(target, abc.Object)
        _copy_object_to(source, target)
    elif isinstance(source, abc.Array):
        assert isinstance(target, abc.Array)
        _copy_array_to(source, target)
    elif isinstance(source, abc.Dictionary):
        assert isinstance(target, abc.Dictionary)
        _copy_dictionary_to(source, target)
def copy_to ( source : abc . Model , target : abc . Model ) -> None : argument_name : str value : MarshallableTypes target_value : MarshallableTypes argument_value : abc . Model for argument_name , argument_value in ( ( "source" , source ) , ( "target" , target ) , ) : assert_is_instance ( argument_name , argument_value , abc . Model ) assert type ( source ) is type ( target ) source_meta : Optional [ abc . Meta ] = read ( source ) target_meta : Optional [ abc . Meta ] = read ( target ) if source_meta is not target_meta : write ( target , source_meta ) if isinstance ( source_meta , abc . ObjectMeta ) and ( source_meta . properties is not None ) : assert isinstance ( source , abc . Object ) assert isinstance ( target , abc . Object ) _copy_object_to ( source , target ) elif isinstance ( source , abc . Array ) : assert isinstance ( target , abc . Array ) _copy_array_to ( source , target ) elif isinstance ( source , abc . Dictionary ) : assert isinstance ( target , abc . Dictionary ) _copy_dictionary_to ( source , target )
This function copies metadata from one model instance to another
This function copies metadata from one model instance to another
"""
    This function copies metadata from one model instance to another
    """ # Verify both arguments are models # Verify both arguments are of of the same `type` # Copy the metadata # ... and recursively do the same for member data
source
abc.Model
target
abc.Model