query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Set an Item or an Asset centroid. If an Asset is supplied, sets the property on the Asset. Otherwise sets the Item's value. | def set_statistics(self, statistics, asset=None):
if statistics is not None:
statistics = [s.to_dict() for s in statistics]
self._set_property('pc:statistics', statistics, asset) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set(self, item, **attrs):\n attrs[self.type] = item\n self.graph._setattrs(self.parent.handle, **attrs)",
"def SetItem(self, item):\r\n\r\n self._item = item",
"def set(self, item, value):\r\n raise NotImplementedError",
"def _single_setitem(self, key, item):\n getattr(... | [
"0.6098633",
"0.58203405",
"0.56901604",
"0.5687995",
"0.56144345",
"0.56144345",
"0.5491145",
"0.53725964",
"0.53577054",
"0.5286343",
"0.52831596",
"0.5268976",
"0.5209155",
"0.51550984",
"0.5145099",
"0.50472564",
"0.5047035",
"0.50446934",
"0.50345016",
"0.50345016",
"0.5... | 0.0 | -1 |
Get or sets the name property for this PointCloudSchema. | def name(self):
return self.properties.get('name') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self.properties.get('name', None)",
"def name(self):\n return self.properties.get(\"Name\", None)",
"def name(self):\n\n return self._get_field(\"name\")",
"def name(self):\n return self._document['name']",
"def name(self) -> Optional[str]:\n retu... | [
"0.67921364",
"0.66994697",
"0.6661094",
"0.6629889",
"0.6424094",
"0.6424094",
"0.63910764",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
"0.63753885",
... | 0.6694871 | 3 |
Get or sets the name property | def name(self):
return self.properties.get('name') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self, name):\n return self.name",
"def name(self):\n return self.properties.get('name', None)",
"def _get_name(self):\n return self.name",
"def name(self):\n return self.properties.get(\"Name\", None)",
"def name(self, name):\n\n return self.name",
"def get_nam... | [
"0.8025751",
"0.79458183",
"0.78638",
"0.7843116",
"0.7828349",
"0.7821822",
"0.782098",
"0.782098",
"0.782098",
"0.7809624",
"0.78084207",
"0.7795705",
"0.7791578",
"0.77386785",
"0.77386785",
"0.77382195",
"0.77382195",
"0.7735762",
"0.7734025",
"0.7723322",
"0.77192616",
... | 0.7870651 | 2 |
Get or sets the average property | def average(self):
return self.properties.get('average') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAvg(self):\r\n\t\treturn self.data['avg']",
"def get_average(self):\n self.avg = math.floor((self.maths + self.phy + self.che) / 3, )\n self.assign_grade()\n return self.avg\n # End of method get_average",
"def getAvg(self):\r\n\t\tdata = self.pair.data\r\n\t\tif data['avg'] ... | [
"0.7684296",
"0.75175554",
"0.7480714",
"0.740854",
"0.730621",
"0.72784716",
"0.72350603",
"0.7200712",
"0.7200712",
"0.7149497",
"0.71300644",
"0.7111354",
"0.7107913",
"0.7058831",
"0.7027082",
"0.6939395",
"0.6907709",
"0.6894971",
"0.68276644",
"0.68015456",
"0.6799922",... | 0.8501269 | 0 |
Get or sets the maximum property | def maximum(self):
return self.properties.get('maximum') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_maximum ( self, object ):\n return self.maximum",
"def max(self):\n return self.__max",
"def _get_maximum(self):\n return self._maximum",
"def get_max(self):\n return self._max",
"def max(self):\n return self._max",
"def max(self):\n return self._max",
... | [
"0.79211074",
"0.78762174",
"0.78615713",
"0.7811744",
"0.77863824",
"0.77863824",
"0.77312344",
"0.7646087",
"0.7555129",
"0.75025356",
"0.74539834",
"0.74374324",
"0.74181014",
"0.7392373",
"0.7392373",
"0.7298539",
"0.7298539",
"0.7298539",
"0.7298539",
"0.7298539",
"0.729... | 0.84164935 | 0 |
Get or sets the minimum property | def minimum(self):
return self.properties.get('minimum') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_minimum(self):\n return self._minimum",
"def min(self):\n return self.__min",
"def min(self):\n return self._min",
"def min(self):\n return self._min",
"def min(self):\n return min(self)",
"def _get_minimum_value(self):\n if hasattr(self, '_minimum_value... | [
"0.8051351",
"0.7951874",
"0.7843424",
"0.7843424",
"0.7758481",
"0.76722556",
"0.7521663",
"0.7521663",
"0.7429883",
"0.74213386",
"0.74213386",
"0.74213386",
"0.74213386",
"0.74213386",
"0.74213386",
"0.7393852",
"0.7393852",
"0.7387544",
"0.7358283",
"0.7358283",
"0.735614... | 0.852471 | 0 |
Get or sets the stddev property | def stddev(self):
return self.properties.get('stddev') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_image_std_dev(self):\n\n # if \"image_normalization\" not in self.config:\n # return constants.DEFAULT_IMAGE_STD_DEV\n\n # return self.config[\"image_normalization\"][\"std_dev\"]\n\n return constants.DEFAULT_IMAGE_STD_DEV",
"def get_stdev(self):\n raise NotImplemen... | [
"0.74076504",
"0.714127",
"0.7071152",
"0.70569897",
"0.69129586",
"0.6900065",
"0.6899796",
"0.6790561",
"0.6691992",
"0.662337",
"0.6462254",
"0.64339566",
"0.6383909",
"0.6379636",
"0.63508195",
"0.63437825",
"0.6311983",
"0.6292293",
"0.62887335",
"0.62790155",
"0.6241445... | 0.84157026 | 0 |
Returns the dictionary representing the JSON of this PointcloudStatistic. | def to_dict(self):
return self.properties | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_json(self):\n return {\n \"power\": self.get_power(), \n \"timestamp\": self.get_timestamp(), \n \"shortage\": self.get_shortage()\n }",
"def stats_to_json(self):\n return json.dumps({'name': self.name,\n ... | [
"0.6874672",
"0.6820688",
"0.673438",
"0.6562006",
"0.65076244",
"0.6421272",
"0.642028",
"0.63681054",
"0.63667303",
"0.6342048",
"0.63207847",
"0.63199097",
"0.6306773",
"0.6270542",
"0.62540376",
"0.62533283",
"0.62312603",
"0.62243485",
"0.6206496",
"0.616382",
"0.6162334... | 0.0 | -1 |
Change the position of paddle according to current velocity | def paddle_change_pos(pos, vel):
y1 = pos[0][1] + vel
y2 = pos[2][1] + vel
return [[pos[0][0], y1], [pos[1][0], y1], [pos[2][0], y2], [pos[3][0], y2]] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _movePaddle(self):\n self._click()\n self._game.updatePaddle(self._touch)\n self._last = self._touch",
"def reset_paddle(self):\r\n self.y = self.screen_Height // 2\r\n self.vy = 0",
"def updatePaddle(self, selfinput):\n assert isinstance(selfinput,GInput)\n ... | [
"0.7675825",
"0.7497701",
"0.7359835",
"0.7257724",
"0.7168305",
"0.71561474",
"0.71209407",
"0.71123207",
"0.7048418",
"0.7036702",
"0.7014332",
"0.7000311",
"0.6904934",
"0.68614465",
"0.6826863",
"0.67468464",
"0.67285174",
"0.6717723",
"0.6710248",
"0.66992813",
"0.669131... | 0.69779617 | 12 |
Bouncing ball from walls (paddles) depending it is vertical or horizontal ones | def ball_bounce(wall):
if wall: # top & bottom walls
ball_vel[1] = -ball_vel[1]
else: # left or right walls
ball_vel[0] = -ball_vel[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bounce(self):\n \n if self.x > width - self.size:\n self.x = 2*(width - self.size) - self.x\n self.angle = self.angle * -1\n self.speed *= elasticity # Added to all to account for elasticity\n elif self.x < self.size:\n self.x = 2*self.size - self.x\n ... | [
"0.7709193",
"0.766397",
"0.7379853",
"0.7351488",
"0.7326048",
"0.73140967",
"0.7311114",
"0.71403015",
"0.7061158",
"0.7043305",
"0.7026576",
"0.70097476",
"0.699283",
"0.6982168",
"0.6964145",
"0.69557464",
"0.6922511",
"0.6897229",
"0.68724406",
"0.68503296",
"0.6797895",... | 0.8331434 | 0 |
This creates an ellipse vertex buffer object (VBO). It can later be drawn with ``render_ellipse_filled``. This method of drawing an ellipse is much faster than calling ``draw_ellipse_filled`` each frame. | def create_ellipse(width, height, color):
num_segments = 64
data = []
for segment in range(num_segments + 1):
theta = 2.0 * 3.1415926 * segment / num_segments
x = width * math.cos(theta)
y = height * math.sin(theta)
data.extend([x, y])
vbo_id = GL.GLuint()
GL.gl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_ellipse(self, color, position, size=None,\n border_width=0, anchor='topleft'):\n if size is None:\n rect = spyral.Rect(position)\n else:\n rect = spyral.Rect(position, size)\n offset = self._calculate_offset(anchor, rect.size)\n pygame.... | [
"0.6592065",
"0.6583624",
"0.65602934",
"0.64700556",
"0.6327017",
"0.63180465",
"0.62618357",
"0.6234542",
"0.6102799",
"0.6060553",
"0.6034306",
"0.60213304",
"0.5934714",
"0.58779436",
"0.5859895",
"0.5859165",
"0.5803246",
"0.5758461",
"0.5747219",
"0.57460034",
"0.574087... | 0.7467849 | 0 |
Draw a filled in ellipse. | def draw_ellipse_filled(center_x, center_y,
width, height, color, tilt_angle=0):
num_segments = 128
GL.glEnable(GL.GL_BLEND)
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)
GL.glEnable(GL.GL_LINE_SMOOTH)
GL.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_NICEST)
GL.glHi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ellipse(self, arg, fill='', outline=''):\n pass",
"def render_ellipse_filled(shape, center_x, center_y, color, angle=0):\n # Set color\n if len(color) == 4:\n GL.glColor4ub(shape.color[0], shape.color[1], shape.color[2],\n shape.color[3])\n GL.glEnable(GL.GL_BL... | [
"0.7955833",
"0.76247454",
"0.75407267",
"0.7536706",
"0.746527",
"0.7430281",
"0.7393279",
"0.737352",
"0.7330664",
"0.7297446",
"0.7236473",
"0.72267675",
"0.7218938",
"0.7172415",
"0.7135174",
"0.7118195",
"0.6997006",
"0.6991571",
"0.6968664",
"0.6954983",
"0.6951969",
... | 0.7692134 | 1 |
Draw the outline of an ellipse. | def draw_ellipse_outline(center_x, center_y, width, height, color,
border_width=1, tilt_angle=0):
num_segments = 128
GL.glEnable(GL.GL_BLEND)
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)
GL.glEnable(GL.GL_LINE_SMOOTH)
GL.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ellipse(self, arg, fill='', outline=''):\n pass",
"def add_ellipse(self, x, y, w, h, fill_style=None, outline_style=None):\n if w < 1 or h < 1:\n return\n fill_style = self.__prepare_style(fill_style, self.style.char)\n outline_style = self.__prepare_style(outline_style... | [
"0.80013",
"0.77460617",
"0.72897387",
"0.7255305",
"0.7240411",
"0.7238065",
"0.7186382",
"0.7120248",
"0.70655346",
"0.70553553",
"0.7029917",
"0.70208615",
"0.7008646",
"0.69414115",
"0.69264764",
"0.6914987",
"0.68623006",
"0.67524683",
"0.6739467",
"0.67185855",
"0.67118... | 0.7946042 | 1 |
Draw a line strip. A line strip is a set of continuously connected line segments. | def draw_line_strip(point_list, color, border_width=1):
GL.glEnable(GL.GL_BLEND)
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)
GL.glEnable(GL.GL_LINE_SMOOTH)
GL.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_NICEST)
GL.glHint(GL.GL_POLYGON_SMOOTH_HINT, GL.GL_NICEST)
# Set line width
GL.g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_line_segment(\n x1: float, y1: float, x2: float, y2: float, color: C3F\n ) -> None:\n pyglet.graphics.draw(\n 2,\n pyglet.gl.GL_LINE_STRIP,\n (GeoDrawer._VERTEX_MODE, [x1, y1, x2, y2]),\n (GeoDrawer._COLOR_MODE, color * 2),\n )",
"def d... | [
"0.6880856",
"0.67509675",
"0.63536894",
"0.63324046",
"0.63174075",
"0.6304633",
"0.630407",
"0.62953043",
"0.6278865",
"0.6257372",
"0.6181309",
"0.6146893",
"0.6109245",
"0.6080167",
"0.6078135",
"0.6066115",
"0.60506165",
"0.60379934",
"0.60350406",
"0.6012197",
"0.600782... | 0.65983725 | 2 |
Draw a set of lines. Draw a line between each pair of points specified. | def draw_lines(point_list, color, border_width=1):
GL.glEnable(GL.GL_BLEND)
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)
GL.glEnable(GL.GL_LINE_SMOOTH)
GL.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_NICEST)
GL.glHint(GL.GL_POLYGON_SMOOTH_HINT, GL.GL_NICEST)
GL.glLoadIdentity()
# Set... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line(canvas, points, line_width, line_color):\n \n # duplicate first point in case only one point was given\n points = points[0], points\n canvas.create_line(points, width = int(line_width), fill = line_color)",
"def line(self, points, ls=\"--\", draw=\"black\", lw=None, options=None, kwoptions=N... | [
"0.72511846",
"0.7052661",
"0.7031082",
"0.7013259",
"0.69279855",
"0.6882803",
"0.68647486",
"0.68350697",
"0.679705",
"0.67915046",
"0.6791072",
"0.6771816",
"0.6758988",
"0.6757219",
"0.67222095",
"0.6676704",
"0.6673109",
"0.66649455",
"0.66630626",
"0.664594",
"0.6579989... | 0.6655173 | 19 |
true if all components of self are greaterthan components of other | def all_gt(self, other):
return self.x > other.x and self.y > other.y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __gt__(self, other):\n result = False\n if isinstance(other, Shape):\n result = not self.__le__(other)\n return result",
"def __gt__(self, other):\n return self.element() > other.element()",
"def __gt__(self,other):\r\n\t\tsorted_self = sorted(self.vector, reverse... | [
"0.760271",
"0.758917",
"0.7563558",
"0.7541532",
"0.7541532",
"0.7515882",
"0.7511142",
"0.74519426",
"0.74519426",
"0.74344575",
"0.7424188",
"0.74241364",
"0.73824865",
"0.73824865",
"0.7377844",
"0.734702",
"0.7342415",
"0.7341371",
"0.73275316",
"0.7303819",
"0.72997916"... | 0.8076023 | 0 |
Sets the account_type of this User. | def account_type(self, account_type):
allowed_values = ["USER_ACCOUNT", "SERVICE_ACCOUNT", "INACTIVE_SERVICE_ACCOUNT"] # noqa: E501
if account_type not in allowed_values:
raise ValueError(
"Invalid value for `account_type` ({0}), must be one of {1}" # noqa: E501
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def account_type(self, account_type):\n\n self._account_type = account_type",
"def account_type(self, account_type):\n\n self._account_type = account_type",
"def account_type(self, account_type):\n\n self._account_type = account_type",
"def account_type(self, account_type):\n\n se... | [
"0.87062484",
"0.87062484",
"0.87062484",
"0.87062484",
"0.6641696",
"0.6611578",
"0.64361453",
"0.6427448",
"0.6310349",
"0.6262316",
"0.6262316",
"0.62338513",
"0.6230086",
"0.61869437",
"0.6051283",
"0.6015449",
"0.6009822",
"0.60007167",
"0.60007167",
"0.60007167",
"0.600... | 0.7928652 | 4 |
Sets the description of this User. | def description(self, description):
self._description = description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, description):\n self.description = description",
"def set_description(self, description):\n self.__description = description",
"def set_description(self, description):\r\n self.__description = description",
"def set_description(self, description):\n self.... | [
"0.79699385",
"0.7915846",
"0.7886942",
"0.7872471",
"0.78138965",
"0.77083653",
"0.7555156",
"0.7555156",
"0.7555156",
"0.7555156",
"0.7538835",
"0.7538835",
"0.7538835",
"0.7538835",
"0.7486253",
"0.7447229",
"0.7400064",
"0.73332494",
"0.7304437",
"0.7265347",
"0.72160715"... | 0.75348717 | 51 |
Sets the identifier of this User. | def identifier(self, identifier):
self._identifier = identifier | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setId(self, identifier):\n self.identifier = identifier",
"def set_identifier(self, uid):\n\n self.uid = uid\n\n self.set_unique_metadata('DC', 'identifier', self.uid, {'id': self.IDENTIFIER_ID})",
"def setIdentifier(self, identifier):\n self._config['identifier'] = identifier",... | [
"0.75760937",
"0.7285924",
"0.7203813",
"0.7203813",
"0.70914125",
"0.70914125",
"0.70821375",
"0.7039978",
"0.68477786",
"0.67846274",
"0.6726643",
"0.65923434",
"0.65923434",
"0.65923434",
"0.65923434",
"0.65923434",
"0.65923434",
"0.65923434",
"0.65923434",
"0.65923434",
"... | 0.70833343 | 9 |
Sets the ingestion_policy_id of this User. | def ingestion_policy_id(self, ingestion_policy_id):
self._ingestion_policy_id = ingestion_policy_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policy_id(self, policy_id):\n\n self._policy_id = policy_id",
"def policy_id(self, policy_id):\n\n self._policy_id = policy_id",
"def policyid(self, policyid):\n self._policyid = policyid",
"def isolation_policy_num_in(self, isolation_policy_num_in):\n\n self._isolation_policy... | [
"0.6515323",
"0.6515323",
"0.6394129",
"0.558252",
"0.53033984",
"0.52396387",
"0.5192091",
"0.5186497",
"0.49860618",
"0.49860618",
"0.49860618",
"0.49860618",
"0.49860618",
"0.49063313",
"0.4902822",
"0.4901014",
"0.4901014",
"0.4858814",
"0.4858814",
"0.4858814",
"0.485881... | 0.86753577 | 0 |
Sets the invalid_password_attempts of this User. | def invalid_password_attempts(self, invalid_password_attempts):
self._invalid_password_attempts = invalid_password_attempts | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def change_password_attempts(request):\n username = request.user.username\n password_attempts = f\"{CHANGE_PASSWORD_ATTEMPTS}{username}\"\n attempts = cache.get(password_attempts)\n\n if attempts:\n cache.incr(password_attempts)\n attempts = cache.get(password_attempts)\n if attemp... | [
"0.60028946",
"0.59822524",
"0.59311193",
"0.5912592",
"0.58220094",
"0.57968193",
"0.57968193",
"0.57968193",
"0.57968193",
"0.57968193",
"0.57968193",
"0.5642325",
"0.5642325",
"0.55837667",
"0.54573965",
"0.533634",
"0.53050673",
"0.5298448",
"0.5297815",
"0.52834195",
"0.... | 0.88109624 | 0 |
Sets the last_successful_login of this User. | def last_successful_login(self, last_successful_login):
self._last_successful_login = last_successful_login | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_last_login(sender, user, **kwargs):\n try:\n user_last_login = UserLastLogin.objects.get(username=user.username)\n except UserLastLogin.DoesNotExist:\n user_last_login = UserLastLogin(username=user.username)\n user_last_login.last_login = timezone.now()\n user_last_login.save()... | [
"0.62383854",
"0.6097289",
"0.5913674",
"0.56693685",
"0.5667146",
"0.55218714",
"0.5453868",
"0.5453868",
"0.5453868",
"0.5453868",
"0.5396251",
"0.5393752",
"0.53828484",
"0.5334476",
"0.5300474",
"0.52913195",
"0.5239801",
"0.5202896",
"0.5134672",
"0.5134307",
"0.5133024"... | 0.86679167 | 0 |
Sets the last_used of this User. | def last_used(self, last_used):
self._last_used = last_used | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_last_used_on(self):\n self.last_used_on = datetime.now()\n self.save()",
"def last_updated_user(self, last_updated_user):\n self._last_updated_user = last_updated_user",
"def used_current(self, used_current):\n self._used_current = used_current",
"def set_used_mem(self, u_... | [
"0.80200636",
"0.681808",
"0.622034",
"0.61213255",
"0.5930207",
"0.5930207",
"0.5930207",
"0.5930207",
"0.585247",
"0.57980454",
"0.57980454",
"0.57906604",
"0.57579005",
"0.5753154",
"0.5700529",
"0.5613673",
"0.5568887",
"0.5545505",
"0.5545505",
"0.553601",
"0.55082154",
... | 0.8048686 | 0 |
Sets the sso_id of this User. | def sso_id(self, sso_id):
self._sso_id = sso_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, ssc_id):\r\n self.ssc_id = ssc_id",
"def security_user_id(self, security_user_id):\n\n self._security_user_id = security_user_id",
"def security_user_id(self, security_user_id):\n\n self._security_user_id = security_user_id",
"def id_user(self, id_user):\n\n self.... | [
"0.6938822",
"0.6722376",
"0.6722376",
"0.6650585",
"0.6571622",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.64370245",
"0.61311513",
"... | 0.8322336 | 0 |
Sets the super_admin of this User. | def super_admin(self, super_admin):
self._super_admin = super_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_admin(self, is_admin):\n\n self._is_admin = is_admin",
"def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n self._is_admin = is_admin",
"def is_superuser(self):\n retu... | [
"0.62841874",
"0.59982663",
"0.57652795",
"0.574121",
"0.56373507",
"0.55411154",
"0.5473407",
"0.54709655",
"0.5418948",
"0.54167575",
"0.5392598",
"0.5367949",
"0.53367376",
"0.52825993",
"0.5276903",
"0.524409",
"0.5232801",
"0.5229835",
"0.5229079",
"0.522115",
"0.5218602... | 0.84275925 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, User):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Check for negative correlation between snr and boxcar width | def sigma_width_correlation(sps,best=True):
env = get_envelope(sps)
env.sort(order='sigma')
if best:
env = env[::-1]
sub = env[np.unique(env.downfact,True)[1]]
return np.corrcoef(sub.downfact,sub.sigma)[0,1]
else:
return np.corrcoef(env.downfact,env.sigma)[0,1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testrescorr():\n tau = np.zeros((2,50))\n tau[0,25] = 2\n tau[1,23] = 3\n tau2 = spec_utils.res_corr(tau, 2, 8)\n #Check flux conserved\n assert np.abs(np.sum(tau2[0,:])/ np.sum(tau[0,:]) -1) < 1e-6\n assert np.abs(np.sum(tau2[1,:])/ np.sum(tau[1,:]) -1) < 1e-6\n #Check expanded by expe... | [
"0.6347539",
"0.5928468",
"0.5708619",
"0.5706645",
"0.5673066",
"0.54473203",
"0.5416163",
"0.54109305",
"0.54031074",
"0.53322965",
"0.5307723",
"0.52894187",
"0.5284714",
"0.52790034",
"0.5271658",
"0.52684325",
"0.5264695",
"0.5264695",
"0.52594686",
"0.5252755",
"0.51993... | 0.55352294 | 5 |
Derive a new feature by calculating each uid_key's number of unique values in the column we concern. | def nunique_stats(df, df_history, uid_key, value, feat):
add = pd.DataFrame(df_history.groupby(uid_key)[value].nunique()).reset_index()
add = add.rename(columns={value: feat})
df = pd.merge(df, add, on=uid_key, how='left')
return df | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_count(df, cols, dummy_col, generated_feature_name, params=None): \n r_col = cols[-1]\n dtype = {x: df[x].dtype for x in cols[:-1] if x in df.columns.values}\n result = df[cols].groupby(by=cols[:-1])[[r_col]].nunique().rename(index=str, columns={r_col: generated_feature_name}).reset_index()\n ... | [
"0.66549265",
"0.65931535",
"0.60874295",
"0.5826456",
"0.57991785",
"0.57584035",
"0.57546794",
"0.57458144",
"0.5695361",
"0.5608669",
"0.5586536",
"0.5578991",
"0.5561425",
"0.5548597",
"0.5500904",
"0.5493599",
"0.54616946",
"0.5449396",
"0.5429298",
"0.5403169",
"0.53879... | 0.65722513 | 2 |
Returns a copy of this object. | def clone( self ):
new = copy( self )
try: del new.input_changed
except AttributeError: pass
return new | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy(self):\n return self.__copy__()",
"def copy(self):\n return self.__copy__()",
"def copy(self):\n return self.__copy__()",
"def copy(self):\n return self.__copy__()",
"def __copy__(self):\n return self.copy()",
"def copy(self):\n return copy(self)",
"de... | [
"0.90618587",
"0.90618587",
"0.90618587",
"0.90618587",
"0.90363246",
"0.9003144",
"0.9003144",
"0.899227",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
"0.89381063",
... | 0.0 | -1 |
Return the main body of the message. The body object contains the main text of the message. This may be the message object itself for a simple message or the first part of the multipart message. | def get_body( self ):
if not self.is_multipart():
return self
return self.get_payload(0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_body(message):\n\n if message.is_multipart():\n # get the html text version only\n text_parts = [part\n for part in typed_subpart_iterator(message,\n 'text',\n ... | [
"0.7925092",
"0.76354456",
"0.7389757",
"0.73256904",
"0.7178256",
"0.69532526",
"0.69361126",
"0.69045234",
"0.6858108",
"0.6858108",
"0.684457",
"0.68286127",
"0.6743032",
"0.67326695",
"0.6726798",
"0.6704837",
"0.6699571",
"0.66831553",
"0.66766495",
"0.66747385",
"0.6617... | 0.76660156 | 1 |
Creates a new mail message instance with character set conversion from portal to email encoding. | def createMessage( self, *args, **kw ):
if not kw.has_key('charset'):
kw['charset'] = self.getOutputCharset()
kw['to_mail'] = 1
return MailServerBase.createMessage( self, *args, **kw ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createMessage( self, *args, **kw ):\n if not kw.has_key('charset'):\n kw['charset'] = self.getInputCharset()\n return MailServerBase.createMessage( self, *args, **kw )",
"def createMessage( self, *args, **kw ):\n return MailMessage( *args, **kw )",
"def create_email(sender, ... | [
"0.70733476",
"0.6609754",
"0.6518896",
"0.6191155",
"0.61215144",
"0.6077816",
"0.6077816",
"0.60411197",
"0.60158163",
"0.59733117",
"0.59410167",
"0.591022",
"0.58883834",
"0.5880787",
"0.58439267",
"0.58423674",
"0.5827256",
"0.58145374",
"0.5812579",
"0.5722532",
"0.5687... | 0.7022055 | 1 |
Formats name and email address pair into string, properly encoding and converting characters if necessary. | def formataddr( pair, charset=None ):
name, address = pair
name = name and name.strip()
address = address and address.strip()
if not name:
return address
if _is8bitstring( name ):
header = Header( '"%s"' % name, charset )
header.append( ' <%s>' % address, '8bit' )
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_email(name: str, email: str, archive_long_name: str):\n if email:\n return email.strip()\n else:\n user = name.title() + archive_long_name.title()\n return re.sub(r'\\W+', '', unidecode(user)) + 'Archive@ao3.org'",
"def address_header(self, name, email)... | [
"0.649302",
"0.64685345",
"0.6436405",
"0.632436",
"0.63218296",
"0.6295794",
"0.6265821",
"0.6252156",
"0.6250787",
"0.62500536",
"0.62288564",
"0.6211553",
"0.6210303",
"0.6158841",
"0.61580867",
"0.61551654",
"0.61551654",
"0.61551654",
"0.6139743",
"0.6139743",
"0.6139743... | 0.60288423 | 26 |
Returns a layer accepting inputs with `in_channels` number of channels and producing outputs of `out_channels` number of channels. The `strides` indicates upsampling factor, ie. transpose convolutional stride. If `is_last` is True this is the final layer and is not expected to include activation and normalization layer... | def _get_layer(
self, in_channels: int, out_channels: int, strides: int, is_last: bool
) -> Convolution | nn.Sequential:
layer: Convolution | nn.Sequential
layer = Convolution(
in_channels=in_channels,
strides=strides,
is_transposed=True,
con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decoder(self, in_channels, out_channels, kernel_size, stride=1, padding=1, output_padding=0, batchnorm=True, bias=False, n_convs=1):\n mods = []\n out = in_channels\n\n for n in range(n_convs):\n if n == n_convs - 1:\n out = out_channels \n mods.append(... | [
"0.64961624",
"0.6486889",
"0.6161412",
"0.6099693",
"0.6056032",
"0.5973628",
"0.5967452",
"0.59473336",
"0.59332967",
"0.5922968",
"0.59079784",
"0.5907842",
"0.587985",
"0.58781666",
"0.58737856",
"0.5852219",
"0.58321995",
"0.58296496",
"0.5822817",
"0.58217055",
"0.58023... | 0.7741987 | 0 |
Return the area of the triangle. p = 1/2(a+b+c) S = sqrt(p(pa)(pb)(pc)) | def area(self):
semi_perimeter = self.perimeter() / 2
area = semi_perimeter
for l in self._lengths:
area *= (semi_perimeter - l)
return float('{:.2f}'.format(area**0.5)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_triangle_area(a,b,c):\n ab = np.sqrt( ((a-b)**2).sum() )\n ac = np.sqrt( ((a-c)**2).sum() )\n bc = np.sqrt( ((b-c)**2).sum() )\n \n s = (ab+ac+bc)/2\n area = np.sqrt(s*(s-ab)*(s-bc)*(s-ac))\n \n return area",
"def triangle_area(side1: number, side2: number, side3: number) -> n... | [
"0.81039286",
"0.80193704",
"0.7848163",
"0.7843925",
"0.7781955",
"0.7758094",
"0.7729729",
"0.762703",
"0.7604994",
"0.75897235",
"0.7544993",
"0.75260663",
"0.75237507",
"0.75114924",
"0.7504563",
"0.7492572",
"0.74918664",
"0.743501",
"0.7426473",
"0.72041607",
"0.7201701... | 0.6352956 | 59 |
Create a Square. length the length of side of the square. | def __init__(self, length):
super().__init__([length]*4, [90]*2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def square(center, side_length, *args, **kwargs):\n center = np.asarray(center)\n side_length = float(side_length)\n lower_left = center - 0.5*side_length\n return patch.Rectangle(lower_left, side_length, side_length,\n \t\t\t\t\t *args, **kwargs)",
"def square(halfSideLength = 30, robotHeight =... | [
"0.73198646",
"0.71987057",
"0.699792",
"0.69413346",
"0.685241",
"0.6675366",
"0.6620838",
"0.65422",
"0.65281945",
"0.64755034",
"0.6356539",
"0.6324386",
"0.62244916",
"0.6215322",
"0.6206195",
"0.6151142",
"0.6139236",
"0.6122061",
"0.6094413",
"0.60280967",
"0.60167927",... | 0.0 | -1 |
Return the area of polygon. S = p a / 2 p = perimeter a = length / (2tan(180/sides)) | def area(self):
area = 0.25*self._sides*self._length**2 / math.tan(math.radians(180/self._sides))
return float('{:.2f}'.format(area)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def area_reg_polygon(sides: int, length: float) -> float:\r\n if not isinstance(sides, int) or sides < 3:\r\n raise ValueError(\r\n \"area_reg_polygon() only accepts integers greater than or \\\r\nequal to three as number of sides\"\r\n )\r\n elif length < 0:\r\n raise ValueEr... | [
"0.8023738",
"0.7992927",
"0.78511256",
"0.78302795",
"0.7814434",
"0.7734573",
"0.7586559",
"0.75264525",
"0.7449325",
"0.7428537",
"0.7271374",
"0.7245943",
"0.71875834",
"0.7176318",
"0.7136696",
"0.71306264",
"0.7113179",
"0.7074509",
"0.7054766",
"0.7048828",
"0.70385116... | 0.7592992 | 6 |
Return the area of irregular polygon. [(x1, y1), (x2, y2), (x3, y3), (x4, y4)] a = x1y2 + x2y3 + x3y4 + x4y1 b = y1x2 + y2x3 + y3x4 + y4x1 S = 1/2|ab| | def area(self):
area = 0
last = self._coordinates[-1]
for c in self._coordinates:
area += (last[0] * c[1] - last[1] * c[0])
last = c
return float("{:.2f}".format(abs(area) * 0.5)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def polygon_area(x, y):\n return 0.5 * np.abs(np.dot(x, np.roll(y, 1)) - np.dot(y, np.roll(x, 1)))",
"def polygon_area(ppath): # pragma: no cover\n v_ = ppath.vertices\n if len(v_) < 3:\n return 0.0\n x_ = v_[:, 1] - v_[:, 1].mean()\n y_ = v_[:, 0] - v_[:, 0].mean()\n correction = x_[-1... | [
"0.7657677",
"0.7575073",
"0.7521163",
"0.7511863",
"0.74539244",
"0.7410052",
"0.7393758",
"0.7365713",
"0.7242179",
"0.7235108",
"0.7217956",
"0.7151036",
"0.70429426",
"0.7032234",
"0.7001936",
"0.6983961",
"0.6973192",
"0.69346815",
"0.69228184",
"0.6922677",
"0.6919159",... | 0.6595707 | 32 |
r"""Sets up actor critic and agent for PPO. | def _setup_actor_critic_agent(self, ppo_cfg: Config, observation_space=None) -> None:
logger.add_filehandler(self.config.LOG_FILE)
if observation_space is None:
observation_space = self.envs.observation_spaces[0]
self.actor_critic = AudioNavBaselinePolicy(
observation_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _setup_actor_critic_agent(self, ppo_cfg: Config) -> None:\n logger.add_filehandler(self.config.LOG_FILE)\n\n self.actor_critic = RearrangementBaselinePolicy(\n observation_space=self.envs.observation_spaces[0],\n action_space=self.envs.action_spaces[0],\n hidden_s... | [
"0.8002376",
"0.7934495",
"0.62190187",
"0.61917746",
"0.61137176",
"0.6070026",
"0.60484576",
"0.5936954",
"0.5790541",
"0.57671416",
"0.5742905",
"0.57137734",
"0.5711547",
"0.57044065",
"0.5698852",
"0.56630653",
"0.5593745",
"0.55782545",
"0.5576158",
"0.5555962",
"0.5555... | 0.7379803 | 2 |
r"""Load checkpoint of specified path as a dict. | def load_checkpoint(self, checkpoint_path: str, *args, **kwargs) -> Dict:
return torch.load(checkpoint_path, *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_checkpoint(checkpoint_path):\n flat_checkpoint_dict = flatten_checkpoint(\n parse_checkpoint(checkpoint_path), keep_empty_nodes=True)\n return flat_checkpoint_dict",
"def load_checkpoint(path: str, use_cuda: bool = True) -> dict:\n assert os.path.isfile(path), \"Checkpoint %s not found\" % pat... | [
"0.793037",
"0.7480966",
"0.74463123",
"0.72766906",
"0.72656673",
"0.72596836",
"0.7255012",
"0.72533715",
"0.71079624",
"0.7094464",
"0.6936953",
"0.69292545",
"0.69085896",
"0.68961304",
"0.6853913",
"0.6835567",
"0.682966",
"0.6803416",
"0.68013287",
"0.67988545",
"0.6798... | 0.80184495 | 1 |
[summary] Get now date | def get_date(self, days=0, months=0, years=0):
now_year, now_month, now_day, now_day_week = (datetime.now() - relativedelta(days=days,months=months, years=years)).strftime("%Y %m %d %w").split(" ")
return now_year, now_month, now_day, now_day_week | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getdate():\r\n import datetime\r\n return datetime.datetime.now()",
"def get_date():\n return datetime.datetime.now()",
"def _get_date():\n return datetime.datetime.now()",
"def get_now():\n return datetime.now()",
"def get_now():\n return datetime.now()",
"def now():\r\n ret... | [
"0.8348285",
"0.82772225",
"0.8255086",
"0.8070372",
"0.8070372",
"0.80288523",
"0.8001644",
"0.797596",
"0.793808",
"0.7851731",
"0.7839628",
"0.77708334",
"0.77312267",
"0.7724434",
"0.7696471",
"0.76959133",
"0.76343066",
"0.76279294",
"0.7622276",
"0.76146644",
"0.7588904... | 0.0 | -1 |
Saves model and training parameters at '{checkpoint_dir}/last_checkpoint.pytorch'. If is_best==True saves '{checkpoint_dir}/best_checkpoint.pytorch' as well. | def save_checkpoint(state, is_best, checkpoint_dir, logger=None):
def log_info(message):
if logger is not None:
logger.info(message)
if not os.path.exists(checkpoint_dir):
log_info(
"Checkpoint directory does not exists. Creatding {}".format(checkpoint_dir))
os.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _save_checkpoint(self, epoch, is_best=False):\n arch = type(self.model).__name__\n state = {\n 'arch': arch,\n 'epoch': epoch,\n 'state_dict': self.model.state_dict(),\n 'optimizer': self.optimizer.state_dict(),\n 'config': self.config\n ... | [
"0.85600317",
"0.84483707",
"0.844336",
"0.84387565",
"0.82364273",
"0.82218236",
"0.82113105",
"0.81998",
"0.8179897",
"0.8165473",
"0.8163356",
"0.81393695",
"0.80733144",
"0.80630046",
"0.80324554",
"0.80055815",
"0.79763263",
"0.79742396",
"0.7972152",
"0.7961076",
"0.786... | 0.8211948 | 6 |
Get vCenter profile ID for the given profile name. | def get_profile_id(self, profile_name):
if profile_name in self._profile_id_cache:
LOG.debug("Returning cached ID for profile: %s.", profile_name)
return self._profile_id_cache[profile_name]
profile_id = pbm.get_profile_id_by_name(self._session, profile_name)
if profile_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_profile_id(self, profile):\n return profile['id']",
"def get_profile_id(self):\n # get list of user profile\n results = self.service.userProfiles().list().execute()\n # TODO: create custom exceptions\n assert 'items' in results\n # TODO: create custom exceptions\... | [
"0.74070936",
"0.7150303",
"0.6525266",
"0.6521924",
"0.64373",
"0.64079624",
"0.6190595",
"0.6131173",
"0.6119806",
"0.6084863",
"0.6063371",
"0.6046787",
"0.6038563",
"0.6031902",
"0.6006041",
"0.6001048",
"0.5946704",
"0.5930294",
"0.59243727",
"0.58269536",
"0.57891476",
... | 0.79604137 | 0 |
Split the list into N chunks with nearly equal size | def split(a, n):
k, m = divmod(len(a), n)
ret = [a[i*k+min(i, m):(i+1)*k+min(i+1, m)] for i in range(n)]
return ret | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_chunks(lst, n):\n size = int(len(lst) / n)\n output_list = []\n for i in range(0, n):\n sub_list = lst[i*size:i*size + size]\n output_list.append(sub_list)\n if len(lst) % n != 0:\n for i in range((n-1)*size+1, len(lst)):\n output_list[-1].append(lst[i])\n ret... | [
"0.8481013",
"0.841289",
"0.8344726",
"0.8324688",
"0.8320427",
"0.8300975",
"0.8290239",
"0.8290239",
"0.82838523",
"0.82808083",
"0.8261033",
"0.82479733",
"0.8246596",
"0.8239782",
"0.8235523",
"0.82307076",
"0.8216914",
"0.8216914",
"0.8216914",
"0.8216914",
"0.8216914",
... | 0.0 | -1 |
Convert the list of genre names to a list of integer codes | def genre_to_int_list(genre_string):
GENRES = ( 'Action', 'Adventure', 'Animation', 'Children', 'Comedy',\
'Crime', 'Documentary', 'Drama', 'Fantasy', 'Film-Noir', 'Horror',\
'Musical', 'Mystery', 'Romance', 'Sci-Fi', 'Thriller', 'War',\
'Western')
GENRES_LC = tuple((x.lower() for x in GENRES))... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_str_encoded_cards_to_int_encoded(cards: List[str]) -> List[int]:\n return [card_ids[card] for card in cards]",
"def genre_to_single_int(genre_string):\r\n genre_list = genre_to_int_list(genre_string)\r\n genre_code = random.choice(genre_list)\r\n return genre_code",
"def encode(self, te... | [
"0.6403545",
"0.6397784",
"0.6230419",
"0.58852553",
"0.5724964",
"0.5712142",
"0.5674078",
"0.5648342",
"0.56424886",
"0.5638062",
"0.5619171",
"0.560808",
"0.55794066",
"0.5572242",
"0.5552211",
"0.55461556",
"0.5514612",
"0.55142",
"0.5499517",
"0.54790187",
"0.5474421",
... | 0.76089114 | 0 |
It will send an email to the user who has submitted his message on contact us page, stating SetNow has recieved your email. | def send_contact_us_receipt_email(**data):
mail_file = os.path.join(APP_PATH, "templates", "main",
"contact-us-receipt", "content.txt")
with open(mail_file, "r") as f:
msg_text = f.read()
msg_html = render_template("main/contact-us-receipt/content.html")
msg = Messag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sendEmail(_name, _email, _body):\n\n _mailer = app.config['MAIL_USERNAME']\n msg = Message(\"Contact Form\", sender=('iSOLveIT Contact', f'{_mailer}'), recipients=[f'{_mailer}'])\n msg.body = f'''{_body}\n\n\nSender's Name: {_name}\nSender's Email: {_email}\nDate Sent: {dt.now(tz=GMT_tz).strftime('%B... | [
"0.7494842",
"0.73954725",
"0.7259586",
"0.7162931",
"0.7162931",
"0.7162931",
"0.7162931",
"0.7162931",
"0.7162931",
"0.7162931",
"0.7162931",
"0.71595526",
"0.7133251",
"0.70918906",
"0.7065375",
"0.7051366",
"0.6987852",
"0.69807917",
"0.6939038",
"0.69237715",
"0.6900738"... | 0.0 | -1 |
Gets the start_date of this PeriodRate. | def start_date(self):
return self._start_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_date(self):\n return self.__start_date",
"def getStartDate(self):\n return self.__startDate",
"def start_date(self) -> str:\n return pulumi.get(self, \"start_date\")",
"def start_date(self) -> str:\n return pulumi.get(self, \"start_date\")",
"def start_date(self) -> st... | [
"0.7750614",
"0.7724319",
"0.74975735",
"0.74975735",
"0.740444",
"0.727911",
"0.727911",
"0.70483065",
"0.7027903",
"0.70245194",
"0.69981235",
"0.6949999",
"0.6880805",
"0.6797683",
"0.67829543",
"0.67502046",
"0.66033673",
"0.65178883",
"0.64935154",
"0.6489378",
"0.647966... | 0.7835232 | 3 |
Sets the start_date of this PeriodRate. | def start_date(self, start_date):
if start_date is None:
raise ValueError("Invalid value for `start_date`, must not be `None`")
self._start_date = start_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_date(self, start_date):\n \n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = sta... | [
"0.82142425",
"0.81671256",
"0.81671256",
"0.81671256",
"0.81671256",
"0.81671256",
"0.81671256",
"0.81671256",
"0.81671256",
"0.81671256",
"0.8090432",
"0.7935861",
"0.790237",
"0.7676254",
"0.76486",
"0.74049854",
"0.71705866",
"0.717013",
"0.69129425",
"0.6812465",
"0.6646... | 0.80454725 | 11 |
Gets the end_date of this PeriodRate. | def end_date(self):
return self._end_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date(self):\n return self.__end_date",
"def end_date(self) -> str:\n return pulumi.get(self, \"end_date\")",
"def end_date(self) -> str:\n return pulumi.get(self, \"end_date\")",
"def end_date(self) -> str:\n return self._end_date",
"def end_date(self) -> Optional[str]:\... | [
"0.8052878",
"0.78916854",
"0.78916854",
"0.7788002",
"0.7606846",
"0.7606846",
"0.7388593",
"0.73551285",
"0.7119431",
"0.70086557",
"0.697917",
"0.68780804",
"0.6863274",
"0.67638165",
"0.67638165",
"0.6609049",
"0.65766025",
"0.65640557",
"0.65194356",
"0.6514433",
"0.6480... | 0.8119356 | 2 |
Sets the end_date of this PeriodRate. | def end_date(self, end_date):
if end_date is None:
raise ValueError("Invalid value for `end_date`, must not be `None`")
self._end_date = end_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date... | [
"0.84405595",
"0.84405595",
"0.84405595",
"0.84405595",
"0.84405595",
"0.84405595",
"0.84405595",
"0.84405595",
"0.8401752",
"0.8070054",
"0.7890985",
"0.7801233",
"0.7764807",
"0.7746387",
"0.75685936",
"0.75660414",
"0.7503813",
"0.74885947",
"0.74398005",
"0.7429233",
"0.6... | 0.81435657 | 9 |
Sets the price of this PeriodRate. Total amount in the given currency per day of this rate, formatted appropriately. For example: 194.99. | def price(self, price):
if price is None:
raise ValueError("Invalid value for `price`, must not be `None`")
self._price = price | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def price(self, value):\n self._price = Decimal(value)",
"def price(self, price: float):\n\n self._price = price",
"def price(self, price):\n\n self._price = price",
"def price(self, price):\n\n self._price = price",
"def price(self, price):\n\n self._price = price",
"d... | [
"0.7363745",
"0.6961715",
"0.68986905",
"0.68986905",
"0.68986905",
"0.68986905",
"0.68397754",
"0.6779544",
"0.6678253",
"0.6490332",
"0.6490332",
"0.63774556",
"0.62787807",
"0.62019104",
"0.6201535",
"0.60346013",
"0.5986553",
"0.593982",
"0.593982",
"0.593982",
"0.593982"... | 0.6396522 | 11 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, PeriodRate):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.80886984",
"0.80886984",
"0.8055307",
"0.7983415",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
"0.79673034",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
restore existing model from checkpoint data | def reload_checkpoint_if_exists(sess, saver, train_writer, validation_writer, test_writer):
global_step = -1
if FLAGS.continue_run:
ckpt = tf.train.get_checkpoint_state(FLAGS.checkpoint_dir)
if ckpt and ckpt.model_checkpoint_path:
# Restores from checkpoint
saver.restore(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def restore(self, checkpoint):\n raise NotImplementedError",
"def _restore(self, checkpoint):\n checkpoint_path = os.path.join(checkpoint, \"model_weights\")\n self.model.load_weights(checkpoint_path)",
"def restore(self):\n if self._restored_model:\n return\n with self.eval_graph.g... | [
"0.82485825",
"0.796376",
"0.7843921",
"0.78421044",
"0.76558834",
"0.7596436",
"0.75354093",
"0.75299984",
"0.75299454",
"0.7502393",
"0.74868834",
"0.7438636",
"0.7432705",
"0.7357649",
"0.7291689",
"0.7288314",
"0.72573495",
"0.7244296",
"0.72177184",
"0.71603024",
"0.7112... | 0.0 | -1 |
Given infection rate, batch size, prob of type II error and prob of type I error, this function gives the infection rate on the negative batch. | def infection_rate_on_negative_batch(p,batch_size,typeII_error, typeI_error):
q = 1-p
r = typeII_error * (1 - q ** batch_size)/((1 - typeI_error) * q ** batch_size + typeII_error *(1 - q**batch_size))
return p*r/(1-q**batch_size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infection_rate_on_positive_batch(p, batch_size, typeII_error, typeI_error): \n\n q = 1-p\n r = (1 - typeII_error) * (1 - q ** batch_size)/(typeI_error * q ** batch_size + (1 - typeII_error) * (1 - q **batch_size))\n return p*r/(1 - q** batch_size)",
"def infection(SIR, infection_rate, incubation_ra... | [
"0.7762854",
"0.5617929",
"0.5598052",
"0.55627394",
"0.5482425",
"0.54776",
"0.53921086",
"0.52652943",
"0.5248407",
"0.5214322",
"0.5190559",
"0.51802075",
"0.5151612",
"0.5146402",
"0.51212883",
"0.5111674",
"0.5104418",
"0.51034486",
"0.50835353",
"0.50782907",
"0.5078290... | 0.8331775 | 0 |
Given infection rate, batch size, prob of type II error and prob of type I error, this function gives the infection rate on the positive batch. | def infection_rate_on_positive_batch(p, batch_size, typeII_error, typeI_error):
q = 1-p
r = (1 - typeII_error) * (1 - q ** batch_size)/(typeI_error * q ** batch_size + (1 - typeII_error) * (1 - q **batch_size))
return p*r/(1 - q** batch_size) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def infection_rate_on_negative_batch(p,batch_size,typeII_error, typeI_error):\n q = 1-p\n r = typeII_error * (1 - q ** batch_size)/((1 - typeI_error) * q ** batch_size + typeII_error *(1 - q**batch_size))\n return p*r/(1-q**batch_size)",
"def one_batch_test_int_solver(prevalence_rate,typeII_error, typeI... | [
"0.7918529",
"0.5915895",
"0.571201",
"0.56996566",
"0.55144626",
"0.5478736",
"0.52507764",
"0.52285254",
"0.52118695",
"0.5194194",
"0.514897",
"0.5107811",
"0.5105545",
"0.5098236",
"0.5084981",
"0.5084981",
"0.50753295",
"0.5049511",
"0.50467753",
"0.5041696",
"0.5035813"... | 0.7973856 | 0 |
HEP.HEPObject.ArXivEprints Returns an array of objects containing the value corresponding to the key hepjsonrecord['metadata']['arxiv_eprints'] | def ArXivEprints(self, default=[{}]):
tmp = self.data.get('metadata', {}).get('arxiv_eprints', default)
return [HEP.ArXivObject(i) for i in tmp] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def arxiv_eprint(self):\n return get_value(self.record, \"arxiv_eprints.value[0]\")",
"def ArXivEprint(self, default=None):\n return self.data.get('arxiv_eprint', default)",
"def get_arxiv(bfo,category=\"yes\"):\n\n primary_report_numbers = bfo.fields('037__')\n additional_report_number... | [
"0.64630973",
"0.55259913",
"0.53447235",
"0.5315425",
"0.5123522",
"0.51023227",
"0.49635324",
"0.4954022",
"0.47878286",
"0.46937022",
"0.46399114",
"0.4552185",
"0.44967413",
"0.44939753",
"0.44826233",
"0.44804487",
"0.44750586",
"0.44402143",
"0.44062522",
"0.4396251",
"... | 0.765578 | 0 |
HEP.HEPObject.DesyBookkeeping Returns an array of objects containing the value corresponding to the key hepjsonrecord['metadata']['_desy_bookkeeping'] | def DesyBookkeeping(self, default=[{}]):
tmp = self.data.get('metadata', {}).get('_desy_bookkeeping', default)
return [HEP.DesyBookkeepingObject(i) for i in tmp] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_decs(self):\n return [i for i in self.decisions.keys()]",
"def get_deputies(self, flush_cache=False):\n bid = 0\n while True:\n entry = self.get_deputy(bid, flush_cache)\n if entry != {}:\n yield entry\n bid += 1",
"def DeletedRecords... | [
"0.51091325",
"0.4956099",
"0.4778483",
"0.46842393",
"0.46654856",
"0.44652015",
"0.44588634",
"0.4407001",
"0.44030765",
"0.4364127",
"0.43436027",
"0.43386763",
"0.43116006",
"0.4306483",
"0.4297046",
"0.42789653",
"0.42562807",
"0.42562807",
"0.42307097",
"0.4204485",
"0.... | 0.7226731 | 0 |
HEP.HEPObject.FacetInspireDocType Returns a string containing the value corresponding to the key hepjsonrecord['metadata']['facet_inspire_doc_type'] | def FacetInspireDocType(self, default=None):
return self.data.get('metadata', {}).get('facet_inspire_doc_type', [default]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def orcid_work_type(self):\n inspire_doc_type = get_value(self.record, \"document_type[0]\")\n return self.INSPIRE_DOCTYPE_TO_ORCID_TYPE[inspire_doc_type]",
"def DocumentType(self, default=[None]):\n return self.data.get('metadata', {}).get('document_type', default)",
"def document_typ... | [
"0.54096705",
"0.519106",
"0.5108564",
"0.5061391",
"0.5061391",
"0.5061391",
"0.5061391",
"0.5061391",
"0.4974735",
"0.49550152",
"0.49070773",
"0.49005374",
"0.48473096",
"0.4787388",
"0.47641906",
"0.475992",
"0.47450444",
"0.4729067",
"0.4705427",
"0.46774548",
"0.4658718... | 0.76018506 | 0 |
HEP.HEPObject.InspireCategories Returns an array of objects containing the value corresponding to the key hepjsonrecord['metadata']['inspire_categories'] | def InspireCategories(self, default=[{}]):
tmp = self.data.get('metadata', {}).get('inspire_categories', default)
return [HEP.InspireFieldObject(i) for i in tmp] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def categories(self):\n return self._data[\"categories\"]",
"def get_hcr_records(self):\r\n result = []\r\n for category in self.categories:\r\n result.extend(category.get_hcr_records())\r\n return result",
"def get_categories():\n categories = app.preprocessed.uniq_cate... | [
"0.5627523",
"0.5378921",
"0.5270243",
"0.5258407",
"0.5219558",
"0.51832426",
"0.5155654",
"0.51469207",
"0.5146772",
"0.51454675",
"0.51310414",
"0.5124729",
"0.512434",
"0.51103467",
"0.5104577",
"0.50789124",
"0.50622624",
"0.5054296",
"0.50426966",
"0.5035662",
"0.503071... | 0.75960416 | 0 |
HEP.HEPObject.Licenses Returns an array of objects containing the value corresponding to the key hepjsonrecord['metadata']['license'] | def Licenses(self, default=[{}]):
tmp = self.data.get('metadata', {}).get('license', default)
return [HEP.LicenseObject(i) for i in tmp] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_license_data() -> List[Mapping[str, str]]:\n output = subprocess.check_output([\"pip-licenses\", \"--format\", \"json\"])\n return json.loads(output)",
"def search_entries_license(search_license):\n returns = {}\n\n ledger_client = get_ledger_client()\n entries = ledger_client.get_ledger_e... | [
"0.67913854",
"0.6778253",
"0.6767952",
"0.6536401",
"0.63911843",
"0.6324092",
"0.61998636",
"0.61737275",
"0.6102567",
"0.58961165",
"0.5862749",
"0.58567077",
"0.5854224",
"0.5852226",
"0.5825481",
"0.5795677",
"0.57283086",
"0.56559587",
"0.56453127",
"0.56394285",
"0.563... | 0.7133877 | 0 |
HEP.HEPObject.PreprintDate Returns a string containing the value corresponding to the key hepjsonrecord['metadata']['preprint_date'] | def PreprintDate(self, default=None):
return self.data.get('metadata', {}).get('preprint_date', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hire_date(self):\n if \"hireDate\" in self._prop_dict:\n return datetime.strptime(self._prop_dict[\"hireDate\"].replace(\"Z\", \"\"), \"%Y-%m-%dT%H:%M:%S.%f\")\n else:\n return None",
"def format_date_sortkey(self, data):\n return self.input['start_date'].date().str... | [
"0.60313094",
"0.5774638",
"0.57018834",
"0.5668274",
"0.56650627",
"0.565743",
"0.5612504",
"0.5605423",
"0.5568452",
"0.5517101",
"0.54812115",
"0.5477579",
"0.54647607",
"0.5439186",
"0.5435751",
"0.5395102",
"0.536371",
"0.5335809",
"0.5311932",
"0.53085726",
"0.52765816"... | 0.7621937 | 0 |
HEP.HEPObject.Refereed Returns a boolean with the value corresponding to the key hepjsonrecord['metadata']['refereed'] | def Refereed(self, default=None):
return self.data.get('metadata', {}).get('refereed', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_reference(self, tokenized_record):\n\n return bool(set(tokenized_record).intersection(self.ref_markers))",
"def IsFlowStatLearnedInformationRefreshed(self):\n\t\treturn self._get_attribute('isFlowStatLearnedInformationRefreshed')",
"def ISREF(value):\n return isinstance(value, Record)",
"def I... | [
"0.57359123",
"0.572561",
"0.56717217",
"0.5567055",
"0.5511739",
"0.55067545",
"0.5462391",
"0.5460812",
"0.5454692",
"0.53906107",
"0.5350606",
"0.5254735",
"0.5248232",
"0.52228117",
"0.5137856",
"0.5130294",
"0.5087933",
"0.50805193",
"0.50615096",
"0.50333315",
"0.503216... | 0.6720755 | 0 |
HEP.HEPObject.References Returns an array of objects containing the value corresponding to the key hepjsonrecord['metadata']['references'] | def References(self, default=[{}]):
tmp = self.data.get('metadata', {}).get('references', default)
return [HEP.ReferenceObject(i) for i in tmp] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def references(self):\n return self.header('References', '').split()",
"def references(md5):\n u = Upload.objects.filter(md5=md5).first()\n if not u:\n abort(404)\n # first, is this searchable?\n is_searchable = False\n count = elastic.count('page', filter={'md5': md5})\n if count... | [
"0.67505085",
"0.64830774",
"0.62343276",
"0.6119095",
"0.60968447",
"0.6018825",
"0.59245414",
"0.59164673",
"0.5902145",
"0.58874375",
"0.58685356",
"0.5783092",
"0.5751134",
"0.57002884",
"0.56623894",
"0.56338125",
"0.5628534",
"0.5622246",
"0.55706495",
"0.5563987",
"0.5... | 0.73244035 | 0 |
HEP.HEPObject.Titles Returns an array of objects containing the value corresponding to the key hepjsonrecord['metadata']['titles'] | def Titles(self, default=[{}]):
tmp = self.data.get('metadata', {}).get('titles', default)
return [HEP.TitleObject(i) for i in tmp] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_titles(our_data):\n return [album['album'] for album in our_data]",
"def get_title(self):\n return [i['title'] for i in self]",
"def get_titles(filename):\n\n with open(filename) as f:\n reader = csv.DictReader(f, fieldnames = ['title', 'year'])\n titles = list(reader)\n ... | [
"0.69731784",
"0.6660475",
"0.6517752",
"0.6240427",
"0.59929657",
"0.5931605",
"0.5891732",
"0.58396065",
"0.58335537",
"0.57803214",
"0.56691855",
"0.5664142",
"0.5627286",
"0.56235963",
"0.5541569",
"0.55407566",
"0.55390805",
"0.54843134",
"0.54457885",
"0.5413636",
"0.53... | 0.7402069 | 0 |
HEP.AcquisitionSourceObject.DateTime Returns a string containing the value corresponding to the key 'datetime' | def DateTime(self, default=None):
return self.data.get('datetime', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def datetime(self):\n return self._datetime",
"def getAttrDateTime(self, e, name):\n val = e.get(name)\n dateVal = datetime.strptime(val,\"%Y-%m-%dT%H:%M:%S\")\n return dateVal.strftime(\"%Y%m%d%H%M%S\")",
"def get_date(self, datetime):\n return datetime.date()",
"def getVa... | [
"0.6618855",
"0.6593948",
"0.6345898",
"0.63304937",
"0.62663305",
"0.6230253",
"0.6201689",
"0.6195972",
"0.6165442",
"0.6101197",
"0.6056088",
"0.6051409",
"0.60270774",
"0.59836715",
"0.5903303",
"0.5893681",
"0.58897984",
"0.58897984",
"0.58897984",
"0.58897984",
"0.58784... | 0.64963645 | 2 |
HEP.AcquisitionSourceObject.Email Returns a string containing the value corresponding to the key 'email' | def Email(self, default=None):
return self.data.get('email', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email(self):\n return self._dict.get('email')",
"def get_email(self):\n return self.reference[REF_EMAIL_ADDRESS][REF_VALUE]",
"def email(self) -> str:\n return pulumi.get(self, \"email\")",
"def email(self) -> str:\n return pulumi.get(self, \"email\")",
"def email(self) -> s... | [
"0.7775586",
"0.74331504",
"0.73852754",
"0.73852754",
"0.73852754",
"0.727929",
"0.72407115",
"0.723567",
"0.723049",
"0.7180283",
"0.7173625",
"0.7173625",
"0.7173625",
"0.7173625",
"0.71301746",
"0.71301746",
"0.71301746",
"0.71301746",
"0.71193135",
"0.7118403",
"0.710112... | 0.71445435 | 14 |
HEP.AcquisitionSourceObject.InternalUID Returns an integer containing the value corresponding to the key 'internal_uid' | def InternalUID(self, default=None):
return self.data.get('internal_uid', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def internal_id(self) -> str:\n return pulumi.get(self, \"internal_id\")",
"def uid(self):\n return self.primary_header['WOD unique cast number']",
"def uid(self):\n return self._serial_number",
"def uid(self):\n return safeInt(self.tag(\"uid\"))",
"def UID(self):\r\n ret... | [
"0.69356",
"0.659793",
"0.65299076",
"0.6460804",
"0.62395644",
"0.62395644",
"0.6188592",
"0.61584574",
"0.61584574",
"0.61481893",
"0.6146356",
"0.61257243",
"0.61108047",
"0.6099596",
"0.6099596",
"0.6099596",
"0.6044039",
"0.60074586",
"0.6001655",
"0.5973609",
"0.5946206... | 0.7566943 | 0 |
HEP.AuthorObject.FullName Returns a string containing the value corresponding to the key 'full_name' | def FullName(self, default=None):
return self.data.get('full_name', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_author_full_name(self, obj):\n return obj.author.get_full_name()",
"def author(self):\n return self._data.get('author', None)",
"def fullname(self):\n return self._fullname",
"def author(self) -> str:\n return pulumi.get(self, \"author\")",
"def full_name(self, obj: User... | [
"0.78495353",
"0.67774147",
"0.67648214",
"0.6725801",
"0.6700805",
"0.6659894",
"0.6645326",
"0.66049576",
"0.65991074",
"0.6595552",
"0.6590049",
"0.6561302",
"0.6558688",
"0.65500927",
"0.65040356",
"0.6494583",
"0.64762235",
"0.64701617",
"0.64645475",
"0.64550847",
"0.64... | 0.6632088 | 8 |
HEP.AuthorObject.UUID Returns a string containing the value corresponding to the key 'uuid' | def UUID(self, default=None):
return self.data.get('uuid', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uuid(self) -> str:\n return self.obj.uuid",
"async def uuid(self) -> str:\n if not hasattr(self, \"_uuid\"):\n result = await self.app.sparql.query(\"\"\"\n SELECT DISTINCT ?o\n WHERE {\n <{{uri}}> <http://mu.semte.ch/vocabularies/core... | [
"0.7221311",
"0.69545937",
"0.6940428",
"0.68965477",
"0.68965477",
"0.68672734",
"0.68672734",
"0.6843015",
"0.68292296",
"0.68292296",
"0.68292296",
"0.68281937",
"0.6698646",
"0.6696938",
"0.6648542",
"0.6537761",
"0.65277475",
"0.65044075",
"0.64666456",
"0.64367855",
"0.... | 0.6674247 | 14 |
HEP.AuthorReducedObject.FullName Returns a string containing the value corresponding to the key 'full_name' | def FullName(self, default=None):
return self.data.get('full_name', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_author_full_name(self, obj):\n return obj.author.get_full_name()",
"def fullname(self):\n return self._fullname",
"def full_name(self):\n return self._full_name",
"def get_full_name(self):\n return self.name #self is base and it hits name filed",
"def _get_full_name(self... | [
"0.72891766",
"0.68866104",
"0.68294305",
"0.67879933",
"0.6730877",
"0.6686969",
"0.6658905",
"0.665852",
"0.66491145",
"0.662785",
"0.6610362",
"0.6604774",
"0.6560567",
"0.6560567",
"0.6560567",
"0.6560567",
"0.6560567",
"0.65028745",
"0.64968324",
"0.6494608",
"0.6487535"... | 0.665415 | 8 |
HEP.DesyBookkeepingObject.Expert Returns a string containing the value corresponding to the key 'expert' | def Expert(self, default=None):
return self.data.get('expert', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_expertise(self, user):\r\n if user.is_anonymous():\r\n return OI_SCORE_ANONYMOUS\r\n \r\n # Non expert and anonymous have the same score\r\n expertise = OI_SCORE_ANONYMOUS\r\n if self.is_expert(user):\r\n expertise = self.expert_set.filter(user=u... | [
"0.5762847",
"0.5522898",
"0.5512231",
"0.5320352",
"0.5282986",
"0.5271331",
"0.5264249",
"0.5217158",
"0.52130574",
"0.5177951",
"0.51694494",
"0.5064532",
"0.5051328",
"0.50347435",
"0.5001117",
"0.49892867",
"0.4966019",
"0.49454343",
"0.492891",
"0.4921074",
"0.4896501",... | 0.7702544 | 0 |
HEP.DesyBookkeepingObject.Status Returns a string containing the value corresponding to the key 'status' | def Status(self, default=None):
return self.data.get('status', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status(self):\n return status_dict[self._get_property_(self.STATUS).upper()]",
"def status(self):\n return STATUS[self.fields['status']]",
"def status(self):\n return self.get(self._names[\"status\"])",
"def status(self):\n return self._data['status']",
"def status(self) -> ... | [
"0.81825423",
"0.81317794",
"0.8031374",
"0.7942066",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
"0.78121203",
... | 0.0 | -1 |
HEP.InstitutionObject.Name Returns a string containing the value corresponding to the key 'name' | def Name(self, default=None):
return self.data.get('name', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\r\n return self._data['name']",
"def name(self):\r\n return self.data[\"name\"]",
"def name(self):\n return self[\"name\"]",
"def name(self) -> str:\n\t\treturn self._raw_result['name']",
"def name(self) -> str:\n return self.data['name']",
"def name(self):\n ... | [
"0.7269371",
"0.7207271",
"0.71607244",
"0.71107453",
"0.70954955",
"0.69867927",
"0.69867927",
"0.69809985",
"0.6918064",
"0.6918064",
"0.6887361",
"0.686778",
"0.68400216",
"0.68400216",
"0.68400216",
"0.68400216",
"0.68400216",
"0.68400216",
"0.68400216",
"0.68400216",
"0.... | 0.0 | -1 |
HEP.PublicationInfoObject.ConfAcronym Returns a string containing the value corresponding to the key 'conf_acronym' | def ConfAcronym(self, default=None):
return self.data.get('conf_acronym', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __title(self, conf):\n return conf[\"conf_json\"][0][\"title\"]",
"def get_abbreviation(res_type, abbr):\n\treturn get_settings_resource(res_type, abbr, 'abbreviations')",
"def abbreviation(self):\n return self._abbreviation",
"def abbreviation(self):\n\n return self._abbreviation",
... | [
"0.6278628",
"0.6041024",
"0.57378703",
"0.56934905",
"0.55002725",
"0.54936796",
"0.53631675",
"0.5289115",
"0.5236102",
"0.52015615",
"0.5143907",
"0.5133274",
"0.5080298",
"0.50757605",
"0.5066578",
"0.50488317",
"0.5038925",
"0.5010426",
"0.5007651",
"0.49840906",
"0.4974... | 0.8273445 | 0 |
HEP.PublicationInfoObject.PageEnd Returns a string containing the value corresponding to the key 'page_end' | def PageEnd(self, default=None):
return self.data.get('page_end', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def EndPage(*args, **kwargs):\n return _gdi_.DC_EndPage(*args, **kwargs)",
"def page_end(self):\n self._npos = self._npages - 1\n self.display()",
"def EndPage(*args, **kwargs):\n return _gdi_.GraphicsContext_EndPage(*args, **kwargs)",
"def page_end(self):\n self._pos = sel... | [
"0.67006034",
"0.6316095",
"0.618355",
"0.6100649",
"0.60963905",
"0.60948616",
"0.6071321",
"0.6033795",
"0.6023109",
"0.5964854",
"0.5944876",
"0.59259486",
"0.58685243",
"0.5689284",
"0.5689284",
"0.56847113",
"0.5671886",
"0.56716466",
"0.56069094",
"0.55284005",
"0.55103... | 0.7654513 | 0 |
HEP.PublicationInfoObject.ParentReportNumber Returns a string containing the value corresponding to the key 'parent_report_number' | def ParentReportNumber(self, default=None):
return self.data.get('parent_report_number', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_parent_series_identifier(self) -> str:\n return self.get_main_information()['ParentSeries']",
"def parent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"parent_id\")",
"def parent_id(self) -> str:\n return self._db_data.parent_id",
"def get_trace_parent(self):\n ... | [
"0.63374156",
"0.63271445",
"0.62883013",
"0.6263952",
"0.6166895",
"0.61415005",
"0.60410494",
"0.60410494",
"0.58790886",
"0.58753693",
"0.58378696",
"0.5831786",
"0.5831786",
"0.5816412",
"0.5815797",
"0.5783323",
"0.57631063",
"0.5756111",
"0.5716508",
"0.5716508",
"0.569... | 0.8407407 | 0 |
HEP.PublicationInfoReducedObject.PageEnd Returns a string containing the value corresponding to the key 'page_end' | def PageEnd(self, default=None):
return self.data.get('page_end', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def EndPage(*args, **kwargs):\n return _gdi_.DC_EndPage(*args, **kwargs)",
"def page_end(self):\n self._npos = self._npages - 1\n self.display()",
"def _get_end(self):\n return self._end",
"def end(self):\n if \"end\" in self._prop_dict:\n if isinstance(self._pro... | [
"0.6591041",
"0.6220588",
"0.61138195",
"0.60784376",
"0.60633093",
"0.6049796",
"0.60415643",
"0.5976694",
"0.5968001",
"0.5963182",
"0.59498703",
"0.5947582",
"0.5910956",
"0.5789145",
"0.5705437",
"0.5635539",
"0.56240124",
"0.56240124",
"0.56161666",
"0.5550527",
"0.55480... | 0.75416845 | 1 |
HEP.RecordFile.Bucket Returns a string containing the value corresponding to the key 'bucket' | def Bucket(self, default=None):
return self.data.get('bucket', default) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bucket(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"bucket\")",
"def bucket(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"bucket\")",
"def bucket_name(self) -> str:\n return self._values.get('bucket_name')",
"def bucket(self) -> pulumi.Input[str]:\n retu... | [
"0.79568624",
"0.79568624",
"0.75529927",
"0.7535211",
"0.7535211",
"0.7535211",
"0.7535211",
"0.7535211",
"0.74644256",
"0.74644256",
"0.7430683",
"0.7430683",
"0.732821",
"0.7325701",
"0.7279994",
"0.7222",
"0.72127545",
"0.7181015",
"0.71588564",
"0.71588564",
"0.7135984",... | 0.7197918 | 17 |
HEP.ReferenceHEPObject.DocumentType Returns a string containing the value corresponding to the key 'document_type' | def DocumentType(self, default='article'):
return self.data.get('document_type', [{}]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DocumentType(self, default=[None]):\n return self.data.get('metadata', {}).get('document_type', default)",
"def document_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"document_type\")",
"def _getDocumentType(self):\n\n fileName, fileExtension = os.path.spli... | [
"0.76880777",
"0.7638122",
"0.73682964",
"0.66018033",
"0.6591659",
"0.64802676",
"0.6420454",
"0.63653225",
"0.63532454",
"0.63532454",
"0.63532454",
"0.63532454",
"0.63532454",
"0.6344297",
"0.6272494",
"0.6272494",
"0.6272494",
"0.6272494",
"0.6272494",
"0.6272494",
"0.627... | 0.7354911 | 3 |
HEP.ReferenceObject.Reference Returns an object containing the value corresponding to the key 'reference' | def Reference(self, default={}):
return HEP.ReferenceHEPObject(self.data.get('reference', default)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_reference(self):\t\t\n\t\treturn self._reference",
"def Get_Reference_Value(self):\r\n return self.__readFromRegister(self.__REG_RW_REFERENCE, 0xff)",
"def _reference(self):\r\n return {1:2, \"key1\":\"value1\", \"key2\":(1,2,3)}",
"def get_actual_ref(self, ref):\n while ref in s... | [
"0.7273775",
"0.70435184",
"0.6954945",
"0.69208664",
"0.689753",
"0.680626",
"0.680626",
"0.6803598",
"0.6390596",
"0.6275421",
"0.62331754",
"0.6206865",
"0.6201469",
"0.6154476",
"0.61456776",
"0.614438",
"0.60001075",
"0.5976887",
"0.59592986",
"0.5945731",
"0.5938286",
... | 0.7524643 | 0 |
Extract features from a sentence represented as a list of words. Includes a flag add_to_indexer to | def extract_features(self, ex_words: List[str], add_to_indexer: bool=False) -> List[int]:
raise Exception("Don't call me, call my subclasses") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_features(self, ex_words: List[str], add_to_indexer: bool) -> List[int]:\n raise Exception(\"Don't call me, call my subclasses\")",
"def _sentence_to_features(self,sentence):\n\n configured_features = self.configFeatures\n sentence_features = []\n\n for word_idx in range(le... | [
"0.73981774",
"0.70589924",
"0.6698269",
"0.6627903",
"0.6610931",
"0.65845233",
"0.6555251",
"0.65412",
"0.65121424",
"0.64885664",
"0.64870423",
"0.6476021",
"0.647495",
"0.6448333",
"0.6411864",
"0.6353861",
"0.63180214",
"0.6317946",
"0.62816715",
"0.62767404",
"0.6273300... | 0.7379542 | 1 |
Get the PHP version number. | def get_php_version(self) -> dict:
uri = f"{self.uri}/"
response = self.request(uri=uri)
env_config = response.json()
return {'php_version': env_config['configuration']['php']['version']} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version_number() -> int:\n return 0",
"def get_version():\n return 1",
"def version():\n return '%d.%d' % (sys.version_info[0], sys.version_info[1])",
"def get_version():\r\n return __version__",
"def phpversion(interp, ext=None):\n if ext:\n return interp.space.w_False\n retur... | [
"0.7549596",
"0.7539556",
"0.7427166",
"0.7424961",
"0.7415291",
"0.7345674",
"0.7345674",
"0.7345674",
"0.73090196",
"0.72999346",
"0.7292751",
"0.7290842",
"0.7290842",
"0.7227754",
"0.7218423",
"0.7205149",
"0.7170386",
"0.7160577",
"0.7153675",
"0.7128294",
"0.70863354",
... | 0.7571268 | 0 |
cumulative bivariate standard normal distribution | def N2_f(d1,d2,rho):
import statsmodels.sandbox.distributions.extras as extras
muStandardNormal=0.0 # mean of a standard normal distribution
varStandardNormal=1.0 # variance of standard normal distribution
upper=([d1,d2]) # upper bound for two values
v=varStandardNormal # simplify... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cumulative_normal_distribution(z):\n from math import exp\n\n b1 = +0.319381530\n b2 = -0.356563782\n b3 = +1.781477937\n b4 = -1.821255978\n b5 = +1.330274429\n p = +0.2316419\n c = +0.39894228\n\n if z >= 0.0:\n t = 1.0 / (1.0 + p * z)\n return 1.0 - c * exp(-z * z / ... | [
"0.7586025",
"0.7051234",
"0.69057137",
"0.6856838",
"0.6717602",
"0.6679886",
"0.65551955",
"0.65118706",
"0.64714265",
"0.6382627",
"0.6380812",
"0.63332224",
"0.6331732",
"0.6306447",
"0.627971",
"0.62638915",
"0.62557536",
"0.62557536",
"0.62557536",
"0.62557536",
"0.6255... | 0.5934698 | 45 |
Returns an abbreviated name of 'length' characters | def shortName(self, length = 3):
if len(self.short) == length: return self.short
s = str(self)
if len(s) < length:
self.short = s + " "*(length-len(s))
return self.short
r = []; alphaNum = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
for ch in s:
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_random_name(length):\n name = (''.join(random.choices(string.ascii_lowercase, k=length)))\n name_capitalized = name.capitalize()\n return name_capitalized",
"def abbreviator(max_length):\n \n def abbreviate(text):\n if len(text) <= max_length:\n return text\n el... | [
"0.75804824",
"0.74979955",
"0.7122115",
"0.7101127",
"0.7090305",
"0.707713",
"0.70266324",
"0.69452465",
"0.6944599",
"0.68276674",
"0.68134385",
"0.6804719",
"0.67037725",
"0.66839355",
"0.6628737",
"0.6542777",
"0.65067285",
"0.64929587",
"0.6487084",
"0.6484433",
"0.6481... | 0.78075564 | 0 |
Test invalid input type of char. Invalid | def test_get_squarerectangle_char(self):
result = get_squarerectangle_type('A', 'A', 'A', 'A')
self.assertEqual(result, 'invalid') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_input_valid(char):\n\n # is there a char at all?\n if char is None:\n return False\n\n # check for embedded 0 byte\n if char == \"\\0\":\n return False\n\n return True",
"def is_char(user_input):\n # Check lenght of input and if equal to zero return True\n if len(user_in... | [
"0.77894497",
"0.74047905",
"0.73173815",
"0.7316064",
"0.7114759",
"0.7083789",
"0.6901848",
"0.6734456",
"0.6697887",
"0.66435784",
"0.6636018",
"0.66344243",
"0.6617422",
"0.661457",
"0.66034985",
"0.6581647",
"0.6570918",
"0.65695614",
"0.6565621",
"0.6546016",
"0.6506755... | 0.5946828 | 83 |
Check for rectangle return. In sides. | def test_get_sqrrect_rect_all_int(self):
result = get_squarerectangle_type(1, 2, 1, 2)
self.assertEqual(result, 'rectangle') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inside_rectangle(self, x, y):\n if (self.pos.x - self.width < x < self.pos.x + self.width and\n self.pos.y - self.height < y < self.pos.y + self.height):\n return True",
"def in_rectangle(x, y):\n return ((self.min_x <= x <= self.max_x) and\n (se... | [
"0.7438624",
"0.72407365",
"0.70488906",
"0.6972503",
"0.68300915",
"0.6793567",
"0.67255056",
"0.67100924",
"0.6670065",
"0.6662908",
"0.66099846",
"0.66016006",
"0.6578844",
"0.6569403",
"0.6563947",
"0.65634966",
"0.6560435",
"0.6542578",
"0.6526674",
"0.65054345",
"0.6501... | 0.6238892 | 37 |
The /about/ page should load without errors. | def test_about(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_59_about(self):\r\n url = \"/about\"\r\n res = self.app.get(url, follow_redirects=True)\r\n err_msg = \"There should be an about page\"\r\n assert \"About\" in res.data, err_msg",
"def test_aboutpage_view(self):\n response = self.client.get(url_for('about'))\n s... | [
"0.8089778",
"0.80485237",
"0.7921579",
"0.7809068",
"0.7783226",
"0.77823067",
"0.7755425",
"0.77472955",
"0.7701709",
"0.76700467",
"0.75427705",
"0.7441477",
"0.73972833",
"0.7373095",
"0.73429656",
"0.73356056",
"0.733354",
"0.73108083",
"0.7306286",
"0.73058784",
"0.7284... | 0.7722519 | 8 |
Takes a function as an input with a specific interval xrange then creates a list with the output ypoints. Inefficient, but useful if f is a simple math function not involving NumPy. | def create_graph_from_lambda(f, xrange):
out = []
for x in xrange:
out.append(f(x))
return out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rectangular_integral(f, xrange, intervals):\n int_out = 0\n delta_x = (max(xrange)-min(xrange))/intervals\n new_xrange = np.linspace(min(xrange), max(xrange), intervals)\n for x in new_xrange:\n int_out += f(x)\n return delta_x*int_out",
"def eulers_method(f, y, dx, range):\n x = min... | [
"0.6254834",
"0.6225927",
"0.61627483",
"0.6153063",
"0.60484535",
"0.59041905",
"0.58831155",
"0.5853075",
"0.57472736",
"0.5692097",
"0.5643448",
"0.5626075",
"0.56205726",
"0.557112",
"0.5553055",
"0.5502757",
"0.54955226",
"0.5494875",
"0.549164",
"0.5477244",
"0.5451032"... | 0.6330015 | 0 |
A utility function to extract a number of elements from a list, leaving only a certain subset. Generates a new list with just the subset. Creates the subset by specifying a subinterval. | def build_extracted_list(input_list, subinterval):
out = []
wait = subinterval
for i in input_list:
if wait == subinterval:
out.append(i)
wait = 0
else:
wait += 1
return out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subset_of_list(alist, n, t):\n if t < 1 or t > n:\n raise Exception(f't={t} is not accept, must be 1-N (include)')\n\n if n > len(alist): # if n is bigger than all list, return only 1 for t<=len\n if t <= len(alist):\n return [alist[t - 1]]\n else:\n return Non... | [
"0.6790797",
"0.6710092",
"0.6515985",
"0.64593947",
"0.6434004",
"0.63437176",
"0.6251503",
"0.61566764",
"0.6126565",
"0.60856795",
"0.60283417",
"0.5995044",
"0.5991604",
"0.5977968",
"0.5921676",
"0.58842266",
"0.58739257",
"0.5863565",
"0.5848513",
"0.5848513",
"0.584435... | 0.67208046 | 1 |
Contextualize the embeddings for each sentence in the batch. The method takes on input a list of tensors with shape N x , where N is the dynamic sentence length (i.e. can be different for each sentence) and is any number of trailing dimensions, including zero, the same for each sentence. Returns a packed sequence. | def pack_forward(self, batch: Sequence[Tensor]) -> rnn.PackedSequence:
# Pack sentence vectors as a packed sequence
packed_batch = rnn.pack_sequence(batch, enforce_sorted=False)
# Apply LSTM to the packed sequence of word embeddings
packed_hidden, _ = self.net(packed_batch)
# ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def batch_gen():\n i = 0\n while len(all_sentences) - i >= batch_size:\n # TODO this is a mess...\n yield np.stack([\n np.pad(\n np.stack(\n [embeddings[id]\n for id in sentence[:max_sentence_length]]), [[\n ... | [
"0.7096154",
"0.68323",
"0.67534053",
"0.66842335",
"0.6608237",
"0.6573804",
"0.656693",
"0.6534448",
"0.65245944",
"0.65072984",
"0.65072984",
"0.6496808",
"0.6484693",
"0.64245284",
"0.6368144",
"0.63452065",
"0.6320503",
"0.62688565",
"0.6266823",
"0.6264502",
"0.62633324... | 0.61215734 | 29 |
Given a limit n and a base i, finds the largest exponenet x such that i ^ x <= n, and outputs i ^ x. | def largest_exponent(i, n):
x = 1
while i ** x <= n:
x += 1
x -= 1
print(i, x, i**x)
return i ** x | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_invpow(x,n):\n high = 1\n while high ** n <= x:\n high *= 2\n low = high//2\n while low < high:\n mid = (low + high) // 2\n if low < mid and mid**n < x:\n low = mid\n elif high > mid and mid**n > x:\n high = mid\n else:\n retu... | [
"0.7478714",
"0.70266604",
"0.69531524",
"0.6952391",
"0.690052",
"0.6833335",
"0.68218166",
"0.6819668",
"0.67383224",
"0.67011136",
"0.6691567",
"0.6675349",
"0.66352636",
"0.66227996",
"0.6592241",
"0.65889907",
"0.65585876",
"0.65553004",
"0.6512691",
"0.650253",
"0.64945... | 0.84001577 | 0 |
Helper internal method Returns true if we can change an ace from 11 to 1 | def can_we_change_ace():
return s + Deck.ace.value[0] > 21 and added_ace_11 is True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid(self, move):\r\n return move > 10 and move < 89",
"async def check_if_ace(self, card_id, user_id):\n aces = [\"1\", \"14\", \"27\", \"40\"]\n aces_used = await self.get_aces_used(user_id)\n if card_id in aces and card_id not in aces_used:\n aces_used.append(car... | [
"0.6094384",
"0.60785514",
"0.5930625",
"0.58261675",
"0.5800911",
"0.5800619",
"0.5791715",
"0.5791715",
"0.57459867",
"0.5739205",
"0.5736245",
"0.5553645",
"0.5552876",
"0.54749244",
"0.5473795",
"0.5460854",
"0.5451095",
"0.54336375",
"0.5414767",
"0.5380428",
"0.5378753"... | 0.83195096 | 0 |
This function retrieves all headlines from the search retrieved by driver. Driver must be preassigned and opened using return_search. Driver is quit after each iteration. Returns list of headlines. | def get_headlines(driver,site,URL_exclusions):
links = get_all_links(driver,site,URL_exclusions)
headlines = []
n=0
for link in links:
driver = make_driver_obj() #get_all_links quits driver when finished.
try:
while True:
try:
driv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_headlines_from_chrome(site,URL_exclusions):\r\n headlines = []\r\n #Initial URL to pass to return search:\r\n URL = f'https://www.google.co.uk/search?hl=en&as_q=&as_epq=&as_oq=travellers&as_eq=quarantine+travel+train+flight+tourist+archive+airport+covid+coronavirus+hotel+holiday+honeymoon&as_n... | [
"0.6978888",
"0.6910584",
"0.68847805",
"0.67749083",
"0.67393386",
"0.6650136",
"0.64237565",
"0.6305853",
"0.623097",
"0.60405976",
"0.60342515",
"0.6029556",
"0.5988117",
"0.5936789",
"0.588422",
"0.58221924",
"0.57586926",
"0.5722062",
"0.55517155",
"0.54750264",
"0.54740... | 0.7840066 | 0 |
Remove any headlines containing exclusionary words. | def remove_false_positives(headlines,exclusions):
for headline in headlines:
for word in exclusions:
if headline.lower().find(word) != -1: #If headline contains exclusionary word.
headlines.remove(headline)
break
return headlines | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_words(headlines,removal_words):\r\n for i in range(len(headlines)):\r\n for word in removal_words:\r\n headline = headlines[i].lower()\r\n pos = headline.find(word) #Find start position of word we want to remove\r\n if pos != -1:\r\n end_pos = po... | [
"0.6898035",
"0.6308071",
"0.6282704",
"0.6278832",
"0.6195218",
"0.61710405",
"0.61693",
"0.6155328",
"0.6143628",
"0.61322665",
"0.61201805",
"0.6117586",
"0.6110899",
"0.60415274",
"0.6002611",
"0.59911555",
"0.59448016",
"0.5941849",
"0.59299976",
"0.5922946",
"0.59214836... | 0.8346897 | 0 |
Extract negative headlines that include negative words. Inputs are get_headlines() data and words (list of strings). Returns list of headlines with negative words. | def get_negative_headlines(headlines,words):
negative_headlines = []
for headline in headlines:
for word in words:
if headline.lower().find(word) != -1: #If particular word is found in lowercased headline.
negative_headlines.append(headline)
break #Stop ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def negative_words(data):\n\n # English version: negative words\n def english_negative_words(data):\n def negative_count(post):\n sid = SentimentIntensityAnalyzer()\n neg_word_num = 0\n post = re.findall(r\"\\b\\w[\\w-]*\\b\", post.lower())\n for word in pos... | [
"0.6349977",
"0.6246985",
"0.60577476",
"0.6012407",
"0.58237606",
"0.5745377",
"0.56684536",
"0.56411093",
"0.55823076",
"0.5574541",
"0.55741763",
"0.55665135",
"0.5555391",
"0.55446666",
"0.55446666",
"0.55446666",
"0.55446666",
"0.55249596",
"0.55183995",
"0.54977405",
"0... | 0.84599596 | 0 |
Remove any word in removal_words that is found in each headline in headlines. This is so words like "Travellers" don't appear in the word map. Returns motified headlines. | def remove_words(headlines,removal_words):
for i in range(len(headlines)):
for word in removal_words:
headline = headlines[i].lower()
pos = headline.find(word) #Find start position of word we want to remove
if pos != -1:
end_pos = pos + len(word) #En... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_false_positives(headlines,exclusions):\r\n for headline in headlines:\r\n for word in exclusions:\r\n if headline.lower().find(word) != -1: #If headline contains exclusionary word.\r\n headlines.remove(headline)\r\n break\r\n return headlines",
"de... | [
"0.68523985",
"0.62996805",
"0.60364926",
"0.60330814",
"0.5940642",
"0.5798099",
"0.5783394",
"0.5638929",
"0.56381005",
"0.5637393",
"0.56209046",
"0.56119895",
"0.5610772",
"0.56091326",
"0.5600459",
"0.557791",
"0.5572793",
"0.55641764",
"0.5547571",
"0.5525597",
"0.55246... | 0.7614397 | 0 |
Pushes the given `probabilities` and actions through all our distributions' `log_prob` APImethods and returns a DataOpDict with the keys corresponding to our `action_space`. | def _graph_fn_get_distribution_log_probs(self, key, parameters, actions):
# For bounded continuous action spaces, need to unscale (0.0 to 1.0 for beta distribution).
if self.bounded_action_space[key] is True:
actions = (actions - self.action_space.low) / (self.action_space.high - self.action... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_policy_log_probs(available_actions, policy, actions):\n def compute_log_probs(probs, labels):\n # Select arbitrary element for unused arguments (log probs will be masked)\n labels = tf.maximum(labels, 0)\n indices = tf.stack([tf.range(tf.shape(labels)[0]), labels], axis=1)\n ... | [
"0.6406205",
"0.6391938",
"0.6010136",
"0.60094225",
"0.59739757",
"0.5837162",
"0.5815365",
"0.5763777",
"0.57014436",
"0.56229717",
"0.5579087",
"0.55518055",
"0.5526341",
"0.5520606",
"0.5519371",
"0.54951334",
"0.5416847",
"0.5384665",
"0.5314357",
"0.5287201",
"0.5237028... | 0.6144919 | 2 |
Initialise each parameter in each buckingham potential. | def __init__(self, labels, atom_type_index, a, rho, c):
if not isinstance(labels, list) or not all(isinstance(label, str) for label in labels) or len(labels) !=2:
raise TypeError('labels should be a list of atoms in the potential. Each of the TWO items should be a string.')
if not i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_paramters(self):\r\n carb_bg_ratio = 5.0\r\n time_to_breakdown = 45.0\r\n insulin_bg_ratio = 50.0\r\n time_to_peak = 45.0\r\n basal_rate = 0.0\r\n digestion_speed = 1.0\r\n activation_speed = 1.0\r\n\r\n # set state to initial\r\n self.S = [se... | [
"0.7096628",
"0.6981636",
"0.69252807",
"0.6839191",
"0.6815761",
"0.68155384",
"0.68124574",
"0.67702335",
"0.67602503",
"0.67524904",
"0.6712717",
"0.66752195",
"0.6651205",
"0.66464245",
"0.6615348",
"0.6594098",
"0.6584151",
"0.6570735",
"0.6475891",
"0.6469922",
"0.64680... | 0.0 | -1 |
Returns a dictionary containing the parameters in the nondimensionalised GPE, and a few other useful parameters, such as Pth. Mostly used for calling GPESolver. | def getGPEParams(self):
outKeysScaleDouble = ['R', 'gamma_C', 'gamma_R', 'g_C', 'g_R', 'k',
'Pth']
outKeysScaleSingle = outKeysScaleDouble + ['gamma_nl']
outKeysScale = outKeysScaleSingle if self.singleComp else\
outKeysScaleDouble
outKeys = ['ch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_params(self) -> Dict:\n params: Dict = {}\n params['g_leak'] = self.leak.get_g()\n params['g_kvhh'] = self.kvhh.get_g()\n params['g_cav'] = self.cav.get_g()\n params['g_kca'] = self.kca.get_g()\n params['g_nap'] = self.nap.get_g()\n params['t_ca'] = self.tau... | [
"0.6891663",
"0.6820562",
"0.67836195",
"0.66519386",
"0.6642077",
"0.66392636",
"0.65458584",
"0.64959824",
"0.64930344",
"0.64397085",
"0.6432674",
"0.63287413",
"0.63178825",
"0.63002235",
"0.6293422",
"0.6290222",
"0.6281099",
"0.62171054",
"0.6194312",
"0.6159477",
"0.61... | 0.704199 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.