# Buggy code
def __str__(self):
    """
    Set the string representation of the class.
    """
    if self.filename:
        filename = self.filename
    else:
        filename = "Unknown"
    if self.endian == "<":
        endian = "Little Endian"
    else:
        endian = "Big Endian"
    if self.did_goto:
        goto_info = (
            " (records were skipped, number is wrong in case of differing record sizes)"
        )
    else:
        goto_info = ""
    ret_val = (
        "FILE: %s\nRecord Number: %i%s\n"
        + "Record Offset: %i byte\n"
        + "Header Endianness: %s\n\n"
    ) % (filename, self.record_number, goto_info, self.record_offset, endian)
    ret_val += "FIXED SECTION OF DATA HEADER\n"
    for key in self.fixed_header.keys():
        ret_val += "\t%s: %s\n" % (key, self.fixed_header[key])
    ret_val += "\nBLOCKETTES\n"
    for key in self.blockettes.keys():
        ret_val += "\t%i:" % key
        if not len(self.blockettes[key]):
            ret_val += "\tNOT YET IMPLEMENTED\n"
        for _i, blkt_key in enumerate(self.blockettes[key].keys()):
            if _i == 0:
                tabs = "\t"
            else:
                tabs = "\t\t"
            ret_val += "%s%s: %s\n" % (tabs, blkt_key, self.blockettes[key][blkt_key])
    ret_val += "\nCALCULATED VALUES\n"
    ret_val += "\tCorrected Starttime: %s\n" % self.corrected_starttime
    return ret_val


# Traceback (NotImplementedError)
Traceback (most recent call last):
File "./10_downloader.py", line 122, in <module>
stationxml_storage=stationxml_storage)
File "/home/legovini/obspy/obspy/clients/fdsn/mass_downloader/mass_downloader.py", line 201, in download
threads_per_client=threads_per_client)
File "/home/legovini/obspy/obspy/clients/fdsn/mass_downloader/download_helpers.py", line 857, in download_mseed
[(self.client, self.client_name, chunk) for chunk in chunks])
File "/home/legovini/miniconda3/envs/sismo/lib/python3.6/multiprocessing/pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/home/legovini/miniconda3/envs/sismo/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
File "/home/legovini/miniconda3/envs/sismo/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/home/legovini/miniconda3/envs/sismo/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/legovini/obspy/obspy/clients/fdsn/mass_downloader/download_helpers.py", line 842, in star_download_mseed
*args, logger=self.logger)
File "/home/legovini/obspy/obspy/clients/fdsn/mass_downloader/utils.py", line 245, in download_and_split_mseed_bulk
c=filenames[channel_id])
File "/home/legovini/obspy/obspy/clients/fdsn/mass_downloader/utils.py", line 143, in get_filename
raise NotImplementedError
NotImplementedError

# Fixed code
def __str__(self):
    """
    Set the string representation of the class.
    """
    if self.filename:
        filename = self.filename
    else:
        filename = "Unknown"
    if self.endian == "<":
        endian = "Little Endian"
    else:
        endian = "Big Endian"
    if self.did_goto:
        goto_info = (
            " (records were skipped, number is wrong in case of differing record sizes)"
        )
    else:
        goto_info = ""
    ret_val = (
        "FILE: %s\nRecord Number: %i%s\n"
        + "Record Offset: %i byte\n"
        + "Header Endianness: %s\n\n"
    ) % (filename, self.record_number, goto_info, self.record_offset, endian)
    ret_val += "FIXED SECTION OF DATA HEADER\n"
    for key in self.fixed_header.keys():
        # Don't print empty values to ease testing.
        if self.fixed_header[key] != "":
            ret_val += "\t%s: %s\n" % (key, self.fixed_header[key])
        else:
            ret_val += "\t%s:\n" % (key)
    ret_val += "\nBLOCKETTES\n"
    for key in self.blockettes.keys():
        ret_val += "\t%i:" % key
        if not len(self.blockettes[key]):
            ret_val += "\tNOT YET IMPLEMENTED\n"
        for _i, blkt_key in enumerate(self.blockettes[key].keys()):
            if _i == 0:
                tabs = "\t"
            else:
                tabs = "\t\t"
            ret_val += "%s%s: %s\n" % (tabs, blkt_key, self.blockettes[key][blkt_key])
    ret_val += "\nCALCULATED VALUES\n"
    ret_val += "\tCorrected Starttime: %s\n" % self.corrected_starttime
    return ret_val