input: Write a python function to create a shared memory object and perform read and write operations on it.
  assert create_shared_memory('test', 1024) is not None
  assert write_to_shared_memory('test', b'hello', 0) == True
  assert read_from_shared_memory('test', 5, 0) == b'hello'
output: from multiprocessing import shared_memory
  
  def create_shared_memory(name, size):
      try:
          shm = shared_memory.SharedMemory(name=name, create=True, size=size)
          return shm
      except FileExistsError:
          return None
  
  def write_to_shared_memory(name, data, offset):
      try:
          shm = shared_memory.SharedMemory(name=name)
          shm.buf[offset:offset+len(data)] = data
          return True
      except Exception as e:
          return False
  
  def read_from_shared_memory(name, size, offset):
      try:
          shm = shared_memory.SharedMemory(name=name)
          data = bytes(shm.buf[offset:offset+size])
          return data
      except Exception as e:
          return None