query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Manual tracking of objects in videoclips using the mouse. Allows manual tracking of an object(s) in the video clip between times `t1` and `t2`. This displays the clip frame by frame and you must click on the object(s) in each frame. If ``t2=None`` only the frame at ``t1`` is taken into account. Returns a list ``[(t1, x... | def manual_tracking(clip, t1=None, t2=None, fps=None, n_objects=1, savefile=None):
import pygame as pg
screen = pg.display.set_mode(clip.size)
step = 1.0 / fps
if (t1 is None) and (t2 is None):
t1, t2 = 0, clip.duration
elif t2 is None:
t2 = t1 + step / 2
t = t1
txy_list = [... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def raytrace(pos1: tuple, pos2: tuple) -> list:\n x0, y0 = pos1\n x1, y1 = pos2\n tiles = []\n dx = abs(x1 - x0)\n dy = abs(y1 - y0)\n x, y = x0, y0\n n = 1 + dx + dy\n x_inc = 1 if x1 > x0 else -1\n y_inc = 1 if y1 > y0 else -1\n error = dx - dy\n dx *= 2\n dy *= 2\n\n while... | [
"0.5310043",
"0.5286239",
"0.5057076",
"0.4953343",
"0.49187213",
"0.48390925",
"0.48240438",
"0.4816844",
"0.4795924",
"0.47676378",
"0.47432348",
"0.47256297",
"0.4705768",
"0.46897307",
"0.4685795",
"0.46163556",
"0.46015707",
"0.45810923",
"0.45771328",
"0.45648286",
"0.4... | 0.7477079 | 0 |
Find an image pattern in a picture optionally defining bounds to search. The image is found is ``pat`` is inside ``pic[x +/ r, y +/ r]``. | def findAround(pic, pat, xy=None, r=None):
if xy and r:
h, w = pat.shape[:2]
x, y = xy
pic = pic[y - r : y + h + r, x - r : x + w + r]
matches = cv2.matchTemplate(pat, pic, cv2.TM_CCOEFF_NORMED)
yf, xf = np.unravel_index(matches.argmax(), matches.shape)
return (x - r + xf, y - r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_icon_by_pic(name, offset=(10, 10), **kwargs):\r\n rate = kwargs.get(\"rate\", 0.9)\r\n path_demo = get_current_dir('demo.png')\r\n capture_screen(path_demo)\r\n img_name = cv2.imread(name)\r\n t = cv2.matchTemplate(cv2.imread(path_demo), img_name,\r\n cv2.TM_CCOEFF_N... | [
"0.58755505",
"0.5569356",
"0.55036914",
"0.54863626",
"0.54638803",
"0.54306555",
"0.5426215",
"0.5414956",
"0.5314991",
"0.5228552",
"0.521884",
"0.52016884",
"0.5173406",
"0.5113699",
"0.50773954",
"0.49873438",
"0.49566814",
"0.49469578",
"0.49061322",
"0.4893878",
"0.488... | 0.7766923 | 0 |
Tracks a given pattern (small image array) in a video clip. Returns ``[(x1, y1), (x2, y2)...]`` where ``(xi, yi)`` are the coordinates of the pattern in the clip on frame ``i``. To select the frames you can either specify a list of times with ``tt`` or select a frame rate with ``fps``. This algorithm assumes that the p... | def autoTrack(clip, pattern, tt=None, fps=None, radius=20, xy0=None):
if not autotracking_possible:
raise IOError(
"Sorry, autotrack requires OpenCV for the moment. "
"Install OpenCV (aka cv2) to use it."
)
if not xy0:
xy0 = findAround(clip.get_frame(tt[0]), patt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_timing_pattern(img, timing_patterns):\n draw_img = img.copy()\n for timing_pattern in timing_patterns:\n cv2.line(draw_img, timing_pattern[0], timing_pattern[1], (0, 255, 0), 2)\n show(draw_img)",
"def draw_separate_position_patterns(img, found, contours):\n for i in found:\n q... | [
"0.53953344",
"0.51301557",
"0.50669867",
"0.5048978",
"0.50434595",
"0.49598178",
"0.49458113",
"0.49102822",
"0.49101192",
"0.48921007",
"0.48678896",
"0.4867333",
"0.4805416",
"0.47268882",
"0.4714568",
"0.4698213",
"0.46616584",
"0.46566698",
"0.46362138",
"0.46190938",
"... | 0.66206294 | 0 |
Swarm function go through each agent and compare positions with other quads find the difference between two locations find the norm (euclidean distance) between two agents | def swarm_next_location(node_locations, agents_locations, agents_velocities, agents_angles):
# Potential Field Gradient Calculation
# Gradient of potential field
dv = numpy.zeros((AGENT_COUNT, DIMENSION_COUNT)) # create an array of values
for agent_it_1 in range(0, AGENT_COUNT):
# Inter-Agent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_agent_distances_vector(self):\n count = 0\n for agent in self.agents:\n agent_loc = agent.getz()\n\n for i, each_task in enumerate(self.tasks):\n dist = euclid_dist(agent_loc, each_task.getloc())\n self.agent_distances[count][i] = dist\n ... | [
"0.6117487",
"0.59835637",
"0.59294254",
"0.5841786",
"0.5818312",
"0.5792214",
"0.5784532",
"0.5768335",
"0.56439126",
"0.56345",
"0.5620634",
"0.56057656",
"0.5601702",
"0.55617213",
"0.55402714",
"0.5538578",
"0.5528003",
"0.5515387",
"0.5493555",
"0.5465111",
"0.54553723"... | 0.6788852 | 0 |
Upload 10 files at a time! | def upload_all(all_file_names):
with ThreadPool(processes=int(10)) as pool:
return pool.map(upload_file, all_file_names) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upload(server):\n for i in range(10):\n start_time = time.time()\n logging.debug('Start uploading: %d' % i)\n os.system(\"scp uploads/18UPLOAD %s:\" % server)\n end_time = time.time()\n logging.debug('End uploading: ')\n logging.debug('Time taken by uploader: %s' % ... | [
"0.75896925",
"0.7002882",
"0.69199824",
"0.6625899",
"0.6493321",
"0.6487956",
"0.63541657",
"0.6290902",
"0.627746",
"0.6256918",
"0.62544245",
"0.6240064",
"0.6217582",
"0.6194342",
"0.6168501",
"0.6125494",
"0.6114586",
"0.6112695",
"0.6050361",
"0.60037833",
"0.5988256",... | 0.77975726 | 0 |
The total width of the widget, in pixels. Includes the border and margin. | def widget_width(self) -> Tuple[int, int]:
return self.widget_size[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def margin_width(self):\n return self.border_width() + self.margin_left + self.margin_right",
"def width(self) :\n return self.m_width",
"def width (self):\n return self._w",
"def getWidth(self):\n return DEFAULT_WIDTH",
"def getWidth(self):\n return constants.DEFAULT_WID... | [
"0.7723997",
"0.76160294",
"0.75883275",
"0.7581459",
"0.75692683",
"0.75485593",
"0.75204754",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7487707",
"0.7464676",
"0.7464676"... | 0.81201506 | 0 |
Gets the currently configured thickness of the border (in pixels) | def border_thickness(self) -> int:
return self._border_thickness | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def border_thickness(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"border_thickness\")",
"def border_thickness(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"border_thickness\")",
"def border_thickness(self) -> Optional[pulumi.Input[str]]:\n return pu... | [
"0.81657225",
"0.81657225",
"0.81657225",
"0.8057173",
"0.79038316",
"0.7642933",
"0.73819387",
"0.72433066",
"0.71979153",
"0.7078818",
"0.70385265",
"0.7023323",
"0.68920004",
"0.6884572",
"0.6832354",
"0.66562974",
"0.66272616",
"0.65804005",
"0.65804005",
"0.65035385",
"0... | 0.8602707 | 0 |
The total height of the widget, in pixels. Includes the border and margin. | def widget_height(self) -> int:
return self.widget_size[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def margin_height(self):\n return self.border_height() + self.margin_top + self.margin_bottom",
"def get_height(self):\r\n return self._height",
"def get_height(self):\r\n return self._height",
"def get_height(self):\r\n return self._height",
"def border_height(self):\n r... | [
"0.7872301",
"0.7724713",
"0.7724713",
"0.7724713",
"0.77205145",
"0.77104795",
"0.76858354",
"0.7669082",
"0.7669082",
"0.7669082",
"0.7669082",
"0.76284504",
"0.76284504",
"0.7616629",
"0.7573606",
"0.7535248",
"0.75344294",
"0.75181544",
"0.7510058",
"0.7510058",
"0.751005... | 0.86296713 | 0 |
Returns the currently configured value for the color of the outline (border) of the widget. | def border_color(self) -> int:
return self._border_color | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def border_color(self):\n return self._border_rgba",
"def border_color(self):\n if self.has_border:\n return Color(self._border_actor.GetProperty().GetColor())\n return None",
"def borderColor( self ):\n return self._borderColor",
"def bordercolor(self):\n return... | [
"0.76036835",
"0.73927736",
"0.73853207",
"0.7094367",
"0.6450684",
"0.6438329",
"0.6391727",
"0.6375041",
"0.6371977",
"0.63530296",
"0.63462377",
"0.6346167",
"0.63437575",
"0.63370436",
"0.63370436",
"0.6334489",
"0.6313817",
"0.6308941",
"0.6305914",
"0.6291787",
"0.62870... | 0.7435684 | 1 |
The fill of the progress bar. Can be a hex value for a color or ``None`` for transparent. | def fill(self) -> int:
return self._fill_color | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fillcolor(self, *args):\n if args:\n color = self._colorstr(args)\n if color == self._fillcolor:\n return\n self.pen(fillcolor=color)\n else:\n return self._color(self._fillcolor)",
"def fill(self, colour: int, /) -> None:",
"def fill... | [
"0.7329175",
"0.73097813",
"0.7186909",
"0.718688",
"0.7166474",
"0.7053421",
"0.66755503",
"0.6654663",
"0.6640797",
"0.66284734",
"0.631836",
"0.631836",
"0.6185718",
"0.61346",
"0.6117504",
"0.6089102",
"0.6018615",
"0.60022604",
"0.5995704",
"0.59930784",
"0.596605",
"0... | 0.7374778 | 0 |
The color of the bar's fill | def bar_color(self) -> int:
return self._bar_color | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill(self, color):",
"def fillcolor(self):\n return self._fillcolor",
"def fill(self, colour: int, /) -> None:",
"def fillcolor(self, *args):\n if args:\n color = self._colorstr(args)\n if color == self._fillcolor:\n return\n self.pen(fillcolo... | [
"0.73191744",
"0.710414",
"0.6960717",
"0.68388325",
"0.6779252",
"0.6712766",
"0.6560369",
"0.6522603",
"0.65224266",
"0.6330059",
"0.62342465",
"0.61958367",
"0.6157005",
"0.61489546",
"0.6054532",
"0.60152364",
"0.59889066",
"0.59789014",
"0.590285",
"0.58719695",
"0.58598... | 0.73930514 | 0 |
Sets the color of the bar | def bar_color(self, color: Union[int, Tuple[int, int, int]]) -> None:
self._bar_color = color
if color is None:
self._palette[2] = 0x00
self._palette.make_transparent(2)
else:
self._palette[2] = color
self._palette.make_opaque(2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setBarColor(front=-1,side=-1,top=-1):\n dislin.barclr(front,side,top)",
"def bar_color(self) -> int:\n\n return self._bar_color",
"def setColors(self, background, barR, barG, barB, barA):\n self.volumeBar.override_background_color(\n Gtk.StateFlags.NORMAL, Gdk.RGBA(barR, barG, b... | [
"0.7708162",
"0.71365523",
"0.68602777",
"0.6804917",
"0.67231643",
"0.6674027",
"0.66058344",
"0.65714437",
"0.6562546",
"0.65551317",
"0.6480851",
"0.647629",
"0.64459276",
"0.64273405",
"0.63670033",
"0.63262546",
"0.6308758",
"0.6307943",
"0.6272581",
"0.6260553",
"0.6255... | 0.7670063 | 1 |
Sets the value for the underlying variable _progress, then calls self.render() with the appropriate values. | def _set_progress(self, value: float) -> None:
self._progress = round(value, 4)
self._render(self._old_value, self._value, value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_progress_value(self, value):\r\n\r\n pass",
"def set_progress(self, progress: float):",
"def progress(self, value):\n self.step = float(value)\n self._draw()",
"def _setProgress(self, progress):\n # print \"Progress set %.2f --------------------------------\" % progress\n\... | [
"0.7885928",
"0.772645",
"0.7424771",
"0.7295443",
"0.72013587",
"0.71065104",
"0.70746356",
"0.70708585",
"0.70708585",
"0.701697",
"0.70077187",
"0.70045197",
"0.6987702",
"0.6974532",
"0.69179356",
"0.68095684",
"0.6750767",
"0.6744838",
"0.6734447",
"0.66794497",
"0.66031... | 0.86373645 | 0 |
Draws the outline (border) of the progressbar, with a thickness value from self.border_thickness. | def _draw_outline(self) -> None:
stroke = self.border_thickness
# draw outline rectangle
for _w in range(self.widget_width):
for line in range(stroke):
self._bitmap[_w, line] = 1
self._bitmap[_w, self.widget_height - 1 - line] = 1
for _h in ra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawBorder(self):\n\t\t# horizontal lines\n\t\tself.wts(0, 0, '╭' + '─' * (self.width - 2) + '╮', self._borderColor)\t\t\t\t\t\t# Top\n\t\tself.wts(self.height - 2, 0, '└' + '─' * (self.width - 2) + '╯', self._borderColor)\t\t\t# Bottom\n\t\t# vertical lines\n\t\tfor yPos in range(1, self.height - 2):\n\t\t\ts... | [
"0.6980046",
"0.6372926",
"0.6327431",
"0.6217453",
"0.5957238",
"0.58896434",
"0.58797497",
"0.5851642",
"0.58446896",
"0.58434147",
"0.58277005",
"0.5813987",
"0.5771594",
"0.57411146",
"0.57224476",
"0.56495273",
"0.55723834",
"0.55633676",
"0.5514165",
"0.5503805",
"0.548... | 0.7037233 | 0 |
Determines any visual space reserved for the widget based on the defined border thickness, and whether a margin should be placed between the border and the bar. The value is calculated as (2 x border_thickness) minus (2 x margin_size). The value for margin_size is either 0 (zero) or 1 (one) depending on the value of ma... | def _get_fill_border_size(self) -> int:
return (2 * self.border_thickness) + (2 * self.margin_size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def margin_size(self, value: int) -> None:\n\n if not isinstance(value, int):\n raise TypeError(\"The margin size must be an integer\")\n\n margin_spacing = (2 * value) + (2 * self._border_thickness)\n\n if margin_spacing >= self.widget_width:\n raise ValueError(\n ... | [
"0.69769204",
"0.6564969",
"0.6504523",
"0.6388232",
"0.6185595",
"0.61238915",
"0.6095111",
"0.6095111",
"0.6095111",
"0.6057181",
"0.60567766",
"0.5963709",
"0.5865675",
"0.58175457",
"0.57987976",
"0.575753",
"0.5754858",
"0.5664051",
"0.5650303",
"0.5649332",
"0.5642728",... | 0.6629648 | 1 |
Returns the size of the margin on a single side of the display | def margin_size(self) -> int:
return self._margin_size | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def margin_width(self):\n return self.border_width() + self.margin_left + self.margin_right",
"def margin(self):\r\n return self._generate_spacing_info(self.config['margin'])",
"def getMargin(self):\n assert False",
"def get_margin(self):\n _pal.lib.geometry_get_margin.restype = c... | [
"0.76753235",
"0.7494543",
"0.74747205",
"0.7453971",
"0.73529184",
"0.7100232",
"0.6973377",
"0.69361866",
"0.6888335",
"0.67849207",
"0.6593433",
"0.6588636",
"0.6546149",
"0.64597106",
"0.6458608",
"0.6458608",
"0.6456268",
"0.6439624",
"0.6420539",
"0.6403202",
"0.6391640... | 0.7870077 | 0 |
Sets the new size of the margin to be used between the border (if displayed) and the value bar. | def margin_size(self, value: int) -> None:
if not isinstance(value, int):
raise TypeError("The margin size must be an integer")
margin_spacing = (2 * value) + (2 * self._border_thickness)
if margin_spacing >= self.widget_width:
raise ValueError(
"The si... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_margin(self, margin):\n _pal.lib.geometry_set_margin(self._geometry, c.c_float(margin))",
"def SetMarginsSize(self, size):\r\n \r\n self.SetMargins(size.x, size.x, size.y, size.y)",
"def change_margin(self, margin):\n self.margin = margin * self._MM_IN_MICRONS\n\n sel... | [
"0.7088271",
"0.6982609",
"0.69273084",
"0.6687851",
"0.6584829",
"0.65272593",
"0.651799",
"0.6422928",
"0.61395323",
"0.6133535",
"0.60705185",
"0.60655385",
"0.6013266",
"0.5968473",
"0.5962315",
"0.59580904",
"0.5943472",
"0.58832717",
"0.58786684",
"0.58772904",
"0.58743... | 0.79206103 | 0 |
Gets the ratio (percentage) of a given value within the range of self.minimum and self.maximum. | def get_value_ratio(self, value: Union[int, float]) -> float:
if self.maximum == self.minimum:
return 0.0
return (float(value) - self.minimum) / (self.maximum - self.minimum) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_percent(self):\n if not (self.votes and self.score):\n return 0\n return 100 * (self.get_rating() / self.field.range)",
"def getPercent(self):\n if isinstance(self.score,numbers.Number) and self.getMaximum():\n return (1.0*self.score/self.getMaximum())\n ... | [
"0.6833876",
"0.67152834",
"0.6532714",
"0.64532036",
"0.64532036",
"0.64504224",
"0.6440304",
"0.64198923",
"0.6418154",
"0.6418154",
"0.6403832",
"0.63265127",
"0.6325848",
"0.632183",
"0.63187045",
"0.6256281",
"0.6231153",
"0.6217156",
"0.6195825",
"0.6180276",
"0.6125604... | 0.8040569 | 0 |
Does the work of actually creating the graphical representation of the value (percentage, aka "progress") to be displayed. | def _render(
self,
_old_value: Union[int, float],
_new_value: Union[int, float],
_progress_value: float,
) -> None:
_prev_ratio, _new_ratio = self._get_ratios(_old_value, _new_value)
_old_value_size, _new_value_size = self._get_value_sizes(
_prev_ratio, _... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_progress(self, value: float) -> None:\n\n self._progress = round(value, 4)\n self._render(self._old_value, self._value, value)",
"def prograssBar(val, final):\n end = \"\"\n maxlen = 50\n step = final // maxlen\n\n print(\"\\r[ \" + \"#\" * (val // step) + \" ] \" +\n ... | [
"0.72470385",
"0.71253514",
"0.70749027",
"0.6908125",
"0.6892346",
"0.6851142",
"0.6813287",
"0.6738935",
"0.6731503",
"0.66507053",
"0.66301835",
"0.6625872",
"0.65764683",
"0.6552549",
"0.6533988",
"0.65089285",
"0.64166343",
"0.6414557",
"0.6399664",
"0.6396538",
"0.63957... | 0.725467 | 0 |
Get a cube with the faces out of order on construction. | def unoriented_cube():
faces = get_oriented_cube_faces()
for face in faces:
np.random.shuffle(face)
poly = Polyhedron(get_cube_points(), faces, faces_are_convex=True)
poly.sort_faces()
return poly | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cube_array(self):\n cube_sides = {}\n\n for side in SIDES:\n cube_sides[side] = []\n \n # Todo Break this loop into helper functions for clarity and simplicity\n for coord in COORDS_3:\n for cubie in self.cubies:\n # Making sure that the c... | [
"0.682039",
"0.67192125",
"0.6679414",
"0.6615704",
"0.6559546",
"0.654458",
"0.6534792",
"0.64524424",
"0.637708",
"0.63354915",
"0.62427455",
"0.6239464",
"0.62222666",
"0.6202463",
"0.61873555",
"0.612637",
"0.6067909",
"0.60508484",
"0.6008664",
"0.600427",
"0.598841",
... | 0.801218 | 0 |
Check correctness of 2d shape distance implementations. | def assert_distance_to_surface_2d(shape, angles, computed_distance):
xy = np.array(
[computed_distance * np.cos(angles), computed_distance * np.sin(angles)]
)
xy = np.transpose(xy)
hull = ConvexHull(xy)
# Test the area
assert np.isclose(shape.area, hull.volume)
# Test the circumfer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shapeCompare(*args, **kwargs)->int:\n pass",
"def distance_checker(xyz1, xyz2):\n return math.sqrt((xyz1[0] - xyz2[0])**2 + (xyz1[1] - xyz2[1])**2 +\n (xyz1[2] - xyz2[2])**2)",
"def check_shape(layer1, layer2, attr):\n attr1 = getattr(layer1, attr, None)\n attr2 = getattr(la... | [
"0.66555154",
"0.63205105",
"0.63129497",
"0.63082397",
"0.628651",
"0.62430817",
"0.6223579",
"0.61524224",
"0.6145492",
"0.6106977",
"0.6094515",
"0.60916805",
"0.60875034",
"0.6085718",
"0.6083386",
"0.6075494",
"0.6069088",
"0.60206515",
"0.6012316",
"0.60007405",
"0.5962... | 0.6402657 | 1 |
Generate a quaternion from axis [x, y, z] and angle theta. | def quaternion_from_axis_angle(x, y, z, theta):
if x == y == z == 0:
return np.array([1, 0, 0, 0])
axis = np.array([x, y, z])
axis /= np.linalg.norm(axis)
return rowan.from_axis_angle(axis, theta) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def angle_axis_to_quaternion(axis, theta):\n if isinstance(axis, string_types):\n axis = axis.lower()\n if axis == 'x':\n axis = np.array([1., 0., 0.])\n elif axis == 'y':\n axis = np.array([0., 1., 0.])\n elif axis == 'z':\n axis = np.array([0., 0., ... | [
"0.76926434",
"0.7200943",
"0.7178451",
"0.71368057",
"0.69507265",
"0.6892011",
"0.6861867",
"0.68281937",
"0.6820917",
"0.68190604",
"0.6812797",
"0.68040746",
"0.6796988",
"0.67912024",
"0.67655146",
"0.675524",
"0.6728748",
"0.670903",
"0.6706233",
"0.6704836",
"0.6696777... | 0.849171 | 0 |
Check if two spheres are almost equal. Works for both circles and spheres. All args and kwargs are forwarded to np.isclose and np.allclose. | def sphere_isclose(c1, c2, *args, **kwargs):
return np.isclose(c1.radius, c2.radius, *args, **kwargs) and np.allclose(
c1.center, c2.center, *args, **kwargs
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _point_almost_equal(a,b, rtol=RTOL, atol=ATOL):\n return np.allclose(a._Point__loc, b._Point__loc,\n rtol=rtol, atol=atol)",
"def almost_equal(self, other, rtol=1e-05, atol=1e-08):\n\n # float attributes defining the instance\n fkeys = ['x0', 'y0', 'dx', 'dy']\n ... | [
"0.6594077",
"0.65919226",
"0.65481305",
"0.6344976",
"0.6266819",
"0.6196258",
"0.61764526",
"0.6156307",
"0.61361444",
"0.61240405",
"0.6084039",
"0.60762227",
"0.60162324",
"0.60157394",
"0.5998651",
"0.59830666",
"0.5966321",
"0.59443253",
"0.5931793",
"0.5924427",
"0.592... | 0.7489281 | 0 |
Test getting and setting the minimal bounding circle radius. This function will work for any shape in two or three dimensions based on the generic base class APIs, so it can be called in other pytest tests. | def _test_get_set_minimal_bounding_sphere_radius(shape, centered=False):
base_attr = "minimal" + ("_centered_" if centered else "_")
sphere_type = "circle" if isinstance(shape, Shape2D) else "sphere"
attr = base_attr + "bounding_" + sphere_type
bounding_sphere = getattr(shape, attr)
bounding_sphere... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_radius():\n center = Coordinates(7, 3)\n radius = 12\n\n returned_rad = get_radius(center, radius, 30)\n\n assert returned_rad == radius\n assert returned_rad != center.get_x()\n assert returned_rad != center.get_y()",
"def test_update_radius():\n center = Coordinates(1, 1)\n ... | [
"0.654615",
"0.61484224",
"0.61027306",
"0.60067105",
"0.59871185",
"0.5964421",
"0.5933814",
"0.58623713",
"0.58558685",
"0.582508",
"0.58149123",
"0.5797314",
"0.5770679",
"0.576661",
"0.5736985",
"0.57300043",
"0.5726174",
"0.571676",
"0.5708322",
"0.5696453",
"0.5671404",... | 0.73728734 | 0 |
Draws the background comprising of the lightblue sky and green grass | def background():
sky_color = (66, 170, 255) # color of the sky
grass_color = (0, 128, 0) # color of the grass
rect(screen, sky_color, (0, 0, 500, 250), 0) # sky
rect(screen, grass_color, (0, 250, 500, 250), 0) # grass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_background(self):\n backgrounds = {\n \"forest\": (38, 106, 46),\n \"desert\": (194, 178, 128)\n }\n self.background_surface.fill(backgrounds[self.geography])",
"def main_background():\n surface.fill(COLOR_GRAY)",
"def draw_bg(self):\n self.scre... | [
"0.78102857",
"0.7737531",
"0.73148644",
"0.7291126",
"0.7223079",
"0.71805614",
"0.6887953",
"0.6861217",
"0.670932",
"0.67014545",
"0.6694754",
"0.6650995",
"0.6435646",
"0.64259964",
"0.64249414",
"0.64249414",
"0.6345578",
"0.6331869",
"0.6303537",
"0.6301052",
"0.6217507... | 0.812715 | 0 |
The function draws a tree by forming its trunk as a rectangle and all its leaves as six circles. | def tree(xt, yt, t):
green = (1, 50, 32) # leaf color
rect(screen, (150, 75, 0), (xt, yt, 15 * t, 60 * t), 0) # tree's trunk
circle(screen, green, (xt + 15 * t / 2, yt - 30 * t), 30 * t) # leaves
circle(screen, green, (xt + 15 * t / 2 + 30 * t, yt - 30 * t + 15 * t), 30 * t) # leaves
circle(scr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_tree(self) -> None:\n import turtle\n\n def height(head):\n return 1 + max(height(head.left), height(head.right)) if head else -1\n\n def jump_to(x, y):\n t.penup()\n t.goto(x, y)\n t.pendown()\n\n def draw(node, x, y, dx):\n ... | [
"0.7460558",
"0.72682446",
"0.6904891",
"0.68636274",
"0.6776809",
"0.6700191",
"0.6676679",
"0.6673319",
"0.66718125",
"0.66088754",
"0.66088754",
"0.65637016",
"0.65432936",
"0.65039027",
"0.64526457",
"0.64284134",
"0.6277493",
"0.6261355",
"0.6227239",
"0.61798245",
"0.61... | 0.77194875 | 0 |
The function draws a sun using a circle and triangles to imitate its rays. | def sun(xs, ys, s, n):
yellow = (255, 255, 0) # sun color
circle(screen, yellow, (xs, ys), 30 * s) # sun body
for k in range(n + 1): # sun rays on the upper side of the sun
polygon(screen, yellow,
[(xs + 45 * s * np.cos(np.pi / n * (k - 1 / 2)), ys - 45 * s * np.sin(np.pi / n * (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_sun():\n lisandro.penup()\n lisandro.goto(40, 90)\n lisandro.begin_fill()\n lisandro.circle(150) # draws out a circle with a radius of 150 for the sun.\n lisandro.end_fill()\n lisandro.hideturtle()",
"def shapes():\r\n turtle.up()\r\n turtle.forward(500)\r\n turtle.down()\r\n... | [
"0.76036316",
"0.60727096",
"0.5996167",
"0.59707737",
"0.5860674",
"0.5790599",
"0.5790599",
"0.57553256",
"0.5712482",
"0.57060146",
"0.5607589",
"0.55747604",
"0.55495393",
"0.55164635",
"0.55006",
"0.5494377",
"0.54593194",
"0.5439375",
"0.5421091",
"0.5418831",
"0.541534... | 0.81417817 | 0 |
Create mask to inform position of padding to model to avoid model treats padding as input | def create_padding_mask(seq):
seq = tf.cast(tf.math.equal(seq, 0), tf.float32)
return seq[:, tf.newaxis, tf.newaxis, :] # (batch_size, 1, 1, seq_len)
| {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_attention_mask_3d_padding(source_mask, target_mask):\n mask = make_attention_mask_3d(source_mask, target_mask)\n # invert mask for Megatron\n return mask < 0.5",
"def get_padding_mask(inputs, padding_value=0):\n mask = tf.cast(tf.equal(inputs, padding_value), 'float32') \n mask = mask[:, tf.... | [
"0.7194738",
"0.71909803",
"0.69525963",
"0.68565017",
"0.68536884",
"0.67958707",
"0.6788473",
"0.67264396",
"0.663091",
"0.66175294",
"0.6586988",
"0.65755576",
"0.6422467",
"0.6411352",
"0.63775486",
"0.6350122",
"0.63143253",
"0.62728643",
"0.62658393",
"0.6217786",
"0.62... | 0.7422589 | 0 |
Turn a linear function into a linear layer. | def create_linear_layer(lin_fn, num_inputs):
inputs = torch.randn(num_inputs, dtype=torch.float64).requires_grad_(True)
bias = torch.ones((), dtype=torch.float64).requires_grad_(True)
out = lin_fn(inputs, bias)
layer = nn.Linear(num_inputs, len(out))
for i, x in enumerate(out):
inputs.grad =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def linear_layer(self, W, b, x, use_relu=True):\n\n if use_relu is True:\n return np.maximum(W @ x + b, 0)\n return W @ x + b",
"def linear(*args, **kwargs):\n return nn.Linear(*args, **kwargs)",
"def linear(x, n_output, name=None, activation=None, reuse=None):\n\tprint('##Start lin... | [
"0.7015644",
"0.69151753",
"0.66974515",
"0.667202",
"0.66359043",
"0.66043425",
"0.65615773",
"0.6542365",
"0.6536673",
"0.6536673",
"0.6518618",
"0.64601105",
"0.6458006",
"0.6448246",
"0.6381619",
"0.63695693",
"0.63089275",
"0.62843263",
"0.62195283",
"0.61954653",
"0.617... | 0.75638497 | 0 |
Generate model evaluations for a set of samples. | def _run_model(self, samples: Union[NumpyFloatArray, NumpyIntArray]):
self.runmodel_object.run(samples=samples, append_samples=False)
model_evals = copy.deepcopy(np.array(self.runmodel_object.qoi_list))
return model_evals | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluate_samples(self, samples, eval_key=None, missing=None):\n pass",
"def evaluate_samples(self, samples, eval_key=None, mask_targets=None):\n pass",
"def __call__(self, samples):\n vals = run_model_samples_in_parallel(\n self.pool_function, self.max_eval_concurrency, samp... | [
"0.6946277",
"0.6890121",
"0.66393656",
"0.6486331",
"0.64624524",
"0.6429546",
"0.63909847",
"0.6262663",
"0.6214519",
"0.6213952",
"0.6138569",
"0.60926986",
"0.60802746",
"0.60679173",
"0.605645",
"0.6050133",
"0.6041548",
"0.6036979",
"0.60147506",
"0.6002384",
"0.5980518... | 0.70462584 | 0 |
Test if has_page_title returns True if fake_article has a title. | def test_article_has_page_title(self, fake_article):
fake_analysis = PageTitleAnalyzer(title=fake_article.title)
assert fake_analysis.has_page_title() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_article_has_no_page_title(self, fake_article_missing_elements):\n\n fake_analysis = PageTitleAnalyzer(title=fake_article_missing_elements.title)\n assert not fake_analysis.has_page_title()",
"def verifyPageTitle(self, titleToVerify):\n try:\n actualTitle = self.getTitle()... | [
"0.74226934",
"0.7201128",
"0.7072147",
"0.70092344",
"0.68888247",
"0.67413706",
"0.6726934",
"0.66687554",
"0.6647014",
"0.65997624",
"0.65997624",
"0.65551233",
"0.6530293",
"0.6367897",
"0.6367897",
"0.63619655",
"0.6342983",
"0.6315898",
"0.6308692",
"0.6308692",
"0.6280... | 0.8438234 | 0 |
Test if has_page_title returns False if fake_article has no title. | def test_article_has_no_page_title(self, fake_article_missing_elements):
fake_analysis = PageTitleAnalyzer(title=fake_article_missing_elements.title)
assert not fake_analysis.has_page_title() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_article_has_page_title(self, fake_article):\n\n fake_analysis = PageTitleAnalyzer(title=fake_article.title)\n assert fake_analysis.has_page_title()",
"def _is_title(self):\n ph = _child(self.__nvXxPr.nvPr, 'p:ph')\n if ph is None:\n return False\n # idx defa... | [
"0.81478935",
"0.71469104",
"0.7134996",
"0.7023476",
"0.6681592",
"0.66118556",
"0.6604462",
"0.659955",
"0.659955",
"0.65993476",
"0.65619737",
"0.6494986",
"0.64904606",
"0.6416079",
"0.63737994",
"0.63737994",
"0.6358897",
"0.6193415",
"0.6174787",
"0.6101239",
"0.6101239... | 0.7949928 | 1 |
Test if page_title_length returns the good title length. | def test_article_page_title_length(self, fake_article):
fake_analysis = PageTitleAnalyzer(title=fake_article.title)
assert fake_analysis.page_title_length == len(fake_article.title) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def title_len(self) -> int:\n return self.__title_len",
"def verifyPageTitle(self, titleToVerify):\n try:\n actualTitle = self.getTitle()\n return self.util.verifyTextContains(actualTitle, titleToVerify)\n except:\n self.log.error(\"Failed to get page title\"... | [
"0.7266168",
"0.6975329",
"0.64746845",
"0.6418382",
"0.6313484",
"0.6305625",
"0.6272739",
"0.62464887",
"0.6177433",
"0.6164515",
"0.61345303",
"0.6125975",
"0.61245835",
"0.6124123",
"0.6077936",
"0.6068465",
"0.6045622",
"0.6019685",
"0.5975678",
"0.5965192",
"0.5961571",... | 0.77252203 | 0 |
The caching processes takes users input data and computation output, then cache them | def cache(self, end_user, input_data, output_data0, c_EC, Name_offloaded_data):
print("Caching at EC server is done at %d%% " % (random.randint(50, 99)))
c_km = c_EC/(1+((end_user-1) * (input_data + output_data0)))
cache_capacity_allocation_EC.append(c_km)
cached_content.insert(Name_off... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache_end_user(self, end_user, input_data, output_data0, c_k, computation_requirement_user,\n Name_offloaded_data):\n print(\"computation at end-user device is done at %d%% of %s's task.\" %\n (random.randint(50, 99), end_user))\n print(\"Caching at end-user dev... | [
"0.69241387",
"0.6817171",
"0.6684514",
"0.66622245",
"0.6657395",
"0.66510534",
"0.64325535",
"0.6382823",
"0.6365466",
"0.6267725",
"0.6214952",
"0.620603",
"0.6172402",
"0.61452436",
"0.61371493",
"0.6086325",
"0.6070391",
"0.60115355",
"0.600396",
"0.5997731",
"0.59631586... | 0.69128287 | 1 |
The caching processes takes users input data and computation output, then cache them | def cache_end_user(self, end_user, input_data, output_data0, c_k, computation_requirement_user,
Name_offloaded_data):
print("computation at end-user device is done at %d%% of %s's task." %
(random.randint(50, 99), end_user))
print("Caching at end-user device is done ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache(self, end_user, input_data, output_data0, c_EC, Name_offloaded_data):\n\n print(\"Caching at EC server is done at %d%% \" % (random.randint(50, 99)))\n c_km = c_EC/(1+((end_user-1) * (input_data + output_data0)))\n cache_capacity_allocation_EC.append(c_km)\n cached_content.ins... | [
"0.6912924",
"0.6817877",
"0.6684545",
"0.66632384",
"0.6657902",
"0.6651216",
"0.6432238",
"0.6383507",
"0.6365778",
"0.62689775",
"0.621549",
"0.62075645",
"0.6172295",
"0.61462307",
"0.6138449",
"0.6087849",
"0.60696554",
"0.6011156",
"0.60051346",
"0.5998601",
"0.5963868"... | 0.69236094 | 0 |
Each enduser demand arrives at edge cloud and requests resources, where each enduser has identification (end_user_id). It starts computation process, waits for it to finish | def compute_end_user(self, end_user, input_data, computation_deadline, p_k, computation_requirement_user, c_k, p_ec,
c_ec, RC_EC_capacity, Name_offloaded_data):
global total_executing_ec_m_array
global total_executing_ec_n_array
global EC_m_cloud_offloading_variable
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute(self, end_user, input_data, computation_deadline, p_ec, c_ec, RC_EC_capacity,\n computation_requirement_user, transm_delay_user_ru, Name_offloaded_data):\n global execution_latency_dc_vector # Global need to be declared in the beginning of the function\n global EC_m_cache_... | [
"0.6130756",
"0.5836668",
"0.54324245",
"0.5392235",
"0.53178537",
"0.5296981",
"0.52855223",
"0.5277251",
"0.52644676",
"0.52298564",
"0.522731",
"0.5215356",
"0.51988107",
"0.5180719",
"0.51591676",
"0.51551324",
"0.5139207",
"0.51250726",
"0.51058996",
"0.51030153",
"0.510... | 0.6660759 | 0 |
Read yaml file with label definitions. | def read_label_definitions(filename: str) -> dict:
with open(filename, 'r') as f:
translate = yaml.load(f, Loader=yaml.SafeLoader)
return translate | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_labels(labels_file):\n if not labels_file:\n print 'WARNING: No labels file provided. Results will be difficult to interpret.'\n return None\n\n labels = []\n with open(labels_file) as infile:\n for line in infile:\n label = line.strip()\n if label:\n ... | [
"0.6454239",
"0.6269596",
"0.6258598",
"0.62443876",
"0.62082666",
"0.6189674",
"0.6186524",
"0.6186325",
"0.6183618",
"0.61517555",
"0.6094851",
"0.6079179",
"0.6069072",
"0.60689235",
"0.6063659",
"0.60388273",
"0.6031207",
"0.6030064",
"0.60240155",
"0.60190016",
"0.600771... | 0.80432695 | 0 |
Normalize label to a standard set. Return a list | def normalize_label(label: str) -> list:
global _LABELS
if _LABELS is None:
_LABELS = read_label_definitions(NORM_LABEL_FILE)
if label in _LABELS['translate'].keys():
return [_LABELS['translate'][label]]
elif label in _LABELS['label_to_group'].keys():
# Originally: return all (ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def norm(self, label):\n label_vec = []\n label_value = self.to_int(label)\n for i in range(10):\n if i == label_value:\n label_vec.append(0.9)\n else:\n label_vec.append(0.1)\n return label_vec",
"def normalize_labels(labels):\n ... | [
"0.70936733",
"0.67618287",
"0.6497166",
"0.64950365",
"0.62931526",
"0.6270191",
"0.6227273",
"0.6212816",
"0.61797905",
"0.6102589",
"0.60916936",
"0.608626",
"0.60579926",
"0.6032182",
"0.59783614",
"0.59651196",
"0.5954803",
"0.5883055",
"0.58621407",
"0.58589786",
"0.582... | 0.7416236 | 0 |
Convert a label to start and end of a special symbol to use as input or output for encoder/decoder | def label_to_symbol(label: str, all_labels: list) -> str:
index = all_labels.index(label)
in_symbol = f"[i-{index}]"
out_symbol = f"[o-{index}]"
return in_symbol, out_symbol | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def symbol_to_label(symbol: str, all_labels: list) -> str:\n m = re.search(\"[i-(\\d+)]\", symbol)\n n = re.search(\"[o-(\\d+)]\", symbol)\n if m is None and n is None:\n raise ValueError(f\"Symbol {symbol} fails to match symbol regex\")\n elif m is not None:\n return all_labels[m.group(1... | [
"0.6479082",
"0.61380243",
"0.60909307",
"0.59870726",
"0.594325",
"0.5936012",
"0.5928955",
"0.5867715",
"0.58144397",
"0.5803089",
"0.5756134",
"0.5675025",
"0.56665194",
"0.5643463",
"0.56145877",
"0.55713457",
"0.5540174",
"0.5500176",
"0.54963714",
"0.5480792",
"0.548079... | 0.71865237 | 0 |
Test case for create_container | def test_create_container(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create(set_env, container: Container):\n # pylint: disable=unused-argument\n assert container\n assert isinstance(container, Container)",
"def test001_create_containers(self):\n self.log('%s STARTED' % self._testID)\n\n self.log('Create a two container on that node, should succeed... | [
"0.8292587",
"0.81556135",
"0.78325146",
"0.7654203",
"0.7513342",
"0.7463807",
"0.72975534",
"0.7197016",
"0.71869355",
"0.7110519",
"0.70905244",
"0.7059516",
"0.70520085",
"0.7025099",
"0.6996306",
"0.69933844",
"0.6968166",
"0.6955092",
"0.69229496",
"0.6905665",
"0.68981... | 0.9447695 | 0 |
Test case for create_container_privilege | def test_create_container_privilege(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_show_container_privilege(self):\n pass",
"def test_update_container_privilege(self):\n pass",
"def test_destroy_container_privilege(self):\n pass",
"def test_create_container(self):\n pass",
"def test_index_container_privileges(self):\n pass",
"def test_create(... | [
"0.819603",
"0.80356145",
"0.78542966",
"0.74272037",
"0.6985518",
"0.64949703",
"0.6320619",
"0.610004",
"0.6066635",
"0.603656",
"0.60300285",
"0.5930474",
"0.59184194",
"0.59108776",
"0.5893975",
"0.5884014",
"0.5834234",
"0.58311236",
"0.57651585",
"0.57612944",
"0.573694... | 0.9525998 | 0 |
Test case for destroy_container | def test_destroy_container(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_destroy_container_privilege(self):\n pass",
"def delete_container(self, container: Container):",
"def test_destroy(set_env, container: Container, docker_client: DockerClient):\n # pylint: disable=unused-argument\n assert container\n\n from dockerdb.commands.destroy import destroy\n\n ... | [
"0.8245798",
"0.7704431",
"0.7700081",
"0.7595063",
"0.73785865",
"0.7206148",
"0.7133335",
"0.70388615",
"0.70206547",
"0.6987417",
"0.67901903",
"0.67895716",
"0.6761828",
"0.67412347",
"0.66842693",
"0.6674814",
"0.66085625",
"0.6554082",
"0.6554082",
"0.6501235",
"0.64754... | 0.9445566 | 0 |
Test case for destroy_container_privilege | def test_destroy_container_privilege(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_destroy_container(self):\n pass",
"def test_create_container_privilege(self):\n pass",
"def test_update_container_privilege(self):\n pass",
"def test_show_container_privilege(self):\n pass",
"def test_destroy(set_env, container: Container, docker_client: DockerClient):\... | [
"0.799227",
"0.75960445",
"0.73963785",
"0.7044312",
"0.64787596",
"0.6368871",
"0.63494855",
"0.62470484",
"0.62427765",
"0.62360406",
"0.6196816",
"0.61744213",
"0.6163879",
"0.61557615",
"0.6136813",
"0.6112972",
"0.6096761",
"0.60735035",
"0.6069854",
"0.6051791",
"0.6027... | 0.95208555 | 0 |
Test case for index_container_privileges | def test_index_container_privileges(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_show_container_privilege(self):\n pass",
"def test_update_container_privilege(self):\n pass",
"def test_create_container_privilege(self):\n pass",
"def test_index_containers(self):\n pass",
"def test_destroy_container_privilege(self):\n pass",
"def test_news_in... | [
"0.7390241",
"0.72225755",
"0.7213204",
"0.6697649",
"0.61364084",
"0.6098532",
"0.57128835",
"0.57016516",
"0.56166",
"0.55914325",
"0.5578832",
"0.5546629",
"0.55442214",
"0.5516774",
"0.5504094",
"0.5342963",
"0.5326308",
"0.5305716",
"0.53056926",
"0.5256991",
"0.5253735"... | 0.95182186 | 0 |
Test case for index_containers | def test_index_containers(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_index_container_privileges(self):\n pass",
"def test_index(self):",
"def test_creating_index_type(self):",
"def test_export_index(self):",
"def test_indexable(self):\n # verify ----------------------\n try:\n self.collection[0]\n except TypeError:\n ... | [
"0.74689764",
"0.7236028",
"0.7231017",
"0.6694666",
"0.659971",
"0.65104294",
"0.64708704",
"0.645695",
"0.6350804",
"0.6346495",
"0.63435423",
"0.6316221",
"0.6306986",
"0.62914807",
"0.6266515",
"0.6252186",
"0.62408215",
"0.6236435",
"0.62193215",
"0.6215455",
"0.6201725"... | 0.9465906 | 0 |
Test case for show_container | def test_show_container(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_container(self):\n pass",
"def test_create_container(self):\n pass",
"def do_show(cs, args):\n opts = {}\n opts['id'] = args.container\n opts['all_projects'] = args.all_projects\n opts = zun_utils.remove_null_parms(**opts)\n container = cs.containers.get(**opts)\n i... | [
"0.7574978",
"0.7064828",
"0.7024498",
"0.6931409",
"0.67337406",
"0.6730391",
"0.66607016",
"0.665341",
"0.6561181",
"0.64965963",
"0.64463973",
"0.64361846",
"0.64278543",
"0.6419025",
"0.6405328",
"0.6402743",
"0.6387417",
"0.6372569",
"0.6355929",
"0.633814",
"0.6278366",... | 0.9311129 | 0 |
Test case for show_container_privilege | def test_show_container_privilege(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_container_privilege(self):\n pass",
"def test_update_container_privilege(self):\n pass",
"def test_destroy_container_privilege(self):\n pass",
"def test_index_container_privileges(self):\n pass",
"def test_show_container(self):\n pass",
"def show_privile... | [
"0.8366198",
"0.79593486",
"0.7508638",
"0.71059686",
"0.6670595",
"0.6056394",
"0.59110796",
"0.58962005",
"0.586424",
"0.5812169",
"0.5746774",
"0.5722556",
"0.5689453",
"0.5635183",
"0.5626916",
"0.55962235",
"0.5576626",
"0.553116",
"0.5496365",
"0.54744405",
"0.54153925"... | 0.962284 | 0 |
Test case for update_container | def test_update_container(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_container():\n return exec_fn(_update_container)",
"def test_update_container_privilege(self):\n pass",
"def __update_container(self, path, obj_stat):\n try:\n self.logger.debug('Update container interface called')\n return self.asyn_helper.call \\\n ... | [
"0.76290596",
"0.7151693",
"0.6988617",
"0.69339997",
"0.68087256",
"0.6795811",
"0.679012",
"0.6744848",
"0.66460276",
"0.66460276",
"0.66460276",
"0.6637277",
"0.6537386",
"0.6536095",
"0.6529612",
"0.65175",
"0.6516598",
"0.65146124",
"0.6504375",
"0.64841086",
"0.64686704... | 0.95231485 | 0 |
Test case for update_container_privilege | def test_update_container_privilege(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_container_privilege(self):\n pass",
"def test_destroy_container_privilege(self):\n pass",
"def test_show_container_privilege(self):\n pass",
"def test_update_container(self):\n pass",
"def test_index_container_privileges(self):\n pass",
"def test_update_... | [
"0.766053",
"0.7609293",
"0.74106824",
"0.69123495",
"0.67316014",
"0.62694347",
"0.61879647",
"0.61383",
"0.6041444",
"0.6019781",
"0.586566",
"0.5853104",
"0.57842124",
"0.57581365",
"0.5677262",
"0.56765527",
"0.56648535",
"0.56625587",
"0.5658636",
"0.5632956",
"0.5630784... | 0.9553669 | 0 |
Return the number of available cores. | def cpu_count():
num_available_cores = multiprocessing.cpu_count()
return num_available_cores | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_num_processors():\n cores = 0\n try:\n cores = len(os.sched_getaffinity(0))\n except AttributeError:\n cores = cpu_count()\n return cores",
"def cpu_count_cores():\n return cext.cpu_count_cores()",
"def get_ncpu():\n from multiprocessing import cpu_count\n return cpu... | [
"0.89551276",
"0.86170775",
"0.8316827",
"0.8212397",
"0.8195297",
"0.81726545",
"0.8117976",
"0.8109059",
"0.81060207",
"0.8065131",
"0.7973178",
"0.7964775",
"0.7926608",
"0.79141355",
"0.78823775",
"0.7857191",
"0.7844706",
"0.7841263",
"0.78397304",
"0.7825439",
"0.781996... | 0.8886122 | 1 |
Set all the device and server owned properties. | def set_all_properties(device: Device, test_cfg: TestCfg):
cprint("\nSet device owned properties.", color="cyan", flush=True)
for key, value in test_cfg.mock_data.items():
device.send(test_cfg.interface_device_prop, "/sensor-id/" + key, value)
time.sleep(0.005)
cprint("\nSet server owned pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unset_some_properties(device: Device, test_cfg: TestCfg):\n cprint(\"\\nUnset some device owned properties.\", color=\"cyan\", flush=True)\n for key, _ in test_cfg.mock_data.items():\n if key not in [\"datetime_endpoint\", \"booleanarray_endpoint\"]:\n device.unset_property(test_cfg.int... | [
"0.59108984",
"0.58113533",
"0.54988265",
"0.5497237",
"0.53480184",
"0.5347657",
"0.531481",
"0.52248204",
"0.5189221",
"0.5167563",
"0.5050707",
"0.5040113",
"0.502045",
"0.50000304",
"0.49858457",
"0.49772954",
"0.49768072",
"0.4970701",
"0.49702758",
"0.49687654",
"0.4958... | 0.7363796 | 0 |
Unset some of the device and server owned properties. | def unset_some_properties(device: Device, test_cfg: TestCfg):
cprint("\nUnset some device owned properties.", color="cyan", flush=True)
for key, _ in test_cfg.mock_data.items():
if key not in ["datetime_endpoint", "booleanarray_endpoint"]:
device.unset_property(test_cfg.interface_device_prop... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unset():\n rino.remote.unset()",
"def clearProperties(*args):",
"def clearProperties(*args):",
"def clearProperties(*args):",
"def clearProperties(*args):",
"def clear_properties(self):\n self.properties.clear()",
"def set_all_properties(device: Device, test_cfg: TestCfg):\n cprint(\"\\nSe... | [
"0.6243904",
"0.61080045",
"0.61080045",
"0.61080045",
"0.61080045",
"0.59212315",
"0.5779443",
"0.5738039",
"0.55826885",
"0.5536625",
"0.55132157",
"0.55132157",
"0.55132157",
"0.55132157",
"0.549153",
"0.5467077",
"0.5450318",
"0.5432928",
"0.54141974",
"0.5398717",
"0.535... | 0.75877285 | 0 |
Start an asyncio event loop, used for the device call back. | def start_call_back_loop(loop: asyncio.AbstractEventLoop) -> None:
asyncio.set_event_loop(loop)
loop.run_forever() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def startLoop(self):\n if(self.loop is not None):\n raise Exception(\"Event loop is already started!\")\n self.loop = asyncio.new_event_loop()\n self.thread = Thread(target=start_thread_loop, args=(self.loop,))\n self.thread.setDaemon(True)\n self.thread.start()",
"d... | [
"0.76564205",
"0.7373814",
"0.72559583",
"0.7224968",
"0.7152667",
"0.7087684",
"0.70857453",
"0.70601386",
"0.7014385",
"0.70009464",
"0.70009464",
"0.70009464",
"0.70009464",
"0.6974847",
"0.6932438",
"0.688413",
"0.68510026",
"0.6805241",
"0.67912406",
"0.67848516",
"0.678... | 0.7421172 | 1 |
Refresh reloads data from the server. It raises an error if it fails to get the object's metadata | def refresh(self):
self.metadata = self.db.read(self.path).json() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _refresh(self):\n url = self.urlobject_single.format(self._cb.credentials.org_key, self._model_unique_id)\n resp = self._cb.get_object(url)\n self._info = resp\n self._last_refresh_time = time.time()\n return True",
"def _refresh(self):\n resp = self._cb.get_object(s... | [
"0.76382405",
"0.7313773",
"0.7313773",
"0.7045631",
"0.69201297",
"0.6815041",
"0.67725044",
"0.67725044",
"0.675185",
"0.6670727",
"0.66402215",
"0.66402215",
"0.66402215",
"0.6614664",
"0.65988886",
"0.65988886",
"0.65988886",
"0.65587395",
"0.6531285",
"0.6509297",
"0.650... | 0.7415601 | 1 |
Sets the object's userfriendly nickname | def nickname(self, new_nickname):
self.set({"nickname": new_nickname}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_nickname(self, nickname):\n \n if len(nickname) > globals.MAX_NICKNAME_LENGTH:\n nick = nickname[0:globals.MAX_NICKNAME_LENGTH-3]+\"...\"\n else:\n nick = nickname\n \n self._nickname.set_message(nick)",
"async def nickname(self, ctx, *, nickna... | [
"0.7748096",
"0.74267966",
"0.72978115",
"0.72184396",
"0.7196049",
"0.71037096",
"0.70768476",
"0.70639694",
"0.70152736",
"0.68799037",
"0.679108",
"0.67883277",
"0.6730406",
"0.671135",
"0.6603327",
"0.65963477",
"0.6478311",
"0.64500314",
"0.6448181",
"0.6426235",
"0.6407... | 0.78098214 | 0 |
Load styles for BHSA divs. | def load_style():
display(HTML(Path('bhsa.css').read_text())) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_default_style(self):\n self._css_shape = {\n \"point\": {\"color\": (255,0,0), \"paint\": fshape.FILL, \"z-index\":0},\n \"line\": {\"color\": (0,255,0), \"paint\": fshape.STROKE, \"z-index\":0},\n \"area\": {\"color\": (0,0,255), \"paint\": fshape.FILL, \"z-index\"... | [
"0.5989639",
"0.59036076",
"0.56176794",
"0.558392",
"0.5241504",
"0.5120053",
"0.5115506",
"0.507915",
"0.5060298",
"0.5031563",
"0.50168383",
"0.501615",
"0.50023115",
"0.49979183",
"0.49873513",
"0.49807042",
"0.49791923",
"0.49720952",
"0.49583104",
"0.49578643",
"0.49547... | 0.7472356 | 0 |
Get logger with path 'file name'. If permission error, create log in /tmp | def get_logger(logger_name, logging_format, file_name, level=logging.INFO):
path, prepared = '', True
for cat in file_name.split('/')[1:-1]:
path += '/%s' % cat
if not os.path.exists(path):
try:
os.mkdir(path)
except PermissionError:
prepar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_logger(name, file_name_path='yang.log'):\n # check if file exists\n exists = False\n if os.path.isfile(file_name_path):\n exists = True\n FORMAT = '%(asctime)-15s %(levelname)-8s %(name)5s => %(message)s - %(lineno)d'\n DATEFMT = '%Y-%m-%d %H:%M:%S'\n logging.basicConfig(datefmt=DA... | [
"0.79687124",
"0.7040542",
"0.69095176",
"0.68904185",
"0.6871001",
"0.676563",
"0.6639393",
"0.66237354",
"0.662209",
"0.66128546",
"0.65883726",
"0.6566198",
"0.6562564",
"0.65618443",
"0.6552894",
"0.6514455",
"0.64994484",
"0.6497173",
"0.6477766",
"0.64529455",
"0.644887... | 0.7458781 | 1 |
Tests that finding GnuPG works. | def test_load(self):
detected_path = GnuPG.path()
self.assertIsNotNone(detected_path)
self.assertIn(detected_path, ['/usr/bin/gpg2', '/usr/bin/gpg']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_gpg_exists(self):\n self.assertTrue(self.mikla.gpg_exists('ls'))",
"def gnupg_bin():\n for a_bin in [\"gpg2\", \"gpg\"]:\n gpg_output = which_bin(a_bin)\n if gpg_output:\n return gpg_output\n\n raise CryptoritoError(\"gpg or gpg2 must be installed\")",
"def test_g... | [
"0.70118",
"0.6833564",
"0.6640107",
"0.6095676",
"0.59951377",
"0.5807542",
"0.5769558",
"0.5716728",
"0.5476184",
"0.5413578",
"0.5398371",
"0.53139794",
"0.5295809",
"0.5264155",
"0.52117217",
"0.5208635",
"0.51940846",
"0.5167096",
"0.5162217",
"0.51571894",
"0.51027113",... | 0.7122632 | 0 |
Tests that converting a Python 2 ConfigParser object to a dictionary works as expected. | def test_config_to_dict_py2(self):
if PYTHON_VERSION > 2:
return
from ConfigParser import ConfigParser
fixture = ConfigParser()
fixture.add_section('something')
fixture.set('something', 'value', 'stuff')
self.assertEqual({ 'something': { 'value': 'stuff' } }... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_config_to_dict_py3(self):\n if PYTHON_VERSION < 3:\n return\n\n from configparser import ConfigParser\n fixture = ConfigParser()\n fixture['something'] = { 'value': 'stuff' }\n\n self.assertEqual({ 'something': { 'value': 'stuff' } }, config_to_dict(fixture))"... | [
"0.77845216",
"0.68661237",
"0.62058705",
"0.6147573",
"0.6130427",
"0.6077881",
"0.60639715",
"0.5976578",
"0.59647095",
"0.5959332",
"0.5956973",
"0.59301674",
"0.59173024",
"0.5910618",
"0.5908001",
"0.5880878",
"0.5876987",
"0.58738756",
"0.58470243",
"0.5835892",
"0.5772... | 0.8247538 | 0 |
Tests that converting a Python 3 ConfigParser object to a dictionary works as expected. | def test_config_to_dict_py3(self):
if PYTHON_VERSION < 3:
return
from configparser import ConfigParser
fixture = ConfigParser()
fixture['something'] = { 'value': 'stuff' }
self.assertEqual({ 'something': { 'value': 'stuff' } }, config_to_dict(fixture)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_config_to_dict_py2(self):\n if PYTHON_VERSION > 2:\n return\n\n from ConfigParser import ConfigParser\n fixture = ConfigParser()\n fixture.add_section('something')\n fixture.set('something', 'value', 'stuff')\n\n self.assertEqual({ 'something': { 'value... | [
"0.7985385",
"0.71259654",
"0.63515246",
"0.62299037",
"0.6216688",
"0.62075067",
"0.61899275",
"0.61818033",
"0.61405694",
"0.6104885",
"0.6103535",
"0.609441",
"0.60868174",
"0.6085061",
"0.59943795",
"0.59495205",
"0.59309465",
"0.5867904",
"0.5845856",
"0.5839396",
"0.583... | 0.8315104 | 0 |
Deactivates a behavior, and returns a boolean value true if the behavior was active, and false if it was not | def deactivate_behavior(self, behavior):
exits = behavior in self.active_behaviors
if exists:
self.active_behaviors.remove(behavior)
active_behavior.consider_deactivation()
return exists | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deactivate(self) -> bool:\n pass",
"def consider_deactivation(self):\n if self.sensob_ultrasonic.get_value() >= 0.20:\n self.active_flag = False\n self.bbcon.deactivate_behaviour(self)",
"def deactivate(self):\n self._is_active = False",
"def consider_deactivati... | [
"0.72328097",
"0.6804652",
"0.6604412",
"0.6549748",
"0.647297",
"0.6391283",
"0.6334366",
"0.6334366",
"0.62551916",
"0.62551916",
"0.6246407",
"0.6181994",
"0.6126587",
"0.6080045",
"0.6040956",
"0.59550935",
"0.59410554",
"0.5849345",
"0.5833029",
"0.58273166",
"0.57891554... | 0.8199572 | 0 |
Updates all active behaviors | def update_all_behaviors(self):
for behavior in self.active_behaviors:
behavior.update() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self):\n #self.consider_deactivation() if self.active_flag else self.consider_activation()\n if self.active_flag:\n self.consider_deactivation()\n else:\n self.consider_activation()\n if self.active_flag:\n self.sense_and_act()\n se... | [
"0.61757594",
"0.61757594",
"0.61757594",
"0.61757594",
"0.6033049",
"0.6010509",
"0.59927744",
"0.5974894",
"0.596138",
"0.5838394",
"0.5811177",
"0.57843184",
"0.5768181",
"0.5756088",
"0.5754011",
"0.5745337",
"0.57002616",
"0.56976306",
"0.56803435",
"0.56803435",
"0.5679... | 0.9065885 | 0 |
Parses the FEMA P58 DS hierarchy into a set of arrays. | def parse_DS_Hierarchy(DSH):
if DSH[:3] == 'Seq':
DSH = DSH[4:-1]
DS_setup = []
while len(DSH) > 0:
if DSH[:2] == 'DS':
DS_setup.append(DSH[:3])
DSH = DSH[4:]
elif DSH[:5] in {'MutEx', 'Simul'}:
closing_pos = DSH.find(')')
subDSH = DS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def structure(self, ism_input):\n f = open(ism_input, 'r')\n data = []\n for line in f:\n line = line.replace('\\\"', '')\n line = line.replace('],[', '];[')\n line = line.strip()\n line = line.replace(']', '')\n line = line.replace('[', '... | [
"0.5703337",
"0.52625185",
"0.51882285",
"0.5113901",
"0.508543",
"0.50327176",
"0.5027605",
"0.50257576",
"0.50027895",
"0.49920815",
"0.49779826",
"0.4965833",
"0.49642783",
"0.49438012",
"0.49253464",
"0.4914421",
"0.48994464",
"0.48994464",
"0.48665243",
"0.48370755",
"0.... | 0.5657535 | 1 |
Create a fragility parameter database based on the FEMA P58 data The method was developed to process v3.1.2 of the FragilityDatabase xls that is provided with FEMA P58 2nd edition. | def create_FEMA_P58_fragility_db(source_file,
target_data_file='fragility_DB_FEMA_P58_2nd.csv',
target_meta_file='fragility_DB_FEMA_P58_2nd.json'):
# parse the source file
df = pd.read_excel(source_file, sheet_name='Summary', header=2, index_col... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_Hazus_EQ_fragility_db(source_file,\n target_data_file='fragility_DB_Hazus_EQ.csv',\n target_meta_file='fragility_DB_Hazus_EQ.json'):\n\n # parse the source file\n with open(source_file, 'r', encoding='utf-8') as f:\n raw_data =... | [
"0.65771925",
"0.610855",
"0.5858219",
"0.5710821",
"0.55405086",
"0.5427353",
"0.5412174",
"0.53368837",
"0.5281407",
"0.5184217",
"0.5183464",
"0.51705265",
"0.51649034",
"0.51160085",
"0.5094011",
"0.5080228",
"0.5078397",
"0.50772166",
"0.50710726",
"0.5054762",
"0.505397... | 0.745988 | 0 |
Create a repair consequence parameter database based on the FEMA P58 data The method was developed to process v3.1.2 of the FragilityDatabase xls that is provided with FEMA P58 2nd edition. | def create_FEMA_P58_bldg_repair_db(
source_file,
target_data_file='bldg_repair_DB_FEMA_P58_2nd.csv',
target_meta_file='bldg_repair_DB_FEMA_P58_2nd.json'):
# parse the source file
df = pd.concat(
[pd.read_excel(source_file, sheet_name=sheet, header=2, index_col=1)
for sh... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_FEMA_P58_fragility_db(source_file,\n target_data_file='fragility_DB_FEMA_P58_2nd.csv',\n target_meta_file='fragility_DB_FEMA_P58_2nd.json'):\n\n # parse the source file\n df = pd.read_excel(source_file, sheet_name='Summary', header=2,... | [
"0.6898587",
"0.59708315",
"0.5941394",
"0.5933838",
"0.5736046",
"0.55414313",
"0.5455951",
"0.532536",
"0.5279041",
"0.52443",
"0.5233434",
"0.5197",
"0.5160039",
"0.5150086",
"0.51443994",
"0.51228565",
"0.50986737",
"0.5092603",
"0.5084257",
"0.5082074",
"0.5080069",
"0... | 0.6659175 | 1 |
Create an injury consequence parameter database based on the FEMA P58 data The method was developed to process v3.1.2 of the FragilityDatabase xls that is provided with FEMA P58 2nd edition. | def create_FEMA_P58_bldg_injury_db(
source_file,
target_data_file='bldg_injury_DB_FEMA_P58_2nd.csv',
target_meta_file='bldg_injury_DB_FEMA_P58_2nd.json'):
# parse the source file
df = pd.read_excel(source_file, sheet_name='Summary', header=2, index_col=1,
true_val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_FEMA_P58_fragility_db(source_file,\n target_data_file='fragility_DB_FEMA_P58_2nd.csv',\n target_meta_file='fragility_DB_FEMA_P58_2nd.json'):\n\n # parse the source file\n df = pd.read_excel(source_file, sheet_name='Summary', header=2,... | [
"0.6338688",
"0.5884251",
"0.5718049",
"0.57067966",
"0.5664042",
"0.5621252",
"0.5532487",
"0.5456979",
"0.53769165",
"0.53531015",
"0.5353015",
"0.5327349",
"0.5312414",
"0.5305771",
"0.5293567",
"0.5258516",
"0.5220751",
"0.5206867",
"0.51643485",
"0.5132311",
"0.51212096"... | 0.6213285 | 1 |
Create an red tag consequence parameter database based on the FEMA P58 data The method was developed to process v3.1.2 of the FragilityDatabase xls that is provided with FEMA P58 2nd edition. | def create_FEMA_P58_bldg_redtag_db(
source_file,
target_data_file='bldg_redtag_DB_FEMA_P58_2nd.csv',
target_meta_file='bldg_redtag_DB_FEMA_P58_2nd.json'):
# parse the source file
df = pd.read_excel(source_file, sheet_name='Summary', header=2, index_col=1,
true_val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_FEMA_P58_fragility_db(source_file,\n target_data_file='fragility_DB_FEMA_P58_2nd.csv',\n target_meta_file='fragility_DB_FEMA_P58_2nd.json'):\n\n # parse the source file\n df = pd.read_excel(source_file, sheet_name='Summary', header=2,... | [
"0.6308902",
"0.58502406",
"0.5834245",
"0.5675954",
"0.5508745",
"0.5472608",
"0.53253484",
"0.53151536",
"0.5244673",
"0.5226974",
"0.519828",
"0.5179325",
"0.5178727",
"0.5168326",
"0.5158303",
"0.51469505",
"0.5117985",
"0.5113623",
"0.51080567",
"0.5100592",
"0.5092436",... | 0.6131606 | 1 |
Attach this plugin to the PostProvision trigger to automatically set set the expiration date for each server in the given job | def run(job, logger=None):
one_day = datetime.datetime.now() + datetime.timedelta(days=int('{{ number_of_days }}'))
date_string = "{:%m/%d/%Y}".format(one_day)
job.set_progress("Setting expiration date for servers in this job to: {}".format(date_string))
for server in job.server_set.all():
serv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postdeploy_plan(plan_name):\n pass",
"def postdeploy(verbose_level=1):\n check_arg(verbose_level, u._('Verbose level'), int)\n\n action = KollaAction(verbose_level=verbose_level,\n playbook_name='post-deploy.yml')\n ansible_job = action.postdeploy()\n ... | [
"0.5408284",
"0.5041925",
"0.48933625",
"0.48644656",
"0.4844124",
"0.48364186",
"0.48095712",
"0.47300762",
"0.47154123",
"0.47019136",
"0.46962067",
"0.46852458",
"0.46838868",
"0.46812868",
"0.4620007",
"0.46096227",
"0.46080133",
"0.45921993",
"0.4573173",
"0.45462424",
"... | 0.66426796 | 0 |
return commits that contains file. | def get_commits_contains(self, file):
full_path = self.files_parser.get_full(file)
commits = self.__commit_contains_file_hash.get(full_path)
return commits | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_first_commit_contains(self, file):\n\n commits = self.get_commits_contains(file)\n return commits[-1] if commits else None",
"def get_last_commit_contains(self, file):\n\n commits = self.get_commits_contains(file)\n return commits[0] if commits else None",
"def get_modified_... | [
"0.71101016",
"0.70415473",
"0.66927785",
"0.66129005",
"0.6595046",
"0.6557422",
"0.6439894",
"0.6426685",
"0.6374402",
"0.6330902",
"0.6290782",
"0.6146598",
"0.61373854",
"0.61027384",
"0.6098769",
"0.60661334",
"0.60144174",
"0.60071295",
"0.5986308",
"0.5985794",
"0.5971... | 0.83925456 | 0 |
return commit that file are added first. | def get_last_commit_contains(self, file):
commits = self.get_commits_contains(file)
return commits[0] if commits else None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_first_commit_contains(self, file):\n\n commits = self.get_commits_contains(file)\n return commits[-1] if commits else None",
"def next_commit(self, commit):\n return RainerCommit(\n {\"version\" : int(commit.meta[\"version\"]) + 1,\n \"author\" : os.getlogin(),\n \"comm... | [
"0.65479827",
"0.573802",
"0.5700632",
"0.5668144",
"0.5611786",
"0.55983216",
"0.5593553",
"0.5582935",
"0.55622244",
"0.55585754",
"0.5541501",
"0.5509702",
"0.5496934",
"0.5496763",
"0.54933196",
"0.5491435",
"0.54855376",
"0.54855376",
"0.54855376",
"0.54855376",
"0.54855... | 0.5772377 | 1 |
Return 401 info, inlclude login_url to PAASLOGINPLATFORM, width & height for adjusting iframe window, login_url as | def _build_ajax_401_response(self, request):
_next = request.build_absolute_uri(reverse('account:login_success'))
if self._conf.ADD_CROSS_PREFIX:
_next = self._conf.CROSS_PREFIX + _next
_login_url = build_redirect_url(_next,
self._conf.LOGIN_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _build_page_401_response_to_platform(self, request):\n _next = request.build_absolute_uri()\n if self._conf.ADD_CROSS_PREFIX:\n _next = self._conf.CROSS_PREFIX + _next\n\n _login_url = build_redirect_url(_next,\n self._conf.LOGIN_URL,\n ... | [
"0.5833281",
"0.5807944",
"0.57253546",
"0.5551472",
"0.55454785",
"0.55313236",
"0.5505527",
"0.54835105",
"0.54654",
"0.54211766",
"0.5410585",
"0.5391261",
"0.5391261",
"0.5391261",
"0.5391261",
"0.5391261",
"0.5391261",
"0.5391261",
"0.5391261",
"0.5391261",
"0.5391261",
... | 0.6192411 | 0 |
Turn the encrypted s field into a working signature | def _decrypt_signature(self, s):
if len(s) == 92:
return s[25] + s[3:25] + s[0] + s[26:42] + s[79] + s[43:79] + s[91] + s[80:83]
elif len(s) == 90:
return s[25] + s[3:25] + s[2] + s[26:40] + s[77] + s[41:77] + s[89] + s[78:81]
elif len(s) == 88:
return s[48] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _build_signature(self):\n sig_contents = \\\n self.payload + \".\" + \\\n b64encode(b\"application/xml\").decode(\"ascii\") + \".\" + \\\n b64encode(b\"base64url\").decode(\"ascii\") + \".\" + \\\n b64encode(b\"RSA-SHA256\").decode(\"ascii\")\n sig_hash... | [
"0.65453",
"0.63674563",
"0.6332326",
"0.6304266",
"0.6247069",
"0.62329787",
"0.6162837",
"0.6110081",
"0.6079472",
"0.6066191",
"0.6039318",
"0.6027544",
"0.60205823",
"0.60150886",
"0.5985069",
"0.598436",
"0.59802085",
"0.59756666",
"0.59607977",
"0.59597117",
"0.59544945... | 0.69796395 | 0 |
Returns a list of message ids that match a given query string. | def get_message_ids_by_query(query_string, service):
message_results = service.users().messages().list(userId='me', q=query_string).execute()
if(message_results['resultSizeEstimate'] == 0):
return []
return message_results['messages'] if message_results['messages'] is not None else [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_email_ids(conn, query='ALL'):\n if conn.state != \"SELECTED\":\n raise imaplib.IMAP4.error(\"Cannot search without selecting a folder\")\n\n rv, data = conn.uid('search', None, query)\n if rv != 'OK':\n print (\"Could not fetch email ids\") # for some reason...\n return []\n\... | [
"0.6726846",
"0.6582666",
"0.6582302",
"0.63143134",
"0.61436373",
"0.609995",
"0.60605496",
"0.6045243",
"0.6023286",
"0.6019033",
"0.59572846",
"0.5849049",
"0.5801364",
"0.5611535",
"0.54922795",
"0.54554754",
"0.5429563",
"0.5421312",
"0.5379711",
"0.53616273",
"0.5347613... | 0.7509429 | 0 |
Returns a string representation of a decoded email message part. | def decode_message_part(message_part):
return base64.urlsafe_b64decode(message_part['body']['data']).decode().strip() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decode_message(self, raw):\n return raw.decode('utf-8')",
"def get_decoded_email_body(message_body):\n\n msg = email.message_from_string(message_body)\n\n text = \"\"\n if msg.is_multipart():\n html = None\n for part in msg.walk():\n\n # print \"%s, %s\" % (part.get_c... | [
"0.71435714",
"0.6644162",
"0.6545203",
"0.6496529",
"0.64006305",
"0.63261145",
"0.63129026",
"0.6311837",
"0.62922305",
"0.6237837",
"0.62142855",
"0.6155156",
"0.6114391",
"0.6081689",
"0.6068862",
"0.60137045",
"0.5987597",
"0.5945252",
"0.59316266",
"0.5877409",
"0.58527... | 0.75111616 | 0 |
Returns a trimmed dictionary representation of an emails headers. | def trim_headers(all_headers, relevant_headers=["From", "To", "Subject", "Date"]):
data = {}
for header in all_headers:
if header['name'] in relevant_headers:
data[header['name']] = header['value']
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _unpack_headers(self, headers):\n return dict((k,v[0]) for (k,v) in headers.getAllRawHeaders())",
"def GetResponseHeadersDict(self):\n headers = collections.defaultdict(list)\n for (key, value) in self._wpr_response.original_headers:\n headers[key.lower()].append(value)\n return {k: ','.... | [
"0.70060724",
"0.67045885",
"0.66727537",
"0.6565173",
"0.6542235",
"0.64860284",
"0.64273584",
"0.63836926",
"0.6382047",
"0.6355729",
"0.63376004",
"0.62960345",
"0.6279265",
"0.6251078",
"0.6250599",
"0.6228501",
"0.6137159",
"0.61062986",
"0.60977423",
"0.60977423",
"0.60... | 0.73881096 | 0 |
REANA workflow status publisher object creation. | def __new__(cls, instance=None):
if instance:
REANAWorkflowStatusPublisher.__instance = instance
elif REANAWorkflowStatusPublisher.__instance is None:
REANAWorkflowStatusPublisher.__instance = WorkflowStatusPublisher()
return REANAWorkflowStatusPublisher.__instance | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwargs):\n super(Publisher, self).__init__(*args, **kwargs)\n self._original = {\n 'status': self.status\n }",
"def _create_pub(name, rostype, *args, **kwargs):\n # counting publisher instance per topic name\n if name in TopicBack.pub_instance_count.keys():... | [
"0.7170993",
"0.5967973",
"0.59654903",
"0.5892892",
"0.587929",
"0.5851673",
"0.56647253",
"0.5647875",
"0.5630605",
"0.5596893",
"0.55781054",
"0.5548198",
"0.5542202",
"0.5540318",
"0.54856986",
"0.54379517",
"0.54240894",
"0.54150003",
"0.53984153",
"0.538884",
"0.5378284... | 0.73234653 | 0 |
An abstract Method A | def method_a(self): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fA(self):\n pass",
"def a(self):\n pass",
"def a(self):\n pass",
"def fun_a(self):\n pass",
"def method_b(self):",
"def __call__(self):\n raise NotImplementedError",
"def method(self, a):",
"def __call__(self, a, b):\n # STUDENT CODE HERE\n raise N... | [
"0.7112726",
"0.7052506",
"0.7052506",
"0.70522475",
"0.7051604",
"0.6883051",
"0.67497706",
"0.6745835",
"0.6745835",
"0.6745835",
"0.6690918",
"0.66639715",
"0.6636465",
"0.6636465",
"0.6636465",
"0.65145385",
"0.6477189",
"0.63304025",
"0.63304025",
"0.63304025",
"0.632794... | 0.732056 | 0 |
An abstract Method B | def method_b(self): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __call__(self):\n raise NotImplementedError",
"def __call__(self, a, b):\n # STUDENT CODE HERE\n raise NotImplementedError",
"def __call__(self, a, b):\n # STUDENT CODE HERE\n raise NotImplementedError",
"def __call__(self, a, b):\n # STUDENT CODE HERE\n r... | [
"0.70421946",
"0.70402884",
"0.70402884",
"0.70402884",
"0.6849722",
"0.6817127",
"0.67778647",
"0.67778647",
"0.67778647",
"0.668075",
"0.6639233",
"0.6639233",
"0.6492132",
"0.6420923",
"0.6414457",
"0.6367774",
"0.6367774",
"0.6367774",
"0.6337042",
"0.63304216",
"0.632963... | 0.74599755 | 0 |
We are calling method_a from Class B using an adapter | def method_a(self):
return self.AdapterB.method_b() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method_b(self):",
"def method_a(self):",
"def another_method(self):\n pass",
"def method(self, a):",
"def __call__(self, a, b):\n # STUDENT CODE HERE\n raise NotImplementedError",
"def __call__(self, a, b):\n # STUDENT CODE HERE\n raise NotImplementedError",
"def ... | [
"0.75815064",
"0.73203146",
"0.64877784",
"0.6271177",
"0.61200273",
"0.61200273",
"0.61200273",
"0.59982276",
"0.5979013",
"0.5966935",
"0.59444237",
"0.58661395",
"0.58052456",
"0.57878673",
"0.5777832",
"0.57048213",
"0.57048213",
"0.5666838",
"0.5666838",
"0.5666838",
"0.... | 0.8095476 | 0 |
Create balanced binary tree from ordered collection | def balanced_tree(ordered):
bt = BinaryTree()
add_range(bt, ordered, 0, len(ordered)-1)
return bt | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def binaryTree(r):\r\n return [r, [], []]",
"def _sorted_list_to_bst(cls, items=[], start=None, end=None, parent=None):\n if start > end:\n return None\n mid = start + (end - start) // 2\n node = Node(items[mid], parent)\n node.left = cls._sorted_list_to_bst(items, start... | [
"0.6875716",
"0.666865",
"0.6641243",
"0.66342694",
"0.6591895",
"0.63320524",
"0.6254881",
"0.62543494",
"0.6193552",
"0.61894536",
"0.6180937",
"0.61638397",
"0.61598194",
"0.61437345",
"0.6138858",
"0.61327463",
"0.61318773",
"0.613097",
"0.6128159",
"0.61017716",
"0.60840... | 0.802619 | 0 |
Add range to the bt in a way that Bt remains balanced | def add_range(bt, ordered, low, high):
if low <= high:
mid = (low+high)//2
bt.add(ordered[mid])
add_range(bt, ordered, low, mid-1)
add_range(bt, ordered, mid+1, high) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tentative_add_range(self, memrange):\n # optimize the easy case. makes rest of code simpler\n if not len(self.ranges):\n bisect.insort(self.ranges, memrange)\n return\n\n probeaddr = memrange.startaddr\n while probeaddr < memrange.endaddr:\n index = bisect.bisect(self.ranges, MemoryR... | [
"0.5963314",
"0.57457644",
"0.57033575",
"0.5670653",
"0.5641155",
"0.56268615",
"0.558927",
"0.5557739",
"0.5524271",
"0.55229443",
"0.54947835",
"0.5489055",
"0.548258",
"0.544948",
"0.5430252",
"0.5424991",
"0.5393245",
"0.5370487",
"0.5359171",
"0.53217083",
"0.531139",
... | 0.7508206 | 0 |
Returns VPN Connection status | def xqsystem_vpn_status(self) -> models.VPNStatusResponse:
return apply_model(
models.VPNStatusResponse,
self.do_get_request("/xqsystem/vpn_status")
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status_openvpn():\n p = Popen(\"service openvpn status\", shell=True, stdout=PIPE, stderr=PIPE)\n (so, se) = p.communicate()\n return True if p.returncode == 0 else False",
"def getConnectionStatus(self): \n return getI1ProConnectionStatus()",
"def status(self) -> 'outputs.ConnectionStatu... | [
"0.72203964",
"0.7181919",
"0.70604736",
"0.68924755",
"0.6871677",
"0.6732765",
"0.6496315",
"0.6462414",
"0.64421576",
"0.6429181",
"0.6426909",
"0.64139163",
"0.6348037",
"0.6317235",
"0.6228951",
"0.6224312",
"0.6174834",
"0.6111198",
"0.6111198",
"0.6111198",
"0.6111198"... | 0.7532402 | 0 |
The method to create all the objects of the commands, registered in register.json file. | def register_commands(self):
with open(self._full_register_name, 'r') as file_to_read:
command_register = json.loads(file_to_read.read())
commands = command_register.get("commands")
if commands is None:
logging.error("Command register is incorrect")
return [... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_command_objects(self):\n super().init_command_objects()\n device_data = DeviceData.get_instance()\n args = (device_data, self.state_model, self.logger)\n self.register_command_object(\"TelescopeOn\", TelescopeOn(*args))\n self.register_command_object(\"TelescopeOff\", Te... | [
"0.693104",
"0.69148487",
"0.68428314",
"0.6794718",
"0.67374337",
"0.6665606",
"0.6656452",
"0.66422254",
"0.66422254",
"0.66422254",
"0.66422254",
"0.66411626",
"0.6629551",
"0.6580605",
"0.6538936",
"0.6527246",
"0.65155095",
"0.64533067",
"0.6446554",
"0.6403348",
"0.6400... | 0.77935547 | 0 |
Retrieve UserRoles object. This is a very important and useful API call, it returns a complete list of privileges the currently authorized user has within all the teams and companies they have access to. | def get_user_roles(self):
url = 'userroles'
result = self.get(url)
return result.get('userroles', result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def roles(self):\n params = {\n \"f\" : \"json\"\n }\n uURL = self._url + \"/roles\"\n return self._con.get(path=uURL, params=params)",
"def listRoles(self):\n return self._client.listRoles()",
"def get_roles(self) -> requests.models.Response:\n return self.get(... | [
"0.7616649",
"0.74757826",
"0.74659115",
"0.7441553",
"0.7416953",
"0.7209505",
"0.720258",
"0.71936095",
"0.7161377",
"0.7090873",
"0.7051462",
"0.7028158",
"0.6980865",
"0.6955454",
"0.6946875",
"0.6920613",
"0.69160676",
"0.6897977",
"0.683362",
"0.6829747",
"0.68292475",
... | 0.8221138 | 0 |
Retrieve the user object from the user reference. | def get_user(self, user_reference):
url = 'users/{0}'.format(user_reference)
result = self.get(url)
return result.get('user', result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_reference_user(self):\n try:\n ref = User.objects.get(\n associated_emails__email__iexact=self.reference_email,\n associated_emails__is_verified=True)\n return ref\n except ObjectDoesNotExist:\n return None",
"def get_user(self)... | [
"0.78336525",
"0.7715592",
"0.7700846",
"0.7665564",
"0.7653078",
"0.76358473",
"0.7595922",
"0.7539751",
"0.75345474",
"0.7522908",
"0.75210303",
"0.75210303",
"0.74338484",
"0.73960936",
"0.73945874",
"0.73929757",
"0.73423374",
"0.72848636",
"0.72711205",
"0.72705686",
"0.... | 0.79839873 | 0 |
Retrieve the list of companies to which the current authorized user \ has access. | def get_companies(self):
url = 'companies'
result = self.get(url)
return result['companies'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queryset(self):\n return self.request.user.setting_set.get().companies",
"def get_queryset(self):\n return self.request.user.setting_set.get().companies",
"def get_queryset(self):\n return self.request.user.setting_set.get().companies",
"def get_queryset(self):\n return se... | [
"0.78642094",
"0.78642094",
"0.78642094",
"0.78642094",
"0.7753397",
"0.73986655",
"0.738589",
"0.73140615",
"0.7313578",
"0.7297904",
"0.7194016",
"0.71020436",
"0.7099391",
"0.6925291",
"0.68956596",
"0.6662987",
"0.66623086",
"0.6641846",
"0.6559034",
"0.6555118",
"0.63004... | 0.79357696 | 0 |
Retrieve the company object from the company reference. | def get_company(self, company_referece):
url = 'companies/{0}'.format(company_referece)
result = self.get(url)
return result.get('company', result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def company(self):\n return self._company",
"def company(self):\n return self._company",
"def get_company(self, name):\n return self.instance.company.id",
"def get_company(self, name):\n return self.store.company.id",
"def get_company(self, name):\n return self.website.co... | [
"0.75074327",
"0.75074327",
"0.72663546",
"0.7220919",
"0.7126427",
"0.6900781",
"0.670451",
"0.6574739",
"0.6413427",
"0.6407828",
"0.63729036",
"0.6328418",
"0.60932",
"0.6011323",
"0.5989269",
"0.59663576",
"0.5930345",
"0.5922437",
"0.58928245",
"0.5855893",
"0.58174187",... | 0.83995926 | 0 |
Retrieve a list of teams within the company being referenced. User has to have access to the referenced company. | def get_company_teams(self, company_referece):
url = 'companies/{0}/teams'.format(company_referece)
result = self.get(url)
return result.get('teams', result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_teams(self):\n url = 'teams'\n result = self.get(url)\n return result.get('teams', result)",
"def teams(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'teams')\r\n\r\n return http.Request('GET', url), parsers.parse_json",
"def get_teams(self, account_id):\n endp... | [
"0.7466345",
"0.73378897",
"0.7215378",
"0.7142608",
"0.70981383",
"0.69372785",
"0.69193894",
"0.6851884",
"0.67941964",
"0.6701132",
"0.6668236",
"0.66499996",
"0.65841126",
"0.65534383",
"0.65458757",
"0.64566386",
"0.63817936",
"0.6355966",
"0.6346351",
"0.6331452",
"0.63... | 0.8338206 | 0 |
Retrieve a list of all users within the referenced company. Only available for users with hiring privileges for the company. | def get_company_users(self, company_referece, active=True):
url = 'companies/{0}/users'.format(company_referece)
if active:
data = {'status_in_company': 'active'}
else:
data = {'status_in_company': 'inactive'}
result = self.get(url, data)
return result.get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_users(self):\r\n\t\tlogger.debug(\"Fetch users\")\r\n\t\t\r\n\t\treturn login.get_users()",
"def fetch_all_users():\n url = \"{}/workspace/{}/users\".format(V1_API_URL, WORKSPACE_ID)\n responses = requests.get(url, headers=HEADERS)\n return [\n {\n \"acronym... | [
"0.71246296",
"0.7009031",
"0.6966797",
"0.6915568",
"0.6887449",
"0.6832766",
"0.6830223",
"0.6819139",
"0.6808806",
"0.679949",
"0.6799372",
"0.6789007",
"0.67806226",
"0.67742866",
"0.67446244",
"0.671317",
"0.6694751",
"0.66875106",
"0.666239",
"0.6648931",
"0.6621379",
... | 0.817946 | 0 |
Retrieve a list of all the teams that a user has access to. This will return teams across all companies the current user has access to. | def get_teams(self):
url = 'teams'
result = self.get(url)
return result.get('teams', result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_company_teams(self, company_referece):\n url = 'companies/{0}/teams'.format(company_referece)\n result = self.get(url)\n return result.get('teams', result)",
"def teams(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'teams')\r\n\r\n return http.Request('GET', url), p... | [
"0.7489081",
"0.72419095",
"0.7240157",
"0.72171396",
"0.72042984",
"0.71952933",
"0.7183357",
"0.71334547",
"0.6981296",
"0.6936945",
"0.67850655",
"0.6764911",
"0.67639595",
"0.67597723",
"0.6750933",
"0.67025095",
"0.6670462",
"0.6529327",
"0.6526705",
"0.6499297",
"0.6498... | 0.7426243 | 1 |
Retrieve the complete job object for the referenced job. This is only available to users with manage_recruiting permissions within the team that the job is posted in. | def get_job(self, job_reference):
url = 'jobs/{0}'.format(job_reference)
result = self.get(url)
return result.get('job', result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_object(self) -> Job:\n project = ProjectPermissionsMixin.get_object(self)\n return project.jobs.get(id=self.kwargs[\"job\"])",
"def get_job(self) -> CustomJob:\n return self._client.get_custom_job(name=self._job_name)",
"def get_job(self, job_id):\n\n try:\n exposure ... | [
"0.81940305",
"0.763955",
"0.72616756",
"0.72534204",
"0.7205309",
"0.7107446",
"0.70887804",
"0.70690084",
"0.6927024",
"0.689124",
"0.688404",
"0.6878481",
"0.68731385",
"0.68664885",
"0.68400425",
"0.6831167",
"0.67426634",
"0.6740695",
"0.6673949",
"0.66355276",
"0.657513... | 0.77152336 | 1 |
Retrieve a list of all the offers on a specific job or within \ a specific team. | def get_offers(self, buyer_team_reference, include_sub_teams=None,
provider_ref=None, profile_key=None, job_ref=None,
agency_ref=None, status=None,
created_time_from=None, created_time_to=None,
page_offset=0, page_size=20, order_by=None):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_offers(self):\n pass",
"def get_league_listing(self):\n url = self.__build_url(urls.GET_LEAGUE_LISTING)\n req = self.executor(url)\n if self.logger:\n self.logger.info('URL: {0}'.format(url))\n if not self.__check_http_err(req.status_code):\n ... | [
"0.57628614",
"0.56692207",
"0.5559179",
"0.55402625",
"0.5539658",
"0.55073285",
"0.547301",
"0.5470004",
"0.54166543",
"0.537629",
"0.5374227",
"0.53590316",
"0.53125197",
"0.5308537",
"0.5307341",
"0.5237498",
"0.51619124",
"0.51416373",
"0.512965",
"0.5113388",
"0.5079461... | 0.68964773 | 0 |
Retrieve the referenced offer. | def get_offer(self, offer_reference):
url = 'offers/{0}'.format(offer_reference)
result = self.get(url)
return result.get('offer', result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_offer(request, offer_id):\n offer = get_object_or_404(Offers, pk=offer_id)\n serializer = OffersSerializer(offer)\n return JsonResponse(serializer.data, safe=False)",
"def get_offer(\n self,\n service_name,\n ):\n import urllib.parse\n\n if self.index is None:\n ... | [
"0.6480831",
"0.62062526",
"0.6197832",
"0.61778504",
"0.5886585",
"0.5828745",
"0.5711066",
"0.5514177",
"0.5442751",
"0.5413679",
"0.5136411",
"0.5119012",
"0.5102649",
"0.5079585",
"0.5053517",
"0.4994421",
"0.49824262",
"0.49734816",
"0.49673218",
"0.49591538",
"0.4944525... | 0.7965513 | 0 |
Retrieve referenced engagement object. | def get_engagement(self, engagement_reference):
url = 'engagements/{0}'.format(engagement_reference)
result = self.get(url)
return result.get('engagement', result) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_object(self):\n return self._object",
"def lookup_obj(self,):\n return self._lookup_obj",
"def get_object(self):\n account = Account.get_account_with_admins(account.id)\n\n return account[0] if account else None",
"def get_object(self):\n if getattr(self, 'current_i... | [
"0.5783282",
"0.56287766",
"0.5541179",
"0.550063",
"0.54797107",
"0.54678154",
"0.54535735",
"0.54510117",
"0.5434497",
"0.5410832",
"0.5401811",
"0.5345003",
"0.5332453",
"0.5307219",
"0.53062886",
"0.5299677",
"0.5265588",
"0.52421933",
"0.52373636",
"0.5230046",
"0.522314... | 0.7453287 | 0 |
List job applications as a client. | def list_client_applications(self, buyer_team__reference, job_key,
status=None, profile_key=None,
agency_team__reference=None,
order_by=None, page_offset=None,
page_size=None):
dat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listapps(self):\n return jsoncall.do_call(\"listapps\", {'modelname':self.modelname,\\\n 'user':self.user,\\\n 'password':self.password},\n ... | [
"0.6776876",
"0.6732049",
"0.6693379",
"0.6689234",
"0.6620565",
"0.6502964",
"0.6432655",
"0.63388366",
"0.630927",
"0.62085605",
"0.6156658",
"0.6153231",
"0.61485225",
"0.6116445",
"0.6095281",
"0.6093142",
"0.6039287",
"0.6038911",
"0.6036074",
"0.6015291",
"0.5975665",
... | 0.73799616 | 0 |
Get specific job application as a client. | def get_client_application(self, application_id, buyer_team__reference):
data = {}
data['buyer_team__reference'] = buyer_team__reference
url = 'clients/applications/{0}'.format(application_id)
return self.get(url, data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_client(self, name):\n return self.get_clients(as_dict=True).get(name)",
"def job(job_name):\n ClientID = Job.get_client_id(job_name)\n return tasks_for_client_job(ClientID, job_name)",
"def client(self) -> str:\n return pulumi.get(self, \"client\")",
"def _get_client(self, request... | [
"0.63978887",
"0.62402445",
"0.6198",
"0.61576414",
"0.6136321",
"0.6130897",
"0.61121416",
"0.60793394",
"0.5979147",
"0.5958431",
"0.59523165",
"0.59523165",
"0.59153277",
"0.58909774",
"0.5878597",
"0.58340085",
"0.582294",
"0.5817454",
"0.5794533",
"0.57913315",
"0.579026... | 0.650442 | 0 |
List job applications as a freelancer. | def list_freelancer_applications(self, status=None):
data = {}
if status:
data['status'] = status
url = 'contractors/applications'
return self.get(url, data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_client_applications(self, buyer_team__reference, job_key,\n status=None, profile_key=None,\n agency_team__reference=None,\n order_by=None, page_offset=None,\n page_size=None):\n ... | [
"0.6346794",
"0.62193936",
"0.60555565",
"0.59836745",
"0.58695585",
"0.57646716",
"0.57538605",
"0.5735169",
"0.5733384",
"0.5714936",
"0.5675769",
"0.5643017",
"0.56337637",
"0.56111324",
"0.56018645",
"0.5600278",
"0.5583996",
"0.5577506",
"0.5548305",
"0.5516825",
"0.5475... | 0.6721879 | 0 |
Get specific job application as a freelancer. | def get_freelancer_application(self, application_id):
data = {}
url = 'contractors/applications/{0}'.format(application_id)
return self.get(url, data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_freelancer_applications(self, status=None):\n data = {}\n\n if status:\n data['status'] = status\n\n url = 'contractors/applications'\n return self.get(url, data)",
"def view_job(options, job_name, client):\n if options.show_events:\n return display_event... | [
"0.55221313",
"0.55001366",
"0.5176622",
"0.5111231",
"0.5085925",
"0.5068883",
"0.50630915",
"0.5051905",
"0.5005737",
"0.49769104",
"0.49479914",
"0.4939961",
"0.49382383",
"0.4904667",
"0.48747703",
"0.485379",
"0.48349792",
"0.48300624",
"0.48130533",
"0.4791802",
"0.4784... | 0.64061135 | 0 |
Edit an existing milestone. | def edit_milestone(self, milestone_id, milestone_description=None, deposit_amount=None, due_date=None, message=None):
data = {}
data['milestone_id'] = milestone_id
if milestone_description:
data['milestone_description'] = milestone_description
if deposit_amount:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_issue_edit_milestone(self):\n pass",
"def update(self):\n\n params = {\n \"title\": self.title,\n \"body\": self.body,\n \"state\": self.state,\n \"labels\": self.labels,\n \"assignees\": self.assignees,\n }\n\n if self.m... | [
"0.7369814",
"0.6184584",
"0.60975057",
"0.60197014",
"0.592604",
"0.5918857",
"0.5915418",
"0.5914129",
"0.5884606",
"0.58582073",
"0.5761563",
"0.5744777",
"0.572514",
"0.5671504",
"0.56410825",
"0.56336033",
"0.5633136",
"0.5629405",
"0.56153303",
"0.5606772",
"0.5602144",... | 0.76799893 | 0 |
Activates a milestone that has not been funded. | def activate_milestone(self, milestone_id, message=None):
data = {}
data['milestone_id'] = milestone_id
if message:
data['message'] = message
url = 'fp/milestones/{0}/activate'.format(milestone_id)
return self.put(url, data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_milestone(self, payload):\n pass",
"def set_milestone(self):\n\t\te = Event()\n\t\tself.queue.put(e)\n\t\treturn e",
"def add_target_to_bug(self, bug, project_name, new_milestone):\n ms_name = self.get_new_milestone_name()\n\n tasks = bug.related_tasks\n # check if already ta... | [
"0.57851166",
"0.5676139",
"0.55553406",
"0.54831004",
"0.5425825",
"0.53606015",
"0.5351348",
"0.53409654",
"0.53227174",
"0.5304007",
"0.53013045",
"0.5250818",
"0.5250497",
"0.5195492",
"0.5162674",
"0.5126358",
"0.5120708",
"0.51070344",
"0.5075711",
"0.50711673",
"0.5066... | 0.6922214 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.