code: def test_to_from_yaml_json():
      ppl = slc.Stream(
          [
              slt.Rotate(
                  angle_range=(-106, 90), p=0.7, interpolation="nearest"
              ),
              slt.Rotate(
                  angle_range=(-106, 91), p=0.8, interpolation="nearest"
              ),
              slt.Rotate(
                  angle_range=(-106, 92),
                  p=0.2,
                  interpolation="bilinear",
              ),
              slt.Projection(
                  slc.Stream(
                      [
                          slt.Rotate(
                              angle_range=(-6, 90),
                              p=0.2,
                              padding="r",
                              interpolation="nearest",
                          ),
                      ]
                  )
              ),
          ]
      )
  
      serialized = {"stream": ppl.to_dict()}
      with open("/tmp/solt_tmp_json0.json", "w") as f:
          json_s = json.dumps(serialized, indent=4)
          f.write(json_s)
  
      with open("/tmp/solt_tmp_yaml0.yaml", "w") as f:
          yaml_s = yaml.safe_dump(serialized)
          f.write(yaml_s)
  
      ppl.to_json("/tmp/solt_tmp_json1.json")
      ppl.to_yaml("/tmp/solt_tmp_yaml1.yaml")
  
      loaded_from_json = slu.from_json("/tmp/solt_tmp_json1.json")
      loaded_from_yaml = slu.from_yaml("/tmp/solt_tmp_yaml1.yaml")
      assert json_s == loaded_from_json.to_json()
      assert yaml_s == loaded_from_yaml.to_yaml()
  
      loaded_from_json = slu.from_json(
          pathlib.Path("/tmp/solt_tmp_json1.json")
      )
      loaded_from_yaml = slu.from_yaml(
          pathlib.Path("/tmp/solt_tmp_yaml1.yaml")
      )
      assert (
          json_s == slu.from_yaml(loaded_from_json.to_yaml()).to_json()
      )
      assert (
          yaml_s == slu.from_json(loaded_from_yaml.to_json()).to_yaml()
      )
  
file_path: solt/tests/test_utils.py
imports: import solt.utils
  import solt.transforms
  import solt.core
  import pytest
  import json
  import pathlib
  import yaml
label_desc: Use image node_id 11 for calling a global function with example usage: test_to_from_yaml_json() without return types