from urllib.parse import urljoin
import time
import asyncio
from typing import Any
from typing import Callable


TRELLO_URL_BASE = 'https://api.trello.com/1/'


def join_url(part: str) -> str:
	"""
	Adds `part` to  API base url.  Always returns url without trailing slash.

	:param part:
	:return: url
	"""
	part = part.strip('/')
	newpath = urljoin(TRELLO_URL_BASE, part)

	while newpath.endswith('/'):
		newpath = newpath[:-1]

	return newpath


def easy_run(func: Callable[Any], *args, **kwargs) -> Any:
	el = asyncio.get_event_loop()
	return el.run_until_complete(func(*args, **kwargs))

from urllib.parse import urljoin
import time
import asyncio
from typing import Any
from typing import Callable


TRELLO_URL_BASE = 'https://api.trello.com/1/'


def join_url(part: str) -> str:
	"""
	Adds `part` to  API base url.  Always returns url without trailing slash.

	:param part:
	:return: url
	"""
	part = part.strip('/')
	newpath = urljoin(TRELLO_URL_BASE, part)

	while newpath.endswith('/'):
		newpath = newpath[:-1]

	return newpath


def easy_run(gen) -> Any:
	el = asyncio.get_event_loop()
	return el.run_until_complete(gen)

Make easy_run better by taking the generator from coroutines
Make easy_run better by taking the generator from coroutines

  from urllib.parse import urljoin
  import time
  import asyncio
  from typing import Any
  from typing import Callable
  
  
  TRELLO_URL_BASE = 'https://api.trello.com/1/'
  
  
  def join_url(part: str) -> str:
  	"""
  	Adds `part` to  API base url.  Always returns url without trailing slash.
  
  	:param part:
  	:return: url
  	"""
  	part = part.strip('/')
  	newpath = urljoin(TRELLO_URL_BASE, part)
  
  	while newpath.endswith('/'):
  		newpath = newpath[:-1]
  
  	return newpath
  
  
- def easy_run(func: Callable[Any], *args, **kwargs) -> Any:
+ def easy_run(gen) -> Any:
  	el = asyncio.get_event_loop()
- 	return el.run_until_complete(func(*args, **kwargs))
+ 	return el.run_until_complete(gen)
  
Make easy_run better by taking the generator from coroutines
## Code Before:
from urllib.parse import urljoin
import time
import asyncio
from typing import Any
from typing import Callable


TRELLO_URL_BASE = 'https://api.trello.com/1/'


def join_url(part: str) -> str:
	"""
	Adds `part` to  API base url.  Always returns url without trailing slash.

	:param part:
	:return: url
	"""
	part = part.strip('/')
	newpath = urljoin(TRELLO_URL_BASE, part)

	while newpath.endswith('/'):
		newpath = newpath[:-1]

	return newpath


def easy_run(func: Callable[Any], *args, **kwargs) -> Any:
	el = asyncio.get_event_loop()
	return el.run_until_complete(func(*args, **kwargs))

## Instruction:
Make easy_run better by taking the generator from coroutines
## Code After:
from urllib.parse import urljoin
import time
import asyncio
from typing import Any
from typing import Callable


TRELLO_URL_BASE = 'https://api.trello.com/1/'


def join_url(part: str) -> str:
	"""
	Adds `part` to  API base url.  Always returns url without trailing slash.

	:param part:
	:return: url
	"""
	part = part.strip('/')
	newpath = urljoin(TRELLO_URL_BASE, part)

	while newpath.endswith('/'):
		newpath = newpath[:-1]

	return newpath


def easy_run(gen) -> Any:
	el = asyncio.get_event_loop()
	return el.run_until_complete(gen)
