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 |
|---|---|---|---|---|---|---|
Initially empty priority queue. | def __init__(self):
self.heap = [None] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_empty_queue():\n return Queue(0, None, None)",
"def empty_queue():\n return Queue()",
"def empty_queue():\n return Queue()",
"def priority_queue_full():\n from src.priorityq import PriorityQueue\n priority_queue = PriorityQueue()\n priority_queue.insert(15, 5)\n priority_queue.i... | [
"0.751585",
"0.7229118",
"0.7229118",
"0.68309575",
"0.66967046",
"0.6606941",
"0.6506064",
"0.6504965",
"0.64588803",
"0.64262563",
"0.6390013",
"0.6341244",
"0.6314453",
"0.6273696",
"0.6271133",
"0.6271133",
"0.6271133",
"0.623536",
"0.6197514",
"0.6187265",
"0.6155153",
... | 0.6543893 | 6 |
Inserts an element in the priority queue. | def append(self, key):
if key is None:
raise ValueError('Cannot insert None in the queue')
i = len(self.heap)
self.heap.append(key)
while i > 1:
parent = i // 2
if key < self.heap[parent]:
self.heap[i], self.heap[parent] = self.heap[pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def push(self, elt):\n if len(self._queue) == 0: self._queue.append(elt); return\n for i in range(len(self._queue)):\n if self._queue[i].priority < elt.priority:\n self._queue.insert(i, elt)\n return\n #if we get here, elt is lower than all the other pr... | [
"0.7832514",
"0.77645606",
"0.75771517",
"0.74165255",
"0.73604333",
"0.73401624",
"0.7286906",
"0.7246562",
"0.7224342",
"0.72192746",
"0.7202222",
"0.71819013",
"0.7180147",
"0.71085465",
"0.7096384",
"0.70856744",
"0.70856744",
"0.7084148",
"0.70814943",
"0.7069347",
"0.70... | 0.6240222 | 93 |
Returns the smallest element in the queue. | def min(self):
return self.heap[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _find_min(self):\n if self.is_empty(): # is_empty inherited from base class\n raise Empty('Priority queue is empty')\n small = self._data.first()\n walk = self._data.after(small)\n while walk is not None:\n if walk.element() < small.element():\n small = walk\n walk = self._dat... | [
"0.86505866",
"0.78346986",
"0.77649283",
"0.770033",
"0.76979214",
"0.7609674",
"0.7585722",
"0.74804986",
"0.7456063",
"0.74530405",
"0.7425251",
"0.7399783",
"0.73981243",
"0.73842514",
"0.7328499",
"0.73163944",
"0.72997665",
"0.72857535",
"0.72819656",
"0.72803116",
"0.7... | 0.74267006 | 10 |
Context manager closing connection | async def __aexit__(self, exc_type, exc_value, traceback):
# Close the connection
await self.disconnect() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __exit__(self, exc_type, exc_val, exc_tb):\n self.session.close()",
"def close_connection(self):\n\t\tself.session.close()",
"def __exit__(self, exc_type, exc_val, exc_tb):\n self.conn.close()\n if exc_val:\n raise",
"def close(self): \n\t\tself.connection = None",
"def ... | [
"0.7961219",
"0.79158074",
"0.7849339",
"0.7805315",
"0.77172446",
"0.767929",
"0.76136905",
"0.7588821",
"0.7577749",
"0.7561629",
"0.75514525",
"0.755019",
"0.75479174",
"0.75121725",
"0.7507942",
"0.7498741",
"0.7489624",
"0.74830574",
"0.7476336",
"0.7440508",
"0.7440508"... | 0.0 | -1 |
Method removing ANSI escape sequence from a string Just CSI sequences are removed | def remove_ansi_escape_sequence(self, text):
# By default no string returned
output = ""
# By default no escape sequence found
esc_found = 0
# Read char by char a string
for i in text:
# Display char
# log.info(f"{str(i).encode('ascii')}")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strip_ansi(text):\n return ANSI_ESCAPE_RE.sub('', text)",
"def strip_ansi(content):\n return ANSI_ESCAPES_REGEX.sub('', content)",
"def strip_ansi(text: str):\n return _ANSI_SEQUENCE_REGEX.sub('', text)",
"def remove_ansi_escape_sequences(input_string):\n ansi_escape = re.compile(r'(\\x9B|\\x... | [
"0.8376572",
"0.82872045",
"0.8137438",
"0.80717736",
"0.80199426",
"0.7908805",
"0.78280157",
"0.7787395",
"0.768299",
"0.7558967",
"0.7500658",
"0.7433293",
"0.7218495",
"0.70009",
"0.67455286",
"0.672778",
"0.6626976",
"0.6585098",
"0.65614086",
"0.656063",
"0.6510126",
... | 0.78745204 | 6 |
Sets the implied precision for this block. | def setImpliedPrecision(self, precision_state):
self.__typeid.setImpliedPrecision(precision_state)
for ii in self.__parameters:
ii.setImpliedPrecision(precision_state) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_precision(self, precision) :\n self.__precision = self.parent().monoid().filter(precision)",
"def _set_precision(self, precision) :\n self.__precision = self.parent().action().filter(precision)",
"def change_precision(self, precision):\n if precision <= 0:\n print(\"Pre... | [
"0.76216877",
"0.7445223",
"0.72476476",
"0.7008173",
"0.68668103",
"0.6843041",
"0.6809629",
"0.6794355",
"0.6696644",
"0.6616972",
"0.6458632",
"0.63987255",
"0.6283753",
"0.62798977",
"0.627851",
"0.627851",
"0.6226328",
"0.6214044",
"0.6149669",
"0.6105994",
"0.6089772",
... | 0.6918356 | 4 |
Tell if given object is a GLSL function block. | def is_glsl_block_function(op):
return isinstance(op, GlslBlockFunction) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_glsl_block_unary(op):\n return isinstance(op, GlslBlockUnary)",
"def isfunction(object):\r\n return isinstance(object, types.FunctionType)",
"def isMergableWith(self, op):\n if not is_glsl_block_function(op):\n return False\n if (self.getName() != op.getName()) or (self.ge... | [
"0.67513657",
"0.59952664",
"0.5961789",
"0.59614486",
"0.5907833",
"0.5751456",
"0.5690445",
"0.5633681",
"0.55431646",
"0.5473873",
"0.5450224",
"0.5416937",
"0.5388759",
"0.53774047",
"0.5372913",
"0.5360642",
"0.5355582",
"0.53300965",
"0.5309282",
"0.52596307",
"0.525055... | 0.8320793 | 0 |
Validate whether a password is strong or not. | def password_validator(password: str) -> bool:
uppercase_regex = re.compile(r"[A-Z]+")
lowercase_regex = re.compile(r"[a-z]+")
digit_regex = re.compile(r"\d+")
if len(password) < 8:
return False
if not uppercase_regex.findall(password):
return False
if not lowercase_regex.findal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_strong(password):\n # at least eight characters long\n if len(password) < 8:\n return False\n\n # contains both uppercase and lowercase characters\n upper = re.compile(r\"[A-Z]\")\n up = upper.search(password)\n lower = re.compile(r\"[a-z]\")\n low = lower.search(password)\n\n ... | [
"0.83585346",
"0.780757",
"0.7524206",
"0.7467783",
"0.7423552",
"0.74158835",
"0.7371211",
"0.73664546",
"0.73452336",
"0.7344676",
"0.7194357",
"0.7171687",
"0.71599966",
"0.71333224",
"0.71333224",
"0.71240216",
"0.7093238",
"0.707961",
"0.7075925",
"0.70527864",
"0.704605... | 0.6994973 | 25 |
Stores the json to a filepath | def storeJson(frameJson, filePath):
file1 = open(filePath, 'a+') # open file handler for specific filePath
file1.write(str(frameJson) + "\n\n")
file1.close() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_json(self, data, json_path=None):\n if json_path is None:\n json_path = self.json_path\n with open(json_path, encoding='utf-8', mode='w') as f:\n json.dump(data, f, indent=4, ensure_ascii=False)\n\n print(json_path)",
"def save_to_file(data):\n\ttry:\n\t\toutpu... | [
"0.80150616",
"0.7738107",
"0.76910883",
"0.7671159",
"0.766181",
"0.7629152",
"0.76104814",
"0.76104814",
"0.76104814",
"0.758912",
"0.7546988",
"0.7541718",
"0.7528836",
"0.7515445",
"0.7504338",
"0.7479639",
"0.7446597",
"0.74435174",
"0.7433478",
"0.7386105",
"0.737419",
... | 0.74785894 | 16 |
Plot traces and contours | def plot_MCMC_trace(ax, xdata, ydata, trace, scatter=False, **kwargs):
xbins, ybins, sigma = compute_sigma_level(trace[0], trace[1])
ax.contour(xbins, ybins, sigma.T, levels=[0.683, 0.955], **kwargs)
if scatter:
ax.plot(trace[0], trace[1], ',k', alpha=0.1)
ax.set_xlabel('m')
ax.set_ylabel('b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot(self, show_contours=False):\n plt.imshow(self.img, cmap='gray')\n if show_contours:\n for X in self.contours:\n plt.plot(X[:, 0], X[:, 1])\n plt.gca().invert_yaxis()",
"def plot_contour( m, lat, lon, data, contour, clr = 'k' ):\n \n x, y = m( lon,lat ... | [
"0.6848458",
"0.6483257",
"0.6411057",
"0.6347628",
"0.63311374",
"0.63311374",
"0.63311374",
"0.6313673",
"0.6299753",
"0.6299753",
"0.6299753",
"0.6299753",
"0.6288099",
"0.6171406",
"0.6109838",
"0.608352",
"0.6024868",
"0.6020237",
"0.60189694",
"0.6011973",
"0.6008449",
... | 0.5726043 | 37 |
Convert json parts to python objects. Tries to convert a json string or a compund object consisting of partial json strings to a full python object. Returns either a json scalar (string, int, float), a list or dict of json scalars, or any combination of lists and dicts that eventually end at json scalars. Note that thi... | def unjsonify(a):
# if string, try to loads() it
if isinstance(a, str):
try:
a = json.loads(a)
# pass-through to below
except ValueError:
return a
if isinstance(a, list):
return [unjsonify(x) for x in a]
if isinstance(a, dict):
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _convert_to_object(jsonc_obj):\n\n if isinstance(jsonc_obj, Jsonc):\n plain = {}\n for key, value in jsonc_obj._dict.items():\n plain[key] = _convert_to_object(value)\n return plain\n elif isinstance(jsonc_obj, list):\n plain = []\n for item in jsonc_obj:\n plain.append(_convert_to_o... | [
"0.66680074",
"0.63928473",
"0.6017572",
"0.5989312",
"0.59788144",
"0.5959627",
"0.59091157",
"0.5872779",
"0.58601344",
"0.5832497",
"0.58230376",
"0.5817522",
"0.5814647",
"0.5796724",
"0.57560086",
"0.57104766",
"0.56650776",
"0.56259483",
"0.5625881",
"0.56255794",
"0.56... | 0.6060976 | 2 |
Sigmoid function for activation | def _np_sigmoid(prediction):
x = prediction
prob_map = 1 / (1 + np.exp(-x))
return prob_map | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid_activation(x):\n return 1.0 / (1 + np.exp(-x))",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))",
"def sigmoid(x):\n\treturn 1 / (1 + m.exp(-x))",
"def sigmoid(x):\r\n\r\n return 1 / (... | [
"0.865935",
"0.8561662",
"0.8561662",
"0.8499141",
"0.84977734",
"0.8466368",
"0.84569424",
"0.84514827",
"0.84514827",
"0.84514827",
"0.84514827",
"0.84514827",
"0.84514827",
"0.84333646",
"0.84326917",
"0.8431087",
"0.84257156",
"0.8424263",
"0.84218955",
"0.84154516",
"0.8... | 0.0 | -1 |
Dense (fully connected) layer | def dense(x, size, name, weight_init=xavier):
w = tf.get_variable(name + "/w", [x.get_shape()[1], size], initializer=weight_init)
b = tf.get_variable(name + "/b", [size], initializer=tf.constant_initializer(0.0))
return tf.matmul(x, w) + b | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dense(in_layer):\n return Dense(neurons,\n kernel_initializer=initializer())(in_layer)",
"def output_layer_activation(x):\n return x",
"def dense(self, input_tensor, units, name, activation='linear'):\n with tf.variable_scope('Dense', name):\n ... | [
"0.74829906",
"0.6941629",
"0.6892387",
"0.68197453",
"0.6800643",
"0.67330986",
"0.6709845",
"0.6640852",
"0.66364175",
"0.66317254",
"0.6614538",
"0.65799814",
"0.6557379",
"0.6544252",
"0.65392625",
"0.650197",
"0.647326",
"0.64690346",
"0.6434535",
"0.6430102",
"0.6427809... | 0.0 | -1 |
Returns a json object of subnet specifications, or None upon error | def build_configs(subnets, host_count, dev_div, domain=None):
global VERBOSE
jsons = [] # subnet breakdown
unlabeled_hosts = [] # number of hosts in the network w/o roles
ip_addr = [] # keeping track of the 2nd and 3rd octets in IP
roles = dict.fromkeys(dev_div.keys(), 0)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subnets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"subnets\")",
"def _get_subnet_info(self, context):\n\n subnet = {}\n data = {}\n subnet_id = str(context.get('id', ''))\n data['subnet_id'] = subnet_id\n data['subnet_na... | [
"0.64065266",
"0.63228405",
"0.6294023",
"0.6285977",
"0.62025964",
"0.61259854",
"0.61236626",
"0.6108108",
"0.6092003",
"0.6092003",
"0.60779184",
"0.5933207",
"0.59232676",
"0.5901114",
"0.58493173",
"0.58067524",
"0.5774286",
"0.5774286",
"0.57689774",
"0.5753676",
"0.572... | 0.5190325 | 42 |
Returns a json object of subnet specifications, or None upon error | def build_configs_deprecated(total, net_div, dev_div, domain=None):
global VERBOSE
total_subnets = calculate_subnets(total, net_div)
if total_subnets < 1:
if VERBOSE:
print("WARNING: Could not break down nodes into the requested subnets.")
return None
jsons = []
host_cou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subnets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"subnets\")",
"def _get_subnet_info(self, context):\n\n subnet = {}\n data = {}\n subnet_id = str(context.get('id', ''))\n data['subnet_id'] = subnet_id\n data['subnet_na... | [
"0.64065266",
"0.63228405",
"0.6294023",
"0.6285977",
"0.62025964",
"0.61259854",
"0.61236626",
"0.6108108",
"0.6092003",
"0.6092003",
"0.60779184",
"0.5933207",
"0.59232676",
"0.5901114",
"0.58493173",
"0.58067524",
"0.5774286",
"0.5774286",
"0.57689774",
"0.5753676",
"0.572... | 0.48744082 | 82 |
Return a nice string formatted representation of the layer. | def __repr__(self):
return '{} (AR layer)'.format(self.name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n rep=\"This system has \"+str(self.NL)+\" layers.\\n\"\n rep+=\"The parameters for the each layers are:\\n\"\n for i in range(self.NL-1):\n rep+=\"Layer no. \"+str(i)+\":\\t \"+str(self.layers[i])\n rep+=\"Coupled to the next layer with strength:\\t\"+... | [
"0.75900286",
"0.7300841",
"0.72361094",
"0.72303885",
"0.70708513",
"0.6925643",
"0.6857246",
"0.6771772",
"0.67026395",
"0.6691163",
"0.66768026",
"0.6651635",
"0.6641453",
"0.66321373",
"0.66099906",
"0.6605443",
"0.65907615",
"0.65904456",
"0.6574823",
"0.65729624",
"0.65... | 0.0 | -1 |
Return a nice string formatted representation of the layer. | def __repr__(self):
return '{} (source layer)'.format(self.name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n rep=\"This system has \"+str(self.NL)+\" layers.\\n\"\n rep+=\"The parameters for the each layers are:\\n\"\n for i in range(self.NL-1):\n rep+=\"Layer no. \"+str(i)+\":\\t \"+str(self.layers[i])\n rep+=\"Coupled to the next layer with strength:\\t\"+... | [
"0.75900286",
"0.7300841",
"0.72361094",
"0.72303885",
"0.70708513",
"0.6925643",
"0.6771772",
"0.67026395",
"0.6691163",
"0.66768026",
"0.6651635",
"0.6641453",
"0.66321373",
"0.66099906",
"0.6605443",
"0.65907615",
"0.65904456",
"0.6574823",
"0.65729624",
"0.65684336",
"0.6... | 0.6857246 | 6 |
Return a nice string formatted representation of the layer. | def __repr__(self):
return '{} (terminator layer)'.format(self.name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n rep=\"This system has \"+str(self.NL)+\" layers.\\n\"\n rep+=\"The parameters for the each layers are:\\n\"\n for i in range(self.NL-1):\n rep+=\"Layer no. \"+str(i)+\":\\t \"+str(self.layers[i])\n rep+=\"Coupled to the next layer with strength:\\t\"+... | [
"0.75900286",
"0.7300841",
"0.72361094",
"0.72303885",
"0.70708513",
"0.6925643",
"0.6857246",
"0.6771772",
"0.67026395",
"0.6691163",
"0.66768026",
"0.6651635",
"0.6641453",
"0.66321373",
"0.66099906",
"0.6605443",
"0.65907615",
"0.65904456",
"0.6574823",
"0.65729624",
"0.65... | 0.0 | -1 |
Returns the root 'src' absolute path of this Chromium Git checkout. | def get_chromium_src_path() -> pathlib.Path:
_CHROMIUM_SRC_ROOT = pathlib.Path(__file__).parents[3].resolve(strict=True)
if _CHROMIUM_SRC_ROOT.name != 'src':
raise AssertionError(
f'_CHROMIUM_SRC_ROOT "{_CHROMIUM_SRC_ROOT}" should end in "src".')
try:
_assert_git_repository(_CHR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetSrc():\n return os.path.abspath(os.path.join(_THIS_DIR, os.pardir, os.pardir,\n os.pardir))",
"def source_root_dir():\n return os.path.abspath(os.path.dirname(__file__))",
"def menpowidgets_src_dir_path():\n # to avoid cluttering the menpowidgets.base namespac... | [
"0.7207564",
"0.70896846",
"0.70820946",
"0.70458966",
"0.7013986",
"0.6813633",
"0.6768941",
"0.6744797",
"0.6672002",
"0.6643499",
"0.6634959",
"0.66120505",
"0.6588977",
"0.6572024",
"0.6556969",
"0.65439117",
"0.65423363",
"0.65149325",
"0.65131664",
"0.65060693",
"0.6501... | 0.7769902 | 0 |
Get an array of flood risk probabilities from a sequence of postcodes. Probability is ordered High>Medium>Low>Very low>Zero. Flood risk data is extracted from the `Tool` flood risk file. | def get_sorted_flood_probability(self, postcodes):
# Fix evil postcodes
postcodes = clean_postcodes(postcodes)
# Get latitude and longitude
output = self.get_lat_long(postcodes) # Returns latitude,longitude pairs in an array
lat_long = pd.DataFrame(
{'Postcode':post... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def psipred(infile, sequence):\n aa2sec = {\n 'H': [1, 0, 0],\n 'E': [0, 1, 0],\n 'C': [0, 0, 1]\n }\n result = []\n with open(infile, 'r') as fh:\n for line in fh:\n if line.startswith('Pred:'):\n spl = line.strip().split(' ')\n if l... | [
"0.6149525",
"0.57030034",
"0.53762126",
"0.5350772",
"0.5320058",
"0.5255733",
"0.52238405",
"0.52073324",
"0.51705116",
"0.51705116",
"0.50618285",
"0.50456816",
"0.50339997",
"0.50247955",
"0.4985709",
"0.4939108",
"0.4907953",
"0.49060336",
"0.485977",
"0.48142055",
"0.48... | 0.64648455 | 0 |
Add value to the front of the list. | def add_first(self, value):
self.head = Node(value, self.head) | {
"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.78942317",
"0.7790364",
"0.77414846",
"0.76170623",
"0.74876505",
"0.7388164",
"0.735828",
"0.735828",
"0.73534775",
"0.7249651",
"0.7239951",
"0.72272575",
"0.7214107",
"0.7188011",
"0.7152299",
"0.70895433",
"0.70742625",
"0.7003356",
"0.695949",
"0.6953719",
"0.6946487"... | 0.733196 | 9 |
Add value to end of the linked list. | def add_last(self, value):
# Checking for empty list
if self.head is None:
self.add_first(value)
return
# Add new node
self._add_last(self.head, value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append(self, value):\n if not self.head:\n self.head = Node(value)\n return\n link = self.head\n while link.next_value:\n link = link.next_value\n link.next_value = Node(value)\n return",
"def append(self, value):\n current = self.hea... | [
"0.82557124",
"0.82534146",
"0.81088895",
"0.8080527",
"0.80634767",
"0.8063339",
"0.80544287",
"0.80018526",
"0.80018526",
"0.79947037",
"0.79647815",
"0.7918456",
"0.79086965",
"0.7891576",
"0.78685373",
"0.7771361",
"0.7765817",
"0.7756061",
"0.77515686",
"0.765143",
"0.76... | 0.8052043 | 7 |
Check whether value is in list. | def search(self, value):
return self._search(self.head, value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_list(value, arg):\r\n return value in arg",
"def list_should_contain_value(self,list_,value,msg=None):\r\n\r\n default =\"%s contains value '%s'\" %(seq2str(list_),value)\r\n _verify_condition(vlaue not in list_,default,msg)",
"def contains(self, value):\n return value in self.va... | [
"0.8385921",
"0.8242074",
"0.7920995",
"0.7596844",
"0.7492047",
"0.7468515",
"0.7417676",
"0.7408305",
"0.73256546",
"0.7324748",
"0.73132247",
"0.7260532",
"0.72374785",
"0.71995187",
"0.719442",
"0.71820176",
"0.71820176",
"0.717647",
"0.7168998",
"0.7168225",
"0.71612686"... | 0.0 | -1 |
Encode a long or int into a bytearray. | def encode_uvarint(value):
if not isinstance(value, int):
raise TypeError("UVarInt encode requires a int type")
output = bytearray()
encoder._EncodeVarint(output.extend, value)
return output | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Encode(chunk: bytes) -> bytes:\n return _UINT64.pack(len(chunk)) + chunk",
"def encode_i64(value: int) -> bytes:\n return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.I64].LENGTH, True)",
"def bencode(data, f):\n\tif isinstance(data, int):\n\t\t_encode_int(data, f)\n\telif isinstance(data, (str... | [
"0.67872787",
"0.6687064",
"0.66125387",
"0.6539887",
"0.6517371",
"0.651584",
"0.63990545",
"0.6383854",
"0.636777",
"0.633729",
"0.63330156",
"0.6301229",
"0.62918305",
"0.62918305",
"0.6271508",
"0.626411",
"0.6215441",
"0.6208903",
"0.61934125",
"0.6184863",
"0.6166674",
... | 0.5682967 | 55 |
Encode a long or int into a bytearray. | def encode_varint(value):
if not isinstance(value, int):
raise TypeError("VarInt encode requires an int type")
output = bytearray()
encoder._EncodeSignedVarint(output.extend, value)
return output | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Encode(chunk: bytes) -> bytes:\n return _UINT64.pack(len(chunk)) + chunk",
"def encode_i64(value: int) -> bytes:\n return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.I64].LENGTH, True)",
"def bencode(data, f):\n\tif isinstance(data, int):\n\t\t_encode_int(data, f)\n\telif isinstance(data, (str... | [
"0.678728",
"0.66870713",
"0.661254",
"0.6539881",
"0.65173805",
"0.6515839",
"0.6399046",
"0.6383853",
"0.6367764",
"0.63372874",
"0.6333018",
"0.63012266",
"0.62918305",
"0.62918305",
"0.62715054",
"0.62641066",
"0.62154424",
"0.6208907",
"0.6193416",
"0.61848617",
"0.61666... | 0.6113598 | 24 |
Return the car mileage. | def read_odometer(self):
print(f"This car has {self.odometer} miles on it.") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mileage(self):\n return str(self._delivery_service.total_mileage())",
"def get_range(self):\n if self.battery_size == 75:\n car_range = 260\n elif self.battery_size == 100:\n car_range = 315\n \n print(f\"This car can run for {car_range} miles.\")",
... | [
"0.6980209",
"0.65308183",
"0.63444203",
"0.6228041",
"0.6225186",
"0.6210702",
"0.61788327",
"0.6164188",
"0.6113817",
"0.610635",
"0.6080533",
"0.60572356",
"0.6047162",
"0.6015492",
"0.601154",
"0.59969085",
"0.59916687",
"0.59608316",
"0.5907209",
"0.5896274",
"0.5893449"... | 0.5371348 | 57 |
Initialize the battery's attributes. | def __init__(self, battery_size=75):
self.battery_size = battery_size | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, battery_size=40):\n self.battery_size = battery_size",
"def __init__(self, battery_size=70):\r\n\t\tself.battery_size = battery_size",
"def __init__(self, battery_size=70):\n self.battery_size = battery_size",
"def __init__(self, battery_size=70):\n self.battery_size =... | [
"0.7382995",
"0.73729676",
"0.73598105",
"0.73598105",
"0.73598105",
"0.7318721",
"0.73161864",
"0.7284151",
"0.72274315",
"0.7206751",
"0.7195436",
"0.69978577",
"0.69625956",
"0.69494915",
"0.6906689",
"0.6906689",
"0.6906689",
"0.6906689",
"0.6906689",
"0.6906689",
"0.6626... | 0.73419243 | 6 |
hides the existing shape associated with id | def hide(id):
if type(id) is int: # shapeID
g.hide(g.database[id])
else: # id refers to hypothetical shape
shapeID=pickShape(local_vars[id])
g.hide(g.database[shapeID]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide(id):\r\n if type(id) is int: # shapeID\r\n g.hide(g.database[id])\r\n else: # id refers to hypothetical shape\r\n shapeID=pickShape(local_vars[id])\r\n g.hide(g.database[shapeID])",
"def hide_shape(self, shape_id):\n\n if shape_id:\n self.itemconfigure(shape_... | [
"0.8581231",
"0.8390346",
"0.71212643",
"0.6763957",
"0.66287816",
"0.6290862",
"0.6058897",
"0.59502864",
"0.5834213",
"0.5813145",
"0.56963134",
"0.5608406",
"0.56070375",
"0.557525",
"0.5532165",
"0.5472659",
"0.5464938",
"0.54630136",
"0.5410584",
"0.53952074",
"0.5380336... | 0.8552118 | 1 |
hides the existing shape associated with id | def hide(id):
if type(id) is int: # shapeID
g.hide(g.database[id])
else: # id refers to hypothetical shape
shapeID=pickShape(local_vars[id])
g.hide(g.database[shapeID]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide(id):\n if type(id) is int: # shapeID\n g.hide(g.database[id])\n else: # id refers to hypothetical shape\n shapeID=pickShape(local_vars[id])\n g.hide(g.database[shapeID])",
"def hide_shape(self, shape_id):\n\n if shape_id:\n self.itemconfigure(shape_id, state=... | [
"0.8552118",
"0.8390346",
"0.71212643",
"0.6763957",
"0.66287816",
"0.6290862",
"0.6058897",
"0.59502864",
"0.5834213",
"0.5813145",
"0.56963134",
"0.5608406",
"0.56070375",
"0.557525",
"0.5532165",
"0.5472659",
"0.5464938",
"0.54630136",
"0.5410584",
"0.53952074",
"0.5380336... | 0.8581231 | 0 |
Property holding gravity gradient torque vector. | def gTorque(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _compute_gravity_torque(self):\n pass",
"def _compute_gravity_torque(self, curr_date):\n if self._to_add[0]:\n # return gravity gradient torque in satellite frame\n body2inertial = self.earth.getBodyFrame().getTransformTo(self.in_frame, curr_date)\n body2sat = s... | [
"0.72439516",
"0.7052605",
"0.6445959",
"0.6279989",
"0.62653804",
"0.61384517",
"0.6062409",
"0.5995027",
"0.5977623",
"0.5962598",
"0.59250134",
"0.5911715",
"0.58819413",
"0.5821571",
"0.5815939",
"0.5807609",
"0.5807609",
"0.58074605",
"0.58059394",
"0.58040255",
"0.58038... | 0.6673271 | 2 |
Property holding magnetic torque vector. | def mTorque(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_torque(self):\n return self.node.sdo[0x6077].phys # rate torque(mN.m) /1000",
"def aTorque(self):\n pass",
"def gTorque(self):\n pass",
"def _compute_gravity_torque(self):\n pass",
"def setMotorTorque(self, torque):\r\n if torque < 0.0:\r\n torque = 0... | [
"0.69905686",
"0.6883635",
"0.6844292",
"0.67961264",
"0.6745202",
"0.66349584",
"0.66349584",
"0.6534814",
"0.6531397",
"0.6504692",
"0.648461",
"0.64651704",
"0.64503294",
"0.63484573",
"0.63299674",
"0.6295242",
"0.62508523",
"0.6243299",
"0.6232335",
"0.62192",
"0.6147876... | 0.73894155 | 0 |
Property holding aerodynamic drag torque vector. | def aTorque(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _compute_gravity_torque(self):\n pass",
"def _compute_solar_torque(self):\n pass",
"def get_torque(self):\n return self.node.sdo[0x6077].phys # rate torque(mN.m) /1000",
"def mTorque(self):\n pass",
"def gTorque(self):\n pass",
"def make_torque(self):\n def... | [
"0.6740475",
"0.65039",
"0.6479744",
"0.6339336",
"0.6331302",
"0.63193476",
"0.6281803",
"0.62109023",
"0.6197392",
"0.61949915",
"0.61743325",
"0.61743325",
"0.6163846",
"0.6038678",
"0.59895176",
"0.5977949",
"0.5948082",
"0.5941911",
"0.5939099",
"0.59242696",
"0.5922103"... | 0.6281605 | 7 |
Sets the reference_currency of this CreditSupportAnnex. | def reference_currency(self, reference_currency):
if self.local_vars_configuration.client_side_validation and reference_currency is None: # noqa: E501
raise ValueError("Invalid value for `reference_currency`, must not be `None`") # noqa: E501
self._reference_currency = reference_currency | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def card_currency(self, card_currency):\n\n self._card_currency = card_currency",
"def billing_currency(self, billing_currency):\n\n self._billing_currency = billing_currency",
"def reference(self, reference):\n\n self._reference = reference",
"def reference(self, reference):\n\n ... | [
"0.6202353",
"0.620083",
"0.6186801",
"0.6186801",
"0.596234",
"0.59369206",
"0.5925179",
"0.5925179",
"0.5925179",
"0.5925179",
"0.5810195",
"0.5784062",
"0.5707103",
"0.5687867",
"0.56441146",
"0.560263",
"0.5576023",
"0.5565525",
"0.5519472",
"0.548651",
"0.5457715",
"0.... | 0.8066907 | 0 |
Sets the valuation_agent of this CreditSupportAnnex. | def valuation_agent(self, valuation_agent):
if self.local_vars_configuration.client_side_validation and valuation_agent is None: # noqa: E501
raise ValueError("Invalid value for `valuation_agent`, must not be `None`") # noqa: E501
if (self.local_vars_configuration.client_side_validation an... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agent_requirement(self, agent_requirement):\n\n self._agent_requirement = agent_requirement",
"def setAgility(self, agility):\n self.ag = agility",
"def valuation_date_times(self, valuation_date_times):\n\n self._valuation_date_times = valuation_date_times",
"def set_etacalc(self, et... | [
"0.5399857",
"0.5215203",
"0.5160706",
"0.51547",
"0.48660296",
"0.47691083",
"0.4741191",
"0.47110885",
"0.46982107",
"0.46744177",
"0.4664191",
"0.46602476",
"0.4644078",
"0.4594802",
"0.44882673",
"0.44703478",
"0.44610634",
"0.44596305",
"0.44565627",
"0.4448571",
"0.4439... | 0.7366433 | 0 |
Sets the threshold_amount of this CreditSupportAnnex. | def threshold_amount(self, threshold_amount):
if self.local_vars_configuration.client_side_validation and threshold_amount is None: # noqa: E501
raise ValueError("Invalid value for `threshold_amount`, must not be `None`") # noqa: E501
self._threshold_amount = threshold_amount | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_threshold(self, threshold):\n self._threshold = check_value_positive('threshold', threshold)",
"def setThreshold(self, threshold): # real signature unknown; restored from __doc__\n pass",
"def setThreshold(self, value):\n return self._set(threshold=value)",
"def setThreshold(self... | [
"0.76420635",
"0.7484654",
"0.7002138",
"0.69110656",
"0.69110656",
"0.69110656",
"0.69110656",
"0.69110656",
"0.6605099",
"0.62813085",
"0.6248368",
"0.6243392",
"0.6088954",
"0.59891135",
"0.59891135",
"0.57627714",
"0.5746402",
"0.5746402",
"0.5746402",
"0.5658464",
"0.565... | 0.7795437 | 0 |
Sets the id of this CreditSupportAnnex. | def id(self, id):
if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetId(self, id):\n self.id = int(id)",
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n self.__id = id",
"def set_id(self, id):\n self.data['id'] = id",
"def id(self, id: int):\n\n self._id = id",
"def id(self, id: int):\n\n self._id = id... | [
"0.7092601",
"0.6946131",
"0.69415164",
"0.6794513",
"0.6719065",
"0.6719065",
"0.6719065",
"0.6719065",
"0.6719065",
"0.6719065",
"0.6719065",
"0.6719065",
"0.6719065",
"0.6719065",
"0.6694277",
"0.6694277",
"0.6694277",
"0.6694277",
"0.6694277",
"0.6660263",
"0.6634346",
... | 0.0 | -1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, CreditSupportAnnex):
return False
return self.to_dict() == other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
if not isinstance(other, CreditSupportAnnex):
return True
return self.to_dict() != other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.84568954",
"0.83923674",
"0.81447554",
"0.81407183",
"0.81326675",
"0.80941343",
"0.8092415",
"0.8092415",
"0.8092415",
"0.8085536",
"0.8085536",
"0.8076502",
"0.8076502",
"0.8066026",
"0.80427635",
"0.80427635",
"0.80427635",
"0.80427635",
"0.80427635",
"0.80427635",
"0.8... | 0.0 | -1 |
Just like Theano function. Take a bunch of tensorflow placeholders and expressions computed based on those placeholders and produces f(inputs) > outputs. Function f takes values to be fed to the input's placeholders and produces the values of the expressions in outputs. Input values can be passed in the same order as i... | def function(inputs, outputs, updates=None, givens=None):
if isinstance(outputs, list):
return _Function(inputs, outputs, updates, givens=givens)
elif isinstance(outputs, (dict, collections.OrderedDict)):
f = _Function(inputs, outputs.values(), updates, givens=givens)
return lambda *args... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tffunc(*argtypes):\n placeholders = list(map(tf.placeholder, argtypes))\n\n def wrap(f):\n out = f(*placeholders)\n\n def wrapper(*args, **kw):\n return out.eval(dict(zip(placeholders, args)), session=kw.get('session'))\n\n return wrapper\n\n return wrap",
"def tffunc... | [
"0.6410329",
"0.637759",
"0.580178",
"0.5791794",
"0.5770872",
"0.5770807",
"0.57650334",
"0.5695057",
"0.5622265",
"0.560454",
"0.5522315",
"0.55193186",
"0.55190384",
"0.5515452",
"0.54765326",
"0.54756653",
"0.5472872",
"0.54653686",
"0.5461366",
"0.54306877",
"0.5427596",... | 0.5249384 | 37 |
Return the tf variable(s) representing the possibly postprocessed value of placeholder(s). | def get(self):
raise NotImplemented() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tf_t_vars(sess):\n return sess.graph.get_collection(\"trainable_variables\")",
"def _tf_placeholders(self):\n tf = self.tf\n d = self.n_nodes\n if self._tf_feed_dict is None:\n with self._tf_graph.as_default():\n L = tf.placeholder(tf.float64, d, name... | [
"0.66177166",
"0.6608421",
"0.6529238",
"0.6410352",
"0.62004066",
"0.61142355",
"0.61015254",
"0.6081202",
"0.6063872",
"0.60620195",
"0.60594153",
"0.6050772",
"0.60495657",
"0.6042938",
"0.6005607",
"0.5982273",
"0.5963916",
"0.5955792",
"0.59483427",
"0.593234",
"0.592738... | 0.0 | -1 |
Creates a placeholder for a batch of tensors of a given shape and dtype | def __init__(self, shape, dtype=tf.float32, name=None):
super().__init__(tf.placeholder(dtype, [None] + list(shape), name=name)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_placeholder(tensor, dtype=None):\r\n if isinstance(tensor, np.ndarray):\r\n if dtype is None:\r\n if tensor.dtype in {np.float32, np.float64, np.float16, np.float}:\r\n placeholder = tf.placeholder(tf.float32, tensor.shape)\r\n elif tensor.dtype in {np.int,... | [
"0.73253214",
"0.70488",
"0.66784686",
"0.6538596",
"0.6528986",
"0.6449464",
"0.6448749",
"0.6326491",
"0.6287082",
"0.6265819",
"0.6117368",
"0.6100018",
"0.6020143",
"0.6012269",
"0.5989508",
"0.59593827",
"0.59574467",
"0.59189063",
"0.59181684",
"0.5910407",
"0.590799",
... | 0.63889307 | 7 |
Test that read_mapping_file can read more than one molecule. | def test_read_mapping_file_multiple(reference_multi):
content, reference = reference_multi
from_names = list(reference.keys())
to_names = []
block_names = []
for k in reference:
to_names.extend(reference[k].keys())
for to in reference[k]:
block_names.extend(reference[k][... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_read_mapping_file(case):\n reference = collections.defaultdict(lambda: collections.defaultdict(dict))\n for from_ff, to_ff in itertools.product(case.from_ff, case.to_ff):\n reference[from_ff][to_ff][case.name] = (\n case.mapping, case.weights, case.extra\n )\n\n ffs = cas... | [
"0.67420113",
"0.6703428",
"0.6658432",
"0.6653267",
"0.6620562",
"0.6576531",
"0.65403",
"0.6393296",
"0.6315044",
"0.6295086",
"0.6235337",
"0.6168162",
"0.61647826",
"0.61638695",
"0.6154931",
"0.6074728",
"0.6069374",
"0.60642123",
"0.605357",
"0.5964693",
"0.59500426",
... | 0.7212817 | 0 |
Retrieves and parses current time stamp from the 'datetime' module. | def get_time():
dt = datetime.datetime.now()
dt_parsed = dt.strftime("%Y-%m-%d %H:%M:%S")
return dt_parsed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def datetime(self):\r\n if 'observation_time_rfc822' in self.data \\\r\n and self.data['observation_time_rfc822']:\r\n tstr = self.data['observation_time_rfc822']\r\n tstr = ' '.join(tstr.split(' ')[:-2])\r\n return datetime.strptime(tstr, '%a, %d %b %Y %H:%M:%S')\... | [
"0.69299984",
"0.6702524",
"0.63582027",
"0.63440084",
"0.63380075",
"0.63115704",
"0.6280957",
"0.6251938",
"0.62222415",
"0.61944693",
"0.61944693",
"0.61590403",
"0.6087337",
"0.60751706",
"0.60636747",
"0.6060406",
"0.6042445",
"0.6027001",
"0.6009286",
"0.59921634",
"0.5... | 0.6883768 | 1 |
The constructor for the SQLAuctionTransformer | def __init__(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwargs):\n \n self.dense = True\n\n # Create table\n super().__init__(*args, **kwargs)",
"def __init__(self, transforms):\n super().__init__(transforms)\n self.S1 = transforms[0]\n self.T1 = transforms[1]\n self.S2 = transforms[2... | [
"0.59803915",
"0.585746",
"0.584389",
"0.5838512",
"0.58377814",
"0.582652",
"0.58096045",
"0.57996446",
"0.5782969",
"0.5706675",
"0.5688038",
"0.5647668",
"0.56334305",
"0.55863696",
"0.55825895",
"0.55825895",
"0.5578682",
"0.5578596",
"0.5575599",
"0.5563545",
"0.5547831"... | 0.0 | -1 |
Function needed for backwards compatibility with the old "col" argument in plt functions. It returns the default color 'C0' if both arguments are None. If 'color' is not None, it always uses that. If 'color' is None and 'col' is an integer, it returns the corresponding 'CN' color. If 'col' is neither None nor integer, ... | def get_color(col, color):
if color is None and col is None:
return 'C0'
if col is None:
return color
if not isinstance(col, int):
raise ValueError("`col` must be an integer. Consider using `color` instead.")
return 'C{}'.format(col) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _color_for_labels(label_color, default_color, seq_index):\n if label_color is None:\n if hasattr(default_color, '__getitem__'):\n c = default_color[seq_index]\n else:\n c = default_color\n else:\n c = label_color\n\n return c or 'black'",
"def getColor(col=... | [
"0.69194543",
"0.65208554",
"0.61030096",
"0.58912325",
"0.5869798",
"0.58372813",
"0.5826115",
"0.58039564",
"0.57599896",
"0.57347935",
"0.5713629",
"0.56824017",
"0.5678672",
"0.5661202",
"0.5658636",
"0.56532097",
"0.5652371",
"0.5651904",
"0.56345254",
"0.5624993",
"0.56... | 0.8174092 | 0 |
p_groups_ids is a list of group ids. | def __call__(self, group_ids, short=False):
self.short = short
self.is_manager = self._is_manager
if not hasattr(group_ids, '__iter__'):
if group_ids.endswith('*'):
# remove ending '*'
group_id = group_ids[:-1]
self._check_auth(group_id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_ids(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:\n return pulumi.get(self, \"group_ids\")",
"def group_ids(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"group_ids\")",
"def groups_ids(self) -> List[int]:\n\n _, groups_ids = Skeleton._group_get_ids(self.grou... | [
"0.7224479",
"0.72083074",
"0.6913109",
"0.6527776",
"0.6415943",
"0.6389505",
"0.6340514",
"0.6331705",
"0.61269575",
"0.6122522",
"0.6122349",
"0.61042315",
"0.6056334",
"0.59949493",
"0.59949493",
"0.5970091",
"0.59480023",
"0.5941458",
"0.59251106",
"0.5907692",
"0.590769... | 0.0 | -1 |
Return group title. If self.short, turn "My config (My suffix)" into "My suffix". | def group_title(self, group):
group_title = group.getProperty('title')
if self.short:
splitted = group_title.split('(')
if len(splitted) > 1:
group_title = group_title.split('(')[-1][:-1]
return html.escape(group_title) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return f\"{self._group.friendly_name} {GROUP_SUFFIX}\"",
"def abbreviate_title(s):\n if u'Group ' in s:\n return s.replace(u'Group ', u'')\n else:\n parts = s.split(None, 1)\n if len(parts) < 2:\n return s\n genus, rest = s.split(None, 1)\n ... | [
"0.6838066",
"0.6740804",
"0.6598238",
"0.6544966",
"0.64837915",
"0.6482191",
"0.6465803",
"0.6433619",
"0.6433619",
"0.6433619",
"0.6433619",
"0.6433619",
"0.6433619",
"0.6433619",
"0.6433619",
"0.63969857",
"0.6358775",
"0.6357756",
"0.6357756",
"0.6346445",
"0.633116",
... | 0.75570285 | 0 |
Indicates if the request context is an administrator. | def is_admin_context(context):
if not context:
warnings.warn(_('Use of empty request context is deprecated'),
DeprecationWarning)
raise Exception('die')
return context.is_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_administrator(self):\n return self.can(Permission.ADMIN)",
"def is_administrator(self):\n return self.can(Permission.ADMIN)",
"def is_admin(self):\n if not self.current_user:\n return False\n else:\n return self.current_user in [\"1\"]",
"def is_admini... | [
"0.8190426",
"0.8190426",
"0.810602",
"0.80679154",
"0.8066203",
"0.8063099",
"0.8020845",
"0.79938287",
"0.7981558",
"0.7949277",
"0.7949277",
"0.79378897",
"0.78060114",
"0.7752501",
"0.77031267",
"0.7689508",
"0.76647407",
"0.7645749",
"0.76286954",
"0.76133853",
"0.761039... | 0.7404763 | 35 |
Indicates if the request context is a normal user. | def is_user_context(context):
if not context:
return False
if context.is_admin:
return False
if not context.user_id or not context.project_id:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_user_context(context):\n if not context or not isinstance(context, RequestContext):\n return False\n if context.is_admin:\n return False\n return True",
"def is_regular_user(user):\n return user.is_authenticated()",
"def _is_user_context(context):\n if not context:\n ... | [
"0.7632277",
"0.74472946",
"0.70615214",
"0.70615214",
"0.68780714",
"0.673595",
"0.6617593",
"0.6616803",
"0.6615392",
"0.6606159",
"0.6588011",
"0.6531366",
"0.64678705",
"0.64584976",
"0.6383593",
"0.6357672",
"0.6351535",
"0.63481635",
"0.63026196",
"0.6299073",
"0.629090... | 0.6977175 | 6 |
Query helper that accounts for context's `read_deleted` field. | def model_query(context, *args, **kwargs):
session = kwargs.get('session') or get_session()
read_deleted = kwargs.get('read_deleted') or context.read_deleted
project_only = kwargs.get('project_only')
query = session.query(*args)
if read_deleted == 'no':
query = query.filter_by(deleted=Fals... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model_query(context, *args, **kwargs):\n session = kwargs.get('session') or context.session\n read_deleted = kwargs.get('read_deleted') or context.read_deleted\n project_only = kwargs.get('project_only')\n\n query = session.query(*args)\n\n if read_deleted == 'no':\n query = query.filter_... | [
"0.66253954",
"0.66253954",
"0.62425643",
"0.6239433",
"0.62286484",
"0.5868385",
"0.576161",
"0.5659449",
"0.5637597",
"0.5584702",
"0.5563001",
"0.55543935",
"0.5476319",
"0.53876364",
"0.5323856",
"0.5303539",
"0.52732766",
"0.5226041",
"0.51618844",
"0.51618844",
"0.51594... | 0.66110253 | 3 |
Returns number of videos of user flagged by other users. | def get_flagged_num(self, username):
done = self.cur.execute("SELECT flags.video_ID FROM videos,flags WHERE videos.video_ID = flags.video_ID AND videos.uploader = \"{}\"".format(username))
return done | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_video_count(self, username):\n done = self.cur.execute(\"SELECT video_ID FROM videos WHERE uploader = \\\"{}\\\"\".format(username))\n return done",
"def get_videos_count(khoros_object, user_settings=None, user_id=None, login=None, email=None):\n user_settings = _process_settings_an... | [
"0.7523925",
"0.6733229",
"0.63746536",
"0.6260079",
"0.6234799",
"0.6202073",
"0.6138974",
"0.60228616",
"0.59842056",
"0.59239006",
"0.58508843",
"0.57385385",
"0.56081533",
"0.5598427",
"0.55598706",
"0.55529207",
"0.5511205",
"0.5501292",
"0.5490401",
"0.5456478",
"0.5449... | 0.7559999 | 0 |
Returns number of flagged videos in the VIDEOS table. | def get_flag_count(self):
done = self.cur.execute("SELECT video_ID FROM flags")
return done | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_video_count(self):\n done = self.cur.execute(\"SELECT video_ID FROM videos\")\n return done",
"def count_videos(self):\n return len(self.videos)",
"def get_flagged_num(self, username):\n done = self.cur.execute(\"SELECT flags.video_ID FROM videos,flags WHERE videos.video_ID ... | [
"0.77415645",
"0.7383914",
"0.7020163",
"0.6678284",
"0.665664",
"0.65775",
"0.6527008",
"0.6088112",
"0.6027986",
"0.5998238",
"0.59302866",
"0.5903157",
"0.5892386",
"0.5889689",
"0.5801771",
"0.57928395",
"0.57669586",
"0.5756323",
"0.57086295",
"0.57069635",
"0.55990773",... | 0.78880155 | 0 |
Name of the metric. | def metric_name(self) -> str:
return pulumi.get(self, "metric_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def metric_name(self) -> str:\n return self._metric_name",
"def metric_name(self) -> str:\n return self._values.get('metric_name')",
"def metric_name(self) -> str:\n return self._values.get('metric_name')",
"def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"m... | [
"0.9080742",
"0.89493376",
"0.89493376",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.8507669",
"0.8280574",
"0.8280574",
"0.8276878",
"0.8003284",
"0.7678508",
"0.7518795",
"0.74013215",
"0.7... | 0.9079402 | 1 |
the id of the action group to use. | def action_group_id(self) -> Optional[str]:
return pulumi.get(self, "action_group_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id(self):\n return self._group",
"def group_id(self):\n return self._id",
"def getId(self):\n return _libsbml.Group_getId(self)",
"def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")",
"def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")"... | [
"0.77482456",
"0.7099057",
"0.70216775",
"0.69734263",
"0.69734263",
"0.6817101",
"0.6817101",
"0.6817101",
"0.6800052",
"0.6768275",
"0.6752699",
"0.6614591",
"0.66105044",
"0.6609539",
"0.66095287",
"0.65748924",
"0.6553389",
"0.6553389",
"0.6553389",
"0.6470345",
"0.644829... | 0.84645164 | 0 |
Name of the metric. | def metric_name(self) -> str:
return pulumi.get(self, "metric_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def metric_name(self) -> str:\n return self._metric_name",
"def metric_name(self) -> str:\n return self._values.get('metric_name')",
"def metric_name(self) -> str:\n return self._values.get('metric_name')",
"def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"m... | [
"0.9080742",
"0.89493376",
"0.89493376",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.85680395",
"0.8507669",
"0.8280574",
"0.8280574",
"0.8276878",
"0.8003284",
"0.7678508",
"0.7518795",
"0.74013215",
"0.7... | 0.9079402 | 2 |
Pass in an index_name to be deleted. Raises an IndexNotFound exception if the index is missing on the node. | def delete_index(index_name):
try:
ES.indices.delete(index=[index_name])
except NotFoundError:
raise IndexNotFound(index_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_index(self, index_name):\n return AlgoliaUtils_request(self.headers, self.write_hosts, \"DELETE\", \"/1/indexes/%s\" % quote(index_name.encode('utf8'), safe=''), self.timeout)",
"def delete_index(client, index_name):\n\n client.conn.indices.delete(index=index_name)",
"def delete_index(inde... | [
"0.8237238",
"0.7881001",
"0.7858925",
"0.7437211",
"0.7330589",
"0.7315321",
"0.7273739",
"0.71558714",
"0.6878204",
"0.678057",
"0.6732007",
"0.6623749",
"0.65878093",
"0.641981",
"0.6412163",
"0.63936096",
"0.63936096",
"0.63688356",
"0.6324927",
"0.63195837",
"0.62910414"... | 0.7987658 | 1 |
Get a document based on the instance. Raises a DocumentNotFound exception if the document is not found on the index. | def get_document(obj):
try:
return ES.get(
index=obj.get_index_name(), doc_type=obj.get_document_type(), id=obj.pk)
except NotFoundError:
raise DocumentNotFound(obj.get_index_name(), obj.pk) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_document(self, url: str) -> Optional[Document]:\n return self._index.get(url, None)",
"def get_document(self, *args, **kwargs):\n return self._documents_manager.get_document(*args, **kwargs)",
"def fetch_search_document(self, index):\n assert self.pk, \"Object must have a primary k... | [
"0.7509461",
"0.7387173",
"0.73165256",
"0.7186353",
"0.7047284",
"0.691709",
"0.67920256",
"0.6776412",
"0.6762755",
"0.6755989",
"0.6754873",
"0.6712459",
"0.6660555",
"0.6659591",
"0.6637856",
"0.6628112",
"0.6611464",
"0.66052437",
"0.6423677",
"0.6407396",
"0.63751054",
... | 0.8279071 | 0 |
Return a reference string for given model. | def ref(self, model):
return model.region.id # FIXME: generalize this! | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def obj_ref(self) -> str:\n return str(self._data[\"objRef\"])",
"def ref(self) -> str:\n return self._ref",
"def getModelRef(self):\n return _libsbml.ExternalModelDefinition_getModelRef(self)",
"def __str__(self):\n ref = self.instance\n if self.mode is not None:\n ... | [
"0.6766413",
"0.67457587",
"0.6455393",
"0.6415791",
"0.64044046",
"0.6363621",
"0.62940174",
"0.62505424",
"0.62472844",
"0.62371844",
"0.6234672",
"0.6234672",
"0.6191923",
"0.6141854",
"0.60936224",
"0.60454404",
"0.603411",
"0.60233545",
"0.60217756",
"0.6019766",
"0.6009... | 0.6636116 | 2 |
Initialize all models with statistics about cases. It can either receive an explicit data frame with cases/deaths statistics, a callable object that receives a model and return the desired cases. If none of these are passed, it assumes that the cases should be initialized from the region. | def init_cases(self: T, data=None, regions=None, raises=True, **kwargs) -> T:
kwargs["regions"] = {} if regions is None else regions
kwargs.setdefault("real", True)
for i, report in enumerate(self._reports):
print(i, report.model.region.id, report.model.region.name)
call... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_case_metrics(self) -> None:\n for case in self.cases:\n graph_distance, time_distance = extract_case_distances(self.process_model_graph, case)\n case.graph_distance = graph_distance\n case.time_distance = time_distance",
"def setUp(self):\n self.df_ca... | [
"0.6291318",
"0.5654613",
"0.54874974",
"0.54647356",
"0.5348363",
"0.5319384",
"0.52680993",
"0.5202522",
"0.5159842",
"0.5042738",
"0.5006515",
"0.49600613",
"0.49330205",
"0.4911519",
"0.48664477",
"0.4865999",
"0.4861922",
"0.48572075",
"0.4801666",
"0.4765036",
"0.474230... | 0.6120037 | 1 |
Return a random alphanumeric string of length `len`. | def random_replicate_name(len=12):
out = random.choices('abcdefghijklmnopqrtuvwxyzABCDEFGHIJKLMNOPQRTUVWXYZ0123456789', k=len)
return ''.join(out) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_random_str(len):\n return base64.urlsafe_b64encode(os.urandom(len))[0:len]",
"def randstr(len, reallyrandom = False):\r\n alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789'\r\n if reallyrandom:\r\n alphabet += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&\\()*+,-./:;<=>?@[\\\\]^_{|}~'\r\n return ''.... | [
"0.84404224",
"0.825311",
"0.82476723",
"0.82387525",
"0.8201293",
"0.81813246",
"0.81375945",
"0.8123472",
"0.8117676",
"0.81167454",
"0.8103791",
"0.81003875",
"0.8097498",
"0.809244",
"0.80803674",
"0.80751",
"0.8047784",
"0.8044852",
"0.80323535",
"0.8029928",
"0.80237716... | 0.75853336 | 52 |
Generate a proof of work for the open transfers, the hash of the previous block and a random number (which is guessed until it fits). | def proof_of_work(self):
last_block = self.__chain[-1]
last_hash = hash_block(last_block)
proof = 0
# Try different PoW numbers and return the first valid one
while not Verification.valid_proof(self.__open_transfers, last_hash, proof):
proof += 1
print(proof)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def proof_of_work(self):\n last_block = self.__chain[-1]\n last_hash = hash_block(last_block)\n proof = 0\n # Try different PoW numbers and return the first valid one\n while not Verification.valid_proof(self.__open_transactions, self.__open_chipsactions, self.__open_messsactions... | [
"0.6767066",
"0.66403455",
"0.65471375",
"0.64007163",
"0.6309153",
"0.63058364",
"0.62753505",
"0.6238329",
"0.62287176",
"0.587455",
"0.58743477",
"0.58078885",
"0.5754991",
"0.57458746",
"0.5647915",
"0.55475503",
"0.55412304",
"0.5443019",
"0.5433007",
"0.54295146",
"0.54... | 0.7421745 | 0 |
Returns the last value of the current blockchain. | def get_last_blockchain_value(self):
if len(self.__chain) < 1:
return None
return self.__chain[-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_last_blockchain_value():\n return blockchain[-1]",
"def last_value():\n return blockchain[-1]",
"def get_last_blockchainvalue(self):\n if len(self.__chain) < 1:\n return None\n return self.__chain[-1]",
"def get_last_blockchain_value():\n if len(blockchai... | [
"0.9384537",
"0.9371666",
"0.9112668",
"0.900784",
"0.90039366",
"0.8981546",
"0.81733084",
"0.8165117",
"0.80747896",
"0.77709347",
"0.77572453",
"0.7621556",
"0.75637656",
"0.75488514",
"0.75137657",
"0.7454129",
"0.74147844",
"0.74071825",
"0.73919386",
"0.73919386",
"0.73... | 0.91088104 | 7 |
Return a list of all connected peer nodes. | def get_peer_nodes(self):
return list(self.__peer_nodes) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_list_all(self):\n return self.client.call('GET', self.name + 'peer-list/all')",
"def peer_list_reachable(self):\n return self.client.call('GET', self.name + 'peer-list/reachable')",
"def list_nodes(self):\n return self.ironic_client.node.list()",
"def get_all_nodes(self):\n ... | [
"0.7392017",
"0.7002911",
"0.69784385",
"0.69227666",
"0.6882579",
"0.6802107",
"0.6790903",
"0.67703485",
"0.6725873",
"0.6651802",
"0.66069186",
"0.6584915",
"0.6584334",
"0.6553957",
"0.6539939",
"0.6539486",
"0.6532221",
"0.65297973",
"0.6525269",
"0.6498614",
"0.6494739"... | 0.849466 | 1 |
Returns the len of the dataset assuming that the dataset is valid... | def length(self):
return len(self.x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Length(data):\n return len(data)",
"def __len__(self):\n\t\treturn min(len(self.dataset), self.opt.max_dataset_size)",
"def __len__(self):\n return len(self.dataset)",
"def __len__(self) -> int:\n if self.data is None:\n return 0\n return len(self.data)",
"def get_val... | [
"0.7966735",
"0.7843512",
"0.78123033",
"0.77448803",
"0.7721914",
"0.7712948",
"0.77092266",
"0.7692448",
"0.7646822",
"0.7646822",
"0.7646822",
"0.75965583",
"0.75965583",
"0.7563075",
"0.7561794",
"0.7524094",
"0.7513503",
"0.75113547",
"0.7505635",
"0.74987423",
"0.748818... | 0.0 | -1 |
Return environment variables starting with prefix | def env_vars(prefix):
return {k: v for k, v in os.environ.items() if k.startswith(prefix)} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _preload_existing_vars(prefix: str) -> Store:\n if not prefix:\n # If prefix is empty just return all the env variables.\n return environ\n\n prefixed = {}\n\n # Prefix is not empty, do the search and replacement:\n for env_name, env_value in environ.items():\n if not env_name.... | [
"0.72910964",
"0.67468673",
"0.6712868",
"0.65505886",
"0.6517432",
"0.63044226",
"0.6295789",
"0.62780964",
"0.6245079",
"0.62119097",
"0.62084186",
"0.6165885",
"0.6108197",
"0.6107439",
"0.60423785",
"0.60150474",
"0.5988261",
"0.59737426",
"0.59527063",
"0.5928965",
"0.59... | 0.8657359 | 0 |
Get an object from cache, return `None` if not found. | def cache_get(item: str) -> object:
item = str(item)
cache = cache_find(item)
# cache_find() will return none if the cache does not exist
# the returned location is guaranteed to exist, so no point checking again.
if cache is not None:
try:
cached = pickle.load(open(cache, "rb"))
except EOFError as ex:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, key):\n if key:\n return self.cache_data.get(key)\n else:\n return None",
"def cache_get(self, key: str) -> Optional[bytes]:\n if self.cache is not None:\n return self.cache.get(key)\n return None",
"def get(self, key):\n if key ... | [
"0.7674477",
"0.76137364",
"0.75440174",
"0.75440174",
"0.75393486",
"0.7432243",
"0.73063606",
"0.72476906",
"0.72312814",
"0.72097397",
"0.7185365",
"0.71732783",
"0.71528417",
"0.713144",
"0.7064178",
"0.70147896",
"0.6986404",
"0.697731",
"0.69466746",
"0.6875618",
"0.687... | 0.82087857 | 0 |
Get the value of the bracket_as_entity option. | def bracket_as_entity(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _entity_as_text(self):\n return str(self.value)",
"def tag_value(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"tag_value\")",
"def value_expression(self) -> Optional[str]:\n return pulumi.get(self, \"value_expression\")",
"def value_expression(self) -> str:\n ... | [
"0.5723108",
"0.546387",
"0.5426668",
"0.5333664",
"0.53097063",
"0.5231422",
"0.52310586",
"0.52190936",
"0.52190936",
"0.52109015",
"0.52036643",
"0.52036643",
"0.51383114",
"0.51383114",
"0.51383114",
"0.51383114",
"0.51383114",
"0.51383114",
"0.51383114",
"0.51383114",
"0... | 0.6956395 | 0 |
Get the value of the en_quote_as_entity option. | def en_quote_as_entity(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _entity_as_text(self):\n return str(self.value)",
"def zh_quote_as_entity(self):\n pass",
"def get_quotes(self):\n # However ignore the 'true' autodetection setting.\n jscs_quotes = self.jscs_options.get('validateQuoteMarks')\n if isinstance(jscs_quotes, dict):\n ... | [
"0.675374",
"0.64509875",
"0.57066256",
"0.56627864",
"0.5602044",
"0.55100125",
"0.53501636",
"0.53001523",
"0.53001523",
"0.52353424",
"0.5217777",
"0.520476",
"0.5186793",
"0.51678133",
"0.51678133",
"0.51678133",
"0.51433784",
"0.51433784",
"0.5109276",
"0.50877744",
"0.5... | 0.7657667 | 0 |
Get the value of the use_en option. | def use_en(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_locale():\n setting = Setting.query.filter(Setting.name == 'default_language').first()\n\n if setting is not None:\n return setting.value\n\n # Return default language when none found\n return 'en'",
"def get_language(self):\n return self.lang",
"def get_lang(self):\n r... | [
"0.6574013",
"0.6493536",
"0.6492421",
"0.64415383",
"0.64187646",
"0.6410013",
"0.63214946",
"0.6320696",
"0.62423205",
"0.62373483",
"0.61986905",
"0.6169279",
"0.6161956",
"0.6158396",
"0.61440474",
"0.61357933",
"0.61304784",
"0.61289316",
"0.6108886",
"0.6078264",
"0.605... | 0.7486109 | 0 |
Get the value of the zh_quote_as_entity option. | def zh_quote_as_entity(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def en_quote_as_entity(self):\n pass",
"def quote_id(self) -> Optional[str]:\n return pulumi.get(self, \"quote_id\")",
"def _entity_as_text(self):\n return str(self.value)",
"def include_quote(self) -> Optional[bool]:\n return pulumi.get(self, \"include_quote\")",
"def get_quote... | [
"0.6517354",
"0.5597231",
"0.5549282",
"0.5526326",
"0.5342145",
"0.52442676",
"0.5122187",
"0.48057586",
"0.47615916",
"0.47427595",
"0.47066078",
"0.46741903",
"0.4667675",
"0.46673623",
"0.4613167",
"0.4613167",
"0.4602033",
"0.45982847",
"0.45765555",
"0.45765555",
"0.456... | 0.7811794 | 0 |
Checks that the default parameters of an ExtrudeCircleShape are correct. | def test_default_parameters(self):
assert self.test_shape.rotation_angle == 360
assert self.test_shape.extrude_both | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_default_parameters(self):\n\n assert self.test_shape.center_coordinate == (0.0, 0.0, 0.0)",
"def test_default_parameters(self):\n\n # assert self.test_shape.rotation_angle == 360\n assert self.test_shape.start_angle == 0",
"def test_default_parameters(self):\n\n assert self... | [
"0.7234929",
"0.6976932",
"0.6569412",
"0.6049638",
"0.5911374",
"0.58454925",
"0.55786914",
"0.55746585",
"0.55698836",
"0.55458",
"0.5545174",
"0.54440904",
"0.54202956",
"0.5415855",
"0.5415855",
"0.541363",
"0.5402548",
"0.5379901",
"0.5365727",
"0.53643066",
"0.53586715"... | 0.7183801 | 1 |
Gets the disposition of this PopSettings. The action that will be executed on a message after it has been fetched via POP. | def disposition(self):
return self._disposition | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disposition(self, disposition):\n allowed_values = [\"archive\", \"dispositionUnspecified\", \"leaveInInbox\", \"markRead\", \"trash\"]\n if disposition not in allowed_values:\n raise ValueError(\n \"Invalid value for `disposition` ({0}), must be one of {1}\"\n ... | [
"0.58163434",
"0.558854",
"0.51367563",
"0.49677005",
"0.4939197",
"0.4939197",
"0.4939197",
"0.4939197",
"0.4939197",
"0.4939197",
"0.49037772",
"0.4865473",
"0.48381123",
"0.47464013",
"0.47021428",
"0.46780324",
"0.46780324",
"0.46662363",
"0.46597967",
"0.46557334",
"0.46... | 0.7230888 | 0 |
Sets the disposition of this PopSettings. The action that will be executed on a message after it has been fetched via POP. | def disposition(self, disposition):
allowed_values = ["archive", "dispositionUnspecified", "leaveInInbox", "markRead", "trash"]
if disposition not in allowed_values:
raise ValueError(
"Invalid value for `disposition` ({0}), must be one of {1}"
.format(disposit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disposition(self):\n return self._disposition",
"def set_popup_mode(self, mode: str):\n if mode not in POPUP_MODES:\n raise ValueError(\"Invalid mode.\")\n self.setPopupMode(POPUP_MODES[mode])",
"def delivery_mode(self, delivery_mode):\n\n self._delivery_mode = delive... | [
"0.62285453",
"0.50006455",
"0.4993129",
"0.4591924",
"0.4530001",
"0.45073426",
"0.4486179",
"0.44548517",
"0.4436408",
"0.43279582",
"0.4305703",
"0.42922822",
"0.42594072",
"0.42561954",
"0.41788253",
"0.4150163",
"0.41420588",
"0.41411808",
"0.40983132",
"0.40756333",
"0.... | 0.7115136 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, PopSettings):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.84568954",
"0.83923674",
"0.81447554",
"0.81407183",
"0.81326675",
"0.80941343",
"0.8092415",
"0.8092415",
"0.8092415",
"0.8085536",
"0.8085536",
"0.8076502",
"0.8076502",
"0.8066026"
] | 0.0 | -1 |
Loads a yaml file | def load_yaml(config):
try:
return yaml.safe_load(config)
except yaml.YAMLError as e:
raise Exception('Error occurred while parsing YAML: {}'.format(e)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_yaml(filepath):\n with open(filepath, 'r') as stream:\n try:\n return yaml.safe_load(stream)\n except yaml.YAMLError as exc:\n print(exc)",
"def load_yaml(file_path):\n with open(file_path) as fin:\n content = yaml.load(fin, Loader=yaml.FullLoader)\n r... | [
"0.8051507",
"0.80284184",
"0.80253714",
"0.8021605",
"0.8000676",
"0.79140764",
"0.7896104",
"0.7886762",
"0.7830894",
"0.78148323",
"0.77994424",
"0.77892375",
"0.7783224",
"0.7753111",
"0.7752777",
"0.77158296",
"0.7671371",
"0.7655973",
"0.76393014",
"0.7619388",
"0.75982... | 0.6743955 | 96 |
Gets the next item from this iterable. | async def next(self, default=NO_ITEM) -> typing.Any:
try:
return await self.__anext__()
except StopAsyncIteration:
if default == NO_ITEM:
raise
return default | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next(self):\n nxt = self.readentry()\n if nxt is None:\n raise StopIteration\n return nxt",
"def __next__(self):\n \n if self.i == len(self.data):\n raise StopIteration\n item = self.data[self.i]\n self.i += 1\n return item",
"de... | [
"0.833185",
"0.81417316",
"0.81041825",
"0.790635",
"0.78904575",
"0.7844525",
"0.7797303",
"0.77856565",
"0.7778144",
"0.77691394",
"0.7766307",
"0.77651185",
"0.7763921",
"0.77617896",
"0.77617896",
"0.77479225",
"0.77414984",
"0.77414984",
"0.77414984",
"0.77414984",
"0.77... | 0.0 | -1 |
Converts a Discordformatted timestamp to a datetime object. | def to_datetime(timestamp: str) -> datetime.datetime:
if timestamp is None:
return
if timestamp.endswith("+00:00"):
timestamp = timestamp[:-6]
try:
return datetime.datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S.%f")
except ValueError:
# wonky datetimes
return d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_timestamp(ts):\n format = '%Y-%m-%d %H:%M:%S'\n return datetime.strptime(ts, format)",
"def _timestamp_to_datetime(timestamp):\n return datetime.fromtimestamp(timestamp * 0.001, tz=timezone.utc)",
"def get_datetime_from_timestamp(timestamp: str) -> datetime.datetime:\n return dateti... | [
"0.745324",
"0.73894274",
"0.7363517",
"0.7086619",
"0.70164067",
"0.6976756",
"0.6949481",
"0.6927075",
"0.69260484",
"0.66861904",
"0.6679699",
"0.66663504",
"0.66598463",
"0.664685",
"0.6620737",
"0.65995663",
"0.6588165",
"0.65610904",
"0.6533557",
"0.6528402",
"0.6528402... | 0.7474306 | 0 |
Insert the node n beginning at index position pos. | def insert(self, n, pos):
if pos == 0:
self.cons(n)
else:
prev = self.index(pos-1)
next = prev.next
prev.next = n
n.next = next
self.len += 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert(self, value, pos):\r\n\r\n if self.head is None:\r\n self.head = Node(value)\r\n return\r\n\r\n if pos == 0:\r\n self.prepend(value)\r\n return\r\n\r\n index = 0\r\n node = self.head\r\n while node.next and index <= pos:\r\n ... | [
"0.72740185",
"0.7103719",
"0.69398314",
"0.6928973",
"0.6863136",
"0.68557435",
"0.6832058",
"0.6755653",
"0.67459166",
"0.667409",
"0.666163",
"0.6628564",
"0.6612427",
"0.65446794",
"0.6527768",
"0.65218896",
"0.6517661",
"0.65158284",
"0.6425271",
"0.64027345",
"0.6361295... | 0.82437086 | 0 |
Append the node n to the end of the list. | def append(self, n):
last = self.last()
if last:
last.next = n
self.len += 1
else:
self.cons(n) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert(self, n, new_node):\n curr_node = self.head\n \n i = 0\n while i < n:\n if curr_node.next is None:\n raise IndexError(\"list is shorter than n\")\n curr_node = curr_node.next\n i += 1\n \n new_node.next = curr_node... | [
"0.69705254",
"0.687432",
"0.6709675",
"0.6645751",
"0.6608237",
"0.6569515",
"0.64727336",
"0.64642847",
"0.64602023",
"0.6447882",
"0.64307994",
"0.6425153",
"0.637969",
"0.6370489",
"0.6370111",
"0.6368923",
"0.63669413",
"0.6334651",
"0.63345844",
"0.63304853",
"0.6326456... | 0.8417494 | 0 |
Validate inputs for functions whose first argument is a numpy.ndarray with shape (n,1). | def check_inputs(function):
def decorated(self, data, *args, **kwargs):
if not (isinstance(data, np.ndarray) and len(data.shape) == 2 and data.shape[1] == 1):
raise ValueError('The argument `data` must be a numpy.ndarray with shape (n, 1).')
return function(self, data, *args, **kwargs)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_input_shapes(*args):\n\n # Collect the shapes of the inputs\n shapes = set()\n\n # DESIGN NOTES - currently allow:\n # - scalars,\n # - 0 dim ndarrays (also scalars but packaged differently)\n # - 1 dim ndarrays with only a single value\n\n for val in args:\n if isinstan... | [
"0.696551",
"0.68897444",
"0.68860936",
"0.6620291",
"0.6588289",
"0.6457762",
"0.64314246",
"0.6405052",
"0.64038384",
"0.6370529",
"0.6309466",
"0.6070468",
"0.6018504",
"0.5987222",
"0.5961908",
"0.5931549",
"0.59065855",
"0.5864621",
"0.5858168",
"0.5847836",
"0.5837565",... | 0.7947115 | 0 |
Return the number of rows in data. | def size(self):
return len(self.data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def row_count(data):\n return int(arcpy.GetCount_management(data).getOutput(0))",
"def getNumRows(self) -> int:\n ...",
"def num_rows(self):\n return (len(self.rows))",
"def num_rows(self):\n return len(self.rows)",
"def row_count(self) -> int:\n return len(self.rows)",
"de... | [
"0.87038606",
"0.8370315",
"0.8278677",
"0.82671",
"0.81809723",
"0.81809723",
"0.817036",
"0.81504387",
"0.81399345",
"0.8134726",
"0.8130088",
"0.80825657",
"0.80764",
"0.8030102",
"0.7994918",
"0.7987368",
"0.78814274",
"0.78239876",
"0.78143436",
"0.778162",
"0.7770112",
... | 0.68308854 | 76 |
abstract=True isn't propagated to child classes. | def test_abstract_factory_not_inherited(self):
class TestObjectFactory(base.Factory):
class Meta:
abstract = True
model = TestObject
class TestObjectChildFactory(TestObjectFactory):
pass
self.assertFalse(TestObjectChildFactory._meta.abst... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def abstract(self):\n\n return self._abstract",
"def is_abstract(cls):\n return cls.__dict__.get('abstract', False)",
"def isabstract(object):\r\n return bool(isinstance(object, type) and object.__flags__ & TPFLAGS_IS_ABSTRACT)",
"def is_abstract(cls) -> bool:\n return cls is InternalObje... | [
"0.73352385",
"0.7040913",
"0.6886036",
"0.67673635",
"0.67400116",
"0.66487026",
"0.65660566",
"0.65146875",
"0.64843595",
"0.64830184",
"0.6474032",
"0.63834685",
"0.63367504",
"0.6273709",
"0.62730175",
"0.6249499",
"0.6243722",
"0.6177498",
"0.6167067",
"0.61284333",
"0.6... | 0.68621737 | 3 |
Returns the filtered queryset based on the value provided in the query string and retrievable via `self.value()`. | def queryset(self, request, queryset):
# Compare the requested value (either '80s' or 'other')
# to decide how to filter the queryset.
if self.value() is None:
return queryset.all()
return queryset.filter(firm__pk=self.value()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queryset(self, request, queryset):\n # Compare the requested value (either '80s' or '90s')\n # to decide how to filter the queryset.\n if self.value():\n return queryset.filter(state_pol=self.value())",
"def queryset(self, request, queryset):\n if self.value() is None:\... | [
"0.7419924",
"0.7245252",
"0.72038484",
"0.70902455",
"0.70488775",
"0.6975942",
"0.67827517",
"0.6762181",
"0.67344034",
"0.6681628",
"0.66560334",
"0.6588891",
"0.6470637",
"0.64161074",
"0.64019424",
"0.6383527",
"0.6369606",
"0.63506347",
"0.63492984",
"0.62763286",
"0.62... | 0.7539923 | 0 |
Hide the markers in the current model. | def hideModelMarkers(self):
# Handle to current model
cmcModel = getCurrentModel()
# Hide markers
markerSet = cmcModel.getMarkerSet()
for i in range(cmcModel.getNumMarkers()):
marker = markerSet.get(i)
toggleObjectDisplay(marker,False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide(self):\n self.set_visible(False)",
"def hide(self):\n self.visible = False",
"def hidePlot(self, index):\n self.pathItem_list[index].hide()",
"def hideAnnotations(self):\r\n widget = slicer.modules.NeedleFinderWidget\r\n nodes = slicer.mrmlScene.GetNodesByClass('vtkMRMLAnn... | [
"0.6804635",
"0.66961974",
"0.6605869",
"0.65740716",
"0.65275544",
"0.63676405",
"0.6291115",
"0.6265939",
"0.6202667",
"0.6144658",
"0.61384076",
"0.6124352",
"0.60892564",
"0.6060456",
"0.6000356",
"0.59868026",
"0.59822285",
"0.5929362",
"0.5924352",
"0.5917634",
"0.59023... | 0.88948095 | 0 |
Checks if a repo contains a given file without downloading it. Works for remote repos and local folders. This function will raise an error if the repository `path_or_repo` is not valid or if `revision` does not exist for this repo, but will return False for regular connection errors. | def has_file(
path_or_repo: Union[str, os.PathLike],
filename: str,
revision: Optional[str] = None,
proxies: Optional[Dict[str, str]] = None,
token: Optional[Union[bool, str]] = None,
**deprecated_kwargs,
):
use_auth_token = deprecated_kwargs.pop("use_auth_token", None)
if use_auth_token... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _git_exists_in_revision(path: Path, rev2: str) -> bool:\n # Surprise: On Windows, `git cat-file` doesn't work with backslash directory\n # separators in paths. We need to use Posix paths and forward slashes instead.\n cmd = [\"git\", \"cat-file\", \"-e\", f\"{rev2}:{path.as_posix()}\"]\n result = r... | [
"0.6596947",
"0.6389621",
"0.6368034",
"0.63567364",
"0.6278122",
"0.6180356",
"0.6152615",
"0.6005258",
"0.5924015",
"0.58965087",
"0.5867283",
"0.58649385",
"0.58643174",
"0.586419",
"0.5849708",
"0.5784172",
"0.57095075",
"0.56832314",
"0.56828415",
"0.563263",
"0.5627547"... | 0.6584571 | 1 |
Create a new minesweeper game | def __init__(self, size):
self.array = [[Square() for x in xrange(size)] for x in xrange(size)]
self.init_game() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, density=0.25, width=10, height=10, side= 20, autoreveal=False):\n\t\ttkinter.Frame.__init__(self, None)\n\t\tself.master.title(\"Minesweeper\")\n\t\tself.grid()\n\t\tself.width, self.height, self.side = width, height, side\n\t\tself.density = density\n\t\tself.auto = autoreveal\n\t\tself.game = ... | [
"0.7326178",
"0.7256178",
"0.7131283",
"0.7099191",
"0.7095152",
"0.6873174",
"0.6792351",
"0.6732125",
"0.6716628",
"0.6701845",
"0.66423863",
"0.6459926",
"0.6427663",
"0.6416395",
"0.6376534",
"0.6375768",
"0.63624305",
"0.6355781",
"0.63329905",
"0.63195556",
"0.6317903",... | 0.0 | -1 |
The associated document for the row. This is only present when the view was accessed with ``include_docs=True`` as a query parameter, otherwise this property will be `None`. | def doc(self):
doc = self.get('doc')
if doc:
from .config import defaults
return defaults.types.doc(doc) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_document(self):\n return self.document",
"def get_doc_id(self):\n return self.__doc_id",
"def db_row(self):\n return self._model_cls.query.get(self._pk)",
"def parent_document(cls):\n return cls.parent_resources()[0]",
"def doc_id(self):\n return self._id",
"def... | [
"0.67477304",
"0.6419086",
"0.6395632",
"0.63479227",
"0.6314023",
"0.6269678",
"0.61776793",
"0.6170131",
"0.6114052",
"0.60822386",
"0.60057837",
"0.5942274",
"0.59032613",
"0.59011275",
"0.58718836",
"0.58703125",
"0.58519983",
"0.58352256",
"0.58352256",
"0.5810771",
"0.5... | 0.51912427 | 83 |
Returns load balancer security group short name. | def get_security_group_short_name(self):
return self.config['security_group'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_target_group_fully_qualified_name(self, short_name):\n return '{}-{}'.format(\n self.get_balancer_name(),\n short_name,\n )",
"def name(self):\n return f\"{self._group.friendly_name} {GROUP_SUFFIX}\"",
"def server_group_name(self) -> str:\n return pulum... | [
"0.73476905",
"0.69869596",
"0.6923902",
"0.6921061",
"0.69105417",
"0.68615884",
"0.68233114",
"0.6768074",
"0.67503476",
"0.67094326",
"0.6699743",
"0.6699743",
"0.6699743",
"0.6699743",
"0.6699743",
"0.6699743",
"0.6699743",
"0.6699743",
"0.6699743",
"0.6699743",
"0.669974... | 0.8458865 | 0 |
Returns the fully qualified name of the target group for the current environment. | def get_target_group_fully_qualified_name(self, short_name):
return '{}-{}'.format(
self.get_balancer_name(),
short_name,
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target_group(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"target_group\")",
"def get_target_group_name(self, short_name):\n app_env = self.get_current_env()\n full_name = self.get_target_group_fully_qualified_name(short_name)\n namespace = self.config['namespace']\n\n ... | [
"0.8062165",
"0.8037268",
"0.78125405",
"0.76617867",
"0.74999666",
"0.74999666",
"0.74999666",
"0.74999666",
"0.74999666",
"0.74999666",
"0.74135804",
"0.73813975",
"0.7170682",
"0.71639377",
"0.7063938",
"0.7012675",
"0.7012675",
"0.6987679",
"0.6899107",
"0.6884742",
"0.68... | 0.7507629 | 4 |
Returns the unique name of the target group for the current environment. The difference between this function and `get_target_group_fully_qualified_name` is that fits the name into 32 characters. | def get_target_group_name(self, short_name):
app_env = self.get_current_env()
full_name = self.get_target_group_fully_qualified_name(short_name)
namespace = self.config['namespace']
if len(full_name) <= 32:
return full_name
elif len(namespace) + 10 <= 32:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target_group_identifier(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"target_group_identifier\")",
"def get_target_group_fully_qualified_name(self, short_name):\n return '{}-{}'.format(\n self.get_balancer_name(),\n short_name,\n )",
"def target_group_i... | [
"0.7647652",
"0.74390054",
"0.7291971",
"0.7287171",
"0.7284457",
"0.70294935",
"0.69971144",
"0.6987528",
"0.693263",
"0.6911461",
"0.68637323",
"0.68637323",
"0.68078226",
"0.6770091",
"0.66889703",
"0.6640256",
"0.66363704",
"0.66363704",
"0.66363704",
"0.66363704",
"0.663... | 0.8356981 | 0 |
Returns target groups configuration. | def get_target_groups_config(self):
return self.config['target_groups'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_target_groups_info(self):\n target_groups_config = self.get_target_groups_config()\n groups_info = {}\n\n for short_name in target_groups_config.keys():\n target_group_name = self.get_target_group_name(short_name)\n data = self.get_target_group_info(short_name)\n ... | [
"0.74112564",
"0.672198",
"0.65918154",
"0.65918154",
"0.65918154",
"0.65918154",
"0.65918154",
"0.65918154",
"0.6472177",
"0.6409221",
"0.6371832",
"0.63339555",
"0.63301975",
"0.6296605",
"0.6258392",
"0.61293525",
"0.60561275",
"0.60237026",
"0.60043335",
"0.6001119",
"0.5... | 0.9180246 | 0 |
Returns load balancer ARN for the current environment. | def get_balancer_arn(self):
return self.get_balancer_info()['LoadBalancerArn'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_balancer_name(self):\n return '{}-{}'.format(\n self.config['namespace'],\n self.get_current_env(),\n )",
"def load_balancer_name(self) -> str:\n return pulumi.get(self, \"load_balancer_name\")",
"def load_balancer_id(self) -> pulumi.Output[str]:\n retu... | [
"0.69737446",
"0.67671096",
"0.63797647",
"0.62352544",
"0.62352544",
"0.62352544",
"0.6182437",
"0.6182437",
"0.61434364",
"0.61434364",
"0.61218286",
"0.61218286",
"0.61218286",
"0.61218286",
"0.61218286",
"0.604468",
"0.60387963",
"0.5940735",
"0.5940735",
"0.5940735",
"0.... | 0.76236105 | 0 |
Returns load balancer DNS name for the current environment. | def get_balancer_dns(self):
return self.get_balancer_info()['DNSName'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_balancer_name(self):\n return '{}-{}'.format(\n self.config['namespace'],\n self.get_current_env(),\n )",
"def load_balancer_name(self) -> str:\n return pulumi.get(self, \"load_balancer_name\")",
"def domain_dns_name(self):\n domain_dn = self.get_defaul... | [
"0.76529366",
"0.75585383",
"0.7015553",
"0.6898756",
"0.6807746",
"0.6806018",
"0.6806018",
"0.67674685",
"0.67267495",
"0.66026753",
"0.6525063",
"0.6525063",
"0.6525063",
"0.650673",
"0.64512",
"0.6416112",
"0.6397409",
"0.63273877",
"0.63170844",
"0.63055694",
"0.6283905"... | 0.75997025 | 1 |
Returns target group ARN for the current environment. | def get_target_group_arn(self, short_name):
target_group_info = self.get_target_group_info(short_name)
return target_group_info['TargetGroupArn'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_group_arn(self) -> str:\n return jsii.get(self, \"logGroupArn\")",
"def log_group_arn(self) -> str:\n return jsii.get(self, \"logGroupArn\")",
"def group_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"group_arn\")",
"def target_group(self) -> pulumi.Output[str]:\n ... | [
"0.7156454",
"0.7156454",
"0.68402165",
"0.6673433",
"0.6616204",
"0.6345443",
"0.61582327",
"0.61299807",
"0.6107626",
"0.61024284",
"0.60479337",
"0.59156257",
"0.59156257",
"0.59156257",
"0.59156257",
"0.59156257",
"0.59156257",
"0.59156257",
"0.59156257",
"0.59156257",
"0... | 0.75529647 | 0 |
Deletes load balancer in the current environment. | def delete_balancer(self):
response = self.client.delete_load_balancer(
LoadBalancerArn=self.get_balancer_arn()
)
assert response['ResponseMetadata']['HTTPStatusCode'] == 200 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(self):\r\n return self.connection.delete_load_balancer(self.name)",
"def delete_loadbalancer(self, context, lb):\n deployment_model = self._get_setting(\n lb.tenant_id, \"lbaas_settings\", \"deployment_model\"\n )\n hostnames = self._get_hostname(lb)\n if ... | [
"0.8278177",
"0.8040908",
"0.79162866",
"0.78241706",
"0.77230436",
"0.75071466",
"0.74508417",
"0.72978145",
"0.66784745",
"0.6670179",
"0.664963",
"0.6360659",
"0.6288071",
"0.6281432",
"0.6272956",
"0.61740905",
"0.61731887",
"0.6141923",
"0.60991526",
"0.6052931",
"0.6027... | 0.8000845 | 2 |
Sets the learning rate to the initial LR decayed by 0.1 every steep step | def adjust_learning_rate(epoch, learn_rate, decay_step, decay_rate, optimizer):
steps = np.sum(epoch > np.asarray(decay_step))
if steps > 0:
new_lr = learn_rate * (decay_rate ** steps)
for param_group in optimizer.param_groups:
param_group['lr'] = new_lr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_learning_rate(self):\n\n if (self.FLAGS.learning_rate_decay is \"exponential\"):\n self.learning_rate = tf.train.exponential_decay(\n self.FLAGS.learning_rate,\n self.global_step,\n self.... | [
"0.79118764",
"0.78800315",
"0.78800315",
"0.7639373",
"0.7610866",
"0.75105745",
"0.74499196",
"0.74453765",
"0.74219716",
"0.7408142",
"0.74022764",
"0.7372194",
"0.73710614",
"0.7369101",
"0.7344164",
"0.7329263",
"0.7306858",
"0.73063797",
"0.7298972",
"0.72753996",
"0.72... | 0.71743083 | 33 |
Generator to produce batches of inputs. | def _decode_batch_input_fn(num_decode_batches, sorted_inputs, vocabulary,
batch_size, max_input_size,
task_id=-1, has_input=True, use_static_shapes=False):
tf.logging.info(" batch %d" % num_decode_batches)
if use_static_shapes:
global_max_length = max([le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_batch_inputs(self, inputs, batch_size=None):\n total_num = inputs.shape[0]\n batch_size = batch_size or self.batch_size\n for i in range(0, total_num, batch_size):\n yield inputs[i:i + batch_size]",
"def batch_iter(input_data,batch_size):\r\n batch_ids,batch_mask,batch_segment,batch_labe... | [
"0.79893434",
"0.76544535",
"0.7513031",
"0.75068486",
"0.7485347",
"0.7377286",
"0.7321902",
"0.7318091",
"0.7280104",
"0.7244809",
"0.7225275",
"0.72116786",
"0.7200391",
"0.7187664",
"0.7182508",
"0.7178894",
"0.7082821",
"0.70549506",
"0.70400363",
"0.7034111",
"0.7032721... | 0.0 | -1 |
Shows an image using matplotlib and saves it. | def show_and_save_image(img, save_path):
try:
import matplotlib.pyplot as plt # pylint: disable=g-import-not-at-top
except ImportError as e:
tf.logging.warning(
"Showing and saving an image requires matplotlib to be "
"installed: %s", e)
raise NotImplementedError("Image display and save... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_image(path):\n img = mpimg.imread(path)\n imgplot = plt.imshow(img)\n plt.show()\n plt.close()",
"def save(image, name):\n from matplotlib import pyplot\n import matplotlib as mpl\n fig = pyplot.figure()\n ax = fig.add_subplot(1,1,1)\n imgplot = ax.imshow(image, cmap=mpl.cm.Gr... | [
"0.7841939",
"0.77371234",
"0.7698087",
"0.7367039",
"0.7197469",
"0.7056606",
"0.70549476",
"0.7029917",
"0.70056736",
"0.69819826",
"0.6958245",
"0.6957882",
"0.69477004",
"0.69260085",
"0.6901715",
"0.68855405",
"0.6878939",
"0.6877376",
"0.6875134",
"0.68697375",
"0.68548... | 0.7918635 | 0 |
Yield successive nsized chunks from lst. | def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]",
"def chunks(lst: list, n: int):\n for i in range(0, len(lst), n):\n yield lst[i : i + n]",
"def chunks(lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]",
"de... | [
"0.83071756",
"0.81939614",
"0.81910837",
"0.81910837",
"0.8190213",
"0.81267184",
"0.81218547",
"0.81218547",
"0.80773693",
"0.80526286",
"0.80526286",
"0.80526286",
"0.80526286",
"0.80526286",
"0.80042696",
"0.7871678",
"0.7845623",
"0.7828392",
"0.7827006",
"0.78138447",
"... | 0.80533457 | 30 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.