Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(
self,
watch=(),
watch_explode=(),
depth=1,
):
self.watch = [
v if isinstance(v, BaseVariable) else CommonVariable(v)
for v in ensure_tuple(watch)
] + [
v if isinstance(v, BaseVariable) else Exploding(v)
for v in ensure_tuple(watch_explode)
]
self.frame_infos = ArgDefaultDict(FrameInfo)
self.depth = depth
assert self.depth >= 1
self.target_codes = set()
self.target_frames = set()
def __init__(
self,
watch=(),
watch_explode=(),
depth=1,
):
self.watch = [
v if isinstance(v, BaseVariable) else CommonVariable(v)
for v in ensure_tuple(watch)
] + [
v if isinstance(v, BaseVariable) else Exploding(v)
for v in ensure_tuple(watch_explode)
]
self.frame_infos = ArgDefaultDict(FrameInfo)
self.depth = depth
assert self.depth >= 1
self.target_codes = set()
self.target_frames = set()
self.variable_whitelist = None
def __init__(self, *args, **kwargs):
super(Source, self).__init__(*args, **kwargs)
if self.tree and self.text:
self.highlighted = ArgDefaultDict(
lambda style: raw_highlight(self.text, style).splitlines()
)
else:
self.lines = defaultdict(lambda: u'SOURCE IS UNAVAILABLE')
self.highlighted = defaultdict(lambda: self.lines)
self.statements = StatementsDict(self)
self.nodes = []
if self.tree:
self.tree._depth = 0
for node in ast.walk(self.tree):
node._tree_index = len(self.nodes)
self.nodes.append(node)
for child in ast.iter_child_nodes(node):
child._depth = node._depth + 1
def __init__(self, *args, **kwargs):
super(Source, self).__init__(*args, **kwargs)
if self.tree:
self.lines = self.text.splitlines()
self.highlighted = ArgDefaultDict(
lambda style: raw_highlight(self.text, style).splitlines()
)
else:
self.lines = defaultdict(lambda: u'SOURCE IS UNAVAILABLE')
self.highlighted = defaultdict(lambda: self.lines)
self.statements = StatementsDict(self)
self.nodes = []
if self.tree:
self.tree._depth = 0
for node in ast.walk(self.tree):
node._tree_index = len(self.nodes)
self.nodes.append(node)
for child in ast.iter_child_nodes(node):
child._depth = node._depth + 1
def __init__(self, factory):
super(ArgDefaultDict, self).__init__()
self.factory = factory