code: def sample_cfgs(seed):
      """Samples chunk configs and return those that are unique and valid."""
      # Fix RNG seed (every call to this function should use a unique seed)
      np.random.seed(seed)
      setup_cfg = sweep_cfg.SETUP
      cfgs = {}
      for _ in range(setup_cfg.CHUNK_SIZE):
          # Sample parameters [key, val, ...] list based on the samplers
          params = samplers.sample_parameters(setup_cfg.SAMPLERS)
          # Check if config is unique, if not continue
          key = zip(params[0::2], params[1::2])
          key = " ".join(["{} {}".format(k, v) for k, v in key])
          if key in cfgs:
              continue
          # Generate config from parameters
          reset_cfg()
          cfg.merge_from_other_cfg(setup_cfg.BASE_CFG)
          cfg.merge_from_list(params)
          # Check if config is valid, if not continue
          is_valid = samplers.check_regnet_constraints(
              setup_cfg.CONSTRAINTS
          )
          if not is_valid:
              continue
          # Special logic for dealing w model scaling (side effect is to standardize cfg)
          if cfg.MODEL.TYPE in ["anynet", "effnet", "regnet"]:
              scaler.scale_model()
          # Check if config is valid, if not continue
          is_valid = samplers.check_complexity_constraints(
              setup_cfg.CONSTRAINTS
          )
          if not is_valid:
              continue
          # Set config description to key
          cfg.DESC = key
          # Store copy of config if unique and valid
          cfgs[key] = cfg.clone()
          # Stop sampling if already reached quota
          if len(cfgs) == setup_cfg.NUM_CONFIGS:
              break
      return cfgs
  
file_path: pycls/tools/sweep_setup.py
imports: import multiprocessing
  import os
  import numpy
  import pycls.models.scaler
  import pycls.sweep.config
  import pycls.sweep.samplers
  import yaml
  from pycls.core.config import cfg, reset_cfg
  from pycls.core.timer import Timer
  from pycls.sweep.config import sweep_cfg
label_desc: Use image node_id 1 for calling a global function with example usage: sample_cfgs(seed) and returns: cfgs