def _get_license_description(license_code):
  """ Gets the body for a license based on a license code """
  req = requests.get("{base_url}/licenses/{license_code}".format(
      base_url=BASE_URL, license_code=license_code), headers=_HEADERS)

  if req.status_code == requests.codes.ok:
    s = req.json()["body"]
    search_curly = re.search(r'\{(.*)\}', s)
    search_square = re.search(r'\[(.*)\]', s)
    license = ""
    replace_string = '{year} {name}'.format(year=date.today().year,
                                            name=_get_config_name())

    if search_curly:
      license = re.sub(r'\{(.+)\}', replace_string, s)
    elif search_square:
      license = re.sub(r'\[(.+)\]', replace_string, s)
    else:
      license = s

    return license
  else:
    print(Fore.RED + 'No such license. Please check again.'),
    print(Style.RESET_ALL),
    sys.exit()
dataset/ETHPy150Open architv/harvey/harvey/harvey.py/_get_license_description/original