<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def inspect_to_metadata(metadata_object, inspect_data):
 """ process data from `docker inspect` and update provided metadata object :param metadata_object: instance of Metadata :param inspect_data: dict, metadata from `docker inspect` or `dockert_client.images()` :return: instance of Metadata """

    identifier = graceful_get(inspect_data, 'Id')
    if identifier:
        if ":" in identifier:
            # format of image name from docker inspect:
            # sha256:8f0e66c924c0c169352de487a3c2463d82da24e9442fc097dddaa5f800df7129
            metadata_object.identifier = identifier.split(':')[1]
        else:
            # container
            metadata_object.identifier = identifier

    # format of Environment Variables from docker inspect:
    # ['DISTTAG=f26container', 'FGC=f26']
    raw_env_vars = graceful_get(inspect_data, "Config", "Env") or []
    if raw_env_vars:
        metadata_object.env_variables = {}
        for env_variable in raw_env_vars:
            splits = env_variable.split("=", 1)
            name = splits[0]
            value = splits[1] if len(splits) > 1 else None
            if value is not None:
                metadata_object.env_variables.update({name: value})

    raw_exposed_ports = graceful_get(inspect_data, "Config", "ExposedPorts")
    if raw_exposed_ports:
        metadata_object.exposed_ports = list(raw_exposed_ports.keys())

    # specific to images
    raw_repo_tags = graceful_get(inspect_data, 'RepoTags')
    if raw_repo_tags:
        metadata_object.name = raw_repo_tags[0]
    metadata_object.labels = graceful_get(inspect_data, 'Config', 'Labels')
    metadata_object.command = graceful_get(inspect_data, 'Config', 'Cmd')
    metadata_object.creation_timestamp = inspect_data.get('Created', None)
    # specific to images
    metadata_object.image_names = inspect_data.get('RepoTags', None)
    # specific to images
    digests = inspect_data.get("RepoDigests", None)
    if digests:
        metadata_object.repo_digests = digests
        metadata_object.digest = digests[0]

    return metadata_object