
import aiohttp


async def aio_get(url: str):
    async with aiohttp.ClientSession() as session:
<<<<<<< HEAD
        async with session.get(url, headers=headers) as r:
            if r.status == 200:
                return r.text()
            else:
                return None

async def aio_get_json(url, headers=None):
    async with aiohttp.ClientSession() as session:
        async with session.get(url, headers=headers) as r:
            if r.status == 200:
                return r.json()
            else:
                return None
=======
    async with session.get(url) as r:
        if r.status == 200:
            return r
        else:
            return None
>>>>>>> parent of 6b6d243... progress on DDG cog & aiohttp wrapper


import aiohttp


async def aio_get_text(url, headers=None):
    async with aiohttp.ClientSession() as session:
        async with session.get(url, headers=headers) as r:
            if r.status == 200:
                return r.text()
            else:
                return None

async def aio_get_json(url, headers=None):
    async with aiohttp.ClientSession() as session:
        async with session.get(url, headers=headers) as r:
            if r.status == 200:
                return r.json()
            else:
                return None

Revert "Revert "progress on DDG cog & aiohttp wrapper""
Revert "Revert "progress on DDG cog & aiohttp wrapper""

This reverts commit 85d3b1203d9861f986356e593a2b79d96c38c1b3.

  
  import aiohttp
  
  
- async def aio_get(url: str):
+ async def aio_get_text(url, headers=None):
      async with aiohttp.ClientSession() as session:
- <<<<<<< HEAD
          async with session.get(url, headers=headers) as r:
              if r.status == 200:
                  return r.text()
              else:
                  return None
  
  async def aio_get_json(url, headers=None):
      async with aiohttp.ClientSession() as session:
          async with session.get(url, headers=headers) as r:
              if r.status == 200:
                  return r.json()
              else:
                  return None
- =======
-     async with session.get(url) as r:
-         if r.status == 200:
-             return r
-         else:
-             return None
- >>>>>>> parent of 6b6d243... progress on DDG cog & aiohttp wrapper
  
Revert "Revert "progress on DDG cog & aiohttp wrapper""
## Code Before:

import aiohttp


async def aio_get(url: str):
    async with aiohttp.ClientSession() as session:
<<<<<<< HEAD
        async with session.get(url, headers=headers) as r:
            if r.status == 200:
                return r.text()
            else:
                return None

async def aio_get_json(url, headers=None):
    async with aiohttp.ClientSession() as session:
        async with session.get(url, headers=headers) as r:
            if r.status == 200:
                return r.json()
            else:
                return None
=======
    async with session.get(url) as r:
        if r.status == 200:
            return r
        else:
            return None
>>>>>>> parent of 6b6d243... progress on DDG cog & aiohttp wrapper

## Instruction:
Revert "Revert "progress on DDG cog & aiohttp wrapper""
## Code After:

import aiohttp


async def aio_get_text(url, headers=None):
    async with aiohttp.ClientSession() as session:
        async with session.get(url, headers=headers) as r:
            if r.status == 200:
                return r.text()
            else:
                return None

async def aio_get_json(url, headers=None):
    async with aiohttp.ClientSession() as session:
        async with session.get(url, headers=headers) as r:
            if r.status == 200:
                return r.json()
            else:
                return None
