code: def _validate_type_key(key, value, types, validated):
      
      for key_schema, value_schema in types.items():
          if not isinstance(key, key_schema):
              continue
          try:
              validated[key] = value_schema(value)
          except NotValid:
              continue
          else:
              return []
  
      return ['%r: %r not matched' % (key, value)]
docs: Validate a key's value by type.