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 |
|---|---|---|---|---|---|---|
Return representation of the circle. | def __repr__(self) -> str:
return f"Circle (r: {self._radius}, color: {self.get_color()})" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n return \"Circle(\" + str(self.radius) + \")\"",
"def __repr__(self):\n return '<Circle %r>' % self.id",
"def __str__(self):\n return \"Circle with radius: \" + str(self.radius)",
"def __repr__(self):\n return \"{}({})\".format(self.__class__.__name__, self._r... | [
"0.8574919",
"0.79641294",
"0.79034865",
"0.764836",
"0.75296295",
"0.74091727",
"0.7007331",
"0.7002674",
"0.6984574",
"0.69697034",
"0.68669456",
"0.6822999",
"0.66565686",
"0.6622435",
"0.6622435",
"0.66161984",
"0.6519085",
"0.6517521",
"0.6504298",
"0.645104",
"0.6449418... | 0.8427207 | 1 |
Return representation of the square. | def __repr__(self) -> str:
return f"Square (a: {self._side}, color: {self.get_color()})" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n out = \"[Square] ({}) {}/{} - {}\"\n return (out.format(self.id, self.x, self.y, self.size))",
"def __str__(self):\n return \"[Square] ({:d}) {:d}/{:d} - {:d}\".format(self.id, self.x,\n self.y, self.width)",
"def... | [
"0.8016825",
"0.788725",
"0.7872962",
"0.7827002",
"0.7791921",
"0.7790835",
"0.77729046",
"0.77505565",
"0.77274054",
"0.7495165",
"0.7108211",
"0.7097999",
"0.6992314",
"0.6977678",
"0.6967802",
"0.6931955",
"0.6925363",
"0.68257856",
"0.67794806",
"0.6772436",
"0.67676765"... | 0.78579515 | 3 |
Computes coherent samples by projecting unconstrained `samples` using the matrix `self.M`. | def reconcile_samples(self, samples):
if self.seq_axis:
# bring the axis to iterate in the beginning
samples = mx.nd.moveaxis(samples, self.seq_axis, list(range(len(self.seq_axis))))
out = [
mx.nd.dot(samples[idx], self.M, transpose_b=True)
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def MC_samples(self, M=100):\n\n p = np.zeros([M, self.dim])\n counter = 0\n for dist in self.distributions:\n p[:, range(counter, counter+dist.dim)] = dist.MC_samples(M=M)\n counter += dist.dim\n\n # Each component distribution already applies\n # transform... | [
"0.68689907",
"0.6459533",
"0.63349444",
"0.63169754",
"0.6135894",
"0.5934055",
"0.5866705",
"0.5834275",
"0.57778525",
"0.57236344",
"0.5648233",
"0.56038547",
"0.5575883",
"0.5536027",
"0.55270064",
"0.5512958",
"0.5495944",
"0.54808635",
"0.54745984",
"0.5460248",
"0.5452... | 0.64627755 | 1 |
Create LinkedListNode self with data value and successor next_. | def __init__(self, value: object,
next_: Union["LinkedListNode", None]=None) -> None:
self.value, self.next_ = value, next_ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, value):\n self.data = value # The value\n self.next = None # A pointer to the next node in the list (Note Python doesnt have pointers)",
"def __init__(self, value, next=None):\n self.value = value # element at the node\n self.next = next # reference to next node ... | [
"0.68798256",
"0.6871054",
"0.6702204",
"0.6672261",
"0.66560686",
"0.66518354",
"0.66054815",
"0.6592395",
"0.65869045",
"0.658104",
"0.6536309",
"0.6536309",
"0.6536309",
"0.6536309",
"0.6525628",
"0.65224385",
"0.64992064",
"0.6470329",
"0.6412459",
"0.63796616",
"0.637063... | 0.6803636 | 2 |
Create an empty linked list. | def __init__(self) -> None:
self.front, self.back, self.size = None, None, 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createEmptyList():\n \n lst = MyList( None, 0, None )\n return lst",
"def __init__(self, nodes: list = None) -> None:\n\n self.head = None\n\n if nodes is not None:\n self.head = Node(nodes.pop(0))\n\n self.tail = self.head\n for i in nodes:\n ... | [
"0.7497289",
"0.7054903",
"0.7018865",
"0.6902276",
"0.6841316",
"0.683314",
"0.67393184",
"0.6683636",
"0.6645305",
"0.66326267",
"0.66236025",
"0.6618072",
"0.6615891",
"0.6610747",
"0.6609567",
"0.6609567",
"0.6609567",
"0.6609567",
"0.6609567",
"0.66072685",
"0.66072685",... | 0.0 | -1 |
Insert a new LinkedListNode with value after self.back. >>> lnk = LinkedList() >>> lnk.append(5) >>> lnk.size 1 >>> print(lnk.front) 5 >| >>> lnk.append(6) >>> lnk.size 2 >>> print(lnk.front) 5 > 6 >| | def append(self, value: object) -> None:
# create the new node
new_node = LinkedListNode(value)
# if the list is empty, the new node is front and back
if self.size == 0:
assert self.back is None and self.front is None, "ooops"
self.front = self.back = new_node
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append(self, value: object) -> None:\n # create the new node\n new_node = LinkedListNode(value)\n # if the list is empty, the new node is front and back\n if self.size == 0:\n assert self.back is None and self.front is None, \"ooops\"\n self.front = self.back =... | [
"0.7484425",
"0.741892",
"0.74038965",
"0.72755736",
"0.7215696",
"0.71664083",
"0.71613216",
"0.7092482",
"0.70800716",
"0.7074797",
"0.7042519",
"0.7028926",
"0.69669235",
"0.69540906",
"0.69334316",
"0.69280106",
"0.6910608",
"0.68845856",
"0.68802565",
"0.6868408",
"0.686... | 0.7505694 | 0 |
Compute a bounding_box filter on the given points | def bounding_box(points, min_x=-np.inf, max_x=np.inf, min_y=-np.inf,
max_y=np.inf):
bound_x = np.logical_and(points[:, 0] > min_x, points[:, 0] < max_x)
bound_y = np.logical_and(points[:, 1] > min_y, points[:, 1] < max_y)
bb_filter = np.logical_and(bound_x, bound_y)
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bound_box(points):\n min_x = np.amin(points[:, 0])\n min_y = np.amin(points[:, 1])\n min_z = np.amin(points[:, 2])\n\n max_x = np.amax(points[:, 0])\n max_y = np.amax(points[:, 1])\n max_z = np.amax(points[:, 2])\n\n return min_x, max_x, min_y, max_y, min_z, max_z",
"def get_bounding_box... | [
"0.72333217",
"0.67094684",
"0.6564637",
"0.65368694",
"0.65218604",
"0.6446489",
"0.64458615",
"0.6401899",
"0.63869166",
"0.6375178",
"0.63690543",
"0.63097906",
"0.62980825",
"0.62917554",
"0.6273993",
"0.6255171",
"0.62443024",
"0.623445",
"0.6216927",
"0.62077993",
"0.61... | 0.81597877 | 0 |
Takes as input a dictionary containing info about a single trip (datum) and its origin city (city) and returns the trip duration in units of minutes. Remember that Washington is in terms of milliseconds while Chicago and NYC are in terms of seconds. | def duration_in_mins(datum, city):
if city == 'Washington':
duration = int(datum['Duration (ms)']) / 60000
elif city == 'Chicago':
duration = int(datum['tripduration']) / 60
elif city == 'NYC':
duration = int(datum['tripduration']) / 60
return duration | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration_in_mins(datum, city):\n \n # YOUR CODE HERE\n if city == 'NYC' or city == 'Chicago':\n duration = int(datum['tripduration'])/60\n \n elif city == 'Washington':\n duration = int(datum['Duration (ms)'])/60000\n \n return duration",
"def duration_in_mins(datum... | [
"0.8178467",
"0.69736904",
"0.64471465",
"0.64392376",
"0.63273895",
"0.61905277",
"0.5689754",
"0.5679215",
"0.567809",
"0.56337",
"0.560629",
"0.5554471",
"0.5412293",
"0.53797555",
"0.53682303",
"0.53631514",
"0.5356803",
"0.5337673",
"0.5298274",
"0.529531",
"0.52764356",... | 0.80439216 | 1 |
Return true if layer geometry type is different than passed by geometry_type). | def not_geometry_type(self, layer, geometry_type):
return bool(geometry_type != self.geometry_type_as_string(layer)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supportInPlaceEdit(self, layer):\n return layer.geometryType() == QgsWkbTypes.PolygonGeometry",
"def test_check_false_geometry_type(self, testdata_tpls):\n testdata_tpls[\"geom\"] = Point([(13.476808430, 48.573711823)])\n assert not Triplegs._check(testdata_tpls)",
"def has_geom_valid(s... | [
"0.64524126",
"0.61094505",
"0.60763663",
"0.60598505",
"0.6015309",
"0.60005623",
"0.5980067",
"0.5951913",
"0.5943587",
"0.59430015",
"0.5882728",
"0.5710969",
"0.5708021",
"0.5548568",
"0.55459607",
"0.5506334",
"0.5491285",
"0.5488939",
"0.5473335",
"0.5458137",
"0.543621... | 0.89287335 | 0 |
The AMI ID to use for the worker nodes. Defaults to the latest recommended EKS Optimized Linux AMI from the AWS Systems Manager Parameter Store. | def ami_id(self) -> Optional[str]:
return pulumi.get(self, "ami_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def network_instance_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"network_instance_id\")",
"def machine_image_id(self):\n return self.__machine_image_id",
"def machine_id(self) -> str:\n return pulumi.get(self, \"machine_id\")",
"def get_instance_id() -> str:\n # https:/... | [
"0.60161126",
"0.59977704",
"0.5849893",
"0.5764395",
"0.5761719",
"0.5746564",
"0.5746564",
"0.5746564",
"0.5746564",
"0.5746564",
"0.5746564",
"0.5746564",
"0.57029533",
"0.5688598",
"0.5688598",
"0.5688598",
"0.5639754",
"0.5635216",
"0.5635216",
"0.56037885",
"0.56037885"... | 0.6673306 | 0 |
The AMI Type to use for the worker nodes. Only applicable when setting an AMI ID that is of type `arm64`. | def ami_type(self) -> Optional[str]:
return pulumi.get(self, "ami_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cpu_type(self) -> str:\n return self.__cpu_type",
"def worker_type(self) -> str:\n return pulumi.get(self, \"worker_type\")",
"def instance_type(self) -> Optional[str]:\n return pulumi.get(self, \"instance_type\")",
"def machine_type(self) -> str:\n return pulumi.get(self, \"m... | [
"0.61839217",
"0.6169491",
"0.6144272",
"0.6121505",
"0.6037769",
"0.6037769",
"0.6037769",
"0.6037769",
"0.6037769",
"0.6037769",
"0.6037769",
"0.6011652",
"0.59927595",
"0.59869194",
"0.59869194",
"0.59558666",
"0.5922172",
"0.59204143",
"0.59204143",
"0.58384746",
"0.58333... | 0.71204734 | 0 |
The tags to apply to the NodeGroup's AutoScalingGroup in the CloudFormation Stack. | def auto_scaling_group_tags(self) -> Optional[Mapping[str, str]]:
return pulumi.get(self, "auto_scaling_group_tags") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _tags(self):\n autoscaling_tag = [{self.TAG_KEY: 'metering.AutoScalingGroupName',\n self.TAG_VALUE: self.FnGetRefId()}]\n return super(AutoScalingGroup, self)._tags() + autoscaling_tag",
"def tags(self) -> Optional[Sequence['outputs.OceanVirtualNodeGroupLaunchSpecific... | [
"0.7627301",
"0.6352289",
"0.5985541",
"0.5975265",
"0.59567773",
"0.59137845",
"0.59137845",
"0.5777165",
"0.5755787",
"0.57423455",
"0.5734009",
"0.57086444",
"0.5688119",
"0.5685757",
"0.56692284",
"0.5626892",
"0.5626892",
"0.5626892",
"0.5626892",
"0.5626892",
"0.5626892... | 0.7493858 | 1 |
The ingress rule that gives node group access. | def cluster_ingress_rule(self) -> Optional['pulumi_aws.ec2.SecurityGroupRule']:
return pulumi.get(self, "cluster_ingress_rule") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_ingress_rules(self, group_name, src_group=None,\n ip_protocol=None, from_port=None, to_port=None,\n cidr_ip=None, group_id=None, src_group_id=None):\n\n return self.conn.authorize_security_group(\n group_name=group_name,\n src_s... | [
"0.6630129",
"0.6574815",
"0.62539",
"0.5980668",
"0.59710133",
"0.59084857",
"0.5660674",
"0.5593863",
"0.5538907",
"0.55298936",
"0.54639864",
"0.5442954",
"0.5442954",
"0.5442954",
"0.5442954",
"0.54360634",
"0.5393134",
"0.5326402",
"0.53137094",
"0.5297687",
"0.5222689",... | 0.7045185 | 0 |
Extra security groups to attach on all nodes in this worker node group. This additional set of security groups captures any user application rules that will be needed for the nodes. | def extra_node_security_groups(self) -> Optional[Sequence['pulumi_aws.ec2.SecurityGroup']]:
return pulumi.get(self, "extra_node_security_groups") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extra_node_security_groups(self) -> Sequence['pulumi_aws.ec2.SecurityGroup']:\n return pulumi.get(self, \"extra_node_security_groups\")",
"def _create_allow_all_security_group(self):\n pass",
"def set_apps_security_groups(self, reservation, app_security_group_models, ec2_session, logger):\n\n... | [
"0.72478366",
"0.65875924",
"0.56927586",
"0.50858945",
"0.5019555",
"0.49101016",
"0.48984176",
"0.48767778",
"0.48688573",
"0.47875565",
"0.47351614",
"0.47341818",
"0.47139433",
"0.46902812",
"0.46892196",
"0.465761",
"0.46564054",
"0.4628548",
"0.46116507",
"0.45971137",
... | 0.7019819 | 1 |
The ingress rule that gives node group access. | def instance_profile(self) -> Optional['pulumi_aws.iam.InstanceProfile']:
return pulumi.get(self, "instance_profile") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_ingress_rule(self) -> Optional['pulumi_aws.ec2.SecurityGroupRule']:\n return pulumi.get(self, \"cluster_ingress_rule\")",
"def add_ingress_rules(self, group_name, src_group=None,\n ip_protocol=None, from_port=None, to_port=None,\n cidr_ip=None,... | [
"0.7045185",
"0.6630129",
"0.6574815",
"0.62539",
"0.5980668",
"0.59710133",
"0.59084857",
"0.5660674",
"0.5593863",
"0.5538907",
"0.55298936",
"0.54639864",
"0.5442954",
"0.5442954",
"0.5442954",
"0.5442954",
"0.54360634",
"0.5393134",
"0.5326402",
"0.53137094",
"0.5297687",... | 0.0 | -1 |
The instance type to use for the cluster's nodes. Defaults to "t2.medium". | def instance_type(self) -> Optional[str]:
return pulumi.get(self, "instance_type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instance_type(self) -> Optional[pulumi.Input['InstanceInstanceType']]:\n return pulumi.get(self, \"instance_type\")",
"def instance_type(self) -> str:\n return self._instance_type",
"def instance_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"instance_type\")",
"def in... | [
"0.74742156",
"0.7230015",
"0.7202886",
"0.7202886",
"0.716582",
"0.70648396",
"0.70648396",
"0.69319904",
"0.6901739",
"0.6832877",
"0.6758593",
"0.65862083",
"0.65520936",
"0.63828135",
"0.635114",
"0.6310204",
"0.6262153",
"0.6246941",
"0.6246941",
"0.6243659",
"0.6213316"... | 0.75292885 | 0 |
Custom k8s node labels to be attached to each worker node. Adds the given key/value pairs to the `nodelabels` kubelet argument. | def labels(self) -> Optional[Mapping[str, str]]:
return pulumi.get(self, "labels") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _AddNodeLabels(bare_metal_node_pool_config_group):\n bare_metal_node_pool_config_group.add_argument(\n '--node-labels',\n metavar='KEY=VALUE',\n type=arg_parsers.ArgDict(),\n help='Labels assigned to nodes of a node pool.',\n )",
"def add_node_labels(self, node_labels=[]):\n self... | [
"0.70172405",
"0.68944615",
"0.63667464",
"0.6149053",
"0.61426544",
"0.6135429",
"0.6005861",
"0.58926964",
"0.5671727",
"0.5514719",
"0.54706854",
"0.54598904",
"0.5437578",
"0.5416307",
"0.54108864",
"0.54014325",
"0.5351181",
"0.5339831",
"0.5338594",
"0.53261554",
"0.531... | 0.0 | -1 |
The minimum number of worker nodes running in the cluster. Defaults to 1. | def min_size(self) -> Optional[int]:
return pulumi.get(self, "min_size") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_workers(self) -> int:\n return self._config.min_workers",
"def min_number_of_workers(self) -> Optional[int]:\n return pulumi.get(self, \"min_number_of_workers\")",
"def min_number_of_workers(self) -> Optional[int]:\n return pulumi.get(self, \"min_number_of_workers\")",
"def minim... | [
"0.8275826",
"0.8082609",
"0.8082609",
"0.793992",
"0.7909534",
"0.786897",
"0.78329027",
"0.78329027",
"0.76036245",
"0.7428952",
"0.7300214",
"0.7151624",
"0.71294135",
"0.7078325",
"0.6939308",
"0.6939308",
"0.69049364",
"0.68893594",
"0.67893106",
"0.67653835",
"0.6758734... | 0.0 | -1 |
The set of subnets to override and use for the worker node group. Setting this option overrides which subnets to use for the worker node group, regardless if the cluster's `subnetIds` is set, or if `publicSubnetIds` and/or `privateSubnetIds` were set. | def node_subnet_ids(self) -> Optional[Sequence[str]]:
return pulumi.get(self, "node_subnet_ids") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subnets(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:\n return pulumi.get(self, \"subnets\")",
"def subnets(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:\n return pulumi.get(self, \"subnets\")",
"def subnets(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:\n return pulum... | [
"0.65720046",
"0.65720046",
"0.65720046",
"0.65518695",
"0.598056",
"0.598056",
"0.58706194",
"0.58706194",
"0.5692734",
"0.56868845",
"0.56005466",
"0.56005466",
"0.5587119",
"0.552445",
"0.552445",
"0.5519085",
"0.5519085",
"0.544487",
"0.54033804",
"0.53188354",
"0.5285047... | 0.60383016 | 4 |
Desired Kubernetes master / control plane version. If you do not specify a value, the latest available version is used. | def version(self) -> Optional[str]:
return pulumi.get(self, "version") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_cluster_kubernetes_version(admin_mc):\n client = admin_mc.client\n cluster = client.by_id_cluster(\"local\")\n version = cluster.get(\"version\")\n if version is not None:\n k8s_version = int(version.get(\"gitVersion\")[3:5])\n if k8s_version >= 25:\n pytest.skip(\"Ne... | [
"0.6527791",
"0.64172614",
"0.62936413",
"0.6260679",
"0.59630924",
"0.59556824",
"0.5943324",
"0.5921796",
"0.59179294",
"0.5898825",
"0.58979857",
"0.58979857",
"0.5895854",
"0.58928156",
"0.588462",
"0.5873537",
"0.5873537",
"0.5873537",
"0.5873537",
"0.5873358",
"0.587335... | 0.5908804 | 11 |
The IAM Role attached to the EKS Cluster | def cluster_iam_role(self) -> 'pulumi_aws.iam.Role':
return pulumi.get(self, "cluster_iam_role") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def role(self) -> str:\n return pulumi.get(self, \"role\")",
"def role(self) -> str:\n return pulumi.get(self, \"role\")",
"def role(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"role\")",
"def role(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"role\")",
"d... | [
"0.76404023",
"0.76404023",
"0.7540189",
"0.7540189",
"0.7540189",
"0.7540189",
"0.7515741",
"0.7515741",
"0.74504715",
"0.74504715",
"0.74456835",
"0.74321014",
"0.7368527",
"0.7368527",
"0.73424274",
"0.72776234",
"0.71574754",
"0.7115127",
"0.7115127",
"0.71058387",
"0.701... | 0.85258186 | 0 |
The AutoScalingGroup name for the node group. | def auto_scaling_group_name(self) -> str:
return pulumi.get(self, "auto_scaling_group_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_name(self):\n return self.properties.get(\"GroupName\", None)",
"def group_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"group_name\")",
"def get_group_name(self):\n return self.name",
"def ad_group_name(self):\n\n return self._ad_group_name",
"def grou... | [
"0.7728036",
"0.7672007",
"0.75971955",
"0.7593044",
"0.74890614",
"0.7452526",
"0.7435842",
"0.7435842",
"0.72757626",
"0.72757626",
"0.7046822",
"0.7046822",
"0.7046822",
"0.7046822",
"0.7046822",
"0.70351386",
"0.7019712",
"0.7013539",
"0.7013539",
"0.7013539",
"0.7013539"... | 0.8530238 | 0 |
The value of the taint. | def value(self) -> str:
return pulumi.get(self, "value") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value(self): # for symmetry with untrusted.string\n return self._value",
"def value(self):\n return self.data.value",
"def Value(self):\n return self.inst.Value()",
"def Value(self):\n return self.inst.Value()",
"def value(self):\n return self.get_attribute(\"value\")... | [
"0.67540747",
"0.6341087",
"0.62963855",
"0.62963855",
"0.6257331",
"0.62451506",
"0.62404555",
"0.62235963",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625",
"0.6211625... | 0.62043995 | 70 |
Get or set the probe attenuation factor. | def probe(self, c, channel, factor = None):
probeFactors = [1,10,20,50,100,500,1000]
dev = self.selectedDevice(c)
chString = 'CH%d:' %channel
if factor is None:
resp = yield dev.query(chString+'PRO?')
elif factor in probeFactors:
yield dev.write(chString+'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_attenuation(self):\n\n return (ord(self.get(0x0d, 1))/4.) * dB",
"def get_attenuation(self):\n\n return self._attenuation",
"def set_attenuation(self, attenuation):\n\n step = self.get_att_step_size()\n\n if isinstance(attenuation, Quantity):\n check_unit(attenuat... | [
"0.7092845",
"0.6685374",
"0.5897132",
"0.5852895",
"0.5757122",
"0.55631584",
"0.5479198",
"0.5437937",
"0.53972954",
"0.5374276",
"0.5366752",
"0.53605545",
"0.52622885",
"0.5246581",
"0.5233393",
"0.5219099",
"0.51992667",
"0.5190151",
"0.5171839",
"0.51292855",
"0.5111466... | 0.57109076 | 5 |
This method returns the message class associated with the action (cls.message_class by default) If cls.message_class is not provided, this method MUST be overriden | def get_message_class(cls):
return cls.message_class | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_message_class(self) -> Type[TMessage]:\n assert self.message_class is not None, (\n \"Please provide a `message_class` or override the `get_message_class` method\"\n )\n return self.message_class",
"def message_class(self) -> Type[Message]:\n return self._message_cl... | [
"0.7547302",
"0.7379721",
"0.7379721",
"0.6267552",
"0.6045476",
"0.6002014",
"0.5954299",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.59263575",
"0.... | 0.7973501 | 0 |
Components' means for all classes Returns array means array (n_components, n_classes) | def means(self):
return np.hstack([
gmm.means_.ravel()[order][:, np.newaxis] for order, gmm in self._models
]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def classes(self) -> np.ndarray:\n pass",
"def get_counts(data):\n pluses = 0\n minuses = 0\n for each in data:\n if each[CLASS_INDEX] == 1:\n pluses += 1\n else:\n minuses += 1\n return np.array([pluses, minuses])",
"def get_class_distribution(self):\n ... | [
"0.6623945",
"0.64971083",
"0.6339757",
"0.6332414",
"0.62688017",
"0.62212765",
"0.61390793",
"0.6124415",
"0.6117912",
"0.60262156",
"0.6024994",
"0.60169643",
"0.59814286",
"0.5947976",
"0.5927263",
"0.5896094",
"0.58687097",
"0.58561313",
"0.5854294",
"0.58197826",
"0.580... | 0.5827841 | 19 |
Compute the weighted log probabilities for each sample. | def score_samples(self, X):
scores = []
for x, (order, gmm) in zip(X.T, self._models):
x = self.normalize(x, test_mode=True)
s = gmm.score_samples(x[:, np.newaxis])[:, np.newaxis]
scores.append(s)
return np.mean(np.hstack(scores), axis=1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_probs(self, X):\n check_is_fitted(self)\n # formerly _estimate_weighted_log_prob\n return self.comp_log_probs(X) + np.log(self.weights_)",
"def generate_weight_probabilities(logit_weights):\n weight_probabilities = torch.exp(logit_weights)\n weight_probabilities = weight_probab... | [
"0.74871975",
"0.732488",
"0.7033256",
"0.6905904",
"0.68163025",
"0.680658",
"0.67390096",
"0.6685089",
"0.65983903",
"0.65912265",
"0.6586799",
"0.6566232",
"0.6540114",
"0.64600694",
"0.64404655",
"0.63742065",
"0.6370189",
"0.6332009",
"0.629462",
"0.6293768",
"0.6289921"... | 0.0 | -1 |
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`. | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None):
bsz, src_len = mask.size()
tgt_len = tgt_len if tgt_len is not None else src_len
expanded_mask = mask[:, None, None, :].expand(bsz, 1, tgt_len, src_len).to(dtype)
inverted_mask = 1.0 - expanded_mask
return in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __make_attention_mask(self) ->None:\n if self.shift_size > 0:\n height, width = self.input_resolution\n mask: torch.Tensor = torch.zeros(height, width, device=self.window_attention.tau.device)\n height_slices: Tuple = (slice(0, -self.window_size), slice(-self.window_size... | [
"0.6929247",
"0.6760313",
"0.67452896",
"0.66927385",
"0.6600673",
"0.63820195",
"0.6313981",
"0.62987995",
"0.6134183",
"0.6109473",
"0.6088634",
"0.60683393",
"0.6020113",
"0.59373564",
"0.59196967",
"0.5901479",
"0.58996546",
"0.5880264",
"0.5876046",
"0.58672315",
"0.5840... | 0.62143844 | 8 |
Add other as a child to this traversal_node along the provided edge. | def add_child(self, child_node: TraversalNode, edge: Edge) -> None:
addresses = edge.split_by_address(self.address) # (traversal_node -> other)
if addresses:
self_address, other_address = addresses
append(
self.children,
other_address.collection_a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_edge(self, edge):\n self.edges.append(edge)\n i, j = edge\n self.parent[self.find(i)] = self.find(~j)",
"def add_edge(self, edge):\n\n super().add_edge(edge)\n vertex2, vertex1 = edge\n self.add_vertex(vertex2)\n self.add_vertex(vertex1)\n self.__pa... | [
"0.72919416",
"0.7263819",
"0.6998892",
"0.6741129",
"0.6707386",
"0.6678997",
"0.6623954",
"0.6616764",
"0.6609373",
"0.6588542",
"0.6587223",
"0.6548996",
"0.64918137",
"0.643299",
"0.6431541",
"0.64222866",
"0.6421374",
"0.6421374",
"0.6401888",
"0.64010346",
"0.63912433",... | 0.7757607 | 0 |
Determine the scoring value of a card. | def value_of_card(card):
if card == 'A':
return 1
if card in ROYALTY:
return 10
return int(card) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_score(self):\n s = 0\n for c in self.hand:\n if c.face_up:\n s += c.card_value\n self.score = s",
"def calculate_score(self):\n self.score = 0\n for card in self.cards:\n self.score += card.value",
"def score(self):\n score ... | [
"0.7728268",
"0.75836074",
"0.74652666",
"0.744398",
"0.7353404",
"0.7343205",
"0.7307973",
"0.7263483",
"0.70772165",
"0.70508635",
"0.70389026",
"0.7024515",
"0.70155996",
"0.6978037",
"0.6971441",
"0.6956104",
"0.6950151",
"0.692135",
"0.6896419",
"0.6893301",
"0.6892118",... | 0.7507887 | 2 |
Determine if the hand is a 'natural' or 'blackjack'. | def is_blackjack(c1, c2): # pylint: disable=invalid-name
if 'A' not in (c1, c2):
return False # can't have a natural BJ w/o an 'A'
# assert: one of the two cards *is* an 'A'!
non_ace = c2 if c1 == 'A' else c1
# Yes, I like the idea just testing: in str
# ORIG: return non_ace in list('JQK... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isRoyal(hand):\n\n # Get hand ranks and suits information from cards\n cards, ranks, suits = handInfo(hand)\n\n if \"A\" in ranks:\n if \"K\" in ranks:\n if \"Q\" in ranks:\n if \"J\" in ranks:\n if \"10\" in ranks:\n return Tr... | [
"0.6864546",
"0.6602015",
"0.6597017",
"0.6409717",
"0.637742",
"0.6366793",
"0.636171",
"0.63142616",
"0.63004684",
"0.6150511",
"0.61367965",
"0.61020315",
"0.60783666",
"0.60717773",
"0.6026342",
"0.6021771",
"0.6003641",
"0.60034436",
"0.59702384",
"0.59690565",
"0.594003... | 0.587193 | 25 |
Supported quantization modes for activation about per_tensor or per_channel. | def support_a_modes(self):
return ('per_tensor') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def support_w_modes(self):\n return ('per_tensor', 'per_channel')",
"def quant_custom_ops():\n custom_ops = {QuantConv: count_quant_conv,\n nn.BatchNorm2d: zero_ops}\n return custom_ops",
"def _query_quantizable_ops(self, matched_nodes):\n uint8_type = self.query_handler.ge... | [
"0.63158655",
"0.60756785",
"0.6025451",
"0.5953445",
"0.58380824",
"0.5830095",
"0.5738822",
"0.56760246",
"0.56718284",
"0.5665037",
"0.5657447",
"0.56548923",
"0.5626821",
"0.5577559",
"0.55355996",
"0.5405712",
"0.53824604",
"0.53289413",
"0.5328817",
"0.52413654",
"0.519... | 0.6649363 | 0 |
Encodes a tree to a single string. | def serialize(self, root):
if not root: return '[]'
data = []
queue = [root]
while queue:
length = len(queue)
for i in range(length):
node = queue.pop(0)
if node:
data.append(node.val)
queue.a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encodeTree(self, tree, key):\n return self.encode(pickle.dumps(tree), key)",
"def serialize(self, root):\n if not root:\n return \"n\"\n s = \"\"\n stack = [root]\n while (stack):\n root = stack.pop(0)\n if root:\n s += str(ro... | [
"0.78278124",
"0.7515946",
"0.71304095",
"0.7053364",
"0.7031874",
"0.6999469",
"0.6999095",
"0.69672054",
"0.69332165",
"0.68838483",
"0.68657243",
"0.68548083",
"0.6809354",
"0.6801677",
"0.67984694",
"0.6773517",
"0.6766546",
"0.6754318",
"0.67507386",
"0.6745785",
"0.6664... | 0.6504807 | 36 |
Backward if nonzero gradient is out of a face. | def test_backward_case1():
vertices = [[0.8, 0.8, 1.], [0.0, -0.5, 1.], [0.2, -0.4, 1.]]
faces = [[0, 1, 2]]
pxi = 35
pyi = 25
grad_ref = [
[1.6725862, -0.26021874, 0.],
[1.41986704, -1.64284933, 0.],
[0., 0., 0.],
]
renderer = Renderer()
renderer.image_size = 6... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _backward(self, gradient: np.ndarray) -> None:\n self.gradients = [gradient]\n for axis in self.backward_axis:\n self.gradients = [np.expand_dims(self.gradients[0], axis=axis)]",
"def backward(self, forwards, label):\n bound = 6\n if forwards > bound:\n gradi... | [
"0.68312794",
"0.67902994",
"0.6778169",
"0.6741348",
"0.6726982",
"0.6667187",
"0.66659653",
"0.6645126",
"0.6620089",
"0.6578389",
"0.65656",
"0.65551937",
"0.65216637",
"0.6513173",
"0.6483881",
"0.6451499",
"0.6433598",
"0.63995165",
"0.6390894",
"0.6390894",
"0.6371721",... | 0.63940835 | 18 |
Backward if nonzero gradient is out of a face. | def test_backward_rgb_th1():
vertices = np.array([[0.8, 0.8, 1.], [0.0, -0.5, 1.], [0.2, -0.4, 1.]])
faces = np.array([[0, 1, 2]]).astype('int32')
textures = np.ones((faces.shape[0], 4, 4, 4, 3), 'float32')
pxi = 35
pyi = 25
grad_ref = np.array([
[1.6725862, -0.26021874, 0.],
[1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _backward(self, gradient: np.ndarray) -> None:\n self.gradients = [gradient]\n for axis in self.backward_axis:\n self.gradients = [np.expand_dims(self.gradients[0], axis=axis)]",
"def backward(self, forwards, label):\n bound = 6\n if forwards > bound:\n gradi... | [
"0.68312794",
"0.67902994",
"0.6778169",
"0.6741348",
"0.6726982",
"0.6667187",
"0.66659653",
"0.6645126",
"0.6620089",
"0.6578389",
"0.65656",
"0.65551937",
"0.65216637",
"0.6513173",
"0.6483881",
"0.6451499",
"0.6433598",
"0.63995165",
"0.63940835",
"0.6390894",
"0.6390894"... | 0.0 | -1 |
Backward if nonzero gradient is on a face. | def test_backward_silhouette_th_2():
vertices = np.array([[0.8, 0.8, 1.], [-0.5, -0.8, 1.], [0.8, -0.8, 1.]])
faces = np.array([[0, 1, 2]])
textures = np.ones((faces.shape[0], 4, 4, 4, 3), 'float32')
pyi = 40
pxi = 50
grad_ref = np.array([
[0.98646867, 1.04628897, 0.],
[-1.03415... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _backward(self, gradient: np.ndarray) -> None:\n self.gradients = [gradient]\n for axis in self.backward_axis:\n self.gradients = [np.expand_dims(self.gradients[0], axis=axis)]",
"def backward(self, grad: Tensor) -> Tensor:\n raise NotImplementedError",
"def backward(self, f... | [
"0.68303776",
"0.66918063",
"0.6663514",
"0.66396964",
"0.66095686",
"0.66032803",
"0.6564957",
"0.6555859",
"0.6537485",
"0.651517",
"0.65131515",
"0.6510324",
"0.6501039",
"0.65003",
"0.6489338",
"0.64614475",
"0.64079225",
"0.6403113",
"0.6382507",
"0.6339412",
"0.6339412"... | 0.0 | -1 |
Assert that profile and profilepath are not specified simultaneously. | def deny_profile_and_path(cls, profile: str, profile_path: str) -> None:
if profile is not None and profile_path is not None:
raise click.UsageError(
"--profile and --profile-path options cannot be specified simultaneously"
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_verify_profile_name_raises(get_msg, get_cfg):\n msg = get_msg\n cfg = get_cfg\n with pytest.raises(UnknownProfileError):\n verify_profile_name(msg, cfg)",
"def test_is_profile_of_with_invalid_profile_returns_false(self):\n patient = patient_pb2.Patient()\n observation = observation... | [
"0.6592031",
"0.6361495",
"0.62935877",
"0.6278085",
"0.6240009",
"0.61710423",
"0.61056453",
"0.60949",
"0.60440916",
"0.6037484",
"0.6000353",
"0.6000353",
"0.59977865",
"0.5969464",
"0.5904283",
"0.58764935",
"0.58492154",
"0.583909",
"0.5835898",
"0.5824574",
"0.58189166"... | 0.7841044 | 0 |
Test HAL server API haveSomeMemory(), which returns hidl_memory. haveSomeMemory() returns input memory directly. We pass the client memory object to this API, and the return value of this API should be registered in our targetside drivers as well. The returned memory object is basically identical to the first memory ob... | def testSameMemoryDifferentId(self):
# Prepare a hidl_memory argument.
var_msg = self.prepareHidlMemoryArgument(self._mem_obj.memId)
# memory_client2 is identical to self._mem_obj because
# haveSomeMemory() API in the server just returns the input
# hidl_memory reference directl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testSharedMemory(self):\n # Zero out memory.\n self._mem_obj.update()\n self._mem_obj.updateBytes(\"\\0\" * self.MEM_SIZE, self.MEM_SIZE)\n self._mem_obj.commit()\n\n # Tell HAL server to fill the memory, should be seen by the client,\n # because they use shared memory... | [
"0.68028533",
"0.64083034",
"0.62504077",
"0.6232818",
"0.619822",
"0.59260696",
"0.59138465",
"0.58626306",
"0.5719195",
"0.5714825",
"0.5682939",
"0.5663314",
"0.5648751",
"0.5646976",
"0.5642872",
"0.56413496",
"0.55961835",
"0.55899227",
"0.55552834",
"0.5544043",
"0.5532... | 0.7383785 | 0 |
Finds the ordinal of a character and sets it relative to bottom ordinal within a range (see header). | def relOrdCharacter(character, bottomRangeNumber):
return ord(character) - bottomRangeNumber | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toIndex ( x ):\n if u'0' <= x <= u'9':\n return ord(x) - ord('0') + DigB\n elif isLetter(x):\n return Mapping[ord(x)]\n else:\n return 0",
"def position_to_char(number, upper):\n mod = 65 if upper else 97\n return chr(number + mod)",
"def trans_pin(ch):\n # ch should ... | [
"0.67441535",
"0.6337403",
"0.61032104",
"0.604996",
"0.6021605",
"0.59708244",
"0.59339774",
"0.5917764",
"0.58616346",
"0.58616346",
"0.58616346",
"0.5844495",
"0.58200353",
"0.5792331",
"0.577812",
"0.5720441",
"0.5680361",
"0.5660609",
"0.5622256",
"0.56136835",
"0.559194... | 0.76530725 | 0 |
Check if the user is anonymous. | def is_anonymous(self):
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_anonymous(self):\n return not self.is_authenticated()",
"def is_anonymous(self):\n\n if isinstance(self, AnonymousUserMixin):\n return True\n else:\n return False",
"def is_anonymous(self):\n return not self.is_authenticated()",
"def is_anonymous(self):\n ... | [
"0.82257867",
"0.81401455",
"0.81400126",
"0.813751",
"0.79920083",
"0.7897385",
"0.77879626",
"0.77425957",
"0.77095455",
"0.77095455",
"0.77095455",
"0.77095455",
"0.75688994",
"0.7357216",
"0.73459345",
"0.72914606",
"0.71936816",
"0.7160927",
"0.7109869",
"0.70186174",
"0... | 0.7729205 | 24 |
Get the user's ID. | def get_id(self):
return self.id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_id(self):\n return self.user_id",
"def get_user_id(self):\n return self.authenticate()['user_id']",
"def get_id(self):\n\n return(self.user_id)",
"def get_user_id(self):\n return self.user_id",
"def get_user_id(self):\n pass",
"def get_user_id(self):\n ap... | [
"0.8626032",
"0.8612456",
"0.85651517",
"0.84455127",
"0.840255",
"0.83924973",
"0.8302554",
"0.824757",
"0.824757",
"0.8228962",
"0.82061845",
"0.8204854",
"0.81499994",
"0.8099929",
"0.80891466",
"0.8085188",
"0.8085188",
"0.80747366",
"0.80747366",
"0.80747366",
"0.806606"... | 0.0 | -1 |
This function returns a Pyramid WSGI application. | def main(global_config, **settings):
engine = engine_from_config(settings, 'sqlalchemy.', poolclass=NullPool)
DBSession.configure(bind=engine)
Base.metadata.bind = engine
Base.metadata.create_all(engine)
config = Configurator(
settings=settings,
authentication_policy=SessionAuthentic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wsgi_app():\n return bottle.default_app()",
"def app():\n return create_app()",
"def app():\n app = server.app\n return app",
"def make_app():\n config = Configurator()\n config.add_renderer('.jinja2', pyramid_jinja2.Jinja2Renderer)\n config.add_route('root_view', '/')\n\n config.... | [
"0.78450423",
"0.770514",
"0.767341",
"0.7536136",
"0.7503487",
"0.7387394",
"0.73840666",
"0.73103166",
"0.7283062",
"0.7275409",
"0.7248791",
"0.72464615",
"0.7243119",
"0.7225271",
"0.7212488",
"0.7211924",
"0.7181437",
"0.7156857",
"0.71322036",
"0.7111742",
"0.70959747",... | 0.0 | -1 |
Assert that expiry date is validated. | def test_validate_expiry_date(session, test_name, restoration_type, delta_date, is_valid):
business = Business(identifier='BC1234567', legal_type='BC')
expiry_date = LegislationDatetime.now()
if delta_date:
expiry_date = expiry_date + delta_date
filing = copy.deepcopy(FILING_HEADER)
filing[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_8_invalid_expiration_date(self):\n res = self.client().post('/insurance/policy/', data=json.dumps(self.invalid_expiration_date))\n self.assertEqual(res.status_code, 400)\n message = json.loads(res.data)[\"message\"]\n self.assertEqual(message, \"Expiration date must be greater ... | [
"0.752491",
"0.7442643",
"0.7288361",
"0.7170833",
"0.70682955",
"0.69911814",
"0.69861746",
"0.6978489",
"0.6894704",
"0.67903584",
"0.6695166",
"0.66642356",
"0.65844005",
"0.65589577",
"0.6557429",
"0.65456563",
"0.64830124",
"0.6443541",
"0.6369817",
"0.6343454",
"0.63330... | 0.7792582 | 0 |
Check if action is an OS scan Returns bool True if action is an OS scan, otherwise False | def is_os_scan(self):
return isinstance(self, OSScan) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_scan(self):\n return isinstance(self, (ServiceScan, OSScan, SubnetScan, ProcessScan))",
"def linux_action(self) -> Optional[bool]:\n return pulumi.get(self, \"linux_action\")",
"def _is_valid_action(self, action):\n if action == SHIFT:\n return self._can_shift()\n ... | [
"0.63405037",
"0.6087495",
"0.5852838",
"0.582331",
"0.58019453",
"0.57636243",
"0.57604706",
"0.5737336",
"0.5725199",
"0.5695604",
"0.5661607",
"0.5657535",
"0.5599549",
"0.5567774",
"0.5529156",
"0.5506441",
"0.5496879",
"0.5463079",
"0.5454719",
"0.54529375",
"0.5433693",... | 0.7251343 | 0 |
Sets the speed multiplicator for the current grid | def set_speed(self, speed):
self.__speed = speed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_grid_speed(self, id_, speed):\n self._linked_grids[id_].set_speed(speed)",
"def set_speed(self, speed):\n self.node.set_dimmer(self.values.primary.value_id, SPEED_TO_VALUE[speed])",
"def set_multiplier(self, *args, **kwargs):\n return _qtgui_swig.time_raster_sink_f_sptr_set_multipl... | [
"0.6939596",
"0.6591866",
"0.6560778",
"0.6489903",
"0.64102185",
"0.64039665",
"0.6371567",
"0.63549966",
"0.6332226",
"0.6322164",
"0.62679374",
"0.6261474",
"0.6224642",
"0.6205316",
"0.6187639",
"0.61863816",
"0.61861783",
"0.61410975",
"0.6070796",
"0.60633165",
"0.60601... | 0.6105278 | 18 |
Sets the speed multiplicator for a linked grid | def set_grid_speed(self, id_, speed):
self._linked_grids[id_].set_speed(speed) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_speed(self, speed):\n self.node.set_dimmer(self.values.primary.value_id, SPEED_TO_VALUE[speed])",
"def set_multiplier(self, *args, **kwargs):\n return _qtgui_swig.time_raster_sink_f_sptr_set_multiplier(self, *args, **kwargs)",
"def set_multiplier(self, *args, **kwargs):\n return _q... | [
"0.6513889",
"0.6241443",
"0.62030166",
"0.6184632",
"0.61477226",
"0.6130536",
"0.6118899",
"0.5966024",
"0.59314346",
"0.5928098",
"0.59256244",
"0.5921108",
"0.59207124",
"0.59102595",
"0.58788747",
"0.5857265",
"0.58259904",
"0.5824985",
"0.5788234",
"0.5781604",
"0.57667... | 0.72426826 | 0 |
Write JSON |data| as minified output to |path|. | def minify_json_data(data, path):
with open(path, 'w', encoding='utf-8') as fp:
json.dump(data, fp, separators=(',', ':'), sort_keys=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minify_json(path):\n with open(path, encoding='utf-8') as fp:\n data = json.load(fp)\n minify_json_data(data, path)",
"def write_json_file(data, path):\n\n prepare_dir(path)\n with open(path, \"w\") as dstfile:\n json.dump(data, dstfile, indent=2)",
"def dump_json(data, path):\n\n... | [
"0.75461745",
"0.7391826",
"0.7297091",
"0.72686917",
"0.70956945",
"0.69082576",
"0.6887421",
"0.68633264",
"0.6837869",
"0.6832105",
"0.6806464",
"0.67860985",
"0.6730631",
"0.67077005",
"0.66634566",
"0.6645428",
"0.6639088",
"0.6615563",
"0.65440375",
"0.65227085",
"0.650... | 0.83657736 | 0 |
See if |path| should be ignored. | def excluded(path):
for exc in EXCLUDE_PATTERNS + extra_exclude:
if fnmatch.fnmatch(path, exc):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _should_ignore(self, path):\n for ignore in self.options.ignores:\n if fnmatch.fnmatch(path, ignore):\n return True\n return False",
"def _is_path_ignored(self, path):\n if self.ignore_links and os.path.islink(path):\n return True\n for idir in... | [
"0.7836594",
"0.77699906",
"0.7571748",
"0.7426255",
"0.7378743",
"0.72358435",
"0.71908206",
"0.71492696",
"0.714073",
"0.712927",
"0.6927044",
"0.6907647",
"0.6905744",
"0.6848555",
"0.67796165",
"0.6756945",
"0.6679499",
"0.65872234",
"0.6568477",
"0.65591526",
"0.6533324"... | 0.676348 | 15 |
Method to get_management_ip of this vm. | def get_management_ip(cls, client_object, **kwargs):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def manage_ip(self):\n return self._manage_ip",
"def _vm_get_ip(self, vm_instance):\n raise NotImplementedError()",
"def management_cidr(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"management_cidr\")",
"def get_machine_ip( self ):\n return gethostbyname(gethostname())"... | [
"0.74905884",
"0.68326694",
"0.64791906",
"0.6376286",
"0.6306106",
"0.62878585",
"0.62878585",
"0.6235973",
"0.6154984",
"0.6121094",
"0.605301",
"0.6039895",
"0.6029876",
"0.602319",
"0.59954923",
"0.59954923",
"0.59954923",
"0.59954923",
"0.59954923",
"0.59954923",
"0.5995... | 0.7702096 | 0 |
Return when the question is recently published. | def was_published_recently(self):
now = timezone.now()
return now - datetime.timedelta(days=1) <= self.pub_date <= now | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_was_published_recently_with_current_question(self):\n\n time = timezone.now() - datetime.timedelta(hours=1)\n question = Question(pub_date=time)\n self.assertIs(question.was_published_recently(), True)",
"def was_published_recently(self):\n now = timezone.now()\n retur... | [
"0.72909033",
"0.72509086",
"0.7217818",
"0.7200813",
"0.71517533",
"0.71219516",
"0.7086019",
"0.70765686",
"0.70674163",
"0.70674163",
"0.70482785",
"0.7043031",
"0.70423007",
"0.7030767",
"0.7013466",
"0.698909",
"0.698206",
"0.6979078",
"0.6978187",
"0.6977395",
"0.697350... | 0.74371934 | 1 |
Return true if voting is currently allowed for this question. | def can_vote(self):
now = timezone.now()
if (now <= self.end_date) and (now >= self.pub_date):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_vote(self):\n current_date = timezone.now()\n if (current_date >= self.pub_date and current_date < self.end_date):\n return True\n return False",
"def can_vote(self):\n if self.is_published() and timezone.now() <= self.end_date:\n return True\n ret... | [
"0.73247206",
"0.7161812",
"0.71182024",
"0.7019654",
"0.7014632",
"0.6952227",
"0.6871926",
"0.6637936",
"0.6550013",
"0.6475402",
"0.6463788",
"0.6444078",
"0.6436552",
"0.64004123",
"0.638115",
"0.6355602",
"0.63166153",
"0.6293962",
"0.62884426",
"0.6275787",
"0.62578243"... | 0.7416295 | 0 |
Returns the data on the current position of the head | def read_current_pos(self):
return self.tape.read() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def head(self):\n return self.data.head()",
"def head_element(self):\r\n return self.data[self.head]",
"def head_element(self):\r\n return self.data[self.head]",
"def peek(self):\n return self.head.data",
"def viewDataHead(self):\n return self.data.head()",
"def front(s... | [
"0.78835773",
"0.7685298",
"0.7685298",
"0.76683456",
"0.74466443",
"0.70488465",
"0.70072913",
"0.70072913",
"0.6999198",
"0.6873687",
"0.6780226",
"0.6778093",
"0.67737633",
"0.67461944",
"0.6675294",
"0.6660295",
"0.6659268",
"0.6658906",
"0.6652082",
"0.661454",
"0.655983... | 0.0 | -1 |
Returns whether the machine is currently in a halting state | def is_halted(self):
return self.halted | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_shutting_down() -> bool:\n return SHUTDOWN.is_set()",
"def isStopping(self):\n return _yarp.Thread_isStopping(self)",
"def isStopping(self):\n return _yarp.RFModule_isStopping(self)",
"def assumed_state(self) -> bool:\n return not self.device.states",
"def is_stopped(self):\n... | [
"0.6685741",
"0.66608644",
"0.666049",
"0.66024613",
"0.65309036",
"0.6475205",
"0.6394681",
"0.63599795",
"0.6261386",
"0.62604785",
"0.62318057",
"0.6221775",
"0.62137145",
"0.6199805",
"0.61963946",
"0.61814773",
"0.6171309",
"0.6170207",
"0.61514467",
"0.6147534",
"0.6081... | 0.71254563 | 0 |
tests that low MAF values pass the filters | def test_passes_filters_low_maf(self):
# check that low MAF values pass the filters
for pop in self.pops:
self.var.info[pop] = "0.001"
self.assertTrue(self.var.passes_filters())
# and check that MAF on the threshold still pass
self.va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_fails_filters_high_maf(self):\n \n # check th\n for pop in self.pops:\n var = self.var\n var.info[pop] = \"0.0101\"\n self.assertFalse(var.passes_filters())",
"def test_out_of_range_maf(self):\n \n self.var.info[\"AFR_AF\"] = \"-1\"\n ... | [
"0.7840747",
"0.7466245",
"0.6603248",
"0.6439217",
"0.643681",
"0.6410382",
"0.63554394",
"0.634449",
"0.63228047",
"0.6322152",
"0.62362653",
"0.6235861",
"0.62289023",
"0.62287563",
"0.62252384",
"0.6225012",
"0.6214135",
"0.6213986",
"0.6212368",
"0.6212255",
"0.62072915"... | 0.86107695 | 0 |
Returnes values for Position,Velocity,Acceleration in a tuple. | def Locational_Data(self):
return (self.Position(), self.Velocity(), self.Acceleration()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Acceleration(self, *acc):\n if(type(acc) == tuple and len(acc) == 2):\n # chescks the value senf is a tuble and tue tuple has only 2 values witht first value being an int\n # this makes sure only the first tupe of format (x,y) is used\n self.acceleration_x, self.accelera... | [
"0.7268919",
"0.7093977",
"0.6828721",
"0.6728411",
"0.66007555",
"0.6569513",
"0.6501421",
"0.64934826",
"0.63850254",
"0.6366532",
"0.6348476",
"0.63464206",
"0.6328197",
"0.63201725",
"0.63043094",
"0.6293022",
"0.6291888",
"0.62874955",
"0.628092",
"0.6272712",
"0.6267469... | 0.71333355 | 1 |
This function determines whether two linked lists are valid DNA pairs. | def is_pairing(dna_seq1, dna_seq2):
if dna_seq1 == None and dna_seq2 == None:
return True
if dna_seq1 == None or dna_seq2 == None:
return False
if dna_seq1.value == 'T':
if dna_seq2.value == 'A':
return is_pairing(dna_seq1.rest,dna_seq2.rest)
else:
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_pairs(pairs, chain):\n for primary, secondary in zip(chain[:-1], chain[1:]):\n if not (primary, secondary) in pairs and \\\n not (secondary, primary) in pairs:\n return False\n return True",
"def is_match(dna_seq1, dna_seq2):\n if dna_seq1 == None and dna_seq2 == No... | [
"0.6963209",
"0.67957574",
"0.65254027",
"0.64768386",
"0.6412749",
"0.63229483",
"0.6314883",
"0.6312521",
"0.6312521",
"0.6223422",
"0.6208447",
"0.6192752",
"0.61803067",
"0.61558384",
"0.61489326",
"0.6142326",
"0.6058019",
"0.60015714",
"0.59996533",
"0.5986643",
"0.5978... | 0.77008826 | 0 |
format time from seconds to string | def __format_time(self, time):
hours = time // 3600
time -= hours * 3600
minutes = time // 60
time -= minutes * 60
time_string = "%d:%d:%.2f" % (hours, minutes, time)
return time_string | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _fmt_time(seconds):\n return (\n str(datetime.timedelta(seconds=seconds))\n )",
"def _sec_to_str(t):\n return \"%d:%02d:%02d.%03d\" % \\\n reduce(lambda ll, b: divmod(ll[0], b) + ll[1:],\n [(t*1000,), 1000, 60, 60])",
"def _format_seconds(seconds: float) -> str:\n\n ... | [
"0.8430221",
"0.82654625",
"0.815404",
"0.8104169",
"0.80734307",
"0.8072846",
"0.8048984",
"0.79261386",
"0.7856605",
"0.78402346",
"0.78339905",
"0.781831",
"0.7817316",
"0.7813659",
"0.78094155",
"0.7787238",
"0.77669483",
"0.7761165",
"0.77597755",
"0.7741699",
"0.7705772... | 0.752873 | 29 |
Method fills in the Katakana table in the Katakana Database when the table is created for the first time. Note. This function is only called in the first time, when the database is created and it is filled with original raw katakana data. | def _create_katakana_baseline_data(self):
text = os.path.join(".", "data", "katakanas.csv")
with open(text) as katakana_baseline_file:
raw_katakana_data = katakana_baseline_file.readlines()
for i in range(1, len(raw_katakana_data)):
line = raw_katakana_data[i]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_katakana_db(self):\n self.create_katakana_database_connection()\n self._create_katakana_database_table()\n self._create_games_database_table()",
"def _create_katakana_database_table(self):\n self.create_katakana_database_connection()\n\n raw_existing_databases = ... | [
"0.80153376",
"0.74216086",
"0.6165395",
"0.5895853",
"0.57727164",
"0.55073047",
"0.5501841",
"0.54341304",
"0.5429817",
"0.5429817",
"0.5399537",
"0.5335819",
"0.5315214",
"0.5258582",
"0.522935",
"0.5221888",
"0.52140135",
"0.5124388",
"0.5108044",
"0.5101472",
"0.5087205"... | 0.6951207 | 2 |
Test that if the cancellation callback fails, the task is not marked as canceled | def test_cancel_callback_fails(self):
# Set up the task with a cancellation callback that raises an exception when called
task = self.create_task()
task.on_cancel = mock.Mock(side_effect=Exception)
task.status = TaskStatus.IN_PROGRESS
# If I cancel a task and its cancellation ca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_cancel_not_in_progress(self):\n # Set up the task with a cancellation callback\n task = self.create_task()\n task.on_cancel = mock.Mock()\n task.status = TaskStatus.NOT_STARTED\n\n # If I cancel a task that is not in progress\n cancel_result = task.cancel()\n\n ... | [
"0.83585894",
"0.8237158",
"0.7478757",
"0.7068008",
"0.70273453",
"0.6882814",
"0.6796367",
"0.6790909",
"0.6780552",
"0.6769873",
"0.67679685",
"0.6717474",
"0.66606385",
"0.6656298",
"0.6626977",
"0.66244805",
"0.66235334",
"0.66053003",
"0.6602595",
"0.6540036",
"0.650574... | 0.843942 | 0 |
ASCii keyboard = 32 ~ 125 function CHR('int') ORD('str') | def test1_chr_ord():
print('a =', ord('a')) # 97
print('A =', ord('A'), SEPERATOR) # 65
print('chr(97) =', chr(97))
print('chr(65) =', chr(65), SEPERATOR) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_keypress(self) -> str:\n c = self.pad.getch()\n if c >= 0 and c <= 255:\n return chr(c)\n elif c == curses.KEY_LEFT:\n return \"KEY_LEFT\"\n elif c == curses.KEY_RIGHT:\n return \"KEY_RIGHT\"\n elif c == curses.KEY_DOWN:\n retur... | [
"0.63983184",
"0.6370407",
"0.6341495",
"0.6177149",
"0.61713976",
"0.61665064",
"0.60746056",
"0.606929",
"0.60463274",
"0.596453",
"0.59629303",
"0.5936072",
"0.5921759",
"0.5884422",
"0.5870591",
"0.5860266",
"0.5858957",
"0.5857357",
"0.5837272",
"0.5833188",
"0.5805746",... | 0.63910216 | 1 |
Load json file as python object | def load_json(fdir, name):
path = os.path.join(fdir, name)
if not os.path.exists(path):
raise FileNotFoundError("Could not find json file: {}".format(path))
with open(path, "r") as f:
obj = json.load(f)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_to_object(fname):\n with open(fname, 'r') as f:\n data = json.load(f)\n return data",
"def from_json(cls, filename):\n with open(filename, \"r\") as ff:\n obj = json.load(ff, object_hook=decode_bilby_json)\n return obj",
"def from_json(cls, path):\n ... | [
"0.82077336",
"0.8159465",
"0.8023441",
"0.7976181",
"0.79332936",
"0.790934",
"0.7899668",
"0.7898076",
"0.78805685",
"0.7830482",
"0.78102416",
"0.77524257",
"0.77472776",
"0.7713201",
"0.7690808",
"0.7670954",
"0.76187557",
"0.7605234",
"0.75969696",
"0.7596201",
"0.758983... | 0.7155901 | 82 |
Just return the main page | def index(request):
return render(request, "index.html", {}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mainPage():\n return \"this is the main page /\"",
"def get_main_page():\n\n return render_template('main.html')",
"def main_page(self):\n return \"index.html\"",
"def show_main():\n if request.method == 'GET':\n return render_template('index.html')",
"def main_page(self):\n ... | [
"0.8028529",
"0.8020562",
"0.80013573",
"0.7850873",
"0.7768355",
"0.77002597",
"0.76467127",
"0.75881946",
"0.7549311",
"0.7528091",
"0.7412481",
"0.7338494",
"0.73301375",
"0.7312903",
"0.729152",
"0.7246133",
"0.7229641",
"0.72181517",
"0.7201605",
"0.71921843",
"0.7191942... | 0.0 | -1 |
Return a list of lists containing n elements. s > [(s0, s1, s2, ..., sn1), (sn, sn+1, sn+2, ..., s2n1), (s2n, s2n+1, s2n+2, ..., s3n1), ..., (sNn, sNn+1, sNn+2, ..., sMn1)]" | def group_iterable(
iterable: typing.Iterable, number: int
) -> typing.Iterator[typing.Any]:
return zip(*[iter(iterable)] * number) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def slices(s, n):\n\n if n == 0 or len(s) < n:\n raise ValueError(\"Incorrect input\")\n\n result = []\n for i in range(len(s) - n + 1):\n result.append([int(j) for j in s[i:i + n]])\n return result",
"def split_n(s, n):\n\tres = None\n\tif n == 0:\n\t\tres = []\n\telif n > 0:\n\t\tl = ... | [
"0.6927321",
"0.66532135",
"0.66107833",
"0.65339893",
"0.6532566",
"0.6532069",
"0.6532069",
"0.6520703",
"0.64827275",
"0.6464118",
"0.6463527",
"0.6458735",
"0.64404297",
"0.64274013",
"0.638592",
"0.638592",
"0.6368123",
"0.63598543",
"0.63388795",
"0.63317496",
"0.628927... | 0.0 | -1 |
Loads an Excitation Emission Matrix which is generated by the instrument. | def load_eem(filepath):
eem_df = pd.read_csv(filepath, sep="\t", index_col=0)
eem_df.dropna(how="all", axis=1, inplace=True)
eem_df.dropna(how="all", axis=0, inplace=True)
eem_df.columns = eem_df.columns.astype(float)
eem_df = eem_df.sort_index(axis=0)
eem_df = eem_df.sor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_matrix(file_num, ex):\r\n return np.loadtxt(\"{}/extrinsic.txt\".format(file_num)) if ex \\\r\n else np.loadtxt(\"{}/intrinsics.txt\".format(file_num))",
"def test_loading_from_file(manually_crafted_segy_file):\n\n dm = DataMatrix.load(manually_crafted_segy_file)\n\n # check the matrix i... | [
"0.6095574",
"0.5698815",
"0.53655505",
"0.52690005",
"0.5248537",
"0.517482",
"0.5170747",
"0.5162729",
"0.5137543",
"0.51267654",
"0.5115376",
"0.51132774",
"0.5109687",
"0.50959945",
"0.5061237",
"0.5002977",
"0.49921498",
"0.4973089",
"0.49615493",
"0.49497598",
"0.493052... | 0.51708597 | 6 |
Creates and saves a User with the given email, first name, last name and password. | def create_user(self, username=None, email=None, first_name=None, last_name=None, password=None):
if not email:
raise ValueError('Users must have an email address')
user = self.model(
username=username,
email=self.normalize_email(email),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_user(self, email, first_name, password, **extra_fields):\n if not email:\n raise ValueError('The given email must be set')\n email = self.normalize_email(email)\n if not first_name:\n raise ValueError('First Name is mandatory')\n first_name = self.get_f... | [
"0.8355854",
"0.8346432",
"0.8316829",
"0.8311254",
"0.8301912",
"0.82926583",
"0.8253985",
"0.82253015",
"0.8205645",
"0.82034343",
"0.8201999",
"0.8169745",
"0.8163523",
"0.8155051",
"0.81546277",
"0.8144393",
"0.813243",
"0.813243",
"0.81229454",
"0.8114456",
"0.81032705",... | 0.8445182 | 0 |
Creates and saves a superuser with the given email, first name, last name and password. | def create_superuser(self, username, email, password):
user = self.create_user(
username=username,
email=email,
password=password,
)
user.is_admin = True
user.is_active = True
user.save(using=self._db)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_superuser(self, email, first_name='', last_name='', password=None, **extra_fields):\n return self._create_user(\n email, password, first_name, last_name, is_staff=True, is_superuser=True, **extra_fields\n )",
"def create_superuser(self, email, first_name, last_name, password, ... | [
"0.83366114",
"0.8270452",
"0.82471263",
"0.8239875",
"0.8199541",
"0.8196143",
"0.8165484",
"0.8148393",
"0.812566",
"0.8118408",
"0.81170416",
"0.81056553",
"0.81038254",
"0.8079089",
"0.80566657",
"0.80341506",
"0.80155116",
"0.80155116",
"0.80155116",
"0.80144894",
"0.800... | 0.78491604 | 75 |
returns True if this is a beanstalk instance | def is_beanstalk_instance(i):
return i.tags.get("elasticbeanstalk:environment-name") is not None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def running(self) -> bool:\n try:\n bobber = self.client.containers.get('bobber')\n except docker.errors.NotFound:\n return False\n else:\n return True",
"def is_running_instance(config, ip, port):\n local_ip = socket.gethostbyname(socket.gethostname())\n ... | [
"0.65208334",
"0.61820525",
"0.5964865",
"0.5944995",
"0.59272736",
"0.5904355",
"0.5818805",
"0.58187354",
"0.58099055",
"0.5803991",
"0.5803991",
"0.5783975",
"0.57538134",
"0.574699",
"0.5745655",
"0.5731719",
"0.5717407",
"0.5702491",
"0.56901455",
"0.5687599",
"0.5668881... | 0.8473686 | 0 |
Overrides widget's default signal. Emiited when current item selection is changed. This will also toggles the state of `self.add_child_btn`. If a child item is selected, the "Add Child" button will be disabled. | def selection_item_changed(self, current, previous):
state = True
if not current or current.parent():
state = False
self.selectionItemChanged.emit(state) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __deleteButtonEnableSlot(self):\r\n\r\n self.parentController.deleteSearchButton.setEnabled(self.selectionModel().hasSelection())",
"def __connectSignals(self):\n \n self.itemDoubleClicked.connect(self._onItemDoubleClicked)\n self.itemSelectionChanged.connect(self._onItemSelection... | [
"0.57340485",
"0.55249643",
"0.55154085",
"0.5401258",
"0.53968936",
"0.5377802",
"0.52928567",
"0.5289531",
"0.52389044",
"0.5229181",
"0.51966923",
"0.5165598",
"0.5145492",
"0.5144298",
"0.5136493",
"0.51005524",
"0.50867045",
"0.5076771",
"0.5066829",
"0.505996",
"0.50253... | 0.57930845 | 0 |
Overrides widget's default signal. Emitted when the contents of the selected item in the column changes. | def tree_item_changed(self, item, column):
if self.rename_counter and self.prev_name != item.text(column):
# print '>>> renaming performed..'
self.rename_counter = False
item.setData(0, IsNewItemRole, True)
self.contentUpdates.emit()
#>>> TODO - To do a ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def selectionChanged(self):\r\n pass",
"def on_history_item_selection_changed(self, event):\n row = event.selected_item_pos\n self.signal_update_selection.emit(row)",
"def __modelUpdateSlot(self, _):\r\n \r\n self.connect(self.selectionModel(),\r\n QtCore.... | [
"0.69968045",
"0.67103434",
"0.64051837",
"0.6396434",
"0.6396434",
"0.62445486",
"0.6237426",
"0.61567765",
"0.6105832",
"0.605247",
"0.604056",
"0.58996505",
"0.5873977",
"0.5857069",
"0.58521104",
"0.58418405",
"0.5839323",
"0.5825641",
"0.58220184",
"0.5798532",
"0.577286... | 0.0 | -1 |
Move selected item up. If toplevel item is selected, the child items within will be moved along with it. | def move_item(self, direction=""):
selected = self.currentItem()
# Top-Level item in selection
if selected.parent() is None:
selected_index = self.indexOfTopLevelItem(selected)
selected_item = self.topLevelItem(selected_index)
self.takeTopLevelItem(s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_up(self):\n item_id = self.solar_cell_list.focus()\n self.solar_cell_list.move(item_id, self.solar_cell_list.parent(item_id),\n self.solar_cell_list.index(item_id) - 1)",
"def move_up(self):\n if self.top_index > 0:\n self.top_index -= 1",... | [
"0.72627324",
"0.70852166",
"0.68523276",
"0.67814577",
"0.6749013",
"0.67365634",
"0.6670118",
"0.6530159",
"0.6494765",
"0.6381992",
"0.63262296",
"0.62248635",
"0.6219827",
"0.6210041",
"0.6186315",
"0.6148809",
"0.6114511",
"0.61135495",
"0.61066663",
"0.60687983",
"0.604... | 0.7253848 | 1 |
Ensure selection in CustomTreeWidget during startup. Only the first item will be selected. | def initial_selection(self):
root_item = self._tree.invisibleRootItem()
if root_item.childCount():
self._tree.setCurrentItem(root_item.child(0)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_selection(self):\n si = self.shotverbrws.selected_indexes(0)\n if si:\n self.shot_ver_sel_changed(si[0])\n else:\n self.shot_ver_sel_changed(QtCore.QModelIndex())\n ai = self.assetverbrws.selected_indexes(0)\n if ai:\n self.asset_ver_sel_... | [
"0.682397",
"0.62709624",
"0.62584233",
"0.6173744",
"0.6117152",
"0.60693777",
"0.5954457",
"0.59501487",
"0.5947316",
"0.5947316",
"0.5945745",
"0.5904881",
"0.5902217",
"0.58321774",
"0.5824931",
"0.57978123",
"0.57816786",
"0.57812864",
"0.5778831",
"0.5735401",
"0.572287... | 0.7934394 | 0 |
Return the instrument_id for a given instrument. | def getInstrumentID(self, name, satellite_id=None):
try:
i_id = int(name)
sq = self.session.query(self.Instrument).get(i_id)
if sq is None:
raise DBNoData("No instrument_id {0} found in the DB".format(i_id))
return sq.instrument_id
except V... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_instrument_id(self):\n return self.send_and_recv('*IDN?')",
"def get_instrument_id(self, instrument_ticker):\n\n params = (instrument_ticker,)\n sql = \"\"\"\n select instr_id\n from Instrument\n where ticker = ?\n \"\"\"\n\n df = pd... | [
"0.76588047",
"0.7160061",
"0.6819779",
"0.6595176",
"0.64889354",
"0.63019437",
"0.62947506",
"0.6207771",
"0.6098946",
"0.60698867",
"0.59727126",
"0.57978415",
"0.5783207",
"0.5716624",
"0.5672155",
"0.5672155",
"0.5672155",
"0.5604395",
"0.55994064",
"0.5595174",
"0.55919... | 0.74674153 | 1 |
This function is used to check that the input for ID is a positive integer or a valid string. For e.g. if user passes 5 it will passed as an integer, but if user passes random string it will be passed as an string. | def _verify_param(self, input_value, action_result, type):
if input_value.isdigit() and int(input_value) != 0:
return input_value
elif type == 2:
return None
else:
try:
float(input_value)
return None
excep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_id(id, type):\n if id is None:\n return\n if id.strip() == \"\":\n raise H2OValueError(\"%s id cannot be an empty string: %r\" % (type, id))\n for i, ch in enumerate(id):\n # '$' character has special meaning at the beginning of the string; and prohibited anywhere else\n ... | [
"0.74372613",
"0.7186236",
"0.71196216",
"0.70283675",
"0.69676995",
"0.6926176",
"0.6909971",
"0.6884033",
"0.68759435",
"0.6815692",
"0.6790632",
"0.67516214",
"0.67214006",
"0.67090386",
"0.6687917",
"0.6680877",
"0.6680124",
"0.6650986",
"0.6650549",
"0.66452545",
"0.6610... | 0.0 | -1 |
Get singleton reference to the system object. | def spinSystemGetInstance():
global h_system
if h_system is None:
h_system = ctypes.c_void_p(0)
checkErrorCode(spindll.spinSystemGetInstance(ctypes.byref(h_system)), "spinSystemGetInstance") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def system(self):\r\n if self._system is None:\r\n url = self._url + \"/system\"\r\n self._system = SystemManager(url=url, gis=self._gis)\r\n return self._system",
"def get_instance():\n if not Singleton.obj:\n Singleton()\n return Singleton.obj",
"d... | [
"0.72400945",
"0.70176405",
"0.69279695",
"0.66151184",
"0.66031957",
"0.6519023",
"0.63630503",
"0.6354886",
"0.62525505",
"0.6217568",
"0.6204155",
"0.6164824",
"0.6117952",
"0.6117464",
"0.6115609",
"0.6114368",
"0.60966945",
"0.60966945",
"0.6071055",
"0.6070939",
"0.6013... | 0.6910708 | 3 |
Get a camera property, loading it if we don't already have it cached. | def getProperty(self, p_name):
if self.h_camera is None:
return
if not p_name in self.properties:
# Get node by searching the node maps to see if we can find it.
c_p_name = ctypes.c_char_p(p_name.encode(self.encoding))
h_node = ctypes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_camera(self):\n return self._camera",
"def camera():\n return _load(\"data/camera.png\")",
"def camera(self):\r\n return self.__camera",
"def get_current_camera(self):\n try:\n current_camera = int(self.__config[self.__camera][self.__current_camera])\n # ... | [
"0.637811",
"0.6324443",
"0.61122924",
"0.60818416",
"0.581853",
"0.5776324",
"0.5732995",
"0.5732995",
"0.5732995",
"0.57140565",
"0.5694735",
"0.5685534",
"0.5662965",
"0.5656006",
"0.5628013",
"0.561977",
"0.5613327",
"0.55981755",
"0.5585206",
"0.54281896",
"0.5406697",
... | 0.5496162 | 19 |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments. | def __init__(self, *args, **kwds):
if args or kwds:
super(FourWheelSteeringStamped, self).__init__(*args, **kwds)
# message fields cannot be None, assign default values for those that are
if self.header is None:
self.header = std_msgs.msg.Header()
if self.data is None:
self.d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwds):\n if args or kwds:\n super(BasicSafetyMessage, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.communication_header is ... | [
"0.80604553",
"0.8058745",
"0.7872343",
"0.7872343",
"0.7872343",
"0.7872343",
"0.7601895",
"0.75999975",
"0.75241876",
"0.7500251",
"0.7500251",
"0.74568015",
"0.7442945",
"0.7425396",
"0.7391005",
"0.7354887",
"0.7331799",
"0.7323837",
"0.73170865",
"0.729031",
"0.7279108",... | 0.74486274 | 12 |
serialize message with numpy array types into buffer | def serialize_numpy(self, buff, numpy):
try:
_x = self
buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
_x = self.header.frame_id
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize_numpy(self, buff, numpy):\n self.serialize(buff)",
"def serialize_numpy(self, buff, numpy):\n try:\n pass\n except struct.error as se: self._check_types(struct.error(\"%s: '%s' when writing '%s'\" % (type(se), str(se), str(locals().get('_x', self)))))\n except TypeError as te: ... | [
"0.7951902",
"0.7893947",
"0.78557163",
"0.7777795",
"0.7767061",
"0.7764195",
"0.7759716",
"0.77543503",
"0.77541",
"0.7737914",
"0.7676825",
"0.7675068",
"0.76686406",
"0.7663991",
"0.76047087",
"0.75877863",
"0.7567696",
"0.7563886",
"0.7556909",
"0.7555319",
"0.75448537",... | 0.7339025 | 65 |
compute the cost by negative log likelihood. | def calculate_loss_lr(y, tx, w):
pred = sigmoid2(tx.dot(w))
print(pred)
loss = y.T.dot(np.log(pred)) + (1 - y).T.dot(np.log(1 - pred))
return np.squeeze(- loss) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def objective(self):\n return - self.log_likelihood()",
"def neg_loglikelihood(beta, Y, X):\n # sum without NAs\n return -np.nansum(Y*np.matmul(X,beta) - scisp.log1p(1+scisp.expm1(np.matmul(X,beta))))",
"def training_cost(self, y):\n return self.negative_log_likelihood_sum(y)",
"d... | [
"0.72717863",
"0.7076344",
"0.70660806",
"0.705847",
"0.7013546",
"0.7012452",
"0.69643426",
"0.6950931",
"0.6936718",
"0.686507",
"0.6836971",
"0.6834444",
"0.6826144",
"0.6817311",
"0.68022966",
"0.6781188",
"0.6749588",
"0.674299",
"0.6737799",
"0.66925216",
"0.6691344",
... | 0.0 | -1 |
Calculate the checksum for a given file using the default hashlib | def calculate_checksum(filename):
m = hashlib.new(constants.DEFAULT_HASHLIB)
with open(filename, 'r') as f:
while 1:
file_buffer = f.read(CHECKSUM_READ_BUFFER_SIZE)
if not file_buffer:
break
m.update(file_buffer)
return m.hexdigest() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checksum(hashlib_algo, filename, **kwargs):\n block_size = kwargs.get(\"block_size\", 2 ** 20)\n hasher = hashlib_algo()\n with open(filename, \"rb\") as file:\n while True:\n data = file.read(block_size)\n if not data:\n break\n hasher.update(dat... | [
"0.7996205",
"0.78419244",
"0.7708356",
"0.7693757",
"0.7550348",
"0.7529813",
"0.7471911",
"0.74295",
"0.7414402",
"0.7339983",
"0.7319372",
"0.7313881",
"0.7287665",
"0.72594887",
"0.7217255",
"0.7214228",
"0.71929145",
"0.71605885",
"0.71406245",
"0.70790166",
"0.70731837"... | 0.78197634 | 2 |
Returns a dataloader with data from the test data set. If given a sampler we use that for the dataloader. | def get_new_test_data_loader(self, sampler=None):
if self.dataset.lower() == "mnist":
test_set = datasets.MNIST(root=self.root, train=False, transform=transforms.ToTensor(), download=True)
elif self.dataset == "lungscans":
data = DatasetLungScans(self.folders, self.resize, self.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_dataloader(self) -> Union[DataLoader, List[DataLoader], Dict[str, DataLoader]]:\n if not self._has_test:\n raise RuntimeError(\"No test dataset specified. Maybe set has_test=True in DataModule init.\")\n return DataLoader(self._test_, self._batch_size, shuffle=False, num_workers=s... | [
"0.7833872",
"0.7805992",
"0.7610206",
"0.7395019",
"0.71081364",
"0.6950687",
"0.6940898",
"0.689284",
"0.6883062",
"0.6853894",
"0.677365",
"0.6632213",
"0.6617782",
"0.66104007",
"0.6545228",
"0.654016",
"0.6512757",
"0.6509263",
"0.6494868",
"0.64297026",
"0.64249974",
... | 0.7794461 | 2 |
Extracts the value for AMI Bz from a snapshot dict. | def extract_ami_z(ds):
snapshot = json.loads(ds.snapshot)
return snapshot['station']['instruments']['AMI430_z']['parameters']['field']['value'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_Bz(ds):\n snapshot = json.loads(ds.snapshot)\n return snapshot['station']['instruments']['Rotated_Magnet']['parameters']['z']['value']",
"def get_snapshot(self, snapshot):\n return self._get(_snapshot.Snapshot, snapshot)",
"def parse_blob_snapshot_parameter(url):\n # type: (str) -> ... | [
"0.6685398",
"0.5188085",
"0.5139102",
"0.513898",
"0.49878165",
"0.4958876",
"0.47995874",
"0.47988203",
"0.47975653",
"0.47830573",
"0.47736296",
"0.47736296",
"0.4761493",
"0.47545627",
"0.47424984",
"0.47424984",
"0.47142446",
"0.46899766",
"0.46657413",
"0.46492252",
"0.... | 0.62725043 | 1 |
Extracts the value for the alignment angle gamma from a snapshot dict. | def extract_gamma(ds):
snapshot = json.loads(ds.snapshot)
return snapshot['station']['instruments']['Rotated_Magnet']['parameters']['gamma']['value'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_gamma(self) -> float:\n gamma_re = re.compile(r\"(?<=gamma\\s=)\\s+[0-9.]+\")\n gamma = gamma_re.search(self.body).group() #type: ignore\n return float(gamma)",
"def eval_gamma_str(gammas):\n gammas = leval(gammas)\n if isinstance(gammas, (tuple,list)):\n if len(gam... | [
"0.56993514",
"0.56593287",
"0.56053483",
"0.5597897",
"0.5568605",
"0.5439421",
"0.5429856",
"0.5376332",
"0.5308002",
"0.52968276",
"0.52515024",
"0.5165921",
"0.5131697",
"0.50737387",
"0.50691587",
"0.50679016",
"0.50465214",
"0.5040585",
"0.5004418",
"0.49854442",
"0.498... | 0.7158516 | 0 |
Return a full name, neatly formatted | def get_formatted_name(first_name,last_name):
full_name = first_name + ' ' + last_name
return full_name.title() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_name(self):\n first = self.first.capitalize()\n last = self.last.capitalize()\n output = f'{first} {last}'\n return(output)",
"def get_formatted_name(first, last):\n full_name = first + \" \" + last\n return full_name.title()",
"def get_full_name(self) -> str:\n ... | [
"0.85130113",
"0.8459006",
"0.8420261",
"0.8394904",
"0.8388975",
"0.8387252",
"0.8382374",
"0.8379792",
"0.83664227",
"0.83651984",
"0.83636063",
"0.8349735",
"0.8349735",
"0.8349735",
"0.8349735",
"0.8349735",
"0.8349735",
"0.8349735",
"0.8349735",
"0.8349735",
"0.8349735",... | 0.8450847 | 2 |
Remove an icon from the tray. | def remove_icon(self, name):
if name in self.sb_icons:
self.hide_tooltip(name)
self.sb_icons[name].Destroy()
del self.sb_icons[name]
self.place_icons(resize=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deleteIconSlot(self):\r\n\r\n icons = self.repositoryConfiguration.icons\r\n if len(icons) == 0:\r\n self.__showInformation(\"No icons have been found on server.\")\r\n else:\r\n selectDialog = icon_selection_dialog.SelectUserIconDialog(multiSelection=True)\r\n ... | [
"0.6919165",
"0.64432555",
"0.61585593",
"0.59762263",
"0.5887459",
"0.5773128",
"0.5754544",
"0.57091296",
"0.5657481",
"0.5614537",
"0.5606592",
"0.5581424",
"0.55700237",
"0.5519336",
"0.55137575",
"0.54768264",
"0.54676783",
"0.5448755",
"0.5446402",
"0.5445191",
"0.54252... | 0.7131599 | 0 |
ReferenceFrame initialization method. A ReferenceFrame has a set of orthonormal basis vectors, along with orientations relative to other ReferenceFrames and angular velocities relative to other ReferenceFrames. | def __init__(self, name, indices=None, latexs=None, variables=None):
if not isinstance(name, str):
raise TypeError('Need to supply a valid name')
# The if statements below are for custom printing of basis-vectors for
# each frame.
# First case, when custom indices are suppli... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup(self):\n self.ref_angles = np.array([340.0, 348.0, 358.9, 0.5, 5.0, 9.87])",
"def __init__(self, ref_joint=DEFAULT_REF_FRAME_JOINT,*args, **kwargs):\n self.ref_joint = ref_joint\n super().__init__(*args, **kwargs)",
"def __init__(self, ref_joint=DEFAULT_REF_FRAME_JOINT,*args, **k... | [
"0.6578136",
"0.6517177",
"0.6517177",
"0.6461423",
"0.6041502",
"0.57824546",
"0.5662855",
"0.56140643",
"0.56106764",
"0.5539543",
"0.5536743",
"0.55171657",
"0.54993355",
"0.546994",
"0.5466526",
"0.541726",
"0.53972656",
"0.5393326",
"0.53813046",
"0.537666",
"0.535916",
... | 0.5414043 | 16 |
Returns basis vector for the provided index, if the index is a string. If the index is a number, returns the coordinate variable correspon ding to that index. | def __getitem__(self, ind):
if not isinstance(ind, str):
if ind < 3:
return self.varlist[ind]
else:
raise ValueError("Invalid index provided")
if self.indices[0] == ind:
return self.x
if self.indices[1] == ind:
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def basis(self, index, vars = None) :\n raise NotImplementedError",
"def get_variable(index: str = None) -> Tuple[Symbol, Symbol, Symbol]:\n return prepare_symbols(func_name=\"r\", index=index, step=\"1/2\")",
"def basis(index, eps):\n # check input\n if index > (nt - 1):\n ... | [
"0.6098836",
"0.5945231",
"0.5938594",
"0.5908574",
"0.5757665",
"0.5669318",
"0.56225234",
"0.56191033",
"0.55106777",
"0.55024445",
"0.5497375",
"0.5492243",
"0.5389289",
"0.53868324",
"0.5378972",
"0.5346976",
"0.53258365",
"0.5279308",
"0.527814",
"0.52085096",
"0.5204679... | 0.59144557 | 3 |
Returns the name of the frame. | def __str__(self):
return self.name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_name(self):\n return stack()[1][3][5:]",
"def my_name():\n return sys._getframe(1).f_code.co_name",
"def get_name(self):\n return self.get_context().get_name()",
"def name(self) :\n\t\ttry :\n\t\t\treturn self._name\n\t\texcept Exception as e:\n\t\t\traise e",
"def name(self) :\n\... | [
"0.7679453",
"0.7230871",
"0.7189667",
"0.70115864",
"0.70115864",
"0.70115864",
"0.6996556",
"0.69826645",
"0.6980834",
"0.6979474",
"0.6979474",
"0.69756967",
"0.6971563",
"0.6971563",
"0.6971563",
"0.69643563",
"0.69643563",
"0.69643563",
"0.69643563",
"0.69643563",
"0.696... | 0.0 | -1 |
Returns an inclusive list of reference frames that connect this reference frame to the provided reference frame. | def _dict_list(self, other, num):
connect_type = {0: 'orientation',
1: 'angular velocity',
2: 'angular acceleration'}
if num not in connect_type.keys():
raise ValueError('Valid values for num are 0, 1, or 2.')
possible_connecting_pat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getReferencesFrom(self) -> List[ghidra.program.model.symbol.Reference]:\n ...",
"def references(self):\r\n return Reference.list_items(self)",
"def reference_frame(self):\n return self._reference_frame",
"def get_file_references():\n ref_nodes = pm.ls(rf=True)\n file_refs = [r.... | [
"0.6414791",
"0.6191626",
"0.6171738",
"0.5977242",
"0.58498996",
"0.58444196",
"0.58325016",
"0.5809666",
"0.5688949",
"0.5644671",
"0.5617305",
"0.5578391",
"0.55767107",
"0.5522012",
"0.5484582",
"0.54600257",
"0.5459503",
"0.54259187",
"0.53931385",
"0.53899336",
"0.53641... | 0.0 | -1 |
Returns the angular acceleration Vector of the ReferenceFrame. | def ang_acc_in(self, otherframe):
_check_frame(otherframe)
if otherframe in self._ang_acc_dict:
return self._ang_acc_dict[otherframe]
else:
return self.ang_vel_in(otherframe).dt(otherframe) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def angle_acceleration(self):\n return self.angle_velocity.diff()*self.frame_rate",
"def acceleration(self):\n return self.velocity.diff()*self.frame_rate",
"def angular_velocity(self):\n return self.base_angular_velocity() + (\n self.tidal_rotational_deceleration() * self.star.... | [
"0.76525116",
"0.7580552",
"0.74873054",
"0.7273692",
"0.71412104",
"0.7113434",
"0.7102453",
"0.70449233",
"0.7017195",
"0.6667252",
"0.6639425",
"0.6478939",
"0.6478282",
"0.6469234",
"0.6394457",
"0.6346002",
"0.6325677",
"0.6325677",
"0.6310297",
"0.62303156",
"0.61968243... | 0.5910806 | 42 |
Returns the angular velocity Vector of the ReferenceFrame. | def ang_vel_in(self, otherframe):
_check_frame(otherframe)
flist = self._dict_list(otherframe, 1)
outvec = Vector(0)
for i in range(len(flist) - 1):
outvec += flist[i]._ang_vel_dict[flist[i + 1]]
return outvec | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def angular_velocity(self):\n return self.base_angular_velocity() + (\n self.tidal_rotational_deceleration() * self.star.age()\n )",
"def angle_velocity(self):\n return self.angle.diff()*self.frame_rate",
"def angular_vel(self):\n return self.data.qvel[1:]",
"def veloci... | [
"0.7862042",
"0.7649216",
"0.7627947",
"0.76027024",
"0.7393704",
"0.73022324",
"0.7287122",
"0.7216157",
"0.7206891",
"0.7129797",
"0.7122984",
"0.7106285",
"0.7084347",
"0.70067906",
"0.6999614",
"0.6934581",
"0.6913443",
"0.68646085",
"0.68523735",
"0.68380773",
"0.6807062... | 0.66694367 | 27 |
Sets the orientation of this reference frame with respect to a parent reference frame by rotating through an angle about an axis fixed in the parent reference frame. | def orient_axis(self, parent, axis, angle):
from sympy.physics.vector.functions import dynamicsymbols
_check_frame(parent)
if not isinstance(axis, Vector) and isinstance(angle, Vector):
axis, angle = angle, axis
axis = _check_vector(axis)
theta = sympify(angle)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def orient_body_fixed(self, parent, angles, rotation_order):\n from sympy.physics.vector.functions import dynamicsymbols\n\n _check_frame(parent)\n\n amounts, rot_order, rot_matrices = self._parse_consecutive_rotations(\n angles, rotation_order)\n self._dcm(parent, rot_matric... | [
"0.66075283",
"0.65841866",
"0.65611386",
"0.630286",
"0.6285694",
"0.6205067",
"0.61293143",
"0.602207",
"0.59776646",
"0.59671766",
"0.5947277",
"0.59298724",
"0.5851533",
"0.58416134",
"0.58397996",
"0.5826595",
"0.5819508",
"0.58189934",
"0.5780521",
"0.5768061",
"0.57527... | 0.73828024 | 0 |
Rotates this reference frame relative to the parent reference frame by right hand rotating through three successive body fixed simple axis rotations. Each subsequent axis of rotation is about the "body fixed" unit vectors of a new intermediate reference frame. This type of rotation is also referred to rotating through ... | def orient_body_fixed(self, parent, angles, rotation_order):
from sympy.physics.vector.functions import dynamicsymbols
_check_frame(parent)
amounts, rot_order, rot_matrices = self._parse_consecutive_rotations(
angles, rotation_order)
self._dcm(parent, rot_matrices[0] * rot_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rotational_dynamics(self, torques: array):\n\n # Get the inertia matrix and its inverse\n I = self.rb_dynamics.inertia_matrix\n I_inv = self.rb_dynamics.inertia_matrix_inv\n\n # Compute the coriolis terms\n coriolis = cross(self.state.v_2, dot(I, self.state.v_2))\n\n #... | [
"0.6051124",
"0.6025768",
"0.5955806",
"0.5912036",
"0.5911985",
"0.5852066",
"0.58215976",
"0.56448066",
"0.55728745",
"0.55646574",
"0.54969245",
"0.54823625",
"0.5479206",
"0.54617614",
"0.54433197",
"0.543791",
"0.5434249",
"0.54332125",
"0.54313767",
"0.5408227",
"0.5396... | 0.69264954 | 0 |
Rotates this reference frame relative to the parent reference frame by right hand rotating through three successive space fixed simple axis rotations. Each subsequent axis of rotation is about the "space fixed" unit vectors of the parent reference frame. The computed angular velocity in this method is by default expres... | def orient_space_fixed(self, parent, angles, rotation_order):
from sympy.physics.vector.functions import dynamicsymbols
_check_frame(parent)
amounts, rot_order, rot_matrices = self._parse_consecutive_rotations(
angles, rotation_order)
self._dcm(parent, rot_matrices[2] * rot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def orient_body_fixed(self, parent, angles, rotation_order):\n from sympy.physics.vector.functions import dynamicsymbols\n\n _check_frame(parent)\n\n amounts, rot_order, rot_matrices = self._parse_consecutive_rotations(\n angles, rotation_order)\n self._dcm(parent, rot_matric... | [
"0.71669024",
"0.59400386",
"0.5924898",
"0.5803986",
"0.53363764",
"0.52715355",
"0.52579707",
"0.52281237",
"0.5197589",
"0.51846594",
"0.5176963",
"0.5176581",
"0.515198",
"0.5138171",
"0.5051946",
"0.50500447",
"0.5049231",
"0.5027009",
"0.5013967",
"0.50115263",
"0.49946... | 0.7110469 | 1 |
The basis Vector for the ReferenceFrame, in the x direction. | def x(self):
return self._x | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def x_vector(self):\n return np.reshape(self.points[:, 0], (-1))",
"def xx(self):\n return Vector.outer(self.x, self.x)",
"def project_x(self) -> Vector:\n return Vector(\n start=(self.start[0],0),\n end=(self.end[0],0)\n )",
"def unit_vector_... | [
"0.71926486",
"0.68230057",
"0.6774555",
"0.67134535",
"0.66671354",
"0.66349834",
"0.65479666",
"0.65311605",
"0.65261304",
"0.64906657",
"0.6484826",
"0.6439059",
"0.64056104",
"0.6384569",
"0.6341071",
"0.6341071",
"0.6341071",
"0.63071346",
"0.6301996",
"0.6292062",
"0.62... | 0.6528453 | 11 |
Unit dyad of basis Vectors y and y for the ReferenceFrame. | def yy(self):
return Vector.outer(self.y, self.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def y(self):\n return self.__y",
"def unit_vector_y(self):\n return self.get_unit_vector(axis='y')",
"def y(self) -> int:\n return self.vector[1]",
"def y(self):\n return self._vct.y",
"def y(self):\n return self._y",
"def y(self):\n return self._y",
"def y(sel... | [
"0.68718493",
"0.6743961",
"0.6680825",
"0.66644883",
"0.66589904",
"0.66589904",
"0.66589904",
"0.6631105",
"0.66258013",
"0.6611942",
"0.6594808",
"0.65622807",
"0.6557311",
"0.64669985",
"0.6464995",
"0.645908",
"0.64437735",
"0.64429307",
"0.6439137",
"0.6420268",
"0.6387... | 0.6734123 | 2 |
Unit dyad of basis Vectors z and y for the ReferenceFrame. | def zy(self):
return Vector.outer(self.z, self.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zz(self):\n return Vector.outer(self.z, self.z)",
"def yz(self):\n return Vector.outer(self.y, self.z)",
"def unit_vector_z(self):\n return self.get_unit_vector(axis='z')",
"def z(self):\n return self._vct.z",
"def z(self):\n return self._z",
"def z(self) -> float:\... | [
"0.6867046",
"0.6790469",
"0.663685",
"0.65729815",
"0.6448851",
"0.63457036",
"0.629333",
"0.62408525",
"0.6236528",
"0.6171309",
"0.61079216",
"0.6092662",
"0.6060374",
"0.6055548",
"0.6050909",
"0.60384595",
"0.6027501",
"0.5964212",
"0.5964212",
"0.59638464",
"0.59543735"... | 0.70027125 | 0 |
Returns the partial angular velocities of this frame in the given frame with respect to one or more provided generalized speeds. | def partial_velocity(self, frame, *gen_speeds):
partials = [self.ang_vel_in(frame).diff(speed, frame, var_in_dcm=False)
for speed in gen_speeds]
if len(partials) == 1:
return partials[0]
else:
return tuple(partials) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_actor_angular_velocities_at_frame(self, frame, actor_list=None):\n return self._get_states_at_frame(frame, \"angular_velocity\", actor_list)",
"def angular_velocity(self):\n return self.base_angular_velocity() + (\n self.tidal_rotational_deceleration() * self.star.age()\n ... | [
"0.632946",
"0.621041",
"0.60083866",
"0.5868274",
"0.58672327",
"0.57878953",
"0.57662135",
"0.56531334",
"0.558325",
"0.5548275",
"0.55195147",
"0.5488661",
"0.5467651",
"0.54508126",
"0.544675",
"0.5441372",
"0.5432231",
"0.5390982",
"0.5383614",
"0.53385335",
"0.53078437"... | 0.7450791 | 0 |
Test deleting an auth without being connected to a user. | async def test_delete_removes_just_auth(
hass_ws_client: WebSocketGenerator,
hass: HomeAssistant,
hass_storage: dict[str, Any],
) -> None:
client = await hass_ws_client(hass)
hass_storage[prov_ha.STORAGE_KEY] = {
"version": 1,
"data": {"users": [{"username": "test-user"}]},
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_delete_authorized_user(self):\n pass",
"def test_delete_manage_user_unauth(self):\n self._create_user()\n\n data = {'username': self.username}\n\n url = reverse('user_items')\n\n response = self.client.delete(url, data)\n self.assertEqual(response.status_code, s... | [
"0.81942654",
"0.7741609",
"0.7715699",
"0.76555365",
"0.7608058",
"0.7564403",
"0.7508941",
"0.7476311",
"0.74406826",
"0.7440514",
"0.73988444",
"0.7378949",
"0.7375278",
"0.73708314",
"0.7355374",
"0.72888124",
"0.7285783",
"0.7271883",
"0.7267608",
"0.72626907",
"0.722567... | 0.74309826 | 10 |
Test trying to delete an unknown auth username. | async def test_delete_unknown_auth(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator
) -> None:
client = await hass_ws_client(hass)
await client.send_json(
{
"id": 5,
"type": "config/auth_provider/homeassistant/delete",
"username": "test-user2",
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_g_remove_user(self):\n assert not auth.remove_user(test_username2, testing=True)",
"def test_delete_users_by_username_hooks_by_uid(self):\n pass",
"def delete_nonexisting_user(self):\n self.test_runner.run_nonexisting_user_delete()",
"def test_delete_authorized_user(self):\n ... | [
"0.7376114",
"0.7232955",
"0.7117893",
"0.70866656",
"0.7050125",
"0.6968135",
"0.6960005",
"0.6911724",
"0.69096047",
"0.6878092",
"0.68706954",
"0.68686366",
"0.6791497",
"0.6789139",
"0.673424",
"0.6722878",
"0.66847795",
"0.6678919",
"0.66599655",
"0.66565436",
"0.6631976... | 0.69465685 | 7 |
Test that change password fails with invalid password. | async def test_change_password_wrong_pw(
hass: HomeAssistant,
hass_ws_client: WebSocketGenerator,
hass_admin_user: MockUser,
auth_provider,
) -> None:
client = await hass_ws_client(hass)
await client.send_json(
{
"id": 6,
"type": "config/auth_provider/homeassista... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_wrongPassword(self):\n # Start password change\n self.log.info(\"Clicking 'Change Password'\")\n pos.click_function_key(\"Change Password\") \n \n # Enter in the wrong password.\n # Need valid newpassword to get correct error.\n self.log.info(\"Enteri... | [
"0.85711455",
"0.81089467",
"0.8084241",
"0.79268754",
"0.7897451",
"0.77143276",
"0.7709761",
"0.7709369",
"0.77026844",
"0.77018386",
"0.7694952",
"0.7684645",
"0.7683374",
"0.7665087",
"0.7652129",
"0.76460594",
"0.7599394",
"0.75795233",
"0.7569521",
"0.75454634",
"0.7543... | 0.7798337 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.