Skip to content

Instantly share code, notes, and snippets.

View SmartManoj's full-sized avatar
💭
Raising an AI Software Engineer 🤖

மனோஜ்குமார் பழனிச்சாமி SmartManoj

💭
Raising an AI Software Engineer 🤖
View GitHub Profile
chat_template="{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- '' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py
index c1c7af36..6d1aa5d7 100644
--- a/astroid/nodes/node_classes.py
+++ b/astroid/nodes/node_classes.py
@@ -4692,14 +4692,18 @@ class FormattedValue(NodeNG):
yield util.Uninferable
uninferable_already_generated = True
continue
- formatted = format(value.value, format_spec.value)
- yield Const(
@SmartManoj
SmartManoj / openapi_3.x to 2.0.py
Last active October 1, 2024 09:27
This script converts an OpenAPI 3.X specification into an OpenAPI 2.0 specification, handling changes like `requestBody`, `$ref`, and security schemes.
import os
import requests
import json
from pyperclip import copy
debug = 0
HOST_URL = 'https://default-host.com'
def convert_to_openapi_2(spec):
global debug
# Initialize the OpenAPI 2.0 specification
openapi2_spec = {
import io
import pyautogui
from time import sleep
import win32clipboard
from PIL import ImageGrab
import win32gui
toplist, winlist = [], []
print(34)
print(34)
import requests
from threading import Thread
from bs4 import BeautifulSoup
from pyperclip import copy
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
}
import ccxt
from datetime import datetime
from pprint import pprint
connection = ccxt.gateio()
pair = 'FITFI/USDT'
timestamp = int(datetime.strptime(
"2022-04-26 10:30:00+00:00", "%Y-%m-%d %H:%M:%S%z").timestamp())
timeframe = '1m'
timeframe = '10s'
import ccxt
from datetime import datetime
from pprint import pprint
connection = ccxt.gateio()
pair = 'FITFI/USDT'
timestamp = int(datetime.strptime(
"2022-04-26 10:30:00+00:00", "%Y-%m-%d %H:%M:%S%z").timestamp())
timeframe = '1m'
timeframe = '10s'
#!/usr/bin/env python
import os
import sys
import dotenv
dotenv.load_dotenv()
TOKEN = os.getenv("BOT_TOKEN")
if TOKEN is None:
import csv
import random
from telethon import TelegramClient, events, sync
from telethon.tl.types import InputPhoneContact
from telethon import functions, types
api_id = 210829
api_hash = '..'
client = TelegramClient('SmartManoj2', api_id, api_hash)
with open('contacts.csv', 'r') as file:
@SmartManoj
SmartManoj / gist:aceee7302d5fcbe0721814d26e3f7d01
Last active October 9, 2020 11:50
Save Contact or Find importers
import os
from telethon import TelegramClient, events
from telethon.tl.types import InputPhoneContact
from telethon import functions, types
from config import *
import random
from tthon import *
sn = 'Temp'