<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_str(cls, string):
 """ Creates a literal from a string Parameters string : str If the string starts with '!', it's interpreted as a negated variable Returns ------- caspo.core.literal.Literal Created object instance """

        if string[0] == '!':
            signature = -1
            variable = string[1:]
        else:
            signature = 1
            variable = string

        return cls(variable, signature)