<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fromTerm(cls, term):
 """Create an atom from a Term or term handle."""


        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)