This file contains hidden or 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 requests | |
| import json | |
| import uuid | |
| from typing import Iterator, Dict, Any | |
| def setup_streamlit_page(): | |
| st.set_page_config( | |
| page_title="LangFlow Chat Interface", page_icon="🤖", layout="wide" |
This file contains hidden or 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 langflow.custom import Component | |
| from langflow.io import SecretStrInput, MessageTextInput, IntInput, BoolInput, DropdownInput, StrInput, Output | |
| from langflow.schema import Data | |
| import httpx | |
| from loguru import logger | |
| class FirecrawlSearchComponent(Component): | |
| display_name = "Firecrawl Search" | |
| description = "Search the web and get full content using Firecrawl" | |
| icon = "flame" |
This file contains hidden or 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
| class TicTacToe: | |
| def __init__(self): | |
| # Initialize empty board (using ' ' for empty squares) | |
| self.board = [" " for _ in range(9)] | |
| self.human_player = "O" | |
| self.ai_player = "X" | |
| def print_board(self): | |
| """Print the current state of the board""" | |
| for i in range(0, 9, 3): |
This file contains hidden or 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
| { | |
| "league": { | |
| "name": "Premier League" | |
| }, | |
| "clubs": [ | |
| { | |
| "name": "Manchester United", | |
| "founded_year": 1878 | |
| }, | |
| { |
This file contains hidden or 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
| # 1. Import statements and environment setup | |
| import os | |
| import random | |
| import warnings | |
| from typing import Callable, Tuple | |
| import matplotlib.pyplot as plt | |
| import neptune | |
| import numpy as np | |
| import tensorflow as tf |
This file contains hidden or 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 os | |
| import time | |
| import warnings | |
| import neptune | |
| from dotenv import load_dotenv | |
| from lightgbm import LGBMClassifier | |
| from xgboost import XGBClassifier | |
| from sklearn.datasets import make_classification | |
| from sklearn.model_selection import train_test_split |
This file contains hidden or 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 gymnasium as gym | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from moviepy.editor import ImageSequenceClip | |
| def create_environment(env_name='Taxi-v3', render_mode='rgb_array'): | |
| """Create and return a Gymnasium environment.""" | |
| return gym.make(env_name, render_mode=render_mode) | |
| def initialize_q_table(env): |
This file contains hidden or 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
| # Please, run the following GitHub gist first: https://gist.github.com/BexTuychiev/00b665c256351a63cca0512b1cd6d220 | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from matplotlib.ticker import ScalarFormatter | |
| # Read the CSV file | |
| data = pd.read_csv("optimization_results.csv") |
This file contains hidden or 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 seaborn as sns | |
| import numpy as np | |
| import pandas as pd | |
| import time | |
| from tabulate import tabulate # pip install tabulate | |
| np.random.seed(42) | |
| # Load and prepare data | |
| dataset_size = 20_000 |
This file contains hidden or 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 seaborn as sns | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| import warnings | |
| warnings.filterwarnings("ignore") | |
| np.random.seed(42) | |
| # Load the data |