

def get_by_id(self, obj_id, only_local=False):
    '\n        Finds and returns the object based on its id.\n        '
    for obj in self.state[getter.state_name]:
        if ((obj['id'] == obj_id) or (obj.temp_id == str(obj_id))):
            return obj
    if (not only_local):
        getter = getattr(self.api, ('get_%s' % self.object_type))
        return getter(obj_id)
    return None

dataset/ETHPy150Open Doist/todoist-python/todoist/managers/generic.py GetByIdMixin.get_by_id/VarMisuse@25/55 `self`->`getter`