prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
return (next_specific(landing_square, "R"), chance_card, chest_card)
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
return (landing_square, chance_card, chest_card)
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
raise Exception("Case should not occur")
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
doubles += 1
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
doubles = 0
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
doubles = 0 current = "JAIL"
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
index = SQUARES.index(current) landing_square = SQUARES[(index + total) % len(SQUARES)] (current, chance_card, chest_card) = next_square(landing_square, chance_card, chest_card)
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
print euler_timer(84)(main)(verbose=True)
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
roll_die
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
back
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
next_specific
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
next_square
<|file_name|>no084.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from random import choice from python.decorators import euler_timer SQUARES = ["GO", "A1", "CC1", "A2", "T1", "R1", "B1", "CH1", "B2", "B3", "JAIL", "C1", "U1", "C2", "C3", "R2", "D1", "CC2", "D2", "D3", ...
main
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): <|fim_middle|> <|fim▁end|>
def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enable is not None: self.enable = enable if text is not None: self.text = te...
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): <|fim_middle|> @property def enable(self): return self._enable @enable.setter def enable(self, valu...
self._enable = None self._text = None self._html = None self._substitution_tag = None if enable is not None: self.enable = enable if text is not None: self.text = text if html is not None: self.html = html if substituti...
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
return self._enable
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
self._enable = value
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
return self._text
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
self._text = value
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
return self._html
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
self._html = value
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
return self._substitution_tag
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
self._substitution_tag = value
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
subscription_tracking = {} if self.enable is not None: subscription_tracking["enable"] = self.enable if self.text is not None: subscription_tracking["text"] = self.text if self.html is not None: subscription_tracking["html"] = self.html if s...
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
self.enable = enable
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
self.text = text
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
self.html = html
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
self.substitution_tag = substitution_tag
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
subscription_tracking["enable"] = self.enable
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
subscription_tracking["text"] = self.text
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
subscription_tracking["html"] = self.html
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
subscription_tracking["substitution_tag"] = self.substitution_tag
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def <|fim_middle|>(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None i...
__init__
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
enable
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
enable
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
text
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
text
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
html
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
html
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
substitution_tag
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
substitution_tag
<|file_name|>subscription_tracking.py<|end_file_name|><|fim▁begin|>class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enab...
get
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input()) MOD = 10**9 + 7 def modexp(a,b): res = 1 while b: if b&1: res *= a res %= MOD a = (a*a)%MOD b /= 2 return res fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(100001)] for...
fn[i] %= MOD ifn[i] = modexp(fn[i],MOD-2)
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input()) MOD = 10**9 + 7 def modexp(a,b): <|fim_middle|> fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(100001)] for i in range(1,100000): fn[i] = fn[i-1] * i fn[i] %= MOD ifn[i] = modexp(fn[i],MOD-2) def nCr(n,k): re...
res = 1 while b: if b&1: res *= a res %= MOD a = (a*a)%MOD b /= 2 return res
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input()) MOD = 10**9 + 7 def modexp(a,b): res = 1 while b: if b&1: res *= a res %= MOD a = (a*a)%MOD b /= 2 return res fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(100001)] for...
return fn[n] * ifn[k] * ifn[n-k]
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input()) MOD = 10**9 + 7 def modexp(a,b): res = 1 while b: if b&1: <|fim_middle|> a = (a*a)%MOD b /= 2 return res fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(100001)] for i i...
res *= a res %= MOD
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input()) MOD = 10**9 + 7 def modexp(a,b): res = 1 while b: if b&1: res *= a res %= MOD a = (a*a)%MOD b /= 2 return res fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(100001)] for...
ans += nCr(n-1,i)%MOD * a[i]%MOD
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input()) MOD = 10**9 + 7 def modexp(a,b): res = 1 while b: if b&1: res *= a res %= MOD a = (a*a)%MOD b /= 2 return res fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(100001)] for...
ans -= nCr(n-1,i)%MOD * a[i]%MOD
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input()) MOD = 10**9 + 7 def <|fim_middle|>(a,b): res = 1 while b: if b&1: res *= a res %= MOD a = (a*a)%MOD b /= 2 return res fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(1000...
modexp
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input()) MOD = 10**9 + 7 def modexp(a,b): res = 1 while b: if b&1: res *= a res %= MOD a = (a*a)%MOD b /= 2 return res fn = [1 for _ in xrange(100001)] ifn = [1 for _ in xrange(100001)] for...
nCr
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
def _run(self): self.is_running = False self.start()
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): <|fim_middle|> <|fim▁end|>
def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args self.kwargs = kwargs self.is_running = False self.start() def _run(self): self.is_runn...
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): <|fim_middle|> def _run(self): self.is_running = False self.start() self.function(*self.args, **self.kw...
self._timer = None self.interval = interval self.function = function self.args = args self.kwargs = kwargs self.is_running = False self.start()
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
self.is_running = False self.start() self.function(*self.args, **self.kwargs)
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
if not self.is_running: self._timer = Timer(self.interval, self._run) self._timer.start() self.is_running = True
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
self._timer.cancel() self.is_running = False
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
self._timer = Timer(self.interval, self._run) self._timer.start() self.is_running = True
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def <|fim_middle|>(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args ...
__init__
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
_run
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
start
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
stop
<|file_name|>test.py<|end_file_name|><|fim▁begin|>" Settings for tests. " from settings.project import * # Databases DATABASES = { 'default': {<|fim▁hole|> 'PASSWORD': '', 'TEST_CHARSET': 'utf8', }} # Caches CACHES['default']['BACKEND'] = 'django.core.cache.backends.locmem.LocMemCache' CACHES['...
'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', 'USER': '',
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
root.left.left = TreeNode(2) root.left.right = TreeNode(8) root.left.right.left = TreeNode(7)
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: <|fim_middle|> class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its parent self.findNodeAndParent(root, key) if self.node == root and...
def __init__(self, x): self.val = x self.left = None self.right = None
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): <|fim_middle|> class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its parent self.findNodeAndParent(root, key) ...
self.val = x self.left = None self.right = None
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: <|fim_middle|> root = TreeNode(10) root.left = TreeNode(3) root.left.left = TreeNode(2) root.left.right = TreeNode(8) root....
node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its parent self.findNodeAndParent(root, key) if self.node == root and not root.left and not root.right: return None if self.node: self.del...
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
self.findNodeAndParent(root, key) if self.node == root and not root.left and not root.right: return None if self.node: self.deleteNodeHelper(self.node, self.parent) return root
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
if not node.left and not node.right: if parent: if parent.left == node: parent.left = None else: parent.right = None return # if node has only one child if not node.left or not node.right: ...
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
succesorParent = node successor = node.right while successor.left: succesorParent = successor successor = successor.left return successor, succesorParent
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
if not root: return if root.val == key: self.node = root return self.parent = root if key < root.val: self.findNodeAndParent(root.left, key) else: self.findNodeAndParent(root.right, key)
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
return None
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
self.deleteNodeHelper(self.node, self.parent)
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
if parent: if parent.left == node: parent.left = None else: parent.right = None return
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
if parent.left == node: parent.left = None else: parent.right = None
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
parent.left = None
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
parent.right = None
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
child = node.left if not node.right else node.right node.val = child.val node.left = child.left node.right = child.right return
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
return
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
self.node = root return
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
self.findNodeAndParent(root.left, key)
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
self.findNodeAndParent(root.right, key)
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def <|fim_middle|>(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and ...
__init__
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def <|fim_middle|>(self, root: TreeNode, key: int) -> TreeNode: # search for the node and it...
deleteNode
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
deleteNodeHelper
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
getNodeSuccessor
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
findNodeAndParent
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># __init__.py # Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of Mako and is released under <|fim▁hole|>__version__ = '0.3.4'<|fim▁end|>
# the MIT License: http://www.opensource.org/licenses/mit-license.php
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Authors: Tim Hessels UNESCO-IHE 2016 Contact: t.hessels@unesco-ihe.org Repository: https://github.com/wateraccounting/wa Module: Collect/MOD17 Description: This module downloads MOD17 GPP data from http://e4ftl01.cr.usgs.gov/. U...
The data is available between 2000-02-18 till present. Examples:
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): <|fim_middle|> class Controller(metaclass=A...
pass
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
@abstractmethod def run(self): raise NotImplementedError @abstractmethod def enable(self): raise NotImplementedError @abstractmethod def disable(self): raise NotImplementedError @abstractmethod def valid(self) -> bool: raise NotImplementedError
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
raise NotImplementedError
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
raise NotImplementedError
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
raise NotImplementedError
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
raise NotImplementedError
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
""" Abstract class for input devices. """ def __init__(self, name): self.name = name self.values = ValueBuffer(name, 128) @abstractmethod def get_value(self) -> float: raise NotImplementedError
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
self.name = name self.values = ValueBuffer(name, 128)
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
raise NotImplementedError
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
""" Abstract class for output devices. """ def __init__(self, name): self.name = name self.values = ValueBuffer(name, 128) def set_value(self, value: Union[int, float]): self.values.update(value) @abstractmethod def apply(self): raise NotImplementedError ...