def node_namespace(node):
    """
    Return the namespace of the given node
    Example:
        input: "namespace:nodename"  | output: "namespace"
        input: "|parent|nodemane"    | output: None
        intput "|parent|ns:nodename" | output: "ns"
    :param str node: Maya node name
    :rtype: str|None
    """
    basename = node.split("|")[-1]
    if ":" not in node:
        return None
    return basename.split(":")[0]