docs: def get_boundaries(bounddict_file, slitlet_number):
      """Read the bounddict json file and return the polynomial boundaries.
  
      Parameters
      ----------
      bounddict_file : file handler
          File containing the bounddict JSON data.
      slitlet_number : int
          Number of slitlet.
  
      Returns
      -------
      pol_lower_boundary : numpy polynomial
          Polynomial defining the lower boundary of the slitlet.
      pol_upper_boundary : numpy polynomial
          Polynomial defining the upper boundary of the slitlet.
      xmin_lower : float
          Minimum abscissae for the lower boundary.
      xmax_lower : float
          Maximum abscissae for the lower boundary.
      xmin_upper : float
          Minimum abscissae for the upper boundary.
      xmax_upper : float
          Maximum abscissae for the upper boundary.
      csu_bar_slit_center : float
          CSU bar slit center (in mm)
  
      """
  
      bounddict = json.loads(open(bounddict_file.name).read())
  
      # return values in case the requested slitlet number is not defined
      pol_lower_boundary = None
      pol_upper_boundary = None
      xmin_lower = None
      xmax_lower = None
      xmin_upper = None
      xmax_upper = None
      csu_bar_slit_center = None
  
      # search the slitlet number in bounddict
      slitlet_label = "slitlet" + str(slitlet_number).zfill(2)
      if slitlet_label in bounddict['contents'].keys():
          list_date_obs = list(bounddict['contents'][slitlet_label].keys())
          list_date_obs.sort()
          num_date_obs = len(list_date_obs)
          if num_date_obs == 1:
              date_obs = list_date_obs[0]
              tmp_dict = bounddict['contents'][slitlet_label][date_obs]
              pol_lower_boundary = Polynomial(tmp_dict['boundary_coef_lower'])
              pol_upper_boundary = Polynomial(tmp_dict['boundary_coef_upper'])
              xmin_lower = tmp_dict['boundary_xmin_lower']
              xmax_lower = tmp_dict['boundary_xmax_lower']
              xmin_upper = tmp_dict['boundary_xmin_upper']
              xmax_upper = tmp_dict['boundary_xmax_upper']
              csu_bar_slit_center = tmp_dict['csu_bar_slit_center']
          else:
              raise ValueError("num_date_obs =", num_date_obs,
                               " (must be 1)")
      else:
          print("WARNING: slitlet number " + str(slitlet_number) +
                " is not available in " + bounddict_file.name)
  
      # return result
      return pol_lower_boundary, pol_upper_boundary, \
             xmin_lower, xmax_lower, xmin_upper, xmax_upper, \
             csu_bar_slit_center