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"""VGG 13layers model (configuration "B") from | def vgg13(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
return _vgg('vgg13', 'B', False, pretrained, progress, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vgg16_bn(pretrained,**kwargs):\n model = VGG(make_layers(cfg['D'], batch_norm=True), **kwargs)\n if pretrained:\n model_dict = paddle.load('./pre_model/vgg16_bn.paddle')\n model.set_state_dict(model_dict)\n return model",
"def build_vgg():\n input_shape = (256, 256, 3)\n\n vgg = ... | [
"0.7486823",
"0.74588525",
"0.72466743",
"0.7236979",
"0.720446",
"0.7148995",
"0.70846766",
"0.70270526",
"0.7020071",
"0.6964951",
"0.6958259",
"0.6897099",
"0.6850254",
"0.68302625",
"0.67775416",
"0.67447203",
"0.6693358",
"0.66475105",
"0.6619898",
"0.6617245",
"0.661391... | 0.6269088 | 40 |
r"""VGG 16layers model (configuration "D") from | def vgg16(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
return _vgg('vgg16', 'D', False, pretrained, progress, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vgg16(pretrained=False, **kwargs):\n if pretrained:\n kwargs['init_weights'] = False\n model = VGG(make_layers(cfg['D']), **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['vgg16']), strict=False)\n return model",
"def vgg16(pretrained=False, **kwargs)... | [
"0.77429366",
"0.7693995",
"0.7606729",
"0.7263396",
"0.72623867",
"0.7207521",
"0.7168756",
"0.70680714",
"0.70441335",
"0.6985597",
"0.6936568",
"0.68743557",
"0.6858933",
"0.68355286",
"0.6832327",
"0.68227834",
"0.68008953",
"0.67717355",
"0.6717667",
"0.67070454",
"0.670... | 0.67197424 | 18 |
r"""VGG 19layers model (configuration "E") from | def vgg19(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
return _vgg('vgg19', 'E', False, pretrained, progress, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_vgg():\n input_shape = (256, 256, 3)\n\n vgg = keras.applications.VGG19(include_top = False , input_shape = input_shape , weights=\"imagenet\")\n features = vgg.get_layer(index = 9).output\n\n model = keras.Model(inputs=[vgg.inputs], outputs=[features])\n return model",
"def build_vgg(s... | [
"0.74924934",
"0.7319148",
"0.7145171",
"0.70746773",
"0.7020434",
"0.6926659",
"0.690226",
"0.68943894",
"0.6889697",
"0.68787706",
"0.6815616",
"0.6800649",
"0.67994547",
"0.6698768",
"0.6625305",
"0.6566188",
"0.6533605",
"0.6508166",
"0.65050346",
"0.64324456",
"0.6399184... | 0.5774416 | 64 |
r"""VGG 19layers model (configuration "E") with batch normalization | def vgg19_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
return _vgg('vgg19_bn', 'E', True, pretrained, progress, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def VGGModel(input_shape):\n \n\n X_input = Input(input_shape)\n \n # Creating a Neural Network (VGG-16)\n\n X = Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv1')(X_input)\n X = Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv2')(X)\n X = MaxPool... | [
"0.662741",
"0.65719354",
"0.6532577",
"0.65323454",
"0.64933974",
"0.64326143",
"0.635741",
"0.6335911",
"0.633384",
"0.63284695",
"0.6278508",
"0.6277828",
"0.62567395",
"0.62092257",
"0.6134604",
"0.61338764",
"0.61234397",
"0.6112209",
"0.60979193",
"0.60795146",
"0.60750... | 0.0 | -1 |
Tokenize given unicode text. Yields each tokenized token, start position(in bytes), end positon(in bytes) | def tokenize(text):
yield text, 0, len(text.encode('utf-16')) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tokenize(self, start_pos=0, text=None):\n pass",
"def tokenize(self, text):\n\n text = convert_to_unicode(text)\n\n output_tokens = []\n for token in whitespace_tokenize(text):\n chars = list(token)\n if len(chars) > self.max_input_chars_per_word:\n output_tokens.append(self.unk_... | [
"0.67784",
"0.67445844",
"0.6567504",
"0.6531172",
"0.6478306",
"0.64667165",
"0.63384664",
"0.6332699",
"0.62861294",
"0.62740296",
"0.62372845",
"0.6227073",
"0.6212162",
"0.6174753",
"0.61692184",
"0.6167863",
"0.6123513",
"0.61219573",
"0.61181265",
"0.61022246",
"0.60889... | 0.7623063 | 0 |
The update time timestamp. | def update_time(self) -> str:
return pulumi.get(self, "update_time") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_update_time(self):\n return self._last_update_time",
"def update_time(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"update_time\")",
"def update_time(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"update_time\")",
"def update_time(self) -> pulumi.Output[str]... | [
"0.8406034",
"0.82378316",
"0.82378316",
"0.82378316",
"0.82378316",
"0.82378316",
"0.82378316",
"0.82378316",
"0.82378316",
"0.82329196",
"0.81739056",
"0.7998141",
"0.78888774",
"0.7874642",
"0.7874642",
"0.78073496",
"0.7801909",
"0.77354795",
"0.7700679",
"0.76856",
"0.76... | 0.8717642 | 7 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, DepositCompleteResponse):
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 |
Proximal operator for joint covariance estimation | def joint_cov_prox(Y, nu, theta, t):
if Y is None:
return nu
n, nk = Y[0].shape
Yemp = Y[0]@Y[0].T
s, Q = np.linalg.eigh(nu/(t*nk)-Yemp/nk)
w = ((t*nk)*s + np.sqrt(((t*nk)*s)**2 + 4*(t*nk)))/2
return Q @ np.diag(w) @ Q.T | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_covariance(self):\n ...",
"def postfit_covariance(self) -> NONEARRAY:\n pass",
"def _posterior_covariance(self, X):\n if isinstance(X, np.ndarray):\n X = pd.DataFrame(X, index=[str(i) for i in range(len(X))])\n cov = self.kernel.make_K(X, hypers=self.hypers)\n ... | [
"0.6625411",
"0.63998413",
"0.6283477",
"0.6253421",
"0.6161595",
"0.612452",
"0.60660034",
"0.60641295",
"0.60290426",
"0.602661",
"0.6013919",
"0.59484684",
"0.5932052",
"0.5868303",
"0.5864781",
"0.5846607",
"0.58416504",
"0.5814043",
"0.5804478",
"0.5794451",
"0.57800406"... | 0.6495126 | 1 |
Proximal operator for joint covariance estimation | def prox(self, t, nu, warm_start, pool, cache):
res = pool.starmap(joint_cov_prox, zip(cache["Y"], nu, warm_start, t*np.ones(cache["K"])))
return np.array(res) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_covariance(self):\n ...",
"def joint_cov_prox(Y, nu, theta, t):\n if Y is None:\n return nu\n\n n, nk = Y[0].shape\n Yemp = Y[0]@Y[0].T\n \n s, Q = np.linalg.eigh(nu/(t*nk)-Yemp/nk)\n w = ((t*nk)*s + np.sqrt(((t*nk)*s)**2 + 4*(t*nk)))/2\n return Q @ np.diag(w) @ Q.T",
... | [
"0.6625411",
"0.6495126",
"0.63998413",
"0.6283477",
"0.6253421",
"0.6161595",
"0.612452",
"0.60641295",
"0.60290426",
"0.602661",
"0.6013919",
"0.59484684",
"0.5932052",
"0.5868303",
"0.5864781",
"0.5846607",
"0.58416504",
"0.5814043",
"0.5804478",
"0.5794451",
"0.57800406",... | 0.60660034 | 7 |
Return a readable representation of an invitation. | def __repr__(self):
return '<Invitation %r>' % self.id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_invitation_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"user_invitation_id\")",
"def __repr__(self):\n return '<{}>'.format(self.email)",
"def __repr__(self):\n\n return \"<%s requested to be friends with %s and the status is %s>\" % (self.requester.name, self.accep... | [
"0.58534473",
"0.57448477",
"0.5699492",
"0.56027234",
"0.5544841",
"0.55092865",
"0.54728633",
"0.5469071",
"0.5465524",
"0.5459138",
"0.5437851",
"0.5429522",
"0.5423583",
"0.5411073",
"0.5381086",
"0.53611654",
"0.533922",
"0.533922",
"0.5323252",
"0.53232306",
"0.5312983"... | 0.7722583 | 0 |
Return a JSONencoded representation of an invitation. | def serialize(self):
return {
'id': self.id,
'code': self.code,
'email': self.email,
'status': self.status.value,
'organization_id': self.organization_id
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n return '<Invitation %r>' % self.id",
"def json(self):\n return {\n 'id': self.id,\n 'email': self.email,\n 'username': self.username\n }",
"def as_json(self):\n return {\n 'id': self.id,\n 'jti': self.jti,\... | [
"0.69491315",
"0.60443646",
"0.6011086",
"0.59985125",
"0.5883783",
"0.58825785",
"0.5836389",
"0.58355486",
"0.5774575",
"0.57718086",
"0.57450587",
"0.57294893",
"0.5728438",
"0.5728438",
"0.5728438",
"0.5712919",
"0.57122076",
"0.5708827",
"0.5702355",
"0.56938404",
"0.569... | 0.5571913 | 55 |
Determines if Spotify is currently running. Returns | def spotify_running():
stdout = (
subprocess.check_output(["osascript", "-e", 'application "Spotify" is running'])
.decode("utf-8")
.strip()
)
return stdout == "true" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_running(self):\n\t\treturn self._running",
"def is_running(self):\n return self.running",
"def is_running(self):\n return self.running",
"def is_running(self):\n return self.running",
"def is_running(self):\n\t\treturn self in _running",
"def is_running(self):\n qstat =... | [
"0.7485294",
"0.74583983",
"0.74583983",
"0.74583983",
"0.73877585",
"0.73770356",
"0.7358338",
"0.7355542",
"0.7355542",
"0.73219174",
"0.73219174",
"0.72924125",
"0.7276731",
"0.7273043",
"0.72289425",
"0.71902716",
"0.71661615",
"0.7159283",
"0.7151589",
"0.7058568",
"0.70... | 0.8088447 | 0 |
Various asserts to enforce CLI arguments passed are valid. | def assert_argument_vals(args, valid_voices):
assert (
args.volume >= 0 and args.volume <= 100
), "Please provide a volume between [0, 100]."
assert not args.memos or (
args.memos and os.path.exists(args.memos)
), "File path to memos does not exist."
assert not args.after_num_plays... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_invalid_arguments(self):\n # More than two arguments should report an error.\n exit_code, output = run_cli('a', 'b', 'c')\n assert exit_code != 0\n assert \"Error\" in output\n # Invalid `ionice' values should report an error.\n exit_code, output = run_cli('--ioni... | [
"0.80039465",
"0.7776947",
"0.7712777",
"0.7522933",
"0.7512567",
"0.7323644",
"0.72140616",
"0.720253",
"0.7150128",
"0.71396214",
"0.71379906",
"0.7124213",
"0.71075547",
"0.70802087",
"0.7078179",
"0.7039676",
"0.7034683",
"0.7022317",
"0.7020104",
"0.7005434",
"0.6996072"... | 0.73047763 | 6 |
Returns a partial child of TorchMultiActionDistribution. This is useful if inputs needed to instantiate the Distribution from logits are available, but the logits are not. | def get_partial_dist_cls(
parent_cls: "Distribution", **partial_kwargs
) -> "Distribution":
class DistributionPartial(parent_cls):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@staticmethod
def _merge_kwargs(**kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __mul__(self, dist):\n return CombinedDistribution(self, dist, mul)",
"def _gen_behaviour(self, params: Tensor) -> Distribution:\n # TODO: check for parameter size mismatches\n # TODO: support params being for multiple different distributions\n\n if len(params.size()) == 1:\n ... | [
"0.60351723",
"0.5910864",
"0.5807054",
"0.5802042",
"0.5508554",
"0.5449978",
"0.5427169",
"0.53182995",
"0.5258739",
"0.5239391",
"0.51076514",
"0.50938547",
"0.50759965",
"0.50657386",
"0.50638276",
"0.50280243",
"0.5024097",
"0.50144297",
"0.5009604",
"0.5009601",
"0.5006... | 0.53079355 | 8 |
Checks if keys in kwargs don't clash with partial_kwargs. | def _merge_kwargs(**kwargs):
overlap = set(kwargs) & set(partial_kwargs)
if overlap:
raise ValueError(
f"Cannot override the following kwargs: {overlap}.\n"
f"This is because they were already set at the time this "
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_kwargs(self, kwargs):\n pass",
"def __checkArgs(self, kwargs):\n requiredArgs = self.__class__.__requiredArgs + \\\n self.__class__.__singleCompArgs if self.singleComp else\\\n self.__class__.__requiredArgs + self.__class__.__doubleCompArgs\n for arg in requir... | [
"0.72764003",
"0.69780177",
"0.6821087",
"0.66674685",
"0.65958565",
"0.6464477",
"0.64453214",
"0.64123327",
"0.6407427",
"0.6297525",
"0.6290569",
"0.6231274",
"0.617673",
"0.6158453",
"0.61378556",
"0.61098105",
"0.6071511",
"0.6054759",
"0.60500556",
"0.60269207",
"0.5970... | 0.6794489 | 3 |
Returns a regular grid with the values of the 3d nodes in the list. The grid is a copy only. Grid points not belonging to the object are assigned a value of NaN. Nodes that are not 3d will be ignored. If there are no 3d nodes, returns a 0x0x0 numpy array. | def value_to_grid(self):
import numpy
from .node import Node3D
# identify regions involved
regions = set()
for node in self:
if isinstance(node, Node3D):
regions.add(node.region)
# default result that falls through if no regions
resul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_grid_np(self):\n\n self.grid_np = [None for i in range(GRID_HEIGHT*GRID_HEIGHT*MAX_CELL_SIZE)]\n grid = self.grid_np\n # cell_size = self.cell_size\n for obj in self.levels[self.curient_level].objects:\n obj.position_grid[X], obj.position_grid[Y] = get_grid_xy(obj.po... | [
"0.61277854",
"0.6113065",
"0.60486025",
"0.59722894",
"0.59692824",
"0.5890724",
"0.5834897",
"0.58036214",
"0.57802176",
"0.5773366",
"0.5717409",
"0.5693001",
"0.56510746",
"0.5635136",
"0.55936784",
"0.5542423",
"0.5541467",
"0.5529994",
"0.55268055",
"0.54849726",
"0.547... | 0.6014039 | 3 |
Deletes up to the last 100 messages sent by the bot in the given channel | async def delete_bot_msg(self, channel):
await channel.purge(limit=100, check=self.is_me) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def channel(self, ctx, limit: int=100, channel: discord.TextChannel=None):\n\n if channel is None:\n channel = ctx.channel\n\n # noinspection PyUnresolvedReferences\n messages = await channel.purge(limit=limit)\n messages = len(messages)\n\n plural = '' if messag... | [
"0.7355912",
"0.729578",
"0.70187694",
"0.6925003",
"0.67768085",
"0.657592",
"0.6565491",
"0.6511749",
"0.6507969",
"0.64933234",
"0.6464555",
"0.64189345",
"0.6397884",
"0.63753015",
"0.6356237",
"0.63543326",
"0.634485",
"0.6288775",
"0.62868375",
"0.6278073",
"0.6273905",... | 0.7999235 | 0 |
A list of VersionedTargetSet objects, one per target. Targets are in topological order, that is if B depends on A then B comes after A in the list. | def all_versioned_targets(self):
return self._all_versioned_targets | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_targets(self):\n return self._combined_all_versioned_targets.targets",
"def _order_target_list(self, targets):\r\n targets = set(t for t in targets if isinstance(t, Target))\r\n return filter(targets.__contains__, reversed(InternalTarget.sort_targets(targets)))",
"def targets(self):\n\n ... | [
"0.69259644",
"0.6516053",
"0.64394027",
"0.64272714",
"0.6228954",
"0.6228795",
"0.6192821",
"0.61541504",
"0.6113445",
"0.6055971",
"0.6016262",
"0.59926796",
"0.5955804",
"0.59527117",
"0.5946635",
"0.5926969",
"0.5889222",
"0.5827486",
"0.5827364",
"0.5804093",
"0.5771140... | 0.678274 | 1 |
A list of all underlying targets, in topological order. | def all_targets(self):
return self._combined_all_versioned_targets.targets | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Targets(self):\n return self._targets",
"def all_targets(self):\n \n # Load the most up-to-date targets of the 'targets' role and all\n # delegated roles.\n self._refresh_targets_metadata(include_delegations=True)\n \n all_targets = []\n # Fetch the targets for the 'targets' role.\n ... | [
"0.7495705",
"0.7448819",
"0.7436363",
"0.7360696",
"0.7281494",
"0.72555256",
"0.7223903",
"0.72016346",
"0.7113758",
"0.7044837",
"0.69220054",
"0.69173354",
"0.69015574",
"0.68946445",
"0.68486214",
"0.6774925",
"0.6737662",
"0.6633021",
"0.6633021",
"0.6573797",
"0.655780... | 0.77213824 | 0 |
A list of all underlying targets that are invalid, in topological order. | def invalid_targets(self):
return self._combined_invalid_versioned_targets.targets | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_targetnodes(self):\n\n self.connect_backwards()\n\n targetnodes = []\n for n in self.find_datanodes():\n if len(n.receives_from) > 0:\n targetnodes.append(n)\n return targetnodes",
"def all_targets(self):\n return self._combined_all_versioned_targ... | [
"0.6499179",
"0.6400803",
"0.6313432",
"0.6307213",
"0.6277269",
"0.62239766",
"0.6200468",
"0.6158609",
"0.60925174",
"0.6077037",
"0.6068353",
"0.601936",
"0.6012095",
"0.6006405",
"0.6006405",
"0.60043997",
"0.59545773",
"0.59121513",
"0.5858036",
"0.5839813",
"0.58315814"... | 0.7527887 | 0 |
Returns a dictionary with only the elements of this enum that has a negative value >>> from itertools import islice >>> negative = SIUnit.get_negative() >>> inc = iter(negative.items()) >>> dict(islice(inc, len(negative) // 2)) | def get_negative(cls: type[T]) -> dict:
return {unit.name: unit.value for unit in cls if unit.value < 0} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_positive(cls: type[T]) -> dict:\n return {unit.name: unit.value for unit in cls if unit.value > 0}",
"def __getstate__(self):\n exclude_keys = ['_is_zero', '_is_positive', '_is_nonneg']\n state = {}\n for key,value in self.__dict__.items():\n if key in exclude_keys:... | [
"0.64682883",
"0.5888617",
"0.5676901",
"0.53898317",
"0.5385515",
"0.5332944",
"0.5318118",
"0.5295327",
"0.5207162",
"0.5199862",
"0.517473",
"0.51484406",
"0.51057535",
"0.50831985",
"0.5039933",
"0.49792072",
"0.49618086",
"0.49249363",
"0.48743483",
"0.48735127",
"0.4853... | 0.74331725 | 0 |
Adds a new edge to the graph between `fst` and `snd` of weight `weight`. There is an option to make the new edge twoway (`twoway=True`). | def add_edge(self, fst: int, snd: int, weight: float=1.):
# assert - nodes' labels has to be between `1` and `nodes_count`
if fst >= self.__nodes_count or snd >= self.__nodes_count:
raise Exception(
'node label exceed maximum number of nodes in graph')
# add a new ed... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_edge(self, n1, n2, weight):\n self.edges[n1.identifier][n2.identifier] = weight\n self.edges[n2.identifier][n1.identifier] = weight",
"def add_edge(self, n1, n2, weight):\n self.edges[n1.identifier][n2.identifier] = weight",
"def add_edge(self, item1: Any, item2: Any, weight: Union... | [
"0.7189628",
"0.71724844",
"0.69349855",
"0.68738526",
"0.685426",
"0.6811757",
"0.66733885",
"0.6668175",
"0.6655825",
"0.6651611",
"0.6649225",
"0.6604694",
"0.6551046",
"0.6516691",
"0.6457827",
"0.6446842",
"0.64372253",
"0.642715",
"0.6384897",
"0.6384338",
"0.630078",
... | 0.77528375 | 0 |
Return the weight of the given edge. If `twoway` then edges the nodes' order will be ignored. | def get_edge_weight(self, fst: int, snd: int, twoway=False) -> float:
if fst == snd:
return 0
try:
def f(e): return e.fst == fst and e.snd == snd
if twoway:
def f(e): return (e.fst == fst and e.snd == snd)\
or (e.fst == snd and e.s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weight(self, edge):\n \n return self._weights[frozenset(edge)]",
"def edge_weight(edge):\n return distance(edge.orig, edge.dest)",
"def get_edge_weight(self, vertex1, vertex2):\n if not self.is_weighted():\n print(\"WARNING: Graph is NOT weighted!\")\n return N... | [
"0.75678617",
"0.7451356",
"0.72742873",
"0.70510006",
"0.6970484",
"0.69384897",
"0.67252535",
"0.65913874",
"0.6574262",
"0.63925576",
"0.63140476",
"0.6289355",
"0.6036671",
"0.5886904",
"0.5853712",
"0.5830674",
"0.5801267",
"0.5800612",
"0.5768085",
"0.5744175",
"0.57032... | 0.7445505 | 2 |
Returns the node grid indices, one per point. Points that are not on the node grid will have an index of 1 If a single point is passed in, a single index will be returned. If a sequence of points is passed in an array of indexes will be returned. | def locate_faces(points, grid):
points = np.asarray(points, dtype=np.float64)
just_one = (points.ndim == 1)
points = points.reshape(-1, 2)
tree = build_celltree(grid)
indices = tree.locate(points)
lon, lat = self._get_grid_vars(grid)
x = indices % (lat.shape[1] - 1)
y = indices // (lat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_neighbors(grid, x, y):\n out = []\n if x > 0:\n out.append(grid[x-1, y])\n if y > 0:\n out.append(grid[x, y-1])\n if y < grid.shape[1] - 1:\n out.append(grid[x, y+1])\n if x < grid.shape[0] - 1:\n out.append(grid[x+1, y])\n return out",
"def getContainingGrid... | [
"0.65198195",
"0.6494832",
"0.64802814",
"0.6446189",
"0.6312183",
"0.63078487",
"0.63023275",
"0.62496895",
"0.6246124",
"0.62280476",
"0.6219807",
"0.6164356",
"0.6119822",
"0.6115523",
"0.6101948",
"0.6079977",
"0.605519",
"0.60533667",
"0.60337543",
"0.60109633",
"0.60091... | 0.56326854 | 86 |
Step function takes as input the action, which is a list of integers, and output the next obervation, reward, and a Boolean variable indicating whether the current game is finished. It also returns an empty dictionary that is reserved to pass useful information. | def step(self, action):
assert action in self.infoset.legal_actions
self.players[self._acting_player_position].set_action(action)
self._env.step()
self.infoset = self._game_infoset
done = False
reward = 0.0
if self._game_over:
done = True
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def step(self, action):\n\n ob = self.sendCmd(self.url, self.actions_list[action])\n print(\"ob -> {}\".format(ob['obsequium']))\n\n self.obsequium = int(ob[\"obsequium\"])\n self.bonus = int(ob[\"bonus\"])\n\n # we need to check is make sense finish it\n if self.is_ga... | [
"0.8119865",
"0.8073929",
"0.7913856",
"0.78879315",
"0.7868532",
"0.78615004",
"0.78235114",
"0.780631",
"0.7747067",
"0.7745747",
"0.7740992",
"0.7727458",
"0.7653722",
"0.7631124",
"0.76214784",
"0.7573789",
"0.7573219",
"0.7531077",
"0.7525722",
"0.75173557",
"0.74996334"... | 0.7840265 | 6 |
The player that is active. It can be landlord, landlod_down, or landlord_up. | def _acting_player_position(self):
return self._env.acting_player_position | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def player(self):\n return self.current.player",
"def get_current_player(self):\n return self.current_player",
"def get_current_player(self) :\n return self.current_player",
"def getCurrentPlayer(self):\r\n return self.currentPlayer",
"def player(self):\n return self._pla... | [
"0.70462275",
"0.6963425",
"0.69560194",
"0.6921606",
"0.69144255",
"0.6807876",
"0.6795035",
"0.6766235",
"0.6766235",
"0.6752221",
"0.6621652",
"0.6601327",
"0.65893203",
"0.6552264",
"0.65430504",
"0.6449663",
"0.6420854",
"0.638816",
"0.6378612",
"0.6236307",
"0.62349564"... | 0.58410406 | 46 |
Pytorch implementation of the Frechet Distance. The Frechet distance between two multivariate Gaussians X_1 ~ N(mu_1, C_1) and X_2 ~ N(mu_2, C_2) is d^2 = ||mu_1 mu_2||^2 + Tr(C_1 + C_2 2sqrt(C_1C_2)). Stable version by Dougal J. Sutherland. | def calculate_frechet_distance(mu1, mu2, sigma1, sigma2, eps=1e-6):
mu1 = np.atleast_1d(mu1)
mu2 = np.atleast_1d(mu2)
sigma1 = np.atleast_2d(sigma1)
sigma2 = np.atleast_2d(sigma2)
assert mu1.shape == mu2.shape, \
'Training and test mean vectors have different lengths'
assert sigma1.sha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_frechet_distance(mu1, sigma1, mu2, sigma2, eps=1e-6,\n use_torch=False):\n\n if use_torch:\n assert mu1.shape == mu2.shape, \\\n 'Training and test mean vectors have different lengths'\n assert sigma1.shape == sigma2.shape, \\\n 'Tr... | [
"0.76174915",
"0.7207137",
"0.7205647",
"0.7175768",
"0.7175768",
"0.7175768",
"0.713519",
"0.7101911",
"0.67504716",
"0.64195573",
"0.63985676",
"0.63251626",
"0.62030023",
"0.6146314",
"0.61347544",
"0.61153895",
"0.6092923",
"0.6020774",
"0.5984842",
"0.5929784",
"0.591653... | 0.71966225 | 3 |
Create a new quaternion signal. | def __init__(self, name, times, w, x, y, z):
w = numpy.array(w)
x = numpy.array(x)
y = numpy.array(y)
z = numpy.array(z)
assert len(w.shape) == 1
assert len(x.shape) == 1
assert len(y.shape) == 1
assert len(z.shape) == 1
values = numpy.vstack([w, x... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quaternion(self, name, q):\n R = self.R(name=name, q=q)\n quat = transformations.unit_vector(\n transformations.quaternion_from_matrix(matrix=R))\n return quat",
"def _rotate_quaternion(self, q):\n self._normalise()\n return self * q * self.conjugate",
"def ran... | [
"0.70448464",
"0.6589935",
"0.6466133",
"0.6419589",
"0.64134055",
"0.6389834",
"0.63560164",
"0.6335024",
"0.6269011",
"0.6266909",
"0.6261823",
"0.6226468",
"0.6206364",
"0.6160217",
"0.61542875",
"0.6138768",
"0.6138098",
"0.61309123",
"0.61260825",
"0.6115526",
"0.6034574... | 0.68315375 | 1 |
Promote a point signal to quaternion. | def from_cartesian(cartesian_signal):
name = "quat({})".format(cartesian_signal.name)
times = cartesian_signal.times
w = numpy.zeros(len(times))
x = cartesian_signal.values[:, 0]
y = cartesian_signal.values[:, 1]
z = cartesian_signal.values[:, 2]
return Quaternion... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def qrotate(points, axis, theta):\n q = Quaternion.rotator(axis, theta)\n return q.rotate(points)",
"def point_rotation_by_quaternion(v, q):\r\n r = [0] + v\r\n q_conj = [q[0], -q[1], -q[2], -q[3]]\r\n return quaternion_product(quaternion_product(q, r), q_conj)[1:]",
"def _rotate_quatern... | [
"0.62891686",
"0.61973786",
"0.60139513",
"0.57476604",
"0.56804264",
"0.56732714",
"0.562738",
"0.5567795",
"0.55519056",
"0.55310965",
"0.55095065",
"0.54813504",
"0.54464185",
"0.5411445",
"0.5397509",
"0.53943837",
"0.5338879",
"0.53253824",
"0.5304156",
"0.5279653",
"0.5... | 0.0 | -1 |
sets the baseline minimum energy and maximum energy | def find_min_max(model, n_times=200):
rand_point = model.any(model)
max_e = rand_point.energy
for _ in xrange(n_times):
rand_point = model.any(model)
if rand_point.energy > max_e: max_e = rand_point.energy
return max_e | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_low_high_value(self):\n # do not apply scaler norm on not scalable data\n self.range_dict.clear()\n\n for data_name in self.dict_to_plot.keys():\n if self.quantitative_normalization:\n # Quantitative normalization\n data_arr, _ = self.img_model_... | [
"0.631815",
"0.62409806",
"0.6188128",
"0.6158496",
"0.613987",
"0.6103026",
"0.6087928",
"0.606811",
"0.6012845",
"0.59674263",
"0.59442365",
"0.58945674",
"0.5828538",
"0.5804591",
"0.5804591",
"0.5788084",
"0.5787026",
"0.57770914",
"0.5755498",
"0.5753679",
"0.57376087",
... | 0.0 | -1 |
Test a status ds with an unknown element. | def test_scp_callback_return_dataset_unknown(self):
self.scp = DummyVerificationSCP()
self.scp.status = Dataset()
self.scp.status.Status = 0x0001
self.scp.status.PatientName = 'test name'
self.scp.start()
ae = AE()
ae.add_requested_context(VerificationSOPClass)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_status_missing(self):\n measurement = Measurement(self.metric())\n self.assertEqual(None, measurement.status())",
"def test_id_missing(self) -> None:\n with pytest.raises(NotFound):\n ObservationType.from_id(-1)",
"def test_no_such_key():\n test = [{'key': 'val1'}, [... | [
"0.65897083",
"0.6283",
"0.6234246",
"0.61931133",
"0.6106065",
"0.6091523",
"0.60776335",
"0.5995418",
"0.5974757",
"0.59469473",
"0.5910711",
"0.58696675",
"0.58375835",
"0.5836437",
"0.5810365",
"0.5809169",
"0.5804393",
"0.57658935",
"0.57550055",
"0.57516927",
"0.5730022... | 0.0 | -1 |
Test a status ds with an unknown element. | def test_scp_handler_return_dataset_unknown(self):
def handle(event):
status = Dataset()
status.Status = 0x0001
status.PatientName = 'test name'
return status
handlers = [(evt.EVT_C_ECHO, handle)]
self.ae = ae = AE()
ae.add_supported_cont... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_status_missing(self):\n measurement = Measurement(self.metric())\n self.assertEqual(None, measurement.status())",
"def test_id_missing(self) -> None:\n with pytest.raises(NotFound):\n ObservationType.from_id(-1)",
"def test_no_such_key():\n test = [{'key': 'val1'}, [... | [
"0.65897083",
"0.6283",
"0.6234246",
"0.61931133",
"0.6106065",
"0.6091523",
"0.60776335",
"0.5995418",
"0.5974757",
"0.59469473",
"0.5910711",
"0.58696675",
"0.58375835",
"0.5836437",
"0.5810365",
"0.5809169",
"0.5804393",
"0.57658935",
"0.57550055",
"0.57516927",
"0.5730022... | 0.0 | -1 |
constructs a string from the self.deck list | def __str__(self):
res = []
for card in self.cards:
res.append(str(card))
return "\n".join(res) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\r\n result = \"\"\r\n for s in self.__deck:\r\n result = result + str(s) + '\\n'\r\n return result",
"def __str__(self):\n res = []\n for card in self.deckcards:\n res.append(str(card))\n return '\\n'.join(res)",
"def __str__(se... | [
"0.8113899",
"0.7725953",
"0.7603377",
"0.75272524",
"0.7473211",
"0.7412785",
"0.7314949",
"0.7258728",
"0.71494055",
"0.705681",
"0.70290315",
"0.7005794",
"0.7005794",
"0.6996145",
"0.69002897",
"0.68944305",
"0.68193346",
"0.68116957",
"0.6579193",
"0.65770364",
"0.655337... | 0.70202625 | 11 |
Login user via this API. This API returns a token with which clients can authenticate. | def post(self):
args = login_parser.parse_args()
username = args['username']
password = args['password']
user = get_user_or_404(username)
token = try_login_user(user, password)
ret = {
'expire': current_app.config['AUTH_TOKEN_EXPIRE'],
'token': to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login_user(self):\n response = self.client.post(self.login_url, self.login_data, format='json')\n return response.data['token']",
"def login(self, user_name, password):\n end_point = '/'.join([self.host, 'api', 'rest-auth', 'login', ''])\n resp = requests.post(end_point, {'usernam... | [
"0.8727277",
"0.788497",
"0.7860386",
"0.7842559",
"0.76326376",
"0.75793135",
"0.7551093",
"0.7541111",
"0.7520471",
"0.75141275",
"0.747947",
"0.7461422",
"0.74609375",
"0.74277693",
"0.7343015",
"0.73235005",
"0.7319646",
"0.7285269",
"0.7285269",
"0.7278955",
"0.7265719",... | 0.7263096 | 21 |
If pos and org are None, returns True if this user can in principle create other users and False otherwise. Otherwise, returns True if user can create a user with the give position and organization, else False. | def allowed_user_access_create(user, pos=None, org=None):
if not user.has_perm("auth.add_user"):
return False
if pos is None and org is not None:
raise ValueError("Either pos and org must both be None, or neither must be None")
if pos is not None and org is None:
raise ValueError("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_organization_access_create(user):\n return user.has_perm(\"vnswww.add_organization\")",
"def allowed_user_access_create_different_org(user):\n return user.has_perm(\"vnswww.userprofile_create_different_org\")",
"def allowed_group_access_create(user, org=None):\n try:\n up = user.get... | [
"0.6795992",
"0.6794807",
"0.66490966",
"0.64185756",
"0.6088277",
"0.60860693",
"0.6083735",
"0.5905645",
"0.5905645",
"0.5898675",
"0.56989825",
"0.56660813",
"0.5635126",
"0.5613989",
"0.5595087",
"0.55335116",
"0.5525625",
"0.54935664",
"0.5484369",
"0.5458122",
"0.544947... | 0.7674742 | 0 |
Returns True if the user can in principle create users at organizations other than their own organization. | def allowed_user_access_create_different_org(user):
return user.has_perm("vnswww.userprofile_create_different_org") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_organization_access_create(user):\n return user.has_perm(\"vnswww.add_organization\")",
"def is_organization(self):\n return self.user_id is None",
"def allowed_group_access_create(user, org=None):\n try:\n up = user.get_profile()\n except AttributeError:\n return Fals... | [
"0.8314069",
"0.7129691",
"0.70954645",
"0.70058125",
"0.69235104",
"0.6504104",
"0.64806396",
"0.6468178",
"0.6464817",
"0.64325935",
"0.6428082",
"0.64145815",
"0.6397964",
"0.6322619",
"0.6267981",
"0.6239462",
"0.6237453",
"0.6216564",
"0.6192202",
"0.614334",
"0.61420655... | 0.73726267 | 1 |
Returns True if usera is allowed to change userb's profile, password, etc | def allowed_user_access_change(usera, userb):
try:
upa = usera.get_profile()
upb = userb.get_profile()
except AttributeError:
return False
return ((usera == userb or usera.has_perm("vnswww.userprofile_change_any") or (usera.has_perm("vnswww.userprofile_change_org") and upa.org == up... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_user_access_use(usera, userb):\n try:\n upa = usera.get_profile()\n upb = userb.get_profile()\n except AttributeError:\n return False\n\n return usera == userb or usera.has_perm(\"vnswww.userprofile_use_any\") or (usera.has_perm(\"vnswww.userprofile_use_org\") and upa.org ... | [
"0.75432837",
"0.7367554",
"0.68467605",
"0.67738134",
"0.6763367",
"0.6735543",
"0.6717929",
"0.664237",
"0.65366995",
"0.6499262",
"0.6474806",
"0.64111125",
"0.6405359",
"0.639976",
"0.636971",
"0.63188046",
"0.62990373",
"0.6298768",
"0.6298329",
"0.62260747",
"0.6177034"... | 0.83856934 | 0 |
True if usera is allowed to view userb's profile | def allowed_user_access_use(usera, userb):
try:
upa = usera.get_profile()
upb = userb.get_profile()
except AttributeError:
return False
return usera == userb or usera.has_perm("vnswww.userprofile_use_any") or (usera.has_perm("vnswww.userprofile_use_org") and upa.org == upb.org) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_user_access_change(usera, userb):\n try:\n upa = usera.get_profile()\n upb = userb.get_profile()\n except AttributeError:\n return False\n\n return ((usera == userb or usera.has_perm(\"vnswww.userprofile_change_any\") or (usera.has_perm(\"vnswww.userprofile_change_org\") a... | [
"0.77977973",
"0.7520763",
"0.73695666",
"0.7216409",
"0.71507704",
"0.7143797",
"0.70865715",
"0.70357996",
"0.70189756",
"0.7016048",
"0.68773395",
"0.68640804",
"0.68065524",
"0.6805121",
"0.6793619",
"0.6761558",
"0.6737822",
"0.6713103",
"0.66978556",
"0.66760373",
"0.66... | 0.84311074 | 0 |
Returns True if user is allowed to delete group, False otherwise. Note that this does NOT mean user is allowed to delete users in the group. user The user who is trying to gain access group The group they're trying to gain access to | def allowed_group_access_delete(user, group):
try:
up = user.get_profile()
except AttributeError:
return False
return (user.has_perm("vnswww.group_delete_any")
or (user.has_perm("vnswww.group_delete_org")
and group.org == up.org)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_delete(self, user):\n raise Return(False)",
"def delete_user_group(self, token, userGroup):\n requestUser = self.get_username_from_token(token)\n if self.check_user_has_owner_clearance(requestUser, userGroup):\n dataBase = self.read_database()\n if userGroup in ... | [
"0.7649102",
"0.7009539",
"0.6983419",
"0.6805028",
"0.6726407",
"0.65543675",
"0.65284413",
"0.64810085",
"0.6478722",
"0.6443003",
"0.64265376",
"0.6420004",
"0.6395428",
"0.6383915",
"0.6365933",
"0.63659155",
"0.633192",
"0.633192",
"0.6325469",
"0.6315925",
"0.6314916",
... | 0.8439144 | 0 |
Returns True if user is allowed read access to org, False otherwise user The user who is trying to gain access org The organization they're trying to access | def allowed_organization_access_use(user, org):
try:
up = user.get_profile()
except AttributeError:
return False
if user.has_perm("vnswww.organization_use_any"):
return True
elif user.has_perm("vnswww.organization_use_org"):
return org == up.org | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_has_access(self, user):\n if self.visibility == self.PUBLIC:\n return True\n elif self.visibility == self.PRIVATE and self.created_by == user:\n return True\n elif self.visibility in (self.ORG_ONLY, self.ORG_ONLY_NO_EXTERNAL):\n if user.external and se... | [
"0.7198642",
"0.7064346",
"0.70490915",
"0.6959451",
"0.6917398",
"0.68647015",
"0.68634295",
"0.6861826",
"0.6839568",
"0.6808862",
"0.6807438",
"0.6780052",
"0.67722094",
"0.67668164",
"0.67631316",
"0.67551166",
"0.6753856",
"0.66949207",
"0.6612002",
"0.6567637",
"0.65526... | 0.7900296 | 0 |
Returns True iff user is allowed to create new organizations. | def allowed_organization_access_create(user):
return user.has_perm("vnswww.add_organization") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_group_access_create(user, org=None):\n try:\n up = user.get_profile()\n except AttributeError:\n return False\n\n if org is None:\n return (user.has_perm(\"vnswww.group_add_any\")\n or user.has_perm(\"vnswww.group_add_org\"))\n else:\n return (user... | [
"0.75001776",
"0.72476524",
"0.67795545",
"0.6771469",
"0.6675508",
"0.66610974",
"0.6647656",
"0.66383",
"0.65283",
"0.63500136",
"0.6332558",
"0.6293318",
"0.62751895",
"0.6231426",
"0.6199397",
"0.6174215",
"0.6172142",
"0.6092151",
"0.6082708",
"0.60812527",
"0.60695946",... | 0.86762804 | 0 |
Create smoothed weighting function using a raised cosine function | def raised_cosine_weights(self, pad, feather):
weights=[]
for dim, xy in zip([0, 1], [self.x, self.y]):
xy0 = np.mean(xy)
W = xy[-1]-xy[0]
dist = np.abs(xy-xy0)
wt = np.zeros_like(dist)
i_feather = (dist >= W/2 - pad - feather) & ( dist <= W/2 ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cosineFunction(self):\n \n w = np.zeros((self.N))\n l = self.l\n for i in range(self.r.shape[0]):\n r = np.abs(self.r[i])\n if r <= l:\n tf = lambda r,l : 0.5 * (np.cos(np.pi * r/l) + 1)\n w[i] = tf(r,l)\n else:\n ... | [
"0.6735153",
"0.6220381",
"0.61864656",
"0.61631453",
"0.61125076",
"0.60661864",
"0.6026083",
"0.5953795",
"0.5896438",
"0.589282",
"0.5868442",
"0.58343494",
"0.58317757",
"0.5792157",
"0.57724833",
"0.57429516",
"0.5707031",
"0.56300455",
"0.5614812",
"0.5613444",
"0.56072... | 0.6303124 | 1 |
Load datasets for evaluation. Always use FrameByFrame dataset for evaluation. This way, we can evaluate the different behavior networks (BehaviorCNN, BehaviorRNN, etc.) on the same dataset/metrics. | def load_eval_datasets(cfg):
# Temporarily change dataset type to be frame_by_frame
cur_dataset_type = cfg.dataset_type
if cfg.dataset_type == 'graph_net':
cfg.dataset_type = 'single_frame_graph_net'
else:
cfg.dataset_type = 'frame_by_frame'
# Get the eva... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_eval_dataset(data_dir):\n\tball_images = load_ball_images_to_memory(data_dir)\n\tgen = functools.partial(data_generator, data_dir, ball_images)\n\treturn tf.data.Dataset.from_generator(gen, (tf.float32, tf.float32))",
"def load_dataset(self):\n\n train_path = os.path.join(self.dataset_path, 'imag... | [
"0.6639196",
"0.6587588",
"0.6459924",
"0.64279443",
"0.64271784",
"0.6355626",
"0.63326746",
"0.62928706",
"0.62538105",
"0.62499624",
"0.6246586",
"0.6227456",
"0.6222277",
"0.6168688",
"0.61525166",
"0.6150792",
"0.6097726",
"0.60954595",
"0.60953987",
"0.5994113",
"0.5975... | 0.7581659 | 0 |
Return the batch size used for evaluation. The self.evaluate_dataset() method expects a DataLoader with this batch size. | def get_evaluation_batch_size():
return 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def batch_size(self):\n return self.size",
"def batch_size(self):\n return self._batch_size",
"def batch_size(self):\n return self._batch_size",
"def batch_size(self):\n return self._batch_size",
"def batch_size(self):\n return self._batch_size",
"def batch_size(self) -... | [
"0.77771175",
"0.774309",
"0.774309",
"0.774309",
"0.774309",
"0.76429844",
"0.7569859",
"0.7328417",
"0.7323009",
"0.72914314",
"0.72489995",
"0.7194375",
"0.7194375",
"0.7194375",
"0.7194375",
"0.7174322",
"0.71063054",
"0.70635784",
"0.7036648",
"0.7011863",
"0.7000447",
... | 0.7715026 | 5 |
Get the actual app module. This is similar to Django's ``get_app`` function from ``django.db.models.loading.get_app`` however instead of returning the model's module, this function returns the actual app module. | def get_app_module(app):
app_module = str('.'.join(app.__name__.split('.')[:-1]))
return __import__(app_module, {}, {}, [str('')]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_module(self):\n module = self.__class__.__module__.split('.')\n module = \".\".join(module[:-1])\n module = module + \".\" + self._get_valid_version().module\n return module",
"def get_app(self):\n\n app = APP\n return app",
"def get_module(self):\n retu... | [
"0.7222791",
"0.7039427",
"0.6928907",
"0.68793404",
"0.67696553",
"0.67583025",
"0.6728999",
"0.66992927",
"0.66110295",
"0.6469375",
"0.6315961",
"0.6265627",
"0.6203205",
"0.616371",
"0.61440074",
"0.61203885",
"0.6116623",
"0.6097265",
"0.6087241",
"0.6068362",
"0.6038862... | 0.77721786 | 0 |
Retrieve pollutions parameters for the vehicle provided to the planner. Only include the pollutants provided in 'self._pollutants' | def _get_pollutants_for_vehicle(self):
from . import session
category = models.Category.get_for_type(self._vehicle)
if not category:
raise ValueError("Unable to find Category for vehicle: {}".format(category))
fuel = session.query(models.Fuel).filter_by(name=self._vehicle.f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_poll_params_11(self):\n pp = tm11.PollParameters(response_type=self.response_type,\n content_bindings=self.supported_content.all(), # Get supported contents?\n allow_asynch=False, # TODO: This can't be specified?\n ... | [
"0.58032805",
"0.5762789",
"0.5622152",
"0.5512208",
"0.5481819",
"0.5481819",
"0.54718965",
"0.54595494",
"0.54497695",
"0.54460764",
"0.54052585",
"0.53636134",
"0.53378963",
"0.5314513",
"0.5307977",
"0.5294815",
"0.5287595",
"0.5283669",
"0.5283669",
"0.5283669",
"0.52778... | 0.7641104 | 0 |
Creates a random string to use as the state variable in the login. | def loginPage():
state = ''.join(random.choice(string.ascii_uppercase + string.digits)
for x in xrange(32))
login_session['state'] = state
return render_template('login.html', STATE=state) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createState(self):\n return ''.join(random.choice(string.ascii_letters + string.digits) for x in range(30))",
"def new_state():\n return ''.join(random.choice(string.ascii_uppercase + string.digits)\n for x in range(32))",
"def __generate_random_string():\n return uuid4().hex... | [
"0.8035858",
"0.7881578",
"0.7446806",
"0.7391109",
"0.73568296",
"0.7278644",
"0.72483516",
"0.7235251",
"0.7221922",
"0.70994",
"0.70441663",
"0.70278215",
"0.696246",
"0.6903587",
"0.68742126",
"0.68622977",
"0.674839",
"0.67305046",
"0.669842",
"0.66856194",
"0.66560966",... | 0.65009344 | 39 |
Make a JSON endpoint for all sports | def sportsJSON():
sports = session.query(Sport).all()
return jsonify(sports=[r.serialize for r in sports]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itemCatalogJSON(sport_id):\n\n sport = session.query(Sport).filter_by(id=sport_id).one()\n items = session.query(Item).filter_by(\n sport_id=sport_id).all()\n return jsonify(Sport=[i.serialize for i in items])",
"def get():\n return jsonify(baby='knight2'), 200",
"def get_games():\n\n ... | [
"0.6343889",
"0.61849576",
"0.6000485",
"0.5790426",
"0.5737663",
"0.5733848",
"0.5717405",
"0.5709815",
"0.56683385",
"0.5648687",
"0.56343955",
"0.5615686",
"0.55803835",
"0.5559064",
"0.5551494",
"0.55136335",
"0.551047",
"0.54734224",
"0.5473241",
"0.54450655",
"0.5439839... | 0.71233594 | 0 |
Return self.template_name if set. Otherwise, resolve the template path by model app_label and name. | def get_template_name(self):
if self.template_name is not None:
return self.template_name
model_opts = self.queryset.model._meta
return f"{model_opts.app_label}/{model_opts.model_name}.html" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_template(self):\n model = self.get_object()\n template_name = self.model_template_name or 'template'\n try:\n template_string = getattr(model, template_name)\n except AttributeError as e:\n raise ImproperlyConfigured(\n \"%(model)s is missing... | [
"0.716279",
"0.70614284",
"0.6938047",
"0.66917205",
"0.6647861",
"0.6601214",
"0.65886533",
"0.65692127",
"0.644684",
"0.6442147",
"0.64242977",
"0.6387982",
"0.63596463",
"0.6344944",
"0.62907714",
"0.62698334",
"0.6261263",
"0.62593627",
"0.615101",
"0.6083188",
"0.6055735... | 0.76693416 | 1 |
Get number of bins using the "square root rule" | def get_srr_bins(p_data):
n_data = len(p_data)
n_bins = np.sqrt(n_data)
return int(n_bins) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solve_n_bins(x):\n from scipy.stats import iqr\n\n x = np.asarray(x)\n hat = 2 * iqr(x) / (len(x) ** (1 / 3))\n\n if hat == 0:\n return int(np.sqrt(len(x)))\n else:\n return int(np.ceil((x.max() - x.min()) / hat))",
"def solve_n_bins(x):\n from scipy.stats import iqr\n\n x ... | [
"0.8209535",
"0.8209535",
"0.70566136",
"0.7040139",
"0.703559",
"0.6701263",
"0.6693324",
"0.66207117",
"0.65516007",
"0.6481782",
"0.64565134",
"0.6444778",
"0.6430371",
"0.6309669",
"0.6300835",
"0.62742615",
"0.6228727",
"0.62262607",
"0.6187216",
"0.6185618",
"0.6179726"... | 0.72749084 | 2 |
Get the lower and upper critical values that indicate the end ot the nonrejection area. | def get_two_tailed_critical_values(p_alpha):
Result = namedtuple('Result', 'lower_critical_value upper_critical_value')
result = Result(
p_alpha/2,
1 - (p_alpha/2)
)
return result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_values(self, lower, upper):\n if not self.upper_bounds is None:\n return self.upper_bounds\n\n minus = np.clip(self.coeffs,-math.inf,0)\n plus = np.clip(self.coeffs,0,math.inf)\n self.upper_bounds = plus.dot(upper) + minus.dot(lower) + self.const\n \n re... | [
"0.6258095",
"0.60106415",
"0.5853385",
"0.5830488",
"0.58107674",
"0.5788223",
"0.5766465",
"0.56480896",
"0.5618747",
"0.5609924",
"0.556671",
"0.55606294",
"0.5549316",
"0.55492395",
"0.55489653",
"0.5530574",
"0.55069643",
"0.5497171",
"0.54849964",
"0.5451922",
"0.541316... | 0.0 | -1 |
Get the primary color of an image by scaling it down and reducing the color palette | def get_primary_color(source_img, palette_size, show_img=False):
# Scale down image to conserve resources
img = source_img.copy()
img.thumbnail((100, 100))
# Reduce color palette (using k-means)
img_reduced = img.convert('P', palette=Image.ADAPTIVE, colors=palette_size)
if show_img:
im... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_primary_color(source: str) -> list:\r\n img = Image.fromarray(source.copy()).convert(\"RGB\")\r\n img.resize((1, 1), resample=0)\r\n primary_color = img.getpixel((0, 0))\r\n return primary_color",
"def main_color_background(img):\r\n\r\n dico = {}; max_value = 0; color = []\r\n\r\n #Con... | [
"0.67656064",
"0.6749027",
"0.64236337",
"0.6375588",
"0.61726546",
"0.6167691",
"0.6126234",
"0.61212265",
"0.60994667",
"0.60713565",
"0.60387623",
"0.60229564",
"0.60003054",
"0.60001034",
"0.5997868",
"0.59866005",
"0.59853506",
"0.5965974",
"0.59617645",
"0.5952587",
"0.... | 0.78358245 | 0 |
The extended location of the cluster associated with the resource. | def extended_location(self) -> pulumi.Input['ExtendedLocationArgs']:
return pulumi.get(self, "extended_location") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extended_location(self) -> pulumi.Output['outputs.ExtendedLocationResponse']:\n return pulumi.get(self, \"extended_location\")",
"def extended_location(self) -> pulumi.Output['outputs.ExtendedLocationResponse']:\n return pulumi.get(self, \"extended_location\")",
"def extended_location(self) -... | [
"0.67308724",
"0.67308724",
"0.6552111",
"0.6427688",
"0.64267975",
"0.64260936",
"0.64260936",
"0.63151413",
"0.6296761",
"0.6123441",
"0.6123441",
"0.595561",
"0.58933264",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953... | 0.6507004 | 4 |
The name of the resource group. The name is case insensitive. | def resource_group_name(self) -> pulumi.Input[str]:
return pulumi.get(self, "resource_group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")",
"def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")",
"def resource_group_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_group_name\")",
"def resource_gr... | [
"0.8592845",
"0.8362428",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8204173",
"0.8176596",
"0.8086605",
"0.8086605",
"0.8086605",
"0.8086605",
"0.8086605",
"0.8086605",
"... | 0.8089463 | 50 |
The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. | def additional_egress_endpoints(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EgressEndpointArgs']]]]:
return pulumi.get(self, "additional_egress_endpoints") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def additional_egress_endpoints(self) -> pulumi.Output[Optional[Sequence['outputs.EgressEndpointResponse']]]:\n return pulumi.get(self, \"additional_egress_endpoints\")",
"def enabled_egress_endpoints(self) -> pulumi.Output[Sequence['outputs.EgressEndpointResponse']]:\n return pulumi.get(self, \"en... | [
"0.79438716",
"0.78404033",
"0.7188768",
"0.6965573",
"0.68945783",
"0.68559766",
"0.6821014",
"0.6796901",
"0.6719417",
"0.6669993",
"0.66438955",
"0.6469753",
"0.63660693",
"0.6356787",
"0.63545716",
"0.6323557",
"0.6323557",
"0.6242556",
"0.621482",
"0.62133324",
"0.621020... | 0.78123057 | 2 |
The name of the cloud services network. | def cloud_services_network_name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "cloud_services_network_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def network(self) -> str:\n return pulumi.get(self, \"network\")",
"def get_network_name_on_vc(options):\n network = get_network_on_vc(options)\n if network:\n return network.name",
"def network_name(self, **kwargs):\n\n return self.api_request(self._get_method_fullname(\"network_nam... | [
"0.73698765",
"0.7273052",
"0.7184648",
"0.70949066",
"0.7003502",
"0.6944948",
"0.6907749",
"0.671241",
"0.66046816",
"0.65476507",
"0.6537378",
"0.6496819",
"0.6456874",
"0.6435901",
"0.6382824",
"0.63539356",
"0.6351035",
"0.6334907",
"0.627564",
"0.62665015",
"0.6256356",... | 0.84567714 | 0 |
The geolocation where the resource lives | def location(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "location") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_location(self):\n\t\treturn self.location",
"def get_location(self):\n return self.location",
"def get_location(self):\n return self.location",
"def get_location(self):\r\n return self.__location",
"def get_location(self):\r\n return None",
"def getLocation(self):\n ... | [
"0.816298",
"0.7999453",
"0.79540074",
"0.7945644",
"0.78364915",
"0.77626437",
"0.7730134",
"0.7681095",
"0.7624169",
"0.76093256",
"0.76093256",
"0.75724584",
"0.75544393",
"0.7547195",
"0.75165695",
"0.74507827",
"0.74267685",
"0.7419033",
"0.7419033",
"0.7419033",
"0.7419... | 0.0 | -1 |
Get an existing CloudServicesNetwork resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'CloudServicesNetwork':
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = CloudServicesNetworkArgs.__new__(CloudServicesNetworkArgs)
_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None) -> 'NetworkGroup':\n opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))\n\n __props__ = dict()\n\n __props__[\"conditional_membership\"] = None\n ... | [
"0.58533376",
"0.583694",
"0.5820981",
"0.5798957",
"0.55366343",
"0.5425285",
"0.5423865",
"0.54131234",
"0.5205126",
"0.51225173",
"0.5113505",
"0.5083816",
"0.50776225",
"0.5052948",
"0.5038816",
"0.50258",
"0.5014543",
"0.50143945",
"0.4987925",
"0.4972836",
"0.49644232",... | 0.6779751 | 0 |
The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. | def additional_egress_endpoints(self) -> pulumi.Output[Optional[Sequence['outputs.EgressEndpointResponse']]]:
return pulumi.get(self, "additional_egress_endpoints") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enabled_egress_endpoints(self) -> pulumi.Output[Sequence['outputs.EgressEndpointResponse']]:\n return pulumi.get(self, \"enabled_egress_endpoints\")",
"def additional_egress_endpoints(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EgressEndpointArgs']]]]:\n return pulumi.get(self, \"addi... | [
"0.7839639",
"0.7810969",
"0.71907055",
"0.6967457",
"0.6896288",
"0.6858077",
"0.68218935",
"0.6795657",
"0.67210174",
"0.66719174",
"0.66440576",
"0.64708406",
"0.63676244",
"0.6358928",
"0.6352911",
"0.63249654",
"0.63249654",
"0.6243185",
"0.62144524",
"0.6213847",
"0.621... | 0.7942772 | 0 |
The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. | def associated_resource_ids(self) -> pulumi.Output[Sequence[str]]:
return pulumi.get(self, "associated_resource_ids") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def network_ids(self):\n return self._network_ids",
"def otherResources(self):\n return self._get_list_field(\"otherResources\")",
"def resource_names(self):\n return self._resource_names",
"def get_ids(self):\n all_networks = []\n network_dict = {}\n for network, st... | [
"0.69101155",
"0.6573186",
"0.6401023",
"0.6343839",
"0.6258195",
"0.5978847",
"0.5978847",
"0.5978847",
"0.5819962",
"0.5801385",
"0.5795712",
"0.5795712",
"0.57860464",
"0.57594633",
"0.5741592",
"0.5688209",
"0.5666085",
"0.5643691",
"0.56345814",
"0.5630704",
"0.5611117",... | 0.70806557 | 0 |
The full list of additional and default egress endpoints that are currently enabled. | def enabled_egress_endpoints(self) -> pulumi.Output[Sequence['outputs.EgressEndpointResponse']]:
return pulumi.get(self, "enabled_egress_endpoints") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def additional_egress_endpoints(self) -> pulumi.Output[Optional[Sequence['outputs.EgressEndpointResponse']]]:\n return pulumi.get(self, \"additional_egress_endpoints\")",
"def additional_egress_endpoints(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EgressEndpointArgs']]]]:\n return pulumi.... | [
"0.81986475",
"0.8105688",
"0.77514595",
"0.7230968",
"0.7226608",
"0.7174375",
"0.71295357",
"0.70636714",
"0.7037679",
"0.6991069",
"0.6913448",
"0.6888268",
"0.65517616",
"0.64895403",
"0.6444483",
"0.6436623",
"0.6436623",
"0.63346684",
"0.632177",
"0.625647",
"0.6153679"... | 0.831773 | 0 |
The extended location of the cluster associated with the resource. | def extended_location(self) -> pulumi.Output['outputs.ExtendedLocationResponse']:
return pulumi.get(self, "extended_location") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extended_location(self) -> pulumi.Output[Optional['outputs.ExtendedLocationResponse']]:\n return pulumi.get(self, \"extended_location\")",
"def extended_location(self) -> pulumi.Input['ExtendedLocationArgs']:\n return pulumi.get(self, \"extended_location\")",
"def extended_location(self) -> p... | [
"0.6552111",
"0.6507004",
"0.6507004",
"0.6427688",
"0.64267975",
"0.64260936",
"0.64260936",
"0.63151413",
"0.6296761",
"0.6123441",
"0.6123441",
"0.595561",
"0.58933264",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",
"0.5883953",... | 0.67308724 | 0 |
Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this cloud services network. | def hybrid_aks_clusters_associated_ids(self) -> pulumi.Output[Sequence[str]]:
return pulumi.get(self, "hybrid_aks_clusters_associated_ids") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gateway_cluster_id_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"gateway_cluster_id_lists\")",
"def _get_cluster_list(self):\n return self.__cluster_list",
"def cluster_ids(self):\n return self.model.cluster_ids",
"def list_cluster_respon... | [
"0.6904107",
"0.67262274",
"0.66436243",
"0.58397466",
"0.5834969",
"0.57922214",
"0.5733183",
"0.5710565",
"0.57062244",
"0.5690729",
"0.5678259",
"0.5668799",
"0.56509113",
"0.56201696",
"0.559548",
"0.559548",
"0.559548",
"0.559548",
"0.559548",
"0.55137837",
"0.550886",
... | 0.5824514 | 6 |
The geolocation where the resource lives | def location(self) -> pulumi.Output[str]:
return pulumi.get(self, "location") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_location(self):\n\t\treturn self.location",
"def get_location(self):\n return self.location",
"def get_location(self):\n return self.location",
"def get_location(self):\r\n return self.__location",
"def get_location(self):\r\n return None",
"def getLocation(self):\n ... | [
"0.816298",
"0.7999453",
"0.79540074",
"0.7945644",
"0.78364915",
"0.77626437",
"0.7730134",
"0.7681095",
"0.7624169",
"0.76093256",
"0.76093256",
"0.75724584",
"0.75544393",
"0.7547195",
"0.75165695",
"0.74507827",
"0.74267685",
"0.7419033",
"0.7419033",
"0.7419033",
"0.7419... | 0.6883943 | 76 |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | def type(self) -> pulumi.Output[str]:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_type\")",
"def ... | [
"0.79187346",
"0.79187346",
"0.7866393",
"0.7866393",
"0.7866393",
"0.7866393",
"0.7866393",
"0.7707365",
"0.75533295",
"0.728177",
"0.70592564",
"0.6979974",
"0.692058",
"0.6869065",
"0.6729038",
"0.67043585",
"0.6653516",
"0.66459006",
"0.6639014",
"0.6639014",
"0.6639014",... | 0.0 | -1 |
The identity block is the block that has no conv layer at shortcut. Arguments | def __init__(self, kernel_size, filters, stage, block):
super().__init__(name='identity' + str(stage) + block)
filters1, filters2, filters3 = filters
if K.image_data_format() == 'channels_last':
bn_axis = 3
else:
bn_axis = 1
conv_name_base = 'res' + str(stage) + block + '_branch'
bn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu... | [
"0.71272004",
"0.7022438",
"0.6910338",
"0.68836653",
"0.68505627",
"0.6847176",
"0.68221945",
"0.6821999",
"0.680346",
"0.6799615",
"0.67849326",
"0.67714536",
"0.67158884",
"0.67146987",
"0.67137283",
"0.6664201",
"0.6624224",
"0.662218",
"0.662218",
"0.66078824",
"0.659845... | 0.0 | -1 |
A block that has a conv layer at shortcut. Arguments | def __init__(self, kernel_size, filters, stage, block, strides=(2, 2)):
super().__init__(name='conv_block' + str(stage) + block)
filters1, filters2, filters3 = filters
if K.image_data_format() == 'channels_last':
bn_axis = 3
else:
bn_axis = 1
conv_name_base = 'res' + str(stage) + block +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conv_block(self, output_channel, filter_, activate):\n return self.add_layer(conv_block, output_channel, filter_, activate)",
"def _convolution_block(self, X, filters, f, s, stage, block):\n\n\t\tconv_layer_name = 'res' + str(stage) + block + '_branch'\n\t\tbn_layer_name = 'bn' + str(stage) + block + ... | [
"0.721995",
"0.67970437",
"0.67504996",
"0.67344207",
"0.67019993",
"0.66698205",
"0.6669391",
"0.66378975",
"0.6601249",
"0.6601249",
"0.65978736",
"0.6559081",
"0.6557333",
"0.6553106",
"0.6530076",
"0.65101016",
"0.65067416",
"0.64779866",
"0.6421004",
"0.64114",
"0.638952... | 0.6291087 | 33 |
Returns the queryset used for the export | def get_queryset(self) -> QuerySet:
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_export_queryset(self, request, context):\n # scope = self.request.POST.get('_select_across', False) == '1'\n scope = request.GET.get('scope')\n select_across = request.GET.get('_select_across', False) == '1'\n selected = request.GET.get('_selected_actions', '')\n if scope... | [
"0.80118215",
"0.74907297",
"0.7482479",
"0.7428582",
"0.74244267",
"0.7200492",
"0.71978205",
"0.71929747",
"0.7097913",
"0.70448977",
"0.69686604",
"0.69686604",
"0.69338095",
"0.6901932",
"0.6889277",
"0.6869352",
"0.683674",
"0.683674",
"0.683674",
"0.683674",
"0.683674",... | 0.7002496 | 10 |
Dictionary of default values of all model parameters set to the column 2 values in Table 2 of Behroozi et al. (2013) Returns | def _retrieve_Behroozi_default_dict():
## Main dictionary
d = ({'smhm_m0_0': 10.72,
'smhm_m0_a': 0.59,
'smhm_m1_0': 12.35,
'smhm_m1_a': 0.3,
'smhm_beta_0': 0.43,
'smhm_beta_a': 0.18,
'smhm_delta_0': 0.56,
'smhm_delta_a': 0.18,
'smhm_gamma_0': 1.54,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getDefaultParameterValues(self):\r\n dct = {}\r\n self.initializeRoadRunnerModel()\r\n self.roadrunnerModel.reset()\r\n for parameterName in self.parametersToFit:\r\n dct[parameterName] = self.roadrunnerModel.model[parameterName]\r\n return dct",
"def _identifyin... | [
"0.71658176",
"0.6402271",
"0.6362589",
"0.63489044",
"0.62419343",
"0.61842936",
"0.61763227",
"0.615268",
"0.6152398",
"0.61490095",
"0.606751",
"0.6060048",
"0.6042473",
"0.603785",
"0.603573",
"0.6015136",
"0.6014756",
"0.6011938",
"0.59739405",
"0.59595644",
"0.5958624",... | 0.6040976 | 13 |
return lowest index of T at which the substring P begins or 1 | def find_boyer_moore(T, P):
n, m = len(T), len(P)
if m == 0: return 0
last = {} # Using hash table for fast access
for k in range(m):
last[P[k]] = k
i = m - 1 # i index at T, k index at P
k = m - 1 # j index of last occurrence of T[i] in P
w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_brute(T, P):\n n, m = len(T), len(P) # introduce convenient notations\n for i in range(n-m+1): # try every potential starting index within T\n k = 0 # an index into pattern P\n while k < m and P[k] == T[i+k]: # kth character of P matches\n k += 1\n ... | [
"0.71366817",
"0.68841183",
"0.67988336",
"0.6591313",
"0.6496134",
"0.64721566",
"0.6445603",
"0.62609804",
"0.6255628",
"0.6255628",
"0.6255628",
"0.623307",
"0.6226056",
"0.6207349",
"0.6207349",
"0.615631",
"0.6127276",
"0.60697514",
"0.6056753",
"0.60400015",
"0.60400015... | 0.574919 | 32 |
return lowest index of T at which the substring P begins or 1 | def find_boyer_moore2(T, P):
n, m = len(T), len(P)
if m == 0: return 0
last = {} # Using hash table for fast access
for k in range(m):
last[P[k]] = k
i = m - 1 # i index at T, k index at P
k = m - 1 # j index of last occurrence of T[i] in P
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_brute(T, P):\n n, m = len(T), len(P) # introduce convenient notations\n for i in range(n-m+1): # try every potential starting index within T\n k = 0 # an index into pattern P\n while k < m and P[k] == T[i+k]: # kth character of P matches\n k += 1\n ... | [
"0.7137163",
"0.68841",
"0.67985874",
"0.6591358",
"0.64953494",
"0.6470466",
"0.64446634",
"0.62614733",
"0.6254462",
"0.6254462",
"0.6254462",
"0.62325263",
"0.6225033",
"0.62068933",
"0.62068933",
"0.6155825",
"0.61272633",
"0.60691506",
"0.6055394",
"0.60390955",
"0.60390... | 0.5669278 | 39 |
This method initializes the terminal in the same fashion than | def initialize_with_shelldicts(self,
shelldicts,
prepare=lambda: None,
finalize=lambda: None):
ss = ShellStack()
ss.initialize(shelldicts=shelldicts)
self.initialize_with_shells(ss.shells,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terminal_init(self):\n pass",
"def __init__(self):\n self.start = datetime.datetime.now()\n self.linecount = 0\n if sys.stdout.isatty():\n self.term = Terminal()\n sys.stdout.write(self.term.clear())",
"def init():\n unicornhathd.rotation(270)\n unico... | [
"0.8699809",
"0.7292389",
"0.71076804",
"0.6831301",
"0.66842216",
"0.6651966",
"0.66282696",
"0.65851945",
"0.6437352",
"0.6436314",
"0.6404397",
"0.6399962",
"0.6394869",
"0.6389796",
"0.6379304",
"0.63294286",
"0.6312214",
"0.6306049",
"0.6304554",
"0.6298047",
"0.62804455... | 0.0 | -1 |
This method initializes the terminal in the same fashion than | def initialize(self, session,
prepare=lambda: None, finalize=lambda: None):
self.session = session
self.prepare = prepare
self.finalize = finalize
self._set_session_callbacks() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terminal_init(self):\n pass",
"def __init__(self):\n self.start = datetime.datetime.now()\n self.linecount = 0\n if sys.stdout.isatty():\n self.term = Terminal()\n sys.stdout.write(self.term.clear())",
"def init():\n unicornhathd.rotation(270)\n unico... | [
"0.8699262",
"0.7292933",
"0.71083564",
"0.6831184",
"0.668472",
"0.6652416",
"0.66292405",
"0.6584851",
"0.64369875",
"0.64360744",
"0.64037913",
"0.6401106",
"0.6395263",
"0.638947",
"0.6378908",
"0.63298637",
"0.63125944",
"0.63061106",
"0.63049245",
"0.6298684",
"0.628029... | 0.0 | -1 |
get_subject The subject of the fact | def get_subject(self):
return self._subject | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subject(self):\n if \"subject\" in self._prop_dict:\n return self._prop_dict[\"subject\"]\n else:\n return None",
"def subject(self):\n return self.__subject",
"def subject(self):\n return self._subject",
"def subject(self):\n return self.get(\"sub... | [
"0.7669172",
"0.7537892",
"0.7468758",
"0.73697263",
"0.7355041",
"0.71277165",
"0.70041686",
"0.6994261",
"0.6980344",
"0.69412374",
"0.67784035",
"0.67784035",
"0.6492579",
"0.64614415",
"0.64437294",
"0.64329296",
"0.64083016",
"0.64064366",
"0.6354084",
"0.63392586",
"0.6... | 0.76411164 | 1 |
Return True if the skupper site is hosted on an internal cluster. | def on_internal_cluster(self) -> bool:
return self.cluster.internal or False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_public_cluster(self) -> bool:\n return not self.on_private_cluster",
"def on_private_cluster(self) -> bool:\n return self.cluster.spec.private if self.cluster.spec else False",
"def isInCluster(self):\n logger.debug(\"Checking if %s is a part of cluster\" % self)\n role = sel... | [
"0.7357069",
"0.70071125",
"0.6751255",
"0.66724575",
"0.66079754",
"0.6542108",
"0.65032285",
"0.64450425",
"0.63726056",
"0.6311538",
"0.6302677",
"0.62704456",
"0.624269",
"0.6212056",
"0.62025696",
"0.6201729",
"0.61704063",
"0.61688036",
"0.6139393",
"0.6076279",
"0.6049... | 0.79504955 | 0 |
Return True if the site is an edge site. | def is_edge_site(self) -> bool:
return self.config.edge | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_edge(self, otherNode):\n\t\t\treturn otherNode in self.edges",
"def isEdge(self,x,y):\n\t\treturn y in self._dictOut[x]",
"def isEdge(self,x,y):\n\t\treturn y in self._dict[x]",
"def isEdge(self, x, y):\n return y in self._dictOut[x]",
"def has_edges(self):\n\n return len(self._edges)... | [
"0.70349616",
"0.6915203",
"0.6851632",
"0.682174",
"0.67566234",
"0.6714369",
"0.66799676",
"0.65916944",
"0.6558664",
"0.6515212",
"0.648408",
"0.6471512",
"0.6367931",
"0.6297021",
"0.62817",
"0.6240533",
"0.6233693",
"0.616926",
"0.6160131",
"0.6136747",
"0.6134466",
"0... | 0.86728704 | 0 |
Set up the test case with a user | def setUp(self):
super(WmsTestCase, self).setUp()
self._user = self.model('user').createUser(
'minervauser', 'password', 'minerva', 'user',
'minervauser@example.com') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n self.new_user = User(\"Juma\",\"12345\")",
"def setUp(self):\n self.user = {\n INPUT: \"12345\",\n }",
"def setUp(self):\n \n self.new_user = User_prof(username = 'munga',bio = 'funny thing to say')",
"def setUp(self):\n \n self.n... | [
"0.7649504",
"0.76031333",
"0.76029813",
"0.76029813",
"0.7588299",
"0.75567895",
"0.75431585",
"0.75382394",
"0.7517782",
"0.75104517",
"0.75053287",
"0.7486146",
"0.7462552",
"0.7422921",
"0.7364179",
"0.7363142",
"0.73448694",
"0.733774",
"0.7320035",
"0.73121804",
"0.7285... | 0.69008464 | 56 |
Test Fail UserResource.get(login) method | def test_get_fail(self):
with self.assertRaises(AssertionError):
self.resource.get(-1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_resource_user_resource_get_user_get(self):\n pass",
"def test_resource_user_resource_find_users_get(self):\n pass",
"def test_api_user_get(self):\n pass",
"def test_resource_user_resource_get_current_user_get(self):\n pass",
"def test_users_get(self):\n pass",
... | [
"0.8289363",
"0.80577666",
"0.7867317",
"0.77092636",
"0.7655078",
"0.7655078",
"0.7511506",
"0.7420454",
"0.7399936",
"0.7388848",
"0.7363005",
"0.73336434",
"0.73078954",
"0.72998255",
"0.71924776",
"0.71804297",
"0.7126135",
"0.71138567",
"0.71093637",
"0.7069864",
"0.7061... | 0.0 | -1 |
Test Fail UserResource.list(page) method | def test_list_fail(self):
with self.assertRaises(AssertionError):
self.resource.get(-1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_list_user(self):\n pass",
"def test_resource_user_resource_find_users_get(self):\n pass",
"def test_users_get(self):\n pass",
"def test_users_get(self):\n pass",
"def test_user_list(self):\r\n self._add_demo_import()\r\n params = {\r\n 'api_key'... | [
"0.76915306",
"0.75058997",
"0.73501027",
"0.73501027",
"0.7257327",
"0.7244572",
"0.71239424",
"0.70939237",
"0.7075472",
"0.70545876",
"0.7054254",
"0.70369774",
"0.69944495",
"0.6981466",
"0.6957983",
"0.6929301",
"0.68954104",
"0.68556964",
"0.6844748",
"0.6822453",
"0.68... | 0.647213 | 43 |
Test UserResource.posts(login, page) method | def test_posts(self):
self.resource._request.register_uri(
'GET', '/users/dotzero/posts?page=2', 'fixture_post.json')
response = self.resource.posts('dotzero', 2)
self.assertTrue('data' in response)
self.assertTrue('server_time' in response) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_user_posts(self):\n with self.client as client:\n resp = client.get(f\"/users/{self.u1_username}\")\n html = resp.get_data(as_text=True)\n\n self.assertEqual(resp.status_code, 200)\n # u1 owns p1 but not p2\n self.assertIn(f'<a class=\"uk-butto... | [
"0.7371837",
"0.73089707",
"0.72772837",
"0.72723603",
"0.72723603",
"0.7219611",
"0.70777917",
"0.7049269",
"0.69681364",
"0.6887939",
"0.68331975",
"0.6831369",
"0.68074936",
"0.67663735",
"0.67579615",
"0.67482716",
"0.671147",
"0.6694462",
"0.66624945",
"0.66008943",
"0.6... | 0.79283786 | 0 |
Test Fail UserResource.posts(login, page) method | def test_posts_fail(self):
with self.assertRaises(AssertionError):
self.resource.posts(-1)
with self.assertRaises(AssertionError):
self.resource.posts('foo', 'bar') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_posts(self):\n self.resource._request.register_uri(\n 'GET', '/users/dotzero/posts?page=2', 'fixture_post.json')\n\n response = self.resource.posts('dotzero', 2)\n\n self.assertTrue('data' in response)\n self.assertTrue('server_time' in response)",
"def test_post_u... | [
"0.7439907",
"0.7425188",
"0.74128944",
"0.7395129",
"0.7370658",
"0.73548263",
"0.73548263",
"0.71929896",
"0.71708775",
"0.71400446",
"0.7114321",
"0.7101303",
"0.70988536",
"0.6969142",
"0.69461167",
"0.6939873",
"0.6884646",
"0.68628407",
"0.68617404",
"0.6768505",
"0.675... | 0.7332438 | 7 |
Test UserResource.favorites_posts(login, page) method | def test_favorites_posts(self):
self.resource._request.register_uri(
'GET', '/users/dotzero/favorites/posts?page=2', 'fixture_post.json')
response = self.resource.favorites_posts('dotzero', 2)
self.assertTrue('data' in response)
self.assertTrue('server_time' in response) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_favorites_comments(self):\n self.resource._request.register_uri(\n 'GET', '/users/dotzero/favorites/comments?page=2',\n 'fixture_post.json')\n\n response = self.resource.favorites_comments('dotzero', 2)\n\n self.assertTrue('data' in response)\n self.assert... | [
"0.68933225",
"0.6811983",
"0.6536278",
"0.63042474",
"0.6301337",
"0.6252229",
"0.61242634",
"0.6111041",
"0.6092737",
"0.6011554",
"0.6006121",
"0.5941497",
"0.5909771",
"0.5900231",
"0.58877295",
"0.5854893",
"0.58386433",
"0.58274436",
"0.58130944",
"0.57888925",
"0.57791... | 0.8498414 | 0 |
Test UserResource.favorites_comments(login, page) method | def test_favorites_comments(self):
self.resource._request.register_uri(
'GET', '/users/dotzero/favorites/comments?page=2',
'fixture_post.json')
response = self.resource.favorites_comments('dotzero', 2)
self.assertTrue('data' in response)
self.assertTrue('server_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_comments(self):\n self.resource._request.register_uri(\n 'GET', '/users/dotzero/comments?page=2', 'fixture_user.json')\n\n response = self.resource.comments('dotzero', 2)\n\n self.assertTrue('data' in response)\n self.assertTrue('server_time' in response)",
"def te... | [
"0.6938474",
"0.67961997",
"0.6484971",
"0.637763",
"0.6331129",
"0.61841625",
"0.6144015",
"0.60092765",
"0.5970653",
"0.59290683",
"0.58997226",
"0.5886138",
"0.58773804",
"0.5853263",
"0.5849604",
"0.5772307",
"0.5724686",
"0.57201016",
"0.57031924",
"0.5697745",
"0.568907... | 0.84647095 | 0 |
Test Fail UserResource.favorites_comments(login, page) method | def test_favorites_comments_fail(self):
with self.assertRaises(AssertionError):
self.resource.favorites_comments(-1)
with self.assertRaises(AssertionError):
self.resource.favorites_comments('foo', 'bar') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_favorites_comments(self):\n self.resource._request.register_uri(\n 'GET', '/users/dotzero/favorites/comments?page=2',\n 'fixture_post.json')\n\n response = self.resource.favorites_comments('dotzero', 2)\n\n self.assertTrue('data' in response)\n self.assert... | [
"0.81004006",
"0.69311523",
"0.66913867",
"0.64991003",
"0.64601576",
"0.64338493",
"0.62749755",
"0.62351966",
"0.6233211",
"0.61592066",
"0.6154396",
"0.61254704",
"0.611604",
"0.6030049",
"0.6007989",
"0.6002804",
"0.59985924",
"0.5997375",
"0.5968795",
"0.59646595",
"0.59... | 0.7950016 | 1 |
Parses a requirements file, looking for nested files. | def parse_nested_files(self):
# type: () -> Tuple[InstallReqFileSet, InstallReqFileSet]
nested_cfiles = ordered_set.OrderedSet()
nested_rfiles = ordered_set.OrderedSet()
parser = pip.req.req_file.build_parser()
defaults = parser.get_default_values()
defaults.index_url = N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_reqs(req_path='./requirements.txt'):\n req = []\n with codecs.open(req_path, 'r') as handle:\n # remove comments and empty lines\n lines = (line.strip() for line in handle\n if line.strip() and not line.startswith('#'))\n\n for line in lines:\n # chec... | [
"0.74728197",
"0.7260392",
"0.71974546",
"0.6867657",
"0.6693883",
"0.66283774",
"0.6492854",
"0.64919966",
"0.6450385",
"0.64306283",
"0.6408674",
"0.63827765",
"0.6364514",
"0.6305518",
"0.63041645",
"0.6297856",
"0.626945",
"0.62402797",
"0.6228126",
"0.62150294",
"0.62042... | 0.66629225 | 5 |
Parses a requirements source file. | def parse_requirements(filename, *args): # pragma: no cover
# type: (str, str) -> Tuple[InstallReqSet, pip.index.PackageFinder]
pip_options, session = build_pip_session(*args)
repository = PyPiRepository(pip_options, session)
requirements = pip.req.parse_requirements(
filename,
finder=r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_requirements_txt():\n root = os.path.dirname(os.path.abspath(__file__))\n\n requirements = []\n dependencies = []\n\n with open(os.path.join(root, 'requirements.txt'), 'r') as f:\n for line in f.readlines():\n line = line.rstrip()\n if not line or line.startswith(... | [
"0.7393417",
"0.7165026",
"0.713954",
"0.70136434",
"0.68966335",
"0.6876439",
"0.6835497",
"0.6826305",
"0.68226284",
"0.68226284",
"0.68226284",
"0.6775737",
"0.67604184",
"0.67575985",
"0.67487645",
"0.672733",
"0.6685165",
"0.6675322",
"0.6626736",
"0.6621038",
"0.6567365... | 0.60225743 | 43 |
Test converting quaternion to rotation matrix. | def test_to_rotation(self):
q = np.array([-1, 1, 3, 2])
q = q / np.linalg.norm(q)
R_gt = np.array([
[-1/3., -14/15., -2/15.],
[2/3., -1/3., 2/3.],
[-2/3., 2/15., 11/15.]]).T
R = to_rotation(q)
zero_matrix = R - R_gt
self.asse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conversions_matrix_quaternion():\n R = np.eye(3)\n a = pr.axis_angle_from_matrix(R)\n assert_array_almost_equal(a, np.array([1, 0, 0, 0]))\n\n random_state = np.random.RandomState(0)\n for _ in range(5):\n q = pr.random_quaternion(random_state)\n R = pr.matrix_from_quaternion(... | [
"0.82558435",
"0.8119534",
"0.7815779",
"0.7733737",
"0.7339709",
"0.72954166",
"0.7218608",
"0.7136635",
"0.7131645",
"0.70673054",
"0.7015742",
"0.7002236",
"0.69939727",
"0.6982585",
"0.6957458",
"0.69242704",
"0.6917323",
"0.68979",
"0.6881608",
"0.6855251",
"0.6845614",
... | 0.8033091 | 2 |
Test converting rotation matrix quaternion. | def test_to_quaternion(self):
R = np.identity(3)
q = to_quaternion(R)
zero_vec = q - np.array([0., 0., 0., 1.])
self.assertAlmostEqual(np.linalg.norm(zero_vec), 0.0)
for _ in range(20):
q = np.random.randn(4)
q /= np.linalg.norm(q)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conversions_matrix_quaternion():\n R = np.eye(3)\n a = pr.axis_angle_from_matrix(R)\n assert_array_almost_equal(a, np.array([1, 0, 0, 0]))\n\n random_state = np.random.RandomState(0)\n for _ in range(5):\n q = pr.random_quaternion(random_state)\n R = pr.matrix_from_quaternion(... | [
"0.82690674",
"0.7959134",
"0.7939182",
"0.7600201",
"0.75372833",
"0.7459533",
"0.739918",
"0.7289051",
"0.7195443",
"0.71935666",
"0.71454626",
"0.7134161",
"0.71254104",
"0.7040668",
"0.70335364",
"0.70171607",
"0.6981919",
"0.6981059",
"0.69645333",
"0.69524604",
"0.69176... | 0.81795835 | 1 |
Forward propagate throught LSTM in parallel mode. | def forward(self, inp, state_0):
next_inp = inp.view(1, -1)
next_state = state_0
outputs = []
for i in range(self.seq_len):
out, next_state = self.model(next_inp, next_state)
outputs.append(out)
next_inp = torch.argmax(out, dim=-1)
return torc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, x):\n # Set initial states\n h0_variable = torch.zeros(self.num_layers * 2, x.size(0), self.hidden_size).to(self.device)\n c0_variable = torch.zeros(self.num_layers * 2, x.size(0), self.hidden_size).to(self.device)\n\n # Forward propagate LSTM\n out, _ = self.ls... | [
"0.6980283",
"0.6869135",
"0.6823408",
"0.66030145",
"0.6528454",
"0.6464937",
"0.64551663",
"0.6441601",
"0.6430547",
"0.6379417",
"0.63715076",
"0.63666254",
"0.6356948",
"0.63421494",
"0.6341871",
"0.62990814",
"0.62716866",
"0.6207853",
"0.6197452",
"0.6182634",
"0.615648... | 0.0 | -1 |
Forward propagate throught LSTM. | def forward(self, inp, state):
emb = self.drop(self.encoder(inp))
y, state_next = self.rnn(emb, state)
y = self.drop(y)
y = self.decoder(y)
return y, state_next | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, x):\n # Set initial states\n h0_variable = torch.zeros(self.num_layers * 2, x.size(0), self.hidden_size).to(self.device)\n c0_variable = torch.zeros(self.num_layers * 2, x.size(0), self.hidden_size).to(self.device)\n\n # Forward propagate LSTM\n out, _ = self.ls... | [
"0.7879262",
"0.768611",
"0.74561685",
"0.7334817",
"0.7257697",
"0.72543764",
"0.7153594",
"0.7151201",
"0.7138459",
"0.70746654",
"0.70660996",
"0.7029574",
"0.702773",
"0.7016172",
"0.7003409",
"0.69388074",
"0.6903344",
"0.6858935",
"0.6844671",
"0.6841093",
"0.6831496",
... | 0.0 | -1 |
Tokenizes the text data | def tokenize(text, token):
text = [token(x) for x in text]
return text | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tokenize(text):\n return text.split(' ')",
"def tokenize(self, raw_text):\n # TODO implement\n raw_tokens = word_tokenize(raw_text.decode('utf8'))\n return self.filter_tokens(raw_tokens)\n # return self.split_by(raw_tokens, '-')",
"def _tokenize(self, text: str) -> List[str]:\n ... | [
"0.75785226",
"0.7350092",
"0.73118323",
"0.7265882",
"0.7198742",
"0.7182935",
"0.71329665",
"0.7129313",
"0.71104115",
"0.7106318",
"0.710309",
"0.7052359",
"0.7032231",
"0.69986963",
"0.6997156",
"0.69853157",
"0.69840133",
"0.6959404",
"0.6914783",
"0.6908655",
"0.6900853... | 0.68079984 | 27 |
Checks if an individual belongs to a specified class. | def check_individual_type(self, individual, classURI):
# Query to return classes of individual
txtQuery = "select ?type { <" + individual + "> a ?type.}"
# issue sparql query
resultSet = self.ontology.query(query_object=txtQuery)
classes = []
for r in resultSet:
classes.append(str(r.type))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def obj_is_in_class(obj: unrealsdk.UObject, in_class: str) -> bool:\n return bool(obj.Class == unrealsdk.FindClass(in_class))",
"def is_kind_of_class(obj, a_class):\n return isinstance(obj, a_class)",
"def is_kind_of_class(obj, a_class):\n return isinstance(obj, a_class)",
"def is_kind_of_class(obj,... | [
"0.71342826",
"0.63399357",
"0.63399357",
"0.63399357",
"0.63399357",
"0.63399357",
"0.63399357",
"0.6306234",
"0.6291996",
"0.6290904",
"0.6285624",
"0.62589914",
"0.62589914",
"0.6235945",
"0.6206578",
"0.6199013",
"0.61777127",
"0.61659217",
"0.6151137",
"0.6129008",
"0.61... | 0.6883937 | 1 |
Moves the swap element to position j from the current position | def _move_swap_el(self, j):
i = self.swap_idx
while i < j:
if self.verbose:
print(i, i+1)
self.arrangement[i],self.arrangement[i+1]=self.arrangement[i+1],self.arrangement[i]
i += 1
while i > j:
if self.verbose:
print(i, i-1)
self.arrangement[i],self.arrangement[i-1]=self.arrangement[i-1],se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _swap(self, i, j):\n self._data[i], self._data[j] = self._data[j], self._data[i]",
"def _swap(self, i, j):\n self._data[i], self._data[j] = self._data[j], self._data[i]",
"def swap(self,i,j):\r\n self._data[i], self._data[j] = self._data[j], self._data[i]",
"def _swap(self, i, j):\r\n ... | [
"0.7661554",
"0.7661554",
"0.7616923",
"0.76118165",
"0.7611776",
"0.75940925",
"0.75202775",
"0.7493728",
"0.7449994",
"0.7422566",
"0.72777003",
"0.72067314",
"0.72058374",
"0.72018766",
"0.71948016",
"0.71905756",
"0.714544",
"0.7057257",
"0.70313597",
"0.70078236",
"0.697... | 0.88287616 | 0 |
Creates keras callback for cyclical learning rate. | def clr_callback(mode=None, base_lr=1e-4, max_lr=1e-3, gamma=0.999994):
if mode == "trng1":
clr = CyclicLR(base_lr=base_lr, max_lr=max_lr, mode="triangular")
elif mode == "trng2":
clr = CyclicLR(base_lr=base_lr, max_lr=max_lr, mode="triangular2")
elif mode == "exp":
clr = CyclicLR(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clr_keras_callback(mode=None, base_lr=1e-4, max_lr=1e-3, gamma=0.999994):\n from . cyclical_learning_rate import CyclicLR\n if mode == 'trng1':\n clr = CyclicLR(base_lr=base_lr, max_lr=max_lr, mode='triangular')\n elif mode == 'trng2':\n clr = CyclicLR(base_lr=base_lr, max_lr=max_lr, mod... | [
"0.68205225",
"0.65726787",
"0.6094842",
"0.58839995",
"0.5845977",
"0.5678293",
"0.56700635",
"0.5652232",
"0.56452197",
"0.5610975",
"0.5600942",
"0.55987376",
"0.5593452",
"0.5593291",
"0.5556113",
"0.55546224",
"0.5525337",
"0.5502516",
"0.54932964",
"0.549059",
"0.545832... | 0.5213432 | 42 |
Turns ON the RF output. | def on(self):
print(f"RF {self.name} on")
self.status(True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_output_on(self):\n self.instr.write('RF1')\n time.sleep(self.sleep_time)",
"def turn_on(self):\n self.write(\"OUT1\\n\")",
"def turn_on(self):\n GPIO.output(self.gpio, True) # turn on light",
"def turnOn(self):\n self.write('E;O1;E;')\n return self.output()... | [
"0.8847189",
"0.8278095",
"0.78173256",
"0.7808823",
"0.77233696",
"0.7542341",
"0.7393205",
"0.7323806",
"0.71810305",
"0.71272415",
"0.7098429",
"0.7074824",
"0.7068935",
"0.7047833",
"0.7047833",
"0.70440906",
"0.69862133",
"0.6984233",
"0.69523996",
"0.69428444",
"0.69315... | 0.7687058 | 5 |
Turns OFF the RF output. | def off(self):
print(f"RF {self.name} off")
self.status(False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_output_off(self):\n self.instr.write('RF0')\n time.sleep(self.sleep_time)",
"def turn_off(self):\n self.write(\"OUT0\\n\")",
"def turnOff(self):\n self.write(\"E;O0;E;\")\n return self.output()",
"def turn_off(self):\n GPIO.output(self.gpio, False) # turn o... | [
"0.8635635",
"0.83003366",
"0.82206154",
"0.813775",
"0.7844174",
"0.7666708",
"0.762896",
"0.7626627",
"0.75779396",
"0.7566445",
"0.7544517",
"0.7521237",
"0.7506766",
"0.74948364",
"0.7489307",
"0.74861085",
"0.74734384",
"0.7443173",
"0.7421677",
"0.74172395",
"0.7383096"... | 0.8402193 | 1 |
Method which returns exact number of edges for current Vertex | def get_number_of_edges(self, where_to=OUTGOING):
if not self._directed:
return len(self._outgoing)
if where_to == Vertex.OUTGOING:
return len(self._outgoing)
elif where_to == Vertex.INCOMING:
return len(self._incoming) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edgecount(self):\n\n raise NotImplementedError",
"def num_edges(self):\n return sum(len(v.adj) for v in self.vertices.values())",
"def num_of_edge(self):\n try:\n return self.edges\n except:\n print(\"ERROR: No graph exists\")",
"def edge_count(self) -> i... | [
"0.8292416",
"0.82491195",
"0.8109534",
"0.81045026",
"0.808755",
"0.8086237",
"0.80690217",
"0.8061081",
"0.8016116",
"0.8012883",
"0.79929984",
"0.7961072",
"0.79313546",
"0.79004496",
"0.7825437",
"0.7798607",
"0.7768569",
"0.77664804",
"0.77095705",
"0.77073675",
"0.77063... | 0.66309214 | 74 |
returns json response of client list | def ajax_clients_list():
if not request.is_xhr:
return jsonify({'error': 'Method not Allowed'}), 405
client_schema = schemas.ClientSchema()
data = client_schema.dump(client.ClientService.objects_all(), many=True).data
return jsonify({
'aaData': [[c.get('name'), c.get('slug')] for c i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_clients():\n clients = Client.query.all()\n clients_schema = ClientSchema()\n result = clients_schema.dump(clients, many=True)\n return jsonify({'clients': result.data})",
"def get_clients():\n data = DataTable(document=ClientDocument, schema=ClientSchema).get_data\n return Response(dat... | [
"0.7758765",
"0.7722253",
"0.72662497",
"0.720054",
"0.71405697",
"0.71192366",
"0.6970985",
"0.6922041",
"0.68684953",
"0.6786567",
"0.6685259",
"0.66827667",
"0.6676122",
"0.6634344",
"0.6578491",
"0.6549434",
"0.65296966",
"0.6520382",
"0.64961916",
"0.64640516",
"0.645042... | 0.83715266 | 0 |
returns json response of client list | def ajax_feature_requests_list(client_slug):
if not request.is_xhr:
return jsonify({'error': 'Method not Allowed'}), 405
client_obj = client.ClientService.objects_filter(**dict(slug=client_slug))
if not client_obj:
return jsonify({'error': 'Client not found'}), 404
feature_schema = s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ajax_clients_list():\n\n if not request.is_xhr:\n return jsonify({'error': 'Method not Allowed'}), 405\n\n client_schema = schemas.ClientSchema()\n\n data = client_schema.dump(client.ClientService.objects_all(), many=True).data\n\n return jsonify({\n 'aaData': [[c.get('name'), c.get('... | [
"0.83715266",
"0.7758765",
"0.7722253",
"0.72662497",
"0.720054",
"0.71405697",
"0.71192366",
"0.6970985",
"0.6922041",
"0.68684953",
"0.6786567",
"0.6685259",
"0.66827667",
"0.6676122",
"0.6634344",
"0.6578491",
"0.6549434",
"0.65296966",
"0.6520382",
"0.64640516",
"0.645042... | 0.64961916 | 19 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.