@utilities.arguments_not_none<EOL><INDENT>def create_hierarchy(self, hierarchy_form):<DEDENT>
<EOL>if self._catalog_session is not None:<EOL><INDENT>return self._catalog_session.create_catalog(catalog_form=hierarchy_form)<EOL><DEDENT>collection = JSONClientValidated('<STR_LIT>',<EOL>collection='<STR_LIT>',<EOL>runtime=self._runtime)<EOL>if not isinstance(hierarchy_form, ABCHierarchyForm):<EOL><INDENT>raise errors.InvalidArgument('<STR_LIT>')<EOL><DEDENT>if hierarchy_form.is_for_update():<EOL><INDENT>raise errors.InvalidArgument('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>if self._forms[hierarchy_form.get_id().get_identifier()] == CREATED:<EOL><INDENT>raise errors.IllegalState('<STR_LIT>')<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>raise errors.Unsupported('<STR_LIT>')<EOL><DEDENT>if not hierarchy_form.is_valid():<EOL><INDENT>raise errors.InvalidArgument('<STR_LIT>')<EOL><DEDENT>insert_result = collection.insert_one(hierarchy_form._my_map)<EOL>self._forms[hierarchy_form.get_id().get_identifier()] = CREATED<EOL>result = objects.Hierarchy(<EOL>osid_object_map=collection.find_one({'<STR_LIT>': insert_result.inserted_id}),<EOL>runtime=self._runtime,<EOL>proxy=self._proxy)<EOL>return result<EOL>
Creates a new ``Hierarchy``.

        arg:    hierarchy_form (osid.hierarchy.HierarchyForm): the form
                for this ``Hierarchy``
        return: (osid.hierarchy.Hierarchy) - the new ``Hierarchy``
        raise:  IllegalState - ``hierarchy_form`` already used in a
                create transaction
        raise:  InvalidArgument - one or more of the form elements is
                invalid
        raise:  NullArgument - ``hierarchy_form`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  PermissionDenied - authorization failure
        raise:  Unsupported - ``hierarchy_form`` did not originate from
                ``get_hierarchy_form_for_create()``
        *compliance: mandatory -- This method must be implemented.*