code: def sample(data: pd.Series, sample_size: int = 10) -> pd.Series:
      """Sample N records from the data.
  
      Args:
          data (pd.Series): Time series.
          sample_size (int): Size of the sample.
  
      Returns:
          pd.Series: First and last ``sample_size/2`` records in ``data``.
      """
      size = len(data)
      sample_size = sample_size // 2
      return data.iloc[
          np.r_[:sample_size, size - sample_size : size]
      ].copy()
  
file_path: tslumen/tslumen/profile/summary.py
imports: from typing import Any, Optional
  import numpy
  import pandas
  from statsmodels.tsa.tsatools import freq_to_period
  from tslumen.profile.base import ProfilingFunction, TypeSeriesFrame
label_desc: Use image node_id 12 for calling a global function with example usage: sample(data, sample_size) and returns: data