code: def sinpi(x):
      y = np.abs(x) % 2.0
      n = np.round(2.0 * y)
      assert n >= 0
      assert n <= 4
  
      if n == 0:
          r = np.sin(np.pi * y)
      elif n == 1:
          r = np.cos(np.pi * (y - 0.5))
      elif n == 2:
          r = np.sin(np.pi * (1.0 - y))
      elif n == 3:
          r = -np.cos(np.pi * (y - 1.5))
      elif n == 4:
          r = np.sin(np.pi * (y - 2.0))
      else:
          raise Exception("Unreachable code")
  
      return np.copysign(1.0, x) * r
  
imports: from typing import Optional, Union, Tuple, List, Sequence
  import numpy
  import numpy.typing
  import ivy
  from ivy import promote_types_of_inputs
  from ivy.functional.backends.numpy.helpers import _scalar_output_to_0d_array
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
label_desc: Use image node_id 24 for calling a global function with example usage: sinpi(x) and returns: unknown