docs: def read_tree_nexus(nexus):
      '''Read a tree from a Nexus string or file
  
      Args:
          ``nexus`` (``str``): Either a Nexus string or the path to a Nexus file (plain-text or gzipped)
  
      Returns:
          ``dict`` of ``Tree``: A dictionary of the trees represented by ``nexus``, where keys are tree names (``str``) and values are ``Tree`` objects
      '''
      if not isinstance(nexus, str):
          raise TypeError("nexus must be a str")
      if nexus.lower().endswith('.gz'): # gzipped file
          f = gopen(expanduser(nexus))
      elif isfile(expanduser(nexus)): # plain-text file
          f = open(expanduser(nexus))
      else:
          f = nexus.splitlines()
      trees = dict()
      for line in f:
          if isinstance(line,bytes):
              l = line.decode().strip()
          else:
              l = line.strip()
          if l.lower().startswith('tree '):
              i = l.index('='); left = l[:i].strip(); right = l[i+1:].strip()
              name = ' '.join(left.split(' ')[1:])
              trees[name] = read_tree_newick(right)
      if hasattr(f,'close'):
          f.close()
      return trees