<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get(self, segids, remove_duplicate_vertices=True, fuse=True, chunk_size=None):
 """ Merge fragments derived from these segids into a single vertex and face list. Why merge multiple segids into one mesh? For example, if you have a set of segids that belong to the same neuron. segids: (iterable or int) segids to render into a single mesh Optional: remove_duplicate_vertices: bool, fuse exactly matching vertices fuse: bool, merge all downloaded meshes into a single mesh chunk_size: [chunk_x, chunk_y, chunk_z] if pass only merge at chunk boundaries Returns: { num_vertices: int, } """

    segids = toiter(segids)
    dne = self._check_missing_manifests(segids)

    if dne:
      missing = ', '.join([ str(segid) for segid in dne ])
      raise ValueError(red(
        'Segment ID(s) {} are missing corresponding mesh manifests.\nAborted.' \
        .format(missing)
      ))

    fragments = self._get_manifests(segids)
    fragments = fragments.values()
    fragments = list(itertools.chain.from_iterable(fragments)) # flatten
    fragments = self._get_mesh_fragments(fragments)
    fragments = sorted(fragments, key=lambda frag: frag['filename']) # make decoding deterministic

    # decode all the fragments
    meshdata = defaultdict(list)
    for frag in tqdm(fragments, disable=(not self.vol.progress), desc="Decoding Mesh Buffer"):
      segid = filename_to_segid(frag['filename'])
      mesh = decode_mesh_buffer(frag['filename'], frag['content'])
      meshdata[segid].append(mesh)

    def produce_output(mdata):
      vertexct = np.zeros(len(mdata) + 1, np.uint32)
      vertexct[1:] = np.cumsum([ x['num_vertices'] for x in mdata ])
      vertices = np.concatenate([ x['vertices'] for x in mdata ])
      faces = np.concatenate([ 
        mesh['faces'] + vertexct[i] for i, mesh in enumerate(mdata) 
      ])

      if remove_duplicate_vertices:
        if chunk_size:
          vertices, faces = remove_duplicate_vertices_cross_chunks(vertices,
                                                                   faces,
                                                                   chunk_size)
        else:
          vertices, faces = np.unique(vertices[faces], return_inverse=True, axis=0)
          faces = faces.astype(np.uint32)

      return {
        'num_vertices': len(vertices),
        'vertices': vertices,
        'faces': faces,
      }

    if fuse:
      meshdata = [ (segid, mdata) for segid, mdata in six.iteritems(meshdata) ]
      meshdata = sorted(meshdata, key=lambda sm: sm[0])
      meshdata = [ mdata for segid, mdata in meshdata ]
      meshdata = list(itertools.chain.from_iterable(meshdata)) # flatten
      return produce_output(meshdata)
    else:
      return { segid: produce_output(mdata) for segid, mdata in six.iteritems(meshdata) }