def add(self, definition, allow_table_lock=False):
    "\n        :type definition: dict\n        :param allow_table_lock:\n            Allow an exclusive lock to be taken on the table while creating the indexes.\n            This will halt other user's requests until completed.\n\n            If false, creation will be slightly slower and cannot be done in a transaction.\n        :rtype: datacube.model.MetadataType\n        "
    MetadataType.validate(definition)
    name = definition['name']
    existing = self._db.get_metadata_type_by_name(name)
    if existing:
        check_doc_unchanged(existing.definition, definition, 'Metadata Type {}'.format(name))
    else:
        self._db.add_metadata_type(name=name, definition=definition, concurrently=(not allow_table_lock))
    return self.get_by_name(name)
:type definition: dict
:param allow_table_lock:
    Allow an exclusive lock to be taken on the table while creating the indexes.
    This will halt other user's requests until completed.

    If false, creation will be slightly slower and cannot be done in a transaction.
:rtype: datacube.model.MetadataType
def add(self, definition, allow_table_lock=False):
    "\n        :type definition: dict\n        :param allow_table_lock:\n            Allow an exclusive lock to be taken on the table while creating the indexes.\n            This will halt other user's requests until completed.\n\n            If false, creation will be slightly slower and cannot be done in a transaction.\n        :rtype: datacube.model.MetadataType\n        "
    MetadataType.validate(definition)
    name = definition['name']
    existing = self._db.get_metadata_type_by_name(name)
    if existing:
        check_doc_unchanged(existing.definition, definition, 'Metadata Type {}'.format(name))
    else:
        self._db.add_metadata_type(name=name, definition=definition, concurrently=(not allow_table_lock))
    return self.get_by_name(name)