code: def __parse_world(
          world, radius=None, species_list=None, max_count=None,
          predicator=None):
      
      from ecell4_base.core import Species
  
      if species_list is None:
          species_list = [
              p.species().serial() for pid, p in world.list_particles()]
          species_list = sorted(
              set(species_list), key=species_list.index)  # XXX: pick unique ones
  
      species = []
      for name in species_list:
          particles = [
              {'pos': p.position(), 'r': p.radius()}
              for pid, p in world.list_particles(Species(name))
              if predicator is None or predicator(pid, p)]
          # particles = [
          #     {'pos': p.position(), 'r': p.radius()}
          #     for pid, p in world.list_particles()
          #     if (p.species().serial() == name and
          #         (predicator is None or predicator(pid, p)))]
  
          if len(particles) == 0:
              continue
  
          if max_count is not None and len(particles) > max_count:
              particles = random.sample(particles, max_count)
  
          data = {
              'x': [p['pos'][0] for p in particles],
              'y': [p['pos'][1] for p in particles],
              'z': [p['pos'][2] for p in particles]
          }
  
          # assume that all particles belong to one species have the same radius
          r = max([p['r'] for p in particles]) if radius is None else radius
          r = r if r > 0 else min(world.edge_lengths()) * 0.005
          size = 30.0 / max(world.edge_lengths()) * r
  
          species.append({
              'name': name,
              'data': data,
              'size': size
          })
  
      return species
docs: Private function to parse world. Return infomation about particles
      (name, coordinates and particle size) for each species.