def no_metar_returner(location, dates, end_dates, start_time_hours,
    end_time_hours, contents, number_of_flights, replace_key=
    'METAR_INFORMATION'):
    """Replaces the key word in a cell with note that no METAR information was
    available from the day"""
    metar_text = ''
    for flight in range(number_of_flights):
        year = str(dates[flight])[:4]
        year_end = str(end_dates[flight])[:4]
        month = str(dates[flight])[4:6]
        month_end = str(end_dates[flight])[4:6]
        day = str(dates[flight])[6:8]
        day_end = str(end_dates[flight])[6:8]
        metar_text += ('    "No METARs for ' + str(location[flight]) +
            ' for the date ' + day + '/' + month + '/' + year +
            ' to the date ' + day_end + '/' + month_end + '/' + year_end +
            ' from a starting time of ' + str(start_time_hours[flight]) +
            ':00 and an end time of ' + str(int(end_time_hours[flight]) - 1
            ) + ':59.\\n",\n')
    metar_text = metar_text[:-2]
    metar_replacement = ('\n  {\n ' + '  "cell_type": "markdown",\n' +
        '   "metadata": {},\n' + '   "source": [\n' + '    "' + replace_key +
        '"\n' + '   ]\n' + '  },')
    metar_information = ('  {\n ' + '  "cell_type": "markdown",\n' +
        '   "metadata": {},\n' + '   "source": [\n' +
        '    "<h1>Metar Information <a class=\\"anchor\\" ' +
        """id=\\"Metar-Information\\"></a></h1>\\n",
    "\\n",
""" +
        metar_text + '\n   ]\n' + '  },')
    contents = contents.replace(metar_replacement, metar_information)
    return contents
