MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / Bytes

Class Bytes

aura/analyzers/python/nodes.py:479–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477
478@dataclass
479class Bytes(ASTNode):
480 value: bytes
481
482 def __post_init__(self):
483 super().__post_init__()
484
485 if type(self.value) == str:
486 self.value = self.value.encode()
487
488 def _visit_node(self, context: Context):
489 pass
490
491 def __str__(self):
492
493 try:
494 return self.value.decode()
495 except UnicodeDecodeError:
496 encoding = chardet.detect(self.value)["encoding"]
497 return self.value.decode(encoding)
498
499 def __bytes__(self):
500 return self.value
501
502 @property
503 def json(self):
504 d = super().json
505 d["value"] = self.value
506 return d
507
508
509@dataclass

Callers 2

inline_decodeMethod · 0.85
visit_BytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected