code: def disk(radius, dim=2):
      """
      D = disk(radius, dim=2)
  
      Return a binary disk structuring element of radius ``radius`` and dimension ``dim``
  
      Parameters
      ----------
      radius : int
          Radius (in pixels) of returned disk
      dim : int, optional
          Dimension of returned array (default: 2)
  
      Returns
      -------
      D : boolean ndarray
      """
      import numpy as np
  
      if dim <= 0:
          raise ValueError(
              "mahotas.morph.disk: dimension must be positive"
          )
      shape = [(radius * 2 + 1) for _ in range(dim)]
      if dim == 2:
          return _morph.disk_2d(np.zeros(shape, bool), radius)
      indices = np.indices(shape, float)
      indices -= radius
      indices **= 2
      return indices.sum(0) < (radius**2)
  
imports: from __future__ import division
  import numpy
  from .internal import _get_output, _verify_is_integer_type, _check_2
  from .None import _morph
label_desc: Use image node_id 2 for calling a global function with example usage: disk(radius, dim) and returns: unknown, _morph