Load labels files.

    Parameters
    ----------
    path
        Path of labels file.

    Returns
    -------
    List[SingleConditionSpec]
        List of SingleConditionSpec stored in labels file.
507704
def load_labels(path: Union[str, Path]) -> List[SingleConditionSpec]:
    
    condition_specs = np.load(str(path))
    return [c.view(SingleConditionSpec) for c in condition_specs]
447786
def _databunch_load_empty(cls, path, fname:str='export.pkl'):
    ""
    sd = LabelLists.load_empty(path, fn=fname)
    return sd.databunch()
755817
def load(self, path):
        
        self.dct = wrapper.Dictionary()
        self.guide = wrapper.Guide()

        with open(path, 'rb') as f:
            self.dct.read(f)
            self.guide.read(f)

        return self
1034903
def update_path_labels(self):
        
        self.view['core_label'].set_text("Core Config Path: " + str(self.core_config_model.config.config_file_path))
        self.view['gui_label'].set_text("GUI Config Path: " + str(self.gui_config_model.config.config_file_path))
950208
def load(cls, path):
        
        data = json.load(open(path))

        weights = data['weights']
        weights = np.asarray(weights, dtype=np.float64)

        s = cls(data['num_neurons'],
                data['data_dimensionality'],
                data['params']['lr']['orig'],
                neighborhood=data['params']['infl']['orig'],
                valfunc=data['valfunc'],
                argfunc=data['argfunc'],
                lr_lambda=data['params']['lr']['factor'],
                nb_lambda=data['params']['nb']['factor'])

        s.weights = weights
        s.trained = True

        return s
1225984
def get_label_map(opts):
    '''  '''
    result = {}
    try:  # get labels from filesystem
        for entry in os.scandir(diskdir):
            if entry.name.startswith('.'):
                continue
            if islink(entry.path):
                target = os.readlink(entry.path)
            else:
                target = entry.path
            result[target] = entry.name
        if opts.debug:
            print('\n\nlabel_map:', result)
    except FileNotFoundError:
        pass

    return result
1223729
def load(self, path):
        
        with open(path, "rb") as f:
            content = f.read().decode("utf-8")

        section_text_list = list()

        lines = list()
        for line in content.split("\n"):
            if line.startswith("["):
                section_text_list.append("\n".join(lines))
                lines = list()
                lines.append(line)
            else:
                lines.append(line)

        section_text_list.append("\n".join(lines))

        self._sections = OrderedDict()
        for text in section_text_list[1:]:
            section = Section.from_text(text)
            self._sections[section.name] = section
811492
def load(self, path):
        
        path = os.path.expandvars(os.path.expanduser(path))

        gdg = cgaddag.gdg_load(path.encode("ascii"))
        if not gdg:
            errno = ctypes.c_int.in_dll(ctypes.pythonapi, "errno").value
            raise OSError(errno, os.strerror(errno), path)

        self.__del__()
        self.gdg = gdg.contents
1307102
def _label_path_from_index(self, index):
        
        label_file = os.path.join(self.label_dir, index + self.label_extension)
        assert os.path.exists(label_file), 'Path does not exist: {}'.format(label_file)
        return label_file
1314099
def labels(self):
        
        if not self.__labels:
            self.__labels = Labels(self.__connection)
        return self.__labels
70005
def load_path(self, path):
        

        if not foundations.common.path_exists(path):
            return False

        if os.path.isfile(path):
            if path in self.list_files():
                self.set_current_editor(path)
            else:
                self.load_file(path)
        else:
            if not path in self.list_projects():
                self.add_project(path)
        return True
808222
def _load_data(path, labels_number=1):
  """"""
  with tf.io.gfile.GFile(path, "rb") as f:
    data = f.read()
  offset = 0
  max_offset = len(data) - 1
  while offset < max_offset:
    labels = np.frombuffer(data, dtype=np.uint8, count=labels_number,
                           offset=offset).reshape((labels_number,))
    # 1 byte per label, 1024 * 3 = 3072 bytes for the image.
    offset += labels_number
    img = (np.frombuffer(data, dtype=np.uint8, count=3072, offset=offset)
           .reshape((3, _CIFAR_IMAGE_SIZE, _CIFAR_IMAGE_SIZE))
           .transpose((1, 2, 0))
          )
    offset += 3072
    yield labels, img
551016
def label_search(self, label:str) -> List[dict]:
        ''' 
        '''
        ilx_rows = self.label2rows(self.local_degrade(label))
        if not ilx_rows:
            return None
        else:
            return ilx_rows
80280
def load(self, paths):
        
        for path in paths:
            self.models.append(Model(path))
358971
def _load(self, data_path, ignore_missing=False):
        '''
        '''
        if data_path.endswith(".npz"):
            data_dict = np.load(data_path)
            keys = sorted(data_dict.keys())
            for i, k in enumerate(keys):
                data = data_dict[k]
                op_name = "_".join(k.split("_")[:-1])
                param_name = "weights" if k.split("_")[-1] == "W" else "biases"
                if self.verbose:
                    print("Loaded: {} {}".format(op_name, param_name))
                if op_name not in self.weights:
                    self.weights[op_name] = {}
                self.weights[op_name][param_name] = data
        elif data_path.endswith(".npy"):
            data_dict = np.load(data_path).item()
            for op_name in data_dict:
                with tf.variable_scope(op_name, reuse=True):
                    for param_name, data in data_dict[op_name].iteritems():
                        if self.verbose:
                            print("Loaded: {} {}".format(op_name, param_name))
                        if op_name not in self.weights:
                            self.weights[op_name] = {}
                        self.weights[op_name][param_name] = data
        else:
            raise RuntimeError("Invalid file type.")
1079831
def load(cls, file_path):
        

        # convert back to numpy
        data = helper.read_json(file_path)
        return Concise.from_dict(data)
493179
def load(file_or_path):
    
    # This is the pickling pain when changing _src -> src
    import sys
    import inspect
    sys.modules['GPy.kern._src'] = kern.src
    for name, module in inspect.getmembers(kern.src):
        if not name.startswith('_'):
            sys.modules['GPy.kern._src.{}'.format(name)] = module
    sys.modules['GPy.inference.optimization'] = inference.optimization
    import paramz
    return paramz.load(file_or_path)