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
Function for returning velocity.
def velocities(self, return_np=False): if return_np: return self.si_values()[3:] return [self.v_r, self.v_t, self.v_p]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVelocity(self):\n return self.v", "def get_velocity(self):\n return self.momentum/self.mass", "def velocity(self):\n return self._velocity", "def velocity(self):\n return self._velocity", "def getVelocity(self):\n\t\tif len(self.prevPositions) < 2:\n\t\t\tself.velocity = 0\n\...
[ "0.8667903", "0.8293557", "0.8140917", "0.8140917", "0.8003917", "0.7993078", "0.79492277", "0.792993", "0.77929205", "0.7697181", "0.76217324", "0.76067966", "0.74850005", "0.74595916", "0.73604906", "0.72500557", "0.7246171", "0.7206871", "0.7172975", "0.7169881", "0.711871...
0.0
-1
Function to convert velocity to cartesian coordinates Returns ~einsteinpy.coordinates.velocity.CartesianDifferential Cartesian representation of the velocity in Spherical Coordinates.
def cartesian_differential(self): x, y, z, v_x, v_y, v_z = self.convert_cartesian() return CartesianDifferential( x * u.m, y * u.m, z * u.m, v_x * u.m / u.s, v_y * u.m / u.s, v_z * u.m / u.s )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _velocity_spherical2cartesian(pos,vel):\n \n #save cartesian position of each particle\n r=pos[:,0]\n theta=pos[:,1]\n phi=pos[:,2]\n\n\n #save cyindrical velocities\n vr=vel[:,0]\n vtheta=vel[:,1]\n vphi=vel[:,2]\n\n\n #compute cartesian velocities\n vx = vr*np.sin(theta)*np.c...
[ "0.75717354", "0.749493", "0.73145956", "0.7314483", "0.72647214", "0.7194624", "0.7028506", "0.6992018", "0.6795275", "0.67766845", "0.6697479", "0.6671886", "0.6653969", "0.6644937", "0.65747213", "0.6547389", "0.64662033", "0.6464509", "0.6451586", "0.64358544", "0.6414557...
0.752729
1
Function to convert velocity to BoyerLindquist coordinates
def bl_differential(self, a): r, theta, phi, v_r, v_t, v_p, a = self.convert_bl(a.si.value) return BoyerLindquistDifferential( r * u.m, theta * u.rad, phi * u.rad, v_r * u.m / u.s, v_t * u.rad / u.s, v_p * u.rad / u.s, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector_coords_to_speed(vel):\n return round(math.sqrt(vel[0]**2 + vel[1]**2 + vel[2]**2),2)", "def getVelocity(self):\n return self.v", "def BaryXV(jday):\n\n jday_min = 2415020.0 # Dec 31st 1899\n jday_max = 2488070.0 # Jan 1st 2100\n\n # Masses of the planets [*** in some unit?].\n # ...
[ "0.61070365", "0.60223526", "0.59349537", "0.5911736", "0.58473176", "0.5817254", "0.57953846", "0.57706666", "0.57327145", "0.5732203", "0.57154965", "0.5713621", "0.5713191", "0.5685953", "0.5685792", "0.5664762", "0.566358", "0.5658571", "0.5646608", "0.5617313", "0.560968...
0.0
-1
Function for returning values in SI units. Returns ~numpy.ndarray Array containing values in SI units (m, rad, rad, m/s, rad/s, rad/s)
def si_values(self): element_list = [ self.r.to(u.m), self.theta.to(u.rad), self.phi.to(u.rad), self.v_r.to(u.m / u.s), self.v_t.to(u.rad / u.s), self.v_p.to(u.rad / u.s), ] return np.array([e.value for e in element_list], d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_array(self):\n return self._data_array.values * units(self._units)", "def si_values(self):\n element_list = [\n self.x.to(u.m),\n self.y.to(u.m),\n self.z.to(u.m),\n self.v_x.to(u.m / u.s),\n self.v_y.to(u.m / u.s),\n self.v...
[ "0.6597943", "0.649187", "0.63240147", "0.6257522", "0.6255147", "0.6213908", "0.6213201", "0.6091031", "0.60509723", "0.58182454", "0.55522114", "0.55494267", "0.55082214", "0.54812056", "0.5480648", "0.54716265", "0.54494315", "0.5425861", "0.53436226", "0.5266943", "0.5266...
0.6856912
0
Function for returning velocity.
def velocities(self, return_np=False): if return_np: return self.si_values()[3:6] return [self.v_r, self.v_t, self.v_p]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVelocity(self):\n return self.v", "def get_velocity(self):\n return self.momentum/self.mass", "def velocity(self):\n return self._velocity", "def velocity(self):\n return self._velocity", "def getVelocity(self):\n\t\tif len(self.prevPositions) < 2:\n\t\t\tself.velocity = 0\n\...
[ "0.8667903", "0.8293557", "0.8140917", "0.8140917", "0.8003917", "0.7993078", "0.79492277", "0.792993", "0.77929205", "0.7697181", "0.76217324", "0.76067966", "0.74850005", "0.74595916", "0.73604906", "0.72500557", "0.7246171", "0.7206871", "0.7172975", "0.7169881", "0.711871...
0.65122586
78
Function to convert velocity to cartesian coordinates Returns ~einsteinpy.coordinates.velocity.CartesianDifferential Cartesian representation of the velocity in BoyerLindquist Coordinates.
def cartesian_differential(self): x, y, z, v_x, v_y, v_z = self.convert_cartesian() return CartesianDifferential( x * u.m, y * u.m, z * u.m, v_x * u.m / u.s, v_y * u.m / u.s, v_z * u.m / u.s )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _velocity_cylindrical2cartesian(pos,vel):\n \n \n #save cartesian position of each particle\n theta=pos[:,1]\n\n #save cyindrical velocities\n vr=vel[:,0]\n vtheta=vel[:,1]\n vz=vel[:,2]\n\n #compute cartesian velocities\n vx = vr*np.cos(theta) - vtheta*np.sin(theta)\n vy = vr*...
[ "0.73405516", "0.71744573", "0.6778464", "0.65815", "0.62820125", "0.6220163", "0.61845547", "0.6147028", "0.609071", "0.601563", "0.60105854", "0.5990543", "0.59816396", "0.5977907", "0.59497446", "0.59303284", "0.5923606", "0.591318", "0.5826719", "0.582666", "0.58232594", ...
0.68691254
3
Function to convert velocity to spherical coordinates Returns ~einsteinpy.coordinates.velocity.SphericalDifferential Spherical representation of the velocity in BoyerLindquist Coordinates.
def spherical_differential(self): r, theta, phi, v_r, v_t, v_p = self.convert_spherical() return SphericalDifferential( r * u.m, theta * u.rad, phi * u.rad, v_r * u.m / u.s, v_t * u.rad / u.s, v_p * u.rad / u.s, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _velocity_cylindrical2spherical(pos,vel):\n \n pos_cart=_position_cylindrical2cartesian(pos)\n vel_cart=_velocity_cylindrical2cartesian(pos,vel)\n vel_sph=_velocity_cartesian2spherical(pos_cart,vel_cart)\n\n return vel_sph", "def _velocity_cartesian2spherical(pos,vel):\n\n \n #save carte...
[ "0.672321", "0.6639501", "0.635419", "0.6353", "0.6298572", "0.61776495", "0.6175607", "0.61004883", "0.601829", "0.5944876", "0.58419675", "0.5830476", "0.5705863", "0.5697523", "0.56473684", "0.5615951", "0.5607414", "0.55717176", "0.55411494", "0.5518485", "0.54982543", ...
0.71730846
1
finds the max contour and crops image
def crop_image(img): gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) _, threshed = cv.threshold(gray, 240, 255, cv.THRESH_BINARY_INV) kernel = cv.getStructuringElement(cv.MORPH_ELLIPSE, (11, 11)) morphed = cv.morphologyEx(threshed, cv.MORPH_CLOSE, kernel) cnts = cv.findContours(morphed, cv.RETR_EXTERNA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_biggest_contour(self):\n blurred = blur(self.data)\n bin_img = threshold(blurred, self.calcthresh(blurred))\n self.contour_exists, self.largest_cont = find_largest_contour(\n bin_img, self.data\n )", "def find_max_contour(contours):\n if len(contours)==0:\n ...
[ "0.74302495", "0.7279877", "0.7024745", "0.70189387", "0.6843401", "0.6629629", "0.66076744", "0.65724164", "0.65403676", "0.65171653", "0.64163184", "0.6372211", "0.63559014", "0.6348195", "0.6314943", "0.62741804", "0.6220215", "0.6159651", "0.6136308", "0.6129356", "0.6110...
0.5729276
47
remove background from image
def remove_background(img): mask = np.zeros(img.shape[:2], np.uint8) bgdModel = np.zeros((1, 65), np.float64) fgdModel = np.zeros((1, 65), np.float64) rect = (50, 50, 450, 290) cv.grabCut(img, mask, rect, bgdModel, fgdModel, 5, cv.GC_INIT_WITH_RECT) mask2 = np.where((mask == 2)|(mask == 0), 0, 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_background(img):\n\n img = img.astype(np.uint8)\n # Binarize the image using OTSU's algorithm. This is used to find the center\n # of mass of the image, and find the threshold to remove background noise\n threshold, _ = cv2.threshold(img, 0, 255, cv2.THRESH_BINARY + cv2.THRES...
[ "0.7596473", "0.7517804", "0.7516415", "0.7453885", "0.7361087", "0.72094864", "0.7066235", "0.678405", "0.6615194", "0.66145176", "0.66145176", "0.6563456", "0.6563456", "0.6557612", "0.65447515", "0.6516783", "0.6507971", "0.64584637", "0.644767", "0.6401402", "0.637965", ...
0.76232606
0
There is an array with some numbers. All numbers are equal except for one. return the different number
def find_uniq(arr): length = len(arr) if(length < 3): print("array length should be atleast 3") return sameVal = getSameVal(arr) for i in range(0, length): if(sameVal != arr[i]): return arr[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def equalizeArray(arr):\n from collections import Counter\n counts = Counter(arr)\n most_common = counts.most_common(1)[0][1]\n return len(arr) - most_common", "def getSameVal(arr):\n currentVal = 0 \n for i in range(1,3):\n #scenario when first element is not different one\n if(a...
[ "0.6573971", "0.65089196", "0.6452169", "0.62671024", "0.61270994", "0.60709643", "0.5992455", "0.59222955", "0.5848902", "0.5832411", "0.58172315", "0.5791484", "0.57831424", "0.5762812", "0.5756214", "0.57520884", "0.5743414", "0.57363194", "0.5707136", "0.5692955", "0.5688...
0.6151948
4
checks for same repeating number in array of format [1,1,1,1,1,21,1,1] and return the same repeating number
def getSameVal(arr): currentVal = 0 for i in range(1,3): #scenario when first element is not different one if(arr[currentVal] == arr[i]): return arr[i] #scenario when first element is different one return arr[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeats(arr):\n return sum([el for el in arr if arr.count(el) == 1])", "def repeatedNTimes(self, A: List[int]) -> int:\n \"\"\" \n A = sorted(A)\n if A[0] == A[1]:\n return A[0]\n return A[int(len(A)/2)]\n \"\"\"\n res = set()\n for a in A...
[ "0.7462376", "0.68985116", "0.68213654", "0.6791498", "0.66626716", "0.6654712", "0.66019726", "0.6586871", "0.65565526", "0.6502662", "0.6475282", "0.64584553", "0.6427284", "0.6316363", "0.6316358", "0.62999094", "0.62543565", "0.61959225", "0.61065865", "0.610497", "0.6078...
0.587011
26
the highest heatvalue location with a quarter offset in the direction from the highest response to the second highest response.
def get_final_preds(self, heatmaps, center, scale, kernelsize=3): coords, maxvals = self.get_max_preds(heatmaps) heatmap_height = heatmaps.shape[2] heatmap_width = heatmaps.shape[3] if self.use_dark: coords = self.dark_postprocess(heatmaps, coords, kernelsize) else:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_max_peak(x_value, raw_values):\n\n\n raw_values_index = raw_values[raw_values[\"m/z\"] == x_value].index[0]\n\n value, index = float(raw_values.loc[raw_values_index - 5, \"intensity_normalized\"]), raw_values_index - 5\n\n for z in range(-5, 15):\n if float(raw_values.loc[raw_values_index...
[ "0.64174277", "0.63321334", "0.6111966", "0.61023045", "0.60487425", "0.59830815", "0.59024787", "0.5866543", "0.5827241", "0.5788122", "0.5777374", "0.57560885", "0.5752713", "0.57365024", "0.57293266", "0.56564736", "0.563684", "0.5632605", "0.55824196", "0.55315524", "0.55...
0.0
-1
Sends response to user depending on received message
def handle_messages(): print("Handling Messages") payload = request.get_data() for sender, incoming_message, payload in messaging_events(payload): # The following statements check which options the user selected # Response handler contains "templates" for the various messages user_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def respond_to_message(self):\n\n MessageEventHandler(self.state, self.meta_data, self.message_data).handle_events(events=self.events)\n data = Converter(self.state).get_messages(meta_data=self.meta_data, message_data=self.message_data)\n\n outgoing_messages = data.get(\"messages\", [])\n ...
[ "0.7485857", "0.71170336", "0.71170336", "0.70899004", "0.7057453", "0.7055285", "0.70518273", "0.6897833", "0.6893781", "0.68720883", "0.6848174", "0.6839564", "0.68096834", "0.67855793", "0.67600363", "0.67594206", "0.67516226", "0.6689828", "0.6643192", "0.66353416", "0.66...
0.6939255
7
Generate tuples of (sender_id, message_text, payload) from the provided payload.
def messaging_events(payload): data = json.loads(payload) message = data["entry"][0]["messaging"] for event in message: if "message" in event and "text" in event["message"]: # if message in event and text in message set id and text sender_id = event["sender"]["id"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_payload(raw_msg):\n\n return raw_msg[14:-6], raw_msg[-5]", "def _payload_messages(payloads):\n return [\n message for payload in payloads\n for message in payload.sqs_messages\n ]", "def messaging_events(payload):\n data = json.loads(payload)\n messaging_events ...
[ "0.59580827", "0.55486125", "0.5414997", "0.5365624", "0.52991694", "0.52787316", "0.51438254", "0.5128899", "0.5045851", "0.5035789", "0.5024441", "0.50193506", "0.5012256", "0.5003323", "0.49992347", "0.48895833", "0.48848885", "0.48299858", "0.4825614", "0.47841936", "0.47...
0.5528389
2
Send the message text to recipient with id recipient.
def send_message(token, data): sender = requests.post("https://graph.facebook.com/v2.6/me/messages", params={"access_token": token}, data=data, headers={'Content-type': 'application/json'}) if sender.status_code != requests.codes.ok: print(sender.te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def send_text_message(\n self, recipient_id: Text, text: Text, **kwargs: Any\n ) -> None:\n\n for message_part in text.strip().split(\"\\n\\n\"):\n await self._send_message(recipient_id, {\"text\": message_part})", "def send_text(self, tg_user_id, text):\n return self.tg....
[ "0.7516807", "0.74322623", "0.7201014", "0.6999175", "0.68078196", "0.6728093", "0.6715548", "0.6670626", "0.6603046", "0.6513881", "0.651088", "0.64997524", "0.64618635", "0.64259326", "0.6421257", "0.6404951", "0.63940114", "0.6379497", "0.6378294", "0.6361757", "0.63503075...
0.0
-1
Gets the full name of sender. Uses a get request.
def get_full_name(sender, token): url = "https://graph.facebook.com/v2.6/" + sender + "?fields=first_name,last_name&access_token=" + token headers = {'content-type': 'application/json'} response = requests.get(url, headers=headers) data = json.loads(response.content) return ''.join(data['first_name'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sender(self):\n key, alt = ('Sender', 'From') if not self.resent else \\\n ('Resent-Sender', 'Resent-From')\n value = self.get(key) or self.get(alt)\n _, addr = getaddresses([value])[0]\n return addr", "def name(self):\n name = self.__telegram_info.mes...
[ "0.64837116", "0.6365123", "0.6297198", "0.62794083", "0.62514067", "0.6221852", "0.6220194", "0.6220194", "0.6200113", "0.61839944", "0.617625", "0.60754865", "0.6052838", "0.60519934", "0.60513854", "0.6046378", "0.6003633", "0.59597677", "0.5958653", "0.5941031", "0.593358...
0.64352673
1
if noninteractive is truthy, always return default. intended primarily as a wrapper to preempt attempts to prompt user input.
def catch_interaction( noninteractive: Any, func: Callable, *args, _default: Any = "", **kwargs ): if noninteractive: return _default return func(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_with_default(prompt, default):\n response = raw_input(\"%s (Default %s) \"%(prompt, default))\n if not response:\n return default\n return response", "def user_prompt(prompt, default=None):\n prompt = f\"\\n {prompt} [{default}] runs or type an amount: \"\n response = input(prompt...
[ "0.6602298", "0.64760804", "0.63981557", "0.63623685", "0.6330591", "0.61910653", "0.614743", "0.6139188", "0.6115366", "0.6073459", "0.6009013", "0.5976778", "0.59015214", "0.58762276", "0.5871548", "0.5866867", "0.584779", "0.58292", "0.5807008", "0.5786783", "0.57751215", ...
0.67750555
0
take anything, return nothing
def zero(*_, **__) -> None: return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nothing(nothing):\n pass", "def nothing():\n pass", "def take(obj=None): #py:take\n if obj is None:\n RUR._take_()\n else:\n RUR._take_(obj)", "def none(self):", "def do_nothing(arg):\n return True", "def noop():", "def do_nothing(sig):\n return sig", "def return_...
[ "0.63890463", "0.6331964", "0.6265283", "0.6091291", "0.60510015", "0.58942634", "0.5821527", "0.5802293", "0.5759943", "0.5757116", "0.5684998", "0.5580994", "0.5572009", "0.5553072", "0.54955065", "0.5441442", "0.54119337", "0.54119337", "0.54119337", "0.54078126", "0.54064...
0.0
-1
implicitly turns a function into a trigger step for a pipeline
def triggerize(niladic_function: Callable) -> Callable: @wraps(niladic_function) def trigger(deferred_state=None): niladic_function() return deferred_state return trigger
{ "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.6040737", "0.5902988", "0.5877854", "0.5722537", "0.5722537", "0.5695798", "0.5683979", "0.5618742", "0.5618742", "0.5533937", "0.5496856", "0.54857695", "0.5480328", "0.5475125", "0.54424846", "0.54287213", "0.54262495", "0.5405869", "0.53996795", "0.5362263", "0.5343884"...
0.57949847
3
iterable > function returns function that checks if its single argument contains all (or by changing oper, perhaps any) items
def are_in(items: Collection, oper: Callable = and_) -> Callable: def in_it(container: Collection) -> bool: inclusion = partial(contains, container) return reduce(oper, map(inclusion, items)) return in_it
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(iterable):\n for item in iterable:\n if not item:\n return False\n return True", "def every(lst, fn):\n return reduce(lambda acc, elem: acc and fn(elem), lst, True)", "def contains_all(self, *items):\n return all(item in self for item in items)", "def any(iterable):\...
[ "0.7025728", "0.68925816", "0.6799579", "0.6778553", "0.67687476", "0.67141616", "0.6710857", "0.6701432", "0.6675492", "0.662684", "0.6607761", "0.655131", "0.6546161", "0.6533346", "0.65054846", "0.64836633", "0.64503634", "0.6401916", "0.6399416", "0.6397432", "0.6397432",...
0.7199069
0
partiallyevaluated predicate form of `isinstance`
def is_it(*types: type) -> Callable[[Any], bool]: def it_is(whatever: Any): return isinstance(whatever, types) return it_is
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_predicate(self, predicate, x):\n if isinstance(predicate, dtype.TypeMeta):\n return issubclass(x, predicate)\n elif isinstance(predicate, type):\n return isinstance(x, predicate)\n elif callable(predicate):\n return predicate(self, x)\n else:\n...
[ "0.6704477", "0.6520452", "0.6432238", "0.60389125", "0.5971642", "0.5969615", "0.59228534", "0.5896889", "0.588795", "0.5879615", "0.58075565", "0.5764086", "0.5752992", "0.5729975", "0.571682", "0.56570166", "0.5620675", "0.56034833", "0.55696195", "0.5534018", "0.5526219",...
0.643537
2
'greedy map' function. map `func` across `iterables` using `mapper` and evaluate with `evaluator`. because we splat the variadic `iterables` argument into `mapper`, behavior is roughly equivalent to `itertools.starmap` if you pass more than one iterable. for cases in which you need a terse or configurable way to map an...
def gmap( func: Callable, *iterables: Iterable, mapper: Callable[[Callable, tuple[Iterable]], Iterable] = map, evaluator: Callable[[Iterable], Any] = tuple ): return evaluator(mapper(func, *iterables))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eager_map(func, iterable):\n for _ in map(func, iterable):\n continue", "def map(iterable, function):\n for x in iterable:\n yield function(x)", "def map(function, iterable):\n\n return [function(x) for x in iterable]", "def map(self, fn, *iterables, **kwargs):\n fn = self._...
[ "0.727791", "0.724331", "0.7051725", "0.6898326", "0.6776462", "0.6744139", "0.6707595", "0.6653942", "0.6592648", "0.6541584", "0.6536001", "0.6513968", "0.648274", "0.64515436", "0.63744414", "0.63716865", "0.62399644", "0.6196002", "0.61775833", "0.6175089", "0.6169941", ...
0.8387936
0
similar to gmap(func, things, mapper=filter, evaluator=next). for slightly faster or simpler cases.
def filtern(func: Callable, iterable: Iterable): return next(filter(func, iterable))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gmap(\n func: Callable,\n *iterables: Iterable,\n mapper: Callable[[Callable, tuple[Iterable]], Iterable] = map,\n evaluator: Callable[[Iterable], Any] = tuple\n):\n return evaluator(mapper(func, *iterables))", "def mapg(f: Callable[[D_], R_], C: Iterable[D_]) -> Iterator[R_]:\n for x in C:...
[ "0.76758003", "0.6960604", "0.6957007", "0.69170654", "0.6845065", "0.6815082", "0.67794806", "0.67764664", "0.6669981", "0.66542083", "0.6609351", "0.66077495", "0.6534164", "0.64531255", "0.64313585", "0.6423037", "0.6410939", "0.639323", "0.6335476", "0.62779206", "0.62762...
0.52034396
100
return an optional version of `func`.
def optionalize(func: Callable, exc_callback: Callable = zero) -> Callable: @wraps(func) def optionally(*args, **kwargs): try: return func(*args, **kwargs) except KeyboardInterrupt: raise except Exception as e: exc_callback(e) return optionally
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maybe(func: t.Callable[[S], T], val: t.Optional[S]) -> t.Optional[T]:\n if val is None:\n return None\n\n return func(val)", "def try_or_none(f):\n def f_or_none(x):\n try: return f(x)\n except: return None\n return f_or_none", "def optional_apply(f, value):\n if value i...
[ "0.72831035", "0.71037054", "0.70771754", "0.70040476", "0.67513853", "0.67439395", "0.67439395", "0.66784215", "0.6556067", "0.65130246", "0.6340111", "0.6217448", "0.6217448", "0.6161739", "0.6096438", "0.60259074", "0.5934939", "0.5912833", "0.5836178", "0.58132607", "0.57...
0.67314667
7
Takes a range in form of "ab" and generate a list of numbers between a and b inclusive. Also accepts comma separated ranges like "ab,cd,f" will build a list which will include Numbers from a to b, a to d and f
def hyphen_range(s): s="".join(s.split())#removes white space r=set() for x in s.split(','): t=x.split('-') if len(t) not in [1,2]: raise SyntaxError("hash_range is given its arguement as "+s+ " which seems not correctly formated.") r.add(int(t[0])) if len(t)==1 else r....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ranges_to_list(s):\n r = []\n for p in s.split(\",\"):\n p = p.strip()\n try:\n r += [int(p)]\n continue\n except:\n pass\n match = rx_range.match(p)\n if not match:\n raise SyntaxError\n f, t = [int(x) for x in match.g...
[ "0.7534799", "0.7517225", "0.7308026", "0.73077446", "0.72394514", "0.7220159", "0.7184164", "0.7162573", "0.7134133", "0.7084473", "0.7030668", "0.7001314", "0.69585234", "0.69384074", "0.68974733", "0.68143064", "0.6806218", "0.68022084", "0.6718881", "0.66961336", "0.66888...
0.60403526
49
Create an array from our arguments
def Array(*args): array = VBArray(len(args) - 1, Variant) for idx in range(len(args)): array[idx] = args[idx] return array
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Array( *args ):\n tArray = ()\n for arg in args:\n tArray += (arg,)\n return tArray", "def Array( *args ):\n tArray = ()\n for arg in args:\n tArray += (arg,)\n return tArray", "def toArray(self, *args):\n pass", "def create_argument_list(self):\n raise NotIm...
[ "0.7456242", "0.7456242", "0.69502527", "0.6623741", "0.6475026", "0.6446139", "0.64036626", "0.6372548", "0.6338635", "0.63133115", "0.6206888", "0.6176178", "0.6166731", "0.6134467", "0.61169034", "0.61010087", "0.6096035", "0.6061234", "0.6045326", "0.6043146", "0.60336053...
0.70180094
2
Return the boolean version of a number
def CBool(num): n = float(num) if n: return 1 else: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test04_boolean_operator(self):\n\n import _cppyy\n number = _cppyy.gbl.number\n\n n = number(20)\n assert n\n\n n = number(0)\n assert not n", "def bool(self):\n return bool(self.int(2))", "def _usable_number(self, num):\n real = isinstance(num, numbers.R...
[ "0.67085755", "0.6664846", "0.6640058", "0.6522127", "0.6354467", "0.6318844", "0.6232596", "0.61336666", "0.61238825", "0.61155796", "0.60645497", "0.60555285", "0.59960485", "0.5991613", "0.5946587", "0.59410155", "0.5910892", "0.5907826", "0.5907112", "0.5859945", "0.58325...
0.7226725
0
Choose from a list of options If the index is out of range then we return None. The list is indexed from 1.
def Choose(index, *args): if index <= 0: return None try: return args[index - 1] except IndexError: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def the_option_at_index(index: Union[int, str]) -> \"SelectByIndex\":\n return SelectByIndex(index)", "def choose_from(self,index_list):\r\n\r\n if len(index_list)==1:\r\n return index_list[0]\r\n\r\n if len(index_list)==2:\r\n while True:\r\n imp_temp = ...
[ "0.6644077", "0.6347903", "0.6231553", "0.6197753", "0.61250263", "0.60571647", "0.6016472", "0.6006558", "0.59368837", "0.5905473", "0.5868816", "0.5859146", "0.58081263", "0.57136124", "0.5678431", "0.5664946", "0.56619287", "0.56481266", "0.5636362", "0.56212187", "0.56143...
0.7803504
0
Try to create an OLE object This only works on windows!
def CreateObject(classname, ipaddress=None): if not win32com: raise ImportError('Not on Windows - cannot create COM object') if ipaddress: raise VB2PYNotSupported("DCOM not supported") return win32com.client.Dispatch(classname)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _winoffice(self):\n # LOG: processing_type property\n self.set_property('processing_type', 'WinOffice')\n oid = oletools.oleid.OleID(self.src_path) # First assume a valid file\n if not olefile.isOleFile(self.src_path):\n # Manual processing, may already count as suspicio...
[ "0.5287344", "0.51087296", "0.51052445", "0.5105081", "0.5038427", "0.50332063", "0.500756", "0.4986537", "0.4856805", "0.48357683", "0.4802901", "0.48026037", "0.48021197", "0.4792462", "0.4780404", "0.47746176", "0.47093895", "0.46859106", "0.46847957", "0.46789405", "0.466...
0.61552715
0
Recursively return the contents of a path matching a certain pattern The complicating part here is that when you first call Dir it return the first file. Subsequent calls to Dir with no parameters return the other files. When all the files are exhausted, we return an empty string. Since we need to remember the original...
def Dir(path=None): global _last_files if path: _last_files = glob.glob(path) if _last_files: return os.path.split(_last_files.pop(0))[1] # VB just returns the filename, not full path else: return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _traverse_path(path):\n path = Path(path)\n\n if path.is_dir():\n yield from path.rglob(\"*\")\n else:\n yield path", "def recursive_glob(path, pattern):\n for root, dirnames, filenames in os.walk(path, followlinks=True):\n for filename in fnmatch.filter(filenames, pattern):\...
[ "0.6468337", "0.62812763", "0.6253904", "0.6243336", "0.6242332", "0.62009394", "0.6172", "0.6124539", "0.61133546", "0.60786104", "0.60636413", "0.5953623", "0.5907256", "0.5900849", "0.5889049", "0.5870786", "0.58664197", "0.5845644", "0.58281845", "0.5782876", "0.5746122",...
0.60976326
9
Return the String associated with an operating system environment variable envstring Optional. String expression containing the name of an environment variable. number Optional. Numeric expression corresponding to the numeric order of the environment string in the environmentstring table. The number argument can be any...
def Environ(envstring): try: envint = int(envstring) except ValueError: return os.environ.get(envstring, "") # Is an integer - need to get the envint'th value try: return "%s=%s" % (list(os.environ.keys())[envint], list(os.environ.values())[envint]) except IndexError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getenv_string(setting, default=''):\n return os.environ.get(setting, default)", "def test_get_environment_string(self):\n pass", "def _get_env(key: str) -> str:\n value = os.getenv(key)\n assert isinstance(value, str), (\n f\"the {key} environment variable must be set and...
[ "0.6552138", "0.62165606", "0.6127461", "0.61043334", "0.5977026", "0.5974327", "0.5880715", "0.58638054", "0.58064455", "0.57543194", "0.5713163", "0.5692808", "0.56204563", "0.5599559", "0.55874664", "0.5569792", "0.5565246", "0.5565246", "0.55345047", "0.5521654", "0.55209...
0.780673
0
Erase the contents of fixed size arrays and return them to their initialized form
def Erase(*args): for array in args: array.erase()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_array():\n while len(lines) != 0:\n lines.pop()\n while len(assembly_lines) != 0:\n assembly_lines.pop()", "def clear(self):\n self._length = 0 # \"Erase\" values by ignoring them\n self._resize_arr(1) # Shrink array to original size", "def reset(self) -> List[int]...
[ "0.6855169", "0.6569751", "0.65207076", "0.6504908", "0.65039915", "0.6499138", "0.64819086", "0.6468035", "0.64670575", "0.645547", "0.6442465", "0.6350169", "0.6344785", "0.63242424", "0.61524266", "0.6151017", "0.6120013", "0.6103786", "0.5939928", "0.59066504", "0.5818406...
0.5718652
33
Determine if we reached the end of file for the particular channel
def EOF(channel): return VBFiles.EOF(channel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reached_end_of_stream(self):\n pass", "def eof_check(self) -> bool:\n eof = False\n curr_pos = self.fileobject.tell()\n # print(curr_pos, self.st_size)\n chunk = self.fileobject.read(25)\n if chunk == '':\n # Is there something on the back burner??\n ...
[ "0.66775554", "0.6652134", "0.6621471", "0.6582723", "0.65502644", "0.65502644", "0.65502644", "0.65502644", "0.65212584", "0.64770806", "0.6436078", "0.6431244", "0.6417623", "0.63535255", "0.6350785", "0.63307154", "0.61963063", "0.616728", "0.6133811", "0.611205", "0.60584...
0.72668666
0
Return the length of a given file
def FileLen(filename): return os.stat(str(filename))[6]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filelength(self):\r\n with open(self.fileName, 'rb') as f:\r\n f.seek(0, 2) # move to end of file\r\n length = f.tell() # get current position\r\n return length", "def findFLength(filename):\n f = os.popen('wc -l < {}'.format(filename))\n return int(f.read())", ...
[ "0.8291489", "0.8033439", "0.80026686", "0.79879576", "0.7905295", "0.78845304", "0.7876845", "0.78724664", "0.7828686", "0.7820954", "0.78019077", "0.7798586", "0.77813584", "0.7755042", "0.7709965", "0.7709965", "0.7709965", "0.77049273", "0.7685765", "0.76809627", "0.76497...
0.834456
0
Returns a zerobased array containing subset of a string array based on a specified filter criteria
def Filter(sourcesarray, match, include=1): if include: return Array(*[item for item in sourcesarray if item.find(match) > -1]) else: return Array(*[item for item in sourcesarray if item.find(match) == -1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_fn(arr):\n return lambda l: ([n for n in arr if n == l])", "def filter(self, filterarray):\n return FeatureSet(list(np.array(self)[np.array(filterarray)]))", "def subset(arr, start, end):\n return [[row_data for row_data in row[start[1]:end[1]]] for row in arr[start[0]:end[0]]]", "def...
[ "0.5791858", "0.57571936", "0.569493", "0.56764555", "0.56472826", "0.5434943", "0.5370937", "0.5358635", "0.52934223", "0.5246935", "0.52461225", "0.5188089", "0.51835763", "0.5115934", "0.5108654", "0.50504124", "0.5034765", "0.50195634", "0.50031567", "0.49780133", "0.4975...
0.59934235
0
Return the next available channel number
def FreeFile(): existing = VBFiles.getOpenChannels() if existing: return max(existing) + 1 else: return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_num():\r\n CHModuleFactory.num += 1\r\n return CHModuleFactory.num", "def next_num():\r\n CHModuleFactory.num += 1\r\n return CHModuleFactory.num", "def read_channel(self, channel: int, /) -> int:", "def get_channel_number(self):\n\t\tif self.have_metadata is False:\n\t\t...
[ "0.7008546", "0.7008546", "0.6429289", "0.6339084", "0.6270405", "0.60651433", "0.60513854", "0.60472274", "0.60323876", "0.6022461", "0.6022461", "0.602076", "0.60024124", "0.5945465", "0.5889599", "0.5872129", "0.58691627", "0.58441615", "0.5840897", "0.583139", "0.5770006"...
0.5667649
27
Return the hex of a value
def Hex(num): return hex(CInt(num))[2:].upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hex(cls, x):\n return c_hex(x)", "def phex(value, expected):\n return f\"{value:#0{expected}x}\"", "def hex(space, w_val):\n return space.hex(w_val)", "def hex_value(value, width=8):\n return 'X\"{0:0{1}x}\"'.format(value, width)", "def to_hex(value):\n \n try:\n hex = \"\"...
[ "0.7913689", "0.7620911", "0.7584483", "0.74646384", "0.7447684", "0.74425066", "0.7421815", "0.7405089", "0.7275429", "0.7238412", "0.7222465", "0.72069186", "0.71447605", "0.70997524", "0.7060247", "0.7028406", "0.6990753", "0.6972978", "0.6927961", "0.69186014", "0.6854936...
0.68242455
21
Return the given number of characters from the given channel
def Input(length, channelid): return VBFiles.getChars(channelid, length)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_channel(self, channel: int, /) -> int:", "async def text_channel_name_length(\n channel: Channel\n):\n return len(channel.name)", "async def thread_channel_name_length(\n channel: ('channel_group_thread', 'Select a thread channel.')\n):\n return len(channel.name)", "def read_nchars(strin...
[ "0.683386", "0.6742142", "0.64049405", "0.6127381", "0.61038464", "0.60214907", "0.5918705", "0.57647336", "0.57181555", "0.5684378", "0.5684378", "0.5680667", "0.56611496", "0.56470084", "0.56177396", "0.5590564", "0.55488926", "0.55358076", "0.5440013", "0.53991723", "0.539...
0.60267204
5
Return the location of one string in another
def InStr(*args): if len(args) == 2: text, subtext = args return text.find(subtext) + 1 else: start, text, subtext = args pos = text[start - 1:].find(subtext) if pos == -1: return 0 else: return pos + start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getIndexes(string1,string2):\n ret = []\n ind = string1.find(string2)\n \n while (ind > -1 and ind < len(string1)):\n ret.append(ind)\n ind = string1.find(string2,ind + 1)\n \n return ret", "def string_diff_index(string1, string2):\n\tfor index, char in enumerate(zip(strin...
[ "0.6757617", "0.6728925", "0.66551954", "0.66551954", "0.652416", "0.62921387", "0.62744766", "0.6200431", "0.6150294", "0.6149084", "0.61228824", "0.6122104", "0.60948277", "0.604031", "0.6006118", "0.6006075", "0.59830564", "0.59563106", "0.59426326", "0.5942483", "0.593937...
0.6005394
16
Return the location of one string in another starting from the end
def InStrRev(text, subtext, start=None, compare=None): assert compare is None, "Compare modes not allowed for InStrRev" if start is None: start = len(text) if subtext == "": return len(text) elif start > len(text): return 0 else: return text[:start].rfind(subtext) + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def between_markers(text: str, begin: str, end: str) -> str:\n # your code here\n return text[text.find(begin) + 1:text.find(end)]", "def __find_between(self, s, first, last):\n try:\n start = s.index(first) + len(first)\n end = s.index(last, start)\n return s[start:...
[ "0.7067289", "0.70230037", "0.69419134", "0.69129944", "0.6894789", "0.6823043", "0.6822284", "0.66678864", "0.6662856", "0.6499308", "0.6481355", "0.64133763", "0.64133763", "0.64133763", "0.6394084", "0.62724096", "0.6237584", "0.62355524", "0.62355524", "0.6186861", "0.617...
0.5857301
45
Return the int of a value
def Int(value): n = float(value) if -32767 <= n <= 32767: return int(n) else: raise ValueError("Out of range in Int (%s)" % n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getInteger(self):\n assert self._is_int is True\n return self._value", "def _get_value(self, value):\r\n try:\r\n return int(value)\r\n except ValueError:\r\n return self.registers[value]", "def as_int(self):\n try:\n value = int(self.valu...
[ "0.7742121", "0.7437336", "0.74170583", "0.74130017", "0.7391071", "0.73551244", "0.73231125", "0.7247027", "0.7216797", "0.72150815", "0.72150815", "0.7191005", "0.71788037", "0.7153142", "0.7125449", "0.7121554", "0.7065469", "0.7032787", "0.70047545", "0.69999975", "0.6977...
0.7011731
18
Return the closest byte of a value
def CByte(num): n = round(float(num)) if 0 <= n <= 255: return int(n) else: raise ValueError("Out of range in CByte (%s)" % n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pick_byte2(input):\n val = int(input) >> 8\n val = val & 255\n return val", "def get_abs_from_relative(byte, addr):\n int_byte = hex_to_number(byte)\n\n if int_byte > 127:\n # substract (255 - highbyte) from current address\n address = addr - (255 - int_byte)\n els...
[ "0.6406828", "0.62708426", "0.62343127", "0.62166965", "0.6060827", "0.5990512", "0.5875173", "0.5818761", "0.5801133", "0.57853144", "0.577574", "0.57714295", "0.5715779", "0.5713841", "0.5713043", "0.5693629", "0.5680981", "0.56576097", "0.56438714", "0.56430525", "0.563271...
0.5583702
23
Return the closest int of a value
def CInt(num): n = round(float(num)) if -32767 <= n <= 32767: return int(n) else: raise ValueError("Out of range in Int (%s)" % n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nearest_int(num):\n return int(np.round(num))", "def getnearest(iterable, value):\n return min(enumerate(iterable), key=lambda i: abs(i[1] - value))", "def _get_index_closest_val(list, val):\n\n return min(range(len(list)), key=lambda i: abs(list[i]-val))", "def find_nearest_idx(array: np.ar...
[ "0.78813636", "0.7478715", "0.6939693", "0.6915604", "0.688788", "0.6883412", "0.6875989", "0.68616486", "0.6823435", "0.6811447", "0.6811447", "0.6807053", "0.6807053", "0.680144", "0.6783059", "0.6664683", "0.66444117", "0.6554003", "0.65234077", "0.64769626", "0.6472988", ...
0.0
-1
Return the closest long of a value
def CLng(num): return int(round(float(num)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getnearest(iterable, value):\n return min(enumerate(iterable), key=lambda i: abs(i[1] - value))", "def floor(self, tuple_data, val, nearest = 1):\r\n retval = val - (val % nearest) if val != None else None\r\n return retval", "def find_absolute_value(x):\n return math.fabs(x)", "def c...
[ "0.6566261", "0.6300067", "0.6277293", "0.62159926", "0.620714", "0.6115691", "0.6098417", "0.6038472", "0.60353285", "0.6025655", "0.6025655", "0.59926397", "0.59917086", "0.5961563", "0.5934293", "0.5928968", "0.5906726", "0.5848198", "0.5812461", "0.5812461", "0.5800306", ...
0.0
-1
Determine if an object is an array
def IsArray(obj): return isinstance(obj, (list, tuple))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_arraylike(obj):\n if isinstance(obj, list):\n return True\n elif isinstance(obj, np.ndarray):\n return True\n elif isinstance(obj, pd.Series):\n return True\n elif isinstance(obj, pd.DataFrame):\n return True\n return False", "def is_array(schema_obj):\n\n if is...
[ "0.8131859", "0.78075755", "0.77648115", "0.774824", "0.76568", "0.75508946", "0.7546086", "0.74527085", "0.7409406", "0.73134905", "0.71920586", "0.7132876", "0.70407593", "0.70193404", "0.6981981", "0.68952763", "0.6841536", "0.6817918", "0.67961663", "0.67788136", "0.67067...
0.8533337
0
Return true if the string contains a valid number
def IsNumeric(text): try: _ = float(text) except ValueError: return 0 else: return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __has_numbers(self, input_string):\n return bool(re.search(r'\\d', input_string))", "def is_valid_numeric(inString):\r\n return is_int(inString) or is_float(inString)", "def is_number(s):\r\n try:\r\n int(s)\r\n return True\r\n except ValueError:\r\n return False", "d...
[ "0.85815185", "0.8289997", "0.8270631", "0.8235928", "0.81586367", "0.809362", "0.80234414", "0.8018477", "0.7955613", "0.79463774", "0.7942422", "0.7923322", "0.79207367", "0.79207367", "0.79156023", "0.7906338", "0.78547174", "0.7820686", "0.7810391", "0.7808907", "0.780890...
0.71502
68
Join a list of strings
def Join(sourcearray, delimeter=" "): s_list = list(map(str, sourcearray)) return delimeter.join(s_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join_list(items: Iterable[str]) -> str:\n\n return ITEM_SEPARATOR.join(items)", "def list_join(the_list):\n return ' '.join(the_list)", "def rejoin(textList):\n return ','.join(textList)", "def list_string(join_list):\n joined_list = '[{}]'.format(join_list, join_list)\n return joined_list...
[ "0.83958447", "0.8349963", "0.7805593", "0.7734362", "0.7621587", "0.7588923", "0.74768436", "0.7426868", "0.7301969", "0.72622794", "0.725474", "0.7220788", "0.7193344", "0.7181325", "0.7089761", "0.7000197", "0.6942799", "0.69354165", "0.69297576", "0.69290656", "0.69134676...
0.67666805
31
Return the lower case version of a string
def LCase(text): return text.lower()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lowercase(str):\n \n return str.lower()", "def lowercase(string):\n\n return str(string).lower()", "def first_lower(string: str) -> str:\n return string[:1].lower() + string[1:]", "def first_lower(self, s):\n if len(s) == 0:\n return s\n else:\n return s[0]...
[ "0.84548575", "0.8379391", "0.8242657", "0.8187556", "0.7893679", "0.7878993", "0.78505135", "0.7821638", "0.78137386", "0.78069407", "0.7790529", "0.7784655", "0.7725147", "0.75343394", "0.7525199", "0.7463234", "0.7463234", "0.7463234", "0.7440147", "0.7353622", "0.73380643...
0.76257986
13
Return the lower case version of a string
def UCase(text): return text.upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lowercase(str):\n \n return str.lower()", "def lowercase(string):\n\n return str(string).lower()", "def first_lower(string: str) -> str:\n return string[:1].lower() + string[1:]", "def first_lower(self, s):\n if len(s) == 0:\n return s\n else:\n return s[0]...
[ "0.845679", "0.83821094", "0.8244327", "0.81879574", "0.7895905", "0.78796196", "0.78506494", "0.7821321", "0.7816625", "0.78067446", "0.77906066", "0.778524", "0.7725389", "0.76250803", "0.75337815", "0.752441", "0.746257", "0.746257", "0.746257", "0.74395347", "0.7352319", ...
0.0
-1
Return the left most characters in the text
def Left(text, number): return text[:number]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def characters_left(self):\r\n return self.max_chars - len(self.variable.get())", "def Right(text, number):\n return text[-number:]", "def keyword_length(text):\n text = scrub_string(text)\n a = [fabs(IC(text, ncol) - ENGLISH_IC) for ncol in range(1, MAX_LEN)]\n return a.index(min(a)) + 1", ...
[ "0.76972735", "0.6075009", "0.60736424", "0.6047909", "0.6003288", "0.5963332", "0.5958215", "0.5919674", "0.59092534", "0.58404374", "0.5834725", "0.5794999", "0.579165", "0.57874477", "0.5779034", "0.5778344", "0.57569116", "0.5754645", "0.5738545", "0.57297117", "0.5723335...
0.7287347
1
Return true if the text matches the pattern The pattern is a string containing wildcards = any string of characters ? = any one character Fortunately, the fnmatch library module does this for us!
def Like(text, pattern): return fnmatch.fnmatch(text, pattern)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regex_match(text, pattern):\n try:\n pattern = re.compile(\n pattern,\n flags=re.IGNORECASE + re.UNICODE + re.MULTILINE,\n )\n except BaseException:\n return False\n return pattern.search(text) is not None", "def match(cls, t...
[ "0.7849038", "0.76907206", "0.76165885", "0.73174125", "0.7219586", "0.7164653", "0.68953913", "0.6827941", "0.67844343", "0.6763894", "0.6674704", "0.6618624", "0.66003686", "0.6596534", "0.6573882", "0.6555509", "0.655082", "0.65427655", "0.65384084", "0.65255356", "0.65145...
0.82227486
0
Return True if X implies Y Performs a bitwise comparison of identically positioned bits and sets corresponding bit in the output.
def Imp(x, y): ix, iy = int(x), int(y) if not (ix or iy): result = 1 else: result = 0 while ix or iy: # Shift result by one bit result = result << 1 # # Get the bits for comparison x_bit1 = ix & 1 y_bit1 = iy & 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __and__(self, other):\n return BitBoard(self.num & other.num)", "def __iand__(self, other):\n self.truths = self.truths | other.truths\n return self", "def __or__(self, y):\n return self.__and__(y) ^ self ^ y", "def __and__(self, other):\n return np.logical_and(self.arr...
[ "0.5854761", "0.584245", "0.58119255", "0.57361525", "0.57329947", "0.57323116", "0.5731651", "0.5688032", "0.5653026", "0.56213224", "0.5614277", "0.5599483", "0.55569243", "0.5550215", "0.55319524", "0.5531421", "0.5518942", "0.5518383", "0.5518057", "0.5518057", "0.5515992...
0.62820095
0
Load an image as a bitmap for display in a BitmapImage control
def LoadPicture(filename): return Bitmap(filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def BitmapFromImage(*args, **kwargs):\n val = _gdi_.new_BitmapFromImage(*args, **kwargs)\n return val", "def load_image(path_to_image, image_name):\n print(\"Loading: \", path_to_image + image_name, \" ...\")\n return Image.open(path_to_image + image_name)", "def set_image(self, image_URL, bkg = No...
[ "0.6720157", "0.6664427", "0.66112494", "0.6585068", "0.6558995", "0.655867", "0.65482175", "0.65217286", "0.6480828", "0.6468993", "0.6439372", "0.64379865", "0.6414927", "0.6369924", "0.6343527", "0.63117355", "0.62969905", "0.625913", "0.6219303", "0.621666", "0.62067175",...
0.7395635
0
Return the length of an open
def Lof(channel): return FileLen(VBFiles.getFile(channel).name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length(self):\n\t\treturn self.n", "def Length(self) -> int:", "def Length(self) -> int:", "def _get_length(self):\n return self._length", "def length(self):\n return self._info.length # pylint: disable=E1101", "def __len__(self):\n # TODO: Is this method used?\n return ...
[ "0.7331417", "0.73231703", "0.73231703", "0.7307505", "0.72597307", "0.7202475", "0.7133018", "0.7133018", "0.7122334", "0.7122334", "0.7110443", "0.7106786", "0.71005636", "0.7095068", "0.7087989", "0.70810914", "0.7072695", "0.7072695", "0.70564586", "0.7037376", "0.7035332...
0.0
-1
Return the log of a value
def Log(num): return math.log(float(num))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def smart_log(self, value: float) -> float:\n if value > 0:\n return math.log(value, self.log_scale)\n elif value == 0:\n return 0\n elif value < 0:\n return -(math.log(abs(value), self.log_scale))", "def log(a):", "def log(data):\n return _make.log(data...
[ "0.7308822", "0.7242207", "0.72024226", "0.7158983", "0.71488637", "0.712817", "0.6983323", "0.6977588", "0.6961718", "0.6875645", "0.68734044", "0.6836565", "0.68358636", "0.68313646", "0.68312883", "0.68312883", "0.67538655", "0.6751828", "0.6751504", "0.6725547", "0.667019...
0.69188833
9
Return the log of a value
def Exp(num): return math.exp(float(num))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def smart_log(self, value: float) -> float:\n if value > 0:\n return math.log(value, self.log_scale)\n elif value == 0:\n return 0\n elif value < 0:\n return -(math.log(abs(value), self.log_scale))", "def log(a):", "def log(data):\n return _make.log(data...
[ "0.7308822", "0.7242207", "0.72024226", "0.7158983", "0.71488637", "0.712817", "0.6983323", "0.6977588", "0.6961718", "0.69188833", "0.6875645", "0.68734044", "0.6836565", "0.68358636", "0.68313646", "0.68312883", "0.68312883", "0.67538655", "0.6751828", "0.6751504", "0.67255...
0.0
-1
Do a VB LSet Left aligns a string within a string variable, or copies a variable of one userdefined type to another variable of a different userdefined type. LSet stringvar = string LSet replaces any leftover characters in stringvar with spaces. If string is longer than stringvar, LSet places only the leftmost characte...
def LSet(var, value): return value[:len(var)] + " " * (len(var) - len(value))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RSet(var, value):\n return \" \" * (len(var) - len(value)) + value[:len(var)]", "def setto(self, s):\n\t\tlength = len(s)\n\t\tself.b = self.b[:self.j+1] + s + self.b[self.j+length+1:]\n\t\tself.k = self.j + length", "def string_swap(seq1, seq2):\n\n l1 = len(seq1)\n l2 = len(seq2)\n if l1 >= l...
[ "0.5684025", "0.52701616", "0.5119802", "0.5114327", "0.50312454", "0.5026097", "0.48728633", "0.48196828", "0.47808087", "0.46736914", "0.46631265", "0.46533147", "0.46418238", "0.4633189", "0.46091893", "0.457231", "0.45466822", "0.45454702", "0.45427588", "0.45427588", "0....
0.6876957
0
Return a date from the given string
def MakeDate(*args): raise NotImplementedError("MakeDate has not been written yet. Passsed: %s" % (args, ))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_date(string):\n try:\n return _date.fromordinal(_dateparse(string).toordinal())\n except ValueError:\n print(string)\n raise", "def string_to_date(string):\n params = string.strip().split('-')\n year = int(params[0])\n month = int(params[1])\n day =...
[ "0.841177", "0.8353382", "0.8329744", "0.80176884", "0.8000853", "0.7834745", "0.7828702", "0.7811149", "0.77817553", "0.77397263", "0.7728585", "0.76790154", "0.76249254", "0.7595951", "0.7587793", "0.7553796", "0.74999577", "0.74550366", "0.7405729", "0.7386409", "0.7325181...
0.0
-1
Return some characters from the text
def Mid(text, start, num=None): if num is None: return text[start - 1:] else: return text[(start - 1):(start + num - 1)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sliptText(text):\n\treturn [char for char in text]", "def extract_letters( idx1, idx2, text ):\r\n return text[idx1] + text[idx2]", "def getText():", "def getText():", "def getText():", "def getText():", "def getText():", "def get_encoded_text(self, text):\n\t\tencoded_text = \"\"\n\t\tfor cha...
[ "0.70941293", "0.66932213", "0.6559918", "0.6559918", "0.6559918", "0.6559918", "0.6559918", "0.6473012", "0.6440036", "0.64054656", "0.6377039", "0.63149476", "0.63024706", "0.6254722", "0.623616", "0.62248534", "0.6212132", "0.61387706", "0.61386544", "0.6130919", "0.610984...
0.0
-1
Return the oct of a value
def Oct(num): n = CInt(num) if n == 0: return "0" else: return oct(n)[2:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def oct(space, w_val):\n # XXX does this need to be a space operation?\n return space.oct(w_val)", "def to_octal(number: int) -> str:\n return oct(number).replace(\"0o\", \"\")", "def dec2oct(x):\n return oct(x)[_oct_index:]", "def hex2oct(x):\n return oct(int(x, 16))[_oct_index:]", "def oct...
[ "0.7847696", "0.7263506", "0.67337745", "0.66332436", "0.6629137", "0.6584903", "0.6495325", "0.6443444", "0.6233513", "0.616412", "0.60683763", "0.60411245", "0.59992856", "0.5767653", "0.570976", "0.5662431", "0.558206", "0.5554986", "0.55308485", "0.5519734", "0.535996", ...
0.7029287
2
Return a Long whole number representing an RGB color value The value for any argument to RGB that exceeds 255 is assumed to be 255. If any argument is less than zero then this results in a ValueError.
def RGB(r, g, b): rm = min(255, Int(r)) gm = min(255, Int(g)) bm = min(255, Int(b)) # if rm < 0 or gm < 0 or bm < 0: raise ValueError("RGB values must be >= 0, were (%s, %s, %s)" % (r, g, b)) # return ((bm * 256) + gm) * 256 + rm
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkRGBRange(value):\n\ttry:\n\t\tv = int(value)\n\t\tif 0 <= v <= 255:\n\t\t\treturn v\n\texcept:\n\t\treturn 255", "def luminance(rgb):\n \n (r, g, b) = rgb\n return (r + g + b) // 3", "def luminance(self):\n \n return (self.r + self.g + self.b) // 3", "def GetRGB(*args):\n ...
[ "0.65882045", "0.65604985", "0.6269075", "0.6263342", "0.6221491", "0.6202926", "0.62008274", "0.61333966", "0.6085049", "0.6076616", "0.6073239", "0.60437983", "0.6026575", "0.6025366", "0.6011845", "0.59900916", "0.598508", "0.59843445", "0.5974619", "0.59649116", "0.596430...
0.631638
2
Returns a string in which a specified substring has been replaced with another substring a specified number of times The return value of the Replace function is a string, with substitutions made, that begins at the position specified by start and and concludes at the end of the expression string. It is not a copy of th...
def Replace(expression, find, replace, start=1, count=-1): if find: return expression[:start - 1] + expression[start - 1:].replace(find, replace, count) else: return expression
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def REPLACE(old_text, start_num, num_chars, new_text):\n if start_num < 1:\n raise ValueError(\"start_num invalid\")\n return old_text[:start_num - 1] + new_text + old_text[start_num - 1 + num_chars:]", "def replace_in_string(string, length, substring, idx):\n return string[:idx]+substring+string[idx+len...
[ "0.69472235", "0.6930251", "0.66695154", "0.64962995", "0.63499135", "0.6083488", "0.6069293", "0.6031655", "0.6022877", "0.598244", "0.5966292", "0.5940701", "0.5935663", "0.5875606", "0.58752525", "0.58342385", "0.57794666", "0.57153463", "0.5702825", "0.56442857", "0.56126...
0.7357595
0
Return the right most characters in the text
def Right(text, number): return text[-number:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def characters_left(self):\r\n return self.max_chars - len(self.variable.get())", "def findAlphabeticallyLastWord(text):\n return max(text.split(' '))", "def get_max_character(strings):\n m=0\n for string in strings:\n for char in string:\n if char>m:\n m=char\n return m", "def lo...
[ "0.66617775", "0.6458333", "0.62414336", "0.61733127", "0.6130016", "0.6114353", "0.611083", "0.60179204", "0.59715396", "0.59695387", "0.59517705", "0.59111524", "0.59110934", "0.5877624", "0.58610624", "0.5852691", "0.58513427", "0.5844956", "0.58354264", "0.583465", "0.583...
0.67059237
0
Return a random numer and optionally seed the current state
def Rnd(value=1): global _last_rnd_number if value == 0: return _last_rnd_number elif value < 0: random.seed(value) r = random.random() _last_rnd_number = r return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rand(self):\n return self.State.rand()", "def rand(self):\n self.state = (self.a * self.state + self.c)\n return self.state", "def newRandomState(x):\n\treturn x + random.uniform(-1, 1)", "def _random_function(self, random_state):\n return random_state.rand", "def Randomize(...
[ "0.7849067", "0.76016414", "0.74548066", "0.73806417", "0.7220588", "0.7142292", "0.7122021", "0.7102938", "0.71007216", "0.70887196", "0.7062087", "0.7058775", "0.70318323", "0.70066047", "0.698479", "0.6960615", "0.6954988", "0.6939078", "0.6934731", "0.6922966", "0.6918052...
0.7022844
13
Seed the RNG In VB this doesn't return a consistent sequence so we basically ignore the seed.
def Randomize(seed=None): random.seed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seed_rng(self, seed: int | Sequence[int] | None) -> None:\n super().seed_rng(seed)\n self.rng = numpy.random.RandomState(seed)", "def seed():", "def reset(self) -> None:\n self._rng = random.default_rng(self.seed)", "def random_seed(self) -> None:\n self.seed = random.SeedSequ...
[ "0.7746183", "0.75075567", "0.74430466", "0.7436358", "0.74273276", "0.7350905", "0.73320913", "0.7319763", "0.72970265", "0.72713155", "0.7259946", "0.7226344", "0.7187404", "0.7163396", "0.71562934", "0.7142743", "0.7136299", "0.7136299", "0.7122739", "0.7114165", "0.710244...
0.74985546
2
Do a VB RSet Right aligns a string within a string variable. RSet stringvar = string If stringvar is longer than string, RSet replaces any leftover characters in stringvar with spaces, back to its beginning.
def RSet(var, value): return " " * (len(var) - len(value)) + value[:len(var)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def LSet(var, value):\n return value[:len(var)] + \" \" * (len(var) - len(value))", "def rstring(string):\n return RTEXT + string + NTEXT", "def _padright(width, s):\n fmt = \"{0:<%ds}\" % width\n return fmt.format(s)", "def rightpad(field, length):\r\n field = str(field)\r\n field_length =...
[ "0.66794926", "0.5602928", "0.5465059", "0.52692467", "0.52135104", "0.5187947", "0.5178085", "0.51736885", "0.51162773", "0.50952494", "0.50288147", "0.5014927", "0.5000405", "0.4966606", "0.49568656", "0.49412823", "0.4936924", "0.49336472", "0.49120805", "0.4890213", "0.48...
0.7263928
0
Return the current 'cursor' position in the specified channel
def Seek(channel): return VBFiles.getFile(Int(channel)).tell() + 1 # VB starts at 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vim_cursor():\n\n line, nbyte = vim.current.window.cursor\n\n raw_bytes = vim.current.buffer[line-1][:nbyte]\n\n vc = vim.eval(\"&encoding\")\n col = len(raw_bytes.decode(vc))\n return line, col", "def _get_cursor_index_position(self) :\n return self._cursor_index_po...
[ "0.6779574", "0.67783344", "0.6728883", "0.663525", "0.65149385", "0.65146947", "0.6468811", "0.6323285", "0.62638175", "0.61799127", "0.6126705", "0.60865986", "0.6084953", "0.60767543", "0.59718573", "0.59710646", "0.5969843", "0.59496564", "0.59293586", "0.59293586", "0.58...
0.59584856
17
Return the name for a section
def _getSettingName(self, section): return "%s.%s" % (self.appname, section)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sectionName(self) -> str:\n return(self._sectionName)", "def rce_section_get_name(config: ConfigParser, section: str) -> Optional[str]:\n m = re.search(r\"(?i:subcluster|resource entry|pilot)\\s+(.+)\", section)\n if not m:\n return\n default_name = m.group(1)\n return config[sectio...
[ "0.8327065", "0.78583246", "0.7617526", "0.7327663", "0.7238623", "0.7150651", "0.69327253", "0.6919737", "0.6805186", "0.6694156", "0.6586379", "0.6568279", "0.6431507", "0.6403175", "0.6387087", "0.633381", "0.6268012", "0.625452", "0.62321115", "0.6220018", "0.6212364", ...
0.66939723
10
Return all the items in a sections
def getAll(self, section): thissection = self._getSettingName(section) options = self._config.options(thissection) ret = vbObjectInitialize(size=(len(options) - 1, 1), objtype=str) for idx in range(len(options)): ret[idx, 0] = options[idx] ret[idx, 1] = self[secti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sections():\n return Section.objects.all()", "def sections(self):\n return list(self._dict)", "def sections(self):\n raise NotImplementedError()", "def _getSections(self):\r\n\r\n sections = self.cf.sections()\r\n return sections", "def items(self):\n\t\treturn self.c...
[ "0.7650896", "0.72542983", "0.70622486", "0.7014934", "0.6969907", "0.6969871", "0.6874632", "0.6811706", "0.6794798", "0.6790805", "0.66383", "0.65431523", "0.6489565", "0.64714074", "0.64626694", "0.64626694", "0.6415491", "0.6373286", "0.63727736", "0.63726866", "0.6363237...
0.0
-1
Delete a setting from the settings file
def delete(self, section, name): section = self._getSettingName(section) self._config.remove_option(section, name) self.save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DeleteSetting(appname, section, key):\n settings = _OptionsDB(appname)\n settings.delete(section, key)", "def delsetting(name):\r\n if '__delattr__' in settings.__class__.__dict__:\r\n delattr(settings, name)\r\n else:\r\n delattr(settings._wrapped, name)", "def clearSetting(self,...
[ "0.7704263", "0.753187", "0.7086533", "0.699388", "0.6632526", "0.65564454", "0.63910055", "0.6343383", "0.6322138", "0.63034177", "0.62049615", "0.6186708", "0.61116606", "0.6107693", "0.6049", "0.59868664", "0.59740686", "0.5955069", "0.5952441", "0.5904571", "0.5896068", ...
0.68263763
4
Get a setting from the central setting file
def GetSetting(appname, section, key, default=None): settings = _OptionsDB(appname) try: return settings[section, key] except config.configparser.Error: if default is not None: return default raise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settings():\n return _get_settings()[1]", "def get_config_setting(setting: str) -> Any:\n try:\n with open('config.json') as config_file:\n data = json.load(config_file)\n return data[setting]\n except Exception as e:\n print(f'Failed get json setting. Error: {e}')", "def get_setting(self,...
[ "0.75953954", "0.7489524", "0.7417485", "0.73691297", "0.73165554", "0.7299111", "0.71707577", "0.7038714", "0.69166815", "0.6869451", "0.6869085", "0.68282914", "0.6781696", "0.6778681", "0.6777153", "0.67645085", "0.6737452", "0.6735574", "0.66980755", "0.6696956", "0.66344...
0.6653763
20
Get all settings from the central setting file
def GetAllSettings(appname, section): settings = _OptionsDB(appname) return settings.getAll(section)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_settings():\n with open('config/config.json') as data_file:\n settings = json.load(data_file)\n return settings", "def read_settings(self):\n self.settings = read_settings(self.settings_path)", "def get_settings():\n settings = {}\n for setting in cfg.displayable_setting:\n ...
[ "0.73821163", "0.7297957", "0.7174996", "0.7174996", "0.71714115", "0.7128893", "0.7125209", "0.70860004", "0.708334", "0.7027854", "0.7017378", "0.7000494", "0.69687414", "0.6960312", "0.69140553", "0.6909096", "0.688501", "0.6881945", "0.68702465", "0.6831432", "0.6824991",...
0.64863575
44
Set a setting in the central setting file
def SaveSetting(appname, section, key, value): settings = _OptionsDB(appname) settings[section, key] = str(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_setting(key, value):\n with sublime_haskell_settings as settings:\n settings[key] = value\n get_settings().set(key, value)\n save_settings()", "def settings(self, value):\n self._settings = value", "def setSetting(self,settingId, value):\r\n settingXmlFile = xbmc.translate...
[ "0.7242095", "0.6988728", "0.6955638", "0.68899655", "0.6869934", "0.6865916", "0.6863022", "0.68300587", "0.6771902", "0.6723841", "0.66841304", "0.66478336", "0.66049504", "0.6603807", "0.65896964", "0.65441775", "0.65088403", "0.6436909", "0.64265513", "0.64139295", "0.639...
0.59183204
55
Delete a setting in the central setting file
def DeleteSetting(appname, section, key): settings = _OptionsDB(appname) settings.delete(section, key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delsetting(name):\r\n if '__delattr__' in settings.__class__.__dict__:\r\n delattr(settings, name)\r\n else:\r\n delattr(settings._wrapped, name)", "def clearSetting(self, name: unicode) -> None:\n ...", "def remove_setting(self, category, setting):\n category_instance = s...
[ "0.72362244", "0.7093934", "0.66168183", "0.6608237", "0.65604854", "0.64848113", "0.6457743", "0.63939166", "0.635336", "0.6336297", "0.6328854", "0.623674", "0.61954266", "0.6193954", "0.6153951", "0.612454", "0.604961", "0.60189205", "0.6010476", "0.5962726", "0.5918145", ...
0.754308
0
Return the sign of a number
def Sgn(num): n = float(num) if n < 0: return -1 elif n == 0: return 0 else: return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign(num: float):\n return 1 if num >= 0 else -1", "def _sign(self, number):\n return cmp(number,0)", "def sign(x):\n if x >= 0:\n return 1\n else:\n return -1", "def sign(x):\n if x >= 0:\n return 1\n return -1", "def sign(n):\n return (n > 0) - (n < 0)", ...
[ "0.86808735", "0.8180675", "0.8142889", "0.8080412", "0.805586", "0.80516213", "0.7749056", "0.76728755", "0.76457745", "0.7544772", "0.7440243", "0.73207474", "0.719852", "0.7096866", "0.69429314", "0.65968424", "0.65949637", "0.65688556", "0.6490249", "0.6485607", "0.648235...
0.5939975
44
Return a repeated number of string items
def String(num=None, text=None, value=None): if value: return VBString(value) elif num is None and text is None: return VBString() else: return VBString(text[:1] * CInt(num))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeat_string_n_times(string, count):\r\n return string * int(count)", "def repeat(word, repetitions):\n return word * repetitions", "def generate_string_list(self, n):\n template_str = 'string_'\n string_list = [template_str + str(i) for i in range(n)]\n return string_list",...
[ "0.7282178", "0.6784161", "0.64937747", "0.64474064", "0.6415712", "0.6369589", "0.636149", "0.6342814", "0.6186498", "0.6181698", "0.6152874", "0.61449236", "0.6133988", "0.6052786", "0.6045444", "0.5994972", "0.59893745", "0.59678847", "0.59678847", "0.5956821", "0.5936408"...
0.0
-1
Return a repeated number of spaces
def Space(num): return String(num, " ")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html_space(n):\n return \" \" * n", "def space(n):\n rstr = \"&nbsp;\" * 4 * n\n return rstr", "def get_pad(self, n):\n pad = \"\"\n for i in range(0, n):\n pad += \" \"\n return pad", "def add_space(s,n):\n t = \"\"\n for i in xrange(len(s)):\n # Ad...
[ "0.72629565", "0.7137454", "0.69357646", "0.6886025", "0.68764853", "0.6821072", "0.66880006", "0.6525293", "0.64707816", "0.6324235", "0.6222161", "0.6219502", "0.61832476", "0.61555964", "0.6122012", "0.61166173", "0.6110725", "0.6061298", "0.6054114", "0.60442823", "0.6028...
0.6417224
9
Split a string using the delimiter If the optional limit is present then this defines the number of items returned. The compare is used for different string comparison types in VB, but this is not implemented at the moment
def Split(text, delimiter=" ", limit=-1, compare=None): if compare is not None: raise VB2PYNotSupported("Compare options for Split are not currently supported") # if limit == 0: return VBArray(0) elif limit > 0: return Array(*str(text).split(delimiter, limit - 1)) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(self, sep=None, maxsplit=None):\n return split(self, sep, maxsplit)", "def split(self, string, maxsplit=MAX_INT, include_separators=False):\n return self._split(\n string, maxsplit=maxsplit, include_separators=include_separators\n )", "def explode(delim, val, limit = N...
[ "0.6533399", "0.64230263", "0.6183412", "0.60216355", "0.5943199", "0.5683144", "0.5631569", "0.55919874", "0.5572784", "0.5486138", "0.5480019", "0.5479996", "0.54729277", "0.5463248", "0.54153234", "0.5413893", "0.5308845", "0.5301453", "0.5294461", "0.52909225", "0.528777"...
0.7360037
0
Return the square root of a value
def Sqr(num): return math.sqrt(float(num))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_sqrt(x):\n square_root = x**(0.5)\n return square_root", "def sqrt(x):\n return 0.0", "def root_mean_square_value( values ):\n return ma.sqrt(mean_square_value( values ))", "def _square_rooted(x):\n return sqrt(sum([(a * a) for a in x]))", "def square_root(value):\n # Init\n roo...
[ "0.81385094", "0.7903101", "0.7839811", "0.7803085", "0.7732751", "0.7569638", "0.7558118", "0.7446835", "0.7419178", "0.74028677", "0.7229052", "0.7227346", "0.720231", "0.7157441", "0.7054696", "0.7023865", "0.7021639", "0.7007933", "0.69974744", "0.69553363", "0.69479114",...
0.75144655
7
Return the sin of a value
def Sin(num): return math.sin(float(num))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sin(x):\n return 0.0", "def sin(data):\n return _make.sin(data)", "def sin(self, a):\n return math.sin(a)", "def sin(x):\n raise NotImplementedError", "def sin(x):\r\n # see decorator for function body\r", "def sin(x):\n\tgetcontext().prec += 2\n\t#if abs(x) > 2 * pi:\n\t\t#x = x %...
[ "0.8602459", "0.8510355", "0.8509288", "0.84776354", "0.7936983", "0.79003245", "0.7870641", "0.7859331", "0.7832021", "0.7789588", "0.77684736", "0.7747511", "0.77271247", "0.763211", "0.7580015", "0.7526183", "0.74847186", "0.74406946", "0.74406946", "0.74406946", "0.744069...
0.8253866
4
Return the cosine of a value
def Cos(num): return math.cos(float(num))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cos(self, a):\n return math.cos(a)", "def cos(x):\n return 0.0", "def cos(data):\n return _make.cos(data)", "def acos(value): # pragma: no cover\n if value < -1:\n value = -1.0\n elif value > 1:\n value = 1.0\n return np.arccos(value)", "def cos(x):\n raise NotIm...
[ "0.8057375", "0.7956048", "0.79287744", "0.77682596", "0.7743804", "0.7645472", "0.7506345", "0.749766", "0.74879783", "0.7394847", "0.7356708", "0.73260015", "0.7294589", "0.7291704", "0.72832996", "0.72112995", "0.72097623", "0.7185758", "0.7144808", "0.713052", "0.7110662"...
0.7785646
3
Return the tangent of a value
def Tan(num): return math.tan(float(num))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tangent(self, p):\n p = array(p, float)\n v = (p - self.o)\n v /= norm(v)\n b = self.o + ((cross(v, self.N) - v) / 3)*self.r\n mb = _mirror_(self.o, p, b) \n mbb = mb - b\n return mbb/norm(mbb)", "def tangent(self, param, diff=0, xyz=False):\n return se...
[ "0.78379315", "0.74969125", "0.7096943", "0.70634794", "0.70211816", "0.7007155", "0.69514745", "0.6938022", "0.6917119", "0.6880844", "0.68235004", "0.67923236", "0.67026263", "0.6697062", "0.66717136", "0.6637665", "0.65839916", "0.6564467", "0.6497807", "0.6492798", "0.646...
0.6288271
30
Return the arctangent of a value
def Atn(num): return math.atan(float(num))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atan(self, x):\n return self.arctan(x)", "def atan(self, a):\n return math.atan(a)", "def arctan(self):\n return type(self)(self.parent(),\n self._simplify(self._express.arctan()))", "def atan (cls, x) :\n return Angle_R (math.atan (x))", "def atan(data)...
[ "0.7464375", "0.7268587", "0.6918107", "0.68998563", "0.68844646", "0.6881485", "0.684194", "0.6830847", "0.6821495", "0.68148017", "0.6796748", "0.6778596", "0.6680247", "0.66651285", "0.65593255", "0.6482144", "0.64635295", "0.64569545", "0.6435361", "0.64145696", "0.639045...
0.6936045
2
Choose from a list of expression each with its own condition The arguments are presented as a sequence of condition, expression pairs and the first condition that returns a true causes its expression to be returned. If no conditions are true then the function returns None
def Switch(*args): arg_list = list(args) arg_list.reverse() # while arg_list: cond, expr = arg_list.pop(), arg_list.pop() if cond: return expr return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_if(cond,seq):\n for x in seq:\n if cond(x): return x\n return None", "def find_if(cond,seq):\n for x in seq:\n if cond(x): return x\n return None", "def or_list(conditionList):\n return functools.reduce(numpy.logical_or, conditionList)", "def select(condlist, choicelist,...
[ "0.6422477", "0.6422477", "0.6359925", "0.635987", "0.6204265", "0.6166474", "0.6049754", "0.5968415", "0.59649223", "0.59408706", "0.58751965", "0.5863526", "0.58623445", "0.5844146", "0.57734656", "0.5697268", "0.56084704", "0.5544484", "0.5540427", "0.55290014", "0.5500933...
0.65245444
0
Returns a Single representing the number of seconds elapsed since midnight
def Timer(): ltime = time.localtime() h, m, s = ltime[3:6] return h * 3600.0 + m * 60.0 + s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_elapsed_seconds():\n\tutcnow = datetime.utcnow()\n\tmidnight_utc = datetime.combine(utcnow.date(), time(0))\n\tdelta = utcnow - midnight_utc\n\treturn delta.total_seconds()", "def _current_time_seconds(self):\n return int(round(time.time()))", "def current_time_seconds(self):\n return int...
[ "0.7415457", "0.72629374", "0.71441406", "0.70840555", "0.70079", "0.6985477", "0.6985477", "0.6985477", "0.6985477", "0.6985477", "0.6985477", "0.69444555", "0.6891631", "0.6846506", "0.68419987", "0.6840068", "0.6831201", "0.68227464", "0.68164074", "0.6791984", "0.67863184...
0.65945977
34
Strip spaces from the text
def Trim(text): return str(text).strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_whitespace(self, text):\n\t\treturn text.strip()", "def del_whitespace(selfs, text):\n\t\treturn text.replace(' ', '')", "def _remove_whitespaces(self, text: str) -> str:\n return \" \".join(re.sub(\"\\xa0\", \" \", str(text)).split())", "def remove_whitespaces(text: str) -> str:\n re...
[ "0.8527219", "0.83403665", "0.83012366", "0.82432264", "0.8120081", "0.8120081", "0.79684293", "0.7852159", "0.782754", "0.7822334", "0.77937025", "0.775798", "0.7756941", "0.7750124", "0.7694335", "0.7694335", "0.7694335", "0.7694335", "0.7694335", "0.7694335", "0.7621785", ...
0.7728063
14
Strip spaces from the left of the text
def LTrim(text): return str(text).lstrip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_whitespaces(text: str) -> str:\n return text.lstrip().rstrip()", "def strip_whitespace(self, text):\n\t\treturn text.strip()", "def del_whitespace(selfs, text):\n\t\treturn text.replace(' ', '')", "def _remove_whitespaces(self, text: str) -> str:\n return \" \".join(re.sub(\"\\xa0\",...
[ "0.81170166", "0.8051765", "0.80383635", "0.8011214", "0.78760153", "0.78730035", "0.7831853", "0.77594376", "0.77594376", "0.7677808", "0.764658", "0.762794", "0.7541146", "0.7530546", "0.75025547", "0.7499387", "0.7464309", "0.7422635", "0.73698944", "0.7335348", "0.7285237...
0.7185453
22
Strip spaces from the right of the text
def RTrim(text): return str(text).rstrip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_whitespace(selfs, text):\n\t\treturn text.replace(' ', '')", "def remove_whitespaces(text: str) -> str:\n return text.lstrip().rstrip()", "def strip_whitespace(self, text):\n\t\treturn text.strip()", "def remove_extra_space(text):\n text = \" \".join(text.split())\n return text", "def ...
[ "0.78611827", "0.7793091", "0.77885216", "0.77223647", "0.7602532", "0.7602532", "0.7588654", "0.75722104", "0.75217164", "0.746933", "0.74691653", "0.73856366", "0.734969", "0.7313776", "0.7304019", "0.7202107", "0.7121464", "0.7121248", "0.7105273", "0.7098501", "0.70901364...
0.7043861
22
Return the upper bound for the index
def UBound(obj, dimension=1): try: return obj.__ubound__(dimension) except AttributeError: # # Might have been called for a list so give this a try if dimension == 1: try: return len(obj) except TypeError: pass raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_upper_bound(self):\n return self._upper_bound", "def upper_bound(self) -> float:\n ...", "def getUpperBound(self) -> int:\n return self.upper_bound", "def storage_upper_bound(index):\n i = index[0]\n return storage_para[i].pmax", "def best_upper_bound(self):\n ...
[ "0.81943715", "0.79659086", "0.78783196", "0.76580983", "0.707804", "0.69440764", "0.68226254", "0.671483", "0.66756105", "0.666539", "0.66157496", "0.66157496", "0.6594715", "0.65075356", "0.64967626", "0.64928114", "0.64666486", "0.6462994", "0.6452403", "0.6446879", "0.642...
0.0
-1
Return the lower bound for the index
def LBound(obj, dimension=1): try: return obj.__lbound__(dimension) except AttributeError: raise ValueError("LBound called for invalid object")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lower_bound(self):\n return self._lower_bound", "def get_lower_bound(self):\n return self._lower_bound", "def getLowerBound(self) -> int:\n return self.lower_bound", "def lower_bound(self) -> float:\n ...", "def _get_observation_lower_bound(self):\n lower_bound = -self._g...
[ "0.8172087", "0.8172087", "0.79958177", "0.79243636", "0.74158543", "0.72117484", "0.71163696", "0.7064927", "0.6982329", "0.68823856", "0.67611873", "0.6757364", "0.6720099", "0.6641639", "0.65721923", "0.6535898", "0.64801216", "0.64339435", "0.64276433", "0.6407137", "0.63...
0.0
-1
Return the value of a string This function finds the longest leftmost number in the string and returns it. If there are no valid numbers then it returns 0. The method chosen here is very poor we just keep trying to convert the string to a float and just use the last successful as we increase the size of the string. A R...
def Val(text): best = 0 for idx in range(len(text)): try: best = float(text[:idx + 1]) except ValueError: pass return best
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_number(s:str):\n array = re.findall(r'[0-9]+', s)\n if array.__len__() is 0:\n return -1\n return int(array[-1])", "def _get_number_from_string(x):\n try:\n return float(x)\n except ValueError:\n raise ValueError('Unknown element')", "def float(s...
[ "0.66451454", "0.64589363", "0.63910717", "0.6363433", "0.63494194", "0.630394", "0.61770207", "0.616602", "0.6151756", "0.61081976", "0.60855013", "0.6082988", "0.60598946", "0.6020905", "0.60046595", "0.5965904", "0.5914045", "0.58885247", "0.58840555", "0.58837414", "0.584...
0.7048725
0
Mimic the range in a for statement VB's range is inclusive and can include noninteger elements so we use an generator.
def vbForRange(start, stop, step=1): num_repeats = (stop - start) / step if num_repeats < 0: return current = start while num_repeats >= 0: yield current current += step num_repeats -= 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simple_range(limit):\n i = 0\n while i < limit:\n yield i\n i += 1", "def grange(start=1, step=1, stop=None):\n \n if stop is None:\n x = int(start)\n dif = int(step)\n while True:\n yield x\n x += dif\n else:\n for x in range(sta...
[ "0.73530185", "0.6914277", "0.6667311", "0.6637387", "0.66086686", "0.65751654", "0.6573731", "0.6543274", "0.65405655", "0.65386635", "0.6509309", "0.6481902", "0.64796376", "0.6473768", "0.64675224", "0.6466789", "0.64587253", "0.6442405", "0.6322762", "0.6307526", "0.63030...
0.6681918
2
Return arguments passed in an event VB Control events have parameters passed in the call, eg MouseMove(Button, Shift, X, Y). In vb2py.PythonCard the event parameters are all passed as a single event object. We can easily unpack the attributes back to the values in the Event Handler but we also have to account for the f...
def vbGetEventArgs(names, arguments): # arguments is the *args tuple # # Is there only one parameter if len(arguments) == 1: # Try to unpack names from this argument try: ret = [] for name in names: if name.endswith("()"): ret.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_args(self, expr, args, kwargs):\n assert expr is not None\n\n if not kwargs:\n return args\n\n if kwargs and not isinstance(expr, Function):\n raise Exception(\"can only supply keyword parameters for a \"\n \"relay.Function, found {...
[ "0.5983954", "0.58679104", "0.5814009", "0.55884343", "0.5439283", "0.5410738", "0.53881556", "0.5294634", "0.52934223", "0.5280633", "0.52511024", "0.5245851", "0.52443963", "0.5239429", "0.5231915", "0.5231915", "0.5226041", "0.5197778", "0.51946074", "0.5181564", "0.517265...
0.69104767
0
Return the default value for a particular argument of a function
def VBGetMissingArgument(fn, argument_index): try: args, varargs, varkw, defaults = inspect.getargspec(fn) except Exception as err: raise VB2PYCodeError("Unable to determine default argument for arg %d of %s: %s" % ( argument_index, fn, err)) # # Find correct argument default...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f_onearg_and_default(self, arg1, default = 1) :\n pass", "def default_arg(request, arg, typ=None, default=None):\n\tif arg not in request.values:\n\t\treturn default\n\tif typ is None:\n\t\treturn request.values[arg]\n\ttry:\n\t\treturn typ(request.values[arg])\n\texcept ValueError:\n\t\treturn defaul...
[ "0.768924", "0.7528626", "0.7298081", "0.72153544", "0.71774876", "0.714499", "0.6843193", "0.6843193", "0.6802212", "0.6786841", "0.6766655", "0.6736836", "0.667706", "0.6653457", "0.6634905", "0.6624111", "0.6621022", "0.6583237", "0.6553943", "0.6545582", "0.65436393", "...
0.64707315
22
Return a new object with the given size and type
def vbObjectInitialize(size=None, objtype=None, preserve=None): if size is None: size = [0] # # Create the object def getObj(): if len(size) == 1: return objtype() else: return vbObjectInitialize(size[1:], objtype) ret = VBArray(size[0], getObj) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, size):\n self.size = size", "def __init__(self, size):\n self.size = size", "def __init__(self, size: Size) -> None:\n self.size = size", "def __init__(self, size=0):\n if type(size) != int:\n raise TypeError(\"size must be an integer\")\n elif...
[ "0.7041559", "0.7041559", "0.70401764", "0.6963839", "0.68794274", "0.68606955", "0.68606955", "0.68606955", "0.68564", "0.68288684", "0.68288684", "0.67912376", "0.6765983", "0.6705111", "0.66971445", "0.65158397", "0.6454853", "0.64246666", "0.63534606", "0.6317422", "0.628...
0.56059283
71
Used to flag a conversion error of some kind that should fail when executed
def VB2PY_ERROR(text): raise Exception('VB2PY conversion error: %s' % text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cast_fail(self, option, value):\n with pytest.raises(errors.BisonError):\n option.cast(value)", "def test_cast_string_failure(self) -> None:\n self.flag.flag_type = None\n self.assertRaises(ValueError, self.flag.cast_string, '42')", "def test_convert_invalid_unit():\n ...
[ "0.6797089", "0.6717357", "0.64959335", "0.6459775", "0.63889784", "0.6295199", "0.6264937", "0.6160858", "0.6140453", "0.6111059", "0.6066067", "0.60413814", "0.60263824", "0.6015477", "0.599505", "0.59867996", "0.595823", "0.59318465", "0.59119284", "0.58867276", "0.5880973...
0.5671561
40
Return the AddressOf a variable This does not work in Python and likely the code using it is going to need significant work so we just throw an error here.
def AddressOf(obj): raise NotImplementedError('AddressOf does not work in Python and code will likely need refactoring')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def LocalAddress(self) -> _n_5_t_0:", "def get_address_value(obj):\n no_dynamic = obj.GetDynamicValue(lldb.eNoDynamicValues)\n \"\"\":type: lldb.SBValue\"\"\"\n address = no_dynamic.GetAddress()\n \"\"\":type: lldb.SBAddress\"\"\"\n address_value = address.GetFileAddress()\n \"\"\":type: int\"\...
[ "0.6837938", "0.67366517", "0.6421531", "0.61839086", "0.6139431", "0.60965663", "0.6088812", "0.6042399", "0.6003365", "0.5988634", "0.5901362", "0.5862584", "0.58369744", "0.58360106", "0.58224577", "0.5810336", "0.5739616", "0.56862915", "0.56791055", "0.56228083", "0.5603...
0.69282764
0
The exit status of the process (an integer), or ``None`` if it has not exited. Negative values indicate termination due to a signal (on UNIX only).
def returncode(self): return self._proc.returncode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exit_code(self):\n return self._process.exitcode", "def exit_status(self):\n return self._exit_status", "def exit_code(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"exit_code\")", "def exit_code(self) -> int:\n _args: list[Arg] = []\n _ctx = self._se...
[ "0.77294195", "0.75537336", "0.7357914", "0.713574", "0.7070254", "0.705515", "0.69850767", "0.6877768", "0.686507", "0.68427026", "0.67148244", "0.6709256", "0.6637215", "0.6616941", "0.65668213", "0.642748", "0.6415429", "0.63409775", "0.62778854", "0.61155397", "0.60257536...
0.6897369
7
Close any pipes we have to the process (both input and output) and wait for it to exit. If cancelled, kills the process and waits for it to finish exiting before propagating the cancellation.
async def aclose(self): with _core.open_cancel_scope(shield=True): if self.stdin is not None: await self.stdin.aclose() if self.stdout is not None: await self.stdout.aclose() if self.stderr is not None: await self.stderr.aclose(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _cleanup_proc(self):\n logger.debug(\"{}: Cleaning up and waiting for process to exit\".format(\n self))\n try:\n self._loop.remove_reader(self._proc.stdout)\n self._proc.stdout.close()\n self...
[ "0.6373793", "0.62173724", "0.6169654", "0.61305934", "0.60700935", "0.59654534", "0.5956748", "0.5948705", "0.5810264", "0.5779637", "0.5764489", "0.57414836", "0.5654102", "0.563886", "0.5624931", "0.5586638", "0.55606866", "0.5533835", "0.54964846", "0.5493101", "0.5481666...
0.63417107
1
Block until the process exits.
async def wait(self): if self.poll() is None: await wait_child_exiting(self) self._proc.wait() else: await _core.checkpoint() return self.returncode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait(self):\n self.Popen.wait()", "def wait_finish(self):\r\n self.proc.join()", "def wait_until_exit(self):\n\n if self._timeout is None:\n raise Exception(\"Thread will never exit. Use stop or specify timeout when starting it!\")\n\n self._thread.join()\n sel...
[ "0.7475609", "0.73495406", "0.7018188", "0.6967537", "0.6930338", "0.68883586", "0.68392646", "0.6805663", "0.67495924", "0.6738889", "0.6737869", "0.67205113", "0.670054", "0.6674701", "0.6672728", "0.6671035", "0.6658206", "0.6646287", "0.65988755", "0.65894777", "0.6589477...
0.6822548
7