code: def fromTerm(cls, term):
          
  
          if isinstance(term, Term):
              term = term.handle
          elif not isinstance(term, (c_void_p, int)):
              raise ArgumentTypeError((str(Term), str(c_void_p)), str(type(term)))
  
          a = atom_t()
          if PL_get_atom(term, byref(a)):
              return cls(a.value)
docs: Create an atom from a Term or term handle.