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
| { | |
| "input": { | |
| "blocklist": [], | |
| "compressor#0": { | |
| "attack": 10.0, | |
| "boost-amount": 6.0, | |
| "boost-threshold": -72.0, | |
| "bypass": false, | |
| "dry": -100.0, | |
| "hpf-frequency": 10.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/bash -xe | |
| # --- Fuji XT-4 Webcam Startup Script --- | |
| # This script sets up the Fujifilm XT-4 as a webcam from a clean slate. | |
| # | |
| # USAGE: | |
| # ./fuji_xt4_ubuntu.sh (Starts in default mode, full visible frame) | |
| # ./fuji_xt4_ubuntu.sh --letterbox (Starts in 16:9 letterbox mode) | |
| # | |
| # hit ctrl-c to restart the stream (and refocus), hit ctrl-c twice in quick succession to stop the 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
| from boltons.iterutils import is_scalar, remap | |
| garbagey = {'attributes': | |
| {'vars': | |
| {'network': | |
| {'addresses': []}}, | |
| 'characteristics': | |
| {'chars': 'abc', | |
| 'misc_obj': {}, | |
| 'others': [1, 2]} |
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
| # python 3.10 with glom 23 | |
| >>> import glom | |
| >>> target = {'planets': [{'name': 'earth', 'moons': 1}]} | |
| >>> spec = ('planets', ['rings']) # a spec we expect to fail | |
| >>> glom.glom(target, spec) | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> | |
| File "/home/mahmoud/projects/glom/glom/core.py", line 2297, in glom | |
| raise err | |
| glom.core.PathAccessError: error raised while processing, details below. |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| Common test fixtures for pytest | |
| """ | |
| from __future__ import print_function, unicode_literals | |
| import os | |
| from itertools import groupby | |
| import pytest |
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
| before = \ | |
| ''' | |
| Traceback (most recent call last): | |
| File "tmp.py", line 9, in _make_stack | |
| glom(target, spec) | |
| File "/home/mahmoud/projects/glom/glom/core.py", line 2024, in glom | |
| raise err | |
| glom.core.PathAccessError: error raised while processing, details below. | |
| Target-spec trace (most recent last): |
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
| $ python3 | |
| Python 3.7.7 (default, Mar 10 2020, 17:25:08) | |
| [GCC 5.4.0 20160609] on linux | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> e = 'hi' | |
| >>> try: | |
| ... 1/0 | |
| ... except Exception as e: | |
| ... pass | |
| ... |
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 f(a, b): | |
| ... return a, b | |
| ... | |
| # py27 | |
| >>> partial(f, b=1)(1, 2) | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> | |
| TypeError: f() got multiple values for keyword argument 'b' |
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 create_parser(): | |
| root_parser = ArgumentParser(description='article fetch operations') | |
| root_parser.add_argument('--list_home', help='list lookup directory') | |
| add_subparsers(root_parser.add_subparsers()) | |
| return root_parser | |
| def add_subparsers(subparsers): | |
| parser_list = subparsers.add_parser('list') | |
| parser_list.add_argument('target_list', nargs='?', |
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
| >>> x = [1] | |
| >>> y = (2, 3) | |
| >>> x + y | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> | |
| TypeError: can only concatenate list (not "tuple") to list | |
| >>> x += y | |
| >>> x | |
| [1, 2, 3] |
NewerOlder