

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('\\{(.*)\\}', s)
        search_square = re.search('\\[(.*)\\]', s)
        license = ''
        replace_string = '{year} {name}'.format(year=date.today().year, name=_get_config_name())
        if search_curly:
            license = re.sub('\\{(.+)\\}', search_curly, s)
        elif search_square:
            license = re.sub('\\[(.+)\\]', 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/VarMisuse@124/207 `replace_string`->`search_curly`