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
17,201
[ 0.006486664060503244, 0.036804892122745514, 0.020166907459497452, -0.025901412591338158, -0.001644287258386612, -0.02130928449332714, -0.03646557033061981, 0.013550171628594398, -0.03490469977259636, -0.03592265769839287, 0.028932670131325722, -0.06103232502937317, 0.04205303639173508, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "procurement.order"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comm...
class ProcurementOrder(models.Model): _inherit = 'procurement.order' @api.multi def run(self, autocommit=False): config_param_obj = self.env['ir.config_parameter'] config_param_list = config_param_obj.search( [('key', '=', 'procurement.order'), ('value', '=', 'no_confirm')]) ...
17,202
[ 0.013367917388677597, -0.012902306392788887, 0.006101945880800486, -0.0411207415163517, -0.016676200553774834, -0.014507437124848366, -0.03996897116303444, 0.0005636335117742419, -0.033450424671173096, -0.008846595883369446, 0.004221125040203333, 0.004254820756614208, -0.011738280765712261, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "RehostTo"}}, "targets": [{"_type": "Name", "_fields": {"id": "__name__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nul...
class RehostTo(MultiHoster): __name__ = "RehostTo" __version__ = "0.43" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False"), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list...
17,203
[ 0.05197378993034363, -0.0021744072437286377, 0.04793360084295273, -0.016397681087255478, 0.040800921618938446, 0.0007259714766405523, -0.035862915217876434, 0.06559072434902191, -0.013305190950632095, 0.0065091936849057674, 0.019776975736021996, -0.003740915795788169, -0.017569834366440773, ...
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 coreReady(self): self.account = self.core.accountManager.getAccountPlugin("RehostTo") user = self.account.selectAccount()[0] if not user: self.logError("Rehost.to: " + _("Please add your rehost.to account first and restart pyLoad")) return data = self.accou...
17,204
[ -0.0017229830846190453, 0.028135649859905243, 0.0017229830846190453, 0.018445532768964767, 0.02983940578997135, 0.02084735594689846, -0.024420512840151787, 0.003913316410034895, -0.017297863960266113, 0.026455555111169815, -0.008010023273527622, -0.005835958290845156, -0.03175613284111023, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def __init__(self, **kwargs): try: super(NeutronException, self).__init__(self.message % kwargs) self.msg = self.message % kwargs except Exception: with excutils.save_and_reraise_exception() as ctxt: if not self.use_fatal_exceptions(): ...
17,205
[ 0.005149390082806349, 0.006936334539204836, 0.019401106983423233, -0.01072682160884142, 0.03057144209742546, 0.0051029762253165245, -0.010324565693736076, 0.012707157991826534, -0.04125700891017914, 0.05974014848470688, -0.03975112736225128, -0.014996922574937344, 0.015615777112543583, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "Invalid network VLAN range: '%(vlan_range)s' - '%(error)s'"}}], "func": {"_type": "Name", "_fields...
class NetworkVlanRangeError(NeutronException): message = _("Invalid network VLAN range: '%(vlan_range)s' - '%(error)s'") def __init__(self, **kwargs): # Convert vlan_range tuple to 'start:end' format for display if isinstance(kwargs['vlan_range'], tuple): kwargs['vlan_range'] = "%d:...
17,206
[ 0.03584079444408417, 0.013996874913573265, -0.012773780152201653, -0.05016062408685684, -0.014196143485605717, 0.020270388573408127, -0.016023913398385048, -0.040953055024147034, 0.027540242299437523, 0.00002156681330234278, 0.025657501071691513, -0.040265925228595734, 0.0036005706060677767,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "\n\t\t<screen position=\"center,center\" size=\"570,420\" title=\"Temperature and fan control\" >\n\t\t\t<ePixmap pixmap=\"skin_default/b...
class TempFanControl(Screen, ConfigListScreen): skin = """ <screen position="center,center" size="570,420" title="Temperature and fan control" > <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="...
17,207
[ -0.027653973549604416, 0.04956403002142906, 0.0025535740423947573, -0.036880627274513245, 0.009545039385557175, 0.015997199341654778, 0.006507390644401312, 0.04111709073185921, 0.00098601751960814, -0.03446350246667862, 0.06565219163894653, -0.029317369684576988, -0.026848265901207924, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def execute(): frappe.reload_doc('buying', 'doctype', 'buying_settings') frappe.db.set_value('Buying Settings', None, 'backflush_raw_materials_of_subcontract_based_on', 'BOM') frappe.reload_doc('stock', 'doctype', 'stock_entry_detail') frappe.db.sql(""" update `tabStock Entry Detail` as sed, `tabStock Entry` a...
17,208
[ 0.0404946506023407, -0.007470564916729927, -0.01574086770415306, -0.02264653891324997, -0.006226528435945511, 0.01685796119272709, -0.005131649784743786, -0.04333816096186638, 0.03318276256322861, 0.016819879412651062, 0.015791645273566246, -0.04615628719329834, -0.0036940262652933598, 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": "session", "annotation": null, "type_comment": null}}, {"_type": "...
def __init__(self, session, args = None): Screen.__init__(self, session) self.setTitle(_("Temperature and fan control")) templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE) tempcount = len(templist) fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM) fancount = len(fanlist) self["red"] = Sta...
17,209
[ 0.04414893686771393, 0.021251671016216278, 0.02821018174290657, 0.0008837720961309969, -0.03806023672223091, -0.005433398764580488, -0.004381394013762474, -0.005589142441749573, -0.021992187947034836, 0.027857555076479912, -0.006359045393764973, -0.01709066890180111, 0.020146772265434265, ...
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": "endog", "annotation": null, "type_comment": null}}, {"_type": "ar...
def __init__(self, endog, exog, r_matrix, q_matrix=None, sigma_prior=None, sigma=None): self.r_matrix = np.asarray(r_matrix) self.q_matrix = atleast_2dcols(q_matrix) if np.size(sigma_prior) == 1: sigma_prior = sigma_prior * np.eye(self.r_matrix.shape[0]) #no numerical shortcuts ...
17,210
[ 0.00728585384786129, -0.007832840085029602, 0.018772559240460396, -0.02057761326432228, 0.006093424279242754, 0.059380803257226944, -0.01643146015703678, -0.019811833277344704, -0.01918826997280121, 0.03529153764247894, 0.030303025618195534, -0.008647848851978779, 0.005149873439222574, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_coeffs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_vars", "annotation": null, "type_comment": null}}, {"_type"...
def coef_restriction_meandiff(n_coeffs, n_vars=None, position=0): reduced = np.eye(n_coeffs) - 1./n_coeffs if n_vars is None: return reduced else: full = np.zeros((n_coeffs, n_vars)) full[:, position:position+n_coeffs] = reduced return full
17,211
[ 0.04901993274688721, 0.014624279923737049, 0.030719157308340073, -0.014174929820001125, -0.009293361566960812, -0.008340196684002876, -0.02016625553369522, 0.005113051272928715, -0.0315089225769043, 0.03654708340764046, -0.012677098624408245, -0.012377532199025154, -0.00879635475575924, 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": "lambd", "annotation": null, "type_comment": null}}], "kwarg": nul...
def fit(self, lambd=1.): #this does duplicate transformation, but I need resid not wresid res_gls = GLS(self.endog, self.exog, sigma=self.sigma).fit() self.res_gls = res_gls sigma2_e = res_gls.mse_resid r_matrix = self.r_matrix q_matrix = self.q_matrix sigma_prio...
17,212
[ 0.002876053564250469, -0.01282511092722416, 0.034388456493616104, -0.030595114454627037, -0.013829894363880157, 0.032311148941516876, -0.03953656554222107, -0.02894681692123413, -0.01748776063323021, 0.013615390285849571, 0.015523351728916168, -0.0030905581079423428, 0.013637969270348549, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n_coeffs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_vars", "annotation": null, "type_comment": null}}, {"_type"...
def coef_restriction_diffbase(n_coeffs, n_vars=None, position=0, base_idx=0): reduced = -np.eye(n_coeffs) #make all rows, drop one row later reduced[:, base_idx] = 1 keep = lrange(n_coeffs) del keep[base_idx] reduced = np.take(reduced, keep, axis=0) if n_vars is None: return reduced ...
17,213
[ -0.03899620845913887, 0.03968844935297966, 0.03913465514779091, -0.0458955354988575, -0.03276604413986206, 0.003974613733589649, -0.029789410531520844, -0.061332497745752335, 0.004447644576430321, -0.03883468359708786, 0.03108159266412258, -0.010585509240627289, 0.01769827865064144, 0.0038...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "report.transaction.pos"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_co...
class report_transaction_pos(osv.osv): _name = "report.transaction.pos" _description = "transaction for the pos" _auto = False _columns = { 'date_create': fields.char('Date', size=16, readonly=True), 'journal_id': fields.many2one('account.journal', 'Sales Journal', readonly=True), ...
17,214
[ -0.020431213080883026, 0.05534333735704422, 0.04929294064640999, -0.03950553387403488, -0.0197638887912035, 0.003283786354586482, -0.038660258054733276, -0.06917916983366013, 0.009804090484976768, -0.03269883617758751, 0.023979147896170616, -0.034456122666597366, -0.0007583850529044867, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "report.sales.by.user.pos.month"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], ...
class report_sales_by_user_pos_month(osv.osv): _name = "report.sales.by.user.pos.month" _description = "Sales by user monthly" _auto = False _columns = { 'date_order': fields.date('Order Date',required=True, select=True), 'amount': fields.float('Total', readonly=True, select=True), ...
17,215
[ -0.021188097074627876, 0.045445654541254044, 0.04725641384720802, -0.0374738946557045, -0.026123521849513054, -0.014695861376821995, -0.039262570440769196, -0.06183081865310669, 0.00952857080847025, -0.037451811134815216, 0.03252742812037468, -0.029347557574510574, 0.01024072989821434, -0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "report.sales.by.user.pos"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_...
class report_sales_by_user_pos(osv.osv): _name = "report.sales.by.user.pos" _description = "Sales by user" _auto = False _columns = { 'date_order': fields.date('Order Date',required=True, select=True), 'amount': fields.float('Total', readonly=True, select=True), 'qty': fields.flo...
17,216
[ -0.009193923324346542, 0.06243961304426193, 0.05440494790673256, -0.043763287365436554, -0.040963977575302124, 0.02104826085269451, -0.031155699864029884, -0.07684218138456345, 0.007922479882836342, -0.019253281876444817, 0.02583487145602703, -0.03758770599961281, 0.003087790682911873, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "report.sales.by.margin.pos.month"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}]...
class report_sales_by_margin_pos_month(osv.osv): _name = "report.sales.by.margin.pos.month" _description = "Sales by margin monthly" _auto = False _columns = { 'product_name':fields.char('Product Name', size=64, readonly=True), 'date_order': fields.date('Order Date',required=True, select...
17,217
[ -0.007241478189826012, 0.05771694332361221, 0.05793182551860809, -0.04003226384520531, -0.05139945074915886, 0.004657538142055273, -0.03294120356440544, -0.07323132455348969, 0.012355637736618519, -0.021541785448789597, 0.028536150231957436, -0.033005669713020325, 0.01446146797388792, -0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "report.sales.by.margin.pos"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "typ...
class report_sales_by_margin_pos(osv.osv): _name = "report.sales.by.margin.pos" _description = "Sales by margin" _auto = False _columns = { 'product_name':fields.char('Product Name', size=64, readonly=True), 'date_order': fields.date('Order Date',required=True, select=True), 'use...
17,218
[ 0.003580823540687561, 0.025769025087356567, 0.020852651447057724, -0.03899548947811127, -0.035098522901535034, 0.011974790133535862, 0.041679494082927704, 0.006497097667306662, 0.02983374334871769, 0.03703410178422928, 0.018104126676917076, -0.0070519642904400826, -0.01677502878010273, -0....
11
{"_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 _inner(): if initial_delay: greenthread.sleep(initial_delay) try: while self._running: start = _ts() self.f(*self.args, **self.kw) end = _ts() if not self._running: ...
17,219
[ 0.007872086949646473, 0.017479753121733665, 0.017479753121733665, -0.044306833297014236, -0.04140593856573105, 0.02581052854657173, 0.019612034782767296, 0.007760514039546251, 0.029604006558656693, 0.03967035934329033, 0.007128268014639616, -0.006040432024747133, -0.0026126650627702475, -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": "interval", "annotation": null, "type_comment": null}}, {"_type": ...
def start(self, interval, initial_delay=None): self._running = True done = event.Event() def _inner(): if initial_delay: greenthread.sleep(initial_delay) try: while self._running: start = _ts() self...
17,220
[ 0.028414053842425346, 0.04371197894215584, 0.005495709367096424, -0.020447971299290657, -0.0445745475590229, 0.034654997289180756, 0.058654725551605225, 0.01836765743792057, 0.03767399117350578, 0.024088522419333458, 0.005143704824149609, -0.03095102310180664, -0.043280694633722305, -0.040...
11
{"_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 _inner(): if initial_delay: greenthread.sleep(initial_delay) try: while self._running: idle = self.f(*self.args, **self.kw) if not self._running: break if periodic_interval_m...
17,221
[ 0.03056204877793789, 0.04471249505877495, -0.008801480755209923, -0.012764578685164452, -0.053586918860673904, 0.05300339311361313, 0.03457377478480339, 0.014952792786061764, 0.04031175747513771, 0.019535884261131287, -0.004950833041220903, -0.03428201004862785, -0.02961382269859314, -0.04...
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": "initial_delay", "annotation": null, "type_comment": null}}, {"_ty...
def start(self, initial_delay=None, periodic_interval_max=None): self._running = True done = event.Event() def _inner(): if initial_delay: greenthread.sleep(initial_delay) try: while self._running: idle = self.f(*self....
17,222
[ 0.00451138149946928, -0.03834158182144165, 0.021245818585157394, -0.01395740918815136, 0.0350380502641201, -0.01230564434081316, -0.033654697239398956, -0.015702085569500923, -0.01875784993171692, 0.00714388070628047, 0.019294671714305878, -0.04459763690829277, 0.019738584756851196, -0.075...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "index.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen...
class Home(TemplateView): template_name = 'index.html' def get_context_data(self, **kwargs): context = super(Home, self).get_context_data(**kwargs) temps = Temp.objects.all() context['latest_temp'] = temps[0] temps = list(temps[:200]) temps.reverse() context['tem...
17,223
[ 0.012948743999004364, 0.002287945942953229, -0.02885478548705578, 0.008100885897874832, 0.023764006793498993, -0.02898152731359005, 0.04803498089313507, 0.03373432904481888, 0.02289794199168682, -0.0006584610673598945, 0.03833926469087601, -0.013740877620875835, 0.027460630983114243, -0.02...
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": "pointer", "annotation": null, "type_comment": null}}, {"_type": "...
def __init__(self, pointer, file_contents): assert isinstance(pointer, dict) # according to docs it's channel URI = "ws://" + pointer.get('farmer')['address'] URI += ":" + str(pointer.get('farmer')['port']) self.json = pointer self.file_contents = file_contents s...
17,224
[ -0.004617139231413603, -0.0446731336414814, 0.013824556022882462, -0.01343059167265892, 0.05711284652352333, 0.009819255210459232, -0.027290962636470795, -0.021309873089194298, -0.019053533673286438, 0.0296308696269989, -0.005846784450113773, -0.05548923835158348, -0.027649112045764923, -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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def get_context_data(self, **kwargs): context = super(Home, self).get_context_data(**kwargs) temps = Temp.objects.all() context['latest_temp'] = temps[0] temps = list(temps[:200]) temps.reverse() context['temps'] = temps return context
17,225
[ 0.04782621189951897, 0.031833451241254807, 0.0019689977634698153, -0.001331410021521151, 0.006640417501330376, 0.0340384766459465, -0.013052728958427906, 0.0003084974305238575, -0.001745644025504589, 0.0452156662940979, 0.03424123674631119, -0.025459157302975655, -0.04055216535925865, 0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def achievable(result): s, c = 0, 1 for n in nums: if n > result: return False if s + n > result: s = n c += 1 if c > m: return False else: ...
17,226
[ 0.03139793127775192, 0.002380963182076812, 0.021118514239788055, -0.037479765713214874, -0.01930888742208481, -0.03524105250835419, -0.030222607776522636, 0.012956543825566769, 0.004911173600703478, 0.02158491127192974, -0.0058952742256224155, -0.016184018924832344, 0.0015414463123306632, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "formatter_class", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Attribute", "_fields": {"ctx": {"_t...
def test_arg_parser(formatter_class=argparse.RawDescriptionHelpFormatter): arg_parser = argparse.ArgumentParser(formatter_class=formatter_class, prog=app_name, description=app_description) arg_parser.add_argument('arg1') arg_p...
17,227
[ -0.0067594340071082115, 0.0001560569799039513, 0.04181525856256485, -0.05775819718837738, -0.010232384316623211, -0.008513391017913818, -0.01601286605000496, -0.03664079308509827, 0.04337691888213158, 0.042514510452747345, -0.0013016280718147755, -0.008775610476732254, -0.028529472649097443,...
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 ManPageFormatterTest(unittest.TestCase): def test_format_functions(self): uut = ManPageFormatter(app_name) self.assertEqual(ManPageFormatter._markup("a-b"), "a\\-b") self.assertEqual(ManPageFormatter._underline("test"), "\\fItest\\fR") self.assertEqual(ManPageFormatter._bold("...
17,228
[ -0.011732588522136211, 0.029775843024253845, 0.012991142459213734, -0.023858848959207535, -0.0052728052251040936, -0.025051791220903397, -0.0035370741970837116, -0.0296565480530262, 0.04265962168574333, 0.038484323769807816, -0.022988000884652138, -0.025791414082050323, -0.013349025510251522...
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_mk_description(self): uut = ManPageFormatter(app_name, parser=test_arg_parser()) self.assertEqual(uut._mk_description(), "") uut = ManPageFormatter(app_name, parser=test_arg_parser(), long_desc=...
17,229
[ 0.0010565423872321844, 0.010171552188694477, 0.010492177680134773, -0.04077465832233429, -0.017225302755832672, -0.019248558208346367, -0.015611122362315655, -0.01609758660197258, 0.027551639825105667, 0.0523613840341568, -0.016362931579351425, 0.005655162036418915, -0.020320992916822433, ...
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_formatter(self): parser = test_arg_parser(ManPageFormatter) self.assertEqual( parser.format_help(), "usage: {0} [-h] [-a A] arg1\n\n{1}\n\n" "positional arguments:\n" " arg1\n\n" "optional arguments:\n" " \\fB-h\\fR, \\fB...
17,230
[ -0.004145720973610878, 0.024740593507885933, 0.016765248030424118, -0.01822415180504322, -0.0480952262878418, -0.02750035561621189, -0.0005109966150484979, -0.016424836590886116, 0.022540079429745674, 0.019476378336548805, 0.02322090044617653, -0.03248494490981102, -0.05553564056754112, 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 BuildManPageTest(unittest.TestCase): def test_finalize_options(self): dist = Distribution() uut = BuildManPage(dist) self.assertRaises(DistutilsOptionError, uut.finalize_options) with make_temp() as uut.output: self.assertRaises(DistutilsOptionError, uut.finalize_o...
17,231
[ 0.003033638698980212, 0.015978658571839333, 0.03382811322808266, -0.025922074913978577, -0.06545227766036987, -0.03418689966201782, 0.0021446896716952324, 0.011442616581916809, 0.01522265188395977, 0.0369802787899971, 0.018836108967661858, -0.021168198436498642, -0.05843038111925125, 0.000...
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_finalize_options(self): dist = Distribution() uut = BuildManPage(dist) self.assertRaises(DistutilsOptionError, uut.finalize_options) with make_temp() as uut.output: self.assertRaises(DistutilsOptionError, uut.finalize_options) uut.parser = "coalib.tests.m...
17,232
[ 0.005302398931235075, -0.004437986761331558, -0.02185475453734398, -0.028911178931593895, 0.018266059458255768, -0.051451414823532104, -0.007797348778694868, -0.009097747504711151, 0.06177395582199097, -0.0020022604148834944, 0.026149092242121696, 0.005796348676085472, -0.03602808713912964, ...
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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul...
def _convert_header_value(self, value): if isinstance(value, bytes_type): pass elif isinstance(value, unicode_type): value = value.encode('utf-8') elif isinstance(value, numbers.Integral): # return immediately since we know the converted value will be safe ...
17,233
[ 0.011288508772850037, 0.0018835521768778563, 0.020128782838582993, 0.0037875918205827475, 0.019319534301757812, -0.0501939132809639, -0.03226751461625099, 0.0215731393545866, 0.0016133757308125496, 0.05117730423808098, -0.0002677755546756089, -0.057774219661951065, -0.01880735158920288, -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": "application", "annotation": null, "type_comment": null}}, {"_type...
def __init__(self, application, request, **kwargs): super(RequestHandler, self).__init__() self.application = application self.request = request self._headers_written = False self._finished = False self._auto_finish = True self._transforms = None # will be set i...
17,234
[ 0.018499229103326797, -0.003997476305812597, -0.0442001037299633, -0.032384902238845825, -0.027906378731131554, -0.019714506343007088, -0.05419238656759262, -0.002073286334052682, 0.06247428059577942, 0.05581275746226311, 0.03868634253740311, -0.04449266940355301, -0.0026654531247913837, 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _get_arguments(self, name, source, strip=True): values = [] for v in source.get(name, []): v = self.decode_argument(v, name=name) if isinstance(v, unicode_type): # Get rid of any weird control chars (unless decoding gave # us bytes, in which ca...
17,235
[ 0.008473016321659088, 0.022787055000662804, -0.014873411506414413, -0.03205496817827225, 0.01096369419246912, -0.028427882120013237, -0.034975480288267136, 0.033609434962272644, 0.04595094919204712, 0.02270462177693844, 0.04133465886116028, -0.030264977365732193, -0.0337507501244545, 0.018...
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": "e", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def _handle_request_exception(self, e): if isinstance(e, Finish): # Not an error; just finish the request without logging. if not self._finished: self.finish() return self.log_exception(*sys.exc_info()) if self._finished: # Extra er...
17,236
[ 0.0003485424385871738, 0.04998238384723663, -0.03666653111577034, 0.0022290737833827734, 0.023712871596217155, -0.021656902506947517, -0.020655551925301552, 0.00422112550586462, -0.0017190766520798206, 0.03163846582174301, -0.008708568289875984, -0.04033105447888374, -0.028080470860004425, ...
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _ui_module(self, name, module): def render(*args, **kwargs): if not hasattr(self, "_active_modules"): self._active_modules = {} if name not in self._active_modules: self._active_modules[name] = module(self) rendered = self._active_modules[n...
17,237
[ 0.0013463684590533376, -0.014483345672488213, -0.028345182538032532, -0.0029937797226011753, -0.004006504081189632, -0.009328162297606468, -0.03136393427848816, 0.01533791795372963, 0.03305088356137276, 0.034649044275283813, 0.02288479544222355, -0.0022571266163140535, -0.03531494736671448, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def wrapper(self, *args, **kwargs): self._auto_finish = False with stack_context.ExceptionStackContext( self._stack_context_handle_exception): result = method(self, *args, **kwargs) if isinstance(result, Future): # If @asynchronous is used with @ge...
17,238
[ -0.011211731471121311, -0.051797229796648026, -0.002562681445851922, 0.00510594854131341, 0.033839043229818344, 0.007590973284095526, -0.03084925003349781, 0.030635692179203033, 0.010784617625176907, 0.0362464115023613, -0.02389894612133503, -0.018249398097395897, 0.024054260924458504, 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}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def wrapper(self, *args, **kwargs): if not self.request.path.endswith("/"): if self.request.method in ("GET", "HEAD"): uri = self.request.path + "/" if self.request.query: uri += "?" + self.request.query self.redirect(uri, permanent...
17,239
[ -0.009966578334569931, -0.047985102981328964, -0.0031714015640318394, 0.0036716454196721315, 0.041742824018001556, 0.01057931687682867, -0.027515798807144165, 0.03689835965633392, 0.014973802492022514, 0.04277682304382324, -0.0285497959703207, -0.027707278728485107, 0.022996850311756134, 0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def wrapper(self, *args, **kwargs): if self.request.path.endswith("/"): if self.request.method in ("GET", "HEAD"): uri = self.request.path.rstrip("/") if uri: # don't try to redirect '/' to '' if self.request.query: uri += ...
17,240
[ 0.000592073833104223, -0.007136208936572075, 0.055346474051475525, -0.00850352831184864, 0.01687631756067276, -0.05987878516316414, -0.08698548376560211, -0.017170481383800507, -0.004981727339327335, 0.0418802872300148, 0.02263975888490677, -0.03874253109097481, -0.008160336874425411, -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": "request", "annotation": null, "type_comment": null}}], "kwarg": n...
def _get_host_handlers(self, request): host = request.host.lower().split(':')[0] matches = [] for pattern, handlers in self.handlers: if pattern.match(host): matches.extend(handlers) # Look for default host if not behind load balancer (for debugging) i...
17,241
[ -0.006358213257044554, 0.046679750084877014, 0.015221658162772655, -0.024481499567627907, -0.014629704877734184, 0.014090604148805141, 0.0059618158265948296, 0.023847263306379318, -0.013149821199476719, 0.04405824467539787, 0.007314852438867092, -0.02340329997241497, 0.022621074691414833, ...
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": "methods", "annotation": null, "type_comment": null}}], "kwarg": n...
def _load_ui_methods(self, methods): if isinstance(methods, types.ModuleType): self._load_ui_methods(dict((n, getattr(methods, n)) for n in dir(methods))) elif isinstance(methods, list): for m in methods: self._load_ui_method...
17,242
[ -0.01743916980922222, -0.05518259108066559, -0.019169030711054802, -0.0018325723940506577, 0.03697579726576805, 0.011103550903499126, -0.020520485937595367, 0.0015771473990753293, 0.015601190738379955, 0.014909246005117893, -0.020606977865099907, -0.035094570368528366, -0.009952111169695854,...
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 __str__(self): message = "HTTP %d: %s" % ( self.status_code, self.reason or httputil.responses.get(self.status_code, 'Unknown')) if self.log_message: return message + " (" + (self.log_message % self.args) + ")" else: return message
17,243
[ -0.015116977505385876, 0.05306722968816757, -0.017282765358686447, -0.021157238632440567, 0.006753120571374893, 0.005264822393655777, -0.013702142052352428, -0.019535619765520096, -0.03149642422795296, 0.04377284646034241, -0.02086338773369789, -0.062296316027641296, 0.013723908923566341, ...
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": "modules", "annotation": null, "type_comment": null}}], "kwarg": n...
def _load_ui_modules(self, modules): if isinstance(modules, types.ModuleType): self._load_ui_modules(dict((n, getattr(modules, n)) for n in dir(modules))) elif isinstance(modules, list): for m in modules: self._load_ui_module...
17,244
[ 0.007078973576426506, 0.030165094882249832, 0.024709951132535934, -0.06014527007937431, 0.039572905749082565, 0.01499008759856224, 0.02245623804628849, -0.06074625998735428, 0.0029818369075655937, 0.0017408495768904686, 0.006680239457637072, -0.0506218858063221, -0.019913585856556892, 0.03...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "abs_path", "annotation": null, "type_comment": null}}], "kwarg": n...
def _get_cached_version(cls, abs_path): with cls._lock: hashes = cls._static_hashes if abs_path not in hashes: try: hashes[abs_path] = cls.get_content_version(abs_path) except Exception: gen_log.error("Could not open...
17,245
[ 0.008714518509805202, -0.034740548580884933, 0.02074325643479824, -0.03819580003619194, 0.03575126826763153, 0.00422504311427474, -0.008250292390584946, -0.006599058862775564, 0.0008931940537877381, 0.025620566681027412, 0.046798668801784515, -0.008755652233958244, -0.023422839120030403, -...
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": "path", "annotation": null, "type_comment": null}}, {"_type": "arg...
def get(self, path, include_body=True): # Set up our path instance variables. self.path = self.parse_url_path(path) del path # make sure we don't refer to path instead of self.path again absolute_path = self.get_absolute_path(self.root, self.path) self.absolute_path = self.valid...
17,246
[ 0.0258265919983387, 0.01850838214159012, 0.05384256690740585, -0.03734111785888672, 0.01571084000170231, -0.03359078988432884, 0.028543047606945038, -0.003841553581878543, 0.035253096371889114, 0.0020386080723255873, -0.013126152567565441, -0.04938271641731262, 0.004193780478090048, -0.026...
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": "path", "annotation": null, "type_comment": null}}], "kwarg": {"_t...
def render(self, path, **kwargs): def set_resources(**kwargs): if path not in self._resource_dict: self._resource_list.append(kwargs) self._resource_dict[path] = kwargs else: if self._resource_dict[path] != kwargs: raise...
17,247
[ -0.032033052295446396, -0.03466418758034706, 0.012289080768823624, 0.0025436936412006617, 0.05851148068904877, -0.004463536199182272, -0.01975441165268421, 0.03556211665272713, -0.003163629211485386, 0.04531402885913849, -0.01661166362464428, 0.007136437576264143, 0.025622263550758362, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def wrapper(self, *args, **kwargs): if not self.current_user: if self.request.method in ("GET", "HEAD"): url = self.get_login_url() if "?" not in url: if urlparse.urlsplit(url).scheme: # if login url is absolute, make next a...
17,248
[ 0.0080702630802989, 0.04567202180624008, 0.058013543486595154, -0.03677269443869591, -0.013212563470005989, -0.06808825582265854, -0.01754678785800934, 0.000486354052554816, 0.04164213687181473, 0.03450588509440422, -0.02831413596868515, 0.00008510376210324466, 0.01539541780948639, -0.0308...
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 javascript_files(self): result = [] for f in self._get_resources("javascript_files"): if isinstance(f, (unicode_type, bytes_type)): result.append(f) else: result.extend(f) return result
17,249
[ 0.03660845384001732, 0.03686341643333435, 0.063655786216259, -0.026686139404773712, -0.01349179819226265, -0.04291879013180733, -0.0038111673202365637, -0.03289024159312248, 0.0233716182410717, 0.038265712559223175, -0.033230192959308624, -0.02768474444746971, -0.019132856279611588, -0.029...
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 css_files(self): result = [] for f in self._get_resources("css_files"): if isinstance(f, (unicode_type, bytes_type)): result.append(f) else: result.extend(f) return result
17,250
[ 0.0198463574051857, 0.027845270931720734, 0.05410585179924965, -0.035938508808612823, 0.008390368893742561, -0.0196765698492527, 0.01888422481715679, 0.00876767560839653, 0.04278663545846939, 0.006187838036566973, -0.014045259915292263, -0.05312485247850418, 0.01943131908774376, -0.0209782...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def set_resources(**kwargs): if path not in self._resource_dict: self._resource_list.append(kwargs) self._resource_dict[path] = kwargs else: if self._resource_dict[path] != kwargs: raise ValueError("set_resources called with dif...
17,251
[ 0.02853419817984104, 0.011013386771082878, 0.01989687606692314, -0.0017686707433313131, 0.0001846267405198887, 0.015872549265623093, -0.024381432682275772, 0.019747033715248108, 0.016750194132328033, 0.05017566308379173, -0.023653630167245865, -0.04388229921460152, 0.0430474653840065, -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": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_commen...
def reverse(self, *args): assert self._path is not None, \ "Cannot reverse url regex " + self.regex.pattern assert len(args) == self._group_count, "required number of arguments "\ "not found" if not len(args): return self._path converted_args = [] ...
17,252
[ 0.022905709221959114, -0.038012824952602386, -0.018175413832068443, 0.008762765675783157, 0.01972021721303463, 0.019411256536841393, 0.04199735075235367, -0.02495124191045761, 0.03330383449792862, 0.003893970511853695, 0.004847487434744835, -0.041805583983659744, -0.01755749247968197, 0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}], "kwarg": null, "var...
def _time_independent_equals(a, b): if len(a) != len(b): return False result = 0 if isinstance(a[0], int): # python3 byte strings for x, y in zip(a, b): result |= x ^ y else: # python2 for x, y in zip(a, b): result |= ...
17,253
[ 0.07138648629188538, 0.0020191532094031572, -0.007295892108231783, -0.04578763246536255, -0.013866043649613857, 0.03393387049436569, -0.013338232412934303, -0.028435835614800453, 0.01281042117625475, -0.023905454203486443, 0.027952007949352264, 0.0013930645072832704, -0.06575649231672287, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "secret", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "a...
def decode_signed_value(secret, name, value, max_age_days=31, clock=None, min_version=None): if clock is None: clock = time.time if min_version is None: min_version = DEFAULT_SIGNED_VALUE_MIN_VERSION if min_version > 2: raise ValueError("Unsupported min_version %d" % min_version) ...
17,254
[ -0.01891915686428547, -0.010802156291902065, 0.0694112628698349, -0.019053414463996887, -0.0002870458993129432, -0.0013474724255502224, -0.010617551393806934, -0.0076079401187598705, -0.052718549966812134, -0.04182129353284836, -0.0073729888536036015, -0.028977300971746445, 0.031237306073307...
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 alias_groups(self): return BuildFileAliases.create( targets={ 'target': Dependencies, 'jar_library': JarLibrary, 'java_library': JavaLibrary, }, objects={ 'artifact': Artifact, 'jar': JarDependency, 'repo': Repository(name='repo', ...
17,255
[ -0.03038044273853302, 0.002742332872003317, 0.0709208995103836, -0.04198477417230606, 0.013372374698519707, 0.067683644592762, -0.005223195068538189, -0.018838364630937576, -0.01999630779027939, 0.012033892795443535, 0.03023103065788746, -0.012949041090905666, 0.044101446866989136, 0.01232...
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 CheckPublishedDepsTest(ConsoleTaskTestBase): @property def alias_groups(self): return BuildFileAliases.create( targets={ 'target': Dependencies, 'jar_library': JarLibrary, 'java_library': JavaLibrary, }, objects={ 'artifact': Artifact, 'jar': JarD...
17,256
[ 0.01362095307558775, -0.0224588792771101, 0.06784113496541977, -0.041478000581264496, -0.037962913513183594, 0.033368196338415146, 0.014135661534965038, -0.03344351798295975, -0.02441728487610817, 0.01822822540998459, 0.03341841325163841, -0.006057244259864092, 0.010746115818619728, -0.020...
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): super(CheckPublishedDepsTest, self).setUp() self.create_file('repo/org.name/lib1/publish.properties', dedent(""" revision.major.org.name%lib1=2 revision.minor.org.name%lib1=0 revision.patch.org.name%lib1=0 revision.sha.org.name%lib1=12345 """)) self....
17,257
[ -0.004715965129435062, -0.021635551005601883, -0.03442976251244545, -0.002359444508329034, 0.004906007554382086, 0.017565729096531868, -0.01879369281232357, 0.006800579838454723, 0.006952613592147827, 0.033751457929611206, -0.0031663919799029827, -0.010215488262474537, 0.010379216633737087, ...
14
{"_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 sync_starred_events(request): context = {'csrf_token': request.csrf_token} if request.user.is_anonymous(): context['ids'] = [] return context elif request.method == 'POST': ids = request.POST.getlist('ids') StarredEvent.objects.filter(user=request.user).exclude( ...
17,258
[ 0.012997236102819443, 0.009357466362416744, 0.04992459714412689, -0.031535614281892776, 0.006889078300446272, 0.01316021103411913, 0.0045021772384643555, -0.029471267014741898, 0.015998687595129013, 0.03077506460249424, 0.031426962465047836, -0.04525265470147133, -0.02773286961019039, 0.03...
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 Clic2MailXMLTest(unittest.TestCase): def _get_manifest(self): filename = os.path.join(os.path.dirname(__file__), "mailing_dir", "manifest.json") with open(filename) as fh: data = json.load(fh) return data def assertBigTextEquals(self, desired, actual): ...
17,259
[ 0.0007341767777688801, -0.025370225310325623, -0.03085370361804962, 0.010668410919606686, 0.014549494720995426, 0.017474016174674034, -0.04852268844842911, -0.017924880608916283, 0.021288080140948296, 0.03906673565506935, 0.0167428869754076, -0.05220271274447441, 0.05269012972712517, -0.02...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "page", "annotation": null, "type_comment": null}}], "kwarg": n...
def home(request, page=1): template_name = 'starred/home.html' ids = request.GET.get('ids') if request.is_ajax(): template_name = 'starred/events.html' if request.user.is_authenticated(): events = ( Event.objects.filter(starredevent__user=request.user.id) .order_...
17,260
[ -0.00326367374509573, 0.00235295994207263, 0.05893572047352791, -0.011761413887143135, 0.008599306456744671, -0.02319781482219696, -0.020611250773072243, -0.045610178261995316, -0.014869351871311665, -0.0008485044236294925, 0.012485922314226627, -0.03293466567993164, -0.04439137876033783, ...
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_collate_postcards(self): manifest = self._get_manifest() files, vals, page = collate_postcards(manifest["postcards"], 1) self.assertEquals(files, [ os.path.join("postcards", "waitlist.pdf") ]) self.assertEquals(vals, [{'endingPage': 1, 'recipient'...
17,261
[ 0.031379058957099915, 0.02053214982151985, 0.04296775907278061, -0.035381920635700226, 0.011266790330410004, 0.021189963445067406, -0.02205771580338478, -0.04131622985005379, -0.0085305692628026, 0.029727529734373093, -0.0035392416175454855, -0.021861771121621132, -0.013310207985341549, 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_collate_letters(self): manifest = self._get_manifest() files, vals, page = collate_letters(MAILDIR, manifest["letters"], 1) self.assertEquals(files, [ os.path.join(MAILDIR, "letters", "frantisek-loukianos-letter10.pdf"), os.path.join(MAILDIR, "letters", "frantise...
17,262
[ 0.03521869704127312, 0.021811285987496376, 0.0501905232667923, -0.009561022743582726, -0.013381552882492542, -0.008546093478798866, 0.02177249826490879, -0.002044403925538063, 0.008138828910887241, 0.04351913928985596, 0.030176371335983276, -0.030228087678551674, -0.007815603166818619, 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_click2mail_xml(self): manifest = self._get_manifest() lfiles, ljobs, lpage = collate_letters(MAILDIR, manifest["letters"], 1) pfiles, pjobs, ppage = collate_postcards(manifest["postcards"], lpage) batch = Click2MailBatch( username="username", pas...
17,263
[ -0.008133957162499428, -0.0032284781336784363, 0.10395398736000061, 0.019883006811141968, -0.009914725087583065, -0.020070455968379974, 0.02681862935423851, 0.011320594698190689, -0.0019447857048362494, 0.02053907886147499, 0.0034811999648809433, -0.020485522225499153, 0.02942952886223793, ...
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 TestMultiLineAddressBehavior(unittest.TestCase): def test_multi_line_addresses(self): jobs = [{ "startingPage": 0, "endingPage": 1, "type": "letter", "recipients": [{ "name": "Kyle De Wolf", "address1": "14966-052", ...
17,264
[ -0.011922397650778294, -0.009406917728483677, 0.09950428456068039, -0.005724283866584301, -0.012863089330494404, -0.02458341233432293, 0.02550319954752922, 0.008988832123577595, -0.007316491566598415, 0.01903681457042694, 0.0158036220818758, -0.01113500352948904, 0.010110694915056229, 0.01...
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_multi_line_addresses(self): jobs = [{ "startingPage": 0, "endingPage": 1, "type": "letter", "recipients": [{ "name": "Kyle De Wolf", "address1": "14966-052", "address2": "Low Security Correctional Institutio...
17,265
[ 0.037344977259635925, 0.0020917875226587057, -0.020040621981024742, -0.005539040546864271, 0.005288849584758282, 0.01836845837533474, 0.03040296770632267, 0.011369442567229271, 0.06698787212371826, 0.013655999675393105, 0.0006044965120963752, 0.002346728928387165, -0.012522222474217415, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "child", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def testfunc(child): child.expect(r"Compressing message \(len: (\d+)\): \"([A-Za-z\., ]+)\"\r\n") msg_len = int(child.match.group(1)) msg = str(child.match.group(2)) assert msg_len == len(msg), "Wrong msg_len: {} (expected: {})".format(len(msg), msg_len) child.expect(r"Message compressed to \d+ raw ...
17,266
[ -0.00878354161977768, -0.06026234105229378, 0.03791864216327667, -0.033956993371248245, 0.011862309649586678, -0.03400226682424545, 0.004340835381299257, 0.016978496685624123, -0.011613291688263416, 0.01847260445356369, 0.0021774922497570515, 0.02594314143061638, -0.03191957250237465, 0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "input_batch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type...
def vgg_pool5(input_batch, name, reuse=None): with tf.variable_scope(name, reuse=reuse): # layer 1 conv1_1 = conv_relu('conv1_1', input_batch, kernel_size=3, stride=1, output_dim=64) conv1_2 = conv_relu('conv1_2', conv1_1, kernel_size=3...
17,267
[ -0.012300343252718449, 0.015557028353214264, 0.021017123013734818, -0.012397196143865585, 0.002363820793107152, -0.0077421944588422775, 0.03227629512548447, 0.0036562043242156506, -0.02554500475525856, 0.044358719140291214, 0.013680499978363514, -0.019394833594560623, -0.021997759118676186, ...
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": "baseurl", "annotation": null, "type_comment": null}}, {"_type": "...
def __init__(self, baseurl, id_, jenkins_obj): logging.basicConfig() self.jenkins_obj = jenkins_obj assert self.RE_MD5.search(id_), ("%s does not look like " "a valid id" % id_) url = "%s/fingerprint/%s/" % (baseurl, id_) JenkinsBase.__ini...
17,268
[ -0.0020351193379610777, 0.024828454479575157, 0.016167892143130302, 0.01790904998779297, -0.03846375271677971, 0.008869728073477745, -0.029690127819776535, -0.014460653066635132, -0.04025013744831085, 0.03335334360599518, 0.02430836856365204, -0.015659112483263016, -0.01195067260414362, -0...
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 validate(self): try: assert self.valid() except AssertionError: raise ArtifactBroken( "Artifact %s seems to be broken, check %s" % (self.id_, self.baseurl)) except requests.exceptions.HTTPError: raise ArtifactBroken( ...
17,269
[ -0.03630742058157921, 0.02018522471189499, 0.03146485611796379, -0.04984297603368759, -0.028204983100295067, -0.01642928458750248, 0.02548842318356037, -0.03581135347485542, -0.017882052809000015, 0.027661669999361038, 0.021472638472914696, -0.005329773295670748, -0.013252089731395245, -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": "filename", "annotation": null, "type_comment": null}}, {"_type": ...
def validate_for_build(self, filename, job, build): if not self.valid(): log.info("Unknown to jenkins.") return False if self.unknown: # not request error, but unknown to jenkins return True if not self._data["original"] is None: if sel...
17,270
[ 0.035073187202215195, 0.012350675649940968, -0.04132813587784767, -0.01577383652329445, -0.032980624586343765, -0.015205205418169498, 0.0169111005961895, 0.009194770827889442, 0.027044111862778664, 0.06823577731847763, -0.021721722558140755, -0.006562007125467062, -0.010576545260846615, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": ...
class ListCompleter(Completer): def __init__( self, start: str, options: typing.Sequence[str], ) -> None: self.start = start self.options: typing.Sequence[str] = [] for o in options: if o.startswith(start): self.options.append(o) ...
17,271
[ 0.041406769305467606, -0.0036966162733733654, 0.053450681269168854, -0.03176697716116905, -0.03734545409679413, -0.00875867623835802, 0.033844318240880966, -0.03419443219900131, -0.040123019367456436, 0.03225713595747948, -0.0008789310813881457, 0.0023209615610539913, 0.013841158710420132, ...
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": "start", "annotation": {"_type": "Name", "_fields": {"id": "str", ...
def __init__( self, start: str, options: typing.Sequence[str], ) -> None: self.start = start self.options: typing.Sequence[str] = [] for o in options: if o.startswith(start): self.options.append(o) self.options.sort() self.o...
17,272
[ 0.000012412367141223513, 0.03397044166922569, 0.003896744456142187, -0.004896718077361584, -0.016985220834612846, -0.003263523569330573, -0.01696229912340641, 0.02291056513786316, -0.006446819752454758, 0.002075876109302044, 0.0022334649693220854, 0.025878967717289925, 0.020159922540187836, ...
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": "txt", "annotation": null, "type_comment": null}}], "kwarg": null,...
def parse_quoted(self, txt): parts, remhelp = self.master.commands.parse_partial(txt) for i, p in enumerate(parts): parts[i] = mitmproxy.command.ParseResult( value = self.maybequote(p.value), type = p.type, valid = p.valid ) ...
17,273
[ 0.06562469154596329, 0.052154093980789185, 0.014970156364142895, -0.0018188486574217677, -0.014309334568679333, 0.015325983986258507, 0.030372388660907745, 0.045469626784324646, 0.03586229309439659, 0.05932147055864334, 0.022086700424551964, 0.014576205052435398, -0.014690577983856201, -0....
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 cycle_completion(self) -> None: if not self.completion: parts, remainhelp = self.master.commands.parse_partial(self.text[:self.cursor]) last = parts[-1] ct = mitmproxy.types.CommandTypes.get(last.type, None) if ct: self.completion = CompletionS...
17,274
[ 0.04779389873147011, 0.0072100902907550335, 0.050163090229034424, 0.0009162111091427505, -0.021254388615489006, 0.03988899663090706, 0.0032975056674331427, 0.03230302780866623, -0.021060753613710403, 0.0208785068243742, -0.012996386736631393, -0.013907614164054394, 0.020411502569913864, 0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": ": "}}, "targets": [{"_type": "Name", "_fields": {"id": "leader", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_...
class CommandEdit(urwid.WidgetWrap): leader = ": " def __init__(self, master: mitmproxy.master.Master, text: str) -> None: super().__init__(urwid.Text(self.leader)) self.master = master self.cbuf = CommandBuffer(master, text) self.update() def keypress(self, size, key): ...
17,275
[ 0.06170676276087761, 0.011458068154752254, 0.03860031068325043, 0.021057769656181335, -0.005331612192094326, 0.022994501516222954, 0.03204004839062691, 0.060005124658346176, -0.022826576605439186, 0.018158268183469772, -0.0005135699757374823, -0.006672211457043886, -0.011575615964829922, 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": "size", "annotation": null, "type_comment": null}}, {"_type": "arg...
def keypress(self, size, key): if key == "backspace": self.cbuf.backspace() elif key == "left": self.cbuf.left() elif key == "right": self.cbuf.right() elif key == "tab": self.cbuf.cycle_completion() elif len(key) == 1: ...
17,276
[ 0.03221803158521652, -0.011504799127578735, 0.03279212489724159, -0.035731472074985504, 0.0014840272488072515, 0.008588412776589394, -0.030564647167921066, -0.006653723772615194, 0.02672971412539482, 0.03366474434733391, 0.011148862540721893, -0.009518441744148731, -0.02776307985186577, 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_sparse_max_row(self): s = pd.Series([1, np.nan, np.nan, 3, np.nan]).to_sparse() result = repr(s) dfm = self.dtype_format_for_platform exp = ("0 1.0\n1 NaN\n2 NaN\n3 3.0\n" "4 NaN\ndtype: Sparse[float64, nan]\nBlockIndex\n" "Block loca...
17,277
[ -0.004228414036333561, -0.022752000018954277, 0.03688430041074753, -0.03628292679786682, 0.030494697391986847, 0.04778421297669411, -0.003702211659401655, -0.020233744755387306, 0.03778636083006859, 0.02751288190484047, 0.01579860784113407, -0.01029227301478386, -0.005979291163384914, 0.04...
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 TestSparseSeriesFormatting(object): @property def dtype_format_for_platform(self): return '' if use_32bit_repr else ', dtype=int32' def test_sparse_max_row(self): s = pd.Series([1, np.nan, np.nan, 3, np.nan]).to_sparse() result = repr(s) dfm = self.dtype_format_for_pl...
17,278
[ 0.048300355672836304, -0.004522748291492462, 0.05618965998291969, -0.03341207280755043, 0.011215673759579659, 0.0161743126809597, -0.018412500619888306, -0.000015263889508787543, 0.0321260429918766, 0.03665188327431679, 0.01734905317425728, -0.0337088517844677, -0.044813234359025955, 0.031...
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_sparsea_max_row_truncated(self): s = pd.Series([1, np.nan, np.nan, 3, np.nan]).to_sparse() dfm = self.dtype_format_for_platform with option_context("display.max_rows", 3): # GH 10560 result = repr(s) exp = ("0 1.0\n ... \n4 NaN\n" ...
17,279
[ 0.009353291243314743, -0.014574160799384117, 0.036650631576776505, -0.03296097368001938, -0.016222210600972176, 0.020772792398929596, -0.011259615421295166, -0.00754535710439086, 0.038544658571481705, 0.020772792398929596, 0.007945070043206215, -0.022125666961073875, -0.006764378398656845, ...
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_sparse_mi_max_row(self): idx = pd.MultiIndex.from_tuples([('A', 0), ('A', 1), ('B', 0), ('C', 0), ('C', 1), ('C', 2)]) s = pd.Series([1, np.nan, np.nan, 3, np.nan, np.nan], index=idx).to_sparse() result = repr(s) dfm...
17,280
[ 0.010600526817142963, -0.049038730561733246, 0.01763741672039032, -0.03279578313231468, 0.020594201982021332, 0.015300394035875797, -0.007830961607396603, -0.0009490118245594203, 0.06321580708026886, 0.030420023947954178, 0.017430828884243965, -0.027708562090992928, 0.0224018432199955, 0.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_sparse_int(self): # GH 13110 s = pd.SparseSeries([0, 1, 0, 0, 1, 0], fill_value=False) result = repr(s) dtype = '' if use_32bit_repr else ', dtype=int32' exp = ("0 0\n1 1\n2 0\n3 0\n4 1\n" "5 0\ndtype: Sparse[int64, False]\nBlockIndex\n"...
17,281
[ 0.011671094223856926, -0.03571482375264168, -0.0033705863170325756, -0.02400546334683895, -0.005985421594232321, 0.03721994906663895, -0.004971375688910484, -0.022449316456913948, 0.0506640262901783, 0.0367862693965435, 0.00998101755976677, -0.02841879427433014, 0.015880340710282326, 0.033...
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_sparse_bool(self): # GH 13110 s = pd.SparseSeries([True, False, False, True, False, False], fill_value=False) result = repr(s) dtype = '' if use_32bit_repr else ', dtype=int32' exp = ("0 True\n1 False\n2 False\n" "3 ...
17,282
[ 0.0027365118730813265, -0.020020674914121628, 0.0185141209512949, -0.016607390716671944, 0.014253402128815651, 0.07236161828041077, 0.02409307472407818, -0.026600074023008347, -0.010669454000890255, 0.013982693664729595, 0.016583850607275963, -0.009957372210919857, 0.006667673122137785, 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 TestSparseDataFrameFormatting(object): def test_sparse_frame(self): # GH 13110 df = pd.DataFrame({'A': [True, False, True, False, True], 'B': [True, False, True, False, True], 'C': [0, 0, 3, 0, 5], 'D': [np.nan, ...
17,283
[ 0.023129159584641457, -0.04848793148994446, 0.016415823251008987, -0.02345992624759674, 0.035820793360471725, 0.0528736487030983, 0.0033597308211028576, -0.01838817074894905, 0.00025305175222456455, 0.02810290828347206, 0.01448022574186325, -0.020666785538196564, 0.014982501044869423, 0.06...
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_sparse_frame(self): # GH 13110 df = pd.DataFrame({'A': [True, False, True, False, True], 'B': [True, False, True, False, True], 'C': [0, 0, 3, 0, 5], 'D': [np.nan, np.nan, np.nan, 1, 2]}) sparse = df.to_spa...
17,284
[ -0.0069439164362847805, 0.03255577012896538, 0.07801318913698196, -0.027566825971007347, 0.0064682262018322945, 0.012170706875622272, 0.03538670763373375, 0.009409383870661259, 0.014699986204504967, -0.045039739459753036, -0.007727064657956362, -0.01790219359099865, 0.010888664051890373, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"...
class BaseSecGroupTest(base.BaseNetworkTest): @classmethod def resource_setup(cls): super(BaseSecGroupTest, cls).resource_setup() def _create_security_group(self): # Create a security group name = data_utils.rand_name('secgroup-') group_create_body = self.client.create_secu...
17,285
[ 0.03156925365328789, -0.026226762682199478, 0.02097374200820923, -0.01867314800620079, -0.03162037581205368, 0.03849659487605095, 0.04235647991299629, 0.00017234479309991002, 0.01207172404974699, -0.0021248534321784973, 0.040362630039453506, -0.019861789420247078, -0.0211526770144701, 0.03...
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_sparse_repr_after_set(self): # GH 15488 sdf = pd.SparseDataFrame([[np.nan, 1], [2, np.nan]]) res = sdf.copy() # Ignore the warning with pd.option_context('mode.chained_assignment', None): sdf[0][1] = 2 # This line triggers the bug repr(sdf) ...
17,286
[ 0.011781233362853527, -0.0026862791273742914, 0.08137466013431549, 0.008499318733811378, 0.0382048562169075, -0.013222331181168556, 0.008862222544848919, 0.03490190580487251, 0.023520391434431076, -0.04510529339313507, 0.013916581869125366, 0.0015397125389426947, 0.018292468041181564, -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 _create_security_group(self): # Create a security group name = data_utils.rand_name('secgroup-') group_create_body = self.client.create_security_group(name=name) self.addCleanup(self._delete_security_group, group_create_body['security_group']['id']) se...
17,287
[ 0.012284055352210999, 0.006472632754594088, 0.038164254277944565, -0.005671948194503784, -0.004243629518896341, 0.055996280163526535, -0.007619420066475868, 0.043639905750751495, 0.06037680432200432, -0.031076902523636818, 0.04479702562093735, -0.06901387125253677, -0.0007199706742540002, ...
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": "secgroup_id", "annotation": null, "type_comment": null}}], "kwarg...
def _delete_security_group(self, secgroup_id): self.client.delete_security_group(secgroup_id) # Asserting that the security group is not found in the list # after deletion list_body = self.client.list_security_groups() secgroup_list = list() for secgroup in list_body['sec...
17,288
[ 0.030159078538417816, 0.041972920298576355, 0.03226796165108681, 0.001859349082224071, -0.027354057878255844, 0.041972920298576355, -0.010457399301230907, 0.037693727761507034, 0.026350803673267365, -0.011936688795685768, 0.04922092705965042, -0.08255356550216675, 0.018928762525320053, -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": "rule_id", "annotation": null, "type_comment": null}}], "kwarg": n...
def _delete_security_group_rule(self, rule_id): self.client.delete_security_group_rule(rule_id) # Asserting that the security group is not found in the list # after deletion list_body = self.client.list_security_group_rules() rules_list = list() for rule in list_body['sec...
17,289
[ -0.005336302798241377, 0.026852862909436226, 0.04043840616941452, -0.012202508747577667, -0.018909605219960213, 0.019949939101934433, 0.04616636410355568, -0.004635607358068228, 0.003329069586470723, 0.043400298804044724, 0.0282481350004673, -0.01657191291451454, -0.017759118229150772, -0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "factory", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "X", "annotation": null, "type_comment": null}}, {"_type": "arg...
def bench(factory, X, Y, X_test, Y_test, ref_coef): gc.collect() # start time tstart = time() clf = factory(alpha=alpha).fit(X, Y) delta = (time() - tstart) # stop time print("duration: %0.3fs" % delta) print("rmse: %f" % rmse(Y_test, clf.predict(X_test))) print("mean coef abs diff...
17,290
[ 0.015622195787727833, -0.03829814866185188, 0.03307969495654106, -0.02262067422270775, 0.01866260915994644, 0.0246770977973938, 0.014638206921517849, -0.0008879388333298266, 0.0035406993702054024, 0.011105800047516823, 0.01876211352646351, -0.018861617892980576, 0.004190241917967796, -0.04...
9
{"_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": "challenges.json"}}]}}, "targets": [{"_type": "Name", "_fi...
class ChallengeTestCase(TestCase): fixtures = ['challenges.json'] def setUp(self): self.easy = Challenge.objects.get(pk=1) def test_create(self): self.assertIsInstance(self.easy, Challenge) def test_as_dict(self): easy_dict = self.easy.as_dict() values = [ ...
17,291
[ -0.01880376785993576, -0.006142966914921999, 0.022878924384713173, -0.012733355164527893, 0.06249380484223366, 0.013882137835025787, -0.032480333000421524, 0.02607133239507675, 0.04157385975122452, 0.023834228515625, 0.03572111204266548, -0.03497137874364853, 0.03342354670166969, -0.025902...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fos", "annotation": null, "type_comment": null}}], "kwarg": null,...
def fortios_firewall_ssh(data, fos): login(data) methodlist = ['firewall_ssh_setting'] for method in methodlist: if data[method]: resp = eval(method)(data, fos) break fos.logout() return not resp['status'] == "success", resp['status'] == "success", resp
17,292
[ 0.0037227561697363853, -0.03468012437224388, 0.04495733603835106, -0.02282853052020073, 0.003638023743405938, 0.016552871093153954, 0.023003462702035904, -0.014235032722353935, -0.0015757480869069695, 0.027092481032013893, 0.014136633835732937, -0.0033892933279275894, 0.03137829527258873, ...
9
{"_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": "challenges.json"}}, {"_type": "Constant", "_fields": {"ki...
class CompletedChallengeTestCase(TestCase): fixtures = [ 'challenges.json', 'users.json', 'cryptographers.json', 'completed_challenges.json' ] def setUp(self): self.challenge = Challenge.objects.get(pk=1) self.crypto = Cryptographer.objects.get(pk=1) de...
17,293
[ 0.02999957837164402, -0.03445019945502281, -0.005211434327065945, -0.0203886479139328, 0.04674353078007698, 0.005334728863090277, -0.022589899599552155, 0.01433821115642786, 0.01477124448865652, 0.028363674879074097, 0.03466671332716942, -0.027666011825203896, 0.014001407660543919, 0.00180...
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_as_dict(self): easy_dict = self.easy.as_dict() values = [ ('pk', int), ('name', str), ('problem', str), ('description', str), ('cipher', str), ('points', int), ('points_required', int) ] for valu...
17,294
[ 0.020599979907274246, 0.015719985589385033, 0.0698665976524353, -0.033146634697914124, -0.011266656219959259, -0.01293998770415783, 0.0010733322706073523, -0.029679972678422928, -0.01801331713795662, 0.018613316118717194, 0.002483330899849534, -0.06154660880565643, -0.010673323646187782, -...
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": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding M2M table for field leaders on 'Project' db.create_table('project_leaders', ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('project', models.ForeignKey(orm['projects.pro...
17,295
[ 0.04960184916853905, 0.014784738421440125, 0.09006768465042114, -0.014038259163498878, -0.012055076658725739, 0.01593231037259102, 0.03701198101043701, 2.1488685320036893e-7, -0.010500840842723846, -0.0021503048483282328, 0.009548244066536427, -0.030683623626828194, 0.0399310477077961, -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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def forwards(self, orm): # Adding M2M table for field leaders on 'Project' db.create_table('project_leaders', ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('project', models.ForeignKey(orm['projects.project'], null=False)), ('per...
17,296
[ 0.0016892097191885114, -0.008070817217230797, 0.06751497834920883, 0.0019269009353592992, -0.02008356899023056, 0.010623994283378124, -0.02168598212301731, 0.009534354321658611, 0.013139781542122364, 0.04696136713027954, -0.011366445571184158, -0.055635761469602585, 0.04070127755403519, -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 get_urlpatterns(self): urlpatterns = [] for name, class_ in self._endpoints.items(): pattern = url( r'^{}/'.format(name), include(class_.get_urlpatterns(), namespace=name) ) urlpatterns.append(pattern) decorate_urlpatterns...
17,297
[ -0.01358761452138424, 0.04815567284822464, 0.058558233082294464, -0.05177903547883034, 0.013719107024371624, 0.022572971880435944, -0.01719636842608452, -0.032990142703056335, -0.006687881890684366, 0.013149304315447807, 0.012462617829442024, -0.013573003932833672, 0.027730420231819153, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def register_types(module): root_module = module.get_root() ## log.h (module 'core'): ns3::LogLevel [enumeration] module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEV...
17,298
[ -0.0238760057836771, 0.035243358463048935, 0.05106939375400543, -0.046473756432533264, 0.005166287068277597, 0.024378178641200066, -0.011002136394381523, -0.0170282032340765, 0.03783030807971954, 0.008719535544514656, 0.030708592385053635, -0.017895592376589775, 0.002566023962572217, 0.009...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "root_module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar...
def register_methods(root_module): register_Ns3AttributeConstructionList_methods(root_module, root_module['ns3::AttributeConstructionList']) register_Ns3AttributeConstructionListItem_methods(root_module, root_module['ns3::AttributeConstructionList::Item']) register_Ns3CallbackBase_methods(root_module, root_...
17,299
[ -0.03564143553376198, 0.042635880410671234, 0.04956555739045143, -0.03710940480232239, 0.02454531379044056, 0.020627129822969437, 0.00009975918510463089, -0.009709106758236885, -0.017129909247159958, 0.013621893711388111, 0.01251012273132801, -0.03039560467004776, 0.008888770826160908, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def register_types_ns3_Hash(module): root_module = module.get_root() ## hash-function.h (module 'core'): ns3::Hash::Implementation [class] module.add_class('Implementation', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'...
17,300
[ -0.012688337825238705, 0.013323342427611351, 0.045226458460092545, -0.03842955455183983, 0.016886426135897636, 0.03922918811440468, 0.0019432324916124344, -0.011224298737943172, 0.0023842081427574158, 0.044473860412836075, 0.030150972306728363, -0.01815643534064293, -0.0011840194929391146, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "root_module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg"...
def register_Ns3CommandLine_methods(root_module, cls): ## command-line.h (module 'core'): ns3::CommandLine::CommandLine() [constructor] cls.add_constructor([]) ## command-line.h (module 'core'): ns3::CommandLine::CommandLine(ns3::CommandLine const & cmd) [copy constructor] cls.add_constructor([param('ns...