def METHOD_NAME(device):
    """Make a snapshot with polymers and distance constraints."""
    def make_snapshot(polymer_length=10,
                      N_polymers=10,
                      polymer_spacing=1.2,
                      bead_spacing=1.1):
        """Make the snapshot.
        Args:
            polymer_length: Number of particles in each polymer
            N_polymers: Number of polymers to place
            polymer_spacing: distance between the polymers
            bead_spacing: distance between the beads in the polymer
        Place N_polymers polymers in a 2D simulation with distance constraints
        between beads in each polymer.
        """
        s = hoomd.Snapshot(device.communicator)
        if s.communicator.rank == 0:
            s.configuration.box = [
                polymer_spacing * N_polymers, bead_spacing * polymer_length, 0,
                0, 0, 0
            ]
            s.particles.N = polymer_length * N_polymers
            s.particles.types = ['A']
            x_coords = numpy.linspace(-polymer_spacing * N_polymers / 2,
                                      polymer_spacing * N_polymers / 2,
                                      num=N_polymers,
                                      endpoint=False) + polymer_spacing / 2
            y_coords = numpy.linspace(-bead_spacing * polymer_length / 2,
                                      bead_spacing * polymer_length / 2,
                                      num=N_polymers,
                                      endpoint=False) + bead_spacing / 2
            position = []
            constraint_values = []
            constraint_groups = []
            for x in x_coords:
                for i, y in enumerate(y_coords):
                    position.append([x, y, 0])
                    if i & 1:
                        constraint_values.append(bead_spacing)
                        tag = len(position) - 1
                        constraint_groups.append([tag, tag - 1])
            s.particles.position[:] = position
            s.constraints.N = len(constraint_values)
            s.constraints.value[:] = constraint_values
            s.constraints.group[:] = constraint_groups
        return s
    return make_snapshot