File size: 1,350 Bytes
a431d31
 
 
 
 
1795206
b9f3732
 
a431d31
 
 
abfea56
1795206
 
a431d31
 
 
b9f3732
 
 
a431d31
1795206
b9f3732
1795206
 
 
 
 
 
 
a431d31
2e3080b
da1ef91
2e3080b
 
da1ef91
2e3080b
da1ef91
b9f3732
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from datasets import load_dataset
import streamlit as st


@st.cache()
def load_all_repository_names():
    list_of_repo_names = ["test"]
    #list_of_repo_names = load_dataset("bigcode/the-stack-paths", split="train")["repository_name"]
    return list_of_repo_names

st.title("Am I in The Stack?")
st.markdown("This tool lets you check if a repository under a given username is part of [The Stack dataset](https://huggingface.co/datasets/bigcode/the-stack).")
repo_names = load_all_repository_names()
n_repos = len(repo_names)

username = st.text_input("GitHub Username:")

st.markdown("Note: this Space is currently under construction.")

"""
if st.button("Check!"):
    
    
    list_of_repos = []
    progress_bar = st.progress(0.0)
    
    for i in range(n_repos):
        progress_bar.progress((i + 1)/n_repos)
        if repo_names[i].split("/")[0]==username:
            list_of_repos.append(repo_names[i])
    
    if len(list_of_repos)==0:
        st.markdown("There is **no repository** under that username in The Stack.")
    else:
        if len(list_of_repos)==1:
            st.markdown("There is **1 repository** under that username in The Stack:")
        else:
            st.markdown(f"There are **{len(list_of_repos)} repositories** under that username in The Stack:")
        st.text("\n".join(list_of_repos))
        
    """