Spaces:
Running
Running
Update yall.py
Browse files
yall.py
CHANGED
@@ -4,7 +4,6 @@ import requests
|
|
4 |
from dataclasses import dataclass
|
5 |
import re
|
6 |
import streamlit as st
|
7 |
-
from concurrent.futures import ThreadPoolExecutor
|
8 |
|
9 |
@dataclass
|
10 |
class GistInfo:
|
@@ -60,13 +59,9 @@ def create_yall():
|
|
60 |
# Retrieve all gists
|
61 |
gist_api = gistyc.GISTyc(auth_token=GITHUB_API_TOKEN)
|
62 |
data = gist_api.get_gists()
|
63 |
-
|
64 |
# List to store the GistInfo objects
|
65 |
gist_infos = []
|
66 |
-
|
67 |
-
# Use a thread pool to make the HTTP requests in parallel
|
68 |
-
with ThreadPoolExecutor(max_workers=10) as executor:
|
69 |
-
gist_infos = list(executor.map(get_gist_info, data))
|
70 |
|
71 |
for data_dict in data:
|
72 |
if 'files' in data_dict and data_dict['files']:
|
|
|
4 |
from dataclasses import dataclass
|
5 |
import re
|
6 |
import streamlit as st
|
|
|
7 |
|
8 |
@dataclass
|
9 |
class GistInfo:
|
|
|
59 |
# Retrieve all gists
|
60 |
gist_api = gistyc.GISTyc(auth_token=GITHUB_API_TOKEN)
|
61 |
data = gist_api.get_gists()
|
62 |
+
|
63 |
# List to store the GistInfo objects
|
64 |
gist_infos = []
|
|
|
|
|
|
|
|
|
65 |
|
66 |
for data_dict in data:
|
67 |
if 'files' in data_dict and data_dict['files']:
|