def _fromfile(self, fh):
        fh.seek(0)
        data = fh.read(4096)
        if (len(data) < 7) or not (b'0' < data[1:2] < b'8'):
            raise ValueError("Not a Netpbm file:\n%s" % data[:32])
        try:
            self._read_pam_header(data)
        except Exception:
            try:
                self._read_pnm_header(data)
            except Exception:
                raise ValueError("Not a Netpbm file:\n%s" % data[:32])
Initialize instance from open file.
dataset/ETHPy150Open SheffieldML/GPy/GPy/util/netpbmfile.py/NetpbmFile._fromfile