code: def test_create_field(N, discretization, out_dims, jitting):
      domain = Domain(N, dx=[1.0] * len(N))
  
      true_size = list(N)
      if out_dims == 0:
          true_size += [1]
      else:
          true_size += [out_dims]
  
      def get(key):
          params = jnp.ones(domain.N)
          if out_dims > 0:
              params = jnp.expand_dims(params, -1)
          if out_dims > 1:
              params = jnp.concatenate([params] * out_dims, -1)
  
          field = discretization.from_grid(params, domain)
          return field
  
      get = jit(get) if jitting else get
  
      # Twice for getting leaked tracers if jitting
      field = get(PRNGKEY)
      if jitting:
          field = get(PRNGKEY)
  
      assert field.params.shape == tuple(true_size)
  
imports: import pytest
  from jax import jit
  from jax import numpy
  from jax import random
  from jaxdf.discretization import FiniteDifferences, FourierSeries, OnGrid
  from jaxdf.geometry import Domain
  from jaxdf.operators import inverse
label_desc: Use image node_id 1 for calling a global function with example usage: test_create_field(N, discretization, out_dims, jitting) and returns: field