def write_bel_namespace(self, file: TextIO, use_names: bool = False) -> None:
if not self.is_populated():<EOL><INDENT>self.populate()<EOL><DEDENT>if use_names and not self.has_names:<EOL><INDENT>raise ValueError<EOL><DEDENT>values = (<EOL>self._get_namespace_name_to_encoding(desc='<STR_LIT>')<EOL>if use_names else<EOL>self._get_namespace_identifier_to_encoding(desc='<STR_LIT>')<EOL>)<EOL>write_namespace(<EOL>namespace_name=self._get_namespace_name(),<EOL>namespace_keyword=self._get_namespace_keyword(),<EOL>namespace_query_url=self.identifiers_url,<EOL>values=values,<EOL>file=file,<EOL>)<EOL>
Write as a BEL namespace file.