code: def has_value(key):
      '''
      Determine whether a named value exists in the grains dictionary.
  
      Given a grains dictionary that contains the following structure::
  
          {'pkg': {'apache': 'httpd'}}
  
      One would determine if the apache key in the pkg dict exists by::
  
          pkg:apache
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' grains.has_value pkg:apache
      '''
      return True \
          if salt.utils.data.traverse_dict_and_list(__grains__, key, False) \
          else Falsf has_value(key):
      '''
      Determine whether a named value exists in the grains dictionary.
  
      Given a grains dictionary that contains the following structure::
  
          {'pkg': {'apache': 'httpd'}}
  
      One would determine if the apache key in the pkg dict exists by::
  
          pkg:apache
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' grains.has_value pkg:apache
      '''
      return True \
          if salt.utils.data.traverse_dict_and_list(__grains__, key, False) \
          else False
docs: Determine whether a named value exists in the grains dictionary.
  
      Given a grains dictionary that contains the following structure::
  
          {'pkg': {'apache': 'httpd'}}
  
      One would determine if the apache key in the pkg dict exists by::
  
          pkg:apache
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' grains.has_value pkg:apache