code: def noncentral_chisquare(df, nonc, size=None):
      if ivy.any(df <= 0):
          raise ValueError("Degree of freedom must be greater than 0")
      if ivy.has_nans(nonc):
          return ivy.nan
      if ivy.any(nonc == 0):
          return chisquare(df, size=size)
      if ivy.any(df < 1):
          n = standard_normal() + ivy.sqrt(nonc)
          return chisquare(df - 1, size=size) + n * n
      else:
          i = poisson(nonc / 2.0, size=size)
          return chisquare(df + 2 * i, size=size)
  
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, from_zero_dim_arrays_to_scalar
  from ivy import with_supported_dtypes
label_desc: Use image node_id 17 for calling a global function with example usage: noncentral_chisquare(df, nonc, size) and returns: ivy, chisquare, unknown, chisquare