derhnyel / sani Goto Github PK
View Code? Open in Web Editor NEWAn advanced AI-powered tool for building better softwares.
An advanced AI-powered tool for building better softwares.
if another code being imported has debugger enabled .. deactivate it
https://github.com/emptycrown/llama-hub
We could use this with the llm and cache ???
it captures the whole class instead .. Might be an issue or maybe not .. in a perfect use case the bot might want to know the whole class context inorder to fix its methods
if the original debugger declaration is reassigned to another variable the fix will not catch that ... We could just add that to the documentation and ask users not to reassign the original declaration
Will keep updating ... we can use this to keep track of the tests generally
Code throws errors when using with method AttributeError: __enter__
on deactivate. This should be avoided ... stops the runtime flow
Here's the code you can use to reproduce the bug:
from sani.debugger import debugger
import json, zlib, datetime
from typing import Any, Dict
debug = debugger.Debugger(__name__, stdout="test.txt", channel="io")
debug.breakpoint(mode="fix", subject="cache operations")
def write_to_cache(query: str, result: Any, cache_obj: Dict):
hash = zlib.adler32(query.encode('utf-8'))
cache_obj[hash] = json.dumps(result)
# redis_connection.set(hash, json.dumps(result))
objects = [
{'id': '12341228', 'title': 'Hello world in python', 'view_count': 2378},
{'id': '44780514', 'title': 'FastAPI with Odmantic', 'view_count': 1970},
{'id': datetime.date(7123, 11, 28), 'title': 'pandas loc vs iloc', 'view_count': 4012},
{'id': '02139172', 'title': 'Dataframe in Pandas', 'view_count': 4012}
]
cache = {}
query = 'pandas'
write_to_cache(query, objects[2], cache) # buggy call here.
print(cache)
debug.debugger_end_breakpoint()
Output:
write_to_cache(query, objects[2], cache)
File "/workspaces/sani/test_fix.py", line 10, in write_to_cache
cache_obj[hash] = json.dumps(result)
File "/usr/local/python/3.10.4/lib/python3.10/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/local/python/3.10.4/lib/python3.10/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/python/3.10.4/lib/python3.10/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/python/3.10.4/lib/python3.10/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
2023-05-14 00:13:20,018::DEBUG::sani.debugger.debugger::Code Failed. No at exit mode was dispatched
Parse error traceback dynamically for different traceback messages scenerios.
Bot's might find it had to fix, improve, write test for code that has sani's comments and declarations in them.
blocked until #10 is complete
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.