<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_codes(s: Union[str, 'ChainedBase']) -> List[str]: """ Grab all escape codes from a string. Returns a list of all escape codes. """

    return codegrabpat.findall(str(s))