def _ToString(obj, *items):
  pkg = (obj.__module__[:obj.__module__.rfind('.') + 1]
         if '.' in obj.__module__ else '')
  clname = obj.__class__.__name__
  args = [('%s=r\'%s\'' % item if isinstance(item[1], basestring)
           else '%s=%s' % item) for item in items if item]
  return '%s%s(%s)' % (pkg, clname, ', '.join(args))
dataset/ETHPy150Open chromium/web-page-replay/rules/log_url.py/_ToString/original