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
14,001
[ -0.020721638575196266, 0.00009870750363916159, 0.0072771706618368626, -0.04105932265520096, 0.011698666960000992, 0.008285055868327618, 0.014734321273863316, -0.03616388142108917, -0.03647584468126297, -0.003389613702893257, 0.026372995227575302, 0.030428532510995865, -0.0032636281102895737,...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_packinfo(): ggplot2 = localRepo.packinfo('ggplot2') print('ggplot2: {0}'.format(ggplot2.as_dict)) assert(ggplot2.name == 'ggplot2') assert(ggplot2.version == '2.2.1') assert(ggplot2.license == 'GPL-2 | file LICENSE') plyr = localRepo.packinfo('plyr') print('plyr: {0}'.format(plyr.as...
14,002
[ 0.010293782688677311, -0.058079108595848083, -0.02641693502664566, 0.019455071538686752, -0.021124010905623436, -0.0004243130679242313, -0.0006243623211048543, 0.019812701269984245, -0.009441431611776352, 0.021398194134235382, 0.05965267866849899, -0.014221752062439919, -0.01459130272269249,...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "chunk", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [...
def download_catching_exceptions(chunk): try: result = download_transactions(chunk) sys.stdout.write('.' if result != None and len(result) == 25 else '+') sys.stdout.flush() return result except: print("Chunk failed", list(map(lambda t: t[1], sample[idx * 25:idx *25 + 25])), sys.exc_info()[1]) traceback.p...
14,003
[ -0.005165683571249247, -0.034180741757154465, -0.041966356337070465, -0.025588084012269974, -0.004949086811393499, -0.030311673879623413, -0.0313560850918293, -0.0011237809667363763, -0.008705408312380314, 0.011536001227796078, 0.016864873468875885, -0.009364099241793156, 0.03325501456856727...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "transactions", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def download_transactions(transactions): ids = [tr[1] for tr in transactions] items, not_found, killed = allegro.get_items_info(ids) items = {item['itemInfo']['itId']: item for item in items} transactions_with_items = [] killed_info = [] for transaction in transactions: if transaction[1] in items: tr_info = ...
14,004
[ -0.005107862409204245, -0.04045221582055092, -0.004183826968073845, -0.037218090146780014, -0.006057565100491047, 0.008829671889543533, -0.05318336933851242, 0.002228272845968604, -0.0024753238540142775, 0.02310088463127613, 0.02933812327682972, -0.04258263111114502, 0.0049538565799593925, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "response", "annotation": null, "type_comment": null}}], "kwarg...
def main(request, response): last_event_id = request.headers.get("Last-Event-Id", "") ident = request.GET.first('ident', "test") cookie = "COOKIE" if ident in request.cookies else "NO_COOKIE" origin = request.GET.first('origin', request.headers["origin"]) credentials = request.GET.first('credentials...
14,005
[ 0.02339177019894123, -0.016255298629403114, 0.00010892619320657104, -0.04938262701034546, -0.006872158497571945, -0.014350036159157753, -0.04398621991276741, -0.011073646135628223, -0.008160687983036041, 0.021244220435619354, 0.025197915732860565, 0.01791827194392681, 0.017962325364351273, ...
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 create_plot(): fig, ax = plt.subplots() x = np.linspace(0, 10, 100) l1 = ax.plot(x, np.sin(x), label='sin', lw=3, alpha=0.2) l2 = ax.plot(x, np.cos(x), label='cos', lw=3, alpha=0.2) l3 = ax.plot(x[::5], 0.5 * np.sin(x[::5] + 2), 'ob', label='dots', alpha=0.2) labels = ['si...
14,006
[ 0.03717420995235443, -0.008410070091485977, 0.05205748602747917, -0.05019990727305412, -0.00668274937197566, 0.019108133390545845, -0.016333092004060745, -0.07847133278846741, -0.0177829097956419, -0.011983642354607582, -0.00022547200205735862, -0.023083802312612534, 0.027206718921661377, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _get_attribute_names(self): names = [] for dim in self.dimensions: for attr in dim.fields: if not attr['isSystemField']: names.append(dim.name +' '+ attr['displayName']) names.append('Unit') names.append('Scale') ...
14,007
[ 0.021554412320256233, -0.009353137575089931, 0.034880876541137695, -0.06090088188648224, -0.05119612440466881, -0.006850763224065304, -0.007085177581757307, -0.04285096749663353, 0.006311609875410795, -0.012799031101167202, -0.001665807911194861, -0.007647772319614887, 0.016244923695921898, ...
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": "series_point", "annotation": null, "type_comment": null}}], "kwar...
def _get_series_with_metadata(self, series_point): names = [] for dim in self.dimensions: for item in dim.items: if item.name == series_point[dim.id]: dim_attrs = item.fields break for attr in dim.fields: ...
14,008
[ -0.00155809021089226, 0.004194531589746475, 0.012634540908038616, -0.06915033608675003, -0.019993368536233902, 0.012906251475214958, -0.03020515665411949, -0.00754562858492136, 0.002262839348986745, -0.009792901575565338, 0.010223109275102615, -0.027827689424157143, 0.01854424551129341, -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": "resp", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _get_metadata_series(self, resp, names_of_attributes): series = {} for series_point in resp.tuples: val = series_point['Value'] if val is None: continue serie_name = self._get_series_name(series_point) if serie_name not in series...
14,009
[ 0.032963160425424576, 0.0014706256333738565, 0.07034333795309067, -0.03763861954212189, 0.013803175650537014, -0.0027488877531141043, -0.04388822615146637, 0.023365546017885208, -0.04701302945613861, 0.03329208493232727, 0.015154125168919563, -0.06564438343048096, -0.0016226073494181037, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation":...
class SelectionDataReader(DataReader): def __init__(self, client, dim_values, transform = None): super().__init__(client) self.dim_values = dim_values self.transform = transform def _get_dim_members(self, dim, splited_values): members = [] for value in splited_...
14,010
[ 0.05744225159287453, -0.013977933675050735, 0.03180607408285141, -0.04474373534321785, -0.002382466336712241, -0.017648784443736076, -0.0057035707868635654, 0.00903962180018425, -0.01755312830209732, 0.044839393347501755, 0.018808631226420403, -0.03094515949487686, -0.004265720956027508, -...
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": "dim", "annotation": null, "type_comment": null}}, {"_type": "arg"...
def _get_dim_members(self, dim, splited_values): members = [] for value in splited_values: if value is None or isinstance(value, str) and not value: raise ValueError('Selection for dimension {} is empty'.format(dim.name)) member = dim.find_member_by_id(valu...
14,011
[ -0.006127414293587208, -0.0008308105170726776, 0.06801608949899673, -0.020046846941113472, 0.004322601482272148, -0.028662217780947685, -0.03510584682226181, 0.031716976314783096, -0.02723030000925064, 0.037158261984586716, 0.024748310446739197, -0.0358695350587368, 0.018459804356098175, -...
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 _create_pivot_request(self): pivot_req = definition.PivotRequest(self.dataset.id) filter_dims = [] time_range = None for name, value in self.dim_values.items(): if definition.is_equal_strings_ignore_case(name, 'timerange'): time_range = value ...
14,012
[ -0.011840561404824257, 0.00011348289990564808, 0.06740902364253998, -0.04768632724881172, -0.0073728617280721664, 0.005711942445486784, -0.03995466232299805, 0.02828771434724331, -0.010347469709813595, -0.007853197865188122, -0.0006438232958316803, -0.050093792378902435, 0.005361818242818117...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "reader", "annotation":...
class PivotResponseReader(ResponseReader): def __init__(self, reader, pivot_resp): self.pivot_resp = pivot_resp super().__init__(reader) def get_pandasframe(self): names_of_dimensions = self.reader._get_dimension_names() # create dataframe with data ...
14,013
[ 0.011344479396939278, 0.03762512654066086, 0.01476096361875534, -0.01989663951098919, -0.01623925007879734, -0.025579828768968582, -0.003561575198546052, 0.034033436328172684, -0.023477377369999886, -0.0018328013829886913, -0.011410180479288101, -0.039026759564876556, 0.018626408651471138, ...
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": "reader", "annotation":...
class ResponseReader(object): def __init__(self, reader): self.include_metadata = reader.include_metadata self.dataset = reader.dataset self.reader = reader super().__init__() def _get_detail_columns(self, resp): detail_columns = [] if resp.descriptor is...
14,014
[ 0.02445509098470211, -0.01942450739443302, 0.09273770451545715, -0.04878519847989082, 0.023871835321187973, 0.012258791364729404, -0.015675004571676254, 0.020518112927675247, 0.0008000241359695792, -0.007066771388053894, 0.020195240154862404, -0.01678944006562233, 0.024538414552807808, -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 get_pandasframe(self): names_of_dimensions = self.reader._get_dimension_names() # create dataframe with data detail_columns = self._get_detail_columns(self.pivot_resp) series = self._get_data_series(self.pivot_resp, detail_columns) pandas_series = PandasHel...
14,015
[ -0.009969905018806458, -0.0013887676177546382, 0.029955552890896797, -0.046411626040935516, -0.026701010763645172, -0.01556221954524517, -0.057252466678619385, -0.007070610765367746, -0.018312538042664528, 0.026907283812761307, 0.013625537045300007, -0.03765644505620003, 0.003761633764952421...
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": "resp", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _get_data_series(self, resp, detail_columns): series_map = {} columns = None frequency_list = [] for series_point in resp.tuples: val = series_point['Value'] if val is None: continue series_name = self._get_series_name(ser...
14,016
[ -0.0010979506187140942, 0.0073130205273628235, 0.014705840498209, -0.06561768800020218, -0.01806880347430706, 0.014876838773488998, -0.022423556074500084, -0.0063326312229037285, -0.011496774852275848, -0.007854514755308628, 0.0019650536123663187, -0.03609200939536095, 0.021648366004228592, ...
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": "resp", "annotation": null, "type_comment": null}}], "kwarg": null...
def _get_metadata_series(self, resp): series = {} names_of_attributes = self._get_attribute_names(resp) for series_point in resp.tuples: serie_name = self._get_series_name(series_point) if serie_name not in series: serie_attrs = self._get_series_with...
14,017
[ 0.009480493143200874, -0.054368264973163605, 0.040001630783081055, -0.06103166565299034, -0.04969963803887367, -0.0048781828954815865, -0.0309190321713686, -0.03874959051609039, 0.005135487765073776, -0.03675481304526329, -0.009496408514678478, -0.016074925661087036, 0.012371857650578022, ...
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": "series_point", "annotation": null, "type_comment": null}}], "kwar...
def _get_series_name(self, series_point): names = [] for dim in self.dataset.dimensions: if dim.id in series_point: names.append(series_point[dim.id]) if self.dataset.has_time: names.append(series_point['Frequency']) return tuple(names)
14,018
[ 0.021478567272424698, 0.007817869074642658, 0.038677878677845, -0.06014469265937805, -0.021701935678720474, 0.020937781780958176, -0.03105986677110195, -0.0606149397790432, -0.01861005648970604, -0.008775998838245869, 0.011503436602652073, -0.025087719783186913, 0.02272472344338894, -0.023...
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": "resp", "annotation": null, "type_comment": null}}], "kwarg": null...
def _get_attribute_names(self, resp): resp_dims = [dim for dim in (resp.header + resp.stub + resp.filter) if dim.fields and any(dim.fields)] names = [] for dim in resp_dims: for d in self.dataset.dimensions: if dim.dimensionid == d.id: for at...
14,019
[ 0.006460936740040779, 0.004677354358136654, 0.043606773018836975, -0.07289635390043259, -0.06299564987421036, 0.0075771925039589405, -0.011726751923561096, -0.031133828684687614, 0.003212268464267254, -0.006952331867069006, 0.01156295370310545, -0.018466752022504807, 0.011823817156255245, ...
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": "series_point", "annotation": null, "type_comment": null}}, {"_typ...
def _get_series_with_metadata(self, series_point, resp): names = [] resp_dims = [dim for dim in (resp.header + resp.stub + resp.filter) if dim.fields and any(dim.fields)] for dim in resp_dims: if dim.dimensionid == 'Time' or not dim.metadataFields: continue ...
14,020
[ 0.00838687364012003, -0.004515570588409901, 0.06221452355384827, -0.06590908020734787, 0.0013925859238952398, 0.014139664359390736, -0.036466650664806366, -0.0032184841111302376, -0.017252672463655472, -0.007440428249537945, 0.0071610561572015285, -0.04613635689020157, -0.008495202288031578,...
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": "reader", "annotation":...
class StreamingResponseReader(ResponseReader): def __init__(self, reader, data_streaming): self.data_streaming = data_streaming super().__init__(reader) def get_pandasframe(self): detail_columns = self._get_detail_columns(self.data_streaming) # create dataframe with d...
14,021
[ 0.037120938301086426, -0.00158085604198277, 0.055899277329444885, -0.04739196598529816, 0.024629712104797363, 0.01969132013618946, 0.02085329405963421, 0.014161565341055393, -0.005789123475551605, -0.01445205882191658, 0.030377335846424103, -0.004222532734274864, 0.01572815701365471, -0.02...
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 get_pandasframe(self): detail_columns = self._get_detail_columns(self.data_streaming) # create dataframe with data series = self._get_data_series(self.data_streaming, detail_columns) pandas_series = {} names_of_dimensions = self.reader._get_dimension_names() i...
14,022
[ -0.01003340631723404, 0.0030314272735267878, 0.03851766884326935, -0.06352882832288742, -0.013916527852416039, -0.0003934373671654612, -0.044619716703891754, -0.011908640153706074, -0.03617814928293228, 0.03740820661187172, 0.018993528559803963, -0.024408189579844475, -0.008061697706580162, ...
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": "resp", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _get_data_series(self, resp, detail_columns): series_map = {} dict_with_delta = TimeFormat.get_frequencies_delta() frequency_list = [] use_stat_format_for_date_label = self._get_use_stat_format_for_date_label(resp.series) dimensions_members_with_id = self._get_dimensio...
14,023
[ -0.03131765499711037, 0.002468095626682043, 0.034978464245796204, -0.07817604392766953, -0.014596010558307171, 0.007097251247614622, -0.009092983789741993, -0.05342423543334007, 0.0038113773334771395, 0.025035228580236435, 0.04140260070562363, 0.002971457317471504, -0.03918249532580376, -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": "series", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _get_use_stat_format_for_date_label(self, series): use_stat_format_for_date_label = {} date_labels_by_freq = {} has_date_labels_by_freq = {} dict_with_delta = TimeFormat.get_frequencies_delta() for series_point in series: freq = series_point['frequency'] ...
14,024
[ 0.02886245958507061, -0.0531630739569664, 0.04561847820878029, -0.05961107090115547, -0.05640900135040283, -0.0023014850448817015, -0.03434545174241066, -0.030068717896938324, 0.003092406550422311, -0.02283117175102234, 0.0023014850448817015, -0.03857832029461861, 0.018258357420563698, -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": "series_point", "annotation": null, "type_comment": null}}, {"_typ...
def _get_series_name(self, series_point, dimensions_members_with_id): names = [] for dim in self.dataset.dimensions: name = series_point[dim.id]['name'] if 'name' in series_point[dim.id] else series_point[dim.id] members_with_id = dimensions_members_with_id[dim.id] if dim.id ...
14,025
[ 0.0337083600461483, -0.029946912080049515, 0.040893688797950745, -0.05102066695690155, -0.0346246100962162, 0.026523031294345856, -0.007559063844382763, -0.016842124983668327, -0.018734904006123543, 0.003631846746429801, 0.016022320836782455, -0.04752444848418236, 0.003939272835850716, -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": "series", "annotation": null, "type_comment": null}}], "kwarg": nu...
def _get_dimensions_members_with_id(self, series): dimensions_members_with_id = {} for dim in self.dataset.dimensions: names = set() names_with_id = set() ids = set() for series_point in series: name = series_point[dim.id]['name'] ...
14,026
[ 0.0026697919238358736, 0.0008933143690228462, 0.026590604335069656, -0.06891282647848129, -0.01454826258122921, 0.016311688348650932, -0.02930535189807415, -0.018550775945186615, -0.006821673363447189, -0.0029627294279634953, 0.004524579271674156, -0.04385361447930336, 0.019768930971622467, ...
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": "resp", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _get_metadata_series(self, resp, names_of_attributes): series = {} dimensions_members_with_id = self._get_dimensions_members_with_id(resp.series) for series_point in resp.series: serie_name = self._get_series_name(series_point, dimensions_members_with_id) if seri...
14,027
[ 0.046268753707408905, -0.018576592206954956, 0.04724940285086632, -0.058928027749061584, -0.003660714253783226, 0.016882745549082756, -0.01583523489534855, -0.08397912234067917, -0.015445205383002758, -0.02202000468969345, 0.005184618756175041, -0.020705044269561768, 0.023535551503300667, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _get_attribute_names(self): names = [] for dim in self.dataset.dimensions: for attr in self.data_streaming.dimensionFields[dim.id]: if not attr['isSystemField']: names.append(dim.name +' '+ attr['displayName']) names.append('Unit') ...
14,028
[ -0.015393713489174843, 0.00804694090038538, 0.02206532284617424, -0.03772910311818123, 0.007026695180684328, -0.015603763982653618, -0.023005550727248192, 0.041369982063770294, -0.005716379266232252, -0.00954230222851038, 0.009587313048541546, -0.018484460189938545, 0.024425892159342766, -...
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}}, {"_type": "arg", "_fields": {"arg": "reader", "annotation":...
class DetailsResponseReader(ResponseReader): def __init__(self, reader, data_resp): self.data_resp = data_resp super().__init__(reader) def get_pandasframe(self): records = self.convert_pandasframe() if not self.include_metadata: return records r...
14,029
[ 0.02250749245285988, -0.02231760323047638, 0.037732165306806564, -0.05334778502583504, -0.04094911739230156, -0.016218798235058784, -0.008081474341452122, -0.03585560992360115, -0.010712002404034138, -0.0197485089302063, -0.012912487611174583, -0.027321750298142433, 0.017380475997924805, -...
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": "series_point", "annotation": null, "type_comment": null}}, {"_typ...
def _get_series_with_metadata(self, series_point, dimensionFields): names = [] for dim in self.dataset.dimensions: dimFields = dimensionFields[dim.id] dimValues = series_point[dim.id] for attr in dimFields: if not attr['isSystemField']: ...
14,030
[ 0.028160281479358673, 0.005815951153635979, 0.04736953601241112, -0.05348459258675575, 0.012894794344902039, 0.00544483819976449, -0.03236992284655571, 0.02339673973619938, -0.04036824032664299, 0.029245926067233086, 0.01105030719190836, -0.04335930198431015, -0.010064365342259407, 0.00926...
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": "client", "annotation":...
class TransformationDataReader(SelectionDataReader): def __init__(self, client, dim_values, transform, frequency): if dim_values == None: dim_values = {} if transform: dim_values['transform'] = transform if frequency: dim_values['frequency'] = fre...
14,031
[ 0.0029154783114790916, -0.015569306910037994, 0.03835071623325348, -0.0612727552652359, 0.035216767340898514, 0.00009746511204866692, -0.038190003484487534, 0.03158058226108551, 0.015067070722579956, -0.01595100574195385, 0.027743499726057053, -0.009452075697481632, 0.04463870823383331, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def convert_pandasframe(self): titles = [] columns = [] indexes = [] for col in self.data_resp.columns: indexes.append(col['index']) if col['dimensionId'] != None: if 'detailColumns' in col: titles.append(col['name']) ...
14,032
[ -0.009119044058024883, -0.01318705826997757, 0.03471929579973221, -0.01554002333432436, 0.016533495858311653, -0.008888976648449898, 0.008522960357367992, -0.03089180774986744, -0.015759631991386414, 0.05734958499670029, 0.018102139234542847, -0.03883960098028183, -0.017600173130631447, -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": "client", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, client, dim_values, transform, frequency): if dim_values == None: dim_values = {} if transform: dim_values['transform'] = transform if frequency: dim_values['frequency'] = frequency super().__init__(client, dim_values)
14,033
[ 0.00251743639819324, -0.004125244449824095, 0.027001600712537766, -0.023320531472563744, 0.03004433400928974, 0.002127785701304674, -0.03370412439107895, 0.056513987481594086, 0.01233051810413599, -0.011117679998278618, 0.06825936585664749, -0.029959222301840782, 0.03208700940012932, -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 get_pandasframe(self): data_resp = self.client.get_dataset_data(self.dataset.id, self._get_data_filters()) if isinstance(data_resp, definition.DetailsResponse): response_reader = DetailsResponseReader(self, data_resp) return response_reader.get_pandasframe() if...
14,034
[ -0.005397949833422899, 0.013186462223529816, 0.040279507637023926, -0.06540107727050781, 0.009196288883686066, -0.028663143515586853, -0.035061586648225784, -0.020529327914118767, -0.03567546233534813, 0.043490536510944366, -0.0010425510117784142, -0.028379816561937332, 0.011321233585476875,...
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 _get_data_filters(self): filter_dims = {} passed_params = ['timerange', 'transform'] for name, value in self.dim_values.items(): if name.lower() in passed_params: filter_dims[name] = value continue if definition.is_equal_string...
14,035
[ 0.03987348824739456, 0.000048691148549551144, 0.08365567773580551, -0.0523860901594162, -0.00020258496806491166, 0.048763394355773926, -0.005866026505827904, 0.0015231112483888865, -0.03777613863348961, -0.00635163439437747, 0.03410577401518822, -0.03086441569030285, -0.025025201961398125, ...
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": "client", "annotation":...
class StreamingDataReader(SelectionDataReader): def __init__(self, client, dim_values, transform = None, group_by = None): self.group_by = group_by super().__init__(client, dim_values, transform) def get_series_metadata(self): self._load_dimensions() pivot_req = s...
14,036
[ 0.002008548006415367, 0.010534114204347134, 0.002274275990203023, -0.02574741840362549, 0.014132576994597912, 0.004123981110751629, -0.021709538996219635, -0.029381509870290756, -0.005002813413739204, 0.05044974014163017, -0.009091166779398918, -0.0035628345794975758, -0.042207714170217514, ...
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": "required_frequency", "annotation": null, "type_comment": null}}, ...
def _get_frequency_for_normalization(self, required_frequency, available_frequency): sorted_frequency = ['A', 'H', 'Q', 'M', 'W', 'D'] sorted_available_frequency = [] for f in sorted_frequency: if f in available_frequency: sorted_available_frequency.append(f) ...
14,037
[ 0.012392942793667316, -0.0036208645906299353, 0.03689008578658104, -0.0466381199657917, -0.02065105549991131, 0.02236042730510235, 0.04465155676007271, -0.00751314964145422, 0.0039789085276424885, -0.0010344296460971236, -0.011006966233253479, -0.03682078421115875, -0.003932709340006113, -...
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": "group_name", "annotation": null, "type_comment": null}}, {"_type"...
def _get_all_series_for_group(self, group_name, group_name_index, frequency, series, metadata): series_by_group = {} for series_name, series_item in series.items(): if series_name[group_name_index] == group_name: series_by_group[series_name] = series_item ...
14,038
[ 0.028628647327423096, 0.001389790209941566, 0.07778704911470413, -0.07171288132667542, -0.000010351922355766874, 0.03576226532459259, 0.006703953258693218, 0.004741031210869551, -0.015844637528061867, 0.019752824679017067, 0.02799297869205475, -0.02003534510731697, 0.018010621890425682, -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": "metadata", "annotation": null, "type_comment": null}}, {"_type": ...
def get_pandasframe_by_metadata_grouped(self, metadata, frequency, timerange): self._load_dimensions() names_of_dimensions = self._get_dimension_names() series = {} series_with_attr = {} offset = 0 detail_columns = None was = False while ...
14,039
[ 0.0379168801009655, 0.020558511838316917, 0.04839008301496506, -0.03769868612289429, -0.039977580308914185, 0.009473158977925777, -0.01923724077641964, 0.015831023454666138, -0.04310499504208565, -0.00815188605338335, 0.027007291093468666, -0.03786839172244072, -0.005421459209173918, -0.05...
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": "metadata", "annotation": null, "type_comment": null}}, {"_type": ...
def _get_part_of_metadata(self, metadata, offset): limit = 50000 member_count_limit = 200 if offset >= len(metadata): return None curr_points = 0 curr_member_count = 0 time_points = 0 dim_values = {} index = offset for i i...
14,040
[ 0.0004032131109852344, 0.004169813357293606, 0.07459624856710434, -0.026038751006126404, -0.03345175459980965, 0.0027172265108674765, -0.008427044376730919, -0.0010970892617478967, -0.032822348177433014, 0.013532225042581558, 0.04834769293665886, -0.027460742741823196, -0.027553988620638847,...
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": "start_date", "annotation": null, "type_comment": null}}, {"_type"...
def _get_time_point_amount(self, start_date, end_date, frequency): count = 0 dict_with_delta = TimeFormat.get_frequencies_delta() date_format = '%Y-%m-%dT%H:%M:%S' + ('Z' if start_date.endswith('Z') else '') data_begin_val = datetime.strptime(start_date, date_format) date_...
14,041
[ 0.0030337534844875336, 0.003282232442870736, 0.012724429368972778, -0.07022128254175186, -0.025726228952407837, 0.01412284467369318, -0.026858830824494362, -0.006604914553463459, -0.00006085565109970048, -0.008153573609888554, 0.010482341051101685, -0.03277609497308731, 0.017266390845179558,...
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": "resp", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _get_metadata_series(self, resp, names_of_attributes): series = {} for series_point in resp.tuples: val = series_point['Value'] if val is None: continue serie_name = series_point['Mnemonics'] if serie_name not in series: ...
14,042
[ -0.01442627888172865, -0.006498377304524183, 0.03519011288881302, -0.0578957200050354, -0.015665199607610703, -0.00922638550400734, -0.06394737213850021, 0.006084410939365625, -0.009833932854235172, 0.0377156063914299, 0.014271413907408714, -0.036024004220962524, -0.021764501929283142, -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": "resp", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _get_data_series(self, resp, detail_columns): series = {} frequency_list = [] for series_point in resp.tuples: val = series_point['Value'] if val is None: continue series_name = series_point['Mnemonics'] if series_name n...
14,043
[ 0.037100668996572495, -0.024218492209911346, 0.04798891022801399, -0.06734578311443329, 0.025002624839544296, 0.02098114602267742, 0.009588820859789848, 0.04834737256169319, 0.011173888109624386, -0.008149377070367336, 0.027579061686992645, -0.028273578733205795, 0.04364257678389549, -0.03...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _get_pandasframe_one_dataset(self): pandas_series = {} if self.include_metadata: pandas_series_with_attr = {} names_of_attributes = self._get_attribute_names() mnemonics = self.mnemonics mnemonics_string = self.separator.join(mnemonics) if isinstance(m...
14,044
[ 0.03047722578048706, -0.018666425719857216, 0.05083424225449562, -0.04892212525010109, 0.0350010059773922, 0.040247660130262375, 0.007024685852229595, 0.0545651949942112, 0.0272825974971056, 0.0021263519302010536, -0.013956097885966301, -0.03663329780101776, 0.032109517604112625, -0.014818...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _get_pandasframe_across_datasets(self): mnemonics_string = self.separator.join(self.mnemonics) if isinstance(self.mnemonics, list) else self.mnemonics mnemonics_resp = self.client.get_mnemonics(mnemonics_string, self.transform, self.frequency) dict_datasets = {} pa...
14,045
[ 0.0653347596526146, 0.009732727892696857, 0.03424907848238945, -0.014140399172902107, -0.0036985420156270266, -0.01823173090815544, 0.003316297894343734, -0.05234372988343239, -0.02208053320646286, 0.054494842886924744, 0.030305374413728714, -0.011187892407178879, 0.0150999641045928, -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}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, name, values=[], index=[], detail_columns=None): self.name = name self.values = values self.index = index self.column_count = len(detail_columns) if detail_columns is not None else 0 self.column_values = [] if self.column_count > 0 else None for _...
14,046
[ 0.01772608608007431, -0.010050415061414242, 0.044221825897693634, -0.04849102720618248, -0.004111330956220627, 0.02929740399122238, -0.006479404401034117, -0.026842612773180008, -0.0165075846016407, -0.02662915177643299, 0.03550553694367409, -0.005469915922731161, 0.05137274041771889, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pandas_series", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "names_of_dimensions", "annotation": null, "type_comment"...
def create_pandas_dataframe(pandas_series, names_of_dimensions, detail_columns): pandas_data_frame = pandas.DataFrame(pandas_series) pandas_data_frame.sort_index() if isinstance(pandas_data_frame.columns, pandas.MultiIndex): column_names = names_of_dimensions if deta...
14,047
[ 0.01832936517894268, -0.013988719321787357, 0.013673036359250546, -0.059822000563144684, -0.0307199377566576, -0.024899525567889214, 0.007467885036021471, 0.013554655015468597, 0.011700015515089035, -0.0414729043841362, 0.012114349752664566, -0.019365202635526657, 0.04178858548402786, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "series", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pandas_series", "ann...
class PandasHelper(object): @staticmethod def creates_pandas_series(series, pandas_series, detail_columns): for _, series_content in series.items(): series_content.creates_pandas_series(pandas_series, detail_columns) return pandas_series @staticmethod def create_pand...
14,048
[ -0.009394650347530842, 0.0024552729446440935, 0.05153488740324974, -0.009394650347530842, 0.00622540945187211, 0.05303389951586723, -0.03140164911746979, -0.007249516900628805, -0.001260750344954431, 0.040292322635650635, -0.0238032266497612, -0.0267237089574337, -0.0453062504529953, -0.00...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Return", "_fields": {"value": {"_type": "Dict", "_fields": {"k...
def get_frequencies_delta(): return { 'A': relativedelta(years = 1), 'H': relativedelta(months = 6), 'Q': relativedelta(months = 3), 'FQ': relativedelta(months = 3), 'M': relativedelta(months = 1), 'W': timedelta(days = 7), ...
14,049
[ -0.03733460232615471, -0.008194203488528728, 0.028633370995521545, -0.03460865095257759, -0.015843216329813004, 0.02350858598947525, -0.04226311668753624, -0.0419360026717186, -0.017664151266217232, 0.013084555976092815, 0.00774714769795537, -0.015886832028627396, -0.003055789042264223, 0....
16
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "date_point", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "freq", "annotati...
class TimeFormat(object): @staticmethod def format_statistical(date_point, freq): return { 'FQ': lambda d: '{}FQ{}'.format(d.year, (d.month - 1) // 3 + 1), 'W': lambda d: TimeFormat.format_weekly(d) }.get(freq, date_point)(date_point) @staticmethod def f...
14,050
[ 0.03633124381303787, 0.03324957564473152, 0.032137393951416016, -0.03083985112607479, -0.017354656010866165, 0.02300824224948883, -0.022776538506150246, -0.01645101048052311, -0.05760170519351959, -0.012465694919228554, 0.017887577414512634, -0.058899249881505966, -0.0087236687541008, 0.00...
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": "client", "annotation":...
class DimensionMetadataReader: def __init__(self, client, dataset, dimension): self.client = client self.dataset = dataset self.dimension = dimension def get(self): dim_info = self.client.get_dimension(self.dataset, self.dimension) view_model = view_definition....
14,051
[ 0.010736843571066856, 0.018266255035996437, 0.01928173564374447, -0.02230340801179409, -0.007368421647697687, -0.0033715174067765474, -0.008835914544761181, -0.02717028185725212, -0.044631581753492355, 0.013263159431517124, 0.04079257324337959, -0.020371519029140472, 0.017238391563296318, ...
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 get(self): dim_info = self.client.get_dimension(self.dataset, self.dimension) view_model = view_definition.Dimension() view_model.key = dim_info.key view_model.id = dim_info.id view_model.name = dim_info.name view_model.isGeo = dim_info.is_geo view_mode...
14,052
[ -0.010532498359680176, -0.02359474077820778, 0.019678501412272453, -0.00633652601391077, 0.0112683130428195, -0.014971714466810226, 0.006445986218750477, 0.05239491909742355, 0.006804772187024355, 0.031792089343070984, -0.0007821838953532279, -0.012119670398533344, -0.04278675094246864, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "uri", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "method", "annotation": null, "type_comment": null}}, {"_type": "ar...
def new_request(uri, method='GET', body=None, headers=None, redirections=httplib2.DEFAULT_MAX_REDIRECTS, connection_type=None): if not self.access_token: logger.info('Attempting refresh to obtain initial access_token') self._refresh(request_orig) # Mo...
14,053
[ -0.00014969999028835446, 0.00893322378396988, -0.01282974798232317, -0.030906518921256065, 0.03655204921960831, -0.010178561322391033, 0.0005797739722765982, -0.0034398999996483326, 0.03168139606714249, 0.0037083395291119814, 0.019084110856056213, -0.05216028541326523, 0.018774161115288734, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "s", "annotation": null, "type_comment": null}}], "kwarg": null, "v...
def from_json(cls, s): data = simplejson.loads(s) retval = SignedJwtAssertionCredentials( data['service_account_name'], base64.b64decode(data['private_key']), data['scope'], private_key_password=data['private_key_password'], user_agent=data['user_agent'], ...
14,054
[ -0.01663355901837349, -0.058451637625694275, 0.04244702309370041, -0.0234984140843153, -0.013890293426811695, -0.052911579608917236, 0.013201131485402584, 0.04648832231760025, 0.03717459738254547, -0.015536252409219742, 0.027258696034550667, 0.024997174739837646, -0.01827951893210411, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class WalletGroupTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 5 self.extra_args = [ [], [], ["-avoidpartialspends"], ["-maxapsfee=0.00002719"], ["-maxapsfee=0.00002720"], ...
14,055
[ -0.011249950155615807, -0.06009136885404587, 0.03840239718556404, -0.02618345245718956, -0.013888913206756115, -0.047253914177417755, 0.015558880753815174, 0.04766625538468361, 0.041811056435108185, -0.011346163228154182, 0.0349387601017952, 0.03928204998373985, -0.030980316922068596, -0.0...
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 run_test(self): self.log.info("Setting up") # Mine some coins self.generate(self.nodes[0], COINBASE_MATURITY + 1) # Get some addresses from the two nodes addr1 = [self.nodes[1].getnewaddress() for _ in range(3)] addr2 = [self.nodes[2].getnewaddress() for _ in range(3...
14,056
[ 0.009767545387148857, -0.012980618514120579, 0.011391356587409973, -0.026119176298379898, -0.013168171048164368, 0.01254628598690033, 0.02236812189221382, 0.0051330202259123325, -0.048210904002189636, 0.05970097333192825, 0.01194414310157299, -0.0168599970638752, 0.007082580588757992, 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 __init__(self): super(InstallCommand, self).__init__() self.parser.add_option( '-e', '--editable', dest='editables', action='append', default=[], metavar='VCS+REPOS_URL[@REV]#egg=PACKAGE', help='Install a package directly from a...
14,057
[ 0.05082443356513977, -0.0020326408557593822, 0.03552775830030441, -0.042548079043626785, -0.030750352889299393, 0.0026410312857478857, 0.02749812602996826, 0.03756881132721901, 0.0018518059514462948, 0.02420104295015335, 0.05091414973139763, -0.04192006587982178, 0.0304139144718647, -0.047...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "product", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def test_server_start_config(product): (check_args, target_browser_cls, get_browser_kwargs, executor_classes, get_executor_kwargs, env_options, get_env_extras, run_info_extras) = products.load_product({}, product) env_extras = get_env_extras() with mock.patch.object(environment.serve, "star...
14,058
[ -0.00024727542768232524, 0.017049141228199005, 0.04976382479071617, -0.05465787649154663, 0.01893586665391922, 0.018181176856160164, 0.0002905128931161016, -0.030553525313735008, -0.01851278357207775, 0.013504383154213428, -0.01915312558412552, -0.0358363576233387, 0.03473862633109093, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "1.0"}}, "targets": [{"_type": "Name", "_fields": {"id": "VERSION", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {...
class HVSpec(base.NovaObject, base.NovaObjectDictCompat): # Version 1.0: Initial version VERSION = '1.0' fields = { 'arch': fields.ArchitectureField(), 'hv_type': fields.HVTypeField(), 'vm_mode': fields.VMModeField(), } # NOTE(pmurray): for backward compati...
14,059
[ 0.014644602313637733, 0.04956286400556564, 0.02003580890595913, 0.01654738187789917, -0.01640014350414276, 0.0410456620156765, 0.008217060938477516, -0.007412909995764494, 0.01830292120575905, 0.04702582210302353, 0.015244884416460991, -0.007458214182406664, 0.005125044845044613, 0.0266842...
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": "statePath", "annotation": null, "type_comment": null}}, {"_type":...
def __init__(self, statePath, server, reactor, shutdownMustSucceed=True): if _ShutdownHandler.handlerRegistered: raise AssertionError('Handler already registered, aborting.') self._server = server self._reactor = reactor self._runningMarkerFile = join(statePath, 'running.mar...
14,060
[ 0.00019677795353345573, 0.05198238417506218, -0.010194425471127033, -0.006428916938602924, -0.03597897291183472, 0.046380043029785156, 0.01575084589421749, 0.01976891979575157, 0.004408400040119886, 0.02324742265045643, 0.01505055371671915, 0.01304151676595211, -0.0069053457118570805, 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 _register(self): self._previouslyRegisteredHandlers = {} for signalnum in SHUTDOWN_SIGNALS: self._previouslyRegisteredHandlers[signalnum] = signal(signalnum, self._handleShutdown) with open(self._runningMarkerFile, 'w') as fp: fp.write("written by registerShutdownHand...
14,061
[ 0.03619387745857239, 0.06171814724802971, -0.02167263627052307, -0.02393762767314911, -0.01461322046816349, 0.05527959391474724, -0.002641532104462385, 0.062316011637449265, 0.03292860835790634, 0.009347401559352875, 0.06512138247489929, 0.004995628725737333, -0.01023845188319683, 0.021960...
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": "signum", "annotation": null, "type_comment": null}}, {"_type": "a...
def _deferredHandleShutdown(self, signum, frame): assert isfile(self._runningMarkerFile) consume(self._server.once.handleShutdown()) remove(self._runningMarkerFile) print('Shutdown completed.') sys.stdout.flush() previousHandler = self._previouslyRegisteredHandlers[signu...
14,062
[ 0.002836252562701702, -0.05342147871851921, 0.0055196708999574184, -0.02950878255069256, 0.009269990026950836, 0.011345010250806808, 0.007729890290647745, -0.03228331357240677, 0.017446627840399742, 0.03762076050043106, 0.037079960107803345, -0.018528223037719727, 0.005939965136349201, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_chisquare(): # Test replacement for scipy.stats.chisquare against the original. obs = np.array([[2., 2.], [1., 1.]]) exp = np.array([[1.5, 1.5], [1.5, 1.5]]) # call SciPy first because our version overwrites obs chi_scp, p_scp = scipy.stats.chisquare(...
14,063
[ 0.02228347770869732, -0.03105962835252285, 0.003136059269309044, -0.03363589197397232, -0.0010202726116403937, -0.004159341566264629, -0.008348779752850533, 0.01608359068632126, -0.014386145398020744, 0.045457810163497925, 0.009775355458259583, -0.026822034269571304, 0.005429415497928858, ...
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 test_chi2(): # Test Chi2 feature extraction chi2 = mkchi2(k=1).fit(X, y) chi2 = mkchi2(k=1).fit(X, y) assert_equal(chi2.get_support(indices=True), [0]) assert_equal(chi2.transform(X), np.array(X)[:, [0]]) chi2 = mkchi2(k=2).fit(X, y) assert_equal(sorted(chi2.get_support(indices=True)),...
14,064
[ 0.016868585720658302, 0.05013303831219673, 0.04674937203526497, 0.0053118630312383175, -0.07001209259033203, 0.043838419020175934, -0.027467431500554085, 0.021857010200619698, 0.06160268187522888, 0.00036542382440529764, 0.0687183365225792, -0.06443899124860764, 0.04152458533644676, 0.0134...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "remove.period.from.vat.commitment"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}...
class RemovePeriod(orm.TransientModel): _name = 'remove.period.from.vat.commitment' def _get_period_ids(self, cr, uid, context=None): commitment_obj = self.pool['account.vat.communication'] res = [] if 'active_id' in context: commitment = commitment_obj.browse( ...
14,065
[ 0.0031742583960294724, 0.02460424229502678, 0.07625400274991989, 0.013929639011621475, -0.038557812571525574, 0.024125559255480766, -0.0209423266351223, 0.04580984264612198, 0.04968716576695442, 0.014719463884830475, 0.05351661890745163, -0.061031922698020935, 0.02144494280219078, -0.00581...
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_period_ids(self, cr, uid, context=None): commitment_obj = self.pool['account.vat.communication'] res = [] if 'active_id' in context: commitment = commitment_obj.browse( cr, uid, context['active_id'], context) for period in commitment.period_ids: ...
14,066
[ 0.017062146216630936, 0.05552859976887703, 0.04145488515496254, 0.020433707162737846, -0.02205563336610794, 0.02432888373732567, 0.007183725479990244, 0.04944957047700882, 0.05588619038462639, 0.011462032794952393, 0.07386785000562668, -0.05987076461315155, 0.018007203936576843, 0.03404766...
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 remove_period(self, cr, uid, ids, context=None): if 'active_id' not in context: raise orm.except_orm(_('Error'), _('Current commitment not found')) self.pool['account.period'].write( cr, uid, [int(self.browse(cr, uid, ids, context)[0].period_id)], {'vat_commitment...
14,067
[ 0.01591649278998375, 0.005110230762511492, 0.037944745272397995, -0.015689730644226074, 0.027902454137802124, -0.008055429905653, -0.011068116873502731, 0.05774857476353645, 0.0004953657044097781, -0.03094753623008728, 0.006689461879432201, -0.027600103989243507, 0.0038360473699867725, -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": "client_key", "annotati...
class PQAuthClient(object): def __init__(self, client_key, server_key): self.client_key = client_key self.server_key = server_key self.server_key_fprint = crypto.public_key_fingerprint(self.server_key) self.client_key_fprint = crypto.public_key_fingerprint(self.client_key) ...
14,068
[ -0.002344708424061537, -0.03478123992681503, 0.053157929331064224, -0.01684156060218811, -0.0048883105628192425, -0.0012017680564895272, -0.04087692126631737, 0.02248903177678585, -0.001235384028404951, 0.021749481558799744, 0.0044176881201565266, -0.036977481096982956, 0.0048294831067323685...
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": "response", "annotation": null, "type_comment": null}}], "kwarg": ...
def process_hello_response(self, response): # Check the server send back the client_guid we sent. if response["client_guid"] != self.client_guid: message = ("Server did not send back the expected client_guid. " "Expected: %s, Got: %s" % (self.cli...
14,069
[ 0.002953426679596305, -0.0012963885674253106, -0.001210490707308054, -0.010390602983534336, 0.0011014429619535804, -0.04807359725236893, -0.03271188214421272, 0.024075787514448166, 0.04339490085840225, 0.03824833780527115, -0.02091766893863678, -0.0005488938768394291, -0.01776929572224617, ...
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": "number", "annotation": null, "type_comment": null}}, {"_type": "a...
def convert_float(self, number, size): text = str(int(round(number * 100, 0))) if len(text) > size: raise Log(_('Error:\n\nCan not convert float number %(number).2f ' 'to fit in %(size)d characters.') % { 'number': number, 'size': size ...
14,070
[ 0.015397020615637302, 0.019552499055862427, 0.004327192436903715, -0.024795498698949814, 0.002107789274305105, -0.02162451483309269, -0.04208137467503548, -0.020216459408402443, 0.04812570661306381, 0.014103441499173641, 0.015774792060256004, -0.003703298280015588, -0.031343527138233185, -...
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}}, {"_type": "ar...
def convert(self, value, size, justified='left'): if not value: return self.convert_text('', size) elif isinstance(value, float): return self.convert_float(value, size) elif isinstance(value, int): return self.convert_int(value, size) else: ...
14,071
[ 0.02846149541437626, 0.011077229864895344, 0.012933414429426193, -0.00989466067403555, -0.01201530173420906, -0.04071630537509918, -0.01833231747150421, 0.026665188372135162, 0.06023618206381798, 0.022473804652690887, -0.025966623798012733, -0.01536840945482254, -0.00888174306601286, 0.016...
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": "number", "annotation": null, "type_comment": null}}, {"_type": "a...
def convert_int(self, number, size): text = str(number) if len(text) > size: raise Log(_('Error:\n\nCan not convert integer number %(number)d ' 'to fit in %(size)d characters.') % { 'number': number, 'size': size }) ...
14,072
[ 0.03445735573768616, -0.002982567297294736, 0.04613981395959854, 0.007853209041059017, 0.004501876886934042, -0.025087786838412285, 0.014538171701133251, 0.046446625143289566, 0.05470695346593857, 0.027141068130731583, -0.0011793088633567095, -0.07004755735397339, 0.021170033141970634, -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": "value", "annotation": null, "type_comment": null}}, {"_type": "ar...
def bank_account_parts(self, value, partner_name): if not isinstance(value, basestring): raise Log(_('User error:\n\nThe bank account number of %s is not ' 'defined.') % partner_name) ccc = self.digits_only(value) if len(ccc) != 20: raise Log(_('Us...
14,073
[ 0.044247105717659, -0.010464286431670189, 0.028898753225803375, 0.003645233577117324, -0.0006862220470793545, -0.018988102674484253, 0.026706131175160408, 0.05806061998009682, 0.07007618993520737, 0.02576330490410328, 0.0035986402072012424, -0.06424381583929062, -0.007252096198499203, -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": "value", "annotation": null, "type_comment": null}}, {"_type": "ar...
def convert_bank_account(self, value, partner_name): if not isinstance(value, basestring): raise Log(_('User error:\n\nThe bank account number of %s is not ' 'defined.') % partner_name) ccc = self.digits_only(value) if len(ccc) != 20: raise Log(_('...
14,074
[ 0.03595549240708351, 0.019337210804224014, 0.04654994234442711, -0.012516450136899948, -0.028478438034653664, 0.016208099201321602, 0.013489169999957085, 0.028126852586865425, -0.028876902535557747, 0.0459170863032341, 0.03911976516246796, -0.016594843938946724, -0.003342993790283799, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "clean up temporary files from 'build' command"}}, "targets": [{"_type": "Name", "_fields": {"id": "description", "ctx": {"_type": "Store"...
class clean(Command): description = "clean up temporary files from 'build' command" user_options = [ ('build-base=', 'b', "base build directory (default: 'build.build-base')"), ('build-lib=', None, "build directory for all modules (default: 'build.build-lib')"), ('buil...
14,075
[ 0.03212011978030205, 0.033251725137233734, 0.030966756865382195, -0.042348071932792664, 0.014482344500720501, -0.010570697486400604, -0.036298349499702454, -0.01841031387448311, 0.002312169875949621, -0.01989010162651539, -0.04245688021183014, -0.04509003460407257, 0.061019524931907654, -0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "cash.flow.template"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen...
class CashFlowTemplate(models.Model): _name = 'cash.flow.template' _order = 'sequence' sequence = fields.Integer(u'序号') name = fields.Char(u'项目') line_num = fields.Char(u'行次') line_type = fields.Selection(LINE_TYPES, u'行类型') # for type sum category_ids = fields.Many2many( 'core....
14,076
[ -0.028396207839250565, 0.022077614441514015, 0.06553354859352112, -0.06408502161502838, -0.008123013190925121, -0.03988455981016159, -0.02572391740977764, 0.0027862372808158398, -0.03955988585948944, 0.06443466246128082, 0.02559904381632805, -0.020291924476623535, 0.006505903322249651, 0.0...
12
{"_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": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load...
def main(argv=sys.argv): unix_success = 0 unix_error = 1 ################ get user parameters if len(argv) < 2 : # print selfdoc and exit if no parameters rsfprog.selfdoc() return unix_error par = rsf.Par(argv) # get parameters levels = par.int('lev...
14,077
[ 0.05058003216981888, 0.023442605510354042, 0.05769428238272667, -0.047229450196027756, -0.021939432248473167, 0.0040161097422242165, 0.01555955596268177, 0.020723124966025352, -0.02873239479959011, 0.025037575513124466, 0.013769518584012985, -0.00938048493117094, -0.004050533287227154, -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 run(self): # remove the build/temp.<plat> directory (unless it's already # gone) if os.path.exists(self.build_temp): remove_tree(self.build_temp, dry_run=self.dry_run) else: log.debug("'%s' does not exist -- can't clean it", self.build_te...
14,078
[ 0.0012425616150721908, 0.00039335532346740365, 0.039212990552186966, -0.05400935932993889, -0.012750757858157158, 0.0028347724582999945, -0.01412974763661623, -0.043264999985694885, 0.0012964794877916574, 0.07011283189058304, 0.010326087474822998, -0.04099064692854881, 0.007489681243896484, ...
10
{"_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 main(argv): if len(argv) > 1: raise app.UsageError("Too many command-line arguments.") assert FLAGS.min_frequency < 100, "--min_frequency higher than 100." assert FLAGS.max_frequency > 15250, "--max_frequency lower than 15250." save_directory = os.path.join( os.path.dirname(os.path.realpath(__fi...
14,079
[ -0.011829599738121033, 0.03636433556675911, 0.08889645338058472, -0.019827911630272865, -0.007366345264017582, -0.021499985828995705, 0.022566426545381546, -0.03862887993454933, -0.0011347397230565548, -0.00385762145742774, 0.024528153240680695, -0.007438757922500372, 0.02883341535925865, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "testdata", "annotation": null, "type_comment": null}}], "kwarg"...
def test_geocode(tmpdir, testdata): scene = testdata['s1'] geocode(scene, str(tmpdir), test=True) xmlfile = finder(str(tmpdir), ['*.xml'])[0] tree = Workflow(xmlfile) assert is_consistent(tree) is True groups = groupbyWorkers(xmlfile, 2) assert len(groups) == 4 groups2 = groupbyWorkers(x...
14,080
[ -0.031727660447359085, 0.009530027396976948, 0.09688372910022736, -0.03439606726169586, -0.027534449473023415, 0.015379998832941055, 0.003698383690789342, -0.026244230568408966, -0.005886624567210674, -0.0076460144482553005, 0.028575420379638672, -0.011047501116991043, 0.017095403745770454, ...
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": "tmpdir", "annotation":...
class Test_geocode_opts(): def test_infile_type(self, tmpdir, testdata): scene = testdata['s1'] with pytest.raises(TypeError): geocode(infile=123, outdir=str(tmpdir), test=True) id = identify(scene) geocode(infile=id, outdir=str(tmpdir), test=True) def test_pol(s...
14,081
[ -0.028560256585478783, -0.010962522588670254, 0.10654802620410919, 0.01745348982512951, -0.00959220714867115, -0.009616248309612274, 0.02099948190152645, -0.0024897067341953516, -0.005998134613037109, -0.013138198293745518, 0.017922282218933105, 0.01728520542383194, 0.02646872214972973, -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": "tmpdir", "annotation": null, "type_comment": null}}, {"_type": "a...
def test_shp(self, tmpdir, testdata): scene = testdata['s1'] ext = {'xmin': 12, 'xmax': 13, 'ymin': 53, 'ymax': 54} with bbox(ext, 4326) as new: with pytest.raises(RuntimeError): geocode(scene, str(tmpdir), shapefile=new, test=True) with identify(scen...
14,082
[ 0.013612509705126286, -0.028281277045607567, 0.03200457990169525, -0.060417890548706055, 0.011420777067542076, 0.025125708431005478, 0.0014548287726938725, -0.008450054563581944, 0.01464235968887806, -0.014523531310260296, 0.05051548406481743, -0.06992419809103012, -0.01315699890255928, 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 test_basic(self): Foo = self.classes.Foo s1 = self._fixture() f1 = Foo(value='f1') f2 = Foo(value='f2') s1.add_all((f1, f2)) s1.commit() f1.value = 'f1rev2' s1.commit() s2 = create_session(autocommit=False) f1_s = s2.query(Foo).get(f...
14,083
[ 0.0422709621489048, -0.013181691989302635, 0.037582967430353165, -0.027048148214817047, -0.013708433136343956, 0.025375746190547943, -0.0021020255517214537, 0.0037365686148405075, 0.04701162874698639, -0.002371980343014002, 0.025783969089388847, -0.05325350910425186, -0.03136742487549782, ...
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_notsane_warning(self): Foo = self.classes.Foo save = testing.db.dialect.supports_sane_rowcount testing.db.dialect.supports_sane_rowcount = False try: s1 = self._fixture() f1 = Foo(value='f1') f2 = Foo(value='f2') s1.add_all((f1, f...
14,084
[ 0.03170093148946762, 0.01434442400932312, 0.0675002709031105, -0.005070543847978115, 0.003885462647303939, 0.016060322523117065, 0.021220365539193153, -0.018874891102313995, -0.021183332428336143, -0.00015276441990863532, -0.011295308358967304, -0.02910856530070305, 0.01540606003254652, 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_update_multi_missing_broken_multi_rowcount(self): @util.memoized_property def rowcount(self): if len(self.context.compiled_parameters) > 1: return -1 else: return self.context.rowcount with patch.object( config.db....
14,085
[ 0.024206439033150673, -0.026116525754332542, -0.00888970959931612, -0.06121886521577835, 0.038778357207775116, -0.009544424712657928, 0.013310538604855537, -0.006769394036382437, 0.008006745018064976, -0.001558702439069748, 0.03356466069817543, -0.03358868882060051, -0.044184260070323944, ...
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_merge_no_version(self): Foo = self.classes.Foo s1 = self._fixture() f1 = Foo(value='f1') s1.add(f1) s1.commit() f1.value = 'f2' s1.commit() f2 = Foo(id=f1.id, value='f3') f3 = s1.merge(f2) assert f3 is f1 s1.commit() ...
14,086
[ 0.020882291719317436, -0.026359034702181816, -0.002258420456200838, -0.0477006658911705, 0.0461459755897522, 0.009163239039480686, 0.017078015953302383, 0.004908457398414612, 0.01408641878515482, 0.0008737760945223272, 0.03260134160518646, -0.035993389785289764, -0.056157227605581284, 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 test_merge_correct_version(self): Foo = self.classes.Foo s1 = self._fixture() f1 = Foo(value='f1') s1.add(f1) s1.commit() f1.value = 'f2' s1.commit() f2 = Foo(id=f1.id, value='f3', version_id=2) f3 = s1.merge(f2) assert f3 is f1 ...
14,087
[ 0.02545691281557083, -0.02169130928814411, 0.014448842965066433, -0.022762039676308632, 0.046053431928157806, -0.0023144013248384, 0.011056192219257355, -0.015026315115392208, 0.015315051190555096, 0.00042934477096423507, 0.03801693767309189, -0.051780033856630325, -0.041217099875211716, 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_merge_incorrect_version(self): Foo = self.classes.Foo s1 = self._fixture() f1 = Foo(value='f1') s1.add(f1) s1.commit() f1.value = 'f2' s1.commit() f2 = Foo(id=f1.id, value='f3', version_id=1) assert_raises_message( orm_exc.S...
14,088
[ 0.021299082785844803, -0.019878340885043144, 0.007928459905087948, -0.024947257712483406, 0.0591413751244545, 0.003654195461422205, 0.01677197404205799, -0.009373282082378864, 0.014592701569199562, -0.0058364784345030785, 0.05350657179951668, -0.05692598223686218, -0.03807105869054794, 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_merge_incorrect_version_not_in_session(self): Foo = self.classes.Foo s1 = self._fixture() f1 = Foo(value='f1') s1.add(f1) s1.commit() f1.value = 'f2' s1.commit() f2 = Foo(id=f1.id, value='f3', version_id=1) s1.close() assert_ra...
14,089
[ 0.0055072735995054245, 0.015161048620939255, 0.08072199672460556, -0.04554733261466026, 0.009018320590257645, 0.027446504682302475, 0.01668870821595192, -0.03476386144757271, -0.02495603635907173, 0.0002721944183576852, 0.005253733601421118, -0.035816535353660583, 0.006081750150769949, 0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "__backend__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}...
class NoBumpOnRelationshipTest(fixtures.MappedTest): __backend__ = True @classmethod def define_tables(cls, metadata): Table( 'a', metadata, Column( 'id', Integer, primary_key=True, test_needs_autoincrement=True), Column('version_i...
14,090
[ 0.015893572941422462, -0.029552506282925606, 0.046475522220134735, -0.06929899752140045, 0.004616794176399708, 0.014977119863033295, 0.030155105516314507, 0.0005080513656139374, 0.008059774525463581, 0.0031275565270334482, 0.004312356002628803, -0.04868505522608757, 0.0032829144038259983, ...
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": "auto_version_counter", "annotation": null, "type_comment": null}}...
def _run_test(self, auto_version_counter=True): A, B = self.classes('A', 'B') s = Session() if auto_version_counter: a1 = A() else: a1 = A(version_id=1) s.add(a1) s.commit() eq_(a1.version_id, 1) b1 = B() b1.a = a1 ...
14,091
[ 0.013179797679185867, 0.02883080765604973, 0.08829573541879654, -0.037335339933633804, 0.02756180614233017, 0.052763715386390686, 0.04154307767748833, -0.041587602347135544, -0.04572855308651924, 0.010474822483956814, 0.0034702718257904053, -0.040185023099184036, 0.03960618004202843, -0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "metadata", "annotation": null, "type_comment": null}}], "kwarg": n...
def define_tables(cls, metadata): Table( 'a', metadata, Column( 'id', Integer, primary_key=True, test_needs_autoincrement=True), Column('version_id', Integer) ) Table( 'b', metadata, Column( ...
14,092
[ 0.023460976779460907, -0.013888396322727203, 0.055804502218961716, -0.042806871235370636, -0.008650450967252254, -0.0018615092849358916, 0.016585780307650566, 0.004773743916302919, 0.004667103290557861, -0.013436741195619106, -0.01082090474665165, -0.06162583827972412, 0.0445382185280323, ...
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_functional_counter(self): A, B = self.classes('A', 'B') a, b = self.tables('a', 'b') mapper( A, a, properties={ 'bs': relationship(B, backref='a') }, version_id_col=a.c.version_id, version_id_generator=lambda num: (num or ...
14,093
[ 0.012467119842767715, -0.03393930196762085, 0.05608655512332916, -0.03572297468781471, -0.006239753216505051, 0.0024463548325002193, 0.022444531321525574, -0.016003496944904327, 0.0034589599817991257, -0.013885386288166046, -0.004877226427197456, -0.04476519674062729, 0.04999234527349472, ...
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_plain_counter(self): A, B = self.classes('A', 'B') a, b = self.tables('a', 'b') mapper( A, a, properties={ 'bs': relationship(B, backref='a') }, version_id_col=a.c.version_id, ) mapper(B, b) self._run_test()
14,094
[ 0.001519100391305983, 0.03731226176023483, 0.0660158023238182, -0.06662403047084808, 0.026621539145708084, 0.023709077388048172, 0.024516144767403603, -0.028843900188803673, -0.0550677552819252, 0.007134946994483471, -0.000862626766320318, -0.02094867266714573, 0.015965905040502548, 0.0375...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "__backend__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}...
class ColumnTypeTest(fixtures.MappedTest): __backend__ = True @classmethod def define_tables(cls, metadata): class SpecialType(TypeDecorator): impl = Date def process_bind_param(self, value, dialect): assert isinstance(value, datetime.date) r...
14,095
[ 0.020356858149170876, -0.023121988400816917, 0.05635359138250351, -0.04068869352340698, -0.016778456047177315, -0.002314701210707426, 0.026850534602999687, -0.011667345650494099, -0.003406364470720291, -0.01782945543527603, -0.01943097822368145, -0.05440173298120499, 0.051699165254831314, ...
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_no_counter(self): A, B = self.classes('A', 'B') a, b = self.tables('a', 'b') mapper( A, a, properties={ 'bs': relationship(B, backref='a') }, version_id_col=a.c.version_id, version_id_generator=False ) mapp...
14,096
[ 0.00876203179359436, 0.06117894873023033, 0.08123180270195007, -0.04560692980885506, 0.02486642450094223, 0.0440763495862484, 0.0400613397359848, -0.0612676776945591, -0.0659259706735611, -0.0010294001549482346, -0.007364543154835701, -0.04742588475346565, 0.0396842397749424, -0.0026299960...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "metadata", "annotation": null, "type_comment": null}}], "kwarg": n...
def define_tables(cls, metadata): class SpecialType(TypeDecorator): impl = Date def process_bind_param(self, value, dialect): assert isinstance(value, datetime.date) return value Table('version_table', metadata, Column('id', Special...
14,097
[ 0.016949230805039406, -0.022530371323227882, 0.04004861041903496, -0.03324470669031143, 0.01674341969192028, 0.021658696234226227, 0.006165282800793648, 0.008946772664785385, 0.024540064856410027, -0.028741052374243736, 0.027142982929944992, -0.0280388705432415, -0.03150135651230812, -0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_update(self): Foo = self.classes.Foo s1 = self._fixture() f1 = Foo(id=datetime.date.today(), value='f1') s1.add(f1) s1.commit() f1.value = 'f1rev2' s1.commit()
14,098
[ -0.005453191231936216, 0.016208002343773842, 0.0510895662009716, -0.04087704047560692, -0.0012698289938271046, 0.020546304062008858, -0.01601938158273697, -0.0023459838703274727, -0.02410317212343216, -0.03220043703913689, 0.008090528659522533, -0.029936976730823517, -0.011836018413305283, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "__backend__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}...
class RowSwitchTest(fixtures.MappedTest): __backend__ = True @classmethod def define_tables(cls, metadata): Table( 'p', metadata, Column('id', String(10), primary_key=True), Column('version_id', Integer, default=1, nullable=False), Column('data', Stri...
14,099
[ 0.012098357081413269, 0.04298683628439903, 0.09053825587034225, -0.0385773628950119, 0.030777689069509506, 0.04945702105760574, 0.04015059396624565, -0.032151494175195694, -0.04608897864818573, -0.001161918742582202, 0.014303094707429409, -0.029691938310861588, 0.04945702105760574, -0.0202...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "metadata", "annotation": null, "type_comment": null}}], "kwarg": n...
def define_tables(cls, metadata): Table( 'p', metadata, Column('id', String(10), primary_key=True), Column('version_id', Integer, default=1, nullable=False), Column('data', String(50)) ) Table( 'c', metadata, Column('id', St...
14,100
[ -0.004394287709146738, -0.00891896989196539, 0.03849239647388458, -0.027461038902401924, 0.0047593917697668076, -0.00021718800417147577, -0.026965541765093803, 0.02361440844833851, 0.004583359695971012, -0.07844521105289459, 0.030042847618460655, -0.017251165583729744, 0.007171686738729477, ...
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_row_switch(self): P = self.classes.P session = sessionmaker()() session.add(P(id='P1', data='P version 1')) session.commit() session.close() p = session.query(P).first() session.delete(p) session.add(P(id='P1', data="really a row-switch")) ...