Skip to content

Instantly share code, notes, and snippets.

import os
import re
import requests
import shutil
def get_url_and_fname(line):
if 'i.imgur.com/' in line:
regex = r"(https?://i.imgur.com/(.*.png))"
./data_viz_easy/raw/tut1.ipynb: "![tut1_plots_you_make](https://i.imgur.com/54BoIBW.png)\n",
./data_viz_easy/raw/tut1.ipynb: "![tut1_spotify_head](https://i.imgur.com/GAGf6Td.png)\n",
./data_viz_easy/raw/tut1.ipynb: "![tut1_read_csv](https://i.imgur.com/18LKa03.png)\n",
./data_viz_easy/raw/tut3.ipynb: "![tut3_insurance](https://i.imgur.com/1nmy2YO.png)\n",
./data_viz_easy/raw/ex2.ipynb: "![ex2_ign](https://i.imgur.com/Oh06Fu1.png)\n",
./data_viz_easy/raw/ex6.ipynb: "![ex6_search_dataset](https://i.imgur.com/QDEKwYp.png)\n",
./data_viz_easy/raw/ex6.ipynb: "![ex6_dataset_added](https://i.imgur.com/oVlEBPx.png)\n",
./data_viz_easy/raw/ex6.ipynb: "![ex6_dataset_dropdown](https://i.imgur.com/4gpFw71.png)\n",
./data_viz_easy/raw/ex6.ipynb: "![ex6_filepath](https://i.imgur.com/pWe0sVb.png)\n",
./data_viz_easy/raw/tut7.ipynb: "![tut7_new_kernel](https://i.imgur.com/ZqW6V2X.png)\n",
import asyncio
import aiohttp
# Example async function that simulates making an API call
async def make_api_call(semaphore, session, task_id):
async with semaphore: # Ensure we respect the semaphore limit
print(f"Task {task_id}: Starting API call...")
try:
async with session.get(f"https://httpbin.org/get?task={task_id}") as response:
result = await response.json()