parameters: ()
docstring: This is essentially a compile step that generates all cached resources.
      Creates files like autocomplete_entries.txt
      Should be run on every redeploy.
docstring_summary: This is essentially a compile step that generates all cached resources.
      Creates files like autocomplete_entries.txt
      Should be run on every redeploy.
docstring_tokens: This is essentially a compile step that generates all cached resources . Creates files like autocomplete_entries . txt Should be run on every redeploy .
function: def create_cache():
      """
      This is essentially a compile step that generates all cached resources.
      Creates files like autocomplete_entries.txt
      Should be run on every redeploy.
      """
      # create autocomplete_entries.txt
      autocomplete_strings = []
      for gene in get_db().genes.find():
          autocomplete_strings.append(gene['gene_name'])
          if 'other_names' in gene:
              autocomplete_strings.extend(gene['other_names'])
      f = open(os.path.join(os.path.dirname(__file__), 'autocomplete_strings.txt'), 'w')
      for s in sorted(autocomplete_strings):
          f.write(s+'\n')
      f.close()
  
      # create static gene pages for genes in
      if not os.path.exists(GENE_CACHE_DIR):
          os.makedirs(GENE_CACHE_DIR)
  
      # get list of genes ordered by num_variants
      for gene_id in GENES_TO_CACHE:
          try:
              page_content = get_gene_page_content(gene_id)
          except Exception as e:
              print e
              continue
          f = open(os.path.join(GENE_CACHE_DIR, '{}.html'.format(gene_id)), 'w')
          f.write(page_content)
          f.close()
function_tokens: def create_cache ( ) : # create autocomplete_entries.txt autocomplete_strings = [ ] for gene in get_db ( ) . genes . find ( ) : autocomplete_strings . append ( gene [ 'gene_name' ] ) if 'other_names' in gene : autocomplete_strings . extend ( gene [ 'other_names' ] ) f = open ( os . path . join ( os . path . dirname ( __file__ ) , 'autocomplete_strings.txt' ) , 'w' ) for s in sorted ( autocomplete_strings ) : f . write ( s + '\n' ) f . close ( ) # create static gene pages for genes in if not os . path . exists ( GENE_CACHE_DIR ) : os . makedirs ( GENE_CACHE_DIR ) # get list of genes ordered by num_variants for gene_id in GENES_TO_CACHE : try : page_content = get_gene_page_content ( gene_id ) except Exception as e : print e continue f = open ( os . path . join ( GENE_CACHE_DIR , '{}.html' . format ( gene_id ) ) , 'w' ) f . write ( page_content ) f . close ( )