def timestep(t, dt):
    '\n    Converts a given time to an integer time step. This function slightly shifts\n    the time before dividing it by ``dt`` to make sure that multiples of ``dt``\n    do not end up in the preceding time step due to floating point issues. This\n    function is used in the refractoriness calculation.\n\n    .. versionadded:: 2.1.3\n\n    Parameters\n    ----------\n    t : np.ndarray, float, Quantity\n        The time to convert.\n    dt : float or Quantity\n        The length of a simulation time step.\n\n    Returns\n    -------\n    ts : np.ndarray, np.int64\n        The time step corresponding to the given time.\n\n    Notes\n    -----\n    This function cannot handle infinity values, use big values instead (e.g.\n    a `NeuronGroup` will use ``-1e4*second`` as the value of the ``lastspike``\n    variable for neurons that never spiked).\n    '
    elapsed_steps = np.array(((t + (0.001 * dt)) / dt), dtype=np.int64)
    if (elapsed_steps.shape == ()):
        elapsed_steps = elapsed_steps.item()
    return elapsed_steps
Converts a given time to an integer time step. This function slightly shifts
the time before dividing it by ``dt`` to make sure that multiples of ``dt``
do not end up in the preceding time step due to floating point issues. This
function is used in the refractoriness calculation.

.. versionadded:: 2.1.3

Parameters
----------
t : np.ndarray, float, Quantity
    The time to convert.
dt : float or Quantity
    The length of a simulation time step.

Returns
-------
ts : np.ndarray, np.int64
    The time step corresponding to the given time.

Notes
-----
This function cannot handle infinity values, use big values instead (e.g.
a `NeuronGroup` will use ``-1e4*second`` as the value of the ``lastspike``
variable for neurons that never spiked).
def timestep(t, dt):
    '\n    Converts a given time to an integer time step. This function slightly shifts\n    the time before dividing it by ``dt`` to make sure that multiples of ``dt``\n    do not end up in the preceding time step due to floating point issues. This\n    function is used in the refractoriness calculation.\n\n    .. versionadded:: 2.1.3\n\n    Parameters\n    ----------\n    t : np.ndarray, float, Quantity\n        The time to convert.\n    dt : float or Quantity\n        The length of a simulation time step.\n\n    Returns\n    -------\n    ts : np.ndarray, np.int64\n        The time step corresponding to the given time.\n\n    Notes\n    -----\n    This function cannot handle infinity values, use big values instead (e.g.\n    a `NeuronGroup` will use ``-1e4*second`` as the value of the ``lastspike``\n    variable for neurons that never spiked).\n    '
    elapsed_steps = np.array(((t + (0.001 * dt)) / dt), dtype=np.int64)
    if (elapsed_steps.shape == ()):
        elapsed_steps = elapsed_steps.item()
    return elapsed_steps