Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
''' | |
Well, it is to play youtube song playlists in your laptop (VLC). | |
you will say why would I do, it is much better | |
Try it | |
prerequisites | |
add vlc to your PATH | |
pip install pytube3 |
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
def Nthmin(list, n): | |
piot = list[0] | |
min_list, max_list = [], [] | |
for i in range(1, len(list)): | |
if list[i] < piot: | |
min_list.append(list[i]) | |
else: | |
max_list.append(list[i]) | |
if len(min_list) >= n and len(min_list) != 0: | |
return Nthmin(min_list, n) |
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 os import listdir,sep | |
from os.path import isfile,isdir,split,join | |
class Traversal(object): | |
def __init__(self,starting_node,dfs=True,bfs=False): | |
''' | |
:param starting_node: give absolute path of the directory to be travesed | |
:param dfs: set True for Debth first traversal ; default : True | |
:param bfs: set true for breadth first traversal ; default : False |
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
0 | 7 | 5 | mar | fri | 86.2 | 26.2 | 94.3 | 5.1 | 8.2 | 51 | 6.7 | 0.0 | 0.0 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 7 | 4 | oct | tue | 90.6 | 35.4 | 669.1 | 6.7 | 18.0 | 33 | 0.9 | 0.0 | 0.0 | |
2 | 7 | 4 | oct | sat | 90.6 | 43.7 | 686.9 | 6.7 | 14.6 | 33 | 1.3 | 0.0 | 0.0 | |
3 | 8 | 6 | mar | fri | 91.7 | 33.3 | 77.5 | 9.0 | 8.3 | 97 | 4.0 | 0.2 | 0.0 | |
4 | 8 | 6 | mar | sun | 89.3 | 51.3 | 102.2 | 9.6 | 11.4 | 99 | 1.8 | 0.0 | 0.0 | |
5 | 8 | 6 | aug | sun | 92.3 | 85.3 | 488.0 | 14.7 | 22.2 | 29 | 5.4 | 0.0 | 0.0 | |
6 | 8 | 6 | aug | mon | 92.3 | 88.9 | 495.6 | 8.5 | 24.1 | 27 | 3.1 | 0.0 | 0.0 | |
7 | 8 | 6 | aug | mon | 91.5 | 145.4 | 608.2 | 10.7 | 8.0 | 86 | 2.2 | 0.0 | 0.0 | |
8 | 8 | 6 | sep | tue | 91.0 | 129.5 | 692.6 | 7.0 | 13.1 | 63 | 5.4 | 0.0 | 0.0 | |
9 | 7 | 5 | sep | sat | 92.5 | 88.0 | 698.6 | 7.1 | 22.8 | 40 | 4.0 | 0.0 | 0.0 |
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 csv, random | |
class NaiveBayes(object): | |
def __init__(self, filename, split_ratio): | |
''' | |
:param filename: a csv filename with absolute or full path | |
:param split_ratio: test to train ratio | |
''' |
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 Algorithmia, speech_recognition as sr, pyttsx | |
# Algorthmia Api key and end point | |
client = Algorithmia.client('simCM+BqJzKSw/iMrQsR/OTRwVE1') | |
algo = client.algo('translation/GoogleTranslate/0.1.1') | |
# pyttsx engine config | |
speech_engine = pyttsx.init('sapi5') # see http://pyttsx.readthedocs.org/en/latest/engine.html#pyttsx.init | |
speech_engine.setProperty('rate', 150) |
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 speech_recognition as sr, pyttsx | |
from googletrans import Translator | |
# pyttsx engine config | |
speech_engine = pyttsx.init('sapi5') # see http://pyttsx.readthedocs.org/en/latest/engine.html#pyttsx.init | |
speech_engine.setProperty('rate', 150) | |
# translator object | |
translator = Translator() |
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 gym | |
import random | |
import numpy as np | |
import tflearn | |
from tflearn.layers.core import input_data, dropout, fully_connected | |
from tflearn.data_utils import to_categorical | |
from tflearn.layers.estimator import regression | |
from statistics import median, mean | |
from collections import Counter | |
import glob |
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 requests | |
from urllib.parse import urlparse,urljoin | |
from bs4 import BeautifulSoup | |
all_urls = set() | |
class url_tree(): | |
def __init__(self, base_url,page_no=1 ,children=None): | |
self.url = base_url | |
self.page_no =page_no |
NewerOlder