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
Your goal is to produce a file called .rules which explains the outline of the project, so that you (the AI agent) can navigate and modify the project swiftly. | |
In the file, include information such as: | |
- Which language(s) the project is written in | |
- Which tools (such as package manager) and libraries/frameworks (only include major or relevant ones) does the project use, include key components (auth, logging, styling, etc) | |
- The structure of the project (if it's split into multiple sub-modules, enumerate what each does, and include information on them) | |
- How the project is deployed (include some information on infrastructure and CI/CD) | |
- Basic project style guides and guidelines, if applicable |
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
import os | |
import struct | |
import fcntl | |
from decimal import Decimal | |
DEVICE_FILE_NAME = "/dev/vcio" | |
IOCTL_MBOX_PROPERTY = 0xC0046400 # _IOWR(MAJOR_NUM, 0, char *) adjusted for alignment | |
GET_GENCMD_RESULT = 0x00030080 | |
MAX_STRING = 1024 |
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
import extruct | |
import requests | |
from w3lib.html import get_base_url | |
from urllib.parse import urlparse | |
url = "https://www.kalevala.fi/collections/korvakorut/products/paratiisi-tappikorvakorut-hopea" | |
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 test_cmdline_logging_info(caplog, capsys): | |
retv = tnefparse.cmdline.tnefparse(('-l', 'INFO', '-rb', 'tests/examples/rtf.tnef')) | |
assert not retv | |
stdout, _ = capsys.readouterr() | |
assert len(stdout) == 593 | |
assert caplog.record_tuples == [ | |
('tnefparse', logging.INFO, 'Skipping checksum for performance'), | |
] | |
def tnefparse(argv=None): |
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
class bouncer(Awaitable): | |
"serve awaiters on a first-come first-served basis" | |
queue = [] | |
def __init__(self): | |
type(self).queue.append(self.caller) | |
@property | |
def caller(self): |
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
class my_turn: | |
"""a first come, first served coordinator predicate for | |
asyncio.Condition.wait_for(predicate); could also do away | |
the 'caller' by just hardcoding it to the current task | |
""" | |
queue = [] | |
def __init__(self, caller): | |
type(self).queue.insert(0, caller) |
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
#!/usr/bin/env python3 | |
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python | |
# Proof-of-Concept for https://stackoverflow.com/q/64017656/1548275 | |
# Do Python asyncio Streams maintain order over multiple writers and readers? | |
import sys | |
import argparse |
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 splice(sequence, size): | |
"return a list of all ordered splices of given size" | |
ss = len(sequence) | |
return [sequence[i:i+size] for i in range(0, ss-size+1)] |
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
class Hfst < Formula | |
desc "Helsinki Finite-State Technology (library and application suite)" | |
homepage "https://hfst.github.io" | |
url "https://github.com/hfst/hfst/archive/v3.15.0.tar.gz" | |
sha256 "1ce90956d7c91d75e7c141e3852504b02728672239746858a141ccfae1712d19" | |
depends_on "automake" | |
depends_on "autoconf" | |
depends_on "libtool" | |
depends_on "bison" |
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
""" | |
An attempt to produce a good enough list of commonly understandable country names | |
from pycountry straight-jacket names. Thus country names produced are without | |
prefixes such as "Republic of", and are also disambiguated from one another | |
(British & US Virgin Islands and Republic & Democratic Republic of Congo). | |
People living in the two countries both known as Congo call their country | |
either Congo-Kinshasa or Congo-Brazzaville, ie. adding the name of the capital; | |
we use that convention as an incremental means for additional disambiguation. | |
Also, liberty is taken to call Lao People's Democratic Republic just Laos, and | |
use the commonly known names North and South Korea, rather than the official |
NewerOlder