Skip to content

Instantly share code, notes, and snippets.

View ksdkamesh99's full-sized avatar
💻
Sleep-Code-Eat

Sai Durga Kamesh Kota ksdkamesh99

💻
Sleep-Code-Eat
View GitHub Profile
api_key=input("Enter the API Key")
!pip install google-api-python-client
from googleapiclient.discovery import build
import datetime
def Video_Summary(api_key,video_id):
service=build('youtube','v3',developerKey=api_key)
videos_list=service.videos().list(part='contentDetails,statistics,snippet',id=video_id).execute()
print("The Title of the Video is ",videos_list['items'][0]['snippet']['title'])
CASE WHEN COALESCE(UPPER(country_name), 'OTHER_COUNTRY') = 'INDIA' AND UPPER(region_name) in ('CHANDIGARH', 'DELHI', 'HARYANA', 'HIMANCHAL PRADESH', 'JAMMU AND KASHMIR', 'PUNJAB', 'RAJASTHAN', 'UTTAR PRADESH','UTTARAKHAND') THEN 'NORTH'
WHEN COALESCE(UPPER(country_name), 'OTHER_COUNTRY') = 'INDIA' AND UPPER(region_name) in ('CHHATTISGARH', 'DADAR AND NAGAR', 'DIU AND DAMAN', 'GOA', 'GUJARAT', 'MADHYA PRADESH', 'MAHARASHTRA') THEN 'WEST'
WHEN COALESCE(UPPER(country_name), 'OTHER_COUNTRY') = 'INDIA' AND UPPER(region_name) in ('ANDAMAN AND NICOBAR', 'ANDHRA PRADESH', 'KARNATAKA', 'KERALA', 'PONDICHERRY', 'TAMIL NADU', 'TELANGANA', 'LAKSHADWEEP') THEN 'SOUTH'
WHEN COALESCE(UPPER(country_name), 'OTHER_COUNTRY') = 'INDIA' AND UPPER(region_name) in ('ARUNACHAL PRADESH', 'ASSAM', 'BIHAR', 'JHARKHAND', 'MANIPUR', 'MEGHALAYA', 'MIZORAM', 'NAGALAND', 'ODISHA', 'SIKKIM', 'TRIPURA', 'WEST BENGAL') THEN 'EAST'
WHEN COALESCE(UPPER(country_name), 'OTHER_COUNTRY') = 'OTHER_COUNTRY' OR COALESCE(UPPER(r
@ksdkamesh99
ksdkamesh99 / lambda_function.py
Created May 5, 2021 11:15
AWS Athena Query Via Lambda
import json
import time
import boto3
client=boto3.client("athena")
def lambda_handler(event, context):
QUERY="SELECT * from data order by age desc limit 10;"
DATABASE="data"
OutputPath="s3://sri-reco-demo/Athena/"
@ksdkamesh99
ksdkamesh99 / css-introduction-into-animating-transition-cards-perspective.markdown
Created February 4, 2021 09:49
CSS introduction into animating transition - Cards Perspective
MIT License
Copyright (c) 2020 Sai Durga Kamesh Kota
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ksdkamesh99
ksdkamesh99 / README.md
Created December 12, 2020 15:50
README.md

WelcomeSample

This is a welcome package which prints a welcome message

import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="welcomesample", # Replace with your own username
version="0.0.1",
author="Kota Sai Durga Kamesh",
author_email="[email protected]",
def welcome():
print("Welcome Amigos")
@ksdkamesh99
ksdkamesh99 / stop_wait.py
Created September 8, 2020 06:25
Stop and Wait Protocol in computer networking including the duplicate packet delay handling
import random
import time
no_frames=random.randint(1,500)
no_frames=no_frames//8
print("No of packets to be transmitted are "+str(no_frames))
frameno=1
delay_acknowledgement=[]
received=[]
while(no_frames>0):
if __name__=='__main__':
app.run(host='0.0.0.0',port=8080)