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 Temperature: | |
def __init__(self, reading = "0.0X"): | |
""" | |
Input : reading (string) : Takes the temperature reading entered by the user. The user needs to enter a temperature in either Celcius (C) | |
or Fahrenheit (F). There be no gap or degree symbol between the numeric value and the temperature unit. | |
""" | |
try: | |
self.unit = reading[-1].upper() | |
self.temp = float(reading[:-1]) | |
self.is_valid = True |
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 | |
from tensorflow.keras.preprocessing.text import Tokenizer | |
# from tensorflow.keras.engine.topology import Layer | |
from tensorflow.keras import initializers as initializers, regularizers, constraints | |
from tensorflow.keras.callbacks import Callback, EarlyStopping | |
from tensorflow.keras.layers import Embedding, Input, Dense, LSTM, GRU, Bidirectional, TimeDistributed, concatenate, Add, Layer | |
from tensorflow.keras import backend as K | |
from tensorflow.keras.models import Model |
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 argparse | |
import random | |
import time | |
import pandas as pd | |
import seaborn as sns | |
sns.set(style = "whitegrid") | |
def generate_initial(num_of_elements): | |
''' | |
Generate a shuffled array of a given length |
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 | |
import time | |
def generate_initial(num_of_elements): | |
''' | |
Generate a shuffled array of a given length | |
''' | |
array = list(range(num_of_elements)) | |
random.shuffle(array) | |
return array |
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
print(colored('Twinkle Twinkle Little Star', 'yellow', 'on_blue', attrs=['blink', 'bold'])) |
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
cprint("A WILD WARNING HAS APPEARED", "yellow", "on_red") | |
print(Fore.YELLOW + Back.RED + "A WILD WARNING HAS APPEARED") |
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
print(colored('Hello', 'red'), colored(' World', 'green')) | |
print(Fore.RED + "Hello" + Fore.GREEN + " World") |
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 termcolor import colored, cprint # For Termcolor | |
from colorama import init, Fore, Back | |
init(autoreset = True) # For colorama |
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
print(f"{bcolors.WARNING}Warning: No active frommets remain. Continue?{bcolors.ENDC}") |
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 bcolors: | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' | |
ENDC = '\033[0m' | |
BOLD = '\033[1m' | |
UNDERLINE = '\033[4m' |
NewerOlder