docstr: Load and initialize the BTB class which will be responsible for
  selecting hyperpartitions.
docstr_tok: ["Load","and","initialize","the","BTB","class","which","will","be","responsible","for","selecting","hyperpartitions","."]
code: def load_selector(self):
      """
      Load and initialize the BTB class which will be responsible for
      selecting hyperpartitions.
      """
      # selector will either be a key into SELECTORS or a path to
      # a file that defines a class called CustomSelector.
      if self.datarun.selector in SELECTORS:
          Selector = SELECTORS[self.datarun.selector]
      else:
          path, classname = re.match(
              CUSTOM_CLASS_REGEX, self.datarun.selector
          ).groups()
          mod = imp.load_source("btb.selection.custom", path)
          Selector = getattr(mod, classname)
  
      LOGGER.info("Selector: %s" % Selector)
  
      # generate the arguments we need to initialize the selector
      hyperpartitions = self.db.get_hyperpartitions(
          datarun_id=self.datarun.id
      )
      hp_by_method = defaultdict(list)
      for hp in hyperpartitions:
          hp_by_method[hp.method].append(hp.id)
  
      hyperpartition_ids = [hp.id for hp in hyperpartitions]
  
      # Selector classes support passing in redundant arguments
      self.selector = get_instance(
          Selector,
          choices=hyperpartition_ids,
          k=self.datarun.k_window,
          by_algorithm=dict(hp_by_method),
      )
  
imports: from __future__ import absolute_import, unicode_literals
  import datetime
  import imp
  import logging
  import os
  import re
  import socket
  import traceback
  import warnings
  from builtins import object, str
  from collections import defaultdict
  import boto3
  import numpy
  from atm.classifier import Model
  from atm.constants import CUSTOM_CLASS_REGEX, SELECTORS, TUNERS
  from atm.database import ClassifierStatus, DBSession
  from atm.utilities import ensure_directory, get_instance, save_metrics, save_model, update_params
label_desc: Use image node_id 2 for calling the Worker obj's underlying member method code with example usage: obj.load_selector() without return types