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
| # create upgrade_plan method based on username | |
| def upgrade_plan(self, username, upgrade_plan): | |
| DISCOUNT = 0.05 | |
| # iterate keys and values based on data | |
| for key, value in data.items(): | |
| if key == self.username: | |
| get_current_plan = value[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
| def data_validation(data: pd.DataFrame): | |
| # check data shape | |
| n_rows = data.shape[0] | |
| n_cols = data.shape[1] | |
| print("========== Start Data Validation Pipeline ==========") | |
| print(f"Number of rows: {n_rows}") | |
| print(f"Number of cols: {n_cols}") |
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
| def menghitung_volume_kubus(rusuk): | |
| """ | |
| function ini untuk menghitung volume kubus | |
| Parameter | |
| --------- | |
| rusuk = input rusuk dari kubus | |
| Returns | |
| ------- |
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
| def check_plan(self, username): | |
| for key, value in data.items(): | |
| if key == self.username: | |
| print(f"Nama Plan: {value[0]}") | |
| print(f"Sudah Berlangganan: {value[1]} Bulan") | |
| print("") | |
| try: | |
| if value[0] == "Basic Plan": | |
| table = [[True, "Bisa Stream"], |
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
| def track_count(df_name): | |
| return df_name.groupby(['artist', 'album']).count() |
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
| def filterByArtist(df_name, artist_name): | |
| return df_name[df_name['artist'] == artist_name] |
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
| def decode_JSON(data_path, encode='utf-8'): | |
| return json.load(open(data_path, encoding=encode)) |
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 os | |
| import pandas as pd | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import seaborn as sns | |
| import warnings as wrn | |
| import json | |
| from utils.preprocess_data import decode_JSON, filterByArtist, track_count | |
| wrn.filterwarnings('ignore', category = DeprecationWarning) | |
| wrn.filterwarnings('ignore', category = FutureWarning) |
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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: karsajobs-backend | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: backend | |
| template: |