code: def write_badge(self, file_path, overwrite=False):
          
  
          # Validate path (part 1)
          if file_path.endswith('/'):
              raise Exception('File location may not be a directory.')
  
          # Get absolute filepath
          path = os.path.abspath(file_path)
          if not path.lower().endswith('.svg'):
              path += '.svg'
  
          # Validate path (part 2)
          if not overwrite and os.path.exists(path):
              raise Exception('File "{}" already exists.'.format(path))
  
          with open(path, mode='w') as file_handle:
              file_handle.write(self.badge_svg_text)
docs: Write badge to file.