<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_value(obj, name):
 """A flexible method for getting values from objects by name. returns: - obj is None: (False, None) - obj is dict: (name in obj, obj.get(name)) - obj hasattr(name):
 (True, getattr(obj, name)) - else: (False, None) :obj: the object to pull values from :name: the name to use when getting the value """

  if obj is None:
    return (False, None)
  elif isinstance(obj, dict):
    return (name in obj, obj.get(name))
  elif hasattr(obj, name):
    return (True, getattr(obj, name))
  elif hasattr(obj, "__getitem__") and hasattr(obj, "__contains__") and name in obj:
    return (True, obj[name])
  else:
    return (False, None)