def get_namespaces(line, separator):
    """Get all the namespaces defined in line based upon the provided separator."""

    namespaces = set()
    if len(line) > 0 and line not in namespaces:
        namespaces.add(line)

        parts = line.rsplit(separator, 1)
        while parts[0] not in namespaces:
            namespaces.add(parts[0])
            parts = parts[0].rsplit(separator, 1)

    return namespaces