Skip to content

Instantly share code, notes, and snippets.

View yaniaular's full-sized avatar
🏠
Working from home

Yanina yaniaular

🏠
Working from home
View GitHub Profile
@yaniaular
yaniaular / lock_python.py
Last active February 19, 2022 06:09
How works redis.lock with python
# https://github.com/redis/redis-py/
# https://realpython.com/intro-to-python-threading/
import time
import threading
from redis import Redis
from redis.exceptions import LockError, TimeoutError, LockNotOwnedError
r = Redis(host='localhost', port=6379, db=0)
@yaniaular
yaniaular / unidades.py
Last active February 1, 2019 02:41
Grupos de unidades de medida
UOM_MAPPING = {
'BL06': [
'absa.product_uom_bl06_bl06',
'absa.product_uom_pza_pza',
],
'TRAMO': [
# Esta es una unidad pote, por lo tanto
# Hay que tomar otras variables en cuenta
# para su conversión
'absa.product_uom_tramo_tramo',