<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shape_from_str_tuple(sshape, variables, ignore=None):
 """ Substitutes string values in the supplied shape parameter with integer variables stored in a dictionary Parameters sshape : tuple/string composed of integers and strings. The strings should related to integral properties registered with this Solver object variables : dictionary Keys with associated integer values. Used to replace string values within the tuple ignore : list A list of tuple strings to ignore (4, 3) """

    if ignore is None: ignore = []

    if not isinstance(sshape, tuple) and not isinstance(sshape, list):
        raise TypeError, 'sshape argument must be a tuple or list'

    if not isinstance(ignore, list):
        raise TypeError, 'ignore argument must be a list'

    return tuple([int(eval_expr(v,variables)) if isinstance(v,str) else int(v)
        for v in sshape if v not in ignore])