query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Write the values in the buffer
def _write(value, encode='UTF-8'): if sys.version_info.major == 3: sys.stdout.buffer.write(bytes(value, encode)) else: sys.stdout.write(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(data):", "def write( data ):", "def write_data():", "def add_to_buffer(self, values):\n self._buffer.extend(values)", "def _serial_write(self, values_to_write):\n if self.verbose:\n self.log(\"Writing 0x{:x} to serial port...\".format(values_to_write))\n if type(values...
[ "0.70988625", "0.70860267", "0.70459974", "0.6899443", "0.68365556", "0.68279403", "0.6819521", "0.67967576", "0.67967576", "0.67758214", "0.6741824", "0.6680452", "0.6680452", "0.66704684", "0.6657253", "0.6621536", "0.66212654", "0.647195", "0.6463634", "0.6423602", "0.6423...
0.0
-1
Set the current porcentage
def _set_percentage(self): step = float(self.step) end = float(self.end) self.percentage = format((100 * step / end), '.1f')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetProportion(self, p):\r\n\r\n self.proportion = p", "def set_ratio(self, value):\n scene = self.scenes[self.current_scene]\n scene.set_perspective(ratio=value)\n self.redraw()", "def SetPercentage( self, percent, total ):\n self.percentageView = percent\n self.to...
[ "0.64167905", "0.61639315", "0.6094924", "0.6022297", "0.5988166", "0.59432715", "0.58724904", "0.58572924", "0.57609844", "0.57023203", "0.5698069", "0.5692947", "0.5677451", "0.5677451", "0.5670534", "0.56523913", "0.56253463", "0.5585602", "0.5560715", "0.55550313", "0.551...
0.62164897
1
Draw the values in the console
def _draw(self): self._set_percentage() spaces = "".join([' ' for _ in range(len(str(self.percentage)), 5)]) porc = "\r" + str(self.text) + spaces + str(self.percentage) + "%[" pos = (((self.step / (self.end - self.start) * 100) * (self.width - len(porc))) / 100) self._write(por...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self):\n res = ''\n # ANSI code to clear the screen\n #res += chr(27) + \"[2J\"\n for position, value in enumerate(self.board.tttboard):\n if value is None:\n res += str(position)\n #sys.stdout.write(str(position))\n else:\n ...
[ "0.72879267", "0.7170986", "0.7062814", "0.7047287", "0.7028592", "0.6993918", "0.6979893", "0.69557345", "0.69146705", "0.68910545", "0.68778646", "0.6865057", "0.6860649", "0.6846453", "0.68377376", "0.6803503", "0.6768655", "0.6758708", "0.6742269", "0.6738019", "0.6733421...
0.64656836
48
Update the progress in the bar
def update(self, value=1): self.step += float(value) self._draw()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_progressbar(self, count, value):\n self.status(\"Progress %s/%s\" % (value, count))", "def update_progress(self):\n report = self.build_progress_report()\n self.conduit.set_progress(report)", "def update_progress(self):\n report = self.build_progress_report()\n sel...
[ "0.8404397", "0.81474715", "0.81474715", "0.8123371", "0.77068305", "0.7665908", "0.7586559", "0.7572029", "0.7531279", "0.75273526", "0.7490642", "0.74718183", "0.73722637", "0.7346754", "0.73099893", "0.73034674", "0.7298702", "0.724514", "0.7242147", "0.72362405", "0.71918...
0.0
-1
Set the progress in the bar
def progress(self, value): self.step = float(value) self._draw()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_progress(self, progress: float):", "def start_progress_bar(self):\r\n self.progress[\"value\"] = self.progress_step", "def setProgress(self, prog):\n\t\tself.progress = prog", "def _setProgress(self, progress):\n # print \"Progress set %.2f --------------------------------\" % progress\...
[ "0.8768934", "0.8502692", "0.82111984", "0.81303436", "0.8030251", "0.8019475", "0.79375666", "0.79375666", "0.792501", "0.7890481", "0.77899075", "0.7700567", "0.7679233", "0.76576704", "0.7648831", "0.7578405", "0.7483617", "0.7459938", "0.7459938", "0.7441867", "0.7396716"...
0.7211095
25
Get data with labels, split into training and test set.
def load_data(tetrode_number=TETRODE_NUMBER): print("Loading data...") X_train, X_valid, X_test, y_train_labels, y_valid_labels, y_test_labels = formatData(tetrode_number,BASENAME,CONV) print("Done!") X_train = X_train.reshape(X_train.shape[0],1,X_train.shape[1],X_train.shape[2]) X_valid = X_valid....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_data(data, labels):\r\n # Split the data into train and test\r\n X_train, X_test, y_train, y_test = train_test_split(data, labels, test_size=0.30, random_state = 42)\r\n return(X_train, y_train, X_test, y_test)", "def data_split(data, labels, train_ratio=0.5, rand_seed=42):\n\n assert 0 <= ...
[ "0.8143042", "0.7599948", "0.74339765", "0.7296101", "0.7249626", "0.72442406", "0.71197224", "0.71188635", "0.7099707", "0.7069122", "0.70243603", "0.7022656", "0.6997569", "0.6986905", "0.69737595", "0.6960043", "0.69092137", "0.6890824", "0.68742186", "0.6870279", "0.68681...
0.0
-1
Create a symbolic representation of a neural network with `intput_dim` input nodes, `output_dim` output nodes and `num_hidden_units` per hidden layer. The training function of this model must have a minibatch size of `batch_size`. A theano expression which represents such a network is returned.
def model(input_shape, output_dim, num_hidden_units,num_hidden_units_2, num_code_units, filter_size, batch_size=BATCH_SIZE): shape = tuple([None]+list(input_shape[1:])) print(shape) l_in = lasagne.layers.InputLayer(shape=shape) print("Input shape: ",lasagne.layers.get_output_shape(l_in)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neural_network(z, dim_out):\n hidden_dim = 15\n net1 = slim.fully_connected(z, hidden_dim, activation_fn=None)\n net2 = slim.fully_connected(net1, dim_out, activation_fn=tf.tanh)\n return net2", "def build_mlp(input_placeholder, output_size, scope, n_layers, size, activation=tf.tanh, output_activ...
[ "0.6677349", "0.63641995", "0.63397634", "0.63344485", "0.6310874", "0.62955785", "0.6284026", "0.6240737", "0.6230628", "0.62106496", "0.61926675", "0.61831915", "0.6096909", "0.6028522", "0.6002715", "0.5981004", "0.59762573", "0.5971294", "0.59666836", "0.59464973", "0.593...
0.5844898
29
Method the returns the theano functions that are used in training and testing. These are the train and predict functions. The predict function returns out output of the network.
def funcs(dataset, network, batch_size=BATCH_SIZE, learning_rate=LEARNING_RATE, sparsity=0.02, beta=0.5, momentum=MOMENTUM): # symbolic variables X_batch = T.tensor4() y_batch = T.tensor4() layers = lasagne.layers.get_all_layers(network) num_layers = len(layers) print(num_layers) code_la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_predict(self):\n with context.context(training=False):\n prediction = self(*self.inputs)\n return theano.function(self.inputs, prediction)", "def initialise_theano_functions(self):\n\n\t\tindex = theano.tensor.lscalar(\"i\")\n\t\tbatch_size = theano.tensor.lscalar(\"b\")\n\...
[ "0.68128395", "0.6681033", "0.6435803", "0.63134134", "0.6197548", "0.6153154", "0.5976184", "0.5925344", "0.5923323", "0.59082633", "0.5906085", "0.5868325", "0.5863052", "0.5828179", "0.58173525", "0.57907325", "0.57895637", "0.5785", "0.57769054", "0.5775508", "0.57731485"...
0.57185984
26
This is the main method that sets up the experiment
def main(tetrode_number=TETRODE_NUMBER,num_hidden_units=300,num_hidden_units_2=200,num_code_units=50): print("Loading the data...") dataset = load_data(tetrode_number) print("Done!") print("Tetrode number: {}, Num outputs: {}".format(tetrode_number,dataset['output_dim'])) print(dataset['input_shap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n tester = Tester()\n # parse args, load configuration and create all required objects.\n tester.setup_experiment()\n # GO!\n tester.run_experiment()", "def main():\n ex = Experiment(SEED)\n ex.main()", "def main(_):\n description = xm.ExperimentDescription(\n FLAGS.exp_n...
[ "0.85037583", "0.82712513", "0.7717566", "0.7569776", "0.7549764", "0.7404024", "0.73748225", "0.7167452", "0.7107528", "0.70680827", "0.70308816", "0.70169765", "0.69949853", "0.6983026", "0.69363546", "0.69278705", "0.6925882", "0.6925882", "0.6925882", "0.6925882", "0.6925...
0.0
-1
Code that sets up the squares for generation
def square(square_x, square_y, square_width, square_height, square_color): arcade.draw_rectangle_filled(square_x, square_y, square_width, square_height, square_color)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_new_board(self):\n\n logger.info(u'setup_new_board()')\n\n self.squares = [[None for j in xrange(8)] for i in xrange(8)]\n \n self.black_checkers = [ch.Checker(u'black', self) for i in xrange(12)]\n self.white_checkers = [ch.Checker(u'white', self) for i in xrange(12)]\...
[ "0.7019628", "0.6982679", "0.6774817", "0.66652906", "0.6616551", "0.6606855", "0.6555123", "0.655324", "0.65215266", "0.6466629", "0.645573", "0.6447546", "0.6421011", "0.64196724", "0.6397347", "0.6376335", "0.6360501", "0.6335579", "0.63345724", "0.63278586", "0.6297224", ...
0.0
-1
Code that generates the grid
def generate_grid(): y_offset = -10 for a in range(20): # Line 1 # Adds offset to the x position of the squares x_offset = 10 for b in range(1): # Adds offset to the y position of the squares y_offset += 20 for c in range(20): # Prints ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_grid(self):\n for k in range(0, NUM + 1):\n self.create_line(k * UNIT, 0, k * UNIT, SIZE, width=THICKNESS)\n self.create_line(0, k * UNIT, SIZE, k * UNIT, width=THICKNESS)", "def gen_grids(self):\n self.dx = self.grid_width / self.grid_resol\n self.dk = 2 * np...
[ "0.7758083", "0.76451397", "0.76273984", "0.75794756", "0.7403041", "0.7393877", "0.72861016", "0.728214", "0.7271755", "0.72587377", "0.7237075", "0.72368324", "0.7170677", "0.7131273", "0.7118185", "0.7113592", "0.7094105", "0.7071812", "0.70549923", "0.7050561", "0.7005154...
0.71991616
12
Code that sets up the snake part to be drawn
def snake(snake_x, snake_y, snake_scale_x, snake_scale_y, snake_color): arcade.draw_rectangle_filled(snake_x, snake_y, snake_scale_x, snake_scale_y, snake_color)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snakeSetup(self,display):\n if display:\n self.screen = pygame.display.set_mode(windowSize)\n pygame.display.set_caption('Snake!')\n pygame.init()\n self.clock = pygame.time.Clock()\n self.dir = left #round(3 * random.random())\n self.s = snake(playerCo...
[ "0.78469527", "0.76066023", "0.7569854", "0.74622273", "0.7257921", "0.72274387", "0.7061917", "0.6906842", "0.6887717", "0.6844835", "0.67481184", "0.67473495", "0.67407817", "0.6739991", "0.67391694", "0.6724039", "0.66443694", "0.65849555", "0.65485495", "0.65448684", "0.6...
0.7239925
5
Draw everything every frame(we chose in on_draw.schedule(e.g I chose 1/3 so every 1/3 of a second a frame is drawn)).
def on_draw(delta_time): # draws all our objects arcade.start_render() generate_grid() apple() snake(on_draw.snake_part_x, on_draw.snake_part_y, 20, 20, snake_color) snake(on_draw.snake_part2_x, on_draw.snake_part2_y, 20, 20, snake_color) snake(on_draw.snake_part3_x, on_draw.snake_part3_y, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n self.t = time()\n self.frame += 1\n self.loop(self)\n self.draw_bg()\n self.draw_C()\n if self.cursor:\n self.draw_rect(*self.pos, RED, 2)\n self.draw_grid()\n self.draw_T()\n self.show_info()\n for (surf, rect) in...
[ "0.7464388", "0.7392822", "0.73468405", "0.7283849", "0.71829623", "0.71477264", "0.7089125", "0.7075479", "0.6999561", "0.6970391", "0.6969356", "0.6952573", "0.69513756", "0.6890341", "0.6886873", "0.68691003", "0.68428355", "0.68375534", "0.6805685", "0.6742561", "0.672333...
0.0
-1
Main code the calls all the rest of the code
def main(): arcade.open_window(WINDOW_WIDTH, WINDOW_HEIGHT, "Snake.exe") # Set the window background colour arcade.set_background_color(light_green) # Calls the on_draw method every 1/3(20 seconds) of a second arcade.schedule(on_draw, 1/3) # Keeps the window open until closed by the user ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\r\n pass", "def main(self):", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "def main():", "de...
[ "0.8354988", "0.82164955", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", "0.8089839", ...
0.0
-1
Find the earliest time a monkey can jump across a river.
def earliest_arrival(jump_distance, stones): #jump_distance of 3 means they skip 2 stones and land on 3rd stone = '' #based on jump_distance, what are all the stone nums within that distance #when jump_distance is 5, can jujp to stones[4] stone = min(stones[:(jump_distance - 1)]) #stone = 2 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probing_time(self):\r\n earliest_launch = (time.time() * 1000)**2\r\n latest_completion = 0\r\n for probe in self.__probes.values():\r\n if probe.complete():\r\n earliest_launch = min(earliest_launch, probe.launch_time)\r\n latest_completion = max(latest_...
[ "0.5745872", "0.56657726", "0.5574333", "0.5569236", "0.54608685", "0.5431501", "0.5426729", "0.53497094", "0.5315338", "0.53116536", "0.53097105", "0.5303282", "0.5294817", "0.5279624", "0.52618533", "0.5254996", "0.5250051", "0.52369374", "0.5227946", "0.52158654", "0.52093...
0.5979008
0
Loops over a list and returns fuzzy matches found in a second list.
def match2Lists(list1,list2): TopMatch = [] TopScore = [] TopRowIdx = [] for member in list1: x=process.extractOne(member, list2) TopMatch.append(x[0]) TopScore.append(x[1]) TopRowIdx.append(x[2]) return TopMatch, TopScore, TopRowIdx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fuzzy_match(replist, wordset):\n matches = []\n for rep in replist:\n for word in wordset:\n matches.append((Levenshtein.distance(str(rep), word), word, rep))\n\n matches.sort(key=lambda x: (x[0], x[2].weight))\n try:\n return str(matches[0][2]), matches[0][1]\n except I...
[ "0.69091445", "0.67994595", "0.6484106", "0.6355296", "0.62826437", "0.6256106", "0.62520707", "0.621516", "0.6201997", "0.6162989", "0.60969675", "0.60801035", "0.606031", "0.5991959", "0.5894236", "0.5836645", "0.5822666", "0.58086807", "0.58027655", "0.5781277", "0.5763510...
0.64018697
3
Loops over a series containing row indices and returns a list of RUID strings.
def createRUID_List(rowIdxList, headerStr): RUID_List = [] for aRowIdx in rowIdxList: workingRUID=df[headerStr].iloc[aRowIdx] RUID_List.append(workingRUID) return RUID_List
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_RSOPuids_in_RIS(seg):\n \n rsopuids = [] \n \n sequences = seg.ReferencedSeriesSequence[0]\\\n .ReferencedInstanceSequence\n \n for sequence in sequences:\n uid = sequence.ReferencedSOPInstanceUID\n \n rsopuids.append(uid)\n \n return rsopu...
[ "0.61830646", "0.57689166", "0.56448036", "0.56144553", "0.5480247", "0.5425637", "0.5419428", "0.5416224", "0.53751045", "0.5372293", "0.5192723", "0.51913315", "0.5185259", "0.51786697", "0.5169981", "0.5103185", "0.5096104", "0.50520396", "0.5026998", "0.5024384", "0.50224...
0.6128861
1
database settings variable configuration check
def test_databases_variable_exists(self): self.assertTrue(settings.DATABASES, f"{flag}settings module does not have a databases variable{flag}") self.assertTrue('default' in settings.DATABASES, f"{flag}default database configuration correct{flag}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_db():", "def check_settings(self):\r\n pass", "def check_settings(self):\n pass", "def validateDbConfig(config):\n if getattr(config, 'CoreDatabase', None) is None:\n return False, \"Configuration problem: Core Database section is missing. \"\n return True, 'Ok'", "def...
[ "0.7424129", "0.6821875", "0.6816555", "0.6731501", "0.66543466", "0.65069836", "0.6390466", "0.634808", "0.62685215", "0.6239921", "0.6238833", "0.61508465", "0.61221683", "0.6101618", "0.60655457", "0.60396117", "0.60385364", "0.596589", "0.59582657", "0.59206635", "0.59076...
0.72970396
1
Sets button state based on msg
def set_power_state(self, msg): last_pct = self._pct last_plugged_in = self._plugged_in self._pct = msg.lifePercent self._plugged_in = msg.powerSupplyPresent if (last_pct != self._pct or last_plugged_in != self._plugged_in): drain_str = "not charging" if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateButton(self, msg):\n onoffdict = online_users(chat_login.UserText,chat_login.PasswordText)\n unreadmessages = unread_messages(chat_login.UserText,chat_login.PasswordText)\n a=onoffdict\n u=unreadmessages\n for key in a:\n KeyFound = False\n for but...
[ "0.70672286", "0.6945545", "0.644783", "0.63519186", "0.63519186", "0.6241247", "0.61946934", "0.6187381", "0.6142355", "0.605621", "0.60445684", "0.604081", "0.6038265", "0.6016297", "0.6007228", "0.597056", "0.59649277", "0.59550816", "0.59414667", "0.5874428", "0.58538574"...
0.0
-1
Sets AWS default region globally
def set_default_region(profile=None): if os.getenv('AWS_DEFAULT_REGION'): return os.getenv('AWS_DEFAULT_REGION') elif profile is not None: return awscli_region(profile_name=profile) return awscli_region(profile_name='default')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aws_region(self, aws_region):\n self._aws_region = aws_region\n return self", "def default_zone(self, region):\n if region == 'us-east-1':\n return region + 'b'\n else:\n return region + 'a'", "def set_environment():\n # status\n\n logger.info('setting global environment...
[ "0.7337903", "0.6978483", "0.6913252", "0.673321", "0.65030354", "0.6460333", "0.64479446", "0.64394736", "0.64317596", "0.6173606", "0.6020383", "0.6018033", "0.59741384", "0.59741384", "0.59741384", "0.5970148", "0.59253097", "0.59253097", "0.59253097", "0.59253097", "0.588...
0.76276314
0
Sets global environment variables for testing
def set_environment(): # status logger.info('setting global environment variables') # set all env vars os.environ['DBUGMODE'] = 'False' os.environ['AWS_DEFAULT_REGION'] = set_default_region() or 'us-east-1' logger.info('AWS_DEFAULT_REGION determined as %s' % os.environ['AWS_DEFAULT_REGION'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_env(self):\n\n os.environ['GIT_NAME'] = statiki.GIT_NAME\n os.environ['GIT_EMAIL'] = statiki.GIT_EMAIL\n os.environ['GH_TOKEN'] = 'this-is-a-bogus-token:password'\n os.environ['TRAVIS_REPO_SLUG'] = TEST_REPO\n\n return", "def environment_vars_set():\n os.environ[\...
[ "0.761664", "0.74059635", "0.7350931", "0.7292421", "0.7289598", "0.7256863", "0.72523034", "0.7229309", "0.72010165", "0.7198395", "0.7139497", "0.7131175", "0.7026046", "0.69873434", "0.69697994", "0.6956086", "0.6937549", "0.69222546", "0.69166696", "0.6912648", "0.6904731...
0.75063795
1
CMAQ PA Master presents a single interface for CMAQ PA, IRR, and Instantaneous concentration files. paths_and_readers iterable of iterables (n x 2) where each element of the primary iterable is an iterable containing a file path and a reader for that path. The reader is expected to present the Scientific.IO.NetCDF.NetC...
def cmaq_pa_master(paths_and_readers,tslice=None,kslice=None,jslice=None,islice=None): from ..pappt.kvextract import tops2shape,pblhghts2tops files=[] iprf = None concf = None for p,r in paths_and_readers: if not os.path.exists(p): raise ValueError, "File at %s does not exist" % ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_netcdf_files(rlzn_path_list,name_prefix): #{{{\n\n fopen_list = []\n for path in rlzn_path_list:\n netcdf_name = glob.glob(path+'/'+name_prefix)\n fopen_list.append(netCDF4.Dataset(netcdf_name[0],'r'))\n\n return fopen_list #}}}", "def process(self):\n\n if len(self.files) ...
[ "0.5421409", "0.5130424", "0.5103049", "0.5059436", "0.5057716", "0.50419617", "0.4975474", "0.49636874", "0.48937297", "0.48205236", "0.478941", "0.4788244", "0.47660458", "0.47560987", "0.4738994", "0.46989864", "0.46953392", "0.46837544", "0.46670833", "0.46629408", "0.466...
0.7248957
0
Do a lookup from a astropy unit and return a fits unit string
def fits_to_units(unit_str): unit_lookup = { 'meters': 'm', 'meter': 'm', 'degrees': 'deg', 'degree': 'deg', 'hz': 'Hz', 'hertz': 'Hz', 'second': 's', 'sec': 's', 'secs': 's', 'days': 'd', 'day': 'd', 'steradians': '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def units_to_fits(unit):\n if unit is None:\n unit = Unit('')\n return unit.to_string(\"fits\").upper()", "def check_unit(unit: str) -> str:\n if unit == 'metric':\n return 'C'\n elif unit == 'imperial':\n return 'F'\n else:\n return 'K'", "def...
[ "0.7458267", "0.7003991", "0.66595644", "0.6645985", "0.6581739", "0.6505332", "0.6440167", "0.64396435", "0.6415089", "0.6389673", "0.6371899", "0.6304088", "0.62806016", "0.62313175", "0.616339", "0.6142032", "0.6140737", "0.61315584", "0.61311346", "0.61221176", "0.612111"...
0.6479545
6
Convert an astropy unit to a FITS format string. uses the to_string() method builtin to astropy Unit() Notes
def units_to_fits(unit): if unit is None: unit = Unit('') return unit.to_string("fits").upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unicode_of_unit(quant):\n return quant.dimensionality.unicode", "def to_unit(self, unit):\n unit = _find_unit(unit)\n self.value = _convert_value(self.value, self.unit, unit)\n self.unit = unit", "def raw_unit_of_measurement(self) -> str:\n if len(self._node.uom) == 1:\n ...
[ "0.6260546", "0.6204777", "0.6175992", "0.61548734", "0.6128645", "0.61167", "0.60747516", "0.6035215", "0.60141885", "0.59913385", "0.5966789", "0.59561276", "0.5942218", "0.5875363", "0.5875164", "0.5864095", "0.5853759", "0.5820853", "0.5785682", "0.57848775", "0.57770944"...
0.7634108
0
Propose a new sample.
def propose(self, num=1): suggestions = self.hebo.suggest(n_suggestions=num) recs = suggestions.to_dict() suggestions.drop(suggestions.index, inplace=True) self.suggest_template = suggestions out = [] for index in list(recs.values())[0].keys(): rec = {key: val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self, like_params):\n\t\traise NotImplementedError", "def sample(self):\r\n raise NotImplementedError", "def sample(self):", "def sample(self):\n raise NotImplementedError(\"Override me!\")", "def add(self, sample, **kwargs):\n if not self.samples:\n self.init(sample)\n self...
[ "0.67553383", "0.6535052", "0.64531416", "0.6449839", "0.64424664", "0.6432462", "0.6432462", "0.6285857", "0.62766904", "0.6270492", "0.62361866", "0.62318283", "0.616201", "0.6132377", "0.6128731", "0.6126346", "0.60952437", "0.60571027", "0.6054638", "0.6047569", "0.604665...
0.0
-1
Take db FILE and fill 2 arrays with its data
def get_vend_data(db_file, vend_array_to_fill, buy_array_to_fill): #открываем файл с сжатой базой _shop = compress_json.local_load(db_file) if not isinstance(_shop, dict): #конвертируем в дикт _shop = json.loads(_shop) _shop = _shop['shops'] #with open(db_file, encoding="utf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadDb(self,dbContent,base):\n \n db = utilities.db2bitarray(dbContent,self.dbSize,1,1,base)\n db = np.array(db).reshape(self.dbSize,-1)\n # track the size of each file\n fileSize = db.shape[-1]\n \n return (db,fileSize)", "def load_data(db_file):\n con = s...
[ "0.6791058", "0.59622383", "0.58491826", "0.5807415", "0.5802011", "0.5794971", "0.57807547", "0.5769846", "0.5747667", "0.5732948", "0.5696196", "0.5690361", "0.567016", "0.5658856", "0.564647", "0.56253934", "0.56235147", "0.5620141", "0.56099135", "0.558745", "0.5570421", ...
0.65294665
1
Add new item to demand
def add_id(demand_array, old_iter, new_iter): #функция для первоначального добавления айдишника #используется в тех случаях, когда зафиксирована продажа, #но конкретно такого предмета еще нет в demand #adding item ID demand_array.append({"item_id": old_iter['item_id']}) #ярлык для наполнен...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, item):", "def add_item(self, item):\n self.items.append(item)", "def add_item(self, item: int) -> None:\n self._antecedent.add(item)\n self._is_updated = False", "def add(self, item):\n completeDeferred = defer.Deferred()\n self.queue.append((item, completeDef...
[ "0.68081516", "0.6587978", "0.65729314", "0.6570229", "0.6536734", "0.6509939", "0.6505945", "0.6496936", "0.64747435", "0.64747435", "0.64747435", "0.64211184", "0.63767767", "0.63502514", "0.6289795", "0.6289541", "0.62787294", "0.62558454", "0.62449247", "0.62353987", "0.6...
0.5871121
74
Compare new and old database and store difference in demand file
def compare_data(old_vend_data, new_vend_data): def find_diff(oldshop, newshop): diffs = [] _counter_a = 0 _counter_b = 0 #идем по каждому предмету старого списка while _counter_a < len(oldshop): #если мы не на последнем элементе (даже просто если мы раньше...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_db(compressed=True):\r\n #wipe demand file\r\n with open(\"{}DEMAND.txt\".format(db_folder_path), \"w\", encoding=\"utf8\") as demand_file:\r\n demand_file.write(str([]))\r\n #взять все файлы, которые есть в папке с дб,\r\n #и всем сделать compare_data, по их порядку создания\r\n ...
[ "0.7594932", "0.7489941", "0.63724744", "0.6338227", "0.61861855", "0.6171648", "0.61647934", "0.613232", "0.60956407", "0.6057095", "0.6025528", "0.6003019", "0.5973139", "0.59662676", "0.59342784", "0.5934132", "0.5926958", "0.59254164", "0.58950245", "0.58729434", "0.58633...
0.616972
6
Iterate through all available databases and compare them one by one
def compare_db(compressed=True): #wipe demand file with open("{}DEMAND.txt".format(db_folder_path), "w", encoding="utf8") as demand_file: demand_file.write(str([])) #взять все файлы, которые есть в папке с дб, #и всем сделать compare_data, по их порядку создания if compressed: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sync_databases(self):\n host, port = self._src.client().address\n log.info('sync databases from %s:%d' % (host, port))\n for dbname in self._src.client().database_names():\n if dbname in self._ignore_dbs:\n log.info(\"skip database '%s'\" % dbname)\n ...
[ "0.68496317", "0.6807194", "0.65819836", "0.6580963", "0.65752", "0.64933705", "0.64932775", "0.64282703", "0.6404911", "0.6336453", "0.63033295", "0.6256832", "0.6209512", "0.61547893", "0.61269677", "0.6114884", "0.6104924", "0.60817283", "0.60331064", "0.60285336", "0.5993...
0.648194
7
Iterate through all available databases and compress them one by one
def compress_all_db(): #взять все файлы, которые есть в папке с дб, #и всем сделать compress_data, по их порядку создания _db_files = sorted(glob.iglob('{}\\jsons\\DB_*.json'.format(db_folder_path)), key=os.path.getctime) #iterate through all dbs for _n in range(len(_db_files)): print(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sync_databases(self):\n host, port = self._src.client().address\n log.info('sync databases from %s:%d' % (host, port))\n for dbname in self._src.client().database_names():\n if dbname in self._ignore_dbs:\n log.info(\"skip database '%s'\" % dbname)\n ...
[ "0.7129909", "0.6637266", "0.65461916", "0.64949363", "0.6465453", "0.63064724", "0.6207744", "0.611546", "0.6086961", "0.6086638", "0.60798156", "0.6018917", "0.5940772", "0.5939117", "0.59159523", "0.5910437", "0.589049", "0.5876924", "0.585962", "0.5850626", "0.5835088", ...
0.80722123
0
function to get demand data from file
def get_demand_data(): with open("{}DEMAND.txt".format(db_folder_path), "r", encoding="utf8") as demand_file: return eval(demand_file.read(), {'__builtins__':None}, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_data(filename):", "def readDemandFile(self, demandFileName):\n try:\n with open(demandFileName, \"r\") as demandFile:\n fileLines = demandFile.read().splitlines()\n self.totalDemand = 0\n\n # Set default parameters for metadata, then read\n se...
[ "0.7019878", "0.64281434", "0.63534486", "0.6285446", "0.6239602", "0.6237105", "0.61515397", "0.61269003", "0.6108679", "0.60838485", "0.6079148", "0.6078576", "0.60710984", "0.6016122", "0.6015671", "0.5973863", "0.5933098", "0.5862542", "0.5854474", "0.5836018", "0.5829553...
0.71445185
0
Make api call, save new db, compare new db with old one and save demand
def api_db_load(vend, buy, db_compare=False, compressed=True): #находим последнюю сжатую базу if compressed: db_conv_time = last_db_time_get() if not db_compare: if convert_time(db_conv_time, 'm') > 9: #9 print("Old database...") #собираем ссылк...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync_db():\n pass", "def save_db(self) -> None:", "def syncDB(self):\n self.evAPI.clear()\n self.evSyncDB.set()", "def db_sync(db_url=None):\n return IMPL.db_sync(db_url)", "def update_database():\n\n # We obtain the data from the official database\n df = getData.extractData()\n\n ...
[ "0.677077", "0.63384706", "0.6261931", "0.6258742", "0.6211199", "0.6152762", "0.59370285", "0.59200627", "0.5910349", "0.58567894", "0.58532375", "0.584045", "0.58263266", "0.58226395", "0.5789347", "0.578354", "0.57725835", "0.5761899", "0.5759041", "0.57459736", "0.5741778...
0.678962
0
Modifies status response to make it verbose. Gets status message related to response code.
def explain_status(response): verbose = STATUS_LIST[response['code']] response['verbose'] = verbose return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self, value):\r\n if isinstance(value, (int, long)):\r\n if 100 <= value <= 999:\r\n st = _RESPONSE_STATUSES.get(value, '')\r\n if st:\r\n self._status = '%d %s' % (value, st)\r\n else:\r\n self._status ...
[ "0.69887984", "0.69007736", "0.6653848", "0.65020436", "0.65020436", "0.64779925", "0.6313701", "0.6249612", "0.6249612", "0.6216472", "0.6166904", "0.6150416", "0.6143187", "0.6122659", "0.61217445", "0.6104094", "0.6091284", "0.6090497", "0.60658073", "0.6064409", "0.605649...
0.7970568
0
Make calls to the API via HTTP methods and passed params.
def call(self, method, name, params=None, payload=None, **kwds):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _do_call(cls, method, url, params={}):\n headers = {\n 'User-Agent': 'py-retain/' + __version__,\n 'content-type': 'application/json'\n }\n try:\n r = cls.request_map[method.lower()]\n except KeyError:\n raise ValueError(\"Unknow HTTP Meth...
[ "0.756826", "0.735287", "0.71914196", "0.7038588", "0.7019611", "0.69896215", "0.69490856", "0.6946334", "0.68748397", "0.6874808", "0.6804254", "0.6796192", "0.67791593", "0.6759801", "0.6726621", "0.6715361", "0.6713873", "0.66992784", "0.66992784", "0.66904086", "0.6641084...
0.6565182
23
Represents account related requests from API.
def account(self): return Account(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account(request: Request) -> Dict:\n # Get account\n account_id: int = request.matchdict.get(\"account_id\")\n account_obj: Optional[Account] = get_account_by_id(\n session=request.dbsession,\n account_id=account_id,\n )\n # TODO: Check access\n\n\n return {\n \"account\"...
[ "0.67459065", "0.6317586", "0.6311221", "0.6259202", "0.62491316", "0.62273127", "0.61869895", "0.6134086", "0.60907334", "0.6004394", "0.59862494", "0.5968531", "0.5851271", "0.58197296", "0.5817465", "0.5716441", "0.5635674", "0.56112385", "0.56067544", "0.56030345", "0.554...
0.5565038
20
Represents block chain related requests from API.
def blockchain(self): return BlockChain(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def new_block(request: Request) -> dict:\n block: dict = await request.json()\n block = await chain.add_block(block)\n response_block = Block(**block).to_dict()\n\n miner_ip = f\"{request.client.host}:{request.client.port}\"\n for node in chain.peers:\n async with httpx.AsyncClient() as...
[ "0.6451227", "0.5982002", "0.597726", "0.59467125", "0.59459376", "0.5796173", "0.5608739", "0.5519942", "0.54800147", "0.5437324", "0.54359704", "0.54261076", "0.53866243", "0.53666806", "0.535216", "0.53475505", "0.5327437", "0.53198546", "0.5316458", "0.52745664", "0.52601...
0.48976094
86
Represents node related requests from API.
def node(self): return Node(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_request(self, body=None, **properties):\n return self.request(body, name=self.name, type=self.type, **properties)", "def get_nodes(self):\n return requests.get(self.__url + 'nodes').json()", "def handle_status(self, request):\n \"\"\"\n @api {get} /status Get node status\n ...
[ "0.65752953", "0.60218084", "0.59715974", "0.57978845", "0.56597495", "0.56597495", "0.5654022", "0.5628266", "0.56217223", "0.5584836", "0.5584836", "0.5581406", "0.55808663", "0.55748695", "0.5572555", "0.55709064", "0.55196404", "0.54681706", "0.544716", "0.5446634", "0.54...
0.5526448
16
Represents namespaces related requests from API.
def namespace(self): return Namespace(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namespaces(self):\n return [self._namespace_prefix]", "def namespaces(self):\n return ()", "def namespace(self, namespace):\n return self.client.call('GET',\n self.name, params={'namespace': namespace})", "def get_namespaces(self):\n if self.name...
[ "0.6367958", "0.633103", "0.6319464", "0.63119346", "0.61796886", "0.6105786", "0.6085081", "0.6074288", "0.606972", "0.60530823", "0.6028548", "0.5998311", "0.58981556", "0.5866389", "0.58170134", "0.5804238", "0.58017904", "0.57751346", "0.5766885", "0.5741974", "0.57404035...
0.5851031
14
Represents transaction related requests methods from API.
def transaction(self): return Transaction(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transaction(self, transaction):\n # Allow for a list of blocks..\n transaction = utils.request_type(transaction)\n\n res = r.get(self.url + self.tx_info + str(transaction))\n return self.execute(res)", "def test_get_transaction_details_request(self):\n self.trans_details.ge...
[ "0.5956951", "0.5891154", "0.5832065", "0.5768386", "0.5709636", "0.5666873", "0.5652827", "0.55485666", "0.55373466", "0.551796", "0.551796", "0.54646456", "0.54461604", "0.5443088", "0.5429502", "0.5410925", "0.5375463", "0.5347054", "0.53385943", "0.533674", "0.5306164", ...
0.5336756
19
Represents requests for additional information from NIS.
def debug(self): return Debug(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_request():\n return SentmanRequest(SentmanRequest.GET_INFO)", "def request_info(self, request):\n\n\t\t# We have to re-resolve the request path here, because the information\n\t\t# is not stored on the request.\n\t\tview, args, kwargs = resolve(request.path)\n\t\tfor i, arg in enumerate(args):\n\...
[ "0.6353112", "0.58354414", "0.5833395", "0.57105994", "0.5678085", "0.5647915", "0.5639483", "0.56136143", "0.5592161", "0.5576073", "0.55720717", "0.5510691", "0.55037004", "0.5477606", "0.547328", "0.5443528", "0.5443528", "0.544047", "0.54264057", "0.5424157", "0.5395726",...
0.0
-1
Gets the current height of the block chain.
def height(self): return self.client.call('GET', self.name + 'height')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_height(self) -> int:\n return self.current_height", "def get_height(self):\n return self.__height", "def get_height(self):\n return self._height", "def get_height(self):\n return self._height", "def get_height(self):\n return self._height", "def get_heig...
[ "0.7698598", "0.73720944", "0.7370557", "0.7370557", "0.7370557", "0.7370557", "0.73291564", "0.7296799", "0.7296799", "0.7296799", "0.7274973", "0.72705775", "0.72258914", "0.7222025", "0.71950066", "0.71939987", "0.71939987", "0.71939987", "0.71939987", "0.71939987", "0.719...
0.7160527
39
Gets the current score of the block chain.
def score(self): return self.client.call('GET', self.name + 'score')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_score(self):\r\n return self.lcp.get_score()", "def get_score(self) -> int:\n return self.rstate.score()", "def get_score(self):\n return self.__score", "def get_score(self):\n return self.score", "def get_score(self):\n return self.score", "def get_score(self):...
[ "0.7594855", "0.7362026", "0.735239", "0.73473436", "0.73473436", "0.73473436", "0.7346677", "0.7346677", "0.7346677", "0.72718865", "0.7252669", "0.72173166", "0.7168475", "0.7031054", "0.6949262", "0.6865669", "0.68513113", "0.6833226", "0.6827207", "0.6782227", "0.66633576...
0.70542854
13
Gets the current last block of the chain.
def last_block(self): return self.client.call('GET', self.name + 'last-block')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_block(self):\n return self.chain[len(self.chain) - 1]", "def last_block(self):\n return self.chain[-1]", "def last_block(self):\n return self.chain[-1]", "def get_last(self):\n return self.get_block(len(self.chain)-1)", "def getLastBlock(self):\n if (len(self.cha...
[ "0.93840367", "0.934637", "0.934637", "0.91835177", "0.88790625", "0.8837044", "0.8333648", "0.812827", "0.81052315", "0.8074458", "0.79539514", "0.79539514", "0.79539514", "0.79539514", "0.79539514", "0.79157966", "0.76173294", "0.7519028", "0.751837", "0.74459416", "0.73005...
0.8299169
7
Gets a block from the chain that has the given height. If the block with the specified height cannot be found in the database, NIS will return a JSON error object.
def at_public(self, block_height): return self.client.call('POST', 'block/at/public', payload={ 'height': block_height })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_block_at_height(height, headers):\n if height == 0:\n print('retrieving genesis block...')\n return GENESIS_DICTIONARY\n\n else:\n height_bottom = headers[0]['height'] # TODO can pass in height_bottom as an argument to save recompute\n result = hea...
[ "0.76337117", "0.73324215", "0.7283678", "0.7279889", "0.71485955", "0.69237685", "0.6770384", "0.67582065", "0.6742776", "0.67281336", "0.66896886", "0.668445", "0.656166", "0.6470748", "0.6397368", "0.6264807", "0.62340134", "0.6229064", "0.6226051", "0.62204444", "0.617060...
0.52596045
70
Gets up to 10 blocks after given block height from the chain. The returned data is an array of `ExplorerBlockViewModel` JSON objects
def local_chain_blocks_after(self, block_height): return self.client.call('POST', 'local/chain/blocks-after', payload={ 'height': block_height })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_blocks_higher_than(self, height):\n cache_blocks = sorted([block for block in self.block_cache.values() if block.chain == MAIN_CHAIN],\n key=lambda b: b.height)\n\n if cache_blocks and cache_blocks[0].height < height:\n result = [block for block in cach...
[ "0.6930888", "0.6319023", "0.62141484", "0.61850494", "0.59893036", "0.5880623", "0.58661306", "0.5858915", "0.5794101", "0.5754458", "0.5723825", "0.5723594", "0.57041293", "0.56774163", "0.5536813", "0.5536182", "0.5514239", "0.54832965", "0.5482205", "0.5462878", "0.543688...
0.6287904
2
Gets basic information about a node. In case the node has not been booted yet, NIS will return a JSON error object.
def info(self): return self.client.call('GET', self.name + 'info')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, request, nnid, wfver, desc):\n try:\n return_data = NNCommonManager().get_nn_node_info(nnid, wfver, desc)\n return Response(json.dumps(return_data))\n except Exception as e:\n return_data = {\"status\": \"404\", \"result\": str(e)}\n return Re...
[ "0.72308207", "0.6686222", "0.64886034", "0.6165819", "0.6161066", "0.6136519", "0.6129323", "0.6109939", "0.6078347", "0.60725546", "0.59906715", "0.5973692", "0.59514", "0.59486485", "0.59335", "0.5931187", "0.59115684", "0.59115684", "0.58923215", "0.58782524", "0.58703154...
0.5634282
40
Gets extended information about a node. In case the node has not been booted yet, NIS will return a JSON error object.
def extended_info(self): return self.client.call('GET', self.name + 'extended-info')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, request, nnid, wfver, desc):\n try:\n return_data = NNCommonManager().get_nn_node_info(nnid, wfver, desc)\n return Response(json.dumps(return_data))\n except Exception as e:\n return_data = {\"status\": \"404\", \"result\": str(e)}\n return Re...
[ "0.6660078", "0.65021825", "0.6235549", "0.6029446", "0.58012617", "0.5699112", "0.56304234", "0.5602254", "0.5584174", "0.55677825", "0.555768", "0.55195814", "0.5497358", "0.54894817", "0.5472727", "0.54255664", "0.5396422", "0.537486", "0.5364025", "0.5353654", "0.5339366"...
0.65434945
1
Gets an array of all known nodes in the neighborhood. n case the node has not been booted yet, NIS will return a JSON error object.
def peer_list_all(self): return self.client.call('GET', self.name + 'peer-list/all')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes(self):\n all_nodes = json.loads(self.sys_info.response).get('nodes_info')\n online_nodes = [node for node in all_nodes if node[\"infos\"][\"has_error\"] is False]\n return online_nodes", "def get_nodes(self):\n return requests.get(self.__url + 'nodes').json()", "def getNod...
[ "0.745296", "0.7347037", "0.6898057", "0.6855192", "0.67468905", "0.6709756", "0.6699558", "0.66928285", "0.66846824", "0.66834635", "0.6682724", "0.66775095", "0.66484153", "0.65956014", "0.65750504", "0.6548775", "0.65263385", "0.64983004", "0.6497481", "0.6426724", "0.6416...
0.0
-1
Gets an array of all nodes with status 'active' in the neighborhood. In case the node has not been booted yet, NIS will return a JSON error object.
def peer_list_reachable(self): return self.client.call('GET', self.name + 'peer-list/reachable')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes(self):\n all_nodes = json.loads(self.sys_info.response).get('nodes_info')\n online_nodes = [node for node in all_nodes if node[\"infos\"][\"has_error\"] is False]\n return online_nodes", "def get_nodes(self):\n return requests.get(self.__url + 'nodes').json()", "def node_s...
[ "0.7316805", "0.6539896", "0.6522135", "0.6469631", "0.644294", "0.64071214", "0.63752174", "0.63568795", "0.63547206", "0.63365823", "0.63364357", "0.6315419", "0.6180723", "0.6152752", "0.6150194", "0.6073789", "0.6058451", "0.6039603", "0.6004912", "0.59947413", "0.5933456...
0.0
-1
Gets an array of active nodes in the neighborhood that are selected for broadcasts. In case the node has not been booted yet, NIS will return a JSON error object.
def peer_list_active(self): return self.client.call('GET', self.name + 'peer-list/active')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes(self):\n all_nodes = json.loads(self.sys_info.response).get('nodes_info')\n online_nodes = [node for node in all_nodes if node[\"infos\"][\"has_error\"] is False]\n return online_nodes", "def get_nodes(self):\n return requests.get(self.__url + 'nodes').json()", "def getNod...
[ "0.6901627", "0.6340183", "0.62708366", "0.6256495", "0.62507504", "0.61447847", "0.6093047", "0.6065234", "0.59295356", "0.5928272", "0.59091455", "0.5887672", "0.58732307", "0.5850766", "0.5848021", "0.5845036", "0.5838138", "0.58357006", "0.5819075", "0.581563", "0.57834",...
0.0
-1
Requests the chain height from every node in the active node list and returns the maximum height seen. In case the node has not been booted yet, NIS will return a JSON error object.
def max_chain_height(self): return self.client.call('GET', self.name + 'active-peers/max-chain-height')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _height(self, node):\n if node.value is not None and not node.nodes:\n return node.height\n elif node.value is not None and node.nodes:\n return max(flatten([node.height, ] +\n map(self._height, node.nodes.values())))\n elif node.value is...
[ "0.68319684", "0.6465309", "0.6297922", "0.6203093", "0.614153", "0.61317945", "0.61278087", "0.6122855", "0.6043672", "0.60223407", "0.60080594", "0.59487", "0.59428215", "0.5899491", "0.58711404", "0.57808805", "0.57459044", "0.57323635", "0.57300353", "0.57110506", "0.5690...
0.72689503
0
Gets an array of node experiences from another node. In case the node has not been booted yet, NIS will return a JSON error object.
def experiences(self): return self.client.call('GET', self.name + 'experiences')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNodeBeans(self,node):\n data = self.connect('get','nodes/%s/ubfailcnt' % (node),None)\n return data", "def get_target_nodes(self):\n url = 'https://raw.githubusercontent.com/ChandlerBang/Pro-GNN/master/nettack/{}_nettacked_nodes.json'.format(self.name)\n json_file = osp.join(se...
[ "0.5117448", "0.50173837", "0.49288344", "0.4921128", "0.488679", "0.48692638", "0.47888082", "0.47887495", "0.4783707", "0.4716792", "0.46871993", "0.46523735", "0.46356001", "0.46347505", "0.46334207", "0.46175465", "0.4607349", "0.45971555", "0.458495", "0.45714545", "0.45...
0.5599594
0
Boots the local node and thus assign an account (the identity) to the local node. In case the node has already been booted, NIS will return a JSON error object.
def boot(self, boot_node_request): return self.client.call('POST', self.name + 'boot', payload=boot_node_request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reboot(self, node):", "def boot(self):\n\t\tmesslen, received = self.socket.send('bootm\\r', 25)\t\t\n\t\treturn None", "def get_bootstrap_node(self):\n self.clear_screen()\n default = 'bootstrap'\n bootstrap_name = input('enter the bootstrap node name\\n'\n ...
[ "0.56767833", "0.563203", "0.55201155", "0.54065555", "0.5341833", "0.5202964", "0.51330847", "0.51300466", "0.50703657", "0.5026765", "0.49834353", "0.49789014", "0.49730033", "0.4930734", "0.48860893", "0.4873858", "0.48642904", "0.48475266", "0.48128572", "0.48125234", "0....
0.63321984
0
Gets the root namespaces.
def root_page(self, _id=None, page_size=25): return self.client.call('GET', self.name + 'root/page', params={'id': _id, 'pageSize': page_size})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNamespaces(self):\n return _libsbml.SBase_getNamespaces(self)", "def getNamespaces(self):\n return _libsbml.SBMLDocument_getNamespaces(self)", "def namespaces(self):\n if not self._namespaces:\n self.update_namespaces_info()\n\n return self._namespaces", "def get...
[ "0.7539759", "0.7310084", "0.7270852", "0.7198547", "0.71577984", "0.7123653", "0.70363843", "0.69998", "0.69870865", "0.69313633", "0.69289225", "0.6853202", "0.68435884", "0.6819998", "0.6801087", "0.6796902", "0.67966753", "0.6762974", "0.6701827", "0.6671402", "0.6612038"...
0.0
-1
Gets the namespace with given id.
def namespace(self, namespace): return self.client.call('GET', self.name, params={'namespace': namespace})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNamespacePath(self, id: long) -> unicode:\n ...", "def namespace_id_to_name(self, ns_id, all=False):\n try:\n if all:\n return self._namespaces[ns_id]\n else:\n return self._namespaces[ns_id][0]\n except KeyError:\n e = \"...
[ "0.71565926", "0.6610915", "0.6161961", "0.6130003", "0.5918505", "0.5895534", "0.5827185", "0.5736784", "0.5669741", "0.56681895", "0.56561065", "0.56506526", "0.5591167", "0.5573754", "0.5567165", "0.555966", "0.5469768", "0.5463284", "0.54599905", "0.5434206", "0.53773785"...
0.59006774
5
Gets the mosaic definitions for a given namespace.
def mosaic_definition_page(self, namespace, _id=None, pagesize=25): return self.client.call('GET', self.name + 'mosaic/definition/page', params={'namespace': namespace, 'id': _id, 'pagesize': pagesize})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_by_namespace(context, namespace_name, session):\n\n # namespace get raises an exception if not visible\n namespace = namespace_api.get(\n context, namespace_name, session)\n\n db_recs = (\n session.query(models.MetadefResourceType)\n .join(models.MetadefResourceType.associ...
[ "0.57161474", "0.5348535", "0.51656383", "0.5053677", "0.4914318", "0.4831727", "0.4793421", "0.47827056", "0.47570306", "0.4742961", "0.47328997", "0.4731177", "0.47172228", "0.47118232", "0.4691641", "0.46705756", "0.465321", "0.46424088", "0.46331793", "0.46294153", "0.461...
0.59891266
0
Creates and broadcasts a transaction. Since this request involves t he private key of an account, it should only be sent to a local NIS. There are various errors that can occur due to failure of transaction validation.
def prepare_announce(self, request_announce): return self.client.call('POST', self.name + 'prepare-announce', payload=request_announce)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_transaction():\n tx_dict = encode_transaction(\"gautham=awesome\") \n print(tx_dict)\n\n tendermint_host = 'localhost'\n tendermint_port = 26657\n endpoint = 'http://{}:{}/'.format(tendermint_host, tendermint_port)\n\n payload = {\n 'method': 'broadcast_tx_commit',\n 'jsonr...
[ "0.6565837", "0.6481717", "0.64336795", "0.6417225", "0.6344886", "0.6318181", "0.6316728", "0.6178172", "0.6124502", "0.60588974", "0.60538596", "0.6043421", "0.60219026", "0.5989179", "0.5877544", "0.5877544", "0.58687174", "0.58598447", "0.5849285", "0.5841728", "0.5819706...
0.0
-1
Creates and broadcasts a transaction. The private key is not involved.
def announce(self, request_announce): return self.client.call('POST', self.name + 'announce', payload=request_announce)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_transaction(self, receiver, amount, comment=\"\"):\n new_tx = Transaction.new(sender=self.pubkey, receiver=receiver,\n amount=amount, privkey=self.privkey,\n comment=comment)\n tx_json = new_tx.to_json()\n msg = \"t\" +...
[ "0.6315258", "0.6254261", "0.6076233", "0.6035776", "0.6019801", "0.6013963", "0.60119206", "0.5998801", "0.59908056", "0.59588766", "0.5949516", "0.59364283", "0.59189755", "0.5900451", "0.58641654", "0.5853684", "0.58489054", "0.5780002", "0.5774247", "0.5696644", "0.569440...
0.0
-1
Gets an array of time synchronization results. You can monitor the change in network time with this information.
def time_synchronization(self): return self.client.call('GET', self.name + 'time-synchronization')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def result_array(self) -> np.ndarray:\n return np.array([r[\"time\"] for r in self.profile_result])", "def timings(self):\r\n return self._timings", "def get_times(self):\n times = []\n for i in range(1, len(self.events)):\n times.append(self.events[i-1].elapsed_time(self.eve...
[ "0.6488706", "0.6295666", "0.6248829", "0.6247177", "0.62049365", "0.62049365", "0.62049365", "0.61829036", "0.6131571", "0.61148036", "0.6109351", "0.60732055", "0.6019051", "0.5968587", "0.5906922", "0.59041935", "0.58985007", "0.58977073", "0.5870661", "0.5811159", "0.5761...
0.73049825
0
Gets an audit collection of incoming calls. You can monitor the outstanding and recent incoming requests with this information.
def connections_incoming(self): return self.client.call('GET', self.name + 'connections/incoming')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_auditlogs(self):\n res = self.get_object(\"/integrationServices/v3/auditlogs\")\n return res.get(\"notifications\", [])", "def incoming_transactions(self):\n return self._call_account_method(\n 'incomingTransactions'\n )", "def calls(self):\r\n return calls...
[ "0.6298176", "0.60776", "0.6057404", "0.5882206", "0.5825129", "0.57916886", "0.56805044", "0.5670594", "0.55811596", "0.5495211", "0.5474368", "0.5451477", "0.54511184", "0.53637016", "0.5334111", "0.531451", "0.5312271", "0.53062207", "0.5304837", "0.5260119", "0.5238507", ...
0.5908251
3
Gets an audit collection of outgoing calls. You can monitor the outstanding and recent outgoing requests with this information.
def connections_outgoing(self): return self.client.call('GET', self.name + 'connections/outgoing')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_auditlogs(self):\n res = self.get_object(\"/integrationServices/v3/auditlogs\")\n return res.get(\"notifications\", [])", "def calls(self):\r\n return calls.Calls(self)", "def getOutageHistory(self):\n return self._OutageHistory", "def outgoing_caller_ids(self):\r\n ...
[ "0.5880125", "0.5739649", "0.5694943", "0.56410474", "0.55779296", "0.552998", "0.5406403", "0.5326707", "0.52545446", "0.52218795", "0.5213842", "0.51800615", "0.51409405", "0.51348984", "0.5015265", "0.50151485", "0.5012773", "0.5002334", "0.49872288", "0.49606916", "0.4957...
0.58743024
1
Gets an array of task monitor structures. You can monitor the statistics for periodic tasks with this information.
def timers(self): return self.client.call('GET', self.name + '/timers')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_monitor_tasks(self, desired_config):\n create_monitors = list()\n delete_monitors = list()\n update_monitors = list()\n\n for hm_type in ['http', 'https', 'tcp', 'icmp', 'udp']:\n existing = self._bigip.get_monitors(hm_type)\n config_key = \"{}_monitors\"....
[ "0.67183924", "0.65694654", "0.6543797", "0.62939304", "0.61585754", "0.60961825", "0.58715564", "0.5836139", "0.5633542", "0.56137323", "0.5572987", "0.55598134", "0.5544262", "0.5541581", "0.5538595", "0.55003303", "0.5490955", "0.54680985", "0.5462771", "0.5455666", "0.545...
0.0
-1
Liefert die Punktanzahl von Spieler[Player]
def getpoints(self, player): return self.Points[player]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numberOfPlayers(self):\r\n return len(self.playerPreparers)", "def noOfPlayers(self):\n\t\tnumber = 0\n\t\tfor n in range(6):\n\t\t\tif self.playerList[n] != None:\n\t\t\t\tnumber = number + 1\n\t\treturn number", "def __countPlayers(self, players):\n\n numLow = sum(map(lambda p: p.lowFps, pl...
[ "0.7048514", "0.69399923", "0.67620605", "0.66545343", "0.6614006", "0.6302638", "0.626841", "0.6247863", "0.6213272", "0.6206069", "0.61641705", "0.6098961", "0.60836196", "0.5977748", "0.5942997", "0.5937962", "0.5935893", "0.592892", "0.59187216", "0.5905554", "0.5904776",...
0.5955262
14
GET state of HttpProxy
def getHttpProxyState(self, kwargs): try: exp_params = [] check_arguments(exp_params, kwargs) except Exception as ex: return HttpErrorResponse("%s" % ex) with self.httpproxy_lock: return self._get(kwargs, self.httpproxy_file, self.HttpProxy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n request = urllib.request.Request(self.url)\n if self.proxy:\n request.set_proxy(self.proxy, 'http')\n logger.info(\"Attempt to do GET request: url=%s, proxy=%s\",\n self.url, self.proxy)\n response = urllib.request.urlopen(request)\n ...
[ "0.6421434", "0.62202215", "0.61088204", "0.6093173", "0.6060972", "0.6051053", "0.6031893", "0.60026574", "0.5994774", "0.5994774", "0.59914345", "0.59550333", "0.59423137", "0.58981866", "0.5886309", "0.585958", "0.58346224", "0.58289933", "0.5825179", "0.58123755", "0.5812...
0.7270524
0
GET state of PHPProcessManager
def getPHPState(self, kwargs): try: exp_params = [] check_arguments(exp_params, kwargs) except Exception as ex: return HttpErrorResponse("%s" % ex) with self.php_lock: return self._get(kwargs, self.php_file, role.PHPProcessManager)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_process_state(self, path, params):\n reply = self._local_collector.get_process_state()\n self._augment_state_reply(reply, path)\n return reply", "def status( self ):\n duration = datetime.datetime.now() - self.startTime\n status = {\n 'start': self.startTime....
[ "0.69086576", "0.66063726", "0.6585314", "0.6570033", "0.65447235", "0.6497234", "0.64806336", "0.6408786", "0.6406396", "0.6367628", "0.6313452", "0.6250311", "0.62220377", "0.61398494", "0.60950476", "0.6080006", "0.60521466", "0.60476416", "0.6043367", "0.60142565", "0.596...
0.6319921
10
GET state of Tomcat
def getTomcatState(self, kwargs): try: exp_params = [] check_arguments(exp_params, kwargs) except Exception as ex: return HttpErrorResponse("%s" % ex) with self.tomcat_lock: return self._get(kwargs, self.tomcat_file, role.Tomcat)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_GET(self):\n self.log.debug('do_GET called')\n self.HeadGet('GET')", "def do_GET(self):\r\n self._send_handler_response('GET')", "def do_GET(self):\n self.http_method = 'GET'\n self.response()", "def get(self, url):\r\n print(f\"GET {url}\")\r\n response = self...
[ "0.637408", "0.61814106", "0.6000447", "0.59790075", "0.59443545", "0.591256", "0.5840415", "0.57981306", "0.5789769", "0.5765345", "0.5730917", "0.57132006", "0.5665296", "0.5638341", "0.562595", "0.562112", "0.5580805", "0.55697966", "0.55190706", "0.54758614", "0.5474336",...
0.7057364
0
Download a file from Google Drive by its id.
def download_file(id, output=DATA_DIR, quiet=False): url = f"https://drive.google.com/uc?id={id}" gdown.download(url, output=output, quiet=quiet)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_file_from_google_drive(file_id, save_path):\r\n\r\n session = requests.Session()\r\n URL = 'https://docs.google.com/uc?export=download'\r\n params = {'id': file_id}\r\n\r\n response = session.get(URL, params=params, stream=True)\r\n token = get_confirm_token(response)\r\n if token:\r...
[ "0.8497534", "0.8235289", "0.8213236", "0.79085726", "0.790216", "0.7863212", "0.7701957", "0.7627367", "0.7533907", "0.75198966", "0.74832404", "0.7365", "0.7320128", "0.7301034", "0.7266459", "0.71668184", "0.71481824", "0.7120525", "0.7066274", "0.70434654", "0.69725263", ...
0.8159849
3
Is used for command, event, and sieve hooks.
def hook(hook_type: str, arg: List[str], admin: bool = False, gadmin: bool = False, autohelp: bool = False) -> GenericWrapperFunc: args: Dict[str, Union[List[str], bool]] = {} def decorator(func): @functools.wraps(func) def hook_wrapper(*args, **kwargs) -> Ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _hook(self):", "def on_hook(self) -> None:", "def _command(self, *cmd, handler=None):", "def cmd(self):", "def _post_hooks(self):", "def commands():", "def onAction(*args):", "def onAction(*args):", "def onAction(*args):", "def onAction(*args):", "def __call__(self, trigger, type, event):",...
[ "0.758539", "0.7487634", "0.6856744", "0.67677987", "0.6689593", "0.65873057", "0.6587067", "0.6587067", "0.6587067", "0.6587067", "0.65779245", "0.65421605", "0.6537857", "0.6537857", "0.6537857", "0.6537857", "0.6503529", "0.64974827", "0.64202654", "0.6419855", "0.6419783"...
0.0
-1
Method that initializes object attributes
def __init__(self, message, decode_msg, state): self.message = message self.state = state self.decode_msg = decode_msg self.transport = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_attrs(self):\n raise NotImplementedError", "def __init__(self, **initial_attributes):\n\n for attribute_name, attribute_value in initial_attributes.items():\n setattr(self, attribute_name, attribute_value)", "def __init__(self, attrs = None):\n\n if attrs != None:\n ...
[ "0.8069656", "0.7743368", "0.7710398", "0.7701249", "0.7685434", "0.7600567", "0.7479638", "0.74744874", "0.7466764", "0.74569243", "0.7394113", "0.739113", "0.7341354", "0.73107", "0.73107", "0.73107", "0.73107", "0.73107", "0.73107", "0.73107", "0.73107", "0.73035", "0....
0.0
-1
Method to make socket connection and use the broadcast protocol
def connection_made(self, transport): self.transport = transport sock = transport.get_extra_info("socket") sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_socket(self):\n sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)\n sock.settimeout(5)\n if platform.system() == \"Windows\":\n sock.bind((\"\", 0))\n return sock", "def connect(self):\n ...
[ "0.6895756", "0.68927896", "0.6654273", "0.65160924", "0.64943236", "0.6482262", "0.6481882", "0.64794344", "0.644412", "0.6401903", "0.63890177", "0.6317026", "0.6288564", "0.62679565", "0.6210093", "0.6204081", "0.61960423", "0.6189511", "0.61739236", "0.61708444", "0.61438...
0.66940266
2
Method to call decode message and pass datagram and address
def datagram_received(self, data, addr): self.decode_msg(data, self.state)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receive_message(datagram, connection):", "def decode(self,buf):\n eth = dpkt.ethernet.Ethernet(buf)\n pkt_len = len(buf)\n if(eth.type== dpkt.ethernet.ETH_TYPE_IP):\n ip = eth.data\n dst_ip = socket.inet_ntoa(ip.dst)\n src_ip = socket.inet_ntoa(ip.src)\n ...
[ "0.68869746", "0.6623922", "0.62035763", "0.60647553", "0.6049381", "0.59432435", "0.5930527", "0.5922012", "0.5886124", "0.5872814", "0.58549213", "0.5790237", "0.57687056", "0.576501", "0.57565933", "0.5733635", "0.5710519", "0.56922716", "0.56672436", "0.56662637", "0.5655...
0.7067808
0
Method to print to console if called. This function is not used.
def error_received(self, exc): print('Error received:', exc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _print(self, text):\n\t\tif self.verbose:\n\t\t\tprint text", "def print_out():\n pass", "def p(self):\n self.printstdout = True", "def print(self):\n # Your implementation here", "def _print(self, *args, **kwargs) -> None:\n # Only print in verbose mode\n if self._ve...
[ "0.75546896", "0.754714", "0.7219767", "0.7175984", "0.71445787", "0.71397495", "0.7124833", "0.7044805", "0.70329005", "0.70090574", "0.700438", "0.6997529", "0.69863456", "0.6971591", "0.69475955", "0.6940994", "0.6921557", "0.6894845", "0.6850914", "0.6822617", "0.6813902"...
0.0
-1
Method if connection lost, this function is not used.
def connection_lost(self, exc): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connectionLost(self,reason):\n pass", "def connectionLost(reason):", "def handle_connection_lost(self, exc: Optional[Exception]) -> None:", "async def connection_lost(self):\n logging.info('connection dropped')", "def __connection_lost(self):\n print(\"Error: connection lost.\")\n ...
[ "0.8508406", "0.8213209", "0.8203684", "0.81575125", "0.80016416", "0.7959189", "0.7818627", "0.7812391", "0.78063464", "0.7803431", "0.77926713", "0.7677541", "0.76621383", "0.7661407", "0.76586294", "0.7654748", "0.7625265", "0.7624131", "0.7619221", "0.7603999", "0.7533861...
0.83723193
1
Get the config from a json file
def get_config_from_json(json_file): # parse the configurations from the config json file provided with open(json_file, 'r') as config_file: try: config_dict = json.load(config_file) except ValueError as e: print("INVALID JSON file format.. Please provide a good json fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getConfig(self, config):\n\n with open('./config.json', 'r') as json_file:\n try:\n data = json_file.read()\n return json.loads(data)[config]\n except Exception as e:\n print(e)", "def get_config():\n handle = open(\"config.json\", ...
[ "0.8521411", "0.8518934", "0.8364559", "0.83243144", "0.81813663", "0.81625235", "0.8146543", "0.8129548", "0.81210816", "0.81115395", "0.80606294", "0.8039763", "0.80340534", "0.80202025", "0.79839694", "0.7936138", "0.79228246", "0.785222", "0.78468686", "0.7839321", "0.782...
0.77437156
23
Get the json file then editing the path of the experiments folder, creating the dir and return the config
def process_config(json_file): config, _ = get_config_from_json(json_file) print(" THE Configuration of your experiment ..") pprint(config) print(" *************************************** ") try: config.summary_dir = os.path.join("experiments", config.exp_name, "summaries/") config.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config():\n config_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), \"config.json\")\n with open(config_file, \"r\") as read_file:\n conf = json.load(read_file)\n\n if conf[\"use_dev_config\"]:\n print(\"Dev Setup: dev_config.json will be used\")\n config_file =...
[ "0.6612955", "0.64641136", "0.6278629", "0.62562484", "0.6255496", "0.61134475", "0.60716355", "0.5988994", "0.5946703", "0.593988", "0.59357256", "0.59330505", "0.5932068", "0.58953905", "0.5877053", "0.5873151", "0.5861984", "0.5851229", "0.5848458", "0.58336425", "0.582086...
0.81028223
0
AddressTxs a model defined in OpenAPI
def __init__(self, address_txs: List[AddressTx]=None, next_page: str=None): self.openapi_types = { 'address_txs': List[AddressTx], 'next_page': str } self.attribute_map = { 'address_txs': 'address_txs', 'next_page': 'next_page' } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def site_address_etl():\r\n with arcetl.ArcETL(\"Site Addresses\") as etl:\r\n etl.extract(dataset.SITE_ADDRESS.path(\"maint\"))\r\n # Clean maintenance values.\r\n transform.clear_nonpositive(etl, field_names=[\"house_nbr\"])\r\n transform.clean_whitespace(\r\n etl,\r\n ...
[ "0.57096714", "0.55062914", "0.5496484", "0.54938596", "0.54218805", "0.54082596", "0.5378746", "0.5357338", "0.5301924", "0.527657", "0.52230495", "0.5172102", "0.51573515", "0.51486653", "0.51459736", "0.5123913", "0.5122486", "0.5097537", "0.50649405", "0.50470746", "0.504...
0.5651204
1
Returns the dict as a model
def from_dict(cls, dikt: dict) -> 'AddressTxs': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'ModelClass':\n return util.deserialize_model(dikt, cls)", "def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())", "def from_dict(cls, dikt):\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, ...
[ "0.69416064", "0.6844471", "0.67740417", "0.67740417", "0.67740417", "0.67740417", "0.67740417", "0.67740417", "0.6739098", "0.66997623", "0.66997623", "0.66453665", "0.6639819", "0.66035503", "0.6600892", "0.65996236", "0.659477", "0.6580991", "0.65615076", "0.64162004", "0....
0.0
-1
Gets the address_txs of this AddressTxs.
def address_txs(self): return self._address_txs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_addr_txo(self, addr) -> Set[str]:\n return self.txo_byaddr.get(addr, set())", "def address_tags(self):\n return self._address_tags", "def symbol_table_addresses(self):\n all_address = []\n for node in self.all_nodes[0]:\n all_address.extend(node['addresses'])\n ...
[ "0.7036344", "0.68626004", "0.677266", "0.6440875", "0.6379488", "0.6379488", "0.6379488", "0.6336632", "0.6181056", "0.6127058", "0.597582", "0.5940792", "0.59098506", "0.5875603", "0.5756019", "0.5694489", "0.56922615", "0.56600934", "0.5566928", "0.555155", "0.5528333", ...
0.91682494
0
Sets the address_txs of this AddressTxs.
def address_txs(self, address_txs): if address_txs is None: raise ValueError("Invalid value for `address_txs`, must not be `None`") self._address_txs = address_txs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address_txs(self):\n return self._address_txs", "def addresses(self, addresses: \"List[str]\"):\n self._attrs[\"addresses\"] = addresses", "def addresses(self, addresses: \"List[str]\"):\n self._attrs[\"addresses\"] = addresses", "def addresses(self, addresses: \"List[str]\"):\n ...
[ "0.67103106", "0.627279", "0.627279", "0.627279", "0.58619", "0.563561", "0.56108737", "0.55193025", "0.53204703", "0.52825093", "0.5198595", "0.5196371", "0.5188511", "0.5182996", "0.5091491", "0.50475854", "0.50410074", "0.5034687", "0.4995494", "0.4987398", "0.4955234", ...
0.8438663
0
Gets the next_page of this AddressTxs.
def next_page(self): return self._next_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_page(self):\n return min((self.get_page() + 1), self.get_last_page())", "def next_page_token(self):\n return self._next_page_token", "def next_page_token(self):\n return self._next_page_token", "def next_num(self):\n return self.page + 1", "def nextPage(self):\n ...
[ "0.7067162", "0.66411906", "0.66411906", "0.65460753", "0.65415114", "0.6517272", "0.64830554", "0.6468212", "0.642163", "0.637417", "0.6330661", "0.6279175", "0.6273147", "0.6216764", "0.61757267", "0.6166563", "0.6163094", "0.61517274", "0.61517274", "0.6089374", "0.6046776...
0.743467
1
Sets the next_page of this AddressTxs.
def next_page(self, next_page): self._next_page = next_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_page_url(self, next_page_url):\n\n self._next_page_url = next_page_url", "def next_page_token(self, next_page_token):\n\n self._next_page_token = next_page_token", "def next_page_token(self, next_page_token):\n\n self._next_page_token = next_page_token", "def setNext(self, next)...
[ "0.7219447", "0.71530163", "0.71530163", "0.71018225", "0.6745028", "0.66674113", "0.6584043", "0.6584043", "0.65468717", "0.6441516", "0.63742745", "0.62788", "0.6275367", "0.62519586", "0.6180144", "0.61524653", "0.6144712", "0.5994668", "0.5881517", "0.5686179", "0.5635909...
0.7985471
1
Just extends the default reaction_check to use owner_ids
def reaction_check(self, payload): if payload.message_id != self.message.id: return False if payload.user_id not in (*self.bot.owner_ids, self._author_id): return False return payload.emoji in self.buttons
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def owner(c, m):\n if not m.id in ids:\n await c.send('You must be an owner to use this command.')\n raise Exception()\n return True", "async def cog_check(self, ctx:utils.Context):\n\n if ctx.author.id in self.bot.config['owners']:\n return True\n raise command...
[ "0.6081681", "0.60427636", "0.5522264", "0.5521075", "0.546714", "0.54281026", "0.539481", "0.53263474", "0.5270159", "0.5203903", "0.51887876", "0.5171225", "0.51699257", "0.51359004", "0.50977296", "0.50574934", "0.5050487", "0.5009937", "0.49913508", "0.49794465", "0.49767...
0.60503805
1
go to the previous page
async def go_to_previous_page(self, payload): await self.show_checked_page(self.current_page - 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def goToPrevLink():\n if wikiPageStackTrace[-2].getUrl() != \"\":\n oldpage = wikiPageStackTrace[-2]\n print(\"going back to \", oldpage.getUrl())\n titleStackTrace.append(oldpage.getTitle())\n urlStackTrace.append(oldpage.getUrl())\n del wikiPageStackTrace[-1]\n update...
[ "0.8341149", "0.8140642", "0.77627325", "0.7596946", "0.74217504", "0.73846143", "0.73772043", "0.7355603", "0.7353923", "0.7264047", "0.7233012", "0.71943694", "0.717306", "0.7150126", "0.7134649", "0.7052938", "0.70496273", "0.70420724", "0.70325124", "0.7024788", "0.697832...
0.7768599
2
go to the next page
async def go_to_next_page(self, payload): await self.show_checked_page(self.current_page + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def next_page(self):\n await self.checked_show_page(self.current_page + 1)", "def next_page():\n\tprint('-> \\nClicking next page')\n\told_html = driver.find_element_by_tag_name('html').text\n\tlink = driver.find_element_by_xpath(XPATHS['next_page']) \n\tlink.click()\n\treturn wait_for(old_html)", ...
[ "0.78312886", "0.77221954", "0.76888263", "0.76687986", "0.7646403", "0.7624802", "0.7548946", "0.7524892", "0.7478211", "0.7427636", "0.7220601", "0.7183752", "0.70250136", "0.70238024", "0.7008027", "0.6966757", "0.69374335", "0.69066745", "0.69066745", "0.67980814", "0.679...
0.77267194
1
go to the first page
async def go_to_first_page(self, payload): await self.show_page(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def first_page(self):\n await self.show_page(1)", "def get_first_page(self):\n return 1", "def first_page(self):\n if self._start == 0:\n raise ValueError('Already at the first page.')\n self._start = 0", "def test_first_page_passes(self):\n\n self.page.ope...
[ "0.8124453", "0.757861", "0.7448942", "0.7334367", "0.6904852", "0.6837108", "0.67754245", "0.65908957", "0.6514685", "0.6514685", "0.648985", "0.63904554", "0.6384999", "0.6368812", "0.6266762", "0.6246366", "0.61889887", "0.6170708", "0.61516196", "0.6107086", "0.6086522", ...
0.82532895
0
go to the last page
async def go_to_last_page(self, payload): # The call here is safe because it's guarded by skip_if await self.show_page(self._source.get_max_pages() - 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __goToLastPage(self):\n try:\n self.currenturi = self.currenturi = self.currenturi.rsplit('/',1)[0] + '/' +self.soup.find('div', 'pagination_container vt_pagination_container').findAll('a', text=re.compile ('^\\d+$'))[-1].parent['href']\n self.__setSoupForCurrentUri()\n exce...
[ "0.8525012", "0.84901273", "0.8000614", "0.7571129", "0.71412313", "0.7129027", "0.7071906", "0.70232373", "0.6910991", "0.68638605", "0.68634975", "0.6720003", "0.66850734", "0.65372634", "0.64675117", "0.63978624", "0.6327516", "0.6310956", "0.6250297", "0.62313193", "0.623...
0.81032753
2
stops the pagination session.
async def stop_pages(self, payload: discord.RawReactionActionEvent) -> None: self.stop() await self.message.delete()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def stop_pages(self):\n await self.message.delete()\n self.paginating = False", "def stopPaging(self):\n self._stillPaging = 0", "def stop_navigation(self):\n print(\"Stopping the navigation thread\")\n self.navigation_stop = True\n self.locomotion_stop = True", ...
[ "0.79502195", "0.76647633", "0.6576003", "0.6432276", "0.6326475", "0.63129485", "0.63129485", "0.63129485", "0.63129485", "0.63129485", "0.63129485", "0.63129485", "0.63129485", "0.63129485", "0.63129485", "0.63129485", "0.63120186", "0.6307632", "0.62576467", "0.6251616", "...
0.61810035
26
Update the progress bar with the new amount (with min and max values set at initialization; if it is over or under, it takes the min or max value as a default.
def updateAmount(self, newAmount = 0): if newAmount and self.starting_amount is None: self.starting_amount = newAmount self.starting_time = time.time() if newAmount < self.min: newAmount = self.min if newAmount > self.max: newAmount = self.max self.prev_amount = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateAmount(self, newAmount=0):\n\n if newAmount <= self.min:\n newAmount = self.min\n if newAmount >= self.max:\n newAmount = self.max\n\n self.amount = newAmount\n\n # Figure out the new percent done, round to an integer\n diffFromMin = float(self.amo...
[ "0.81444263", "0.8055253", "0.80018425", "0.74270576", "0.70937634", "0.70410943", "0.70247483", "0.7020443", "0.7002356", "0.6974016", "0.69505423", "0.68986005", "0.684882", "0.68441993", "0.6825717", "0.67352104", "0.6724981", "0.6724981", "0.67151386", "0.6707617", "0.668...
0.8072242
1
Updates the amount, and writes to stdout. Prints a carriage return first, so it will overwrite the current line in stdout.
def __call__(self, value): self.updateAmount(value) if self.progBar_last == self.progBar and self.comment==self.comment_last: return print '\r', sys.stdout.write(self.prefix + str(self) + str(self.comment) + ' ') sys.stdout.flush() self.progBar_last = self.pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, value):\n\n print('\\r', end='')\n self.updateAmount(value)\n writec(str(self), self.color, self.style)\n sys.stdout.flush()", "def update(self, value, every=1, suffix=''):\n if value % every == 0 or value >= self.max:\n self.update_amount(newAmoun...
[ "0.762545", "0.6610195", "0.6492391", "0.64584005", "0.6391145", "0.6297665", "0.6245245", "0.61903924", "0.6185342", "0.6158732", "0.61420435", "0.6093406", "0.6072768", "0.6070518", "0.59700406", "0.5969873", "0.59611136", "0.5960584", "0.5960584", "0.5959093", "0.59544796"...
0.7512267
1
Return pretty string representation of x.
def tostr (x): if isinstance (x, tuple): return tuple ( map (tostr, x)) if isinstance(x, (float, numpy.float32,numpy.float64)): return float_to_str(x) return str(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pretty_str(self) -> str:\n ...", "def pprint(x):\n if is_theano_object(x):\n return _gettheano().printing.pprint(x)\n else:\n return str(x)", "def pretty_repr(x: Any, num_spaces: int = 4) -> str:\n\n if isinstance(x, FrozenDict):\n return x.pretty_repr()\n else:\n\n def p...
[ "0.68052506", "0.67240494", "0.6638014", "0.66270936", "0.6526375", "0.64931875", "0.64578533", "0.6433521", "0.637899", "0.63540995", "0.6342875", "0.62580365", "0.6173003", "0.6159281", "0.61371696", "0.6119064", "0.611821", "0.6089578", "0.60637194", "0.60572577", "0.60359...
0.6772707
1
Return human readable time string from seconds. Examples >>> from iocbio.utils import time_to_str >>> print time_to_str(123000000) 3Y10M24d10h40m >>> print time_to_str(1230000) 14d5h40m >>> print time_to_str(1230) 20m30.0s >>> print time_to_str(0.123) 123ms >>> print time_to_str(0.000123) 123us >>> print time_to_str(0....
def time_to_str(s): seconds_in_year = 31556925.9747 # a standard SI year orig_s = s years = int(s / (seconds_in_year)) r = [] if years: r.append ('%sY' % (years)) s -= years * (seconds_in_year) months = int(s / (seconds_in_year/12.0)) if months: r.append ('%sM' % (mon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seconds2str(seconds):\n\n seconds = abs(seconds)\n days = hours = minutes = 0\n\n if seconds >= 86400:\n days = seconds / 86400\n seconds = (days - int(days)) * 86400\n\n if seconds >= 3600:\n hours = seconds / 3600\n seconds = (hours - int(hours)) * 3600\n\n if secon...
[ "0.81438756", "0.8068417", "0.77642405", "0.7726116", "0.76527566", "0.7624055", "0.76136416", "0.76041996", "0.7520092", "0.75124556", "0.75027996", "0.74487066", "0.7442624", "0.7388984", "0.7385807", "0.7183101", "0.7097691", "0.7094492", "0.70717335", "0.7068713", "0.7055...
0.7918404
2
Expand data to given shape by zeropadding.
def expand_to_shape(data, shape, dtype=None, background=None): if dtype is None: dtype = data.dtype if shape==data.shape: return data.astype(dtype) if background is None: background = data.min() expanded_data = numpy.zeros(shape, dtype=dtype) + background slices = [] rhs_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand_data(X, orig_shape=(256, 256)):\n\n return X.reshape((-1, *orig_shape, X.shape[-1]))", "def dataset_zeropadding(data, training=True):\n # Flatten Data into 1D Vector\n ##Maximum number of points = 72 , keep around 80 values for even number\n ####max_len = np.max([len(a) for a in arr])\n ...
[ "0.63390535", "0.60706556", "0.594458", "0.57902503", "0.5786774", "0.5715383", "0.5558415", "0.553652", "0.54733175", "0.5471953", "0.54562503", "0.5387259", "0.53608185", "0.536063", "0.5359308", "0.5348232", "0.5347931", "0.53136796", "0.5310307", "0.5289619", "0.5283824",...
0.68397105
0
Contract data stack to given shape.
def contract_to_shape(data, shape, dtype=None): if dtype is None: dtype = data.dtype if shape==data.shape: return data.astype(dtype) slices = [] for s1, s2 in zip (data.shape, shape): slices.append(slice((s1-s2)//2, (s1+s2)//2)) return data[tuple(slices)].astype(dtype)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contract(self):\n self.vertices[-1, :] = self.contracted", "def stack(self):\n # Fetch the zeroth layer data, which is the original input\n \tdata = self.data_container[0]\n # Initialize network that will contain the stack\n \tself.init_stacked_net(data)\n # Add the weights ...
[ "0.55399996", "0.5525955", "0.53692496", "0.5167249", "0.5094762", "0.50430816", "0.50266343", "0.49535766", "0.49497294", "0.49210066", "0.49048564", "0.49048564", "0.48840332", "0.48734602", "0.4861909", "0.48574793", "0.48401105", "0.48222226", "0.48093274", "0.47836372", ...
0.54277307
2
Return numpy float dtype object from float type label.
def float2dtype(float_type): if float_type == 'single' or float_type is None: return numpy.float32 if float_type == 'double': return numpy.float64 raise NotImplementedError (`float_type`)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dtype_float(dtype: DType):\n return promote_dtypes(dtype, np.float16)", "def new_float(*args, **kwargs):\n return array.array(FLOAT_TYPECODE, *args, **kwargs)", "def getDataType(self, label):\n\n try:\n return self._data[label].dtype\n except KeyError:\n return Non...
[ "0.6824595", "0.6470433", "0.62978154", "0.6265532", "0.6262961", "0.6202859", "0.61125803", "0.61037177", "0.6056416", "0.6034441", "0.6021092", "0.59418553", "0.59375775", "0.593196", "0.5871259", "0.5841695", "0.58065265", "0.5799321", "0.5799321", "0.57938313", "0.5788107...
0.6392694
2
Return a directory name with suffix that will be used to save data related to given path.
def get_path_dir(path, suffix): if os.path.isfile(path): path_dir = path+'.'+suffix elif os.path.isdir(path): path_dir = os.path.join(path, suffix) elif os.path.exists(path): raise ValueError ('Not a file or directory: %r' % path) else: base, ext = os.path.splitext(path) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDirectoryFilename(path):\n\tfrom os.path import splitext\n\tpath = normalizePath(path)\n\treturn splitext(path)[0]", "def data_path(path: str, createdir: bool = False) -> str:\n path_obj = Path(path)\n if not path_obj.is_absolute():\n if inside_project():\n path_obj = Path(project_...
[ "0.7162813", "0.66013575", "0.6581869", "0.64441097", "0.64150935", "0.6364166", "0.633812", "0.6298539", "0.6284165", "0.6278799", "0.62650996", "0.62615657", "0.6255409", "0.62436426", "0.6233815", "0.6168217", "0.61586595", "0.61431384", "0.6131991", "0.61302805", "0.61132...
0.6724265
1
Return option value. For example, ``options.get(key = default_value)`` will return the value of an option with ``key``. If such an option does not exist then update ``options`` and return ``default_value``.
def get(self, **kws): assert len (kws)==1,`kws` key, default = kws.items()[0] if key not in self.__dict__: if VERBOSE: print 'Options.get: adding new option: %s=%r' % (key, default) self.__dict__[key] = default value = self.__dict__[key] if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_option(self, option, default=None):\n splitvals = option.split('/')\n section, key = \"/\".join(splitvals[:-1]), splitvals[-1]\n\n try:\n value = self.get(section, key)\n value = self._str_to_val(value)\n except ValueError, s:\n logger.warning(\"...
[ "0.773545", "0.7729312", "0.77203834", "0.77163213", "0.7318744", "0.72514683", "0.715828", "0.70651406", "0.70090353", "0.7003951", "0.69639146", "0.6959806", "0.68285704", "0.6809219", "0.679564", "0.6711485", "0.6663394", "0.6575352", "0.65437526", "0.6529776", "0.6515117"...
0.6843059
12
Fast LineSplitter. Copied from The F2Py Project.
def splitquote(line, stopchar=None, lower=False, quotechars = '"\''): items = [] i = 0 while 1: try: char = line[i]; i += 1 except IndexError: break l = [] l_append = l.append nofslashes = 0 if stopchar is None: # search for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_line(line, sizer, surface_width):\n splits = []\n queue = [line]\n while len(queue) > 0:\n current = queue.pop(0)\n line_width, _ = sizer(current)\n if line_width >= surface_width:\n tokens = current.split()\n tokens_size = len(tokens)\n if t...
[ "0.6781566", "0.6237892", "0.5944432", "0.57823193", "0.5778391", "0.5770935", "0.5714025", "0.5671507", "0.56476444", "0.563116", "0.5596077", "0.55742425", "0.5550149", "0.5489525", "0.5473699", "0.54629004", "0.5420649", "0.5420296", "0.5387836", "0.53691286", "0.53668946"...
0.0
-1
Round values to one or two decimal digits defined by the last value.
def sround(*values): last_decimals = _get_sround_decimals (values[-1]) other_decimals = int(-numpy.floor(numpy.log10(values[-1]))) l = [] for value in values[:-1]: if value<0: l.append(-numpy.around (-value, other_decimals)) else: l.append(numpy.around (value, oth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def round_decimal(cls, value: Dec) -> Dec:\n # This check for numbers which are smaller than the precision allows will\n # be commented out for now as it seems to kill economic activity.\n # if value < Dec('1E-8'):\n # return Dec(0)\n return round(value, cls.currency_precisio...
[ "0.70942503", "0.6996406", "0.69596493", "0.68176585", "0.67429626", "0.67079645", "0.6595587", "0.658156", "0.653194", "0.6517209", "0.65127504", "0.65024275", "0.6484846", "0.643247", "0.64188635", "0.6402234", "0.63885266", "0.63826716", "0.6382356", "0.637307", "0.6347956...
0.60833997
30
Adds IP block to the assigned IP block of the IPv6 allocator
def add_ip_block(self, ipblock: IPNetwork): if self._assigned_ip_block and ipblock.overlaps( self._assigned_ip_block, ): raise OverlappedIPBlocksError(ipblock) if ipblock.prefixlen > self._ipv6_prefixlen: log_error_and_raise( InvalidIPv6Ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_ipv6(self, id_network_ipv6, id_equip, description):\n\n ip_map = dict()\n ip_map['id_network_ipv6'] = id_network_ipv6\n ip_map['description'] = description\n ip_map['id_equip'] = id_equip\n\n code, xml = self.submit({'ip': ip_map}, 'POST', 'ipv6/')\n\n return self....
[ "0.6616031", "0.62040496", "0.60433906", "0.59782785", "0.59601086", "0.59469026", "0.5781444", "0.57143337", "0.56583583", "0.5587608", "0.5586854", "0.550963", "0.5483628", "0.54783916", "0.544025", "0.537757", "0.5374095", "0.5303565", "0.52504593", "0.5202539", "0.5193527...
0.7826192
0
Removes assigned IP block (as it only supports one for now) If force is False, blocks that have any addresses currently allocated will not be removed. Otherwise, if force is True, the indicated blocks will be removed regardless of whether any addresses have been allocated and any allocated addresses will no longer be s...
def remove_ip_blocks( self, ipblocks: List[IPNetwork], force: bool = False, ) -> List[IPNetwork]: if self._assigned_ip_block not in ipblocks: return [] if not force: allocated_ip_block_set = self._store.ipv6_state_map.get_allocated_ip_block_set() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_item(self, usage_locator, user_id, force=False): # lint-amnesty, pylint: disable=arguments-differ\n if not isinstance(usage_locator, BlockUsageLocator) or usage_locator.deprecated:\n # The supplied UsageKey is of the wrong type, so it can't possibly be stored in this modulestore.\n ...
[ "0.5939767", "0.5938632", "0.56954473", "0.56054527", "0.55543953", "0.55501753", "0.5495851", "0.544292", "0.5290664", "0.52457166", "0.52143854", "0.5211263", "0.5097896", "0.5064577", "0.50482243", "0.50213253", "0.49973372", "0.49596322", "0.49533314", "0.49437845", "0.49...
0.7909288
0