def get_user_from_topic(s):
  """Extracts the username from a topic or Stream object.

  Topics look like: 'stream/bar@example.com/comments'

  Returns:
    A string, the username, or None if the topic name didn't appear to contain a
    valid userid.
  """
  o = None
  # Check whether we got a topic name or a Stream instance
  if not (isinstance(s, str) or isinstance(s, unicode)):
    s = s.key().name()
  list = s.split('/')
  try:
    email = list[1]
    if '@' in email:
      o = email
  except __HOLE__:   # No '/' in s.
    pass
  return o
dataset/ETHPy150Open CollabQ/CollabQ/common/util.py/get_user_from_topic