code: def perm(N, k, exact=False):
      """Permutations of N things taken k at a time, i.e., k-permutations of N.
  
      It's also known as "partial permutations".
  
      Parameters
      ----------
      N : int, ndarray
          Number of things.
      k : int, ndarray
          Number of elements taken.
      exact : bool, optional
          If `exact` is False, then floating point precision is used, otherwise
          exact long integer is computed.
  
      Returns
      -------
      val : int, ndarray
          The number of k-permutations of N.
  
      Notes
      -----
      - Array arguments accepted only for exact=False case.
      - If k > N, N < 0, or k < 0, then a 0 is returned.
  
      Examples
      --------
      >>> from scipy.special import perm
      >>> k = np.array([3, 4])
      >>> n = np.array([10, 10])
      >>> perm(n, k)
      array([  720.,  5040.])
      >>> perm(10, 3, exact=True)
      720
  
      """
      if exact:
          if (k > N) or (N < 0) or (k < 0):
              return 0
          val = 1
          for i in range(N - k + 1, N + 1):
              val *= i
          return val
      else:
          k, N = asarray(k), asarray(N)
          cond = (k <= N) & (N >= 0) & (k >= 0)
          vals = poch(N - k + 1, k)
          if isinstance(vals, np.ndarray):
              vals[~cond] = 0
          elif not cond:
              vals = np.float64(0)
          return vals
  
imports: import operator
  import numpy
  import math
  from numpy import pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, where, mgrid, sin, place, issubdtype, extract, inexact, nan, zeros, sinc
  from .None import _ufuncs
  from ._ufuncs import mathieu_a, mathieu_b, iv, jv, gamma, psi, hankel1, hankel2, yv, kv, ndtri, poch, binom, hyp0f1
  from .None import specfun
  from .None import orthogonal
  from ._comb import _comb_int
label_desc: Use image node_id 54 for calling a global function with example usage: perm(N, k, exact) and returns: val, vals, int