def _set_artifact_properties(artifact: types.Artifact, properties: Optional[Dict[(str, Any)]], custom_properties: Optional[Dict[(str, Any)]]):
    'Sets properties and custom_properties to the given artifact.'
    if (properties is not None):
        for (key, value) in properties.items():
            setattr(artifact, key, value)
    if (custom_properties is not None):
        for (key, value) in custom_properties.items():
            if isinstance(value, int):
                artifact.set_int_custom_property(key, value)
            elif isinstance(value, (str, bytes)):
                artifact.set_string_custom_property(key, value)
            else:
                raise NotImplementedError(f'Unexpected custom_property value type:{type(value)}')
Sets properties and custom_properties to the given artifact.
def _set_artifact_properties(artifact: types.Artifact, properties: Optional[Dict[(str, Any)]], custom_properties: Optional[Dict[(str, Any)]]):
    
    if (properties is not None):
        for (key, value) in properties.items():
            setattr(artifact, key, value)
    if (custom_properties is not None):
        for (key, value) in custom_properties.items():
            if isinstance(value, int):
                artifact.set_int_custom_property(key, value)
            elif isinstance(value, (str, bytes)):
                artifact.set_string_custom_property(key, value)
            else:
                raise NotImplementedError(f'Unexpected custom_property value type:{type(value)}')