docstr: Given a sorted list of floats, returns the number closest to num.
  
  Implements a binary search.
docstr_tok: ["Given","a","sorted","list","of","floats",",","returns","the","number","closest","to","num",".","Implements","a","binary","search","."]
code: def get_closest_pt(
      cls, sorted_list: List[float], num: float
  ) -> float:
      """
      Given a sorted list of floats, returns the number closest to num.
  
      Implements a binary search.
      """
      assert sorted_list
      if len(sorted_list) == 1:
          return sorted_list[0]
      else:
          halfway_indx = (len(sorted_list) - 1) // 2
          if sorted_list[halfway_indx] > num:
              return cls.get_closest_pt(
                  sorted_list[: halfway_indx + 1], num
              )
          elif sorted_list[halfway_indx + 1] < num:
              return cls.get_closest_pt(
                  sorted_list[halfway_indx + 1 :], num
              )
          elif abs(sorted_list[halfway_indx] - num) < abs(
              sorted_list[halfway_indx + 1] - num
          ):
              return sorted_list[halfway_indx]
          else:
              return sorted_list[halfway_indx + 1]
  
imports: from typing import Any, Dict, List, Optional, Union
  import copy
  import numpy
  import pandas
  import xgboost
  import gc
  from collections import defaultdict
  from gluonts.core.component import equals, validated
label_desc: Use image node_id 7 for calling the QRX obj's underlying member method code with example usage: obj.get_closest_pt(cls, sorted_list, num) and returns: sorted_list, cls, cls, sorted_list, sorted_list