code: def orientation_from_string(string_ornt):
      """Return an array representation of an ornt string."""
      orientation_dict = dict(
          r=(0, 1), l=(0, -1), a=(1, 1), p=(1, -1), s=(2, 1), i=(2, -1)
      )
      ornt = tuple(orientation_dict[ii] for ii in string_ornt.lower())
      ornt = np.array(ornt)
      if _check_ornt(ornt):
          msg = (
              string_ornt
              + " does not seem to be a valid orientation string"
          )
          raise ValueError(msg)
      return ornt
  
imports: import logging
  from warnings import warn
  import numpy
  from scipy.linalg import inv, polar
  from dipy.io import gradients
  from dipy.core.onetime import auto_attr
  from dipy.core.geometry import vector_norm, vec2vec_rotmat
  from dipy.core.sphere import disperse_charges, HemiSphere
  from dipy.utils.deprecator import deprecate_with_version
label_desc: Use image node_id 22 for calling a global function with example usage: orientation_from_string(string_ornt) and returns: ornt