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 |
|---|---|---|---|---|---|---|
r"""Preprocess `wiki..tokens` and convert into `lmp.dataset.LanguageModelDataset`. | def _preprocess_wiki_tokens(split: str) -> lmp.dataset.LanguageModelDataset:
if not isinstance(split, str):
raise TypeError('`split` must be an instance of `str`.')
file_path = os.path.join(f'{lmp.path.DATA_PATH}', f'wiki.{split}.tokens')
if not os.path.exists(file_path):
raise FileNotFoun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_wiki_tokenized() -> pd.DataFrame:\n text_ids = []\n text_string = []\n articles = []\n text_ids_intro = []\n\n with open(WIKI_ARTICLES_TOKENIZED_PATH, \"r\") as json_file:\n json_list = list(json_file)\n\n for json_str in tqdm(json_list):\n result = json.loads(json_str)\... | [
"0.66479766",
"0.6226101",
"0.61701614",
"0.6134741",
"0.60984904",
"0.6041527",
"0.6009486",
"0.59737575",
"0.59614587",
"0.5945968",
"0.591458",
"0.5903691",
"0.59022385",
"0.58789974",
"0.58743083",
"0.5867766",
"0.585464",
"0.58138835",
"0.58111805",
"0.5810568",
"0.58034... | 0.8668603 | 0 |
Register a customized GNN pooling layer (for graph classification). After registeration, the module can be directly called by GraphGym. | def register_pooling(key, module):
register(key, module, pooling_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, nfeat, nhid, nclass, dropout, alpha):\n super(GCN, self).__init__()\n self.dropout = dropout\n\n self.conv1 = GraphConvolutionLayer(nfeat, nhid, dropout=dropout, alpha=alpha, not_final=True)\n \n self.add_module('conv1', self.conv1)\n\n self.conv2 = Grap... | [
"0.6119383",
"0.6070854",
"0.601929",
"0.5838702",
"0.58358914",
"0.58042276",
"0.5761903",
"0.5744535",
"0.56902486",
"0.56672794",
"0.56427836",
"0.5619802",
"0.5572468",
"0.5533812",
"0.5528844",
"0.54969275",
"0.54743403",
"0.54496455",
"0.5427712",
"0.5399917",
"0.539466... | 0.67710155 | 0 |
Register a customized learning rate scheduler. After registeration, the module can be directly called by GraphGym. | def register_scheduler(key, module):
register(key, module, scheduler_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scheduler_creator(optimizer, config):\n return torch.optim.lr_scheduler.StepLR(optimizer, step_size=5, gamma=0.9)",
"def lr_scheduler(self, lr_init, global_step):\n pass",
"def _create_learning_rate_scheduler(learning_rate_config, optimizer, last_step=-1):\n lr_scheduler = None\n learning_r... | [
"0.67662835",
"0.6746144",
"0.6729955",
"0.6703826",
"0.666188",
"0.6598473",
"0.6553854",
"0.64931625",
"0.6486319",
"0.64218897",
"0.6408378",
"0.63567275",
"0.6290918",
"0.6283077",
"0.6279324",
"0.62665695",
"0.6262147",
"0.6225136",
"0.6205504",
"0.6198537",
"0.6194469",... | 0.60830265 | 30 |
Draw a circle, normal or flattened. Either specified with xy and flatratio, or with a bbox. | def draw_circle(self, xy=None, bbox=None, flatratio=1, **options):
#TEMPORARY DISABLING TRANSFORM TO AVOID DEFORMED CIRCLE
options = self._check_options(options)
args = []
if options["outlinecolor"]:
pen = aggdraw.Pen(options["outlinecolor"], options["outlinewidth"])... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def circle(draw, bbox, thickness=4, loops=2, fill=(255,0,0)):\n offset = 0\n x1, y1, x2, y2 = bbox\n w, h = x2 - x1, y2 - y1\n x_c, y_c = x1 + w/2, y1 + h/2\n rot = noise(0.6)\n a, b = w, h\n for loop in range(loops):\n for r in np.arange(0, 2*pi + random.random(), 1/(max(w, h))):\n ... | [
"0.69435924",
"0.67922854",
"0.6776331",
"0.66895694",
"0.6574525",
"0.6568594",
"0.6566598",
"0.6547096",
"0.6506512",
"0.64771223",
"0.64714444",
"0.64467096",
"0.64336234",
"0.64313453",
"0.6424838",
"0.6424838",
"0.6404882",
"0.6385082",
"0.6381709",
"0.637997",
"0.635737... | 0.8530085 | 0 |
Connect a series of coordinate points with one or more lines. Outline does not work with this method. | def draw_line(self, coords, smooth=False, **options):
# NOTE: Outline does not work because uses paths instead of normal line method.
# TODO: Add volume param, containing a list of linewidths same length as line
# or as a function that calculates the width at each node
# Result is a flow... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plt_connecting_lines():\n\n for i in range(0, Molecule.connection_count):\n tmp1 = Molecule.right_endpt[Molecule.left_connection[i] - 1]\n tmp2 = Molecule.left_endpt[Molecule.right_connection[i] - 1]\n tmp3 = Molecule.energy[Molecule.left_connection[i] - 1]\n tmp4 = Molecule.ener... | [
"0.70532775",
"0.6807385",
"0.6746432",
"0.6719691",
"0.6694514",
"0.6603705",
"0.6389794",
"0.6385055",
"0.6372656",
"0.6372409",
"0.62994283",
"0.6295221",
"0.6283354",
"0.6259894",
"0.62548393",
"0.620464",
"0.6190338",
"0.6156337",
"0.6150167",
"0.6139709",
"0.61199427",
... | 0.63451064 | 10 |
Clears any drawing done on the canvas, and resets it to its original mode, size, and background. | def clear(self):
self.img = PIL.Image.new(self.img.mode, self.img.size, self.background)
self.drawer = aggdraw.Draw(self.img) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_canvas(self):\n self.canvas.fill(self.colorPalette.black)\n self.background.to_canvas(canvas=self.canvas)",
"def clear_canvas():\r\n global _canvas\r\n if _canvas == None:\r\n raise RuntimeError(\"Canvas is not open yet.\")\r\n else:\r\n _canvas.clear()",
"def cle... | [
"0.77626824",
"0.76811874",
"0.75397754",
"0.7522146",
"0.7430021",
"0.7314975",
"0.72501177",
"0.72000146",
"0.7179969",
"0.7098576",
"0.7095018",
"0.7080522",
"0.7057002",
"0.7042345",
"0.6940186",
"0.6862446",
"0.6655312",
"0.65718627",
"0.6534404",
"0.650934",
"0.65041685... | 0.6915754 | 15 |
Use argparse to get command line arguments. | def parse_args():
# label_path: 原始label文件存储位置
# det_path : 生成的bbox的信息文件存储位置
# 下面只是对训练集进行解析,测试机可以得到同样的结果。
parser = argparse.ArgumentParser()
parser.add_argument('--label_path', type=str,default='C:\\Users\\wangbo\\Documents\\EGDownloads\\bdd100k_labels_release\\bdd100k\\labels\\bdd100k_labels_im... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_args():\n\n parser = get_argument_parser()\n args = parser.parse_args()\n\n return args",
"def command_line_arguments():\n\n try:\n parser = argparse.ArgumentParser(description='Log Handler/Cleaner/Copier for Idemia DocAuth')\n\n # Add required arguments.\n parser.add_arg... | [
"0.79559433",
"0.79283893",
"0.7898887",
"0.78868335",
"0.78574914",
"0.784694",
"0.77937055",
"0.7769283",
"0.77371347",
"0.77297413",
"0.7704374",
"0.76961625",
"0.768516",
"0.7665124",
"0.7656156",
"0.7647168",
"0.76255476",
"0.7621759",
"0.76077676",
"0.76019317",
"0.7591... | 0.0 | -1 |
Initializes the Process. Requires process_step, which would be the URI for the Process. | def __init__(self, name, process_step=None, **attributes):
self.name = name
self.process_step = process_step
# Check the config file for the process metadata if process step not provided
if process_step is None:
cfg_def = cfg.read_procedures()[name]
self.process_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__( self ):\n self._env = None\n self._steps = None\n\n self._initialize( )",
"def __init__(self, host=\"\", port=8432):\n Process.__init__(self)\n self.host, self.port = host, port\n self._Handler.annotator = self",
"def initialize_process():\n\n ... | [
"0.63028157",
"0.5980118",
"0.59741586",
"0.5961842",
"0.59247273",
"0.5874668",
"0.5790337",
"0.5772914",
"0.57708",
"0.57540727",
"0.5751383",
"0.5734739",
"0.5705344",
"0.5656907",
"0.56560916",
"0.5581608",
"0.55599284",
"0.55356514",
"0.55210406",
"0.5479819",
"0.5479435... | 0.644102 | 0 |
Swizzle [NSBundle bundleIdentifier] to make NSUserNotifications work. To post NSUserNotifications OS X requires the binary to be packaged as an application bundle. To circumvent this restriction, we modify `bundleIdentifier` to return a fake bundle identifier. | def swizzled_bundleIdentifier(self, original):
return 'com.apple.terminal' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bundle_identifier(self, bundle_identifier):\n\n self._bundle_identifier = bundle_identifier",
"def bundle_id(self, bundle_id):\n\n self._bundle_id = bundle_id",
"def bundle_id(self) -> str:\n return pulumi.get(self, \"bundle_id\")",
"def bundle_id(self) -> str:\n return pulumi... | [
"0.5354327",
"0.48549736",
"0.4755605",
"0.4755605",
"0.46968424",
"0.45560274",
"0.45420203",
"0.45343342",
"0.4520363",
"0.45035475",
"0.44943786",
"0.4492326",
"0.44564447",
"0.4450745",
"0.4443043",
"0.43955845",
"0.43955845",
"0.43955845",
"0.43394354",
"0.43070078",
"0.... | 0.5384512 | 0 |
Create and configure Flask Application | def create_app(configobj=ProdConfig):
app = Flask(__name__)
app.config.from_object(configobj)
configure_blueprints(app)
configure_extensions(app)
configure_callbacks(app)
configure_filters(app)
configure_error_handlers(app)
return app | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_app():\n\n # 1 Create Flask application\n app = Flask(\n import_name=__name__,\n template_folder=\"templates\",\n static_folder=\"static\"\n )\n\n # 2 Update the apps configuration\n app = config_selector(app)\n register_error_handlers(app)\n\n cache.init_app(app... | [
"0.84994274",
"0.8410988",
"0.83788973",
"0.82721883",
"0.823806",
"0.8136931",
"0.8123198",
"0.8090329",
"0.80712444",
"0.8063567",
"0.8058306",
"0.8055221",
"0.8021039",
"0.8001481",
"0.79961085",
"0.7987065",
"0.7985413",
"0.7937559",
"0.79221535",
"0.7920248",
"0.7919254"... | 0.76880777 | 69 |
Create a matrix of weights as a tf variable. Create also a placeholder and a assign operation to change it value. | def create_weight_variable(self, shape, name="W"):
import tensorflow as tf
self.variables[name] = tf.Variable(tf.truncated_normal(shape, stddev=0.1), name=name)
self.variables[name + "_ph"] = tf.placeholder(tf.float32, shape=shape,
name=name+"_ph")
self.variables[name + "_a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action(self):\n operator = self.create_operator()\n operator.set_name(self.node_name)\n if not isinstance(operator, zautograd.Variable):\n z_tensor = operator(self.inputs)\n operator.set_weights(self.format_params(self.params))\n else:\n z_tensor = o... | [
"0.6463859",
"0.64204574",
"0.64059955",
"0.6383337",
"0.6354962",
"0.6351365",
"0.6338791",
"0.6304451",
"0.6303614",
"0.62947935",
"0.62940407",
"0.6275025",
"0.6248222",
"0.6233668",
"0.62097126",
"0.62019485",
"0.6201534",
"0.61593145",
"0.6098334",
"0.6098334",
"0.609833... | 0.6806245 | 0 |
Create a biais as a tf variable. Create also a placeholder and a assign operation to change it value. | def create_bias_variable(self, shape, name="b"):
import tensorflow as tf
self.variables[name] = tf.Variable(tf.constant(0.1, shape=shape), name=name)
self.variables[name + "_ph"] = tf.placeholder(tf.float32, shape=shape,
name=name+"_ph")
self.variables[name + "_assign"] = t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def biases_variable(shape, val):\n return tf.Variable(tf.fill(dims=shape, value=val), name='biases')",
"def create_bias_variables(shape, name, use_gpu=False):\n initializer = tf.constant(0.1, shape=shape)\n \n if use_gpu:\n with tf.device(\"/gpu\"):\n return tf.get_variable(name, in... | [
"0.67754275",
"0.6574838",
"0.6507779",
"0.6495485",
"0.6411058",
"0.6402624",
"0.6398957",
"0.6340892",
"0.6340892",
"0.6340892",
"0.63306934",
"0.6310526",
"0.6291361",
"0.6291361",
"0.6291361",
"0.6291361",
"0.6291361",
"0.6291361",
"0.6291361",
"0.6291361",
"0.6291361",
... | 0.6968848 | 0 |
Return the best action for a given state | def best_action(self, observation, sess, weighted=False):
if weighted:
return self.weighted_choice(observation, sess)[0]
else:
return self.best_choice(observation, sess)[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _best_action(self, state):\n actions_rewards = list(self.Q[state].items())\n return max(actions_rewards, key=lambda x: x[1])[0]",
"def best_action(self, state):\n return random.choice(self.possible_actions)",
"def get_best_action(self, state):\n possible_actions = self.get_legal... | [
"0.86557984",
"0.86321425",
"0.8616949",
"0.8507299",
"0.830925",
"0.82970816",
"0.81366223",
"0.8094315",
"0.80745447",
"0.80690217",
"0.79240084",
"0.7891441",
"0.7891204",
"0.7866433",
"0.78616655",
"0.7859754",
"0.78372735",
"0.7834808",
"0.7808274",
"0.780026",
"0.779859... | 0.0 | -1 |
Return the estimated reward for a given state | def best_reward(self, observation, sess, weighted=False):
if weighted:
return self.weighted_choice(observation, sess)[1]
else:
return self.best_choice(observation, sess)[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reward(self,\n state: float) -> float:\n raise NotImplementedError",
"def get_reward(self, state, action, next_state):\n assert action in self.get_possible_actions(state), \"cannot do action %s from state %s\" % (action, state)\n return self._rewards.get(state, {}).get(acti... | [
"0.8373127",
"0.7674529",
"0.7557464",
"0.75392056",
"0.7499562",
"0.7422198",
"0.7401848",
"0.74002194",
"0.73398507",
"0.72056127",
"0.71717",
"0.716302",
"0.7136563",
"0.7067415",
"0.7022347",
"0.6997678",
"0.6981964",
"0.6951804",
"0.69439334",
"0.6931873",
"0.6928792",
... | 0.0 | -1 |
Assign the value of the NN weights to theta | def assign_value_to_theta(self, sess):
import tensorflow as tf
assert self.initialised, "This model must be initialised (self.initialisation())."
keys = sorted(self.variables.keys())
keys = [ key for key in keys if critere_keys(key)]
diff = 0
for i, key in enumerate(ke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_weights(self, theta):\n self.rnn.theta.set_value(theta)",
"def theta(self, theta):\n self.kernel.theta = theta",
"def theta(self, theta):\n\n self._theta = theta",
"def theta(self):\n self.eigenvalues()",
"def model(theta, x):\n\tw, b = theta\n\treturn w * x + b",
"de... | [
"0.8113398",
"0.7059381",
"0.6631136",
"0.6571155",
"0.64348215",
"0.636359",
"0.636359",
"0.6285756",
"0.627999",
"0.6246355",
"0.6226069",
"0.61640245",
"0.6156764",
"0.6151762",
"0.6084468",
"0.6072335",
"0.6072335",
"0.6059977",
"0.6050011",
"0.6040013",
"0.6021056",
"0... | 0.72215295 | 1 |
Assign the value of theta to the weights of the NN | def read_value_from_theta(self, sess, theta):
import tensorflow as tf
assert self.initialised, "This model must be initialised (self.initialisation())."
self.theta_copy = []
keys = sorted(self.variables.keys())
keys = [ key for key in keys if critere_keys(key)]
for i, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_weights(self, theta):\n self.rnn.theta.set_value(theta)",
"def theta(self, theta):\n self.kernel.theta = theta",
"def assign_value_to_theta(self, sess):\n import tensorflow as tf\n\n assert self.initialised, \"This model must be initialised (self.initialisation()).\"\n\n ... | [
"0.82823056",
"0.7130067",
"0.69874674",
"0.6727204",
"0.6674391",
"0.66648334",
"0.65745217",
"0.65745217",
"0.64835066",
"0.6378752",
"0.6289476",
"0.62818855",
"0.62285775",
"0.62240875",
"0.61822224",
"0.61711514",
"0.61360806",
"0.61014223",
"0.61014134",
"0.60935587",
"... | 0.621753 | 14 |
Checks if heap is empty. | def is_empty(self):
return self.heap_size <= 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty(heap):\n return size(heap) == 0",
"def is_empty(self):\n return len(self.__heap) == 0",
"def is_empty(self) -> bool:\n return self.heap.length() == 0",
"def is_empty(self) -> bool:\n return self.heap.length() == 0",
"def empty(self):\n return 0 >= len(self._heap)",
... | [
"0.87918097",
"0.8555897",
"0.8528184",
"0.8528184",
"0.8321541",
"0.81755346",
"0.8159286",
"0.7861932",
"0.73693806",
"0.7357226",
"0.7353525",
"0.7334226",
"0.7329839",
"0.72932124",
"0.72553164",
"0.72476596",
"0.7222908",
"0.72170645",
"0.7216803",
"0.72154963",
"0.72154... | 0.8642679 | 1 |
Set limits of plots based on position of Robot | def _set_plot_limits(self, dist):
plt.xlim(self._Position.xPos - dist * 1000.0, self._Position.xPos + dist * 1000.0)
plt.ylim(self._Position.zPos - dist * 1000.0, self._Position.zPos + dist * 1000.0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_plot_limits(self) -> None:\n matplotlib.pyplot.xlim(0, self.imgsz[0])\n matplotlib.pyplot.ylim(self.imgsz[1], 0)",
"def py_apply_limits(self, plot):\n if any(x is not None for x in self.x_lim):\n if self.x_lim[0] is not None: # at least left?\n if self.x_lim... | [
"0.69201916",
"0.6810851",
"0.67182255",
"0.6644486",
"0.65790164",
"0.6509992",
"0.643594",
"0.6405612",
"0.63867384",
"0.6365879",
"0.62673724",
"0.6166516",
"0.6158192",
"0.6101342",
"0.6066959",
"0.60599023",
"0.6049937",
"0.6015137",
"0.6010948",
"0.60079694",
"0.5980629... | 0.7070708 | 0 |
perform topK based on np.argpartition | def partition_arg_topK(matrix, K, axis=0):
a_part = np.argpartition(matrix, K, axis=axis)
if axis == 0:
row_index = np.arange(matrix.shape[1 - axis])
a_sec_argsort_K = np.argsort(matrix[a_part[0:K, :], row_index], axis=axis)
return a_part[0:K, :][a_sec_argsort_K, row_index]
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indices_of_top_k(arr, k):\n return np.sort(np.argpartition(np.array(arr), -k)[-k:])",
"def top_k(input, k=1, sorted=True, index_type=dtypes.int32, name=None): # pylint: disable=redefined-builtin\n return gen_nn_ops.top_kv2(\n input, k=k, sorted=sorted, index_type=index_type, name=name\n )",
"def... | [
"0.7193422",
"0.69196993",
"0.69045466",
"0.6880053",
"0.67147714",
"0.6711919",
"0.6691106",
"0.6684509",
"0.6488495",
"0.64705074",
"0.64413583",
"0.6432459",
"0.64215416",
"0.6410795",
"0.6399684",
"0.63739944",
"0.6373075",
"0.6335258",
"0.63132817",
"0.6270284",
"0.62200... | 0.7392668 | 0 |
Setup booking test by registering user and add cars. | def test_setup(client):
# Register user (includes login)
with open("src/MasterCSS/tests/testImages/" + \
"example.jpg", "rb") as user_image:
user_image_read = BytesIO(user_image.read())
response = client.post(
'/register',
data=dict(
username="example",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_bookings(self):\n baker.make_recipe('booking.user', _quantity=3)\n baker.make_recipe('booking.future_EV', _quantity=2)\n self.assertEqual(Booking.objects.all().count(), 0)\n management.call_command('create_bookings')\n self.assertEqual(Booking.objects.all().count(... | [
"0.6757841",
"0.6647219",
"0.6595748",
"0.65383124",
"0.6518337",
"0.65061074",
"0.6464423",
"0.64538574",
"0.64296675",
"0.641307",
"0.63922983",
"0.6391201",
"0.63832366",
"0.6380297",
"0.63742024",
"0.63696045",
"0.63104606",
"0.6300438",
"0.6293467",
"0.62545455",
"0.6219... | 0.6015748 | 46 |
Test view booking details when the car is available. | def test_view_car_booking(client):
response = client.post(
BOOKING_API_URL + '/book',
data=dict(
pickup_datetime=PICKUP_DATE,
return_datetime=RETURN_DATE,
car_id=1,
),
content_type='multipart/form-data'
)
assert b'Available!' in response.d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_view_booking(client):\n response = client.post(\n BOOKING_API_URL + '/view',\n data=dict(\n booking_id=1\n ),\n content_type='multipart/form-data'\n )\n\n assert b'Booking ID: 1' in response.data\n assert b'Car ID: </strong> 1' in response.data\n asser... | [
"0.71622014",
"0.66552305",
"0.6442244",
"0.6398572",
"0.6397116",
"0.6388818",
"0.63158363",
"0.6289131",
"0.61854357",
"0.61825824",
"0.610541",
"0.6088516",
"0.60803777",
"0.603744",
"0.60169834",
"0.5997365",
"0.59882426",
"0.5987657",
"0.59703535",
"0.59640193",
"0.59581... | 0.79464215 | 0 |
Used to get a users full name | def get_full_name(self):
return self.last_name + self.first_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_full_name(self):\n full_name = '%s %s' % (self.user.first_name.strip(), self.user.last_name.strip())\n if len(full_name.strip()) == 0:\n full_name = self.user.username\n return full_name.strip()",
"def get_full_name(self):\n full_name = f'{self.first_name} {self.las... | [
"0.8447406",
"0.84173375",
"0.840863",
"0.840863",
"0.8322008",
"0.83157456",
"0.8233342",
"0.8191648",
"0.81704843",
"0.80976194",
"0.8085201",
"0.8049897",
"0.80166596",
"0.8014928",
"0.8014928",
"0.80035484",
"0.7998611",
"0.79971266",
"0.79884243",
"0.7980313",
"0.7965516... | 0.79911834 | 18 |
Collate's training batch from normalized text and melspectrogram PARAMS | def __call__(self, batch):
# Right zero-pad all one-hot text sequences to max input length
input_lengths, ids_sorted_decreasing = torch.sort(
torch.LongTensor([len(x[0]) for x in batch]),
dim=0, descending=True)
max_input_len = input_lengths[0]
text_padded... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collate_fn(batch):\n text = [item[0] for item in batch]\n audio = [item[1] for item in batch]\n\n text_lengths = [len(x) for x in text]\n audio_lengths = [len(x) for x in audio]\n\n max_text = max(text_lengths)\n max_audio = max(audio_lengths)\n\n text_batch = np.stack(pad_text(x, max_text... | [
"0.69097173",
"0.6619894",
"0.65473866",
"0.6525156",
"0.6332836",
"0.6294709",
"0.62303245",
"0.620209",
"0.6173654",
"0.61379397",
"0.6064911",
"0.60534745",
"0.6045044",
"0.6028306",
"0.6024529",
"0.60206467",
"0.600853",
"0.600532",
"0.5963638",
"0.5942347",
"0.5942309",
... | 0.5908762 | 24 |
References to the graph lines which involve the segment as dovetail overlap. Returns gfapy.line.Edge list A list of lines. The lines themselves can be modified, but the list is immutable. | def dovetails(self):
return self.dovetails_L + self.dovetails_R | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_line_intersects_line(self) -> List[List[Line]]:\n intersections = []\n\n for line_bin in self.line_bins.values():\n for connection_pair in itertools.combinations(line_bin, 2):\n line_segments = (\n connection_pair[0].line_segments + connection_pair... | [
"0.71655566",
"0.63469094",
"0.63058233",
"0.6233303",
"0.62050915",
"0.61608976",
"0.61473024",
"0.6103755",
"0.6100683",
"0.60892045",
"0.60663164",
"0.60188127",
"0.5967623",
"0.5961982",
"0.5931545",
"0.591691",
"0.5916348",
"0.58952886",
"0.5888905",
"0.58696556",
"0.586... | 0.0 | -1 |
References to the graph lines which involve the segment as dovetail overlap. Returns gfapy.line.Edge list A list of lines. The lines themselves can be modified, but the list is immutable. | def dovetails_of_end(self, extremity):
return getattr(self, "dovetails_{}".format(extremity)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_line_intersects_line(self) -> List[List[Line]]:\n intersections = []\n\n for line_bin in self.line_bins.values():\n for connection_pair in itertools.combinations(line_bin, 2):\n line_segments = (\n connection_pair[0].line_segments + connection_pair... | [
"0.7164901",
"0.63454485",
"0.6306709",
"0.62335426",
"0.62069494",
"0.6161223",
"0.6147382",
"0.6102799",
"0.60997033",
"0.6087373",
"0.6065465",
"0.6017201",
"0.5966419",
"0.596061",
"0.59320253",
"0.59169734",
"0.59154665",
"0.58956903",
"0.5889701",
"0.5871476",
"0.586947... | 0.0 | -1 |
A string representation of the model. | def __str__(self):
return self.title | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return super().__str__() + self.model.__str__()",
"def __repr__(self):\n\n mod = f\"{self.__class__.__name__} Model\"\n try:\n mod += f': {self.filename}'\n except AttributeError:\n pass\n s = [mod]\n for name, v in self.metadat... | [
"0.85671604",
"0.8032301",
"0.7940423",
"0.78145605",
"0.7811784",
"0.778326",
"0.7757942",
"0.7757942",
"0.77394825",
"0.7716183",
"0.7716154",
"0.7681381",
"0.76639384",
"0.7658158",
"0.7644924",
"0.7644924",
"0.7629028",
"0.7628085",
"0.75915027",
"0.75915027",
"0.75711316... | 0.0 | -1 |
Test that service on a non existing entity. | async def test_configure_service_with_faulty_entity(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
await setup_deconz_integration(hass, aioclient_mock)
aioclient_mock.clear_requests()
data = {
SERVICE_ENTITY: "light.nonexisting",
SERVICE_DATA: {},
}
await ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_unknown_service(self):\n raise NotImplementedError # FIXME",
"def test_unknown_resource_under_service(self):\n raise NotImplementedError # FIXME",
"def test_entity_doesnt_exist(self):\n key = ndb.Key(models.InstanceTemplateRevision, 'fake-key')\n urls = snapshots.fetch(key)\n ... | [
"0.69567376",
"0.6942485",
"0.68693227",
"0.6861405",
"0.67818165",
"0.661912",
"0.6555507",
"0.6418882",
"0.6413617",
"0.63799554",
"0.634616",
"0.63378704",
"0.6321899",
"0.6303549",
"0.6256703",
"0.62400776",
"0.62392443",
"0.62369066",
"0.62319523",
"0.6214839",
"0.621115... | 0.6161989 | 23 |
split path to list of items eg. /Users/abc/test.txt would be splited to ['Users', 'abc', 'test.txt'] | def split_path(path):
items = []
while True:
path, folder = os.path.split(path)
if folder != '':
items.append(folder)
else:
if path != '':
items.append(path)
break
items.reverse()
return items | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __split_path(path: str) -> List[str]:\n return [part for part in path.split('/') if part] # Splits path at '/', handles extra slashes in the process",
"def split_path(self, path):\n path = path.strip(\"/\")\n return path.split(\"/\") if len(path) > 0 else []",
"def split_path(self, p... | [
"0.8215983",
"0.79268104",
"0.78505445",
"0.77712375",
"0.764754",
"0.7637763",
"0.7575202",
"0.7564119",
"0.7525559",
"0.7422646",
"0.7321763",
"0.7258655",
"0.72189015",
"0.7156561",
"0.69875604",
"0.69770586",
"0.69757944",
"0.6924834",
"0.69044626",
"0.68909943",
"0.68704... | 0.77505153 | 4 |
Change the human readable name of a sample. | def renameSample(old_name, new_name):
def switch(val):
return new_name.join(val.split(old_name))
with Repo.loadRepo() as repo:
sample = repo.db.sampleTable.get(old_name)
print(f'{old_name} -> {new_name}', file=sys.stderr)
sample.rename(new_name)
old_file_paths = []
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_name(self,new_name):\n self.name = new_name",
"def set_name(self, newname=\"\"):\n self.name = newname",
"def fixture_microbial_sample_name():\n return \"microbial_name_test\"",
"def update_name(self, new_name):\r\n self.__name = new_name",
"def update_name(self, new_name):\... | [
"0.6881961",
"0.6667725",
"0.66657543",
"0.66115016",
"0.66115016",
"0.6554496",
"0.6378364",
"0.633691",
"0.6332565",
"0.6250181",
"0.62216526",
"0.6196299",
"0.61688536",
"0.61688536",
"0.6153011",
"0.6127622",
"0.6127622",
"0.6127622",
"0.6127622",
"0.61091566",
"0.6109156... | 0.62834746 | 9 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, ShowRoomSettingResponse):
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.8089139",
"0.8089139",
"0.8054507",
"0.79827213",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
"0.79669285",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Sets the limit of this XmlNs0FindAssetsRequest. | def limit(self, limit):
self._limit = limit | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetLimit(self, *args):\n return _BRepAlgo.BRepAlgo_NormalProjection_SetLimit(self, *args)",
"def set_limit(self, limit):\n self.limit = limit\n self._prune()",
"def limit(self, limit):\n self._limit = limit",
"def limit(self, limit):\n self._limit = limit\n retur... | [
"0.6410126",
"0.6366396",
"0.6330318",
"0.6312624",
"0.6294551",
"0.6272586",
"0.60134995",
"0.596716",
"0.57926714",
"0.5786847",
"0.56928045",
"0.5667438",
"0.56298906",
"0.5619141",
"0.5584812",
"0.55328345",
"0.5523113",
"0.5439481",
"0.5436042",
"0.5429478",
"0.5403939",... | 0.6287489 | 7 |
Sets the offset of this XmlNs0FindAssetsRequest. | def offset(self, offset):
self._offset = offset | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_offset(self, offset):\n self.offset = offset",
"def set_offset(self, offset):\n self.offset = offset",
"def offset(self, offset):\n self._offset = offset",
"def set_offset( self, offset ):\n assert offset in range( len( self.buffer ) )\n self.pos = offset\n s... | [
"0.59101146",
"0.59101146",
"0.57172877",
"0.5701093",
"0.5698692",
"0.56388134",
"0.55797756",
"0.5519498",
"0.55152214",
"0.5466904",
"0.5431073",
"0.5427775",
"0.536597",
"0.5299718",
"0.5299718",
"0.5299718",
"0.5299718",
"0.5282704",
"0.5241763",
"0.5206652",
"0.5194446"... | 0.57591635 | 4 |
Sets the community_id of this XmlNs0FindAssetsRequest. | def community_id(self, community_id):
self._community_id = community_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def community(self, community):\n\n self._community = community",
"def set_community(self, community):\n assert community is None or isinstance(community, Community), type(community)\n self._community = community\n if community:\n self._dispersy = community.dispersy",
"de... | [
"0.63697976",
"0.59270924",
"0.58250076",
"0.52287894",
"0.51442206",
"0.51286715",
"0.50578964",
"0.49459624",
"0.48697382",
"0.4863069",
"0.4779173",
"0.4771958",
"0.473637",
"0.4731776",
"0.4606088",
"0.4604786",
"0.45618775",
"0.45532256",
"0.45126185",
"0.44874886",
"0.4... | 0.73118234 | 0 |
Sets the name of this XmlNs0FindAssetsRequest. | def name(self, name):
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetName(self, name):\n self.name = name",
"def setName(self, *args):\n return _libsbml.Input_setName(self, *args)",
"def set_name(self, name):\n self._name = name",
"def set_name(self, name: str):\n self._name = name",
"def set_name(self, a_name):\n self.set_parameter... | [
"0.5760864",
"0.57353497",
"0.56819093",
"0.5679064",
"0.565772",
"0.56366694",
"0.5613423",
"0.5613423",
"0.5613423",
"0.5613423",
"0.5613423",
"0.5591216",
"0.558348",
"0.558348",
"0.5563619",
"0.5563619",
"0.5563619",
"0.5554763",
"0.5554763",
"0.55516434",
"0.5532887",
... | 0.0 | -1 |
Sets the name_match_mode of this XmlNs0FindAssetsRequest. | def name_match_mode(self, name_match_mode):
self._name_match_mode = name_match_mode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def match_name(self, match_name):\n\n self._match_name = match_name",
"def set_match_names(self, names):\n result = self.copy()\n result.match_names = names\n return result",
"def setResultsName(self, name, **kwargs):\n self.structure.set_name(name)\n return self",
"... | [
"0.64192903",
"0.5590339",
"0.48118964",
"0.47153068",
"0.46072176",
"0.4586734",
"0.44739786",
"0.44508502",
"0.44508502",
"0.44324607",
"0.4407056",
"0.43796033",
"0.43265542",
"0.4317527",
"0.4312261",
"0.43117434",
"0.43060198",
"0.43043357",
"0.43008414",
"0.43008414",
"... | 0.7436334 | 0 |
Sets the status_ids of this XmlNs0FindAssetsRequest. | def status_ids(self, status_ids):
self._status_ids = status_ids | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_statuses(self, statuses):\n if not all((s in USBDeviceQuery.VALID_STATUSES) for s in statuses):\n raise ApiError(\"One or more invalid status values\")\n self._update_criteria(\"status\", statuses)\n return self",
"def asset_statuses(self) -> Optional[pulumi.Input[Sequence... | [
"0.643593",
"0.5356635",
"0.52965933",
"0.5290756",
"0.5263389",
"0.52224183",
"0.51152265",
"0.5101985",
"0.5093685",
"0.503186",
"0.50317496",
"0.5025396",
"0.5000745",
"0.49372622",
"0.4887585",
"0.4825357",
"0.48156592",
"0.48111647",
"0.48111647",
"0.48111647",
"0.475695... | 0.7379978 | 0 |
Sets the type_inheritance of this XmlNs0FindAssetsRequest. | def type_inheritance(self, type_inheritance):
self._type_inheritance = type_inheritance | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_type(self, type, asset=None):\n self._set_property('pc:type', type, asset)",
"def asset_type(self, **kwargs):\n\n return self.api_request(self._get_method_fullname(\"asset_type\"), kwargs)",
"def account_type(self, account_type):\n\n self._account_type = account_type",
"def accou... | [
"0.49095726",
"0.48038062",
"0.4500521",
"0.4500521",
"0.4500521",
"0.4500521",
"0.44780543",
"0.44686472",
"0.4446214",
"0.438684",
"0.43061894",
"0.43061894",
"0.42989403",
"0.42801845",
"0.42762223",
"0.42279965",
"0.42172024",
"0.42163652",
"0.42149055",
"0.42149055",
"0.... | 0.64896697 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, XmlNs0FindAssetsRequest):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Find the best lambda value. | def tune_lambda(Xtrain, ytrain, Xval, yval):
#####################################################
# TODO 5: Fill in your code here #
#####################################################
bestlambda = None
mean_abs_err = 10000000
power = -19
while power < 20:
lambda0 = 10 ** (power)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_lambda(model):\n best_lambdas = [1000.0, 0.001, 100.0, 0.001, 100.0, 100.0, 0.001, 100.0]\n lambda_ = best_lambdas[model]\n return lambda_",
"def __bestLambda(self):\n\t\t\n\t\t# Determine starting value for brent-method (to avoid local minimum).\n\t\tself.startValue = self.__findStartValue()\n\... | [
"0.74376273",
"0.7189221",
"0.6557769",
"0.6550426",
"0.62340736",
"0.62213564",
"0.6185053",
"0.6160072",
"0.61558044",
"0.61117035",
"0.6098818",
"0.6078099",
"0.6040128",
"0.6040128",
"0.6017976",
"0.59726703",
"0.5890478",
"0.5844015",
"0.58438104",
"0.5816413",
"0.578790... | 0.63082486 | 4 |
Returns the default collector settings | def get_default_config(self):
config = super(CMDCollector, self).get_default_config()
config.update({
'enabled': 'True',
'fs': ',',
'timeout': 300,
})
return config | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getDefaultSettings():\n return {}",
"def get_default_config(self):\n config = super(DropwizardCollector, self).get_default_config()\n config.update({\n 'url': DEFAULT_METRICS_URL,\n 'path': 'dropwizard'\n })\n return config",
"def get_default_config(... | [
"0.7008024",
"0.69490683",
"0.6713433",
"0.65743333",
"0.65309024",
"0.6521635",
"0.6515402",
"0.6466526",
"0.6447688",
"0.641337",
"0.6397818",
"0.6380512",
"0.63683224",
"0.6357208",
"0.63517016",
"0.6331759",
"0.63120294",
"0.62353724",
"0.6231899",
"0.62074906",
"0.620161... | 0.70514023 | 0 |
Split DataFrame `df` into `nchunks` chunks. | def split_df(df, n_chunks):
chunk_size = int(np.ceil(df.shape[0] / n_chunks))
assert n_chunks * chunk_size >= df.shape[0]
chunks = []
for i in range(0, df.shape[0], chunk_size):
chunks.append(df[i:i + chunk_size])
assert len(chunks) == n_chunks
return chunks | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_dataframe(df, n_split, axis=0):\n\n # TODO: implement axis logic\n\n if df.shape[0] < n_split:\n raise ValueError(\n 'n_split ({}) can\\'t be greater than the number of rows ({}).'.\n format(n_split, df.shape[0]))\n elif n_split <= 0:\n raise ValueError('n... | [
"0.78726727",
"0.7268714",
"0.66131675",
"0.6435278",
"0.6306082",
"0.6217494",
"0.61886173",
"0.61415464",
"0.6116423",
"0.5982091",
"0.5961465",
"0.59080034",
"0.5821741",
"0.5775712",
"0.57639426",
"0.5749825",
"0.5739742",
"0.5734471",
"0.57339364",
"0.5677342",
"0.567562... | 0.8935508 | 0 |
Remove duplicate columns. Examples >>> import pandas as pd >>> df = pd.DataFrame([[1,2,3], [4,5,6], [7,8,9]], columns=['a', 'b', 'a']) >>> remove_duplicate_columns(df) a b 0 1 2 1 4 5 2 7 8 >>> remove_duplicate_columns(df, keep_first=False) b a 0 2 3 1 5 6 2 8 9 >>> remove_duplicate_columns(df, add_suffix=True) a b a_2... | def remove_duplicate_columns(df, keep_first=True, add_suffix=False):
seen = Counter()
keep_i = []
keep_name = []
def my_enumerate(columns):
if keep_first:
yield from enumerate(columns)
else:
yield from enumerate(reversed(columns))
for i, column in my_enumera... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drop_duplicate_columns(df: pd.DataFrame) -> pd.DataFrame:\n for duplicate_column, original_column in duplicate_columns(df):\n logger.debug(\n \"Dropping column %r from DataFrame (duplicate of %r)\",\n duplicate_column,\n original_column,\n )\n df = df.dr... | [
"0.76116794",
"0.68624413",
"0.6824561",
"0.6510528",
"0.62474686",
"0.61860317",
"0.603843",
"0.59988433",
"0.58866745",
"0.58123964",
"0.5727827",
"0.56710726",
"0.55679774",
"0.55378133",
"0.55196655",
"0.55141246",
"0.5492219",
"0.5486242",
"0.5462965",
"0.54447806",
"0.5... | 0.85251105 | 0 |
Add EDF trigger times as a variable to Dataset ds. These trigger times can then be used for Edf.add_by_T(ds) after ds hads been decimated. | def add_t_to(self, ds, trigger='trigger', t_edf='t_edf'):
if trigger:
self.assert_trigger_match(ds=ds, trigger=trigger)
if isinstance(trigger, str):
trigger = ds[trigger]
ds[t_edf] = Var(self.triggers['T']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def events(path, samples=False, ds=None, trigger='trigger', t_edf='t_edf'):\n edf = Edf(path, samples=samples)\n if ds is None:\n ds = edf.get_triggers(trigger, t_edf)\n else:\n if 'edf' in ds.info:\n raise ValueError(\"ds.info already contains 'edf' entry.\")\n if trigger ... | [
"0.6246392",
"0.57395035",
"0.5486942",
"0.5454465",
"0.53303003",
"0.52895975",
"0.5223884",
"0.5209137",
"0.5107591",
"0.5098208",
"0.50408536",
"0.5029141",
"0.50290847",
"0.50114167",
"0.50090975",
"0.49920243",
"0.49858004",
"0.4962081",
"0.4949539",
"0.49373734",
"0.492... | 0.7076232 | 0 |
view to return the index page | def index(request):
return render(request, 'home/index.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index():\r\n return render_template('index.html')",
"def index():\n return render_template('index.html')",
"def index():\n return render_template('index.html')",
"def index():\n return render_template('index.html')",
"def index(self):\n\t\treturn render_template('ind... | [
"0.8667649",
"0.8651757",
"0.85949266",
"0.85949266",
"0.8577009",
"0.8576306",
"0.8498363",
"0.8498363",
"0.84614736",
"0.84501773",
"0.84491396",
"0.8444358",
"0.84263587",
"0.8418289",
"0.83815753",
"0.8379742",
"0.8378358",
"0.8373484",
"0.83634514",
"0.83634514",
"0.8363... | 0.0 | -1 |
return queryset or None | def getOldGlobalMsgs(self): # if you dont delete global cache locally before it - index will be 1
msgsType = 'old'
return self.getGlobalMsgs(msgsType) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queryset(self):\n return None",
"def get_queryset(self):\n return None",
"def get_queryset(self):\n if self.queryset is None:\n return self.model.objects.all()\n return self.queryset",
"def get_queryset(self):\n \n # throw error if no args pass in\... | [
"0.7446653",
"0.7446653",
"0.7272068",
"0.7068698",
"0.703857",
"0.7038281",
"0.6985785",
"0.69088817",
"0.6884461",
"0.68763596",
"0.68409175",
"0.6809832",
"0.6798547",
"0.6783358",
"0.67233807",
"0.670246",
"0.6691403",
"0.6644355",
"0.66228557",
"0.66184044",
"0.6570538",... | 0.0 | -1 |
return queryset or None | def getNewGlobalMsgs(self):
msgsType = 'new'
newMsgs = self.getGlobalMsgs(msgsType)
return newMsgs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queryset(self):\n return None",
"def get_queryset(self):\n return None",
"def get_queryset(self):\n if self.queryset is None:\n return self.model.objects.all()\n return self.queryset",
"def get_queryset(self):\n \n # throw error if no args pass in\... | [
"0.7446653",
"0.7446653",
"0.7272068",
"0.7068698",
"0.703857",
"0.7038281",
"0.6985785",
"0.69088817",
"0.6884461",
"0.68763596",
"0.68409175",
"0.6809832",
"0.6798547",
"0.6783358",
"0.67233807",
"0.670246",
"0.6691403",
"0.6644355",
"0.66228557",
"0.66184044",
"0.6570538",... | 0.0 | -1 |
Compute the binary cross entropy weighted by the given weights. | def weighted_binary_cross_entropy_from_probs(target,
output,
positive_class_weight=None,
negative_class_weight=None):
epsilon = tf.constant(_EPSILON, dtype=output.dtype.base_dtype)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weighted_categorical_crossentropy(weights):\n weights = K.variable(weights)\n\n def loss(y_true, y_pred):\n y_hat = y_pred / K.sum(y_pred, axis=-1, keepdims=True)\n y_hat = K.clip(y_hat, K.epsilon(), 1 - K.epsilon())\n loss = y_true * K.log(y_hat) * weights\n loss = - K.sum(lo... | [
"0.7218679",
"0.71868956",
"0.7161859",
"0.6997633",
"0.6992103",
"0.683924",
"0.681261",
"0.67551243",
"0.6749629",
"0.6640951",
"0.65996283",
"0.6563472",
"0.64816934",
"0.6425765",
"0.6385413",
"0.6360757",
"0.63489616",
"0.6339922",
"0.6322644",
"0.63202494",
"0.62498975"... | 0.6728296 | 9 |
Returns project's root working directory (entire path). Returns string Path to project's root directory. | def get_project_root(self):
# Get current working directory
cwd = os.getcwd()
# Remove all children directories
rd = os.path.join(cwd.split('stochastic-travel-demand-modelling/', 1)[0])
# Make sure directory ends with project's name
if not rd.endswith('stochastic-travel-d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project_root() -> Path:\n return PROJECT_ROOT",
"def getProjectRootDir():\n return ROOT_DIR",
"def get_project_root() -> Path:\n return Path(__file__).parent.parent",
"def get_project_root() -> Path:\n return Path(__file__).parent.parent",
"def get_project_root() -> Path:\n return Pa... | [
"0.85946465",
"0.83289444",
"0.8313182",
"0.8313182",
"0.8313182",
"0.8313182",
"0.8279548",
"0.817783",
"0.8133247",
"0.8100622",
"0.80944616",
"0.8083665",
"0.8083665",
"0.7994004",
"0.79298663",
"0.7873802",
"0.7772452",
"0.7751362",
"0.77438676",
"0.7720112",
"0.7713667",... | 0.78509915 | 16 |
Move the character to the given direction | def move(self, direction, is_update=False):
s = self
if not self.is_moving():
self.check_powerups()
self.check_fires()
self.check_enemies()
if is_update:
return
s.direction = direction
if s.physics.can_move_bomberm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move(self, direction):\n pass",
"def move(self, direction):\r\n self.stored_direction = direction",
"def move_character(direction: str, character: list):\n if direction == \"d\":\n character[1] += 1\n if direction == \"a\":\n character[1] -= 1\n if direction == \"w\":\n... | [
"0.81505865",
"0.78554475",
"0.7828393",
"0.76221555",
"0.76221555",
"0.758785",
"0.7410414",
"0.73122853",
"0.72756755",
"0.7224027",
"0.7194552",
"0.7156637",
"0.7144008",
"0.71431845",
"0.71171147",
"0.71025944",
"0.70914245",
"0.705965",
"0.7033448",
"0.7004743",
"0.69926... | 0.0 | -1 |
Checks if the character was burnt or touched by an enemy. | def is_dead(self):
if self.killer:
if self.killer.stype == 'fire' and not (self.killer in self.pjs.fires):
return True
elif self.killer.stype == 'enemy' and self.timeout == 0:
return True
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attack(self, enemy: 'games.stardash.unit.Unit') -> bool:\n return self._run_on_server('attack', {\n 'enemy': enemy\n })",
"def can_take_damage(self):\n result = True\n if self.side_effects[\"shield\"] > 0:\n result = False\n return result",
"def isCo... | [
"0.6861014",
"0.68004805",
"0.67390764",
"0.6548177",
"0.65322685",
"0.65293974",
"0.63886976",
"0.63758624",
"0.6327478",
"0.62903994",
"0.61857027",
"0.61702913",
"0.6161636",
"0.61174965",
"0.610088",
"0.6094651",
"0.6073904",
"0.6053508",
"0.604052",
"0.60359156",
"0.6033... | 0.66071343 | 3 |
Initializes the blocks at the discrete grid of blocks, representatives of the character. | def init_blocks(self):
length = self.physics.len_blocks
rect = Rectangle(self.rpos, self.rpos + Vector(length, length))
self.rects.append(rect)
self.physics.add_block(rect, 'bomberman') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_grid(self) -> None:\n for i in range(self.grid_size[0]):\n for j in range(self.grid_size[1]):\n self.set(i, j, self.base_color)",
"def init_blocks(self):\n length = self.physics.len_blocks\n rect = Rectangle(Vector(self.rpos.x, self.rpos.y),\n ... | [
"0.700023",
"0.6953139",
"0.6816464",
"0.67683136",
"0.663996",
"0.66040695",
"0.6537529",
"0.6388788",
"0.63295823",
"0.62872064",
"0.6208005",
"0.6202071",
"0.6168464",
"0.616763",
"0.6160629",
"0.61366373",
"0.6131687",
"0.6131577",
"0.6124719",
"0.6100548",
"0.6099862",
... | 0.7088482 | 0 |
Check if the character is touched by an enemy. | def check_enemies(self):
for enemy in self.pjs.enemies:
for block in enemy.rects:
if block.overlap(self.rects[0]):
self.killer = enemy
return | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attack(self, enemy: 'games.stardash.unit.Unit') -> bool:\n return self._run_on_server('attack', {\n 'enemy': enemy\n })",
"def is_enemy(self) -> bool:\n return self.proto.alliance == ALLIANCE.Enemy.value",
"def is_enemy(self, x, y, mycolor):\n piece = self.get_piece(x... | [
"0.7175313",
"0.6996342",
"0.6925273",
"0.66545045",
"0.6613577",
"0.6434328",
"0.6308691",
"0.6281839",
"0.6280903",
"0.62739336",
"0.6202598",
"0.61416197",
"0.6135618",
"0.6112355",
"0.61011326",
"0.60078156",
"0.59952885",
"0.5951462",
"0.5941117",
"0.5921054",
"0.5887138... | 0.63199437 | 6 |
Return a simple homepage outlining Margarine and allowing signups. | def home_page():
return render_template('index.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def homepage():\n\n return render_template('rosemead_homepage.html')",
"def a_homepage():\n\n\treturn render_template('home/a_homepage.html', title=\"Homepage Admin\")",
"def homepage():\n\treturn render_template(\"home/a_homepage.html\", title=\"Welcome\")",
"def show_homepage():\n\n return render_tem... | [
"0.7492662",
"0.7281623",
"0.72750795",
"0.7248451",
"0.72075105",
"0.7190779",
"0.716878",
"0.7134176",
"0.711963",
"0.70058256",
"0.69527566",
"0.69472724",
"0.69472724",
"0.6926922",
"0.6880205",
"0.68649167",
"0.6864301",
"0.68516576",
"0.6848143",
"0.6833217",
"0.6815475... | 0.6667214 | 33 |
Creates a dictionary of headers for the API requests. | def _make_headers() -> CaseInsensitiveDict:
headers = CaseInsensitiveDict()
headers['Authorization'] = f'Token {os.environ["TOKEN"]}'
headers['Content-type'] = 'application/json'
return headers | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_headers(self) -> Dict[str, str]:\n header_dict = self.generate_auth_dict()\n\n return {\n \"Authorization\": \"Basic \" + header_dict[\"signature\"],\n \"Content-Type\": 'application/json',\n }",
"def _create_auth_headers(self):\n auth_headers = {**self.g... | [
"0.8193797",
"0.81096715",
"0.80381167",
"0.8028978",
"0.801511",
"0.8010688",
"0.79964143",
"0.7943161",
"0.7910022",
"0.7855798",
"0.7850285",
"0.7843639",
"0.78135407",
"0.7807975",
"0.77866757",
"0.7763731",
"0.77539635",
"0.7728968",
"0.7693633",
"0.7661439",
"0.76561797... | 0.83065397 | 0 |
Gets the class name without the module and trims the '> at the end. | def get_check_name(self):
return str(self.__class__).split('.')[-1][:-2] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def module_name(cls):\n return __name__.split(\".\")[0]",
"def fullname(cls):\n module = cls.__module__\n if module is None or module == str.__class__.__module__:\n return cls.__class__.__name__\n return module + '.' + cls.__class__.__name__",
"def full_classname(cls: type) -> str:\n ... | [
"0.73995894",
"0.7344704",
"0.7338965",
"0.73184496",
"0.7294019",
"0.7219299",
"0.7203663",
"0.7141555",
"0.7141555",
"0.7131966",
"0.7103369",
"0.70865095",
"0.7084533",
"0.70366347",
"0.6959328",
"0.6910953",
"0.6907556",
"0.68888605",
"0.686988",
"0.6828416",
"0.6820023",... | 0.6583977 | 27 |
(int) Return the picking card | def pick(self, amount = 1):
pick_card = self._starting_card[-1:-amount -1 :-1]
self._starting_card = self._starting_card[0:-amount:1]
return pick_card | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_card(self):\n\n card = random.randint(1,13)\n return card",
"def deal_cards(self):\n self.card = random.randint(1, 13)\n return self.card",
"def get_card_val(card):\n\n if card == '1':\n return 1\n if card == '2':\n return 2\n if card == '3':\n ... | [
"0.7456667",
"0.70580256",
"0.6910752",
"0.6880011",
"0.68365145",
"0.6817712",
"0.6773583",
"0.6738799",
"0.67364",
"0.66177714",
"0.6602599",
"0.655657",
"0.65555173",
"0.6553807",
"0.65477955",
"0.6500462",
"0.6477123",
"0.6254982",
"0.6241475",
"0.62120587",
"0.61727685",... | 0.7397418 | 1 |
This function can put the card into the starting_cards | def add_card(self, card):
self.get_cards().append(card) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self._cards = []",
"def __init__(self):\r\n self.cards = []",
"def cards(self) -> None:\n self._cards = []",
"def add_card(self, added_cards):\n\n self.hand[:0] = added_cards",
"def cards(self, cards):\n\n self._cards = cards",
"def cards(self, car... | [
"0.6924642",
"0.6888843",
"0.6882657",
"0.6861642",
"0.6787011",
"0.6787011",
"0.6621758",
"0.65791523",
"0.6568772",
"0.6547994",
"0.6483687",
"0.6460429",
"0.6453161",
"0.6432953",
"0.6426527",
"0.63999176",
"0.6393222",
"0.6380351",
"0.6361572",
"0.63591313",
"0.635386",
... | 0.59279895 | 75 |
(int) Return the coder card | def get_coders(self):
return self._coder | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_card(self):\n\n card = random.randint(1,13)\n return card",
"def get_card_value(self, card):\n if card >= 10:\n return 10\n if card == 1:\n return 11\n return card",
"def get_card_val(card):\n\n if card == '1':\n return 1\n if card =... | [
"0.7239942",
"0.67526466",
"0.67433816",
"0.6680641",
"0.6569214",
"0.6524646",
"0.65131825",
"0.6464915",
"0.6426081",
"0.6379205",
"0.63320845",
"0.6329492",
"0.6279826",
"0.62731",
"0.62441707",
"0.61480963",
"0.6135354",
"0.6089321",
"0.6069328",
"0.60642076",
"0.6057255"... | 0.0 | -1 |
Calculate the output dimension of an input image during pooling or convolution when padded with ``SAME`` mode for arbitrary n dimensional array. | def same_nd(shape, stride, kernel_size):
rshape = []
for sh, st, sz in zip(shape, stride, kernel_size):
rshape.append(int(same_x(sh, st, sz)))
return rshape | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_conv1d_output_size(input_size, kernel_size, stride):\n return ((input_size - kernel_size)//stride) + 1",
"def get_conv1d_output_size(input_size, kernel_size, stride):\n return ((input_size - kernel_size)//stride) + 1",
"def calc_conv_out_dims(X_shape, W_shape, stride=1, pad=0, dilation=0):\n\tdum... | [
"0.68589336",
"0.68589336",
"0.6517815",
"0.6473044",
"0.64381516",
"0.6425057",
"0.6401127",
"0.6311207",
"0.62701726",
"0.62701726",
"0.6265837",
"0.62590533",
"0.62136805",
"0.6157396",
"0.61321896",
"0.6124309",
"0.61074704",
"0.6101602",
"0.6086174",
"0.60758394",
"0.606... | 0.0 | -1 |
Calculate the output dimension of an input image during pooling or convolution when padded with ``VALID`` mode for arbitrary n dimensional array. | def valid_nd(shape, stride, kernel_size):
rshape = []
for sh, st, sz in zip(shape, stride, kernel_size):
rshape.append(int(valid_x(sh, st, sz)))
return rshape | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calc_conv_out_dims(X_shape, W_shape, stride=1, pad=0, dilation=0):\n\tdummy = np.zeros(X_shape)\n\ts, p, d = stride, pad, dilation\n\tif len(X_shape) == 3:\n\t\t_, p = pad1D(dummy, p)\n\t\tpw1, pw2 = p\n\t\tfw, in_ch, out_ch = W_shape\n\t\tn_ex, in_length, in_ch = X_shape\n\n\t\t_fw = fw * (d+1) - d\n\t\tout_l... | [
"0.6438825",
"0.6398467",
"0.6376204",
"0.6376204",
"0.6231611",
"0.6195767",
"0.61696184",
"0.61628515",
"0.6144802",
"0.60782415",
"0.60782415",
"0.60551137",
"0.60373974",
"0.60172415",
"0.59939396",
"0.5974569",
"0.5933613",
"0.59261537",
"0.5925673",
"0.58971304",
"0.589... | 0.0 | -1 |
Make a onehot version of X | def make_one_hot(X, onehot_size):
if onehot_size < 450:
dig_one = np.zeros((onehot_size, onehot_size))
np.fill_diagonal(dig_one, 1)
rX = dig_one[np.asarray(X)]
else:
# for large onehot size, this is faster
rX = np.zeros((len(X), onehot_size))
for i in range(len(X)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def one_hot_encode(x):\n # TODO: Implement Function\n output = np.zeros((len(x), 10))\n \n for i, j in enumerate(x):\n output[i,j] = 1\n \n return output",
"def one_hot(self, x, N):\n\n ### YOUR CODE HERE ###\n M = x.shape[0]\n one_hot = np.zeros((N, M))\n ... | [
"0.85305494",
"0.8302866",
"0.8197623",
"0.81806487",
"0.8165966",
"0.8157481",
"0.81350404",
"0.81320757",
"0.8028779",
"0.79036874",
"0.7895831",
"0.7859813",
"0.78508013",
"0.78413004",
"0.78390336",
"0.7832777",
"0.7815534",
"0.7807532",
"0.77763385",
"0.7770624",
"0.7769... | 0.82986164 | 2 |
Object representation in string format HumanReadable | def __str__(self):
return f'{self.body} - quote of {self.author}' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return str(self.__dict__['_obj'])",
"def __str__(self):\n return str(self.obj)",
"def get_str(self, obj):\n if self.pretty:\n return pprint.pformat(obj)\n else:\n return str(obj)",
"def objectToString(obj):\n if (hasattr(obj, \... | [
"0.713109",
"0.70712805",
"0.7066851",
"0.6923915",
"0.6835651",
"0.67915416",
"0.67913574",
"0.6776442",
"0.6776442",
"0.67424697",
"0.6733303",
"0.67180645",
"0.6711196",
"0.6695596",
"0.6681303",
"0.6681303",
"0.6670656",
"0.6653437",
"0.6653437",
"0.6653437",
"0.6653437",... | 0.0 | -1 |
In the backward pass we receive a Tensor containing the gradient of the loss with respect to the output, and we need to compute the gradient of the loss with respect to the input. | def backward(self, grad_output):
input, = self.saved_tensors
grad_input = grad_output.clone()
grad_input[input < 0] = 0
return grad_input | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def backward(ctx, grad_output):\n\n ########################\n # PUT YOUR CODE HERE #\n #######################\n # Retrieve saved tensors and constants\n gamma, ivar, mean, input = ctx.saved_tensors\n eps = ctx.saved_tensors\n\n # Check which inputs need gradients\n input_needs_grad, gamm... | [
"0.81704295",
"0.8148858",
"0.79390633",
"0.7929755",
"0.7905755",
"0.7901849",
"0.78919894",
"0.7861708",
"0.7844769",
"0.7824832",
"0.7806002",
"0.77869797",
"0.77864844",
"0.77721834",
"0.77721834",
"0.775241",
"0.7694936",
"0.7690958",
"0.767474",
"0.767474",
"0.7646458",... | 0.7306075 | 45 |
Test if queue is empty Worst case time complexity of O(1) | def empty(self):
return self.__n == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty_queue(queue):\n return queue.front is None",
"def empty(self): # O(1)\n return not self.queue",
"def empty(self) -> bool: \n if(self.queue is not None and len(self.queue) > 0):\n print(\"len > 0\" )\n return False\n else:\n ... | [
"0.87215465",
"0.82825214",
"0.82448214",
"0.82370806",
"0.8155726",
"0.81298125",
"0.81298125",
"0.80942005",
"0.7992637",
"0.7974321",
"0.7967088",
"0.7936354",
"0.79183674",
"0.79106414",
"0.7903161",
"0.78360516",
"0.7816995",
"0.77962285",
"0.7752891",
"0.7749309",
"0.77... | 0.0 | -1 |
Get index of item with minimum priority Worst case time complexity of O(1) | def min_index(self):
return self.__pq[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_search(arr: Sequence) -> int:\n\tprint(arr)\n\tmin_index = None\n\tmin_elem = arr[0]\n\tfor i in range(1, len(arr)):\n\t\tif min_elem > arr[i]:\n\t\t\tmin_elem = arr[i]\n\t\t\tmin_index = i\n\treturn min_index",
"def get_index_of_smallest(L, i):\n #The index of the smallest item so far.\n index_of_... | [
"0.7138264",
"0.7103271",
"0.7075633",
"0.7041816",
"0.7009289",
"0.6984614",
"0.69305915",
"0.68890285",
"0.67641395",
"0.67394584",
"0.66318446",
"0.65755033",
"0.6552069",
"0.65453887",
"0.6543955",
"0.6531411",
"0.6506877",
"0.645046",
"0.6437206",
"0.6426598",
"0.6416018... | 0.6554829 | 12 |
Change the maximum index of the priority queue Note that decreasing the size will truncate the queue and delete elements Worst case time complexity of O(N) | def resize(self, cap):
temp_pq = [0] * (cap + 1)
temp_qp = [-1] * (cap + 1)
temp_keys = [None] * (cap + 1)
for i in range(cap + 1):
temp_pq[i] = self.__pq[i]
temp_qp[i] = self.__qp[i]
temp_keys[i] = self.__keys[i]
self.__pq = temp_pq
se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_pop_decreases_size(sample_priorityq):\n for i in range(5):\n sample_priorityq.insert([i, i + 3])\n sample_priorityq.pop()\n assert len(sample_priorityq.heap_list) == 4\n sample_priorityq.pop()\n assert len(sample_priorityq.heap_list) == 3\n sample_priorityq.pop()\n assert len(s... | [
"0.7126611",
"0.7054646",
"0.6841057",
"0.68401074",
"0.65708464",
"0.6442002",
"0.64284337",
"0.6351499",
"0.62953246",
"0.6272475",
"0.6266955",
"0.625777",
"0.62539256",
"0.62342995",
"0.6226677",
"0.6219871",
"0.6210027",
"0.6210027",
"0.61938924",
"0.61863434",
"0.616617... | 0.56897783 | 78 |
Sets the account_moid of this PciSwitch. The Account ID for this managed object. | def account_moid(self, account_moid):
self._account_moid = account_moid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def account_moid(self):\n return self._account_moid",
"def account_moid(self):\n return self._account_moid",
"def domain_group_moid(self, domain_group_moid):\n\n self._domain_group_moid = domain_group_moid",
"def domain_group_moid(self, domain_group_moid):\n\n self._domain_group_m... | [
"0.6732311",
"0.6732311",
"0.5899351",
"0.5899351",
"0.5450976",
"0.524153",
"0.524153",
"0.5161066",
"0.5144567",
"0.5144567",
"0.5144567",
"0.5144567",
"0.5045895",
"0.50274193",
"0.50010234",
"0.49296352",
"0.49296352",
"0.49296352",
"0.49296352",
"0.49296352",
"0.49296352... | 0.8387056 | 1 |
Gets the create_time of this PciSwitch. The time when this managed object was created. | def create_time(self):
return self._create_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_time(self) -> str:\n return pulumi.get(self, \"create_time\")",
"def create_time(self) -> str:\n return pulumi.get(self, \"create_time\")",
"def create_time(self) -> str:\n return pulumi.get(self, \"create_time\")",
"def create_time(self) -> str:\n return pulumi.get(sel... | [
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.78575814",
"0.7745116",... | 0.81326383 | 2 |
Gets the domain_group_moid of this PciSwitch. The DomainGroup ID for this managed object. | def domain_group_moid(self):
return self._domain_group_moid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def domain_group_moid(self, domain_group_moid):\n\n self._domain_group_moid = domain_group_moid",
"def domain_group_moid(self, domain_group_moid):\n\n self._domain_group_moid = domain_group_moid",
"def managed_network_group_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(sel... | [
"0.6358574",
"0.6358574",
"0.6306843",
"0.6288101",
"0.6288101",
"0.6226057",
"0.6114631",
"0.6109095",
"0.6109095",
"0.6109095",
"0.60822976",
"0.607031",
"0.6050105",
"0.6039327",
"0.60296535",
"0.6024981",
"0.6017161",
"0.6005489",
"0.598093",
"0.598093",
"0.598093",
"0.... | 0.8040621 | 1 |
Gets the mod_time of this PciSwitch. The time when this managed object was last modified. | def mod_time(self):
return self._mod_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetModTime(self):\n return self.file.ModTime",
"def get_mod_time(self):\n if self.file_meta[:2] == b'bp':\n file_meta_plist = ccl_bplist.load(BytesIO(self.file_meta))\n raw_date_time = file_meta_plist['$objects'][1]['LastModified']\n converted_time = datetime.da... | [
"0.82173115",
"0.76447886",
"0.7612789",
"0.7373698",
"0.7373698",
"0.7351345",
"0.71119905",
"0.71119905",
"0.68961626",
"0.68961626",
"0.68803257",
"0.6858121",
"0.6768353",
"0.67615724",
"0.6739784",
"0.6735192",
"0.67351705",
"0.67061955",
"0.66734195",
"0.66458124",
"0.6... | 0.813919 | 2 |
Gets the moid of this PciSwitch. The unique identifier of this Managed Object instance. | def moid(self):
return self._moid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_mo_id(self):\n return self._device_mo_id",
"def getMcnpId(self):\n raise NotImplementedError",
"def _get_msti_bridge_id(self):\n return self.__msti_bridge_id",
"def getOid(self):\n if self.__state & self.stClean:\n return self.__oid\n else:\n ra... | [
"0.7536716",
"0.70477176",
"0.66772836",
"0.6631365",
"0.662034",
"0.6591366",
"0.6552269",
"0.6549051",
"0.65022385",
"0.64964485",
"0.6493265",
"0.6418782",
"0.6406215",
"0.63400257",
"0.6339248",
"0.6339248",
"0.6339248",
"0.6339248",
"0.6306894",
"0.6306894",
"0.6306894",... | 0.6283842 | 22 |
Sets the moid of this PciSwitch. The unique identifier of this Managed Object instance. | def moid(self, moid):
self._moid = moid | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_mo_id(self, device_mo_id):\n\n self._device_mo_id = device_mo_id",
"def setObjectID(self, id):\n\n self.objectID = id[0]",
"def setIdentity(self) -> None:\n ...",
"def ion_id(self, ion_id):\n\n self._ion_id = ion_id",
"def setObjectID(self, objectid):\n self._o... | [
"0.64672226",
"0.61071706",
"0.5867551",
"0.57829386",
"0.57302964",
"0.5637227",
"0.5617281",
"0.55990374",
"0.5586296",
"0.5580104",
"0.55795133",
"0.55627424",
"0.5562221",
"0.5556127",
"0.5547449",
"0.5539673",
"0.5539323",
"0.5535778",
"0.55293536",
"0.5462279",
"0.54397... | 0.72678304 | 1 |
Gets the object_type of this PciSwitch. The fullyqualified type of this managed object, i.e. the class name. This property is optional. The ObjectType is implied from the URL path. If specified, the value of objectType must match the class name specified in the URL path. | def object_type(self):
return self._object_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def object_type(self) -> str:\n return pulumi.get(self, \"object_type\")",
"def object_type(self) -> str:\n return pulumi.get(self, \"object_type\")",
"def object_type(self) -> str:\n return pulumi.get(self, \"object_type\")",
"def object_type(self) -> str:\n return pulumi.get(sel... | [
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7737721",
"0.7733519",
"0.7733519",
"0.7457514",
"0.7400266",
"0.7400266",
"... | 0.74606985 | 21 |
Sets the object_type of this PciSwitch. The fullyqualified type of this managed object, i.e. the class name. This property is optional. The ObjectType is implied from the URL path. If specified, the value of objectType must match the class name specified in the URL path. | def object_type(self, object_type):
self._object_type = object_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def object_type(self, object_type: str):\n allowed_values = [\"actuator\", \"sensor\", \"human\", \"service\", \"skill\", \"task\", \"action\", \"healthdata\",\n \"humanrole\", \"message\", \"permission\", \"preference\", \"property\"] # noqa: E501\n if object_type not in al... | [
"0.74689245",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.62091756",
"0.61738706",
"0.611745",
"0.611745",
... | 0.776316 | 2 |
Gets the owners of this PciSwitch. The array of owners which represent effective ownership of this object. | def owners(self):
return self._owners | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def owners(self) -> pulumi.Output[Optional[Sequence[str]]]:\n return pulumi.get(self, \"owners\")",
"def owners(self):\n return self.find_users_by_rel('owner')",
"def owners(self):\n return self.properties.get('owners',\n DirectoryObjectCollection(self.con... | [
"0.7081701",
"0.7017931",
"0.68439704",
"0.6685915",
"0.6685915",
"0.628168",
"0.621002",
"0.6157493",
"0.5992977",
"0.5842412",
"0.57837707",
"0.57837707",
"0.57308567",
"0.5714613",
"0.56067383",
"0.5571537",
"0.55058175",
"0.5426715",
"0.54190296",
"0.5396023",
"0.53789026... | 0.7459439 | 1 |
Gets the shared_scope of this PciSwitch. Intersight provides prebuilt workflows, tasks and policies to end users through global catalogs. Objects that are made available through global catalogs are said to have a 'shared' ownership. Shared objects are either made globally available to all end users or restricted to end... | def shared_scope(self):
return self._shared_scope | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fs_sis_shared_space(self):\n return self._fs_sis_shared_space",
"def get_shared_type(self):\n\n\t\treturn self.__shared_type",
"def getSharedVariables(self):\n return self.sharedVariables.copy()",
"def shared_scope(self, shared_scope):\n\n self._shared_scope = shared_scope",
"def s... | [
"0.6131667",
"0.61115617",
"0.57669765",
"0.57204556",
"0.57204556",
"0.5610654",
"0.5555902",
"0.5545472",
"0.5517112",
"0.5484225",
"0.53886074",
"0.53886074",
"0.53886074",
"0.53886074",
"0.53886074",
"0.5364692",
"0.53505737",
"0.5315091",
"0.5315091",
"0.5277567",
"0.527... | 0.7215077 | 1 |
Sets the shared_scope of this PciSwitch. Intersight provides prebuilt workflows, tasks and policies to end users through global catalogs. Objects that are made available through global catalogs are said to have a 'shared' ownership. Shared objects are either made globally available to all end users or restricted to end... | def shared_scope(self, shared_scope):
self._shared_scope = shared_scope | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shared_scope(self):\n return self._shared_scope",
"def shared_scope(self):\n return self._shared_scope",
"def shared_folders(self, shared_folders):\n\n self._shared_folders = shared_folders",
"def set_shared_type(self, shared_type):\n\n\t\tif shared_type is not None and not isinstanc... | [
"0.57403934",
"0.57403934",
"0.56223464",
"0.56053156",
"0.54149973",
"0.5242932",
"0.52103466",
"0.5205537",
"0.52023107",
"0.5165787",
"0.51206183",
"0.5077011",
"0.5062981",
"0.50437695",
"0.5036216",
"0.5027395",
"0.5027129",
"0.49768785",
"0.49099812",
"0.48845208",
"0.4... | 0.75874066 | 1 |
Gets the tags of this PciSwitch. The array of tags, which allow to add key, value metadata to managed objects. | def tags(self):
return self._tags | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tags(self):\n return self.tags",
"def get_tags(self):\n\n return self.tags",
"def getTags(self,):\n\t\treturn self.tags;",
"def tags(self) -> Sequence[str]:\n return pulumi.get(self, \"tags\")",
"def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")",
... | [
"0.72871244",
"0.72264355",
"0.71776426",
"0.71651065",
"0.7111102",
"0.7111102",
"0.7100726",
"0.7100726",
"0.7100726",
"0.7100726",
"0.7100716",
"0.7090668",
"0.70890194",
"0.7046948",
"0.70391196",
"0.7026736",
"0.69416314",
"0.69200355",
"0.6916423",
"0.6881133",
"0.68582... | 0.7065538 | 20 |
Sets the dn of this PciSwitch. The Distinguished Name unambiguously identifies an object in the system. | def dn(self, dn):
self._dn = dn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_ntds_settings_dn(self, ntds_settings_dn):\n dsdb._samdb_set_ntds_settings_dn(self, ntds_settings_dn)",
"def set_label(self, mp, dn):\n for p in self.partition_list:\n if p[0] == mp:\n p[3] = dn",
"def dnb(self, dnb):\n\n self._dnb = dnb",
"def SetDC(self... | [
"0.6226153",
"0.5493173",
"0.54712653",
"0.5259618",
"0.5249272",
"0.51613784",
"0.5152772",
"0.5127094",
"0.50311536",
"0.49918097",
"0.4951567",
"0.4917776",
"0.49147847",
"0.49147847",
"0.49022743",
"0.48470283",
"0.48417428",
"0.48088935",
"0.4802661",
"0.47319624",
"0.47... | 0.76727 | 0 |
Gets the model of this PciSwitch. This field identifies the model of the given component. | def model(self):
return self._model | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model(self):\n return self._device.device_data[self._uuid]['model']",
"def model(self):\n return self._bulb_device.model or self.capabilities.get(\"model\")",
"def _get_model(self) -> str:\n return str(self.hass.data[DOMAIN][self._config_entry.entry_id][ATTR_MODEL])",
"def model(self... | [
"0.76031",
"0.72191864",
"0.7217466",
"0.7158551",
"0.70999134",
"0.69936645",
"0.6970894",
"0.6892782",
"0.6856917",
"0.6847194",
"0.6845608",
"0.684552",
"0.68113923",
"0.67482007",
"0.67482007",
"0.67482007",
"0.67482007",
"0.67482007",
"0.67482007",
"0.67482007",
"0.67482... | 0.6289855 | 41 |
Gets the serial of this PciSwitch. This field identifies the serial of the given component. | def serial(self):
return self._serial | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_serial(self) -> str:\n return self._get_string(openvr.Prop_SerialNumber_String)",
"def getSerial(self):\n\n return self.get_POW().getSerial()",
"def serial_number(self):\n return self._serialno",
"def serial_number(self) -> str:\n return pulumi.get(self, \"serial_number\")... | [
"0.76618683",
"0.74134195",
"0.72831655",
"0.72525257",
"0.7219611",
"0.71774805",
"0.7166393",
"0.7166393",
"0.7142793",
"0.7114071",
"0.709234",
"0.709234",
"0.7053733",
"0.70505875",
"0.70505875",
"0.70247835",
"0.70202595",
"0.7015016",
"0.7003665",
"0.6860254",
"0.676945... | 0.74727714 | 1 |
Gets the vendor of this PciSwitch. This field identifies the vendor of the given component. | def vendor(self):
return self._vendor | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vendor_name(self):\n return self._device.vendor",
"def vendor(self) -> str:\n return self.properties[DBUS_ATTR_VENDOR]",
"def vendor_id(self):\n return self._device.vendor_id",
"def vendorid(self):\n return self._vendorid",
"def vendor_id(self):\n return self._vendor_... | [
"0.77624255",
"0.7653674",
"0.76424897",
"0.7093425",
"0.7072505",
"0.7000978",
"0.6897045",
"0.6594497",
"0.630049",
"0.6258802",
"0.60797405",
"0.5998909",
"0.5988746",
"0.5901482",
"0.5896661",
"0.58628434",
"0.5798469",
"0.57834554",
"0.5742829",
"0.57112926",
"0.56597286... | 0.7605276 | 3 |
Sets the vendor of this PciSwitch. This field identifies the vendor of the given component. | def vendor(self, vendor):
self._vendor = vendor | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vendorid(self, vendorid):\n\n self._vendorid = vendorid",
"def vendor_id(self, vendor_id):\n\n self._vendor_id = vendor_id",
"def vendor(self) -> str:\n return self.properties[DBUS_ATTR_VENDOR]",
"def vendor_name(self):\n return self._device.vendor",
"def vendor(self):\n ... | [
"0.6752885",
"0.6714627",
"0.6459503",
"0.63713557",
"0.62853163",
"0.6255317",
"0.6075294",
"0.579613",
"0.57748306",
"0.55584455",
"0.55048436",
"0.54063314",
"0.538839",
"0.5316498",
"0.52577376",
"0.51986444",
"0.5156424",
"0.5140296",
"0.5040143",
"0.5014028",
"0.4942445... | 0.7603529 | 0 |
Sets the device_id of this PciSwitch. It shows the device id of the switch. | def device_id(self, device_id):
self._device_id = device_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_device(self, device):\n self.device = device",
"def device_id(self, device_id):\n if device_id is None:\n raise ValueError(\"Invalid value for `device_id`, must not be `None`\") # noqa: E501\n\n self._device_id = device_id",
"def setDeviceID(self, id, unitCode=0):\n ... | [
"0.669606",
"0.64275897",
"0.6408661",
"0.63029265",
"0.613332",
"0.6114622",
"0.5926382",
"0.59086215",
"0.58322626",
"0.5828652",
"0.579316",
"0.56635684",
"0.5628597",
"0.5613037",
"0.5607434",
"0.55909014",
"0.5570654",
"0.55702674",
"0.55384594",
"0.55313927",
"0.5507911... | 0.7379557 | 1 |
Gets the pci_address of this PciSwitch. It shows shows the PCI address of switch. | def pci_address(self):
return self._pci_address | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ethernet_switch_address(self):\n return self._props[\"optional\"].get(self._ethernet_switch_prop)",
"def pci_slot(self):\n return self._pci_slot",
"def pci_order(self):\n return \"%s:%s\" % (self.pci_dev, self.sys_dev_port)",
"def physical_address(self):\n return str(self._device.... | [
"0.6329751",
"0.62218595",
"0.6200187",
"0.6068754",
"0.58047974",
"0.5776399",
"0.57576656",
"0.5688168",
"0.5623249",
"0.5604801",
"0.56032187",
"0.5526252",
"0.5476702",
"0.54600674",
"0.5455366",
"0.5455366",
"0.5455366",
"0.5440252",
"0.54359686",
"0.5424832",
"0.5413638... | 0.7825728 | 0 |
Gets the product_name of this PciSwitch. It shows the model information for the switch. | def product_name(self):
return self._product_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_product_name(self):\n system = self._get_host_details()\n return system['Model']",
"def get_product_name(self):\n sushy_system = self._get_sushy_system()\n return sushy_system.model",
"def product(self):\n return self.__values['product_name']",
"def product(self) ->... | [
"0.79224235",
"0.7479676",
"0.7284134",
"0.6997802",
"0.6789596",
"0.6784458",
"0.6745868",
"0.6502802",
"0.64935535",
"0.64398515",
"0.64398515",
"0.63227755",
"0.6313388",
"0.62140274",
"0.6179835",
"0.61203265",
"0.6117179",
"0.60753995",
"0.6072238",
"0.6052387",
"0.60263... | 0.71672326 | 3 |
Sets the product_name of this PciSwitch. It shows the model information for the switch. | def product_name(self, product_name):
self._product_name = product_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_product(self, model, fqname, event_name, key):\r\n self.product.SetLabel(\"%s %s\" % (self.model.article, self.model.sn))",
"def set_received_charges_grid_product_name(self, product_name):\n if product_name != \"\":\n self.set_product(product_name)\n else:\n self... | [
"0.66786844",
"0.64622045",
"0.64434826",
"0.625135",
"0.62430656",
"0.61706746",
"0.61186564",
"0.61186564",
"0.60980505",
"0.60487264",
"0.60317856",
"0.5984787",
"0.59829485",
"0.5911176",
"0.58557326",
"0.58497584",
"0.5832119",
"0.57194567",
"0.5710623",
"0.5681767",
"0.... | 0.7446365 | 0 |
Gets the product_revision of this PciSwitch. It shows the revision for the product. | def product_revision(self):
return self._product_revision | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def revision(self):\n return self._revision",
"def revision(self):\n return self._revision",
"def get_revision(self, ehr_record, version):\n return self.version_manager.get_revision(ehr_record.record_id, version)",
"def get_product_version(self):\n return self.get_attr('product_ve... | [
"0.681922",
"0.681922",
"0.67263114",
"0.66584736",
"0.6653135",
"0.65485823",
"0.6521992",
"0.64784205",
"0.6442322",
"0.642906",
"0.6376165",
"0.634603",
"0.63214767",
"0.618301",
"0.6149994",
"0.6148217",
"0.6139012",
"0.6129547",
"0.61137986",
"0.6092506",
"0.60526067",
... | 0.83489 | 0 |
Sets the product_revision of this PciSwitch. It shows the revision for the product. | def product_revision(self, product_revision):
self._product_revision = product_revision | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_version(self, product_version):\n\n self._product_version = product_version",
"def product_revision(self):\n return self._product_revision",
"def revision(self, revision):\n\n self._revision = revision",
"def revision(self, revision):\n\n self._revision = revision",
... | [
"0.6987804",
"0.69120777",
"0.66963047",
"0.66963047",
"0.62302727",
"0.62302727",
"0.62004894",
"0.61446095",
"0.6134995",
"0.6109497",
"0.60834247",
"0.60834247",
"0.6060173",
"0.5743411",
"0.56762767",
"0.54818565",
"0.5462824",
"0.54612815",
"0.54450095",
"0.5401396",
"0.... | 0.8525715 | 0 |
Gets the type of this PciSwitch. It shows the type inforamtion of switch. | def type(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"type\")",
"def type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"type\")",
"def type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"type\")",
"def type(self) -> pulumi.Output[str]:\n return pul... | [
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346",
"0.69540346"... | 0.0 | -1 |
Gets the vendor_id of this PciSwitch. It shows the vendor id of the switch. | def vendor_id(self):
return self._vendor_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vendor_id(self):\n return self._device.vendor_id",
"def vendorid(self):\n return self._vendorid",
"def VendorId(self):\n\t\treturn self._get_attribute('vendorId')",
"def vendor_name(self):\n return self._device.vendor",
"def vswitch_id(self) -> pulumi.Output[str]:\n return p... | [
"0.7818368",
"0.7783924",
"0.7639705",
"0.6891799",
"0.67953974",
"0.67953974",
"0.67953974",
"0.67905605",
"0.67905605",
"0.67905605",
"0.67905605",
"0.66595054",
"0.65937686",
"0.65552235",
"0.6474454",
"0.62582266",
"0.62582266",
"0.62582266",
"0.61620003",
"0.61620003",
"... | 0.7731614 | 2 |
Sets the vendor_id of this PciSwitch. It shows the vendor id of the switch. | def vendor_id(self, vendor_id):
self._vendor_id = vendor_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vendorid(self, vendorid):\n\n self._vendorid = vendorid",
"def vendorid(self):\n return self._vendorid",
"def vendor_id(self):\n return self._vendor_id",
"def vendor_id(self):\n return self._device.vendor_id",
"def vendor(self, vendor):\n\n self._vendor = vendor",
"... | [
"0.79262173",
"0.6951001",
"0.6859631",
"0.68382907",
"0.678323",
"0.6477189",
"0.577675",
"0.57387656",
"0.56844294",
"0.5641657",
"0.56413406",
"0.55411047",
"0.55314434",
"0.5502202",
"0.54793864",
"0.5276704",
"0.5276704",
"0.5276704",
"0.5276704",
"0.5254104",
"0.5219623... | 0.79240745 | 1 |
Gets the registered_device of this PciSwitch. The Device to which this Managed Object is associated. | def registered_device(self):
return self._registered_device | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_device(self):\n return self.parent.get_device()",
"def get_device(self):\n raise NotImplementedError()",
"def device(self):\n\n\t\treturn self._device",
"def device(self):\n return self._device",
"def device(self):\n hw = self.hw()\n if hw: return hw.device()",
... | [
"0.742656",
"0.7336699",
"0.73293227",
"0.7316465",
"0.7275741",
"0.71657866",
"0.6993961",
"0.6993961",
"0.6993961",
"0.6993961",
"0.6993961",
"0.6868311",
"0.67873496",
"0.6742496",
"0.6723557",
"0.6672859",
"0.66526765",
"0.6600317",
"0.6595047",
"0.65797776",
"0.65692556"... | 0.84275097 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, PciSwitch):
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 |
Split the string on the first nondigit character. | def split_num(s):
i = 0
while i < len(s):
if s[i] < '0' or s[i] > '9':
break
i += 1
if s[i:]:
return (int(s[:i]), s[i:], )
return (int(s[:i]), ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_alnum(s):\n def convert(x):\n try:\n return int(x)\n except ValueError:\n return x\n r = []\n digit = None\n for c in s:\n d = c.isdigit()\n if d != digit:\n digit = d\n r += [c]\n else:\n r[-1] += c\n ... | [
"0.71369797",
"0.6829342",
"0.6682371",
"0.65508556",
"0.64466274",
"0.6394221",
"0.6394221",
"0.6231281",
"0.61990166",
"0.61990166",
"0.61990166",
"0.61990166",
"0.61141384",
"0.6093439",
"0.608187",
"0.59330356",
"0.5928559",
"0.5928559",
"0.5862075",
"0.5852437",
"0.58090... | 0.6945367 | 1 |
Get the template name for the current request | def get_template_name(request, base_template_name):
template_base_dir = get_template_base_directory(request)
return f"cast/{template_base_dir}/{base_template_name}" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def template_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"template_name\")",
"def inspect_template_name(self) -> str:\n return pulumi.get(self, \"inspect_template_name\")",
"def template_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"template_name\")... | [
"0.81386393",
"0.80851495",
"0.80360377",
"0.80052745",
"0.7789843",
"0.77682555",
"0.7721727",
"0.7664725",
"0.76205105",
"0.7592634",
"0.7592634",
"0.74705166",
"0.74541646",
"0.74343765",
"0.733828",
"0.73081017",
"0.71104914",
"0.71024334",
"0.7069157",
"0.7045875",
"0.70... | 0.75843847 | 11 |
Just call the default page_not_found view, but with a custom template | def page_not_found(request, exception):
return defaults.page_not_found(request, exception, template_name=get_template_name(request, "404.html")) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page_not_found():\n return render_template(\"errors/404.html\"), 404",
"def page_not_found(e):\n return render_template('404.html')",
"def page_not_found(e):\n return render_template(\"404.html\", page_title=404)",
"def page_not_found(request, exception): # noqa\n return render(request, 'mis... | [
"0.8616379",
"0.856645",
"0.8550328",
"0.84541804",
"0.84324586",
"0.84324586",
"0.8421552",
"0.8410528",
"0.84085643",
"0.84066546",
"0.83382547",
"0.82927036",
"0.82714987",
"0.82670146",
"0.82378745",
"0.8184889",
"0.80407125",
"0.8009587",
"0.79788846",
"0.7963538",
"0.79... | 0.8753066 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.