code: def _pack_rgb(rgb):
      """Pack an RGB sequence into a single integer.
  
      Used by :func:`read_annot` and :func:`write_annot` to generate
      "annotation values" for a Freesurfer ``.annot`` file.
  
      Parameters
      ----------
      rgb : ndarray, shape (n, 3)
          RGB colors
  
      Returns
      -------
      out : ndarray, shape (n, 1)
          Annotation values for each color.
      """
      bitshifts = 2 ** np.array([[0], [8], [16]], dtype=rgb.dtype)
      return rgb.dot(bitshifts)
  
file_path: nibabel/nibabel/freesurfer/io.py
imports: import getpass
  import time
  import warnings
  from collections import OrderedDict
  import numpy
  from ..openers import Opener
label_desc: Use image node_id 4 for calling a global function with example usage: _pack_rgb(rgb) and returns: rgb