def check_blacklist(host, port, path):
  """
  Return true if this host:port path combo is allowed to be proxied.
  """
  blacklist = conf.BLACKLIST.get()
  if not blacklist:
    return True

  # Make a canonical path, since "/forbidden//path" (string) does not match
  # "/forbidden/path" (regex).
  has_trailing_slash = path.endswith('/')
  path_elems = path.split('/')
  path_elems = [ p for p in path_elems if p ]
  canon_url = (host, port, '/'.join(path_elems)) % "%s:%s/%s"
  if has_trailing_slash:
    canon_url += '/'

  for regexp in blacklist:
    if regexp.match(canon_url):
      return False
  return True
dataset/ETHPy150Open cloudera/hue/apps/proxy/src/proxy/views.py/check_blacklist/swapped operands of `%`