<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_path(cls, *path, namespace=None):
 """Build up a Datastore key from a path. Parameters: \*path(tuple[str or int]):
 The path segments. namespace(str):
 An optional namespace for the key. This is applied to each key in the tree. Returns: anom.Key: The Datastore represented by the given path. """

        parent = None
        for i in range(0, len(path), 2):
            parent = cls(*path[i:i + 2], parent=parent, namespace=namespace)

        return parent