code: def shape_from_str_tuple(sshape, variables, ignore=None):
      
      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])
docs: 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
  
      >>> print self.shape_from_str_tuple((4,'na','ntime'),ignore=['ntime'])
      (4, 3)