def METHOD_NAME(self, identifier, attr_type, attr_data):
    for uid, attrs in self.users_info.items():
        for attr in attrs:
            if (attr_type == attr['attr_type'] and
                    attr_data == attr['attr_data']):
                return defer.succeed(uid)
    uid = self.nextId()
    self.db.insert_test_data([User(uid=uid, identifier=identifier)])
    self.db.insert_test_data([UserInfo(uid=uid,
                                     attr_type=attr_type,
                                     attr_data=attr_data)])
    return defer.succeed(uid)