<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _list_tables_model(self, prefix='', project=None):
 """ List all TablesModel in the given project. :param prefix: model prefix :param str project: project name, if you want to look up in another project :rtype: list[str] """

    tset = set()

    if prefix.startswith(TEMP_TABLE_PREFIX):
        prefix = TEMP_TABLE_MODEL_PREFIX + prefix[len(TEMP_TABLE_PREFIX):]
        it = self.list_tables(project=project, prefix=prefix)
    else:
        it = self.list_tables(project=project, prefix=TABLE_MODEL_PREFIX + prefix)
        if TEMP_TABLE_PREFIX.startswith(prefix):
            new_iter = self.list_tables(project=project, prefix=TEMP_TABLE_MODEL_PREFIX)
            it = itertools.chain(it, new_iter)

    for table in it:
        if TABLE_MODEL_SEPARATOR not in table.name:
            continue
        if not table.name.startswith(TEMP_TABLE_MODEL_PREFIX) and not table.name.startswith(TABLE_MODEL_PREFIX):
            continue
        model_name, _ = table.name.rsplit(TABLE_MODEL_SEPARATOR, 1)
        if model_name.startswith(TEMP_TABLE_MODEL_PREFIX):
            model_name = TEMP_TABLE_PREFIX + model_name[len(TEMP_TABLE_MODEL_PREFIX):]
        else:
            model_name = model_name[len(TABLE_MODEL_PREFIX):]
        if model_name not in tset:
            tset.add(model_name)
            yield TablesModelObject(_odps=self, name=model_name, project=project)