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 re, codecs | |
| def output_results(f, r): | |
| ''' | |
| Write contents of result dicttionary to file after sorting | |
| Params: | |
| f - file handler to write to | |
| r - results dictionary | |
| ''' |
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
| #### Graph object | |
| class Graph: | |
| def __init__(self, lines: str): | |
| ''' | |
| Intilize a graph with at least one line | |
| Params: | |
| lines -- a string with lines to initilize | |
| ''' | |
| self.lines = dict() |
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 pytube import YouTube, Playlist | |
| import argparse, os, time, pathlib | |
| def video_dl(url, resolution, is_progressive, is_adaptive, is_only_audio, path, numbered, prefix): | |
| print('Fetching ...', end='\r') | |
| for i in range(6): | |
| try: | |
| video = YouTube(url, on_progress_callback=progress) | |
| except: |
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
| % Initialize | |
| global piece pieces_types all_pieces running interface plane max_column max_row score blocks | |
| max_row = 23; max_column = 15; | |
| plane = zeros(max_row,max_column); | |
| interface = figure; initialize_window(); | |
| load_pieces(); | |
| running = true; | |
| score = 0; | |
| blocks = 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 random, sys | |
| entry_number = -1 | |
| entries= [] | |
| number_of_groups = 0 | |
| def add_entry(): | |
| global entry_number, entries |
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
| // calculate x^y | |
| float power(float x, int y){ | |
| if(y == 1) return x; | |
| return x * power(x, --y); | |
| } | |
| // int d is the size of the square matrix | |
| // float m[d][d] is the actual 2D array | |
| float det(int d, float m[d][d]){ |
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 pygame, time, numpy | |
| class grid: | |
| def __init__(self, dimentions): | |
| self.dimentions = dimentions | |
| self.plane = numpy.zeros([dimentions,dimentions]) | |
| def changeColor(self, cellPosition): | |
| self.cellPosition = cellPosition |
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
| #!/usr/bin/python3 | |
| ############ Imports | |
| import re, requests, tempfile, argparse, ffmpy | |
| import urllib.request | |
| ############ Parser function | |
| def parseRedditVideo(link: str, outPath: str): |