query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Use instead of 'NA' for multiprocessing arrays for floats
def check_main(value, sfigs, stat): if isinstance(value, float): if np.isclose(value, my_NA): return 'NA' # Do not round position information elif stat in ["physpos", "dist_physpos"]: return str(value) else: return str(round_to_n(value, sfigs)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fma_nan_param_nanarray_nanarray_nanarray_none_b_157(self):\n\t\t# The expected results.\n\t\texpected = [(x * y + z) for x,y,z in zip(self.nanarrayx, self.nanarrayy, self.nanarrayz)]\n\n\t\t# Exceptions are turned off so we can use the results to test for correct values.\n\t\tarrayfunc.fma(self.nanarrayx,...
[ "0.60194516", "0.60182357", "0.5973354", "0.59729075", "0.5951667", "0.5936688", "0.59348536", "0.59302145", "0.5929193", "0.5924291", "0.59230524", "0.591046", "0.5906386", "0.5905886", "0.5889434", "0.5889431", "0.5884194", "0.5883888", "0.58693504", "0.5867881", "0.586245"...
0.0
-1
Find insecure headers from the gathered headers.
def find_insecure_headers(self): headers_dict = self.gather_headers() try: xss_protect = headers_dict['X-XSS-Protection'] if xss_protect != '1; mode=block': self.logger.log( "XSS Protection NOT set properly.", logtype="warn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_important_headers():\r\n list_important_headers = ['X-Frame-Options', 'Referrer-Policy', 'Permissions-Policy',\r\n 'X-XSS-Protection', 'Strict-Transport-Security', 'X-Content-Type-Options']\r\n list_headers_not_defined = []\r\n http_request = requests.get(url)\r\n ...
[ "0.6479786", "0.5830397", "0.57203007", "0.5445407", "0.5274052", "0.5198477", "0.5191335", "0.518404", "0.5152374", "0.51470995", "0.5134563", "0.51314926", "0.5131039", "0.51200885", "0.51131123", "0.5108264", "0.5099634", "0.508319", "0.50823754", "0.506054", "0.50518453",...
0.7353875
0
Helper function that retrieves the air distance in kilometers for two pycons
def _km_distance(origin, destination): lon1, lat1, lon2, lat2 = map( radians, [origin.lon, origin.lat, destination.lon, destination.lat] ) return 6371 * ( acos(sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon1 - lon2)) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_geo_distance(c_1: City, c_2: City) -> float:\n return great_circle(c_1.coordinates, c_2.coordinates).km", "def get_distance(self): \n return self.from_station.distance_to(self.to_station)", "def _get_distance_in_meters(a, b):\n return 1000 * math.sqrt(\n pow((b[0]...
[ "0.69017816", "0.6863262", "0.6857653", "0.67921215", "0.673452", "0.65906703", "0.65906703", "0.65906703", "0.65906703", "0.65827817", "0.6531554", "0.6472499", "0.6467679", "0.6448047", "0.6447639", "0.6438406", "0.63751113", "0.63706785", "0.6313624", "0.6309994", "0.62960...
0.0
-1
Return the total travel distance of your PyCon journey in kilometers rounded to one decimal.
def total_travel_distance(journey): return round(sum(leg.distance for leg in journey),2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_total_distance(self):\n total_distance = 0.0\n for trip in self.trips:\n total_distance += trip.get_distance()\n \n return total_distance", "def getDistance(self):\n # ˅\n return float(self.config(['projector_distance']['between_projector_distance']))\...
[ "0.7430315", "0.6880409", "0.6670747", "0.6571537", "0.6462652", "0.6456562", "0.6397196", "0.6383612", "0.6376394", "0.6356906", "0.62958044", "0.6236837", "0.62256426", "0.62199736", "0.6208623", "0.6202793", "0.6178393", "0.6164279", "0.6163497", "0.61632335", "0.6151037",...
0.7519869
0
tests whether the keymaps (and keymap entries) of different Refresher leak one into another
def test_exit_label_leakage(self): i = get_mock_input() o = get_mock_output() r1 = Refresher(lambda: "Hello", i, o, name=r_name + "1", keymap={"KEY_LEFT":lambda: True}) r2 = Refresher(lambda: "Hello", i, o, name=r_name + "2", keymap={"KEY_LEFT":lambda: False}) r3 = Refresher(lamb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_changed(self):\n objs_a = list(self.val_a.all())\n objs_b = list(self.val_b.all())\n\n map_forwards, map_backwards, added, deleted = self.get_mapping(objs_a, objs_b)\n\n if added or deleted:\n return True\n\n for a_idx, b_idx in map_forwards.items():\n ...
[ "0.5368731", "0.53161925", "0.53142047", "0.53047085", "0.5292647", "0.5231324", "0.52067566", "0.52050775", "0.51706207", "0.51682985", "0.5152845", "0.51105887", "0.5109247", "0.5109053", "0.5089028", "0.5055209", "0.50495124", "0.5047237", "0.50209093", "0.50136065", "0.50...
0.651978
0
Dimensional diffusivity in negative particle. Note this is defined as a function of stochiometry
def D_n_dimensional(self, sto, T): inputs = {"Negative particle stoichiometry": sto, "Temperature [K]": T} if self.options["particle cracking"] != "none": mech_effects = ( 1 + self.theta_n_dim * (sto * self.c_n_max - self.c_n_0_dim) / T ) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def D_p_dimensional(self, sto, T):\n inputs = {\"Positive particle stoichiometry\": sto, \"Temperature [K]\": T}\n if self.options[\"particle cracking\"] != \"none\":\n mech_effects = (\n 1 + self.theta_p_dim * (sto * self.c_p_max - self.c_p_0_dim) / T\n )\n ...
[ "0.6863082", "0.6533661", "0.64980775", "0.64693135", "0.63858384", "0.6281535", "0.6217575", "0.6134653", "0.6124095", "0.60261905", "0.6011028", "0.6001699", "0.59706", "0.5953693", "0.59462154", "0.5937255", "0.5903408", "0.58816123", "0.5867888", "0.5865761", "0.5859849",...
0.72563916
0
Dimensional diffusivity in positive particle. Note this is defined as a function of stochiometry
def D_p_dimensional(self, sto, T): inputs = {"Positive particle stoichiometry": sto, "Temperature [K]": T} if self.options["particle cracking"] != "none": mech_effects = ( 1 + self.theta_p_dim * (sto * self.c_p_max - self.c_p_0_dim) / T ) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def D_n_dimensional(self, sto, T):\n inputs = {\"Negative particle stoichiometry\": sto, \"Temperature [K]\": T}\n if self.options[\"particle cracking\"] != \"none\":\n mech_effects = (\n 1 + self.theta_n_dim * (sto * self.c_n_max - self.c_n_0_dim) / T\n )\n ...
[ "0.7283493", "0.65273243", "0.6468503", "0.6425827", "0.636535", "0.6324772", "0.6248934", "0.6165855", "0.6136456", "0.613585", "0.61002284", "0.6074435", "0.60598737", "0.6025732", "0.60140806", "0.5985284", "0.59603137", "0.59568584", "0.5945988", "0.5939839", "0.5921195",...
0.720903
1
Negative electrode active material volume fraction
def epsilon_s_n(self, x): inputs = {"Through-cell distance (x_n) [m]": x * self.L_x} return pybamm.FunctionParameter( "Negative electrode active material volume fraction", inputs )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def volume(self) -> float:\n # Fail or 0 for <3D cells?\n # Definitely 0 since this is currently a property.\n # I think normally it is more convenient just to get zero\n return np.abs(np.linalg.det(self))", "def computeVolume(self):\n return (1 if self.clockwise else -1)*np.su...
[ "0.7147114", "0.7096934", "0.69437855", "0.6835842", "0.6784454", "0.6766683", "0.6757778", "0.67345494", "0.6699754", "0.6697718", "0.6670479", "0.6646859", "0.6598163", "0.65839607", "0.6572843", "0.65652746", "0.6563617", "0.65551025", "0.6519445", "0.64942133", "0.64921",...
0.5854029
86
Positive electrode active material volume fraction
def epsilon_s_p(self, x): inputs = {"Through-cell distance (x_p) [m]": x * self.L_x} return pybamm.FunctionParameter( "Positive electrode active material volume fraction", inputs )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def volume(self):\n return 1.0", "def _calc_volume(self):\n return 4/3*math.pi*self._radius**3", "def volume(self) -> float:\n return (4/3)*pi*self.radius**3", "def computeVolume(self):\n return (1 if self.clockwise else -1)*np.sum(np.linalg.det(np.dstack((self.vertices[self.faces...
[ "0.7230577", "0.7218235", "0.7145752", "0.7086602", "0.7049061", "0.6967415", "0.69295055", "0.6907882", "0.6888102", "0.6871196", "0.6855837", "0.6849389", "0.6836085", "0.677748", "0.675523", "0.67359775", "0.673043", "0.67046237", "0.6692782", "0.66883135", "0.66774976", ...
0.60295236
88
Dimensionless negative particle diffusivity
def D_n(self, c_s_n, T): sto = c_s_n T_dim = self.Delta_T * T + self.T_ref return self.D_n_dimensional(sto, T_dim) / self.D_n_dimensional( pybamm.Scalar(1), self.T_ref )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __neg__(self):\n return _almathswig.Velocity3D___neg__(self)", "def __neg__(self):\n return _almathswig.Position3D___neg__(self)", "def __neg__(self):\n\t\treturn vec2(-self.x, -self.y)", "def get_particle_loss(self):\n return -(\n integrate.trapz(self.get_data(), x=self.I...
[ "0.6869883", "0.6426134", "0.6408068", "0.6383852", "0.6383852", "0.63528705", "0.63093275", "0.6308561", "0.6294363", "0.6269501", "0.6224967", "0.621208", "0.61410826", "0.6126521", "0.6076555", "0.60169005", "0.6010984", "0.6010137", "0.5934886", "0.5913812", "0.58855903",...
0.0
-1
Dimensionless negative exchangecurrent density
def j0_n(self, c_e, c_s_surf, T): c_e_dim = c_e * self.c_e_typ c_s_surf_dim = c_s_surf * self.c_n_max T_dim = self.Delta_T * T + self.T_ref return ( self.j0_n_dimensional(c_e_dim, c_s_surf_dim, T_dim) / self.j0_n_ref_dimensional )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def density():\n\tpass", "def __neg__(self):\n return (-1.0) * self", "def SurfaceDensity_tilde_NFW(X):\r\n\r\n # author: Gary Mamon\r\n\r\n # t = type(X)\r\n\r\n # check that input is integer or float or numpy array\r\n CheckType(X,'SurfaceDensity_tilde_NFW','X')\r\n \r\n # stop with...
[ "0.64863735", "0.6194743", "0.6166435", "0.6002642", "0.5969138", "0.5932706", "0.5863469", "0.58601713", "0.58520305", "0.5842224", "0.58417976", "0.5797756", "0.5758391", "0.5746144", "0.5739578", "0.5737953", "0.5725521", "0.57146865", "0.5712944", "0.57076937", "0.5697363...
0.0
-1
Dimensionless opencircuit potential in the negative electrode
def U_n(self, c_s_n, T): sto = c_s_n T_dim = self.Delta_T * T + self.T_ref return (self.U_n_dimensional(sto, T_dim) - self.U_n_ref) / self.potential_scale
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_selfinnerproduct(self):\n qkclass = QuantumKernel(feature_map=self.feature_map)\n qc = qkclass.construct_circuit(self.x)\n self.assertEqual(qc.decompose().size(), 4)", "def mee_ocp_central_difference(p0):\n\n # TEMP\n tspan = np.array([0,642.54])\n rho = 1\n eclipse = Fa...
[ "0.6169071", "0.6139888", "0.5927643", "0.5812121", "0.57804096", "0.57722807", "0.57589674", "0.5714337", "0.57132524", "0.5693342", "0.56696236", "0.566357", "0.5656973", "0.5621627", "0.5601602", "0.5597644", "0.5564254", "0.5545324", "0.5509013", "0.5504488", "0.5499857",...
0.0
-1
Set the input current
def _set_input_current(self): self.dimensional_current_with_time = pybamm.FunctionParameter( "Current function [A]", {"Time [s]": pybamm.t * self.timescale} ) self.dimensional_current_density_with_time = ( self.dimensional_current_with_time / (self.n_electrod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveCurrentInput(self, s):\n\t\t\tself.current_input = s", "def set_input(self, new_input):\n\n\t\tself.input.set(new_input)", "def set_input(self, new_input):\n\n\t\tself.input.set(new_input)", "def set_input(self, input):\r\n pass", "def set_input(self, input):\n super().set_input(input...
[ "0.7794059", "0.7749006", "0.7749006", "0.75624514", "0.74740654", "0.7464202", "0.7464202", "0.7337968", "0.7290387", "0.7017751", "0.6954247", "0.66363305", "0.6612313", "0.6561831", "0.6557935", "0.6547785", "0.647173", "0.6341522", "0.6324492", "0.6309486", "0.6309486", ...
0.6980713
10
Compute the arithmetic mean of elements in a tensor along the specified axes.
def mean( t: Tensor, axis: Optional[Union[int, Iterable[int]]] = None, keepdims: bool = False ) -> Tensor: ctx = get_current_context() g = ctx.graph pb_g = g._pb_graph check_in_graph(g, t=t) if isinstance(axis, int): axis = [axis] axis = convert_optional_int64_list(axis) sett...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean(x, reduction_axes=None, out_axes=None):\n return sum(x, reduction_axes=reduction_axes, out_axes=out_axes) / \\\n tensor_size(x, reduction_axes=reduction_axes, out_axes=out_axes)", "def _mean(a, axis=None, *args, **kwargs):\n\n rv = np.mean(a, axis=axis, *args, **kwargs)\n\n if axis is no...
[ "0.7508972", "0.7165041", "0.705567", "0.700156", "0.69928837", "0.6979571", "0.69460064", "0.6907584", "0.6865659", "0.68625003", "0.67777675", "0.67613596", "0.6747078", "0.67427605", "0.6589868", "0.65338326", "0.6430673", "0.6425331", "0.6419999", "0.638844", "0.638189", ...
0.6804045
10
Create and save room
def create_room(player_ids: Union[int, List] , lobby_id: int): # print("Player id: " + player_ids) if not isinstance(player_ids, list): player_ids = [int(player_id) for player_id in player_ids] room_id = new_ID() print('room id ' + str(room_id)) data = { 'id' : room_id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_room(self):\n pass", "def save_room(room_id: int):\r\n data = json.loads(conn.hget('room',room_id))\r\n player_ids = data['player_ids']\r\n lobby_id = data['lobby_id']\r\n players = [models.Player.get_by_id(int(player_id)) for player_id in player_ids]\r\n room, status = models.Room...
[ "0.8117693", "0.77918404", "0.728916", "0.7177708", "0.6922339", "0.6547635", "0.65435416", "0.64295685", "0.6401585", "0.6333914", "0.6316458", "0.62165916", "0.61196274", "0.6099861", "0.60739", "0.6060709", "0.6044158", "0.60205054", "0.59626985", "0.5946752", "0.59102875"...
0.57752913
52
Returns an integer in bitform indicating which rounds the spies won
def get_mission_results(model): s = "" for i in model.rounds_won_spies: s = s + str(i) return int(s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def need_to_win(self):\n return 4 if self.best_of == 7 else 3", "def get_rounds(number):\n pass", "def get_overall_wins(self, wins) -> int:\n return wins[\"RANKED_SOLO_5x5\"] + wins[\"RANKED_FLEX_SR\"] + wins[\"RANKED_FLEX_TT\"]", "def checkWinner(self):\n if self.__turnsTaken == self...
[ "0.669892", "0.6579372", "0.64334977", "0.62529045", "0.62141114", "0.62038654", "0.6191595", "0.6168356", "0.6160399", "0.6140877", "0.61157185", "0.6084214", "0.6064783", "0.6057844", "0.6056089", "0.6046921", "0.6031197", "0.6018388", "0.600524", "0.5921248", "0.5899565", ...
0.5565411
82
Changes the opacity of all actors.
def change_opacity(self, opacity): for actor in self._all_actors: actor.GetProperty().SetOpacity(opacity)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_opacity(self, opacity: int) -> None:\n\n self._opacity = (opacity / 255) % 1.0\n for elem in self._ui_elements:\n elem.opacity = self._opacity\n elem.rebuild(self)", "def set_opacity(self, opacity: int):\n\n # Update the attribute\n self.opacity = opacity...
[ "0.7367654", "0.7312674", "0.71573067", "0.7128765", "0.69104445", "0.68971187", "0.65518326", "0.6528598", "0.64642197", "0.6338369", "0.61618257", "0.61324215", "0.60495156", "0.6037693", "0.59275", "0.59251314", "0.5841105", "0.57740134", "0.5703372", "0.56229335", "0.5523...
0.88041866
0
Utility to pad a list to the target length. If list_in is not none then the list is padded with the first value in list_in, otherwise if_none_pad_value is used.
def pad_list(list_in, target_length, if_none_pad_value): if list_in is None: list_in = [if_none_pad_value] if len(list_in) not in [1, target_length]: raise ValueError("property list wrong length.") while len(list_in) < target_length: list_in.append(list_in[0]) return list_in
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def padlist(container, size, default=...):\n ...", "def pad_list(xs, pad_value=0., pad_left=False):\n bs = len(xs)\n max_time = max(x.size(0) for x in xs)\n xs_pad = xs[0].new_zeros(bs, max_time, * xs[0].size()[1:]).fill_(pad_value)\n for b in range(bs):\n if len(xs[b]) == 0:\n c...
[ "0.74253285", "0.72790444", "0.7189443", "0.7081153", "0.69865906", "0.680348", "0.6771477", "0.67328805", "0.6632996", "0.660995", "0.65946364", "0.65660894", "0.6538056", "0.64929044", "0.6421357", "0.6359635", "0.6317463", "0.63124305", "0.63000816", "0.62915695", "0.62488...
0.8417904
0
Update movement ratio for the ship.
def set_movement_ratio(val): monospace.Ship.drag_ratio = 1 + val / 10
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n # Update ship's center value instead of rect value.\n # Use if instead of elif for better transition between left/right.\n if self.moving_right and self.rect.right < self.screen_rect.right:\n # self.rect.centerx += 1\n self.center += self.ai_settings.s...
[ "0.71340966", "0.7033257", "0.69881207", "0.6966965", "0.6849698", "0.68174684", "0.6781157", "0.6761112", "0.6552798", "0.6469774", "0.64660466", "0.6464748", "0.64096045", "0.6377581", "0.6353255", "0.63236225", "0.62946457", "0.62578917", "0.6246188", "0.6237976", "0.62379...
0.72326386
0
Return the absolute path to the executable. Uses the plugin executable if none is specified.
def exec_path(self, executable: Optional[str] = None) -> Union[str, Path]: executable = executable or self.plugin.executable if not self.venv_service: if "/" not in executable.replace("\\", "/"): # Expect executable on path return executable # Ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getExecutable():\n\n return sys.executable", "def executable(self) -> str:\n return pulumi.get(self, \"executable\")", "def executable(self) -> str:\n return pulumi.get(self, \"executable\")", "def executable(self) -> str:\n return pulumi.get(self, \"executable\")", "def get_exe...
[ "0.75235456", "0.7232219", "0.72314465", "0.72314465", "0.7218742", "0.7160686", "0.71012825", "0.70068526", "0.69112027", "0.6910421", "0.690151", "0.6839951", "0.68053037", "0.6763661", "0.67531216", "0.6739762", "0.67357785", "0.6723936", "0.66986746", "0.6690943", "0.6675...
0.78459126
0
Find a Command by name. Raises `UnknownCommandError` if not defined.
def find_command(self, name): try: return self.plugin.all_commands[name] except KeyError as err: raise UnknownCommandError(self.plugin, name) from err
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_command(name):\r\n for c in COMMANDS:\r\n if c.name == name:\r\n return c\r\n return None", "def get_command(name):\n return _commands.get(name)", "def get_command(command_name):\n # Accept hyphens in place of underscores.\n command_name = command_name.replace(\"-\", \"_\")\n\n #...
[ "0.8513913", "0.77929425", "0.76095456", "0.75053227", "0.7436297", "0.74269617", "0.73569566", "0.7237335", "0.7206728", "0.7108401", "0.7080571", "0.70611477", "0.6886166", "0.6805618", "0.66985476", "0.6641071", "0.6438527", "0.63741016", "0.6350872", "0.6195473", "0.61905...
0.8870859
0
Returns the dict as a model
def from_dict(cls, dikt) -> 'InlineResponse200': return util.deserialize_model(dikt, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dikt) -> 'Model':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelOutput':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'ModelStat':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt):\n ...
[ "0.73100865", "0.7226481", "0.68927467", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67725724", "0.67388964", "0.66993856", "0.6698291", "0.6698291", "0.6698291", "0.6650225", "...
0.6148202
47
Gets the data of this InlineResponse200.
def data(self) -> List[InlineResponse200Data]: return self._data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_response_data(self):\n return self.good_response", "def get_data(self):\r\n return self.data", "def get_data(self):\n return self.data", "def get_data(self):\n return self.data", "def get_data(self):\n return self.data", "def get_data(self):\n return sel...
[ "0.6815782", "0.6591509", "0.65650964", "0.65650964", "0.65650964", "0.65650964", "0.65650964", "0.65650964", "0.65650964", "0.65650964", "0.6553751", "0.6548213", "0.6522513", "0.65142494", "0.6446241", "0.6392985", "0.63726705", "0.6365383", "0.6365383", "0.6365383", "0.633...
0.782065
0
Returns the SUNet IDs associated with this issue, such as the candidate's, the slate members', the sponsor's, etc. >>> issue = Issue(sunetid1='jsmith', sunetid2='aliceb') >>> issue.sunetids() ['jsmith', 'aliceb']
def sunetids(self): ids = (self.sunetid1, self.sunetid2, self.sunetid3, self.sunetid4, self.sunetid5) return [s for s in ids if s]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identities(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"identities\")", "def get_seed_ids(cls):\n return db_session.query(SeedIds.uid).filter(text('is_crawled=0')).all()", "def ids(self) -> Sequence[str]:\n return pulumi.get(self, \"ids\")", "def ids(self) -> Sequenc...
[ "0.5199865", "0.5085064", "0.5065881", "0.5065881", "0.5065881", "0.5065881", "0.5065881", "0.5065881", "0.49977323", "0.49693778", "0.4967977", "0.4967977", "0.4967977", "0.4967864", "0.4967864", "0.4967864", "0.4962995", "0.49100855", "0.49097925", "0.49097925", "0.49097925...
0.774572
0
Get a summary of the commit message.
def summary(self) -> str: return self._commit.message.splitlines()[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_message_summary(message):\n summary = []\n message_type = message[\"msg_type\"]\n summary.append(f\"type: {message_type}\")\n\n if message_type == \"status\":\n summary.append(\", state: {}\".format(message[\"content\"][\"execution_state\"]))\n elif message_ty...
[ "0.6919026", "0.6687533", "0.65539813", "0.64479136", "0.6417122", "0.6338289", "0.63120264", "0.6303993", "0.63001347", "0.6204392", "0.61518574", "0.60027516", "0.5939946", "0.5939946", "0.59207875", "0.58880675", "0.5884036", "0.585996", "0.58433145", "0.58187383", "0.5783...
0.8628926
0
Confirm the passed dict is a partition. A partition is valid if no entries from the value lists are ever repeated. Raise an exception if there's a problem, otherwise return the total number of entries.
def _check(partition): all_items = set() for values in partition.values(): # not repeated in this list assert len(values) == len(set(values)) # not repeated from earlier assert all_items.intersection(values) == set() # now add to running list all_items.update(valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partition_count(self) -> Optional[int]:\n return pulumi.get(self, \"partition_count\")", "def size(self):\n # Het aantal elementen in de knop komt overeen met het maximaal aantal keys min het aantal keys die niet ingevuld zijn.\n # int(k is None) geeft 1 als k None is, en 0 als k niet No...
[ "0.5902819", "0.57726735", "0.5752581", "0.5712231", "0.5652365", "0.55713546", "0.54912484", "0.54348886", "0.5348112", "0.5331135", "0.5305595", "0.53026015", "0.5281491", "0.5269641", "0.526724", "0.5264182", "0.5251587", "0.5249116", "0.5240359", "0.5234491", "0.52275014"...
0.68530864
0
Get the equivalence relations given a list of activities
def equivalence(trace): ret = set() freq = activ_freq(trace) for x in freq: for y in freq: if x != y and freq[x] == freq[y]: ret.add((x, y)) ret.add((y, x)) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_activities(self):\n return map(lambda x: self.__activity_controller.find_by_id(x.activity_id),list(filter(lambda x: x.activity_id in [e.entity_id for e in self.__activity_controller.get_all()],self.get_all())))", "def get_activity_links(activities):\n\tlinks = []\n\tfor i, activity in enumerat...
[ "0.61217237", "0.6027125", "0.5826878", "0.5809431", "0.573859", "0.5504591", "0.54863274", "0.5417533", "0.537434", "0.5350722", "0.5278522", "0.52711415", "0.52638465", "0.52321863", "0.5213144", "0.5198582", "0.51640916", "0.51640916", "0.51442844", "0.51416785", "0.513653...
0.0
-1
Calculate mean squared displacement of time series
def calculate_msd(self, ensemble=False): print('Calculating MSD...', end='', flush=True) # start = timer.time() # This is just here to test parallelization self.msd = timeseries.msd(self.z_interpolated.T[..., np.newaxis], 0, ensemble=ensemble).T # print('Done in %.3f seconds' % (timer....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_msd(self) -> float:\n return self.compute_displacement2().mean()", "def s_mavg(dataset, window):\n\tweigths = np.repeat(1.0, window)/window\n\treturn np.convolve(dataset, weigths, 'valid')", "def mse(x, y):\n diff = x - y\n diff = diff.reshape(-1).tolist()[0]\n diff = [x**2 for x in...
[ "0.676059", "0.60665506", "0.60062945", "0.597367", "0.5948843", "0.5920638", "0.58980185", "0.586261", "0.58478266", "0.58450824", "0.5843153", "0.58294827", "0.58269125", "0.5811526", "0.58047605", "0.5778864", "0.5761226", "0.5759469", "0.57519716", "0.57496905", "0.574873...
0.0
-1
Extract data from one column of a csv file to a pandas.DataFrame
def extract_csv(fName, colName, DAYS_IN_YEAR): result = pd.read_csv(fName, usecols=[colName], nrows=24*DAYS_IN_YEAR) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_csv(csv_file: str) -> pd.DataFrame:\n data = pd.read_csv(csv_file, encoding=\"utf-8\", sep=\",\", low_memory=False)\n return data[['id', 'download']]", "def load_data(csv):\n df = pd.read_csv(csv, sep=',', error_bad_lines=False)\n return df", "def read_csv(csv_data):\n data = pd.read_cs...
[ "0.7739158", "0.7301157", "0.7217343", "0.7155576", "0.7126922", "0.7124798", "0.7108372", "0.7011583", "0.70002925", "0.6989695", "0.6961575", "0.69581103", "0.6948135", "0.6919171", "0.6914541", "0.68988794", "0.6896053", "0.6851345", "0.6800405", "0.6793851", "0.6774744", ...
0.0
-1
Returns a list of distance between sample and each center.
def __getDistance(self, sample): distance = [] samp = self.__getSampleVec(sample) for i in xrange(self.K): center = self.centers[i] dist = math.sqrt(sum(sum((samp - center)*(samp - center)))) distance.append(dist) return distance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calc_distance(self, data: np.ndarray):\r\n distances = []\r\n for c in self.centroid:\r\n distance = np.sum((data - c) * (data - c), axis=1)\r\n distances.append(distance)\r\n\r\n distances = np.array(distances)\r\n distances = distances.T\r\n return di...
[ "0.7435151", "0.74085397", "0.722874", "0.68501806", "0.6765846", "0.674212", "0.67386913", "0.67294806", "0.66475016", "0.6627545", "0.6616871", "0.6612117", "0.65010595", "0.64546424", "0.6441459", "0.6344907", "0.6338823", "0.63108706", "0.629873", "0.62924486", "0.6258209...
0.8218491
0
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'SSB_DRAG_pulse', 'I_channel': None, 'Q_channel': None, 'amplitude': 0.1, 'sigma': 10e-9, 'nr_sigma': 5, 'motzoi': 0, 'mod_frequency': 1e6, 'phase': 0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79624355", "0.7691749", "0.7661343", "0.7649247", "0.7640761", "0.76115996", "0.7583923", "0.74922", "0.74884087", "0.7462428", "0.74182993", "0.73627293", "0.7072385", "0.65201443", "0.6471434", "0.62837", "0.6164133", "0.61591196", "0.61591196", "0.61026305", "0.6037902"...
0.77485865
1
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'GaussianFilteredPiecewiseConstPulse', 'channels': None, 'lengths': None, 'amplitudes': 0, 'gaussian_filter_sigma': 0, } return params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79637265", "0.7749739", "0.769337", "0.76631606", "0.76509535", "0.7642553", "0.7613169", "0.75850594", "0.7493774", "0.7489461", "0.746347", "0.73643935", "0.707376", "0.65196884", "0.6472295", "0.62847054", "0.6163434", "0.6159609", "0.6159609", "0.6102214", "0.6038477",...
0.74202335
11
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'BufferedSquarePulse', 'channel': None, 'channels': [], 'amplitude': 0, 'pulse_length': 0, 'buffer_length_start': 0, 'buffer_length_end': 0, 'gaussian_filter_sigma': 0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79624355", "0.77485865", "0.7691749", "0.7661343", "0.7649247", "0.7640761", "0.76115996", "0.7583923", "0.74884087", "0.7462428", "0.74182993", "0.73627293", "0.7072385", "0.65201443", "0.6471434", "0.62837", "0.6164133", "0.61591196", "0.61591196", "0.61026305", "0.60379...
0.74922
8
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'BufferedCZPulse', 'channel': None, 'aux_channels_dict': None, 'amplitude': 0, 'frequency': 0, 'phase': 0, 'pulse_length': 0, 'buffer_length_start': 0, 'buf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79625964", "0.7748502", "0.769218", "0.7662022", "0.76495636", "0.76118106", "0.75843275", "0.74921715", "0.7488733", "0.74621373", "0.7418949", "0.736299", "0.7072951", "0.6520441", "0.6471716", "0.62850577", "0.61634815", "0.6160918", "0.6160918", "0.61042047", "0.603924...
0.76412207
5
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'NZBufferedCZPulse', 'channel': None, 'aux_channels_dict': None, 'amplitude': 0, 'alpha': 1, 'frequency': 0, 'phase': 0, 'pulse_length': 0, 'buffer_length_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79624355", "0.77485865", "0.7691749", "0.7649247", "0.7640761", "0.76115996", "0.7583923", "0.74922", "0.74884087", "0.7462428", "0.74182993", "0.73627293", "0.7072385", "0.65201443", "0.6471434", "0.62837", "0.6164133", "0.61591196", "0.61591196", "0.61026305", "0.6037902...
0.7661343
3
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'BufferedNZFLIPPulse', 'channel': None, 'channel2': None, 'amplitude': 0, 'amplitude2': 0, 'alpha': 1, 'pulse_length': 0, 'buffer_length_start': 30e-9, 'buf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79637265", "0.7749739", "0.769337", "0.76631606", "0.76509535", "0.7642553", "0.75850594", "0.7493774", "0.7489461", "0.746347", "0.74202335", "0.73643935", "0.707376", "0.65196884", "0.6472295", "0.62847054", "0.6163434", "0.6159609", "0.6159609", "0.6102214", "0.6038477"...
0.7613169
6
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'BufferedFLIPPulse', 'channel': None, 'channel2': None, 'amplitude': 0, 'amplitude2': 0, 'mirror_pattern': None, # see Segment.resolve_mirror 'mirror_correction': None, # see Seg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79624355", "0.77485865", "0.7691749", "0.7661343", "0.7649247", "0.7640761", "0.76115996", "0.7583923", "0.74922", "0.74884087", "0.7462428", "0.74182993", "0.7072385", "0.65201443", "0.6471434", "0.62837", "0.6164133", "0.61591196", "0.61591196", "0.61026305", "0.6037902"...
0.73627293
12
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'NZMartinisGellarPulse', 'channel': None, 'aux_channels_dict': None, 'theta_f': np.pi / 2, 'alpha': 1, 'pulse_length': 0, 'buffer_length_start': 0, 'buffer_length_end':...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'SSB_DRAG_pulse',\n 'I_channel': None,\n 'Q_channel': None,\n 'amplitude': 0.1,\n 'sigma': 10e-9,\n 'nr_sigma': 5,\n 'motzoi': 0,\n 'mod_frequency': 1e6,\n '...
[ "0.7748502", "0.769218", "0.7662022", "0.76495636", "0.76412207", "0.76118106", "0.75843275", "0.74921715", "0.7488733", "0.74621373", "0.7418949", "0.736299", "0.7072951", "0.6520441", "0.6471716", "0.62850577", "0.61634815", "0.6160918", "0.6160918", "0.61042047", "0.603924...
0.79625964
0
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'GaussFilteredCosIQPulse', 'I_channel': None, 'Q_channel': None, 'amplitude': 0, 'pulse_length': 0, 'mod_frequency': 0, 'phase': 0, 'buffer_length_start': 10e-9, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79624355", "0.77485865", "0.7691749", "0.7661343", "0.7640761", "0.76115996", "0.7583923", "0.74922", "0.74884087", "0.7462428", "0.74182993", "0.73627293", "0.7072385", "0.65201443", "0.6471434", "0.62837", "0.6164133", "0.61591196", "0.61591196", "0.61026305", "0.6037902...
0.7649247
4
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params_super = super().pulse_params() params = { **params_super, 'pulse_type': 'GaussFilteredCosIQPulseWithFlux', 'flux_channel': None, 'flux_amplitude': 0, 'flux_extend_start': 20e-9, 'flux_extend_end': 150e-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79637265", "0.7749739", "0.769337", "0.76631606", "0.76509535", "0.7642553", "0.7613169", "0.75850594", "0.7493774", "0.746347", "0.74202335", "0.73643935", "0.707376", "0.65196884", "0.6472295", "0.62847054", "0.6163434", "0.6159609", "0.6159609", "0.6102214", "0.6038477"...
0.7489461
9
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'GaussFilteredCosIQPulseMultiChromatic', 'I_channel': None, 'Q_channel': None, 'amplitude': 0, 'pulse_length': 0, 'mod_frequency': [0], 'phase': 0, 'buffer_length_start...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79624355", "0.77485865", "0.7661343", "0.7649247", "0.7640761", "0.76115996", "0.7583923", "0.74922", "0.74884087", "0.7462428", "0.74182993", "0.73627293", "0.7072385", "0.65201443", "0.6471434", "0.62837", "0.6164133", "0.61591196", "0.61591196", "0.61026305", "0.6037902...
0.7691749
2
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'VirtualPulse', 'pulse_length': 0, } return params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79625964", "0.7748502", "0.769218", "0.7662022", "0.76495636", "0.76412207", "0.76118106", "0.74921715", "0.7488733", "0.74621373", "0.7418949", "0.736299", "0.7072951", "0.6520441", "0.6471716", "0.62850577", "0.61634815", "0.6160918", "0.6160918", "0.61042047", "0.603924...
0.75843275
7
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'SquarePulse', 'channel': None, 'channels': [], 'amplitude': 0, 'length': 0, } return params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79624355", "0.77485865", "0.7691749", "0.7661343", "0.7649247", "0.7640761", "0.76115996", "0.7583923", "0.74922", "0.74884087", "0.74182993", "0.73627293", "0.7072385", "0.65201443", "0.6471434", "0.62837", "0.6164133", "0.61591196", "0.61591196", "0.61026305", "0.6037902...
0.7462428
10
Returns a dictionary of pulse parameters and initial values. These parameters are set upon calling the super().__init__ method.
def pulse_params(cls): params = { 'pulse_type': 'CosPulse', 'channel': None, 'amplitude': 0, 'length': 0, 'frequency': 1e6, 'phase': 0, } return params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pulse_params(cls):\n params = {\n 'pulse_type': 'NZMartinisGellarPulse',\n 'channel': None,\n 'aux_channels_dict': None,\n 'theta_f': np.pi / 2,\n 'alpha': 1,\n 'pulse_length': 0,\n 'buffer_length_start': 0,\n 'buffe...
[ "0.79637265", "0.7749739", "0.769337", "0.76631606", "0.76509535", "0.7642553", "0.7613169", "0.75850594", "0.7493774", "0.7489461", "0.746347", "0.74202335", "0.73643935", "0.65196884", "0.6472295", "0.62847054", "0.6163434", "0.6159609", "0.6159609", "0.6102214", "0.6038477...
0.707376
13
Remove all boxes with any side smaller than min_size.
def _filter_boxes(boxes, min_size): ws = boxes[:, 2] - boxes[:, 0] + 1 hs = boxes[:, 3] - boxes[:, 1] + 1 keep = np.where((ws >= min_size) & (hs >= min_size))[0] return keep
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_boxes_opr(boxes, min_size):\n ws = boxes[:, 2] - boxes[:, 0] + 1\n hs = boxes[:, 3] - boxes[:, 1] + 1\n keep = (ws >= min_size) * (hs >= min_size)\n return keep", "def filter_boxes(boxes, min_size):\n ws = boxes[:, 2] - boxes[:, 0] + 1\n hs = boxes[:, 3] - boxes[:, 1] + 1\n keep =...
[ "0.8014259", "0.7931493", "0.79263544", "0.7912969", "0.79018307", "0.78963673", "0.7878665", "0.77762973", "0.7593091", "0.7129412", "0.69834185", "0.6600835", "0.64342785", "0.6393689", "0.61802477", "0.61238587", "0.6041259", "0.6037091", "0.58902675", "0.58318746", "0.580...
0.7921694
3
Return the possible transition outcomes for a stateaction pair. This should be in the same format at the provided environments in section 2.
def query_model(self, state, action): outcomes = [] reward = 0 is_terminal = False if action==0: #SWITCH_TO_1 nextstate = list(state) nextstate[0] = 1 outcomes.append([self.P[0], (nextstate[0], nextstate[1]+1, nextstate[2], nextstate[3]), reward, is_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_transitions(self, state, act):\n self._check_env_name()\n assert self.model_based, \"You should not use _get_transitions in \" \\\n \"model-free algorithm!\"\n \n # call the internal attribute of the environments.\n # `transitions` is a list contain all possib...
[ "0.67162776", "0.6709939", "0.66092503", "0.6492271", "0.6396114", "0.6361655", "0.6266484", "0.625744", "0.625744", "0.61351764", "0.6101383", "0.6012364", "0.5963588", "0.5962668", "0.59480727", "0.5942646", "0.5902899", "0.5862486", "0.5797152", "0.5751557", "0.57458663", ...
0.5567015
33
Estimates the spectral radiance of a point light reflected from the surface point towards the observation point.
def estimate_radiance( point_light_radiance: type_alias.TensorLike, point_light_position: type_alias.TensorLike, surface_point_position: type_alias.TensorLike, surface_point_normal: type_alias.TensorLike, observation_point: type_alias.TensorLike, brdf: Callable[ [type_alias.TensorLike, t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def surface_reflectance(bandname):\n\t\t\t\n\t\t\t# run 6S for this waveband\n\t\t\ts.wavelength = spectralResponseFunction(bandname)\n\t\t\ts.run()\n\t\t\t\n\t\t\t# extract 6S outputs\n\t\t\tEdir = s.outputs.direct_solar_irradiance #direct solar irradiance\n\t\t\tEdif = s.outputs.diffuse_solar_irradia...
[ "0.6115399", "0.6068082", "0.5929012", "0.5881929", "0.57647204", "0.5710174", "0.5643745", "0.5585179", "0.55276924", "0.55240023", "0.54008675", "0.5374676", "0.5372181", "0.53698844", "0.5359809", "0.5352588", "0.52897626", "0.52710027", "0.5265274", "0.5245473", "0.522787...
0.69111466
0
Yield an incrementing timer at least `at_least` times, thereafter continuing until the timeout has been reached.
def repeat(cls, at_least, timeout, snooze=0.0, snooze_multiplier=1.0, snooze_jitter=0.0): timer = cls(timeout) n = 0 next_snooze = None while n < at_least or timer.remaining(): if snooze: if next_snooze is None: next_snooze = snooze ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeater(at_least, timeout):\n timer = Timer(timeout)\n repeat = 0\n while repeat < at_least or timer.remaining():\n yield repeat\n repeat += 1", "def timer(seconds=0):\n start = time.time()\n while True:\n timepast = time.time() - start\n if seconds != 0 and timepa...
[ "0.82348263", "0.6462765", "0.5755805", "0.5733742", "0.57115275", "0.5666848", "0.5625389", "0.55400985", "0.5523059", "0.5506974", "0.5500974", "0.5422662", "0.53867906", "0.53748184", "0.53385943", "0.5334059", "0.53283477", "0.53168344", "0.5303768", "0.5303768", "0.53037...
0.7278871
1
Check the correct format for the current date
def test_date_sort(self): self.assertEqual(get_tab_date() ,"11/21")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verifying_date_format(input_date):\n\timport datetime\n\n\tinput_date = input_date\n\n\ttry:\n\t\tyear = int(input_date[:4])\n\t\tmonth = int(input_date[5:7])\n\t\tday = int(input_date[-2:])\n\t\tconverted_date = str(datetime.date(year,month,day))\n\t\tcorrect_date = True\n\texcept ValueError:\n\t\tcorrect_dat...
[ "0.70248616", "0.6934396", "0.67133474", "0.6689967", "0.6604895", "0.6524784", "0.65205127", "0.6512829", "0.6498565", "0.6403556", "0.6370579", "0.63332623", "0.6327", "0.62945", "0.62937355", "0.6289992", "0.6285753", "0.62630683", "0.6233064", "0.6211148", "0.62006384", ...
0.0
-1
random choice of index from nonzero elements of iterable
def random_positive_choice(iterable): iterable = np.array(iterable) indices = np.argwhere(iterable > 0).reshape(-1) index = np.random.choice(indices) return index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(iterable,n):\r\n import random as r\r\n iterable = tuple(iterable) if type(iterable)==type({0,1}) else iterable\r\n choiceIndices = tuple(r.randint(0,len(iterable)-1) for i in range(n))\r\n return tuple(iterable[i] for i in choiceIndices)", "def get_random_index(self):\n return rand...
[ "0.6883476", "0.68092626", "0.67878234", "0.66066295", "0.6591917", "0.65816003", "0.6520857", "0.6488586", "0.6485563", "0.64427763", "0.64219993", "0.6354172", "0.6348744", "0.6346782", "0.63230425", "0.6318705", "0.63171035", "0.6248409", "0.62367874", "0.62107414", "0.620...
0.8097986
0
Makes one hot encodings for labels in dataframe
def get_one_hot_encoding(self, df: pd.DataFrame): df['labels'] = df['labels'].apply(lambda x: self.fix_dups(x)) unique_labels = df['labels'].unique() true_unique_labels = [] for labels in unique_labels: for label in labels.split(','): if label not in true_uniq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_onehot(label_df):\n ll = get_label_list(labels_df)\n for label in ll:\n labels_df[label] = label_df['tags'].apply(lambda x: 1 if label in x.split(' ') else 0)\n return label_df", "def onehot_encoding(labels):\n #dataframe = self.cf\n unique = np.unique(labels).tolist()\n ...
[ "0.8344673", "0.8274568", "0.82467735", "0.82448393", "0.8192559", "0.8033064", "0.7931735", "0.7881767", "0.7849149", "0.7846874", "0.78187656", "0.773791", "0.77138805", "0.768129", "0.76507807", "0.76382387", "0.7630176", "0.7626557", "0.76178074", "0.7600028", "0.75940067...
0.852479
0
Set title and labels for the axis of the canvas.
def set_info(self, title=None, xlabel=None, ylabel=None): # Set label / title only for grid axis : if self._axis: # X-label : if xlabel is not None: self.xaxis.axis.axis_label = xlabel self.xaxis.update() # Y-label : if ylab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_axis_labels(self, fig, axis_number: str, xlabel: str, ylabel: str) -> None:\r\n fig.layout[f'xaxis{axis_number}'].update({ 'title': { 'text': xlabel } })\r\n fig.layout[f'yaxis{axis_number}'].update({ 'title': { 'text': ylabel } })", "def axes_labels_set(self):\n self.ax1.set_xlabel...
[ "0.7707845", "0.75893515", "0.75565654", "0.74944746", "0.74560404", "0.72519565", "0.70988345", "0.70196575", "0.69673896", "0.6876215", "0.6856133", "0.6794892", "0.67790025", "0.67415243", "0.6730722", "0.67280966", "0.67164093", "0.6624536", "0.66196567", "0.66194034", "0...
0.7881057
0
Adds a portmap, requires that an IGD device has been found with self.search() Linux IGD has a limited status reply (none really) if the syntax is correct, invalid port numbers etc. are not rejected. Because of this, we just return true if the HTTP headers statuscode is 200 There are no tests to confirm that there actua...
def AddPortMapping(self, ip, port, protocol): log.debug('Mapping protocol %s port %s to host at %s' % (protocol, port, ip)) if not self._host: return False response = '' #Timeconstraints did not allow creating a soap module/parser, UPnP requires NewRemoteHost, #NewEx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_add_port_mapping(\n self,\n remote_host: IPv4Address,\n external_port: int,\n protocol: str,\n internal_port: int,\n internal_client: IPv4Address,\n enabled: bool,\n description: str,\n lease_duration: timedelta,\n services: Opti...
[ "0.631539", "0.5891271", "0.5586706", "0.55781054", "0.53270054", "0.53089106", "0.5283044", "0.5133529", "0.51114964", "0.5109902", "0.5080863", "0.5037663", "0.50260365", "0.50232965", "0.50093096", "0.49951813", "0.49881086", "0.4987675", "0.4970638", "0.4933114", "0.48830...
0.69191676
0
Generate gaussian distributed random numbers to emulate gaussian PSF
def generate_gaussian_distortion(N, sig_x=0.5, sig_y=0.5): return np.random.multivariate_normal([0, 0], [[sig_x, 0], [0, sig_y]], size=(N,)).T
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f_Gauss(pt):\n return np.random.normal(0, 0.1, len(pt))", "def gauss(self, sigma):\n return np.random.normal(loc=0,scale=sigma)", "def random_gaussian(size, miu=0, sigma=8, epsilon=0, seed=None):\n from akg.utils import gen_random as random\n return random.random_gaussian(size, miu, sigma, ...
[ "0.7260477", "0.7238243", "0.721237", "0.71540236", "0.7133735", "0.70802253", "0.7006473", "0.6983167", "0.6976391", "0.6954189", "0.6950094", "0.69297504", "0.69260806", "0.69232345", "0.689393", "0.6881781", "0.6881781", "0.68431747", "0.678955", "0.6763096", "0.6737917", ...
0.6877312
17
Apply radial velocity shift. Applies an RV shift to the formerly drawn wavelength.
def apply_rv(self, rv): self.wavelength = apply_rv(self.wavelength, rv) return self.wavelength
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_rv (self,rv,all_bands = True):\n self.history.append([time.ctime(),'Apply radial velocity shift:'+str(rv)])\n\n c = 299792.4580\n # assuming c = 3e5 gives percent difference of:\n # 0.06922855944562016 %\n\n rv = float(rv)\n\n # solve delta_lambda/lambda = rv/c\...
[ "0.7104622", "0.58802015", "0.58522636", "0.5626694", "0.5616344", "0.55080557", "0.5443805", "0.5428445", "0.542831", "0.5411132", "0.53999335", "0.5370794", "0.53528947", "0.52975726", "0.52975726", "0.5283372", "0.5273181", "0.52643317", "0.52403736", "0.52403736", "0.5237...
0.0
-1
Bins random wavelength into wavelength vector.
def bin_to_wavelength(self, wl_vector): return np.histogram(self.wavelength, wl_vector)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_wavelength_vector(self):\n wl_bins = (np.array(range(self.img_width+1)) - self.offset_x - self.sx*np.cos(self.rot)/2. +\n self.sy*np.sin(self.rot+self.shear)/2.) / self.disp_x + self.wl_center\n\n wls = (wl_bins[1:] + wl_bins[:-1]) / 2\n return wl_bins, wls", "def sim...
[ "0.6007722", "0.5763038", "0.56223625", "0.56033623", "0.5582829", "0.5525589", "0.552336", "0.54820156", "0.5461967", "0.54403436", "0.54232806", "0.53124183", "0.5309677", "0.53083193", "0.52858436", "0.5248172", "0.51980656", "0.517637", "0.5146513", "0.5132803", "0.512639...
0.65179354
0
Find 1hot coded spots in data.
def run( self, primary_image: ImageStack, blobs_image: Optional[ImageStack] = None, blobs_axes: Optional[Tuple[Axes, ...]] = None, verbose: bool = False, n_processes: Optional[int] = None, *args, ) -> IntensityTable: if blo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_encoding(data):\n n_spiketime_bins = np.max(data).astype(int) + 1\n spikes = np.zeros(list(data.shape)+[n_spiketime_bins])\n for i, sample in enumerate(data):\n for j, tf in enumerate(sample):\n spikes[i, j] = np.eye(n_spiketime_bins)[tf]\n\n return spikes", "def _one_ho...
[ "0.76359683", "0.69047946", "0.6840862", "0.6715586", "0.66771936", "0.66653186", "0.6607822", "0.6569988", "0.65638596", "0.65511364", "0.6548937", "0.64680594", "0.6445549", "0.64058256", "0.63847613", "0.63799894", "0.6369621", "0.6359013", "0.6342282", "0.6335085", "0.630...
0.0
-1
Move the given row to one position right
def move_right(board, row): board[row] = board[row][-1:] + board[row][:-1] return board
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate_row_right(self, row):\n nboard = self.value\n vrow = nboard[row]\n rotated_row = vrow[-1:] + vrow[0:-1]\n nboard = (*nboard[:row], rotated_row, *nboard[row+1:])\n col = self.free_space[1] + 1 * (self.free_space[0] == row)\n if col >= Board.W:\n col = ...
[ "0.7623501", "0.75505334", "0.752152", "0.74732566", "0.7371169", "0.7362241", "0.7292276", "0.7203944", "0.7201472", "0.69565415", "0.6920369", "0.6846611", "0.6825925", "0.6814557", "0.6808193", "0.67940044", "0.6775518", "0.67306685", "0.6722134", "0.6684894", "0.66627574"...
0.7948137
0
Move the given row to one position left
def move_left(board, row): board[row] = board[row][1:] + board[row][:1] return board
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moveDownLeft(self):\n if self.curr_col > 0:\n self.curr_col -= 1\n if self.curr_row < self.num_row - 1:\n self.curr_row += 1", "def rotate_row_left(self, row):\n nboard = self.value\n vrow = nboard[row]\n rotated_row = vrow[1:] + vrow[0:1]\n nbo...
[ "0.7624692", "0.75719404", "0.7319383", "0.73119634", "0.72898895", "0.71448743", "0.71160835", "0.7046048", "0.6991292", "0.69808924", "0.6958888", "0.6913841", "0.6756467", "0.67549783", "0.67419875", "0.6720198", "0.6675776", "0.66642046", "0.6646188", "0.66448444", "0.664...
0.7684525
0
Reshape cifar data array to (n, 32, 32, 3) and convert to BGR format.
def cvt_cifar(cifar_array): n = np.asarray(cifar_array).shape[0] #Pixel values in CIFAR data are stacked vertically #in a single column R = cifar_array[:,:1024].reshape(n,32,32) G = cifar_array[:,1024:2048].reshape(n,32,32) B = cifar_array[:,-1024:].reshape(n,32,32) #Stack channels in BGR order img_arra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reformat_dataset(dataset):\n # change the dataset shape from\n # (50000, 32, 32, 3)\n # (50000, 3, 32, 32)\n dataset = np.rollaxis(dataset, 3, 1)\n return dataset.reshape((-1, image_size * image_size * color_channel))", "def convert_to_rgb(arr: torch.Tensor) -> np.ndarray: # pyre-ignore[24]\n squeez...
[ "0.6796701", "0.66383415", "0.6495292", "0.6472013", "0.6454601", "0.6424725", "0.63568044", "0.6332957", "0.62867147", "0.61435276", "0.6108258", "0.60710925", "0.60673344", "0.6040633", "0.6020119", "0.60042363", "0.5945585", "0.5924207", "0.5903314", "0.58863574", "0.58718...
0.74502814
0
Reshape array of images to 2D for displaying as a single image.
def create_mosaic(img_array, padding=2): #Add white padding to every image in the array with_padding = np.pad(img_array,((0,0),(0,0),(padding,padding), (padding,padding),(0,0)), 'constant', constant_values=(255)) #Stack rows vertically mosaic = np.vstack( #Sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reshape_arrays_to_images(X, image_size):\n index_dimensions = X.shape[:-1]\n return X.reshape(index_dimensions + image_size)", "def _reshape_images_to_arrays(X, image_size):\n index_dimensions = X.shape[:-len(image_size)]\n return X.reshape(index_dimensions + (int(np.prod(image_s...
[ "0.72734326", "0.71148777", "0.692364", "0.67427", "0.6676586", "0.665126", "0.64821535", "0.64639205", "0.6437096", "0.6434576", "0.641303", "0.6395982", "0.637544", "0.6337185", "0.6281935", "0.6279161", "0.62658864", "0.62275714", "0.6195275", "0.61799675", "0.61764807", ...
0.0
-1
Generate batches from dataset
def get_batches(data_array, batch_size=1000): start = 0 while True: batch = data_array[start:start + batch_size] if len(batch) == 0: break yield batch if len(batch) < batch_size: break start += batch_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_batches(dataset, batch_size):\n for i in range(0, len(dataset), batch_size):\n yield dataset[i:i + batch_size]", "def generate_batches(dataset, batch_size, shuffle=True,\n drop_last=True, device=\"cpu\"):\n dataloader = DataLoader(dataset=dataset, batch_size=batch_size,\...
[ "0.8241465", "0.7619338", "0.75657815", "0.73831856", "0.7269094", "0.72297466", "0.7207585", "0.7176144", "0.7154549", "0.71490026", "0.7076912", "0.70675063", "0.70473486", "0.70053595", "0.6996283", "0.6994088", "0.69929045", "0.6962829", "0.6962829", "0.69363683", "0.6929...
0.680629
39
Init timeline metadata, adding all collected info.
def init_timeline(self, reduce_op_type): timeline_list = self._load_timeline_data(reduce_op_type) # Init a dict for counting the num of streams. stream_count_dict = {} for timeline in timeline_list: self._parse_timeline_data(timeline, 0) # Updating the collection...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_timeline(self):\n timeline_list = self._load_timeline_data()\n\n # Init a dict for counting the num of streams.\n stream_count_dict = {}\n for timeline in timeline_list:\n self._parse_timeline_data(timeline, 0)\n # Updating the collection of streams.\n ...
[ "0.7694649", "0.6142569", "0.59966695", "0.5988403", "0.59715044", "0.59130824", "0.58006215", "0.57973856", "0.5773176", "0.5633608", "0.56335443", "0.5623044", "0.5607606", "0.5603519", "0.55880076", "0.55849594", "0.5558796", "0.55176955", "0.54883826", "0.5478793", "0.547...
0.65769875
1
Init timeline metadata, adding all collected info.
def init_timeline(self): timeline_list = self._load_timeline_data() # Init a dict for counting the num of streams. stream_count_dict = {} for timeline in timeline_list: self._parse_timeline_data(timeline, 0) # Updating the collection of streams. if le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_timeline(self, reduce_op_type):\n timeline_list = self._load_timeline_data(reduce_op_type)\n\n # Init a dict for counting the num of streams.\n stream_count_dict = {}\n for timeline in timeline_list:\n self._parse_timeline_data(timeline, 0)\n # Updating th...
[ "0.65769875", "0.6142569", "0.59966695", "0.5988403", "0.59715044", "0.59130824", "0.58006215", "0.57973856", "0.5773176", "0.5633608", "0.56335443", "0.5623044", "0.5607606", "0.5603519", "0.55880076", "0.55849594", "0.5558796", "0.55176955", "0.54883826", "0.5478793", "0.54...
0.7694649
0
Get corresponding BBG Source given sheet name
def read_basic_mkt_input( self, s_name ): workbook = self.workbook worksheet = workbook.sheet_by_name(s_name) ans_bk = {} ans_bk["source"] = worksheet.cell(4,1).value ans_bk["curve date"] = worksheet.cell(3,1).value ans_bk["value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_samplesheet(self):\n current_year = '20' + self.id[0:2]\n samplesheets_dir = os.path.join(self.CONFIG['samplesheets_dir'],\n current_year)\n ssname = os.path.join(samplesheets_dir, '{}.csv'.format(self.flowcell_id))\n if os.path.ex...
[ "0.6189816", "0.6178057", "0.59082836", "0.5865354", "0.56681496", "0.5661834", "0.565219", "0.56091833", "0.5602016", "0.55578524", "0.55121744", "0.5508468", "0.536729", "0.5337185", "0.5306344", "0.5282044", "0.52814555", "0.52546364", "0.5250441", "0.52349526", "0.5234882...
0.0
-1
Get corresponding BBG Source given sheet name
def read_basic_swap_input( self, s_name ): workbook = self.workbook worksheet = workbook.sheet_by_name(s_name) ans_bk = {} ans_bk["source"] = worksheet.cell(4,1).value ans_bk["curve date"] = worksheet.cell(3,1).value ans_bk["valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_samplesheet(self):\n current_year = '20' + self.id[0:2]\n samplesheets_dir = os.path.join(self.CONFIG['samplesheets_dir'],\n current_year)\n ssname = os.path.join(samplesheets_dir, '{}.csv'.format(self.flowcell_id))\n if os.path.ex...
[ "0.6192852", "0.61829525", "0.5912035", "0.5868658", "0.567335", "0.56624097", "0.56510127", "0.56077975", "0.56066775", "0.55575496", "0.55129373", "0.55075455", "0.5366931", "0.53396696", "0.53029937", "0.5284438", "0.5279742", "0.5253115", "0.5251199", "0.52394855", "0.523...
0.0
-1
Get corresponding BBG Source given sheet name
def read_basic_fx_input( self, s_name ): workbook = self.workbook worksheet = workbook.sheet_by_name(s_name) ans_bk = {} ans_bk["source"] = worksheet.cell(4,1).value ans_bk["cv date"] = worksheet.cell(3,1).value ans_bk["value date"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_samplesheet(self):\n current_year = '20' + self.id[0:2]\n samplesheets_dir = os.path.join(self.CONFIG['samplesheets_dir'],\n current_year)\n ssname = os.path.join(samplesheets_dir, '{}.csv'.format(self.flowcell_id))\n if os.path.ex...
[ "0.6189816", "0.6178057", "0.59082836", "0.5865354", "0.56681496", "0.5661834", "0.565219", "0.56091833", "0.5602016", "0.55578524", "0.55121744", "0.5508468", "0.536729", "0.5337185", "0.5306344", "0.5282044", "0.52814555", "0.52546364", "0.5250441", "0.52349526", "0.5234882...
0.0
-1
Get corresponding BBG Source given sheet name
def read_basic_opt_input( self, s_name ): workbook = self.workbook worksheet = workbook.sheet_by_name(s_name) ans_bk = {} ans_bk["source"] = worksheet.cell(4,1).value ans_bk["curve date"] = worksheet.cell(3,1).value ans_bk["value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_samplesheet(self):\n current_year = '20' + self.id[0:2]\n samplesheets_dir = os.path.join(self.CONFIG['samplesheets_dir'],\n current_year)\n ssname = os.path.join(samplesheets_dir, '{}.csv'.format(self.flowcell_id))\n if os.path.ex...
[ "0.6189816", "0.6178057", "0.59082836", "0.5865354", "0.56681496", "0.5661834", "0.565219", "0.56091833", "0.5602016", "0.55578524", "0.55121744", "0.5508468", "0.536729", "0.5337185", "0.5306344", "0.5282044", "0.52814555", "0.52546364", "0.5250441", "0.52349526", "0.5234882...
0.0
-1
Compute softmax values for each sets of scores in x.
def softmax(x): # pass # TODO: Compute and return softmax(x) x2 = x - np.amax(x) return np.exp(x2)/ np.sum(np.exp(x2), axis = 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_softmax(scores):\n if not scores:\n return []\n\n max_score = None\n for score in scores:\n if max_score is None or score > max_score:\n max_score = score\n\n exp_scores = []\n total_sum = 0.0\n for score in scores:\n x = math.exp(score - max_score)\n ...
[ "0.76584643", "0.76584643", "0.75839716", "0.7520069", "0.7448017", "0.7338574", "0.7290132", "0.726931", "0.72287184", "0.7208339", "0.7208301", "0.71756643", "0.71672153", "0.71650755", "0.715882", "0.7149386", "0.71357757", "0.7134225", "0.7134225", "0.71285176", "0.712851...
0.70811504
38
Normalizes a numpy array of points
def normalized(a, axis=-1, order=2): l2 = np.atleast_1d(np.linalg.norm(a, order, axis)) l2[l2 == 0] = 1 return a / np.expand_dims(l2, axis), l2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_points(pts):\r\n mean = np.mean(pts, axis=0)\r\n dist = np.mean(np.linalg.norm(pts - mean, axis=1))\r\n scale = np.sqrt(2)/dist\r\n pts_n = (pts - mean)*scale\r\n T = np.array([[scale, 0, -mean[0]*scale],\r\n [0, scale, -mean[1]*scale],\r\n [0, 0, ...
[ "0.76679116", "0.7303392", "0.71752846", "0.7110623", "0.70819265", "0.7039477", "0.7025924", "0.6982855", "0.6972277", "0.6961061", "0.69506335", "0.6944855", "0.6920742", "0.6909832", "0.6904043", "0.6885208", "0.6873545", "0.6843208", "0.6822215", "0.68169487", "0.68168473...
0.0
-1
Normalizes a 2D numpy array of points into unit box [0,1]
def normalize_box(a:np.ndarray): min_x = np.min(a[:, 0]) max_x = np.max(a[:, 0]) min_y = np.min(a[:, 1]) max_y = np.max(a[:, 1]) range_x = max_x - min_x range_y = max_y - min_y a[:, 0] = (a[:, 0] - min_x) / range_x a[:, 1] = (a[:, 1] - min_y) / range_y # print(range_x, range_y, min_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_points(pts):\r\n mean = np.mean(pts, axis=0)\r\n dist = np.mean(np.linalg.norm(pts - mean, axis=1))\r\n scale = np.sqrt(2)/dist\r\n pts_n = (pts - mean)*scale\r\n T = np.array([[scale, 0, -mean[0]*scale],\r\n [0, scale, -mean[1]*scale],\r\n [0, 0, ...
[ "0.7468448", "0.7058503", "0.7001372", "0.69308263", "0.69275063", "0.6840614", "0.6804683", "0.6801651", "0.67947876", "0.6780234", "0.6763154", "0.65873647", "0.65536785", "0.6551214", "0.6545062", "0.65236753", "0.65210927", "0.65210927", "0.651436", "0.65061605", "0.65045...
0.74375284
1
Calculates a vector's magnitude.
def vector_magnitude(vec): magnitude = np.sqrt(np.sum(vec**2)) return(magnitude)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magnitude(v: Vector2) -> float:\n return sqrt(dot(v, v))", "def magnitude(vector: Vec3) -> float:\n return m.sqrt(sum(x * x for x in vector))", "def magnitude(v):\n return math.sqrt(Vector.sum_of_squares(v))", "def magnitude(self):\n return sqrt(Vector.dot(self, self))", "def get_ve...
[ "0.83944386", "0.81817174", "0.8133356", "0.79377276", "0.7850437", "0.7835626", "0.7811086", "0.77646863", "0.77530664", "0.7705905", "0.7528858", "0.7480715", "0.73986834", "0.7332721", "0.7315547", "0.7287969", "0.72619176", "0.7258984", "0.7257842", "0.7246664", "0.720745...
0.8029723
3
Aligns vector a to vector b with axis angle rotation
def align_vector_to_another(a=np.array([0, 0, 1]), b=np.array([1, 0, 0])): if np.allclose(np.abs(a),np.abs(b),atol=.01): return None, None axis_ = np.cross(a, b) axis_ = axis_ / np.linalg.norm(axis_) angle = np.arccos(np.dot(a, b)) return axis_, angle
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(a, b):\n ab_vec = (b[1] - a[1], a[0] - b[0]) # vector with bottom-right origin\n res = atan2(*ab_vec) * 180 / pi # angle with yaxis in [-180, 180]\n if res < 0: # from [-180, 180] to [0, 360]\n res += 360\n return res", "def angle_between_vectors(a, b):\n angle = (acos(dot(a, b...
[ "0.6937838", "0.68454874", "0.67928874", "0.67172676", "0.67141795", "0.66880816", "0.6663808", "0.6596096", "0.6592772", "0.6579849", "0.6579642", "0.6561774", "0.6525386", "0.6494755", "0.6479828", "0.6428853", "0.6403829", "0.63940567", "0.6358735", "0.63525146", "0.634419...
0.81538045
0
Computes the maximum sum of non adjacent numbers from the given array using the above mentioned approach
def maximum_non_adjacent_sum(array: list[int]) -> int: length = len(array) # The maximum sum for an array with one element is the element itself assert length > 1 if length == 1: return array[0] sum_k = array[0] # With two elements, the maximum sum is the larger of the two elements if length == 2: return ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kadane(array):\n curSum = maxSum = float('-inf')\n\n for x in array:\n curSum = x + max(curSum, 0)\n\n maxSum = max(curSum, maxSum)\n\n print(\"x: {:5}, curSum: {:5}, maxSum: {:5}\".format(x, curSum, maxSum))\n \n return maxSum", "def max_sum_from_start(array):\n array...
[ "0.7790113", "0.759904", "0.7501926", "0.7296347", "0.7272469", "0.7232971", "0.72043294", "0.71993965", "0.71403694", "0.71213776", "0.7100625", "0.70983094", "0.6987121", "0.6954923", "0.6954085", "0.6931704", "0.68568736", "0.6839619", "0.6764028", "0.6740653", "0.67366827...
0.8521267
0
Create a list of all .json file in a given file path
def list_json_files(folder_path): query = os.path.join(folder_path, '*.json') file_list = glob(query) return file_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_all_json_directory(file_path):\n glob_string = \"{}/{}\".format(file_path, \"*.json\")\n json_paths = glob.iglob(glob_string)\n\n jsons = [read_json(json_path) for json_path in json_paths]\n\n return jsons", "def get_existing_jsons(json_dir):\n try:\n json_list = os.listdir(json_di...
[ "0.7775101", "0.73559356", "0.7283014", "0.70136076", "0.700648", "0.6880387", "0.6869387", "0.6865411", "0.6842113", "0.6816563", "0.6807347", "0.6738284", "0.6729445", "0.67038393", "0.6695209", "0.669424", "0.6631813", "0.66301036", "0.6628544", "0.6617845", "0.6613795", ...
0.6990642
5
Get parents of a given entity
def GetParents(self, entity): return self.GetEntities(entity.GetParents())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parents(self, GenericParams, context=None):\n return self._client.call_method('OntologyAPI.get_parents',\n [GenericParams], self._service_ver, context)", "def get_parents(G, node_id):\n\n parents = list(set(nx.ancestors(G, node_id)))\n\n return parents"...
[ "0.70378757", "0.7035916", "0.69721824", "0.6910299", "0.6855985", "0.6835428", "0.6799355", "0.6750858", "0.6732974", "0.6713188", "0.6708765", "0.6658928", "0.66005963", "0.65984064", "0.65807855", "0.6535651", "0.65349215", "0.65024495", "0.64958155", "0.64610136", "0.6460...
0.8669643
0
Test whether the entity allows to be controlled after duplication. Returns bool
def AllowControl(self): return self._allow_control
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_insert(self, obj):\n return self.insert", "def allow_duplicate_design(self):\n return self._allow_duplicate_design", "def can_create(self): # pylint: disable=no-self-use\n return True", "def check_postreplicate(self):\n if getattr(self, \"all_est_objectives\", None) is No...
[ "0.6547938", "0.648056", "0.64314765", "0.6424714", "0.63344556", "0.6262208", "0.6236708", "0.61827415", "0.6154141", "0.6108537", "0.6105361", "0.60964715", "0.60898703", "0.6069861", "0.6069861", "0.6057228", "0.5977947", "0.5949727", "0.5918777", "0.58868766", "0.5872516"...
0.0
-1
Test whether the entity allows multiple parents of the provided type.
def AllowMultipleParents(self, type_): return self._multiple_parents[type_]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def HasParent(self, type_):\r\n\r\n try:\r\n\r\n if self._parents[type_]:\r\n\r\n return True\r\n\r\n except KeyError:\r\n\r\n return False\r\n\r\n return False", "def has_ancestor_of_type(self, NodeType):\n\n node = self.parent\n while node:\n ...
[ "0.66979855", "0.62690306", "0.5912054", "0.56911033", "0.56849015", "0.56543636", "0.56431884", "0.55755687", "0.54983115", "0.53846586", "0.536592", "0.536026", "0.5345359", "0.53230196", "0.5292702", "0.52878743", "0.5251846", "0.52119374", "0.5210031", "0.5205553", "0.520...
0.83585304
0
Clear the children of the entity
def ClearChildren(self): for type_ in self._children: self._children[type_] = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\n self.children.clear()\n self.modified = datetime.now()", "def clear(self):\n self.children = []\n return self", "def clear_all_data(self):\n\n if not self.dont_clear:\n self.clear_data()\n self.update()\n\n for child in self.chi...
[ "0.75002694", "0.74598676", "0.72960055", "0.72649443", "0.72187173", "0.7121578", "0.6997812", "0.6801571", "0.6772865", "0.67580605", "0.663768", "0.6631195", "0.6625996", "0.66017205", "0.6440889", "0.6439501", "0.642849", "0.64223963", "0.64223963", "0.64223963", "0.64223...
0.7293151
3
Clear the parents of the entity
def ClearParents(self): for type_ in self._parents: self._parents[type_] = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_relations(self):\n self.children = {}\n self.parents = {}", "def removeFromParents(self):\n for parent in self.parents:\n if self in parent.dependents:\n parent.dependents.remove(self)\n self.parents.clear()", "def clear(self):\n self._ancestor...
[ "0.75299436", "0.7134056", "0.696838", "0.65472823", "0.6541352", "0.65391", "0.64903283", "0.6445622", "0.6439944", "0.63900125", "0.6354401", "0.63496923", "0.63119483", "0.63033634", "0.62595284", "0.6243364", "0.6235576", "0.6213534", "0.6207422", "0.61858636", "0.6133045...
0.7875709
0
Create a deep copy of the entity Returns Entity A copy of the entity
def Copy(self): return copy.deepcopy(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone(self):\n entity_class = type(self)\n data = self.serialize()\n del data[\"uid\"]\n new_entity = entity_class(data)\n return new_entity", "def copy(self: T) -> T:\n entity = self.__class__(doc=self.doc)\n # copy and bind dxf namespace to new entity\n ...
[ "0.8278038", "0.76462495", "0.75567245", "0.7099693", "0.7029619", "0.69239914", "0.6901216", "0.68915534", "0.6855977", "0.68401283", "0.68083304", "0.68015134", "0.6753319", "0.67384964", "0.6721332", "0.6712162", "0.67109513", "0.66734594", "0.6651741", "0.66450894", "0.66...
0.6499778
50
Return a list of children pointers associated to the entity
def GetChildren(self, type_=None): if type_ is not None: try: return self._children[type_] except KeyError: raise KeyError('{} does not allow that type of children'.format(self._attr[1:])) else: # flatten dict and return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_children(self):\n\n return self.children", "def GetChildren(self, entity, type_=None):\r\n\r\n return self.GetEntities(entity.GetChildren(type_))", "def children(self):\n return []", "def get_list_of_children(self) :\n return self.list_of_children", "def get_list_of_children...
[ "0.7303178", "0.7286609", "0.71661067", "0.70721155", "0.7047712", "0.7043821", "0.7043821", "0.7009401", "0.69288146", "0.6925735", "0.6925735", "0.6890777", "0.6850933", "0.6805715", "0.67959785", "0.6788818", "0.6776807", "0.6761599", "0.6749264", "0.6713743", "0.6709093",...
0.0
-1
Get the parents of a specific type associated to the entity
def GetParents(self, type_=None): if type_ is not None: try: parents = self._parents[type_] if self._multiple_parents[type_]: return parents else: if parents: retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetParentByType(self, entity, type_):\r\n\r\n pointer = entity.GetParents(type_)\r\n\r\n if pointer is not None:\r\n\r\n return self.GetEntity(*pointer)", "def GetParents(self, entity):\r\n return self.GetEntities(entity.GetParents())", "def parents(self, data_type_key=None,...
[ "0.7851591", "0.75454146", "0.71108377", "0.6769059", "0.66835827", "0.6642637", "0.65302324", "0.6443781", "0.6442697", "0.64395", "0.64149404", "0.6362174", "0.6343136", "0.63214725", "0.63041157", "0.62515223", "0.62275803", "0.61962783", "0.6163328", "0.6130632", "0.61062...
0.7270508
2
Get a specific profile from a class Profile on a SimulationResult.
def GetSimulationProfile(self, simulation, variable): return self.GetSimulationResult(simulation).GetProfile(variable)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instance_profile(self, profile):\n try:\n path = (\"/v1/instance/profiles/{}?version={}\"\n \"&generation={}\".format(profile, self.cfg[\"version\"],\n self.cfg[\"generation\"]))\n\n return qw(\"iaas\", \"GET\", path...
[ "0.69722795", "0.69489366", "0.6843249", "0.6817629", "0.6740549", "0.66771716", "0.6549876", "0.6501466", "0.64871454", "0.6483116", "0.6389025", "0.6317443", "0.6292724", "0.62292993", "0.6224848", "0.6220301", "0.6200135", "0.6165118", "0.6093839", "0.6085287", "0.60836047...
0.70444095
0
Test if the entity has a parent of a given type
def HasParent(self, type_): try: if self._parents[type_]: return True except KeyError: return False return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetParentByType(self, entity, type_):\r\n\r\n pointer = entity.GetParents(type_)\r\n\r\n if pointer is not None:\r\n\r\n return self.GetEntity(*pointer)", "def has_ancestor_of_type(self, NodeType):\n\n node = self.parent\n while node:\n if isinstance(node, NodeType):\n ...
[ "0.72968185", "0.7188222", "0.69000685", "0.68600243", "0.66776216", "0.66341865", "0.65488684", "0.6480278", "0.64405185", "0.63851494", "0.62868536", "0.62704897", "0.6238255", "0.62199914", "0.6196339", "0.6013884", "0.598934", "0.59847695", "0.5959107", "0.59538436", "0.5...
0.7841225
0
Test if the entity is of a provided family type
def IsFamilyType(self, type_): return self._family_type == type_
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_family (self):\n return (self.role == ROLE_OWNER or self.role == ROLE_FAMILY)", "def is_entity(self, s):\n return True", "def GetFamilyType(self):\r\n\r\n return self._family_type", "def is_individual(self, entity):\n if isinstance(entity, str):\n entity = self.g...
[ "0.63517827", "0.60373425", "0.60156554", "0.59935874", "0.58795214", "0.5741402", "0.5677106", "0.5550165", "0.55471915", "0.55274934", "0.54598486", "0.54576343", "0.54510224", "0.54455495", "0.54409844", "0.5414506", "0.541328", "0.534755", "0.53429985", "0.53393424", "0.5...
0.76251453
0
Test if entity is a pipeline Returns bool bool
def IsPipeline(self): return self.IsType(ID_PIPELINE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_pipeline(obj):\n from .pipeline import Pipeline\n return isinstance(obj, Pipeline)", "def IsRootPipeline(self):\n return self.pipeline_id == self.root_pipeline_id", "def pipeline_exist(self, name):\n return name in self.pipelines", "def _is_graphpipeline(param):\n if not isinstance(...
[ "0.7962183", "0.6608181", "0.65364647", "0.65308905", "0.6159888", "0.5932114", "0.5878004", "0.5768552", "0.5648795", "0.5637851", "0.56185025", "0.5501469", "0.5483586", "0.54692155", "0.54636157", "0.54510266", "0.538306", "0.538306", "0.5343606", "0.5288433", "0.52728236"...
0.7833117
1
Test if entity is a Producer Returns bool bool
def IsProducer(self): return self.IsType(ID_PRODUCER)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_entity(self, s):\n return True", "def publish(self, producer_id, product):\n try:\n self.producer_queues[producer_id].put(product)\n return True\n except Full:\n return False", "def publish(self, producer_id, product):\n # Check if producer's ...
[ "0.596289", "0.58255386", "0.57109255", "0.55633044", "0.55029863", "0.550103", "0.5488219", "0.5451552", "0.5398858", "0.5360225", "0.5312653", "0.53116876", "0.52720124", "0.52287215", "0.5224274", "0.5125807", "0.51098657", "0.50647986", "0.5061213", "0.5053021", "0.503329...
0.7446595
0
Test if entity is a Project Returns bool bool
def IsProject(self): return self.IsType(ID_PROJECT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_project(self, project=None):\n try:\n return project.i_am_project()\n except Exception:\n return False", "def is_project(self): # tag matches project tag\n return self.tag == tagset.project.tag", "def is_project_set(self):\n return self._project is not ...
[ "0.733865", "0.69721633", "0.66939896", "0.6307739", "0.6292039", "0.6212944", "0.6050611", "0.596111", "0.59177923", "0.59110445", "0.5892002", "0.58453834", "0.5844855", "0.5831446", "0.57945657", "0.5762963", "0.574651", "0.5698893", "0.56956583", "0.56795996", "0.5660763"...
0.7389271
0
Test if the entity holds simulation, both histories and predictions Returns bool bool
def IsSimulationHolder(self): return self._simulation_holder
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_simulated_trade(entity):\n return entity.record_type == \"Trade\" and entity.status == \"Simulated\"", "def should_run_simulations(self):\n return self.ctx.should_run_simulations", "def should_store_predictions(self) -> bool:\n any_pred = any(cb.interval.on_epoch for cb in self.trainer...
[ "0.67637825", "0.61686975", "0.61356914", "0.6069061", "0.5902817", "0.58371866", "0.57988465", "0.57959706", "0.5791279", "0.57872975", "0.5780984", "0.5778168", "0.5755582", "0.57079846", "0.568139", "0.56639403", "0.56488055", "0.56444883", "0.56356746", "0.5621348", "0.56...
0.56158143
20
Given a set of images with all the same shape, makes a mosaic with nrows and ncols
def make_mosaic(imgs, nrows, ncols, border=1): nimgs = imgs.shape[0] imshape = imgs.shape[1:] mosaic = ma.masked_all((nrows * imshape[0] + (nrows - 1) * border, ncols * imshape[1] + (ncols - 1) * border, 3), dtype=np.float3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_mosaic(imgs, nrows, ncols, border=1):\n nimgs = imgs.shape[0]\n imshape = imgs.shape[1:]\n\n mosaic = ma.masked_all((nrows * imshape[0] + (nrows - 1) * border,\n ncols * imshape[1] + (ncols - 1) * border),\n dtype=np.float32)\n\n paddedh = ...
[ "0.8045955", "0.7812499", "0.7664634", "0.7364875", "0.73270756", "0.7250745", "0.71756107", "0.7149815", "0.7125625", "0.7093408", "0.7067591", "0.70270324", "0.6987341", "0.68721837", "0.6868721", "0.67316914", "0.6728286", "0.6721507", "0.6661952", "0.66340476", "0.6619268...
0.80024326
1
helper function for cycling over color list if the number of items is higher than the length of the color list
def get_color(index): corrected_index = index % len(COLOR_LIST) return COLOR_LIST[corrected_index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __create_next_color(self):\r\n self.next_color = BLOCK_COLORS[randint(0, len(BLOCK_COLORS)-1)]", "def color_cycle(ind=None):\n # import matplotlib as mpl\n # c = np.uint32(np.array([int(c['color'][1:], 16) for c in mpl.rcParams['axes.prop_cycle']]))\n # c = np.double(np.flip(np.reshape(c.view...
[ "0.595417", "0.5915981", "0.5889342", "0.5791682", "0.5690962", "0.5668579", "0.5664715", "0.56606877", "0.5650225", "0.5647795", "0.5639241", "0.5622006", "0.5613418", "0.55921483", "0.5579861", "0.5571493", "0.55571806", "0.5530995", "0.5527619", "0.55171996", "0.5510304", ...
0.56115097
13
Wrapper for inserting int64 features into example proto
def int64_feature(value): if not isinstance(value,list): value = [value] return tf.train.Feature(int64_list=tf.train.Int64List(value=value))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _int64_features(value):\n return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))", "def _int64_feature(value):\r\n return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))", "def _int64_feature(value):\r\n return tf.train.Feature(int64_list=tf.train.Int64List(value=[val...
[ "0.73848325", "0.7356459", "0.7356459", "0.7354396", "0.7353842", "0.7353842", "0.7353842", "0.7353842", "0.7353842", "0.7353842", "0.7353842", "0.7353842", "0.7353842", "0.73434615", "0.73434615", "0.73434615", "0.73434615", "0.73434615", "0.73434615", "0.73427653", "0.73338...
0.7131464
45
Test if ALAP schedule agrees with doublyreversed ASAP schedule.
def test_alap_agree_with_reverse_asap_reverse(self): qc = QuantumCircuit(2) qc.h(0) qc.delay(500, 1) qc.cx(0, 1) qc.measure_all() durations = InstructionDurations( [("h", 0, 200), ("cx", [0, 1], 700), ("measure", None, 1000)] ) pm = PassManag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_beat_order(previous_beat, next_beat):\n if previous_beat == 'p' and next_beat == 'N':\n return True\n elif previous_beat == 't' and next_beat == 'A':\n return True\n elif previous_beat == 'N' and next_beat == 't':\n return True\n elif previous...
[ "0.6326719", "0.61601436", "0.5870002", "0.5813306", "0.58030444", "0.5731692", "0.56768537", "0.5673744", "0.56379205", "0.5623279", "0.56035715", "0.55990654", "0.5593214", "0.5580965", "0.5580403", "0.5526381", "0.550808", "0.55058247", "0.54953486", "0.5460595", "0.545804...
0.70868224
0
Take a gray scale image and for each pixel around the center of the window generate a bit value of length window_size 2 1. window_size of 3 produces bit length of 8, and 5 produces 24. The image gets border of zero padded pixels half the window size. Bits are set to one if pixel under consideration is greater than the ...
def transform(image, window_size=3): half_window_size = window_size // 2 image = cv2.copyMakeBorder(image, top=half_window_size, left=half_window_size, right=half_window_size, bottom=half_window_size, borderType=cv2.BORDER_CONSTANT, value=0) rows, cols = image.shape census = np.zeros((rows - ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pixel_in_window(img, x_center, y_center, size):\n half_size = size // 2\n window = img[int(y_center - half_size):int(y_center + half_size), int(x_center - half_size):int(x_center + half_size)]\n x, y = (window.T == 1).nonzero()\n x = x + x_center - half_size\n y = y + y_center - half_size\n ...
[ "0.59427714", "0.591112", "0.5859442", "0.57153", "0.565953", "0.55790925", "0.5538362", "0.55047154", "0.5501985", "0.54689527", "0.54419786", "0.54319924", "0.54234457", "0.53974223", "0.5388298", "0.5370071", "0.53675824", "0.5360287", "0.53515315", "0.5349147", "0.5320539...
0.58753407
2
Greaterthan comparison using semantic versioning.
def __gt__(self, other: object) -> bool: if not isinstance(other, str): return NotImplemented return bool(semver.compare(self, other) > 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greater_than(self, ver1, ver2=VERSION):\n return self.__compare(ver1, ver2, reverse=True)", "def __gt__(self, version):\n if isinstance(version, str):\n return self.__version > SAMLVersion.valueOf(version)\n elif isinstance(version, (tuple, list)):\n return self.__v...
[ "0.7766513", "0.723109", "0.718097", "0.69289863", "0.6926175", "0.68791306", "0.6761309", "0.67535615", "0.6737463", "0.6717289", "0.65910023", "0.6590668", "0.6574695", "0.6560317", "0.6541082", "0.6522406", "0.648373", "0.64647985", "0.6459159", "0.6446488", "0.6443969", ...
0.0
-1
Greaterthanequals comparison using semantic versioning.
def __ge__(self, other: object) -> bool: if not isinstance(other, str): return NotImplemented return bool(semver.compare(self, other) >= 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greater_than(self, ver1, ver2=VERSION):\n return self.__compare(ver1, ver2, reverse=True)", "def __gt__(self, version):\n if isinstance(version, str):\n return self.__version > SAMLVersion.valueOf(version)\n elif isinstance(version, (tuple, list)):\n return self.__v...
[ "0.7590797", "0.7127617", "0.7109039", "0.68589824", "0.6830672", "0.66915405", "0.66396606", "0.66366255", "0.6547438", "0.6475291", "0.64265704", "0.63994026", "0.6342834", "0.63152397", "0.63030803", "0.62845993", "0.6269902", "0.6244361", "0.6236472", "0.62047124", "0.619...
0.0
-1
Log Errors caused by Updates.
def error(update, context): logger.warning('Update "%s" caused error "%s"', update, context.error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, context.error)", "def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, context.error)", "def error(self, update, context):\n self.logger.warning('Update \"%s\" caused error \"...
[ "0.7895998", "0.7895998", "0.78257465", "0.77876204", "0.77857095", "0.77857095", "0.7736321", "0.7720785", "0.77103233", "0.7705559", "0.7657797", "0.76552874", "0.76517016", "0.76468384", "0.76378685", "0.76123977", "0.7566961", "0.75665903", "0.7553289", "0.7541538", "0.75...
0.77470577
26
Compute online exponentially weighted mean per column over 2D values. Takes the first observation as is, then computes the subsequent exponentially weighted mean accounting minimum periods.
def online_ewma( values: np.ndarray, deltas: np.ndarray, minimum_periods: int, old_wt_factor: float, new_wt: float, old_wt: np.ndarray, adjust: bool, ignore_na: bool, ): result = np.empty(values.shape) weighted_avg = values[0] n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exp_mavg(dataset, window):\n\tweights = np.exp(np.linspace(-1., 0., window))\n\tweights /= weights.sum()\n\ta = np.convolve(dataset, weights, mode='full')[:len(dataset)]\n\ta[:window] = a[window]\n\treturn a", "def s_mavg(dataset, window):\n\tweigths = np.repeat(1.0, window)/window\n\treturn np.convolve(dat...
[ "0.6950851", "0.6487448", "0.63459855", "0.6303681", "0.6298694", "0.62960786", "0.62834847", "0.62467515", "0.6236795", "0.6236795", "0.61982334", "0.6180264", "0.6165429", "0.6115755", "0.61063087", "0.6037333", "0.6032074", "0.6025835", "0.59915036", "0.5989701", "0.596503...
0.56883055
52
Return the value of the state (computed in __init__).
def getValue(self, state): return self.values[state]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_value(self):\n return self.__state", "def get_value(self):\n return self.__state", "def value(self, state):\r\n raise NotImplementedError", "def value(self, state):\r\n raise NotImplementedError", "def value(self, state):\n raise NotImplementedError", "def value...
[ "0.84119457", "0.84119457", "0.83227456", "0.83227456", "0.8300559", "0.8300559", "0.8250657", "0.80266315", "0.8024696", "0.80224997", "0.7957269", "0.79056394", "0.7832761", "0.7743842", "0.7734989", "0.7734989", "0.7734989", "0.7734989", "0.7734989", "0.7734989", "0.773498...
0.79315007
13