d02dff76c1e8fcfcff277a4ea0a65f9c8259605e,torchaudio/__init__.py,,save,#Any#Any#Any#,37

Before Change


    filename, extension = os.path.splitext(filepath)
    assert type(sample_rate) == int

    if isinstance(src, torch.FloatTensor):
        func = th_sox.libthsox_Float_write_audio_file
    elif isinstance(src, torch.DoubleTensor):
        func = th_sox.libthsox_Double_write_audio_file
    elif isinstance(src, torch.ByteTensor):
        func = th_sox.libthsox_Byte_write_audio_file
    elif isinstance(src, torch.CharTensor):
        func = th_sox.libthsox_Char_write_audio_file
    elif isinstance(src, torch.ShortTensor):
        func = th_sox.libthsox_Short_write_audio_file
    elif isinstance(src, torch.IntTensor):
        func = th_sox.libthsox_Int_write_audio_file
    elif isinstance(src, torch.LongTensor):
        func = th_sox.libthsox_Long_write_audio_file
    func(bytes(filepath), src, extension.replace(".", ""), sample_rate)

After Change


        raise TypeError("Sample rate should be a integer")

    check_input(src)
    typename = type(src).__name__.replace("Tensor", "")
    func = getattr(th_sox, "libthsox_{}_write_audio_file".format(typename))

    func(bytes(filepath), src, extension[1:], sample_rate)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: pytorch/audio
Commit Name: d02dff76c1e8fcfcff277a4ea0a65f9c8259605e
Time: 2017-05-27
Author: seannaren@hotmail.com
File Name: torchaudio/__init__.py
Class Name:
Method Name: save


Project Name: mindsdb/mindsdb
Commit Name: db76568e4f8bfda4c262508217536e670ece7d3f
Time: 2019-09-01
Author: zoran.pandovski@keitaro.com
File Name: mindsdb/libs/phases/data_extractor/data_extractor.py
Class Name: DataExtractor
Method Name: _get_prepared_input_df


Project Name: pytorch/audio
Commit Name: d02dff76c1e8fcfcff277a4ea0a65f9c8259605e
Time: 2017-05-27
Author: seannaren@hotmail.com
File Name: torchaudio/__init__.py
Class Name:
Method Name: load