def METHOD_NAME(
    shape, dtype, location, lock, 
    readonly=False, order='F', emulate_shm=False,
    **kwargs
  ):
  """Emulate shared memory using the filesystem."""
  dbytes = np.dtype(dtype).itemsize
  nbytes = Vec(*shape).rectVolume() * dbytes
  if emulate_shm:
    directory = mkdir(EMULATED_SHM_DIRECTORY)
    filename = os.path.join(directory, location)
  else:
    filename = location
  if lock:
    lock.acquire()
  try:
    allocate_shm_file(filename, nbytes, dbytes, readonly)
  finally:
    if lock:
      lock.release()
  with open(filename, 'r+b') as f:
    array_like = mmap.mmap(f.fileno(), 0) # map entire file
  renderbuffer = np.ndarray(buffer=array_like, dtype=dtype, shape=shape, order=order, **kwargs)
  renderbuffer.setflags(write=(not readonly))
  return array_like, renderbuffer