code: def extract_filestem(data):
      
      escapes = re.compile(r"[\s/,#\(\)]")
      escname = re.sub(escapes, '_', data['AssemblyName'])
      return '_'.join([data['AssemblyAccession'], escname])
docs: Extract filestem from Entrez eSummary data.
  
      Function expects esummary['DocumentSummarySet']['DocumentSummary'][0]
  
      Some illegal characters may occur in AssemblyName - for these, a more
      robust regex replace/escape may be required. Sadly, NCBI don't just
      use standard percent escapes, but instead replace certain
      characters with underscores: white space, slash, comma, hash, brackets.