docs: def is_filelike(obj):
      """Filename or file object?
      """
      if isinstance(obj, (bytes, unicode)):
          return False
      res = True
      for a in ('read', 'tell', 'seek'):
          res = res and hasattr(obj, a)
      if not res:
          raise ValueError("Invalid object passed as file")
      return True