import random
import time
from os import getenv

from aiographite.aiographite import connect
from aiographite.protocol import PlaintextProtocol

GRAPHITE_HOST = getenv('GRAPHITE_HOST', 'localhost')


async def run(worker, *args, **kwargs):
    value = random.randrange(10)
    try:
    	connection = await connect(GRAPHITE_HOST, 2003, PlaintextProtocol(), loop=worker.loop)
    	await connection.send('workers.worker', value, time.time())
    	await connection.close()
    except Exception as e:
    	worker.logger.error('Cannot connect to graphite')

import random
import time
from os import getenv

from aiographite.aiographite import connect
from aiographite.protocol import PlaintextProtocol

GRAPHITE_HOST = getenv('GRAPHITE_HOST', 'localhost')


async def run(worker, *args, **kwargs):
    value = random.randrange(10)
    try:
        connection = await connect(GRAPHITE_HOST, 2003, PlaintextProtocol(), loop=worker.loop)
        await connection.send('workers.worker', value, time.time())
        await connection.close()
    except Exception:
        worker.logger.error('Cannot connect to graphite')

Fix flake8 issues in examples
Fix flake8 issues in examples

  import random
  import time
  from os import getenv
  
  from aiographite.aiographite import connect
  from aiographite.protocol import PlaintextProtocol
  
  GRAPHITE_HOST = getenv('GRAPHITE_HOST', 'localhost')
  
  
  async def run(worker, *args, **kwargs):
      value = random.randrange(10)
      try:
-     	connection = await connect(GRAPHITE_HOST, 2003, PlaintextProtocol(), loop=worker.loop)
+         connection = await connect(GRAPHITE_HOST, 2003, PlaintextProtocol(), loop=worker.loop)
-     	await connection.send('workers.worker', value, time.time())
+         await connection.send('workers.worker', value, time.time())
-     	await connection.close()
+         await connection.close()
-     except Exception as e:
+     except Exception:
-     	worker.logger.error('Cannot connect to graphite')
+         worker.logger.error('Cannot connect to graphite')
  
Fix flake8 issues in examples
## Code Before:
import random
import time
from os import getenv

from aiographite.aiographite import connect
from aiographite.protocol import PlaintextProtocol

GRAPHITE_HOST = getenv('GRAPHITE_HOST', 'localhost')


async def run(worker, *args, **kwargs):
    value = random.randrange(10)
    try:
    	connection = await connect(GRAPHITE_HOST, 2003, PlaintextProtocol(), loop=worker.loop)
    	await connection.send('workers.worker', value, time.time())
    	await connection.close()
    except Exception as e:
    	worker.logger.error('Cannot connect to graphite')

## Instruction:
Fix flake8 issues in examples
## Code After:
import random
import time
from os import getenv

from aiographite.aiographite import connect
from aiographite.protocol import PlaintextProtocol

GRAPHITE_HOST = getenv('GRAPHITE_HOST', 'localhost')


async def run(worker, *args, **kwargs):
    value = random.randrange(10)
    try:
        connection = await connect(GRAPHITE_HOST, 2003, PlaintextProtocol(), loop=worker.loop)
        await connection.send('workers.worker', value, time.time())
        await connection.close()
    except Exception:
        worker.logger.error('Cannot connect to graphite')
