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 io | |
| import pandas as pd | |
| import streamlit as st | |
| # Window CSV data | |
| EMBEDDED_CSV = """"Manufacturer","Series/Model","Type","Material","Glazing/Insulation","U-Factor (typ)","SHGC (typ)","Common Size Range (in)","Typical Price (USD)","Notes" | |
| "Andersen","100 Series","Single-Hung","Fibrex composite","Low-E dual-pane argon","0.28-0.30","0.19-0.30","24-48 W x 36-72 H","450-900","Budget composite line; ENERGY STAR options" | |
| "Andersen","100 Series","Gliding","Fibrex composite","Low-E SmartSun option","0.27-0.29","0.19-0.28","36-72 W x 24-60 H","600-1,000","Retail sizes like 47.5x47.5 sold at Home Depot" | |
| "Andersen","100 Series","Picture","Fibrex composite","Low-E dual-pane","0.27-0.29","0.20-0.30","24-72 W x 24-72 H","300-800","Fixed unit; high VT options" | |
| "Andersen","400 Series","Double-Hung","Wood clad","Low-E dual-pane","~0.30","~0.19","24-48 W x 36-72 H","700-1,400","Classic wood-clad favorite" |
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 pandas as pd | |
| # Create sample data for demonstration | |
| data = {'A': [4, 8, 3, 4], 'B': [4, 5, 6, 7]} | |
| # data = { | |
| # 'A': [4, 8, 3, 4, 9, 2, 7, 5, 6, 1, 10, 12, 14, 4, 8, 11, 13, 15, 16, 17], | |
| # 'B': [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23] | |
| # } |
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
| @echo off | |
| setlocal enabledelayedexpansion | |
| REM =================================================================== | |
| REM GitHub Bulk Collaborator Management Script | |
| REM =================================================================== | |
| REM This script adds a collaborator to multiple GitHub repositories | |
| REM in bulk using the GitHub CLI (gh). | |
| REM | |
| REM Prerequisites: |
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 ftplib | |
| import json | |
| from datetime import datetime, date | |
| import fnmatch | |
| # Import FTP credentials from configuration file | |
| from ftp_config import FTP_HOST, FTP_USER, FTP_PASS | |
| # --- Local Configuration --- |
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 base64 | |
| import json | |
| import time | |
| from pathlib import Path | |
| from mistralai import Mistral | |
| from typing import Optional | |
| # API key - directly defined | |
| api_key = "YO123" |
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
| model = "gemini-2.0-pro-exp-02-05" | |
| # Set API key | |
| GEMINI_API_KEY = "abc" | |
| def log_failed_validation(pdf_path): | |
| """Log failed validation to failed.log with timestamp""" | |
| if pdf_path: | |
| base_name = os.path.splitext(os.path.basename(pdf_path))[0] | |
| timestamp = datetime.now().isoformat() | |
| with open('failed.log', 'a') as f: |
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 re | |
| from pytube import YouTube | |
| def download_youtube_audio(url): | |
| yt = YouTube(url) | |
| audio_stream = yt.streams.filter(only_audio=True).first() | |
| # Remove invalid characters from the filename using regex | |
| cleaned_title = re.sub(r'[<>:"/\\|?*]', '_', yt.title) | |
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 | |
| from langchain_groq import ChatGroq | |
| from langchain_core.prompts import ChatPromptTemplate | |
| def generate_response(user_input): | |
| chain = prompt | chat | |
| for chunk in chain.stream({"text": "\n".join([f"{role}: {msg}" for role, msg in st.session_state.messages])}): | |
| content = chunk.content | |
| #replace $ in content so no latex | |
| content = content.replace("$", "\\$") |
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 | |
| from groq import Groq | |
| # Initialize Groq client with API key | |
| client = Groq(api_key="gsk_123") | |
| def generate_response(user_input): | |
| stream = client.chat.completions.create( | |
| model="llama3-70b-8192", | |
| messages=[ |
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 groq import Groq | |
| # Initialize Groq client with API key | |
| client = Groq(api_key="gsk_123") | |
| completion = client.chat.completions.create( | |
| model="llama3-70b-8192", | |
| messages=[ | |
| { | |
| "role": "system", |
NewerOlder