code: def adaptive_graph_lasso(X, model_selector, method):
      """Run QuicGraphicalLassoCV or QuicGraphicalLassoEBIC as a two step adaptive fit
      with method of choice (currently: 'binary', 'inverse', 'inverse_squared').
  
      Compare the support and values to the model-selection estimator.
      """
      metric = "log_likelihood"
      print("Adaptive {} with:".format(model_selector))
      print("   adaptive-method: {}".format(method))
      if model_selector == "QuicGraphicalLassoCV":
          print("   metric: {}".format(metric))
          model = AdaptiveGraphicalLasso(
              estimator=QuicGraphicalLassoCV(
                  cv=2,  # cant deal w more folds at small size
                  n_refinements=6,
                  init_method="cov",
                  score_metric=metric,
              ),
              method=method,
          )
  
      elif model_selector == "QuicGraphicalLassoEBIC":
          model = AdaptiveGraphicalLasso(
              estimator=QuicGraphicalLassoEBIC(), method=method
          )
      model.fit(X)
      lam_norm_ = np.linalg.norm(model.estimator_.lam_)
      print("   ||lam_||_2: {}".format(lam_norm_))
      return (
          model.estimator_.covariance_,
          model.estimator_.precision_,
          lam_norm_,
      )
  
imports: import sys
  import numpy
  import tabulate
  import time
  from sklearn.model_selection import GridSearchCV
  from sklearn.datasets import make_sparse_spd_matrix
  from sklearn.covariance import GraphicalLassoCV, ledoit_wolf
  import matplotlib.pyplot
  from inverse_covariance import QuicGraphicalLasso, QuicGraphicalLassoCV, QuicGraphicalLassoEBIC, AdaptiveGraphicalLasso, ModelAverage
label_desc: Use image node_id 7 for calling a global function with example usage: adaptive_graph_lasso(X, model_selector, method) and returns: model,  model,  lam_norm_