code: def loadbin(self, fobj, offset=0):
          
          fread = getattr(fobj, "read", None)
          if fread is None:
              f = open(fobj, "rb")
              fread = f.read
              fclose = f.close
          else:
              fclose = None
  
          try:
              self.frombytes(array('B', asbytes(fread())), offset=offset)
          finally:
              if fclose:
                  fclose()
docs: Load bin file into internal buffer. Not needed if source set in
          constructor. This will overwrite addresses without warning
          if object was already initialized.
  
          @param  fobj        file name or file-like object
          @param  offset      starting address offset