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 |
|---|---|---|---|---|---|---|
Creates a new MetaInfo object for a reply to the message containing this MetaInfo instance. | def reply(self, timestamp):
return MetaInfo(self.target, self.source, timestamp) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_reply(self):\n return MessageCreateReplyRequestBuilder(self.append_to_request_url(\"createReply\"), self._client)",
"def create_reply(self,\n source=None,\n to=None,\n previous_hop=None,\n next_hop=None,\n ... | [
"0.6456526",
"0.628657",
"0.61125267",
"0.60335016",
"0.5821395",
"0.5732767",
"0.57026815",
"0.56157696",
"0.54840016",
"0.53782415",
"0.5349397",
"0.53365403",
"0.5321292",
"0.52362007",
"0.5226336",
"0.5220253",
"0.5181559",
"0.5174374",
"0.5165728",
"0.51612043",
"0.51596... | 0.72604454 | 0 |
SETUP funcion for TestUser class, this function is executed for each function in this TestClass | def setup(self, session):
user_types = []
user_types.append(UserType("ADMIN", 2))
user_types.append(UserType("GUEST", 0))
user_types.append(UserType("USER", 1))
user_type_db = UserType.query.all()
for user in user_type_db:
for seedUser in user_types... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n self.user_1 = User()",
"def setUpClass(cls):\n cls.ins = User()",
"def setUpClass(cls):\n cls.user = User()\n cls.user.first_name = \"Kev\"\n cls.user.last_name = \"Yo\"\n cls.user.email = \"1234@yahoo.com\"\n cls.storage = db_storage()",
"d... | [
"0.8078728",
"0.80658495",
"0.80610627",
"0.7916541",
"0.7902837",
"0.789154",
"0.78752875",
"0.78639704",
"0.7848155",
"0.7830282",
"0.78217167",
"0.7819956",
"0.7800205",
"0.7772404",
"0.7753675",
"0.7753675",
"0.7744824",
"0.7694",
"0.7690794",
"0.7676174",
"0.7667984",
... | 0.0 | -1 |
Return the total receptive field of this model as of frames. | def receptive_field(self):
frames = 0
for f in self.pad:
frames += f
return 1 + 2 * frames | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def receptive_field(self):\n return self.LocalLayer_Torso.receptive_field()",
"def total_rewards(self) -> float:\n return self.__total_rewards",
"def fields(self):\n return (self._total + self._mean + self._variance\n + self._skew + self._kurtosis)",
"def patrimony_total(self)... | [
"0.6807186",
"0.6247257",
"0.6151634",
"0.6062826",
"0.60195196",
"0.60095304",
"0.6005246",
"0.5999161",
"0.5976631",
"0.5976631",
"0.5976631",
"0.5976631",
"0.5954339",
"0.5918959",
"0.590753",
"0.589701",
"0.5859162",
"0.5844734",
"0.5844734",
"0.5828635",
"0.5827173",
"... | 0.70493305 | 1 |
Rotate vector(s) v about the rotation described by quaternion(s) q. Expects a tensor of shape (, 4) for q and a tensor of shape (, 3) for v, where denotes any number of dimensions. Returns a tensor of shape (, 3). | def qrot(q, v):
assert q.shape[-1] == 4
assert v.shape[-1] == 3
assert q.shape[:-1] == v.shape[:-1]
qvec = q[..., 1:]
uv = torch.cross(qvec.double(), v.double(), dim=len(q.shape) - 1)
uuv = torch.cross(qvec.double(), uv.double(), dim=len(q.shape) - 1)
return v + 2 * (q[..., :1] * uv + uuv) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def qrot(q, v):\n assert q.shape[-1] == 4\n assert v.shape[-1] == 3\n assert q.shape[:-1] == v.shape[:-1]\n\n original_shape = v.shape\n q = q.view(-1, 4)\n v = v.view(-1, 3)\n\n qvec = q[:, 1:]\n uv = torch.cross(qvec, v, dim=1)\n uuv = torch.cross(qvec, uv, dim=1)\n return (v + 2 * ... | [
"0.8495045",
"0.78478664",
"0.77880514",
"0.77639997",
"0.77639997",
"0.7758006",
"0.7711432",
"0.7691805",
"0.75344366",
"0.72165096",
"0.70153165",
"0.6899906",
"0.68904066",
"0.6864454",
"0.6851497",
"0.68470275",
"0.6750625",
"0.6738028",
"0.670181",
"0.6637706",
"0.66250... | 0.85507977 | 0 |
Returns the value to which the specified key is mapped, or 1 if this map contains no mapping for the key | def get(self, key: int) -> int:
idx = key % self.size
curr = self.hashmap[idx]
while curr:
if curr.key == key:
return curr.value
else:
curr = curr.next
return -1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, key: int) -> int:\n if key not in self.map:\n return -1\n return self.map[key]",
"def get(self, key: int) -> int:\n if key in self.hashmap.keys():return self.hashmap[key]\n else:return -1",
"def get(self, key: int) -> int:\n sh = key % 37\n if ... | [
"0.8003961",
"0.7910052",
"0.76285523",
"0.7564368",
"0.75547266",
"0.7529255",
"0.7525802",
"0.74922633",
"0.7373652",
"0.72940284",
"0.72927696",
"0.72212875",
"0.72157663",
"0.717665",
"0.7160438",
"0.6980584",
"0.6925764",
"0.67844886",
"0.6755871",
"0.67318416",
"0.66118... | 0.7180783 | 13 |
Same as `copy_png()` except that it accepts filelike objects. | def copy_png_fp(
fin: IO[bytes], fout: IO[bytes], filter_chunks: Optional[Callable[[bytes], bool]] = None, verify_crc: bool = False
) -> None:
filter_chunks = filter_chunks or (lambda chunk_type: True)
for length, chunk_type, chunk, crc in iter_png_fp(fin, translate=False, verify_crc=verify_crc):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy_png(\n inpath: str, outpath: str, filter_chunks: Optional[Callable[[bytes], bool]] = None, verify_crc: bool = False\n) -> None:\n\n with open(inpath, \"rb\") as fr, open(outpath, \"xb\") as fw:\n copy_png_fp(fr, fw, filter_chunks=filter_chunks, verify_crc=verify_crc)",
"async def img_to_png... | [
"0.6967591",
"0.68054867",
"0.6404409",
"0.59217024",
"0.5889846",
"0.56795454",
"0.5670899",
"0.5669457",
"0.5609672",
"0.5583578",
"0.5570547",
"0.5562139",
"0.5521952",
"0.54994345",
"0.5495418",
"0.54856914",
"0.54625785",
"0.54474294",
"0.5333892",
"0.5325213",
"0.531537... | 0.634472 | 3 |
Returns uncertainty (Shannon's entropy) for each row in a IN BITS | def row_uncertainty(a):
try:
return sum(safe_p_log_p(a), 1)
except ValueError:
raise ValueError("Array has to be two-dimensional") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entropy(x):\n nz = np.nonzero(x)[0]\n return -np.sum(x[nz]*np.log2(x[nz]))",
"def entropy(data):\n e = 0\n\n counter = collections.Counter(data)\n l = len(data)\n for count in counter.values():\n p_x = count / l\n e += - p_x * math.log2(p_x)\n\n ... | [
"0.62159806",
"0.6139315",
"0.6018644",
"0.5969801",
"0.59441507",
"0.5872345",
"0.58492565",
"0.582803",
"0.58200026",
"0.5811002",
"0.5788554",
"0.5785955",
"0.5778342",
"0.5777099",
"0.57513267",
"0.57076585",
"0.5704342",
"0.56729835",
"0.5664917",
"0.5658752",
"0.5655598... | 0.53801996 | 51 |
Returns uncertainty (Shannon's entropy) for each column in a in BITS | def column_uncertainty(a):
if len(a.shape) < 2:
raise ValueError("Array has to be two-dimensional")
return sum(safe_p_log_p(a), axis=0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entropy(x):\n nz = np.nonzero(x)[0]\n return -np.sum(x[nz]*np.log2(x[nz]))",
"def entropy(self, col=None):\n\n res = 0\n if col == None:\n uniques, counts = np.unique(self.__data[1][self.__indexes], return_counts=True)\n for val, count in zip(uniques, counts):\n ... | [
"0.6016887",
"0.5942191",
"0.585249",
"0.5813751",
"0.58095366",
"0.5767757",
"0.57241356",
"0.5717549",
"0.56806374",
"0.56601214",
"0.56493473",
"0.56413174",
"0.56376994",
"0.5612899",
"0.5590037",
"0.5570637",
"0.5561298",
"0.5531375",
"0.5509181",
"0.5495826",
"0.5468004... | 0.5600463 | 14 |
Validates whether the given path is a URL or not. If the given path includes a scheme (http, https, ftp, ...) and a net location (a domain name such as it is validated as a URL. | def validate_url(path):
parsed = urlparse(path)
return bool(parsed.scheme) and bool(parsed.netloc) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_url(path: str):\n regex = re.compile(\n r\"^(?:http|ftp)s?://\" # http:// or https://\n r\"(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\.)+(?:[A-Z]{2,6}\\.?|[A-Z0-9-]{2,}\\.?)|\" # domain...\n r\"localhost|\" # localhost...\n r\"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3... | [
"0.8226748",
"0.7753527",
"0.7516201",
"0.7313043",
"0.72947246",
"0.7179743",
"0.7126698",
"0.70977753",
"0.7081974",
"0.7031983",
"0.7029829",
"0.6994219",
"0.69915915",
"0.6962306",
"0.6929586",
"0.6928357",
"0.6919079",
"0.68891406",
"0.6869636",
"0.6844321",
"0.67917764"... | 0.8411403 | 0 |
Convert a string representation of a number into a numeric type. | def str_to_num(value):
if isinstance(value, numbers.Number):
return value
try:
return int(value)
except ValueError:
return float(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def str2num(numstr):\n require_type(isa(numstr,str), 'parameter of string->number must be a string')\n return transform(numstr)",
"def to_numeric(s):\n\n try:\n s = float(s)\n except Exception as e:\n log.debug('Caught `{e!s}` trying to cast {s!r} to numeric'.format(**locals()))\n pass\n return... | [
"0.7692844",
"0.7651764",
"0.7643866",
"0.75142723",
"0.73039746",
"0.7276309",
"0.7247764",
"0.71872604",
"0.7127173",
"0.7101733",
"0.6848343",
"0.6846693",
"0.67493945",
"0.66773766",
"0.66629636",
"0.6633682",
"0.6567507",
"0.6566695",
"0.6550615",
"0.65199035",
"0.647166... | 0.786068 | 0 |
Creates and adds a request to the app database. | def create_request(self, **kwargs):
if kwargs['ride_id'] in app.database['Rides']:
request_ids = [x for x in app.database['Requests']]
if request_ids:
request_id = max(request_ids) + 1
else:
request_id = 1
self.new_request = Request... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_request_db(request, nome_request):\r\n login = request.form['login']\r\n email = request.form['email']\r\n\r\n db_dirpath = os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\"))\r\n with sql.connect(db_dirpath + '/pais_alice_requests.db') as conn:\r\n cur = conn.cursor()\r\... | [
"0.74390715",
"0.6635346",
"0.6542619",
"0.6531432",
"0.6416287",
"0.6344382",
"0.62605315",
"0.61843646",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
"0.6167075",
... | 0.63069624 | 6 |
Return a list of nonNone cells of the board. Useful for iterations. | def compact(self):
if self._memoized_compact == None:
self._memoized_compact = [cell for cell in self if cell != None]
return self._memoized_compact | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cells(self):\n cell_list = []\n for cell_row in self.board:\n for current_cell in cell_row:\n if current_cell is not None:\n cell_list.append(current_cell)\n return cell_list",
"def get_empty_cells(board):\n empty_cells = [idx for i... | [
"0.84464186",
"0.7828616",
"0.77953017",
"0.77933073",
"0.7647911",
"0.75764745",
"0.752653",
"0.7466717",
"0.7406266",
"0.7352547",
"0.7337111",
"0.72858626",
"0.72746646",
"0.7252236",
"0.72275174",
"0.7205831",
"0.7015558",
"0.7002503",
"0.698743",
"0.69797724",
"0.6953428... | 0.0 | -1 |
Return a deep copy of the Board. | def copy(self):
cpy = deepcopy(self)
# usually we use copy to perform transformations on the board
# so it's good to reset memoized values
cpy._memoized_compact = None
return cpy | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy(self):\n\t\tb = Board(self.size, self.end_count)\n\t\tfor x in range(self.size):\n\t\t\tfor y in range(self.size):\n\t\t\t\tb.tiles[x][y] = self.tiles[x][y]\n\t\treturn b",
"def copy(self):\r\n\t\tnewBoard = BoardClass()\r\n\r\n\t\tfor row in self.board:\r\n\t\t\tnewBoard.board.append(row[:])\r\n\t\tnew... | [
"0.86262125",
"0.86240983",
"0.85221416",
"0.8475742",
"0.841117",
"0.84055525",
"0.82885045",
"0.8231767",
"0.8115957",
"0.7993336",
"0.79295677",
"0.79114765",
"0.78862065",
"0.7834646",
"0.777284",
"0.7745863",
"0.7718335",
"0.76620406",
"0.7632108",
"0.76311755",
"0.75881... | 0.8080789 | 9 |
List of full cells. | def full(self):
return [cell for cell in self.compact if cell.peg] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty_cells(self) -> List[Cell]:\n return list(ob.pos[0] for ob in self.new_obs())",
"def make_free_cell_list():\r\n for row in range(9):\r\n for col in range(9):\r\n if (application.ui.__getattribute__(f'cell{col+1}{row+1}')).text() == \"\":\r\n lst_free_cells.appe... | [
"0.76237094",
"0.7340262",
"0.72466403",
"0.7153904",
"0.69738305",
"0.6905639",
"0.68990743",
"0.68602157",
"0.6845637",
"0.6837027",
"0.67788905",
"0.67414886",
"0.6734878",
"0.67185724",
"0.67068577",
"0.6672113",
"0.66634375",
"0.6653808",
"0.6626256",
"0.66231835",
"0.66... | 0.72002244 | 3 |
Number of rows in this board | def height(self):
return len(self.rows) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rows(self) -> int:\n return self.__squares.__len__()",
"def number_of_rows(self):\n if self.number_of_columns():\n return self._number_of_rows\n else:\n return 0",
"def row_count(self):\n return self.well_count // self.col_count",
"def num_cells_for_rows(... | [
"0.8547023",
"0.84731627",
"0.8359427",
"0.8230221",
"0.8220705",
"0.7961",
"0.7952762",
"0.7952762",
"0.7920514",
"0.7815514",
"0.77867424",
"0.77378064",
"0.7685716",
"0.76324797",
"0.75865215",
"0.75185627",
"0.7518256",
"0.7460419",
"0.74505967",
"0.7431087",
"0.7421119",... | 0.7048002 | 49 |
Number of columns in this board | def width(self):
return len(self.rows[0]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def columns(self) -> int:\n return self.__squares[0].__len__()",
"def num_cols(self):\n return (len(self.rows[0]))",
"def num_cols(self):\n return len(self.rows[0])",
"def n_cols(self):\n ch = self.children\n return 1 if not ch else sum([c.n_cols for c in ch])",
"def ncol... | [
"0.8586405",
"0.83533347",
"0.8333007",
"0.828061",
"0.8260796",
"0.8137133",
"0.8039843",
"0.7957241",
"0.79351544",
"0.7891392",
"0.78802615",
"0.787296",
"0.7818426",
"0.7752602",
"0.76793474",
"0.7663512",
"0.7651754",
"0.76190865",
"0.7610931",
"0.7606698",
"0.75436676",... | 0.66806626 | 83 |
Sets the recipe_id of this AggregatedReturnsRequest. | def recipe_id(self, recipe_id):
self._recipe_id = recipe_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_recipe(self, recipe):\n self.__recipe.append(recipe)\n return 'Recipe created successfully'",
"def find_recipe(self, recipe_id):\n return self.find_doc('recipe', 'name', self.get_unique_recipe_name(recipe_id))",
"def get_recipe(self, _id):\n raise NotImplementedError()",
"... | [
"0.55870974",
"0.54671645",
"0.5221521",
"0.5192757",
"0.51834637",
"0.5174198",
"0.517067",
"0.51267165",
"0.50854874",
"0.4884659",
"0.485019",
"0.4834199",
"0.4822419",
"0.4805069",
"0.47986838",
"0.47986838",
"0.47986838",
"0.47663274",
"0.47538355",
"0.47477326",
"0.4739... | 0.79471385 | 0 |
Sets the alternative_inception_date of this AggregatedReturnsRequest. | def alternative_inception_date(self, alternative_inception_date):
self._alternative_inception_date = alternative_inception_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_end_date(self, date):\n pass",
"def actual_reported_date(self, actual_reported_date):\n\n self._actual_reported_date = actual_reported_date",
"def interview_date_default(self, interview_date_default):\n\n self._interview_date_default = interview_date_default",
"def irb_approval_d... | [
"0.5673351",
"0.5669718",
"0.5614726",
"0.5448032",
"0.5390809",
"0.53852904",
"0.5363487",
"0.5332228",
"0.5332228",
"0.5332228",
"0.5332228",
"0.5332228",
"0.5332228",
"0.5332228",
"0.5332228",
"0.5265065",
"0.5261624",
"0.5261624",
"0.52061903",
"0.5201065",
"0.51539373",
... | 0.86131525 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, AggregatedReturnsRequest):
return False
return self.to_dict() == other.to_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.80885184",
"0.80885184",
"0.805514",
"0.7983044",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
"0.7966715",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
if not isinstance(other, AggregatedReturnsRequest):
return True
return self.to_dict() != other.to_dict() | {
"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.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
... | 0.0 | -1 |
Gets the min/max value of features in normalized or denormalized form. | def get_minx_maxx(self, normalized=True):
minx = np.array([[0.0] * len(self.encoded_feature_names)])
maxx = np.array([[1.0] * len(self.encoded_feature_names)])
for idx, feature_name in enumerate(self.continuous_feature_names):
max_value = self.train_df[feature_name].max()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_features_min_max(self):\n min_max_list = []\n\n # Get each feature's min and max values.\n for feature_name in self.feature_names:\n min = self.data[feature_name].min()\n max = self.data[feature_name].max()\n min_max_list.append([min, max])\n\n #... | [
"0.7540581",
"0.7015066",
"0.7012897",
"0.6947194",
"0.69155586",
"0.68044853",
"0.6753555",
"0.6641467",
"0.6630861",
"0.65878993",
"0.6554788",
"0.65083605",
"0.64835256",
"0.64835256",
"0.64732724",
"0.6449555",
"0.6441301",
"0.6395186",
"0.6391089",
"0.63818216",
"0.63791... | 0.7373559 | 1 |
Computes Median Absolute Deviation of features. | def get_mads(self, normalized=False):
mads = {}
if normalized is False:
for feature in self.continuous_feature_names:
mads[feature] = np.median(
abs(self.train_df[feature].values - np.median(self.train_df[feature].values)))
else:
normal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mad_std(x, axis=None):\r\n return 1.4826 * np.nanmedian(np.abs(x - np.nanmedian(x, axis)), axis)",
"def mad(self):\n observations_raw = input(\"Observations: \").split()\n observations = [int(elem) for elem in observations_raw]\n n = len(observations)\n mean = sum(observations)... | [
"0.7121166",
"0.70351005",
"0.6989611",
"0.6967279",
"0.69158524",
"0.69158524",
"0.6856089",
"0.68486226",
"0.6846189",
"0.67956245",
"0.6792994",
"0.6688018",
"0.6668764",
"0.6648401",
"0.6640476",
"0.66224927",
"0.6608339",
"0.6589418",
"0.65804255",
"0.65783995",
"0.65732... | 0.0 | -1 |
Gets the column indexes categorical features after onehotencoding. | def get_encoded_categorical_feature_indexes(self):
cols = []
for col_parent in self.categorical_feature_names:
temp = [self.encoded_feature_names.index(
col) for col in self.encoded_feature_names if col.startswith(col_parent) and
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_one_hot_to_category_indices(data: ndarray):\n return np.argmax(data, axis=-1)",
"def get_categorical_features(self):\n return self.categorical_features",
"def indices_to_one_hot(data, nb_classes):\n\ttargets = np.array(data).reshape(-1)\n\treturn np.eye(nb_classes)[targets]",
"def one_hot_... | [
"0.7089238",
"0.6969168",
"0.69366455",
"0.68854326",
"0.6816166",
"0.6814135",
"0.6813351",
"0.6813351",
"0.6813351",
"0.6813351",
"0.6798283",
"0.67559",
"0.6728701",
"0.67114335",
"0.6687825",
"0.66658866",
"0.66084766",
"0.6605116",
"0.6583032",
"0.65777326",
"0.6576012",... | 0.74847424 | 0 |
Gets the precision of continuous features in the data. | def get_decimal_precisions(self):
# if the precision of a continuous feature is not given, we use the maximum precision of the modes to capture the precision of majority of values in the column.
precisions = [0] * len(self.feature_names)
for ix, col in enumerate(self.continuous_feature_names):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def precision(self):\n tpos, fpos = len(self.__true_positives), len(self.__false_positives)\n return float(tpos) / (tpos + fpos)",
"def GetDataPrecision():\n return _gmat_py.GmatBase_GetDataPrecision()",
"def GmatBase_GetDataPrecision():\n return _gmat_py.GmatBase_GetDataPrecision()",
... | [
"0.71140885",
"0.7082765",
"0.685438",
"0.6725679",
"0.6636091",
"0.6634585",
"0.66228724",
"0.66228724",
"0.6615951",
"0.6615951",
"0.6615951",
"0.6615951",
"0.6615951",
"0.6615951",
"0.6612774",
"0.6612774",
"0.6612774",
"0.6612774",
"0.6612774",
"0.6612774",
"0.6612774",
... | 0.7226376 | 0 |
Expands a single node. Sets cost, previous and queue status for neighboring nodes | def _expand_node(expand_n, base_cost, randomizer):
for next_n, props in nb[expand_n].items():
randomizer -= 1
total_cost = props['weight'] + base_cost
e_cost = (total_cost, props['weight'], randomizer)
# Check for tree membership as this sign... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _expand_node(self, min_heap, curr_node):\n\n agent = curr_node[1]\n current_route = curr_node[2]\n # create new agents for every neighbors\n neighbors = agent.local_environment.get_passable_subgraph(agent.curr_time(),\n ... | [
"0.657337",
"0.567434",
"0.55995715",
"0.5575162",
"0.55138063",
"0.5488258",
"0.54829615",
"0.5375251",
"0.53495437",
"0.53339",
"0.53293395",
"0.53024435",
"0.5291686",
"0.5289031",
"0.52475774",
"0.5237448",
"0.5204016",
"0.5185657",
"0.5170416",
"0.5170002",
"0.5164375",
... | 0.6522187 | 1 |
convert distance from meters to inches | def m2in(x):
return x / 0.0254 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inches(n):\n return n * 25.4",
"def cm2inch(size):\n return size / 2.54",
"def cm2inch(size):\n return size / 2.54",
"def cm2inch(size):\n return size / 2.54",
"def inches_to_mm(inches):\n\tmm=inches*25.4\n\treturn mm",
"def inches_to_mm(inches):\n mm = inches *... | [
"0.7390042",
"0.7127614",
"0.7127614",
"0.7127614",
"0.7089511",
"0.70076936",
"0.68451875",
"0.6829537",
"0.6809064",
"0.67768383",
"0.673157",
"0.6726232",
"0.6557208",
"0.6555006",
"0.6548271",
"0.65404546",
"0.649713",
"0.6469255",
"0.64486855",
"0.63809586",
"0.6351136",... | 0.0 | -1 |
Get the width and height (in meters) of the area we can render the map to, returned as a tuple | def _get_render_area_size(self):
render_area = self._get_render_area()
return (render_area.width(), render_area.height()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def area(self):\n\t\treturn self.width * self.height",
"def area(self):\n\t\treturn self.width() * self.height()",
"def area(self):\n return (self.__width * self.__height)",
"def area(self):\n return (self.__width * self.__height)",
"def area(self):\r\n return self.width * self.height"... | [
"0.7191288",
"0.70865685",
"0.7069405",
"0.7069405",
"0.7049778",
"0.70255524",
"0.70138747",
"0.7008947",
"0.7008947",
"0.7008947",
"0.69841087",
"0.69805795",
"0.69805795",
"0.69805795",
"0.69805795",
"0.69805795",
"0.6975057",
"0.6958338",
"0.6958338",
"0.6958338",
"0.6958... | 0.7273084 | 0 |
Return number of items in the subtree. | def size(self):
# Replace by correct code
if self.right and self.left:
return self.left.height() + self.right.height()
elif not self.right:
return self.left.size()
elif not self.left:
return self.right.size()
else:
return self._siz... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count(self):\n return self.__tree.node_count",
"def tree_size(self) -> int:\n Q = Queue()\n count = 0\n Q.put(self.root)\n while not Q.empty():\n node = Q.get()\n count += 1\n for child in node.children.values():\n Q.put(child... | [
"0.78687537",
"0.78506297",
"0.78367746",
"0.7787001",
"0.7748685",
"0.7532372",
"0.7531484",
"0.750434",
"0.7504217",
"0.74893916",
"0.7487244",
"0.744008",
"0.7439325",
"0.7409861",
"0.7378327",
"0.7351274",
"0.7349612",
"0.73217934",
"0.7321754",
"0.73028815",
"0.7294153",... | 0.0 | -1 |
Sets the web_site_id of this WebSiteItem. | def web_site_id(self, web_site_id):
self._web_site_id = web_site_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def web_id(self, web_id):\n\n self._web_id = web_id",
"def site_id(self, site_id):\n\n self._site_id = site_id",
"def site_id(self, site_id):\n\n self._site_id = site_id",
"def set_site_id(self):\n self.site_id = entities.sites['next id']\n entities.sites['object list'].app... | [
"0.7182987",
"0.709915",
"0.709915",
"0.64841306",
"0.62134904",
"0.6092591",
"0.6092591",
"0.60198987",
"0.60165477",
"0.59643185",
"0.5905854",
"0.5719135",
"0.56791884",
"0.55605614",
"0.551997",
"0.5463314",
"0.54087853",
"0.51915896",
"0.51706636",
"0.50504845",
"0.49889... | 0.8354037 | 0 |
Sets the site_name of this WebSiteItem. | def site_name(self, site_name):
if site_name is not None and len(site_name) > 100:
raise ValueError("Invalid value for `site_name`, length must be less than or equal to `100`") # noqa: E501
self._site_name = site_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def site_name(self, site_name):\n\n self._site_name = site_name",
"async def set_name(self, name: str):\n json = {**self.get_data(), \"name\": name}\n return await self.easee.put(f\"/api/sites/{self.id}\", json=json)",
"def sitename(self, sitename) :\n\t\ttry :\n\t\t\tself._sitename = site... | [
"0.83834606",
"0.69977725",
"0.6917416",
"0.6499933",
"0.6406021",
"0.63973033",
"0.6147185",
"0.6147185",
"0.6098518",
"0.6028512",
"0.6009907",
"0.5953798",
"0.5884867",
"0.5875244",
"0.5860439",
"0.5860439",
"0.5856015",
"0.5856015",
"0.5856015",
"0.5856015",
"0.5856015",
... | 0.78920615 | 1 |
Sets the description of this WebSiteItem. | def description(self, description):
if description is not None and len(description) > 500:
raise ValueError("Invalid value for `description`, length must be less than or equal to `500`") # noqa: E501
self._description = description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_desc(self, item_desc):\r\n self.description = item_desc",
"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 = ... | [
"0.82880384",
"0.7866971",
"0.7787265",
"0.77858555",
"0.7732623",
"0.7714818",
"0.7701361",
"0.7444264",
"0.74227697",
"0.74227697",
"0.74227697",
"0.74227697",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259",
"0.7379259... | 0.6625897 | 90 |
Sets the url of this WebSiteItem. | def url(self, url):
if url is not None and len(url) > 255:
raise ValueError("Invalid value for `url`, length must be less than or equal to `255`") # noqa: E501
self._url = url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_web_url(self, item_web_url):\n\n self._item_web_url = item_web_url",
"def set_url(self, url):\n self.url = url",
"def set_url(self, url):\n self.data['url'] = url",
"def set_url(self, url):\n if url is not None:\n self.url = url",
"def set_url(self, url):\n ... | [
"0.7953001",
"0.7837962",
"0.77365106",
"0.7704859",
"0.74754",
"0.7420541",
"0.7228046",
"0.7228046",
"0.7228046",
"0.7228046",
"0.7228046",
"0.7228046",
"0.7228046",
"0.717777",
"0.70900995",
"0.70900995",
"0.70900995",
"0.70748025",
"0.680651",
"0.6767347",
"0.6753684",
... | 0.6663859 | 21 |
Sets the security_user_id of this WebSiteItem. | def security_user_id(self, security_user_id):
self._security_user_id = security_user_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id_user(self, id_user):\n\n self._id_user = id_user",
"def user_id(self, user_id):\n\n self._user_id = user_id",
"def user_id(self, user_id):\n\n self._user_id = user_id",
"def user_id(self, user_id):\n\n self._user_id = user_id",
"def user_id(self, user_id):\n\n self... | [
"0.65334135",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.65311515",
"0.6328552",
"0.62569165",
"0.62236816",
"0.6052821",
"0.60261583",
... | 0.8238337 | 1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, WebSiteItem):
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 |
Create a sparse representention of x. | def sparse_tuple_from_label(sequences, dtype=np.int32):
indices = []
values = []
for n, seq in enumerate(sequences):
indices.extend(zip([n] * len(seq), range(len(seq))))
values.extend(seq)
indices = np.asarray(indices, dtype=np.int64)
values = np.asarray(values, dtype=dtype)
sh... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_sparse(x):\n x_typename = torch.typename(x).split('.')[-1]\n sparse_tensortype = getattr(torch.sparse, x_typename)\n\n indices = torch.nonzero(x)\n if len(indices.shape) == 0: # if all elements are zeros\n return sparse_tensortype(*x.shape)\n indices = indices.t()\n values = x[tupl... | [
"0.75686485",
"0.7074417",
"0.7010392",
"0.7005248",
"0.6776821",
"0.6769516",
"0.6685081",
"0.6682845",
"0.6600969",
"0.6585346",
"0.658275",
"0.6573287",
"0.6444108",
"0.6443818",
"0.64427996",
"0.6438962",
"0.6436992",
"0.6384505",
"0.63345295",
"0.6333298",
"0.6276179",
... | 0.0 | -1 |
Retrieve all drafts that belong to this item | def get_draft_versions(self, object_id):
content_type = ContentType.objects.get_for_model(self.model)
versions = Version.objects.filter(
revision__easypublishermetadata__status='draft',
revision__easypublishermetadata__language=get_language(),
object_id=object_id,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drafts(self):\n if self._drafts is None:\n if self._initialize_drafts():\n self._save_drafts()\n return self._drafts",
"def drafts():\n query = Entry.drafts().order_by(Entry.last_mod_date.desc())\n return object_list('index.html', query)",
"def get_drafts(self):\n return self... | [
"0.77946293",
"0.70463485",
"0.70166445",
"0.6983148",
"0.69253886",
"0.6851197",
"0.68482864",
"0.6356238",
"0.62340665",
"0.6167321",
"0.6000534",
"0.5831474",
"0.569329",
"0.5594569",
"0.55920637",
"0.55599767",
"0.5558999",
"0.55432385",
"0.5536836",
"0.5438686",
"0.54188... | 0.64627457 | 7 |
Checks if the coordinates intersect the button's bounding box | def is_intersecting(self, y: int, x: int) -> bool:
return (self.is_enabled
and self.top_left_y <= y <= self.bottom_right_y and self.top_left_x <= x <= self.bottom_right_x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mouse_on_button(self, mouse) -> bool:\n return self.x + self.w > mouse[0] > self.x and self.y + self.h > mouse[1] > self.y",
"def wasClicked(self, point):\n p1 = self.rect.getP1()\n p2 = self.rect.getP2()\n if (p1.getX() <= point.getX() <= p2.getX() and\n p1.getY() ... | [
"0.71758246",
"0.7032196",
"0.70155203",
"0.6930319",
"0.688711",
"0.6827305",
"0.6774853",
"0.67548174",
"0.6739409",
"0.6738531",
"0.67331046",
"0.6707221",
"0.66990006",
"0.6667516",
"0.6662137",
"0.6662137",
"0.66532266",
"0.66468704",
"0.66462183",
"0.6636563",
"0.662936... | 0.6756586 | 7 |
Generate a random string of letters and digits | def generate_password(stringLength):
lettersAndDigits = string.ascii_letters + string.digits
password = ''.join(random.choice(lettersAndDigits)
for i in range(stringLength))
add_credential(social, username, password)
print(">Generated password: {}".format(password))
return | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rand_string():\n out = ''\n for _ in range(24):\n out += choice(ascii_letters)\n return out",
"def get_random_alphanumeric_string():\n return get_random_string(char_choice=string.ascii_letters + string.digits)",
"def gen_rand_str(n):\n return \"\".join(random.choice(string.ascii_l... | [
"0.86016387",
"0.84852463",
"0.8366202",
"0.83620757",
"0.83602",
"0.8158604",
"0.8123532",
"0.81143093",
"0.8089975",
"0.80873764",
"0.8011259",
"0.7957295",
"0.79525083",
"0.794848",
"0.7927194",
"0.79182523",
"0.7897885",
"0.788374",
"0.787901",
"0.7854035",
"0.78254104",
... | 0.0 | -1 |
Get a list of all whitelist/valid phrases (which were not filteredout by the user) | def get_valid_phrases():
return [x[0] for x in all_topics if x[1] == "1"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lemmatized_phrases(self):\n phrases = [set(lower_words(TextBlob(p).words.lemmatize()))\n for p in self.blob.noun_phrases]\n return [' '.join(p) for p in phrases if not STOPWORDS.intersection(p)]",
"def clean_string(self):\n\n cleaned = unidecode(self.user_query).lower()... | [
"0.67475116",
"0.67071265",
"0.66126364",
"0.656505",
"0.6479037",
"0.64566004",
"0.6432774",
"0.63958436",
"0.6394926",
"0.63111955",
"0.6303372",
"0.6291639",
"0.6253642",
"0.62465453",
"0.623552",
"0.6215198",
"0.6200187",
"0.6195033",
"0.6175894",
"0.6144901",
"0.61022824... | 0.73431623 | 0 |
Get the filtertable indices of all whitelist/valid phrases | def get_valid_indices():
return [i for i, val in enumerate(all_topics) if val[1] == "1"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _tokens_to_index(self,tokens):\n wids = []\n for tk in tokens:\n if tk in self.wtoi.keys():\n wids.append(self.wtoi[tk])\n else:\n wids.append(1) # <UNK>\n for _ in range(self.sentence_max_length - len(wids)):\n wids.append(0)... | [
"0.6123164",
"0.60713714",
"0.59939605",
"0.59426266",
"0.5935242",
"0.58957887",
"0.58723086",
"0.5870341",
"0.5870341",
"0.5862831",
"0.579157",
"0.57855695",
"0.56508505",
"0.564407",
"0.5622267",
"0.5608045",
"0.5596853",
"0.5579939",
"0.55550253",
"0.55298173",
"0.550351... | 0.6620929 | 0 |
Converts `my_obj` to a JSON string | def to_json_string(my_obj):
return json.dumps(my_obj) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_json_string(my_obj):\n\n return json.dumps(my_obj)",
"def to_json_string(my_obj):\n return (json.dumps(my_obj))",
"def to_json_string(my_obj):\n return (json.dumps(my_obj))",
"def to_json_string(my_obj):\n j_obj = json.dumps(my_obj)\n return j_obj",
"def to_json_string(my_obj):\n o... | [
"0.9209581",
"0.9123023",
"0.9123023",
"0.9005176",
"0.89608663",
"0.81777",
"0.80933607",
"0.78639245",
"0.7818062",
"0.7795821",
"0.7574203",
"0.75297135",
"0.74653584",
"0.74505556",
"0.7422575",
"0.74206537",
"0.7417701",
"0.73882395",
"0.7383173",
"0.7281284",
"0.7279155... | 0.9190377 | 4 |
Return the conductor of this elliptic curve factor, which is the level of the space of Hilbert modular forms. | def conductor(self):
return self._S.level() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def circpol(self):\n return self._circpol",
"def concentration(self):\n return self._gev_bijector.concentration",
"def get_coeff(self):\n return bernoulli(self.degree+1) / factorial(self.degree + 1)",
"def cole_coeff(self):\n return self.diseq_coeff(standardize=True)",
"def C(self,... | [
"0.65925086",
"0.64509857",
"0.64332074",
"0.6185768",
"0.6133102",
"0.6116377",
"0.598807",
"0.5984201",
"0.59567434",
"0.59515804",
"0.5945288",
"0.5931537",
"0.58707625",
"0.5856588",
"0.58369917",
"0.58194524",
"0.580431",
"0.57861376",
"0.5766513",
"0.5760627",
"0.573839... | 0.7364952 | 0 |
Create Encounter with players and monsters | def create(self, request):
encounter = Encounter()
encounter.name = self.request.data.get('name')
encounter.description = self.request.data.get('description')
encounter.save()
players = self.request.data.get('players')
for player in players:
encounter.players... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_monsters(cls, character):\n numbers = randint(1, 3)",
"def create_asteroid_e(self):\n self.create_asteroid_common(6, self.colors[1], self.colors[1], enemy=True)",
"def generate(self):\n self.coins = 0\n self.crystals = 0\n all_sprite.empty()\n levels_group.e... | [
"0.58086365",
"0.58007735",
"0.57794285",
"0.566323",
"0.5662352",
"0.5552685",
"0.5533674",
"0.5500984",
"0.5500954",
"0.5471554",
"0.5436554",
"0.5413689",
"0.53676915",
"0.5356831",
"0.5350974",
"0.5338737",
"0.53218794",
"0.53118926",
"0.5306474",
"0.5302534",
"0.5298009"... | 0.66613716 | 0 |
Load a data file and return it as a list of lines. | def load_data_file(filename, encoding="utf-8"):
data = pkgutil.get_data(PACKAGE_NAME, os.path.join(DATA_DIR, filename))
return data.decode(encoding).splitlines() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_lines(filename):\r\n lines = []\r\n f = open(filename)\r\n for line in f.readlines():\r\n line = line.strip()\r\n lines.append(line)\r\n return lines",
"def load_data(path):\n with open(path) as f:\n return f.readlines()",
"def load_file(filename):\n with open(fi... | [
"0.7872119",
"0.786365",
"0.7694696",
"0.7597393",
"0.75399727",
"0.75351334",
"0.74810326",
"0.7426112",
"0.7396894",
"0.7369566",
"0.73315233",
"0.73189026",
"0.72921854",
"0.7255364",
"0.7251107",
"0.7236142",
"0.71754056",
"0.7163294",
"0.71627325",
"0.71229047",
"0.71141... | 0.6676183 | 52 |
Exports a read dataframe into a specified path as CSV or XLSX using pandas | def export_df(df: pd.DataFrame, output_path: str, output_type: str):
if output_type == 'csv':
df.to_csv(output_path + 'concat_df.csv', index=False)
elif output_type == 'excel':
df.to_excel(output_path + 'concat_df.xlsx', index=False, engine='openpyxl')
else:
print('Please specif... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_dataframe_to_excel(df,path,filename):\n \n path_and_file_name = path.joinpath('output',filename)\n df.to_csv(path_or_buf = path_and_file_name, sep=';',index=False)",
"def save_df(data_frame, file_path):\r\n data_frame.to_csv(file_path)\r\n return None",
"def df_write(df: pd.DataFrame, p... | [
"0.78194535",
"0.7386306",
"0.7207754",
"0.7160049",
"0.7123344",
"0.70207244",
"0.7011365",
"0.69984126",
"0.6970991",
"0.6956849",
"0.69336474",
"0.6927608",
"0.6900491",
"0.68773144",
"0.6874557",
"0.6854536",
"0.6850878",
"0.68479234",
"0.6792725",
"0.67175174",
"0.669752... | 0.7127423 | 4 |
Test that users who logged out is unauthenticated. | def test_logout(self):
self.client.post(reverse('login'), self.user)
response = self.client.post(reverse('logout'))
self.assertEqual(response.status_code, 302)
response = self.client.get(reverse('polls:index'))
self.assertFalse(response.context['user'].is_authenticated) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_logout_un_logged_in_user_false(self):\n resp = self.client().post('/api/v1/auth/logout/1')\n self.assertEqual(resp.status_code, 400)\n resp = resp.get_json()\n self.assertEqual(resp['error'],\n 'That user is not logged in')",
"def test_unauthenticated_... | [
"0.79117715",
"0.78292716",
"0.7774065",
"0.7759688",
"0.7588042",
"0.7586064",
"0.75560594",
"0.7522972",
"0.748129",
"0.7456746",
"0.74321526",
"0.7401776",
"0.73788226",
"0.73293763",
"0.7277878",
"0.7277878",
"0.7263813",
"0.7228855",
"0.72257316",
"0.7203001",
"0.7158268... | 0.70931023 | 23 |
Note that initial_stddev and current_stddev refer to std of parameter noise, but desired_action_stddev refers to (as name notes) desired std in action space | def __init__(self, initial_stddev=0.1, desired_action_stddev=0.2, adaptation_coefficient=1.01):
self.initial_stddev = initial_stddev
self.desired_action_stddev = desired_action_stddev
self.adaptation_coefficient = adaptation_coefficient
self.current_stddev = initial_stddev | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_std(self):\n param = self.param\n meansp = self.mean()\n stdsp = self.std()\n num_noise = 200\n noise = np.random.normal(1,0.005,(num_noise,self.wvl.size)) # add 0.5% variance to signal at all wavelengths\n # should be at every sp in utc, but for now, use mean sp... | [
"0.64792573",
"0.63251257",
"0.6322401",
"0.5968955",
"0.5941517",
"0.59403867",
"0.59090215",
"0.5877816",
"0.5875061",
"0.5868092",
"0.58003134",
"0.57642704",
"0.57622504",
"0.5728623",
"0.5726372",
"0.5720931",
"0.57206666",
"0.57147044",
"0.5676818",
"0.5653704",
"0.5637... | 0.7329208 | 0 |
Returns TACACS Servers in JSON Style Format | def get_tacacs_servers(self):
cmd = 'show tacacs'
output = self.iosapi.bcp_send_command(self.iosapi.netmiko_session, cmd)
self.iosapi.bcp_log("info", "(%s) get_tacacs_servers() : Attempting to retrieve TACACS+ servers" %(__name__))
return(self.iosapi.textfsm_extractor('cisco_ios_show_t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_json(self):\n server_data = []\n for server in self.servers:\n server_data.append(server.__dict__)\n return json.dumps(server_data)",
"def json_out(self):\n temp_json = json.dumps(self.ecat_info, indent=4)\n print(temp_json)",
"def get_servers(self) -> dict:... | [
"0.6202939",
"0.5987852",
"0.59618145",
"0.5932779",
"0.5861334",
"0.57894295",
"0.5776895",
"0.5774729",
"0.57335955",
"0.5723935",
"0.5602442",
"0.56003565",
"0.55882174",
"0.5574191",
"0.5560447",
"0.55510235",
"0.55405444",
"0.5524064",
"0.55236965",
"0.5519416",
"0.54968... | 0.6523296 | 0 |
Returns normally distributed weights (mean=0, sd=std_dev) with shape (n_rows, n_cols) | def _init_weights(n_rows, n_cols, std_dev=0.5):
weights = np.random.randn(n_rows, n_cols) * std_dev
return weights | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_standard_normal_distribution():\n return np.random.normal(0, 1)",
"def standard_normal(weight_shape):\n return np.random.normal(size=weight_shape)",
"def init_weights(self, dims):\n self.W = np.random.normal(size=dims) * 0.0001",
"def _mutate_weights(self, weights):\n return weights +... | [
"0.6591022",
"0.65766734",
"0.65077186",
"0.65043247",
"0.6454653",
"0.62337154",
"0.6223493",
"0.6205565",
"0.6184105",
"0.6175772",
"0.61582905",
"0.61486274",
"0.61305547",
"0.6118239",
"0.6110674",
"0.6089133",
"0.6066576",
"0.60517883",
"0.6033719",
"0.6018233",
"0.60167... | 0.7355454 | 0 |
Returns sigmoid output given number or arraylike of numbers. | def _sigmoid(x):
return 1 / (1 + np.exp(-x)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid(data):\n return _make.sigmoid(data)",
"def sigmoid(number):\n\n # Return the calculated value\n return 1 / (1 + math.exp(-number))",
"def sigmoid(X):\n if isinstance(X,(list,tuple)):\n X=np.array(X)\n return 1/(1+np.exp(-X))\n #return np.exp(X)/(1+np.exp(X))",
"def sigmoi... | [
"0.77380294",
"0.76086503",
"0.75716966",
"0.7559287",
"0.7295104",
"0.7281146",
"0.71946067",
"0.717696",
"0.716129",
"0.716129",
"0.716129",
"0.716129",
"0.716129",
"0.716129",
"0.71596265",
"0.7149838",
"0.71454155",
"0.71432346",
"0.7118343",
"0.7102405",
"0.7093699",
"... | 0.70791924 | 21 |
This function returns the padded, two's complement representation of x, in ybits. It is conventional for y to be 8, 16, 32 or 64, though y can have any nonzero positive value. | def tcbin(x, y=8):
if x >= (2**(y - 1)) or x < -(2**(y - 1) or y < 1):
raise Exception("Argument outside of range.")
if x >= 0:
binstr = bin(x)
# pad with leading zeros
while len(binstr) < y + 2:
binstr = "0b0" + binstr[2:]
return binstr
return bin((2**y) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _bin_backport(x):\n chars = []\n for n in range(7, -1, -1):\n y = x - 2**n\n if y >= 0:\n chars.append('1')\n x = y\n else:\n chars.append('0')\n return ''.join(chars)",
"def complement_ixes(ixes, y):\n try:... | [
"0.57773876",
"0.5757616",
"0.56228423",
"0.56109315",
"0.5606774",
"0.55555767",
"0.5425595",
"0.5338052",
"0.5243212",
"0.5215987",
"0.5159904",
"0.51473325",
"0.51394945",
"0.5130186",
"0.5126489",
"0.5110445",
"0.5098994",
"0.50986856",
"0.50791144",
"0.5049751",
"0.50053... | 0.65920156 | 0 |
Gets the value of minPts or its default value. | def getMinPts(self):
return self.getOrDefault(self.minPts) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"min\")",
"def min(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"min\")",
"def min(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"min\")",
"def min(self) -> pulumi.Input[int]:\n r... | [
"0.74552226",
"0.74552226",
"0.72984475",
"0.72984475",
"0.72143245",
"0.72143245",
"0.70735884",
"0.7062526",
"0.70310277",
"0.69532746",
"0.6945611",
"0.6944281",
"0.6910095",
"0.6910095",
"0.69065595",
"0.69024223",
"0.689831",
"0.68929803",
"0.6887403",
"0.6886365",
"0.68... | 0.89825577 | 0 |
Gets the value of minPts or its default value. | def getMinPts(self):
return self.getOrDefault(self.minPts) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"min\")",
"def min(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"min\")",
"def min(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"min\")",
"def min(self) -> pulumi.Input[int]:\n r... | [
"0.74552226",
"0.74552226",
"0.72984475",
"0.72984475",
"0.72143245",
"0.72143245",
"0.70735884",
"0.7062526",
"0.70310277",
"0.69532746",
"0.6945611",
"0.6944281",
"0.6910095",
"0.6910095",
"0.69065595",
"0.69024223",
"0.689831",
"0.68929803",
"0.6887403",
"0.6886365",
"0.68... | 0.89825577 | 1 |
Row normalization function Implement a function that normalizes each row of a matrix to have unit length. Given X = [a b c] Unit length ||X|| = sqrt(a^2 + b^2 + c^2) So in order to normalize the unit length to 1, we find the ||X|| for each row and then divide each item in the row by that number | def normalizeRows(x):
### YOUR CODE HERE
# Find the square of each item
xsq = x*x
# Find the unit length along each row (axis=1)
xsq_sum = xsq.sum(axis=1)
x_unit = np.sqrt(xsq_sum)
# reshape the unit length and normalize matrix by unit length
x_unit = x_unit.reshape(x_unit.shape[0],1)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalizeRows(x):\n N = x.shape[0]\n x /= np.sqrt(np.sum(x ** 2, axis=1)).reshape((N, 1)) + 1e-30\n return x",
"def normalizeRows(x):\n\n ### YOUR CODE HERE\n norm2 = np.linalg.norm(x,2,axis = 1).reshape(x.shape[0],-1)\n x = x/norm2\n ### END YOUR CODE\n\n return x",
"def normalizeR... | [
"0.81519127",
"0.80916977",
"0.80625796",
"0.79737985",
"0.7399374",
"0.7377428",
"0.7276853",
"0.7252308",
"0.715315",
"0.7148506",
"0.71114415",
"0.70644873",
"0.7032399",
"0.69580424",
"0.69418246",
"0.6915055",
"0.6890738",
"0.6817182",
"0.67826456",
"0.67617255",
"0.6747... | 0.8273341 | 0 |
Alternative implementation of the Kendall tau. This implementation follows the Wikipedia article's definition (see References). This should give identical results as ``tau_score``. References .. [1] `Wikipedia entry for the Kendall rank correlation coefficient. | def _tau_score(Y_true, Y_pred, sample_weight=None):
(n_samples, n_classes) = Y_true.shape
scores = np.zeros(n_samples)
for sample in range(n_samples):
for f_class in range(n_classes - 1):
for s_class in range(f_class + 1, n_classes):
a = Y_true[sample, f_class] - Y_true[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTau(self) -> float:\n return self.tau",
"def get_kendell_tau(ys):\n\n from scipy.stats import kendalltau\n\n # calculate Kendall tau\n tau, p = kendalltau(range(len(ys)), ys)\n\n return tau, p",
"def akendalltau(x,y):\r\n n1 = 0\r\n n2 = 0\r\n iss = 0\r\n for j in range(le... | [
"0.6800352",
"0.6690253",
"0.64381886",
"0.6395395",
"0.6262187",
"0.62431103",
"0.623256",
"0.61966074",
"0.61129206",
"0.60974896",
"0.60613716",
"0.5990444",
"0.599038",
"0.59637266",
"0.5955699",
"0.5862515",
"0.5845801",
"0.5845664",
"0.58407414",
"0.5837315",
"0.5799023... | 0.5624818 | 29 |
Helper method to make random sample weights. | def _make_sample_weights(n_repetitions, n_samples, random_state):
sample_weights = np.zeros((n_repetitions, n_samples), dtype=np.float64)
for repetition in range(n_repetitions):
sample_weights[repetition] = random_state.rand(n_samples) + 1
return sample_weights | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _generate_weights(self):\n weights = [random.uniform(0, 1) for x in range(self.num_weights)]\n return self._normalize_weights(weights)",
"def randomizeWeights(self, rand_distr):\n raise NotImplementedError",
"def weightGenerate(self):\n\t\tfor i in range(0, self.numberOfInput):\n\t\t\t... | [
"0.81583005",
"0.80193406",
"0.79607755",
"0.79208803",
"0.7821434",
"0.7763524",
"0.7732938",
"0.7600318",
"0.7535313",
"0.7530261",
"0.7386818",
"0.7380814",
"0.7371349",
"0.73231924",
"0.7295997",
"0.72540116",
"0.72437114",
"0.7228062",
"0.7212939",
"0.7140366",
"0.708334... | 0.7555848 | 8 |
Divide the first input by the second, returning a floating point. | def divide(numbers):
counter = 0
for num in numbers:
counter /= num
return counter | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def divide(num1, num2):\n return float(num1) / float(num2)",
"def division(self, first_value, second_value):\n return first_value / second_value",
"def divide(num1, num2):\n quotient = num1 / float(num2)\n return quotient",
"def divide(number_1, number_2):\n return int(number_1) / float(nu... | [
"0.8084872",
"0.7971019",
"0.77763706",
"0.76590556",
"0.75653994",
"0.75236464",
"0.74660003",
"0.7434087",
"0.7424988",
"0.7415727",
"0.73994714",
"0.73743945",
"0.7333185",
"0.72712845",
"0.7233861",
"0.722389",
"0.72100836",
"0.7109199",
"0.7109199",
"0.7102085",
"0.70813... | 0.0 | -1 |
The directory service ID of the directory service you want to connect to with an `identity_provider_type` of `AWS_DIRECTORY_SERVICE`. | def directory_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "directory_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_id(self) -> str:\n return pulumi.get(self, \"service_id\")",
"def service_provider_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"service_provider_id\")",
"def service_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"service_id\")",
"def servi... | [
"0.66323614",
"0.6440405",
"0.6431667",
"0.6431667",
"0.63788056",
"0.6266402",
"0.6266402",
"0.5954231",
"0.59128284",
"0.5813627",
"0.57898563",
"0.57687885",
"0.575299",
"0.5737945",
"0.5717451",
"0.5702433",
"0.56408757",
"0.5617684",
"0.5617684",
"0.5604004",
"0.55792576... | 0.5758642 | 13 |
The ARN for a lambda function to use for the Identity provider. | def function(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "function") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def idp_lambda_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"idp_lambda_arn\")",
"def lambda_arn_lookup(session, lambda_name):\n if session is None:\n return None\n\n client = session.client(\"lambda\")\n response = client.get_function(FunctionName=lambda_name)\n ... | [
"0.71581995",
"0.6931736",
"0.67630583",
"0.65284175",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",
"0.62176174",... | 0.0 | -1 |
Amazon Resource Name (ARN) of the IAM role used to authenticate the user account with an `identity_provider_type` of `API_GATEWAY`. | def invocation_role(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "invocation_role") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iam_role_arn(self) -> str:\n return pulumi.get(self, \"iam_role_arn\")",
"def role_arn(self) -> str:\n return pulumi.get(self, \"role_arn\")",
"def role_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"role_arn\")",
"def role_arn(self) -> pulumi.Output[Optional[str]]:\n ... | [
"0.75581414",
"0.7541349",
"0.7446048",
"0.728013",
"0.7276502",
"0.7276502",
"0.7276502",
"0.7276502",
"0.7220094",
"0.72132146",
"0.72132146",
"0.68693906",
"0.67883784",
"0.67883784",
"0.6764475",
"0.6762043",
"0.6762043",
"0.6743998",
"0.6607129",
"0.6598952",
"0.64929825... | 0.5987342 | 41 |
A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel. | def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
return pulumi.get(self, "tags") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.... | [
"0.6417023",
"0.6417023",
"0.64133024",
"0.64133024",
"0.64133024",
"0.64133024",
"0.62754464",
"0.6200991",
"0.61419016",
"0.60991037",
"0.6084715",
"0.6067825",
"0.59696394",
"0.5957612",
"0.58632016",
"0.58437586",
"0.58437586",
"0.58437586",
"0.58437586",
"0.58437586",
"0... | 0.568598 | 65 |
The directory service ID of the directory service you want to connect to with an `identity_provider_type` of `AWS_DIRECTORY_SERVICE`. | def directory_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "directory_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_id(self) -> str:\n return pulumi.get(self, \"service_id\")",
"def service_provider_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"service_provider_id\")",
"def service_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"service_id\")",
"def servi... | [
"0.66323614",
"0.6440405",
"0.6431667",
"0.6431667",
"0.63788056",
"0.6266402",
"0.6266402",
"0.5954231",
"0.59128284",
"0.5813627",
"0.57898563",
"0.57687885",
"0.575299",
"0.5737945",
"0.5717451",
"0.5702433",
"0.56408757",
"0.5617684",
"0.5617684",
"0.5604004",
"0.55792576... | 0.5758642 | 14 |
The ARN for a lambda function to use for the Identity provider. | def function(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "function") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def idp_lambda_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"idp_lambda_arn\")",
"def lambda_arn_lookup(session, lambda_name):\n if session is None:\n return None\n\n client = session.client(\"lambda\")\n response = client.get_function(FunctionName=lambda_name)\n ... | [
"0.7157678",
"0.6930264",
"0.67632616",
"0.65272325",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
... | 0.0 | -1 |
Amazon Resource Name (ARN) of the IAM role used to authenticate the user account with an `identity_provider_type` of `API_GATEWAY`. | def invocation_role(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "invocation_role") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iam_role_arn(self) -> str:\n return pulumi.get(self, \"iam_role_arn\")",
"def role_arn(self) -> str:\n return pulumi.get(self, \"role_arn\")",
"def role_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"role_arn\")",
"def role_arn(self) -> pulumi.Output[Optional[str]]:\n ... | [
"0.7557056",
"0.75396997",
"0.74452627",
"0.72786665",
"0.7275483",
"0.7275483",
"0.7275483",
"0.7275483",
"0.722024",
"0.72115207",
"0.72115207",
"0.6867623",
"0.6787211",
"0.6787211",
"0.67641985",
"0.67603594",
"0.67603594",
"0.67425984",
"0.6605708",
"0.6599621",
"0.64914... | 0.59863675 | 40 |
A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel. | def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
return pulumi.get(self, "tags") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.... | [
"0.64165634",
"0.64165634",
"0.64128274",
"0.64128274",
"0.64128274",
"0.64128274",
"0.62759674",
"0.6200294",
"0.6141971",
"0.60991013",
"0.608474",
"0.6068905",
"0.5970547",
"0.5960387",
"0.58637536",
"0.5843988",
"0.5843988",
"0.5843988",
"0.5843988",
"0.5843988",
"0.58439... | 0.5686278 | 66 |
A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. | def tags_all(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
return pulumi.get(self, "tags_all") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.... | [
"0.7443431",
"0.7443431",
"0.743764",
"0.743764",
"0.743764",
"0.743764",
"0.71586853",
"0.7096361",
"0.7081579",
"0.7057494",
"0.69307125",
"0.6917113",
"0.68256235",
"0.67964035",
"0.6753257",
"0.6701461",
"0.663132",
"0.663132",
"0.663132",
"0.663132",
"0.663132",
"0.663... | 0.0 | -1 |
The directory service ID of the directory service you want to connect to with an `identity_provider_type` of `AWS_DIRECTORY_SERVICE`. | def directory_id(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "directory_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_id(self) -> str:\n return pulumi.get(self, \"service_id\")",
"def service_provider_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"service_provider_id\")",
"def service_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"service_id\")",
"def servi... | [
"0.66323614",
"0.6440405",
"0.6431667",
"0.6431667",
"0.63788056",
"0.6266402",
"0.6266402",
"0.5954231",
"0.59128284",
"0.5813627",
"0.57687885",
"0.5758642",
"0.5758642",
"0.5758642",
"0.575299",
"0.5737945",
"0.5717451",
"0.5702433",
"0.56408757",
"0.5617684",
"0.5617684",... | 0.57898563 | 10 |
The ARN for a lambda function to use for the Identity provider. | def function(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "function") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def idp_lambda_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"idp_lambda_arn\")",
"def lambda_arn_lookup(session, lambda_name):\n if session is None:\n return None\n\n client = session.client(\"lambda\")\n response = client.get_function(FunctionName=lambda_name)\n ... | [
"0.7157678",
"0.6930264",
"0.67632616",
"0.65272325",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
"0.62169456",
... | 0.0 | -1 |
Amazon Resource Name (ARN) of the IAM role used to authenticate the user account with an `identity_provider_type` of `API_GATEWAY`. | def invocation_role(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "invocation_role") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iam_role_arn(self) -> str:\n return pulumi.get(self, \"iam_role_arn\")",
"def role_arn(self) -> str:\n return pulumi.get(self, \"role_arn\")",
"def role_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"role_arn\")",
"def role_arn(self) -> pulumi.Output[Optional[str]]:\n ... | [
"0.7557056",
"0.75396997",
"0.74452627",
"0.72786665",
"0.7275483",
"0.7275483",
"0.7275483",
"0.7275483",
"0.722024",
"0.72115207",
"0.72115207",
"0.6867623",
"0.6787211",
"0.6787211",
"0.67641985",
"0.67603594",
"0.67603594",
"0.67425984",
"0.6605708",
"0.6599621",
"0.64914... | 0.6198971 | 30 |
A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel. | def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
return pulumi.get(self, "tags") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.... | [
"0.64165634",
"0.64165634",
"0.64128274",
"0.64128274",
"0.64128274",
"0.64128274",
"0.62759674",
"0.6200294",
"0.6141971",
"0.60991013",
"0.608474",
"0.6068905",
"0.5970547",
"0.5960387",
"0.58637536",
"0.5843988",
"0.5843988",
"0.5843988",
"0.5843988",
"0.5843988",
"0.58439... | 0.0 | -1 |
A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. | def tags_all(self) -> pulumi.Output[Mapping[str, str]]:
return pulumi.get(self, "tags_all") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, str]:\n return pulumi.... | [
"0.7443431",
"0.7443431",
"0.743764",
"0.743764",
"0.743764",
"0.743764",
"0.71586853",
"0.7096361",
"0.7081579",
"0.7057494",
"0.69307125",
"0.6917113",
"0.68256235",
"0.67964035",
"0.6753257",
"0.6701461",
"0.663132",
"0.663132",
"0.663132",
"0.663132",
"0.663132",
"0.663... | 0.6412229 | 61 |
Split 3D array into a list of 2D arrays. e.g. given a numpy array of shape (100, 200, 6), return a list of 6 channels, each with shape (100, 200). | def split_3d_array_into_channels(arr):
return [arr[:, :, i] for i in range(arr.shape[-1])] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_3Darray(array2d, L_window):\n N, ch = array2d.shape\n n_windows = N//L_window\n array3d = np.zeros((n_windows, L_window, ch))\n for i in range(n_windows):\n array3d[i]=array2d[i*L_window: (i+1)*L_window,:] \n \n return array3d",
"def split_array(arr, num_of_splits):\n # ... | [
"0.7381979",
"0.7202182",
"0.6981213",
"0.6907791",
"0.6840848",
"0.67897874",
"0.67672086",
"0.65890145",
"0.6482709",
"0.63571244",
"0.6311316",
"0.63039243",
"0.63039243",
"0.63039243",
"0.6293337",
"0.6286221",
"0.6217353",
"0.61296993",
"0.6090372",
"0.6079073",
"0.60603... | 0.85482824 | 0 |
Save an array as a PNG image with PIL and show it. | def array_to_png(arr,
path=None,
show=True,
vmin=None,
vmax=None,
scale=None,
labels=None):
scaled, image_mode = autoscale_colors_for_png(arr, vmin=vmin, vmax=vmax)
save_to_png(
scaled,
path=path,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_to_png(arr,\n path=None,\n image_mode=None,\n show=True,\n labels=None,\n scale=None):\n if image_mode is None:\n image_mode = _get_image_type_from_array(arr)\n\n img = Image.fromarray(arr, mode=image_mode)\n\n if labels is n... | [
"0.75673556",
"0.73633295",
"0.72557175",
"0.7024852",
"0.65844244",
"0.6513829",
"0.6512833",
"0.6498813",
"0.6370763",
"0.63654566",
"0.6361134",
"0.63606095",
"0.6329673",
"0.6301614",
"0.6289081",
"0.6232529",
"0.6231562",
"0.6218037",
"0.62074643",
"0.620423",
"0.616027"... | 0.708567 | 3 |
Get DeepVariant channel names for the given number of channels. | def _deepvariant_channel_names(num_channels):
# Add additional empty labels if there are more channels than expected.
filler_labels = [
'channel {}'.format(i + 1)
for i in range(len(DEEPVARIANT_CHANNEL_NAMES), num_channels)
]
labels = DEEPVARIANT_CHANNEL_NAMES + filler_labels
# Trim off any extra ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetChannelNames(vDataSet):\r\n nc = vDataSet.GetSizeC()\r\n ret = []\r\n for i in range(nc):\r\n name = vDataSet.GetChannelName(i)\r\n ret.append(name)\r\n\r\n return ret",
"def getChannelsByName(self, unit, channels): \n\t\treturn self.selectChannelsByName(unit, channels, dontSel... | [
"0.6843132",
"0.6815625",
"0.6340127",
"0.6282354",
"0.6261833",
"0.6214825",
"0.6147756",
"0.6112671",
"0.6100254",
"0.6076097",
"0.5998444",
"0.59789765",
"0.59680164",
"0.59402627",
"0.591586",
"0.5909943",
"0.5894663",
"0.5888713",
"0.5877956",
"0.58738446",
"0.5816415",
... | 0.79262525 | 0 |
Extract indices of the particular alt allele(s) the example represents. | def alt_allele_indices_from_example(example):
features = example.features.feature
val = features['alt_allele_indices/encoded'].bytes_list.value[0]
# Extract the encoded proto into unsigned integers and convert to regular ints
mapped = [int(x) for x in np.frombuffer(val, dtype=np.uint8)]
# Format is [<field id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alt_from_example(example):\n variant = variant_from_example(example)\n indices = alt_allele_indices_from_example(example)\n return alt_bases_from_indices(indices, variant.alternate_bases)",
"def get_gt_hom_idxs(alt_num):\n last = -1\n hom_idxs = []\n for a in range(alt_num + 1):\n last = l... | [
"0.6662739",
"0.6392309",
"0.62740046",
"0.6250704",
"0.6132491",
"0.61320454",
"0.6118353",
"0.60102886",
"0.5839906",
"0.5772015",
"0.5707984",
"0.5626002",
"0.5590027",
"0.5576302",
"0.5576157",
"0.5551241",
"0.55511457",
"0.55454165",
"0.5541605",
"0.5531042",
"0.55244434... | 0.7830137 | 0 |
Destroy the driver session, this function is called everytime a driver instance is destroyed This is a good place to close any open sessions, finish writing to log files | def cleanup(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close_session(self):\n self.driver.close()",
"def dispose():\n if _driver:\n log.msg_debug(\"[{driver}] dispose\".format(driver=_driver.get_name()))\n _driver.dispose()",
"def __del__(self):\n\n self.session.close()",
"def clean_up(self):\n self.session.close()",
"... | [
"0.7129188",
"0.7001336",
"0.68518764",
"0.6811382",
"0.6810663",
"0.66477114",
"0.6643653",
"0.6589809",
"0.6589809",
"0.6589809",
"0.6571782",
"0.6525661",
"0.65103686",
"0.6508231",
"0.64842504",
"0.6417367",
"0.64106673",
"0.6394431",
"0.6385482",
"0.6375603",
"0.63564086... | 0.0 | -1 |
Returns the value of the top most element of the stack | def peek(self):
if self.top is None:
raise IndexError("peek from empty")
else:
return self.top.value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top(stack):\n if empty_stack(stack):\n raise IndexError(\"Stack is empty!\")\n else:\n return stack.top.value",
"def top(self):\n if self.stack == []:\n return None\n return self.stack[-1]",
"def top(self) -> Any:\n try:\n return self._data[-1]... | [
"0.8848893",
"0.84465754",
"0.8427697",
"0.8382203",
"0.8364697",
"0.8349785",
"0.8341653",
"0.82897216",
"0.8259051",
"0.8245945",
"0.8240611",
"0.81573904",
"0.8107842",
"0.80739635",
"0.80739635",
"0.80600196",
"0.8057762",
"0.7991178",
"0.7984346",
"0.7955297",
"0.7883293... | 0.772541 | 22 |
Returns whether or not the stack is empty | def isEmpty(self):
return self._len == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.the_stack) == 0",
"def is_empty(self):\n return len(self.stack) == 0",
"def empty(self):\r\n return len(self.stack) == 0",
"def empty(self):\n return len(self.stack) == 0",
"def empty(self):\n return len(self.stack) == 0",
"def empt... | [
"0.92653126",
"0.9214829",
"0.9145256",
"0.910661",
"0.910661",
"0.9087219",
"0.90427834",
"0.903481",
"0.89923906",
"0.89494544",
"0.8856016",
"0.8850572",
"0.8840251",
"0.88373005",
"0.88154143",
"0.88125634",
"0.8808817",
"0.87881815",
"0.87744504",
"0.87744504",
"0.876389... | 0.0 | -1 |
Gets the token_type of this Token. | def token_type(self) -> str:
return self._token_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_type(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"token_type\")",
"def token_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"token_type\")",
"def token_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"token_type\"... | [
"0.82482535",
"0.81942713",
"0.81942713",
"0.7848631",
"0.7748776",
"0.7332968",
"0.7165366",
"0.69898933",
"0.6828592",
"0.6828592",
"0.6789685",
"0.67495817",
"0.6668206",
"0.66607594",
"0.6660645",
"0.6660645",
"0.6659596",
"0.66294986",
"0.6627386",
"0.65947294",
"0.65587... | 0.8853833 | 1 |
Sets the token_type of this Token. | def token_type(self, token_type: str):
if token_type is None:
raise ValueError("Invalid value for `token_type`, must not be `None`") # noqa: E501
self._token_type = token_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_type(self, token_type):\n if self.local_vars_configuration.client_side_validation and token_type is None: # noqa: E501\n raise ValueError(\"Invalid value for `token_type`, must not be `None`\") # noqa: E501\n\n self._token_type = token_type",
"def auth_token_validator_type(se... | [
"0.7898236",
"0.70429343",
"0.6997586",
"0.6997586",
"0.68130374",
"0.68130374",
"0.6798993",
"0.65808195",
"0.63278085",
"0.6291034",
"0.6291034",
"0.625069",
"0.625069",
"0.6217216",
"0.6217216",
"0.6217216",
"0.6217216",
"0.6217216",
"0.6217216",
"0.6217216",
"0.6217216",
... | 0.85196644 | 1 |
Gets the token_data of this Token. | def token_data(self) -> TokenData:
return self._token_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_token_data(self):\n raise NotImplementedError('Method \"get_token_data\" must be implemented in any derived class')",
"def __get_token_data__(self):\n raise Exception(\"Implement me!\")",
"def get_token(self):\n return self.__token",
"def get_token(self):\n return self.__t... | [
"0.8125697",
"0.72108555",
"0.7193326",
"0.7193326",
"0.71916693",
"0.7115067",
"0.70763254",
"0.70763254",
"0.70763254",
"0.7040364",
"0.70020586",
"0.69536346",
"0.6840766",
"0.6772533",
"0.6772533",
"0.6772533",
"0.6772533",
"0.6750777",
"0.67353415",
"0.67353415",
"0.6735... | 0.9228936 | 0 |
Sets the token_data of this Token. | def token_data(self, token_data: TokenData):
self._token_data = token_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token(self, token):\n\n self._token = token",
"def token(self, token):\n\n self._token = token",
"def set_data(self, data):\n self.data = data",
"def set_data(self, data):\n\n self._data = data",
"def set_data(self, data):\n\n self._data = data",
"def set_data(self,... | [
"0.73837405",
"0.73837405",
"0.68396115",
"0.6821606",
"0.6821606",
"0.6821606",
"0.68169135",
"0.6801668",
"0.67623466",
"0.67623466",
"0.6737896",
"0.67189944",
"0.6696196",
"0.669293",
"0.66883206",
"0.66626894",
"0.6632083",
"0.64813954",
"0.64813954",
"0.64813215",
"0.64... | 0.8994774 | 0 |
Index page of the app | def todos_index_page():
return render_template(
template_name_or_list='index.html',
todos=Todo.index(mongo.db)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index():\r\n return render_template('index.html')",
"def index():\n return render_template('index.html')",
"def index():\n return render_template('index.html', title='Home')",
"def index():\n\treturn render_template(\"index.html\", title=\"Home\")",
"def index():\n r... | [
"0.8410845",
"0.83959925",
"0.8390335",
"0.8381064",
"0.83672357",
"0.83672357",
"0.8362487",
"0.83019596",
"0.82938606",
"0.82519364",
"0.82487863",
"0.8244747",
"0.82357043",
"0.82357043",
"0.8230237",
"0.822754",
"0.818534",
"0.818534",
"0.818534",
"0.8172627",
"0.816406",... | 0.0 | -1 |
Check wheter this processor is responsible for update. true if update contains a message. | def responsible_for(update):
return update.message | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_update(self):\n return self.action in [\"update\", \"partial_update\"]",
"def needs_update(self) -> bool:\n return False",
"def hasChanged(self):\r\n if self.is_updated:\r\n self.is_updated = False\r\n return True\r\n else:\r\n return False\r\... | [
"0.709764",
"0.701449",
"0.6746119",
"0.6636625",
"0.66039455",
"0.6593684",
"0.6564156",
"0.6514355",
"0.6503613",
"0.6433604",
"0.64049643",
"0.63707995",
"0.6364584",
"0.63562626",
"0.6347093",
"0.6309343",
"0.6301806",
"0.6296973",
"0.6215552",
"0.6156972",
"0.61447686",
... | 0.5998254 | 28 |
Initializes a constant agent which returns a constant action of the provided shape. | def __init__(
self,
states_spec,
actions_spec,
batched_observe=1000,
scope='constant',
action_values=None
):
if action_values is None:
raise TensorForceError("No action_values for constant model provided.")
self.action_values = action_valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, env, state_shape, action_shape, player_id:int=1, policy=None, cuda=False):\n super().__init__(env=env, player_id=player_id)\n\n # Automatic default policy\n self.__default_policy__ = PolicyCategorical\n if policy is None:\n policy = self.__default_policy__(... | [
"0.5991871",
"0.59620297",
"0.58393246",
"0.5815698",
"0.57411337",
"0.563758",
"0.5576354",
"0.556133",
"0.54827785",
"0.5478818",
"0.54765797",
"0.54595715",
"0.5445469",
"0.54297155",
"0.5401047",
"0.53965443",
"0.5388863",
"0.53772676",
"0.5372401",
"0.5354815",
"0.528311... | 0.68296087 | 0 |
Return the pvname associated with parname. | def get_pvname(self, parname=None, sep="."):
if parname is None:
return self.pvname
return sep.join((self.pvname, motor_params[parname][0])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_par(self, parname, sep=\".\"):\n pvobj = self.get_pvobj(parname, sep)\n pvobj.wait_ready(1)\n return pvobj.value",
"def vpd_name(self) -> str:\n return pulumi.get(self, \"vpd_name\")",
"def _get_full_pv_name(self, pv_name):\n if pv_name and \"://\" not in pv_name:\n pv... | [
"0.6914291",
"0.66231906",
"0.65711564",
"0.651787",
"0.63923377",
"0.60865366",
"0.60840416",
"0.6078549",
"0.6034939",
"0.6034939",
"0.6034939",
"0.60186833",
"0.6002732",
"0.6002732",
"0.5994977",
"0.5983542",
"0.5983542",
"0.5983542",
"0.5983542",
"0.5983542",
"0.59449613... | 0.83567536 | 0 |
This method generate a randomized deck of cards | def generate_deck(suits=4, type_cards=13):
cards = []
for suite in range(suits):
for type_card in range(1, type_cards+1):
# Setting the key-value pair for every card
if (type_card == 1):
cards.append({'A':type_cards+1})
elif (type_card == 11):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_deck(number = 1):\n deck = []\n for suit, face in itertools.product(suit_names, face_names):\n if face == \"Ace\":\n value = 11\n elif face in ['Jack', 'Queen', 'King']:\n value = 10\n else:\n value = int(face)\n img = Image(img_path+su... | [
"0.784826",
"0.7830937",
"0.78279245",
"0.76797956",
"0.76630664",
"0.76499367",
"0.7572995",
"0.754555",
"0.74657416",
"0.74532825",
"0.7434322",
"0.7377199",
"0.7374861",
"0.7367785",
"0.7348301",
"0.7316936",
"0.72867274",
"0.7277025",
"0.7203634",
"0.7203634",
"0.7203634"... | 0.719946 | 23 |
Tiles given weights along 'units' dimension. | def _GetNonMonotonicInitializer(self, weights):
dims = len(weights)
def Initializer(shape, dtype):
_, lattice_sizes, num_inputs, num_terms = shape
units = num_inputs // dims
# Create expanded weights, tile, reshape, return.
return tf.reshape(
tf.tile(
tf.constant... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_weights(num_tilings, tiles_per_dim, num_dims, num_actions):\n weights = np.zeros((num_tilings*tiles_per_dim**num_dims*num_actions))\n return weights",
"def tiles(west, south, east, north, zooms, provider_bounds, truncate=False):\n if truncate:\n west, south = truncate_xy(west, south, pr... | [
"0.5967534",
"0.57707137",
"0.5635389",
"0.5605839",
"0.54857236",
"0.5379514",
"0.53557086",
"0.5353093",
"0.5316037",
"0.5291093",
"0.52770966",
"0.52718365",
"0.52517474",
"0.52391493",
"0.51545787",
"0.5111979",
"0.50687957",
"0.50564593",
"0.5056225",
"0.5048586",
"0.504... | 0.0 | -1 |
Tests instances after using to_dict conversion | def test_after_todict(self):
my_model = BaseModel()
new_model = BaseModel()
test_dict = my_model.to_dict()
self.assertIsInstance(my_model, BaseModel)
self.assertEqual(type(my_model).__name__, "BaseModel")
self.assertEqual(test_dict['__class__'], "BaseModel")
self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_dict_to_instance(self):\n r = Review()\n r_dictionary = r.to_dict()\n r2 = Review(**r_dictionary)\n self.assertEqual(type(r), type(r2))",
"def test_to_dictAmenity(self):\n insta = Amenity()\n dict_cont = insta.to_dict()\n self.assertEqual(type(dict_cont),... | [
"0.7749703",
"0.73173213",
"0.73015094",
"0.7293858",
"0.7283153",
"0.72653836",
"0.7218791",
"0.71618503",
"0.7146502",
"0.70662636",
"0.70602334",
"0.7034339",
"0.6985194",
"0.69555855",
"0.6932088",
"0.69316864",
"0.6894538",
"0.6890294",
"0.6886384",
"0.6867644",
"0.68270... | 0.7245311 | 6 |
Convert from UTC to PST. | def utc_to_pst(df):
pst = (
pd
.to_datetime(df['ds'])
.subtract(pd.Timedelta('8 hours'))
)
return pst | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def localtime2utc(date):\n return date + (datetime.utcnow() - datetime.now())",
"def local_to_utc(local_dt):\n local_dt = local_dt.replace(tzinfo=tz.tzlocal())\n return local_dt.astimezone(tz.tzlocal())",
"def convert_naive_local_to_utc_timestamp(year, month, day, hour, minutes, seconds):\n ... | [
"0.591414",
"0.5673533",
"0.5554261",
"0.54776263",
"0.53988117",
"0.53703845",
"0.53623194",
"0.5322138",
"0.531382",
"0.52993125",
"0.52867246",
"0.52749634",
"0.5269944",
"0.5268663",
"0.52622014",
"0.521339",
"0.520569",
"0.520569",
"0.5196036",
"0.5193117",
"0.5192021",
... | 0.68597245 | 0 |
Renders the home page which is the CNS of the web app currently, nothing pretty. | def home():
form = SubmissionForm(request.form)
# Form has been submitted
if request.method == 'POST' and form.validate():
# Plug in the data into a dictionary object
# - data from the input form
# - text data must be converted to lowercase
data = {
"Inputs": {
"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_home():\r\n\treturn render_template(\"index.html\")",
"def home():\n\n return render_template('home_page.html')",
"def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\t\t\t\t year=datetime.now().year)",
"def home():\n return render_template('homepage.html')",
"... | [
"0.8200085",
"0.80594796",
"0.80502856",
"0.80343944",
"0.803274",
"0.79780376",
"0.7974957",
"0.7965331",
"0.793906",
"0.7928867",
"0.7914779",
"0.79093885",
"0.7894522",
"0.7893631",
"0.7893631",
"0.7885817",
"0.7885817",
"0.7883246",
"0.7879107",
"0.7879107",
"0.7879107",
... | 0.0 | -1 |
Renders the about page. | def about():
return render_template(
'about.html',
title='About',
year=datetime.now().year,
message='Your application description page.'
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def about():\n return render_template('about.html', title='About')",
"def about():\n\n return render_template('about_page.html', title='About')",
"def about():\n\n\treturn render_template(\"about.html\")",
"def on_about(self):\n render_about_window()",
"def about():\n return render_temp... | [
"0.85650355",
"0.85034525",
"0.84489655",
"0.84044397",
"0.8394454",
"0.82935613",
"0.82680845",
"0.8243358",
"0.8239194",
"0.8224137",
"0.82079816",
"0.8204868",
"0.8173699",
"0.8172736",
"0.80967313",
"0.80501616",
"0.80501616",
"0.80501616",
"0.80501616",
"0.80501616",
"0.... | 0.82709616 | 16 |
Sets an image's anchor point to its center | def center_image(image):
image.anchor_x = image.width / 2
image.anchor_y = image.height / 2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_anchor_center(img):\n img.anchor_x = int(img.width / 2)\n img.anchor_y = int(img.height / 2)",
"def center_image_anchor(image):\n image.anchor_x = image.height/2\n image.anchor_y = image.height/2",
"def center_image(image):\n image.anchor_x = image.width/2\n image.anchor_y = image.he... | [
"0.90294266",
"0.88902074",
"0.8374858",
"0.77350885",
"0.6867228",
"0.6867228",
"0.6867228",
"0.6599151",
"0.6545185",
"0.64940906",
"0.6492981",
"0.64907575",
"0.64504904",
"0.64468896",
"0.63265204",
"0.62879276",
"0.626176",
"0.62339115",
"0.6182414",
"0.6159055",
"0.6134... | 0.84555244 | 3 |
Convert a scenario to an OSM xml document. | def __call__(self, scenario):
self.osm = OSM()
self.lanelet_network = scenario.lanelet_network
self.first_nodes = dict() # saves first left and right node
self.last_nodes = dict() # saves last left and right node
self.left_ways = dict()
self.right_ways = dict()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main(self):\n root = etree.Element(\"OpenSCENARIO\")\n self.get_header(root)\n self.get_parameter_declarations(root)\n etree.SubElement(root, \"CatalogLocations\")\n self.get_road_network(root)\n self.get_entities(root)\n storyboard = etree.SubElement(root, \"St... | [
"0.5644972",
"0.5342896",
"0.51407355",
"0.5134849",
"0.511551",
"0.510339",
"0.51001364",
"0.50381887",
"0.49696374",
"0.49397066",
"0.4937171",
"0.49292958",
"0.48394686",
"0.48051918",
"0.4793238",
"0.4779189",
"0.47294244",
"0.4709506",
"0.47045374",
"0.46894932",
"0.4683... | 0.72085524 | 0 |
Loads JSON if the content of the file if JSON, otherwise just loads the string representation | def read(self):
with open(self._path, 'r') as f:
content = os.linesep.join(f.readlines())
try:
return json.loads(content)
except json.JSONDecodeError:
return content | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_json_file(self, file, default_content=None):\n if os.path.isfile(file) and os.path.getsize(file):\n with open(file, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n return default_content",
"def load(file, **kwargs):\n extension = os.path.splitext(file)... | [
"0.7703119",
"0.74735206",
"0.74170816",
"0.74029106",
"0.738915",
"0.73819727",
"0.7353916",
"0.73363346",
"0.73288053",
"0.7272153",
"0.7267699",
"0.72463596",
"0.7227746",
"0.719896",
"0.7166707",
"0.71607214",
"0.7149143",
"0.7135173",
"0.7123975",
"0.71158916",
"0.710457... | 0.0 | -1 |
Compare eq for dict. | def __eq__(self, other) -> bool:
# pylint: disable=protected-access
return isinstance(other, type(self)) and self._key == other._key | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_01_is_equal_true(self):\n\n dict1 = {\"a\": \"1\", \"b\": \"2\"}\n dict2 = {\"a\": \"1\", \"b\": \"2\"}\n items_equal = utils.is_equal(dict1, dict2)\n self.assertTrue(items_equal)",
"def __eq__(self, other):\n return dict.__eq__(self, other)",
"def equals_dict(self, ... | [
"0.70912904",
"0.70857626",
"0.68653953",
"0.6839955",
"0.6791464",
"0.6754745",
"0.668604",
"0.6681262",
"0.665515",
"0.6578432",
"0.65116024",
"0.6511463",
"0.6479654",
"0.6474791",
"0.64423645",
"0.6438431",
"0.6431704",
"0.64313036",
"0.6405253",
"0.6380307",
"0.63631415"... | 0.0 | -1 |
Create a default margin of zero. | def __init__(self) -> None:
self.gap = '' # type: str
self.pixels(0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def margin(self):\r\n return self._generate_spacing_info(self.config['margin'])",
"def getMargin(self):\n assert False",
"def DimStyle0(self):\n\t\treturn self.Space(0)",
"def _nuke_set_zero_margins(widget_object):\n\tparentApp = QtWidgets.QApplication.allWidgets()\n\tparentWidgetList = []\n\tf... | [
"0.6792134",
"0.65760887",
"0.6375985",
"0.6359635",
"0.6335977",
"0.6145928",
"0.60265803",
"0.5932651",
"0.59083045",
"0.58943087",
"0.58306414",
"0.58170927",
"0.58042586",
"0.5796273",
"0.57542264",
"0.5723986",
"0.5654332",
"0.5563231",
"0.5546722",
"0.5525178",
"0.55242... | 0.49146858 | 82 |
Set the margin in pixels. | def pixels(self, value: int) -> 'Gap':
raise_not_number(value)
self.gap = '{}px'.format(value)
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_margin(self, margin):\n _pal.lib.geometry_set_margin(self._geometry, c.c_float(margin))",
"def change_margin(self, margin):\n self.margin = margin * self._MM_IN_MICRONS\n\n self._create_drawing_area()\n self.partition(self.rows, self.cols)",
"def margin(self):\r\n ret... | [
"0.8208623",
"0.7635874",
"0.759428",
"0.7373291",
"0.72563547",
"0.7245858",
"0.72380984",
"0.7235281",
"0.7143932",
"0.6982436",
"0.6961663",
"0.6943389",
"0.6905781",
"0.6893873",
"0.67863876",
"0.6718553",
"0.6711763",
"0.6685608",
"0.65913993",
"0.65608954",
"0.6481791",... | 0.59170365 | 36 |
Represent the margin to be inserted into a JSX template. | def __repr__(self) -> str:
return self.gap | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def margin(self):\r\n return self._generate_spacing_info(self.config['margin'])",
"def get_margin(self):\n return unicode(self._visual_indent * 20)",
"def margins(value):\r\n if value.isNull():\r\n return '(Null)'\r\n return '({}, {}, {}, {})'.format(value.left(), value.t... | [
"0.7419509",
"0.6592418",
"0.6526396",
"0.6432177",
"0.62934655",
"0.6167668",
"0.6145292",
"0.6131973",
"0.6080773",
"0.6066616",
"0.5854853",
"0.5812037",
"0.5805815",
"0.57474554",
"0.5747355",
"0.568962",
"0.56720114",
"0.5665759",
"0.5589268",
"0.55741847",
"0.5562013",
... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.