class_docstr: bla
code: def __init__(
      self,
      distribution_path=None,
      transform_img_fn=None,
      n=1000,
      dummys=None,
      white=None,
      segmentation_fn=None,
  ):
      """"""
      self.hide = True
      self.white = white
      if segmentation_fn is None:
          from skimage.segmentation import quickshift
  
          segmentation_fn = lambda x: quickshift(
              x, kernel_size=4, max_dist=200, ratio=0.2  # noqa
          )
      self.segmentation = segmentation_fn
      if dummys is not None:
          self.hide = False
          self.dummys = dummys
      elif distribution_path:
          self.hide = False
          import os
          import skimage
  
          if not transform_img_fn:
  
              def transform_img(path):
                  img = skimage.io.imread(path)
                  short_egde = min(img.shape[:2])
                  yy = int((img.shape[0] - short_egde) / 2)
                  xx = int((img.shape[1] - short_egde) / 2)
                  crop_img = img[
                      yy : yy + short_egde, xx : xx + short_egde
                  ]
                  return skimage.transform.resize(crop_img, (224, 224))
  
              def transform_imgs(paths):
                  out = []
                  for i, path in enumerate(paths):
                      if i % 100 == 0:
                          print(i)
                      out.append(transform_img(path))
                  return out
  
              transform_img_fn = transform_imgs
          all_files = os.listdir(distribution_path)
          all_files = np.random.choice(
              all_files, size=min(n, len(all_files)), replace=False
          )
          paths = [
              os.path.join(distribution_path, f) for f in all_files
          ]
          self.dummys = transform_img_fn(paths)
  
file_path: anchor/anchor/anchor_image.py
imports: from .None import anchor_base
  import numpy
  import sklearn
label_desc: Use image node_id 1 to create a new AnchorImage object from inherited base classes: object with example: obj = AnchorImage(distribution_path, transform_img_fn, n, dummys, white, segmentation_fn)