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
| #!/bin/sh | |
| echo "$branchName" | |
| if [ "$branchName" = "master" ]; then | |
| exit 0 | |
| fi | |
| if [[ "$branchName" =~ ^[a-z]+[\/]+[A-Z]+[\-]+[0-9]+[\_]+[a-zA-Z] ]]; then | |
| echo "Good branch name!" | |
| exit 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
| #!/bin/sh | |
| echo "Running pre-push hook" | |
| ./exampleScrit.sh | |
| # $? stores exit value of the last command | |
| if [ $? -ne 0 ]; then | |
| echo "Tests must pass before commit!" | |
| exit 1 | |
| fi |
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/env node | |
| const fs = require( 'fs' ); | |
| const commit = process.argv[2]; | |
| const data = fs.readFileSync( commit, { encoding: 'utf8' } ); | |
| const [ firstLine ] = data.split( '\n' ); | |
| const result = /^[A-Z]+\-\d+ .+$/.test( firstLine ); | |
| const errorMessage = ` | |
| ----------------------------------------------------- |
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
| #!/bin/sh | |
| # list of hooks the script will look for | |
| HOOK_NAMES="applypatch-msg pre-applypatch post-applypatch pre-commit prepare-commit-msg commit-msg post-commit pre-push pre-rebase post-checkout post-merge pre-receive update post-receive post-update pre-auto-gc" | |
| # relative folder path of the .git hook / current script | |
| GIT_HOOK_DIR=./.git/hooks | |
| # relative folder path of the custom hooks to deploy / current script | |
| LOCAL_HOOK_DIR=./scripts/git | |
| # relative folder path of the custom hooks to deploy / .git hook folder |
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 test_addtion_int(): | |
| assert calculate_result(2, 3, 'int', "addition") == 5 | |
| def test_addtion_float(): | |
| assert calculate_result(2.1, 3.5, 'float', "addition") == 5.6 | |
| def test_subtraction_int(): | |
| assert calculate_result(4, 3, 'int', "subtraction") == 1 | |
| def test_subtraction_float(): |
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 numpy as np | |
| one_dim = np.ones(shape=(5), dtype=np.int) | |
| # print(one_dim) | |
| # [1 1 1 1 1] | |
| two_dim = np.ones(shape=(5, 2), dtype=np.int) | |
| # print(two_dim) |
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 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 glob | |
| import shutil | |
| import typing | |
| import numpy as np | |
| from PIL import Image, ImageStat, ImageChops | |
| from pathlib import Path | |
| def pre_processsing(input_dir: str, output_dir: str, logfile: str) -> int: |
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
| @app.route('/predict',methods=['POST']) | |
| def predict(): | |
| input_val = [x for x in request.form.values()][0] | |
| rf = load_model(BUCKET_NAME, MODEL_FILE_NAME, MODEL_LOCAL_PATH) | |
| if input_val not in available_countries: | |
| return f'Country {input_val} is not in available list. Try one from the list! Go back in your browser', 400 | |
| to_pred = get_prediction_params(input_val, url_to_covid) | |
| prediction = rf.predict(to_pred)[0] | |
| return render_template('home.html',pred=f'New cases will be {prediction}') |
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 pre_process(df): | |
| cols_too_many_missing = ['new_tests', | |
| 'new_tests_per_thousand', | |
| 'total_tests_per_thousand', | |
| 'total_tests', | |
| 'tests_per_case', | |
| 'positive_rate', | |
| 'new_tests_smoothed', | |
| 'new_tests_smoothed_per_thousand', | |
| 'tests_units', |