*parse spectra data from a row in the tns results content*

        **Key Arguments:**
             - ``content`` -- a table row from the TNS results page
             - ``TNSId`` -- the tns id of the transient

        **Return:**
            - ``specData`` -- a list of dictionaries of the spectral data
            - ``relatedFilesTable`` -- a list of dictionaries of transient spectrum related files

def _parse_spectral_data(
            self,
            content,
            TNSId):
        """*parse spectra data from a row in the tns results content*

        **Key Arguments:**
             - ``content`` -- a table row from the TNS results page
             - ``TNSId`` -- the tns id of the transient

        **Return:**
            - ``specData`` -- a list of dictionaries of the spectral data
            - ``relatedFilesTable`` -- a list of dictionaries of transient spectrum related files 
        """
        self.log.info('starting the ``_parse_spectral_data`` method')

        specData = []
        relatedFilesTable = []

        # CLASSIFICATION BLOCK
        classBlock = re.search(
            r"""<tr class=[^\n]*?Classification reportings.*$""",
            content,
            flags=re.S  # re.S
        )

        if classBlock:
            classBlock = classBlock.group()

            reports = re.finditer(
                r"""<tr class="row-[^"]*"><td class="cell-id">.*?</tbody>\s*</table>\s*</div></td> </tr>\s*</tbody>\s*</table>\s*</div></td> </tr>""",
                classBlock,
                flags=re.S  #
            )

            relatedFiles = self._parse_related_files(classBlock)

            for r in reports:

                header = re.search(
                    r"""<tr class="row.*?time_received">(?P<reportAddedDate>[^<]*).*?user_name">(?P<TNSuser>[^<]*).*?classifier_name">(?P<reporters>[^<]*).*?source_group_name">(?P<survey>[^<]*).*?-type">(?P<specType>[^<]*).*?-redshift">(?P<transRedshift>[^<]*).*?-related_files">(?P<relatedFiles>[^<]*).*?-groups">(?P<surveyGroup>[^<]*).*?-remarks">(?P<sourceComment>[^<]*)</td>""",
                    r.group(),
                    flags=re.S  # re.S
                )
                if not header:
                    continue

                header = header.groupdict()
                header["TNSId"] = TNSId

                del header["reporters"]
                del header["surveyGroup"]
                del header["survey"]

                if not self.comments:
                    del header['sourceComment']
                else:
                    theseComments = header[
                        "sourceComment"].split("\n")
                    header["sourceComment"] = ""
                    for c in theseComments:
                        header["sourceComment"] += " " + c.strip()
                    header["sourceComment"] = header[
                        "sourceComment"].strip().replace('"', "'")[0:750]

                spec = re.finditer(
                    r"""<tr class="class-results-.*?-obsdate">(?P<obsdate>[^<]*).*?-tel_inst">(?P<telescope>[^<]*).*?-exptime">(?P<exptime>[^<]*).*?-observer">(?P<sender>[^<]*).*?-reducer">(?P<reducer>[^<]*).*?-source_group_name">(?P<survey>[^<]*).*?-asciifile">(.*?<a href="(?P<filepath>[^"]*)".*?</a>)?.*?-fitsfile">(.*?<a href="(?P<fitsFilepath>[^"]*)".*?</a>)?.*?-groups">(?P<surveyGroup>[^<]*).*?-remarks">(?P<remarks>[^<]*)""",
                    r.group(),
                    flags=0  # re.S
                )
                filesAppended = False
                for s in spec:
                    s = s.groupdict()
                    del s["sender"]
                    del s["surveyGroup"]
                    del s["reducer"]

                    if not self.comments:
                        del s["remarks"]
                    else:
                        s["remarks"] = s["remarks"].replace('"', "'")[0:750]

                    s.update(header)

                    if s["relatedFiles"] and filesAppended == False:
                        filesAppended = True
                        for f in relatedFiles:
                            # ORDER THE DICTIONARY FOR THIS ROW OF
                            # RESULTS
                            thisFile = collections.OrderedDict()
                            thisFile["TNSId"] = TNSId
                            thisFile["filename"] = f[
                                "filepath"].split("/")[-1]
                            thisFile["url"] = f["filepath"]
                            if self.comments:
                                thisFile["comment"] = f[
                                    "fileComment"].replace("\n", " ").strip()
                            thisFile["dateObs"] = s["obsdate"]
                            thisFile["spec1phot2"] = 1
                            relatedFilesTable.append(thisFile)

                    for ffile in [s["filepath"], s["fitsFilepath"]]:
                        if ffile:
                            # ORDER THE DICTIONARY FOR THIS ROW OF
                            # RESULTS
                            thisFile = collections.OrderedDict()
                            thisFile["TNSId"] = TNSId
                            thisFile["filename"] = ffile.split(
                                "/")[-1]
                            thisFile["url"] = ffile
                            if self.comments:
                                thisFile["comment"] = ""
                            thisFile["dateObs"] = s["obsdate"]
                            thisFile["spec1phot2"] = 1
                            relatedFilesTable.append(thisFile)

                    del s["filepath"]
                    del s["fitsFilepath"]
                    del s["relatedFiles"]

                    # ORDER THE DICTIONARY FOR THIS ROW OF RESULTS
                    orow = collections.OrderedDict()
                    keyOrder = ["TNSId", "survey", "obsdate", "specType", "transRedshift",
                                "telescope", "exptime", "reportAddedDate", "TNSuser"]
                    for k, v in s.iteritems():
                        if k not in keyOrder:
                            keyOrder.append(k)
                    for k in keyOrder:
                        try:
                            orow[k] = s[k]
                        except:
                            self.log.info(
                                "`%(k)s` not found in the source data for %(TNSId)s" % locals())
                            pass

                    specData.append(orow)

        self.log.info('completed the ``_parse_spectral_data`` method')
        return specData, relatedFilesTable