<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_artifact_optional(chain, task_id, path):
 """Tells whether an artifact is flagged as optional or not. Args: chain (ChainOfTrust):
 the chain of trust object task_id (str):
 the id of the aforementioned task Returns: bool: True if artifact is optional """

    upstream_artifacts = chain.task['payload'].get('upstreamArtifacts', [])
    optional_artifacts_per_task_id = get_optional_artifacts_per_task_id(upstream_artifacts)
    return path in optional_artifacts_per_task_id.get(task_id, [])