docs: def find_nearest_conn_objects(node_shp, branches, proj, conn_dist_weight, debug, branches_only=False):
      """Searches all `branches` for the nearest possible connection object per branch.
      
      Picks out 1 object out of 3 possible objects: 
      
      * 2 branch-adjacent stations and
      * 1 potentially created cable distributor on the line (perpendicular projection)).
      
      The resulting stack (list) is sorted ascending by distance from node.
  
      Args
      ----
      node_shp: :shapely:`Shapely Point object<points>`
          Shapely Point object of node
      branches: BranchDing0
          BranchDing0 objects of MV region
      proj: :pyproj:`pyproj Proj object< >`
          nodes' CRS to equidistant CRS (e.g. WGS84 -> ETRS)
      conn_dist_weight: float
          length weighting to prefer stations instead of direct line connection.
      debug: bool
          If True, information is printed during process
      branches_only: bool, defaults to False
          If True, only branch objects are considered as connection objects
  
      Returns
      -------
      :any:`list` 
          List of connection objects. 
          Each object is represented by dict with Ding0 object,
          shapely object, and distance to node.
      
      See Also
      --------
      mv_connect_satellites : for details on `conn_dist_weight` param
      """
  
      # threshold which is used to determine if 2 objects are on the same position (see below for details on usage)
      conn_diff_tolerance = cfg_ding0.get('mv_routing', 'conn_diff_tolerance')
  
      conn_objects_min_stack = []
  
      for branch in branches:
          stations = branch['adj_nodes']
  
          # create shapely objects for 2 stations and line between them, transform to equidistant CRS
          station1_shp = transform(proj, stations[0].geo_data)
          station2_shp = transform(proj, stations[1].geo_data)
          line_shp = LineString([station1_shp, station2_shp])
  
          # create dict with DING0 objects (line & 2 adjacent stations), shapely objects and distances
          if not branches_only:
              conn_objects = {'s1': {'obj': stations[0],
                                     'shp': station1_shp,
                                     'dist': node_shp.distance(station1_shp) * conn_dist_weight * 0.999},
                              's2': {'obj': stations[1],
                                     'shp': station2_shp,
                                     'dist': node_shp.distance(station2_shp) * conn_dist_weight * 0.999},
                              'b': {'obj': branch,
                                    'shp': line_shp,
                                    'dist': node_shp.distance(line_shp)}}
  
              # Remove branch from the dict of possible conn. objects if it is too close to a node.
              # Without this solution, the target object is not unique for different runs (and so
              # were the topology)
              if (
                      abs(conn_objects['s1']['dist'] - conn_objects['b']['dist']) < conn_diff_tolerance
                   or abs(conn_objects['s2']['dist'] - conn_objects['b']['dist']) < conn_diff_tolerance
                 ):
                  del conn_objects['b']
  
              # remove MV station as possible connection point
              if isinstance(conn_objects['s1']['obj'], MVStationDing0):
                  del conn_objects['s1']
              elif isinstance(conn_objects['s2']['obj'], MVStationDing0):
                  del conn_objects['s2']
  
          else:
              conn_objects = {'b': {'obj': branch,
                                    'shp': line_shp,
                                    'dist': node_shp.distance(line_shp)}}
  
  
  
          # find nearest connection point on given triple dict (2 branch-adjacent stations + cable dist. on line)
          conn_objects_min = min(conn_objects.values(), key=lambda v: v['dist'])
          #if not branches_only:
          #    conn_objects_min_stack.append(conn_objects_min)
          #elif isinstance(conn_objects_min['shp'], LineString):
          #    conn_objects_min_stack.append(conn_objects_min)
          conn_objects_min_stack.append(conn_objects_min)
  
      # sort all objects by distance from node
      conn_objects_min_stack = [_ for _ in sorted(conn_objects_min_stack, key=lambda x: x['dist'])]
  
      if debug:
          logger.debug('Stack length: {}'.format(len(conn_objects_min_stack)))
  
      return conn_objects_min_stack