code: def license_cleanup(text):
      
      if not text:
          return None
      text = text.rsplit(':', 1)[-1]
      replacements = [
          'licenses',
          'license',
          'licences',
          'licence',
          'software',
          ',',
      ]
      for replacement in replacements:
          text = text.replace(replacement, '')
      text = text.strip().upper()
      text = text.replace(' ', '_')
      text = text.replace('-', '_')
      if any(trigger.upper() in text for trigger in BAD_LICENSES):
          return None
      return text
docs: Tidy up a license string
  
      e.g. "::OSI::   mit software license" -> "MIT"