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 |
|---|---|---|---|---|---|
11,001 | [
0.06281861662864685,
0.005091508850455284,
0.07218138873577118,
0.009247740730643272,
-0.0025832655373960733,
0.03501037508249283,
0.031969472765922546,
-0.05785714462399483,
-0.054656196385622025,
0.010803201235830784,
-0.03366997838020325,
-0.019895896315574646,
0.08834617584943771,
-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": "constraint", "annotation": null, "type_comment": null}}], "kwarg"... | def visit_foreign_key_constraint(self, constraint):
local_table = constraint.elements[0].parent.table
remote_table = constraint.elements[0].column.table
if local_table.schema != remote_table.schema:
return None
else:
return super(
SQLiteDDLCompil... | |
11,002 | [
0.09008712321519852,
0.022343194112181664,
0.05960830673575401,
-0.020993871614336967,
0.02031921036541462,
0.011399791575968266,
0.029685094952583313,
-0.03960658609867096,
-0.04282114654779434,
0.004060369450598955,
-0.011508927680552006,
-0.031054262071847916,
0.06706926971673965,
0.006... | 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": "constraint", "annotation": null, "type_comment": null}}], "kwarg"... | def visit_primary_key_constraint(self, constraint):
# for columns with sqlite_autoincrement=True,
# the PRIMARY KEY constraint can only be inline
# with the column itself.
if len(constraint.columns) == 1:
c = list(constraint)[0]
if (c.primary_key and
... | |
11,003 | [
0.0564940944314003,
0.008242434822022915,
0.05805347487330437,
-0.03851667419075966,
-0.02769012562930584,
0.03871716558933258,
0.009734983555972576,
-0.06986020505428314,
-0.05448917672038078,
0.024237213656306267,
-0.03230143338441849,
-0.06068214029073715,
0.06883546710014343,
-0.010921... | 10 | {"_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}}, {"_type": "arg", "_fields": {"arg": "type_", "annotation": ... | class SQLiteTypeCompiler(compiler.GenericTypeCompiler):
def visit_large_binary(self, type_, **kw):
return self.visit_BLOB(type_)
def visit_DATETIME(self, type_, **kw):
if not isinstance(type_, _DateTimeMixin) or \
type_.format_is_text_affinity:
return super(SQLiteTyp... | |
11,004 | [
0.07199233770370483,
0.018474504351615906,
0.028500497341156006,
-0.02386334352195263,
-0.024689137935638428,
-0.0002904837892856449,
-0.0028373452369123697,
-0.029686253517866135,
-0.04173438251018524,
0.010364779271185398,
0.029326291754841805,
-0.004020454827696085,
0.06801158934831619,
... | 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": "create", "annotation": null, "type_comment": null}}, {"_type": "a... | def visit_create_index(self, create, include_schema=False,
include_table_schema=True):
index = create.element
self._verify_index_table(index)
preparer = self.preparer
text = "CREATE "
if index.unique:
text += "UNIQUE "
text += "INDEX... | |
11,005 | [
0.07140536606311798,
0.029794219881296158,
0.03982486575841904,
-0.016294071450829506,
0.01200013142079115,
0.019981134682893753,
0.03160339966416359,
-0.051206666976213455,
-0.039183635264635086,
-0.0691610649228096,
0.0013139457441866398,
-0.051069263368844986,
0.07754283398389816,
0.010... | 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 SQLiteExecutionContext(default.DefaultExecutionContext):
@util.memoized_property
def _preserve_raw_colnames(self):
return not self.dialect._broken_dotted_colnames or \
self.execution_options.get("sqlite_raw_colnames", False)
def _translate_colname(self, colname):
# TODO: d... | |
11,006 | [
0.01469915360212326,
-0.016325069591403008,
0.032518308609724045,
0.004166407976299524,
0.008107605390250683,
0.002187570324167609,
-0.0019939434714615345,
0.03407830744981766,
-0.0003196214383933693,
-0.02687154710292816,
0.011134224012494087,
0.018785914406180382,
0.045393798500299454,
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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def set_isolation_level(self, connection, level):
try:
isolation_level = self._isolation_lookup[level.replace('_', ' ')]
except KeyError:
raise exc.ArgumentError(
"Invalid value '%s' for isolation_level. "
"Valid isolation levels for %s are %s" %
... | |
11,007 | [
0.025644628331065178,
-0.01528286561369896,
0.07262057065963745,
-0.051093198359012604,
-0.03427126258611679,
-0.01627296768128872,
-0.028487497940659523,
-0.04085887223482132,
-0.03499668464064598,
-0.022429248318076134,
-0.00466132303699851,
-0.04807387664914131,
0.05360276624560356,
-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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_table_names(self, connection, schema=None, **kw):
if schema is not None:
qschema = self.identifier_preparer.quote_identifier(schema)
master = '%s.sqlite_master' % qschema
else:
master = "sqlite_master"
s = ("SELECT name FROM %s "
"WHERE ty... | |
11,008 | [
0.0001562710094731301,
-0.017938558012247086,
0.034280549734830856,
0.002014238853007555,
0.005032033193856478,
-0.012453213334083557,
0.007526667322963476,
0.01901053637266159,
0.001913027954287827,
-0.05414639040827751,
0.016296375542879105,
0.002286510309204459,
0.049858469516038895,
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": "connection", "annotation": null, "type_comment": null}}], "kwarg"... | def get_isolation_level(self, connection):
cursor = connection.cursor()
cursor.execute('PRAGMA read_uncommitted')
res = cursor.fetchone()
if res:
value = res[0]
else:
# http://www.sqlite.org/changes.html#version_3_3_3
# "Optional READ UNCOMMITT... | |
11,009 | [
0.028921540826559067,
0.012902186252176762,
0.0625910833477974,
-0.06176534667611122,
-0.05375567078590393,
-0.0383143313229084,
-0.02530892938375473,
-0.06304524093866348,
-0.042525604367256165,
-0.020024193450808525,
0.013562778010964394,
-0.04169986769556999,
0.038995567709207535,
-0.01... | 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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_view_names(self, connection, schema=None, **kw):
if schema is not None:
qschema = self.identifier_preparer.quote_identifier(schema)
master = '%s.sqlite_master' % qschema
else:
master = "sqlite_master"
s = ("SELECT name FROM %s "
"WHERE typ... | |
11,010 | [
0.024168645963072777,
0.015061935409903526,
0.031254060566425323,
-0.02540750801563263,
-0.03710061311721802,
-0.022147348150610924,
-0.018365563824772835,
-0.051553983241319656,
-0.03905670717358589,
-0.03031948022544384,
0.025668319314718246,
-0.02063680812716484,
0.06728968769311905,
-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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_view_definition(self, connection, view_name, schema=None, **kw):
if schema is not None:
qschema = self.identifier_preparer.quote_identifier(schema)
master = '%s.sqlite_master' % qschema
s = ("SELECT sql FROM %s WHERE name = '%s'"
"AND type='view'") % ... | |
11,011 | [
0.024127230048179626,
0.020342566072940826,
0.029671762138605118,
-0.018904395401477814,
0.013804560527205467,
0.001632136176340282,
-0.0416313000023365,
-0.038641415536403656,
-0.054234229028224945,
0.006476505659520626,
-0.00878515001386404,
-0.028498517349362373,
0.06524760276079178,
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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_columns(self, connection, table_name, schema=None, **kw):
info = self._get_table_pragma(
connection, "table_info", table_name, schema=schema)
columns = []
for row in info:
(name, type_, nullable, default, primary_key) = (
row[1], row[2].upper(), n... | |
11,012 | [
-0.008798941969871521,
0.06158234924077988,
0.03156965970993042,
-0.022494152188301086,
0.01641991175711155,
-0.022944854572415352,
0.015436560846865177,
-0.05580516159534454,
-0.04216117039322853,
-0.0009481397573836148,
-0.011923129670321941,
0.00043309692409820855,
0.054412081837654114,
... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _get_column_info(self, name, type_, nullable, default, primary_key):
coltype = self._resolve_type_affinity(type_)
if default is not None:
default = util.text_type(default)
return {
'name': name,
'type': coltype,
'nullable': nullable,
... | |
11,013 | [
0.0030968075152486563,
0.013816526159644127,
0.06180621683597565,
-0.04729669541120529,
-0.026203755289316177,
-0.004845529329031706,
-0.021406952291727066,
-0.0649246796965599,
-0.05279732123017311,
0.015267477370798588,
0.012322261929512024,
-0.025510763749480247,
0.07129154354333878,
0.... | 13 | {"_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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_foreign_keys(self, connection, table_name, schema=None, **kw):
# sqlite makes this *extremely difficult*.
# First, use the pragma to get the actual FKs.
pragma_fks = self._get_table_pragma(
connection, "foreign_key_list",
table_name, schema=schema
)
... | |
11,014 | [
0.051142510026693344,
0.005261777434498072,
0.05263744667172432,
-0.011457889340817928,
-0.006009245291352272,
0.035426024347543716,
0.0009527751826681197,
-0.019522670656442642,
-0.03892732039093971,
-0.022601056843996048,
-0.01503786537796259,
0.0017494180938228965,
0.08277218788862228,
... | 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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_pk_constraint(self, connection, table_name, schema=None, **kw):
constraint_name = None
table_data = self._get_table_sql(connection, table_name, schema=schema)
if table_data:
PK_PATTERN = r'CONSTRAINT (\w+) PRIMARY KEY'
result = re.search(PK_PATTERN, table_data, re... | |
11,015 | [
0.03046548180282116,
0.015243644826114178,
0.0521642304956913,
-0.01959429867565632,
-0.034041959792375565,
-0.014120543375611305,
-0.023203488439321518,
-0.03175213932991028,
-0.04854413866996765,
0.00896300096064806,
-0.00617160415276885,
-0.013346366584300995,
0.048849448561668396,
0.00... | 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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_unique_constraints(self, connection, table_name,
schema=None, **kw):
auto_index_by_sig = {}
for idx in self.get_indexes(
connection, table_name, schema=schema,
include_auto_indexes=True, **kw):
if not idx['name'].startsw... | |
11,016 | [
0.026379447430372238,
0.07277660816907883,
0.07982217520475388,
-0.005325622856616974,
-0.021261047571897507,
0.04898744076490402,
0.007750128395855427,
-0.030565345659852028,
-0.028223728761076927,
0.04790988564491272,
0.0033077921252697706,
-0.010765218175947666,
0.08272329717874527,
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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_check_constraints(self, connection, table_name,
schema=None, **kw):
table_data = self._get_table_sql(
connection, table_name, schema=schema, **kw)
if not table_data:
return []
CHECK_PATTERN = (
r'(?:CONSTRAINT (\w+) +)?'
... | |
11,017 | [
0.026557283475995064,
0.016969962045550346,
0.056148529052734375,
-0.06674717366695404,
-0.0065887547098100185,
-0.009162566624581814,
-0.03741886839270592,
-0.004558528307825327,
-0.04603532329201698,
-0.021298415958881378,
0.006153887137770653,
-0.015685586258769035,
0.07059019058942795,
... | 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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def get_indexes(self, connection, table_name, schema=None, **kw):
pragma_indexes = self._get_table_pragma(
connection, "index_list", table_name, schema=schema)
indexes = []
include_auto_indexes = kw.pop('include_auto_indexes', False)
for row in pragma_indexes:
# ... | |
11,018 | [
-0.003213871968910098,
-0.006197130307555199,
0.03234479948878288,
-0.032953228801488876,
-0.002020323183387518,
-0.00242635072208941,
-0.024906281381845474,
-0.021334221586585045,
-0.01733037456870079,
-0.010686737485229969,
0.0005023208213970065,
-0.055818330496549606,
0.07984141260385513,... | 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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def _get_table_sql(self, connection, table_name, schema=None, **kw):
try:
s = ("SELECT sql FROM "
" (SELECT * FROM sqlite_master UNION ALL "
" SELECT * FROM sqlite_temp_master) "
"WHERE name = '%s' "
"AND type = 'table'") % table_n... | |
11,019 | [
0.014552596025168896,
0.0417807474732399,
0.04734562337398529,
-0.05198302119970322,
0.0005548315239138901,
0.04381236806511879,
-0.027912719175219536,
-0.03729793056845665,
-0.034603822976350784,
0.031158898025751114,
0.0029922258108854294,
-0.00663589546456933,
0.039903704077005386,
0.00... | 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": "Constant", "_fields":... | def parse_fks():
FK_PATTERN = (
r'(?:CONSTRAINT (\w+) +)?'
r'FOREIGN KEY *\( *(.+?) *\) +'
r'REFERENCES +(?:(?:"(.+?)")|([a-z0-9_]+)) *\((.+?)\) *'
r'((?:ON (?:DELETE|UPDATE) '
r'(?:SET NULL|SET DEFAULT|CASCADE|RESTRICT|NO ACTIO... | |
11,020 | [
0.029002660885453224,
0.031349439173936844,
0.028714848682284355,
-0.016017882153391838,
-0.015010537579655647,
0.002619371982291341,
-0.02138669416308403,
-0.009630654938519001,
-0.013704311102628708,
-0.055260032415390015,
0.026633741334080696,
-0.024309100583195686,
0.08027759194374084,
... | 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": "connection", "annotation": null, "type_comment": null}}, {"_type"... | def _get_table_pragma(self, connection, pragma, table_name, schema=None):
quote = self.identifier_preparer.quote_identifier
if schema is not None:
statement = "PRAGMA %s." % quote(schema)
else:
statement = "PRAGMA "
qtable = quote(table_name)
statement = "... | |
11,021 | [
0.056634411215782166,
0.02011709474027157,
-0.005723792593926191,
-0.041383739560842514,
-0.031191077083349228,
-0.023316672071814537,
-0.02532838098704815,
0.015442265197634697,
0.026497088372707367,
0.015691334381699562,
0.048779167234897614,
-0.009809479117393494,
-0.002507452154532075,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def remove_files(name):
for f in (name + ".py",
name + ".pyc",
name + ".pyo",
name + ".pyw",
name + "$py.class"):
unlink(f)
rmtree('__pycache__') | |
11,022 | [
0.04164593294262886,
0.0441383458673954,
0.05587533861398697,
-0.00787375494837761,
0.011317814700305462,
0.04030909389257431,
-0.04252960532903671,
-0.044795434921979904,
-0.02004125528037548,
-0.007409260142594576,
0.006803151220083237,
0.007080715149641037,
0.06326194107532501,
0.015101... | 11 | {"_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": "Constant", "_fields":... | def parse_uqs():
UNIQUE_PATTERN = r'(?:CONSTRAINT "?(.+?)"? +)?UNIQUE *\((.+?)\)'
INLINE_UNIQUE_PATTERN = (
r'(?:(".+?")|([a-z0-9]+)) '
r'+[a-z0-9_ ]+? +UNIQUE')
for match in re.finditer(UNIQUE_PATTERN, table_data, re.I):
name, cols = ... | |
11,023 | [
-0.0019059081096202135,
0.022182049229741096,
-0.015305151231586933,
-0.046216461807489395,
0.008526659570634365,
0.0023009823635220528,
0.004766941070556641,
0.01292023342102766,
0.0322774276137352,
-0.021823154762387276,
0.0703434944152832,
0.008480350486934185,
0.03980265557765961,
0.02... | 14 | {"_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 test_execute_bit_not_copied(self):
# Issue 6070: under posix .pyc files got their execute bit set if
# the .py file had the execute bit set, but they aren't executable.
with temp_umask(0o022):
sys.path.insert(0, os.curdir)
try:
fname = TESTFN + os.exts... | |
11,024 | [
0.008002838119864464,
0.0068993824534118176,
0.03488702327013016,
-0.06402270495891571,
0.022782452404499054,
0.0008979507256299257,
-0.020742731168866158,
0.02494477853178978,
0.01656297594308853,
0.051227081567049026,
0.02679501846432686,
0.0052079749293625355,
0.004675752948969603,
0.00... | 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 test_import(self):
def test_with_extension(ext):
# The extension is normally ".py", perhaps ".pyw".
source = TESTFN + ext
pyo = TESTFN + ".pyo"
if is_jython:
pyc = TESTFN + "$py.class"
else:
pyc = TESTFN + ".pyc"
... | |
11,025 | [
0.02484913170337677,
-0.006258459761738777,
0.03268067166209221,
-0.0758526548743248,
-0.02457823045551777,
0.00974017009139061,
-0.01143946684896946,
-0.03162169083952904,
-0.01744857244193554,
0.06284934282302856,
0.03292694687843323,
-0.04713700711727142,
-0.0037587699480354786,
-0.0272... | 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": "module", "annotation": null, "type_comment": null}}], "kwarg": nu... | def test_module_with_large_stack(self, module='longlist'):
# Regression test for http://bugs.python.org/issue561858.
filename = module + '.py'
# Create a file with a list of 65000 elements.
with open(filename, 'w') as f:
f.write('d = [\n')
for i in range(65000):
... | |
11,026 | [
0.058560747653245926,
0.058873191475868225,
-0.0040617589838802814,
-0.009133378975093365,
0.004011544864624739,
0.011231210082769394,
-0.01345736626535654,
-0.005654660519212484,
0.013725174590945244,
0.043786656111478806,
0.057846590876579285,
0.0026990054175257683,
-0.026379117742180824,
... | 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 test_imp_module(self):
# Verify that the imp module can correctly load and find .py files
# XXX (ncoghlan): It would be nice to use support.CleanImport
# here, but that breaks because the os module registers some
# handlers in copy_reg on import. Since CleanImport doesn't
# r... | |
11,027 | [
0.004763373639434576,
0.006976773962378502,
0.022921239957213402,
-0.07835892587900162,
0.02187158726155758,
-0.007056638598442078,
-0.015528027899563313,
0.015733394771814346,
0.0005469322786666453,
0.023822573944926262,
0.0433780774474144,
-0.0020451131276786327,
-0.02405075915157795,
-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 test_failing_import_sticks(self):
source = TESTFN + ".py"
with open(source, "w") as f:
print("a = 1/0", file=f)
# New in 2.4, we shouldn't be able to import that no matter how often
# we try.
sys.path.insert(0, os.curdir)
if TESTFN in sys.modules:
... | |
11,028 | [
0.05382920801639557,
0.05038156732916832,
0.01296314038336277,
-0.054288893938064575,
0.024823034182190895,
0.023558897897601128,
-0.014572040177881718,
-0.006113821640610695,
0.016157956793904305,
0.05447277054190636,
0.023202642798423767,
-0.013595208525657654,
-0.042084235697984695,
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 test_failing_reload(self):
# A failing reload should leave the module object in sys.modules.
source = TESTFN + os.extsep + "py"
with open(source, "w") as f:
f.write("a = 1\nb=2\n")
sys.path.insert(0, os.curdir)
try:
mod = __import__(TESTFN)
... | |
11,029 | [
0.018624847754836082,
0.021406682208180428,
0.014353851787745953,
-0.06903913617134094,
0.02256491780281067,
0.01634974032640457,
-0.0015512087848037481,
0.005667082965373993,
0.016556568443775177,
0.036484431475400925,
0.010351733304560184,
0.02674284018576145,
0.025667333975434303,
0.012... | 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 test_import_by_filename(self):
path = os.path.abspath(TESTFN)
encoding = sys.getfilesystemencoding()
try:
path.encode(encoding)
except UnicodeEncodeError:
self.skipTest('path is not encodable to {}'.format(encoding))
with self.assertRaises(ImportError)... | |
11,030 | [
-0.0005832697497680783,
-0.004514500964432955,
0.011146782897412777,
-0.06456251442432404,
0.006851642392575741,
-0.02959476225078106,
-0.018274657428264618,
-0.006022945512086153,
0.02196858637034893,
0.01771136000752449,
0.025370033457875252,
0.02051701210439205,
0.04684031754732132,
-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": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_file_to_source(self):
# check if __file__ points to the source file where available
source = TESTFN + ".py"
with open(source, "w") as f:
f.write("test = None\n")
sys.path.insert(0, os.curdir)
try:
mod = __import__(TESTFN)
self.assertT... | |
11,031 | [
0.004691191948950291,
0.0250586848706007,
0.044525377452373505,
-0.010131102986633778,
0.004334380384534597,
-0.009598810225725174,
-0.00755738141015172,
0.011716281063854694,
-0.02863849699497223,
-0.012658028863370419,
0.016998259350657463,
0.02599458396434784,
-0.008832543157041073,
0.0... | 8 | {"_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 test_import_in_del_does_not_crash(self):
# Issue 4236
testfn = script_helper.make_script('', TESTFN, textwrap.dedent("""\
import sys
class C:
def __del__(self):
import imp
sys.argv.insert(0, C())
"""))
script_he... | |
11,032 | [
-0.00970462802797556,
0.002020332496613264,
0.036990102380514145,
-0.07862155139446259,
0.007389816455543041,
-0.005760657601058483,
-0.02164788357913494,
0.01475619152188301,
0.020358622074127197,
0.03738860413432121,
0.02533986233174801,
-0.0006585492519661784,
-0.0007460872293449938,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ext", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def test_with_extension(ext):
# The extension is normally ".py", perhaps ".pyw".
source = TESTFN + ext
pyo = TESTFN + ".pyo"
if is_jython:
pyc = TESTFN + "$py.class"
else:
pyc = TESTFN + ".pyc"
with open(source, "w"... | |
11,033 | [
0.014956888742744923,
0.02576109766960144,
0.04437572509050369,
-0.03732582554221153,
0.010037653148174286,
0.019870087504386902,
0.004777391906827688,
-0.031458958983421326,
0.02425212971866131,
0.013967005535960197,
0.038605429232120514,
-0.03126581013202667,
0.03363187238574028,
0.04244... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "unlikely_module_name"}}, "targets": [{"_type": "Name", "_fields": {"id": "module_name", "ctx": {"_type": "Store", "_fields": {}}}}], "typ... | class PycRewritingTests(unittest.TestCase):
# Test that the `co_filename` attribute on code objects always points
# to the right file, even when various things happen (e.g. both the .py
# and the .pyc file are renamed).
module_name = "unlikely_module_name"
module_source = """
import sys
code_filena... | |
11,034 | [
0.07940547168254852,
-0.008446428924798965,
0.024932775646448135,
-0.032746851444244385,
-0.03604412078857422,
-0.006667936220765114,
0.022855043411254883,
0.021409666165709496,
0.004711594432592392,
0.050768911838531494,
0.011292017996311188,
-0.011523503810167313,
0.0013642169069498777,
... | 8 | {"_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 tearDown(self):
sys.path[:] = self.sys_path
if self.orig_module is not None:
sys.modules[self.module_name] = self.orig_module
else:
unload(self.module_name)
unlink(self.file_name)
unlink(self.compiled_name)
rmtree(self.dir_name) | |
11,035 | [
-0.007969524711370468,
0.013433197513222694,
0.03391481935977936,
-0.06270351260900497,
0.025264481082558632,
0.013353101909160614,
-0.011396477930247784,
0.0046798791736364365,
0.011304940097033978,
0.03414366394281387,
0.016499720513820648,
-0.005778334569185972,
0.012277531437575817,
-0... | 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 test_basics(self):
mod = self.import_module()
self.assertEqual(mod.module_filename, self.file_name)
self.assertEqual(mod.code_filename, self.file_name)
self.assertEqual(mod.func_filename, self.file_name)
del sys.modules[self.module_name]
mod = self.import_module()
... | |
11,036 | [
0.03375893458724022,
0.007693182677030563,
0.018796144053339958,
-0.08649403601884842,
-0.011711851693689823,
0.03687221184372902,
-0.012675484642386436,
0.0007405945798382163,
0.029247861355543137,
-0.0283795315772295,
-0.0016678269021213055,
-0.036787498742341995,
0.015248703770339489,
0... | 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 test_module_without_source(self):
target = "another_module.py"
py_compile.compile(self.file_name, dfile=target)
os.remove(self.file_name)
pyc_file = make_legacy_pyc(self.file_name)
mod = self.import_module()
self.assertEqual(mod.module_filename, pyc_file)
self... | |
11,037 | [
0.03403068706393242,
0.028981419280171394,
0.020416107028722763,
-0.03414596617221832,
0.016542695462703705,
0.013695277273654938,
0.017464935779571533,
-0.05473499372601509,
0.022491149604320526,
0.014041117392480373,
0.02653748169541359,
-0.004129909910261631,
0.06340406090021133,
0.0034... | 8 | {"_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 test_foreign_code(self):
py_compile.compile(self.file_name)
with open(self.compiled_name, "rb") as f:
header = f.read(8)
code = marshal.load(f)
constants = list(code.co_consts)
foreign_code = test_main.__code__
pos = constants.index(1)
constant... | |
11,038 | [
0.0025406235363334417,
0.023022323846817017,
0.016171345487236977,
-0.02271839790046215,
0.04769090563058853,
0.020274333655834198,
0.01177709549665451,
-0.02428867667913437,
-0.01035877875983715,
0.03196278586983681,
0.014449103735387325,
-0.02288302406668663,
-0.01769097149372101,
0.0387... | 8 | {"_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 test_issue3221(self):
# Note for mergers: the 'absolute' tests from the 2.x branch
# are missing in Py3k because implicit relative imports are
# a thing of the past
#
# Regression test for http://bugs.python.org/issue3221.
def check_relative():
exec("from ... | |
11,039 | [
0.007331267464905977,
-0.008409037254750729,
0.02844824083149433,
-0.050417687743902206,
0.037338316440582275,
0.03417198732495308,
-0.001843472826294601,
-0.002143360674381256,
0.021969446912407875,
-0.004335434176027775,
0.04430424049496651,
-0.008841362781822681,
0.037143465131521225,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "get_tag", "value": {"_type": "Name", "_fields": {"id": "imp"... | class PycacheTests(unittest.TestCase):
# Test the various PEP 3147 related behaviors.
tag = imp.get_tag()
def _clean(self):
forget(TESTFN)
rmtree('__pycache__')
unlink(self.source)
def setUp(self):
self.source = TESTFN + '.py'
self._clean()
with open(se... | |
11,040 | [
0.015190154314041138,
0.002212638733908534,
-0.009325601160526276,
-0.033547282218933105,
0.03096846118569374,
0.0196465365588665,
0.001620245398953557,
0.020019786432385445,
0.012272016145288944,
-0.005050188861787319,
0.04019792005419731,
0.02676091156899929,
0.029543323442339897,
-0.015... | 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 test_unwritable_directory(self):
# When the umask causes the new __pycache__ directory to be
# unwritable, the import still succeeds but no .pyc file is written.
with temp_umask(0o222):
__import__(TESTFN)
self.assertTrue(os.path.exists('__pycache__'))
self.assertF... | |
11,041 | [
0.03539098799228668,
0.0026265026535838842,
0.01277028489857912,
-0.07153122127056122,
0.03146845102310181,
0.007029716391116381,
-0.00258656102232635,
-0.029859768226742744,
-0.0010426127118989825,
-0.01219732966274023,
0.011888815090060234,
-0.004451419226825237,
0.05059633031487465,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_missing_source_legacy(self):
# Like test_missing_source() except that for backward compatibility,
# when the pyc file lives where the py file would have been (and named
# without the tag), it is importable. The __file__ of the imported
# module is the pyc location.
__im... | |
11,042 | [
-0.00020719529129564762,
0.007369432598352432,
0.010057371109724045,
-0.09694499522447586,
0.04623255133628845,
-0.001593163819052279,
0.006350255571305752,
-0.021212318912148476,
-0.00962058175355196,
-0.015780441462993622,
0.030284112319350243,
0.014055680483579636,
0.04999566450715065,
... | 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 test_missing_source(self):
# With PEP 3147 cache layout, removing the source but leaving the pyc
# file does not satisfy the import.
__import__(TESTFN)
pyc_file = imp.cache_from_source(self.source)
self.assertTrue(os.path.exists(pyc_file))
os.remove(self.source)
... | |
11,043 | [
0.03455127403140068,
-0.006998568773269653,
0.007113497704267502,
-0.04468921944499016,
0.04248742014169693,
0.038398370146751404,
0.005093167535960674,
-0.006381581537425518,
0.03109130822122097,
-0.022780129685997963,
0.010506926104426384,
-0.010797273367643356,
0.05187530443072319,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test___cached___legacy_pyc(self):
# Like test___cached__() except that for backward compatibility,
# when the pyc file lives where the py file would have been (and named
# without the tag), it is importable. The __cached__ of the imported
# module is the pyc location.
__impo... | |
11,044 | [
0.02183215506374836,
-0.04233182966709137,
-0.008014092221856117,
-0.037975650280714035,
0.017514409497380257,
0.022101212292909622,
0.0076553476974368095,
0.005675847642123699,
0.04471491649746895,
0.006044201087206602,
0.03090326115489006,
-0.03205636888742447,
0.045534905046224594,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_package___cached__(self):
# Like test___cached__ but for packages.
def cleanup():
rmtree('pep3147')
os.mkdir('pep3147')
self.addCleanup(cleanup)
# Touch the __init__.py
with open(os.path.join('pep3147', '__init__.py'), 'w'):
pass
w... | |
11,045 | [
0.05327188968658447,
0.031920287758111954,
0.04751148074865341,
-0.06669697910547256,
-0.012157559394836426,
0.015817323699593544,
-0.011752902530133724,
0.008432336151599884,
0.012282527051866055,
0.02956375665962696,
0.052319757640361786,
-0.020911240950226784,
0.02398187294602394,
-0.00... | 20 | {"_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}}, {"_type": "arg", "_fields": {"arg": "plan", "annotation": n... | class ResourceSweeper(object):
def execute(self, plan, config):
# type: (models.Plan, Config) -> None
instructions = plan.instructions
marked = self._mark_resources(instructions)
deployed = config.deployed_resources(config.chalice_stage)
if deployed is not None:
... | |
11,046 | [
0.029450740665197372,
-0.021184084936976433,
-0.015286455862224102,
-0.021807512268424034,
0.045634932816028595,
0.028004387393593788,
0.015024615451693535,
0.010841413401067257,
0.056557390838861465,
-0.006982394028455019,
0.0468817874789238,
-0.01893974281847477,
0.051869213581085205,
-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": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_package___cached___from_pyc(self):
# Like test___cached__ but ensuring __cached__ when imported from a
# PEP 3147 pyc file.
def cleanup():
rmtree('pep3147')
os.mkdir('pep3147')
self.addCleanup(cleanup)
unload('pep3147.foo')
unload('pep3147')
... | |
11,047 | [
0.05969056487083435,
0.06733014434576035,
0.06101476028561592,
-0.06620967388153076,
-0.0010910271666944027,
0.002570399548858404,
0.017940273508429527,
0.027858993038535118,
0.006035265978425741,
0.015151828527450562,
0.026407472789287567,
-0.02433205395936966,
0.02565624751150608,
-0.025... | 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": "plan", "annotation": null, "type_comment": null}}, {"_type": "arg... | def execute(self, plan, config):
# type: (models.Plan, Config) -> None
instructions = plan.instructions
marked = self._mark_resources(instructions)
deployed = config.deployed_resources(config.chalice_stage)
if deployed is not None:
remaining = self._determine_remainin... | |
11,048 | [
0.053331874310970306,
0.03881403058767319,
0.04861731454730034,
-0.07169120758771896,
-0.007982319220900536,
0.042904969304800034,
-0.006803680211305618,
0.0008707276429049671,
0.013395329937338829,
0.049939386546611786,
0.0223629679530859,
-0.018222138285636902,
0.020492110401391983,
-0.0... | 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": "plan", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _determine_remaining(self, plan, deployed, marked):
# type: (models.Plan, DeployedResources, MarkedResource) -> List[str]
remaining = []
deployed_resource_names = reversed(deployed.resource_names())
for name in deployed_resource_names:
resource_values = deployed.resource_... | |
11,049 | [
0.051494400948286057,
0.019539425149559975,
0.02311944216489792,
-0.06769488751888275,
-0.021540377289056778,
-0.00012731966853607446,
-0.035944826900959015,
0.02199842780828476,
0.024336889386177063,
0.02796512469649315,
0.02507217973470688,
-0.0532301664352417,
0.002572007942944765,
-0.0... | 19 | {"_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": "plan", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _plan_deletion(self,
plan, # type: List[models.Instruction]
messages, # type: Dict[int, str]
remaining, # type: List[str]
deployed, # type: DeployedResources
):
# type: (...) -> None... | |
11,050 | [
0.04708806797862053,
0.08828463405370712,
0.03482142835855484,
-0.048099298030138016,
-0.0035090723540633917,
-0.0025514280423521996,
0.014036289416253567,
-0.01209077425301075,
0.005737621802836657,
-0.005814563017338514,
0.061289232224226,
-0.0031106264796108007,
0.05082521587610245,
-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": "plan", "annotation": null, "type_comment": null}}], "kwarg": null... | def _mark_resources(self, plan):
# type: (List[models.Instruction]) -> MarkedResource
marked = {} # type: MarkedResource
for instruction in plan:
if isinstance(instruction, models.RecordResource):
marked.setdefault(instruction.resource_name, []).append(
... | |
11,051 | [
0.03381744399666786,
-0.018110189586877823,
-0.003496931167319417,
0.058243606239557266,
0.011463540606200695,
0.023522304370999336,
0.03685969114303589,
-0.024095481261610985,
-0.004877516068518162,
0.04217260330915451,
0.029562707990407944,
-0.04426690191030502,
0.03959330543875694,
0.04... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "X", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "Y", "annotation": null, "type_comment": null}}], "kwarg": null, "var... | def assert_csr_equal(X, Y):
X.eliminate_zeros()
Y.eliminate_zeros()
assert_equal(X.shape[0], Y.shape[0])
assert_equal(X.shape[1], Y.shape[1])
assert_array_equal(X.data, Y.data)
assert_array_equal(X.indices, Y.indices)
assert_array_equal(X.indptr, Y.indptr) | |
11,052 | [
0.039350129663944244,
-0.06183917075395584,
0.009769176132977009,
-0.009700820781290531,
0.024949850514531136,
0.02314981445670128,
0.03964633867144585,
-0.01555093377828598,
-0.0035260175354778767,
0.02927904762327671,
0.006271640304476023,
-0.07181911170482635,
0.017419325187802315,
0.01... | 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 test_seq_dataset():
dataset1 = ArrayDataset(X, y, sample_weight, seed=42)
dataset2 = CSRDataset(X_csr.data, X_csr.indptr, X_csr.indices,
y, sample_weight, seed=42)
for dataset in (dataset1, dataset2):
for i in range(5):
# next sample
xi_, yi, sw... | |
11,053 | [
0.03306456655263901,
-0.06923113763332367,
0.0012168618850409985,
-0.010804146528244019,
0.01401777844876051,
0.02050379104912281,
0.039621081203222275,
0.006815013941377401,
-0.027730055153369904,
0.011092022061347961,
0.011738273315131664,
-0.06204012408852577,
0.0109745217487216,
0.0452... | 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 test_seq_dataset_shuffle():
dataset1 = ArrayDataset(X, y, sample_weight, seed=42)
dataset2 = CSRDataset(X_csr.data, X_csr.indptr, X_csr.indices,
y, sample_weight, seed=42)
# not shuffled
for i in range(5):
_, _, _, idx1 = dataset1._next_py()
_, _, _, idx2 =... | |
11,054 | [
-0.03495223447680473,
0.05242835357785225,
0.045874807983636856,
-0.05529249459505081,
0.0026472071185708046,
-0.0028611074667423964,
-0.008404313586652279,
0.013738170266151428,
-0.013883804902434349,
0.06427327543497086,
-0.015570735558867455,
-0.042015500366687775,
0.016056183725595474,
... | 15 | {"_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}}, {"_type": "arg", "_fields": {"arg": "terms", "annotation": ... | class LookupModule(LookupBase):
def run(self, terms, variables, **kwargs):
result = None
anydict = False
skip = False
for term in terms:
if isinstance(term, dict):
anydict = True
total_search = []
if anydict:
for term in ter... | |
11,055 | [
0.03979635611176491,
0.007481991779059172,
-0.0028792410157620907,
-0.0014136814279481769,
-0.014963983558118343,
-0.01056009903550148,
-0.028060350567102432,
0.0013927860418334603,
0.05782691761851311,
0.07890100032091141,
0.017823049798607826,
-0.03785957023501396,
0.00826592929661274,
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": "argument_spec", "annotation": null, "type_comment": null}}], "kwa... | def __init__(self, argument_spec):
self.spec = argument_spec
self.module = None
self.init_module()
# module input info
self.ospf = self.module.params['ospf']
self.route_id = self.module.params['route_id']
self.vrf = self.module.params['vrf']
self.descript... | |
11,056 | [
0.0070126536302268505,
0.05999181047081947,
0.04394916445016861,
-0.06508319079875946,
-0.000802282418590039,
-0.015550320036709309,
0.006460287142544985,
0.012464271858334541,
-0.003386247204616666,
0.08045338839292526,
-0.01014673337340355,
-0.03314199298620224,
0.008003311231732368,
-0.... | 14 | {"_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": "terms", "annotation": null, "type_comment": null}}, {"_type": "ar... | def run(self, terms, variables, **kwargs):
result = None
anydict = False
skip = False
for term in terms:
if isinstance(term, dict):
anydict = True
total_search = []
if anydict:
for term in terms:
if isinstance(ter... | |
11,057 | [
0.021207910031080246,
0.03168788179755211,
0.004042554181069136,
0.034454699605703354,
0.008829016238451004,
0.026323910802602768,
-0.028190206736326218,
-0.01339034829288721,
0.020972993224859238,
0.06896159797906876,
0.02038569562137127,
-0.03917916864156723,
-0.02727663516998291,
0.0389... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",... | def test_Abs():
assert refine(Abs(x), Q.positive(x)) == x
assert refine(1 + Abs(x), Q.positive(x)) == 1 + x
assert refine(Abs(x), Q.negative(x)) == -x
assert refine(1 + Abs(x), Q.negative(x)) == 1 - x
assert refine(Abs(x**2)) != x**2
assert refine(Abs(x**2), Q.real(x)) == x**2 | |
11,058 | [
0.03535008803009987,
0.0028541283681988716,
0.03752465918660164,
0.03951359912753105,
0.025498205795884132,
0.039354484528303146,
-0.056114617735147476,
-0.004819863475859165,
0.03031143918633461,
0.04444617033004761,
0.0458516888320446,
-0.04542738199234009,
-0.030390998348593712,
0.04595... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",... | def test_pow():
assert refine((-1)**x, Q.even(x)) == 1
assert refine((-1)**x, Q.odd(x)) == -1
assert refine((-2)**x, Q.even(x)) == 2**x
# nested powers
assert refine(sqrt(x**2)) != Abs(x)
assert refine(sqrt(x**2), Q.complex(x)) != Abs(x)
assert refine(sqrt(x**2), Q.real(x)) == Abs(x)
as... | |
11,059 | [
-0.008056683465838432,
-0.013344113714993,
0.007362524047493935,
-0.009253001771867275,
-0.0037643397226929665,
0.020381711423397064,
-0.008854229003190994,
0.0007412370759993792,
-0.019155854359269142,
0.04681885987520218,
0.04049757495522499,
-0.019658014178276062,
-0.005165582522749901,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",... | def test_Piecewise():
assert refine(Piecewise((1, x < 0), (3, True)), Q.is_true(x < 0)) == 1
assert refine(Piecewise((1, x < 0), (3, True)), ~Q.is_true(x < 0)) == 3
assert refine(Piecewise((1, x < 0), (3, True)), Q.is_true(y < 0)) == \
Piecewise((1, x < 0), (3, True))
assert refine(Piecewise((1,... | |
11,060 | [
0.015741458162665367,
0.03053136169910431,
-0.006083162967115641,
0.012349840253591537,
0.029906053096055984,
0.03167323023080826,
0.006096756551414728,
0.004159660078585148,
-0.04398908466100693,
0.07454763352870941,
0.036730069667100906,
-0.050840288400650024,
-0.009637905284762383,
0.04... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "UnaryOp",... | def test_Relational():
assert not refine(x < 0, ~Q.is_true(x < 0))
assert refine(x < 0, Q.is_true(x < 0))
assert refine(x < 0, Q.is_true(0 > x)) == True
assert refine(x < 0, Q.is_true(y < 0)) == (x < 0)
assert not refine(x <= 0, ~Q.is_true(x <= 0))
assert refine(x <= 0, Q.is_true(x <= 0))
a... | |
11,061 | [
-0.036899346858263016,
0.009129077196121216,
-0.000097505166195333,
0.002009354531764984,
0.035928983241319656,
-0.012097623199224472,
-0.039478469640016556,
-0.008484295569360256,
0.01971369981765747,
0.04341099411249161,
0.006677632685750723,
-0.031051630154252052,
-0.02180764079093933,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",... | def test_atan2():
assert refine(atan2(y, x), Q.real(y) & Q.positive(x)) == atan(y/x)
assert refine(atan2(y, x), Q.negative(y) & Q.positive(x)) == atan(y/x)
assert refine(atan2(y, x), Q.negative(y) & Q.negative(x)) == atan(y/x) - pi
assert refine(atan2(y, x), Q.positive(y) & Q.negative(x)) == atan(y/x) +... | |
11,062 | [
0.03525573015213013,
0.025053108111023903,
-0.05464071407914162,
-0.041286613792181015,
0.04978879913687706,
0.0284766536206007,
-0.03777237609028816,
0.029995711520314217,
0.03378202021121979,
0.05332570895552635,
0.035301074385643005,
-0.005461237393319607,
0.030993301421403885,
0.047385... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fie... | def test_func_args():
class MyClass(Expr):
# A class with nontrivial .func
def __init__(self, *args):
self.my_member = ""
@property
def func(self):
def my_func(*args):
obj = MyClass(*args)
obj.my_member = self.my_member
... | |
11,063 | [
0.04138467088341713,
0.041561421006917953,
0.06893236935138702,
-0.058175891637802124,
-0.04062717407941818,
0.03646093234419823,
0.014619722031056881,
-0.013155224733054638,
-0.04598016291856766,
0.027042698115110397,
0.03067869134247303,
0.0015102627221494913,
-0.029062695801258087,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "suite", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dirname", "annotation": null, "type_comment": null}}], "kwarg": ... | def sign_release_dir(suite, dirname):
cnf = Config()
if 'Dinstall::SigningKeyring' in cnf or 'Dinstall::SigningHomedir' in cnf:
args = {
'keyids': suite.signingkeys or [],
'pubring': cnf.get('Dinstall::SigningPubKeyring') or None,
'secring': cnf.get('Dinstall::Signin... | |
11,064 | [
-0.0013738196576014161,
0.034784357994794846,
0.05569351837038994,
-0.043046850711107254,
-0.035121604800224304,
0.00345976697281003,
0.0020234668627381325,
0.03661511465907097,
-0.009232067503035069,
0.0040318784303963184,
0.07197760790586472,
-0.00704600103199482,
0.026738669723272324,
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": "session", "annotation": null, "type_comment": null}}, {"_type": "... | def _update_hashfile_table(self, session, fileinfo, hashes):
# Mark all by-hash files as obsolete. We will undo that for the ones
# we still reference later.
query = """
UPDATE hashfile SET unreferenced = CURRENT_TIMESTAMP
WHERE suite_id = :id AND unreferenced IS NULL"""... | |
11,065 | [
-0.023501746356487274,
0.0375230498611927,
0.04301638901233673,
-0.01912700943648815,
-0.019470343366265297,
-0.05480048805475235,
0.03395681083202362,
-0.008422750979661942,
-0.015117757953703403,
0.03267207741737366,
0.036902837455272675,
0.04179811105132103,
0.04447832703590393,
-0.0399... | 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": "fileinfo", "annotation": null, "type_comment": null}}, {"_type": ... | def _make_byhash_links(self, fileinfo, hashes):
# Create hardlinks in by-hash directories
for filename in fileinfo:
if not os.path.lexists(filename):
# probably an uncompressed index we didn't generate
continue
for h in hashes:
fie... | |
11,066 | [
-0.01933637447655201,
0.0567057840526104,
0.04820205271244049,
-0.013866636902093887,
-0.020917469635605812,
-0.057133108377456665,
0.04053160175681114,
-0.011975731700658798,
-0.019005198031663895,
0.012135977856814861,
0.02135547623038292,
0.007114931009709835,
0.025147968903183937,
-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": "fileinfo", "annotation": null, "type_comment": null}}, {"_type": ... | def _make_byhash_base_symlink(self, fileinfo, hashes):
# Create symlinks to files in by-hash directories
for filename in fileinfo:
if not os.path.lexists(filename):
# probably an uncompressed index we didn't generate
continue
besthash = hashes[-1]... | |
11,067 | [
0.00689344247803092,
0.03210240602493286,
0.000044172629714012146,
0.02664928510785103,
-0.060935620218515396,
-0.007650448475033045,
0.029127975925803185,
0.0321292020380497,
0.006675719749182463,
0.04274068400263786,
0.027841737493872643,
-0.02886001020669937,
0.005784730426967144,
0.015... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Expr", "_fields": {"value... | def showAbout():
if mc.window('appleseedAboutDialog', query=True, exists=True):
mc.deleteUI('appleseedAboutDialog')
window = mc.window('appleseedAboutDialog', title='About appleseed-maya')
mc.columnLayout(rs=20, columnOffset=['both', 22], width=200)
# Add some empty space. Is there a better w... | |
11,068 | [
0.04043096303939819,
0.006125165615230799,
0.07162374258041382,
-0.0708446204662323,
-0.055707354098558426,
0.006267772987484932,
0.008980793878436089,
-0.00317388609983027,
-0.011972072534263134,
0.03503274545073509,
0.03670229762792587,
-0.037537071853876114,
-0.031387560069561005,
-0.01... | 13 | {"_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": ["Logger"]}}, {"_type": "Assign"... | def main():
global Logger
cnf = Config()
for i in ["Help", "Suite", "Force", "Quiet"]:
key = "Generate-Releases::Options::%s" % i
if key not in cnf:
cnf[key] = ""
Arguments = [('h', "help", "Generate-Releases::Options::Help"),
('a', 'archive', 'Generate-Re... | |
11,069 | [
-0.0004650044138543308,
0.024830039590597153,
0.01998920366168022,
-0.03231481462717056,
-0.028483018279075623,
-0.02233937196433544,
0.0167704951018095,
0.020078612491488457,
0.028329746797680855,
0.015288866125047207,
0.055228956043720245,
-0.02162410318851471,
-0.000223122289753519,
-0.... | 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 createMenu():
logger.debug("creating appleseed menu.")
global __g_appleseedMenu
deleteMenu()
gMainWindow = mel.eval('$temp1=$gMainWindow')
__g_appleseedMenu = mc.menu(
'appleseedMenu', parent=gMainWindow, label='appleseed', tearOff=True)
mc.menuItem(
'appleseedLightMenu',
... | |
11,070 | [
0.05979546159505844,
0.05381591618061066,
-0.0036492818035185337,
0.011552395299077034,
-0.0316564217209816,
-0.016685571521520615,
0.04447287321090698,
-0.020213942974805832,
0.03007359988987446,
-0.012453723698854446,
0.04928728938102722,
-0.007782203610986471,
0.014388282783329487,
0.04... | 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": "obj", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __array_finalize__(self, obj):
if hasattr(obj, '_mmap') and np.may_share_memory(self, obj):
self._mmap = obj._mmap
self.filename = obj.filename
self.offset = obj.offset
self.mode = obj.mode
else:
self._mmap = None
self.filename ... | |
11,071 | [
-0.0044111874885857105,
-0.031373120844364166,
0.006158817559480667,
0.02714090794324875,
-0.004753343760967255,
-0.028383200988173485,
0.023771982640028,
-0.04623850807547569,
0.014907496981322765,
0.045733168721199036,
-0.033331308513879776,
-0.009880428202450275,
0.030825670808553696,
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": "arr", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def __array_wrap__(self, arr, context=None):
arr = super(memmap, self).__array_wrap__(arr, context)
# Return a memmap if a memmap was given as the output of the
# ufunc. Leave the arr class unchanged if self is not a memmap
# to keep original memmap subclasses behavior
if self i... | |
11,072 | [
0.025646518915891647,
0.02267395332455635,
0.00693237129598856,
0.04324324429035187,
-0.03692925348877907,
0.016414206475019455,
0.02597198262810707,
-0.0146892499178648,
-0.00034088906249962747,
0.021534832194447517,
0.0049389079213142395,
0.0230645090341568,
0.0417461097240448,
-0.012411... | 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": "mainwindow", "annotation": null, "type_comment": null}}, {"_type"... | def __init__(self, mainwindow, pointer_hint = True):
gtk.EventBox.__init__(self)
global CANVAS
assert CANVAS == None, "Only one PygameCanvas can be created, ever."
CANVAS = self
# Initialize Events translator before widget gets "realized".
self.translator = event.Transl... | |
11,073 | [
0.07186611741781235,
0.029947740957140923,
0.03367006033658981,
0.010035454295575619,
-0.001981446985155344,
0.03485443443059921,
0.030328433960676193,
-0.005477729719132185,
0.012858917005360126,
0.03231649100780487,
-0.007476360537111759,
-0.030307283625006676,
0.03986687213182449,
0.033... | 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": "main_fn", "annotation": null, "type_comment": null}}], "kwarg": n... | def _run_pygame_cb(self, main_fn):
assert pygame.display.get_surface() is None, "PygameCanvas.run_pygame can only be called once."
# Preinitialize Pygame with the X window ID.
assert pygame.display.get_init() == False, "Pygame must not be initialized before calling PygameCanvas.run_pyga... | |
11,074 | [
0.02580881491303444,
0.03570476546883583,
0.08115120232105255,
-0.012066888622939587,
0.014237826690077782,
0.0031654920894652605,
-0.015306765213608742,
-0.007620322983711958,
-0.04778267443180084,
0.013356227427721024,
-0.046063557267189026,
0.008391722105443478,
0.0035374166909605265,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "dependencies", "ctx": {"_type": "Store", "_fields": {}}}}], "... | class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('choice_text', models... | |
11,075 | [
-0.007896499708294868,
0.022258320823311806,
-0.03172611445188522,
-0.03953253850340843,
-0.0066304574720561504,
0.0014849723083898425,
0.041874468326568604,
-0.01386140938848257,
-0.056766726076602936,
-0.03492875024676323,
0.021837975829839706,
-0.014612027443945408,
-0.004969090223312378,... | 10 | {"_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}}, {"_type": "arg", "_fields": {"arg": "store", "annotation": ... | class VariableTableSetter(object):
def __init__(self, store):
self._store = store
def set(self, variables, overwrite=False):
for name, value in VariableTableReader().read(variables):
self._store.add(name, value, overwrite, decorated=False) | |
11,076 | [
0.007709495257586241,
0.03573666512966156,
-0.027859926223754883,
-0.02991003543138504,
-0.0033934726379811764,
0.014037863351404667,
-0.022486478090286255,
-0.012591996230185032,
-0.012386985123157501,
-0.025140831246972084,
-0.0046666995622217655,
-0.0484689325094223,
0.0021377799566835165... | 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}}, {"_type": "arg", "_fields": {"arg": "variables", "annotatio... | class VariableTableReader(object):
def read(self, variables):
for var in variables:
if not var:
continue
try:
yield self._get_name_and_value(var.name, var.value,
var.report_invalid_syntax)
exc... | |
11,077 | [
0.03312359005212784,
0.019683197140693665,
-0.02221704088151455,
-0.029475832358002663,
0.011947015300393105,
0.005737872328609228,
-0.039660174399614334,
-0.029940981417894363,
-0.013611762784421444,
-0.0002258808963233605,
0.02864345721900463,
-0.04245107248425484,
-0.025313962250947952,
... | 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": "variables", "annotation": null, "type_comment": null}}], "kwarg":... | def read(self, variables):
for var in variables:
if not var:
continue
try:
yield self._get_name_and_value(var.name, var.value,
var.report_invalid_syntax)
except DataError as err:
va... | |
11,078 | [
-0.005757784470915794,
0.020377732813358307,
0.06334611773490906,
-0.02747795172035694,
-0.017955059185624123,
-0.007897289469838142,
-0.03842718154191971,
-0.020975535735487938,
-0.01601482182741165,
-0.0020320049952715635,
0.001691152574494481,
-0.033309150487184525,
-0.0045726667158305645... | 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}}, {"_type": "arg", "_fields": {"arg": "values", "annotation":... | class VariableTableValueBase(object):
def __init__(self, values, error_reporter=None):
self._values = self._format_values(values)
self._error_reporter = error_reporter
self._resolving = False
def _format_values(self, values):
return values
def resolve(self, variables):
... | |
11,079 | [
-0.0007279341807588935,
-0.016176901757717133,
0.012333303689956665,
-0.025490235537290573,
-0.018880091607570648,
-0.008985994383692741,
-0.002943414729088545,
-0.031171157956123352,
-0.009952173568308353,
0.020305601879954338,
-0.00572315976023674,
-0.039808694273233414,
-0.026060439646244... | 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}}, {"_type": "arg", "_fields": {"arg": "values", "annotation":... | class ScalarVariableTableValue(VariableTableValueBase):
def _format_values(self, values):
separator = None
if is_string(values):
values = [values]
elif values and values[0].startswith('SEPARATOR='):
separator = values.pop(0)[10:]
return separator, values
... | |
11,080 | [
0.035920243710279465,
-0.03185950592160225,
0.004984123166650534,
-0.03317708894610405,
-0.026437992230057716,
-0.021437669172883034,
0.011145427823066711,
-0.001491726958192885,
0.025250010192394257,
0.05309198051691055,
-0.0007168389274738729,
-0.0293971449136734,
-0.019407300278544426,
... | 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": "values", "annotation": null, "type_comment": null}}, {"_type": "a... | def _replace_variables(self, values, variables):
separator, values = values
if (separator is None and len(values) == 1 and
not VariableSplitter(values[0]).is_list_variable()):
return variables.replace_scalar(values[0])
if separator is None:
separator = ' '... | |
11,081 | [
0.008570811711251736,
0.0006164025980979204,
-0.004220324102789164,
-0.016300562769174576,
-0.0076346308924257755,
0.002673372393473983,
-0.00026126709417439997,
-0.0015344356652349234,
-0.015069009736180305,
0.015139097347855568,
0.016030222177505493,
-0.03356233984231949,
-0.02465109713375... | 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}}, {"_type": "arg", "_fields": {"arg": "values", "annotation":... | class DictVariableTableValue(VariableTableValueBase):
def _format_values(self, values):
return list(self._yield_formatted(values))
def _yield_formatted(self, values):
for item in values:
if VariableSplitter(item).is_dict_variable():
yield item
else:
... | |
11,082 | [
0.04212578386068344,
0.008030098862946033,
-0.022156264632940292,
-0.015193751081824303,
-0.0036024560686200857,
-0.01426541619002819,
0.025910863652825356,
0.011635133065283298,
0.020031409338116646,
0.01841197907924652,
0.03290432319045067,
-0.01830883137881756,
-0.021991226822137833,
-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": "values", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _yield_formatted(self, values):
for item in values:
if VariableSplitter(item).is_dict_variable():
yield item
else:
name, value = split_from_equals(item)
if value is None:
raise DataError("Dictionary item '%s' does no... | |
11,083 | [
0.06887614727020264,
0.003802715102210641,
-0.02089357003569603,
-0.02088288776576519,
-0.003233910072594881,
-0.025935372337698936,
0.008892585523426533,
-0.004456974565982819,
-0.004064418841153383,
0.02864854410290718,
0.012828822247684002,
-0.0287339985370636,
-0.016204265877604485,
-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": "values", "annotation": null, "type_comment": null}}, {"_type": "a... | def _yield_replaced(self, values, replace_scalar):
for item in values:
if isinstance(item, tuple):
key, values = item
yield replace_scalar(key), replace_scalar(values)
else:
for key, values in replace_scalar(item).items():
... | |
11,084 | [
-0.003083352465182543,
0.03741443529725075,
-0.0026506013236939907,
-0.038774508982896805,
-0.00846956018358469,
0.016123075038194656,
-0.007616421673446894,
-0.006645822431892157,
-0.030762430280447006,
-0.002418770221993327,
0.010219111107289791,
-0.012401414103806019,
0.018051909282803535... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "manager", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg"... | def do_cli(manager, options):
action = options.archive_action
if action == 'tag-source':
tag_source(options.source, tag_names=options.tags)
elif action == 'consolidate':
consolidate()
elif action == 'search':
cli_search(options)
elif action == 'inject':
cli_inject(ma... | |
11,085 | [
0.0007013655849732459,
0.016675256192684174,
0.019152101129293442,
-0.053404271602630615,
0.00332147185690701,
0.023399675264954567,
-0.00852773617953062,
0.008875364437699318,
-0.013361930847167969,
0.05940084531903267,
-0.02707148902118206,
-0.04797259345650673,
0.026245875284075737,
0.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 cli_search(options):
search_term = ' '.join(options.keywords)
tags = options.tags
sources = options.sources
query = re.sub(r'[ \(\)]+', ' ', search_term).strip()
table_data = []
with Session() as session:
for archived_entry in search(session, query, tags=tags, sources=sources):
... | |
11,086 | [
0.01844809204339981,
0.029502257704734802,
-0.0028584138490259647,
-0.06879779696464539,
0.011715211905539036,
-0.013269894756376743,
-0.007846865803003311,
0.012272204272449017,
-0.033076804131269455,
0.020639339461922646,
0.02008846588432789,
-0.010540017858147621,
0.030897799879312515,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "manager", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg"... | def cli_inject(manager, options):
log.debug('Finding inject content')
inject_entries = defaultdict(list)
with Session() as session:
for id in options.ids:
archive_entry = session.query(ArchiveEntry).get(id)
# not found
if not archive_entry:
log.cr... | |
11,087 | [
0.029219873249530792,
0.02563808299601078,
0.06134827062487602,
-0.007506949361413717,
0.013647162355482578,
0.05068368837237358,
-0.006052688229829073,
-0.012038049288094044,
-0.005722786299884319,
0.0007368087535724044,
0.06883502006530762,
-0.002144361613318324,
0.04271218553185463,
0.0... | 10 | {"_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 TestMemmap(TestCase):
def setUp(self):
self.tmpfp = NamedTemporaryFile(prefix='mmap')
self.tempdir = mkdtemp()
self.shape = (3, 4)
self.dtype = 'float32'
self.data = arange(12, dtype=self.dtype)
self.data.resize(self.shape)
def tearDown(self):
self.... | |
11,088 | [
0.007038326933979988,
0.03211308270692825,
0.017956316471099854,
-0.05813772603869438,
-0.03710285574197769,
0.07040616124868393,
-0.02584153227508068,
0.0026293587870895863,
-0.0003603208460845053,
0.04296240583062172,
0.02065720409154892,
-0.03309730440378189,
0.06230349838733673,
0.0301... | 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 register_parser_arguments():
archive_parser = options.register_command('archive', do_cli, help='Search and manipulate the archive database')
archive_parser.add_subparsers(title='Actions', metavar='<action>', dest='archive_action')
# Default usage shows the positional arguments after the optional ones, o... | |
11,089 | [
0.03288283199071884,
0.016179649159312248,
0.07100098580121994,
-0.028619781136512756,
0.0016609694575890899,
0.0467689111828804,
0.006699970457702875,
0.019021684303879738,
-0.009355028159916401,
-0.019682331010699272,
0.0676104947924614,
0.02208808809518814,
0.038043368607759476,
-0.0195... | 8 | {"_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 test_attributes(self):
offset = 1
mode = "w+"
fp = memmap(self.tmpfp, dtype=self.dtype, mode=mode,
shape=self.shape, offset=offset)
self.assertEqual(offset, fp.offset)
self.assertEqual(mode, fp.mode)
del fp | |
11,090 | [
0.044854771345853806,
0.013468788005411625,
0.026146749034523964,
-0.013555285520851612,
0.004704808350652456,
0.02507171779870987,
0.021451208740472794,
0.014173119328916073,
-0.009885349310934544,
0.04233400896191597,
0.06450190395116806,
-0.002029585884884,
0.01975834183394909,
0.013221... | 8 | {"_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 test_roundtrip(self):
# Write data to file
fp = memmap(self.tmpfp, dtype=self.dtype, mode='w+',
shape=self.shape)
fp[:] = self.data[:]
del fp # Test __del__ machinery, which handles cleanup
# Read data back from file
newfp = memmap(self.tmpfp, dty... | |
11,091 | [
0.05466926470398903,
0.030748436227440834,
0.03726129233837128,
-0.026632502675056458,
-0.01486577931791544,
0.040723517537117004,
0.008110808208584785,
0.020034905523061752,
0.015047364868223667,
-0.04784166067838669,
0.10081613063812256,
0.03321799635887146,
0.021318107843399048,
0.02510... | 8 | {"_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 test_del(self):
# Make sure a view does not delete the underlying mmap
fp_base = memmap(self.tmpfp, dtype=self.dtype, mode='w+',
shape=self.shape)
fp_base[0] = 5
fp_view = fp_base[0:1]
assert_equal(fp_view[0], 5)
del fp_view
# Should still ... | |
11,092 | [
0.0638672262430191,
0.03526190295815468,
0.06503662467002869,
-0.04146871715784073,
0.009928654879331589,
0.02129657007753849,
0.017597218975424767,
-0.014268927276134491,
0.001689445460215211,
-0.01894652657210827,
0.06247293949127197,
0.01898025907576084,
0.02464735135436058,
-0.02133030... | 8 | {"_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 test_filename(self):
tmpname = mktemp('', 'mmap', dir=self.tempdir)
fp = memmap(tmpname, dtype=self.dtype, mode='w+',
shape=self.shape)
abspath = os.path.abspath(tmpname)
fp[:] = self.data[:]
self.assertEqual(abspath, fp.filename)
b = fp[:1]
... | |
11,093 | [
-0.025686124339699745,
-0.02507075108587742,
0.04125278443098068,
0.01707090251147747,
-0.0061708237044513226,
0.020455453544855118,
0.008068223483860493,
-0.030039319768548012,
-0.00041167312883771956,
0.0018105071503669024,
0.03621584177017212,
-0.0035383948124945164,
0.056158483028411865,... | 8 | {"_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 test_view(self):
fp = memmap(self.tmpfp, dtype=self.dtype, shape=self.shape)
new1 = fp.view()
new2 = new1.view()
assert(new1.base is fp)
assert(new2.base is fp)
new_array = asarray(fp)
assert(new_array.base is fp) | |
11,094 | [
0.004483172204345465,
-0.04660337045788765,
-0.0007030292763374746,
-0.009855171665549278,
-0.00542304664850235,
-0.029115095734596252,
-0.031949732452631,
-0.06020002439618111,
-0.008035478182137012,
0.013380452059209347,
-0.018857549875974655,
-0.03322291746735573,
0.005894485395401716,
... | 8 | {"_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 __str__(self):
vendor = 'VENDOR = 0x%x' % self._vendor_id
vendor_string = self._vendor_string
if not vendor_string and self._vendor_id in self._VENDOR_ID_MAP:
vendor_string = self._VENDOR_ID_MAP[self._vendor_id]
if vendor_string:
vendor += ' (%s)' % vendor_string
device = 'DEVICE = 0... | |
11,095 | [
0.0032505979761481285,
0.006392369512468576,
0.029108701273798943,
-0.015387109480798244,
-0.015642615035176277,
-0.03455948457121849,
0.03804193064570427,
0.018320690840482712,
-0.05113895609974861,
-0.00014926667790859938,
-0.005129036493599415,
-0.05159318819642067,
0.0377391092479229,
... | 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}}, {"_type": "arg", "_fields": {"arg": "source_root", "annotat... | class Workspace(object):
def __init__(self, source_root, build_root):
self.source_root = source_root
self.build_root = build_root
def source_dir(self, path):
return os.path.join(self.source_root, path)
def build_dir(self, deployment_target, product):
return os.path.join(sel... | |
11,096 | [
0.008466274477541447,
-0.00406895624473691,
0.018213162198662758,
-0.04242440685629845,
-0.0538514144718647,
-0.008964290842413902,
0.02018333598971367,
-0.06540977209806442,
-0.020610205829143524,
0.023707756772637367,
-0.013035982847213745,
0.0038007935509085655,
0.023598304018378258,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def compute_build_subdir(args):
# Create a name for the build directory.
build_subdir = args.cmake_generator.replace(" ", "_")
cmark_build_dir_label = args.cmark_build_variant
if args.cmark_assertions:
cmark_build_dir_label += "Assert"
llvm_build_dir_label = args.llvm_build_variant
if ... | |
11,097 | [
-0.02353360690176487,
0.04334690421819687,
-0.003978072665631771,
-0.04185878112912178,
0.018070068210363388,
-0.0003238661156501621,
0.06335153430700302,
0.019016088917851448,
-0.016794534400105476,
0.05918478965759277,
0.035651180893182755,
-0.002939043566584587,
0.0105391014367342,
0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Try", "_fields": {"body": [{"_type": "Return", "_fields": {"va... | def get_infer_version():
try:
return subprocess.check_output([
utils.get_cmd_in_bin_dir(INFER_ANALYZE_BINARY), '-version'])
except:
print("Failed to run {0} binary, exiting".
format(INFER_ANALYZE_BINARY))
sys.exit(os.EX_UNAVAILABLE) | |
11,098 | [
-0.004203285090625286,
0.01661655679345131,
-0.018261656165122986,
-0.040413614362478256,
0.012860759161412716,
0.0073615689761936665,
-0.014050612226128578,
-0.06332087516784668,
-0.025100724771618843,
0.034598857164382935,
0.026590628549456596,
-0.029073799028992653,
-0.01906868815422058,
... | 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}}, {"_type": "arg", "_fields": {"arg": "parser", "annotation":... | class VersionAction(argparse._VersionAction):
def __call__(self, parser, namespace, values, option_string=None):
# set self.version so that argparse version action knows it
self.version = get_infer_version()
super(VersionAction, self).__call__(parser,
... | |
11,099 | [
0.011966705322265625,
0.02789512276649475,
0.03586515784263611,
-0.033418215811252594,
-0.000057623266911832616,
0.002130877459421754,
0.0586799681186676,
-0.00390636594966054,
-0.01996004395186901,
0.0568622387945652,
0.05373947694897652,
-0.010766538791358471,
0.031134406104683876,
-0.02... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "infer_out", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs... | def clean_infer_out(infer_out):
directories = ['multicore', 'classnames', 'sources', 'filelists']
extensions = ['.cfg', '.cg']
for root, dirs, files in os.walk(infer_out):
for d in dirs:
if d in directories:
path = os.path.join(root, d)
shutil.rmtree(pat... | |
11,100 | [
0.015257153660058975,
-0.012490312568843365,
0.040362004190683365,
-0.013619635254144669,
-0.039865102618932724,
0.014873184263706207,
-0.014161710627377033,
-0.01853219047188759,
0.02902360074222088,
0.037245072424411774,
0.025387180969119072,
0.0013149555306881666,
0.02714892476797104,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_javac_args(args):
javac_args = args[detect_javac(args) + 1:]
if len(javac_args) == 0:
return None
else:
# replace any -g:.* flag with -g to preserve debugging symbols
args = map(lambda arg: '-g' if '-g:' in arg else arg, javac_args)
# skip -Werror
args = filte... |