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 operator | |
| import construct | |
| class ConstructGetter(object): | |
| def __init__(self): | |
| self._index = 0 | |
| def __getattr__(self, name): |
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 sys | |
| import inspect | |
| class Tracer(object): | |
| def __init__(self): | |
| self._indentation_level = 0 | |
| @property | |
| def indentation_level(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
| def _remove_visual_c_ref(self, manifest_file): | |
| try: | |
| # Remove references to the Visual C runtime, so they will | |
| # fall through to the Visual C dependency of Python.exe. | |
| # This way, when installed for a restricted user (e.g. | |
| # runtimes are not in WinSxS folder, but in Python's own | |
| # folder), the runtimes do not need to be in every folder | |
| # with .pyd's. | |
| # Returns either the filename of the modified manifest or | |
| # None if no manifest should be embedded. |
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
| <html> | |
| <body> | |
| <style> | |
| #byte_content { | |
| margin: 5px 0; | |
| max-height: 100px; | |
| overflow-y: auto; | |
| overflow-x: hidden; | |
| } | |
| #byte_range { margin-top: 5px; } |
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 functools import wraps | |
| class Default(object): | |
| def __init__(self, name): | |
| super(Default, self).__init__() | |
| self.name = name | |
| def set_defaults(defaults): |
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 LoopLabel(object): | |
| def __init__(self): | |
| super(LoopLabel, self).__init__() | |
| class MyLoopLabel(Exception): pass | |
| self._label_exception = MyLoopLabel | |
| def __enter__(self): | |
| return self._label_exception |
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
| // Define a class with a method | |
| function MyClass(value) { | |
| this.value = value; | |
| this.function = function() { | |
| return this.value; | |
| }; | |
| } | |
| // Instanciate the class | |
| my_class = new MyClass("my value"); |
NewerOlder