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
__keywords = {} | |
__keywords[GENERATED_NAME] = STATEMENT | |
__keywords[ANOTHER_GENERATED_NAME] = ANOTHER_STATEMENT |
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 os | |
import six | |
from time import time | |
from random import choice | |
from string import Formatter | |
from string import ascii_letters | |
from inspect import currentframe | |
string_formatter = Formatter() |
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 __future__ import print_function | |
import os | |
import sys | |
import six | |
from time import time | |
from random import choice | |
from string import Formatter | |
from string import ascii_letters | |
from inspect import currentframe |
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 __future__ import print_function | |
import os | |
import sys | |
import six | |
from time import time | |
from random import choice | |
from string import Formatter | |
from string import ascii_letters | |
from inspect import currentframe |
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 os | |
import six | |
from time import time | |
from inspect import currentframe | |
from string import Formatter | |
string_formatter = Formatter() | |
devnull = open(os.devnull, 'w') |
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 time import time | |
import os | |
devnull = open(os.devnull, 'w') | |
name = "oded" | |
t = time() | |
for _ in range(50000): | |
print("my name is {} & 2*3={}".format(name, 2*3), | |
file=devnull) |
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
/* The following function breaks the notion that bytes are immutable: | |
it changes the size of a bytes object. We get away with this only if there | |
is only one module referencing the object. You can also think of it | |
as creating a new bytes object and destroying the old one, only | |
more efficiently. In any case, don't use this if the bytes object may | |
already be known to some other part of the code... | |
Note that if there's not enough memory to resize the bytes object, the | |
original bytes object at *pv is deallocated, *pv is set to NULL, an "out of | |
memory" exception is set, and -1 is returned. Else (on success) 0 is | |
returned, and the value in *pv may or may not be the same as on input. |
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
void | |
PyBytes_Concat(PyObject **pv, PyObject *w) | |
{ | |
assert(pv != NULL); | |
if (*pv == NULL) | |
return; | |
if (w == NULL) { | |
Py_CLEAR(*pv); | |
return; | |
} |
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 __future__ import print_function | |
import os | |
import sys | |
# look at timeit.py gist | |
# https://gist.github.com/odedlaz/7811f703cc30a9d266817eaa4014ba7a | |
from random import randint | |
from timeit import TimeIt | |
from six.moves import range, cStringIO |
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 __future__ import print_function | |
import gc | |
import sys | |
import time | |
class TimeIt(object): | |
def __init__(self, scope_name="", fd=sys.stdout): | |
self._start = None | |
self._fd = fd |