code: def __init__(self, args=None, default_only=False):
      self.config = {}
  
      if not args:
          import argparse
  
          args = argparse.Namespace(opts=[])
          default_only = True
  
      self.args = args
      self._register_resolvers()
  
      self._default_config = self._build_default_config()
  
      # Initially, silently add opts so that some of the overrides for the defaults
      # from command line required for setup can be honored
      self._default_config = _merge_with_dotlist(
          self._default_config,
          args.opts,
          skip_missing=True,
          log_info=False,
      )
      # Register the config and configuration for setup
      registry.register("config", self._default_config)
      registry.register("configuration", self)
  
      if default_only:
          other_configs = {}
      else:
          other_configs = self._build_other_configs()
  
      self.config = OmegaConf.merge(self._default_config, other_configs)
  
      self.config = _merge_with_dotlist(self.config, args.opts)
      self._update_specific(self.config)
      self.upgrade(self.config)
      # Resolve the config here itself after full creation so that spawned workers
      # don't face any issues
      self.config = OmegaConf.create(
          OmegaConf.to_container(self.config, resolve=True)
      )
  
      # Update the registry with final config
      registry.register("config", self.config)
  
imports: import collections
  import json
  import logging
  import os
  import warnings
  from ast import literal_eval
  from typing import List
  import torch
  from mmf.common.registry import registry
  from mmf.utils.env import import_user_module
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path, get_mmf_root
  from omegaconf import DictConfig, errors, OmegaConf
label_desc: Use image node_id 1 to create a new Configuration object  with example: obj = Configuration(args, default_only)