Read GPAD file. HTTP address okay. GZIPPED/BZIPPED file okay.

def init_associations(self, hdr_only=False, prt=sys.stdout):
        """Read GPAD file. HTTP address okay. GZIPPED/BZIPPED file okay."""
        import timeit
        import datetime
        associations = []
        tic = timeit.default_timer()
        if self.filename is None:
            return associations
        ver = None
        ntgpadobj_make = None
        hdrobj = GpadHdr()
        ifstrm = nopen(self.filename)
        _add_ns = self.godag is not None
        _get_ntgpadvals = self._get_ntgpadvals
        for lnum, line in enumerate(ifstrm, 1):
            # Read data
            if ntgpadobj_make:
                flds = self._split_line(line)
                try:
                    # pylint: disable=not-callable
                    ntgpad = ntgpadobj_make(_get_ntgpadvals(flds, _add_ns))
                    associations.append(ntgpad)
                # pylint: disable=broad-except
                except Exception as inst:
                    import traceback
                    traceback.print_exc()
                    sys.stdout.write("\n  **FATAL: {MSG}\n\n".format(MSG=str(inst)))
                    sys.stdout.write("**FATAL: {FIN}[{LNUM}]:\n{L}\n".format(
                        FIN=self.filename, L=line, LNUM=lnum))
                    for idx, val in enumerate(flds):
                        sys.stdout.write('{I:2} {VAL}\n'.format(I=idx, VAL=val))
                    ## if datobj is not None:
                    ##     datobj.prt_line_detail(sys.stdout, line)
                    sys.exit(1)
            # Read header
            else:
                if line[0] == '!':
                    if ver is None and line[1:13] == 'gpa-version:':
                        ver = line[13:].strip()
                    hdrobj.chkaddhdr(line)
                else:
                    self.hdr = hdrobj.get_hdr()
                    if hdr_only:
                        return associations
                    ntgpadobj_make = self._get_ntgpadnt(ver, _add_ns)._make
        # GPAD file has been read
        prt.write('HMS:{HMS} {N:7,} annotations READ: {ANNO}\n'.format(
            N=len(associations), ANNO=self.filename,
            HMS=str(datetime.timedelta(seconds=(timeit.default_timer()-tic)))))
        return associations