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
18,601
[ 0.0354885570704937, 0.03269263729453087, 0.01693493314087391, -0.03960885852575302, 0.0185904111713171, -0.002008034149184823, 0.03301146999001503, -0.013047624379396439, 0.0003657764755189419, -0.004083513747900724, 0.024255827069282532, -0.04063893482089043, -0.023139912635087967, -0.019...
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_basic_manager(self): fake_loader = DictDataLoader({}) v = VariableManager() vars = v.get_vars(loader=fake_loader, use_cache=False) if 'omit' in vars: del vars['omit'] self.assertEqual(vars, dict()) self.assertEqual( v._merge_dicts( ...
18,602
[ 0.034986238926649094, 0.020856717601418495, 0.00908412504941225, -0.0414482057094574, -0.001570281689055264, 0.013442334719002247, 0.0208326056599617, -0.040122054517269135, 0.020290089771151543, 0.0020374481100589037, 0.017686013132333755, -0.03144180402159691, -0.021809134632349014, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_variable_manager_extra_vars(self): fake_loader = DictDataLoader({}) extra_vars = dict(a=1, b=2, c=3) v = VariableManager() v.extra_vars = extra_vars vars = v.get_vars(loader=fake_loader, use_cache=False) for (key, val) in extra_vars.iteritems(): se...
18,603
[ 0.02585100196301937, 0.04938974976539612, 0.022787265479564667, -0.03012867271900177, -0.0022544478997588158, 0.004364379681646824, 0.04261484369635582, -0.06899766623973846, -0.001029675710014999, -0.02188548631966114, 0.01748064160346985, -0.013249216601252556, 0.011965915560722351, -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_variable_manager_group_vars_file(self): fake_loader = DictDataLoader({ "group_vars/all.yml": """ foo: bar """, "group_vars/somegroup.yml": """ bam: baz """ }) v = VariableManager() v.add_group_vars_fi...
18,604
[ 0.014844651333987713, 0.03141305223107338, 0.012848732061684132, -0.042254526168107986, 0.006968707777559757, -0.018711745738983154, 0.0210365392267704, -0.06518492102622986, -0.02308916114270687, 0.0030902731232345104, 0.023520097136497498, -0.0017747808014973998, -0.0028733869548887014, ...
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_variable_manager_host_vars_file(self): fake_loader = DictDataLoader({ "host_vars/hostname1.yml": """ foo: bar """ }) v = VariableManager() v.add_host_vars_file("host_vars/hostname1.yml", loader=fake_loader) self.assertIn("hostname1...
18,605
[ 0.014512414112687111, 0.026652490720152855, -0.013507801108062267, -0.05853380635380745, 0.004085020627826452, -0.014681866392493248, 0.047495171427726746, -0.058872710913419724, 0.026458829641342163, -0.01707841269671917, 0.04628479480743408, -0.037860576063394547, -0.006717589683830738, ...
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_variable_manager_play_vars(self): fake_loader = DictDataLoader({}) mock_play = MagicMock() mock_play.get_vars.return_value = dict(foo="bar") mock_play.get_roles.return_value = [] mock_play.get_vars_files.return_value = [] v = VariableManager() self.asse...
18,606
[ 0.025387544184923172, 0.03990133851766586, -0.008230664767324924, -0.06139380484819412, -0.0018591450061649084, -0.02115628682076931, 0.0498940609395504, -0.06556709855794907, 0.01609037071466446, -0.010931714437901974, 0.0319952629506588, -0.03519478812813759, 0.01416601799428463, -0.0326...
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_variable_manager_play_vars_files(self): fake_loader = DictDataLoader({ "/path/to/somefile.yml": """ foo: bar """ }) mock_play = MagicMock() mock_play.get_vars.return_value = dict() mock_play.get_roles.return_value = [] mock...
18,607
[ 0.03988494724035263, -0.004507893696427345, 0.014870459213852882, -0.0017546226736158133, 0.011516219936311245, -0.030310122296214104, 0.029984861612319946, -0.002572853583842516, -0.03108261339366436, 0.041470590978860855, -0.005671713035553694, -0.003590560285374522, 0.021812716498970985, ...
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": "chars", "annotation": ...
class CharData(FieldSet): def __init__(self, chars, *args): FieldSet.__init__(self, *args) self.chars = chars def createFields(self): for char in self.chars: yield CharBitmap(char, self, "char_bitmap[]")
18,608
[ 0.0074071018025279045, 0.04119519144296646, -0.013551956042647362, -0.03961164504289627, 0.0032904515974223614, -0.003938788082450628, 0.04314593970775604, -0.04670318216085434, 0.0393591932952404, -0.024028616026043892, 0.046634335070848465, -0.012186432257294655, -0.005528073292225599, -...
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_variable_manager_task_vars(self): fake_loader = DictDataLoader({}) mock_task = MagicMock() mock_task._role = None mock_task.get_vars.return_value = dict(foo="bar") v = VariableManager() self.assertEqual(v.get_vars(loader=fake_loader, task=mock_task, use_cache=F...
18,609
[ 0.03202070668339729, -0.02997172810137272, 0.00262661324813962, 0.006991587113589048, -0.01347093004733324, -0.03842920437455177, 0.041807837784290314, -0.018364494666457176, -0.04481590911746025, 0.034549228847026825, -0.006610128562897444, -0.005095194093883038, 0.02428255043923855, -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}}, {"_type": "arg", "_fields": {"arg": "char", "annotation": n...
class CharBitmap(FieldSet): def __init__(self, char, *args): FieldSet.__init__(self, *args) self.char = char def createFields(self): width = self.char["width_pixels"].value for line in xrange(self.char["height_pixels"].value): yield GenericVector(self, "line[]", width, ...
18,610
[ 0.03996741771697998, -0.04363856092095375, 0.03513811156153679, -0.014924956485629082, -0.011494182981550694, -0.024299489334225655, 0.02048630639910698, -0.012663268484175205, -0.03697368502616882, 0.010887788608670235, -0.029434723779559135, -0.011658073402941227, 0.036274418234825134, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": 16}}, "right": {"_type": "Constant", "_fields": {"kind": nu...
class CharInfo(FieldSet): static_size = 16 * 8 def createFields(self): yield UInt32(self, "data_offset") yield UInt8(self, "logical_width") yield UInt8(self, "unknown[]") yield UInt8(self, "unknown[]") yield UInt8(self, "unknown[]") yield UInt32(self, "width_pixels") yield UInt32(self, ...
18,611
[ 0.03394987806677818, 0.0007397005101665854, 0.04630366712808609, 0.02033996395766735, -0.023739561438560486, -0.04706425592303276, 0.0009658601484261453, -0.015787960961461067, -0.0169634148478508, 0.00018222417565993965, -0.0099913589656353, -0.011017000302672386, -0.002391242189332843, -...
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 createFields(self): yield UInt32(self, "data_offset") yield UInt8(self, "logical_width") yield UInt8(self, "unknown[]") yield UInt8(self, "unknown[]") yield UInt8(self, "unknown[]") yield UInt32(self, "width_pixels") yield UInt32(self, "height_pixels")
18,612
[ 0.009744567796587944, 0.028852062299847603, 0.004131264053285122, -0.05510896444320679, 0.020481402054429054, -0.029920658096671104, -0.01639784313738346, -0.002798700938001275, -0.0016951223369687796, 0.03689196705818176, 0.021435504779219627, -0.030175084248185158, -0.012765892781317234, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "id"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "category"}}, {"_type": "Constant"...
class LafFile(Parser): PARSER_TAGS = { "id": "lucasarts_font", "category": "game", "file_ext" : ("laf",), "min_size" : 32*8, "description" : "LucasArts Font" } endian = LITTLE_ENDIAN def validate(self): if self["num_chars"].value != 256: return "Invalid number of characters (...
18,613
[ 0.05071234330534935, 0.013316015712916851, 0.022482389584183693, -0.0034652608446776867, 0.01921222358942032, -0.04308195784687996, -0.0010637328960001469, 0.0079029006883502, -0.006509364116936922, 0.023423802107572556, 0.014393684454262257, -0.015409417450428009, -0.014790068380534649, -...
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 createFields(self): yield UInt32(self, "num_chars") yield UInt32(self, "raw_font_data_size") yield UInt32(self, "max_char_width") yield UInt32(self, "min_char_width") yield UInt32(self, "unknown[]", 4) yield UInt32(self, "unknown[]", 4) yield UInt32(self, "first_char_code") yield UIn...
18,614
[ 0.059121809899806976, -0.0017587317852303386, 0.005436080042272806, -0.020595518872141838, 0.014081696979701519, 0.024681461974978447, -0.021791692823171616, 0.023722153156995773, 0.021211370825767517, 0.08219258487224579, 0.016391143202781677, -0.008379142731428146, -0.018428193405270576, ...
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 validate(self): if self["num_chars"].value != 256: return "Invalid number of characters (%u)" % self["num_chars"].value if self["first_char_code"].value != 0: return "Invalid of code of first character code (%u)" % self["first_char_code"].value if self["last_char_code"].value != 255: ...
18,615
[ 0.023315628990530968, 0.03423435986042023, 0.04099451005458832, -0.02057609148323536, -0.00535096600651741, 0.00009446413605473936, 0.03492417186498642, 0.025247100740671158, -0.03218463435769081, 0.027395369485020638, 0.0030105344485491514, -0.010435862466692924, -0.0015545394271612167, -...
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": "documents", "annotation": null, "type_comment": null}}, {"_type":...
def scan_vocab(self, documents, progress_per=10000, trim_rule=None): logger.info("collecting all words and their counts") document_no = -1 total_words = 0 min_reduce = 1 interval_start = default_timer() interval_count = 0 vocab = defaultdict(int) for docum...
18,616
[ 0.052056048065423965, 0.02145649492740631, 0.036477230489254, -0.024579383432865143, -0.07684916257858276, 0.018404852598905563, 0.018630459904670715, 0.01517509762197733, -0.04258051514625549, 0.024983102455735207, 0.004129217471927404, 0.010063298046588898, -0.0039837597869336605, -0.018...
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": "model", "annotation": null, "type_comment": null}}], "kwarg": nul...
def reset_weights(self, model): length = max(len(self.doctags), self.count) if self.mapfile_path: self.doctag_syn0 = np_memmap(self.mapfile_path+'.doctag_syn0', dtype=REAL, mode='w+', shape=(length, model.vector_size)) self.doctag_syn0_loc...
18,617
[ -0.017720261588692665, 0.048312678933143616, 0.019945820793509483, -0.03339541703462601, 0.002748866332694888, -0.02964204177260399, 0.05317281559109688, -0.012739822268486023, 0.008234568871557713, 0.019488679245114326, -0.0016150340670719743, -0.030484145507216454, 0.007320284843444824, ...
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 __iter__(self): for fname in os.listdir(self.dirname): fname = os.path.join(self.dirname, fname) if not os.path.isfile(fname): continue for item_no, line in enumerate(utils.smart_open(fname)): line = utils.to_unicode(line) #...
18,618
[ -0.005640384741127491, 0.05065334588289261, 0.02828756906092167, -0.004762515425682068, -0.023258939385414124, -0.00045384603436104953, 0.041305724531412125, 0.03959280624985695, -0.023723874241113663, 0.019796403124928474, 0.02652571350336075, 0.02789604477584362, -0.0032759499736130238, ...
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": "job", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def _do_train_job(self, job, alpha, inits): work, neu1 = inits tally = 0 raw_tally = 0 for doc in job: indexed_doctags = self.docvecs.indexed_doctags(doc.tags) doctag_indexes, doctag_vectors, doctag_locks, ignored = indexed_doctags if self.sg: ...
18,619
[ 0.040290649980306625, 0.0057349978014826775, -0.02068483643233776, -0.004197392612695694, 0.05809450149536133, -0.01503076497465372, -0.025831766426563263, -0.02326369658112526, 0.047822218388319016, 0.03107581101357937, -0.009360508993268013, -0.009748956188559532, 0.04344139248132706, -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": "func", "annotation": null, "type_comment": null}}], "kwarg": null...
def __call__(self, func): if not self.what: self.what = func.__name__ + '()' @functools.wraps(func) def wrapped(*args, **kwargs): msg, details = self._build_message() LOG.deprecated(msg, details) return func(*args, **kwargs) return wrapped
18,620
[ 0.07448439300060272, 0.023501528427004814, 0.04396039620041847, -0.03101082146167755, -0.05467056855559349, 0.03444294631481171, 0.015055096708238125, 0.0015776207437738776, 0.006161392666399479, 0.0026486380957067013, 0.01013206783682108, -0.026921482756733894, -0.044228147715330124, -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": "release", "annotation": null, "type_comment": null}}], "kwarg": n...
def _get_safe_to_remove_release(self, release): # TODO(dstanek): this method will have to be reimplemented once # when we get to the X release because once we get to the Y # release, what is Y+2? new_release = chr(ord(release) + self.remove_in) if new_release in self._RELEA...
18,621
[ 0.056254997849464417, 0.02111758477985859, 0.0003176092868670821, 0.031043903902173042, -0.007861996069550514, -0.051581721752882004, 0.02134597860276699, 0.02196088247001171, -0.0333629734814167, 0.02153923362493515, -0.0046249618753790855, 0.010945304296910763, 0.02589627355337143, -0.00...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class UserCreationFormExtended(UserCreationForm): def __init__(self, *args, **kwargs): super(UserCreationFormExtended, self).__init__(*args, **kwargs) self.fields['email'] = forms.EmailField( label=_("E-mail"), max_length=75, validators=[validate_email, validate_u...
18,622
[ 0.030100947245955467, -0.011183425784111023, 0.021797237917780876, 0.02843007817864418, -0.006999925710260868, -0.01754411868751049, -0.011791014112532139, -0.018240313977003098, -0.016822606325149536, 0.02063269354403019, -0.01213278342038393, -0.008082193322479725, -0.04354384168982506, ...
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 _build_message(self): details = dict(what=self.what, as_of=self._RELEASES[self.as_of], remove_in=self._get_safe_to_remove_release(self.as_of)) if self.in_favor_of: details['in_favor_of'] = self.in_favor_of msg = self._deprecated_...
18,623
[ 0.044020045548677444, 0.010466568171977997, -0.0013921575155109167, 0.01496303640305996, -0.014093970879912376, -0.02990717999637127, 0.01261089276522398, 0.02686545066535473, -0.02374815195798874, 0.02784787304699421, 0.006428248714655638, 0.015671513974666595, 0.02476835995912552, 0.0328...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class UserChangeFormExtended(UserChangeForm): def __init__(self, *args, **kwargs): super(UserChangeFormExtended, self).__init__(*args, **kwargs) self.fields['email'] = forms.EmailField( label=_("E-mail"), max_length=75, validators=[validate_email] ) d...
18,624
[ 0.00019065085507463664, 0.030393846333026886, 0.01891198381781578, -0.014662882313132286, -0.035641368478536606, -0.019991673529148102, -0.0051285261288285255, -0.0033638719469308853, -0.04492902383208275, -0.012317750602960587, -0.015347846783697605, -0.04335012286901474, -0.037916842848062...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "my", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs":...
class SearchTypeInputWdg(SelectWdg): def get_display(my): #project = Project.get() schema = Schema.get() # no hierarchy to prevent all sthpw and parent sTypes search_type_names = schema.get_search_types(hierarchy=False) search = Search('sthpw/search_object') search...
18,625
[ -0.01008303090929985, 0.01789022982120514, 0.017038315534591675, -0.025873897597193718, -0.02257576771080494, -0.017439931631088257, -0.008671285584568977, -0.007825454697012901, -0.03271356597542763, -0.003803195198997855, 0.0009698147769086063, -0.07277794182300568, -0.043739788234233856, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "my", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}...
def get_display(my): #project = Project.get() schema = Schema.get() # no hierarchy to prevent all sthpw and parent sTypes search_type_names = schema.get_search_types(hierarchy=False) search = Search('sthpw/search_object') search.add_filters('search_type', search_type_na...
18,626
[ -0.004145891405642033, 0.011534763500094414, -0.012009651400148869, 0.03984054923057556, 0.009847664274275303, 0.006051689386367798, 0.021532392129302025, 0.0005295618902891874, 0.018583092838525772, 0.04174009710550308, -0.030867677181959152, -0.023069527000188828, -0.024531681090593338, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _get_notifications(self): cr, uid, context = request.cr, request.uid, request.context Message = request.registry['mail.message'] badge_st_id = request.registry['ir.model.data'].xmlid_to_res_id(cr, uid, 'gamification.mt_badge_granted') if badge_st_id: msg_ids = Message.sea...
18,627
[ 0.021536830812692642, -0.01126788929104805, -0.02718564122915268, -0.006986686028540134, 0.025782357901334763, -0.038435693830251694, -0.032870128750801086, 0.04431045427918434, -0.0173150897026062, 0.07121068239212036, 0.03539128229022026, 0.00070201326161623, -0.012677119113504887, -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": "forum", "annotation": null, "type_comment": null}}], "kwarg": {"_...
def _prepare_forum_values(self, forum=None, **kwargs): user = request.registry['res.users'].browse(request.cr, request.uid, request.uid, context=request.context) values = { 'user': user, 'is_public_user': user.id == request.website.user_id.id, 'notifications': self._g...
18,628
[ 0.03836238756775856, -0.005926899146288633, -0.03246909752488136, -0.013545596972107887, 0.023326661437749863, -0.007568280212581158, -0.02288970723748207, 0.06018771603703499, 0.012839747592806816, 0.05821581557393074, 0.03475470840930939, 0.031236661598086357, -0.0060109286569058895, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "token", "annotation": null, "type_comment": null}}, {"_type": "ar...
def validate_email(self, token, id, email, forum_id=None, **kwargs): if forum_id: try: forum_id = int(forum_id) except ValueError: forum_id = None done = request.registry['res.users'].process_forum_validation_token(request.cr, request.uid, token, i...
18,629
[ -0.007156367413699627, -0.008755321614444256, -0.025415584444999695, 0.016588401049375534, 0.012683837674558163, -0.02232547104358673, -0.04982508718967438, 0.012456271797418594, -0.027643341571092606, 0.0660182386636734, 0.03974029794335365, -0.03087718039751053, -0.011929275467991829, -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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def questions(self, forum, tag=None, page=1, filters='all', sorting='date', search='', **post): cr, uid, context = request.cr, request.uid, request.context Post = request.registry['forum.post'] user = request.registry['res.users'].browse(cr, uid, uid, context=context) domain = [('forum_...
18,630
[ 0.006643710657954216, -0.01221604272723198, -0.05482662469148636, 0.015593213960528374, -0.022533882409334183, -0.018446341156959534, -0.043763477355241776, 0.001379254157654941, -0.013473748229444027, 0.04923682659864426, 0.02338399738073349, -0.017200281843543053, -0.002294147154316306, ...
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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def tags(self, forum, page=1, **post): cr, uid, context = request.cr, request.uid, request.context Tag = request.registry['forum.tag'] obj_ids = Tag.search(cr, uid, [('forum_id', '=', forum.id), ('posts_count', '>', 0)], limit=None, order='posts_count DESC', context=context) tags = Tag.b...
18,631
[ 0.003949358593672514, 0.01523900218307972, -0.061402756720781326, -0.031818240880966187, 0.013464427553117275, 0.0015775718493387103, -0.07008948177099228, 0.014841894619166851, -0.020463448017835617, -0.0021282483357936144, 0.027177048847079277, 0.008668113499879837, -0.008544017560780048, ...
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": "q", "annotation": null, "type_comment": null}}, {"_type": "arg", ...
def tag_read(self, q='', l=25, t='texttext', **post): data = request.registry['forum.tag'].search_read( request.cr, request.uid, domain=[('name', '=ilike', (q or '') + "%")], fields=['id', 'name'], limit=int(l), context=request.context ...
18,632
[ -0.008614063262939453, -0.0158811267465353, -0.04286153241991997, 0.04849199205636978, 0.011213772930204868, -0.010425778105854988, -0.06681118905544281, -0.005472186487168074, -0.02275082655251026, 0.0641171857714653, 0.04498979076743126, -0.023639846593141556, -0.017026077955961227, -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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def question(self, forum, question, **post): cr, uid, context = request.cr, request.uid, request.context # Hide posts from abusers (negative karma), except for moderators if not question.can_view: raise werkzeug.exceptions.NotFound() # increment view counter request...
18,633
[ 0.013824639841914177, -0.028324829414486885, -0.05365793779492378, 0.03276415541768074, -0.011200853623449802, -0.022570595145225525, -0.0027218014001846313, 0.00163458869792521, -0.017684923484921455, 0.030640998855233192, 0.028710857033729553, 0.0016873660497367382, 0.009047538973391056, ...
15
{"_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": "forum", "annotation": null, "type_comment": null}}], "kwarg": {"_...
def question_create(self, forum, **post): cr, uid, context = request.cr, request.uid, request.context Tag = request.registry['forum.tag'] Forum = request.registry['forum.forum'] question_tag_ids = [] tag_version = post.get('tag_type', 'texttext') if tag_version == "textte...
18,634
[ 0.012049282900989056, -0.07972212880849838, -0.06462488323450089, 0.03209521621465683, 0.0348920077085495, 0.007412854582071304, -0.046405013650655746, 0.02737054042518139, -0.01550454180687666, 0.02716688998043537, 0.04572618007659912, -0.015830380842089653, 0.017065856605768204, 0.002241...
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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def question_toggle_favorite(self, forum, question, **post): if not request.session.uid: return {'error': 'anonymous_user'} # TDE: add check for not public favourite = False if question.user_favourite else True if favourite: favourite_ids = [(4, request.uid)] ...
18,635
[ 0.008889008313417435, -0.006435337942093611, -0.01960400491952896, 0.03710305318236351, 0.0075385388918221, -0.0257033109664917, -0.053105805069208145, 0.01056917104870081, 0.006524101365357637, 0.06390956044197083, 0.043189678341150284, -0.04121152311563492, -0.01842472143471241, 0.025259...
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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def question_ask_for_close(self, forum, question, **post): cr, uid, context = request.cr, request.uid, request.context Reason = request.registry['forum.post.reason'] reason_ids = Reason.search(cr, uid, [], context=context) reasons = Reason.browse(cr, uid, reason_ids, context) va...
18,636
[ -0.005661725532263517, -0.005536637268960476, -0.05008288845419884, 0.01648780144751072, 0.007701852358877659, -0.016797544434666634, -0.01721450500190258, 0.04331621900200844, 0.014164737425744534, 0.06433101743459702, 0.049368102103471756, 0.0009143343777395785, 0.01747659407556057, 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}}, {"_type": "arg", "_fields": {"arg": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def post_new(self, forum, post, **kwargs): if not request.session.uid: return login_redirect() cr, uid, context = request.cr, request.uid, request.context user = request.registry['res.users'].browse(cr, SUPERUSER_ID, uid, context=context) if not user.email or not tools.single...
18,637
[ -0.004333304241299629, -0.02563568204641342, -0.07656717300415039, 0.029252836480736732, 0.01676272600889206, 0.021751487627625465, -0.016265062615275383, 0.04318738356232643, 0.005686703138053417, 0.04194929823279381, 0.04413415491580963, 0.0009111166000366211, 0.006936927791684866, 0.015...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def post_comment(self, forum, post, **kwargs): if not request.session.uid: return login_redirect() question = post.parent_id if post.parent_id else post cr, uid, context = request.cr, request.uid, request.context if kwargs.get('comment') and post.forum_id.id == forum.id: ...
18,638
[ 0.01813424751162529, -0.02921377494931221, -0.06561794131994247, -0.03857484459877014, -0.03482137247920036, -0.007365624886006117, -0.025731638073921204, 0.029485110193490982, -0.027269205078482628, 0.050513602793216705, 0.04933781549334526, -0.007942212745547295, 0.003665853990241885, 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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def post_edit(self, forum, post, **kwargs): tag_version = kwargs.get('tag_type', 'texttext') if tag_version == "texttext": # old version - retro v8 - #TODO Remove in master tags = "" for tag_name in post.tag_ids: tags += tag_name.name + "," elif tag_versi...
18,639
[ 0.004734677262604237, -0.017875438556075096, -0.049485817551612854, 0.04903549328446388, -0.010826586745679379, 0.01492330152541399, -0.02359207719564438, 0.002461156342178583, -0.016924750059843063, 0.04926065728068352, 0.0870630219578743, -0.025468435138463974, 0.012959380634129047, 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}}, {"_type": "arg", "_fields": {"arg": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def post_toggle_correct(self, forum, post, **kwargs): cr, uid, context = request.cr, request.uid, request.context if post.parent_id is False: return request.redirect('/') if not request.session.uid: return {'error': 'anonymous_user'} # set all answers to False, o...
18,640
[ -0.002312751254066825, 0.005737802945077419, -0.02178441919386387, 0.009789525531232357, 0.01863022893667221, -0.029131371527910233, -0.045569054782390594, 0.0338754765689373, -0.016296641901135445, 0.05785243958234787, 0.008763773366808891, -0.03338824212551117, 0.005087091121822596, -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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def users(self, forum, page=1, **searches): cr, uid, context = request.cr, request.uid, request.context User = request.registry['res.users'] step = 30 tag_count = User.search(cr, SUPERUSER_ID, [('karma', '>', 1), ('website_published', '=', True)], count=True, context=context) pa...
18,641
[ 0.00612712511792779, -0.02848421223461628, -0.0570690780878067, 0.008077236823737621, -0.013852084055542946, -0.005677341483533382, -0.02469722181558609, -0.00036564594483934343, -0.02571631222963333, 0.023111969232559204, 0.03384387493133545, -0.0034504395443946123, -0.0032459923531860113, ...
15
{"_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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def post_save(self, forum, post, **kwargs): cr, uid, context = request.cr, request.uid, request.context question_tags = [] Tag = request.registry['forum.tag'] Forum = request.registry['forum.forum'] tag_version = kwargs.get('tag_type', 'texttext') vals = { ...
18,642
[ -0.049275267869234085, 0.0030797042418271303, -0.05287507548928261, 0.04618971794843674, 0.012529195286333561, -0.06493676453828812, 0.028447818011045456, -0.010133220814168453, -0.007561930455267429, 0.05670863389968872, -0.007737245410680771, -0.033777400851249695, -0.00601915642619133, ...
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": "user_id", "annotation": null, "type_comment": null}}], "kwarg": {...
def user_avatar(self, user_id=0, **post): cr, uid, context = request.cr, request.uid, request.context response = werkzeug.wrappers.Response() User = request.registry['res.users'] Website = request.registry['website'] user = User.browse(cr, SUPERUSER_ID, user_id, context=context) ...
18,643
[ -0.023545579984784126, -0.00851193442940712, -0.037574391812086105, 0.0017892566975206137, 0.04843958839774132, -0.01641448587179184, -0.028394725173711777, 0.03412553295493126, -0.02619056962430477, 0.07934964448213577, 0.03407366946339607, -0.029198594391345978, -0.018579745665192604, 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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def open_user(self, forum, user_id=0, **post): cr, uid, context = request.cr, request.uid, request.context User = request.registry['res.users'] Post = request.registry['forum.post'] Vote = request.registry['forum.post.vote'] Activity = request.registry['mail.message'] Fol...
18,644
[ 0.009224611334502697, 0.002247252967208624, -0.02259334921836853, 0.010336155071854591, 0.0010526446858420968, 0.005696665495634079, -0.0022397018037736416, 0.06910906732082367, -0.01654026471078396, 0.08897188305854797, 0.009967654012143612, -0.013241877779364586, 0.02752280794084072, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def edit_profile(self, forum, user, **kwargs): country = request.registry['res.country'] country_ids = country.search(request.cr, SUPERUSER_ID, [], context=request.context) countries = country.browse(request.cr, SUPERUSER_ID, country_ids, context=request.context) values = self._prepare_f...
18,645
[ 0.02464001625776291, -0.01978207938373089, -0.05124188959598541, 0.004869614262133837, 0.014153411611914635, 0.011444177478551865, -0.006089937407523394, 0.0640873983502388, -0.0037485521752387285, 0.06105118617415428, 0.036644723266363144, -0.01898799277842045, 0.03963422402739525, 0.0127...
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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def save_edited_profile(self, forum, user, **kwargs): values = { 'name': kwargs.get('name'), 'website': kwargs.get('website'), 'email': kwargs.get('email'), 'city': kwargs.get('city'), 'country_id': int(kwargs.get('country')) if kwargs.get('country') e...
18,646
[ -0.005055403336882591, -0.048041924834251404, -0.03622424602508545, 0.008971001952886581, -0.0013099249918013811, -0.007519309874624014, -0.04155467823147774, 0.03674595057964325, -0.030735038220882416, 0.06446418911218643, 0.03132478892803192, -0.0017040367238223553, 0.028988471254706383, ...
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": "forum", "annotation": null, "type_comment": null}}, {"_type": "ar...
def badge_users(self, forum, badge, **kwargs): user_ids = [badge_user.user_id.id for badge_user in badge.owner_ids] users = request.registry['res.users'].browse(request.cr, SUPERUSER_ID, user_ids, context=request.context) values = self._prepare_forum_values(forum=forum, searches={'badges': True}...
18,647
[ 0.017491864040493965, -0.03080199845135212, -0.01880502887070179, 0.028124673292040825, 0.0007729185163043439, 0.009542754851281643, -0.032739873975515366, 0.010435196571052074, -0.0021115816198289394, 0.06930449604988098, 0.02538360096514225, -0.019327744841575623, 0.0010868668323382735, ...
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": "forum", "annotation": null, "type_comment": null}}], "kwarg": {"_...
def badges(self, forum, **searches): cr, uid, context = request.cr, request.uid, request.context Badge = request.registry['gamification.badge'] badge_ids = Badge.search(cr, SUPERUSER_ID, [('challenge_ids.category', '=', 'forum')], context=context) badges = Badge.browse(cr, uid, badge_ids...
18,648
[ 0.03438863158226013, 0.024379221722483635, 0.07164081186056137, -0.009254472330212593, -0.0018027347978204489, 0.015957782045006752, -0.03282669559121132, 0.013107248581945896, -0.05347028374671936, 0.0311866607517004, 0.013536781072616577, -0.009365109726786613, -0.005050260573625565, 0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "e", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def do_align(self,e): align = e.align ox,oy,oh = self.x,self.y,self.h w,h = e.rect.w,e.rect.h if align == 0: self.line() self.x = self.rect.left + (self.rect.width-w)/2 self.fit = 0 elif align == -1: self.line() ...
18,649
[ 0.03220512717962265, -0.026260981336236, -0.07721869647502899, -0.010544879361987114, 0.055540043860673904, -0.010968146845698357, -0.02594813145697117, -0.0017448278376832604, 0.016111765056848526, -0.011115370318293571, -0.010397655889391899, -0.059404660016298294, -0.012974065728485584, ...
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 parse_oauth_tokens(result): for r in result.split('&'): k, v = r.split('=') if k == 'oauth_token': oauth_token = v elif k == 'oauth_token_secret': oauth_token_secret = v return oauth_token, oauth_token_secret
18,650
[ 0.0232061967253685, 0.03635205328464508, 0.08950591087341309, -0.03002544678747654, -0.004038396757096052, -0.021261543035507202, -0.019407641142606735, -0.00198192591778934, -0.030673665925860405, 0.04138222336769104, 0.007221146021038294, -0.019796570762991905, -0.016412874683737755, -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 line(self): x1 = self.getleft() x2 = self.getright() align = self.align y = self.y if len(self.items) != 0 and type(self.items[-1]) == tuple: del self.items[-1] w = 0 for e in self.items: if type(e) == tuple: w += e[0]...
18,651
[ 0.0686371922492981, 0.02630647085607052, 0.07045327126979828, 0.0069037796929478645, 0.000887175730895251, 0.012759306468069553, -0.006379653234034777, 0.033223606646060944, -0.020217258483171463, 0.019429398700594902, 0.029938634485006332, -0.03228885680437088, -0.052452702075242996, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "e", "annotation": null, "type_comment": null}}], "kwarg": null, "...
def do_space(self,e): w,h = e if self.x+w >= self.getright(): self.line() else: self.items.append(e) self.h = max(self.h,h) self.x += w
18,652
[ -0.017986927181482315, 0.01854037120938301, -0.01653413660824299, 0.04674294963479042, 0.003332193475216627, -0.05769652873277664, 0.0012863246956840158, 0.027879737317562103, 0.015957633033394814, 0.01881709322333336, 0.03394455835223198, -0.023440655320882797, -0.0002983408630825579, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _compute_qty(self, cr, uid, from_uom_id, qty, to_uom_id=False, round=True, rounding_method='UP'): if not from_uom_id or not qty or not to_uom_id: return qty uoms = self.browse(cr, uid, [from_uom_id, to_uom_id]) if uoms[0].id == from_uom_id: from_unit, to_unit = uoms[0...
18,653
[ -0.03786107152700424, 0.004772493150085211, -0.02175789140164852, 0.04553532600402832, -0.005133884493261576, -0.03966802731156349, 0.021152030676603317, 0.024532103911042213, 0.01855851523578167, 0.006754831876605749, 0.025063561275601387, -0.02493601106107235, -0.012967576272785664, 0.02...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _compute_qty_obj(self, cr, uid, from_unit, qty, to_unit, round=True, rounding_method='UP', context=None): if context is None: context = {} if from_unit.category_id.id != to_unit.category_id.id: if context.get('raise-exception', True): raise osv.except_osv(_('E...
18,654
[ -0.03125036880373955, -0.03383145481348038, -0.009764406830072403, 0.033575478941202164, 0.02553357556462288, -0.043046582490205765, 0.013897347263991833, 0.02706943079829216, 0.022205892950296402, 0.007972576655447483, 0.03118637390434742, -0.03056776523590088, 0.0037516439333558083, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _compute_price(self, cr, uid, from_uom_id, price, to_uom_id=False): if (not from_uom_id or not price or not to_uom_id or (to_uom_id == from_uom_id)): return price from_unit, to_unit = self.browse(cr, uid, [from_uom_id, to_uom_id]) if from_unit.category_id.id != to...
18,655
[ -0.009530940093100071, -0.00236421637237072, 0.007888952270150185, -0.003925957251340151, -0.020024850964546204, -0.020987821742892265, -0.029432334005832672, -0.0206915233284235, 0.016728529706597328, 0.000540127803105861, 0.02906196191906929, -0.05693872645497322, 0.0019197684014216065, ...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def write(self, cr, uid, ids, vals, context=None): if isinstance(ids, (int, long)): ids = [ids] if 'category_id' in vals: for uom in self.browse(cr, uid, ids, context=context): if uom.category_id.id != vals['category_id']: raise osv.except_osv(...
18,656
[ 0.0016349604120478034, 0.00040722484118305147, 0.006242851726710796, -0.025213846936821938, -0.02826860174536705, -0.006012532860040665, -0.003624490462243557, -0.032899223268032074, 0.03816018998622894, -0.005015494767576456, 0.0011531092459335923, -0.056052323430776596, 0.02897168137133121...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "product.ul"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null...
class product_ul(osv.osv): _name = "product.ul" _description = "Logistic Unit" _columns = { 'name' : fields.char('Name', select=True, required=True, translate=True), 'type' : fields.selection([('unit','Unit'),('pack','Pack'),('box', 'Box'), ('pallet', 'Pallet')], 'Type', required=True), ...
18,657
[ 0.03394744545221329, 0.0232782494276762, -0.010347768664360046, -0.012022584676742554, -0.02612036094069481, -0.03424068167805672, -0.021372230723500252, 0.027315853163599968, -0.0349624864757061, 0.04197753965854645, -0.008588366210460663, -0.041706863790750504, 0.05160914361476898, 0.005...
15
{"_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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): if not args: args = [] if not context: context = {} if name: # Be sure name_search is symetric to name_get categories = name.split(' / ') parent...
18,658
[ 0.014401194639503956, -0.021630387753248215, -0.026308774948120117, 0.016849054023623466, -0.013451790437102318, 0.008870632387697697, 0.029328564181923866, 0.04037825018167496, -0.001725798356346786, -0.024547230452299118, 0.03125024959445, -0.04321502149105072, 0.020635230466723442, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _get_price_extra(self, cr, uid, ids, name, args, context=None): result = dict.fromkeys(ids, 0) if not context.get('active_id'): return result for obj in self.browse(cr, uid, ids, context=context): for price_id in obj.price_ids: if price_id.product_tmp...
18,659
[ 0.008452319540083408, 0.010629866272211075, -0.02315075881779194, -0.027184952050447464, -0.025947188958525658, 0.019391626119613647, 0.014280121773481369, -0.025534600019454956, 0.020927369594573975, -0.044421952217817307, 0.0782083123922348, -0.06628910452127457, 0.006154434755444527, -0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "product.attribute.value"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_c...
class product_attribute_value(osv.osv): _name = "product.attribute.value" _order = 'sequence' def _get_price_extra(self, cr, uid, ids, name, args, context=None): result = dict.fromkeys(ids, 0) if not context.get('active_id'): return result for obj in self.browse(cr, uid,...
18,660
[ 0.01859201490879059, -0.006581802852451801, -0.02148410677909851, 0.007838485762476921, 0.009605874307453632, 0.007987680844962597, 0.03677087649703026, 0.04230257123708725, 0.01206185668706894, -0.01595240831375122, 0.06459003686904907, -0.025409087538719177, -0.006065357942134142, -0.018...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _set_price_extra(self, cr, uid, id, name, value, args, context=None): if context is None: context = {} if 'active_id' not in context: return None p_obj = self.pool['product.attribute.price'] p_ids = p_obj.search(cr, uid, [('value_id', '=', id), ('product_tmpl_...
18,661
[ 0.005995367653667927, 0.019363785162568092, 0.006202292162925005, -0.04582834988832474, -0.026551691815257072, 0.015236184000968933, 0.009023001417517662, -0.06800195574760437, 0.0023660194128751755, -0.037812747061252594, 0.03066840209066868, -0.04835500940680504, 0.05745968967676163, -0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "product.attribute.line"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_co...
class product_attribute_line(osv.osv): _name = "product.attribute.line" _rec_name = 'attribute_id' _columns = { 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete='cascade'), 'attribute_id': fields.many2one('product.attribute', 'Attribute', req...
18,662
[ -0.024527328088879585, -0.019836891442537308, 0.01704861968755722, -0.014827455393970013, 0.007484615780413151, -0.019683299586176872, 0.00923909991979599, 0.05770302191376686, 0.004590013064444065, 0.002535731066018343, 0.028780622407794, -0.026417681947350502, 0.02603961154818535, -0.034...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _product_template_price(self, cr, uid, ids, name, arg, context=None): plobj = self.pool.get('product.pricelist') res = {} quantity = context.get('quantity') or 1.0 pricelist = context.get('pricelist', False) partner = context.get('partner', False) if pricelist: ...
18,663
[ 0.0037070484831929207, -0.018712572753429413, 0.011799504049122334, 0.020446470007300377, 0.026436293497681618, -0.01483945269137621, 0.029904088005423546, 0.06755441427230835, 0.024139443412423134, 0.0005925085279159248, 0.014141391031444073, -0.03575880452990532, 0.007329653948545456, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def get_history_price(self, cr, uid, product_tmpl, company_id, date=None, context=None): if context is None: context = {} if date is None: date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT) price_history_obj = self.pool.get('product.price.history') history_ids =...
18,664
[ -0.028046369552612305, -0.004120650235563517, -0.04135880619287491, 0.023285482078790665, 0.006052645854651928, 0.006312125362455845, -0.008624879643321037, 0.04043370485305786, -0.008252582512795925, 0.011546846479177475, 0.017734872177243233, -0.05306923761963844, 0.0016372604295611382, ...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _default_category(self, cr, uid, context=None): if context is None: context = {} if 'categ_id' in context and context['categ_id']: return context['categ_id'] md = self.pool.get('ir.model.data') res = False try: res = md.get_object_reference...
18,665
[ -0.020966578274965286, -0.01255517452955246, 0.010871767066419125, 0.0006369076436385512, 0.02337627112865448, -0.023669036105275154, 0.015629220753908157, 0.07819114625453949, 0.00963314063847065, -0.019423924386501312, 0.028375819325447083, -0.013681198470294476, -0.016755245625972748, 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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _price_get(self, cr, uid, products, ptype='list_price', context=None): if context is None: context = {} if 'currency_id' in context: pricetype_obj = self.pool.get('product.price.type') price_type_id = pricetype_obj.search(cr, uid, [('field','=',ptype)])[0] ...
18,666
[ 0.05382123962044716, 0.014758543111383915, 0.008488163352012634, -0.0347757451236248, -0.015353000722825527, 0.004444139078259468, 0.004241223447024822, 0.05107759311795235, -0.02232644148170948, 0.023915471509099007, -0.01001431792974472, -0.07096904516220093, 0.03745080530643463, 0.00294...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): # Only use the product.product heuristics if there is a search term and the domain # does not specify a match on `product.template` IDs. if not name or any(term[0] == 'id' for term in (args or [])): ...
18,667
[ -0.000930594396777451, -0.002517427783459425, 0.004342246800661087, -0.022770704701542854, 0.01769789680838585, -0.03461147099733353, 0.041746292263269424, 0.005920383147895336, 0.021189406514167786, 0.01819126307964325, 0.03931741788983345, -0.05237261950969696, 0.010310068726539612, 0.01...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def create_variant_ids(self, cr, uid, ids, context=None): product_obj = self.pool.get("product.product") ctx = context and context.copy() or {} if ctx.get("create_product_variant"): return None ctx.update(active_test=False, create_product_variant=True) tmpl_ids = s...
18,668
[ -0.025216052308678627, -0.02294842153787613, -0.000785167096182704, 0.01565798930823803, 0.0005282870260998607, -0.03274458646774292, 0.005428140517324209, 0.041384257376194, 0.024399705231189728, -0.008792737498879433, 0.014456144534051418, -0.04487640783190727, 0.010017258115112782, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _product_lst_price(self, cr, uid, ids, name, arg, context=None): product_uom_obj = self.pool.get('product.uom') res = dict.fromkeys(ids, 0.0) for product in self.browse(cr, uid, ids, context=context): if 'uom' in context: uom = product.uos_id or product.uom_id ...
18,669
[ -0.03779608756303787, -0.02134154923260212, 0.011067993938922882, -0.0024450095370411873, 0.012963817454874516, -0.019427670165896416, 0.013421221636235714, 0.056958943605422974, 0.012891595251858234, 0.003195815719664097, 0.04042014852166176, -0.03866275027394295, 0.02131747454404831, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _product_price(self, cr, uid, ids, name, arg, context=None): plobj = self.pool.get('product.pricelist') res = {} if context is None: context = {} quantity = context.get('quantity') or 1.0 pricelist = context.get('pricelist', False) partner = context.get('p...
18,670
[ -0.021719245240092278, 0.012799268588423729, -0.017696276307106018, 0.028783388435840607, -0.032710570842027664, -0.002764294855296612, 0.00197556521743536, 0.02562248334288597, 0.039487358182668686, 0.02842419408261776, 0.004905987065285444, -0.06834258884191513, 0.04676701873540878, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _product_partner_ref(self, cr, uid, ids, name, arg, context=None): res = {} if context is None: context = {} for p in self.browse(cr, uid, ids, context=context): data = self._get_partner_code_name(cr, uid, [], p, context.get('partner_id', None), context=context) ...
18,671
[ -0.01617163047194481, -0.033254947513341904, 0.0000962395133683458, 0.002889729104936123, 0.0033645671792328358, -0.026243625208735466, 0.01158062368631363, 0.04753807932138443, 0.0182663444429636, -0.018429145216941833, 0.025028038769960403, -0.03464419022202492, -0.003701023990288377, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _set_product_lst_price(self, cr, uid, id, name, value, args, context=None): product_uom_obj = self.pool.get('product.uom') product = self.browse(cr, uid, id, context=context) if 'uom' in context: uom = product.uos_id or product.uom_id value = product_uom_obj._compute...
18,672
[ 0.003472190350294113, -0.02193819358944893, -0.03273281082510948, 0.02064702846109867, -0.015145031735301018, -0.004103233106434345, 0.0313136912882328, 0.02987130545079708, 0.008991635404527187, -0.013923658058047295, 0.03191855922341347, -0.04848271235823631, 0.00804943311959505, -0.0339...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _get_price_extra(self, cr, uid, ids, name, args, context=None): result = dict.fromkeys(ids, False) for product in self.browse(cr, uid, ids, context=context): price_extra = 0.0 for variant_id in product.attribute_value_ids: for price_id in variant_id.price_ids:...
18,673
[ 0.00524214468896389, -0.0017678518779575825, -0.03058527410030365, 0.002398947486653924, -0.04858522117137909, -0.03112882748246193, 0.0619649700820446, 0.00619336124509573, -0.013390203937888145, -0.008325759321451187, 0.04314969480037689, -0.029184581711888313, 0.011874528601765633, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _set_image_variant(self, cr, uid, id, name, value, args, context=None): image = tools.image_resize_image_big(value) product = self.browse(cr, uid, id, context=context) if product.product_tmpl_id.image: product.image_variant = image else: product.product_tmpl_...
18,674
[ 0.03053934872150421, -0.006832978688180447, 0.007004805840551853, -0.007783753797411919, -0.03177650272846222, -0.001276529859751463, 0.03076845221221447, 0.043185800313949585, 0.016071533784270287, 0.024491045624017715, 0.051135655492544174, -0.08371401578187943, -0.0017984537407755852, -...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def unlink(self, cr, uid, ids, context=None): unlink_ids = [] unlink_product_tmpl_ids = [] for product in self.browse(cr, uid, ids, context=context): # Check if product still exists, in case it has been unlinked by unlinking its template if not product.exists(): ...
18,675
[ -0.005528935696929693, 0.0016542525263503194, -0.01692841202020645, 0.027783852070569992, -0.0017649577930569649, -0.020306503400206566, -0.0077809966169297695, 0.018750304356217384, 0.04767283797264099, -0.005623825825750828, 0.0328446626663208, -0.04304219409823418, 0.022862212732434273, ...
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": "cursor", "annotation": null, "type_comment": null}}, {"_type": "a...
def onchange_uom(self, cursor, user, ids, uom_id, uom_po_id): if uom_id and uom_po_id: uom_obj=self.pool.get('product.uom') uom=uom_obj.browse(cursor,user,[uom_id])[0] uom_po=uom_obj.browse(cursor,user,[uom_po_id])[0] if uom.category_id.id != uom_po.category_id.id...
18,676
[ 0.012287747114896774, 0.02682332880795002, -0.00458671385422349, -0.011088483035564423, 0.002228998579084873, -0.020054709166288376, -0.008991341106593609, 0.031595271080732346, -0.021674657240509987, 0.026697752997279167, -0.013110279105603695, -0.05801675096154213, 0.023633664473891258, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): if not args: args = [] if name: positive_operators = ['=', 'ilike', '=ilike', 'like', '=like'] ids = [] if operator in positive_operators: ids =...
18,677
[ -0.00660967081785202, -0.0014390472788363695, 0.005034259054809809, -0.0022427961230278015, -0.017185144126415253, -0.01717231050133705, -0.024988407269120216, -0.012301689013838768, -0.017210813239216805, -0.02018837444484234, 0.0247958917170763, -0.06560900807380676, 0.0003651762963272631,...
15
{"_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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def name_get(self, cr, user, ids, context=None): if context is None: context = {} if isinstance(ids, (int, long)): ids = [ids] if not len(ids): return [] def _name_get(d): name = d.get('name','') code = context.get('display_def...
18,678
[ 0.013262955471873283, 0.004572032019495964, 0.020313197746872902, -0.013212954625487328, -0.01826312765479088, 0.022388270124793053, 0.007262749597430229, 0.0005199397564865649, 0.0020797590259462595, -0.00851279217749834, 0.03592623397707939, -0.07440255582332611, -0.0026969676837325096, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "product.packaging"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment...
class product_packaging(osv.osv): _name = "product.packaging" _description = "Packaging" _rec_name = 'ean' _order = 'sequence' _columns = { 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of packaging."), 'name' : fields.text('Description'...
18,679
[ 0.021080251783132553, -0.0172714963555336, -0.03154882416129112, 0.006461674813181162, 0.0006680458318442106, -0.01233992725610733, 0.04458225518465042, -0.005217774771153927, -0.01887865737080574, -0.003949107136577368, 0.016699081286787987, -0.0593109093606472, 0.014783695340156555, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def copy(self, cr, uid, id, default=None, context=None): if context is None: context={} if default is None: default = {} product = self.browse(cr, uid, id, context) if context.get('variant'): # if we copy a variant or create one, we keep the same tem...
18,680
[ 0.01849459297955036, -0.007793084718286991, 0.014479974284768105, -0.012777178548276424, -0.021713746711611748, -0.011291894130408764, -0.04708166792988777, 0.01873074844479561, 0.0006319452077150345, 0.010446710512042046, 0.025852657854557037, -0.05013924092054367, 0.03798351809382439, -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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def name_get(self, cr, uid, ids, context=None): if not len(ids): return [] res = [] for pckg in self.browse(cr, uid, ids, context=context): p_name = pckg.ean and '[' + pckg.ean + '] ' or '' p_name += pckg.ul.name res.append((pckg.id,p_name)) ...
18,681
[ -0.017818640917539597, -0.01658429019153118, 0.007344995159655809, -0.0031133736483752728, -0.03145759925246239, -0.03703051060438156, 0.025933576747775078, -0.020666202530264854, -0.01501996535807848, -0.011084710247814655, 0.011359688825905323, -0.06927027553319931, 0.01050419919192791, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "product.supplierinfo"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comm...
class product_supplierinfo(osv.osv): _name = "product.supplierinfo" _description = "Information about a product supplier" def _calc_qty(self, cr, uid, ids, fields, arg, context=None): result = {} for supplier_info in self.browse(cr, uid, ids, context=context): for field in fields...
18,682
[ -0.04041629284620285, 0.0176587775349617, 0.024592621251940727, -0.047558922320604324, -0.05687730386853218, 0.01613135263323784, -0.006736048497259617, -0.01736208237707615, -0.008977735415101051, -0.005178405903279781, 0.009285417385399342, -0.03933940455317497, 0.03404286876320839, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "pricelist.partnerinfo"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_com...
class pricelist_partnerinfo(osv.osv): _name = 'pricelist.partnerinfo' _columns = { 'name': fields.char('Description'), 'suppinfo_id': fields.many2one('product.supplierinfo', 'Partner Information', required=True, ondelete='cascade'), 'min_quantity': fields.float('Quantity', required=True,...
18,683
[ -0.017704922705888748, -0.0005385542172007263, -0.021497994661331177, 0.025986067950725555, -0.009017378091812134, -0.0915520042181015, 0.0350564569234848, -0.0000350170666933991, -0.006796900182962418, -0.0032482584938406944, 0.027941502630710602, -0.028789643198251724, 0.005347994156181812...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _calc_qty(self, cr, uid, ids, fields, arg, context=None): result = {} for supplier_info in self.browse(cr, uid, ids, context=context): for field in fields: result[supplier_info.id] = {field:False} qty = supplier_info.min_qty result[supplier_info.id...
18,684
[ -0.0036054886877536774, 0.009989749640226364, 0.04878568649291992, 0.03402424603700638, -0.011102516204118729, 0.02108597941696644, 0.027410514652729034, 0.05436838045716286, 0.04946466162800789, 0.02404078096151352, 0.034879252314567566, -0.05527368187904358, -0.01737675815820694, 0.03055...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _check_main_currency_rounding(self, cr, uid, ids, context=None): cr.execute('SELECT digits FROM decimal_precision WHERE name like %s',('Account',)) digits = cr.fetchone() if digits and len(digits): digits = digits[0] main_currency = self.pool.get('res.users').browse(c...
18,685
[ -0.010508940555155277, 0.035815440118312836, 0.060745321214199066, -0.002952222479507327, -0.031150199472904205, 0.009245437569916248, 0.011280406266450882, -0.013825634494423866, 0.047211263328790665, -0.003167868359014392, 0.008437524549663067, -0.06302934139966965, 0.006174761801958084, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "res.currency"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment":...
class res_currency(osv.osv): _inherit = 'res.currency' def _check_main_currency_rounding(self, cr, uid, ids, context=None): cr.execute('SELECT digits FROM decimal_precision WHERE name like %s',('Account',)) digits = cr.fetchone() if digits and len(digits): digits = digits[0]...
18,686
[ 0.017599748447537422, 0.04841085523366928, 0.053630728274583817, 0.018512070178985596, -0.03349033370614052, 0.015451746992766857, 0.025960782542824745, -0.007899099960923195, 0.05081292241811752, -0.002559412270784378, 0.022276846691966057, -0.06328518688678741, -0.003242210717871785, -0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "decimal.precision"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comm...
class decimal_precision(osv.osv): _inherit = 'decimal.precision' def _check_main_currency_rounding(self, cr, uid, ids, context=None): cr.execute('SELECT id, digits FROM decimal_precision WHERE name like %s',('Account',)) res = cr.fetchone() if res and len(res): account_preci...
18,687
[ 0.010451700538396835, 0.01788812130689621, 0.04307907447218895, 0.04038185998797417, -0.0043098158203065395, 0.018969550728797913, 0.030941614881157875, 0.056132566183805466, 0.04307907447218895, 0.024898329749703407, 0.03895691782236099, -0.05786285549402237, -0.016285059973597527, 0.0282...
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def _check_main_currency_rounding(self, cr, uid, ids, context=None): cr.execute('SELECT id, digits FROM decimal_precision WHERE name like %s',('Account',)) res = cr.fetchone() if res and len(res): account_precision_id, digits = res main_currency = self.pool.get('res.users...
18,688
[ 0.018383048474788666, 0.0261992160230875, -0.004673612304031849, -0.052190832793712616, -0.03510528802871704, -0.02806762419641018, 0.012466426007449627, -0.013826210983097553, 0.004040429834276438, 0.06257086992263794, 0.05102827027440071, -0.0006182610522955656, -0.012030464597046375, 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": "text", "annotation": null, "type_comment": null}}], "kwarg": null...
def _CleanText(self, text): lines = [line for line in text.splitlines(True) if line.strip()] if self.noeol: # Remove whitespace at the end of a source line, so that invisible # whitespace is not significant (users should use {%sp%} in that # situation).. The text passed in here d...
18,689
[ -0.019801955670118332, 0.009508361108601093, 0.015412706881761551, 0.02130195125937462, -0.02808716520667076, 0.005773473065346479, 0.016902634873986244, 0.006664409767836332, -0.026778444647789, 0.027624079957604408, -0.04002672806382179, 0.01233217865228653, -0.02410059981048107, 0.04159...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ctxt", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "default", "annotation": null, "type_comment": null}}], "kwarg": n...
def _GetCurrentLanguage(ctxt=None, default=None): if ctxt is None: ctxt = GetCurrentContext() or {} try: # respect the language set by the language node, if any return ctxt[_LANGUAGE] except KeyError: language_model = ctxt.get('language_model') if language_model and language_model.language: ...
18,690
[ -0.0009263342362828553, 0.030765829607844353, -0.02079802192747593, 0.01603473350405693, -0.017689349129796028, -0.003306725062429905, 0.03439595550298691, -0.018351195380091667, 0.051142677664756775, 0.044564325362443924, -0.0020406930707395077, 0.04825462028384209, 0.01526257861405611, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "wrap_blocks", "annotation": null, "type_comment": null}}, {"_type...
def _WrapInComment(text, wrap_blocks, start_prefix, continue_prefix, comment_end, begin_tag, end_tag, available_width): # If the text has no EOL and is short, it may be a one-liner, # though still not necessarily because of other comment overhead. if len(text) < available_wid...
18,691
[ 0.01661090739071369, -0.004470691550523043, -0.010964294895529747, 0.0034208600409328938, -0.021621590480208397, -0.02482316456735134, -0.009341579861938953, -0.023003092035651207, 0.004635155666619539, -0.0015651531284675002, -0.032125383615493774, 0.004920227453112602, -0.01319004688411951...
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": "context", "annotation": null, "type_comment": null}}], "kwarg": n...
def render(self, context): # pylint: disable=g-bad-name try: text = django_template.resolve_variable(self._variable_name, context) if text: return utilities.CamelCase(text) except django_template.VariableDoesNotExist: pass return ''
18,692
[ 0.028964124619960785, 0.013654208742082119, 0.03692011907696724, 0.008794600144028664, 0.005574572365731001, -0.0030157524161040783, 0.008085011504590511, -0.015782974660396576, -0.06300288438796997, 0.07418428361415863, -0.04558570310473442, 0.028555572032928467, 0.045413680374622345, 0.0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loc", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "scale_tril", "annotation": null, "type_comment": null}}, {"_type":...
def _make_tril_scale( loc=None, scale_tril=None, scale_diag=None, scale_identity_multiplier=None, shape_hint=None): if scale_tril is not None: scale_tril = np.tril(scale_tril) if scale_diag is not None: scale_tril += _matrix_diag(np.array(scale_diag, dtype=np.float32)) if scale_i...
18,693
[ 0.025250878185033798, 0.004444989375770092, 0.010736840777099133, 0.030551476404070854, -0.0078100343234837055, -0.0006860517314635217, -0.011362895369529724, -0.02197452448308468, -0.056845780462026596, 0.05525977537035942, -0.05851525813341141, 0.01101856492459774, 0.033827830106019974, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loc", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "scale_diag", "annotation": null, "type_comment": null}}, {"_type":...
def _make_diag_scale( loc=None, scale_diag=None, scale_identity_multiplier=None, shape_hint=None): if scale_diag is not None: scale_diag = np.asarray(scale_diag) if scale_identity_multiplier is not None: scale_diag += scale_identity_multiplier return _matrix_diag(scale_diag) if lo...
18,694
[ 0.029426129534840584, -0.005432805046439171, 0.0671737864613533, 0.007036955561488867, -0.0036250033881515265, 0.035742469131946564, -0.016505200415849686, -0.008396723307669163, 0.0031769692432135344, 0.07464311271905899, 0.0066171190701425076, -0.003443283261731267, 0.03428870812058449, ...
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}}, {"_type": "arg", "_fields": {"arg": "loc", "annotation": nu...
class MakeTrilScaleTest(test.TestCase): def _testLegalInputs( self, loc=None, shape_hint=None, scale_params=None): for args in _powerset(scale_params.items()): with self.test_session(): args = dict(args) scale_args = dict({ "loc": loc, "shape_hint": shape_hint...
18,695
[ 0.03267790749669075, 0.016982419416308403, 0.05803798511624336, 0.0047597456723451614, -0.02311425842344761, 0.03621065616607666, -0.004917457699775696, -0.0005125637399032712, 0.005769101902842522, 0.059753891080617905, 0.015834275633096695, -0.001012510503642261, 0.020023105666041374, 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": "loc", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def _testLegalInputs( self, loc=None, shape_hint=None, scale_params=None): for args in _powerset(scale_params.items()): with self.test_session(): args = dict(args) scale_args = dict({ "loc": loc, "shape_hint": shape_hint}, **args) expected_scale = _make_t...
18,696
[ 0.036248549818992615, -0.016193805262446404, 0.0656113550066948, 0.006578349508345127, -0.015972478315234184, 0.029977601021528244, -0.023927977308630943, -0.010279439389705658, -0.015984773635864258, 0.06748034060001373, 0.010537655092775822, -0.01828412339091301, 0.02786269225180149, 0.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}}, {"_type": "arg", "_fields": {"arg": "loc", "annotation": nu...
class MakeDiagScaleTest(test.TestCase): def _testLegalInputs( self, loc=None, shape_hint=None, scale_params=None): for args in _powerset(scale_params.items()): with self.test_session(): args = dict(args) scale_args = dict({ "loc": loc, "shape_hint": shape_hint...
18,697
[ 0.026730721816420555, -0.04474179446697235, 0.04204966500401497, 0.012888877652585506, -0.006122812163084745, 0.0362127423286438, -0.02112012915313244, -0.0015046453336253762, 0.014949668198823929, 0.04009608179330826, 0.013567865826189518, -0.03078083135187626, 0.00878516398370266, 0.0181...
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 testAssertPositive(self): with self.test_session(): with self.assertRaisesOpError("diagonal part must be positive"): scale = distribution_util.make_tril_scale( scale_tril=[[-1., 1], [1., 1.]], validate_args=True, assert_positive=True) scale.to_dense().ev...
18,698
[ 0.022482430562376976, -0.049494724720716476, 0.041126396507024765, 0.018393632024526596, -0.007665006909519434, 0.03004015050828457, -0.02708381973206997, -0.0022679122630506754, 0.010829951614141464, 0.03795549273490906, 0.01260017417371273, -0.03271038830280304, -0.00047869040281511843, ...
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 testAssertPositive(self): with self.test_session(): with self.assertRaisesOpError("diagonal part must be positive"): scale = distribution_util.make_diag_scale( scale_diag=[[-1., 1], [1., 1.]], validate_args=True, assert_positive=True) scale.to_dense().ev...
18,699
[ 0.031565383076667786, 0.012913111597299576, 0.06071427837014198, 0.006601293571293354, -0.028821662068367004, 0.033956702798604965, -0.005122452508658171, -0.005084695294499397, -0.00044955185148864985, 0.05930466204881668, 0.014385659247636795, -0.004971422255039215, 0.01331586018204689, ...
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": "loc", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def _testLegalInputs( self, loc=None, shape_hint=None, scale_params=None): for args in _powerset(scale_params.items()): with self.test_session(): args = dict(args) scale_args = dict({ "loc": loc, "shape_hint": shape_hint}, **args) expected_scale = _make_d...
18,700
[ -0.002760170493274927, -0.02214391715824604, 0.05324548855423927, -0.0067119840532541275, 0.019804418087005615, 0.0470401868224144, -0.0048854234628379345, -0.057849422097206116, -0.011028171516954899, 0.042436253279447556, -0.025259079411625862, -0.01722721755504608, 0.03620592877268791, ...
13
{"_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 ShapesFromLocAndScaleTest(test.TestCase): def test_static_loc_static_scale_non_matching_event_size_raises(self): loc = constant_op.constant(np.zeros((2, 4))) scale = linear_operator_diag.LinearOperatorDiag(np.ones((5, 1, 3))) with self.assertRaisesRegexp(ValueError, "could not be broadcast"): ...