code: def chisquare(df, size=None):
      df = ivy.array(df)  # scalar ints and floats are also array_like
      if ivy.any(df <= 0):
          raise ValueError("df <= 0")
  
      # ivy.gamma() throws an error if both alpha is an array and a shape is passed
      # so this part broadcasts df into the shape of `size`` first to keep it happy.
      if size is not None:
          df = df * ivy.ones(size)
  
      return ivy.gamma(df / 2, 2, dtype="float64")
  
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 3 for calling a global function with example usage: chisquare(df, size) and returns: ivy