docs: def kegg_mapping_and_metadata_parallelize(self, sc, kegg_organism_code, custom_gene_mapping=None, outdir=None,
                                                set_as_representative=False, force_rerun=False):
          """Map all genes in the model to KEGG IDs using the KEGG service.
  
          Steps:
              1. Download all metadata and sequence files in the sequences directory
              2. Creates a KEGGProp object in the protein.sequences attribute
              3. Returns a Pandas DataFrame of mapping results
  
          Args:
              sc (SparkContext): Spark Context to parallelize this function
              kegg_organism_code (str): The three letter KEGG code of your organism
              custom_gene_mapping (dict): If your model genes differ from the gene IDs you want to map,
                  custom_gene_mapping allows you to input a dictionary which maps model gene IDs to new ones.
                  Dictionary keys must match model gene IDs.
              outdir (str): Path to output directory of downloaded files, must be set if GEM-PRO directories
                  were not created initially
              set_as_representative (bool): If mapped KEGG IDs should be set as representative sequences
              force_rerun (bool): If you want to overwrite any existing mappings and files
  
          """
  
          # First map all of the organism's KEGG genes to UniProt
          kegg_to_uniprot = ssbio.databases.kegg.map_kegg_all_genes(organism_code=kegg_organism_code, target_db='uniprot')
  
          # Parallelize the genes list
          genes_rdd = sc.parallelize(self.genes)
  
          # Write a sub-function to carry out the bulk of the original function
          def gp_kegg_sc(g):
              if custom_gene_mapping:
                  kegg_g = custom_gene_mapping[g.id]
              else:
                  kegg_g = g.id
  
              # Download both FASTA and KEGG metadata files
              kegg_prop = g.protein.load_kegg(kegg_id=kegg_g, kegg_organism_code=kegg_organism_code,
                                              download=True, outdir=outdir,
                                              set_as_representative=set_as_representative,
                                              force_rerun=force_rerun)
  
              # Update potentially old UniProt ID
              if kegg_g in kegg_to_uniprot.keys():
                  kegg_prop.uniprot = kegg_to_uniprot[kegg_g]
                  if g.protein.representative_sequence:
                      if g.protein.representative_sequence.kegg == kegg_prop.kegg:
                          g.protein.representative_sequence.uniprot = kegg_to_uniprot[kegg_g]
  
              # Tracker for if it mapped successfully to KEGG
              if kegg_prop.sequence_file:
                  success = True
              else:
                  success = False
  
              return g, success
  
          # Run a map operation to execute the function on all items in the RDD
          result = genes_rdd.map(gp_kegg_sc).collect()
  
          # Copy the results over to the GEM-PRO object's genes using the GenePro function "copy_modified_gene"
          # Also count how many genes mapped to KEGG
          successfully_mapped_counter = 0
          for modified_g, success in result:
              original_gene = self.genes.get_by_id(modified_g.id)
              original_gene.copy_modified_gene(modified_g)
              if success:
                  successfully_mapped_counter += 1
  
          log.info('{}/{}: number of genes mapped to KEGG'.format(successfully_mapped_counter, len(self.genes)))
          log.info('Completed ID mapping --> KEGG. See the "df_kegg_metadata" attribute for a summary dataframe.')