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
    
  
  
    
  | from dataclasses import dataclass | |
| from typing import Callable, Any, Literal, Type | |
| from enum import Enum | |
| El = int | float | str | |
| S = list[El] | |
| BoolMat = list[list[bool]] | |
| def default_for_type(t: Type) -> El: | 
  
    
      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
    
  
  
    
  | from enum import Enum, unique, auto | |
| from dataclasses import dataclass | |
| from typing import List, TypeVar, Type | |
| from pathlib import Path | |
| import os | |
| I = TypeVar('I', bound='Input') | |
| @unique | |
| class InputType(Enum): | 
  
    
      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
    
  
  
    
  | from dataclasses import dataclass | |
| from datetime import datetime | |
| import enum | |
| from functools import reduce | |
| from typing import List, Optional | |
| import uuid | |
| class StatusEnum(enum.Enum): | |
| PENDING: str = "PENDING" | 
  
    
      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
    
  
  
    
  | # Thanks blanket#1213 https://github.com/blanketsucks for helping. | |
| from dataclasses import dataclass | |
| import enum | |
| import math | |
| class MathError(Exception): | |
| pass | |
| class InavliadSyntax(MathError): | |
| def __init__(self, *args: object) -> 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
    
  
  
    
  | from abc import ABC | |
| from dataclasses import dataclass | |
| from enum import Enum | |
| from string import ascii_letters, digits | |
| from typing import List, Optional, Union | |
| DELIMITER = Enum("DELIMITER", "COMMA SEMICOLON") | 
  
    
      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
    
  
  
    
  | from typing import Iterator, Match, TypeVar, Type | |
| from dataclasses import dataclass, field | |
| from enum import Enum | |
| import re | |
| class TokenKind(int, Enum): | |
| NUMBER = 0x01 | |
| SYMBOL = 0x02 | |
| ASSIGN = 0x03 | 
  
    
      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 | |
| # Copyright (c) 2010 Joshua Harlan Lifton. | |
| # See LICENSE.txt for details. | |
| # | |
| # keyboardcontrol.py - Abstracted keyboard control. | |
| # | |
| # Uses OS appropriate module. | |
| """Keyboard capture and control. | 
  
    
      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 | |
| import io | |
| import subprocess | |
| import pandas | |
| def read_shell(command, **kwargs): | |
| """ | |
| Takes a shell command as a string and and reads the result into a Pandas DataFrame. | |
  
    
      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 re | |
| def get_create_table_string(tablename, connection): | |
| sql = """ | |
| select * from sqlite_master where name = "{}" and type = "table" | |
| """.format(tablename) | |
| result = connection.execute(sql) | |
| create_table_string = result.fetchmany()[0][4] | |
| return create_table_string | 
  
    
      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
    
  
  
    
  | -- Example from https://www.sqlite.org/lang_with.html#outlandish_recursive_query_examples | |
| CREATE TABLE mandelbrot AS WITH RECURSIVE | |
| xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+0.05 FROM xaxis WHERE x<1.2), | |
| yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+0.1 FROM yaxis WHERE y<1.0), | |
| m(iter, cx, cy, x, y) AS ( | |
| SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis | |
| UNION ALL | |
| SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m | |
| WHERE (x*x + y*y) < 4.0 AND iter<28 | |
| ), |