Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
13,501 | [
0.03986591845750809,
0.04125386103987694,
-0.02637086808681488,
-0.022271106019616127,
0.03166639432311058,
-0.019388459622859955,
0.04317562282085419,
-0.011615993455052376,
0.00979565642774105,
0.023018458858132362,
0.011231641285121441,
-0.04054921492934227,
-0.02487616427242756,
0.0125... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def _get_frontmatter(filename):
with open(filename) as f:
content = f.read()
_, frontmatter, *_ = content.split('---\n', 2)
try:
return yaml.load(frontmatter)
except yaml.composer.ComposerError:
frontmatter, *_ = content.split('\n---', 1)
return yaml.load(frontmatter) | |
13,502 | [
0.006582988891750574,
0.06183374673128128,
0.042842667549848557,
-0.02112068422138691,
-0.03968584164977074,
0.0353514663875103,
0.026557443663477898,
-0.006520353257656097,
0.007021437399089336,
0.024189822375774384,
0.019454579800367355,
-0.022085269913077354,
0.0025476980954408646,
0.02... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
event_files = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'_termine',
'*.md',
)
today = date.today()
for event_file in glob.glob(event_files):
event_data = _get_frontmatter(event_file)
if today > event_data['date']:
print('O... | |
13,503 | [
0.02016897313296795,
0.061854515224695206,
0.01316149067133665,
-0.08624594658613205,
0.00341670960187912,
0.0229315385222435,
0.04222457855939865,
-0.00544652109965682,
-0.006159622687846422,
0.04330265149474144,
0.03463313728570938,
-0.012521384283900261,
0.024818168953061104,
0.00683341... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tmp", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def run(self, tmp=None, task_vars=dict()):
if self._play_context.check_mode:
return dict(skipped=True, msg=("skipped, this module does not support check_mode."))
src = self._task.args.get('src', None)
dest = self._task.args.get('dest', None)
delimiter = self._... | |
13,504 | [
0.050569869577884674,
0.012957965023815632,
0.015166453085839748,
0.025104649364948273,
0.010360738262534142,
-0.026479320600628853,
0.029273733496665955,
-0.012281897477805614,
0.006028270814567804,
-0.0007873372524045408,
-0.011425545439124107,
-0.04849659278988838,
0.012574860826134682,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "xml_config", "annotation": null, "type_comment": null}}], "kwarg"... | def __call__(self, xml_config):
config = ElementTree.parse(xml_config).getroot()
try:
interface.alsoProvides(config, IAppElementTreeConfig)
except AttributeError: #Py3 breaks
config = component.getUtility(proxy.IZopeInterfaceProviderProxy)(config)
interface.al... | |
13,505 | [
0.021467160433530807,
0.019974486902356148,
0.011035533621907234,
-0.005549101624637842,
-0.00763428770005703,
-0.05109275504946709,
0.030218105763196945,
-0.02184317819774151,
0.009166842326521873,
0.00020955123181920499,
-0.026252834126353264,
-0.06508515030145645,
0.018948985263705254,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": "u", "value": "Create an XML based app configuration"}}, "targets": [{"_type": "Name", "_fields": {"id": "title", "ctx": {"_type": "Store", "_fields": {}... | class AppConfigFactory(object):
title = u"Create an XML based app configuration"
description = u"returns a xml.etree.ElementTree marked with IAppElementTreeConfig"
def __call__(self, xml_config):
config = ElementTree.parse(xml_config).getroot()
try:
interface.alsoProvid... | |
13,506 | [
0.017434371635317802,
0.04694773629307747,
-0.04087617248296738,
-0.01671818271279335,
-0.005654679611325264,
0.038994841277599335,
-0.03170468658208847,
-0.035659756511449814,
0.004537639673799276,
0.022404931485652924,
-0.0098556037992239,
-0.058492261916399,
0.057979170233011246,
-0.012... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def display(obj):
cls = type(obj)
if cls is type:
return '<class {}>'.format(obj.__name__)
elif cls in [type(None), int]:
return repr(obj)
else:
return '<{} object>'.format(cls_name(obj)) | |
13,507 | [
-0.007885693572461605,
-0.004956092219799757,
0.012830771505832672,
-0.02867925353348255,
0.031014123931527138,
-0.030177094042301178,
0.00019411361427046359,
0.05132308602333069,
-0.02572762407362461,
0.005327798891812563,
-0.03006695955991745,
-0.04037563130259514,
0.009746980853378773,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestBaseRouter(DragonTestCase):
def setUp(self):
self.router = FooRouter(self.connection)
def test_publish(self):
data = {'channel': 'foo'}
self.router.subscribe(**data)
self.router.publish(['foo-chan'], {'key': 'value'})
actual = self.connection.get_last_published... | |
13,508 | [
0.019513001665472984,
-0.021873535588383675,
-0.02334059588611126,
-0.019722582772374153,
-0.021333038806915283,
0.013236632570624352,
0.050740424543619156,
-0.034437306225299835,
0.012971899472177029,
-0.013380029238760471,
0.020759452134370804,
-0.04021730273962021,
-0.02255742810666561,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tag", "annotation": null, "type_comment": null}}], "kwarg": null,... | def set_up_substitutions(self, tag):
# We are only interested in <meta> tags
if tag.name != 'meta':
return False
http_equiv = tag.get('http-equiv')
content = tag.get('content')
charset = tag.get('charset')
# We are interested in <meta> tags that say what enc... | |
13,509 | [
0.015640655532479286,
-0.018251759931445122,
0.03335980325937271,
-0.0315411202609539,
-0.007807336747646332,
-0.03671136870980263,
-0.031645044684410095,
-0.003504208056256175,
-0.016212239861488342,
0.07612477988004684,
0.0009239547653123736,
-0.0747217983007431,
0.019680723547935486,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "features", "annotation": null, "type_co... | def lookup(self, *features):
if len(self.builders) == 0:
# There are no builders at all.
return None
if len(features) == 0:
# They didn't ask for any features. Give them the most
# recently registered builder.
return self.builders[0]
... | |
13,510 | [
0.00881248340010643,
0.060232892632484436,
0.004223717842251062,
-0.058407656848430634,
0.024161605164408684,
0.007397922687232494,
-0.03294556960463524,
-0.0007322346209548414,
0.008356173522770405,
0.0648416206240654,
0.028861595317721367,
0.0077002281323075294,
-0.03655041381716728,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "level", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def _checkLevel(level):
if isinstance(level, int):
rv = level
elif str(level) == level:
if level not in logging._levelNames:
raise ValueError('Unknown level: %r' % level)
rv = logging._levelNames[level]
else:
raise TypeError('Level ... | |
13,511 | [
0.047294314950704575,
-0.007788633927702904,
-0.03184685856103897,
-0.02896939031779766,
0.03654167428612709,
-0.002104012994095683,
0.027108773589134216,
0.044481754302978516,
0.042188432067632675,
-0.02060742676258087,
0.027519840747117996,
-0.006593294907361269,
0.024339480325579643,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __getitem__(self, key):
value = dict.__getitem__(self, key)
result = self.configurator.convert(value)
# If the converted value is different, save for next time
if value is not result:
self[key] = result
if type(result) in (ConvertingDict, ConvertingList,
... | |
13,512 | [
0.035190943628549576,
0.010966305620968342,
-0.022759243845939636,
0.006902921944856644,
0.0315408781170845,
0.014825715683400631,
0.012925533577799797,
0.023639556020498276,
0.017574001103639603,
-0.02653813734650612,
0.006108495406806469,
0.005523411091417074,
0.03637184947729111,
0.0018... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def pop(self, key, default=None):
value = dict.pop(self, key, default)
result = self.configurator.convert(value)
if value is not result:
if type(result) in (ConvertingDict, ConvertingList,
ConvertingTuple):
result.parent = self
... | |
13,513 | [
0.027297819033265114,
0.00023718808370176703,
-0.032284919172525406,
0.001413558959029615,
0.031191257759928703,
0.019106285646557808,
0.024038704112172127,
0.03355357050895691,
0.027275945991277695,
-0.02443242259323597,
0.008814920671284199,
-0.00690101133659482,
0.012916156090795994,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def get(self, key, default=None):
value = dict.get(self, key, default)
result = self.configurator.convert(value)
# If the converted value is different, save for next time
if value is not result:
self[key] = result
if type(result) in (ConvertingDict, ConvertingList... | |
13,514 | [
0.03720221668481827,
-0.015113401226699352,
-0.030845416709780693,
-0.033085230737924576,
0.03777816891670227,
-0.01117773074656725,
0.016851922497153282,
0.046204131096601486,
0.05017179995775223,
-0.023422038182616234,
0.025021905079483986,
-0.0015905334148555994,
0.02685641683638096,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __getitem__(self, key):
value = list.__getitem__(self, key)
result = self.configurator.convert(value)
# If the converted value is different, save for next time
if value is not result:
self[key] = result
if type(result) in (ConvertingDict, ConvertingList,
... | |
13,515 | [
0.0293275136500597,
-0.003441493958234787,
-0.01801316998898983,
-0.0042558275163173676,
0.017322570085525513,
-0.019267762079834938,
-0.0035278189461678267,
0.036463722586631775,
0.02990301325917244,
-0.024263108149170876,
0.04475092887878418,
0.008989320136606693,
0.04281724989414215,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idx", "annotation": null, "type_comment": null}}], "kwarg": null,... | def pop(self, idx= -1):
value = list.pop(self, idx)
result = self.configurator.convert(value)
if value is not result:
if type(result) in (ConvertingDict, ConvertingList,
ConvertingTuple):
result.parent = self
return result | |
13,516 | [
0.04782560467720032,
-0.03031287156045437,
-0.024118591099977493,
-0.008066968992352486,
0.03335856273770332,
-0.030662715435028076,
0.014178933575749397,
0.041837114840745926,
0.03689815104007721,
-0.02156679518520832,
0.02131984755396843,
0.0033286537509411573,
0.02753470651805401,
-0.02... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __getitem__(self, key):
value = tuple.__getitem__(self, key)
result = self.configurator.convert(value)
if value is not result:
if type(result) in (ConvertingDict, ConvertingList,
ConvertingTuple):
result.parent = self
... | |
13,517 | [
0.01142363715916872,
0.030926434323191643,
0.04501083865761757,
-0.05200745910406113,
-0.04118206724524498,
-0.021263347938656807,
0.022311702370643616,
0.007144758477807045,
0.003882897086441517,
0.04015650600194931,
0.030105983838438988,
-0.04619593545794487,
0.04077184200286865,
-0.0250... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "interpreter", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "arguments", "annotation": null, "type_comment": null}}, {"... | def atests(interpreter, arguments, schema_validation=False):
try:
interpreter = Interpreter(interpreter)
except ValueError as err:
sys.exit(err)
outputdir, tempdir = _get_directories(interpreter)
arguments = list(_get_arguments(interpreter, outputdir)) + list(arguments)
return _run(a... | |
13,518 | [
0.012090961448848248,
-0.013317740522325039,
0.03731177747249603,
-0.04153366759419441,
-0.011527305468916893,
-0.02314302884042263,
0.03980954363942146,
0.003127734875306487,
-0.0106597188860178,
0.02760806307196617,
0.00753750978037715,
0.003945588134229183,
0.02515450492501259,
-0.08943... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "interpreter", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def _get_directories(interpreter):
name = interpreter.output_name
outputdir = CURDIR / 'results' / name
tempdir = Path(tempfile.gettempdir()) / 'robotatest' / name
if outputdir.exists():
shutil.rmtree(outputdir)
if tempdir.exists():
shutil.rmtree(tempdir)
os.makedirs(tempdir)
... | |
13,519 | [
0.010882860980927944,
0.004275409504771233,
0.02893635258078575,
-0.06874498724937439,
-0.05300767719745636,
-0.010100225917994976,
0.009269997477531433,
0.01206738967448473,
0.011369363404810429,
0.062018558382987976,
-0.010406933724880219,
-0.03663579374551773,
0.0546998605132103,
-0.005... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "interpreter", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "outputdir", "annotation": null, "type_comment": null}}], "... | def _get_arguments(interpreter, outputdir):
arguments = ARGUMENTS.format(interpreter=interpreter,
variable_file=CURDIR / 'interpreter.py',
pythonpath=CURDIR / 'resources',
outputdir=outputdir)
for line in argument... | |
13,520 | [
0.045806270092725754,
0.046300582587718964,
0.037011630833148956,
-0.06104756519198418,
-0.027908047661185265,
-0.009778114967048168,
0.020122628659009933,
0.021667353808879852,
0.003086877055466175,
0.05301498994231224,
0.012182737700641155,
-0.01799090765416622,
0.059523437172174454,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tempdir", "annotation": null, "type_comment": null}}, {"_type": "... | def _run(args, tempdir, interpreter, schema_validation):
command = [sys.executable, str(CURDIR.parent / 'src/robot/run.py')] + args
environ = dict(os.environ,
TEMPDIR=str(tempdir),
PYTHONCASEOK='True',
PYTHONIOENCODING='')
if schema_validation:
... | |
13,521 | [
0.012292342260479927,
-0.02393118478357792,
0.009554175660014153,
-0.002935850527137518,
-0.03343307971954346,
-0.016951801255345345,
0.011932916939258575,
0.0011272882111370564,
0.027316316962242126,
0.03492306172847748,
0.026009315624833107,
-0.010201141238212585,
0.0037314873188734055,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "rctext", "annotation": null, "type_comment": null}}, {"_type": "a... | def AddIdentifiers(self, rctext, node):
node.AddChild(misc.IdentifierNode.Construct(node, 'IDS_COMMAND_gcFirst', '12000', ''))
node.AddChild(misc.IdentifierNode.Construct(node,
'IDS_COMMAND_PCI_SPACE', '16', ''))
node.AddChild(misc.IdentifierNode.Construct(nod... | |
13,522 | [
0.005621576681733131,
0.010884110815823078,
0.0452188141644001,
-0.019901202991604805,
-0.06356074661016464,
-0.01613638736307621,
0.045382946729660034,
-0.012638289481401443,
-0.03809951990842819,
0.05059419199824333,
0.001468226546421647,
-0.00966336764395237,
0.026897398754954338,
-0.02... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "job", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg": nu... | def create_binary(job, options):
build_cmd = [settings.BUILD_SCRIPT]
build_cmd.extend(job.build_args)
build_dir_path = os.path.join(options.outdir, job.name)
build_cmd.append('--builddir=%s' % build_dir_path)
if options.toolchain:
build_cmd.append('--toolchain=%s' % options.toolchain)
... | |
13,523 | [
0.013685541227459908,
0.0181288979947567,
0.04234519600868225,
-0.05785251408815384,
-0.03050364926457405,
-0.013718866743147373,
-0.013363397680222988,
-0.041278790682554245,
-0.014896356500685215,
0.04330052062869072,
0.011619379743933678,
0.023216543719172478,
0.03665769845247269,
0.006... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def get_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('--toolchain', action='store', default='', help='Add toolchain file')
parser.add_argument('--buildoptions', action='store', default='',
help='Add a comma separated list of extra build options to each test')
... | |
13,524 | [
0.00487197982147336,
0.0363788940012455,
0.01667456142604351,
-0.03854301571846008,
0.04354213550686836,
-0.0017826956463977695,
-0.009165056981146336,
0.04401824250817299,
0.043736908584833145,
0.04964496195316315,
-0.0057349237613379955,
-0.0004703584127128124,
0.047264426946640015,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "runnable", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def run_check(runnable):
sys.stderr.write('Test command: %s\n' % ' '.join(runnable))
try:
ret = subprocess.check_call(runnable)
except subprocess.CalledProcessError as err:
return err.returncode
return ret | |
13,525 | [
0.021740850061178207,
0.007486443035304546,
0.04080522805452347,
-0.03979606553912163,
-0.04148531332612038,
-0.018877902999520302,
0.060418061912059784,
-0.010755249299108982,
0.012439013458788395,
0.048790767788887024,
0.022508690133690834,
-0.006307259667664766,
0.04306487366557121,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def run_jerry_debugger_tests(options):
ret_build = ret_test = 0
for job in DEBUGGER_TEST_OPTIONS:
ret_build, bin_dir_path = create_binary(job, options)
if ret_build:
break
for test_file in os.listdir(settings.DEBUGGER_TESTS_DIR):
if test_file.endswith(".cmd"):
... | |
13,526 | [
-0.005910835694521666,
-0.0069897067733109,
0.025364946573972702,
-0.04834260419011116,
-0.03801298886537552,
-0.04021663963794708,
0.05297945439815521,
0.00010015782027039677,
0.0035751948598772287,
0.04030845686793327,
0.012028263881802559,
-0.025732221081852913,
0.04175460338592529,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def run_jerry_test_suite(options):
ret_build = ret_test = 0
for job in JERRY_TEST_SUITE_OPTIONS:
ret_build, bin_dir_path = create_binary(job, options)
if ret_build:
break
test_cmd = [settings.TEST_RUNNER_SCRIPT, get_binary_path(bin_dir_path)]
if '--profile=minimal' ... | |
13,527 | [
0.018337976187467575,
0.00015915422409307212,
0.044129304587841034,
-0.040925271809101105,
-0.026041287928819656,
-0.03987998515367508,
0.04226596653461456,
-0.0037209957372397184,
0.004294767510145903,
0.04662890359759331,
0.0038317732978612185,
-0.024200674146413803,
0.0345853753387928,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def run_jerry_tests(options):
ret_build = ret_test = 0
for job in JERRY_TESTS_OPTIONS:
ret_build, bin_dir_path = create_binary(job, options)
if ret_build:
break
test_cmd = [
settings.TEST_RUNNER_SCRIPT,
get_binary_path(bin_dir_path),
setti... | |
13,528 | [
-0.0051133474335074425,
0.012682990171015263,
0.04343392699956894,
-0.03396301716566086,
-0.04263090714812279,
-0.04090677946805954,
0.042678143829107285,
0.004227663390338421,
0.00820143148303032,
0.027302676811814308,
0.014950340613722801,
-0.00432804087176919,
0.025861963629722595,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def run_unittests(options):
ret_build = ret_test = 0
for job in JERRY_UNITTESTS_OPTIONS:
ret_build, bin_dir_path = create_binary(job, options)
if ret_build:
break
ret_test |= run_check([
settings.UNITTEST_RUNNER_SCRIPT,
bin_dir_path
])
re... | |
13,529 | [
0.0017946509178727865,
-0.0026340389158576727,
0.05349472910165787,
-0.059011515229940414,
-0.05711229518055916,
-0.011570552363991737,
0.04775184765458107,
-0.005358516704291105,
-0.010281795635819435,
0.0159964170306921,
0.014311987906694412,
0.003507341491058469,
0.029505757614970207,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def run_test262_test_suite(options):
ret_build = ret_test = 0
for job in TEST262_TEST_SUITE_OPTIONS:
ret_build, bin_dir_path = create_binary(job, options)
if ret_build:
break
test_cmd = [
settings.TEST262_RUNNER_SCRIPT,
get_binary_path(bin_dir_path),
... | |
13,530 | [
0.029856234788894653,
0.003961850889027119,
0.004081906750798225,
-0.005515719763934612,
-0.03158504143357277,
0.04187556356191635,
-0.01893456093966961,
-0.005834725685417652,
-0.021788464859128,
0.04747360572218895,
0.02510887384414673,
-0.015572989359498024,
-0.0033907268662005663,
0.02... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class HebrewProber(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self._mLogicalProber = None
self._mVisualProber = None
self.reset()
def reset(self):
self._mFinalCharLogicalScore = 0
self._mFinalCharVisualScore = 0
# The two last charac... | |
13,531 | [
0.009249566122889519,
0.01995818130671978,
0.08106421679258347,
-0.05284701660275459,
-0.06296665966510773,
0.01879362016916275,
0.006826742552220821,
-0.033009305596351624,
0.008372798562049866,
0.0607713907957077,
0.0227825790643692,
-0.02039991319179535,
0.010327121242880821,
0.03142978... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def main(options):
ret = 0
if options.check_signed_off_tolerant:
ret = run_check([settings.SIGNED_OFF_SCRIPT, '--tolerant'])
if not ret and options.check_signed_off_travis:
ret = run_check([settings.SIGNED_OFF_SCRIPT, '--travis'])
if not ret and (options.all or options.check_signed_of... | |
13,532 | [
0.037105850875377655,
0.04267608001828194,
0.004710760433226824,
-0.024398764595389366,
-0.015216590836644173,
0.026023415848612785,
-0.009261957369744778,
0.015028014779090881,
-0.01003076508641243,
0.08889158070087433,
0.02789466455578804,
-0.012199382297694683,
-0.03800521045923233,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "aBuf", "annotation": null, "type_comment": null}}], "kwarg": null... | def feed(self, aBuf):
# Final letter analysis for logical-visual decision.
# Look for evidence that the received buffer is either logical Hebrew or
# visual Hebrew.
# The following cases are checked:
# 1) A word longer than 1 letter, ending with a final letter. This is an
... | |
13,533 | [
0.03783870488405228,
0.00959677342325449,
0.00982526782900095,
-0.02023809403181076,
-0.04152073338627815,
0.025943929329514503,
-0.0028268047608435154,
-0.023502301424741745,
-0.04157296195626259,
0.04078955203294754,
-0.029534559696912766,
-0.01920660398900509,
-0.03593240678310394,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_charset_name(self):
# Make the decision: is it Logical or Visual?
# If the final letter score distance is dominant enough, rely on it.
finalsub = self._mFinalCharLogicalScore - self._mFinalCharVisualScore
if finalsub >= MIN_FINAL_CHAR_DISTANCE:
return LOGICAL_HEBREW_N... | |
13,534 | [
0.018152199685573578,
-0.030295781791210175,
-0.019654354080557823,
0.013722950592637062,
0.020412448793649673,
-0.0022462117485702038,
-0.002907791407778859,
-0.038157522678375244,
0.001928583369590342,
0.012171660549938679,
0.021928641945123672,
-0.05618337169289589,
0.018362781032919884,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "composlug", "annotation": null, "type_comment": null}}], "kwar... | def compoview(request, composlug):
c = {}
# fetch compo
try:
theCompo = Compo.objects.get(pk=composlug)
except Compo.DoesNotExist:
raise Http404("Compo was not found")
# is the compo published?
if not theCompo.isPublished:
return HttpResponseRedirect("/?error=1")
c... | |
13,535 | [
0.023792902007699013,
-0.026379939168691635,
-0.029790123924613,
-0.022734569385647774,
0.024433128535747528,
0.008362140506505966,
-0.040347326546907425,
-0.028431277722120285,
0.012092438526451588,
0.00752592645585537,
0.05848271772265434,
-0.04492037370800972,
0.06815144419670105,
0.010... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def indexview(request):
c = {}
if request.user.is_authenticated():
c['isLoggedin'] = True
# Has error?
if request.GET.get("error"):
print(request.GET.get("error"))
if request.GET.get("error") == "1":
c["errorMessage"] = "Konkurransen er ikke publisert"
# fetch ... | |
13,536 | [
0.043894704431295395,
0.001820119097828865,
0.006697897333651781,
0.03443220630288124,
0.009794394485652447,
0.03050597384572029,
-0.016368715092539787,
-0.007923079654574394,
0.007442892529070377,
0.02810504101216793,
0.0324549674987793,
-0.043019071221351624,
0.026876326650381088,
0.0361... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "c", "annotation": null, "type_comment": null}}], "kwarg": null... | def compovotingview(request, c):
# User has already sent bidrag?
if request.user.is_authenticated():
c['isLoggedin'] = True
c['user'] = request.user
c['isCrew'] = user_is_crew(request.user)
return render(request, 'compos/voting.html', c) | |
13,537 | [
0.05687791481614113,
-0.016897082328796387,
-0.011499598622322083,
0.029679110273718834,
0.027579305693507195,
0.020490705966949463,
-0.02104031853377819,
-0.007617074530571699,
0.01806677132844925,
0.007285897620022297,
0.016319282352924347,
-0.0321030467748642,
0.027959808707237244,
0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "c", "annotation": null, "type_comment": null}}], "kwarg": null... | def componormalview(request, c):
theCompo = c['compo']
# User has already sent bidrag?
if request.user.is_authenticated():
c['isLoggedin'] = True
c['user'] = request.user
c['isCrew'] = user_is_crew(request.user)
bidragUserCompo = Bidrag.objects.filter(compo=theCompo, creato... | |
13,538 | [
0.047259826213121414,
-0.015363342128694057,
-0.0394611731171608,
0.007103271316736937,
0.021446289494633675,
0.01091811154037714,
-0.0464799590408802,
-0.03324824944138527,
0.01940564252436161,
0.012022919952869415,
0.0232009869068861,
-0.029946820810437202,
0.03925320878624916,
0.0178199... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "composlug", "annotation": null, "type_comment": null}}, {"_typ... | def composinglebidragview(request, composlug, bidragslug):
c = {}
if request.user.is_authenticated() is False:
return HttpResponseForbidden("You are not logged in")
# fetch compo and bidrag
try:
theCompo = Compo.objects.get(pk=composlug)
theBidrag = Bidrag.objects.get(id=bidrag... | |
13,539 | [
0.03023645468056202,
-0.024731522426009178,
-0.025545058771967888,
0.04390387609601021,
0.016582593321800232,
0.0010008198441937566,
-0.036365099251270294,
-0.023579010739922523,
0.02422984130680561,
0.006023562978953123,
-0.00485071400180459,
-0.05534762889146805,
0.03484649956226349,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "composlug", "annotation": null, "type_comment": null}}], "kwar... | def compobidragview(request, composlug):
c = {}
if not request.user.is_authenticated() or not user_is_crew(request.user):
return HttpResponseForbidden()
# fetch compo
try:
theCompo = Compo.objects.get(pk=composlug)
except Compo.DoesNotExist:
raise Http404("Compo was not fou... | |
13,540 | [
0.05238797515630722,
-0.0021905298344790936,
-0.05589810013771057,
0.017431868240237236,
0.03452064096927643,
0.01941126212477684,
-0.04296605661511421,
-0.0034969302359968424,
0.010160891339182854,
0.017365887761116028,
0.019358478486537933,
-0.03140639141201973,
0.01652134582400322,
0.00... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "composlug", "annotation": null, "type_comment": null}}, {"_typ... | def bidragvote(request, composlug, bidragslug):
c = {}
if not request.user.is_authenticated():
return HttpResponseForbidden()
# fetch compo
try:
theCompo = Compo.objects.get(pk=composlug)
theBidrag = Bidrag.objects.get(id=bidragslug, compo=theCompo)
except Compo.DoesNotExis... | |
13,541 | [
0.05420123413205147,
-0.010764324106276035,
-0.0465574711561203,
0.018388785421848297,
0.016407068818807602,
0.031064050272107124,
-0.0410241074860096,
0.013061313889920712,
0.027126353234052658,
-0.012540147639811039,
0.025299057364463806,
-0.048925235867500305,
0.02746092900633812,
0.000... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "composlug", "annotation": null, "type_comment": null}}, {"_typ... | def bidragdelete(request, composlug, bidragslug):
c = {}
if not request.user.is_authenticated():
return HttpResponseForbidden()
# fetch compo
try:
theCompo = Compo.objects.get(pk=composlug)
theBidrag = Bidrag.objects.get(id=bidragslug, compo=theCompo)
except Compo.DoesNotEx... | |
13,542 | [
0.02119489759206772,
-0.013912663795053959,
-0.004933489020913839,
0.033938806504011154,
0.04782899469137192,
-0.02697123773396015,
0.0113110626116395,
-0.0005545258172787726,
0.036905642598867416,
0.03904086723923683,
0.03980505093932152,
-0.044772256165742874,
0.04944726824760437,
-0.002... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def accountview(request):
c = {}
if request.user.is_authenticated() is not True:
return HttpResponseRedirect("/")
c['isLoggedin'] = True
c['user'] = request.user
return render(request, 'account/view.html', c) | |
13,543 | [
0.05488692596554756,
-0.017436672002077103,
-0.03921616077423096,
0.01610243134200573,
0.023493070155382156,
0.01979121007025242,
-0.037672627717256546,
-0.0023659849539399147,
0.023898573592305183,
-0.019869694486260414,
0.013394712470471859,
-0.036809295415878296,
0.02342766523361206,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "composlug", "annotation": null, "type_comment": null}}, {"_typ... | def bidrageditsave(request, composlug, bidragslug):
c = {}
if not request.user.is_authenticated():
return HttpResponseForbidden()
# fetch compo
try:
theCompo = Compo.objects.get(pk=composlug)
theBidrag = Bidrag.objects.get(id=bidragslug, compo=theCompo)
except Compo.DoesNot... | |
13,544 | [
0.020463693886995316,
-0.02397140860557556,
-0.03769883140921593,
0.003346894169226289,
0.024881714954972267,
-0.02544003538787365,
0.027721870690584183,
-0.0218837708234787,
0.0014269056264311075,
0.028280192986130714,
0.01848529279232025,
-0.017975522205233574,
0.03488295152783394,
-0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "composlug", "annotation": null, "type_comment": null}}], "kwar... | def uploadview(request, composlug):
c = {}
if request.user.is_authenticated() is not True:
return HttpResponseRedirect("/")
c['isLoggedin'] = True
c['user'] = request.user
# fetch compo
theCompo = get_object_or_404(Compo, id=composlug)
# is the compo published?
if not theComp... | |
13,545 | [
-0.026517504826188087,
-0.0038980599492788315,
-0.0343136265873909,
-0.02845650725066662,
0.011313065886497498,
-0.008197292685508728,
0.005312193185091019,
0.014990480616688728,
0.018855109810829163,
0.041748691350221634,
0.04776627942919731,
-0.032548464834690094,
0.01179447304457426,
0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def loginview(request):
c = {}
if request.method == 'GET' and int(request.GET['id']) > 0 and request.GET['timestamp'] and request.GET['token']:
# Validate the session from GE
params = {"user_id": request.GET['id'], "timestamp": request.GET['timestamp'], "token": request.GET['token']}
r ... | |
13,546 | [
0.01169912051409483,
-0.0059656728990375996,
-0.04029418155550957,
-0.025117961689829826,
-0.0008018039516173303,
-0.005300379358232021,
-0.020887698978185654,
0.02713894657790661,
0.053926415741443634,
0.014071580953896046,
0.0436583049595356,
-0.059047918766736984,
-0.03419356793165207,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def logouthandle(request):
# Clear API variables
innleveringuser = get_innlevering_user(request.user)
if innleveringuser:
innleveringuser.currenttoken = ""
innleveringuser.currenttimestamp = ""
innleveringuser.save()
logout(request)
return HttpResponseRedirect("/") | |
13,547 | [
0.028687631711363792,
-0.02442614920437336,
-0.024688027799129486,
0.02409284934401512,
0.017914891242980957,
-0.02235492691397667,
-0.03280626982450485,
0.010808452032506466,
0.007279040291905403,
0.037543896585702896,
0.011641702614724636,
-0.04459081590175629,
0.04444797337055206,
-0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def mybidrags(request):
if request.user.is_authenticated() is not True:
return HttpResponseRedirect("/")
c = {}
c['isLoggedin'] = True
c['bidrags'] = Bidrag.objects.filter(creator=request.user)
return render(request, "account/mybidrags.html", c) | |
13,548 | [
0.04566359519958496,
0.010878105647861958,
-0.03855004906654358,
0.007125770207494497,
0.018615005537867546,
-0.00817080121487379,
0.02498297393321991,
-0.006496306508779526,
0.01558380201458931,
0.03065425530076027,
0.004604860674589872,
-0.02201288565993309,
0.02644968591630459,
-0.01972... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "composlug", "annotation": null, "type_comment": null}}], "kwar... | def uploadhandler(request, composlug):
c = {}
theCompo = get_object_or_404(Compo, id=composlug)
# Check if the user already has uploaded
userBidragsInCompo = Bidrag.objects.filter(creator=request.user, compo=theCompo)
if userBidragsInCompo.count() > 0:
# User has already uploaded a bidrag
... | |
13,549 | [
0.016801340505480766,
0.055583707988262177,
0.004573033191263676,
0.0009487479692324996,
0.04561607539653778,
0.007116629742085934,
0.015386720187962055,
0.04787946864962578,
-0.0053238701075315475,
-0.023439176380634308,
0.04302623122930527,
0.036932479590177536,
0.006001255940645933,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def decompress(self, data):
pop = subprocess.Popen("bunzip2", shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
pop.stdin.write(data)
pop.stdin.... | |
13,550 | [
0.037469178438186646,
0.06960532069206238,
0.00791335292160511,
-0.0413999930024147,
0.012079787440598011,
-0.01430954784154892,
0.009993696585297585,
0.053974006325006485,
-0.0084535526111722,
0.020182784646749496,
0.02443542145192623,
0.004154941067099571,
-0.012183229438960552,
0.068961... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testReadLine(self):
# "Test BZ2File.readline()"
self.createTempFile()
with BZ2File(self.filename) as bz2f:
self.assertRaises(TypeError, bz2f.readline, None)
sio = StringIO(self.TEXT)
for line in sio.readlines():
self.assertEqual(bz2f.readli... | |
13,551 | [
0.05379188433289528,
0.054890576750040054,
0.030653463676571846,
-0.0025146277621388435,
0.01953471638262272,
0.0009174065198749304,
0.021215712651610374,
0.032433342188596725,
-0.0053780898451805115,
0.022006770595908165,
0.02213861234486103,
0.0005318348412401974,
-0.025951068848371506,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testReadChunk10(self):
# "Test BZ2File.read() in chunks of 10 bytes"
self.createTempFile()
with BZ2File(self.filename) as bz2f:
text = ''
while 1:
str = bz2f.read(10)
if not str:
break
text += str
... | |
13,552 | [
0.04802596569061279,
0.04218843951821327,
0.022986603900790215,
-0.049180641770362854,
0.00697616720572114,
-0.01779056340456009,
0.026578929275274277,
0.04417704790830612,
0.01710631139576435,
-0.014647278003394604,
0.048924047499895096,
-0.011461228132247925,
-0.041097912937402725,
0.019... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testClosedIteratorDeadlock(self):
# "Test that iteration on a closed bz2file releases the lock."
# http://bugs.python.org/issue3309
self.createTempFile()
bz2f = BZ2File(self.filename)
bz2f.close()
self.assertRaises(ValueError, bz2f.next)
# This call will deadl... | |
13,553 | [
0.04719962552189827,
0.04605843499302864,
0.03759080544114113,
-0.02223038487136364,
0.030492601916193962,
0.006093955598771572,
0.037613630294799805,
0.03316298872232437,
-0.014059463515877724,
0.006607491057366133,
0.016729848459362984,
0.026315845549106598,
-0.04640079289674759,
-0.0085... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testWriteChunks10(self):
# "Test BZ2File.write() with chunks of 10 bytes"
with BZ2File(self.filename, "w") as bz2f:
n = 0
while 1:
str = self.TEXT[n*10:(n+1)*10]
if not str:
break
bz2f.write(str)
... | |
13,554 | [
0.032345227897167206,
0.05822140723466873,
0.046715397387742996,
-0.04392531141638756,
0.014394860714673996,
-0.0277280081063509,
0.013444256037473679,
0.020147865638136864,
-0.008012233301997185,
0.006314726546406746,
0.022987332195043564,
0.023814482614398003,
-0.016271376982331276,
0.03... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testWriteLines(self):
# "Test BZ2File.writelines()"
with BZ2File(self.filename, "w") as bz2f:
self.assertRaises(TypeError, bz2f.writelines)
sio = StringIO(self.TEXT)
bz2f.writelines(sio.readlines())
# patch #1535500
self.assertRaises(ValueError, bz... | |
13,555 | [
0.07004451751708984,
0.03576793894171715,
0.07496602088212967,
-0.03514653816819191,
-0.02850995771586895,
0.026496611535549164,
0.02407314069569111,
0.01938776485621929,
-0.014814240857958794,
-0.014677532017230988,
0.03996862471103668,
-0.027366576716303825,
0.01701400615274906,
0.010209... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testSeekPostEndTwice(self):
# "Test BZ2File.seek(150000) twice"
self.createTempFile()
with BZ2File(self.filename) as bz2f:
bz2f.seek(150000)
bz2f.seek(150000)
self.assertEqual(bz2f.tell(), len(self.TEXT))
self.assertEqual(bz2f.read(), "") | |
13,556 | [
0.030364666134119034,
0.027411554008722305,
0.009603570215404034,
0.002484246389940381,
0.020731326192617416,
0.02695905975997448,
0.03839046508073807,
0.03786652535200119,
0.026673275977373123,
-0.0014326466480270028,
0.016777966171503067,
0.03015032783150673,
-0.0366281233727932,
-0.0363... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testCompressChunks10(self):
# "Test BZ2Compressor.compress()/flush() with chunks of 10 bytes"
bz2c = BZ2Compressor()
n = 0
data = ''
while 1:
str = self.TEXT[n*10:(n+1)*10]
if not str:
break
data += bz2c.compress(str)
... | |
13,557 | [
0.024169128388166428,
0.02274671196937561,
0.008779536932706833,
-0.002239708323031664,
-0.0024204987566918135,
0.023786628618836403,
0.024981936439871788,
0.04460889473557472,
0.002581865293905139,
0.001280473661608994,
0.01773837022483349,
0.017236340790987015,
-0.022926008328795433,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class BZ2CompressorTest(BaseTest):
def testCompress(self):
# "Test BZ2Compressor.compress()/flush()"
bz2c = BZ2Compressor()
self.assertRaises(TypeError, bz2c.compress)
data = bz2c.compress(self.TEXT)
data += bz2c.flush()
self.assertEqual(self.decompress(data), self.TE... | |
13,558 | [
0.036218222230672836,
0.03593210130929947,
0.009072437882423401,
0.0014000583905726671,
-0.01229130569845438,
0.033643126487731934,
-0.0019343009917065501,
0.03726733475923538,
-0.011742905713617802,
0.005841648671776056,
0.03230789303779602,
0.012255540117621422,
-0.01955164037644863,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class BZ2DecompressorTest(BaseTest):
def test_Constructor(self):
self.assertRaises(TypeError, BZ2Decompressor, 42)
def testDecompress(self):
# "Test BZ2Decompressor.decompress()"
bz2d = BZ2Decompressor()
self.assertRaises(TypeError, bz2d.decompress)
text = bz2d.decompres... | |
13,559 | [
0.06072288379073143,
0.00140616693533957,
0.05022267997264862,
0.004720758646726608,
-0.025458043441176414,
0.011001688428223133,
0.012939521111547947,
0.01894494518637657,
0.017471449449658394,
0.0028154293540865183,
0.03551248461008072,
0.016852334141731262,
-0.04276852309703827,
-0.0153... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def testBigmem(self, size):
text = "a" * size
bz2c = bz2.BZ2Compressor()
data = bz2c.compress(text) + bz2c.flush()
del text
text = self.decompress(data)
self.assertEqual(len(text), size)
self.assertEqual(text.strip("a"), "") | |
13,560 | [
0.04451090469956398,
0.016661448404192924,
0.050924718379974365,
0.012550339102745056,
-0.028090575709939003,
0.017903221771121025,
0.01127842627465725,
0.024244697764515877,
0.020953400060534477,
0.007559137884527445,
0.049068085849285126,
0.016191262751817703,
-0.04581295698881149,
-0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def testBigmem(self, size):
# Issue #14398: decompression fails when output data is >=2GB.
if size < _4G:
self.skipTest("Test needs 5GB of memory to run.")
compressed = bz2.compress("a" * _4G)
text = bz2.BZ2Decompressor().decompress(compressed)
self.assertEqual(len(te... | |
13,561 | [
0.0474233403801918,
0.035920560359954834,
0.007038334384560585,
0.0038779170718044043,
0.021832503378391266,
0.027971114963293076,
0.03671778365969658,
0.038494449108839035,
0.019930558279156685,
-0.012288612313568592,
0.02144527994096279,
0.02794833667576313,
-0.040248338133096695,
-0.050... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testDecompressChunks10(self):
# "Test BZ2Decompressor.decompress() with chunks of 10 bytes"
bz2d = BZ2Decompressor()
text = ''
n = 0
while 1:
str = self.DATA[n*10:(n+1)*10]
if not str:
break
text += bz2d.decompress(str)
... | |
13,562 | [
0.037522297352552414,
0.02309878170490265,
-0.056236423552036285,
-0.04847805202007294,
0.02044212818145752,
0.024638701230287552,
-0.029105640947818756,
0.03192686662077904,
0.01515233051031828,
0.007787757087498903,
0.01489371806383133,
-0.04043756052851677,
0.0038938785437494516,
-0.022... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def load(self):
try:
s = self.model.objects.get(
session_key=self.session_key,
expire_date__gt=timezone.now()
)
return self.decode(s.session_data)
except (self.model.DoesNotExist, SuspiciousOperation) as e:
if isinstance(e, ... | |
13,563 | [
0.04540391266345978,
0.02608008310198784,
0.04580551013350487,
0.01407946553081274,
-0.02085934206843376,
0.022111374884843826,
0.020823907107114792,
0.0187450610101223,
0.03385213762521744,
0.00268419343046844,
0.04786073416471481,
0.016831574961543083,
-0.04774261638522148,
-0.0262454468... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def testDecompressBigmem(self, size):
# Issue #14398: decompression fails when output data is >=2GB.
if size < _4G:
self.skipTest("Test needs 5GB of memory to run.")
compressed = bz2.compress("a" * _4G)
text = bz2.decompress(compressed)
self.assertEqual(len(text), _4G... | |
13,564 | [
0.07506636530160904,
0.030490709468722343,
-0.011093896813690662,
-0.037713248282670975,
0.018026331439614296,
0.0513780452311039,
-0.0009171971469186246,
0.07814744859933853,
0.02142752707004547,
-0.017246058210730553,
0.028149887919425964,
-0.07282558083534241,
-0.013314676471054554,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "session_key", "annotation": null, "type_comment": null}}], "kwarg... | def delete(self, session_key=None):
if session_key is None:
if self.session_key is None:
return
session_key = self.session_key
try:
self.model.objects.get(session_key=session_key).delete()
except self.model.DoesNotExist:
pass | |
13,565 | [
0.06770513951778412,
0.012122241780161858,
0.03770052641630173,
-0.028824258595705032,
0.03755888342857361,
0.025070730596780777,
0.04143044725060463,
0.04277605190873146,
0.004863061010837555,
0.00815034843981266,
0.04648236185312271,
-0.00870511494576931,
0.0005053392960689962,
-0.027242... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def create(self):
while True:
self._session_key = self._get_new_session_key()
try:
# Save immediately to ensure we have a unique entry in the
# database.
self.save(must_create=True)
except CreateError:
# Key wasn... | |
13,566 | [
-0.001988951815292239,
-0.04209592193365097,
-0.028767557814717293,
-0.002046748297289014,
0.0019449763931334019,
-0.059786662459373474,
0.007217018399387598,
0.0007909319247119129,
0.02589281275868416,
0.034135088324546814,
0.008041245862841606,
0.05082067474722862,
0.02372167631983757,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "output_size", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def _create_zero_output(output_size):
# convert int to TensorShape if necessary
size = _state_size_with_prefix(output_size, prefix=[batch_size])
output = array_ops.zeros(
array_ops.pack(size), _infer_state_dtype(dtype, state))
shape = _state_size_with_prefix(
outp... | |
13,567 | [
0.04303508996963501,
-0.021990325301885605,
-0.026960575953125954,
-0.022172164171934128,
-0.01748073287308216,
-0.015492632985115051,
0.018317189067602158,
-0.03202780708670616,
0.026087751612067223,
0.04875693842768669,
0.05096324533224106,
0.005782461725175381,
-0.0314701683819294,
0.03... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "flat_new_output", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flat_new_state", "annotation": null, "type_comment": n... | def _copy_some_through(flat_new_output, flat_new_state):
# Use broadcasting select to determine which values should get
# the previous state & zero output, and which values should get
# a calculated state & output.
flat_new_output = [
_copy_one_through(zero_output, new_output)
for zero_o... | |
13,568 | [
0.042948540300130844,
-0.01283159852027893,
0.00679496955126524,
-0.033824384212493896,
0.029563233256340027,
-0.00026011522277258337,
0.03986703231930733,
-0.01693626493215561,
-0.03950591757893562,
0.033583641052246094,
0.009509346447885036,
-0.03216325864195824,
0.00813711155205965,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "current", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "candidate", "annotation": null, "type_comment": null}}], "kwar... | def _copy_some_through(current, candidate):
current_flat = nest.flatten(current)
candidate_flat = nest.flatten(candidate)
result_flat = [
math_ops.select(elements_finished, current_i, candidate_i)
for (current_i, candidate_i) in zip(current_flat, candidate_flat)]
... | |
13,569 | [
-0.02070339024066925,
0.0018430273048579693,
0.017629213631153107,
-0.03258626163005829,
-0.022961726412177086,
-0.0255629513412714,
-0.010203897953033447,
0.014874279499053955,
0.04161960631608963,
0.015228992328047752,
0.0028953412547707558,
0.005849801003932953,
-0.0075553772039711475,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def setup_package(request):
_check_vagrant_version()
vagrant_box = os.environ.get('FABTOOLS_TEST_BOX')
if not vagrant_box:
pytest.skip("Set FABTOOLS_TEST_BOX to choose a Vagrant base box for functional tests")
vagrant_provider = os.environ.get('FABTOOLS_TEST_PROVIDER')
reuse_vm = os.environ.... | |
13,570 | [
0.012289651669561863,
0.02238873392343521,
0.02592734433710575,
-0.04506954550743103,
-0.0018016021931543946,
0.0017342001665383577,
-0.004459773190319538,
0.0416320376098156,
0.0031819413416087627,
-0.038014791905879974,
0.0012006000615656376,
0.014188144356012344,
0.0030302866362035275,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def _target_vagrant_machine():
config = _vagrant_ssh_config()
_set_fabric_env(
host=config['HostName'],
port=config['Port'],
user=config['User'],
key_filename=config['IdentityFile'].strip('"'),
)
_clear_fabric_connection_cache() | |
13,571 | [
-0.03523026034235954,
-0.007200470194220543,
0.02884763479232788,
-0.02534748613834381,
-0.017809582874178886,
0.007349169347435236,
0.03326285630464554,
0.032027509063482285,
0.036740127950906754,
0.011707198806107044,
0.002962544560432434,
0.00275808316655457,
-0.014698338694870472,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "provider", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def _start_vagrant_machine(provider):
if provider:
options = ' --provider %s' % quote(provider)
else:
options = ''
with lcd(HERE):
with settings(hide('stdout')):
local('vagrant up' + options) | |
13,572 | [
0.025325313210487366,
-0.01537136361002922,
0.012673667632043362,
-0.013092085719108582,
0.01730930060148239,
0.01569068245589733,
0.016703695058822632,
0.012079073116183281,
-0.0037464946508407593,
0.06113310158252716,
0.02048047073185444,
0.02660258859395981,
0.017727719619870186,
-0.029... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "func", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwds):
try:
oldcwd = os.getcwd()
repo_root = os.path.dirname(test_dir)
os.chdir(os.path.join(repo_root, path))
return func(*args, **kwds)
finally:
... | |
13,573 | [
-0.007130597718060017,
-0.021100252866744995,
-0.011054248549044132,
-0.04465430602431297,
0.03270113840699196,
0.021051662042737007,
0.03916362300515175,
0.002315622055903077,
0.027477703988552094,
0.0038143231067806482,
0.014577031135559082,
-0.010058151558041573,
0.006210422609001398,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "With", "_fields": {"body": [{"_type": "With", "_fields": {"bod... | def _vagrant_ssh_config():
with lcd(HERE):
with settings(hide('running')):
output = local('vagrant ssh-config', capture=True)
config = {}
for line in output.splitlines()[1:]:
key, value = line.strip().split(' ', 2)
config[key] = value
return config | |
13,574 | [
-0.003586715552955866,
-0.009476875886321068,
0.024033142253756523,
-0.02272302471101284,
0.006459309719502926,
0.014379078522324562,
0.029123270884156227,
0.02083301916718483,
0.00001970503944903612,
0.04297615587711334,
0.012413902208209038,
0.019952448084950447,
0.024226438254117966,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwds", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": ... | def wrapper(*args, **kwds):
try:
oldcwd = os.getcwd()
repo_root = os.path.dirname(test_dir)
os.chdir(os.path.join(repo_root, path))
return func(*args, **kwds)
finally:
os.chdir(oldcwd) | |
13,575 | [
-0.013081737793982029,
0.003055050503462553,
-0.04554802551865578,
-0.05559171736240387,
0.030879249796271324,
-0.011222634464502335,
0.024984532967209816,
-0.01661856845021248,
0.010803203098475933,
0.044663820415735245,
0.024939188733696938,
-0.04788324236869812,
-0.015825048089027405,
-... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "(?i)https?://(?:(www|touch)\\.)?dailymotion\\.[a-z]{2,3}/(?:(?:(?:embed|swf|#)/)?video|swf)/(?P<id>[^/?_]+)"}}, "targets": [{"_type": "Na... | class DailymotionIE(DailymotionBaseInfoExtractor):
_VALID_URL = r'(?i)https?://(?:(www|touch)\.)?dailymotion\.[a-z]{2,3}/(?:(?:(?:embed|swf|#)/)?video|swf)/(?P<id>[^/?_]+)'
IE_NAME = 'dailymotion'
_FORMATS = [
('stream_h264_ld_url', 'ld'),
('stream_h264_url', 'standard'),
('stream_h... | |
13,576 | [
0.0178043395280838,
0.04330159351229668,
-0.046054575592279434,
0.028121594339609146,
-0.001780112273991108,
0.019566763192415237,
0.010645296424627304,
0.038130100816488266,
0.001511567854322493,
0.011024796403944492,
0.02408216893672943,
-0.020145662128925323,
0.013095966540277004,
-0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "info", "annotation": null, "type_comment": null}}], "kwarg": null... | def _check_error(self, info):
error = info.get('error')
if error:
title = error.get('title') or error['message']
# See https://developer.dailymotion.com/api#access-error
if error.get('code') == 'DM007':
self.raise_geo_restricted(msg=title)
... | |
13,577 | [
-0.007084894925355911,
-0.01981418766081333,
-0.04315612092614174,
-0.061665043234825134,
0.03325490653514862,
-0.016968470066785812,
0.03504230082035065,
-0.01813262701034546,
0.00653809355571866,
0.03327842801809311,
0.03981652110815048,
-0.04957662522792816,
-0.010836067609488964,
-0.04... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage_no_ff(
'https://www.dailymotion.com/video/%s' % video_id, video_id)
age_limit = self._rta_search(webpage)
description = self._og_search_description(webpage) or self._html_search_m... | |
13,578 | [
-0.030057700350880623,
0.01874246448278427,
-0.06265953183174133,
-0.043373364955186844,
-0.0007104080868884921,
-0.024497538805007935,
0.04230647161602974,
-0.012505234219133854,
0.028293222188949585,
0.01887582615017891,
0.018886083737015724,
-0.05839195474982262,
-0.015787987038493156,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "video_id", "annotation": null, "type_comment": null}}, {"_type": ... | def _get_subtitles(self, video_id, webpage):
try:
sub_list = self._download_webpage(
'https://api.dailymotion.com/video/%s/subtitles?fields=id,language,url' % video_id,
video_id, note=False)
except ExtractorError as err:
self._downloader.report_war... | |
13,579 | [
0.009553611278533936,
-0.02032395452260971,
-0.05227447301149368,
-0.07345464825630188,
0.030508464202284813,
0.005458401516079903,
0.024131881073117256,
-0.009762032888829708,
-0.0008801601943559945,
0.03280673921108246,
0.04540218412876129,
-0.07994389533996582,
0.004790888167917728,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "dailymotion:playlist"}}, "targets": [{"_type": "Name", "_fields": {"id": "IE_NAME", "ctx": {"_type": "Store", "_fields": {}}}}], "type_co... | class DailymotionPlaylistIE(DailymotionBaseInfoExtractor):
IE_NAME = 'dailymotion:playlist'
_VALID_URL = r'(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/playlist/(?P<id>[^/?#&]+)'
_MORE_PAGES_INDICATOR = r'(?s)<div class="pages[^"]*">.*?<a\s+class="[^"]*?icon-arrow_right[^"]*?"'
_PAGE_TEMPLATE = 'http... | |
13,580 | [
0.034650757908821106,
-0.025648601353168488,
-0.031759005039930344,
-0.047525350004434586,
0.01674702763557434,
-0.004271623678505421,
0.032815121114254,
-0.004871977027505636,
0.007883173413574696,
0.04915982112288475,
0.06145606189966202,
-0.07060909271240234,
-0.023108886554837227,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "id", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def _extract_entries(self, id):
video_ids = set()
processed_urls = set()
for pagenum in itertools.count(1):
page_url = self._PAGE_TEMPLATE % (id, pagenum)
webpage, urlh = self._download_webpage_handle_no_ff(
page_url, id, 'Downloading page %s' % pagenum)
... | |
13,581 | [
-0.000001314865244239627,
-0.011811085045337677,
-0.03957129269838333,
-0.05643535777926445,
0.005837961100041866,
-0.002752627246081829,
0.0022288744803518057,
0.013578588142991066,
-0.007158390711992979,
0.038947466760873795,
0.06333902478218079,
-0.05007234588265419,
0.034580692648887634,... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
playlist_id = mobj.group('id')
webpage = self._download_webpage(url, playlist_id)
return {
'_type': 'playlist',
'id': playlist_id,
'title': self._og_search_title(webpage),
... | |
13,582 | [
-0.0033988538198173046,
-0.03509286046028137,
-0.07877487689256668,
-0.05968239903450012,
0.015914488583803177,
-0.013951252214610577,
0.028098827227950096,
0.001681021531112492,
0.01526416651904583,
0.01755869947373867,
0.041350677609443665,
-0.0670936182141304,
-0.0020598648115992546,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "dailymotion:user"}}, "targets": [{"_type": "Name", "_fields": {"id": "IE_NAME", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen... | class DailymotionUserIE(DailymotionPlaylistIE):
IE_NAME = 'dailymotion:user'
_VALID_URL = r'https?://(?:www\.)?dailymotion\.[a-z]{2,3}/(?!(?:embed|swf|#|video|playlist)/)(?:(?:old/)?user/)?(?P<user>[^/]+)'
_PAGE_TEMPLATE = 'http://www.dailymotion.com/user/%s/%s'
_TESTS = [{
'url': 'https://www.d... | |
13,583 | [
0.004350560251623392,
0.0019541126675903797,
-0.05594697222113609,
-0.034647706896066666,
0.01651757024228573,
-0.0014851816231384873,
0.005935127381235361,
0.024591583758592606,
0.011567899025976658,
0.04662994295358658,
0.04114275053143501,
-0.05146763101220131,
0.01837649755179882,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
user = mobj.group('user')
webpage = self._download_webpage(
'https://www.dailymotion.com/user/%s' % user, user)
full_user = unescapeHTML(self._html_search_regex(
r'<a class="nav-image" title="([^"... | |
13,584 | [
0.03546565771102905,
0.006589747965335846,
0.03185044974088669,
-0.05903315916657448,
0.025809846818447113,
0.03535125404596329,
0.01179519109427929,
0.021496765315532684,
-0.04667738080024719,
0.015765057876706123,
0.00611496577039361,
-0.017080718651413918,
-0.02225184068083763,
0.002508... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "instance", "annotation": null, "type_comment": null}}], "kwarg": ... | def check(self, instance):
if rrdtool is None:
raise Exception("Unable to import python rrdtool module")
# Load the instance config
config = self._get_config(instance)
connection = pymysql.connect(config.host, config.user, config.password, config.db)
self.log.debug... | |
13,585 | [
0.03731219843029976,
0.047054704278707504,
0.05718327313661575,
-0.017123188823461533,
-0.003960021305829287,
0.012149742804467678,
-0.0019502040231600404,
0.015351824462413788,
-0.008351528085768223,
0.06858359277248383,
0.013012714684009552,
-0.0024554969277232885,
0.013762137852609158,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "whitelist", "annotation": null, "type_comment": null}}], "kwarg":... | def _get_whitelist_patterns(self, whitelist):
patterns = []
if whitelist:
if not os.path.isfile(whitelist) or not os.access(whitelist, os.R_OK):
# Don't run the check if the whitelist is unavailable
self.log.exception("Unable to read whitelist file at %s" % (w... | |
13,586 | [
0.01129014603793621,
0.017084846273064613,
-0.003249317640438676,
0.019030015915632248,
-0.024090178310871124,
0.02139686606824398,
0.006226583383977413,
-0.020240645855665207,
-0.018336284905672073,
0.03593802824616432,
-0.02539602667093277,
-0.02668827213346958,
0.03438733518123627,
0.06... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def basic_multivector_operations():
Print_Function()
(ex, ey, ez) = MV.setup('e*x|y|z')
A = MV('A', 'mv')
A.Fmt(1, 'A')
A.Fmt(2, 'A')
A.Fmt(3, 'A')
X = MV('X', 'vector')
Y = MV('Y', 'vector')
print('g_{ij} =\n', MV.metric)
X.Fmt(1, 'X')
Y.Fmt(1, 'Y')
(X*Y).Fmt(2, 'X... | |
13,587 | [
0.03717378154397011,
-0.017343740910291672,
0.02098870277404785,
-0.05938149616122246,
-0.010518490336835384,
0.024271583184599876,
0.01916622184216976,
-0.012359075248241425,
-0.03780139237642288,
0.017138561233878136,
-0.01282978244125843,
-0.03227360174059868,
0.015026414766907692,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "instance", "annotation": null, "type_comment": null}}], "kwarg": ... | def _get_config(self, instance):
required = ['mysql_host', 'mysql_user', 'rrd_path']
for param in required:
if not instance.get(param):
raise Exception("Cacti instance missing %s. Skipping." % (param))
host = instance.get('mysql_host')
user = instance.get('my... | |
13,588 | [
0.03979150205850601,
-0.012457064352929592,
0.003982568625360727,
0.006467828061431646,
-0.04764040932059288,
0.03205198422074318,
0.023136502131819725,
-0.010310237295925617,
0.00039911147905513644,
0.033474087715148926,
0.03708403930068016,
-0.03691994771361351,
0.00460473820567131,
0.03... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def check_generalized_BAC_CAB_formulas():
Print_Function()
(a, b, c, d, e) = MV.setup('a b c d e')
print('g_{ij} =\n', MV.metric)
print('a|(b*c) =', a | (b*c))
print('a|(b^c) =', a | (b ^ c))
print('a|(b^c^d) =', a | (b ^ c ^ d))
print('a|(b^c)+c|(a^b)+b|(c^a) =', (a | (b ^ c)) +
... | |
13,589 | [
0.037985846400260925,
0.018734516575932503,
0.03457487002015114,
0.006437567062675953,
-0.012939736247062683,
0.021938763558864594,
-0.008204425685107708,
-0.04206867888569832,
-0.01214513462036848,
0.015543187968432903,
-0.004486593417823315,
-0.02051752433180809,
0.013068939559161663,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def derivatives_in_rectangular_coordinates():
Print_Function()
X = (x, y, z) = symbols('x y z')
(ex, ey, ez, grad) = MV.setup('e_x e_y e_z', metric='[1,1,1]', coords=X)
f = MV('f', 'scalar', fct=True)
A = MV('A', 'vector', fct=True)
B = MV('B', 'grade2', fct=True)
C = MV('C', 'mv', fct=Tru... | |
13,590 | [
0.037327591329813004,
0.015927240252494812,
0.023392757400870323,
0.005614141933619976,
-0.009091849438846111,
-0.00598621740937233,
-0.0044769104570150375,
-0.014054859057068825,
0.013118668459355831,
-0.002448498038575053,
-0.0016413338016718626,
-0.032742660492658615,
-0.00335468235425651... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def derivatives_in_spherical_coordinates():
Print_Function()
X = (r, th, phi) = symbols('r theta phi')
curv = [[r *
cos(phi) *
sin(th), r *
sin(phi) *
sin(th), r *
cos(th)], [1, r, r *
sin(th)]]
(er,
eth,
... | |
13,591 | [
-0.01613067276775837,
-0.002072566654533148,
0.018418530002236366,
-0.0015905742766335607,
-0.05603962764143944,
0.00372097990475595,
-0.023636898025870323,
-0.0022171642631292343,
-0.002326415851712227,
0.02402249164879322,
0.013997053727507591,
0.0029353327117860317,
-0.02373972348868847,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def rounding_numerical_components():
Print_Function()
(ex, ey, ez) = MV.setup('e_x e_y e_z', metric='[1,1,1]')
X = 1.2*ex + 2.34*ey + 0.555*ez
Y = 0.333*ex + 4*ey + 5.3*ez
print('X =', X)
print('Nga(X,2) =', Nga(X, 2))
print('X*Y =', X*Y)
print('Nga(X*Y,2) =', Nga(X*Y, 2))
return | |
13,592 | [
0.022490104660391808,
-0.033435214310884476,
0.004286928568035364,
-0.015981895849108696,
0.0030249019619077444,
-0.023837020620703697,
-0.01950198784470558,
-0.052518412470817566,
0.018879463896155357,
0.056095097213983536,
-0.045976247638463974,
-0.01936616376042366,
0.015868710353970528,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n", "annotation": null, "type_comment": null}}], "kwarg": null, "var... | def make_vector(a, n=3):
if isinstance(a, str):
sym_str = ''
for i in range(n):
sym_str += a + str(i + 1) + ' '
sym_lst = list(symbols(sym_str))
sym_lst.append(S.Zero)
sym_lst.append(S.Zero)
a = MV(sym_lst, 'vector')
return(F(a)) | |
13,593 | [
-0.006307597737759352,
-0.029200037941336632,
0.02622889168560505,
-0.02119986154139042,
0.015257568098604679,
0.01962905004620552,
-0.016743142157793045,
-0.021382514387369156,
-0.018313951790332794,
0.030539490282535553,
-0.011440131813287735,
-0.021979177370667458,
-0.017583342269062996,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["n", "nbar"]}}, {"_type": "Expr... | def conformal_representations_of_circles_lines_spheres_and_planes():
global n, nbar
Print_Function()
metric = '1 0 0 0 0,0 1 0 0 0,0 0 1 0 0,0 0 0 0 2,0 0 0 2 0'
(e1, e2, e3, n, nbar) = MV.setup('e_1 e_2 e_3 n nbar', metric)
print('g_{ij} =\n', MV.metric)
e = n + nbar
# conformal represe... | |
13,594 | [
-0.009442063979804516,
-0.0031160754151642323,
0.04149589687585831,
-0.024941544979810715,
0.008024783805012703,
0.03233211115002632,
-0.014729361049830914,
-0.03665514290332794,
0.002561135683208704,
0.01783572882413864,
0.020178448408842087,
-0.02583462744951248,
-0.009325575083494186,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def properties_of_geometric_objects():
Print_Function()
metric = '# # # 0 0,' + \
'# # # 0 0,' + \
'# # # 0 0,' + \
'0 0 0 0 2,' + \
'0 0 0 2 0'
(p1, p2, p3, n, nbar) = MV.setup('p1 p2 p3 n nbar', metric)
print('g_{ij} =\n', MV.metric)
P1 = F(p... | |
13,595 | [
0.019230782985687256,
0.004708402790129185,
0.009826788678765297,
-0.03333677351474762,
-0.010377704165875912,
0.0021476082038134336,
-0.020857904106378555,
-0.03164559230208397,
0.0266745425760746,
0.020960399881005287,
0.02327936887741089,
-0.0432019978761673,
0.011678120121359825,
0.060... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def extracting_vectors_from_conformal_2_blade():
Print_Function()
metric = ' 0 -1 #,' + \
'-1 0 #,' + \
' # # #,'
(P1, P2, a) = MV.setup('P1 P2 a', metric)
print('g_{ij} =\n', MV.metric)
B = P1 ^ P2
Bsq = B*B
print('B**2 =', Bsq)
ap = a - (a ^ B)*B
pri... | |
13,596 | [
0.01703363098204136,
-0.036612365394830704,
-0.007973330095410347,
-0.004308117087930441,
0.01201633270829916,
0.0405360646545887,
-0.04027095064520836,
0.015111548826098442,
0.013613649643957615,
0.020069196820259094,
0.027253810316324234,
-0.0046958476305007935,
0.012029588222503662,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def reciprocal_frame_test():
Print_Function()
metric = '1 # #,' + \
'# 1 #,' + \
'# # 1,'
(e1, e2, e3) = MV.setup('e1 e2 e3', metric)
print('g_{ij} =\n', MV.metric)
E = e1 ^ e2 ^ e3
Esq = (E*E).scalar()
print('E =', E)
print('E**2 =', Esq)
Esq_inv = 1/Es... | |
13,597 | [
-0.0036068253684788942,
0.03290042653679848,
0.07838787138462067,
-0.018388839438557625,
-0.04551553726196289,
-0.007733426988124847,
-0.02073485590517521,
0.020833192393183708,
-0.005440089851617813,
0.024190664291381836,
0.029276043176651,
-0.05478721857070923,
-0.03573812544345856,
0.04... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def main():
Get_Program(True)
with GA_Printer():
enhance_print()
basic_multivector_operations()
check_generalized_BAC_CAB_formulas()
derivatives_in_rectangular_coordinates()
derivatives_in_spherical_coordinates()
rounding_numerical_components()
noneuclidia... | |
13,598 | [
0.028750983998179436,
0.02635296620428562,
-0.037232398986816406,
0.013088135048747063,
-0.000634607276879251,
0.04594099149107933,
0.009705665521323681,
0.012791537679731846,
0.03680327907204628,
-0.00001172756492451299,
0.012078442610800266,
0.05497773736715317,
-0.006594551727175713,
-0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "op", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}... | def lazyInit(op):
def wrapper(self, *args):
if not self.initialized:
util.SMlog("LVMCache: will initialize now")
self.refresh()
#util.SMlog("%s(%s): %s" % (op, args, self.toString()))
try:
ret = op(self, *args)
except KeyError:
util... | |
13,599 | [
0.056324828416109085,
0.04202515259385109,
0.010367264039814472,
-0.06514295935630798,
-0.015809085220098495,
-0.03817218542098999,
-0.010238169692456722,
0.022422684356570244,
0.021946027874946594,
0.03753664344549179,
0.012730682268738747,
-0.04500425234436989,
-0.006519261281937361,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "slug", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": null... | def api_delete_files(slug,path):
content_path = os.path.join(current_app.config["DATA_DIR"], slug)
files_path = os.path.join(content_path, "files")
to_delete_path = os.path.join(files_path, path)
# make sure the file actually exists
if not os.path.isfile(to_delete_path):
abort(404)
de... | |
13,600 | [
0.007228449452668428,
0.006827836390584707,
-0.006253044120967388,
-0.005016369745135307,
-0.01939198561012745,
-0.008290944620966911,
-0.015652932226657867,
-0.05285767465829849,
-0.02186533436179161,
0.006938150152564049,
0.015560035593807697,
0.06563083827495575,
0.0004906055983155966,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "lvName", "annotation": null, "type_comment": null}}, {"_type": "a... | def create(self, lvName, size, tag = None):
lvutil.create(lvName, size, self.vgName, tag)
lvInfo = LVInfo(lvName)
lvInfo.size = size
lvInfo.active = True
self.lvs[lvName] = lvInfo
if tag:
self._addTag(lvName, tag) |