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
| # Gmail Account Creation Automation Script - Version 1.1.0 | |
| # Original script by Abdelhakim Khaouiti (khaouitiabdelhakim on GitHub) | |
| import pip | |
| import time | |
| try: | |
| import selenium | |
| except ImportError: | |
| pip.main(['install', 'selenium']) | |
| from selenium import webdriver |
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 | |
| # df = pd.read_json('test.json') | |
| # print(df.shape[0]) | |
| # Python program to translate | |
| # speech to text and text to speech | |
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 requests | |
| from bs4 import BeautifulSoup | |
| from tqdm import tqdm | |
| import json | |
| def get_subpage_links(l): | |
| for link in tqdm(l): | |
| # If not crawled through this page start crawling and get links | |
| if l[link] == "Not-checked": |
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 pip._vendor import pkg_resources | |
| dep_list = set() | |
| def get_dependencies(package_name): | |
| package_name = package_name.split('<')[0] | |
| package_name = package_name.split('>')[0] | |
| global dep_list | |
| pkg_dependencies = [str(dep) for dep in pkg_resources.working_set.by_key[package_name].requires()] | |
| print(pkg_dependencies) |
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 json | |
| import boto3 | |
| import os | |
| import csv | |
| def get_session(env_name): | |
| return boto3.session() | |
| def list_s3_objects(env_name,bucket_name,prefix): | |
| session = get_session(env_name) | |
| s3 = session.resource('s3', verify=False) |
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 boto3 | |
| from common import session | |
| current_session = session.get_session('qa') | |
| client = current_session.client('kinesis') | |
| response = client.put_record( | |
| StreamName='bdc-kinesis-qa', | |
| Data=b'<sample></sample', | |
| PartitionKey='1', |
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 boto3 | |
| def get_session(env_name): | |
| if env_name == 'prd': | |
| return boto3.Session(aws_access_key_id='',aws_secret_access_key='') | |
| if env_name == 'qa': | |
| return boto3.Session(aws_access_key_id='',aws_secret_access_key='') | |
| if env_name == 'dev': | |
| return boto3.session.Session() | |
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 json | |
| a = json.load(open('GMSInventoryLayout.json')) | |
| def get_keys1(d, curr_key=[]): | |
| for k, v in d.items(): | |
| if isinstance(v, dict): | |
| yield from get_keys1(v, curr_key + [k]) | |
| elif isinstance(v, list): |
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 openai | |
| import os | |
| os.environ['REQUESTS_CA_BUNDLE'] = r'C:\Users\popurisu\OneDrive - Dun and Bradstreet\Desktop\Projects\ai-bot\sni.cloudflaressl.der' | |
| openai.api_key = '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' | |
| def get_completion(prompt, model="gpt-3.5-turbo"): | |
| messages = [{"role": "user", "content": prompt}] | |
| response = openai.ChatCompletion.create(model=model,messages=messages,temperature=0) |
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 | |
| from sqlalchemy import create_engine | |
| import urllib | |
| import pyodbc | |
| import numpy as np | |
| #Config | |
| literal_list = 'LITR_TBL.xlsx' | |
| literal_db_location = r'C:\Users\popurisu\Downloads\LiteralDatabase.accdb' |
NewerOlder