This style guide elaborates on pycode-style.
'''is for string values."""is for docstrings.
| #!/bin/sh | |
| pactl load-module module-loopback latency_msec=1 |
| """Jaccard Similarity of Bags | |
| Using artificial restriciton of using only builtin Python 3 only. | |
| """ | |
| import doctest | |
| def multiset_intersection_cardinality(x: list, y: list) -> int: |
| """Jaccard similarity of two sets using builtin Python 3 only.""" | |
| import doctest | |
| def jaccard_similarity(x: set, y: set) -> float: | |
| """Get the Jaccard similarity of two sets. | |
| Example: | |
| >>> jaccard_similarity({1,2,3,4}, {2,3,5,7}) |
| """Find all the combinations of two cards being added | |
| to equal a range of values 2-26, because 2 is the lowest | |
| value that has a combination, and 26 is the highest value | |
| which has a combination. | |
| King 13 | |
| Queen 12 | |
| Jack 11 | |
| Ace 1 |
| #!/bin/zsh | |
| # Sync a youtube playlist as mp3 | |
| # | |
| # Requires youtube-dl: brew install youtube-dl | |
| # | |
| # Max quality. | |
| youtube-dl -o "/Users/lillianlemmer/Music/Youtube/%(title)s.%(ext)s" \ | |
| --extract-audio --audio-format mp3 --audio-quality 0 \ | |
| --download-archive ~/.cache/youtube-dl/archive -q \ |
| <html> | |
| <head> | |
| <style> | |
| .wowimsocool { | |
| display: block; | |
| width: 632px; | |
| height: 836px; | |
| background: #000; | |
| background-image: linear-gradient(to right, rgba(255, 0, 0, 255), rgba(255, 0, 0, 255)), | |
| linear-gradient(to right, rgba(0, 255, 0, 255), rgba(0, 255, 0, 255)), |
| """Demo the ability to use Abstract Syntax Trees to | |
| retrieve the value of __version__ from a package's | |
| __init__.py, without executing __init__.py or using | |
| regular expressions. | |
| Works in Python 2 and Python 3. | |
| See Also: | |
| * https://greentreesnakes.readthedocs.org/en/latest/tofrom.html | |
| * http://eli.thegreenplace.net/2009/11/28/python-internals-working-with-python-asts/ |