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
Store the results of decorated function for last lookup
def memoize(func): cache = {} # Store results in a dict that maps arguments to results def wrapper(*args, **kwargs): if(args, kwargs) not in cache: # call func() and store the result. cache[(args,kwargs)] = func(*args,**kwargs) return cache[(args,kwargs)] retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_result(f):\n @wraps(f)\n def wrapper(*args, **kwargs):\n assert len(args) == 0 and len(kwargs) == 0, \"Wrapped call must be empty\"\n if not hasattr(f, \"cached_result\"):\n f.cached_result = f()\n return f.cached_result\n return wrapper", "def _memoize_return_v...
[ "0.70574814", "0.7017321", "0.68872094", "0.68841857", "0.6872656", "0.6859558", "0.6859039", "0.67440945", "0.6736466", "0.6702753", "0.6632642", "0.6616202", "0.6610168", "0.6601362", "0.6576083", "0.6567744", "0.6561982", "0.65458673", "0.6534694", "0.65299016", "0.6455248...
0.63989127
24
Install eggs for a particular configuration
def __install_eggs(self, config): egg_carton = ( self.directory.install_directory(self.feature_name), "requirements.txt", ) eggs = self.__gather_eggs(config) self.logger.debug("Installing eggs %s..." % eggs) self.__load_carton(egg_carton, eggs) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def install(self, egg, dir_path):", "def install():\n deploy()\n configure()", "def _install(self):\n\n pass", "def install_egg(self, egg_name):\n if not os.path.exists(self.egg_directory):\n os.makedirs(self.egg_directory)\n self.requirement_set.add_requirement(\n ...
[ "0.6983456", "0.66896045", "0.6177954", "0.60125315", "0.6004646", "0.59920675", "0.5969057", "0.590986", "0.5858302", "0.58255863", "0.58191156", "0.5809163", "0.58055943", "0.57812357", "0.5772991", "0.5771122", "0.5763537", "0.57495356", "0.57216597", "0.57147646", "0.5714...
0.8199708
0
add the proper resources into the environment
def __add_paths(self, config): bin_path = os.path.join( self.directory.install_directory(self.feature_name), "bin" ) whitelist_executables = self._get_whitelisted_executables(config) for f in os.listdir(bin_path): for pattern in BLACKLISTED_EXECUTABLES: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resources(self):", "def resources(self, resources):\n self._resources = resources", "def add_resources(event):\n anuket_resources.need()", "def _load_resources(self):\n puts = (getattr(self, 'project', None) or self).puts\n for resource_type, resource_cls in six.iteritems(AVAILABL...
[ "0.6918525", "0.6601503", "0.6575732", "0.653603", "0.6515601", "0.64752585", "0.64702904", "0.64049286", "0.6381827", "0.6381827", "0.6381827", "0.6381827", "0.6336196", "0.6322255", "0.6199193", "0.61631304", "0.60845155", "0.6036984", "0.6014663", "0.59382975", "0.59016645...
0.0
-1
Create a matrix of the pairwise noise correlations between cells.
def noise(date, cs, trange=(0, None), trace_type='dff', cutoff_before_lick_ms=-1, error_trials=-1, randomizations=500): if isinstance(cs, list) and len(cs) == 1: cs = cs[0] elif isinstance(cs, list): return _noise_multiple(date, cs, trange, trace_type, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _noise_matrix(self):\n\n return self._noise * (np.random.rand(self._rows, self._cols)\n - 0.5)", "def _gp_cov_matrix(Nt, snr2, clen2):\n f = lambda x: np.exp(-(x**2)/clen2)\n C = snr2 * f(np.arange(Nt))\n C[0] += 1 # noise\n return scipy.linalg.toeplitz(C)", ...
[ "0.63896286", "0.60221064", "0.5909629", "0.5822298", "0.57837486", "0.577646", "0.5753432", "0.567505", "0.5652752", "0.5638996", "0.5632121", "0.5631466", "0.5631466", "0.56234056", "0.56053835", "0.55994177", "0.5569348", "0.5540141", "0.5540067", "0.55052173", "0.5498896"...
0.5140765
54
Create a matrix of the pairwise signal correlations between cells.
def signal(date, cs, trange=(0, None), trace_type='dff', cutoff_before_lick_ms=-1, error_trials=-1, randomizations=500): # ncells x frames x nstimuli/onsets trs = stimulus.trials(date, cs, start_s=trange[0], end_s=trange[1], trace_type=trace_type, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correlation_matrix(data):\n\n _, num_columns = shape(data)\n\n def matrix_entry(i, j):\n return correlation(get_column(data, i), get_column(data, j))\n\n return make_matrix(num_columns, num_columns, matrix_entry)", "def correlation_matrix(data):\n\n _, num_columns = shape(data)\n\n def ...
[ "0.6814257", "0.6814257", "0.6782614", "0.67099845", "0.65058136", "0.6460902", "0.61755204", "0.6162979", "0.61337745", "0.6130927", "0.61205184", "0.6110745", "0.61083704", "0.609489", "0.60805887", "0.6067641", "0.6061592", "0.5999719", "0.59809506", "0.5967061", "0.595325...
0.0
-1
Create a matrix of the pairwise noise correlations between cells.
def _noise_multiple(date, cs, trange=(0, None), trace_type='dff', cutoff_before_lick_ms=-1, error_trials=-1, randomizations=500): # ncells x frames x nstimuli/onsets cses, trials = cs, [0] trs = None for cs in cses: cstrs = stimulus.trials(date, cs, start_s=trange[0], end_s=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _noise_matrix(self):\n\n return self._noise * (np.random.rand(self._rows, self._cols)\n - 0.5)", "def _gp_cov_matrix(Nt, snr2, clen2):\n f = lambda x: np.exp(-(x**2)/clen2)\n C = snr2 * f(np.arange(Nt))\n C[0] += 1 # noise\n return scipy.linalg.toeplitz(C)", ...
[ "0.6387653", "0.6021434", "0.59131205", "0.5825419", "0.57857037", "0.57784086", "0.57573915", "0.567533", "0.5652715", "0.5641329", "0.5636672", "0.5636672", "0.56285775", "0.56064606", "0.5600935", "0.55724317", "0.55433285", "0.5541137", "0.5506146", "0.55005693", "0.54895...
0.5629217
12
Divide the data into trips and give each trip a unique number "trip_no" The data is saved to a parquet file.
def save_numbered_trips(df, output_path:str, max_skip=3): current_trip_no = 0 parquet_schema = None if os.path.exists(output_path): os.remove(output_path) skips=0 for i,partition in enumerate(df.partitions): try: df_raw = partition.compute() except Val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_microtrips(self):\n for data in self.microtrip_data:\n file_name = \"../data/microtrips/\" + data.file.name + \"_m\" + \".csv\"\n data.save_csv(file_name)", "def export_trip_information(trip_id,first_arrive,first_depart,\n trip_length,trip_duration,to...
[ "0.60607815", "0.5905817", "0.5816707", "0.54936224", "0.53999996", "0.53608507", "0.5337857", "0.53275985", "0.5279713", "0.5245389", "0.52331084", "0.52224356", "0.51837873", "0.5180322", "0.5174375", "0.51288676", "0.5123644", "0.510983", "0.51059484", "0.5104036", "0.5098...
0.67602295
0
bags the data for the specified participants by sessions. The starting index of each session is defined in session_start and the corresponding labels are defined in session_labels. (X,Y) is the entire dataset.
def single_instances_to_sessions(X, Y, session_labels, session_start, participant_indices): bags = [] labels = [] single_instance_labels = [] for k in participant_indices: for j in range(len(session_labels[k])): if j < len(session_labels[k])-1: end = session_start[k][j+1] else: end = len(X[k]) ba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regroup_dataset(labels):\r\n batch_y = labels.copy()\r\n for i, label in enumerate(labels):\r\n if label in [0, 15, 19]:\r\n batch_y[i]=0\r\n if label in [1, 2, 3, 4, 5,]:\r\n batch_y[i]=1\r\n if label in [...
[ "0.5448921", "0.53773844", "0.5312974", "0.5291654", "0.52719367", "0.52677006", "0.52605337", "0.5203306", "0.51902205", "0.51698947", "0.5103194", "0.50545406", "0.5038974", "0.5037716", "0.50168985", "0.5003415", "0.50015026", "0.4984332", "0.49801752", "0.4976352", "0.494...
0.6738862
0
Read a list of synapse admin events and report changes to user power levels.
def report_admin_events(events): levels = {} # keeps track of user -> level mapping over time show_mutes = False for event in events: (timestamp, sender, event_type, content) = event print(f"\n{timestamp}\t{sender}") # report on users where the prior known level is gone us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _e_list(self, ctx):\n event_list = self.database.get_guild_events(ctx.guild.id)\n if len(event_list) == 0:\n await ctx.send(\"This server has no custom events\")\n return\n out = \"```\\nServer Events:\\n\"\n for event in event_list:\n out += f...
[ "0.595979", "0.5520849", "0.5495647", "0.5478341", "0.53156155", "0.53067887", "0.52975523", "0.5295242", "0.5291212", "0.52869153", "0.5238782", "0.5236966", "0.52195317", "0.5198999", "0.5172369", "0.51485234", "0.51476765", "0.51330614", "0.51263815", "0.5109358", "0.51061...
0.66740656
0
Calculates the time difference abs(date1 date2) between two dates in months. Day is neglected.
def month_diff(date1, date2): # First make sure, that date2 > date1 if date1.daysTo(date2) < 0: date_tmp = date1 date1 = date2 date2 = date_tmp years = date2.year() - date1.year() months = date2.month() - date1.month() if months < 0: years -= 1 months += 12 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diff_month(d1, d2):\n return ceil(abs((d1.year - d2.year) * 12 + d1.month - d2.month))", "def compute_duration(date1, date2):\n duration = 0\n if date1 and date2:\n delta = abs(date1 - date2)\n duration = delta.days * 86400 + delta.seconds\n return duration", "def date_diff_months...
[ "0.6941323", "0.6818145", "0.679008", "0.67421985", "0.6620554", "0.64680517", "0.64635617", "0.64242184", "0.6399711", "0.6364292", "0.60353655", "0.59266156", "0.582229", "0.5665558", "0.5641006", "0.5557162", "0.5533768", "0.55188507", "0.55112755", "0.5487111", "0.5483864...
0.7048405
0
arrival_time = frequency of the exponential distribution related to the arrival time in 1/seconds service_time = deterministic service time in 1/seconds max_time = time of simulation in hour to be converted in seconds in the program
def M_D_1(arrival_time,max_time,service_time=1/90): #conversion in seconds max_seconds = max_time*60*60 sim_time = 0.0 # simulation time t_1 = 0.0 # time for next event (arrival) t_2 = max_seconds # time for next event (departure) t_n = 0.0 #last event time--> tempo dell'ultimo avvenimento gener...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approximate_delivery_time(self):\n # this is set to seconds just of demonstration\n approx_delivery_time = random.randrange(300, 600)\n approx_time_to_main_station = approx_delivery_time / 2\n\n return {\n \"delivery_time\": approx_delivery_time,\n \"time_to_st...
[ "0.623899", "0.62073016", "0.57325894", "0.56798995", "0.5615627", "0.5612654", "0.55865824", "0.5578292", "0.55203074", "0.5509975", "0.5509975", "0.54552954", "0.543938", "0.5385902", "0.53795916", "0.534916", "0.5277093", "0.52733487", "0.5250447", "0.52468187", "0.5239847...
0.69476897
0
This function/filter reads the host_var information provided by Ansible aruba_config module to extract "changed lines"
def aruba_diff(self, host_var): output_list = [] for item in host_var: if type(host_var[item]) is dict: if 'updates' in host_var[item]: if host_var[item]['changed']: update = host_var[item]['updates'] for i i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __analyze_config(self):\n result = {}\n with open(self.file) as f:\n data = f.readlines()\n temp_key = ''\n for line in data:\n if line[0] == '\t' or line[0] == ';':\n result[temp_key].append(line.strip())\n else:\n temp...
[ "0.5730209", "0.56443113", "0.5615085", "0.5516753", "0.54714805", "0.5436443", "0.54273635", "0.53481036", "0.5313529", "0.5283646", "0.52792495", "0.5246545", "0.5220793", "0.5219981", "0.52106386", "0.5179972", "0.51748455", "0.51602554", "0.5153993", "0.5145902", "0.51281...
0.66426724
0
Training step that optimizes the weights provided some batch_size X and Y examples from the dataset.
def train_batch(): X, Y = train_X, train_Y feed_dict = {encoder[t]: X[t] for t in range(len(encoder))} feed_dict.update({labels[t]: Y[t] for t in range(len(labels))}) _, loss_t = sess.run([train_op, loss], feed_dict) return loss_t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self, X, y, batch_size=5, num_epochs=10, alpha=0.1, gamma=0.9, learning=\"Delta\"):\r\n for i in range(num_epochs):\r\n bse = 0 \r\n for j in range(X.shape[1]//batch_size):\r\n x_bs = X[:,bse:bse+batch_size]\r\n y_bs = y[:,bse:bse+batch_size]\r\...
[ "0.77232385", "0.7349785", "0.707549", "0.69327986", "0.69199604", "0.6844348", "0.6836232", "0.68340915", "0.68285096", "0.6825701", "0.6808993", "0.6807454", "0.6770575", "0.6641682", "0.66391444", "0.6622418", "0.6603509", "0.6600248", "0.65747213", "0.6538866", "0.6527656...
0.0
-1
Test step, does NOT optimizes. Weights are frozen by not doing sess.run on the train_op.
def test_batch(): X, Y = test_X, test_Y feed_dict = {encoder[t]: X[t] for t in range(len(encoder))} feed_dict.update({labels[t]: Y[t] for t in range(len(labels))}) loss_t = sess.run([loss], feed_dict) return loss_t[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self._logger = mock_lib.MockBenchmarkLogger()\n\n self.graph = tf.Graph()\n with self.graph.as_default():\n tf.train.create_global_step()\n self.train_op = tf.assign_add(tf.train.get_global_step(), 1)\n self.global_step = tf.train.get_global_...
[ "0.7189777", "0.713235", "0.6868056", "0.6775731", "0.67507005", "0.67205113", "0.66059977", "0.65993184", "0.65889955", "0.65766", "0.6544388", "0.65419114", "0.6527287", "0.6513407", "0.648487", "0.64734393", "0.64699334", "0.6458755", "0.64557123", "0.644801", "0.642417", ...
0.6011905
82
Creates an empty list instance
def __init__(self): self._head = None self._tail = None self._size = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty_list(*args):\n return []", "def __init__(self):\n # Initializing an empty list.\n self.mylist = []", "def new_empty_ll():\n from linked_list import Linked_List\n this_empty_ll = Linked_List()\n return this_empty_ll", "def __noop_list(self, *args, **kwargs):\n return []"...
[ "0.7383587", "0.7302276", "0.72101533", "0.71087044", "0.7041304", "0.7011241", "0.7011241", "0.67002696", "0.66640145", "0.6652877", "0.6644676", "0.6621762", "0.6608354", "0.66006655", "0.654123", "0.65394247", "0.64968204", "0.64968204", "0.64968204", "0.6482919", "0.64398...
0.0
-1
Gets the length of the list
def __len__(self): return self._size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLength(self):\r\n return len(self.list)", "def length(self):\n return self.list.length", "def length(self):\n return self.list.length", "def get_list_length(self):\r\n return self._api.get_list_length()", "def length(self):\n return self.list.length()", "def leng...
[ "0.89645356", "0.88459057", "0.88459057", "0.88405335", "0.8820714", "0.8757057", "0.8654384", "0.8635413", "0.86173993", "0.8571206", "0.8492897", "0.8482033", "0.84651417", "0.84598345", "0.84011644", "0.82260954", "0.82017213", "0.81988937", "0.8151289", "0.810921", "0.810...
0.0
-1
Determines if any target value exists
def __contains__(self, item): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has(self, target):\r\n return target in self.by_target", "def has(self, target):\n return target in self.by_target", "def _ok(self, assignment_graph, source, value, target):\n target_values = assignment_graph[target]\n return len(target_values - set([value])) > 0", "def any(self) ...
[ "0.70388", "0.69756544", "0.6831402", "0.6467504", "0.6203474", "0.6096493", "0.60902774", "0.60739547", "0.6044992", "0.6015043", "0.60087895", "0.59799826", "0.59799826", "0.596468", "0.596468", "0.59619915", "0.59619915", "0.59619915", "0.59619915", "0.59528977", "0.594948...
0.0
-1
Makes the list iterable
def __iter__(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__():", "def __iter__():", "def __iter__():", "def __iter__():", "def __iter__(self):\n return iter(self.to_list())", "def _build_iterable(self):", "def __iter__(self):\n return iter(self.atom_list)", "def __iter__(self):\n raise NotImplementedError(\"__iter__\")", "d...
[ "0.7771175", "0.7771175", "0.7771175", "0.7771175", "0.7748262", "0.7495855", "0.7493199", "0.747693", "0.7387433", "0.7387433", "0.7387433", "0.7387433", "0.7387433", "0.7376672", "0.7362731", "0.73596007", "0.7341213", "0.7341213", "0.73187697", "0.7312031", "0.7312031", ...
0.7373446
19
Gets the current head
def head(self): return self._head
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(self):\r\n return self.__head", "def first(self):\n return self.__head", "def currenthead(self):\n return self.repo.head.object", "def peek(self):\n return self.list.head", "def head(self) -> object:\n if not self._head:\n raise EmptyListException(\"T...
[ "0.80130213", "0.7923789", "0.7821768", "0.75414413", "0.73890346", "0.73000383", "0.7205366", "0.7202247", "0.72009563", "0.71663415", "0.71562153", "0.71256787", "0.710123", "0.7087479", "0.7047039", "0.7027316", "0.7017254", "0.69998443", "0.69862455", "0.69797623", "0.697...
0.85257405
1
Gets the current tail
def tail(self): return self._tail
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tail(self):\n return self._readahead.getvalue()", "def get_tail(self):\n pointer = self.head\n while pointer.next_node:\n pointer = pointer.next_node\n return pointer", "def peek_last(self):\n if self.is_empty(): raise RuntimeError(\"Empty list\")\n ...
[ "0.7987476", "0.75084555", "0.7217858", "0.7078854", "0.70251787", "0.6993961", "0.69410443", "0.6919684", "0.6894651", "0.68824685", "0.6878774", "0.6853597", "0.68393075", "0.67811173", "0.6733288", "0.6732261", "0.6592453", "0.65848786", "0.65684897", "0.6545789", "0.65059...
0.864701
1
Gets the list size
def size(self): return self._size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n return self.list_size", "def get_list_length(self):\r\n return self._api.get_list_length()", "def getSize(self):\r\n list = self.getList()\r\n return len(list)", "def size(self):\n return len(self.__list)", "def getLength(self):\r\n return len(sel...
[ "0.90231985", "0.88729995", "0.8824647", "0.86315054", "0.85967255", "0.85088795", "0.8443649", "0.8432129", "0.8432129", "0.84318507", "0.8413873", "0.83628243", "0.8263652", "0.8254407", "0.8213345", "0.8197529", "0.81928915", "0.81516874", "0.8115379", "0.81023437", "0.807...
0.0
-1
Determines the emptiness of the list
def empty(self): return self._size is 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty(self):\n if len(self.list_x) == 0:\n return True\n else:\n return False", "def filled(self):\n return self.list.count(0) == 0", "def is_empty(self):\n return self.list_size == 0", "def is_empty(self):\n return self.list.length == 0", "def i...
[ "0.80257577", "0.79700047", "0.7873327", "0.78489643", "0.78489643", "0.7747847", "0.7672707", "0.76688343", "0.76248163", "0.7612408", "0.7558429", "0.75444674", "0.74985474", "0.74538016", "0.74538016", "0.7441022", "0.7439793", "0.7433452", "0.7433452", "0.7421738", "0.742...
0.0
-1
Adds a node to the front of the list
def addFront(self, data): new_list = _Node(data) temp = self._head if self._head is None: self._head = new_list self._tail = new_list else: new_list.next = temp new_list.next.prev = new_list self._head = new_list self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push_front(self, item):\n new_node = Node(item)\n # if the list is empty, make it head\n if self.head is None:\n self.head = new_node\n # else, \n else:\n new_node.next = self.head # new node points to current head\n self.head = new_node # c...
[ "0.82249105", "0.7810608", "0.7768546", "0.7768546", "0.7755671", "0.7738799", "0.77328646", "0.7720509", "0.7625948", "0.7588103", "0.75430006", "0.752145", "0.7492182", "0.746664", "0.745477", "0.7394027", "0.7339842", "0.73390335", "0.73347354", "0.728799", "0.7265528", ...
0.7907306
1
Return name of serializer for a model.
def get_serializer_name_by_model(_model): return '{}Serializer'.format(_model.__name__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_name(self) -> str:\n return self._get_string(openvr.Prop_RenderModelName_String)", "def name(self) -> str: # pragma: no cover\n return self.model.__name__", "def get_model_name(self) -> str:\n raise NotImplementedError", "def model_name(self) -> str:\n return self._...
[ "0.6780367", "0.6774362", "0.66296005", "0.6629534", "0.657652", "0.6532302", "0.65118784", "0.6496903", "0.64815027", "0.639073", "0.63782823", "0.63662857", "0.62982553", "0.6294734", "0.6262839", "0.6249802", "0.6196127", "0.6195564", "0.6152502", "0.6151185", "0.6149466",...
0.9127496
0
Supervised Learning of Universal Sentence Representations from Natural Language Inference Data
def forward(self, source_sentences, target_sentences): u = self.encoder(source_sentences) v = self.encoder(target_sentences) features = torch.cat((u, v, torch.abs(u - v), u * v), 1) return self.classifier(features)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_sentences(self, sents):\n tkw=self.tkw\n sents_attr=[]\n sent_samples={\n \"word_inputs\":[],\n \"predicate_inputs\":[],\n \"postags_inputs\":[]\n }\n print('prepare data')\n for sid,sent in enumerate(sents):\n if sid...
[ "0.6346211", "0.63405776", "0.6338936", "0.63327533", "0.62454486", "0.6228956", "0.6184826", "0.618037", "0.617182", "0.61669314", "0.61542684", "0.61505806", "0.61445844", "0.61279905", "0.6127771", "0.61258423", "0.61200845", "0.6100256", "0.60922563", "0.60849583", "0.608...
0.0
-1
A text classification network made w/ the goal of creating sentence embeddings.
def forward(self, source_sentences): return self.classifier(self.encode(source_sentences))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classify(text):\n # TODO Wonder if there's a better way of doing this so the model persists across fucn calls. Will see once I get\n # Heroku running\n\n sentences = sent_tokenize(text)\n clean_sentences = list(map(clean_text, sentences))\n word_tokenizer = BertTokenizerFast.from_pretrained('be...
[ "0.7100394", "0.6748437", "0.65471923", "0.6498375", "0.6481639", "0.64756286", "0.64739716", "0.64437383", "0.6409879", "0.6400079", "0.63984555", "0.6376186", "0.63573384", "0.63420796", "0.63091457", "0.6302174", "0.6277894", "0.6258807", "0.6257803", "0.6256364", "0.62519...
0.0
-1
Verify that we can respect all the documented containers names possible
def test_object_names_container(sdc_builder, sdc_executor, azure, container_name_category, index): container_name = container_name_category event_hub_name = get_random_string(string.ascii_lowercase, 10) builder = sdc_builder.get_pipeline_builder() azure_iot_event_hub_consumer = builder.add_stage(name=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validateName(name):\n return name in [container.name for container in DOCKER_CLIENT.containers.list()]", "def test_basic(self):\n self.check_4_way('container', 'pod')", "def test_index_containers(self):\n pass", "def test_containers(self):\n\n message = {\"method\": \"containers\"...
[ "0.6736741", "0.6729749", "0.60338986", "0.59777915", "0.5967935", "0.59532505", "0.5937677", "0.5929508", "0.58507514", "0.5833313", "0.58174473", "0.57982504", "0.5780771", "0.57688516", "0.5733226", "0.5706515", "0.5678251", "0.5677904", "0.5676172", "0.5647392", "0.562660...
0.0
-1
Verify that we can respect all the documented containers names possible
def test_object_names_blob(sdc_builder, sdc_executor, azure, blob_name_category, index): container_name = get_random_string(string.ascii_lowercase, 10) event_hub_name = blob_name_category builder = sdc_builder.get_pipeline_builder() azure_iot_event_hub_consumer = builder.add_stage(name=AZURE_IOT_EVENT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validateName(name):\n return name in [container.name for container in DOCKER_CLIENT.containers.list()]", "def test_basic(self):\n self.check_4_way('container', 'pod')", "def test_index_containers(self):\n pass", "def test_containers(self):\n\n message = {\"method\": \"containers\"...
[ "0.67369556", "0.67299783", "0.60355276", "0.5980367", "0.5968923", "0.5954608", "0.5939962", "0.59322596", "0.5850188", "0.5835206", "0.58177173", "0.5800159", "0.57798576", "0.57688797", "0.57336664", "0.57085073", "0.56805813", "0.5678986", "0.5676663", "0.56491464", "0.56...
0.0
-1
Test read multiple batches.
def test_multiple_batch(sdc_builder, sdc_executor, azure, number_batches): container_name = get_random_string(string.ascii_lowercase, 10) event_hub_name = get_random_string(string.ascii_lowercase, 10) number_records = 1000 builder = sdc_builder.get_pipeline_builder() azure_iot_event_hub_consumer ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_batch(self):\n pass", "def test_batch_read_all_bins_pos(self):\n\n b = br.Read((\"test\", \"demo\", 1), ops=None, read_all_bins=True)\n\n assert b.read_all_bins", "def test_block_missing_batch(self):\n pass", "def test_block_batches_order(self):\n pass", "def tes...
[ "0.7609623", "0.6662145", "0.6534062", "0.6469143", "0.63781834", "0.63687474", "0.633586", "0.63011676", "0.6233108", "0.622242", "0.6204284", "0.619079", "0.61579096", "0.61227316", "0.60985446", "0.6091486", "0.6060122", "0.6053497", "0.6049608", "0.6037472", "0.6037338", ...
0.6025853
23
Test Azure EventHub origin parses Binary in a variety of data types.
def test_data_format_binary(sdc_builder, sdc_executor, azure): container_name = get_random_string(string.ascii_lowercase, 10) event_hub_name = get_random_string(string.ascii_lowercase, 10) MESSAGES = [b'message 1', b'message 2'] EXPECTED_OUTPUT = "[b'message 1', b'message 2']" builder = sdc_builde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_bytes(self, ???):", "def test_bin_data_type(self):\n\n with pytest.raises(TypeError) as verr:\n avg.median2D(self.testInst, ['1', 'a', '23', '10'], 'longitude',\n ['0', 'd', '24', 'c'], 'mlt',\n ['dummy1', 'dummy2', 'dummy3'], auto_bin=Fa...
[ "0.6008974", "0.59854835", "0.5940457", "0.5918118", "0.5896898", "0.5895602", "0.5882247", "0.58684736", "0.58602846", "0.58145744", "0.5814127", "0.57945067", "0.5786584", "0.57704145", "0.57686555", "0.57686555", "0.57686555", "0.57686555", "0.57686555", "0.57686555", "0.5...
0.6982023
0
Azure EventHub origin parses JSON in a variety of data types.
def test_data_format_json(sdc_builder, sdc_executor, azure, data_type): container_name = get_random_string(string.ascii_lowercase, 10) event_hub_name = get_random_string(string.ascii_lowercase, 10) # We map data_type to input data as well as the expected output. DATA_TYPE = {'ARRAY': ['Alex', 'Xavi'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_event_payload(event):\n payload_key = 'event' if 'event' in event else 'data'\n if payload_key in event and isinstance(event[payload_key], str):\n event = event.copy()\n try:\n event[payload_key] = json.loads(event[payload_key])\n except ValueError:\n pass...
[ "0.6673187", "0.6324516", "0.62787443", "0.62350726", "0.6046042", "0.5893333", "0.58861136", "0.5836435", "0.5807699", "0.5807676", "0.58076185", "0.58072615", "0.5800543", "0.58004636", "0.57962376", "0.5793326", "0.5781644", "0.57799", "0.57798296", "0.5779329", "0.5742935...
0.5784067
16
Azure EventHub origin parses Text in a variety of data types.
def test_data_format_text(sdc_builder, sdc_executor, azure): container_name = get_random_string(string.ascii_lowercase, 10) event_hub_name = get_random_string(string.ascii_lowercase, 10) MESSAGE = 'Hello World!' EXPECTED = {'text': 'Hello World!'} builder = sdc_builder.get_pipeline_builder() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_textAsEvent(self):\n self.assertEquals(\n textAsEvent(u\"Hello, World!\"),\n b\"data: Hello, World!\\n\\n\"\n )", "def parse_string(self, data):\n pass", "def from_text(cls, text):\n raw = json.loads(text)\n event_msg = EventMessage.from_text(ra...
[ "0.6361389", "0.61759293", "0.61751777", "0.6019956", "0.5999681", "0.5953749", "0.59506565", "0.59049666", "0.577963", "0.5729194", "0.5720689", "0.55496836", "0.5544985", "0.5542114", "0.5516061", "0.5498533", "0.54913414", "0.5472944", "0.54333293", "0.5430793", "0.5406387...
0.5179421
46
Create and return a Azure EventHub origin stage depending on execution mode for the pipeline.
def _get_azure_eventhub_consumer_stage(builder, container_name, event_hub_name, data_format): azure_iot_event_hub_consumer = builder.add_stage(name=AZURE_IOT_EVENT_HUB_STAGE_NAME).set_attributes( container_name=container_name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_event(trigger, event):\n\n if trigger == \"eval\":\n print(\"Triggered by Invoke\")\n\n # event is the pipeline, provide consistent pipeline defaults\n pipeline = default_pipeline(event)\n\n return pipeline\n\n elif trigger == \"S3\":\n print(\"Triggered from S3\"...
[ "0.52332556", "0.5193338", "0.5114489", "0.50379026", "0.4959821", "0.48886234", "0.4858949", "0.48461798", "0.4842308", "0.4800151", "0.4778661", "0.47242874", "0.47108313", "0.4688939", "0.4656326", "0.46418527", "0.46377864", "0.45985177", "0.45866713", "0.45585388", "0.45...
0.62307066
0
Test that using multithreaded pipeline we can start our pipeline multiple times adding more objects in between without reading any duplicated record neither missing them.
def test_multithreading(sdc_builder, sdc_executor, azure, max_threads): container_name = get_random_string(string.ascii_lowercase, 10) event_hub_name = get_random_string(string.ascii_lowercase, 10) builder = sdc_builder.get_pipeline_builder() azure_iot_event_hub_consumer = builder.add_stage(name=AZURE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def producer(pipeline):\n\n for index, iteration in enumerate(range(10)):\n obj = random.randint(1, 101)\n logging.info(\"Producer %s: produced object %s\", index, obj)\n logging.debug(\"Producer %s: about to acquire lock\", index)\n pipeline._lock.acquire()\n pipeline.shift(o...
[ "0.62404513", "0.61196893", "0.607896", "0.607896", "0.605554", "0.60008496", "0.5892256", "0.587391", "0.5838322", "0.5835361", "0.583378", "0.5813028", "0.57524157", "0.5748982", "0.57474613", "0.5741296", "0.5739111", "0.5707681", "0.57005924", "0.5679863", "0.56795543", ...
0.52362895
91
Test that we can start our pipeline multiple times without reading any duplicated record neither missing them.
def test_resume_offset(sdc_builder, sdc_executor, azure): container_name = get_random_string(string.ascii_lowercase, 10) event_hub_name = get_random_string(string.ascii_lowercase, 10) builder = sdc_builder.get_pipeline_builder() azure_iot_event_hub_consumer = builder.add_stage(name=AZURE_IOT_EVENT_HUB...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_duplicate_entries(self):", "def test_getting_state_parallel(self):\n no_replicates = 25\n replicate(experiment2, no_replicates, parallel=True, no_processes=2)\n for i in range(no_replicates):\n self.assertNotIn(SUBSTATE_KEY_PATTERN % i + '.result', state)", "def test_mo...
[ "0.6436138", "0.6180809", "0.61560345", "0.6148749", "0.6031402", "0.6030519", "0.59612024", "0.5926448", "0.5896942", "0.58900166", "0.58820057", "0.58755946", "0.5870928", "0.5866555", "0.584371", "0.58427185", "0.58296657", "0.58072215", "0.5799708", "0.5777461", "0.577661...
0.0
-1
Test whether we can add a landing page to campaign.
def testAddLandingPageToCampaign(self): if self.__class__.campaign1 is None: self.testSaveCampaign() landing_page = { 'id': '-1', 'url': 'http://www.example.com', 'name': 'Landing page #%s' % Utils.GetUniqueName() } self.assert_(isinstance(self.__class__.service.AddLandingP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available(self):\n existing_url = self.context.get_personal_fundraising_campaign_url()\n same = existing_url == self.context.absolute_url()\n creating = 'create-personal-campaign-page' in self.request.URL\n return not same and not creating", "def testGetLandingPagesForCampaign(sel...
[ "0.7193204", "0.6475577", "0.63865", "0.6113079", "0.5993139", "0.5958102", "0.58199036", "0.5775793", "0.57187057", "0.56757647", "0.56338835", "0.5573666", "0.5542688", "0.55141956", "0.5502747", "0.5437384", "0.5427393", "0.5408094", "0.5405026", "0.539166", "0.5384252", ...
0.6654128
1
Test whether we can copy campaigns.
def testCopyCampaigns(self): if self.__class__.campaign1 is None: self.testSaveCampaign() requests = [{ 'campaignId': self.__class__.campaign1['id'] }] self.assert_(isinstance(self.__class__.service.CopyCampaigns(requests), tuple))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def canShare(self):\n return False", "def CanCopy(self):\n return self.HasSelection()", "def can_be_collected(self):\n return True", "def canCreateCaddyManip(*args, **kwargs)->bool:\n pass", "def _copyDataSetsForExperiment(self):\n\n # Copy all tubes - if they could not be co...
[ "0.60453284", "0.5922676", "0.5760109", "0.5710391", "0.5692238", "0.5674369", "0.56590486", "0.553042", "0.54061353", "0.5337865", "0.5293677", "0.5285584", "0.5263262", "0.52472526", "0.52441347", "0.52295303", "0.52201074", "0.5219359", "0.52088076", "0.520511", "0.5189243...
0.7094511
0
Test whether we can delete a campaign.
def testDeleteCampaign(self): if self.__class__.campaign2 is None: self.testSaveCampaign() self.assertEqual(self.__class__.service.DeleteCampaign( self.__class__.campaign2['id']), None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_campaign_by_admin_passes(self):\n response = self.client.delete(\n f\"{self.endpoint_url}{self.test_campaign.id}/\",\n headers={\"Authorization\": self.admin_token},\n )\n response_body = response.get_json()\n self.assertEqual(response.status_code, ...
[ "0.7160737", "0.6712778", "0.66537017", "0.6412838", "0.6403892", "0.6248027", "0.62260723", "0.6173202", "0.61620015", "0.61620015", "0.6158001", "0.6153437", "0.61174256", "0.61138195", "0.60950786", "0.606821", "0.60502833", "0.60258365", "0.59846985", "0.59573454", "0.591...
0.6538772
3
Test whether we can fetch a campaign.
def testGetCampaign(self): if self.__class__.campaign1 is None: self.testSaveCampaign() self.assert_(isinstance(self.__class__.service.GetCampaign( self.__class__.campaign1['id']), tuple))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_if_can_fetch(self, url, useragent=\"*\"):\n logger.debug(\"Checking if can fetch %s\" % url)\n return self.rp.can_fetch(useragent=useragent, url=url)", "def can_fetch(self, agent, url):\n if not url.startswith(self.base_url):\n url = urljoin(self.base_url, url)\n ...
[ "0.6951294", "0.66682565", "0.6388986", "0.6277096", "0.6162821", "0.6039939", "0.5521341", "0.5516752", "0.5443673", "0.5427626", "0.53725314", "0.5343013", "0.53338003", "0.53287655", "0.5325066", "0.5308681", "0.5290137", "0.5257859", "0.52291495", "0.52203906", "0.5171033...
0.61979556
4
Test whether we can fetch campaigns by criteria.
def testGetCampaignsByCriteria(self): criteria = { 'archiveFilter': { 'inactiveOnly': 'true' } } self.assert_(isinstance(self.__class__.service.GetCampaignsByCriteria( criteria), tuple))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_existent_campaigns_returns_campaigns_list(self):\n test_campaign = return_canned_campaign()\n test_campaign.create()\n response = self.client.get(self.endpoint_url)\n response_body = response.get_json()\n self.assertEqual(response.status_code, 200)\n self.asse...
[ "0.6126352", "0.60831", "0.5854207", "0.5814784", "0.5765778", "0.5627458", "0.5505774", "0.54764736", "0.5463633", "0.53875184", "0.5286463", "0.5152078", "0.51443475", "0.51261663", "0.509484", "0.50877887", "0.5074913", "0.50539947", "0.50416815", "0.50400865", "0.5023619"...
0.6735202
0
Test whether we can fetch landing pages for a campaign.
def testGetLandingPagesForCampaign(self): if self.__class__.campaign1 is None: self.testSaveCampaign() self.assert_(isinstance(self.__class__.service.GetLandingPagesForCampaign( self.__class__.campaign1['id']), tuple))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available(self):\n existing_url = self.context.get_personal_fundraising_campaign_url()\n same = existing_url == self.context.absolute_url()\n creating = 'create-personal-campaign-page' in self.request.URL\n return not same and not creating", "def test_contact_landing_success(self)...
[ "0.67742693", "0.6306628", "0.62808394", "0.6120006", "0.59452415", "0.57627016", "0.5738992", "0.5561723", "0.5556827", "0.55112934", "0.54937756", "0.54576766", "0.5449263", "0.542853", "0.54040414", "0.53753954", "0.53047925", "0.53038776", "0.5275955", "0.5274629", "0.526...
0.67377996
1
Test whether we can create a campaign.
def testSaveCampaign(self): self.testSaveLandingPage() dt = datetime.datetime.now() campaign = { 'advertiserId': self.__class__.advertiser_id, 'archived': 'false', 'name': 'Campaign #%s' % Utils.GetUniqueName(), 'defaultLandingPageId': self.__class__.landing_page_id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_campaign(self):\n campaign = self.campaign\n\n self.assertTrue(isinstance(campaign, Campaign))\n self.assertEqual(campaign.name, \"Test Campaign\")", "def test_create_already_existing_campaign_fails(self):\n test_campaign = return_canned_campaign()\n self.test_o...
[ "0.7282776", "0.6861378", "0.6769927", "0.6562641", "0.6446506", "0.64025927", "0.63065374", "0.62620866", "0.61669487", "0.61126655", "0.6082157", "0.60696846", "0.60404605", "0.5802044", "0.5785592", "0.5767152", "0.5753982", "0.5717169", "0.5715338", "0.5704595", "0.567379...
0.52247524
54
Test whether we can create a landing page.
def testSaveLandingPage(self): landing_page = { 'url': 'http://www.example.com', 'name': 'Landing page #%s' % Utils.GetUniqueName() } landing_page = self.__class__.service.SaveLandingPage(landing_page) self.__class__.landing_page_id = landing_page[0]['id'] self.assert_(isinstance(lan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_landing_page(self):\n # Create a test client\n client = server.app.test_client()\n\n # Use the test client to make requests\n result = client.get('/', follow_redirects=True)\n\n # Compare result.data with assert method\n self.assertIn(b'<p class=\"navbar-text\">Al...
[ "0.6737651", "0.6642092", "0.6532604", "0.63541234", "0.63539374", "0.62464356", "0.62459445", "0.62454194", "0.62132585", "0.62077016", "0.618775", "0.6178662", "0.61785996", "0.61771363", "0.6166073", "0.6118469", "0.6086317", "0.60613596", "0.60205966", "0.59654224", "0.59...
0.0
-1
Updating of product qty
def ProcessOrder(product_id): product = Product.query.filter_by(product_id = product_id) if (product): product.qty = product db.session.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, product, qty):\n product_id = str(product)\n if product_id in self.basket:\n self.basket[product_id]['qty'] = qty\n self.save()", "def update(self, product, qty):\n product_id = str(product)\n if product_id in self.cart:\n self.cart[produc...
[ "0.82021457", "0.7991138", "0.73357517", "0.7190872", "0.71537274", "0.6928786", "0.68572164", "0.68549824", "0.67613435", "0.6734073", "0.668889", "0.6671283", "0.6603879", "0.65982896", "0.65982896", "0.6587045", "0.65754604", "0.65699196", "0.65018183", "0.6474085", "0.645...
0.66913927
10
Render home page of the site
def homepage(): return render_template("home/index.html", title="Welcome")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template('home_page.html')", "def home():\n return render_template('homepage.html')", "def homepage():\n return render_template(\"home/index.html\")", "def homepage():\n return render_template('home/...
[ "0.8892464", "0.8681746", "0.868129", "0.85841256", "0.8567517", "0.8564356", "0.8539393", "0.8536602", "0.8536602", "0.8527715", "0.85203385", "0.8516136", "0.8516136", "0.8516136", "0.8516136", "0.8516136", "0.8516136", "0.8516136", "0.8516136", "0.8516136", "0.8516136", ...
0.85693485
4
Render landing page after successfull login
def dashboard(): return render_template("home/dashboard.html", title="Dashboard")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def landing():\n if g.user:\n return render_template('landing.html', user=g.user)\n return redirect(url_for('login'))", "def index(self):\n\n # try and pull the user's data\n user = get_active_user_data()\n\n if not user:\n # they are not logged in give them the login...
[ "0.81607425", "0.7835049", "0.7612851", "0.759617", "0.75545955", "0.75486267", "0.7532583", "0.7532583", "0.7517395", "0.74704564", "0.7379486", "0.7360537", "0.7352043", "0.73301697", "0.7329643", "0.7309229", "0.729956", "0.728683", "0.7285191", "0.727541", "0.7249322", ...
0.0
-1
To render admin dashboard
def admin_dashboard(): if current_user.is_admin: return render_template("home/admin_dashboard.html", title="Admin Dashboard") abort(403)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dashboard():\n return render_template(\"admin/dashboard.html\", title=\"Dashboard\")", "def show_admin():\n return render_admin_page(\"admin.html\")", "def admin():\n return Response(render_template('admin.html'))", "def dashboard():", "def index(self):\n return self.render(\"admin/inde...
[ "0.8648089", "0.8191513", "0.80940354", "0.7911078", "0.7859473", "0.7806951", "0.77863497", "0.7742015", "0.7731237", "0.75979704", "0.7586668", "0.75291425", "0.7436194", "0.7365606", "0.7362157", "0.73533463", "0.7312894", "0.725193", "0.7224566", "0.7199894", "0.7161485",...
0.82224727
1
Display name of the DNS Zone.
def display_name(self) -> Optional[str]: return pulumi.get(self, "display_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zone_name(self):\n return self._zone_name", "def name(self):\n return f\"{self.zone_name} {self.zone_variable}\"", "def name(self) -> str | None:\n if self.zone.GroupName is not None:\n return self.zone.GroupName\n\n return self.zone.Name", "def name(self) -> str:\n...
[ "0.76426804", "0.74550986", "0.7064773", "0.6893803", "0.68507403", "0.6842008", "0.6833507", "0.6787723", "0.6689961", "0.6662626", "0.66411114", "0.65904385", "0.65904385", "0.65896606", "0.65858406", "0.65848696", "0.6580685", "0.6498563", "0.6498563", "0.6498563", "0.6498...
0.6087911
72
DNS Server IP array of the DNS Zone.
def dns_server_ips(self) -> Optional[Sequence[str]]: return pulumi.get(self, "dns_server_ips")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ip_addresses(self):\n try:\n return socket.gethostbyaddr(self.fqdn)[-1]\n except socket.error as _:\n return ['127.0.0.1']", "def get_server_ip(self, server_id):\n interface_list = self.get_server_ip_mac(server_id)\n if not isinstance(interface_list, list):\n...
[ "0.6982518", "0.6663064", "0.6639232", "0.6582995", "0.65587693", "0.64883596", "0.64526194", "0.6438488", "0.6390472", "0.6310422", "0.6257167", "0.6109224", "0.60959417", "0.60855275", "0.6008593", "0.5972465", "0.5970295", "0.59657687", "0.59450984", "0.5930674", "0.59133"...
0.7367935
0
Number of DNS Services using the DNS zone.
def dns_services(self) -> Optional[float]: return pulumi.get(self, "dns_services")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_servos(self) -> int:\n return self._num_servos", "def service_count(self) -> str:\n return pulumi.get(self, \"service_count\")", "def get_new_service_num(route53_zone, service_name):\n\n # Match records belonging to the service for particular service and\n # environment.\n match_...
[ "0.6881554", "0.65291023", "0.6471647", "0.63960993", "0.62855804", "0.6134902", "0.61287624", "0.60777795", "0.600986", "0.60090524", "0.6004223", "0.5980317", "0.5954924", "0.5919003", "0.58260965", "0.581609", "0.58124703", "0.5804332", "0.579322", "0.5773976", "0.5755711"...
0.6778599
1
Domain names of the DNS Zone.
def domain(self) -> Optional[Sequence[str]]: return pulumi.get(self, "domain")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_domain_names(self) -> Dict:\n pass", "def list_domain_names():\n pass", "def zone_names(domain):\n fragments = domain.split('.')\n return ['.'.join(fragments[i:]) for i in range(0, len(fragments))]", "def get_dns_list(self):\n return self.get_ipv4_dns_list()", "def list_zone...
[ "0.8048088", "0.7856697", "0.7513482", "0.74956244", "0.74465716", "0.73392856", "0.7316214", "0.72221154", "0.72098655", "0.7192537", "0.7182453", "0.7060481", "0.7050362", "0.7015216", "0.6959108", "0.6945479", "0.6894981", "0.6887697", "0.68169963", "0.6804438", "0.6753850...
0.6229096
59
Source IP of the DNS Zone.
def source_ip(self) -> Optional[str]: return pulumi.get(self, "source_ip")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSourceIp(self):\n return self.__sourceIp", "def getOriginIp(self):\n return self.originIp", "def public_ip_source(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"public_ip_source\")", "def address(self):\n \n return self.__ip", "def ip_address(self) ...
[ "0.73396534", "0.6806294", "0.6775697", "0.6729144", "0.669053", "0.66422296", "0.66422296", "0.66401964", "0.6604399", "0.6597317", "0.65907013", "0.6536555", "0.6487871", "0.6486956", "0.64785546", "0.64755166", "0.64685756", "0.6462598", "0.6390518", "0.6390518", "0.638882...
0.752894
0
Function takes in an input of a specific xml string with surrounding instructions tags and returns a valid html string.
def test_get_instructions(self): xmltree = etree.fromstring(self.sample_xml) expected_xml = "<div><p>Helper Test Instructions.</p></div>" actual_xml = get_instructions(xmltree) assert actual_xml is not None assert expected_xml.strip() == actual_xml.strip() xmltree = etr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xml(string, token=[WORD, POS, CHUNK, PNP, REL, ANCHOR, LEMMA]):\n return Text(string, token).xml", "def html(input):\n output=atpic.cleaner_alex.clean(input)\n return output", "def get_html(self):\r\n # TODO: why are there nested html tags here?? Why are there html tags at all, in fact?\r\...
[ "0.617261", "0.6098834", "0.5746285", "0.5708064", "0.56590945", "0.55680555", "0.5534447", "0.55276144", "0.5519618", "0.5502098", "0.5476914", "0.5361028", "0.5359617", "0.5358282", "0.53365433", "0.5336395", "0.5330039", "0.5326488", "0.5319277", "0.53137803", "0.53066504"...
0.5628138
5
Tests whether given a url if the video will return a youtube source or extension
def test_get_extension(self): expectedyoutube = 'video/youtube' expectednotyoutube = 'video/mp4' result1 = get_extension(self.sample_sourceurl) result2 = get_extension(self.sample_youtubeurl) assert expectedyoutube == result2 assert expectednotyoutube == result1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isYouTube(self):\n if 'youtube' in self.link.split('.'):\n return True\n return None", "def check_url(url=None, parse_url=None):\n \n if not parse_url:\n if url:\n parse_url = urlparse.urlparse(url)\n \n #yt_domains = ['youtube.com', 'youtube-n...
[ "0.788234", "0.7384367", "0.72096467", "0.7126284", "0.6865806", "0.67937374", "0.6791887", "0.67800224", "0.67411244", "0.6726512", "0.6726139", "0.660549", "0.65651995", "0.65489876", "0.65404326", "0.65394735", "0.6538381", "0.6473086", "0.6471275", "0.6445513", "0.6442236...
0.67213124
11
Run the main functionality of the program
def main(): db_config_params = config.get_db_config('psql') print(f'Connecting to {db_config_params["database"]} database.') try: # Will commit and close the connection with psycopg2.connect(**db_config_params) as connection: with connection.cursor() as cursor: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n run_program()", "def run():\n main()", "def main():\n print(\"is Running!\")", "def main():\n return", "def main():\n\n BASIC.run(PROGRAM)", "def main():\n pass", "def run_main():\n main(sys.argv)", "def main():\n print(\"Call your main application code here\")...
[ "0.8905815", "0.8603472", "0.82622087", "0.82094646", "0.8201298", "0.81621265", "0.8152863", "0.80915654", "0.80915654", "0.80915654", "0.80447954", "0.8030121", "0.80230725", "0.80230725", "0.80230725", "0.80230725", "0.80230725", "0.80230725", "0.80230725", "0.80230725", "...
0.0
-1
The main entrypoint of the resume web application.
def home(): now_dt = dt.datetime.now() return render_template( 'resume/home.html', age=relativedelta(now_dt, dt.datetime(day=19, month=3, year=1983)).years, current_year=now_dt.year, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resume():\n return render_template('/resume.html')", "def startapp():", "def main():\n print(\"def main\")\n return APP.run()", "def main():\n app = App()\n app.run()", "def main():\n\n # this part of the program opens student txt resume and detects key info\n\n # sets the name of resu...
[ "0.6950655", "0.65195596", "0.64208555", "0.64051366", "0.6387563", "0.6358651", "0.6345297", "0.63428", "0.6320092", "0.63030446", "0.6287019", "0.62853336", "0.6278611", "0.6262163", "0.62319463", "0.6134304", "0.6091628", "0.60407025", "0.60370904", "0.60318667", "0.603186...
0.0
-1
The main entrypoint of the resume web application.
def details(): now_dt = dt.datetime.now() return render_template( 'resume/home.html', age=relativedelta(now_dt, dt.datetime(day=19, month=3, year=1983)).years, current_year=now_dt.year, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resume():\n return render_template('/resume.html')", "def startapp():", "def main():\n print(\"def main\")\n return APP.run()", "def main():\n app = App()\n app.run()", "def main():\n\n # this part of the program opens student txt resume and detects key info\n\n # sets the name of resu...
[ "0.6950586", "0.6519517", "0.6420699", "0.6405276", "0.6387574", "0.635867", "0.63456076", "0.63422334", "0.6320472", "0.6303545", "0.6287705", "0.6285776", "0.62785864", "0.62617797", "0.62316823", "0.61350286", "0.6092063", "0.6040754", "0.6037207", "0.6031369", "0.6031369"...
0.0
-1
The main entrypoint of the resume web application.
def download(): now_dt = dt.datetime.now() return render_template( 'resume/home.html', age=relativedelta(now_dt, dt.datetime(day=19, month=3, year=1983)).years, current_year=now_dt.year, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resume():\n return render_template('/resume.html')", "def startapp():", "def main():\n print(\"def main\")\n return APP.run()", "def main():\n app = App()\n app.run()", "def main():\n\n # this part of the program opens student txt resume and detects key info\n\n # sets the name of resu...
[ "0.6950586", "0.6519517", "0.6420699", "0.6405276", "0.6387574", "0.635867", "0.63456076", "0.63422334", "0.6320472", "0.6303545", "0.6287705", "0.6285776", "0.62785864", "0.62617797", "0.62316823", "0.61350286", "0.6092063", "0.6040754", "0.6037207", "0.6031369", "0.6031369"...
0.0
-1
Creates a text file which contains a short summary of the dataset_dict data
def write_analysis(path, dataset_dict, datasettype, mask_part, start_time, supervised=True): for mask_el in mask_part: if mask_el == 'podocytes': filename = datasettype + '_podos.txt' filestr = 'podos images' elif mask_el == 'glomerulus': filename = datasettype + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_simple_report(final_dictionary):\n otpt = open('multifind_simple_summary.txt', 'w')\n for cat in final_dictionary:\n category_name = cat[0]\n category_cont = str(len(cat[1]))\n otpt.write(category_name + ' ')\n otpt.write(category_cont + '\\n')\n otpt.close()", "...
[ "0.72692883", "0.70404285", "0.65547776", "0.6458474", "0.64352334", "0.631799", "0.6294561", "0.62730587", "0.6229788", "0.62266004", "0.61721945", "0.60947776", "0.6037688", "0.60162705", "0.59921813", "0.5952756", "0.5932814", "0.59305197", "0.5919714", "0.59086657", "0.58...
0.5494341
65
Creates a pandas dataframe containing the analysis of mask and prediction
def write_dataframe(path, dataset_dict, image_list, datasettype, mask_part): for mask_el in mask_part: titles = [] for i in range(len(image_list)): # Get rid of .tif and the path before image_name = os.path.split(image_list[i])[1] titles.append(image_name[:-4]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prediction_features(prediction_data: pd.DataFrame):\n return pd.get_dummies(\n prediction_data.drop(columns=[\"outstanding_balance\", \"status\", \"account_no\"])\n )", "def get_srs_features(df):\n\n #test result classified by labels\n li = df.TestResultsCode.tolist()\n labels = [ item...
[ "0.58400506", "0.58308923", "0.57699585", "0.56826246", "0.56474906", "0.5641397", "0.5617641", "0.556883", "0.5511037", "0.5510878", "0.54680425", "0.54326487", "0.5415884", "0.5394611", "0.5394532", "0.5381576", "0.5379836", "0.53677845", "0.53350216", "0.53309435", "0.5330...
0.0
-1
Creates the csv output which will be used for the classification. Dataframe contains optionally the WT1 signal of the glomerulus prediction, the DACH1 signal for the podocoyte prediction and the stereological calculations.
def write_readouts(path, dataset_dict, image_list, datasettype, mask_part, do_wt1_signal, do_dach1_signal, do_stereology_pred, do_stereology_gt): titles = [] for i in range(len(image_list)): image_name = os.path.split(image_list[i])[1] titles.append(image_name[:-4]) # Se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __create_output_csv(self, df, score_list, elapsed_list):\n df['Similar']=score_list\n df['Elapsed']=elapsed_list\n df.to_csv('Output.csv',index=False)\n return df", "def create_model_csv(self):\n\n self.model_df.to_csv(self.model_output_file)", "def classification_report(...
[ "0.6866416", "0.67374027", "0.6438249", "0.6316223", "0.6306237", "0.6122821", "0.6075931", "0.6042094", "0.6034793", "0.6025147", "0.60183454", "0.6013684", "0.5995917", "0.5989906", "0.5972817", "0.59266", "0.5921068", "0.5904744", "0.5889595", "0.5854905", "0.58439815", ...
0.0
-1
As a general rule you should ensure there's an appropriate index for the field provided in ordering. allow_count (default False) indicates whether or not to allow count queries that can be extremely expensive on large and fast changing datasets. allow_empty_first_page and orphans are currently ignored and only exist to...
def __init__( self, queryset, per_page=25, ordering="pk", allow_count=False, allow_empty_first_page=True, orphans=0, ): self.queryset = queryset self.per_page = int(per_page) self.ordering = ordering self.allow_count = allow_cou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_paginate(operation_name=None):\n pass", "def can_paginate(operation_name=None):\n pass", "def can_paginate(operation_name=None):\n pass", "def can_paginate(operation_name=None):\n pass", "def can_paginate(operation_name=None):\n pass", "def can_paginate(operation_name=None):\n p...
[ "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.5470511", "0.54211426", "0.52824336", "0.52025956", "0.52025956",...
0.6878338
0
Counting the number of items is expensive, so by default it's not supported and None will be returned.
def count(self): return self.queryset.count() if self.allow_count else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self) -> Optional[int]:\n return pulumi.get(self, \"count\")", "def count(self) -> Optional[int]:\n return pulumi.get(self, \"count\")", "def count(item):\n return len(item)", "def available(self):\n if self._count is not None:\n # If count is available, use it\n ...
[ "0.7429864", "0.7429864", "0.73906094", "0.73351336", "0.7263295", "0.71967214", "0.71967214", "0.71967214", "0.71967214", "0.719134", "0.71839863", "0.71584815", "0.7121969", "0.7038985", "0.6984783", "0.6984783", "0.6984783", "0.6984783", "0.6984783", "0.6984783", "0.698478...
0.69155455
29
Attempt to fetch usage data from Xfinity.
def get_usage_data(username, password): usage_req = XfinityUsage(username, password, browser_name="firefox-headless") return usage_req.run()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getUsageInfo(self):\n return self.jsonRequest(\"/api/v1/usage\", { \"apiKey\": self._apiKey })", "def _fetch_data(self):\n pass", "def test_mock_datasource_usages(self):\n account1 = self.test_data.accounts[0]\n meter = account1.meters[0]\n usage = meter.usages[0]\n ...
[ "0.65825534", "0.6223947", "0.6160463", "0.6084775", "0.6011586", "0.5991422", "0.5960606", "0.5794058", "0.5778082", "0.57704514", "0.57532215", "0.5739064", "0.5734715", "0.5715392", "0.56156725", "0.5563081", "0.55498004", "0.5534532", "0.5509536", "0.55004823", "0.5500482...
0.68384093
0
Parses usage data from `get_usage_data` into a simplified dictionary.
def parse_usage_data(usage_data): try: used = float(usage_data["used"]) total = float(usage_data["total"]) units = usage_data["units"] except KeyError: raise RuntimeError("Missing usage field") except ValueError: raise RuntimeError("Invalid float for usage") try:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_usage_data(self):\n with self._lock:\n data_copy = self._data.copy()\n return data_copy", "def getUsageInfo(self):\n return self.jsonRequest(\"/api/v1/usage\", { \"apiKey\": self._apiKey })", "def _usage_report_dict(self, root):\n details = {}\n selector = ...
[ "0.595714", "0.5901919", "0.5696059", "0.56513846", "0.5559412", "0.55006486", "0.5456827", "0.5399195", "0.53736734", "0.53501415", "0.5313205", "0.53006226", "0.52940077", "0.5287321", "0.52843976", "0.5270543", "0.52501863", "0.5234447", "0.5186706", "0.51861036", "0.51832...
0.7904441
0
Converts from bitwise representation into an array of vertex indices
def bits_to_verts(n): return [v for v in range(8) if 2**v & n > 0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toIndexes(self, binaryVector):\n\t\treturn n.array([i for i,v in enumerate(binaryVector) if v], dtype=\"int32\")", "def indices(self):\n\n # We used lookup tables here. Read more about other methods here:\n # https://chessprogramming.wikispaces.com/Bitboard+Serialization\n\n if self.num ...
[ "0.6880614", "0.66368663", "0.6283147", "0.61515015", "0.59993356", "0.5996714", "0.5987039", "0.597378", "0.58865625", "0.5886015", "0.58810294", "0.5878558", "0.5835041", "0.5816263", "0.57732755", "0.5763688", "0.57467073", "0.57454824", "0.57390153", "0.572041", "0.569220...
0.6249408
3
Converts from an array of vertex indices to a bitwise representation
def verts_to_bits(vs): return sum(2**v for v in vs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertex_group_ids_to_bitmask(vertex):\n list = [x.group for x in vertex.groups]\n masked = 0\n for group in list:\n masked |= 1 << group\n return masked", "def flip_labels_with_indices(arr, indices):\n\n assert arr.ndim == 1, 'arr is not 1d!'\n assert np.all(np.unique(arr) == np.array...
[ "0.6393874", "0.61002445", "0.6074662", "0.6046116", "0.6043752", "0.5958655", "0.5898454", "0.58136505", "0.57977664", "0.57674116", "0.5753882", "0.573017", "0.57096016", "0.56567574", "0.5620509", "0.5576903", "0.5572747", "0.5552426", "0.5549938", "0.5513818", "0.54547226...
0.69435185
0
Applies a vertex permutation operation to a set of vertices in bitwise representation
def bits_apply(op, n): return verts_to_bits(op[v] for v in bits_to_verts(n))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_permutation(hyper, pol, perm):\n pass", "def _permutation_to_vertex(self, p):\n return (\n tuple(p._labels[0]),tuple(p._labels[1]),\n tuple(p._twin[0]),tuple(p._twin[1]))", "def _permutation_to_vertex(self, p):\n return (tuple(p._labels[0]),tuple(p._labels[1]),\n ...
[ "0.6501051", "0.6195658", "0.6121992", "0.6116653", "0.59749347", "0.59226155", "0.5864506", "0.58285385", "0.58096594", "0.57623035", "0.57196116", "0.56820846", "0.5677053", "0.5631341", "0.5579956", "0.554991", "0.5541649", "0.5531225", "0.5472351", "0.54227304", "0.541530...
0.5487144
18
Applies a vertex permutation to a list of faces, optionally flipping the faces
def faces_apply(op, faces, flip): return [face_apply(op, face, flip) for face in faces]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def face_apply(op, face, flip):\n edges = [edge_apply(op, edge) for edge in face]\n if flip: edges = list(reversed(edges))\n return edges", "def permutations(cube):\r\n yield from rotations24(cube)\r\n yield from rotations24(np.flip(cube, 0))\r\n yield from rotations24(np.flip(cube, 1))\r\n ...
[ "0.6295819", "0.57063204", "0.56514055", "0.5288726", "0.5246789", "0.5239562", "0.51833093", "0.517691", "0.51233995", "0.5112797", "0.5077392", "0.50435096", "0.5018579", "0.50046337", "0.5001015", "0.49998033", "0.49979767", "0.49799728", "0.49551815", "0.49465147", "0.494...
0.6877623
0
Applies a vertex permutation to a list of edges
def face_apply(op, face, flip): edges = [edge_apply(op, edge) for edge in face] if flip: edges = list(reversed(edges)) return edges
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_edges_perm(edges):\n L = dict(edges)\n output = [START_NODE]\n while output[-1] != END_NODE:\n output.append(L[output[-1]])\n if len(edges) + 1 != len(output):\n raise Exception()\n return output", "def edgify(vertices:list)->list:\n edges = []\n for k in range(0, l...
[ "0.6615729", "0.6356669", "0.6107732", "0.60739803", "0.6059545", "0.6019073", "0.5929815", "0.5906628", "0.57717305", "0.5688672", "0.56653947", "0.5655183", "0.561524", "0.5603018", "0.55932075", "0.55679923", "0.55290484", "0.5518229", "0.54648507", "0.5454239", "0.5418100...
0.53229946
30
Applies a vertex permutation to an edge. I.e. it permutes both ends of the edge, and finds the new edge that adjoins the two resulting vertex indices.
def edge_apply(op, edge): vs = frozenset(op[v] for v in EDGES[edge]) return EDGES_BY_VERTSET[vs]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_permutation(V,m,adj):\r\n\r\n global tent\r\n\r\n perm = V.copy()\r\n \r\n \"\"\" try to select two vertices to swipe wisely. \"\"\"\r\n \r\n #we select 1 vertex among the m first vertices\r\n p1 = randint(0,m-1)\r\n \r\n #we select 1 vertex among the vertices left\r\n p2 = ra...
[ "0.61496586", "0.60148495", "0.5731535", "0.5478552", "0.54727155", "0.5447548", "0.5397627", "0.53930193", "0.53740484", "0.53071874", "0.53060764", "0.53023404", "0.52788925", "0.52775645", "0.525877", "0.5247642", "0.52019525", "0.5191499", "0.5182609", "0.5179934", "0.516...
0.59890103
2
Applies a series of vertex permutations into a single new permutation
def compose(*ops): if len(ops) == 0: return [0, 1, 2, 3, 4, 5, 6, 7] if len(ops) == 1: return ops[0] if len(ops) == 2: op1, op2 = ops return [op2[op1[v]] for v in range(8)] op1 = ops[0] rest = ops[1:] return compose(op1, compose(*rest))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_permutation(hyper, pol, perm):\n pass", "def new_permutation(V,m,adj):\r\n\r\n global tent\r\n\r\n perm = V.copy()\r\n \r\n \"\"\" try to select two vertices to swipe wisely. \"\"\"\r\n \r\n #we select 1 vertex among the m first vertices\r\n p1 = randint(0,m-1)\r\n \r\n #w...
[ "0.6906324", "0.6441453", "0.6377218", "0.623576", "0.6179371", "0.61270565", "0.60793066", "0.6078905", "0.60621685", "0.60290956", "0.5963186", "0.59536695", "0.5931516", "0.59029084", "0.57851154", "0.57602996", "0.5758229", "0.5711937", "0.57091004", "0.56876945", "0.5655...
0.0
-1
Repeats a vertex permutation n times
def pow(op, n): return compose(* ([op] * n))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makePermutations(n):\n\thalf = n // 2\n\tfull = half * 2\n\tswap = np.random.rand(half) > 0.5\n\tpx = np.arange(n)\n\tpx[:full:2] += swap\n\tpx[1:full:2] -= swap\n\treturn px", "def permutations(cube):\r\n yield from rotations24(cube)\r\n yield from rotations24(np.flip(cube, 0))\r\n yield from rotat...
[ "0.65971667", "0.65550095", "0.6534163", "0.6501334", "0.6494306", "0.6486899", "0.6421604", "0.6302786", "0.6279778", "0.6265627", "0.6223219", "0.6217137", "0.62151647", "0.6209237", "0.61867625", "0.61583555", "0.60585505", "0.604222", "0.6039225", "0.60213876", "0.5980881...
0.0
-1
Returns the midpoint of the edge, scaled by 2
def d_midpoint(edge): v0, v1 = EDGES[edge] v0_pos = VERTICES[v0] v1_pos = VERTICES[v1] return ((x+y) for (x,y) in zip(v0_pos, v1_pos))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMidPoint(self):\n return p.Point((self.start.normalVector + self.end.normalVector)/2.0)", "def midpoint(self) -> Tuple[int, int]:\n minx, miny, maxx, maxy = self.substrates.bounds\n return ((minx + maxx) // 2, (miny + maxy) // 2)", "def midpoints(self):\n return self.bins[:, ...
[ "0.71897864", "0.71782583", "0.69667315", "0.68740594", "0.6849831", "0.6820582", "0.68040663", "0.6604313", "0.655959", "0.6443173", "0.64284766", "0.6420485", "0.64110684", "0.64069355", "0.6338997", "0.6332368", "0.6320957", "0.6279374", "0.6177305", "0.60413665", "0.60012...
0.72003573
0
Returns the square of the length of two positions
def length_sq(pos1, pos2): return sum((x-y)**2 for (x,y) in zip(pos1, pos2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length(a, b):\n return sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]))", "def two_point_length(tuple1, tuple2):\n tot_sum = 0\n tot_sum += pow(tuple1[0]-tuple2[0], 2)\n tot_sum += pow(tuple1[1]-tuple2[1], 2)\n tot_sum += pow(tuple1[2]-tuple2[2], 2)\n final_len = pow(tot_...
[ "0.77668077", "0.7397608", "0.7298026", "0.7286897", "0.7151986", "0.69440967", "0.68845505", "0.6838329", "0.68282306", "0.66732067", "0.663228", "0.6612591", "0.6606926", "0.65746224", "0.65694505", "0.6530553", "0.65292597", "0.64804214", "0.6469597", "0.64584744", "0.6403...
0.840613
0
Calls each dot's display method
def display(self): for i in range(0, len(self.top_row)): self.top_row[i].display() for i in range(0, len(self.bottom_row)): self.bottom_row[i].display() for i in range(0, len(self.left_col)): self.left_col[i].display() for i in range(0, len(self.right_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display(self):\r\n\t\tfor each_item in self.items:\r\n\t\t\teach_item.display()", "def display(self):\n for x, p in zip(self.xs, self.ps):\n print(x, p)", "def dot():\n print_message(\".\")", "def display(self):\n while (True):\n self.print()\n choice...
[ "0.67835927", "0.66843057", "0.666886", "0.65113515", "0.6475496", "0.6450511", "0.6438653", "0.64117676", "0.6406389", "0.64011604", "0.63695925", "0.6368356", "0.6323673", "0.6308699", "0.6306104", "0.6278271", "0.6268307", "0.6267662", "0.62406975", "0.62362784", "0.623549...
0.6552318
3
Given the location of pacman, remove the dot which has been eaten
def eat(self, x, y): for dot in self.top_row: if (dot.x in range(x-self.EAT_DIST, x+self.EAT_DIST) and dot.y in range(y-self.EAT_DIST, y+self.EAT_DIST)): self.top_row.remove(dot) for dot in self.left_col: if (dot.x in range(x-self.EAT_DIST, x+s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_letter(letter, strng):", "def rm_dot(item):\n if len(str(item).split('.')) > 2:\n return item.replace('.', '', 1)\n else:\n return item", "def remove_accronymes(txt):\n return re.sub(r'(?<!\\w)([A-Z])\\.', r'\\1', txt)", "def remove_at_symbols(text):\n return text.replace...
[ "0.5764863", "0.56930834", "0.5624305", "0.561746", "0.55540574", "0.5498374", "0.53847456", "0.529521", "0.5261624", "0.5258695", "0.52553254", "0.52407074", "0.5233354", "0.52231973", "0.52170676", "0.5213291", "0.5207047", "0.5196517", "0.5182967", "0.5152582", "0.51511467...
0.49672496
40
Returns the number of remaing dots in the collection
def dots_left(self): return (len(self.top_row) + len(self.bottom_row) + len(self.left_col) + len(self.right_col))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_length(full):\n length = 0\n while length < len(full) and (is_int(full[length]) or full[length] == \".\"):\n length += 1\n return length", "def sentence_count(self):\n count = 0\n for line in self.lines:\n if '.' in line:\n count += 1\n if co...
[ "0.64962554", "0.64053047", "0.6216463", "0.6174851", "0.6148714", "0.61460245", "0.6102202", "0.6085623", "0.60542667", "0.60527104", "0.60527104", "0.60527104", "0.6040605", "0.6025968", "0.60231924", "0.60001814", "0.5998494", "0.59954226", "0.5974416", "0.5965547", "0.593...
0.5766017
57
Calculates standard deviation for the parameters
def deviation_from_actual_value(array): if array.ndim == 3: deviations = np.zeros((array.shape[1],array.shape[2])) for pt in range(array.shape[1]): for param in range(array.shape[2]): dev = np.std(array[:,pt,param]) deviations[pt,param] = dev retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def standard_deviation( values, sample=False ):\n return ma.sqrt( variance( values, sample ) )", "def _std(self, data):\n var = stats.var(data)\n if var>0.0:\n sd = math.sqrt(var)\n else:\n sd = 0.0\n return sd", "def standard_deviation(data):\n\n return ...
[ "0.78026533", "0.7647307", "0.76123196", "0.76123196", "0.7597832", "0.75591713", "0.75591713", "0.7547501", "0.74657285", "0.7434376", "0.742554", "0.7424684", "0.74159634", "0.74136686", "0.7356248", "0.73473656", "0.73449373", "0.7275893", "0.7271954", "0.7239", "0.7225868...
0.6829382
58
Generate value for temporary column.
def temp_(code): # Does the partial match criteria include at least one OLC code? if centroid or northwest or southeast: # Is the specified UBID code valid? if buildingid.v2.isValid(code): # Separate the UBID code into three OLC codes. openlocatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fake_column_value(self, column_name, raw_value):\n if raw_value not in self.random_column_mappings[column_name]:\n self.random_column_mappings[column_name][raw_value] = uuid.uuid4().hex\n return self.random_column_mappings[column_name][raw_value]", "def _get_value(self, value_column...
[ "0.6443928", "0.586687", "0.55891824", "0.556972", "0.5548356", "0.55463386", "0.5470742", "0.53880584", "0.5322259", "0.528715", "0.52488106", "0.5237839", "0.5124428", "0.511907", "0.51168317", "0.51155615", "0.51041496", "0.5101956", "0.5081746", "0.50771576", "0.50757074"...
0.0
-1
Generate value for temporary column.
def temp_(code): # Does the partial match criteria include at least one criterion? if centroid or north or east or south or west: match = buildingid.v3.RE_PATTERN_.match(code) # Is the specified UBID code valid? if match is None: return None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fake_column_value(self, column_name, raw_value):\n if raw_value not in self.random_column_mappings[column_name]:\n self.random_column_mappings[column_name][raw_value] = uuid.uuid4().hex\n return self.random_column_mappings[column_name][raw_value]", "def _get_value(self, value_column...
[ "0.6443928", "0.586687", "0.55891824", "0.556972", "0.5548356", "0.55463386", "0.5470742", "0.53880584", "0.5322259", "0.528715", "0.52488106", "0.5237839", "0.5124428", "0.511907", "0.51168317", "0.51155615", "0.51041496", "0.5101956", "0.5081746", "0.50771576", "0.50757074"...
0.0
-1
Clears the screen for a clean user experience
def clear(): os.system('cls' if os.name == 'nt' else 'clear')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self) -> None:\n self.screen.clear()", "def clear_screen(self) -> None:\n assert self.screen is not None\n self.screen.clear()\n self.refresh_screen()", "def clearScreen():\n pass", "def clear_screen(self):\n os.system('cls' if os.name == 'nt' else 'clear')", ...
[ "0.90538967", "0.8771846", "0.8672335", "0.86050916", "0.86050916", "0.8545433", "0.8500673", "0.8455498", "0.8432114", "0.83662564", "0.8340428", "0.8340428", "0.8340428", "0.8273955", "0.82572716", "0.8220763", "0.8220763", "0.81928957", "0.81839484", "0.8150272", "0.811245...
0.72859526
52
Checks that the user has entered a date in the specified format
def date_format(date): formatted = True task_date = date while formatted: try: datetime.datetime.strptime(task_date, "%m/%d/%Y") formatted = False clear() except ValueError: clear() task_date = input( "Sorry. That i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate(self, date, format):\n try:\n datetime.datetime.strptime(date, format) # format = \"%m/%d/%Y\"\n return True\n except ValueError:\n return False", "def _validate(self, date, format):\n try:\n datetime.datetime.strptime(date, format) #...
[ "0.8078952", "0.8078952", "0.79856914", "0.7561423", "0.75526595", "0.7543216", "0.7513091", "0.7494118", "0.7473142", "0.7441406", "0.7438409", "0.74290854", "0.7388282", "0.73706716", "0.7357162", "0.73103935", "0.72623146", "0.7257095", "0.71837956", "0.71804875", "0.71614...
0.67866516
44
Verifies that the user has entered the time spent in a rounded minutes format
def time_format(time): task_time = time formatted = True while formatted: try: int(task_time) formatted = False clear() except ValueError: clear() task_time = input("Please submit the time in rounded minutes: \n>") return task_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_time_spent():\n valid_data = False\n # used to keep track of the values and change them in other scopes\n input_data = {'time_spent': ''}\n\n while not valid_data:\n input_data['time_spent'] = input(\"Time spent on task (rounded minutes) : \")\n if re.match('\\d+', input_data['t...
[ "0.694629", "0.6748994", "0.638864", "0.6357921", "0.6322843", "0.6196093", "0.6184729", "0.61560804", "0.611747", "0.6044115", "0.6039488", "0.6033791", "0.60058755", "0.6001399", "0.6001399", "0.5945724", "0.59402835", "0.5858136", "0.58569", "0.5838605", "0.58353543", "0...
0.6721099
2
Searches the CSV for the user provided criteria, then calls the display_search_results function once it is found
def search_csv(search_criteria): results_list = [] with open('work_log.csv', 'r') as file: for row in file: if search_criteria in row: results_list.append(row) results_sort(results_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proceed(results_sort):\n result_index = 0\n good = True\n with open('work_log.csv', 'r') as file:\n while good:\n proceed_prompt = input('Would you like to see the next '\n 'match (Y/N)? \\n>').upper()\n if proceed_prompt == 'Y':\n ...
[ "0.66718364", "0.66616684", "0.64814675", "0.6412671", "0.6390805", "0.6351803", "0.6337164", "0.63014495", "0.6237988", "0.62156785", "0.61356044", "0.6060477", "0.60499936", "0.60499936", "0.60210896", "0.6012082", "0.6007237", "0.59896463", "0.59748703", "0.5954872", "0.59...
0.7490647
0
Searches the csv file for the time spent on the task
def search_time(time_spent): results_list = [] with open('work_log.csv', 'r') as file: for row in file: if time_spent in row: results_list.append(row) time_sort(time_spent, results_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self,time):\n \n fname = []\n tind =[]\n for t in time:\n flag=1\n for f in self.timelookup.keys():\n\n if t >= self.timelookup[f][0] and t<=self.timelookup[f][-1]:\n# print 'Found tstep %s'%datetime.strptime(t,'%Y-%m-...
[ "0.62988394", "0.6165839", "0.6142794", "0.613546", "0.61039007", "0.6103374", "0.59048325", "0.5850628", "0.58097833", "0.5788802", "0.57876265", "0.57777923", "0.5762286", "0.5760471", "0.57439256", "0.57371503", "0.5698138", "0.5673036", "0.5657542", "0.56012", "0.560112",...
0.70304364
0
Uses a regex pattern to search the CSV for the users specified criteria
def reg_csv_search(arg): results_list = [] with open('work_log.csv', 'r') as file: for row in file: if re.search(arg, str(row)): results_list.append(row) results_sort(results_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_csv(search_criteria):\n results_list = []\n with open('work_log.csv', 'r') as file:\n for row in file:\n if search_criteria in row:\n results_list.append(row)\n results_sort(results_list)", "def match_name(pattern, rows):\n matching = []\n for row in...
[ "0.67888", "0.6470334", "0.6396413", "0.6255691", "0.5961034", "0.5894265", "0.5788759", "0.57324696", "0.56589437", "0.5637524", "0.56029505", "0.5554282", "0.55365884", "0.55257493", "0.5497352", "0.54574275", "0.5443628", "0.5270864", "0.52509785", "0.5232844", "0.522245",...
0.73986834
0
Asks the user if they would like to proceed to the next search match or return to the main menu
def proceed(results_sort): result_index = 0 good = True with open('work_log.csv', 'r') as file: while good: proceed_prompt = input('Would you like to see the next ' 'match (Y/N)? \n>').upper() if proceed_prompt == 'Y': result...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_again(self):\n\n response = input(\n \"\\nWould you like to search for something else? (Yes or No): \")\n\n while response.lower().strip() != 'yes' or response.lower().strip() != 'no':\n\n if response.lower().strip() == 'yes':\n search_method_choice = s...
[ "0.72866863", "0.67840254", "0.67181313", "0.67010593", "0.6606882", "0.6564676", "0.65373194", "0.6530345", "0.6452046", "0.6443651", "0.64413977", "0.6321795", "0.6321795", "0.62783706", "0.62707144", "0.6233784", "0.6147132", "0.6137649", "0.6078425", "0.60593116", "0.6048...
0.63667834
11
Asks the user if they would like to proceed to the next search match or return to the main menu
def proceed_time(time_spent, results_sort): result_index = 0 good = True with open('work_log.csv', 'r') as file: while good: proceed_prompt = input('Would you like to see the next ' 'match (Y/N)? \n>').upper() if proceed_prompt == 'Y': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_again(self):\n\n response = input(\n \"\\nWould you like to search for something else? (Yes or No): \")\n\n while response.lower().strip() != 'yes' or response.lower().strip() != 'no':\n\n if response.lower().strip() == 'yes':\n search_method_choice = s...
[ "0.72863895", "0.6784519", "0.6718815", "0.67012006", "0.6608094", "0.65645003", "0.6537902", "0.65299827", "0.64510673", "0.6442261", "0.64421093", "0.6366394", "0.6320764", "0.6320764", "0.6278601", "0.6270224", "0.62320995", "0.6146126", "0.6137398", "0.60778147", "0.60583...
0.0
-1
Displays the users desired criteria in a user friendly format
def display_search_results(results): new_list = results.split(',') print('Date : {}'.format(new_list[0])) print('Title : {}'.format(new_list[1])) print('Time Spent : {}'.format(new_list[2])) print('Notes : {}'.format(new_list[3])) clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def criteria_display(self, obj):\n return markdownify(obj.criteria)", "def __ui_choose_search_criteria_for_persons(self):\n print(\"By which criteria do you want to search persons?\\n\"\n \" 1. By name\\n\"\n \" 2. By phone number\\n\")\n user_choice = input...
[ "0.729246", "0.6475465", "0.6302368", "0.60785484", "0.60026693", "0.57753193", "0.56812596", "0.56490254", "0.56184477", "0.56179726", "0.5589205", "0.5563888", "0.5551328", "0.5518226", "0.5494235", "0.54688364", "0.5435666", "0.54348785", "0.54307306", "0.5420073", "0.5411...
0.0
-1
Displays the time criteria in a user friendly format
def display_time(time_spent, results): time_list = results.split(',') if time_list[2] == time_spent: print('Date : {}'.format(time_list[0])) print('Title : {}'.format(time_list[1])) print('Time Spent : {}'.format(time_list[2])) print('Notes : {}'.format(time_list[3])) c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_time(self):\n hour = str(datetime.datetime.now().strftime(\"%H\"))\n minute = str(datetime.datetime.now().strftime(\"%M\"))\n\n hour1 = int(hour[0])\n hour2 = int(hour[1])\n minute1 = int(minute[0])\n minute2 = int(minute[1])\n\n self.light_number(self.numb...
[ "0.662041", "0.6618704", "0.65189946", "0.6502401", "0.63292795", "0.6303609", "0.62661237", "0.6211137", "0.61990756", "0.6094369", "0.6071117", "0.6003552", "0.60004944", "0.59723264", "0.59697723", "0.59694594", "0.59597594", "0.59349036", "0.59229594", "0.5916387", "0.591...
0.6771459
0
Watch the pins and reconstruct transactions.
async def _monitor_recv(self): while True: await RisingEdge(self.clock) await ReadOnly() if self.bus.valid.value: self._recv(int(self.bus.data.value))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activatePinReading(self):\n\n for pin in self.pinsToMeasure:\n arduino.samplePinDuringCapture(self.f, self.pinMap[pin], self.wallClock)", "def rescanblockchain(self, *args, **kwargs):\n pass", "def notify(self):\n for customer in self.customers:\n customer.update...
[ "0.551483", "0.5239121", "0.51758367", "0.5165967", "0.51407325", "0.5108498", "0.50625914", "0.5031228", "0.50113636", "0.49593377", "0.49497795", "0.49426496", "0.49096787", "0.48999128", "0.48825422", "0.48567903", "0.48450917", "0.48180082", "0.4799888", "0.47884685", "0....
0.0
-1
Test n5/n = 5
async def mean_basic_test(dut): BUS_WIDTH = int(dut.BUS_WIDTH.value) await value_test(dut, [5] * BUS_WIDTH)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def five():\r\n \r\n n = 20\r\n divisible = False\r\n \r\n while divisible == False:\r\n n += 20\r\n divisible = True\r\n for i in range(20, 0, -1):\r\n if n % i != 0:\r\n divisible = False\r\n break\r\n return n", "def Z(n):\n co...
[ "0.68741405", "0.68214047", "0.6767779", "0.6581722", "0.65181637", "0.64457196", "0.63073707", "0.63073707", "0.6244081", "0.6204426", "0.6193691", "0.6183099", "0.61796105", "0.61215574", "0.60917366", "0.6087825", "0.60302454", "0.60219646", "0.6012", "0.600985", "0.600085...
0.0
-1
Test for overflow nmax_val/n = max_val
async def mean_overflow_test(dut): BUS_WIDTH = int(dut.BUS_WIDTH.value) DATA_WIDTH = int(dut.DATA_WIDTH.value) await value_test(dut, [2**DATA_WIDTH - 1] * BUS_WIDTH)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_valid_range(val, max_val):\n if val < 0:\n val = 0\n elif val > max_val:\n val = max_val\n else:\n pass\n return val", "def normexponent(val):\n n = np.log10(val)\n if n < 0:\n n = int(n) - 1\n else:\n n = int(n)\n r...
[ "0.63276565", "0.6182196", "0.6137918", "0.6084422", "0.6055982", "0.6047039", "0.6044521", "0.5964492", "0.59547186", "0.5945219", "0.59124607", "0.5856389", "0.5852122", "0.5821489", "0.5820828", "0.5815797", "0.580666", "0.5793909", "0.5789581", "0.57884365", "0.5772079", ...
0.5406247
61
Test mean of random numbers multiple times
async def mean_randomised_test(dut): # dut_in = StreamBusMonitor(dut, "i", dut.clk) # this doesn't work: # VPI Error vpi_get_value(): # ERROR - Cannot get a value for an object of type vpiArrayVar. dut_out = StreamBusMonitor(dut, "o", dut.clk) exp_out = [] with warnings.catch_warnings(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkMean(mean, iterations=10000):\n resultMean = mean\n for x in range(iterations):\n resultMean += nextTime(mean)\n resultMean /= iterations\n return resultMean\n # This one is kinda bullshit. Random seeding is seemingly different than what doctest author intended. Why check the floats ...
[ "0.72472805", "0.6431477", "0.6431477", "0.6419152", "0.63732487", "0.6226704", "0.6222548", "0.6181071", "0.61689115", "0.6168421", "0.6133957", "0.6133957", "0.6133957", "0.6133957", "0.61324465", "0.61039424", "0.60864156", "0.6069528", "0.6055752", "0.6047192", "0.6026047...
0.0
-1
Tries to perform an urlopen(url).read(), with workarounds for broken certificate stores. On many Python installations, urllib has problems using the system certificate stores; this seems to be particularly true on macOS, it is so in a twisted way on Win32 and can be a problem on some Linux distros (where in general the...
def workaround_url_read(url): from urllib.request import urlopen from urllib.error import URLError try: return urlopen(url).read() except URLError as ex: import ssl if len(ex.args) and isinstance(ex.args[0], ssl.SSLError): logger.warn("SSL error reading catalog file %...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getfilehttps(self, url):\n ctx = ssl.create_default_context()\n ctx.check_hostname = False\n ctx.verify_mode = ssl.CERT_NONE\n response = urllib.request.urlopen(url, context=ctx)\n result = response.read()\n return result", "def _fetch(url, ssl_verify = True):\n r...
[ "0.76082635", "0.71762764", "0.662815", "0.66156995", "0.65748215", "0.6362366", "0.631332", "0.6236358", "0.62360704", "0.62359977", "0.62280315", "0.60872215", "0.60525805", "0.60064995", "0.59848493", "0.5960688", "0.5955748", "0.59550893", "0.59434485", "0.5941267", "0.59...
0.7631621
0
Ensure we have an alias to import is_affirmative as _is_affirmative for backward compatibility with Agent 5.x
def test_alias(): assert getattr(config, "_is_affirmative", None) is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_affordable(self, tx_message: TransactionMessage) -> bool:\n is_affordable = True\n if self.context.ownership_state.is_initialized:\n is_affordable = self.context.ownership_state.is_affordable_transaction(\n tx_message\n )\n if self.context.ledger_st...
[ "0.58096945", "0.56020963", "0.5278895", "0.5237023", "0.52046263", "0.5125001", "0.5096052", "0.50864345", "0.50788856", "0.49949625", "0.49739137", "0.49159327", "0.48837402", "0.48781067", "0.48724884", "0.48707488", "0.48390678", "0.4833998", "0.47909078", "0.478799", "0....
0.64019364
0
simple markov chain model for qa field
def cloudModel(PsPs, PcPc): PsPc = 1 - PsPs PcPs = 1 - PcPc """ transition matrix -- don't really need... """ P = np.array([[PsPs, PsPc], [PcPs, PcPc]]) """ initial condintion """ sunny = True t0 = np.random.choice([False, True]) """ run realisation ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getQValue(self, state, action):\n \"\"\"Description:\n [Enter a description of what you did here.]\n Use first equation in slide 71 of MDP to compute q-value depond on weights and current features.\n \n !! But I think what I did is not work for IdentityExtractor. Because feature of IdentityExtra...
[ "0.5637491", "0.5590359", "0.5580348", "0.5483759", "0.542955", "0.5413857", "0.54065937", "0.5316787", "0.5316414", "0.5286672", "0.52820724", "0.52810353", "0.5273364", "0.5269522", "0.5262664", "0.52541405", "0.5239877", "0.523715", "0.52256894", "0.52171457", "0.521534", ...
0.0
-1
simulate simple BRDF BRDF is not random so we enforce a certain structure onto the BRDF First the SZA is modelled as a simple sin across the year One approach is a climatology from the MODIS data? For this i think sin waves of diff freq will give some characteristic covering can vary max and min angles to sensors
def angular1(brdf_settings): # const scaleconst = 2*np.pi/366 locals().update(brdf_settings) def scale(x, a=5, b=10, xmin=-1, xmax=1): """ rescale the sin a new min b = new max xmin = min of x xmax = max of x """ return (b - a)*(x - xmin)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sim_any_sinmode(gls_obj, in_freq, times):\n k = np.where(np.round(gls_obj.freq, 5) == in_freq)[0]\n if len(k) > 1:\n k = k[0]\n amp = np.sqrt(gls_obj._a[k]**2 + gls_obj._b[k]**2)\n ph = np.arctan2(gls_obj._a[k], gls_obj._b[k]) / (2. * np.pi)\n T0 = times.min() - ph / in_freq\n offset =...
[ "0.6582506", "0.6425722", "0.6123549", "0.6094703", "0.6085024", "0.6063853", "0.6045906", "0.6019445", "0.6018563", "0.60164666", "0.60149175", "0.60096467", "0.597433", "0.5969006", "0.59594935", "0.5911588", "0.58930105", "0.58714265", "0.58433384", "0.58316123", "0.582491...
0.68870825
0
rescale the sin a new min b = new max xmin = min of x xmax = max of x
def scale(x, a=5, b=10, xmin=-1, xmax=1): return (b - a)*(x - xmin)/(xmax - xmin) + a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rescale(self, xmin, xmax):\n\n # Normalise\n self.normalise()\n\n \n # Rescale\n range = xmax-xmin\n for seg in self.segments:\n seg.lower_bound = seg.lower_bound*range + xmin\n seg.upper_bound = seg.upper_bound*range + xmin", "def sin_inplace(a...
[ "0.634048", "0.6331223", "0.605195", "0.6003298", "0.5982807", "0.5972186", "0.5926084", "0.5825354", "0.57681715", "0.5748232", "0.5718174", "0.5701674", "0.56905395", "0.5674951", "0.5660613", "0.5647292", "0.5632954", "0.55880105", "0.55765074", "0.55494636", "0.5454097", ...
0.67776537
0