code: def get_by_id(cls, id):
          
  
          if any((isinstance(id, basestring) and id.isdigit(), isinstance(id,
                 (int, float)))):
              return cls.query.get(int(id))
          return None
docs: Get model by identifier