class_docstr: Track side effects (list mutation, setattr, etc) that need to be
  applied after an FX graph is run.
class_docstr_tok: ["Track","side","effects","(","list","mutation",",","setattr",",","etc",")","that","need","to","be","applied","after","an","FX","graph","is","run","."]
code: def check_allowed_side_effect(self, item):
      from torch._dynamo.variables.misc import (
          AutogradFunctionContextVariable,
      )
  
      # People do things like self.dim = dim inside autograd.Function.
      # These are benign.
      if isinstance(item, AutogradFunctionContextVariable):
          return True
      if not is_side_effect_safe(item.mutable_local):
          unimplemented(
              "HigherOrderOperator: Mutating a variable not in the current scope (SideEffects)"
          )
  
imports: import inspect
  from typing import Any, Dict, List, Optional, Union
  import torch.nn
  from .None import utils, variables
  from .bytecode_transformation import create_call_function, create_call_method, create_instruction
  from .codegen import PyCodegen
  from .exc import unimplemented
  from .source import LocalSource, Source
  from .utils import nn_module_new, object_new
  from .variables.base import is_side_effect_safe, MutableLocalBase, MutableLocalSource, VariableTracker
label_desc: Use image node_id 8 for calling the SideEffects obj's underlying member method code with example usage: obj.check_allowed_side_effect(item) and returns: True