code: def _prune(
      values,
      last_n: int = 0,
      skip_first_n: int = 0,
      skip_last_n: int = 0,
  ):
      """inline function to select first or last items of input list
  
      :param values: input list to select from
      :param int last_n: select last 'n' items of values. default is 0.
      :param int skip_first_n: skip first n items of values. default is 0. last_n takes precedence.
      :param int skip_last_n: in plot skip last 'n' periods. last_n takes precedence (optional)
      :return: list of selected values
      """
      if last_n > 0:
          return values[-last_n:]
      if skip_first_n > 0:
          values = values[skip_first_n:]
      if skip_last_n > 0:
          values = values[:-skip_last_n]
      return values
  
imports: from __future__ import annotations
  import datetime
  import json
  import logging
  import math
  import warnings
  from collections import defaultdict
  import numpy
  import pandas
  import plotly.express
  import plotly.graph_objects
  from popmon.resources import templates_env
label_desc: Use image node_id 12 for calling a global function with example usage: _prune(values, last_n, skip_first_n, skip_last_n) and returns: values, values