<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def has_attr(cls, attr_name):
 """Check to see if an attribute is defined for the model."""

    if attr_name in cls.attrs:
      return True

    if isinstance(cls.primary_key_name, str) and cls.primary_key_name == attr_name:
      return True

    if isinstance(cls.primary_key_name, tuple) and attr_name in cls.primary_key_name:
      return True

    if cls.timestamps is not None and attr_name in cls.timestamps:
      return True

    return False