code: def test_json_writer(tmpdir, pdf, gdf):
      pdf_df_fname = tmpdir.join("pdf_df.json")
      gdf_df_fname = tmpdir.join("gdf_df.json")
  
      pdf.to_json(pdf_df_fname)
      gdf.to_json(gdf_df_fname)
  
      assert os.path.exists(pdf_df_fname)
      assert os.path.exists(gdf_df_fname)
  
      expect_df = pd.read_json(pdf_df_fname)
      got_df = pd.read_json(gdf_df_fname)
  
      assert_eq(expect_df, got_df)
  
      for column in pdf.columns:
          pdf_series_fname = tmpdir.join(
              column + "_" + "pdf_series.json"
          )
          gdf_series_fname = tmpdir.join(
              column + "_" + "gdf_series.json"
          )
  
          pdf[column].to_json(pdf_series_fname)
          gdf[column].to_json(gdf_series_fname)
  
          assert os.path.exists(pdf_series_fname)
          assert os.path.exists(gdf_series_fname)
  
          expect_series = pd.read_json(pdf_series_fname, typ="series")
          got_series = pd.read_json(gdf_series_fname, typ="series")
  
          assert_eq(expect_series, got_series)
  
          # Make sure results align for regular strings, not just files
          pdf_string = pdf[column].to_json()
          gdf_string = pdf[column].to_json()
          assert_eq(pdf_string, gdf_string)
  
imports: import copy
  import gzip
  import itertools
  import os
  from io import BytesIO, StringIO
  from pathlib import Path
  import numpy
  import pandas
  import pyarrow
  import pytest
  import cudf
  from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, TIMEDELTA_TYPES, assert_eq
label_desc: Use image node_id 7 for calling a global function with example usage: test_json_writer(tmpdir, pdf, gdf) without return types