Skip to content

Instantly share code, notes, and snippets.

View gaborbernat's full-sized avatar
👋
Around but limited availability

Bernát Gábor gaborbernat

👋
Around but limited availability
View GitHub Profile
@gaborbernat
gaborbernat / spacy.har.json
Last active July 19, 2022 07:43
Space import time
{"log":{"version":"1.2","creator":{"name":"python","version":"3.10.5 (main, Jun 7 2022, 08:14:35) [Clang 13.1.6 (clang-1316.0.21.2.5)]"},"browser":{"name":"python","version":"3.10.5 (main, Jun 7 2022, 08:14:35) [Clang 13.1.6 (clang-1316.0.21.2.5)]"},"pages":[{"startedDateTime":"1991-07-05T00:00:00.000Z","id":"page0","title":"`import spacy` 3.10.5 (main, Jun 7 2022, 08:14:35) [Clang 13.1.6 (clang-1316.0.21.2.5)]","pageTimings":{"onContentLoad":-1,"onLoad":-1}}],"entries":[{"page_ref":"page0","startedDateTime":"1991-07-05T00:00:00.003Z","time":101,"request":{"method":"GET","url":"itertools","httpVersion":"HTTP/0.0","cookies":[],"headers":[],"queryString":[],"headersSize":0,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/0.0","cookies":[],"headers":[],"content":{"size":0,"mimeType":"text/x-python"},"redirectURL":"","headersSize":0,"bodySize":0},"cache":{},"timings":{"blocked":0,"dns":0,"connect":0,"ssl":0,"send":0,"wait":0,"receive":101},"serverIpAddress":"0.0.0.0"},{"page_ref":"p
@gaborbernat
gaborbernat / output
Created October 22, 2021 09:14
pycharm-3.10-segmentation-fault
/w/.tox/4/dev/bin/python "/Users/bgabor8/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.4631.9/PyCharm 2021.3 EAP.app/Contents/plugins/python/helpers/pydev/pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 57096 --file "/Users/bgabor8/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.4631.9/PyCharm 2021.3 EAP.app/Contents/plugins/python/helpers/pycharm/_jb_pytest_runner.py" --target manual_step.py::test_dataflow_step_local
Testing started at 10:11 ...
/Users/bgabor8/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.4631.9/PyCharm 2021.3 EAP.app/Contents/plugins/python/helpers/pydev/pydevd.py:1844: DeprecationWarning: currentThread() is deprecated, use current_thread() instead
dummy_thread = threading.currentThread()
Connected to pydev debugger (build 213.4631.9)
Launching pytest with arguments manual_step.py::test_dataflow_step_local --no-header --no-summary -q in /w/tests/integration
============================= test session
@gaborbernat
gaborbernat / README.md
Last active September 23, 2021 09:32
tox-2159
"""The challenge here is to make grand children print out the value set by child, without access to modify cannot_modify"""
from threading import Thread, local, current_thread
# solution start
def new_start(self): # need to patch this
self.parent = current_thread().ident
old_start(self)
old_start, Thread.start = Thread.start, new_start
class Local(local):
"""The challenge here is to make grand children print out the value set by child, without modifying cannot_modify or grand_child"""
from threading import Thread, local
var = local()
def peek(from_name):
print(f"{from_name}: {getattr(var, 'value', None)}\n", end="")
def master():
var.value = "master"
@gaborbernat
gaborbernat / keybase.md
Created September 13, 2019 08:26
keybase.md

Keybase proof

I hereby claim:

  • I am gaborbernat on github.
  • I am gaborjbernat (https://keybase.io/gaborjbernat) on keybase.
  • I have a public key ASBH4ekjiP4eqwyaUHNgPyDYMYfrREL5Jx1gQELe0lHGSQo

To claim this, I am signing this object:

gaborjbernat Bernat Gabor working at @bloomberg, currently mainly focusing on Python but polyglot London

Keybase proof

I hereby claim:

fix_lint installed: aspy.yaml==1.1.1,cached-property==1.5.1,cfgv==1.1.0,identify==1.1.7,importlib-metadata==0.6,nodeenv==1.3.2,pre-commit==1.12.0,PyYAML==3.13,six==1.11.0,toml==0.10.0,virtualenv==16.0.0
fix_lint run-test-pre: PYTHONHASHSEED='643'
fix_lint runtests: commands[0] | pre-commit run --all-files --show-diff-on-failure
[INFO] Installing environment for https://github.com/ambv/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('C:\\Users\\berna\\.cache\\pre-commit\\repos2irookv\\py_env-python3.7\\Scripts\\pip.exe', 'install', '.')
Return code: 2
Expected return code: 0
Output:
@gaborbernat
gaborbernat / output.md
Created March 3, 2017 17:59
python ssl bug
  1. Fails
FROM artprod.dev.bloomberg.com/devx-rhel-build-base:7.2
RUN printf 'Acquire::http::Proxy "http://bproxy.tdmz1.bloomberg.com:80";\nAcquire::https::Proxy "https://bproxy.tdmz1.bloomberg.com:80";' >/opt/bb/etc/apt/apt.conf
RUN /opt/bb/bin/apt-get update && /opt/bb/bin/apt-get install --force-yes -y python2.7
RUN /opt/bb/bin/python2.7 -c 'import ssl'
from collections import defaultdict
import itertools
def data():
N, I = [int(i) for i in input().split()]
rows = [[int(i) for i in input().split()] for _ in range(I)]
return N, rows