code: def is_tainted(variable, context, only_unprotected=False, ignore_generic_taint=False):
      '''
          Args:
          variable
          context (Contract|Function)
          only_unprotected (bool): True only unprotected function are considered
      Returns:
          bool
      '''
      assert isinstance(context, (Contract, Function))
      assert isinstance(only_unprotected, bool)
      if isinstance(variable, Constant):
          return False
      slither = context.slither
      taints = slither.context[KEY_INPUT]
      if not ignore_generic_taint:
          taints |= GENERIC_TAINT
      return variable in taints or any(is_dependent(variable, t, context, only_unprotected) for t in taintsf is_tainted(variable, context, only_unprotected=False, ignore_generic_taint=False):
      '''
          Args:
          variable
          context (Contract|Function)
          only_unprotected (bool): True only unprotected function are considered
      Returns:
          bool
      '''
      assert isinstance(context, (Contract, Function))
      assert isinstance(only_unprotected, bool)
      if isinstance(variable, Constant):
          return False
      slither = context.slither
      taints = slither.context[KEY_INPUT]
      if not ignore_generic_taint:
          taints |= GENERIC_TAINT
      return variable in taints or any(is_dependent(variable, t, context, only_unprotected) for t in taints)
docs: Args:
          variable
          context (Contract|Function)
          only_unprotected (bool): True only unprotected function are considered
      Returns:
          bool