code: def __init__(
      self,
      path,
      data_provider,
      run_config,
      net_config,
      pure=False,
      only_forward=False,
  ):
      if only_forward:
          pure = True
      self.graph = tf.Graph()
  
      self.data_provider = data_provider
      self._path = path
      self.run_config = run_config
      self.net_config = net_config
  
      self.data_shape = data_provider.data_shape
      self.n_classes = data_provider.n_classes
  
      self._save_path, self._logs_path = None, None
      self.batches_step = 0
  
      self.cross_entropy, self.train_step, self.accuracy = (
          None,
          None,
          None,
      )
      with self.graph.as_default():
          self._define_inputs()
          self._build_graph(only_forward=only_forward)
          self.global_variables_initializer = (
              tf.global_variables_initializer()
          )
          if not pure:
              self._count_trainable_params()
              self.saver = tf.train.Saver()
      self._initialize_session(set_logs=(not pure))
  
imports: import os
  import shutil
  import tensorflow
  import numpy
  import time
  from datetime import timedelta
  import json
  import pickle
label_desc: Use image node_id 1 to create a new BasicModel object  with example: obj = BasicModel(path, data_provider, run_config, net_config, pure, only_forward)