code: def _coord_byval(coord: COORD) -> c_long:
      """
      Turns a COORD object into a c_long.
      This will cause it to be passed by value instead of by reference. (That is what I think at least.)
  
      When running ``ptipython`` is run (only with IPython), we often got the following error::
  
           Error in 'SetConsoleCursorPosition'.
           ArgumentError("argument 2: <class 'TypeError'>: wrong type",)
       argument 2: <class 'TypeError'>: wrong type
  
      It was solved by turning ``COORD`` parameters into a ``c_long`` like this.
  
      More info: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686025(v=vs.85).aspx
      """
      return c_long(coord.Y * 0x10000 | coord.X & 0xFFFF)
  
imports: from __future__ import annotations
  import sys
  import os
  from ctypes import ArgumentError, byref, c_char, c_long, c_uint, c_ulong, pointer
  from ctypes.wintypes import DWORD, HANDLE
  from typing import Callable, TextIO, TypeVar
  from prompt_toolkit.cursor_shapes import CursorShape
  from prompt_toolkit.data_structures import Size
  from prompt_toolkit.styles import ANSI_COLOR_NAMES, Attrs
  from prompt_toolkit.utils import get_cwidth
  from prompt_toolkit.win32_types import CONSOLE_SCREEN_BUFFER_INFO, COORD, SMALL_RECT, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE
  from ..utils import SPHINX_AUTODOC_RUNNING
  from .base import Output
  from .color_depth import ColorDepth
label_desc: Use image node_id 1 for calling a global function with example usage: _coord_byval(coord) and returns: c_long