code: def _euler_step(xf_traj, yf_traj, dmap, f):
      """Simple Euler integration step that extends streamline to boundary."""
      ny, nx = dmap.grid.shape
      xi = xf_traj[-1]
      yi = yf_traj[-1]
      cx, cy = f(xi, yi)
      if cx == 0:
          dsx = np.inf
      elif cx < 0:
          dsx = xi / -cx
      else:
          dsx = (nx - 1 - xi) / cx
      if cy == 0:
          dsy = np.inf
      elif cy < 0:
          dsy = yi / -cy
      else:
          dsy = (ny - 1 - yi) / cy
      ds = min(dsx, dsy)
      xf_traj.append(xi + cx * ds)
      yf_traj.append(yi + cy * ds)
      return ds, xf_traj, yf_traj
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  from six.moves import xrange
  import numpy
  import matplotlib
  import matplotlib.cm
  import matplotlib.colors
  import matplotlib.collections
  import matplotlib.lines
  import matplotlib.patches
label_desc: Use image node_id 4 for calling a global function with example usage: _euler_step(xf_traj, yf_traj, dmap, f) and returns: ds,  xf_traj,  yf_traj