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
name: Test | |
on: | |
push: | |
branches: | |
- main | |
- features/** | |
- dependabot/** | |
pull_request: | |
branches: |
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
## https://stackoverflow.com/a/35730928/12168211 | |
## Automatic help command | |
## Comment directly before target name used as help | |
.PHONY: help | |
# Show this help. | |
help: | |
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t |
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
""" | |
Simple logging decorator. | |
Usage: | |
@log() | |
def foo(): | |
# raise an exception | |
return 1 / 0 | |
By default, the exception is logged and then raised. |
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 argparse | |
from decimal import * | |
from functools import reduce, partial | |
import math | |
def _class_count(dic, x): | |
""" | |
Callback function to count elements in a list. | |
""" |
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 argparse | |
from decimal import Decimal | |
import matplotlib.pyplot as plt | |
from numpy import trapz | |
def create_roc_values(thresholds, scores, true_values): | |
""" | |
Calculate the points on a roc curve | |
""" | |
assert len(scores) == len(true_values) |
NewerOlder