code: def test_gifti_round_trip():
      # From section 14.4 in GIFTI Surface Data Format Version 1.0
      # (with some adaptations)
  
      test_data = b"""<?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE GIFTI SYSTEM "http://www.nitrc.org/frs/download.php/1594/gifti.dtd">
  <GIFTI
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.nitrc.org/frs/download.php/1303/GIFTI_Caret.xsd"
  Version="1.0"
  NumberOfDataArrays="2">
  <MetaData>
  <MD>
  <Name><![CDATA[date]]></Name>
  <Value><![CDATA[Thu Nov 15 09:05:22 2007]]></Value>
  </MD>
  </MetaData>
  <LabelTable/>
  <DataArray Intent="NIFTI_INTENT_POINTSET"
  DataType="NIFTI_TYPE_FLOAT32"
  ArrayIndexingOrder="RowMajorOrder"
  Dimensionality="2"
  Dim0="4"
  Dim1="3"
  Encoding="ASCII"
  Endian="LittleEndian"
  ExternalFileName=""
  ExternalFileOffset="">
  <CoordinateSystemTransformMatrix>
  <DataSpace><![CDATA[NIFTI_XFORM_TALAIRACH]]></DataSpace>
  <TransformedSpace><![CDATA[NIFTI_XFORM_TALAIRACH]]></TransformedSpace>
  <MatrixData>
  1.000000 0.000000 0.000000 0.000000
  0.000000 1.000000 0.000000 0.000000
  0.000000 0.000000 1.000000 0.000000
  0.000000 0.000000 0.000000 1.000000
  </MatrixData>
  </CoordinateSystemTransformMatrix>
  <Data>
  10.5 0 0
  0 20.5 0
  0 0 30.5
  0 0 0
  </Data>
  </DataArray>
  <DataArray Intent="NIFTI_INTENT_TRIANGLE"
  DataType="NIFTI_TYPE_INT32"
  ArrayIndexingOrder="RowMajorOrder"
  Dimensionality="2"
  Dim0="4"
  Dim1="3"
  Encoding="ASCII"
  Endian="LittleEndian"
  ExternalFileName="" ExternalFileOffset="">
  <Data>
  0 1 2
  1 2 3
  0 1 3
  0 2 3
  </Data>
  </DataArray>
  </GIFTI>"""
  
      exp_verts = np.zeros((4, 3))
      exp_verts[0, 0] = 10.5
      exp_verts[1, 1] = 20.5
      exp_verts[2, 2] = 30.5
      exp_faces = np.asarray(
          [[0, 1, 2], [1, 2, 3], [0, 1, 3], [0, 2, 3]], dtype=np.int32
      )
  
      def _check_gifti(gio):
          vertices = gio.get_arrays_from_intent(
              "NIFTI_INTENT_POINTSET"
          )[0].data
          faces = gio.get_arrays_from_intent("NIFTI_INTENT_TRIANGLE")[
              0
          ].data
          assert_array_equal(vertices, exp_verts)
          assert_array_equal(faces, exp_faces)
  
      bio = BytesIO()
      fmap = dict(image=FileHolder(fileobj=bio))
  
      bio.write(test_data)
      bio.seek(0)
      gio = GiftiImage.from_file_map(fmap)
      _check_gifti(gio)
      # Write and read again
      bio.seek(0)
      gio.to_file_map(fmap)
      bio.seek(0)
      gio2 = GiftiImage.from_file_map(fmap)
      _check_gifti(gio2)
  
imports: import itertools
  import sys
  import warnings
  from io import BytesIO
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from nibabel.tmpdirs import InTemporaryDirectory
  from ...None import load
  from ...fileholders import FileHolder
  from ...nifti1 import data_type_codes
  from ...testing import get_test_data
  from ..None import GiftiCoordSystem, GiftiDataArray, GiftiImage, GiftiLabel, GiftiLabelTable, GiftiMetaData, GiftiNVPairs
  from .test_parse_gifti_fast import DATA_FILE1, DATA_FILE2, DATA_FILE3, DATA_FILE4, DATA_FILE5, DATA_FILE6
label_desc: Use image node_id 14 for calling a global function with example usage: test_gifti_round_trip() without return types