Load exchange data and return dataset.
3559
def load_exchange_word_vectors(
    filename                 = "database.db",
    maximum_number_of_events = None
    ):
    
    log.info("load word vectors of database {filename}".format(
        filename = filename
    ))
    # Ensure that the database exists.
    if not os.path.isfile(filename):
        log.info("database {filename} nonexistent".format(
            filename = filename
        ))
        program.terminate()
        raise Exception
    # Access the database.
    database = access_database(filename = filename)
    # Access or create the exchanges table.
    table_exchanges = database["exchanges"]
    # Access exchanges.
    table_name = "exchanges"
    # Create a datavision dataset.
    data = datavision.Dataset()
    # progress
    progress = shijian.Progress()
    progress.engage_quick_calculation_mode()
    number_of_entries = len(database[table_name])
    index = 0
    for index_entry, entry in enumerate(database[table_name].all()):
        if maximum_number_of_events is not None and\
            index >= int(maximum_number_of_events):
            log.info(
                "loaded maximum requested number of events " +
                "({maximum_number_of_events})\r".format(
                    maximum_number_of_events = maximum_number_of_events
                )
            )
            break
        #unique_identifier = str(entry["id"])
        utteranceWordVector = str(entry["utteranceWordVector"])
        responseWordVector = str(entry["responseWordVector"])
        if utteranceWordVector != "None" and responseWordVector != "None":
            index += 1

            utteranceWordVector = eval("np." + utteranceWordVector.replace("float32", "np.float32"))
            responseWordVector  = eval("np." + responseWordVector.replace("float32", "np.float32"))
            data.variable(index = index, name = "utteranceWordVector", value = utteranceWordVector)
            data.variable(index = index, name = "responseWordVector",  value = responseWordVector )

            #utteranceWordVector = list(eval("np." + utteranceWordVector.replace("float32", "np.float32")))
            #responseWordVector  = list(eval("np." + responseWordVector.replace("float32", "np.float32")))
            #for index_component, component in enumerate(utteranceWordVector):
            #    data.variable(index = index, name = "uwv" + str(index_component), value = component)
            #for index_component, component in enumerate(responseWordVector):
            #    data.variable(index = index, name = "rwv" + str(index_component), value = component)

        print progress.add_datum(fraction = index_entry / number_of_entries),
    return data
1308176
def load_remote_dataset(self, ds_str):
        '''
        
        '''

        if opendap.is_opendap(ds_str):
            return Dataset(ds_str)
        else:
            # Check if the HTTP response is XML, if it is, it's likely SOS so
            # we'll attempt to parse the response as SOS
            response = requests.get(ds_str, allow_redirects=True)
            if 'text/xml' in response.headers['content-type']:
                return self.process_doc(response.content)

            raise ValueError("Unknown service with content-type: {}".format(response.headers['content-type']))
145980
async def get_data(self):
        """"""
        try:
            await self.get_session_data()
            await self.get_home_data()
            await self.get_users()
            await self.get_user_data()
        except (asyncio.TimeoutError, aiohttp.ClientError, socket.gaierror):
            msg = "Can not load data from Tautulli."
            logger(msg, 40)
223239
def load(self):
        """"""
        if self.r.live:
            self.extra_config['collections'] = {'live':
                    {'index': '$live'}}

        if self.r.debug:
            self.extra_config['debug'] = True

        if self.r.record:
            self.extra_config['recorder'] = 'live'
906079
def fetch_data(self, **var):
        """"""
        varstr = ','.join(name + self._convert_indices(ind)
                          for name, ind in var.items())
        query = self.query().add_query_parameter(req='data', var=varstr)
        return self._fetch(query)
1090002
def load(self, d3mds):
        """"""
        X, y = d3mds.get_data()

        return Dataset(d3mds.dataset_id, X, y)
687454
def load(self, data, many=None, partial=None):
        """"""
        result = super(ResumptionTokenSchema, self).load(
            data, many=many, partial=partial
        )
        result.data.update(
            result.data.get('resumptionToken', {}).get('kwargs', {})
        )
        return result
199525
def load_data():
    ''''''
    digits = load_digits()
    X_train, X_test, y_train, y_test = train_test_split(digits.data, digits.target, random_state=99, test_size=0.25)

    ss = StandardScaler()
    X_train = ss.fit_transform(X_train)
    X_test = ss.transform(X_test)

    return X_train, X_test, y_train, y_test
26670
def loaded_dataset_ids(self):
        """"""
        return set(ds_id for scene in self.scenes for ds_id in scene.keys())
810582
def prepare_data():
  """"""
  ((x_train, y_train), (x_test, y_test)) = DATASET.load_data()
  x_train = x_train.astype("float32")
  x_test = x_test.astype("float32")
  x_train /= 255.0
  x_test /= 255.0
  return ((x_train, y_train), (x_test, y_test))
348493
def load(self, model):
        """"""
        self._dawg.load(find_data(model))
        self._loaded_model = True
968934
def load_data(verbose=False):
    ""

    df = pd.read_csv(STOPS_PATH, usecols=['stop_id', 'stop_name'])
    if verbose:
        print('- Loaded %d entries from "%s".' % (len(df), STOPS_PATH))
    return df
1362709
def datasetItems(self):
        
        out = {}
        for item in self.items():
            if isinstance(item, XChartDatasetItem):
                out[item.dataset()] = item
        return out
1100242
def get_data(self, collection):
        """"""
        data = self._filter_queryset('view_data', collection.data.all())

        return self._serialize_data(data)
767907
def get_dataset(dataset_name, dataset_prefix=None, data_dir=None,
                url=None, resume=True, verbose=1):
    
    warn(DEPRECATION_MSG)
    file_id, md5 = OSF_RESOURCES[dataset_name]
    if url is None:
        url = '{}/{}'.format(OSF_PROJECT_URL, file_id)
    return fetch_file(dataset_name, url, data_dir, dataset_prefix=dataset_prefix,
                      filetype='tar', resume=resume, verbose=verbose, md5sum=md5)
752262
def get_dataset(self):
        # type: () -> hdx.data.dataset.Dataset
        
        package_id = self.data.get('package_id')
        if package_id is None:
            raise HDXError('Resource has no package id!')
        return hdx.data.dataset.Dataset.read_from_hdx(package_id)
1154967
def load(self, dataset_keys, previous_datasets=None):
        """"""
        all_datasets = previous_datasets or DatasetDict()
        datasets = DatasetDict()

        # Include coordinates in the list of datasets to load
        dsids = [self.get_dataset_key(ds_key) for ds_key in dataset_keys]
        coordinates = self._get_coordinates_for_dataset_keys(dsids)
        all_dsids = list(set().union(*coordinates.values())) + dsids

        for dsid in all_dsids:
            if dsid in all_datasets:
                continue
            coords = [all_datasets.get(cid, None)
                      for cid in coordinates.get(dsid, [])]
            ds = self._load_dataset_with_area(dsid, coords)
            if ds is not None:
                all_datasets[dsid] = ds
                if dsid in dsids:
                    datasets[dsid] = ds
        self._load_ancillary_variables(all_datasets)

        return datasets