code: def is_valid_resource_id(rid, exception_type=None):
      
      is_valid = False
      try:
          is_valid = rid and resource_id(**parse_resource_id(rid)).lower() == rid.lower()
      except KeyError:
          pass
      if not is_valid and exception_type:
          raise exception_type()
      return is_valid
docs: Validates the given resource id.
  
      :param rid: The resource id being validated.
      :type rid: str
      :param exception_type: Raises this Exception if invalid.
      :type exception_type: :class:`Exception`
      :returns: A boolean describing whether the id is valid.
      :rtype: bool