code: def blackman(M):
      if M < 1:
          return ivy.array([])
      if M == 1:
          return ivy.ones((1,))
      n = ivy.arange(0, M)
      alpha = 0.16
      a0 = (1 - alpha) / 2
      a1 = 1 / 2
      a2 = alpha / 2
      ret = (
          a0
          - a1 * ivy.cos(2 * ivy.pi * n / (M - 1))
          + a2 * ivy.cos(4 * ivy.pi * n / (M - 1))
      )
      return ret
  
imports: import ivy
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back, handle_jax_dtype
  from ivy.functional.frontends.jax.numpy import promote_types_of_jax_inputs
label_desc: Use image node_id 7 for calling a global function with example usage: blackman(M) and returns: ret, ivy, ivy