code: def f1(x, d=0):
      if d is None:
          return "sin"
      if x is None:
          return "sin(x)"
      if d % 4 == 0:
          return sin(x)
      if d % 4 == 1:
          return cos(x)
      if d % 4 == 2:
          return -sin(x)
      if d % 4 == 3:
          return -cos(x)
  
imports: import itertools
  import os
  import numpy
  from numpy.testing import assert_equal, assert_allclose, assert_, assert_almost_equal, assert_array_almost_equal
  from pytest import raises
  import pytest
  from scipy._lib._testutils import check_free_memory
  from numpy import array, asarray, pi, sin, cos, arange, dot, ravel, sqrt, round
  from scipy import interpolate
  from scipy.interpolate.fitpack import splrep, splev, bisplrep, bisplev, sproot, splprep, splint, spalde, splder, splantider, insert, dblint
  from scipy.interpolate.dfitpack import regrid_smth
  from scipy.interpolate.fitpack2 import dfitpack_int
label_desc: Use image node_id 3 for calling a global function with example usage: f1(x, d) and returns: str, str, sin, cos, unknown, unknown