code: def _parse_format_options(view, options):
      """Given a user-provided options dictionary, extract the useful values."""
      max_cols = view.num_columns() + (1 if view._sides > 0 else 0)
      column_only_offset = (
          1 if view._sides > 0 or view._column_only else 0
      )
      return {
          "start_row": int(floor(max(options.get("start_row", 0), 0))),
          "end_row": int(
              ceil(
                  min(
                      options.get("end_row", view.num_rows()),
                      view.num_rows(),
                  )
              )
          ),
          "start_col": int(floor(max(options.get("start_col", 0), 0))),
          "end_col": int(
              ceil(
                  min(
                      max_cols,
                      (
                          options.get("end_col") + column_only_offset
                          if "end_col" in options
                          else max_cols
                      )
                      * (view._num_hidden_cols() + 1),
                  )
              )
          ),
          "index": options.get("index", False),
          "id": options.get("id", False),
          "leaves_only": options.get("leaves_only", False),
          "has_row_path": view._sides > 0 and (not view._column_only),
      }
  
imports: import numpy
  from math import floor, ceil, trunc
  from ._constants import COLUMN_SEPARATOR_STRING
  from .libpsppy import get_data_slice_unit, get_data_slice_zero, get_data_slice_one, get_data_slice_two, get_from_data_slice_unit, get_from_data_slice_zero, get_from_data_slice_one, get_from_data_slice_two, get_pkeys_from_data_slice_unit, get_pkeys_from_data_slice_zero, get_pkeys_from_data_slice_one, get_pkeys_from_data_slice_two, scalar_to_py
label_desc: Use image node_id 4 for calling a global function with example usage: _parse_format_options(view, options) and returns: dict