docs: def _export_prb_file(recording, file_name, format=None, adjacency_distance=None, graph=False, geometry=True, radius=100,
                       dimensions='all'):
      '''Exports .prb file
  
      Parameters
      ----------
      recording: RecordingExtractor
          The recording extractor to save probe file from
      file_name: str
          probe filename to be exported to
      format: str
          'klusta' | 'spiking_circus' (defualt=None)
      adjacency_distance: float
          distance to consider 2 channels adjacent (if 'location' is a property)
      graph: bool
          if True graph information is extracted and saved
      geometry:
          if True geometry is saved
      radius: float
          radius for template-matching (if format is 'spyking_circus')
      '''
      if format == 'klusta':
          graph = True
          geometry = False
      elif format == 'spyking_circus':
          graph = False
          geometry = True
      else:
          graph = True
          geometry = True
  
      file_name = Path(file_name)
      assert file_name is not None
      abspath = file_name.absolute()
  
      if geometry:
          if 'location' in recording.get_channel_property_names():
              positions = np.array([recording.get_channel_property(chan, 'location')
                                    for chan in recording.get_channel_ids()])
              if dimensions is not None:
                  positions = positions[:, dimensions]
          else:
              print("'location' property is not available and it will not be saved.")
              positions = None
              geometry = False
      else:
          positions = None
  
      if 'group' in recording.get_channel_property_names():
          groups = np.array([recording.get_channel_property(chan, 'group') for chan in recording.get_channel_ids()])
          channel_groups = np.unique([groups])
      else:
          print("'group' property is not available and it will not be saved.")
          channel_groups = [0]
          groups = np.array([0] * recording.get_num_channels())
  
      n_elec = recording.get_num_channels()
  
      # find adjacency graph
      if graph:
          if positions is not None and adjacency_distance is not None:
              adj_graph = []
              for chg in channel_groups:
                  group_graph = []
                  elecs = list(np.where(groups == chg)[0])
                  for i in range(len(elecs)):
                      for j in range(i, len(elecs)):
                          if elecs[i] != elecs[j]:
                              if np.linalg.norm(positions[elecs[i]] - positions[elecs[j]]) < adjacency_distance:
                                  group_graph.append((elecs[i], elecs[j]))
                  adj_graph.append(group_graph)
          else:
              # all connected by group
              adj_graph = []
              for chg in channel_groups:
                  group_graph = []
                  elecs = list(np.where(groups == chg)[0])
                  for i in range(len(elecs)):
                      for j in range(i, len(elecs)):
                          if elecs[i] != elecs[j]:
                              group_graph.append((elecs[i], elecs[j]))
                  adj_graph.append(group_graph)
  
      with abspath.open('w') as f:
          f.write('\n')
          if format == 'spyking_circus':
              f.write('total_nb_channels = ' + str(n_elec) + '\n')
              f.write('radius = ' + str(radius) + '\n')
          f.write('channel_groups = {\n')
          if len(channel_groups) > 0:
              for i_chg, chg in enumerate(channel_groups):
                  f.write("     " + str(int(chg)) + ": ")
                  elecs = list(np.where(groups == chg)[0])
                  f.write("\n        {\n")
                  f.write("           'channels': " + str(elecs) + ',\n')
                  if graph:
                      if len(adj_graph) == 1:
                          f.write("           'graph':  " + str(adj_graph[0]) + ',\n')
                      else:
                          f.write("           'graph':  " + str(adj_graph[i_chg]) + ',\n')
                  else:
                      f.write("           'graph':  [],\n")
                  if geometry:
                      f.write("           'geometry':  {\n")
                      for i, pos in enumerate(positions[elecs]):
                          f.write('               ' + str(elecs[i]) + ': ' + str(list(pos)) + ',\n')
                      f.write('           }\n')
                  f.write('       },\n')
              f.write('}\n')
          else:
              for elec in range(n_elec):
                  f.write('    ' + str(elec) + ': ')
                  f.write("\n        {\n")
                  f.write("           'channels': [" + str(elec) + '],\n')
                  f.write("           'graph':  [],\n")
                  f.write('        },\n')
              f.write('}\n')