Skip to content

Instantly share code, notes, and snippets.

View cfcosta's full-sized avatar

Cainã Costa cfcosta

  • São Paulo, Brazil
View GitHub Profile

MichaelSoft Binbows XP

Ever since the adventing of computing, there has been lots of different pushes to be able to "compute" the law. The benefits are very clear and simple, code is verifiable and, in a certain way, enforceable. But most of all, code connects with code, which connects with code, in a eternal chain to achieve goals once thought impossible.

The Crypto ecosystem got their own take on it: Smart Contracts. Unfortunately, a real world contract is not like a Smart Contract, it's not exactly deterministic, if this then that. It is diffuse, complex, and based more on "rules" that are not meant to be broken, but to be "reasoned" with.

Let's take this article from a fictional Income Tax law as an example:

1. The income tax for an individual is defined as a fixed percentage of the individual's income over a year.
from dspy import InputField, OutputField, Signature, evaluate, ChainOfThought, Example, Module
from dspy.teleprompt.bootstrap import BootstrapFewShot
class Extract(Signature):
"""Extract the information from a given text using a json schema."""
input_text = InputField(desc="the text to extract information from")
json_schema = InputField(desc="the schema to use to extract the information")
output = OutputField(desc="the extracted information")
{
"fund": {
"name": "AUTO LOANS FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS",
"cnpj": "40.794.358/0001-58",
"shares": [
{
"name": "Cotas Seniores",
"quantity": {
"min": 35000000,
"max": 70000000
use forced_collaboration::{
corpus::key_value_store::{Operation, Response},
proptest::*,
test_key_value_store, transport, Host, Simulation,
};
use async_trait::async_trait;
use dashmap::DashMap;
use eyre::Result;
use turmoil::net::TcpStream;
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.my-packages.notes;
directory = "/home/johndoe";
today = pkgs.writeShellScriptBin "today"
''$EDITOR "${directory}/$(date +%Y-%M-%d).md"'';
yesterday = pkgs.writeShellScriptBin "yesterday"
''$EDITOR "${directory}/$(date -d "yesterday" +%Y-%M-%d).md"'';
tomorrow = pkgs.writeShellScriptBin "tomorrow"
This file has been truncated, but you can view the full file.
{
"college": {
"DRVEF2019": [
[
{
"name": "UNITID",
"value": 100654
},
{
"name": "ENRTOT",
src
├── actions
│   ├── refund.rs
│   ├── transfer.rs
│   └── users
│   ├── sign_in.rs
│   └── sign_out.rs
├── main.rs
├── resources
│   ├── account.rs
./src/components/CytoscapeGraph/ContextMenu/NodeContextMenu.tsx
Line 107: Anchors must have content and the content must be accessible by a screen reader jsx-a11y/anchor-has-content
./src/components/MessageCenter/NotificationDrawer.tsx
Line 108: The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid
./src/components/Nav/Menu.tsx
Line 13: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
./src/components/IstioWizards/Slider/Slider.tsx
Compiled with warnings. ./src/components/CytoscapeGraph/ContextMenu/NodeContextMenu.tsx Line 107: Anchors must have content and the content must be accessible by a screen reader jsx-a11y/anchor-has-content ./src/components/MessageCenter/NotificationDrawer.tsx Line 108: The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid ./src/components/Nav/Menu.tsx Line 13: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank ./src/components/IstioWizards/Slider/Slider.tsx Line 184: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-te
./src/store/Selectors/GraphData.ts
Line 103: Expected to return a value in arrow function array-callback-return
Line 108: Prefer 'as DecoratedGraphNodeData' instead of '<DecoratedGraphNodeData>' when doing type assertions @typescript-eslint/no-angle-bracket-type-assertion
Line 110: Prefer 'as DecoratedGraphNodeWrapper' instead of '<DecoratedGraphNodeWrapper>' when doing type assertions @typescript-eslint/no-angle-bracket-type-assertion
Line 128: Prefer 'as DecoratedGraphEdgeData' instead of '<DecoratedGraphEdgeData>' when doing type assertions @typescript-eslint/no-angle-bracket-type-assertion
Line 130: Prefer 'as DecoratedGraphEdgeWrapper' instead of '<DecoratedGraphEdgeWrapper>' when doing type assertions @typescript-eslint/no-angle-bracket-type-assertion
./src/components/CytoscapeGraph/ContextMenu/NodeContextMenu.tsx
Line 107: Anchors must have content and the content must be accessible by a screen reader jsx-