code: def is_tarfile(name):
      
      try:
          t = open(name)
          t.close()
          return True
      except TarError:
          return False
docs: Return True if name points to a tar archive that we
         are able to handle, else return False.