This file contains 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 . import templates | |
from guillotina.entrypoint import app as guillo | |
from starlette.applications import Starlette | |
from starlette.responses import PlainTextResponse | |
from starlette.responses import JSONResponse | |
from guillotina.component import get_utility | |
from guillotina.interfaces import IApplication | |
from guillotina.utils.content import get_database | |
from guillotina.utils.content import navigate_to | |
from guillotina import task_vars |
This file contains 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 python:3.7.3 | |
# based on a git clone from https://github.com/CollectivaT-dev/catotron-cpu | |
# plus embedding voices. | |
# also fixed requirements.txt | |
# -matplotlib==2.1.0 | |
# +numba==0.48 | |
# +matplotlib==3.3.2 | |
# numpy==1.18.0 | |
# inflect==0.2.5 |
This file contains 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 functools import partial | |
from imaplib import Int2AP | |
from starlette.responses import JSONResponse | |
from starlette.applications import Starlette | |
from starlette.routing import Route | |
import httpx | |
import json | |
import pydantic as pd | |
import random |
This file contains 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
import textwrap | |
sql = textwrap.dedent(""" | |
SELECT t1.field1, | |
t2.field2, | |
t3.field3 | |
FROM table1 t1 | |
INNER JOIN table2 t2 using(id_relation) | |
WHERE t1.pk = $1 | |
""") |
This file contains 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
const MyFunctionnalComponent: React.FC = props => { | |
useEffect(() => { | |
// Using an IIFE | |
(async function anyNameFunction() { | |
await loadContent(); | |
})(); | |
}, []); | |
return <div></div>; |
This file contains 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
docker run --rm -e 'TESTING=jenkins' -e 'DATABASE=postgres' -v /var/run/docker.sock:/var/run/docker.sock checkout:PR-173.1 'py.test checkout/tests/ -x -s -v' | |
Traceback (most recent call last): | |
File "/usr/local/bin/py.test", line 10, in <module> | |
sys.exit(main()) | |
File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 61, in main | |
config = _prepareconfig(args, plugins) | |
File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 182, in _prepareconfig | |
config = get_config() | |
File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 156, in get_config | |
pluginmanager.import_plugin(spec) |
This file contains 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
const out = () => console.log("Hola 2") | |
const out2 = () => console.log("Hola 4") | |
console.log("Hola 1") | |
out() | |
console.log("Hola 3") | |
Promise.resolve().then(out2) | |
console.log("Hola 5") |
This file contains 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
import asyncio | |
async def fibonacci(n: int, c: asyncio.Queue): | |
i, x, y = 0, 0, 1 | |
while(i < n): | |
print(f"produccing {i}") | |
await c.put(x) | |
x, y = y, x + y |
This file contains 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
############################################################################## | |
# | |
# Copyright (c) 2006 Zope Foundation and Contributors. | |
# All Rights Reserved. | |
# | |
# This software is subject to the provisions of the Zope Public License, | |
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | |
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | |
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
This file contains 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
_, pending = await asyncio.wait( | |
[handler_task, receiver_task], return_when=asyncio.FIRST_COMPLETED, | |
) | |
await _cancel_tasks(pending) |
NewerOlder