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
# %% [markdown] | |
# ### pattern recognition | |
# %% | |
import pandas as pd | |
import numpy as np | |
import math | |
from pandas.errors import EmptyDataError | |
from geopy.distance import great_circle, geodesic |
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 | |
import numpy as np | |
import math | |
from pandas.errors import EmptyDataError | |
from geopy.distance import great_circle, geodesic | |
import matplotlib.pyplot as plt | |
plt.rcParams["figure.figsize"] = (20, 10) | |
%matplotlib inline | |
from datetime import timedelta |
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 dash | |
from dash.dependencies import Output, Input | |
from dash import dcc, html, dcc | |
from datetime import datetime | |
import json | |
import plotly.graph_objs as go | |
from collections import deque | |
from flask import Flask, request | |
import numpy as np |
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 urllib3 | |
from bs4 import BeautifulSoup | |
http = urllib3.PoolManager() | |
x = int(input('1) category 2) keyword')) | |
p = input('Job search for:').split() | |
p = '%20'.join(p) | |
url = '' | |
if x == 1: | |
url = f'https://internshala.com/internships/work-from-home-{p}-jobs' |
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
class RegularCustomer: | |
def __init__(self, name, item, price, quantity): | |
self.name = name | |
self.item = item | |
self.price = price | |
self.quantity = quantity | |
def discount(self): | |
return self.price * 0.3 |
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
{%load widget_tweaks%} | |
{%block body%} | |
<h1 class='title'>{{user.username}}</h1> | |
<img src="{{user.profile.pic.url}}" alt="Aimeri basking in the sun" class="circle"><br/> | |
{{user.profile.bio}} | |
<button class="button" onclick="myFunction()"> Update Your Details</button> | |
<form method='POST' action="" enctype="multipart/form-data"> | |
{%csrf_token%} | |
{%for hidden in u_form.hidden_fields%} |
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 .forms import UserUpdateForm,ProfileUpdateForm | |
@login_required | |
def profile(request): | |
if request.method == 'POST': | |
p_form = ProfileUpdateForm(request.POST,request.FILES,instance=request.user.profile) | |
u_form = UserUpdateForm(request.POST,instance=request.user) | |
if p_form.is_valid() and u_form.is_valid(): | |
u_form.save() | |
p_form.save() | |
messages.success(request,'Your Profile has been updated!') |
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 random | |
first_6=400000 # IIN For Banking Industry(6 digits) | |
def luhn(): | |
global first_6 | |
card_no = [int(i) for i in str(first_6)] # To find the checksum digit on | |
card_num = [int(i) for i in str(first_6)] # Actual account number | |
seventh_15 = random.sample(range(9), 9) # Acc no (9 digits) | |
for i in seventh_15: | |
card_no.append(i) | |
card_num.append(i) |
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 django.db import models | |
from django.contrib.auth.models import User | |
class Profile(models.Model): | |
user=models.OneToOneField(User,on_delete=models.CASCADE) | |
bio=models.TextField() | |
pic=models.ImageField(default='default.jpg',upload_to='profile_pics') | |
def __str__(self): | |
return f'{self.user.username}\'s Profile ' |
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 django.shortcuts import render, redirect | |
from django.contrib import messages | |
from .forms import UserRegisterationForm | |
def register(request): | |
if request.method == 'POST': #if the form has been submitted | |
form = UserRegisterationForm(request.POST) #form bound with post data | |
if form.is_valid(): | |
form.save() |
NewerOlder