This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
from bokeh.models import ColumnDataSource, CustomJS | |
from bokeh.plotting import figure | |
import pandas as pd | |
import numpy as np | |
from streamlit_bokeh_events import streamlit_bokeh_events | |
from state import provide_state | |
@provide_state | |
def main(state): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from streamlit.report_thread import get_report_ctx | |
from streamlit.hashing import _CodeHasher | |
from streamlit.server.server import Server | |
from prometheus_client.registry import REGISTRY | |
from prometheus_client import Counter | |
class _SessionState: | |
def __init__(self, session, hash_funcs): | |
"""Initialize SessionState instance.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x | y | size | ||
---|---|---|---|---|
0 | 0.22350554878154982 | 0.24488387754195973 | 5.121734927672993 | |
1 | 0.29228506683932176 | 0.02701330608229313 | 7.769701006355811 | |
2 | 0.1671886828540321 | 0.4718313957475925 | 5.433848596895122 | |
3 | 0.7917289279327249 | 0.27173221695239047 | 8.093148016907989 | |
4 | 0.8375282431440418 | 0.8498298721856706 | 9.405192850799946 | |
5 | 0.5794420093002058 | 0.28788057347946905 | 7.977779993621126 | |
6 | 0.0028331174317425267 | 0.8954760582866268 | 1.2970672156251917 | |
7 | 0.429252587113481 | 0.554692000881586 | 3.3975258630268157 | |
8 | 0.029717719251690977 | 0.9097710479958356 | 9.1103289671696 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import io | |
from PIL import Image | |
original, modified = st.beta_columns(2) | |
image_box = original.empty() | |
filter_type = original.empty() | |
image = original.file_uploader("Upload Image") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bokeh.models import ColumnDataSource, CustomJS | |
from bokeh.palettes import Category20 | |
from bokeh.plotting import figure | |
from bokeh.transform import linear_cmap | |
import numpy as np | |
import pandas as pd | |
import streamlit as st | |
from sklearn.datasets import make_blobs | |
from state import provide_state | |
st.set_page_config(layout="wide") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def one_hot_column(df, column, labels, prefix=None, **kwargs): | |
dummies = pd.get_dummies(df[column], prefix=prefix or column, **kwargs) | |
for label in labels: | |
if f"{column}_{label}" not in dummies.columns: | |
dummies[f"{column}_{label}"] = 0 | |
return df.join(dummies) | |
if __name__ == "__main__": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netsh advfirewall firewall add rule name="Allowing LAN connections" dir=in action=allow protocol=TCP localport=9999 | |
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=9999 connectaddress=localhost connectport=9999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import logging | |
from fastapi import FastAPI | |
from fastapi.responses import HTMLResponse | |
from fastapi.websockets import WebSocket, WebSocketDisconnect | |
import aioredis | |
import async_timeout |