code: def permute_pathways_across_features(self):
          
          side_labels = self.feature_pathway_df.side.unique()
          pathway_features = {}
          for side in side_labels:
              pathway_features[side] = []
  
          feature_grouping = self.feature_pathway_df.groupby(
              ["side", "feature"])
  
          for (side, feature), group in feature_grouping:
              pathways = group["pathway"].tolist()
              for pathway in pathways:
                  pathway_features[side].append((pathway, feature))
  
          permuted_network = {}
          for side in side_labels:
              pathway_side_permutation = _pathway_feature_permutation(
                  pathway_features[side], self.permutation_max_iters)
              while pathway_side_permutation is None:
                  pathway_side_permutation = _pathway_feature_permutation(
                      pathway_features[side], self.permutation_max_iters)
              assert _permutation_correctness(
                  pathway_side_permutation, pathway_features[side]), \
                  ("Permutation on side {0} did not preserve the "
                   "expected invariants").format(side)
              permuted_network[side] = pathway_side_permutation
          return CoNetwork(self.n_features,
                           significant_pathways=permuted_network)
docs: Return a permutation of the network. Requires that the
          significant pathways file has been specified during CoNetwork
          initialization (or set `self.feature_pathway_df` to the
          pandas.DataFrame afterwards).