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
// package foo:foo | |
// interface a { | |
// variant c1 { | |
// a(s32), | |
// b(s64), | |
// c(string) | |
// } | |
// } |
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 binarysearch(arr, low, high, x): | |
if high >= low: | |
mid = (high + low) // 2 | |
if arr[mid] > x: | |
return binarysearch(arr, low, mid - 1, x) | |
elif arr[mid] <= x: | |
return binarysearch(arr, mid+1, high, x) | |
else: | |
return low |
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 | |
@pytest.fixtures(scope='session') | |
def mock_foo3(): | |
m = Mock() | |
mock_foo3 = patch.dict('sys.modules', {'foo3': m}) | |
mock_foo3.start() | |
yield m | |
mock_foo3.stop() |
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 datetime import datetime | |
class A: | |
def a(self): | |
from foo1 import bar1 | |
print(datetime.date.today().timestamp()) | |
return bar1() | |
def b(self): | |
from foo2 import bar2 |
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
<h1 class="text-primary">Hello World</h1> |