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 |
|---|---|---|---|---|---|
20,501 | [
0.09311733394861221,
0.002027487149462104,
-0.018163343891501427,
-0.016503535211086273,
-0.025863591581583023,
-0.008257020264863968,
0.023006200790405273,
-0.014927768148481846,
0.023678528144955635,
-0.02977149561047554,
-0.026031674817204475,
-0.004133762791752815,
0.007579440250992775,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_create_body(payload: Dict[str, Any]) -> str:
action = get_action_with_primary_id(payload)
if action.get("epic_id") is None:
message = "New story [{name}]({app_url}) of type **{story_type}** was created."
kwargs = action
else:
message = "New story [{name}]({app_url}) wa... | |
20,502 | [
0.05311771482229233,
0.005585710983723402,
-0.05511370301246643,
0.02816786803305149,
-0.022546514868736267,
0.0223632100969553,
0.045378170907497406,
0.015000459738075733,
0.05767997354269028,
-0.027821626514196396,
-0.01301465556025505,
-0.008462580852210522,
0.005565343424677849,
-0.045... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_comment_added_body(payload: Dict[str, Any], entity: str) -> str:
actions = payload["actions"]
kwargs = {"entity": entity}
for action in actions:
if action["id"] == payload["primary_id"]:
kwargs["text"] = action["text"]
elif action["entity_type"] == entity:
nam... | |
20,503 | [
0.049854230135679245,
-0.006161758676171303,
-0.028525063768029213,
0.01845295913517475,
-0.020370429381728172,
0.03699209541082382,
0.04177499935030937,
-0.02249257266521454,
0.04420953989028931,
0.0012401615967974067,
0.010174442082643509,
-0.020208844915032387,
-0.012463557533919811,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_epic_update_state_body(payload: Dict[str, Any]) -> str:
action = get_action_with_primary_id(payload)
state = action["changes"]["state"]
kwargs = {
"entity": "epic",
"new": state["new"],
"old": state["old"],
"name_template": EPIC_NAME_TEMPLATE.format(name=action["name"... | |
20,504 | [
0.03920268267393112,
0.01655830629169941,
-0.03689417243003845,
0.03110191412270069,
-0.008882513269782066,
0.009753450751304626,
0.05242414399981499,
0.017544670030474663,
0.04465916007757187,
-0.0005181028973311186,
-0.04083962365984917,
-0.02675771899521351,
-0.02300114557147026,
-0.055... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_update_description_body(payload: Dict[str, Any], entity: str) -> str:
action = get_action_with_primary_id(payload)
desc = action["changes"]["description"]
kwargs = {
"entity": entity,
"new": desc["new"],
"old": desc["old"],
"name_template": get_name_template(entity).... | |
20,505 | [
0.055677566677331924,
-0.00532269012182951,
-0.017038419842720032,
0.023034315556287766,
-0.0318295881152153,
0.022608114406466484,
0.048509612679481506,
0.005773108918219805,
0.031015928834676743,
-0.02888491563498974,
-0.021833200007677078,
-0.0011248360387980938,
-0.02710261382162571,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_update_name_body(payload: Dict[str, Any], entity: str) -> str:
action = get_action_with_primary_id(payload)
name = action["changes"]["name"]
kwargs = {
"entity": entity,
"new": name["new"],
"old": name["old"],
"name_template": get_name_template(entity).format(
... | |
20,506 | [
0.07533460110425949,
0.015264715999364853,
-0.04454717040061951,
0.02640150859951973,
-0.0369793139398098,
0.016307447105646133,
0.03313088417053223,
-0.01440473273396492,
0.01660844124853611,
0.0030395060312002897,
-0.01602795161306858,
0.002750605111941695,
-0.027067996561527252,
-0.0011... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_update_state_body(payload: Dict[str, Any]) -> str:
action = get_action_with_primary_id(payload)
workflow_state_id = action["changes"]["workflow_state_id"]
references = payload["references"]
state = {}
for ref in references:
if ref["id"] == workflow_state_id["new"]:
... | |
20,507 | [
0.06595143675804138,
0.0043849041685462,
-0.021880697458982468,
-0.018859470263123512,
-0.010249488055706024,
-0.022334396839141846,
0.03217143192887306,
0.010971282608807087,
0.03796641528606415,
-0.03279011324048042,
-0.033408794552087784,
0.0010350024094805121,
0.005104121286422014,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_task_body(payload: Dict[str, Any], action: str) -> str:
primary_action = get_action_with_primary_id(payload)
kwargs = {
"task_description": primary_action["description"],
"action": action,
}
for a in payload["actions"]:
if a["entity_type"] == "story":
... | |
20,508 | [
0.06371758878231049,
0.0020046739373356104,
-0.014903435483574867,
-0.019482461735606194,
-0.007397719658911228,
0.04479670152068138,
0.02671818807721138,
-0.04527188464999199,
0.014817038550972939,
-0.015346218831837177,
-0.044148728251457214,
-0.010205613449215889,
-0.006873939651995897,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_update_archived_body(payload: Dict[str, Any]) -> str:
primary_action = get_action_with_primary_id(payload)
archived = primary_action["changes"]["archived"]
if archived["new"]:
action = "archived"
else:
action = "unarchived"
kwargs = {
"name_template": STORY_NAM... | |
20,509 | [
0.08452480286359787,
-0.009178310632705688,
-0.03609173744916916,
-0.02463827095925808,
-0.030054250732064247,
0.03371669724583626,
0.024904631078243256,
-0.014805158600211143,
0.031852178275585175,
-0.027634816244244576,
-0.019055815413594246,
-0.022818146273493767,
-0.005959798116236925,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_update_epic_body(payload: Dict[str, Any]) -> str:
action = get_action_with_primary_id(payload)
kwargs = {
"story_name_template": STORY_NAME_TEMPLATE.format(
name=action["name"],
app_url=action["app_url"]
),
}
new_id = action["changes"]["epic_id"].g... | |
20,510 | [
0.08546972274780273,
0.032828330993652344,
-0.037387821823358536,
-0.01168887596577406,
-0.037325646728277206,
0.007217466365545988,
0.045885056257247925,
0.023357026278972626,
0.05666203424334526,
-0.02555387280881405,
-0.01274584885686636,
0.034817926585674286,
-0.006233030930161476,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_task_completed_body(payload: Dict[str, Any]) -> Optional[str]:
action = get_action_with_primary_id(payload)
kwargs = {
"task_description": action["description"],
}
story_id = action["story_id"]
for ref in payload["references"]:
if ref["id"] == story_id:
kw... | |
20,511 | [
0.08879844099283218,
0.03449966385960579,
-0.02335026115179062,
-0.007856162264943123,
-0.03348788619041443,
-0.004550523590296507,
0.0551915243268013,
0.00604587234556675,
0.006070671137422323,
-0.02555236779153347,
-0.03190078213810921,
0.006353374104946852,
-0.00815870426595211,
-0.0221... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_update_attachment_body(payload: Dict[str, Any]) -> Optional[str]:
action = get_action_with_primary_id(payload)
kwargs = {
"name_template": STORY_NAME_TEMPLATE.format(
name=action["name"],
app_url=action["app_url"]
)
}
file_ids_added = action["change... | |
20,512 | [
0.0897839143872261,
0.014459335245192051,
0.012023847550153732,
-0.0027975193224847317,
-0.04835868626832962,
0.005551155656576157,
0.016126874834299088,
-0.0014261862961575389,
0.006335558369755745,
-0.018200330436229706,
-0.027404718101024628,
-0.003118411172181368,
-0.04203958436846733,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_update_estimate_body(payload: Dict[str, Any]) -> str:
action = get_action_with_primary_id(payload)
kwargs = {
"story_name_template": STORY_NAME_TEMPLATE.format(
name=action["name"],
app_url=action["app_url"]
),
}
new = action["changes"]["estimate"]... | |
20,513 | [
0.06077828258275986,
0.007432473823428154,
-0.0326220728456974,
-0.023817941546440125,
-0.037513259798288345,
0.014886213466525078,
0.035046398639678955,
-0.009197553619742393,
0.0009882053127512336,
-0.027348101139068604,
-0.023711610585451126,
-0.0074696894735097885,
-0.012578850612044334,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_label_body(payload: Dict[str, Any]) -> Optional[str]:
action = get_action_with_primary_id(payload)
kwargs = {
"name_template": STORY_NAME_TEMPLATE.format(
name=action["name"],
app_url=action["app_url"]
)
}
label_ids_added = action["changes"]["label_... | |
20,514 | [
0.06583452969789505,
-0.012156126089394093,
-0.0056766327470541,
-0.019268643110990524,
-0.028347138315439224,
0.005671486258506775,
0.04257217422127724,
-0.017374716699123383,
0.003159975167363882,
-0.009927674196660519,
-0.046977609395980835,
-0.0019016462611034513,
-0.03236144036054611,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_update_project_body(payload: Dict[str, Any]) -> str:
action = get_action_with_primary_id(payload)
kwargs = {
"name_template": STORY_NAME_TEMPLATE.format(
name=action["name"],
app_url=action["app_url"]
)
}
new_project_id = action["changes"]["project_... | |
20,515 | [
0.0426807664334774,
-0.012140972539782524,
-0.005213311407715082,
0.010286102071404457,
-0.024675402790308,
0.01773368939757347,
0.027429604902863503,
0.023963432759046555,
0.026830051094293594,
-0.04054485261440277,
-0.028310200199484825,
-0.016918670386075974,
0.0045669167302548885,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_entity_name(payload: Dict[str, Any], entity: Optional[str]=None) -> Optional[str]:
name = get_action_with_primary_id(payload).get("name")
if name is None:
for action in payload["actions"]:
if action["entity_type"] == entity:
name = action["name"]
if name is None... | |
20,516 | [
0.05331731587648392,
0.01617264933884144,
-0.040935758501291275,
-0.0330309234559536,
-0.03256711736321449,
0.010778405703604221,
0.05565650016069412,
-0.018955474719405174,
0.008177069015800953,
-0.006069784983992577,
-0.055051539093256,
-0.01720108464360237,
-0.03042958676815033,
-0.0011... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Tuple", "_fields": {"ctx": {"_typ... | def get_story_update_type_body(payload: Dict[str, Any]) -> str:
action = get_action_with_primary_id(payload)
kwargs = {
"name_template": STORY_NAME_TEMPLATE.format(
name=action["name"],
app_url=action["app_url"]
),
"new_type": action["changes"]["story_type"]["new"... | |
20,517 | [
-0.005241097882390022,
-0.009121309965848923,
-0.022314028814435005,
0.011393201537430286,
0.03074927255511284,
0.01305775623768568,
0.021999113261699677,
0.02463090978562832,
0.07742428779602051,
0.003199768951162696,
-0.014283678494393826,
-0.027465151622891426,
0.009126933291554451,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": {"_type": "Name", "_fields": {"id": "HttpRequest", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}, {"_type": "... | def api_clubhouse_webhook(
request: HttpRequest, user_profile: UserProfile,
payload: Dict[str, Any]=REQ(argument_type='body')
) -> HttpResponse:
body_func = get_body_function_based_on_type(payload)
topic_func = get_topic_function_based_on_type(payload)
topic = topic_func(payload)
body =... | |
20,518 | [
-0.0006491237436421216,
0.0009130369871854782,
-0.004681336227804422,
-0.014467446133494377,
-0.016384676098823547,
0.03112265281379223,
-0.044178638607263565,
-0.04008541256189346,
-0.01613767072558403,
0.0407676175236702,
0.014843834564089775,
-0.02655893750488758,
0.05368245765566826,
0... | 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 FBFindViewControllerCommand(fb.FBCommand):
def name(self):
return "fvc"
def description(self):
return "Find the view controllers whose class names match classNameRegex and puts the address of first on the clipboard."
def options(self):
return [
fb.FBCommandArgumen... | |
20,519 | [
-0.004648544359952211,
-0.004419825971126556,
-0.020448649302124977,
-0.0071459002792835236,
-0.007417889777570963,
-0.013475832529366016,
0.020114844664931297,
-0.0057704998180270195,
0.0010091420263051987,
0.011405005119740963,
0.02596261352300644,
-0.03469099849462509,
0.02947374805808067... | 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": "object", "annotation": null, "type_comment": null}}], "kwarg": nu... | def findOwningViewController(self, object):
while object:
if self.isViewController(object):
description = fb.evaluateExpressionValue(object).GetObjectDescription()
print("Found the owning view controller.\n{}".format(description))
cmd = 'echo {} | tr -... | |
20,520 | [
0.005858105141669512,
0.03263533487915993,
0.028258949518203735,
-0.018530867993831635,
-0.030809758231043816,
0.022819727659225464,
0.0002313232544111088,
-0.017605574801564217,
-0.003932495601475239,
0.03518614172935486,
-0.019531184807419777,
0.005104741547256708,
0.03811207041144371,
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": "arguments", "annotation": null, "type_comment": null}}, {"_type":... | def run(self, arguments, options):
if options.classNameRegex and options.view:
print("Do not set both the --name and --view flags")
elif options.view:
self.findOwningViewController(options.view)
else:
output = vcHelpers.viewControllerRecursiveDescription(
... | |
20,521 | [
0.02860882133245468,
0.01661466248333454,
-0.03342084959149361,
0.030476177111268044,
-0.03672463074326515,
-0.0020888030994683504,
0.01742863841354847,
0.03856804221868515,
0.031002866104245186,
0.033803895115852356,
0.004716265946626663,
-0.06009049713611603,
0.048646967858076096,
-0.046... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "object", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def nextResponder(object):
command = "[((id){}) nextResponder]".format(object)
nextResponder = fb.evaluateObjectExpression(command)
try:
if int(nextResponder, 0):
return nextResponder
else:
return None
except Exception:
... | |
20,522 | [
-0.008168273605406284,
0.016008686274290085,
0.012029125355184078,
-0.02186496928334236,
-0.032876595854759216,
0.025686252862215042,
-0.04870438948273659,
-0.0479356124997139,
-0.038891155272722244,
0.037398822605609894,
0.02552797459065914,
-0.03418803960084915,
0.05182472616434097,
-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 FBFindViewCommand(fb.FBCommand):
def name(self):
return "fv"
def description(self):
return "Find the views whose class names match classNameRegex and puts the address of first on the clipboard."
def args(self):
return [
fb.FBCommandArgument(
arg="c... | |
20,523 | [
0.006310587748885155,
0.017624367028474808,
-0.00031853612745180726,
-0.04052359610795975,
-0.038803040981292725,
0.0017842267407104373,
-0.0324188768863678,
-0.03828234598040581,
0.017443256452679634,
-0.01742061786353588,
0.01748853549361229,
0.0006264602416194975,
0.05229581147432327,
-... | 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 FBTapLoggerCommand(fb.FBCommand):
def name(self):
return "taplog"
def description(self):
return "Log tapped view to the console."
def run(self, arguments, options):
parameterExpr = objc.functionPreambleExpressionForObjectParameterAtIndex(0)
breakpoint = lldb.debugger.... | |
20,524 | [
0.02011243812739849,
-0.011947526596486568,
-0.009370043873786926,
-0.03263658285140991,
-0.008655037730932236,
-0.00309355603531003,
-0.00668300362303853,
0.00710393488407135,
-0.031344957649707794,
0.020458409562706947,
-0.001416318118572235,
-0.0070289745926856995,
0.02986881695687771,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "needle", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "haystack", "annotation": null, "type_comment": null}}], "kwarg"... | def printMatchesInViewOutputStringAndCopyFirstToClipboard(needle, haystack):
first = None
for match in re.finditer(
".*<.*(" + needle + ")\\S*: (0x[0-9a-fA-F]*);.*", haystack, re.IGNORECASE
):
view = match.groups()[-1]
className = fb.evaluateExpressionValue(
"(id)[(" + vi... | |
20,525 | [
0.0023585129529237747,
0.01764080859720707,
-0.004710827488452196,
-0.0038368450477719307,
-0.0661003440618515,
-0.0001119596345233731,
-0.01535977702587843,
0.010890689678490162,
0.03818249702453613,
-0.0052438946440815926,
-0.0076426975429058075,
0.0068492949940264225,
0.053207557648420334... | 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": "arguments", "annotation": null, "type_comment": null}}, {"_type":... | def run(self, arguments, options):
parameterExpr = objc.functionPreambleExpressionForObjectParameterAtIndex(0)
breakpoint = lldb.debugger.GetSelectedTarget().BreakpointCreateByName(
"-[UIApplication sendEvent:]"
)
breakpoint.SetCondition(
"(int)["
+ pa... | |
20,526 | [
0.03080175630748272,
0.03431271016597748,
-0.0019531226716935635,
-0.003884457517415285,
-0.06040829420089722,
0.01936003752052784,
-0.021152863278985023,
0.0028215229976922274,
0.05771905556321144,
-0.006505221594125032,
0.006380719598382711,
-0.018177269026637077,
0.05109555646777153,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "frame", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bp_loc", "annotation": null, "type_comment": null}}, {"_type": "... | def taplog_callback(frame, bp_loc, internal_dict):
parameterExpr = objc.functionPreambleExpressionForObjectParameterAtIndex(0)
print(
"Gesture Recognizers:\n{}".format(
fb.describeObject(
"[[[%s allTouches] anyObject] gestureRecognizers]" % (parameterExpr)
)
... | |
20,527 | [
0.008001688867807388,
-0.03878914192318916,
0.010980095714330673,
0.0063283201307058334,
0.039932239800691605,
-0.029441136866807938,
-0.016460618004202843,
0.03269261494278908,
0.034318357706069946,
0.01822607032954693,
0.056088030338287354,
-0.03297204151749611,
-0.010078318417072296,
-0... | 11 | {"_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 first(request):
if request.method == "POST":
submission = request.POST.get("answer", "").lower()
points = 0
if 'hello' in submission:
points += 1
if 'a+' in submission:
points += 1
return render(request, "exercises/first_result.html", {
... | |
20,528 | [
-0.005139004904776812,
0.0035634359810501337,
-0.039627764374017715,
-0.0018730126321315765,
0.05762753263115883,
-0.02622217684984207,
-0.02000236138701439,
0.004379197955131531,
0.04339734837412834,
0.028130529448390007,
0.02584521844983101,
-0.032630473375320435,
0.04676641523838043,
-0... | 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 file(request):
if request.method == "POST":
if "myfile" in request.FILES and request.FILES["myfile"].name:
status = "accepted"
else:
status = "error"
return render(request, "exercises/file_result.html", {
"status": status,
})
return rende... | |
20,529 | [
-0.0034658268559724092,
-0.000633296906016767,
-0.009670235216617584,
-0.016151543706655502,
-0.006222665309906006,
-0.003051996696740389,
-0.001808985136449337,
-0.008507858961820602,
0.024768946692347527,
-0.03704996034502983,
0.04135866463184357,
-0.018257208168506622,
0.03505384176969528... | 8 | {"_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 OSTime(BaseTime):
# see pygaze._time.basetime.BaseTime
def __init__(self):
# see pygaze._time.basetime.BaseTime
# try to copy docstring (but ignore it if it fails, as we do
# not need it for actual functioning of the code)
try:
copy_docstr(BaseTime, OSTime)
except:
# we're not even going... | |
20,530 | [
-0.04634898528456688,
-0.007539195008575916,
0.0480017364025116,
-0.07008636742830276,
0.044768087565898895,
0.002923758467659354,
-0.02227625623345375,
0.01578500308096409,
0.004254645202308893,
0.02471945807337761,
0.015916744247078896,
-0.004892392549663782,
-0.009880597703158855,
-0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test", "annotation": {"_type": "Name", "_fields": {"id": "RDFTest", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg": null, "v... | def n3(test: RDFTest):
g = Graph()
try:
base = "https://w3c.github.io/N3/tests/N3Tests/" + split_uri(test.action)[1]
g.parse(test.action, publicID=base, format="n3")
if not test.syntax:
raise AssertionError("Input shouldn't have parsed!")
if test.result: # eval t... | |
20,531 | [
-0.00009402624709764495,
-0.03022238425910473,
0.015775293111801147,
-0.05145028978586197,
0.037748854607343674,
0.03208652511239052,
0.03138747066259384,
0.017429716885089874,
-0.002544261049479246,
-0.031993318349123,
-0.017161747440695763,
-0.004756472073495388,
0.030362194404006004,
-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 TestCache(TestCase):
def setUp(self):
self.cache = mock.MagicMock(
host='localhost', port=1234, db=0, password='pass')
def tearDown(self):
cache.redis_conn = None
cache.cache_prefix = None
@mock.patch.object(cache, 'logger')
def test_enable_redis_cache(self, ... | |
20,532 | [
0.03787138685584068,
-0.019955391064286232,
0.04429658502340317,
-0.06390111148357391,
0.02701652981340885,
0.06017317995429039,
0.05166472867131233,
0.010350489057600498,
0.02504291944205761,
-0.025722719728946686,
-0.012280240654945374,
0.01564634218811989,
0.025130635127425194,
-0.01777... | 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": "logger", "annotation": null, "type_comment": null}}], "kwarg": nu... | def test_enable_redis_cache(self, logger):
self.assertEqual(cache.redis_conn, None)
self.assertEqual(cache.cache_prefix, None)
cache.enable_redis_cache(None, None)
self.assertEqual(logger.warn.call_count, 1)
cache.enable_redis_cache(self.cache, None)
self.assertTrue(cach... | |
20,533 | [
-0.005267691798508167,
-0.030045801773667336,
0.04922963306307793,
-0.028279824182391167,
-0.05375343933701515,
-0.04100453481078148,
-0.031690821051597595,
-0.03304554149508476,
0.0005099107511341572,
0.016861451789736748,
-0.016728399321436882,
-0.01338997669517994,
-0.053656671196222305,
... | 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 setUp( self ):
## Make a dataset with bin centered sin waves with 3 different
## amplitudes
self.duration = 10.0
self.fs = 1024
t = arange( 0, self.duration, 1. / self.fs, dtype=double )
w1 = 2.* pi * self.f1
w2 = 2. * pi * s... | |
20,534 | [
0.008394760079681873,
-0.010042215697467327,
0.05925997719168663,
-0.050586603581905365,
0.04423905164003372,
0.010314772836863995,
0.031640853732824326,
0.03469349443912506,
0.019212249666452408,
-0.0009865054162219167,
-0.011707843281328678,
0.0394178181886673,
0.00967880617827177,
-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": "lru_init", "annotation": null, "type_comment": null}}, {"_type": ... | def test_enable_redis_lru(self, lru_init, logger):
cache.enable_redis_lru(None, None)
self.assertEqual(logger.warn.call_count, 1)
cache.enable_redis_lru(self.cache, None)
self.assertEqual(logger.info.call_count, 2)
lru_init.assert_called_once_with(
host=self.cache.ho... | |
20,535 | [
-0.018414298072457314,
-0.03783891722559929,
0.04827889800071716,
-0.028866305947303772,
-0.013891910202801228,
0.030117180198431015,
-0.015443474054336548,
-0.007920192554593086,
0.0252580177038908,
0.03305192291736603,
0.031055334955453873,
-0.033869799226522446,
-0.016056884080171585,
-... | 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_2dsprectraldecomp( self ):
# test 1d
dt = 1.0 / self.fs
f = (self.f1, self.f2, self.f3)
data = zeros( (self.data.size, 2 ) )
data[:,0] = self.data
data[:,1] = self.data
test = spectraldecomp( data, window_length = 1.0,
f=... | |
20,536 | [
-0.016642175614833832,
-0.03945959731936455,
0.04582558944821358,
-0.025440115481615067,
-0.013924112543463707,
0.024748679250478745,
-0.024915577843785286,
-0.00867872778326273,
0.02085040509700775,
0.028253549709916115,
0.027204472571611404,
-0.018442295491695404,
-0.016868680715560913,
... | 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_1dsprectraldecomp( self ):
# test 1d
dt = 1.0 / self.fs
f = (self.f1, self.f2, self.f3)
test = spectraldecomp( self.data,window_length = 1.0,
f=f, dt=dt )
self.assertAlmostEquals( test[5,0] / test[5,1],
s... | |
20,537 | [
-0.014082086272537708,
0.018917644396424294,
0.021665656939148903,
0.0022231771145015955,
-0.040264859795570374,
-0.01879970356822014,
0.009122692048549652,
-0.03488677740097046,
-0.01837511733174324,
-0.0008388512651436031,
0.04656288027763367,
0.04804892838001251,
-0.013940557837486267,
... | 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 initialize(self):
position = np.zeros((4, 2))
position[:,0] = [-.5, .5, .5, -.5]
position[:,1] = [-.5, -.5, .5, .5]
# we first add a plot with square coordinates but black
self.add_visual(PlotVisual, position=np.random.randn(4, 2)*.2, color=(1.,) * 4)
# add a new vis... | |
20,538 | [
0.005759155843406916,
0.027695849537849426,
0.014095630496740341,
-0.004314206540584564,
-0.025478294119238853,
-0.020347248762845993,
0.023614604026079178,
-0.039703674614429474,
-0.030550362542271614,
0.0017501582624390721,
0.03198941424489021,
0.03713225573301315,
-0.02196323312819004,
... | 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 PM(PaintManager):
def initialize(self):
position = np.zeros((4, 2))
position[:,0] = [-.5, .5, .5, -.5]
position[:,1] = [-.5, -.5, .5, .5]
# we first add a plot with square coordinates but black
self.add_visual(PlotVisual, position=np.random.randn(4, 2)*.2, color=(1.,) ... | |
20,539 | [
0.00033300378709100187,
0.022758513689041138,
0.0032454312313348055,
-0.04607239365577698,
-0.04075011983513832,
0.009458609856665134,
-0.04540132358670235,
-0.02065274305641651,
0.04262448474764824,
0.013189987279474735,
0.008041264489293098,
-0.021497365087270737,
0.026125431060791016,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "visit_type", "annotation": {"_type": "Name", "_fields": {"id": "str", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}, {"_type": "arg",... | def _check_visit_type_savable(visit_type: str, privileged_user: bool = False) -> None:
visit_type_tasks = get_savable_visit_types(privileged_user)
if visit_type not in visit_type_tasks:
allowed_visit_types = ", ".join(visit_type_tasks)
raise BadInputExc(
f"Visit of type {visit_type} ... | |
20,540 | [
0.000799907895270735,
0.01946272701025009,
0.013002324849367142,
0.02859288640320301,
-0.009996301494538784,
0.009435856714844704,
0.000656612275633961,
-0.011708206497132778,
0.02176564745604992,
0.05645209923386574,
-0.008365916088223457,
-0.01279852632433176,
-0.010954152792692184,
0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "origin_url", "annotation": {"_type": "Name", "_fields": {"id": "str", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg": null, ... | def _check_origin_url_valid(origin_url: str) -> None:
try:
_validate_url(origin_url)
except ValidationError:
raise BadInputExc(
f"The provided origin url ({escape(origin_url)}) is not valid!"
)
parsed_url = urlparse(origin_url)
if parsed_url.password not in (None, ""... | |
20,541 | [
0.025621000677347183,
-0.006059554405510426,
0.05392855033278465,
0.029176728799939156,
-0.007220104802399874,
0.03427327424287796,
0.004029825795441866,
0.01324508897960186,
0.022243058308959007,
0.04792332276701927,
0.007378137204796076,
-0.041285961866378784,
-0.04737020656466484,
-0.00... | 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": "module", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, module):
self.module = module
try:
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module, boto3=True)
if not region:
module.fail_json(msg="Region must be specified as a parameter, in EC2_REGION or AWS_REGION environment variables... | |
20,542 | [
-0.006761064752936363,
0.0036177625879645348,
0.030775245279073715,
-0.023507369682192802,
0.0019382797181606293,
-0.000626436376478523,
-0.006755672860890627,
-0.005990066099911928,
0.028640171512961388,
0.0723336860537529,
0.017026668414473534,
-0.045591358095407486,
0.007882516831159592,
... | 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": "cluster_name", "annotation": null, "type_comment": null}}, {"_typ... | def list_tasks(self, cluster_name, service_name, status):
response = self.ecs.list_tasks(
cluster=cluster_name,
family=service_name,
desiredStatus=status
)
if len(response['taskArns'])>0:
for c in response['taskArns']:
if c.endswith... | |
20,543 | [
0.019480695948004723,
0.03935828059911728,
0.06425211578607559,
-0.02491588704288006,
0.00000302803209706326,
-0.006763671059161425,
0.0541093684732914,
0.03404436260461807,
0.04403276741504669,
0.029171431437134743,
0.018532568588852882,
0.006234484259039164,
0.02128875069320202,
-0.04442... | 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": "cluster", "annotation": null, "type_comment": null}}, {"_type": "... | def run_task(self, cluster, task_definition, overrides, count, startedBy):
if overrides is None:
overrides = dict()
response = self.ecs.run_task(
cluster=cluster,
taskDefinition=task_definition,
overrides=overrides,
count=count,
sta... | |
20,544 | [
0.03345348313450813,
-0.004625579807907343,
0.036661628633737564,
0.00250825472176075,
-0.006940891500562429,
-0.017624618485569954,
0.04104004055261612,
0.04358234256505966,
0.037670478224754333,
0.044470131397247314,
0.018895771354436874,
0.0042296056635677814,
0.015223554335534573,
-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}}, {"_type": "arg", "_fields": {"arg": "cluster", "annotation": null, "type_comment": null}}, {"_type": "... | def start_task(self, cluster, task_definition, overrides, container_instances, startedBy):
args = dict()
if cluster:
args['cluster'] = cluster
if task_definition:
args['taskDefinition']=task_definition
if overrides:
args['overrides']=overrides
... | |
20,545 | [
0.04053453356027603,
0.04454483836889267,
0.031143315136432648,
-0.0460677407681942,
-0.01151058916002512,
0.06756601482629776,
0.0318286195397377,
0.03312308341264725,
0.05939311906695366,
0.07908929884433746,
0.038732435554265976,
-0.0605606734752655,
0.01285581849515438,
-0.018325569108... | 13 | {"_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():
argument_spec = ec2_argument_spec()
argument_spec.update(dict(
operation=dict(required=True, choices=['run', 'start', 'stop'] ),
cluster=dict(required=False, type='str' ), # R S P
task_definition=dict(required=False, type='str' ), # R* S*
overrides=dict(required=False... | |
20,546 | [
-0.014431970193982124,
0.013464193791151047,
0.022500809282064438,
-0.03164630010724068,
0.004491088911890984,
-0.029081691056489944,
-0.046356506645679474,
0.00884305965155363,
-0.01091168262064457,
-0.035444822162389755,
0.004548550583422184,
-0.054776161909103394,
-0.008298685774207115,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "gift_one_month"}}, {"_type": "Constant", "_fields": {"kin... | class BookAdmin(SimpleHistoryAdmin):
actions = ['gift_one_month', 'gift_one_year']
def gift_time(self, request, queryset, num_weeks):
num_books = queryset.count()
for book in queryset:
num_owners = BookOwner.objects.filter(book=book).count()
if num_owners > payments_cons... | |
20,547 | [
0.028645237907767296,
0.05508699640631676,
0.09786324948072433,
-0.018274512141942978,
0.0018711615120992064,
0.012897542677819729,
0.020298359915614128,
-0.004832087550312281,
-0.03815373405814171,
-0.024837050586938858,
-0.023723334074020386,
-0.0003199686179868877,
-0.005694319028407335,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
("shipping", "0024_shippingmethodzipcoderule"),
]
operations = [
migrations.AddField(
model_name="shippingmethod",
name="maximum_delivery_days",
field=models.PositiveIntegerField(blank=True, null=Tr... | |
20,548 | [
0.0035355512518435717,
0.024166569113731384,
-0.007212652824819088,
-0.041075449436903,
-0.017590895295143127,
-0.03381775692105293,
-0.026341304183006287,
0.008390097878873348,
-0.0015208660624921322,
-0.03631419688463211,
0.020293226465582848,
-0.042774055153131485,
-0.019997257739305496,
... | 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": "request", "annotation": null, "type_comment": null}}, {"_type": "... | def gift_time(self, request, queryset, num_weeks):
num_books = queryset.count()
for book in queryset:
num_owners = BookOwner.objects.filter(book=book).count()
if num_owners > payments_constants.PLANS[payments_constants.FAMILY_MONTHLY]['collaborators']:
book.plan =... | |
20,549 | [
-0.0009277769713662565,
-0.009981182403862476,
-0.07941285520792007,
-0.04853546991944313,
0.04261710122227669,
-0.03905152529478073,
-0.0019419644959270954,
0.027675647288560867,
0.018482772633433342,
-0.00009162176138488576,
0.06578120589256287,
-0.034467216581106186,
0.007792113348841667,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "http://(?:www\\.)?pornhd\\.com/(?:[a-z]{2,4}/)?videos/(?P<id>\\d+)(?:/(?P<display_id>.+))?"}}, "targets": [{"_type": "Name", "_fields": {... | class PornHdIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<id>\d+)(?:/(?P<display_id>.+))?'
_TEST = {
'url': 'http://www.pornhd.com/videos/1962/sierra-day-gets-his-cum-all-over-herself-hd-porn-video',
'md5': '956b8ca569f7f4d8ec563e2c41598441',
'... | |
20,550 | [
-0.01508540753275156,
0.022278854623436928,
0.031959984451532364,
-0.01656821370124817,
0.013590347021818161,
-0.027376767247915268,
0.003752969903871417,
-0.014435913413763046,
-0.034386396408081055,
0.005496186204254627,
0.01721770688891411,
-0.01897011511027813,
0.026371890679001808,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "grade_book", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "output_file", "annotation": null, "type_comment": null}}, {... | def exportGradebook(grade_book, output_file, user_ids_path=None):
try:
# Load user id map
uids = {}
if user_ids_path != None:
fin = open(user_ids_path)
for row in csv.DictReader(fin, [TO_USER_ID_KEY, USER_ID_KEY]):
to_user_id = row[TO_USER_ID_KE... | |
20,551 | [
-0.003951993305236101,
0.02943553775548935,
-0.010344834998250008,
-0.005535819102078676,
0.0021183290518820286,
-0.028587600216269493,
-0.028369558975100517,
0.025026263669133186,
-0.0023454551119357347,
0.0028935859445482492,
0.04779943823814392,
-0.0008471801993437111,
0.00843697600066661... | 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": "req", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def action(self, req, id, body):
context = req.environ['nova.context']
authorize(context)
if 'reserve' in body:
return self._set_reserved(context, id, True)
elif 'unreserve' in body:
return self._set_reserved(context, id, False)
else:
raise web... | |
20,552 | [
-0.004964098334312439,
0.009273657575249672,
-0.04864388331770897,
-0.04768960177898407,
0.011934634298086166,
-0.01935478299856186,
0.0011515606893226504,
-0.003973113838583231,
0.018437204882502556,
0.03261684626340866,
0.05221632122993469,
-0.05197163298726082,
-0.00372230913490057,
-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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
display_id = mobj.group('display_id')
webpage = self._download_webpage(url, display_id or video_id)
title = self._html_search_regex(
[r'<span[^>]+class=["\']video-name["\... | |
20,553 | [
-0.04318806901574135,
0.028146959841251373,
0.052227430045604706,
0.005802707746624947,
-0.0424041673541069,
-0.03892560303211212,
-0.001104657887481153,
0.011544172652065754,
0.0658477172255516,
-0.016192462295293808,
0.009768146090209484,
-0.055950962007045746,
0.03020470030605793,
-0.04... | 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 get_resources(self):
member_actions = {'action': 'POST'}
resources = []
resource = extensions.ResourceExtension('os-fixed-ips',
FixedIPController(),
member_actions=member_actions)
resource... | |
20,554 | [
0.00186073943041265,
-0.00979581754654646,
0.028467273339629173,
0.03829803317785263,
-0.029678648337721825,
-0.02117573842406273,
-0.015200406312942505,
0.006674201227724552,
0.02658032812178135,
0.004053441807627678,
0.028350796550512314,
-0.0016394307604059577,
0.04647480696439743,
-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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def _set_reserved(self, context, address, reserved):
try:
fixed_ip = db.fixed_ip_get_by_address(context, address)
db.fixed_ip_update(context, fixed_ip['address'],
{'reserved': reserved})
except exception.FixedIpNotFoundForAddress:
msg = ... | |
20,555 | [
0.014079959131777287,
-0.004428998101502657,
0.05481679365038872,
-0.022600876167416573,
-0.0022393655963242054,
0.0071615488268435,
-0.0015582999913021922,
-0.0319175198674202,
-0.04853938892483711,
-0.004009030759334564,
0.005064474884420633,
-0.022291425615549088,
0.027098948135972023,
... | 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 AutoTableNameTest(unittest.TestCase):
def setUp(self):
self.Base = declarative_base(name='Base', metaclass=AutoTableNameMeta)
def test_basic(self):
class A(self.Base):
id = Column(Integer, primary_key=True)
self.assertEqual(A.__tablename__, 'A')
self.assertEqu... | |
20,556 | [
-0.02346937544643879,
0.030330434441566467,
0.04073594883084297,
-0.03622942417860031,
-0.03531799092888832,
-0.02539351023733616,
0.019203366711735725,
-0.016595657914876938,
0.0006151375127956271,
-0.016190577298402786,
-0.0064211655408144,
0.010956172831356525,
0.03784974664449692,
0.02... | 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": "Dict", "_fields": {"k... | def _get_terminal_map():
ret = {}
ls = glob.glob('/dev/tty*') + glob.glob('/dev/pts/*')
for name in ls:
assert name not in ret
try:
ret[os.stat(name).st_rdev] = name
except OSError:
err = sys.exc_info()[1]
if err.errno != errno.ENOENT:
... | |
20,557 | [
0.005494655109941959,
-0.00853975024074316,
0.043799929320812225,
-0.015169292688369751,
0.02694515883922577,
0.02997901849448681,
0.008348729461431503,
-0.02264157496392727,
0.00862964242696762,
-0.021495450288057327,
-0.019529059529304504,
-0.05793546140193939,
0.023034851998090744,
-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_abstract(self):
class A(self.Base):
__abstract__ = True
id = Column(Integer, primary_key=True)
class B(A):
pass
self.assertIsNone(getattr(A, '__table__', None))
self.assertEqual(B.__table__.name, 'B') | |
20,558 | [
0.039942603558301926,
-0.010980934835970402,
0.07117920368909836,
-0.0005714679718948901,
0.030208507552742958,
0.01654796302318573,
0.008848183788359165,
-0.021655628457665443,
-0.02834918722510338,
-0.01932600699365139,
0.01331055536866188,
-0.017608869820833206,
0.026577362790703773,
-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_inheritance(self):
class A(self.Base):
id = Column(Integer, primary_key=True)
class B(A):
id = Column(ForeignKey(A.id), primary_key=True)
class C(B):
id = Column(ForeignKey(B.id), primary_key=True)
class D(A):
id = Column(ForeignKe... | |
20,559 | [
0.037760745733976364,
-0.017087386921048164,
0.07223795354366302,
0.0011023902334272861,
0.03557891771197319,
0.012777735479176044,
-0.0004337328427936882,
-0.023632870987057686,
-0.03179852291941643,
-0.028644593432545662,
0.008975738659501076,
-0.03067520633339882,
0.05910377949476242,
-... | 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_single_table_inheritance(self):
class A(self.Base):
id = Column(Integer, primary_key=True)
class B(A):
__tablename__ = None
class C(A):
__tablename__ = 'A'
class D(A):
__table__ = A.__table__
self.assertEqual(A.__table__.na... | |
20,560 | [
0.013051025569438934,
-0.0053268298506736755,
0.06951191276311874,
-0.030335446819663048,
-0.015506863594055176,
0.03950390964746475,
-0.0005244237836450338,
-0.008191973902285099,
-0.02876838855445385,
0.019167231395840645,
-0.02135409601032734,
-0.0609983392059803,
0.028534499928355217,
... | 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 TableArgsTest(unittest.TestCase):
def test_basic(self):
args = {'dialect1_a': 1, 'dialect2_b': 2}
Base = declarative_base(name='Base', metaclass=TableArgsMeta(args))
class A(Base):
__tablename__ = 'A'
id = Column(Integer, primary_key=True)
self.assertEq... | |
20,561 | [
0.022363904863595963,
-0.028506020084023476,
0.05041015148162842,
-0.03022722713649273,
-0.015408340841531754,
0.06347246468067169,
0.02433268167078495,
0.007598068565130234,
-0.020937424153089523,
0.006360214203596115,
-0.021137839183211327,
-0.03987070173025131,
-0.007374075707048178,
-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_update(self):
args = {'dialect1_a': 11, 'dialect2_b': 12}
Base = declarative_base(name='Base', metaclass=TableArgsMeta(args))
class A(Base):
__tablename__ = 'A'
__table_args__ = {
'dialect2_b': 22,
'dialect3_c': 23,
}
... | |
20,562 | [
0.04162682220339775,
-0.008871395140886307,
0.08309946954250336,
-0.02954990416765213,
-0.016445163637399673,
0.06835021823644638,
0.011004127562046051,
-0.009764316491782665,
-0.024089597165584564,
-0.0015618088655173779,
-0.0026145242154598236,
-0.05133974924683571,
0.038260702043771744,
... | 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_positional(self):
args = {'dialect1_a': 11, 'dialect2_b': 12}
Base = declarative_base(name='Base', metaclass=TableArgsMeta(args))
class A(Base):
__tablename__ = 'A'
id = Column(Integer)
data = Column(Integer)
__table_args__ = (
... | |
20,563 | [
0.05790816619992256,
-0.0001382550544803962,
0.05737156793475151,
-0.0120735177770257,
-0.007227341644465923,
0.0013359123840928078,
0.003082659561187029,
-0.0017830797005444765,
-0.06018872186541557,
-0.03483433276414871,
-0.010307206772267818,
-0.012464788742363453,
0.049635570496320724,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "B"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}... | class B(Base):
__tablename__ = 'B'
id = Column(Integer, primary_key=True)
data = Column(Integer)
__table_args__ = (
PrimaryKeyConstraint(id),
UniqueConstraint(id),
{'dialect2_b': 22,
'dialect3_c': 23},
... | |
20,564 | [
0.06729639321565628,
-0.01879846304655075,
0.04398209974169731,
0.00283552217297256,
0.01829436980187893,
-0.004678611643612385,
0.004006487783044577,
-0.02205406129360199,
-0.03677777200937271,
-0.016855604946613312,
-0.00908417347818613,
-0.0250996220856905,
0.05536619573831558,
0.008889... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "A"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}... | class A(Base):
__tablename__ = 'A'
id = Column(Integer)
data = Column(Integer)
__table_args__ = (
PrimaryKeyConstraint(id),
UniqueConstraint(data),
) | |
20,565 | [
0.02876248210668564,
0.03394605219364166,
-0.024400699883699417,
0.0015579677419736981,
0.002520668087527156,
0.01846909523010254,
0.024063557386398315,
-0.010999279096722603,
-0.02298891358077526,
0.03308212384581566,
-0.024021413177251816,
-0.02690819837152958,
0.017879096791148186,
-0.0... | 18 | {"_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 Node(object):
def __init__(self):
self.present = False
self.children = {}
def _build_re(self, key):
if key == '*':
assert len(self.children) == 0
# We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
return '(?=\\.[a-z]\\w*\\b(?!\\.)... | |
20,566 | [
0.0022704831790179014,
-0.004664551466703415,
-0.024336790665984154,
-0.006179263349622488,
-0.029939323663711548,
0.03518694266676903,
0.006315524224191904,
0.006112717557698488,
0.047329988330602646,
0.007795378565788269,
0.03919237479567528,
-0.020242633298039436,
0.04687367379665375,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test_object", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "triggered_by", "annotation": null, "type_comment": null}},... | def on_attended_transfer(test_object, triggered_by, ari, event):
LOGGER.debug("on_attended_transfer(%r)" % event)
ari.delete('bridges', TEST.bridge_id)
ari.delete('channels', TEST.originated_id)
if not event['transferer_first_leg']['name'].startswith('PJSIP/bob-'):
return False
elif event[... | |
20,567 | [
0.06905581802129745,
0.029229508712887764,
0.003435681341215968,
-0.00023508201411459595,
-0.024460947141051292,
0.0208293367177248,
0.01071822177618742,
-0.0008982444414868951,
-0.009266681037843227,
0.0016943842638283968,
-0.01916254684329033,
-0.03366691991686821,
0.05241001024842262,
-... | 17 | {"_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 _build_re(self, key):
if key == '*':
assert len(self.children) == 0
# We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
return '(?=\\.[a-z]\\w*\\b(?!\\.))'
elif len(self.children) == 1:
child_key, child = next(self.children.iteritems())
... | |
20,568 | [
-0.020434992387890816,
0.03921114653348923,
0.004850305616855621,
0.010283609852194786,
-0.003984823822975159,
0.01882423460483551,
-0.00013917582691647112,
-0.014340557157993317,
0.036590658128261566,
0.04752938821911812,
0.026853984221816063,
-0.018559781834483147,
0.04144697263836861,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lines", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def _strip_comments(lines):
# FIXME this is a horribe hack, we should use a proper JavaScript parser
# here
in_multiline_comment = False
lineno = 0
for line in lines:
lineno += 1
if in_multiline_comment:
index = line.find('*/')
if index != -1:
... | |
20,569 | [
-0.009146569296717644,
0.0021681091748178005,
-0.01184132695198059,
-0.021077921614050865,
-0.026167351752519608,
-0.02041773684322834,
0.01116313599050045,
0.0606890507042408,
-0.045660827308893204,
0.0338975228369236,
0.08051861822605133,
-0.004795347340404987,
-0.012021377682685852,
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": "index", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __getitem__(self, index):
self._Update()
if index >= len(self._filtered_context_ids):
raise exceptions.DevtoolsTargetCrashException(
self.app,
'Web content with index %s may have crashed. '
'filtered_context_ids = %s' % (
index, repr(self._filtered_context_i... | |
20,570 | [
-0.00824671983718872,
0.06201086565852165,
0.04275456815958023,
-0.04917333275079727,
0.012767763808369637,
0.014128263108432293,
-0.007946711964905262,
-0.04805702716112137,
0.029526326805353165,
0.05227108672261238,
0.04724770411849022,
-0.03329386189579964,
0.011184003204107285,
0.03602... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "closure_lib", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "filenames", "annotation": null, ... | def check_requires(closure_lib, *filenames):
unused_count = 0
all_provides = set()
for filename in ifind(closure_lib):
if filename.endswith('.js'):
if not re.match(r'.*/closure/goog/', filename):
continue
# Skip goog.i18n because it contains so many modules t... | |
20,571 | [
0.018799975514411926,
-0.01437284518033266,
0.034901976585388184,
-0.009154717437922955,
-0.035343464463949203,
0.007020865101367235,
0.013698351569473743,
0.01978105865418911,
-0.016850076615810394,
0.047852255403995514,
0.04944651201367378,
0.013023857958614826,
0.017205718904733658,
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 _Update(self):
backends_map = self._devtools_client.GetUpdatedInspectableContexts()
self._devtools_context_map_backend = backends_map
# Clear context ids that do not appear in the inspectable contexts.
context_ids = [context['id'] for context in backends_map.contexts]
self._filtered_context_ids... | |
20,572 | [
-0.003297880757600069,
-0.02163923904299736,
0.01317983865737915,
-0.005935600958764553,
-0.02554178051650524,
-0.017491329461336136,
0.03278601914644241,
0.013425207696855068,
0.0007185816066339612,
0.031126853078603745,
0.0318746455013752,
0.023473666980862617,
0.03311317786574364,
0.041... | 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": "context_id", "annotation": null, "type_comment": null}}], "kwarg"... | def GetBackendFromContextId(self, context_id):
self._Update()
if context_id not in self._wrapper_dict:
try:
backend = self._devtools_context_map_backend.GetInspectorBackend(
context_id)
except exceptions.Error as e:
self._HandleDevToolsConnectionError(e)
raise e
... | |
20,573 | [
0.020906316116452217,
-0.00015956479182932526,
0.040579549968242645,
-0.04450298845767975,
0.013216379098594189,
-0.014191633090376854,
-0.024997901171445847,
0.02916795387864113,
-0.04459266737103462,
0.020357035100460052,
0.008906202390789986,
-0.001037609064951539,
0.017005298286676407,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": {"_type": "Name", "_fields": {"id": "PublishProcessesRequest", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": nu... | async def package_for_publish(request: PublishProcessesRequest) -> PublishProcesses:
packages = await MultiGet(
Get(BuiltPackage, PackageFieldSet, field_set) for field_set in request.package_field_sets
)
for pkg in packages:
for artifact in pkg.artifacts:
if artifact.relpath:
... | |
20,574 | [
0.01582908444106579,
0.03384663909673691,
0.08425599336624146,
-0.05714884027838707,
0.010003534145653248,
-0.014187734574079514,
0.000482613017084077,
0.021511640399694443,
-0.04013847932219505,
0.013454100117087364,
0.0188506618142128,
-0.0002675354771781713,
0.017905641347169876,
-0.052... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "console", "annotation": {"_type": "Name", "_fields": {"id": "Console", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg": ... | async def run_publish(console: Console) -> Publish:
target_roots_to_package_field_sets, target_roots_to_publish_field_sets = await MultiGet(
Get(
TargetRootsToFieldSets,
TargetRootsToFieldSetsRequest(
field_set,
goal_description="the `publish` goal",
... | |
20,575 | [
0.021417759358882904,
0.02656320296227932,
0.04681529104709625,
0.011809793300926685,
-0.0012135063298046589,
0.00743557745590806,
0.0032585845328867435,
0.013564188964664936,
-0.03746636211872101,
-0.03829057514667511,
-0.017956066876649857,
-0.029459722340106964,
0.030189739540219307,
-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_multi_table_inheritance_unsupported(self):
expected_message = "Can't bulk create a multi-table inherited model"
with self.assertRaisesMessage(ValueError, expected_message):
Pizzeria.objects.bulk_create([
Pizzeria(name="The Art of Pizza"),
])
with ... | |
20,576 | [
0.04789352789521217,
0.0028373824898153543,
0.06254547089338303,
0.009592441841959953,
-0.00005316514943842776,
-0.0019259288674220443,
0.010754294693470001,
0.013564491644501686,
-0.00015104447084013373,
0.028731537982821465,
0.00946652702987194,
-0.021691739559173584,
-0.009191802702844143... | 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_simple(self):
created = Country.objects.bulk_create(self.data)
self.assertEqual(len(created), 4)
self.assertQuerysetEqual(Country.objects.order_by("-name"), [
"United States of America", "The Netherlands", "Germany", "Czech Republic"
], attrgetter("name"))
c... | |
20,577 | [
0.032607633620500565,
-0.023410290479660034,
0.03713785484433174,
0.02109539695084095,
0.012943488545715809,
0.025438932701945305,
-0.020037515088915825,
0.004726239945739508,
-0.008450604975223541,
0.052271779626607895,
0.033877093344926834,
-0.0027644927613437176,
-0.020983386784791946,
... | 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_non_auto_increment_pk(self):
State.objects.bulk_create([
State(two_letter_code=s)
for s in ["IL", "NY", "CA", "ME"]
])
self.assertQuerysetEqual(State.objects.order_by("two_letter_code"), [
"CA", "IL", "ME", "NY",
], attrgetter("two_letter_code... | |
20,578 | [
0.05447646975517273,
-0.011421684175729752,
0.05114928260445595,
0.03160826861858368,
0.0008279169560410082,
0.011576870456337929,
0.014115712605416775,
0.003857922274619341,
-0.013855000026524067,
-0.0032340746838599443,
-0.003401675494387746,
-0.02541324868798256,
0.013308745808899403,
-... | 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_proxy_inheritance_supported(self):
ProxyCountry.objects.bulk_create([
ProxyCountry(name="Qwghlm", iso_two_letter="QW"),
Country(name="Tortall", iso_two_letter="TA"),
])
self.assertQuerysetEqual(ProxyCountry.objects.all(), {
"Qwghlm", "Tortall"
... | |
20,579 | [
0.03771952539682388,
-0.0178984347730875,
0.059147052466869354,
0.013876030221581459,
0.030383065342903137,
0.030838433653116226,
-0.02052944153547287,
0.021174542605876923,
-0.0009099424933083355,
0.042349085211753845,
0.04510658234357834,
-0.01283880602568388,
-0.02598118968307972,
0.020... | 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_non_auto_increment_pk_efficiency(self):
with self.assertNumQueries(1):
State.objects.bulk_create([
State(two_letter_code=s)
for s in ["IL", "NY", "CA", "ME"]
])
self.assertQuerysetEqual(State.objects.order_by("two_letter_code"), [
... | |
20,580 | [
0.03156530484557152,
-0.06286866217851639,
0.05521963909268379,
-0.04107419028878212,
-0.02774079516530037,
-0.009181443601846695,
0.015992214903235435,
-0.010150669142603874,
-0.03559937700629234,
0.024060359224677086,
0.03808793053030968,
-0.0185986440628767,
-0.041047994047403336,
-0.01... | 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 test_large_batch(self):
with override_settings(DEBUG=True):
connection.queries_log.clear()
TwoFields.objects.bulk_create([
TwoFields(f1=i, f2=i + 1) for i in range(0, 1001)
])
self.assertEqual(TwoFields.objects.count(), 1001)
self.assertEqu... | |
20,581 | [
0.020702306181192398,
-0.022175824269652367,
0.026133617386221886,
-0.030907325446605682,
-0.02041003853082657,
-0.009115103632211685,
0.014272414147853851,
-0.02261422574520111,
-0.0003112957056146115,
0.014893483370542526,
0.02995745651423931,
-0.018863454461097717,
-0.015551085583865643,
... | 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_explicit_batch_size(self):
objs = [TwoFields(f1=i, f2=i) for i in range(0, 4)]
num_objs = len(objs)
TwoFields.objects.bulk_create(objs, batch_size=1)
self.assertEqual(TwoFields.objects.count(), num_objs)
TwoFields.objects.all().delete()
TwoFields.objects.bulk_cre... | |
20,582 | [
0.08267329633235931,
0.025376882404088974,
-0.002469580387696624,
-0.030053265392780304,
0.05144020915031433,
-0.05246986821293831,
0.039406031370162964,
0.039813604205846786,
-0.0029602788854390383,
0.041443902999162674,
0.024926405400037766,
0.011744584888219833,
0.00039785451372154057,
... | 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_bulk_insert_nullable_fields(self):
# NULL can be mixed with other values in nullable fields
nullable_fields = [field for field in NullableFields._meta.get_fields() if field.name != 'id']
NullableFields.objects.bulk_create([
NullableFields(**{field.name: None}) for field in n... | |
20,583 | [
0.03994181379675865,
-0.020054617896676064,
0.07505234330892563,
0.0031331602949649096,
0.011049771681427956,
0.041448600590229034,
0.011217191815376282,
0.052665792405605316,
0.02348674274981022,
0.0039463466964662075,
0.05151776596903801,
-0.03731091693043709,
-0.02409663237631321,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_set_pk_and_query_efficiency(self):
with self.assertNumQueries(1):
countries = Country.objects.bulk_create(self.data)
self.assertEqual(len(countries), 4)
self.assertEqual(Country.objects.get(pk=countries[0].pk), countries[0])
self.assertEqual(Country.objects.get(pk=co... | |
20,584 | [
0.0008930009789764881,
-0.03015013411641121,
0.04213753715157509,
0.015414104796946049,
-0.01924038678407669,
0.03242653235793114,
0.022691305726766586,
0.03387954831123352,
0.020184848457574844,
0.026759758591651917,
0.0002315748279215768,
-0.030755558982491493,
-0.028140125796198845,
-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_set_state(self):
country_nl = Country(name='Netherlands', iso_two_letter='NL')
country_be = Country(name='Belgium', iso_two_letter='BE')
Country.objects.bulk_create([country_nl])
country_be.save()
# Objects save via bulk_create() and save() should have equal state.
... | |
20,585 | [
0.01132205594331026,
-0.0011145314201712608,
-0.009887014515697956,
-0.025028813630342484,
-0.005407785531133413,
-0.024606741964817047,
0.030747875571250916,
-0.04110972210764885,
-0.013242479413747787,
-0.004666523076593876,
0.013094753958284855,
-0.011248193681240082,
0.05009983479976654,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def mock_workflow(tmpdir):
workflow = DockerBuildWorkflow(MOCK_SOURCE, 'test-image')
mock_source = MockSource(tmpdir)
setattr(workflow, 'builder', MockBuilder())
workflow.builder.source = mock_source
flexmock(workflow, source=mock_source)
with open(mock_source.flatpak_json_path, "w") as f:
... | |
20,586 | [
-0.017864204943180084,
-0.020743027329444885,
-0.013676827773451805,
-0.04268798977136612,
0.008781861513853073,
-0.01817438192665577,
0.016604114323854446,
-0.05637450888752937,
-0.01826161891222,
-0.011001558974385262,
0.014791523106396198,
-0.03770578280091286,
0.05711117759346962,
-0.0... | 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": "tmpdir", "annotation":... | class MockSource(object):
def __init__(self, tmpdir):
tmpdir = str(tmpdir)
self.dockerfile_path = "./"
self.path = tmpdir
self.flatpak_json_path = os.path.join(tmpdir, 'flatpak.json')
def get_build_file_path(self):
return self.flatpak_json_path, self.path
def get_v... | |
20,587 | [
-0.007421407848596573,
-0.0326654389500618,
0.030191635712981224,
-0.037922270596027374,
-0.033199556171894073,
0.015292597934603691,
0.03148476034402847,
0.0009197696344926953,
0.045877791941165924,
0.06516221165657043,
0.020872710272669792,
-0.01972014270722866,
-0.004842187277972698,
0.... | 14 | {"_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 TestCase(TestBase):
def setUp(self):
super(TestCase, self).setUp()
def tearDown(self):
super(TestCase, self).tearDown()
def createSimpleModel1(self):
#two states, 1 track, 2 symbols
em = IndependentMultinomialEmissionModel(numStates=2,
... | |
20,588 | [
0.00888590607792139,
-0.00030698307091370225,
0.017230115830898285,
-0.035231105983257294,
-0.0037736454978585243,
-0.0021693904418498278,
0.03191842511296272,
-0.0007090234430506825,
-0.013354902155697346,
0.02741817757487297,
0.015073747374117374,
-0.010578707791864872,
0.06596196442842484... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "docker_tasker", "annotation": null, "type_comment": null}}], "k... | def test_flatpak_create_dockerfile(tmpdir, docker_tasker):
workflow = mock_workflow(tmpdir)
args = {
'base_image': "registry.fedoraproject.org/fedora:latest",
}
mmd = ModuleMetadata()
mmd.loads(FLATPAK_APP_MODULEMD)
base_module = ModuleInfo(MODULE_NAME, MODULE_STREAM, LATEST_VERSION,
... | |
20,589 | [
0.020139919593930244,
-0.03017699159681797,
0.04677828401327133,
-0.041753169149160385,
-0.03620186820626259,
0.024086343124508858,
0.02517818845808506,
-0.0033511719666421413,
0.03578091412782669,
0.031150443479418755,
0.022507773712277412,
-0.024704616516828537,
0.026888305321335793,
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 testSingleObs(self):
em = self.createSimpleModel1()
assert em.singleLogProb(0, [1]) == math.log(0.2)
assert em.singleLogProb(0, [2]) == math.log(0.8)
assert em.singleLogProb(1, [1]) == math.log(0.5)
assert em.singleLogProb(1, [2]) == math.log(0.5)
assert em.singleLogP... | |
20,590 | [
0.016263626515865326,
-0.015264325775206089,
0.02882983908057213,
-0.0070325820706784725,
-0.03699912503361702,
0.01246003620326519,
0.02184722200036049,
-0.0016363556496798992,
0.028305206447839737,
0.06035779044032097,
0.0518137663602829,
-0.014939552173018456,
0.014364954084157944,
0.01... | 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 testAllObs(self):
em = self.createSimpleModel1()
truth = np.array([[math.log(0.2), math.log(0.5)],
[math.log(0.2), math.log(0.5)],
[math.log(0.8), math.log(0.5)]])
obs = np.array([[1], [1], [2]])
assert np.array_equal(em.al... | |
20,591 | [
0.031050173565745354,
-0.02153918705880642,
0.03173050284385681,
-0.0028046525549143553,
-0.0388331264257431,
-0.014191643334925175,
0.02002885937690735,
0.016300661489367485,
0.038533780723810196,
0.057310838252305984,
0.029553452506661415,
-0.015470660291612148,
-0.008048281073570251,
-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 testAccumultestats(self):
em = self.createSimpleModel1()
obsStats = em.initStats()
obs = np.array([[0], [0], [1]])
posteriors = np.array([[0.01, 0.02], [0.01, 0.02], [0.3, 0.4]])
em.accumulateStats(obs, obsStats, posteriors)
assert obsStats[0][0][0] == 0.01 + 0.01
... | |
20,592 | [
0.028230570256710052,
-0.012218543328344822,
0.040757887065410614,
-0.04073267802596092,
-0.03180980309844017,
0.022874323651194572,
0.026667805388569832,
-0.02419763058423996,
0.03218789026141167,
0.05701566860079765,
0.029969774186611176,
-0.006729966029524803,
0.01894220896065235,
0.013... | 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 testInitStats(self):
em = self.createSimpleModel1()
obsStats = em.initStats()
assert len(obsStats) == 1
assert obsStats[0].shape == (2, 2+1)
em = self.createSimpleModel2()
obsStats = em.initStats()
assert len(obsStats) == 2
assert obsStats[0].shape ==... | |
20,593 | [
-0.03477802127599716,
-0.02172296866774559,
0.027466127648949623,
-0.011878502555191517,
-0.046477049589157104,
-0.040654122829437256,
0.034193068742752075,
-0.009000275284051895,
0.031959619373083115,
0.06179213896393776,
0.0003523002960719168,
-0.00047319577424786985,
0.01538156345486641,
... | 13 | {"_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 testGaussian(self):
bedIntervals = getBedStates()
trackData = TrackData()
trackData.loadTrackData(getTracksInfoPath(6), bedIntervals)
assert len(trackData.getTrackTableList()) == len(bedIntervals)
em = IndependentMultinomialAndGaussianEmissionModel(
... | |
20,594 | [
-0.007631397806107998,
-0.0374692939221859,
0.011356961913406849,
-0.04828545078635216,
-0.05127658322453499,
0.010208580642938614,
0.05426771938800812,
0.009694479405879974,
0.048499103635549545,
0.06414914131164551,
0.01112328004091978,
0.0072908890433609486,
-0.00779831362888217,
0.0491... | 13 | {"_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 testSupervisedTrain(self):
bedIntervals = getBedStates()
trackData = TrackData()
trackData.loadTrackData(getTracksInfoPath(), bedIntervals)
assert len(trackData.getTrackTableList()) == len(bedIntervals)
# set the fudge to 1 since when the test was written this was
# h... | |
20,595 | [
0.06306140124797821,
0.025880930945277214,
-0.028456561267375946,
-0.041127000004053116,
0.05064021423459053,
-0.0064079188741743565,
0.03807363286614418,
-0.012234244495630264,
0.030720623210072517,
-0.01026097871363163,
0.005675733555108309,
0.04054540768265724,
0.030720623210072517,
-0.... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "stream", "annotation": null, "type_comment": null}}], "kwarg": nu... | def make_stream_logger(name, stream):
# stream should be a file-like object supporting write/read/?
logger = logging.getLogger(name)
hdlr = logging.StreamHandler(stream)
formatter = logging.Formatter('%(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.... | |
20,596 | [
0.02253398858010769,
0.031587500125169754,
0.0057650357484817505,
-0.004989409353584051,
-0.012092513963580132,
0.051853571087121964,
0.04212876036763191,
0.05014810338616371,
-0.008540961891412735,
0.04847891628742218,
-0.04866034910082817,
-0.004304499831050634,
0.01534923817962408,
0.01... | 9 | {"_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": "CharField", "value": {"_type": "Name", "_fields": {"id": "fo... | class UserRegistrationForm(ModelForm):
password_confirm = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ['username', 'email', 'password', ]
widgets = { 'password': forms.PasswordInput() }
def clean(self):
cleaned_data = super(UserRegist... | |
20,597 | [
0.01230904646217823,
0.07744252681732178,
0.05296069383621216,
-0.020961714908480644,
-0.024300146847963333,
-0.04265016317367554,
0.01764599420130253,
-0.04112856462597847,
0.005978517234325409,
0.06109102442860603,
0.010390016250312328,
-0.015590701252222061,
0.007812383584678173,
-0.049... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "run_path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "source_path", "annotation": null, "type_comment": null}}, {"_... | def _init(run_path, source_path, build_path):
if not (os.path.isabs(run_path) and os.path.isabs(source_path) and os.path.isabs(build_path)):
raise ValueError("All paths must be absolute !")
tooldir = os.path.join(WAFDIR, "Tools")
sys.path.insert(0, tooldir)
cwd = os.getcwd()
if __USE_NO_OU... | |
20,598 | [
0.008928359486162663,
0.02452973835170269,
0.03252806141972542,
-0.0007236854289658368,
-0.02664557285606861,
-0.023948464542627335,
0.01381105650216341,
-0.006835775449872017,
-0.037131745368242264,
0.0614289753139019,
0.0028308015316724777,
0.01326465979218483,
0.004138666670769453,
0.00... | 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": "global_context", "anno... | class ConfigureWafContext(ConfigureContext):
def __init__(self, global_context, cmd_argv, options_context, pkg, run_node):
super(ConfigureWafContext, self).__init__(global_context, cmd_argv, options_context, pkg, run_node)
run_path = self.run_node.abspath()
source_path = self.top_node.abspa... | |
20,599 | [
0.029379190877079964,
-0.013496951200067997,
0.04860319569706917,
-0.0312921442091465,
-0.018480077385902405,
-0.007734473794698715,
-0.00902748852968216,
-0.040644362568855286,
-0.0001856126036727801,
0.0654182955622673,
-0.0025063236244022846,
-0.04014841094613075,
0.023923730477690697,
... | 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 configure(self):
o, a = self.get_parsed_arguments()
if o.use_distutils_flags:
Options.options.use_distutils_flags = True
else:
Options.options.use_distutils_flags = False
pkg = self.pkg
# FIXME: this is wrong (not taking into account sub packages)
... | |
20,600 | [
0.01493456307798624,
0.01170632615685463,
0.02296810783445835,
0.012087363749742508,
-0.03274807706475258,
-0.03200717270374298,
0.02343382127583027,
-0.02095707692205906,
-0.03490729257464409,
0.08149974048137665,
0.00006520144961541519,
0.027201861143112183,
-0.0021883209701627493,
-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": "global_context", "annotation": null, "type_comment": null}}, {"_t... | def __init__(self, global_context, cmd_argv, options_context, pkg, run_node):
super(ConfigureWafContext, self).__init__(global_context, cmd_argv, options_context, pkg, run_node)
run_path = self.run_node.abspath()
source_path = self.top_node.abspath()
build_path = self.build_node.abspath... |