@staticmethod
def from_path(root_key, path):
    p = HDKey.parse_path(path)
    if (p[0] == 'm'):
        if root_key.master:
            p = p[1:]
        else:
            raise ValueError("root_key must be a master key if 'm' is the first element of the path.")
    keys = [root_key]
    for i in p:
        if isinstance(i, str):
            hardened = (i[(- 1)] == "'")
            index = ((int(i[:(- 1)], 0) | 2147483648) if hardened else int(i, 0))
        else:
            index = i
        k = keys[(- 1)]
        klass = k.__class__
        keys.append(klass.from_parent(k, index))
    return keys
@staticmethod
def from_path(root_key, path):
    p = HDKey.parse_path(path)
    if (p[0] == 'm'):
        if root_key.master:
            p = p[1:]
        else:
            raise ValueError("root_key must be a master key if 'm' is the first element of the path.")
    keys = [root_key]
    for i in p:
        if isinstance(i, str):
            hardened = (i[(- 1)] == "'")
            index = ((int(i[:(- 1)], 0) | 2147483648) if hardened else int(i, 0))
        else:
            index = i
        k = keys[(- 1)]
        klass = k.__class__
        keys.append(klass.from_parent(k, index))
    return keys