Load datasets from the necessary reader.

        Args:
            nodes (iterable): DependencyTree Node objects
            **kwargs: Keyword arguments to pass to the reader's `load` method.

        Returns:
            DatasetDict of loaded datasets
186455
def read(self, nodes=None, **kwargs):
        
        if nodes is None:
            required_nodes = self.wishlist - set(self.datasets.keys())
            nodes = self.dep_tree.leaves(nodes=required_nodes)
        return self._read_datasets(nodes, **kwargs)
758568
def _configure_dataset(self, data_root: str=None, download_urls: Iterable[str]=None, **kwargs) -> None:
        
        self._data_root = data_root
        self._download_urls = download_urls
1294403
def read_dataset(args, dataset):
    
    path = os.path.join(vars(args)[dataset])
    logger.info('reading data from {}'.format(path))
    examples = [line.strip().split('\t') for line in open(path)]
    if args.max_num_examples > 0:
        examples = examples[:args.max_num_examples]
    # NOTE: assume data has been tokenized
    dataset = gluon.data.SimpleDataset([(e[0], e[1], LABEL_TO_IDX[e[2]]) for e in examples])
    dataset = dataset.transform(lambda s1, s2, label: (
        ['NULL'] + s1.lower().split(),
        ['NULL'] + s2.lower().split(), label),
                                lazy=False)
    logger.info('read {} examples'.format(len(dataset)))
    return dataset
900186
def add_nodes(self, lb, nodes):
        """"""
        if not isinstance(nodes, (list, tuple)):
            nodes = [nodes]
        node_dicts = [nd.to_dict() for nd in nodes]
        resp, body = self.api.method_post("/loadbalancers/%s/nodes" % lb.id,
                body={"nodes": node_dicts})
        return resp, body
233764
def load_lists(keys=[], values=[], name='NT'):
    
    mapping = dict(zip(keys, values))
    return mapper(mapping, _nt_name=name)
1200616
def load_from_rdf_file(self, rdf_file):
        
        self.graph = rdflib.Graph()
        self.graph.parse(os.path.abspath(rdf_file), format='nt')
        self.initialize()
1072591
def load(self, patterns, dirs, ignore=None):
        
        for _dir in dirs:
            data = self.read_file(_dir, ignore=ignore)
            if data:
                self.paths[_dir] = data
465789
def _load_dataset(dsid, ds_info, file_handlers, dim='y'):
        """"""
        slice_list = []
        failure = True
        for fh in file_handlers:
            try:
                projectable = fh.get_dataset(dsid, ds_info)
                if projectable is not None:
                    slice_list.append(projectable)
                    failure = False
            except KeyError:
                logger.warning("Failed to load {} from {}".format(dsid, fh),
                               exc_info=True)

        if failure:
            raise KeyError(
                "Could not load {} from any provided files".format(dsid))

        if dim not in slice_list[0].dims:
            return slice_list[0]
        res = xr.concat(slice_list, dim=dim)

        combined_info = file_handlers[0].combine_info(
            [p.attrs for p in slice_list])

        res.attrs = combined_info
        return res
970981
def _load(self, metrix):
    
    if isinstance(metrix, TimeSeries):
      return metrix
    if isinstance(metrix, dict):
      return TimeSeries(metrix)
    return TimeSeries(utils.read_csv(metrix))
638702
def get_links(self, dataset, state, backward=False):
        
        if backward and self.backward is None:
            raise ValueError('no backward nodes')
        try:
            node = dataset[int(backward)][self.join_state(state)]
            if not isinstance(node[0], list):
                return [(node[0], node[1])]
            return list(zip(*node))
        except KeyError:
            return []
1365976
def get_specific_nodes(self, node, names):
        
        nodes = [(x.tagName, x) for x in node.childNodes
                 if x.nodeType == x.ELEMENT_NODE and
                 x.tagName in names]
        return dict(nodes)
350331
def get_nodes(self, request, *args, **kwargs):
        
        # ListSerializerMixin.list returns a serializer object
        return (self.list(request, *args, **kwargs)).data
446851
def node_to_dict(node):
    
    dic = dict(tag=striptag(node.tag))
    if node.attrib:
        dic['attrib'] = node.attrib
    if node.text is not None:
        dic['text'] = node.text
    if node.nodes:
        dic['nodes'] = [node_to_dict(n) for n in node]
    return dic
13061
def _load(cls, attrs, *, context, **kwargs):
        
        return unpack_from_dynamodb(
            model=cls,
            attrs=attrs or {},
            expected=cls.Meta.columns,
            context=context, **kwargs)
956093
def load(cls, data):
        
        if len(data) == 1:
            for key, value in data.items():
                if "__classname__" not in value:  # pragma: no cover
                    raise ValueError
                name = key
                bases = (Constant,)
                attrs = dict()
                for k, v in value.items():
                    if isinstance(v, dict):
                        if "__classname__" in v:
                            attrs[k] = cls.load({k: v})
                        else:
                            attrs[k] = v
                    else:
                        attrs[k] = v
            return type(name, bases, attrs)
        else:  # pragma: no cover
            raise ValueError
1245892
def load(source):
    
    parser = get_xml_parser()
    return etree.parse(source, parser=parser).getroot()
561607
def iterate_similarity_datasets(args):
    
    for dataset_name in args.similarity_datasets:
        parameters = nlp.data.list_datasets(dataset_name)
        for key_values in itertools.product(*parameters.values()):
            kwargs = dict(zip(parameters.keys(), key_values))
            yield dataset_name, kwargs, nlp.data.create(dataset_name, **kwargs)