<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def strip_py(arg):
 # type: (str) -> Optional[str] """Strip a trailing .py or .pyi suffix. Return None if no such suffix is found. """

    for ext in PY_EXTENSIONS:
        if arg.endswith(ext):
            return arg[:-len(ext)]
    return None