<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def output_influx(data):
 """Print data using influxDB format."""

    for contract in data:

        # Pop yesterdays data
        yesterday_data = data[contract]['yesterday_hourly_consumption']
        del data[contract]['yesterday_hourly_consumption']

        # Print general data
        out = "pyhydroquebec,contract=" + contract + " "

        for index, key in enumerate(data[contract]):
            if index != 0:
                out = out + ","
            if key in ("annual_date_start", "annual_date_end"):
                out += key + "=\"" + str(data[contract][key]) + "\""
            else:
                out += key + "=" + str(data[contract][key])

        out += " " + str(int(datetime.datetime.now(HQ_TIMEZONE).timestamp() * 1000000000))
        print(out)

        # Print yesterday values
        yesterday = datetime.datetime.now(HQ_TIMEZONE) - datetime.timedelta(days=1)
        yesterday = yesterday.replace(minute=0, hour=0, second=0, microsecond=0)

        for hour in yesterday_data:
            msg = "pyhydroquebec,contract={} {} {}"

            data = ",".join(["{}={}".format(key, value) for key, value in hour.items()
                             if key != 'hour'])

            datatime = datetime.datetime.strptime(hour['hour'], '%H:%M:%S')
            yesterday = yesterday.replace(hour=datatime.hour)
            yesterday_str = str(int(yesterday.timestamp() * 1000000000))

            print(msg.format(contract, data, yesterday_str))