code: def communitydetection(self, community_detection_params, community_type='temporal', tag=None, file_hdr=False, file_idx=False, njobs=None):
          
          if not njobs:
              njobs = self.njobs
          self.add_history(inspect.stack()[0][3], locals(), 1)
  
          if not tag:
              tag = ''
          else:
              tag = 'desc-' + tag
  
          if community_type == 'temporal':
              files = self.get_selected_files(quiet=True)
              # Run check to make sure files are tvc input
              for f in files:
                  if 'tvc' not in f:
                      raise ValueError(
                          'tvc tag not found in filename. TVC data must be used in communitydetection (perhaps run TenetoBIDS.derive first?).')
          elif community_type == 'static':
              files = self.get_selected_files(
                  quiet=True, pipeline='functionalconnectivity')
  
          with ProcessPoolExecutor(max_workers=njobs) as executor:
              job = {executor.submit(self._run_communitydetection, f, community_detection_params, community_type, file_hdr,
                                     file_idx, tag) for i, f in enumerate(files) if all([t + '_' in f or t + '.' in f for t in tag])}
              for j in as_completed(job):
                  j.result()
docs: Calls temporal_louvain_with_consensus on connectivity data
  
          Parameters
          ----------
  
          community_detection_params : dict
              kwargs for detection. See teneto.communitydetection.louvain.temporal_louvain_with_consensus
          community_type : str
              Either 'temporal' or 'static'. If temporal, community is made per time-point for each timepoint.
          file_idx : bool (default false)
              if true, index column present in data and this will be ignored
          file_hdr : bool (default false)
              if true, header row present in data and this will be ignored
          njobs : int
              number of processes to run. Overrides TenetoBIDS.njobs
  
          Note
          ----
          All non-positive edges are made to zero.
  
  
          Returns
          -------
          List of communities for each subject. Saved in BIDS_dir/derivatives/teneto/communitydetection/