code: def tofile(self, f):
          
          f.write(pack(self.FILE_FMT, self.scale, self.ratio,
                       self.initial_capacity, self.error_rate))
  
          # Write #-of-filters
          f.write(pack(b'<l', len(self.filters)))
  
          if len(self.filters) > 0:
              # Then each filter directly, with a header describing
              # their lengths.
              headerpos = f.tell()
              headerfmt = b'<' + b'Q'*(len(self.filters))
              f.write(b'.' * calcsize(headerfmt))
              filter_sizes = []
              for filter in self.filters:
                  begin = f.tell()
                  filter.tofile(f)
                  filter_sizes.append(f.tell() - begin)
  
              f.seek(headerpos)
              f.write(pack(headerfmt, *filter_sizes))
docs: Serialize this ScalableBloomFilter into the file-object
          `f'.