Load speaker, file, utterance, labels for the file with the given id.
490306
def load_file(folder_path, idx, corpus):
        
        xml_path = os.path.join(folder_path, '{}.xml'.format(idx))
        wav_paths = glob.glob(os.path.join(folder_path, '{}_*.wav'.format(idx)))

        if len(wav_paths) == 0:
            return []

        xml_file = open(xml_path, 'r', encoding='utf-8')
        soup = BeautifulSoup(xml_file, 'lxml')

        transcription = soup.recording.cleaned_sentence.string
        transcription_raw = soup.recording.sentence.string
        gender = soup.recording.gender.string
        is_native = soup.recording.muttersprachler.string
        age_class = soup.recording.ageclass.string
        speaker_idx = soup.recording.speaker_id.string

        if speaker_idx not in corpus.issuers.keys():
            start_age_class = int(age_class.split('-')[0])

            if start_age_class < 12:
                age_group = issuers.AgeGroup.CHILD
            elif start_age_class < 18:
                age_group = issuers.AgeGroup.YOUTH
            elif start_age_class < 65:
                age_group = issuers.AgeGroup.ADULT
            else:
                age_group = issuers.AgeGroup.SENIOR

            native_lang = None

            if is_native == 'Ja':
                native_lang = 'deu'

            issuer = issuers.Speaker(speaker_idx,
                                     gender=issuers.Gender(gender),
                                     age_group=age_group,
                                     native_language=native_lang)
            corpus.import_issuers(issuer)

        utt_ids = []

        for wav_path in wav_paths:
            wav_name = os.path.split(wav_path)[1]
            wav_idx = os.path.splitext(wav_name)[0]
            corpus.new_file(wav_path, wav_idx)
            utt = corpus.new_utterance(wav_idx, wav_idx, speaker_idx)
            utt.set_label_list(annotations.LabelList.create_single(
                transcription,
                idx=audiomate.corpus.LL_WORD_TRANSCRIPT
            ))
            utt.set_label_list(annotations.LabelList.create_single(
                transcription_raw,
                idx=audiomate.corpus.LL_WORD_TRANSCRIPT_RAW
            ))
            utt_ids.append(wav_idx)

        return utt_ids
901594
def create_assets_if_needed(corpus, path, entry):
        
        file_idx = entry[1]

        if file_idx not in corpus.utterances.keys():
            speaker_idx = entry[0]
            transcription = entry[2]

            age = CommonVoiceReader.map_age(entry[5])
            gender = CommonVoiceReader.map_gender(entry[6])

            file_path = os.path.join(path, 'clips', '{}.wav'.format(file_idx))

            corpus.new_file(file_path, file_idx)

            if speaker_idx in corpus.issuers.keys():
                issuer = corpus.issuers[speaker_idx]
            else:
                issuer = issuers.Speaker(speaker_idx, gender=gender, age_group=age)
                corpus.import_issuers(issuer)

            utterance = corpus.new_utterance(file_idx, file_idx, issuer.idx)
            utterance.set_label_list(
                annotations.LabelList.create_single(
                    transcription,
                    idx=audiomate.corpus.LL_WORD_TRANSCRIPT
                )
            )

        return file_idx
557324
def load(self, id_code):
        
        filestream = open('{0}/{1}'.format(self.data_path, id_code), 'rb')
        workflow = pickle.load(filestream)
        return workflow
1168476
def _loadData(self, data):
        
        self._data = data
        self.codec = data.attrib.get('codec')
        self.codecID = data.attrib.get('codecID')
        self.id = cast(int, data.attrib.get('id'))
        self.index = cast(int, data.attrib.get('index', '-1'))
        self.language = data.attrib.get('language')
        self.languageCode = data.attrib.get('languageCode')
        self.selected = cast(bool, data.attrib.get('selected', '0'))
        self.streamType = cast(int, data.attrib.get('streamType'))
        self.type = cast(int, data.attrib.get('streamType'))
903618
function loadDeps(file, resource) {
  file.requires.forEach(function(id) {
    resource.add(id);
  });

  file.asyncs.forEach(function(id) {
    resource.add(id, true);
  });
}
76656
private static TagLib[] loadFromSystem(Identification id) throws TagLibException {

	if (systemTLDs[CFMLEngine.DIALECT_CFML] == null) {
	    TagLib cfml = new TagLibFactory(null, TLD_BASE, id).getLib();
	    TagLib lucee = cfml.duplicate(false);
	    systemTLDs[CFMLEngine.DIALECT_CFML] = new TagLibFactory(cfml, TLD_CFML, id).getLib();
	    systemTLDs[CFMLEngine.DIALECT_LUCEE] = new TagLibFactory(lucee, TLD_LUCEE, id).getLib();
	}
	return systemTLDs;
    }
179371
def load_items():
    

    filename = os.path.join(os.path.dirname(__file__), "data", "items.json")

    with open(filename) as f:
        items = json.loads(f.read())["result"]["items"]
        for item in items:
            ITEMS_CACHE[item["id"]] = item
793367
def load_data(self, pdbid):
        """"""
        f = urlopen("http://projects.biotec.tu-dresden.de/plip-rest/pdb/%s?format=xml" % pdbid.lower())
        self.doc = etree.parse(f)
222197
def _load(self):
        """"""

        self.session_id = self._session_object.get_session_id()

        # protection against session_id tampering
        if self.session_id and not self._valid_session_id(self.session_id):
            self.session_id = None

        if self.session_id:
            d = self.store[self.session_id]
            if isinstance(d, dict) and d:
                self.update(d)

        if not self.session_id:
            self.session_id = self._session_object.generate_session_id()

        if not self._data:
            if self._initializer and isinstance(self._initializer, dict):
                self.update(deepcopy(self._initializer))

        self._session_object.set_session_id(self.session_id)
1330825
def download(self, *ids):
        
        bundles = sublists_of(ids, 20)  # 20 files at once is an API restriction

        for bundle in bundles:
            download_response = self._rpc.DownloadSubtitles(self._token, bundle)

            assert_status(download_response)

            download_data = download_response.get('data')

            for item in download_data:
                subtitle_id = item['idsubtitlefile']
                subtitle_data = item['data']

                decompressed = decompress(subtitle_data)

                yield Result(subtitle_id, decompressed)
258866
def loadlist(self, playlist, mode='replace'):
        """"""
        self.command('loadlist', playlist.encode(fs_enc), mode)
859944
def load(self, filename):
        """"""
        f = io.open(filename,'r',encoding='utf-8')
        for line in f:
            data = line.strip().split("\t")
            type, count = data[:2]
            self.count(type,count)
        f.close()
951625
def load_books_of_speaker(corpus, path, speaker):
        
        utt_ids = []

        for book_path in MailabsReader.get_folders(path):
            meta_path = os.path.join(book_path, 'metadata.csv')
            wavs_path = os.path.join(book_path, 'wavs')

            meta = textfile.read_separated_lines(meta_path,
                                                 separator='|',
                                                 max_columns=3)

            for entry in meta:
                file_basename = entry[0]
                transcription_raw = entry[1]
                transcription_clean = entry[2]

                if speaker is None:
                    idx = file_basename
                    utt_speaker = issuers.Speaker(idx)
                    speaker_idx = idx
                    corpus.import_issuers(utt_speaker)
                else:
                    idx = '{}-{}'.format(speaker.idx, file_basename)
                    speaker_idx = speaker.idx

                wav_name = '{}.wav'.format(file_basename)
                wav_path = os.path.join(wavs_path, wav_name)

                if os.path.isfile(wav_path):
                    corpus.new_file(wav_path, idx)

                    ll_raw = annotations.LabelList.create_single(
                        transcription_raw,
                        idx=audiomate.corpus.LL_WORD_TRANSCRIPT_RAW
                    )

                    ll_clean = annotations.LabelList.create_single(
                        transcription_clean,
                        idx=audiomate.corpus.LL_WORD_TRANSCRIPT
                    )

                    utterance = corpus.new_utterance(idx, idx, speaker_idx)
                    utterance.set_label_list(ll_raw)
                    utterance.set_label_list(ll_clean)

                    utt_ids.append(utterance.idx)

        return utt_ids
1196807
def load_context(context, file_path=None):
    """"""
    if not file_path:
        file_path = _get_context_filepath()
    if os.path.exists(file_path):
        with io.open(file_path, encoding='utf-8') as f:
            for line in f:
                execute(line, context)
107975
def load(cli, yaml_filename):
        """Expected Definition:
        - name: NAME
          docker_id: IMAGE
        - name: NAME
          docker_id: IMAGE
        """
        with open(yaml_filename, 'rb') as filehandle:
            for waybill in yaml.load(filehandle.read()):
                cli.create(waybill.name,
                           waybill.docker_id)
182110
@Override
    public Blob loadForID(String id) throws SQLException {
        Connection c = dataSource.getConnection();
        PreparedStatement preparedStatement = c.prepareStatement(loadStatement());
        preparedStatement.setString(1, id);
        ResultSet r = preparedStatement.executeQuery();
        if (r.wasNull() || !r.next()) {
            return null;
        } else {
            Blob first = r.getBlob(2);
            return first;
        }


    }
68997
def _walk_librispeech_dir(directory):
  """"""
  directory = os.path.join(directory, "LibriSpeech")
  for path, _, files in tf.io.gfile.walk(directory):
    if not files:
      continue

    transcript_file = [f for f in files if f.endswith(".txt")]
    if not transcript_file:
      continue
    assert len(transcript_file) == 1
    transcript_file, = transcript_file
    transcripts = {}
    with tf.io.gfile.GFile(os.path.join(path, transcript_file)) as f:
      for line in f:
        line = line.strip()
        key, transcript = line.split(" ", 1)
        transcripts[key] = transcript
    audio_files = [f for f in files if not f.endswith(".txt")]
    for audio_file in audio_files:
      assert audio_file.endswith(".flac")
      key = audio_file[:-len(".flac")]
      transcript = transcripts[key]
      speaker_id, chapter_id = [int(el) for el in key.split("-")[:2]]
      yield LibrispeechExample(
          speaker_id=speaker_id,
          chapter_id=chapter_id,
          audio_file=os.path.join(path, audio_file),
          transcript=transcript)