def METHOD_NAME(plot):
    p.setup(timestep=1.0)
    cell_params_lif = {'cm': 0.25,
                       'i_offset': 0.0,
                       'tau_m': 20.0,
                       'tau_refrac': 2.0,
                       'tau_syn_E': 5.0,
                       'tau_syn_I': 5.0,
                       'v_reset': -70.0,
                       'v_rest': -65.0,
                       'v_thresh': -50.0
                       }
    def create_grid(n, label, dx=1.0, dy=1.0):
        grid_structure = p.Grid2D(dx=dx, dy=dy, x0=0.0, y0=0.0)
        return p.Population(n*n, p.IF_curr_exp(**cell_params_lif),
                            structure=grid_structure, label=label)
    # Parameters
    n = 5
    weight_to_spike = 2.0
    delay = 2
    runtime = 1000
    # Network population
    small_world = create_grid(n, 'small_world')
    small_world.set_max_atoms_per_core((10, 10))
    # SpikeInjector
    injectionConnection = [(0, 0)]
    spikeArray = {'spike_times': [[0]]}
    inj_pop = p.Population(1, p.SpikeSourceArray(**spikeArray),
                           label='inputSpikes_1')
    # Injector projection
    p.Projection(inj_pop, small_world,
                 p.FromListConnector(injectionConnection),
                 p.StaticSynapse(weight=weight_to_spike, delay=delay))
    # Connectors
    degree = 2.0
    rewiring = 0.4
    rng = NumpyRNG(seed=1)
    small_world_connector = p.SmallWorldConnector(degree, rewiring, rng=rng)
    # Projection for small world grid
    sw_pro = p.Projection(small_world, small_world, small_world_connector,
                          p.StaticSynapse(weight=2.0, delay=5))
    small_world.record(['v', 'spikes'])
    p.run(runtime)
    v = small_world.get_data('v')
    spikes = small_world.get_data('spikes')
    weights = sw_pro.get('weight', 'list')
    if plot:
        # pylint: disable=no-member
        Figure(
            # raster plot of the presynaptic neuron spike times
            Panel(spikes.segments[0].spiketrains,
                  yticks=True, markersize=0.2, xlim=(0, runtime), xticks=True),
            # membrane potential of the postsynaptic neuron
            Panel(v.segments[0].filter(name='v')[0],
                  ylabel="Membrane potential (mV)",
                  data_labels=[small_world.label], yticks=True,
                  xlim=(0, runtime), xticks=True),
            title="Simple small world connector",
            annotations="Simulated with {}".format(p.name())
        )
        plt.show()
    p.end()
    return v, spikes, weights