def namespace(ns_key):
if ns_key not in __NAMESPACE__:<EOL><INDENT>raise NamespaceError('<STR_LIT>'.format(ns_key))<EOL><DEDENT>sch = copy.deepcopy(JAMS_SCHEMA['<STR_LIT>']['<STR_LIT>'])<EOL>for key in ['<STR_LIT:value>', '<STR_LIT>']:<EOL><INDENT>try:<EOL><INDENT>sch['<STR_LIT>'][key] = __NAMESPACE__[ns_key][key]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return sch<EOL>
Construct a validation schema for a given namespace.

    Parameters
    ----------
    ns_key : str
        Namespace key identifier (eg, 'beat' or 'segment_tut')

    Returns
    -------
    schema : dict
        JSON schema of `namespace`