Skip to content

Instantly share code, notes, and snippets.

View svalordev's full-sized avatar
📚
Studying for JEE 2026

Shaurya Pratap Singh svalordev

📚
Studying for JEE 2026
View GitHub Profile
import sys
import time
import signal
import getpass
import requests
import math
from datetime import datetime
from rich.live import Live
from rich.table import Table
from rich.layout import Layout
import customtkinter as ctk
import os
import threading
import time
# Configuration
ctk.set_appearance_mode("System")
ctk.set_default_color_theme("blue")
class ScreenPadControl(ctk.CTk):
def load_dotdoe(doe_path=None):
if doe_path is None:
f = open('.doe', 'r')
else:
f = open(doe_path, 'r')
text = f.read()
lines = text.split('\n')
dictionary = {}

Keybase proof

I hereby claim:

  • I am shaurya-blip on github.
  • I am sblipdev (https://keybase.io/sblipdev) on keybase.
  • I have a public key ASChL-n6owvUHN6DHVTnBiyfkQDOkUStcFKnNUZ51tWm2Ao

To claim this, I am signing this object:

# Coefficients
print('Coefficients: \n', regressor.coef_)
# The mean squared error
print("Mean squared error: %.2f" % np.mean((regressor.predict(X_test) - y_test) ** 2))
# Explained variance score: 1 is perfect prediction
print('Variance score: %.2f' % regressor.score(X_test, y_test))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'sample', # DATABASE NAME
'USER': 'postgres', # NAME OF USER (DEFAULT IS postgres)
'PASSWORD': 'xyz', # whatever password you have kept.
'HOST': '127.0.0.1', # HOST in which the psql server is running on
'PORT': '5432', # PORT in which the psql server is running on
}
}
import requests
def create_book(title, author):
headers={
'title':title,
'author':author
}
response = requests.post('http://127.0.0.1:8000/books/', headers)
print(f"New book {title} by {author} has been created,\n\n")
from django.urls import include, path
from rest_framework import routers
from .views import BookViewSet
router = routers.DefaultRouter()
router.register(r'books', BookViewSet)
urlpatterns = [
path('', include(router.urls)),
"""Books URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
from rest_framework import viewsets
from .serializer import BookModelSerializer
from main.models import Book
class BookViewSet(viewsets.ModelViewSet):
queryset = Book.objects.all()
serializer_class = BookModelSerializer