7d47747b0515a1f0c4b3ae7bc999b072c132864a,media-translation/cloud-client/translate_from_mic.py,,main,#,122

Before Change


        streaming_config=config, audio_content=None)

    with MicrophoneStream(RATE, CHUNK) as stream:
        audio_generator = stream.generator()
        mic_requests = (mediatranslation.StreamingTranslateSpeechRequest(
            audio_content=content,
            streaming_config=config)
            for content in audio_generator)

        requests = itertools.chain(iter([first_request]), mic_requests)

        responses = client.streaming_translate_speech(requests)

After Change




def main():
    while True:
        print()
        option = input("Press any key to translate or \"q\" to quit: ")

        if option.lower() == "q":
            break

        do_translation_loop()


if __name__ == "__main__":
    main()
// [END media_translation_translate_from_mic]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7d47747b0515a1f0c4b3ae7bc999b072c132864a
Time: 2020-06-15
Author: erschmid@google.com
File Name: media-translation/cloud-client/translate_from_mic.py
Class Name:
Method Name: main


Project Name: biolab/orange3
Commit Name: a1c9e902822e0dd6c33ac0a1b633de8737b1bf26
Time: 2016-10-14
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/classify/owclassificationtreegraph.py
Class Name: OWTreeGraph
Method Name: node_tooltip


Project Name: geekcomputers/Python
Commit Name: 139259ac8ac83160502cbb896371ce4fa4027361
Time: 2019-10-10
Author: ml.smiley3@gmail.com
File Name: primelib/primelib.py
Class Name:
Method Name: isPrime