code: def __init__(self, args=None, from_other=None, mode="full"):
      if mode == "full":
          self._args = dict(DefaultResources.defaults)
      elif mode == "bare":
          self._args = dict(DefaultResources.bare_defaults)
      else:
          raise ValueError(
              f"Unexpected mode for DefaultResources: {mode}"
          )
  
      if from_other is not None:
          self._args = dict(from_other._args)
          self.parsed = dict(from_other.parsed)
      else:
          if args is None:
              args = []
  
          self._args.update(
              {
                  name: value
                  for name, value in map(self.decode_arg, args)
              }
          )
  
          self.parsed = dict(_cores=1, _nodes=1)
          self.parsed.update(
              parse_resources(
                  self._args, fallback=eval_resource_expression
              )
          )
  
imports: from collections import UserDict, defaultdict
  import itertools
  import operator
  import re
  import tempfile
  from snakemake.exceptions import ResourceScopesException, WorkflowError
  from snakemake.common.tbdstring import TBDString
label_desc: Use image node_id 3 to create a new DefaultResources object  with example: obj = DefaultResources(args, from_other, mode)