Modernize Python projects to follow best current practices for packaging, linting, CI, and releases.
Use when the user asks to:
- "modernize this python project"
- "fix python project to follow best practices"
- "add pyproject.toml"
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
| import requests | |
| def count_chars(text): | |
| """Count the frequency of each character in the given text.""" | |
| freq = {} | |
| for char in text: | |
| freq[char] = freq.get(char, 0) + 1 | |
| return freq | |
| from math import sqrt | |
| try: | |
| from nose.tools import assert_almost_equal | |
| except: | |
| assert_almost_equal = lambda x, y: True | |
| def daumann_kalk(ankertaulengde, dybde, daumannlengde, dausynk, daumannsvekt): | |
| l1 = ankertaulengde - daumannlengde | |
| l2 = daumannlengde |
| from math import log10 | |
| import sys | |
| def print_si(number): | |
| units = ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] | |
| thousands = int(log10(number)//3) | |
| base = number//1000**thousands | |
| print("%d %s" % (base, units[thousands])) | |
| if __name__ == '__main__': |