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
9,101
[ 0.05783024802803993, 0.004471067804843187, 0.019458377733826637, -0.02596064656972885, 0.027849575504660606, -0.005433693993836641, -0.03358900919556618, -0.008021888323128223, 0.04540691524744034, 0.03799650818109512, 0.012762370519340038, -0.007446734234690666, -0.02363581396639347, -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": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def forward_zones(self): if self._values['forward_zones'] is None: return None elif self._values['forward_zones'] in ['', 'none']: return '' result = [] for x in self._values['forward_zones']: if 'name' not in x: raise F5ModuleError( ...
9,102
[ 0.01916378363966942, 0.023985881358385086, -0.04615257307887077, -0.013731137849390507, -0.013220270164310932, 0.009052333422005177, -0.02973003312945366, 0.05975911021232605, 0.003697563661262393, 0.0341409407556057, -0.01602381467819214, -0.06140385568141937, 0.029381146654486656, -0.041...
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 to_return(self): result = {} try: for returnable in self.returnables: result[returnable] = getattr(self, returnable) result = self._filter_params(result) except Exception: pass return result
9,103
[ 0.024767441675066948, 0.009258913807570934, -0.017216837033629417, -0.03518752008676529, -0.004933426156640053, 0.032974619418382645, -0.034093227237463, 0.018055792897939682, -0.008991420269012451, 0.023259753361344337, -0.008821197785437107, -0.07188272476196289, 0.004708488937467337, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class Changes(Parameters): def to_return(self): result = {} try: for returnable in self.returnables: result[returnable] = getattr(self, returnable) result = self._filter_params(result) except Exception: pass return result
9,104
[ 0.0697004646062851, -0.00868135318160057, 0.03727177530527115, 0.008918514475226402, 0.02623753249645233, -0.006571865174919367, -0.030681187286973, -0.006709169130772352, 0.04600929841399193, 0.010422616265714169, 0.016039595007896423, 0.0053111654706299305, -0.045884475111961365, 0.03025...
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 UsableChanges(Changes): @property def forward_zones(self): if self._values['forward_zones'] is None: return None result = [] for x in self._values['forward_zones']: tmp = {'name': x['name']} if 'nameservers' in x: tmp['nameservers...
9,105
[ 0.0678698718547821, -0.017804482951760292, -0.0038801576010882854, -0.014647744596004486, 0.033289238810539246, -0.010486588813364506, -0.00996046606451273, 0.0020491895265877247, 0.035537220537662506, 0.02982161194086075, 0.00802935566753149, 0.0012009656056761742, -0.01342809572815895, -...
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 forward_zones(self): if self._values['forward_zones'] is None: return None result = [] for x in self._values['forward_zones']: tmp = {'name': x['name']} if 'nameservers' in x: tmp['nameservers'] = [] for y in x['nameservers'...
9,106
[ 0.036202870309352875, -0.006807713303714991, -0.015627946704626083, -0.030671250075101852, 0.033706896007061005, -0.029591910541057587, -0.008921421132981777, -0.010506702587008476, 0.007875810377299786, -0.006762741133570671, -0.03262755647301674, -0.02163177728652954, -0.000780694652348756...
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": "param", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __default(self, param): attr1 = getattr(self.want, param) try: attr2 = getattr(self.have, param) if attr1 != attr2: return attr1 except AttributeError: return attr1
9,107
[ 0.03268583491444588, -0.02181445062160492, -0.027644379064440727, 0.009616994298994541, 0.07096266746520996, -0.006006141658872366, -0.005163908004760742, -0.033426523208618164, 0.0021966767963021994, 0.0132845938205719, -0.005256494041532278, -0.04415455088019371, -0.009246651083230972, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "want", "annotation": n...
class Difference(object): def __init__(self, want, have=None): self.want = want self.have = have def compare(self, param): try: result = getattr(self, param) return result except AttributeError: return self.__default(param) def __default(...
9,108
[ 0.029694637283682823, -0.02106304094195366, 0.0043947091326117516, 0.004027471877634525, 0.0299131590873003, -0.014483116567134857, -0.003787705209106207, -0.010495100170373917, 0.00898365955799818, 0.024110201746225357, -0.002091128844767809, 0.003727004863321781, -0.013973233290016651, -...
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 forward_zones(self): if self.want.forward_zones is None: return None if self.have.forward_zones is None and self.want.forward_zones in ['', 'none']: return None if self.have.forward_zones is not None and self.want.forward_zones in ['', 'none']: return [] ...
9,109
[ -0.002238354878500104, 0.06266745924949646, -0.0043860748410224915, -0.0356065109372139, 0.020379872992634773, 0.04384132847189903, -0.021325064823031425, -0.013634057715535164, 0.03708256408572197, 0.0565560907125473, 0.021765289828181267, -0.047881048172712326, -0.05052240565419197, 0.00...
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an...
class ModuleManager(object): def __init__(self, *args, **kwargs): self.module = kwargs.get('module', None) self.client = F5RestClient(**self.module.params) self.want = ModuleParameters(params=self.module.params) self.have = ApiParameters() self.changes = UsableChanges() ...
9,110
[ 0.003059339476749301, 0.0030374201014637947, 0.0025755444075912237, 0.013314546085894108, 0.017986536026000977, 0.016946924850344658, 0.033317681401968, -0.021856898441910744, 0.018487554043531418, 0.030737439170479774, 0.016896823421120644, -0.05506185069680214, -0.03990606218576431, 0.05...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _update_changed_options(self): diff = Difference(self.want, self.have) updatables = Parameters.updatables changed = dict() for k in updatables: change = diff.compare(k) if change is None: continue else: if isinstance...
9,111
[ 0.016795065253973007, 0.03193557262420654, 0.006434387993067503, -0.01160816103219986, -0.0006918608560226858, 0.06287316232919693, -0.004336646292358637, 0.010124312713742256, 0.028153730556368828, 0.032854773104190826, 0.031357791274785995, -0.03555984050035477, 0.009631884284317493, 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 exec_module(self): changed = False result = dict() state = self.want.state if state == "present": changed = self.present() elif state == "absent": changed = self.absent() reportable = ReportableChanges(params=self.changes.to_return()) ...
9,112
[ -0.037868600338697433, 0.00963794905692339, 0.018129102885723114, 0.01376152690500021, 0.02781585231423378, 0.00340988184325397, -0.023972872644662857, -0.012700132094323635, 0.004876924213021994, 0.06807564198970795, 0.007387060672044754, -0.011492338962852955, 0.013602927327156067, -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 exists(self): uri = "https://{0}:{1}/mgmt/tm/ltm/dns/cache/resolver/{2}".format( self.client.provider['server'], self.client.provider['server_port'], transform_name(self.want.partition, self.want.name) ) resp = self.client.api.get(uri) try: ...
9,113
[ 0.04459388181567192, 0.015210949815809727, -0.01575961709022522, -0.006502301432192326, 0.05976980924606323, 0.05808878317475319, 0.03644557669758797, 0.007307793013751507, 0.015362708829343319, -0.00000968445874605095, -0.0008799119968898594, -0.010844951495528221, -0.05724827200174332, 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 update(self): self.have = self.read_current_from_device() if not self.should_update(): return False if self.module.check_mode: return True self.update_on_device() return True
9,114
[ 0.014108906500041485, 0.03128606081008911, 0.00542916264384985, 0.01397058367729187, 0.008695462718605995, 0.01806996390223503, -0.021062761545181274, -0.018987921997904778, -0.004819285590201616, 0.02561483345925808, -0.0024583700578659773, 0.005190241616219282, -0.028720805421471596, -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 update_on_device(self): params = self.changes.api_params() uri = "https://{0}:{1}/mgmt/tm/ltm/dns/cache/resolver/{2}".format( self.client.provider['server'], self.client.provider['server_port'], transform_name(self.want.partition, self.want.name) ) ...
9,115
[ 0.03405993804335594, 0.014557470567524433, 0.011454231105744839, 0.011801137588918209, 0.0059131840243935585, -0.027878690510988235, -0.02492683008313179, -0.024409621953964233, 0.008294225670397282, 0.004929230082780123, -0.008496062830090523, 0.024195171892642975, -0.009152031503617764, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def create_on_device(self): params = self.changes.api_params() params['name'] = self.want.name params['partition'] = self.want.partition uri = "https://{0}:{1}/mgmt/tm/ltm/dns/cache/resolver/".format( self.client.provider['server'], self.client.provider['server_po...
9,116
[ -0.0116118174046278, 0.027920547872781754, -0.023401547223329544, -0.0033062247093766928, 0.048582229763269424, 0.007929008454084396, -0.05674252659082413, -0.0027428320609033108, 0.006315927021205425, 0.023852260783314705, -0.008907532319426537, -0.02640235424041748, -0.017376212403178215, ...
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 read_current_from_device(self): uri = "https://{0}:{1}/mgmt/tm/ltm/dns/cache/resolver/{2}".format( self.client.provider['server'], self.client.provider['server_port'], transform_name(self.want.partition, self.want.name) ) resp = self.client.api.get(uri) ...
9,117
[ 0.006218933966010809, 0.02935098670423031, 0.012128408998250961, -0.009384936653077602, 0.015937134623527527, 0.027113361284136772, -0.04213402047753334, 0.013152003288269043, 0.03220752999186516, 0.03592103719711304, 0.02706575207412243, -0.024280622601509094, -0.021019401028752327, -0.04...
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 remove_from_device(self): uri = "https://{0}:{1}/mgmt/tm/ltm/dns/cache/resolver/{2}".format( self.client.provider['server'], self.client.provider['server_port'], transform_name(self.want.partition, self.want.name) ) response = self.client.api.delete(uri) ...
9,118
[ 0.024029474705457687, 0.012540522031486034, -0.005979401525110006, 0.024834932759404182, -0.0330013744533062, 0.0038538891822099686, -0.012294409796595573, -0.01791023649275303, 0.05351816117763519, 0.0528021976351738, 0.010392636060714722, -0.03429905325174332, 0.007925922982394695, -0.01...
17
{"_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 ArgumentSpec(object): def __init__(self): self.supports_check_mode = True argument_spec = dict( name=dict(required=True), route_domain=dict(), answer_default_zones=dict(type='bool'), forward_zones=dict( type='raw', ...
9,119
[ 0.02173561416566372, 0.014378944411873817, 0.008019485510885715, 0.03611455857753754, -0.018511099740862846, 0.02842349372804165, 0.009124180302023888, 0.014462542720139027, 0.050350189208984375, 0.08211762458086014, 0.028065215796232224, -0.014235632494091988, 0.02186698280274868, -0.0219...
16
{"_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 __init__(self): self.supports_check_mode = True argument_spec = dict( name=dict(required=True), route_domain=dict(), answer_default_zones=dict(type='bool'), forward_zones=dict( type='raw', options=dict( ...
9,120
[ 0.029077773913741112, 0.05045582726597786, 0.013361282646656036, -0.024571172893047333, -0.028647495433688164, 0.05498507618904114, -0.026564041152596474, -0.009358559735119343, 0.05829142779111862, 0.04438663274049759, 0.016633665189146996, -0.07219621539115906, -0.003436567261815071, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): spec = ArgumentSpec() module = AnsibleModule( argument_spec=spec.argument_spec, supports_check_mode=spec.supports_check_mode, ) try: mm = ModuleManager(module=module) results = mm.exec_module() module.exit_json(**results) except F5ModuleError as ...
9,121
[ -0.008126186206936836, 0.02894001081585884, 0.06303950399160385, -0.04758450761437416, -0.05961548164486885, 0.0020036969799548388, 0.02551599033176899, -0.03780493885278702, 0.004277094267308712, -0.015748150646686554, 0.026923121884465218, -0.03862576559185982, 0.027181096374988556, 0.03...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "mrp.config.settings"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comme...
class mrp_config_settings(osv.osv_memory): _name = 'mrp.config.settings' _inherit = 'res.config.settings' _columns = { 'module_mrp_repair': fields.boolean("Manage repairs of products ", help='Allows to manage all product repairs.\n' '* Add/remove products in the reparat...
9,122
[ 0.009212195873260498, -0.00006246235716389492, 0.00650529470294714, -0.016634343191981316, 0.014134826138615608, -0.017922304570674896, -0.04518778622150421, 0.004802566487342119, 0.04047253727912903, 0.04464203864336014, 0.01696179248392582, -0.038835298269987106, -0.020247183740139008, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "F", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},...
def wrapper(F): class OptionLoader(object): def process_request(self, request): if loader: loader(request) def process_response(self, request, response): if unloader: unloader(request, response) return response return decorator_fro...
9,123
[ 0.011569756083190441, -0.026109224185347557, 0.04887297749519348, -0.013236431404948235, -0.042448703199625015, -0.01547886710613966, 0.01352734211832285, 0.011672787368297577, 0.0045272959396243095, 0.06744276732206345, 0.05338209122419357, -0.006957611534744501, -0.02802438661456108, 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_finalize_options(self): # Make sure Python's include directories (for Python.h, pyconfig.h, # etc.) are in the include search path. modules = [Extension('foo', ['xxx'])] dist = Distribution({'name': 'xx', 'ext_modules': modules}) cmd = build_ext(dist) cmd.finaliz...
9,124
[ 0.04558080434799194, -0.05173334851861, 0.03245249390602112, -0.008730543777346611, -0.011655167676508427, 0.004246120806783438, 0.029961146414279938, -0.0052047474309802055, 0.002143370220437646, 0.022595427930355072, 0.004154049325734377, -0.027469800785183907, 0.0055892812088131905, 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_compiler_option(self): # cmd.compiler is an option and # should not be overriden by a compiler instance # when the command is run dist = Distribution() cmd = build_ext(dist) cmd.compiler = 'unix' cmd.ensure_finalized() cmd.run() self.asser...
9,125
[ -0.013505048118531704, -0.006480104755610228, 0.05485484004020691, -0.0362839475274086, -0.03783731907606125, 0.033803194761276245, -0.023706285282969475, 0.00882754847407341, -0.0032110714819282293, 0.07011032849550247, 0.040967244654893875, -0.03204116225242615, 0.016658158972859383, 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_check_extensions_list(self): dist = Distribution() cmd = build_ext(dist) cmd.finalize_options() #'extensions' option must be a list of Extension instances self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, 'foo') # each element of 'ext_modules' o...
9,126
[ 0.0021829823963344097, -0.02291082963347435, 0.060923442244529724, -0.024098319932818413, -0.007654152810573578, 0.01505015604197979, 0.0010672896169126034, -0.015824606642127037, 0.0020038906950503588, 0.046725183725357056, 0.0438339002430439, -0.006569921970367432, 0.009041709825396538, ...
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_ext_fullpath(self): ext = sysconfig.get_config_vars()['SO'] dist = Distribution() cmd = build_ext(dist) cmd.inplace = 1 cmd.distribution.package_dir = {'': 'src'} cmd.distribution.packages = ['lxml', 'lxml.html'] curdir = os.getcwd() wanted = os.p...
9,127
[ 0.02714492753148079, -0.0018897514091804624, 0.07013677060604095, -0.04214145615696907, -0.007484765257686377, 0.028373267501592636, 0.009320523589849472, -0.00036909207119606435, 0.0025562262162566185, 0.01276257075369358, 0.04408520087599754, -0.010683843865990639, 0.01191893219947815, 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_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') self.write_file(c_file, 'void initfoo(void) {};\n') ext = Extension('foo', [c_file]) dist = Distribution({'name': 'xx', 'ext_modules': [ext]}) cmd = b...
9,128
[ 0.012405134737491608, -0.012228758074343204, 0.04564619064331055, -0.02211759053170681, -0.029537154361605644, 0.028572963550686836, 0.022470343858003616, 0.0023869595024734735, -0.039155542850494385, 0.016156071797013283, 0.040284350514411926, -0.007872262969613075, 0.015579908154904842, ...
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_build_ext_inplace(self): etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c') etree_ext = Extension('lxml.etree', [etree_c]) dist = Distribution({'name': 'lxml', 'ext_modules': [etree_ext]}) cmd = build_ext(dist) cmd.ensure_finalized() cmd.inplace = 1 cmd...
9,129
[ -0.002835575258359313, -0.00876189861446619, 0.04156167805194855, -0.018166031688451767, -0.03135475143790245, 0.03133181482553482, 0.036263249814510345, -0.006416600197553635, 0.01145125087350607, 0.05280076339840889, 0.011176008731126785, -0.017604077234864235, -0.011302161030471325, -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_build_ext_path_with_os_sep(self): dist = Distribution({'name': 'UpdateManager'}) cmd = build_ext(dist) cmd.ensure_finalized() ext = sysconfig.get_config_var("SO") ext_name = os.path.join('UpdateManager', 'fdsend') ext_path = cmd.get_ext_fullpath(ext_name) ...
9,130
[ 0.0018527217907831073, -0.015331272967159748, 0.0599355511367321, 0.00022344838362187147, -0.04180203750729561, 0.02020624652504921, 0.03501644358038902, -0.015597601421177387, -0.00711560994386673, 0.06280726939439774, -0.0016037622699514031, 0.0037430771626532078, -0.00014655319682788104, ...
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_build_ext_path_cross_platform(self): if sys.platform != 'win32': return dist = Distribution({'name': 'UpdateManager'}) cmd = build_ext(dist) cmd.ensure_finalized() ext = sysconfig.get_config_var("SO") # this needs to work even under win32 ext_...
9,131
[ 0.020889848470687866, -0.004119040444493294, 0.07398638129234314, -0.019891656935214996, -0.014588017016649246, 0.03261558338999748, 0.0140588553622365, 0.024401554837822914, -0.014443700201809406, 0.003535760100930929, 0.01761866919696331, -0.014840571209788322, -0.05075138807296753, 0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_deployment_target_higher_ok(self): # Issue 9516: Test that an extension module can be compiled with a # deployment target higher than that of the interpreter: the ext # module may depend on some newer OS feature. deptarget = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') ...
9,132
[ -0.05307706072926521, -0.013145786710083485, -0.005808271933346987, -0.03970331326127052, 0.009868837893009186, -0.004212540574371815, 0.0058557637967169285, -0.019471721723675728, -0.038487520068883896, -0.010600214824080467, -0.01701163500547409, -0.032636504620313644, 0.004504616372287273...
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": "lookup_type", "annotation": null, "type_comment": null}}, {"_type...
def date_extract_sql(self, lookup_type, field_name): # http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html if lookup_type == 'week_day': # DAYOFWEEK() returns an integer, 1-7, Sunday=1. # Note: WEEKDAY() returns 0-6, Monday=0. return "DAYOFWEEK(%s)" % field...
9,133
[ 0.048556916415691376, 0.01598161831498146, 0.07254067808389664, -0.031645871698856354, -0.056083012372255325, 0.019767334684729576, 0.00019835341663565487, 0.020583417266607285, -0.04125751182436943, 0.0077754538506269455, 0.0012397088576108217, -0.009197931736707687, 0.0003572132554836571, ...
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": "operator", "annotation": null, "type_comment": null}}, {"_type": ...
def _try_compile_deployment_target(self, operator, target): orig_environ = os.environ os.environ = orig_environ.copy() self.addCleanup(setattr, os, 'environ', orig_environ) if target is None: if os.environ.get('MACOSX_DEPLOYMENT_TARGET'): del os.environ['MACO...
9,134
[ -0.039252493530511856, 0.011659730225801468, 0.0335676483809948, -0.022449331358075142, 0.0211731418967247, -0.011156989261507988, -0.005322290118783712, -0.015159583650529385, -0.04412521421909332, -0.00944573525339365, -0.03615869954228401, -0.02797948569059372, 0.02981642633676529, -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": "lookup_type", "annotation": null, "type_comment": null}}, {"_type...
def date_trunc_sql(self, lookup_type, field_name): fields = { 'year': '%%Y-01-01', 'month': '%%Y-%%m-01', } # Use double percents to escape. if lookup_type in fields: format_str = fields[lookup_type] return "CAST(DATE_FORMAT(%s, '%s') AS DATE)" % ...
9,135
[ -0.015661509707570076, 0.027390172705054283, 0.04144460707902908, -0.026751335710287094, 0.019414681941270828, -0.027509955689311028, 0.0007498858612962067, 0.02213972434401512, -0.030584363266825676, -0.0022820986341685057, -0.027689628303050995, -0.008384747430682182, 0.04328126460313797, ...
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": "lookup_type", "annotation": null, "type_comment": null}}, {"_type...
def datetime_trunc_sql(self, lookup_type, field_name, tzname): field_name, params = self._convert_field_to_tz(field_name, tzname) fields = ['year', 'month', 'day', 'hour', 'minute', 'second'] format = ('%%Y-', '%%m', '-%%d', ' %%H:', '%%i', ':%%s') # Use double percents to escape. forma...
9,136
[ -0.025169095024466515, 0.024436399340629578, 0.014228163287043571, -0.03798137232661247, 0.0040941862389445305, -0.02748599834740162, 0.0010891426354646683, -0.029010798782110214, -0.02091153897345066, -0.017723320052027702, -0.03152572736144066, -0.02364429645240307, 0.009916148148477077, ...
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": "lookup_type", "annotation": null, "type_comment": null}}, {"_type...
def time_trunc_sql(self, lookup_type, field_name): fields = { 'hour': '%%H:00:00', 'minute': '%%H:%%i:00', 'second': '%%H:%%i:%%s', } # Use double percents to escape. if lookup_type in fields: format_str = fields[lookup_type] return "C...
9,137
[ 0.04611021280288696, 0.02728579379618168, 0.023952525109052658, -0.0203628521412611, -0.014583049342036247, 0.00943891890347004, 0.01704026758670807, 0.008685728535056114, -0.012029680423438549, 0.0037766359746456146, 0.019251761958003044, -0.0048236241564154625, -0.006746663711965084, -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": "style", "annotation": null, "type_comment": null}}, {"_type": "ar...
def sql_flush(self, style, tables, sequences, allow_cascade=False): # NB: The generated SQL below is specific to MySQL # 'TRUNCATE x;', 'TRUNCATE y;', 'TRUNCATE z;'... style SQL statements # to clear all tables of all data if tables: sql = ['SET FOREIGN_KEY_CHECKS = 0;'] ...
9,138
[ 0.015047719702124596, 0.02133694849908352, 0.015438158996403217, 0.011491561308503151, 0.018055154010653496, -0.028048275038599968, 0.03807305172085762, -0.003107681404799223, -0.0015564787900075316, 0.015522577799856663, -0.01903652586042881, -0.02321527525782585, 0.036258041858673096, 0....
7
{"_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 adapt_timefield_value(self, value): if value is None: return None # Expression values are adapted by the database. if hasattr(value, 'resolve_expression'): return value # MySQL doesn't support tz-aware times if timezone.is_aware(value): r...
9,139
[ 0.01923498325049877, 0.0021155867725610733, 0.02517273835837841, 0.006261823233217001, 0.002940129954367876, -0.020165370777249336, 0.0447840578854084, -0.0007905682432465255, -0.0016229517059400678, 0.028099801391363144, -0.009324785321950912, -0.012460923753678799, 0.03378666564822197, -...
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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul...
def adapt_datetimefield_value(self, value): if value is None: return None # Expression values are adapted by the database. if hasattr(value, 'resolve_expression'): return value # MySQL doesn't support tz-aware datetimes if timezone.is_aware(value): ...
9,140
[ 0.05159976705908775, -0.01369834691286087, -0.0010607379954308271, 0.017975516617298126, 0.01412036083638668, 0.06537795811891556, 0.03873404487967491, 0.01424582488834858, -0.0073852455243468285, 0.01250073965638876, -0.045760005712509155, -0.027168577536940575, 0.02431713230907917, 0.002...
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": "connector", "annotation": null, "type_comment": null}}, {"_type":...
def combine_expression(self, connector, sub_expressions): if connector == '^': return 'POW(%s)' % ','.join(sub_expressions) # Convert the result to a signed integer since MySQL's binary operators # return an unsigned integer. elif connector in ('&', '|', '<<'): re...
9,141
[ 0.0048745316453278065, -0.0017244545742869377, 0.01514449529349804, -0.006437232717871666, 0.012260351330041885, -0.02460843324661255, 0.036539796739816666, 0.030376721173524857, -0.010072569362819195, -0.030771508812904358, -0.008592115715146065, -0.011514641344547272, 0.05768287181854248, ...
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": "expression", "annotation": null, "type_comment": null}}], "kwarg"...
def get_db_converters(self, expression): converters = super(DatabaseOperations, self).get_db_converters(expression) internal_type = expression.output_field.get_internal_type() if internal_type == 'TextField': converters.append(self.convert_textfield_value) elif internal_type ...
9,142
[ 0.012243896722793579, -0.02613580785691738, 0.0037291592452675104, 0.004981015808880329, 0.01415601558983326, 0.011821329593658447, 0.043608978390693665, -0.011895278468728065, 0.0010102007072418928, 0.01292000524699688, -0.010516651906073093, -0.0263893473893404, 0.01285661943256855, 0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "group_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def silo_role_from_group(group_name): # FIXME: Assumes siloname and role aren't complex strings # Failing edge cases are possible if group_name == u"superuser": return (None, u"superuser") s = group_name.rsplit(".", 1) if len(s) == 2: return s else: log.error("FATAL: Grou...
9,143
[ -0.029509304091334343, 0.0041900863870978355, 0.03708399832248688, -0.04672839865088463, 0.008892265148460865, 0.02193460986018181, -0.005003565922379494, -0.005259612109512091, 0.01838197000324726, 0.00734532019123435, -0.03554772213101387, -0.052702806890010834, -0.006321136374026537, -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": "internal_type", "annotation": null, "type_comment": null}}, {"_ty...
def subtract_temporals(self, internal_type, lhs, rhs): lhs_sql, lhs_params = lhs rhs_sql, rhs_params = rhs if self.connection.features.supports_microsecond_precision: if internal_type == 'TimeField': return ( "((TIME_TO_SEC(%(lhs)s) * POW(10, 6) + ...
9,144
[ 0.003927838522940874, 0.034542206674814224, 0.057380594313144684, -0.026208359748125076, -0.012102296575903893, 0.006056840531527996, 0.028462598100304604, 0.007810136768966913, 0.016713237389922142, -0.033198773860931396, -0.0011463310802355409, -0.04690635949373245, 0.0051175751723349094, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "siloname", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "role", "annotation": null, "type_comment": null}}], "kwarg": ...
def add_group_helper(siloname, role): gname = group_name(siloname, role) try: group = Group.objects.get(name=gname) log.info("Skipping '%s' - exists in db already" % group_name) except Group.DoesNotExist: log.info("Creating '%s'") g = Group(name=gname) g.save()
9,145
[ 0.02843293733894825, 0.03463013842701912, 0.03825244680047035, -0.035306595265865326, -0.01053960807621479, 0.021341068670153618, 0.006693632807582617, 0.02614171802997589, 0.01807880960404873, -0.044995177537202835, 0.010577795095741749, -0.05097416788339615, 0.007702860049903393, -0.0233...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "siloname", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "role", "annotation": null, "type_comment": null}}], "kwarg": ...
def del_group_helper(siloname, role): group_name = group_name(siloname, role) try: group = Group.objects.get(name=group_name) log.info("Deleting '%s'") g.delete() except Group.DoesNotExist: log.info("Skipping '%s' - does not exists in db" % group_name)
9,146
[ 0.005703179631382227, -0.008016792125999928, 0.015859441831707954, 0.008626292459666729, 0.013085594400763512, 0.03174376115202904, 0.03878410905599594, -0.004695638548582792, -0.044879112392663956, 0.011574283242225647, 0.001336391200311482, -0.053436990827322006, 0.001722770743072033, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "siloname", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def add_silo(siloname): if siloname == "*": # make sure superuser role exists add_group_helper(None, u"superuser") return True s, status = Silo.objects.get_or_create(silo=siloname) if status: log.info("Added Silo: '%s'" % siloname) else: log.info("Silo '%...
9,147
[ 0.014962957240641117, 0.011806708760559559, 0.008393283933401108, 0.0037436618003994226, -0.003734894562512636, 0.04493563249707222, 0.014998027123510838, 0.0382256805896759, -0.0382724404335022, -0.0010192053159698844, 0.032801609486341476, -0.06621108949184418, -0.006528759375214577, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "silo_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs...
def delete_silo(silo_name): if silo_name == '*': del_group_helper(None, u"superuser") else: Group.objects.filter(name__startswith=silo_name).delete() #for role in ROLES[1:]: # del_group_helper(siloname, role) return True
9,148
[ -0.0007602634723298252, -0.009186920709908009, -0.024705443531274796, 0.012441430240869522, 0.01399383693933487, 0.012563405558466911, 0.032423123717308044, 0.05468906834721565, 0.014736774377524853, 0.013417229056358337, -0.0021248566918075085, -0.002476920373737812, 0.009392060339450836, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "user_details", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def add_user(user_details): # Does user already exist? try: u = User.objects.get(username=user_details['username']) log.warn("Username '%s' already exists. Not overwriting." % user_details['username']) return False except User.DoesNotExist: # parameter cleanup usernam...
9,149
[ -0.0009559749159961939, -0.00830115471035242, -0.011355209164321423, 0.01559948455542326, 0.02467554807662964, 0.008296089246869087, 0.02998342551290989, 0.0642617717385292, 0.005900454241782427, 0.024614771828055382, 0.005510467104613781, -0.0158932413905859, -0.02710663713514805, 0.02054...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "user_details", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def update_user(user_details): if not ('username' in user_details and user_details['username']): return False try: u = User.objects.get(username=user_details['username']) log.info("Updating user '%s'" % user_details['username']) if 'password' in user_details and user_details['pas...
9,150
[ -0.051244329661130905, 0.003747669979929924, 0.05942971631884575, 0.008294843137264252, 0.01783652976155281, 0.030038466677069664, 0.022671619430184364, 0.04256401211023331, -0.01477176882326603, -0.008846880868077278, -0.0229000486433506, 0.000648406392429024, -0.019549749791622162, 0.035...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "username", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "groups", "annotation": null, "type_comment": null}}], "kwarg"...
def add_user_groups(username, groups): #groups is a list of (silo_name, permission_name) tuples try: groups_list_names = [group_name(*group) for group in groups] u = User.objects.get(username=username) log.info("Adding user '%s' to %s" % (username, groups_list_names)) # gather li...
9,151
[ 0.00486376928165555, 0.02147999405860901, -0.04252324253320694, -0.001456649275496602, 0.013678111135959625, 0.046493664383888245, 0.009375163353979588, 0.087984599173069, 0.033927273005247116, 0.01748971827328205, 0.0434364378452301, -0.00200134189799428, -0.006005266215652227, 0.03700435...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "username", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def delete_user(username): try: u = User.objects.get(username=username) log.info("Deleting user '%s'" % username) u.profile.delete() u.delete() except User.DoesNotExist: log.error('Error deleting user %s. Does the user exist?' % username) return False return T...
9,152
[ -0.03828829526901245, 0.019444743171334267, 0.04166999086737633, -0.00514299375936389, -0.0004685055755544454, 0.034211475402116776, 0.016861503943800926, 0.06207288056612015, -0.011798356659710407, -0.012803470715880394, 0.00557040236890316, 0.011103230528533459, -0.010436284355819225, 0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "username", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "groups", "annotation": null, "type_comment": null}}], "kwarg"...
def delete_user_groups(username, groups): #groups is a list of (silo_name, permission_name) tuples try: groups_list_names = [group_name(*group) for group in groups] u = User.objects.get(username=username) log.info("Adding user '%s' to %s" % (username, groups_list_names)) # gather...
9,153
[ -0.01675591617822647, -0.0033958153799176216, 0.026843881234526634, 0.007544463966041803, -0.0020756686571985483, 0.023187262937426567, 0.02200423926115036, 0.0483534000813961, -0.04265337809920311, -0.020864233374595642, 0.029618607833981514, -0.04377187415957451, 0.010652589611709118, 0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "silo_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user_groups", "annotation": null, "type_comment": null}}], "...
def add_group_users(silo_name, user_groups): #user_groups is a list of (user_name, permission_name) tuples groups_holder = {} user_holder = {} user_groups_holder = {} for user, role in user_groups: if not user_groups_holder.has_key(user): user_groups_holder[user] = [] try...
9,154
[ -0.0001564787089591846, 0.012950613163411617, 0.0167539119720459, -0.00041851113201119006, -0.005866562947630882, 0.032538145780563354, 0.020169340074062347, 0.05494852364063263, -0.03682628646492958, -0.026741614565253258, 0.053267743438482285, -0.045208629220724106, 0.0023433929309248924, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "silo_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user_groups", "annotation": null, "type_comment": null}}], "...
def delete_group_users(silo_name, user_groups): #user_groups is a list of (user_name, permission_name) tuples groups_holder = {} user_holder = {} user_groups_holder = {} for user, role in user_groups: if not user_groups_holder.has_key(user): user_groups_holder[user] = [] ...
9,155
[ -0.02793128602206707, -0.013203521259129047, -0.019587531685829163, -0.018191957846283913, 0.029970211908221245, -0.007645966950803995, 0.01761789247393608, 0.06833366304636002, 0.01642027124762535, -0.0013361884048208594, -0.02242816984653473, -0.03434498980641365, 0.026604995131492615, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "username", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user_object", "annotation": null, "type_comment": null}}], "k...
def list_user_details(username, user_object=None): try: u = user_object if u == None: u = User.objects.get(username=username) log.info("Getting user '%s' information" % username) user_details = {} user_details['user_name'] = u.username user_de...
9,156
[ 0.01492431852966547, 0.007399143185466528, 0.018064621835947037, 0.01910438761115074, 0.011048827320337296, 0.01137441024184227, 0.011479437351226807, 0.016856813803315163, -0.014157622121274471, -0.007435902487486601, 0.013075845316052437, -0.04352313652634621, 0.022160669788718224, -0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "siloname", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def list_group_users(siloname): # NOTE: Original code seems to have oddness wrt users with multiple # permissions for a single silo. # New code mimics this until I can see why # would be better if 'permission' key in returned dict was # a list of permissions? group_users =[] for u in Us...
9,157
[ -0.04020924121141434, 0.011000830680131912, 0.022965239360928535, 0.0011530296178534627, 0.0177559033036232, 0.03870365396142006, 0.00928947888314724, 0.045127496123313904, -0.008426275104284286, -0.0014742218190804124, 0.010248037055134773, -0.030151912942528725, 0.006915668491274118, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "username", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "siloname", "annotation": null, "type_comment": null}}], "kwar...
def list_user_group_and_permissions(username, siloname=None): try: u = User.objects.get(username=username) if siloname != None: group_list = u.groups.filter(name__startswith=siloname) else: group_list = u.groups.all() roles = [] for g in group_list: ...
9,158
[ -0.014335010200738907, 0.01073411013931036, 0.014597932808101177, 0.02352587692439556, 0.014952306635677814, -0.005641409195959568, -0.008070587180554867, 0.06488478183746338, 0.012083018198609352, 0.0011974419467151165, -0.0018547490471974015, -0.008590717799961567, 0.023160072043538094, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c...
def list_new_users(): # Expensive operation... #Users not a part of any group ungrouped_users =[] for u in User.objects.all(): if u.groups.count() == 0: ungrouped_users.append({ 'user_name':u.username, 'permission':None, 'name':u.p...
9,159
[ 0.008748214691877365, -0.001012218650430441, 0.02804720774292946, -0.008224534802138805, 0.0014139364939182997, -0.011807609349489212, 0.014288200065493584, 0.005498641636222601, -0.008996274322271347, 0.010953184217214584, -0.002913315314799547, -0.035654351115226746, 0.010661025531589985, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "siloname", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def list_group_usernames(siloname): admins = [] managers = [] submitters = [] for u in User.objects.filter(groups__name__startswith=siloname): for group in u.groups.filter(name__startswith=siloname): silo, role = silo_role_from_group(group.name) username = u.username...
9,160
[ -0.03632940724492073, -0.0037641588132828474, -0.020284777507185936, 0.011763318441808224, 0.03834656625986099, 0.003581482684239745, 0.00038432757719419897, 0.060308877378702164, 0.02021273598074913, 0.0027864552102983, 0.010132096707820892, -0.0010581068927422166, 0.022847389802336693, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "username", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def list_user(username): try: u = User.objects.get(username=username) user_details = {} user_details['id'] = u.id # is this necessary? user_details['user_name'] = u.username user_details['name'] = u.profile.name user_details['firstname'] = u.first_name use...
9,161
[ 0.029968390241265297, -0.01840643770992756, 0.008306068368256092, -0.008650669828057289, -0.0013212175108492374, 0.004464957397431135, 0.02424088679254055, 0.008959622122347355, -0.02298131212592125, -0.024431012570858, 0.0228862501680851, -0.07091648131608963, 0.07148685306310654, -0.0066...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "silo_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "id", "annotation": null, "type_comment": null}}, {"_type": "...
def add_dataset(silo_name, id, name=None): # Unhappy about mixing db access modes here - ORM or is direct id needed for some reason? silo, status = Silo.objects.get_or_create(silo=silo_name) if status: log.warn("Needed to instantiate Silo '%s' in the database" % silo_name) add_silo(silo_name...
9,162
[ -0.011104363948106766, -0.03402820974588394, -0.0040818979032337666, -0.04244944825768471, -0.022918125614523888, -0.009182125329971313, -0.0112187834456563, 0.020686956122517586, -0.06238124147057533, -0.00692234979942441, -0.018375691026449203, -0.10105486214160919, -0.004488085396587849, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "silo_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": null, "type_comment": null}}, {"_type"...
def get_datasets(silo_name, start=0, rows=100): # NOTE: Pagination I guess? try: start = int(start) except: start = 0 try: rows = int(rows) except: rows = 100 return [d.id for d in Dataset.objects.filter(silo__silo__exact=silo_name)[start:rows+start]]
9,163
[ 0.012399811297655106, 0.0003663929528556764, -0.03277970105409622, -0.041680555790662766, -0.017279936000704765, 0.03992084413766861, -0.01764824613928795, 0.03488725796341896, -0.02835996448993683, -0.007120683789253235, 0.05974826589226723, -0.0785730630159378, 0.018313253298401833, 0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "silo_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "id", "annotation": null, "type_comment": null}}], "kwarg": n...
def delete_dataset(silo_name, id): try: d = Dataset.objects.get(id = id) d.delete() return True except Dataset.DoesNotExist: log.error('Error deleting dataset %s in silo %s'%(id, silo_name)) return False return True
9,164
[ -0.022272389382123947, -0.009392119944095612, 0.034487076103687286, -0.07459463179111481, -0.026647983118891716, -0.01132724154740572, 0.001317300251685083, -0.023098206147551537, -0.010581541806459427, 0.06562158465385437, -0.00037920530303381383, -0.028201010078191757, 0.009996075183153152...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lfw_dir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pairs", "annotation": null, "type_comment": null}}, {"_type": ...
def get_paths(lfw_dir, pairs, file_ext): nrof_skipped_pairs = 0 path_list = [] issame_list = [] for pair in pairs: if len(pair) == 3: path0 = os.path.join(lfw_dir, pair[0], pair[0] + '_' + '%04d' % int(pair[1])+'.'+file_ext) path1 = os.path.join(lfw_dir, pair[0], pair[0] ...
9,165
[ 0.005964695475995541, -0.00119431980419904, 0.011542790569365025, 0.00904522743076086, 0.0038015730679035187, -0.002252102131024003, -0.030878959223628044, 0.02800706960260868, -0.040034644305706024, 0.030093485489487648, 0.014334906823933125, -0.05783054605126381, 0.019280940294265747, 0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ident", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "permission", "annotation": null, "type_comment": null}}], "kwarg...
def authz(ident, permission=[]): silos=[] roles=ROLES if permission != []: if type(permission).__name__ != "list": roles = [permission] else: roles = permission permission_list = list_user_groups(ident.username) if permission_list: for silo, role in pe...
9,166
[ -0.03529486060142517, -0.03077240101993084, -0.018052978441119194, 0.0024824379943311214, -0.00028918252792209387, -0.02119903825223446, -0.024222204461693764, 0.023288218304514885, -0.020006977021694183, 0.01924503967165947, -0.010882172733545303, -0.008344433270394802, 0.013886906206607819...
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": "EdfToFifDialog", "anno...
class Ui_EdfToFifDialog(object): def setupUi(self, EdfToFifDialog): EdfToFifDialog.setObjectName(_fromUtf8("EdfToFifDialog")) EdfToFifDialog.resize(501, 183) self.gridLayout = QtGui.QGridLayout(EdfToFifDialog) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.splitt...
9,167
[ 0.005019504576921463, -0.0502195879817009, 0.03794696182012558, -0.04248783364892006, -0.019071662798523903, -0.048231422901153564, -0.015303965657949448, 0.0033688361290842295, 0.004703484009951353, 0.02805522456765175, -0.00415428401902318, -0.029675211757421494, 0.022557087242603302, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lfw_dir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pair_num", "annotation": null, "type_comment": null}}], "kwarg...
def gen_pairs(lfw_dir, pair_num=20): persons = os.listdir(lfw_dir) full_persion = [] for person_name in persons: path_name = os.path.join(lfw_dir, person_name) if not os.path.isdir(path_name): continue images = [] for name in os.listdir(path_name): ...
9,168
[ -0.00574975972995162, -0.01709834486246109, -0.0012601627968251705, -0.005667172838002443, -0.017428692430257797, -0.042603470385074615, -0.007324607577174902, 0.02467356063425541, -0.029981907457113266, 0.025903822854161263, -0.011157780885696411, 0.0001690006465651095, -0.00666960747912526...
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": "EdfToFifDialog", "annotation": null, "type_comment": null}}], "kw...
def retranslateUi(self, EdfToFifDialog): EdfToFifDialog.setWindowTitle(_translate("EdfToFifDialog", "Select a file for conversion", None)) self.browseButton.setText(_translate("EdfToFifDialog", "Browse...", None)) self.browseDestButton.setText(_translate("EdfToFifDialog", "Browse...", None)) ...
9,169
[ -0.028783857822418213, -0.030152102932333946, 0.012193865142762661, 0.02210731990635395, 0.0005384304095059633, -0.005998748354613781, -0.027821017429232597, 0.01130703929811716, -0.03681597113609314, 0.03093757852911949, -0.006454830523580313, -0.0016691343626007438, 0.01980157010257244, ...
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": "EdfToFifDialog", "annotation": null, "type_comment": null}}], "kw...
def setupUi(self, EdfToFifDialog): EdfToFifDialog.setObjectName(_fromUtf8("EdfToFifDialog")) EdfToFifDialog.resize(501, 183) self.gridLayout = QtGui.QGridLayout(EdfToFifDialog) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.splitter = QtGui.QSplitter(EdfToFifDialog) ...
9,170
[ 0.003796423552557826, -0.0028799802530556917, -0.006665043067187071, -0.03274959698319435, 0.028250694274902344, -0.007517108228057623, -0.0029973757918924093, -0.01038383413106203, 0.04386810213327408, 0.032416343688964844, 0.0408991277217865, -0.05207822099328041, -0.027478154748678207, ...
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 IfEqualTagTests(SimpleTestCase): @setup({'ifequal01': '{% ifequal a b %}yes{% endifequal %}'}) def test_ifequal01(self): output = self.engine.render_to_string('ifequal01', {'a': 1, 'b': 2}) self.assertEqual(output, '') @setup({'ifequal02': '{% ifequal a b %}yes{% endifequal %}'}) ...
9,171
[ 0.04824359342455864, 0.039569124579429626, 0.0574130043387413, -0.03683393448591232, -0.00980110839009285, -0.01187204010784626, 0.009781571105122566, -0.033030711114406586, -0.01955011859536171, -0.008667957037687302, -0.009540613740682602, -0.06507154554128647, 0.014926339499652386, 0.02...
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": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'XForm.is_crowd_form' db.add_column('odk_logger_xform', 'is_crowd_form', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False) def backwards(self, orm): # Deleting...
9,172
[ -0.012789812870323658, -0.014029822312295437, 0.015446976758539677, -0.046222832053899765, -0.005633186548948288, -0.016143742948770523, 0.016498032957315445, -0.0329015888273716, 0.021304545924067497, -0.029358703643083572, -0.011354944668710232, -0.04754551127552986, -0.014502206817269325,...
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 IfNotEqualTagTests(SimpleTestCase): @setup({'ifnotequal01': '{% ifnotequal a b %}yes{% endifnotequal %}'}) def test_ifnotequal01(self): output = self.engine.render_to_string('ifnotequal01', {'a': 1, 'b': 2}) self.assertEqual(output, 'yes') @setup({'ifnotequal02': '{% ifnotequal a b %...
9,173
[ -0.05601860210299492, 0.0030426031444221735, 0.043749041855335236, -0.03569326922297478, -0.048756010830402374, -0.019321460276842117, -0.003981410525739193, -0.006044927518814802, -0.0141533724963665, 0.03326414152979851, 0.05066461116075516, 0.03549497202038765, 0.04022928699851036, 0.02...
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": "view", "annotation": n...
class ViewBoxMenu(QtGui.QMenu): def __init__(self, view): QtGui.QMenu.__init__(self) self.view = weakref.ref(view) ## keep weakref to view to avoid circular reference (don't know why, but this prevents the ViewBox from being collected) self.valid = False ## tells us whether the ui...
9,174
[ -0.03948420286178589, 0.019193710759282112, 0.03115862049162388, -0.0033962896559387445, -0.03886103257536888, -0.01036335714161396, -0.008288193494081497, -0.01701260730624199, -0.03245481848716736, 0.032504674047231674, 0.032953355461359024, 0.026372656226158142, 0.04471885412931442, 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": "view", "annotation": null, "type_comment": null}}], "kwarg": null...
def __init__(self, view): QtGui.QMenu.__init__(self) self.view = weakref.ref(view) ## keep weakref to view to avoid circular reference (don't know why, but this prevents the ViewBox from being collected) self.valid = False ## tells us whether the ui needs to be updated self.vi...
9,175
[ -0.03021850809454918, 0.012532293796539307, 0.0006453797104768455, 0.011091870255768299, -0.029683668166399002, 0.006825299002230167, 0.018172433599829674, 0.0015163953648880124, -0.022244518622756004, 0.039918579161167145, 0.04512111842632294, 0.02040904201567173, 0.0320904515683651, 0.02...
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 updateState(self): ## Something about the viewbox has changed; update the menu GUI state = self.view().getState(copy=False) if state['mouseMode'] == ViewBox.PanMode: self.mouseModes[0].setChecked(True) else: self.mouseModes[1].setChecked(True) ...
9,176
[ -0.01979399286210537, -0.029876790940761566, 0.01751483418047428, -0.03433601185679436, -0.06485691666603088, -0.01908794976770878, -0.001216996111907065, -0.023794906213879585, 0.0005790796130895615, 0.055641189217567444, 0.022197019308805466, 0.011321470141410828, 0.035525139421224594, -...
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": "views", "annotation": null, "type_comment": null}}], "kwarg": nul...
def setViewList(self, views): names = [''] self.viewMap.clear() ## generate list of views to show in the link combo for v in views: name = v.name if name is None: ## unnamed views do not show up in the view list (although they are linkable) ...
9,177
[ -0.01648847386240959, 0.0030915888492017984, 0.0226775910705328, -0.06329293549060822, -0.02630077861249447, -0.027773812413215637, 0.024613918736577034, 0.010548821650445461, 0.0007554494659416378, 0.01297220028936863, 0.022178661078214645, -0.0052328333258628845, -0.011891183443367481, -...
16
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def main(args): socket.setdefaulttimeout(30) textfile_names = os.listdir(args.dataset_descriptor) for textfile_name in textfile_names: if textfile_name.endswith('.txt'): with open(os.path.join(args.dataset_descriptor, textfile_name), 'rt') as f: lines = f.readlines() ...
9,178
[ 0.04634395241737366, 0.0003953146224375814, -0.05721064656972885, 0.005266898777335882, -0.019379334524273872, 0.02298174984753132, 0.01896321214735508, 0.028486432507634163, 0.043847229331731796, -0.036571063101291656, 0.016835052520036697, 0.04437035322189331, -0.017025278881192207, -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 turnon(self): if ( get_power_state() == False ): GPIO.output(MODE_BTN, True) sleep(1) GPIO.output(MODE_BTN, True) print("Power on") elif ( get_power_state() == True ): print("GoPro is already on")
9,179
[ -0.0033536942210048437, 0.011340604163706303, -0.014231874607503414, -0.06235087662935257, -0.023040372878313065, 0.008435864932835102, -0.0202748104929924, -0.0034883806947618723, -0.0024872110225260258, 0.01037984061986208, -0.02167554944753647, -0.022393876686692238, -0.032127223908901215...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def parse_arguments(argv): parser = argparse.ArgumentParser() parser.add_argument('dataset_descriptor', type=str, help='Directory containing the text files with the image URLs. Image files will also be placed in this directory.') parser.add_argument('--output_format', type=str, help='Format of the ...
9,180
[ 0.04102326184511185, 0.007064464036375284, -0.048992820084095, -0.0003282081161160022, -0.03723830729722977, 0.02365008555352688, 0.003817278891801834, 0.025436772033572197, 0.07598119229078293, -0.031643155962228775, 0.011049244552850723, 0.019547760486602783, -0.024096757173538208, -0.00...
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 turnoff(self): if ( get_power_state() == True ): GPIO.output(MODE_BTN, True) sleep(3) GPIO.output(MODE_BTN, True) print("Power off") elif ( get_power_state() == False ): print("GoPro is already off")
9,181
[ 0.01877872832119465, 0.0014617532724514604, 0.028811559081077576, -0.0386342778801918, -0.014668419025838375, 0.01829284429550171, 0.005584373604506254, 0.024977020919322968, 0.00848325714468956, 0.007321077398955822, 0.027419568970799446, -0.02189100719988346, -0.006303349509835243, -0.03...
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 TestExplorer(unittest.TestCase): def setUp(self): self.invertor = Invertor() x, y, err = load('sphere_80.txt') # Choose the right d_max... self.invertor.d_max = 160.0 # Set a small alpha self.invertor.alpha = .0007 # Set data ...
9,182
[ 0.023411190137267113, 0.01003625150769949, -0.010547825135290623, -0.024138161912560463, -0.030102023854851723, 0.004981104284524918, 0.030748222023248672, 0.01709730364382267, -0.004472896922379732, 0.00028292168281041086, 0.04111430421471596, -0.009282355196774006, -0.04555691033601761, ...
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 setUp(self): self.invertor = Invertor() x, y, err = load('sphere_80.txt') # Choose the right d_max... self.invertor.d_max = 160.0 # Set a small alpha self.invertor.alpha = .0007 # Set data self.invertor.x = x self.invertor.y = y ...
9,183
[ -0.00649054441601038, -0.022182613611221313, 0.002841545967385173, -0.004521734546869993, 0.020670786499977112, 0.01797698810696602, -0.006658907048404217, -0.00950388889759779, 0.0377681665122509, 0.015736736357212067, 0.003731461940333247, -0.032078202813863754, -0.037025995552539825, -0...
15
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_invert_real(): x = Symbol('x', real=True) y = Symbol('y') n = Symbol('n') def ireal(x, s=S.Reals): return Intersection(s, x) minus_n = Intersection(Interval(-oo, 0), FiniteSet(-n)) plus_n = Intersection(Interval(0, oo), FiniteSet(n)) assert solveset(abs(x) - n, x, S.Reals) ...
9,184
[ 0.0026486909482628107, -0.034649841487407684, 0.014872152358293533, -0.007442058529704809, 0.005485826171934605, -0.024443931877613068, -0.02519771084189415, 0.00045391175081022084, 0.07537776231765747, 0.002491653896868229, 0.02002894878387451, -0.05096972733736038, -0.029481081292033195, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg...
def test_garbage_input(): raises(ValueError, lambda: solveset_real(x, 1)) raises(ValueError, lambda: solveset_real([x], x)) raises(ValueError, lambda: solveset_real(x, pi)) raises(ValueError, lambda: solveset_real(x, x**2)) raises(ValueError, lambda: solveset_complex([x], x)) raises(ValueError,...
9,185
[ -0.029633739963173866, 0.0013029456604272127, -0.03531494364142418, -0.009574995376169682, 0.023398857563734055, 0.006415427662432194, -0.005004154052585363, -0.006433482281863689, 0.028189364820718765, -0.010212928056716919, 0.029296718537807465, -0.020257344469428062, 0.006553846877068281,...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_invert_complex(): assert invert_complex(x + 3, y, x) == (x, FiniteSet(y - 3)) assert invert_complex(x*3, y, x) == (x, FiniteSet(y / 3)) assert invert_complex(exp(x), y, x) == \ (x, imageset(Lambda(n, I*(2*pi*n + arg(y)) + log(Abs(y))), S.Integers)) assert invert_complex(log(x), y, x) ...
9,186
[ -0.0015186055097728968, -0.02571987360715866, 0.007472502999007702, -0.017692958936095238, -0.013703606091439724, -0.00027212113491259515, -0.016933655366301537, 0.017234966158866882, 0.051102280616760254, -0.0003188242844771594, 0.04266558215022087, -0.02914276160299778, -0.0377481915056705...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_solve_invert(): assert solveset_real(exp(x) - 3, x) == FiniteSet(log(3)) assert solveset_real(log(x) - 3, x) == FiniteSet(exp(3)) assert solveset_real(3**(x + 2), x) == FiniteSet() assert solveset_real(3**(2 - x), x) == FiniteSet() assert solveset_real(y - b*exp(a/x), x) == Intersection(S...
9,187
[ 0.012788986787199974, -0.049001213163137436, 0.03186472877860069, 0.020685456693172455, 0.014246601611375809, 0.020393934100866318, -0.0244879312813282, 0.022269820794463158, 0.0349574089050293, 0.05779759958386421, 0.04484384134411812, -0.04357634857296944, -0.027149662375450134, 0.032118...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_errorinverses(): assert solveset_real(erf(x) - S.One/2, x) == \ FiniteSet(erfinv(S.One/2)) assert solveset_real(erfinv(x) - 2, x) == \ FiniteSet(erf(2)) assert solveset_real(erfc(x) - S.One, x) == \ FiniteSet(erfcinv(S.One)) assert solveset_real(erfcinv(x) - 2, x) == Fin...
9,188
[ 0.016720006242394447, -0.010095424950122833, 0.0080947894603014, 0.01309926062822342, 0.04478655755519867, 0.01591283455491066, -0.004860333167016506, -0.003672635881230235, 0.0157629307359457, 0.013917963951826096, 0.004384677857160568, -0.06222148612141609, -0.025852588936686516, -0.0255...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"...
def test_return_root_of(): f = x**5 - 15*x**3 - 5*x**2 + 10*x + 20 s = list(solveset_complex(f, x)) for root in s: assert root.func == CRootOf # if one uses solve to get the roots of a polynomial that has a CRootOf # solution, make sure that the use of nfloat during the solve process # ...
9,189
[ -0.004164728336036205, -0.044059380888938904, -0.0009684033575467765, 0.0010337557177990675, 0.0215306356549263, -0.004256816115230322, -0.01923736184835434, 0.016551973298192024, 0.054420702159404755, 0.026568710803985596, 0.03386441245675087, -0.06245310232043266, -0.03557545319199562, 0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_solve_polynomial(): assert solveset_real(3*x - 2, x) == FiniteSet(Rational(2, 3)) assert solveset_real(x**2 - 1, x) == FiniteSet(-S(1), S(1)) assert solveset_real(x - y**3, x) == FiniteSet(y ** 3) a11, a12, a21, a22, b1, b2 = symbols('a11, a12, a21, a22, b1, b2') assert solveset_real(x**...
9,190
[ 0.0020332003477960825, -0.05541083216667175, 0.024643367156386375, -0.0032488335855305195, 0.025304770097136497, 0.011243842542171478, -0.024508636444807053, -0.011378572322428226, 0.03872879222035408, 0.030914442613720894, 0.03167383000254631, -0.06187787652015686, -0.05335313454270363, 0...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_solveset_sqrt_2(): # http://tutorial.math.lamar.edu/Classes/Alg/SolveRadicalEqns.aspx#Solve_Rad_Ex2_a assert solveset_real(sqrt(2*x - 1) - sqrt(x - 4) - 2, x) == \ FiniteSet(S(5), S(13)) assert solveset_real(sqrt(x + 7) + 2 - sqrt(3 - x), x) == \ FiniteSet(-6) # http://www.purp...
9,191
[ -0.002144312020391226, -0.04283588379621506, 0.015845248475670815, -0.013472937047481537, 0.008968902751803398, 0.009741023182868958, -0.026632551103830338, -0.012622485868632793, 0.045969124883413315, 0.029922453686594963, 0.02569257840514183, -0.04048595204949379, -0.04861000180244446, 0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_solveset_sqrt_1(): assert solveset_real(sqrt(5*x + 6) - 2 - x, x) == \ FiniteSet(-S(1), S(2)) assert solveset_real(sqrt(x - 1) - x + 7, x) == FiniteSet(10) assert solveset_real(sqrt(x - 2) - 5, x) == FiniteSet(27) assert solveset_real(sqrt(x) - 2 - 5, x) == FiniteSet(49) assert solv...
9,192
[ -0.001979137770831585, 0.004272119607776403, -0.0033882325515151024, -0.01547442376613617, 0.002561990637332201, 0.004819744732230902, -0.010984535329043865, 0.00527770072221756, 0.024748830124735832, 0.027771979570388794, 0.013309541158378124, -0.022968245670199394, -0.031102566048502922, ...
21
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_solve_sqrt_3(): R = Symbol('R') eq = sqrt(2)*R*sqrt(1/(R + 1)) + (R + 1)*(sqrt(2)*sqrt(1/(R + 1)) - 1) sol = solveset_complex(eq, R) fset = [S(5)/3 + 4*sqrt(10)*cos(atan(3*sqrt(111)/251)/3)/3, -sqrt(10)*cos(atan(3*sqrt(111)/251)/3)/3 + 40*re(1/((-S(1)/2 - sqrt(3)*I/2)*(S...
9,193
[ 0.02124890498816967, -0.036620453000068665, -0.024163788184523582, -0.004336632788181305, -0.018250739201903343, -0.006573359481990337, 0.012718409299850464, -0.0015176726737990975, 0.07247946411371231, 0.02129649557173252, 0.03685840219259262, -0.08708957582712173, -0.03702496737241745, 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": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_solve_polynomial_symbolic_param(): assert solveset_complex((x**2 - 1)**2 - a, x) == \ FiniteSet(sqrt(1 + sqrt(a)), -sqrt(1 + sqrt(a)), sqrt(1 - sqrt(a)), -sqrt(1 - sqrt(a))) # issue 4507 assert solveset_complex(y - b/(1 + a*x), x) == \ FiniteSet((b/y - 1)/a) - Fin...
9,194
[ -0.0030856523662805557, -0.02828766405582428, 0.04243149608373642, -0.007132359780371189, 0.007005427964031696, 0.019789276644587517, -0.016912154853343964, 0.007259291596710682, 0.06523086875677109, 0.038224611431360245, 0.02452806383371353, -0.08012420684099197, -0.044051386415958405, 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": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_solve_abs(): assert solveset_real(Abs(x) - 2, x) == FiniteSet(-2, 2) assert solveset_real(Abs(x + 3) - 2*Abs(x - 3), x) == \ FiniteSet(1, 9) assert solveset_real(2*Abs(x) - Abs(x - 1), x) == \ FiniteSet(-1, Rational(1, 3)) assert solveset_real(Abs(x - 7) - 8, x) == FiniteSet(-S...
9,195
[ 0.029083838686347008, -0.050645168870687485, 0.022100362926721573, 0.012828991748392582, 0.02013588696718216, -0.008061542175710201, -0.016266826540231705, -0.0005899419775232673, 0.059078045189380646, 0.017979754135012627, 0.03689383342862129, -0.04338618740439415, -0.04784219712018967, 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": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_no_sol(): assert solveset_real(4, x) == EmptySet() assert solveset_real(exp(x), x) == EmptySet() assert solveset_real(x**2 + 1, x) == EmptySet() assert solveset_real(-3*a/sqrt(x), x) == EmptySet() assert solveset_real(1/x, x) == EmptySet() assert solveset_real(-(1 + x)/(2 + x)**2 + 1/(2...
9,196
[ -0.008640042506158352, -0.037220634520053864, 0.021193288266658783, -0.019385207444429398, -0.014877920970320702, -0.00403589429333806, -0.0035806456580758095, -0.012081854045391083, 0.03177056089043617, 0.03551587089896202, 0.04114675149321556, -0.04354891553521156, -0.05605050176382065, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"...
def test_piecewise(): eq = Piecewise((x - 2, Gt(x, 2)), (2 - x, True)) - 3 assert set(solveset_real(eq, x)) == set(FiniteSet(-1, 5)) absxm3 = Piecewise( (x - 3, S(0) <= x - 3), (3 - x, S(0) > x - 3)) y = Symbol('y', positive=True) assert solveset_real(absxm3 - y, x) == FiniteSet(-y ...
9,197
[ -0.003937006928026676, -0.0386466421186924, 0.007509310729801655, 0.013189123012125492, 0.011114496737718582, 0.01495883334428072, 0.011664542369544506, 0.004561786539852619, 0.05758732557296753, 0.012364055961370468, 0.03979456424713135, -0.04637118801474571, -0.0716971755027771, 0.025278...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_solveset_complex_rational(): assert solveset_complex((x - 1)*(x - I)/(x - 3), x) == \ FiniteSet(1, I) assert solveset_complex((x - y**3)/((y**2)*sqrt(1 - y**2)), x) == \ FiniteSet(y**3) assert solveset_complex(-x**2 - I, x) == \ FiniteSet(-sqrt(2)/2 + sqrt(2)*I/2, sqrt(2)/2...
9,198
[ -0.0018585196230560541, -0.002691429341211915, -0.01398906297981739, -0.025684837251901627, 0.017811210826039314, 0.022168459370732307, -0.003631040919572115, 0.009478927589952946, 0.020168201997876167, -0.0015296555357053876, 0.03659069910645485, -0.03345653787255287, -0.07547468692064285, ...
11
{"_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 test_solve_quintics(): skip("This test is too slow") f = x**5 - 110*x**3 - 55*x**2 + 2310*x + 979 s = solveset_complex(f, x) for root in s: res = f.subs(x, root.n()).n() assert tn(res, 0) f = x**5 + 15*x + 12 s = solveset_complex(f, x) for root in s: res = f.subs...
9,199
[ 0.008932862430810928, -0.03954562917351723, 0.0003265395062044263, -0.009661264717578888, -0.013548284769058228, 0.016991641372442245, -0.01695191115140915, 0.0033142310567200184, 0.04203544184565544, 0.014144251123070717, 0.010475751012563705, -0.028844736516475677, -0.027811728417873383, ...
18
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_solve_lambert(): assert solveset_real(x*exp(x) - 1, x) == FiniteSet(LambertW(1)) assert solveset_real(x + 2**x, x) == \ FiniteSet(-LambertW(log(2))/log(2)) # issue 4739 assert solveset_real(exp(log(5)*x) - 2**x, x) == FiniteSet(0) ans = solveset_real(3*x + 5 + 2**(-5*x + 3), x) ...
9,200
[ 0.02098374255001545, -0.0533464252948761, 0.017300881445407867, 0.011427881196141243, 0.019503258168697357, 0.040278997272253036, -0.0075247823260724545, -0.012461774051189423, 0.01389943528920412, 0.04323996976017952, -0.013630256056785583, -0.06695221364498138, -0.04360703378915787, 0.03...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assert", "_fields": {"msg": null, "test": {"_type": "Compare",...
def test_conditionset(): assert solveset(Eq(sin(x)**2 + cos(x)**2, 1), x, domain=S.Reals) == \ ConditionSet(x, True, S.Reals) assert solveset(Eq(x**2 + x*sin(x), 1), x, domain=S.Reals) == \ ConditionSet(x, Eq(x*(x + sin(x)) - 1, 0), S.Reals) assert solveset(Eq(sin(Abs(x)), x), x, domain=S....