def validate_options(options):
  if not options:
    return

  for k, v in options.iteritems():
    if not isinstance(k, str):
      raise TypeError('option %r should be a str.' % k)
    if not any(k.startswith(valid) for valid in _CS_OPTIONS):
      raise ValueError('option %s is not supported.' % k)
    if not isinstance(v, basestring):
      raise TypeError('value %r for option %s should be of type basestring.' %
                      v, k)
Validate Cloud Storage options.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/cloudstorage/common.py/validate_options