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 |
|---|---|---|---|---|---|---|
Unpack an 8 bit integer. | def u8(value: bytes, endian: str = "little", sign: bool = False) -> int:
return unpack(value, 8, endian, sign) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unpack_int8(data):\n value = unpack(DecodeUtils.INT8_BYTE_FORMAT, data[:1])[0]\n return value, 1",
"def unpack_uint8(data):\n value = unpack(DecodeUtils.UINT8_BYTE_FORMAT, data[:1])[0]\n return value, 1",
"def ReadInt8(self, endian=\"<\"):\n return self.unpack('%sb' % end... | [
"0.7935619",
"0.7624533",
"0.69614124",
"0.6757723",
"0.6754148",
"0.6754148",
"0.67517203",
"0.6714144",
"0.6571568",
"0.64756215",
"0.64684594",
"0.6415871",
"0.6414337",
"0.64",
"0.63875854",
"0.63492674",
"0.62968296",
"0.62938625",
"0.6200666",
"0.61871505",
"0.6161569",... | 0.71732724 | 2 |
Unpack a 64 bit integer. | def u64(value: bytes, endian: str = "little", sign: bool = False) -> int:
return unpack(value, 64, endian, sign) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unpack_int64(data):\n value = unpack(DecodeUtils.INT64_BYTE_FORMAT, data[:8])[0]\n return value, 8",
"def ReadInt64(self, endian=\"<\"):\n return self.unpack('%sq' % endian, 8)",
"def unpack64(data):\n\treturn struct.unpack('<Q', data)[0]",
"def decode_i64(as_bytes: typing.List[int])... | [
"0.77930623",
"0.7212262",
"0.6988175",
"0.68668485",
"0.67630064",
"0.65976274",
"0.65869117",
"0.6542752",
"0.6467777",
"0.6450494",
"0.631488",
"0.62452245",
"0.6222874",
"0.6221238",
"0.61923754",
"0.61922246",
"0.6127858",
"0.6076253",
"0.60701835",
"0.60701835",
"0.6040... | 0.7342726 | 1 |
Returns whether or not the group is currently muted | async def get_mute(self, group_id: int) -> bool:
results = await self._api.call('group', 'get_mute', gid=group_id)
return results.header.vars.get('state') == 'on' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def muted(self) -> bool:\n return self._muted",
"def is_muted(self):\n return self.muting_handler.is_muted()",
"def is_muted(self):\n # type: () -> bool\n return self._is_muted",
"def isMuted(self):\n return self._isMuted",
"def is_volume_muted(self):\n return self... | [
"0.82060486",
"0.7902248",
"0.7778891",
"0.77541435",
"0.77435714",
"0.77433336",
"0.7736492",
"0.7736492",
"0.7736492",
"0.76979184",
"0.7504682",
"0.7495899",
"0.7357085",
"0.6853823",
"0.6839233",
"0.6755185",
"0.670104",
"0.6700856",
"0.64677656",
"0.62433064",
"0.6210645... | 0.70657253 | 13 |
Sets the volume level on the group | async def set_volume(self, group_id: int, level: int) -> None:
if not self.VOLUME_MIN <= level <= self.VOLUME_MAX:
raise ValueError(f'Level must be between {self.VOLUME_MIN} and {self.VOLUME_MAX}')
await self._api.call('group', 'set_volume', gid=group_id, level=level) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_volume_level(self, level):\n self._remote.volume(int(level * 60))",
"async def async_set_volume_level(self, volume: float) -> None:\n await self._group.set_volume(round(volume * 100))\n self.async_write_ha_state()",
"def set_volume_level(self, volume):\n self._volume = volum... | [
"0.7835308",
"0.7779876",
"0.76944256",
"0.76944256",
"0.76304144",
"0.7603562",
"0.7572225",
"0.75515115",
"0.75143075",
"0.74580747",
"0.7423177",
"0.7382089",
"0.7375795",
"0.7352901",
"0.7254881",
"0.72219044",
"0.71914285",
"0.7054412",
"0.7046454",
"0.70393115",
"0.6960... | 0.8247164 | 0 |
If user is going to /profile anyway, don't redirect them | def test_no_redirect_profile(self):
self.create_user_and_login(
agreed_to_terms_of_service=True,
filled_out=False
)
resp = self.client.get(PROFILE_URL)
assert resp.status_code == 200 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login_success(request):\n if not hasattr(request.user, 'profile'):\n return redirect('index')\n else:\n return redirect('registration_process')",
"def me():\n if g.USER:\n return redirect(url_for(\"profile\", username=g.USER.username))\n return redirect(url_for(\"home\"))",
... | [
"0.7255817",
"0.72039914",
"0.6965785",
"0.6909972",
"0.6901148",
"0.6867212",
"0.6866252",
"0.68644387",
"0.6722343",
"0.65752923",
"0.65680116",
"0.65494317",
"0.6506799",
"0.65036356",
"0.6487468",
"0.6420049",
"0.6398205",
"0.6394704",
"0.63742226",
"0.63365525",
"0.63306... | 0.6748943 | 8 |
Test if num is a power of 2. (int > bool) | def is_power2(num):
num = int(num)
return num != 0 and ((num & (num - 1)) == 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_power_of_2(num: int) -> bool:\n return ((num & (num - 1)) == 0) and num > 0",
"def isPower2(num):\n\treturn ((num & (num - 1)) == 0) and num > 0",
"def isPower2(num):\n\treturn ((num & (num - 1)) == 0) and num > 0",
"def is_power_of_two(n):\n if n < 0:\n return False\n else:\n r... | [
"0.8742579",
"0.8739187",
"0.8739187",
"0.8265603",
"0.82158875",
"0.79109615",
"0.79091007",
"0.78798586",
"0.78774834",
"0.78754234",
"0.76183957",
"0.6965005",
"0.6939847",
"0.68730646",
"0.68239594",
"0.67543066",
"0.6735248",
"0.67183286",
"0.66449463",
"0.6576456",
"0.6... | 0.8712512 | 3 |
Compute the smallest power of 2 >= to num.(float > int) | def next_power2(num):
return 2 ** int(np.ceil(np.log2(num))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _nearest_bigger_power_of_two(x: int) -> int:\n y = 2\n while y < x:\n y *= 2\n return y",
"def _find_nearest_power_of_two(x):\n\n return 1 << (x - 1).bit_length()",
"def is_power_of_2(x):\n return x == get_lowest_one_mask(x)",
"def _next_power_of_two(self, n):\n if n == 0:\n ... | [
"0.7385786",
"0.73798734",
"0.73216134",
"0.7192021",
"0.7186426",
"0.70581555",
"0.7045594",
"0.7013145",
"0.69955385",
"0.68677104",
"0.68614525",
"0.67954695",
"0.6760385",
"0.6760385",
"0.67593217",
"0.67382836",
"0.67181736",
"0.67164856",
"0.663026",
"0.658525",
"0.6568... | 0.7663828 | 0 |
Return a filepath to a cute picture of an animal. If a message is provided, will try to parse the message for an animal we have registered and try to find a picture of the animal. If the message does not contain an animal we have registered, or is not provided, will return a picture for a random animal from our choices... | def get_cute_animal_picture(self, message=None):
animal = None
if message:
animal = self._get_animal_from_message(message)
if animal is None:
animal = random.choice(self.animals)
# Get a random image for the animal specified
img_directory = '{}/{}'.form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_animal_from_message(self, message):\n animal = None\n\n # Try to find an animal from our inventory in the message\n find_animal_regex = r'({animals})'.format(animals='|'.join(self.animals))\n ret = re.findall(find_animal_regex, message)\n\n # re.findall return is a list ... | [
"0.65964687",
"0.6558159",
"0.62370455",
"0.62126964",
"0.59554297",
"0.59009993",
"0.5867215",
"0.58375984",
"0.56845075",
"0.5646861",
"0.5548076",
"0.5523026",
"0.55105233",
"0.54953235",
"0.5467597",
"0.5414916",
"0.53987855",
"0.53573287",
"0.5356251",
"0.53278863",
"0.5... | 0.87228394 | 0 |
Given a message parse the string to find if the message contains an animal in our choices list. If we can't find an animal from our choices in the text, return None. | def _get_animal_from_message(self, message):
animal = None
# Try to find an animal from our inventory in the message
find_animal_regex = r'({animals})'.format(animals='|'.join(self.animals))
ret = re.findall(find_animal_regex, message)
# re.findall return is a list of matching ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_choice(choices: list, choice: str):\n if choice == \"1\":\n return 0\n \n if choice == \"2\":\n return 1\n\n choices = list(map(str.lower, choices))\n words = list(map(str.split, choices))\n\n # Go through all words in the given message, and find any words unique to a choice... | [
"0.606461",
"0.5299773",
"0.52959967",
"0.51993984",
"0.50815886",
"0.5071449",
"0.5029537",
"0.50161564",
"0.49730578",
"0.49722525",
"0.4935244",
"0.49352235",
"0.49296334",
"0.49292344",
"0.4914024",
"0.48905495",
"0.48655167",
"0.4861523",
"0.48423055",
"0.4836423",
"0.48... | 0.7347285 | 0 |
Returns the amount of money we get in case of a coupon payment | def cash_coupon(certificate, percentage):
return sum(stake for name, stake in certificate['underlyings'].items()) * percentage | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stripe_payment_amount(self):\n return int(round(self.payment * 100, 0))",
"def discount_amount(self):\r\n customer = self.records.find_customers(str(self.__customer).strip())\r\n order_value = self.order_value\r\n discount = customer.get_discount(order_value)\r\n return disco... | [
"0.7044716",
"0.6959202",
"0.67286813",
"0.6720781",
"0.66810477",
"0.6679439",
"0.65815043",
"0.65780234",
"0.6560561",
"0.65283465",
"0.6497476",
"0.64899194",
"0.64650804",
"0.64188606",
"0.6411846",
"0.64080226",
"0.63927466",
"0.63927466",
"0.6348151",
"0.6330993",
"0.63... | 0.60244745 | 49 |
Returns the minimax action using self.depth and self.evaluationFunction | def getAction(self, gameState):
"*** YOUR CODE HERE ***"
def max_val(agent, depth, game_state, alpha, beta):
v = float("-inf")
for newState in game_state.getLegalActions(agent):
value = pruning_alpha_beta(1, depth, game_state.generateSuccessor(agent, newState), al... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAction(self, gameState: GameState):\n _max = float(\"-inf\")\n action = None\n for move in gameState.getLegalActions(0):\n util = minimax(self.evaluationFunction, 1, 0,\n gameState.generateSuccessor(0, move), self.depth)\n if util > _max o... | [
"0.7482665",
"0.7383559",
"0.71806973",
"0.7110041",
"0.70884514",
"0.70694935",
"0.70683014",
"0.7048308",
"0.70055133",
"0.69651455",
"0.69642085",
"0.69604385",
"0.6945924",
"0.68998593",
"0.6895832",
"0.688605",
"0.6826282",
"0.6767276",
"0.6758028",
"0.6751636",
"0.67054... | 0.0 | -1 |
Normalizes values of array x in the range 0...1 for each entry along axis. | def normalize_axis(x, axis, dtype=float):
x = x.astype(dtype)
ind_list = [slice(None) for i in range(x.ndim)]
try:
for i in range(x.shape[axis]):
ind_list[axis] = i
ind = tuple(ind_list)
minn = x[ind].min()
maxx = x[ind].max()
x[ind] = (x[i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalise(x):\n return (x - jnp.min(x)) / (jnp.max(x) - jnp.min(x))",
"def normalise(x):\n x = np.copy(x)\n n_cols = x.shape[1]\n for col_index in range(n_cols):\n col = x[:, col_index]\n factor = np.max(col)\n x[:, col_index] = col / factor\n\n return x",
"def normalize... | [
"0.8137932",
"0.8125129",
"0.80050844",
"0.79591656",
"0.7941651",
"0.79366153",
"0.7924594",
"0.78650326",
"0.7789366",
"0.7735067",
"0.7685656",
"0.7579968",
"0.7575515",
"0.7575515",
"0.7495279",
"0.7493347",
"0.74757946",
"0.74170405",
"0.74170405",
"0.74170405",
"0.73780... | 0.73843914 | 20 |
initialize a UnannotatedDataset instance | def __init__(self,
root,
spect_paths,
window_size,
spect_key='s',
timebins_key='t',
transform=None,
target_transform=None,
):
super().__init__(root, transform=transform, target... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.__dataset = None",
"def __init__(self, dataset: Dataset):\n self.dataset = dataset",
"def __init__(self, dataset):\n self._dataset = dataset",
"def __init__(self, unencoded_dataset): \n self._unencoded_dataset = unencoded_dataset\n self._plain_tr... | [
"0.7326177",
"0.7300945",
"0.7279701",
"0.6786179",
"0.664395",
"0.663583",
"0.65546256",
"0.6495789",
"0.64646125",
"0.640933",
"0.638711",
"0.63490206",
"0.62937415",
"0.6206585",
"0.62022907",
"0.61671495",
"0.6136067",
"0.6134071",
"0.61328566",
"0.6124787",
"0.6114436",
... | 0.0 | -1 |
Return True if the queen at column c clashes with any queen to its left. | def col_clashes(bs, c):
for i in range(c): # Look at all columns to the left of c
if share_diagonal(c,bs[c],i, bs[i]):
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isfree(col,queens):\n if col in queens:\n return False\n elif any([ abs(col-col1)==len(queens)-index for index,col1 in enumerate(queens)]):\n #c[r]==c[j]; r-j==c[r]-c[j]; r-j==c[j]-c[r]\n # col is the colomn to check; len(queens) just be the row index of col, dont subtract 1\n ... | [
"0.77055407",
"0.72922397",
"0.7145801",
"0.70153964",
"0.6985228",
"0.6902115",
"0.66958386",
"0.65576535",
"0.6551649",
"0.6548673",
"0.6523149",
"0.6523149",
"0.6522317",
"0.6519715",
"0.65155363",
"0.6512403",
"0.6512403",
"0.65036315",
"0.6501785",
"0.64987516",
"0.64938... | 0.6355316 | 34 |
Iterator, chunks repeated values | def runs(lst):
for j, two in enumerate(lst):
if j == 0:
one, i = two, 0
if one != two:
yield j - i, one
i = j
one = two
yield j - i + 1, two | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk_data(self):\n for n in range(0, len(self.data) + 1, len(self.data) //\n self.num_of_chunks):\n yield self.data[0 + n:len(self.data) // self.num_of_chunks + n]",
"def chunk(it, size):\n\tit = iter(it)\n\treturn iter(lambda: tuple(islice(it, size)), ())",
"def g... | [
"0.7251167",
"0.7177626",
"0.7130785",
"0.71232283",
"0.70711863",
"0.7048549",
"0.7034991",
"0.70266014",
"0.69485027",
"0.68571484",
"0.6856559",
"0.68546176",
"0.68392646",
"0.6785348",
"0.6776854",
"0.6776614",
"0.67567474",
"0.6746808",
"0.6745287",
"0.6741101",
"0.67285... | 0.0 | -1 |
function returns string on welcome page | def home():
return "Alive!" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def welcome():\n return (\n f\"Welcome to the 'Surf's Up' Climate App! <br/>\"\n f\"Available Routes:<br/>\"\n f\"For Precipiations Data from the Last 12 Months: /api/v1.0/precipitation <br/>\"\n f\"For A Complete List of Stations: /api/v1.0/stations <br/>\"\n f\"For Temperatu... | [
"0.78411657",
"0.7768572",
"0.7749537",
"0.7742824",
"0.77248496",
"0.77228695",
"0.7714821",
"0.7713833",
"0.7683574",
"0.7633418",
"0.7607578",
"0.7597735",
"0.75628895",
"0.7538602",
"0.7535203",
"0.7534152",
"0.7504829",
"0.7495256",
"0.74878114",
"0.74811184",
"0.7469224... | 0.70254123 | 87 |
returns the result of x^y mod n | def modexp(x,y,n):
if y == 0: return 1
partial = modexp(x, y/2, n)
if y%2 == 0: return (partial**2) % n
else: return (x*partial**2) % n | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modular_exponentiation(x, y, n):\r\n result = 1\r\n while y > 0:\r\n if y & 1 == 1:\r\n result = (result * x) % n\r\n\r\n y = y >> 1\r\n x = (x * x) % n\r\n return result",
"def modpow(a, n, p):\n res = 1\n a = a % p\n while n > 0:\n # if n is odd\n ... | [
"0.8080248",
"0.7587051",
"0.7483047",
"0.74777716",
"0.7475592",
"0.74505883",
"0.7444581",
"0.7435717",
"0.7407008",
"0.7386572",
"0.73720056",
"0.7300809",
"0.7291958",
"0.7258364",
"0.7253965",
"0.72051156",
"0.72027093",
"0.71822876",
"0.71670157",
"0.7127054",
"0.709578... | 0.7542747 | 2 |
Compute the softmax of each element along an axis of X. | def softmax(X, axis):
y = np.atleast_2d(X)
# subtract the max for numerical stability
y = y - np.expand_dims(np.max(y, axis = axis), axis)
# exponentiate y
y = np.exp(y)
# take the sum along the specified axis
ax_sum = np.expand_dims(np.sum(y, axis = axis), axis)
# finally: divide elemen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(self, x):\n\n out = np.zeros(x.shape)\n for i in range(x.shape[0]):\n max_x = x[i] - np.max(x[i])\n out[i] = np.exp(max_x) / np.sum(np.exp(max_x), axis=0)\n\n return out",
"def softmax(x: npt.NDArray) -> npt.NDArray:\n row_wise_max = np.max(x, axis=1).res... | [
"0.8648168",
"0.8523443",
"0.8501356",
"0.845101",
"0.8424965",
"0.8401308",
"0.83822155",
"0.83788544",
"0.8372522",
"0.83631027",
"0.835532",
"0.8344603",
"0.8326291",
"0.8309666",
"0.82737535",
"0.8272703",
"0.82659155",
"0.824838",
"0.824838",
"0.8244414",
"0.82432497",
... | 0.8110068 | 61 |
Test that the copy name is based on the data model if the original subject doesn't have a name. | def test_copy_without_name(self):
self.subject["name"] = ""
subject_copy = copy_subject(self.subject, self.DATA_MODEL)
self.assertEqual("Software (copy)", subject_copy["name"]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_copy_without_name_change(self):\n subject_copy = copy_subject(self.subject, self.DATA_MODEL, change_name=False)\n self.assertEqual(\"Subject\", subject_copy[\"name\"])",
"def test_copy_name(self):\n subject_copy = copy_subject(self.subject, self.DATA_MODEL)\n self.assertEqual... | [
"0.88873017",
"0.8691286",
"0.7811251",
"0.77832234",
"0.7486555",
"0.7380365",
"0.7351881",
"0.7196302",
"0.70959884",
"0.6792372",
"0.6631461",
"0.65845174",
"0.62648475",
"0.5981978",
"0.59408563",
"0.59408563",
"0.5894436",
"0.58697796",
"0.586741",
"0.5839228",
"0.581219... | 0.8606052 | 2 |
Generate data by sampling from latent space. If z_mu is not None, data for this point in latent space is generated. Otherwise, z_mu is drawn from prior in latent space. | def generate(self, y, z_mu=None):
if z_mu is None:
z_mu = np.random.normal(size=self.network_architecture["n_z"])
# Note: This maps to mean of distribution, we could alternatively
# sample from Gaussian distribution
return self.sess.run(self.x_reconstr_mean,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _sampling_normal(self, args):\n z_mean, z_log_var = args\n return sampling_normal(z_mean, z_log_var, (None, self.latent_dim))",
"def _sampling_normal(self, args):\n z_mean, z_log_var = args\n return sampling_normal(z_mean, z_log_var, (None, self.latent_dim))",
"def _sampling_nor... | [
"0.660405",
"0.660405",
"0.660405",
"0.660405",
"0.660405",
"0.6534334",
"0.6397323",
"0.61442673",
"0.6121328",
"0.6086617",
"0.6054408",
"0.6054192",
"0.5983142",
"0.59812415",
"0.5959901",
"0.59052175",
"0.5867946",
"0.5866582",
"0.5866582",
"0.5866582",
"0.5866582",
"0.... | 0.6008274 | 12 |
Produces a linearised probability plot for the lognormal distribution. | def plot_lognormal_prob_plot(t, r, ci_lb=None, ci_ub=None, ax=None, marker='o',
color='blue', label=None):
if ax is None:
ax = plt.gca()
y = norm.ppf(1-r)
x = np.log(t)
ax.scatter(x, y, color=color,
label=label, marker=marker)
if ci_lb is not None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_noise_distribution(self, ax, mask=None, **kwargs):\r\n trs = self.rec_smooth_pos\r\n ivalid = np.where(np.isfinite(trs.noise))[0]\r\n sigma = np.std(trs.noise[ivalid])\r\n mu = np.average(trs.noise[ivalid])\r\n\r\n kwargs['linestyle']='-'\r\n kwargs['linewidth']=1... | [
"0.6935847",
"0.66377306",
"0.64029247",
"0.63893706",
"0.6319592",
"0.62403464",
"0.62243557",
"0.62080157",
"0.6206531",
"0.6151104",
"0.6115379",
"0.60753834",
"0.60631967",
"0.60576105",
"0.6037297",
"0.6018699",
"0.60162073",
"0.60037184",
"0.5957338",
"0.5952947",
"0.59... | 0.65246713 | 2 |
Asks user to specify a city, month, and day to analyze. | def get_filters():
# initialize the variables
city = " "
month = " "
day = " "
print('Hello! Let\'s explore some US bikeshare data!\n')
# get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs
while True:
city = input('Wo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)",
"def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f... | [
"0.66714007",
"0.65354675",
"0.64593667",
"0.6374057",
"0.6348314",
"0.63097656",
"0.62868035",
"0.6259136",
"0.62316",
"0.62130964",
"0.62050414",
"0.6181105",
"0.6171822",
"0.61686903",
"0.6158568",
"0.61582303",
"0.61532456",
"0.61444426",
"0.6131269",
"0.610484",
"0.61025... | 0.0 | -1 |
Loads data for the specified city and filters by month and day if applicable. | def load_data(city, month, day):
df = pd.read_csv(CITY_DATA[city])
df['Start Time'] = pd.to_datetime(df['Start Time'])
df['month'] = df['Start Time'].dt.month
df['day'] = df['Start Time'].dt.weekday_name
df['hour'] = df['Start Time'].dt.hour
df['And'] = ' & '
# create a new column of ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ... | [
"0.81320685",
"0.8108889",
"0.8045821",
"0.8042514",
"0.80090284",
"0.80071104",
"0.79991937",
"0.7998333",
"0.7988789",
"0.797905",
"0.79737365",
"0.79610896",
"0.7956163",
"0.7947432",
"0.79463065",
"0.7908287",
"0.7908229",
"0.7904569",
"0.7900715",
"0.78930074",
"0.788921... | 0.7335328 | 100 |
Displays statistics on the most frequent times of travel. | def time_stats(df):
print('\nCalculating The Most Frequent Times of Travel...\n')
start_time = time.time()
# display the most common month
print('Most common month: ')
print(df['month'].mode()[0])
# display the most common day of week
print('Most common day: ')
print(df['da... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\... | [
"0.8023676",
"0.8022362",
"0.79149705",
"0.78213924",
"0.7813664",
"0.7765152",
"0.77395964",
"0.7735777",
"0.7733763",
"0.76860064",
"0.7668081",
"0.7651128",
"0.7644099",
"0.7639373",
"0.7636164",
"0.7624668",
"0.7622597",
"0.76122236",
"0.7599646",
"0.75829977",
"0.7579222... | 0.7825905 | 3 |
Displays statistics on the most popular stations and trip. | def station_stats(df):
print('\nCalculating The Most Popular Stations and Trip...\n')
start_time = time.time()
# display most commonly used start station
print('Most common start station: ')
print(df['Start Station'].mode()[0])
# display most commonly used end station
print('Mos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m... | [
"0.7815675",
"0.7662213",
"0.7553417",
"0.74914914",
"0.74748665",
"0.7446617",
"0.7428588",
"0.74237514",
"0.74177027",
"0.7400495",
"0.7387161",
"0.7385634",
"0.73647535",
"0.735934",
"0.73566747",
"0.73548365",
"0.7351854",
"0.7351274",
"0.735057",
"0.73421645",
"0.7340198... | 0.72815245 | 32 |
Displays statistics on the total and average trip duration. | def trip_duration_stats(df):
print('\nCalculating Trip Duration...\n')
start_time = time.time()
# display total travel time
print('Total travel time: ')
print(df['Trip Duration'].sum())
# display mean travel time
print('Average travel time: ')
print(df['Trip Duration'].mean... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri... | [
"0.814274",
"0.8025143",
"0.80041367",
"0.79496753",
"0.79312176",
"0.7926815",
"0.7915187",
"0.79142886",
"0.7908032",
"0.79055744",
"0.7900715",
"0.7891682",
"0.78894734",
"0.7886722",
"0.78851086",
"0.7884266",
"0.7882474",
"0.78738385",
"0.78686154",
"0.78664047",
"0.7863... | 0.7937415 | 4 |
Return slope of repolarization period between trough and baseline After reaching it's maxumum polarization, the neuron potential will recover. The repolarization slope is defined as the dV/dT of the action potential between trough and baseline. Optionally the function returns also the indices per waveform where the pot... | def repolarization_slope(waveforms, sampling_frequency, return_idx=False):
trough_idx, peak_idx = _get_trough_and_peak_idx(waveforms)
rslope = np.empty(waveforms.shape[0])
rslope[:] = np.nan
return_to_base_idx = np.empty(waveforms.shape[0], dtype=np.int)
return_to_base_idx[:] = 0
time = np.ara... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rslope(x,y,window):\n \n import numpy as np\n \n # Check that x and y are the same length\n if len(x) != len(y): \n print (\"Error: x and y must be the same length\")\n return 0 \n \n N = len(x) # Number of points in the dataset\n slopes = np.ones(N) # Make array for s... | [
"0.58379334",
"0.5803326",
"0.5730749",
"0.5638403",
"0.5474698",
"0.54089415",
"0.5407718",
"0.5350361",
"0.5348057",
"0.53432703",
"0.5302389",
"0.5261501",
"0.525283",
"0.5250733",
"0.5244446",
"0.5223535",
"0.5220072",
"0.5212352",
"0.51912844",
"0.5188852",
"0.51677907",... | 0.6774447 | 0 |
Return the toplevel data directory. | def datadir():
return os.path.join(os.getenv('HOME'), 'stellar-mass') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_dir(self):\r\n return self._data_dir",
"def data_dir(self):\n return self._data_dir",
"def data_dir(self):\n return self._data_dir",
"def get_data_dir(self):\n return self.data_dir",
"def data_dir():\n return _config.datadir",
"def data_directory(self):\n\n ... | [
"0.7853355",
"0.78523815",
"0.78523815",
"0.784796",
"0.7825752",
"0.7784888",
"0.7779173",
"0.7733864",
"0.77277327",
"0.76710695",
"0.76486516",
"0.764862",
"0.76370835",
"0.7620126",
"0.7602108",
"0.7601692",
"0.74984044",
"0.74838716",
"0.74833477",
"0.74635625",
"0.74427... | 0.6655436 | 61 |
Get the list of keras metrics to be used with the RelevanceModel | def get_metrics(metrics_keys: List[str]) -> List[Union[Metric, str]]:
return [
metrics_factory.get_metric(metric_key=metric_key) for metric_key in metrics_keys
] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_metrics(model, X, y, scoring_list={'accuracy':make_scorer(accuracy_score)}):\n\n metrics = {}\n for metric in scoring_list:\n score = scoring_list[metric](model, X, y)\n metrics[metric] = score\n print(\"%s\\t%s\" %(metric, score))\n\n return metrics",
"def _monitor_metrics(... | [
"0.6830628",
"0.6561114",
"0.6407309",
"0.6385046",
"0.63840514",
"0.638032",
"0.6377268",
"0.6365058",
"0.63254255",
"0.63193583",
"0.6248947",
"0.6243238",
"0.6231267",
"0.62287164",
"0.62192327",
"0.6179102",
"0.6172044",
"0.61600727",
"0.6131287",
"0.6122013",
"0.6076984"... | 0.0 | -1 |
Returns config for tf.session | def get_config():
config = tf.ConfigProto(allow_soft_placement=True)
config.gpu_options.allow_growth = True
return config | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _config_session(self):\n config = tf.ConfigProto()\n config.gpu_options.allow_growth = True\n config.gpu_options.visible_device_list = str(self.device_num)\n return tf.Session(config=config)",
"def get_config():\n config = tf.ConfigProto(allow_soft_placement=True)\n config.g... | [
"0.7999958",
"0.75894344",
"0.72901034",
"0.7119736",
"0.6969369",
"0.6781894",
"0.65969217",
"0.64716965",
"0.6348045",
"0.6322737",
"0.631881",
"0.62444156",
"0.6241746",
"0.6201172",
"0.61908853",
"0.61729336",
"0.6153548",
"0.6133191",
"0.6101502",
"0.6080999",
"0.6076644... | 0.7535755 | 2 |
Transforms a text sequence to dictionary with index representation of word. Index from alphabetical ordering | def text_to_idx_dict(*, text:str) -> Dict:
words = re.findall(r'\w+', text.lower())
words = sorted(list(set(words)))
return {w:words.index(w) for w in words} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_index(text: Iterable) -> Dict[str, List[Tuple[int, int]]]:\n index = defaultdict(list)\n for line_no, line in enumerate(text, 1):\n for match in WORD_RE.finditer(line):\n word = match.group()\n column_no = match.start() + 1\n location = (line_no, column_no)\n... | [
"0.75115854",
"0.7007506",
"0.6914698",
"0.69092387",
"0.6765797",
"0.67446685",
"0.66158366",
"0.656521",
"0.65445685",
"0.65431255",
"0.6542468",
"0.6520293",
"0.64818096",
"0.6481161",
"0.6471223",
"0.64695764",
"0.64690566",
"0.64555514",
"0.64185774",
"0.634428",
"0.6295... | 0.7997426 | 0 |
Creates an instance of this model from a dictionary | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
# Extract variables from the dictionary
total_offers = dictionary.get('TotalOffers')
total_offer_pages = dictionary.get('TotalOfferPages')
more_offers_url = dictionary.ge... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction... | [
"0.83181584",
"0.8168118",
"0.8168118",
"0.8118749",
"0.8089047",
"0.79787344",
"0.7949278",
"0.79231393",
"0.7898951",
"0.78923255",
"0.788838",
"0.7882321",
"0.7882212",
"0.7876749",
"0.78585315",
"0.7836853",
"0.7801407",
"0.7801407",
"0.7801407",
"0.7801407",
"0.7801407",... | 0.0 | -1 |
Get the toplevel model folder names underneath the appDeployments section. | def get_model_app_deployments_subfolder_names(self):
return list(self.__app_deployments_top_level_folders) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _GetDjangoAppDirs(self):\r\n \r\n manage_file, settings_file = self._FindKeyFiles()\r\n if manage_file is None:\r\n return None\r\n\r\n dirname = os.path.dirname(manage_file)\r\n files = os.listdir(dirname)\r\n appnames = []\r\n for fn in files:\r\n dn = os.path.join(dirname, fn)... | [
"0.67357963",
"0.6707481",
"0.6629796",
"0.62143904",
"0.62103814",
"0.6176339",
"0.61655825",
"0.6100475",
"0.6096638",
"0.6034409",
"0.59899044",
"0.5891733",
"0.5855422",
"0.5828501",
"0.582037",
"0.5709121",
"0.56600755",
"0.5631647",
"0.562626",
"0.55994487",
"0.55653644... | 0.816869 | 0 |
Get the WLST MBean name for the specified location. | def get_wlst_mbean_name_for_location(self, location):
_method_name = 'get_wlst_mbean_name_for_location'
_logger.entering(str_helper.to_string(location), class_name=_class_name, method_name=_method_name)
folder_dict = self.__get_dictionary_for_location(location, False)
mbean_name = None... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_online_bean_name_for_location(self, location):\n _method_name = 'get_online_bean_name_for_location'\n _logger.entering(str_helper.to_string(location), class_name=_class_name, method_name=_method_name)\n\n online_bean = ''\n folder_dict = self.__get_dictionary_for_location(locati... | [
"0.65598637",
"0.6440005",
"0.60279965",
"0.5829499",
"0.5740292",
"0.56658196",
"0.5626133",
"0.56203943",
"0.5591339",
"0.5507877",
"0.54946566",
"0.54946566",
"0.5474041",
"0.54487234",
"0.54377",
"0.54059875",
"0.5382291",
"0.5382291",
"0.53609353",
"0.53508145",
"0.53307... | 0.78426397 | 0 |
Get the WLST MBean type for the specified location. | def get_wlst_mbean_type_for_location(self, location):
_method_name = 'get_wlst_mbean_type_for_location'
_logger.entering(str_helper.to_string(location), class_name=_class_name, method_name=_method_name)
# some callers use this method to check for location valid.
# they should call is_mo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_wlst_mbean_name_for_location(self, location):\n _method_name = 'get_wlst_mbean_name_for_location'\n\n _logger.entering(str_helper.to_string(location), class_name=_class_name, method_name=_method_name)\n folder_dict = self.__get_dictionary_for_location(location, False)\n\n mbean_... | [
"0.6363691",
"0.5564492",
"0.5480641",
"0.5480641",
"0.5460233",
"0.5363872",
"0.5349335",
"0.5346862",
"0.52896726",
"0.52832425",
"0.5256891",
"0.52351975",
"0.51944554",
"0.51760113",
"0.51674753",
"0.5165391",
"0.51571786",
"0.5142682",
"0.5112325",
"0.5109181",
"0.510709... | 0.8366184 | 0 |
Get the online bean class name for the specified location. | def get_online_bean_name_for_location(self, location):
_method_name = 'get_online_bean_name_for_location'
_logger.entering(str_helper.to_string(location), class_name=_class_name, method_name=_method_name)
online_bean = ''
folder_dict = self.__get_dictionary_for_location(location, False)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_wlst_mbean_name_for_location(self, location):\n _method_name = 'get_wlst_mbean_name_for_location'\n\n _logger.entering(str_helper.to_string(location), class_name=_class_name, method_name=_method_name)\n folder_dict = self.__get_dictionary_for_location(location, False)\n\n mbean_... | [
"0.6643693",
"0.5841632",
"0.57243204",
"0.566328",
"0.56352216",
"0.5585703",
"0.5507082",
"0.5489415",
"0.5487095",
"0.5468062",
"0.5446967",
"0.5446967",
"0.5388775",
"0.5361446",
"0.5271288",
"0.526342",
"0.5251421",
"0.5251421",
"0.5246386",
"0.5221342",
"0.5206687",
"... | 0.8220318 | 0 |
Determine if the specified location is valid, including version/mode checks. Returns a boolean answer instead of the (ValidationCode, message) tuple used elsewhere. | def is_model_location_valid(self, location):
if len(location.get_model_folders()) > 0:
parent_location = LocationContext(location)
folder = parent_location.pop_location()
code, message = self.is_valid_model_folder_name_for_location(parent_location, folder)
if code... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_version_valid_location(self, location):\n _method_name = 'is_version_valid_location'\n\n _logger.entering(str_helper.to_string(location), class_name=_class_name, method_name=_method_name)\n\n code = ValidationCodes.VALID\n message = ''\n if self.get_wlst_mbean_type_for_loc... | [
"0.79280347",
"0.65032697",
"0.6418528",
"0.632665",
"0.63242877",
"0.6170731",
"0.606353",
"0.60096663",
"0.60090554",
"0.60068333",
"0.5853153",
"0.5831007",
"0.5824646",
"0.576646",
"0.5703268",
"0.5694241",
"0.5692312",
"0.56704646",
"0.5555044",
"0.55413055",
"0.5522839"... | 0.6621528 | 1 |
Remove any curly braces and return the value for the current WLST mode. | def _resolve_curly_braces(self, value):
str_value = str_helper.to_string(value)
if '${' in str_value:
parts = alias_utils.parse_curly_braces(str_value)
return parts[self._wlst_mode]
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _strip_braces(self, val):\n logger.debug('Strip braces')\n val = val.strip()\n if val.startswith('{') and val.endswith('}') and self._full_span(val):\n return val[1:-1]\n return val",
"def rightStripCurlyBraces(line):\n match = rstrip_regex.match(line)\n if not ma... | [
"0.66221845",
"0.54903525",
"0.5448728",
"0.5322757",
"0.5257414",
"0.5247903",
"0.5113087",
"0.51008976",
"0.5050025",
"0.49775994",
"0.49364486",
"0.49298143",
"0.4845963",
"0.48194852",
"0.47890183",
"0.4737286",
"0.47093135",
"0.4708715",
"0.46691692",
"0.46600592",
"0.46... | 0.63641816 | 1 |
Assumes outputs contains hidden states. Then transforms into tensors. | def get_layers(outputs):
hidden_states = outputs[2]
# Transform into single tensor
token_embeddings = torch.stack(hidden_states, dim=0)
## Remove "batch" layer b/c we just have one sentence
token_embeddings = torch.squeeze(token_embeddings, dim=1)
## Rearrange layers, now: 1) token; 2) layer; 3... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_outputs():\n all_hidden_states = get_states()\n all_attention = tf.map_fn(get_attention, all_hidden_states)\n a_values = tf.nn.softmax(all_attention, axis = 0)\n final_hidden_state = tf.einsum('ijk,ijl->jkl', a_values, \n all_hidden_states)\n out... | [
"0.74198467",
"0.6768379",
"0.6718283",
"0.6639429",
"0.659661",
"0.65247947",
"0.6485352",
"0.64744866",
"0.64435065",
"0.6438602",
"0.6414681",
"0.63864845",
"0.6369009",
"0.6355192",
"0.6355192",
"0.6355192",
"0.6349493",
"0.6345034",
"0.63009334",
"0.6299708",
"0.6293006"... | 0.6680177 | 3 |
return the index of a letter in teh alphabet | def alphabet_position(letter):
alphabet='abcdefghijklmnopqrstuvwxyz'
ALPHABET='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if letter.isupper() == True:
for x in ALPHABET:
if letter == x:
position = ALPHABET.index(x)
return position
else:
for x in alphabet:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def letter_to_index(letter):\r\n return ord(letter.lower()) - CHAR_A",
"def letter_to_index(letter):\r\n return ord(letter.lower()) - CHAR_A",
"def return_index(character: str) -> int:\n if character.islower():\n return ord(character) - ord(\"a\")\n else:\n return ord(character) - ord... | [
"0.90463245",
"0.90463245",
"0.86501026",
"0.84535825",
"0.83994454",
"0.82488245",
"0.8200395",
"0.77724713",
"0.77706635",
"0.7490004",
"0.74095434",
"0.74095434",
"0.74095434",
"0.7364318",
"0.72719175",
"0.7270736",
"0.7264149",
"0.72520393",
"0.7176083",
"0.71111566",
"0... | 0.81873924 | 7 |
make a dataframe from an sqlalchemy query | def get_frame_from_query(the_query, colnames):
df = DataFrame.from_records(list(the_query), columns=colnames)
return df | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query_to_df(query):\n df = pd.DataFrame(query.all())\n df.columns = [x['name'] for x in query.column_descriptions]\n return df",
"def get_dataframe(q):\n cnx = create_engine(postgres_str)\n query = q\n return pd.read_sql_query(query, cnx)",
"def db_to_df(query):\n conn = loader.databas... | [
"0.7916001",
"0.7789747",
"0.7705248",
"0.7676981",
"0.7579248",
"0.7515109",
"0.74399406",
"0.7430691",
"0.7425391",
"0.7266823",
"0.7158268",
"0.71004856",
"0.70083815",
"0.69484764",
"0.69144934",
"0.6760844",
"0.6737484",
"0.6715473",
"0.66688776",
"0.6620345",
"0.6600132... | 0.68969995 | 15 |
Get Hausdorff distance between nonzero pixels in two images | def hausdorff_distance(image1, image2):
image1_int = image1.clone("unsigned int")
image2_int = image2.clone("unsigned int")
libfn = utils.get_lib_fn("hausdorffDistance%iD" % image1_int.dimension)
d = libfn(image1_int.pointer, image2_int.pointer)
return d | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hamming_distance(a, b):\n return np.count_nonzero(a != b)",
"def hamming_distance(x1: np.ndarray, x2: np.ndarray) -> int:\n assert isinstance(x1, np.ndarray) and isinstance(x2, np.ndarray)\n return (x1 != x2).sum()",
"def diff_image_feature(image0, image1):\n return 0",
"def hamming_distance(... | [
"0.71314627",
"0.6906451",
"0.6764861",
"0.6728653",
"0.66946054",
"0.6659211",
"0.6650996",
"0.6646588",
"0.65291774",
"0.64861846",
"0.64787304",
"0.6456695",
"0.6438853",
"0.6422956",
"0.6371332",
"0.63624674",
"0.62960315",
"0.62827206",
"0.628124",
"0.6217335",
"0.620040... | 0.79843724 | 0 |
A humanreadable representation of the group specification, in constructor form. | def __repr__(self):
return '{cls}(name={x.name!r}, capabilities={x.capabilities!r}, description={x.description!r}, datasets={x.datasets!r})'.format(cls=self.__class__.__name__, x=self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return u\"group_list={self.group_list} bits={self.bits}\"",
"def __repr__(self):\n return str(self.group)",
"def __repr__(self) -> str:\n\n return f\"{self.group}({self._value})\"",
"def format(self):\n groups = [g + \".\" for g in self.groups]\n params... | [
"0.6835909",
"0.6771201",
"0.65263474",
"0.6514753",
"0.6330489",
"0.63223976",
"0.62261033",
"0.6142467",
"0.60900754",
"0.60861987",
"0.6081848",
"0.6069926",
"0.6044486",
"0.6038937",
"0.6013985",
"0.60016763",
"0.5999276",
"0.5991199",
"0.59825927",
"0.5978334",
"0.597556... | 0.0 | -1 |
Return heuristic used to compute hScore for this node | def get_heuristic(self):
return self._heuristic | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_h_score(self):\n if self._h_score is None:\n self._h_score = self._heuristic.compute(self)\n return self._h_score",
"def heuristic(self):\n game_score = (self.get_game_score(), 0.85)\n road_score = (self.get_longest_road_score(), 0.05)\n steps_score = (self.g... | [
"0.8254411",
"0.80370325",
"0.7303243",
"0.67431265",
"0.6729288",
"0.6714751",
"0.6700875",
"0.6571597",
"0.64842117",
"0.6476321",
"0.64723706",
"0.6453293",
"0.64385825",
"0.64172584",
"0.64172584",
"0.64172584",
"0.6372317",
"0.63685703",
"0.6367823",
"0.63638484",
"0.635... | 0.7704478 | 2 |
Return true if the priority queue does not contain any node | def is_empty(self):
return len(self._pool) == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.priority_queue) == 0",
"def any(self) -> bool:\n return len(self.queue) > 0",
"def is_empty(self):\n return self.queue == []",
"def empty(self):\r\n return self.queue == []",
"def empty_queue(queue):\n return queue.front is None",
"def isEm... | [
"0.7861887",
"0.7247188",
"0.72284824",
"0.7219885",
"0.7177321",
"0.71573395",
"0.7142883",
"0.7136697",
"0.7136697",
"0.7133701",
"0.7115788",
"0.7115271",
"0.7108555",
"0.7107866",
"0.7100729",
"0.70957524",
"0.7091723",
"0.70898557",
"0.7075301",
"0.7073402",
"0.7071536",... | 0.0 | -1 |
return the rows that are being displayed and the total rows in the dataTable | def dt_row_cnt(check = (),
quiet = True):
config = current.test_config
browser = config.browser
elem = browser.find_element_by_id("list_info")
details = elem.text
if not quiet:
s3_debug(details)
words = details.split()
start = int(words[1])
end = int(words[3])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getRowCount(self) -> int:\n ...",
"def calc_total_rows(self):\n #total_rows = len(self.file_list) - 1 # Minus header\n print('Total number of rows: ' + str(self.tot_rows))\n results.append('Total number of rows: ' + str(self.tot_rows))",
"def getNumRows(self) -> int:\n .... | [
"0.7137301",
"0.6977899",
"0.67960125",
"0.67778",
"0.65845525",
"0.64856106",
"0.64248115",
"0.6405334",
"0.63706803",
"0.6364493",
"0.63236254",
"0.63155305",
"0.6294024",
"0.6242874",
"0.6212886",
"0.6159824",
"0.6151935",
"0.61395794",
"0.6123093",
"0.6107035",
"0.6103315... | 0.5675716 | 58 |
Platformspecific location of sitepackages folder in bundles. | def bundled_site_packages() -> Optional[str]:
exe_dir = os.path.dirname(sys.executable)
if os.name == 'nt':
return os.path.join(exe_dir, "Lib", "site-packages")
if sys.platform.startswith('darwin'):
python_dir = f'python{sys.version_info.major}.{sys.version_info.minor}'
return os.pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path(self):\n installed_packages_folder_path = site.getsitepackages()[0]\n return f'{installed_packages_folder_path}/{SITE_PACKAGES_FOLDER_NAME}'",
"def user_site_packages() -> str:\n if os.name == 'nt':\n return os.path.join(user_plugin_dir(), 'Lib', 'site-packages')\n\n python_di... | [
"0.73990774",
"0.7004395",
"0.6767867",
"0.6635699",
"0.654256",
"0.6498899",
"0.6495638",
"0.6361758",
"0.6330214",
"0.61963844",
"0.6179695",
"0.6168915",
"0.61511856",
"0.6097586",
"0.6078866",
"0.602589",
"0.60094786",
"0.5999121",
"0.5974214",
"0.5970506",
"0.5915921",
... | 0.74634486 | 0 |
Returns a printable representation of object we call it on. | def __repr__(self):
return "{}".format(self.val) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def repr_(object_):\n return repr(object_)",
"def __repr__(self):\n return repr(self.__dict__['_obj'])",
"def __repr__(self):\n return str(self.__dict__)",
"def __repr__(self):\n return str(self.__dict__)",
"def __repr__(self):\n return str(self.__dict__)",
"def __r... | [
"0.8289505",
"0.8102019",
"0.77527064",
"0.77527064",
"0.77527064",
"0.77527064",
"0.77527064",
"0.77262497",
"0.77150035",
"0.7624847",
"0.7620398",
"0.7609563",
"0.7552161",
"0.75011474",
"0.7486976",
"0.7486976",
"0.7486976",
"0.74720895",
"0.7466644",
"0.7466644",
"0.7466... | 0.0 | -1 |
Set the current alpha value for the Surface. When blitting this Surface onto a destination, the pixels will be drawn slightly transparent. The alpha value is an integer from ``0`` to ``255``, ``0`` is fully transparent and ``255`` is fully opaque. If None is passed for the alpha value, then alpha blending will be disab... | def set_alpha(self, value: Optional[int], flags: int = 0) -> 'BaseImage':
if value is None:
self._surface.set_alpha(None)
return self
assert isinstance(value, int)
assert 0 <= value <= 255, 'alpha value must be an integer between 0 and 255'
self._surface.set_alpha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_alpha(self, alpha):\n if alpha < 0 or alpha > 255:\n raise ValueError(\"alpha must be betweeen 0 and 255\")\n\n self.alpha = alpha\n self.draw_alpha()",
"def SetAlpha(self, *args):\n return _itkRGBAPixelPython.itkRGBAPixelUS_SetAlpha(self, *args)",
"def draw_alpha... | [
"0.7351839",
"0.6980368",
"0.6964286",
"0.69274616",
"0.6848601",
"0.6770376",
"0.6581452",
"0.65453243",
"0.6366386",
"0.6355929",
"0.6315802",
"0.6231872",
"0.61802965",
"0.6177129",
"0.6092933",
"0.6072144",
"0.6033012",
"0.59878683",
"0.59170294",
"0.58857006",
"0.5828823... | 0.7538483 | 0 |
Return the surface object of the image. | def get_surface(self, new: bool = True) -> 'pygame.Surface':
if new:
return self.get_crop_rect(self.get_rect())
return self._surface | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def surface(self):\n return self._surface",
"def surface(self):\n return BRep_Tool_Surface(self.topods_shape())",
"def get_surface(self, name):\n for surface in self._surfaces:\n if surface.name == name:\n return surface\n return None",
"def Surface(self,... | [
"0.78905296",
"0.7373414",
"0.687337",
"0.6708551",
"0.66705686",
"0.6598057",
"0.6572758",
"0.65572315",
"0.6499511",
"0.64380336",
"0.62919366",
"0.62666744",
"0.62176377",
"0.6204652",
"0.61614186",
"0.609381",
"0.60734326",
"0.6071488",
"0.6071488",
"0.60078555",
"0.60051... | 0.67910814 | 3 |
Return the name of the image file. | def get_filename(self) -> str:
return self._filename | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def image_name(self) -> str:\n return self._image_name",
"def name(self, strippath=False):\n return _image.image_name(self, strippath)",
"def image_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"image_name\")",
"def get_file_name(self):\n return str(self.g... | [
"0.81359076",
"0.80070156",
"0.79464424",
"0.7929313",
"0.79043955",
"0.7870586",
"0.7852736",
"0.776733",
"0.77643526",
"0.7739092",
"0.7702486",
"0.76989967",
"0.76985604",
"0.76909155",
"0.7686735",
"0.7627973",
"0.7622364",
"0.7574487",
"0.7546045",
"0.7546045",
"0.749859... | 0.7201016 | 50 |
Return ``True`` if the image is the same as the object. | def equals(self, image: 'BaseImage') -> bool:
assert isinstance(image, BaseImage)
im1 = pygame.image.tostring(self._surface, 'RGBA')
im2 = pygame.image.tostring(image._surface, 'RGBA')
return im1 == im2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n if not isinstance(other, ImageInfo):\n return False\n\n return self.__dict__ == other.__dict__",
"def is_same_as(self, other) -> bool:\n return self.x == other.x and self.y == other.y",
"def __eq__(self, other):\n if not isinstance(other, Create... | [
"0.75574994",
"0.69859844",
"0.69413126",
"0.6880145",
"0.6816951",
"0.67958325",
"0.6792008",
"0.6712118",
"0.6704978",
"0.6692546",
"0.66896534",
"0.66890275",
"0.66832995",
"0.66340494",
"0.6632897",
"0.6587442",
"0.6579872",
"0.6559901",
"0.6557837",
"0.6551167",
"0.65437... | 0.7666818 | 0 |
Draw the image in a given surface. | def draw(
self,
surface: 'pygame.Surface',
area: Optional['pygame.Rect'] = None,
position: Tuple2IntType = (0, 0)
) -> 'BaseImage':
assert isinstance(surface, pygame.Surface)
assert isinstance(area, (pygame.Rect, type(None)))
assert_vector(position, 2, int)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw(self, surface):\n surface.blit(self.image, self.rect)",
"def draw(self, surface):\n surface.blit(self.image, self.rect)",
"def draw(self, surface):\r\n surface.blit(self.image, self.rect)",
"def draw(self, surface):\n\n\t\tsurface.blit(self.image, self.rect.topleft)",
"def dra... | [
"0.8680978",
"0.8680978",
"0.86610556",
"0.85166633",
"0.8186879",
"0.7789847",
"0.77565336",
"0.75712264",
"0.75001985",
"0.73758835",
"0.725146",
"0.7168916",
"0.71532476",
"0.71518713",
"0.70755273",
"0.7035059",
"0.7029318",
"0.70260674",
"0.6978322",
"0.69364816",
"0.687... | 0.70487696 | 15 |
get user home path | def user_home_path(self):
return path.join(env.user_home, self._user_home_path) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_home():\n from os.path import expanduser\n home = expanduser('~')\n return home",
"def get_user_homedir():\n return os.path.expanduser(\"~\")",
"def homedir():\n return os.path.expanduser('~')",
"def get_home_dir(self) -> str:\n ret = os.path.expanduser(\"~\")\n if not o... | [
"0.8800848",
"0.865227",
"0.85414934",
"0.8490601",
"0.8490246",
"0.84059525",
"0.835542",
"0.835542",
"0.82909644",
"0.8112106",
"0.7972705",
"0.7958267",
"0.79442",
"0.7831784",
"0.7730921",
"0.7730355",
"0.77286303",
"0.7690875",
"0.7635592",
"0.7608767",
"0.749288",
"0.... | 0.8773884 | 1 |
String for representing the MyModelName object (in Admin site etc.). | def __str__(self):
return '%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s ' % (self.Month,
self.Production,self.Hygienist_Production,
self.Collections_Percentage,self.Overthe_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self.name:s}\"",
"def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self.name:s}\"",
"def __str__(self):\n return '%s%s' % (self.name, ' - %s' % self.model ... | [
"0.7781468",
"0.7781468",
"0.77076906",
"0.7524018",
"0.7449824",
"0.7227405",
"0.71806455",
"0.7147519",
"0.71067315",
"0.7104305",
"0.7104305",
"0.7104305",
"0.7090013",
"0.70863175",
"0.70797986",
"0.70797986",
"0.70797986",
"0.70797986",
"0.70797986",
"0.705124",
"0.70307... | 0.0 | -1 |
Construct a ne deque. | def __init__(self, iterable=None):
self._values = DLL(iterable) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_empty_deque():\n from deque import Deque\n new_deque = Deque()\n return new_deque",
"def __init__(self):\r\n self.deque = deque()",
"def __init__(self):\r\n self.q = deque()",
"def __init__(self):\n \n self.elements = deque()",
"def __init__(self):\n ... | [
"0.7170411",
"0.6520084",
"0.64937186",
"0.648073",
"0.6462904",
"0.64487356",
"0.6402062",
"0.63626605",
"0.6360955",
"0.6288091",
"0.6270055",
"0.6221395",
"0.61992276",
"0.61814535",
"0.6125442",
"0.6125442",
"0.6125442",
"0.6125442",
"0.61142796",
"0.6098398",
"0.6089704"... | 0.0 | -1 |
Get the node at front of the deque. | def front(self):
return self._values.tail | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFront(self):\n\t\tfront = self.queue[self.front]\n\t\treturn front\n\t\tpass",
"def front_node(self):\n return self.sentinel.next if self.N != 0 else None",
"def front(self):\n return self.queue[0] if not self.empty() else None",
"def peek_front(self):\n if ((self.is_empty()) or s... | [
"0.81181645",
"0.79774064",
"0.7880995",
"0.78587675",
"0.78194445",
"0.7774033",
"0.7685147",
"0.7665018",
"0.76151335",
"0.7564011",
"0.7540196",
"0.74546",
"0.7440685",
"0.7379193",
"0.73582995",
"0.73537236",
"0.7331829",
"0.7331829",
"0.7282541",
"0.7270891",
"0.7268208"... | 0.0 | -1 |
Add a value to the end of the deque. | def append(self, val):
self._values.push(val) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append(self, value):\n self[self._end] = value\n self._end = (self._end + 1) % self._capacity\n\n if self.full:\n self._begin = (self._begin + 1) % self._capacity\n\n else:\n self._size += 1",
"def push(self, val):\r\n return self.deque.append(val)",
... | [
"0.7777364",
"0.7540302",
"0.7485117",
"0.74535406",
"0.7450489",
"0.74204665",
"0.73268807",
"0.7299541",
"0.72779363",
"0.7268163",
"0.72432536",
"0.7233518",
"0.72203344",
"0.72135884",
"0.72121245",
"0.7167945",
"0.7148727",
"0.714037",
"0.7133984",
"0.7083267",
"0.708326... | 0.73055166 | 7 |
Add a value to the front of the deque. | def appendleft(self, val):
self._values.append(val) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def push_front(self, value):\n new_node = self.Node(value)\n\n # Edge Case : List is empty\n if self._size == 0:\n self._tail = new_node\n self._head = new_node\n self._size += 1\n return\n\n new_node.next = self._head\n self._head.prev... | [
"0.77105063",
"0.7573097",
"0.7570266",
"0.7531734",
"0.75082994",
"0.72768545",
"0.7263074",
"0.7258478",
"0.7249984",
"0.72343963",
"0.72226423",
"0.7198484",
"0.7193163",
"0.7109683",
"0.7036448",
"0.7033341",
"0.7019342",
"0.7012546",
"0.7002079",
"0.69705063",
"0.6970506... | 0.0 | -1 |
Get the value from the end of the deque without removing it. | def peek(self):
if self.end:
return self.end.val | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pop(self):\n try:\n return self._values.pop()\n except IndexError:\n raise IndexError('Cannot pop from empty deque.')",
"def pop(self):\n value = self.buffer[self.end - 1]\n self.buffer[self.end - 1] = None\n self.end = (self.end - 1) % len(self.buffer... | [
"0.74612045",
"0.73744774",
"0.732348",
"0.7251731",
"0.7235065",
"0.7232359",
"0.7228888",
"0.7227422",
"0.7227422",
"0.72052187",
"0.7178993",
"0.7161674",
"0.7156923",
"0.7143276",
"0.7131488",
"0.712937",
"0.71218807",
"0.711889",
"0.7115477",
"0.71009356",
"0.7089555",
... | 0.72798043 | 3 |
Get the value from the front of the deque without removing it. | def peekleft(self):
if self.front:
return self.front.val | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peek_front(self):\n if ((self.is_empty()) or self.data_[self.front_]== None): #If we trip this if block we raise an error since we know the deque should be empty \n raise IndexError\n return self.data_[self.front_]",
"def peek_front(self):\n\n if (self._size == 0):\n ... | [
"0.80046177",
"0.79004306",
"0.7847813",
"0.7761827",
"0.7723682",
"0.7688387",
"0.7681973",
"0.7645673",
"0.7625478",
"0.76252276",
"0.7606364",
"0.7582759",
"0.7469969",
"0.74399006",
"0.742082",
"0.74193853",
"0.7414419",
"0.7385722",
"0.7379656",
"0.7372658",
"0.7369993",... | 0.6875316 | 71 |
Get the size of the deque. | def size(self):
return len(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __len__(self):\n return len(self.deque)",
"def __len__(self):\r\n return len(self.deque)",
"def size(self):\n return len(self.queue)",
"def size(self):\n return len(self.queue)",
"def size(self):\n return len(self.queue)",
"def size(self):\n return len(self.q... | [
"0.8046172",
"0.7975563",
"0.74108714",
"0.74108714",
"0.74108714",
"0.74108714",
"0.7398047",
"0.7398047",
"0.7368494",
"0.7358193",
"0.7357428",
"0.734755",
"0.734755",
"0.7162433",
"0.71270686",
"0.71143854",
"0.71020526",
"0.700914",
"0.7005447",
"0.7004008",
"0.6987788",... | 0.66903883 | 76 |
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes. | def add_header(r):
r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
r.headers["Pragma"] = "no-cache"
r.headers["Expires"] = "0"
r.headers['Cache-Control'] = 'public, max-age=0'
return r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response",
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m... | [
"0.8222958",
"0.82221323",
"0.82221323",
"0.82221323",
"0.82221323",
"0.81953573",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883",
"0.8162883"... | 0.71278924 | 58 |
The Amazon Resource Name (ARN) of the agents associated with the selfmanaged object storage server location. | def agent_arns(self) -> Optional[Sequence[str]]:
return pulumi.get(self, "agent_arns") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server_agent_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"server_agent_name\")",
"def arn(self) -> str:\n return pulumi.get(self, \"arn\")",
"def arn(self) -> str:\n return pulumi.get(self, \"arn\")",
"def arn(self) -> str:\n return pulumi.get(self, \"arn\")",... | [
"0.6722578",
"0.6326199",
"0.6326199",
"0.6326199",
"0.6326199",
"0.6326199",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0.624962",
"0... | 0.63512903 | 1 |
Sends a 401 response that enables basic auth | def authenticate():
return Response(
'Could not verify your access level for that URL.\n'
'You have to login with proper credentials', 401,
{'WWW-Authenticate': 'Basic realm="Login Required"'}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})",
"def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )",
"def authenticate():\n return Response(\n 'You have to login with pro... | [
"0.8093736",
"0.80926424",
"0.7958403",
"0.7852648",
"0.7843114",
"0.7824419",
"0.776624",
"0.7754693",
"0.774767",
"0.774767",
"0.774767",
"0.774767",
"0.774767",
"0.774767",
"0.774767",
"0.774767",
"0.771945",
"0.7667712",
"0.7664151",
"0.76493174",
"0.76140213",
"0.76131... | 0.7810746 | 22 |
Reduce the cells according to the time dimensions. | def _reduce_cells(self):
def reduce_cell(result, cell):
# We assume only _sum aggergation
# All measures should be prepared so we can to this
for aggregate in self.aggregate_names:
result[aggregate] = result.get(aggregate, 0) + \
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def truncate_data(self, width):\n times_from_mid = self.time - self.midtime\n idxs = np.abs(times_from_mid) < 0.5 * width * self.duration\n self.time = self.time[idxs]\n self.flux = self.flux[idxs]",
"def reset_time_dim(ds):\n return ds.assign_coords(Time=pd.to_datetime(ds.XTIME.va... | [
"0.6026995",
"0.589354",
"0.56654084",
"0.55536246",
"0.55470103",
"0.5516815",
"0.5506113",
"0.5377757",
"0.5361846",
"0.521967",
"0.5210406",
"0.5201377",
"0.5193547",
"0.51714456",
"0.5139673",
"0.51254725",
"0.51046675",
"0.5087949",
"0.50877255",
"0.508634",
"0.5082353",... | 0.6872891 | 0 |
Removing stop words Lemmatization the process of grouping together the inflected forms of a word so they can be analysed as a single item, Stemmer an algorithm to bring words to its root word. | def run_summarized_text(text,lines):
#text_preprocessing
words = word_tokenize(text)
# print(words)
print("\n")
ps = PorterStemmer()
lem = WordNetLemmatizer()
stopWords = set(stopwords.words("english"))
# print(stopWords)
print("\n")
# 1 Create the word frequency table... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_text(text):\n\n lemmizer = WordNetLemmatizer()\n stemmer = porter.PorterStemmer()\n\n stop = stopwords.words('english')\n stop += ['.', ',', ':', '...', '!\"', '?\"', \"'\", '\"', ' - ', ' — ', ',\"', '.\"', '!', ';', '♫♫', '♫', \\\n '.\\'\"', '[', ']', '—', \".\\'\", 'ok', 'okay'... | [
"0.7672317",
"0.74295396",
"0.727268",
"0.72468156",
"0.7139328",
"0.7114286",
"0.7080774",
"0.6981716",
"0.6962026",
"0.6922665",
"0.69125235",
"0.69055253",
"0.68968296",
"0.68756044",
"0.68723214",
"0.6865177",
"0.6847625",
"0.6842435",
"0.6823994",
"0.680942",
"0.6791481"... | 0.0 | -1 |
delete records with dateTime older than ts | def prune_data(self, ts):
sql = "delete from %s where dateTime < %d" % (self.dbm.table_name, ts)
self.dbm.getSql(sql)
try:
# sqlite databases need some help to stay small
self.dbm.getSql('vacuum')
except Exception as e:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_old():\n objs = (Snapshot\n .objects\n .filter(timestamp__lte=(datetime.now() - timedelta(days=35)))\n )\n objs.delete()",
"def test_blind_delete_with_datetime(self):\r\n uid = uuid4()\r\n tmp = TestTimestampModel.create(id=uid, count=1)\r\n\r\n ... | [
"0.6707435",
"0.6189551",
"0.60988617",
"0.6051222",
"0.60038644",
"0.5996559",
"0.5989116",
"0.5934917",
"0.5930973",
"0.58878756",
"0.586799",
"0.58655924",
"0.5839218",
"0.5776258",
"0.57601184",
"0.57538813",
"0.57396704",
"0.57230777",
"0.56961006",
"0.56705767",
"0.5649... | 0.7225892 | 0 |
Assert that the given response was an error for the access_token field with the given error message. | def _assert_access_token_error(self, response, expected_error_message, error_code):
assert response.status_code == 400
response_json = json.loads(response.content.decode('utf-8'))
self.assertDictEqual(
response_json,
{
"access_token": [{"user_message": exp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assertFailedTokenRequest(self, request, result, expectedError, msg):\n if result == NOT_DONE_YET:\n result = request.getResponse()\n if msg.endswith('.'):\n msg = msg[:-1]\n self.assertEqual(\n 'application/json;charset=UTF-8', reque... | [
"0.77887464",
"0.76525337",
"0.7369657",
"0.7207198",
"0.7200718",
"0.6831742",
"0.66395813",
"0.6636375",
"0.6623991",
"0.6609984",
"0.6596322",
"0.65894777",
"0.6524559",
"0.65080005",
"0.65042335",
"0.6446866",
"0.6444835",
"0.6432882",
"0.64215994",
"0.6366899",
"0.633619... | 0.8771187 | 0 |
Test if username '{0}' and email '{1}' have conflicts with username 'user' and email 'user.com'. | def test_existence_conflict(self, username, email, validate_suggestions):
user = UserFactory.create(username='user', email='user@email.com')
self.assertValidationDecision(
{
'username': username,
'email': email
},
{
# py... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_email_not_unique(bot):\n expect_error(register, InputError, \"a\", \"abcdef\", \"a\", \"a\", bot.email)",
"def test_username_not_unique(bot):\n expect_error(register, InputError, bot.username, \"abcdef\", \"a\", \"a\", \"a\")",
"def test_registeration_duplicate_user_email(self):\n self.si... | [
"0.66741556",
"0.66731715",
"0.65498346",
"0.6486595",
"0.6410053",
"0.6409277",
"0.6408444",
"0.63949543",
"0.638658",
"0.6381248",
"0.6373655",
"0.6368763",
"0.6302717",
"0.6299862",
"0.6284223",
"0.62572354",
"0.6238511",
"0.6210236",
"0.620532",
"0.6197751",
"0.6195634",
... | 0.74244946 | 0 |
Construct the the terms loss optimizer `reconstruction` and `latent` losses. | def _create_loss_op(self):
# 1.) The reconstruction loss, which forces the NN towards reconstructing more accurately the
# given input. This function is configurable, but usually it is the Bernoulli negative log-likelihood.
if self.cost_function == 'abs':
reconstr_loss = tf.reduce_su... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_loss(self):\n import tensorflow as tf\n\n y_1d = [tf.reduce_sum(tf.multiply(self.variables[\"y\"][i], self.variables[\"y_action\"][i]), axis=1) for i in range(len(self.variables[\"y\"]))]\n loss = np.sum([tf.nn.l2_loss(y_1d[i] - self.variables[\"y_true\"]) for i in range(len(y_1d))])... | [
"0.70604014",
"0.6739587",
"0.6399894",
"0.63691413",
"0.62196726",
"0.61939603",
"0.61482894",
"0.6097922",
"0.6071232",
"0.60199046",
"0.6015574",
"0.60058206",
"0.5987177",
"0.59870607",
"0.59616125",
"0.59403795",
"0.59061944",
"0.58969194",
"0.58829916",
"0.58415216",
"0... | 0.6656896 | 2 |
Ensure that numerator is divisible by the denominator. | def ensure_divisibility(numerator, denominator):
assert numerator % denominator == 0, "{} is not divisible by {}".format(numerator, denominator) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def divide_ints_check_divisible(numerator, denominator):\n if not isinstance(numerator, int):\n raise TypeError('`numerator` is not an instance of `int`.')\n if not isinstance(denominator, int):\n raise TypeError('`denominator` is not an instance of `int`.')\n if numerator % denominator != 0... | [
"0.80189806",
"0.79450506",
"0.7656433",
"0.7321621",
"0.73083454",
"0.6930531",
"0.6927685",
"0.6643818",
"0.66237444",
"0.65489805",
"0.6548519",
"0.6480361",
"0.6450601",
"0.6308908",
"0.63015735",
"0.6266947",
"0.62265795",
"0.62150854",
"0.618245",
"0.6116295",
"0.611579... | 0.8829848 | 0 |
Ensure that numerator is divisible by the denominator and return the division value. | def divide(numerator, denominator):
ensure_divisibility(numerator, denominator)
return numerator // denominator | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def divide(self, numerator, denominator):\r\n if denominator == 0:\r\n if not self.has_error:\r\n self.has_error = True\r\n self.error += DIVISION_BY_ZERO\r\n return 1\r\n else:\r\n return numerator / denominator",
"def divide_by(numera... | [
"0.8466519",
"0.8147906",
"0.8017677",
"0.7677957",
"0.7466672",
"0.7403014",
"0.73982346",
"0.732799",
"0.7150066",
"0.713532",
"0.713532",
"0.70842254",
"0.70722574",
"0.706894",
"0.70327723",
"0.6994885",
"0.6992866",
"0.6982372",
"0.6956742",
"0.6944867",
"0.6935785",
"... | 0.8783131 | 0 |
Init method based on N(0, sigma). | def init_method_normal(sigma):
def init_(tensor):
return torch.nn.init.normal_(tensor, mean=0.0, std=sigma)
return init_ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, sigma=0.0001):\n self.sigma = sigma",
"def __init__(self, sigma):\n self.sigma = float(sigma)\n super().__init__(domain=functional.domain,\n range=functional.domain, linear=False)\n\n # Setting up parameters\n ... | [
"0.75872624",
"0.7376511",
"0.70341724",
"0.6977439",
"0.6934908",
"0.6788185",
"0.6788185",
"0.66477704",
"0.6600612",
"0.6528712",
"0.65230536",
"0.651248",
"0.65082043",
"0.6487978",
"0.6459183",
"0.6443816",
"0.64392465",
"0.642364",
"0.6417713",
"0.637748",
"0.63402086",... | 0.67498875 | 7 |
Helper for instantiating a ShardedTensor where the `tp_axis` dimension is sharded across TP group. | def make_tp_sharded_tensor_for_checkpoint(tensor, key, tp_axis=0, replica_id=None, **kwargs):
return ShardedTensor.from_rank_offsets(
key,
tensor,
(
tp_axis,
parallel_state.get_tensor_model_parallel_rank(),
parallel_state.get_tensor_model_parallel_world_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_sharded_tensor_for_checkpoint(tensor, key, **kwargs):\n\n return ShardedTensor.from_rank_offsets(\n key,\n tensor,\n replica_id=parallel_state.get_data_parallel_rank()\n * parallel_state.get_data_parallel_world_size()\n + parallel_state.get_tensor_model_parallel_rank(... | [
"0.62167466",
"0.5897788",
"0.5701166",
"0.5607006",
"0.5557774",
"0.55356824",
"0.5321004",
"0.53100383",
"0.51067233",
"0.5093603",
"0.50926715",
"0.50296974",
"0.5026927",
"0.4990751",
"0.49722522",
"0.49509093",
"0.49495432",
"0.49429172",
"0.49210116",
"0.48878738",
"0.4... | 0.75323325 | 0 |
Helper for instantiating a nonsharded ShardedTensor (replicated across TP and DP group). | def make_sharded_tensor_for_checkpoint(tensor, key, **kwargs):
return ShardedTensor.from_rank_offsets(
key,
tensor,
replica_id=parallel_state.get_data_parallel_rank()
* parallel_state.get_data_parallel_world_size()
+ parallel_state.get_tensor_model_parallel_rank(),
*... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_tp_sharded_tensor_for_checkpoint(tensor, key, tp_axis=0, replica_id=None, **kwargs):\n\n return ShardedTensor.from_rank_offsets(\n key,\n tensor,\n (\n tp_axis,\n parallel_state.get_tensor_model_parallel_rank(),\n parallel_state.get_tensor_model_par... | [
"0.65599984",
"0.5717177",
"0.5703217",
"0.56154853",
"0.5568129",
"0.5568129",
"0.54848343",
"0.54728",
"0.5453427",
"0.54405004",
"0.54305416",
"0.54225713",
"0.541727",
"0.5382867",
"0.53583944",
"0.53495646",
"0.52744365",
"0.52639186",
"0.5233921",
"0.5233617",
"0.523055... | 0.6421122 | 1 |
Creates a MLP with configurable activation functions and dimensions for each layer | def make_mlp(dim_list, activation, batch_norm=False, dropout=0.0):
layers = []
for dim_in, dim_out in zip(dim_list[:-1], dim_list[1:]):
layers.append(nn.Linear(dim_in, dim_out))
if batch_norm:
layers.append(nn.BatchNorm1d(dim_out))
if activation == 'relu':
layers... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_model(num_vars, num_categs, hidden_dims, actfn=None):\n num_outputs = max(1, num_categs)\n num_inputs = num_vars\n actfn = get_activation_function(actfn)\n\n mask = InputMask(None)\n if num_categs > 0:\n pre_layers = EmbedLayer(num_vars=num_vars,\n nu... | [
"0.7377406",
"0.7333905",
"0.70421517",
"0.6955417",
"0.6821501",
"0.68130195",
"0.6802523",
"0.67283475",
"0.66690606",
"0.6622575",
"0.661229",
"0.65686977",
"0.6548823",
"0.65108293",
"0.64653003",
"0.6382096",
"0.63816655",
"0.6364846",
"0.63583595",
"0.6326049",
"0.63255... | 0.6816784 | 5 |
opens a Qt stylesheet with a path relative to the project | def open_qss(path):
with open(path) as f:
qss = f.read()
pattern = r'url\((.*?)\);'
for url in sorted(set(re.findall(pattern, qss)), key=len, reverse=True):
directory, basename = os.path.split(path)
new_url = os.path.join(directory, *url.split(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_stylesheet(name):\n with suppress(FileNotFoundError):\n with open(STATIC_PATH / name, 'rt') as stylesheet:\n style = stylesheet.read().replace('@Path', (IMAGES_PATH / settings.value(Key.Theme)).as_posix())\n return style\n return ''",
"def loadStyleSheet(self, styleFile=No... | [
"0.6207485",
"0.6139326",
"0.61135066",
"0.59641707",
"0.57913464",
"0.56551206",
"0.56247807",
"0.55175304",
"0.55074334",
"0.54528993",
"0.5383155",
"0.5347583",
"0.53475785",
"0.5320229",
"0.52764684",
"0.52764684",
"0.5231521",
"0.5227985",
"0.5218482",
"0.52152383",
"0.5... | 0.0 | -1 |
Returns whether or not the rate limit has been exceeded for this interval. | def is_exceeded(self):
if self.stopwatch.check_time() > self.duration:
self.stopwatch.start()
self.num_processed_this_interval = 0
return False
return self.num_processed_this_interval >= self.max_per_interval | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_rate_limit(self):\n # Already received 429 from server\n if self.rate_limit_sleep:\n msg = f\"请求过于频繁,已被BitMEX限制,请等待{self.rate_limit_sleep}秒后再试\"\n self.gateway.write_log(msg)\n return False\n # Just local request limit is reached\n elif not sel... | [
"0.81886196",
"0.7860412",
"0.7287615",
"0.7259392",
"0.70181286",
"0.6880373",
"0.68399876",
"0.6807785",
"0.68047625",
"0.67791414",
"0.6691183",
"0.6668844",
"0.66030705",
"0.65513533",
"0.6510626",
"0.65095764",
"0.64973634",
"0.6490561",
"0.6468434",
"0.6420972",
"0.6397... | 0.7323208 | 2 |
Ensure that nxt and prv items are discarded when testing the equality of two trees. | def __eq__(self, other):
self = filter_tree(self, _remove_visit_meta)
return super(Node, self).__eq__(filter_tree(other, _remove_visit_meta)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __neq__(self, other): \n return not self == other",
"def __ne__(left, right):\n return (not (left == right))",
"def test_equals(self):\n parameters = [\n (1, 'a', False),\n (1, None, False),\n (1, 2, False),\n (1, 1, True)\n ]\n... | [
"0.6063511",
"0.60523754",
"0.60055393",
"0.59527284",
"0.5903955",
"0.58971107",
"0.58808404",
"0.58345664",
"0.5833671",
"0.58172846",
"0.5803773",
"0.5792091",
"0.57811755",
"0.5777969",
"0.5768776",
"0.5739272",
"0.5739272",
"0.5736872",
"0.5736872",
"0.5723223",
"0.57164... | 0.0 | -1 |
distort a specific point | def distort_point(point):
fx, fy = _camera_tuned_matrix[0][0], _camera_tuned_matrix[1][1]
cx, cy = _camera_tuned_matrix[0][2], _camera_tuned_matrix[1][2]
x, y = (point.x - cx) / fx, (point.y - cy) / fy
k1, k2, p1, p2, k3 = _camera_distortion[0]
r2 = x ** 2 + y ** 2
r4 = r2 * r2
r6 = r2 * r4... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def undistort_points(points, K, dist):\n return cv2.undistortPoints(points, K, dist)",
"def _distort(self, xy: np.ndarray) -> np.ndarray:\n # X' = dr * X + dt\n if not any(self.k) and not any(self.p):\n return xy\n dxy = xy.copy()\n r2 = np.sum(xy ** 2, axis=1)\n ... | [
"0.7185404",
"0.71529627",
"0.7112815",
"0.6317618",
"0.62505597",
"0.6112292",
"0.6106113",
"0.60904396",
"0.6041913",
"0.60095",
"0.5903378",
"0.5900208",
"0.58998436",
"0.5894413",
"0.5854621",
"0.5817317",
"0.58132195",
"0.57800376",
"0.5763803",
"0.57206905",
"0.5696379"... | 0.67700994 | 3 |
Given a NumPy / OpenCV 2 image, center crops it to the given size. | def center_crop(image: np.ndarray, size: Union[tuple, list, np.ndarray]) -> np.ndarray:
if type(size) is int and isinstance(size, str) and len(size) < 2:
raise ValueError("size has to be a list or tuple or array with at least two int elements")
# For tensor processing
image = _convert_tensor_to_nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def center_crop_img(img, size=100):\n if img.shape[0] < size or img.shape[1] < size:\n return\n center_x, center_y = img.shape[1] // 2, img.shape[0] // 2\n half_size = size // 2\n try:\n return img[center_y - half_size: center_y + half_size, center_x - half_size: center_x + half_size]\n ... | [
"0.797611",
"0.7485786",
"0.74626565",
"0.7442388",
"0.7380599",
"0.7341405",
"0.71853316",
"0.71751124",
"0.7135351",
"0.7097567",
"0.70561105",
"0.6989287",
"0.69795585",
"0.6942761",
"0.6928651",
"0.6913199",
"0.690994",
"0.69037414",
"0.68939775",
"0.6870195",
"0.68136394... | 0.8053452 | 0 |
Given a NumPy / OpenCV 2 image, crops it to the given size, around it's centre point | def crop_around_center(image: np.ndarray, size: Union[tuple, list, np.ndarray]) -> np.ndarray:
if type(size) is int and isinstance(size, str) and len(size) < 2:
raise ValueError("size has to be a list or tuple or array with at least two int elements")
# For tensor processing
image = _convert_tenso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __crop(img, pos, size):\n ow, oh = img.size\n x1, y1 = pos\n tw = th = size\n if (ow > tw or oh > th):\n return img.crop((x1, y1, x1 + tw, y1 + th))\n return img",
"def center_crop(img:np.array,output_size:List[int])->np.array:\n\n if isinstance(output_size,numbers.Number):\n ... | [
"0.7458042",
"0.7452528",
"0.74039954",
"0.7366078",
"0.73545456",
"0.73128617",
"0.7251075",
"0.7201152",
"0.71689117",
"0.71518946",
"0.7148854",
"0.7126921",
"0.71200424",
"0.7095002",
"0.7084206",
"0.7066387",
"0.701856",
"0.6991854",
"0.6980322",
"0.69573003",
"0.6948773... | 0.7536772 | 0 |
Returns True if the contact is tilted. | def is_tilted(self, channel=None):
return self.get_state(channel) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def qtilde(self) -> bool:\n return self._qtilde",
"def is_antipodal(self):\n return self._.r if self._.antipodal else False",
"def is_origin(self) -> bool:\n return self.x == 0 and self.y == 0",
"def is_masked(self):\n return False",
"def degenerate(self):\n return self.r... | [
"0.603381",
"0.5886912",
"0.5860704",
"0.55790263",
"0.5549671",
"0.54859716",
"0.5478402",
"0.54456013",
"0.54310817",
"0.542535",
"0.5411188",
"0.53881085",
"0.53693324",
"0.53692335",
"0.5355262",
"0.5348771",
"0.53339815",
"0.5315877",
"0.5314212",
"0.5293286",
"0.5289911... | 0.0 | -1 |
Returns True if the handle is set to tilted. | def is_tilted(self, channel=None):
return self.get_state(channel) == 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def qtilde(self) -> bool:\n return self._qtilde",
"def IsNormalMode(self):\n return self.mode == ViKeyHandler.NORMAL",
"def is_antipodal(self):\n return self._.r if self._.antipodal else False",
"def isAltHeld():\n return False if pm.about(batch=True) else (pm.getModifiers() & 8) > 0"... | [
"0.6534187",
"0.60057116",
"0.5721048",
"0.55515295",
"0.5521086",
"0.5406051",
"0.5385722",
"0.5361601",
"0.53505135",
"0.5343395",
"0.5275451",
"0.52672917",
"0.523906",
"0.52026904",
"0.5196759",
"0.51876616",
"0.51870817",
"0.5177884",
"0.51737446",
"0.5158726",
"0.515033... | 0.49288893 | 47 |
Returns True if CO2 state is normal. | def is_normal(self, channel=None):
return self.get_state(channel) == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_monochromatic(self):\n return equal(s.color for s in self.iter_states())",
"def is_on(self):\n return self._state != self._invert_logic",
"def assumed_state(self) -> bool:\n return self._optimistic",
"def assumed_state(self):\n return self._command_state is False",
"def i... | [
"0.63989973",
"0.629935",
"0.6015038",
"0.5811539",
"0.57207966",
"0.5706454",
"0.5631948",
"0.56137234",
"0.559398",
"0.5584031",
"0.55800146",
"0.55799305",
"0.55704635",
"0.5545672",
"0.5543839",
"0.5508212",
"0.54747784",
"0.5468475",
"0.5466188",
"0.5466156",
"0.54649544... | 0.6375818 | 1 |
Returns if the word is in the trie. | def search(self, word: str) -> bool:
n = self.root
for l in word[0:-1]:
cn = n.get_child_with_val(l)
if cn == None or cn.eow:
return False
n = cn
last_node = n.get_eow_child_with_val(word[-1])
if last_node == None:
return F... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr... | [
"0.83863926",
"0.81505",
"0.81232995",
"0.7856138",
"0.78298444",
"0.7793162",
"0.77923244",
"0.77637726",
"0.7752571",
"0.774713",
"0.77109605",
"0.7680232",
"0.7676067",
"0.76640654",
"0.7650189",
"0.7633662",
"0.7627638",
"0.7610382",
"0.7576994",
"0.75686866",
"0.756092",... | 0.7478827 | 29 |
NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy. | def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:
return pulumi.get(self, "namespace_selector") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:\n return pulumi.get(self, \"namespace_selector\")",
"def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:\n return pulumi.get(self, \"namespace_selector\")",
"def namespace_selector(self) ... | [
"0.5621592",
"0.5621592",
"0.5621592",
"0.50892055",
"0.50335526",
"0.50335526",
"0.50335526",
"0.49598947",
"0.49413362",
"0.49188876",
"0.48614702",
"0.4821528",
"0.4821528",
"0.4821528",
"0.47646743",
"0.47337058",
"0.47246644",
"0.47229904",
"0.47105864",
"0.46107516",
"0... | 0.5740632 | 2 |
ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule. | def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperations']]:
return pulumi.get(self, "resource_rules") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperationsPatch']]:\n return pulumi.get(self, \"resource_rules\")",
"def rules(self) -> Optional[Sequence['outputs.RuleWithOperations']]:\n return pulumi.get(self, \"rules\")",
"def rules(self) -> Optional[Sequence['outputs.RuleW... | [
"0.7212852",
"0.626723",
"0.626723",
"0.6233313",
"0.6233313",
"0.58287555",
"0.57398957",
"0.5652218",
"0.5584852",
"0.5422545",
"0.5402217",
"0.5372105",
"0.5312721",
"0.53091645",
"0.5299365",
"0.5285576",
"0.52767664",
"0.52494067",
"0.5245626",
"0.52377105",
"0.522741",
... | 0.72779727 | 0 |
NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy. | def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelectorPatch']:
return pulumi.get(self, "namespace_selector") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:\n return pulumi.get(self, \"namespace_selector\")",
"def namespace_selector(self) -> Optional['_meta.v1.outputs.LabelSelector']:\n return pulumi.get(self, \"namespace_selector\")",
"def namespace_selector(self) -> Optiona... | [
"0.574091",
"0.574091",
"0.574091",
"0.5089836",
"0.50320995",
"0.50320995",
"0.50320995",
"0.4962092",
"0.4941465",
"0.49183708",
"0.48608595",
"0.48197553",
"0.48197553",
"0.48197553",
"0.47646925",
"0.47335988",
"0.4727508",
"0.4725472",
"0.47133085",
"0.461183",
"0.449169... | 0.5621526 | 5 |
ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule. | def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperationsPatch']]:
return pulumi.get(self, "resource_rules") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_rules(self) -> Optional[Sequence['outputs.NamedRuleWithOperations']]:\n return pulumi.get(self, \"resource_rules\")",
"def rules(self) -> Optional[Sequence['outputs.RuleWithOperations']]:\n return pulumi.get(self, \"rules\")",
"def rules(self) -> Optional[Sequence['outputs.RuleWithOp... | [
"0.7278144",
"0.6268627",
"0.6268627",
"0.6234785",
"0.6234785",
"0.58311135",
"0.57414705",
"0.56523573",
"0.5585149",
"0.54238856",
"0.54033464",
"0.53733134",
"0.53141737",
"0.53107816",
"0.5299748",
"0.5283886",
"0.52786136",
"0.5250844",
"0.52464885",
"0.52390134",
"0.52... | 0.7213293 | 1 |
Kind is the API kind the resources belong to. Required. | def kind(self) -> Optional[str]:
return pulumi.get(self, "kind") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kind(self, kind):\n if kind is None:\n raise ValueError(\"Invalid value for `kind`, must not be `None`\") # noqa: E501\n allowed_values = [\"require_tasks_to_be_completed\", \"require_passing_builds_to_merge\", \"force\", \"require_all_dependencies_merged\", \"push\", \"require_approv... | [
"0.6209708",
"0.6069023",
"0.6020148",
"0.6008778",
"0.5950071",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"0.59305537",
"... | 0.6000945 | 5 |
Kind is the API kind the resources belong to. Required. | def kind(self) -> Optional[str]:
return pulumi.get(self, "kind") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kind(self, kind):\n if kind is None:\n raise ValueError(\"Invalid value for `kind`, must not be `None`\") # noqa: E501\n allowed_values = [\"require_tasks_to_be_completed\", \"require_passing_builds_to_merge\", \"force\", \"require_all_dependencies_merged\", \"push\", \"require_approv... | [
"0.62095636",
"0.60710657",
"0.60212165",
"0.6009538",
"0.5950414",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
"0.5932811",
... | 0.6002357 | 6 |
`name` is the name of the resource being referenced. `name` and `selector` are mutually exclusive properties. If one is set, the other must be unset. | def name(self) -> Optional[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__, *,\n name: Optional[pulumi.Input[str]] = None,\n selectors: Optional[pulumi.Input[Sequence[pulumi.Input['SelectorArgs']]]] = None):\n if name is not None:\n pulumi.set(__self__, \"name\", name)\n if selectors is not None:\n ... | [
"0.6022603",
"0.5493131",
"0.54854655",
"0.54564255",
"0.53101546",
"0.513093",
"0.50835437",
"0.506374",
"0.50337493",
"0.50075436",
"0.50075436",
"0.50075436",
"0.50075436",
"0.5006786",
"0.49921054",
"0.49921054",
"0.49921054",
"0.49921054",
"0.49921054",
"0.49921054",
"0.... | 0.0 | -1 |
namespace is the namespace of the referenced resource. Allows limiting the search for params to a specific namespace. Applies to both `name` and `selector` fields. A pernamespace parameter may be used by specifying a namespacescoped `paramKind` in the policy and leaving this field empty. If `paramKind` is clusterscoped... | def namespace(self) -> Optional[str]:
return pulumi.get(self, "namespace") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def watch_namespaced_cluster_policy_binding(self, name, **kwargs):\n\n all_params = ['name', 'pretty', 'label_selector', 'field_selector', 'watch', 'resource_version', 'timeout_seconds']\n all_params.append('callback')\n\n params = locals()\n for key, val in iteritems(params['kwargs']):... | [
"0.5365855",
"0.5311109",
"0.5285467",
"0.5237485",
"0.5237441",
"0.5228274",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5122965",
"0.5062839",
"0.5062839",
"0.5062839",
"0.5062839",
"... | 0.4442695 | 79 |
`parameterNotFoundAction` controls the behavior of the binding when the resource exists, and name or selector is valid, but there are no parameters matched by the binding. If the value is set to `Allow`, then no matched parameters will be treated as successful validation by the binding. If set to `Deny`, then no matche... | def parameter_not_found_action(self) -> Optional[str]:
return pulumi.get(self, "parameter_not_found_action") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def HandleMissingParameterDoc(self, token, param_name):\n raise TypeError('Abstract method HandleMissingParameterDoc not implemented')",
"def test_invalid_ssm_parameter_without_default():\n with pytest.raises(GetParameterError):\n _ = get_ssm_parameter(ssm_parameter_key=\"/oops/not/valid\")",
"def... | [
"0.5484264",
"0.54707",
"0.5435296",
"0.52834576",
"0.5257851",
"0.5239528",
"0.5228244",
"0.5224172",
"0.521562",
"0.5195242",
"0.5019285",
"0.4970587",
"0.49247026",
"0.48941028",
"0.48703346",
"0.48554608",
"0.48435742",
"0.48361632",
"0.48011",
"0.47820675",
"0.4781566",
... | 0.67835265 | 0 |
`name` is the name of the resource being referenced. `name` and `selector` are mutually exclusive properties. If one is set, the other must be unset. | def name(self) -> Optional[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__, *,\n name: Optional[pulumi.Input[str]] = None,\n selectors: Optional[pulumi.Input[Sequence[pulumi.Input['SelectorArgs']]]] = None):\n if name is not None:\n pulumi.set(__self__, \"name\", name)\n if selectors is not None:\n ... | [
"0.6022603",
"0.5493131",
"0.54854655",
"0.54564255",
"0.53101546",
"0.513093",
"0.50835437",
"0.506374",
"0.50337493",
"0.50075436",
"0.50075436",
"0.50075436",
"0.50075436",
"0.5006786",
"0.49921054",
"0.49921054",
"0.49921054",
"0.49921054",
"0.49921054",
"0.49921054",
"0.... | 0.0 | -1 |
namespace is the namespace of the referenced resource. Allows limiting the search for params to a specific namespace. Applies to both `name` and `selector` fields. A pernamespace parameter may be used by specifying a namespacescoped `paramKind` in the policy and leaving this field empty. If `paramKind` is clusterscoped... | def namespace(self) -> Optional[str]:
return pulumi.get(self, "namespace") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def watch_namespaced_cluster_policy_binding(self, name, **kwargs):\n\n all_params = ['name', 'pretty', 'label_selector', 'field_selector', 'watch', 'resource_version', 'timeout_seconds']\n all_params.append('callback')\n\n params = locals()\n for key, val in iteritems(params['kwargs']):... | [
"0.5365855",
"0.5311109",
"0.5285467",
"0.5237485",
"0.5237441",
"0.5228274",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5124307",
"0.5122965",
"0.5062839",
"0.5062839",
"0.5062839",
"0.5062839",
"... | 0.4442695 | 78 |
`parameterNotFoundAction` controls the behavior of the binding when the resource exists, and name or selector is valid, but there are no parameters matched by the binding. If the value is set to `Allow`, then no matched parameters will be treated as successful validation by the binding. If set to `Deny`, then no matche... | def parameter_not_found_action(self) -> Optional[str]:
return pulumi.get(self, "parameter_not_found_action") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def HandleMissingParameterDoc(self, token, param_name):\n raise TypeError('Abstract method HandleMissingParameterDoc not implemented')",
"def test_invalid_ssm_parameter_without_default():\n with pytest.raises(GetParameterError):\n _ = get_ssm_parameter(ssm_parameter_key=\"/oops/not/valid\")",
"def... | [
"0.5484264",
"0.54707",
"0.5435296",
"0.52834576",
"0.5257851",
"0.5239528",
"0.5228244",
"0.5224172",
"0.521562",
"0.5195242",
"0.5019285",
"0.4970587",
"0.49247026",
"0.48941028",
"0.48703346",
"0.48554608",
"0.48435742",
"0.48361632",
"0.48011",
"0.47820675",
"0.4781566",
... | 0.67835265 | 1 |
ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding. | def __init__(__self__, *,
match_resources: Optional['outputs.MatchResources'] = None,
param_ref: Optional['outputs.ParamRef'] = None,
policy_name: Optional[str] = None,
validation_actions: Optional[Sequence[str]] = None):
if match_resources is ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spec(self) -> Optional['outputs.ValidatingAdmissionPolicyBindingSpec']:\n return pulumi.get(self, \"spec\")",
"def __init__(__self__, *,\n api_version: Optional[str] = None,\n kind: Optional[str] = None,\n metadata: Optional['_meta.v1.outputs.ObjectMeta'... | [
"0.7041987",
"0.5891312",
"0.5756616",
"0.4778619",
"0.46263778",
"0.45471433",
"0.4417923",
"0.43508485",
"0.43091828",
"0.42596906",
"0.42212072",
"0.41586104",
"0.41075704",
"0.41067326",
"0.4078584",
"0.40658724",
"0.40642",
"0.40527445",
"0.40447128",
"0.40333524",
"0.40... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.