code: def fromfile(file, dtype, count, *args, **kwargs):
      
  
      try:
          return np.fromfile(file, dtype=dtype, count=count, *args, **kwargs)
      except (TypeError, IOError, UnsupportedOperation):
          return np.frombuffer(
              file.read(count * np.dtype(dtype).itemsize),
              dtype=dtype, count=count, *args, **kwargs)
docs: Wrapper around np.fromfile to support any file-like object