Skip to content

Instantly share code, notes, and snippets.

View PiotrZakrzewski's full-sized avatar

Piotr Zakrzewski PiotrZakrzewski

View GitHub Profile
View result.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PiotrZakrzewski
PiotrZakrzewski / list_fun_calls.py
Last active April 5, 2021 07:41
List function calls within a Python function declaration with the ast module.
View list_fun_calls.py
"""List function calls within a Python function declaration with the ast module."""
import ast
class PrintCalls(ast.NodeVisitor):
def visit_Call(self, node):
print(node.func.id)
code = """def fun(a:int) -> int:
b = util_fun(a)
View IMDB-5000-ETL.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pr_reporter.py
from github import Github
from time import time
from calendar import timegm
from statistics import median
import requests
import json
GITHUB_API_TOKEN = "REPLACE_ME"
WEBHOOK_URL = "REPLACE_ME"
TARGET_ORG = "REPLACE_ME"
View keybase.md

Keybase proof

I hereby claim:

  • I am piotrzakrzewski on github.
  • I am piotrzakrzewski (https://keybase.io/piotrzakrzewski) on keybase.
  • I have a public key ASAu2338QxVxUiOEJ48YaZyaR2Ah2eaDKPBGnYfziMqxhAo

To claim this, I am signing this object:

@PiotrZakrzewski
PiotrZakrzewski / random_drop.py
Last active November 19, 2017 17:53
Random drop
View random_drop.py
import numpy as np
import random
ILOSC_KREGOW = 9
probabilities = np.array([np.exp(-x) for x in range(ILOSC_KREGOW) ])
normalized_probs = probabilities / np.sum(probabilities) # teraz ich suma to 1.0
print("Prawdopodobienswa po normalizacji", normalized_probs)
normalized_probs = list(normalized_probs)
@PiotrZakrzewski
PiotrZakrzewski / install_docker.sh
Created May 30, 2017 12:58
Install docker-engine Ubuntu 16.04
View install_docker.sh
sudo apt-get update
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
sudo apt-get update
apt-cache policy docker-engine
sudo apt-get install -y docker-engine
View migrate_grails.py
#!/bin/python
import click
from os import walk, makedirs
from os.path import join
from shutil import copy
@click.command()
@click.option('--source', help="""Path to the grails 2 project""", type=file)
@click.option('--destination',
help="""Path to the bootstrapped grails 3 project""", type=file)
View Validation-oc.md

#Patient Registration

  • presence of required fields. Taken from Study parameters.
  • Study exists in OC,
  • Site exist in the study
  • uniqueness of Study Subject ID (SSID) within file
  • width of SSID max 30 characters
  • gender is either "m" or "f"
  • uniqueness of PersonID in the Study
  • date format of Date of Enrollment
  • Width of Secondary ID max 30 characters
@PiotrZakrzewski
PiotrZakrzewski / getMetadataResponse.xml
Created April 28, 2016 15:14
Response to getMetadata request to OC 3.6
View getMetadataResponse.xml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<createResponse xmlns="http://openclinica.org/ws/study/v1">
<result xmlns="http://openclinica.org/ws/study/v1">Fail</result>
<error xmlns="http://openclinica.org/ws/study/v1">No study identifier was provided</error>
</createResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>