code: def _check_required_fields(self, fields=None, either_fields=None):
          ''' Check the values of the fields
  
          If no value found in `fields`, an exception will be raised.
          `either_fields` are the fields that one of them must have a value
  
          Raises:
              HSException: If no value found in at least one item of`fields`, or
                  no value found in one of the items of `either_fields`
  
          Returns:
              None
  
          '''
  
          for (key, value) in fields.items():
              # If value is a dict, one of the fields in the dict is required ->
              # exception if all are None
              if not value:
                  raise HSException("Field '%s' is required." % key)
          if either_fields is not None:
              for field in either_fields:
                  if not any(field.values()):
                      raise HSException("One of the following fields is required: %s" % ", ".join(field.keys())f _check_required_fields(self, fields=None, either_fields=None):
          ''' Check the values of the fields
  
          If no value found in `fields`, an exception will be raised.
          `either_fields` are the fields that one of them must have a value
  
          Raises:
              HSException: If no value found in at least one item of`fields`, or
                  no value found in one of the items of `either_fields`
  
          Returns:
              None
  
          '''
  
          for (key, value) in fields.items():
              # If value is a dict, one of the fields in the dict is required ->
              # exception if all are None
              if not value:
                  raise HSException("Field '%s' is required." % key)
          if either_fields is not None:
              for field in either_fields:
                  if not any(field.values()):
                      raise HSException("One of the following fields is required: %s" % ", ".join(field.keys()))
docs: Check the values of the fields
  
          If no value found in `fields`, an exception will be raised.
          `either_fields` are the fields that one of them must have a value
  
          Raises:
              HSException: If no value found in at least one item of`fields`, or
                  no value found in one of the items of `either_fields`
  
          Returns:
              None