code: def dict_of(validate_key, validate_item):
      
      def validate(value, should_raise=True):
          validate_type = is_type(dict)
          if not validate_type(value, should_raise=should_raise):
              return False
  
          for key, item in value.items():
              try:
                  validate_key(key)
              except TypeError as e:
                  if should_raise:
                      samtranslator.model.exceptions.prepend(e, "dict contained an invalid key")
                      raise
                  return False
  
              try:
                  validate_item(item)
              except TypeError as e:
                  if should_raise:
                      samtranslator.model.exceptions.prepend(e, "dict contained an invalid value")
                      raise
                  return False
          return True
      return validate
docs: Returns a validator function that succeeds only if the input is a dict, and each key and value in the dict passes
      as input to the provided validators validate_key and validate_item, respectively.
  
      :param callable validate_key: the validator function for keys in the dict
      :param callable validate_item: the validator function for values in the list
      :returns: a function which returns True its input is an dict of valid items, and raises TypeError otherwise
      :rtype: callable