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 |
|---|---|---|---|---|---|---|
Gets the start_loc of this StartConfiguration. | def start_loc(self) -> str:
return self._start_loc | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getStartState(self):\n return self._start_loc",
"def get_start_loc(self) -> Tuple[int, int]:\n assert self.pos_marker\n return self.pos_marker.working_loc",
"def get_start(self):\n return self._start",
"def getStart(self):\n return self._start",
"def start_location(se... | [
"0.76678634",
"0.76191413",
"0.7535662",
"0.7526042",
"0.7468089",
"0.739624",
"0.71940124",
"0.7110066",
"0.697193",
"0.69274306",
"0.6879675",
"0.68734604",
"0.6870186",
"0.6868174",
"0.6841254",
"0.6775295",
"0.677028",
"0.6765186",
"0.6717241",
"0.66995096",
"0.66838473",... | 0.8092295 | 0 |
Sets the start_loc of this StartConfiguration. | def start_loc(self, start_loc: str):
if start_loc is None:
raise ValueError("Invalid value for `start_loc`, must not be `None`") # noqa: E501
self._start_loc = start_loc | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_start(self, start_line):\n self.__start_line = start_line",
"def _set_start(self, coordinates):\n self._start = coordinates",
"def start(self, start):\n if start is None:\n raise ValueError(\"Invalid value for `start`, must not be `None`\")\n\n self._start = start... | [
"0.6936121",
"0.68152237",
"0.68014246",
"0.675889",
"0.6694931",
"0.6694931",
"0.6694931",
"0.6694931",
"0.6530491",
"0.65054053",
"0.6268435",
"0.6207663",
"0.6156244",
"0.6070756",
"0.60211486",
"0.60195583",
"0.5997648",
"0.5997648",
"0.5997648",
"0.5997648",
"0.5997648",... | 0.7981936 | 0 |
Gets the target_loc of this StartConfiguration. | def target_loc(self) -> str:
return self._target_loc | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTarget(self):\n\n return self._target",
"def getTarget(self):\n return self._target",
"def target(self):\n return self._properties.get('target')",
"def getTarget(self):\n return self.Target",
"def get_target(self, ):\n return self.get_parameter('target')",
"def g... | [
"0.71594894",
"0.7106075",
"0.7083087",
"0.70237416",
"0.69409907",
"0.6844123",
"0.67553025",
"0.66829485",
"0.66829485",
"0.66829485",
"0.66829485",
"0.66742957",
"0.66610354",
"0.6648117",
"0.6604971",
"0.65594655",
"0.63787967",
"0.63787967",
"0.63712007",
"0.63712007",
"... | 0.8121992 | 0 |
Gets the configuration of this StartConfiguration. | def configuration(self) -> str:
return self._configuration | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_configuration(self) -> dict:\n return self.config",
"def configuration(self):\n return self._config",
"def getConfiguration(self):\n return self._configuration",
"def configuration(self):\n return self._configuration",
"def get_config(self):\n return self.config",... | [
"0.7980706",
"0.78555775",
"0.78483015",
"0.7695311",
"0.76142955",
"0.75064206",
"0.75064206",
"0.75064206",
"0.7495136",
"0.7495136",
"0.7434576",
"0.743175",
"0.7390229",
"0.73862046",
"0.7363518",
"0.7349425",
"0.7302741",
"0.7302741",
"0.7300254",
"0.7260203",
"0.7237924... | 0.6950183 | 34 |
Gets the utility of this StartConfiguration. | def utility(self) -> str:
return self._utility | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def utility_ref(self):\n\n return self._utility_ref",
"def tool(self):\n tool_type = self.__class__.__module__.split('.')[-1]\n return g.config.tools[tool_type]",
"def tool(self):\n return self._tool",
"def is_utility(self):\n\n return self._is_utility",
"def get_utility_... | [
"0.6344449",
"0.6295392",
"0.6116635",
"0.60027087",
"0.59996575",
"0.5752847",
"0.56608504",
"0.5655063",
"0.5626775",
"0.561444",
"0.55948263",
"0.55605507",
"0.55589664",
"0.5540132",
"0.55228776",
"0.55228776",
"0.55228776",
"0.55228776",
"0.55228776",
"0.55228776",
"0.55... | 0.7318603 | 0 |
Returns whether the resulting plaintext contains an admin tuple (i.e ';admin=true;') | def contains_admin(ct):
pt = aes.cbc_decrypt(ct, KEY, IV)
return b";admin=true;" in pt | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_admin(cipher):\n counter = Crypto.gen_aes_stream_counter_mt19973(3453243);\n text = Crypto.decrypt_aes(cipher, key, AES.MODE_CTR, counter=counter)\n return text.find(';admin=true;') != -1",
"def decrypt_and_check_admin(self, ciphertext):\n data = aes_cbc_decrypt(ci... | [
"0.80174947",
"0.74390316",
"0.7115621",
"0.66282034",
"0.6606085",
"0.65460783",
"0.6518575",
"0.64968514",
"0.6438575",
"0.6438365",
"0.64063686",
"0.6396682",
"0.6388433",
"0.63049096",
"0.62971383",
"0.62775207",
"0.61965424",
"0.618776",
"0.6185764",
"0.61604714",
"0.615... | 0.78648704 | 1 |
add together x and y >>> add(1,2) 3 >>> add(8, "hi") | def add(x,y):
return x + y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(x, y):\n return x + y",
"def add(x, y):\n return x + y",
"def add(x, y):\n return x + y",
"def add(x, y):\n return x + y",
"def add(x, y):\n return x + y",
"def add(x, y):\n return x + y",
"def add(x, y):\n return x + y",
"def add(x, y):\n return x + y",
"def add(x, ... | [
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.8650206",
"0.86200476",
"0.8200011",
"0.808888",
"0.8081228",
"0.8069842",
"0.8055119",
"0.80420023",
"0.78542197",
... | 0.85345334 | 14 |
get train test data dataframe | def train_test_data_df(train_data_file, test_data_file):
dtype_dict = {
"age": np.int32,
"education-num": np.int32,
"capital-gain": np.int32,
"capital-loss": np.int32,
"hours-per-week": np.int32
}
cols = [i for i in range(15) if i != 2]
train_data = pd.read_csv(tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_test_train(df, num_months_test = 1):\n train_set = df.iloc[0:len(df)-num_months_test]\n test_set = df.iloc[len(df)-num_months_test:len(df)]\n \n return train_set, test_set",
"def load_train_test() -> Tuple[pd.DataFrame, pd.DataFrame]:\n df = load_data() \n #Sample\n train_df = df.... | [
"0.7227787",
"0.7168921",
"0.71056587",
"0.70871526",
"0.7073559",
"0.7069441",
"0.7069077",
"0.7009184",
"0.699438",
"0.6971492",
"0.6960593",
"0.69449794",
"0.69428146",
"0.6937551",
"0.6908583",
"0.6907999",
"0.68962926",
"0.6884439",
"0.6883385",
"0.6868346",
"0.68502784"... | 0.7851694 | 0 |
split train test data | def split_train_test_data(total_data_df, frac):
test_data_df = total_data_df.sample(frac=frac, random_state=1)
train_data_df = total_data_df.loc[total_data_df.index.difference(test_data_df.index)]
return train_data_df, test_data_df | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_data(data, test_size):\r\n ntest = int(round(len(data) * (1 - test_size)))+1\r\n \r\n train, test = data[:ntest], data[ntest:]\r\n \r\n return train,test",
"def split_dataset(self, test_size=0.20):\n\t\t(self.training_data, self.test_data, self.training_labels, self.test_labels) = train_tes... | [
"0.85929984",
"0.84333485",
"0.8412204",
"0.83514774",
"0.83317685",
"0.826351",
"0.81242734",
"0.8086233",
"0.8077096",
"0.80345243",
"0.80052936",
"0.8005135",
"0.7985718",
"0.792576",
"0.79199374",
"0.79185224",
"0.79080427",
"0.78838915",
"0.78601694",
"0.7858985",
"0.784... | 0.79242676 | 14 |
Record the power of a prime if it's higher than previous power of the same prime. | def find_max_power_prime_in_range(range_i, range_f):
max_power_primes = {}
for x in range(range_i, range_f+1):
prime_count = {}
if not is_a_prime(x):
prime_factors = find_prime_factors(x)
for y in prime_factors:
if y in prime_count:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isPower2(num):\n\treturn ((num & (num - 1)) == 0) and num > 0",
"def isPower2(num):\n\treturn ((num & (num - 1)) == 0) and num > 0",
"def task3_is_power(num):\n power = 3\n while num > power:\n num /= power\n return num == power",
"def hit(self):\n if self._power == 0 :\n ... | [
"0.5686051",
"0.5686051",
"0.5621634",
"0.53984225",
"0.53320354",
"0.5328334",
"0.5322347",
"0.53105474",
"0.53032446",
"0.52924424",
"0.5251057",
"0.5222014",
"0.52144474",
"0.5192926",
"0.51883703",
"0.51639116",
"0.5154919",
"0.51498914",
"0.5126156",
"0.5124413",
"0.5116... | 0.47324446 | 96 |
Return the transport device name. | def __str__(self):
return 'loop-back' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_device_name(self):\n name = self._device[\"name\"]\n if not name or name == \"--\":\n name = self._mac\n\n return name",
"def device_name(self) -> Optional[str]:\n return pulumi.get(self, \"device_name\")",
"def device_name(self) -> Optional[str]:\n return ... | [
"0.7703214",
"0.7683986",
"0.7683986",
"0.76643795",
"0.76451933",
"0.76375216",
"0.76375216",
"0.76375216",
"0.760074",
"0.7443136",
"0.7443136",
"0.7442517",
"0.7405169",
"0.7367768",
"0.73315394",
"0.7318421",
"0.7267664",
"0.7253427",
"0.72120595",
"0.7162567",
"0.7155903... | 0.0 | -1 |
Return the transport device name. | def __str__(self):
return self.port | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_device_name(self):\n name = self._device[\"name\"]\n if not name or name == \"--\":\n name = self._mac\n\n return name",
"def device_name(self) -> Optional[str]:\n return pulumi.get(self, \"device_name\")",
"def device_name(self) -> Optional[str]:\n return ... | [
"0.7703214",
"0.7683986",
"0.7683986",
"0.76643795",
"0.76451933",
"0.76375216",
"0.76375216",
"0.76375216",
"0.760074",
"0.7443136",
"0.7443136",
"0.7442517",
"0.7405169",
"0.7367768",
"0.73315394",
"0.7318421",
"0.7267664",
"0.7253427",
"0.72120595",
"0.7162567",
"0.7155903... | 0.0 | -1 |
Return the transport device name. | def __str__(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_device_name(self):\n name = self._device[\"name\"]\n if not name or name == \"--\":\n name = self._mac\n\n return name",
"def device_name(self) -> Optional[str]:\n return pulumi.get(self, \"device_name\")",
"def device_name(self) -> Optional[str]:\n return ... | [
"0.7703214",
"0.7683986",
"0.7683986",
"0.76643795",
"0.76451933",
"0.76375216",
"0.76375216",
"0.76375216",
"0.760074",
"0.7443136",
"0.7443136",
"0.7442517",
"0.7405169",
"0.7367768",
"0.73315394",
"0.7318421",
"0.7267664",
"0.7253427",
"0.72120595",
"0.7162567",
"0.7155903... | 0.0 | -1 |
Return the transport device name. | def __str__(self):
return self._addr[0] + ":" + str(self._addr[1]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_device_name(self):\n name = self._device[\"name\"]\n if not name or name == \"--\":\n name = self._mac\n\n return name",
"def device_name(self) -> Optional[str]:\n return pulumi.get(self, \"device_name\")",
"def device_name(self) -> Optional[str]:\n return ... | [
"0.7703214",
"0.7683986",
"0.7683986",
"0.76643795",
"0.76451933",
"0.76375216",
"0.76375216",
"0.76375216",
"0.760074",
"0.7443136",
"0.7443136",
"0.7442517",
"0.7405169",
"0.7367768",
"0.73315394",
"0.7318421",
"0.7267664",
"0.7253427",
"0.72120595",
"0.7162567",
"0.7155903... | 0.0 | -1 |
Sets the versions of this VersionList. | def versions(self, versions):
self._versions = versions | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_versions(self, consumer, versions):\n for resource_type, resource_version in versions.items():\n self._set_version(consumer, resource_type,\n resource_version)\n\n if versions:\n self._cleanup_removed_versions(consumer, versions)\n els... | [
"0.7115569",
"0.6755616",
"0.6259162",
"0.6053471",
"0.59819925",
"0.5840009",
"0.5838923",
"0.58016723",
"0.56732124",
"0.56508595",
"0.56191653",
"0.5560468",
"0.55537826",
"0.5547353",
"0.54942024",
"0.5349271",
"0.53464514",
"0.53288394",
"0.5325478",
"0.53164107",
"0.531... | 0.8148091 | 0 |
push a new node to the front | def push(self, new_data):
new_node = Node(new_data)
new_node.next = self.head
self.head = new_node | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def push(self, node):\n self.prepend(node)",
"def append_front(self, item):\n\n self.front = Node(item, self.front)",
"def push_front(self, data):\n n = Node(data)\n if self.empty():\n self.head = n\n return\n\n l = self.head\n self.head = n\n ... | [
"0.80560565",
"0.79882514",
"0.7872004",
"0.7826987",
"0.7770506",
"0.76518565",
"0.7609562",
"0.76047397",
"0.7540177",
"0.7459227",
"0.74473196",
"0.74144137",
"0.7391758",
"0.73793775",
"0.73541343",
"0.73541343",
"0.735067",
"0.72484905",
"0.72397304",
"0.71929216",
"0.71... | 0.6802017 | 48 |
Translate docker environment vars format to kubernetes format. | def _docker_env_to_k8s_env(env):
res = []
if isinstance(env, dict):
for key, value in env.items():
res.append(client.V1EnvVar(name=key, value=value))
elif isinstance(env, (list, tuple)):
for el in env:
key, value = el.split("=")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _translate_docker_properties(self):\n self.spec.setdefault(\"name\", self.spec.pop(\"container_name\", self.name))\n self.spec.setdefault(\"command\", shlex.split(self.spec.pop(\"entrypoint\", \"\")))\n self.spec.setdefault(\"args\", shlex.split(self.spec.pop(\"cmd\", \"\")))\n \n ... | [
"0.6434571",
"0.59294695",
"0.58166206",
"0.55057716",
"0.5492789",
"0.54040915",
"0.5375168",
"0.534774",
"0.53099155",
"0.52431905",
"0.52238774",
"0.5192179",
"0.5149855",
"0.5135296",
"0.5124982",
"0.511643",
"0.5090065",
"0.5089572",
"0.50857353",
"0.50654405",
"0.501804... | 0.67334956 | 0 |
Gets the prefect_mandate of this RomaniaSettlement. | def prefect_mandate(self):
return self._prefect_mandate | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mandate(self):\n return self.__mandate",
"def mandate(self):\n return self.__mandate",
"def prefect_mandate(self, prefect_mandate):\n\n self._prefect_mandate = prefect_mandate",
"def actual_monthly(self):\n actual_monthly = numpy.pmt(\n self.loan_at / 12,\n ... | [
"0.6766393",
"0.6766393",
"0.60980475",
"0.5382205",
"0.48817226",
"0.48410153",
"0.4837972",
"0.47189185",
"0.46360102",
"0.46157357",
"0.46041834",
"0.45693982",
"0.45609918",
"0.45492807",
"0.45407116",
"0.4524697",
"0.4524232",
"0.4491638",
"0.4489924",
"0.44763404",
"0.4... | 0.73430675 | 0 |
Sets the prefect_mandate of this RomaniaSettlement. | def prefect_mandate(self, prefect_mandate):
self._prefect_mandate = prefect_mandate | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prefect_mandate(self):\n return self._prefect_mandate",
"def mandate(self):\n return self.__mandate",
"def mandate(self):\n return self.__mandate",
"def set_statement_due_date(self, due_date):\n due_date_to_set = None\n if due_date != \"\":\n due_date_to_set ... | [
"0.5782977",
"0.5173651",
"0.5173651",
"0.514843",
"0.4865814",
"0.48238504",
"0.48142707",
"0.46720013",
"0.46601328",
"0.4617344",
"0.46116596",
"0.46036306",
"0.45708257",
"0.45519936",
"0.45431557",
"0.45416537",
"0.45134273",
"0.44901252",
"0.44870344",
"0.447455",
"0.44... | 0.78854436 | 0 |
Gets the description of this RomaniaSettlement. | def description(self):
return self._description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description(self) -> str:\n return pulumi.get(self, \"description\")",
"def description(self) -> str:\n return pulumi.get(self, \"description\")",
"def description(self) -> str:\n return pulumi.get(self, \"description\")",
"def description(self) -> str:\n return pulumi.get(sel... | [
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"0.6922839",
"... | 0.6651549 | 45 |
Gets the authority_title of this RomaniaSettlement. | def authority_title(self):
return self._authority_title | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authority_title(self, authority_title):\n\n self._authority_title = authority_title",
"def arn(self) -> str:\n return pulumi.get(self, \"arn\")",
"def arn(self) -> str:\n return pulumi.get(self, \"arn\")",
"def arn(self) -> str:\n return pulumi.get(self, \"arn\")",
"def arn(... | [
"0.6653078",
"0.5903717",
"0.5903717",
"0.5903717",
"0.5903717",
"0.5903717",
"0.57301164",
"0.57301164",
"0.57301164",
"0.57146174",
"0.56581306",
"0.56030047",
"0.5549363",
"0.55244315",
"0.55199397",
"0.5513378",
"0.54996204",
"0.54774183",
"0.5473758",
"0.54698306",
"0.54... | 0.8329752 | 0 |
Sets the authority_title of this RomaniaSettlement. | def authority_title(self, authority_title):
self._authority_title = authority_title | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authority_title(self):\n return self._authority_title",
"def setAuthority(self, authority):\n libxml2mod.xmlURISetAuthority(self._o, authority)",
"def title_of_security(self, title_of_security):\n\n self._title_of_security = title_of_security",
"def set_title(self, title):\n \... | [
"0.65282655",
"0.59100914",
"0.57800037",
"0.5630795",
"0.5613141",
"0.5609171",
"0.56070304",
"0.5599914",
"0.55766344",
"0.5575587",
"0.55686224",
"0.55686224",
"0.55457926",
"0.5534204",
"0.5532807",
"0.55298054",
"0.5509413",
"0.5496042",
"0.54811865",
"0.54811865",
"0.54... | 0.8518491 | 0 |
Gets the id of this RomaniaSettlement. | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id(self) -> int:\n return pulumi.get(self, \"id\")",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_id(self):\n return self._id",
"def get_... | [
"0.6662917",
"0.6583054",
"0.6583054",
"0.6583054",
"0.6583054",
"0.6583054",
"0.6583054",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"0.6577215",
"... | 0.0 | -1 |
Sets the id of this RomaniaSettlement. | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n self.__id = id",
"def SetId(self, id):\n self.id = int(id)",
"def set_id(self, id):\n self.data['id'] = id",
"def setID(self, id):\n self._id = id\n return self.callRemote('setID', id)",
"def id... | [
"0.71691763",
"0.71336484",
"0.706023",
"0.7013812",
"0.6935394",
"0.6755252",
"0.6755252",
"0.6755252",
"0.6755252",
"0.6755252",
"0.67184776",
"0.6678843",
"0.66715205",
"0.6670732",
"0.6670732",
"0.6670732",
"0.6670732",
"0.6670732",
"0.6670732",
"0.6670732",
"0.6670732",
... | 0.6639746 | 65 |
Gets the label of this RomaniaSettlement. | def label(self):
return self._label | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_label(self):\n\n return self._label",
"def GetLabel(self):\n \n return self.label_str",
"def get_label(self):\n return self._label",
"def GetLabel(self) -> str:\n return self._label",
"def GetLabel(self):\r\n\r\n return self._label",
"def get_label ( self... | [
"0.755173",
"0.7505904",
"0.7493779",
"0.7456432",
"0.74268115",
"0.7417624",
"0.74039376",
"0.7384647",
"0.7384647",
"0.7384647",
"0.7384647",
"0.7324952",
"0.7324952",
"0.72316545",
"0.718691",
"0.7112228",
"0.7112228",
"0.7112228",
"0.7112228",
"0.7112228",
"0.7112228",
... | 0.7192392 | 19 |
Gets the type of this RomaniaSettlement. | def type(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_type(self):\n return self.type",
"def get_type(self):\n return self.type",
"def get_type(self):\n return self._type",
"def get_type(self):\n return self._type",
"def getType(self):\n return self.type_",
"def GetType(self):\r\n\r\n return self._type",
"d... | [
"0.69323933",
"0.69323933",
"0.68913364",
"0.68913364",
"0.6864363",
"0.68505335",
"0.6845008",
"0.682176",
"0.6810152",
"0.6755758",
"0.675129",
"0.6676684",
"0.66680634",
"0.66541743",
"0.66514987",
"0.66514987",
"0.66514987",
"0.66514987",
"0.66514987",
"0.66514987",
"0.66... | 0.660126 | 63 |
Given a list of VARIABLES that occur in MODEL, produce a conjunction restricting those variables to their values in the MODEL. | def project_soln(variables, model):
if variables == []:
return True
res = []
for variable in variables:
res.append(variable == model[variable])
return And(*res) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_different(variables) :\n constraints=[]\n for index,var in enumerate(variables):\n for sub_index in range(index+1,len(variables)):\n var1=var\n var2=variables[sub_index]\n new_constraint=Constraint(var1,var2,constraint_different)\n constraints.append... | [
"0.59275424",
"0.5635069",
"0.55582076",
"0.5461659",
"0.53210896",
"0.5318738",
"0.5301276",
"0.5255597",
"0.5120201",
"0.51095146",
"0.5107714",
"0.5105462",
"0.50430405",
"0.50198907",
"0.5001272",
"0.49666727",
"0.49661908",
"0.493536",
"0.49129227",
"0.4910818",
"0.49067... | 0.69235945 | 0 |
Initializes the radial velocity parameter of a given component to the (negative) heliocentric correction. | def __call__(self, cmp: Component, filename: str):
# file doesn't exist?
if not os.path.exists(filename):
self.log.error('Give file %s for extracting coordinates does not exist, skipping.', filename)
return
# get fits header
header = fits.getheader(filename)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(self, **params):\n\n self._n_x = params['n_x']\n self._n_y = params['n_y']\n self._dx = params['dx']\n self._dy = params['dy']\n\n self._r_corr_in_points = self._r_corr_in_meters // max(self._dx, self._dy)",
"def __init__(self, timestep=1.0 * simtk.unit.femtoseco... | [
"0.6125686",
"0.58644915",
"0.57939047",
"0.5775438",
"0.57521355",
"0.5750994",
"0.56970173",
"0.56726813",
"0.56504893",
"0.56055677",
"0.5546638",
"0.5537054",
"0.5531482",
"0.5518716",
"0.547513",
"0.5473131",
"0.54320455",
"0.5422189",
"0.54157746",
"0.53864413",
"0.5381... | 0.0 | -1 |
Combines the entries of two dictionaries to make another dictionary. | def merge_dicts(d1, d2):
return {**d1, **d2} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dict_merge(dict1, dict2):\n combined = dict(dict1)\n combined.update(dict2)\n return combined",
"def dict_merge(dict1, dict2):\n combined = dict(dict1)\n combined.update(dict2)\n return combined",
"def merge_two_dicts(x, y):\n\tz = x.copy()\n\tz.update(y)\n\treturn z",
"def mergedict(x,... | [
"0.8383678",
"0.8383678",
"0.80422664",
"0.80405974",
"0.7991594",
"0.7952249",
"0.7952249",
"0.7952249",
"0.7952249",
"0.7952249",
"0.7952249",
"0.7952249",
"0.7952249",
"0.790564",
"0.78840524",
"0.78840524",
"0.78840524",
"0.7869812",
"0.7849549",
"0.778433",
"0.7776719",
... | 0.8328937 | 2 |
Round a datetime object to a multiple of a timedelta | def round_time(dt=None, date_delta=datetime.timedelta(minutes=1), to='closest'):
round_to = date_delta.total_seconds()
if dt is None:
dt = datetime.datetime.utcnow()
seconds = (dt - dt.min).seconds
if to == 'up':
rounding = (seconds + round_to) // round_to * round_to
elif to == 'd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def datetime_round(dt, period, start=None):\n result = datetime_mod(dt, period, start)\n if abs(dt - result) >= period // 2:\n result += period\n return result",
"def round_timedelta(td, period):\n\n period_seconds = period.total_seconds()\n half_period_seconds = period_seconds / 2\n rem... | [
"0.68975663",
"0.68538725",
"0.6825297",
"0.65712696",
"0.6420755",
"0.64077187",
"0.6403653",
"0.63419026",
"0.6314484",
"0.6239859",
"0.62325466",
"0.6166598",
"0.61635166",
"0.6105188",
"0.60536534",
"0.6047574",
"0.5957411",
"0.5915374",
"0.57969356",
"0.56966025",
"0.563... | 0.62927574 | 9 |
Create pretend app fixture of main app to test routing. | def app(config_path, dbtransaction, test_url):
settings = get_appsettings(config_path)
settings['sqlalchemy.url'] = test_url
app = main({}, **settings)
return TestApp(app) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_app():\n param = {\n 'DEBUG': True,\n 'TESTING': True\n }\n _app = create_app(settings_override=param)\n\n ctx = _app.app_context()\n ctx.push()\n yield _app\n ctx.pop()",
"def app():\n print('creating app with test vars')\n\n app = create_app('test')\n app.te... | [
"0.76478225",
"0.75793684",
"0.7402738",
"0.7330481",
"0.73268855",
"0.73268855",
"0.73268855",
"0.7319933",
"0.7155195",
"0.7120768",
"0.7106621",
"0.7105188",
"0.7084136",
"0.7083836",
"0.7064482",
"0.70479447",
"0.70391726",
"0.7037252",
"0.702485",
"0.7007175",
"0.699371"... | 0.6415475 | 87 |
Get the effective bind port for a service. | def port_for(self, service, port, protocol='tcp'):
# Return the container port if we run in no Docker mode.
if self._docker_allow_fallback:
return port
docker_service = self._docker_compose.get_service(service)
container = docker_service.get_container()
docker_port... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_http_service_port(self):\n tcp_port = 0\n service_name = \"http_port\"\n if _is_https_enabled(self.dbapi):\n service_name = \"https_port\"\n\n try:\n web_port = self.dbapi.service_parameter_get_one(service=\"http\",\n ... | [
"0.6804834",
"0.6758106",
"0.6699113",
"0.6696702",
"0.6690165",
"0.66068864",
"0.6580366",
"0.6568244",
"0.6549745",
"0.6529907",
"0.6522467",
"0.65178096",
"0.6499335",
"0.64974684",
"0.6487808",
"0.6477429",
"0.6471335",
"0.6470393",
"0.64690566",
"0.646369",
"0.6434442",
... | 0.6776161 | 1 |
Get the dockercompose.yml absolute path. Override this fixture in your tests if you need a custom location. | def docker_compose_file(pytestconfig):
return os.path.join(
str(pytestconfig.rootdir),
'tests',
'docker-compose.yml'
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def docker_compose_file(pytestconfig: Any) -> Any:\n return os.path.join(str(pytestconfig.rootdir), \"./\", \"docker-compose.yml\")",
"def docker_compose_project_dir(pytestconfig):\n return os.path.join(\n str(pytestconfig.rootdir),\n 'tests'\n )",
"def airflow_docker_compose_file(self):... | [
"0.81317294",
"0.68065774",
"0.6786318",
"0.64272743",
"0.63940334",
"0.63474923",
"0.6280923",
"0.62237525",
"0.6118632",
"0.60496396",
"0.5930887",
"0.5911524",
"0.5899274",
"0.588456",
"0.58497846",
"0.5796194",
"0.57861733",
"0.57814866",
"0.5702711",
"0.5699418",
"0.5692... | 0.8015339 | 1 |
Get the docker compose project directory absolute path. Override this fixture in your tests if you need a custom location. | def docker_compose_project_dir(pytestconfig):
return os.path.join(
str(pytestconfig.rootdir),
'tests'
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def docker_compose_file(pytestconfig: Any) -> Any:\n return os.path.join(str(pytestconfig.rootdir), \"./\", \"docker-compose.yml\")",
"def docker_compose_file(pytestconfig):\n return os.path.join(\n str(pytestconfig.rootdir),\n 'tests',\n 'docker-compose.yml'\n )",
"def get_projec... | [
"0.77096164",
"0.75773823",
"0.683886",
"0.6820666",
"0.67610484",
"0.6744314",
"0.67120713",
"0.66960955",
"0.66633856",
"0.66617274",
"0.66439223",
"0.66437197",
"0.66437197",
"0.66393584",
"0.6631962",
"0.6631962",
"0.6631962",
"0.6631962",
"0.66167533",
"0.6559197",
"0.65... | 0.81009513 | 0 |
Return if want to run against localhost when docker is not available. Override this fixture to return `True` if you want the ability to run without docker. | def docker_allow_fallback():
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_host():\n return not in_docker()",
"def allow_localhost(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"allow_localhost\")",
"def allow_localhost(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"allow_localhost\")",
"def _is_docker(self) -> bool:\n... | [
"0.723349",
"0.6848421",
"0.6848421",
"0.6790873",
"0.67049235",
"0.6578793",
"0.6297202",
"0.6255045",
"0.61912084",
"0.6126876",
"0.61004734",
"0.6087489",
"0.60840803",
"0.60539734",
"0.5943316",
"0.5859047",
"0.5824245",
"0.5822375",
"0.58134884",
"0.576715",
"0.5756328",... | 0.6541451 | 6 |
Returns true if two lists contains the same elements, regardless of order. | def equal_ignore_order(self, a, b):
unmatched = list(b)
for element in a:
try:
unmatched.remove(element)
except ValueError:
return False
return not unmatched | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_same(lst1, lst2):\n return len(lst1) == len(lst2) and all([x == y for x, y in zip(lst1, lst2)])",
"def lists_are_identical(list1, list2):\n if len(list1) != len(list2):\n return False\n for elem1, elem2 in zip(list1, list2):\n if elem1 != elem2:\n return False\n retu... | [
"0.86918193",
"0.8581629",
"0.81190884",
"0.8006266",
"0.80002135",
"0.7775472",
"0.7729561",
"0.76670426",
"0.7626077",
"0.7594808",
"0.7591347",
"0.75041986",
"0.7497082",
"0.7450093",
"0.74375314",
"0.7404963",
"0.72854775",
"0.7241263",
"0.7232385",
"0.7199296",
"0.718816... | 0.6883557 | 38 |
Converts datetime_obj into string of format 'YYYY(sep)MM(sep)DD' (always 10 chars long sep should be a 1char str). If no datetime_obj argument is provided, the current date is returned as a string instead. If datetime_obj is not a datetime obj, returns an empty string (used in file handling). | def datetime_to_str(datetime_obj: Union[dt.datetime, dt.date] = dt.datetime.now(), sep: str = DATE_SEPARATOR) -> str:
if datetime_obj:
return f'{datetime_obj:%Y}{sep}{datetime_obj:%m}{sep}{datetime_obj:%d}'
else:
return '' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date2str(datetime_object):\n if datetime_object is None:\n return 'None'\n return datetime_object.strftime('%Y-%m-%dT%H:%M:%S.%f')[0:-3]",
"def date_to_final_str(date_obj: datetime) -> str:\n return date_obj.strftime(\"%Y-%m-%d\")",
"def convert_datetime_to_string(dt):\n\tre... | [
"0.7011492",
"0.7009908",
"0.6752136",
"0.6752136",
"0.6678831",
"0.6627686",
"0.6617606",
"0.65714633",
"0.644009",
"0.6263681",
"0.62013453",
"0.6158756",
"0.61083454",
"0.6051599",
"0.597935",
"0.5961348",
"0.5922962",
"0.5919355",
"0.591742",
"0.58738285",
"0.5872277",
... | 0.8004128 | 0 |
Returns an implementation of an operator. | def getop(class_or_name: Union[str, Type], optype: str, otherclass: Union[str, Type, None] = None):
all_op1_types = _get_all_bases(class_or_name)
if otherclass is None:
for classname in all_op1_types:
if (classname, classname, optype) in Replacements._oprep:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_operator(self) -> Operator:\n return Operator(self.to_instruction())",
"def op(\n self,\n opstring: str,\n precedence: int = 0,\n is_comparison: bool = False,\n return_type: Optional[\n Union[Type[TypeEngine[Any]], TypeEngine[Any]]\n ] = None,\n ... | [
"0.7099149",
"0.6842051",
"0.6770022",
"0.6754999",
"0.6729791",
"0.66103494",
"0.6576852",
"0.6483258",
"0.6447014",
"0.63835394",
"0.63495487",
"0.6344599",
"0.63019323",
"0.62706405",
"0.62706405",
"0.6257523",
"0.6244761",
"0.6244761",
"0.62332964",
"0.62332964",
"0.62332... | 0.0 | -1 |
Gets the list of mutual friends between two characters. | def get_mutual_friends(self, character_1: str, character_2: str) -> DataFrame:
mutual_friends = self._mutual_friends_motif()
return (
mutual_friends.filter(
(lower(col("character_1")) == character_1.lower())
& (lower(col("character_2")) == character_2.lower()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mutual_friends(person1_friends, person2_friends):\n return list(set(person1_friends) & set(person2_friends))",
"def get_all_characters_mutual_friends(self) -> DataFrame:\n mutual_friends = self._mutual_friends_motif()\n return (\n mutual_friends.filter(col(\"character_1\") != ... | [
"0.7557711",
"0.7315502",
"0.66618615",
"0.65711766",
"0.64454794",
"0.63039625",
"0.6105177",
"0.6031693",
"0.59454083",
"0.5928206",
"0.5882427",
"0.5815458",
"0.5810836",
"0.57881385",
"0.5715533",
"0.5698209",
"0.5696826",
"0.5684341",
"0.56808573",
"0.5666093",
"0.566280... | 0.7240443 | 2 |
Iterate over the OMD's values in insertion order. By default, yields the mostrecently inserted value per unique key. Set multi to ``True`` to get all values according to insertion order. | def itervalues(self, multi=False):
for k, v in self.iteritems(multi=multi):
yield v | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iteritems(self, multi=False):\n root = self.root\n curr = root[NEXT]\n if multi:\n while curr is not root:\n yield curr[KEY], curr[VALUE]\n curr = curr[NEXT]\n else:\n for key in self.iterkeys():\n yield key, self[ke... | [
"0.6708744",
"0.60786945",
"0.5910532",
"0.5834102",
"0.5627534",
"0.5428168",
"0.5428168",
"0.54243594",
"0.53866136",
"0.53624475",
"0.53414583",
"0.5308692",
"0.53019434",
"0.5297419",
"0.5281543",
"0.5279601",
"0.5263811",
"0.5253902",
"0.5211993",
"0.5191485",
"0.513917"... | 0.6951697 | 0 |
Verify Update ignores POST requests with bogus entity fragments. | def test_wants_to_handle2(self):
self.bogus_environ['PATH_INFO'] = '/by_frag/abc123'
self.assertFalse(self.uh.wants_to_handle(self.bogus_environ)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_updated_invalid(self):\n thread1 = ThreadFactory()\n PostFactory(thread=thread1)\n\n self.refresh()\n\n qs = {'a': 1, 'w': 4, 'format': 'json',\n 'updated': 1, 'updated_date': 'invalid'}\n response = self.client.get(reverse('search.advanced'), qs)\n e... | [
"0.6710628",
"0.6672446",
"0.66353476",
"0.65393144",
"0.65003204",
"0.64810914",
"0.6452536",
"0.6418487",
"0.6373143",
"0.63548666",
"0.63543636",
"0.63292414",
"0.6306025",
"0.6282334",
"0.6247884",
"0.6224973",
"0.6209476",
"0.6189061",
"0.61608964",
"0.6127134",
"0.61265... | 0.0 | -1 |
Verify Update ignores GET requests, even if they have valid entity fragments. | def test_wants_to_handle3(self):
self.bogus_environ['REQUEST_METHOD'] = 'GET'
wants_to_handle = self.uh.wants_to_handle(self.bogus_environ)
self.assertFalse(wants_to_handle) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_partial_update_should_not_be_allowed(self):\n response = self.client.patch(self.get_url(), {})\n self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)",
"def test_update_should_not_be_allowed(self):\n response = self.client.put(self.get_url(), {})\n self.... | [
"0.71324295",
"0.6771482",
"0.6500988",
"0.639681",
"0.6383396",
"0.6261407",
"0.62607324",
"0.6124643",
"0.6070139",
"0.60358673",
"0.6030641",
"0.59783274",
"0.5970789",
"0.59579235",
"0.5911095",
"0.5879336",
"0.5878029",
"0.58539563",
"0.58499634",
"0.582906",
"0.5810206"... | 0.0 | -1 |
Gets the id of this StackViewResponse. id of the stack | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id(self):\n return self.data[\"id\"]",
"def id(self):\n return self.raw_resource[\"id\"]",
"def id(self):\n return self.get_data(\"id\")",
"def id(self): # type: () -> str\n return self.inspection['Id']",
"def id(self):\n return self.data.id",
"def id(self):\n ... | [
"0.66742194",
"0.64978755",
"0.6459868",
"0.6378208",
"0.6373632",
"0.6344862",
"0.62959987",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
"0.62951607",
... | 0.61747646 | 65 |
Sets the id of this StackViewResponse. id of the stack | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id):\n self.data['id'] = id",
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n self.__id = id",
"def SetId(self, id):\n self.id = int(id)",
"def setID(self, id):\n self._id = id\n return self.callRemote('setID', id)",
"def se... | [
"0.73176455",
"0.6974107",
"0.6848325",
"0.68166137",
"0.66359454",
"0.66159344",
"0.6593629",
"0.6593629",
"0.6593629",
"0.6593629",
"0.6593629",
"0.6571374",
"0.6571374",
"0.6571374",
"0.6571374",
"0.6571374",
"0.6571374",
"0.6571374",
"0.6571374",
"0.6571374",
"0.6571374",... | 0.6480886 | 67 |
Gets the name of this StackViewResponse. name of the stack | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stack_name(self) -> str:\n return self._values.get(\"stack_name\")",
"def stack_name(self) -> str:\n return jsii.get(self, \"stackName\")",
"def stack_name(self) -> typing.Optional[str]:\n return self._values.get(\"stack_name\")",
"def stackname(self):\n raise NotImplementedEr... | [
"0.8116496",
"0.78954965",
"0.7689035",
"0.7416753",
"0.7119795",
"0.7101517",
"0.7085201",
"0.6972799",
"0.69028956",
"0.68607616",
"0.6834281",
"0.6813043",
"0.6797727",
"0.6786841",
"0.67280555",
"0.67280555",
"0.67261225",
"0.67261225",
"0.6705967",
"0.6705967",
"0.670596... | 0.0 | -1 |
Sets the name of this StackViewResponse. name of the stack | def name(self, name):
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name):\n\t\tself.name_ = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n ... | [
"0.71105784",
"0.7079291",
"0.7079291",
"0.7079291",
"0.7079291",
"0.7079291",
"0.70613706",
"0.70447886",
"0.6983018",
"0.6959145",
"0.69544697",
"0.6953081",
"0.6953081",
"0.68925387",
"0.6858854",
"0.68546504",
"0.6834388",
"0.6827597",
"0.6827597",
"0.6796416",
"0.6769524... | 0.0 | -1 |
Sets the cloud_platform of this StackViewResponse. type of cloud provider | def cloud_platform(self, cloud_platform):
self._cloud_platform = cloud_platform | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cloud(self, cloud):\n\n self._cloud = cloud",
"def cloud_platform(self):\n return self._cloud_platform",
"def platform_type(self, platform_type):\n self._platform_type = platform_type",
"def cloud_type(self) -> str:\n return pulumi.get(self, \"cloud_type\")",
"def setPlatfor... | [
"0.6736485",
"0.6567717",
"0.64904517",
"0.60702163",
"0.6068089",
"0.60587424",
"0.57670355",
"0.5724394",
"0.56498265",
"0.5379995",
"0.5284888",
"0.51860106",
"0.51742315",
"0.50568503",
"0.5044245",
"0.49483645",
"0.49411187",
"0.49025363",
"0.4889581",
"0.48449868",
"0.4... | 0.8164243 | 0 |
Gets the platform_variant of this StackViewResponse. cloud provider api variant | def platform_variant(self):
return self._platform_variant | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def variant(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"variant\")",
"def variant(self) -> Optional[pulumi.Input['LoggingVariantConfigVariant']]:\n return pulumi.get(self, \"variant\")",
"def platform_version(self) -> Optional[str]:\n return pulumi.get(self, \"platfor... | [
"0.6202142",
"0.60241395",
"0.56926996",
"0.56455576",
"0.5447794",
"0.5400674",
"0.5380225",
"0.5377921",
"0.5335053",
"0.52666205",
"0.52622366",
"0.5254485",
"0.5244452",
"0.52119863",
"0.5210187",
"0.51943356",
"0.51696074",
"0.51691324",
"0.5160636",
"0.51207626",
"0.511... | 0.78026843 | 0 |
Sets the platform_variant of this StackViewResponse. cloud provider api variant | def platform_variant(self, platform_variant):
self._platform_variant = platform_variant | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def platform_variant(self):\n return self._platform_variant",
"def variant_info(self, variant_info):\n\n self._variant_info = variant_info",
"def setPlatform(self):\n\t\treturn None",
"def cloud_platform(self, cloud_platform):\n\n self._cloud_platform = cloud_platform",
"def platform_t... | [
"0.61940426",
"0.5484458",
"0.5429786",
"0.519478",
"0.5181971",
"0.51487416",
"0.51206714",
"0.506125",
"0.49958244",
"0.49857196",
"0.4972714",
"0.49435753",
"0.48953342",
"0.48254177",
"0.47905013",
"0.4787956",
"0.47770366",
"0.47252142",
"0.47053957",
"0.46856812",
"0.46... | 0.78752595 | 0 |
Sets the hdp_version of this StackViewResponse. specific version of HDP | def hdp_version(self, hdp_version):
self._hdp_version = hdp_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hxdp_build_version(self, hxdp_build_version):\n\n self._hxdp_build_version = hxdp_build_version",
"def hx_version(self, hx_version):\n\n self._hx_version = hx_version",
"def hdp_version(self):\n return self._hdp_version",
"def hypervisor_version(self, hypervisor_version):\n\n ... | [
"0.67614126",
"0.671934",
"0.6627358",
"0.6171896",
"0.5744815",
"0.55755526",
"0.5513145",
"0.5449648",
"0.5422354",
"0.5407114",
"0.53934133",
"0.53934133",
"0.53879625",
"0.53496426",
"0.53496426",
"0.53496426",
"0.53496426",
"0.53496426",
"0.53496426",
"0.53496426",
"0.53... | 0.84829843 | 0 |
Gets the cluster of this StackViewResponse. cluster object on stack | def cluster(self):
return self._cluster | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clustering(self) -> 'outputs.ClusteringResponse':\n return pulumi.get(self, \"clustering\")",
"def get_cluster_entry(self):\n\n cert_data = self.cluster_description.get(\"certificateAuthority\", {}).get(\"data\", \"\")\n endpoint = self.cluster_description.get(\"endpoint\")\n arn ... | [
"0.74876666",
"0.70739603",
"0.7037293",
"0.6970391",
"0.6828793",
"0.68085283",
"0.6789719",
"0.6720045",
"0.66731364",
"0.6654192",
"0.6638024",
"0.66311413",
"0.6624151",
"0.66174746",
"0.6613645",
"0.65870553",
"0.6581855",
"0.6571768",
"0.6518994",
"0.64931774",
"0.64856... | 0.8006438 | 1 |
Sets the cluster of this StackViewResponse. cluster object on stack | def cluster(self, cluster):
self._cluster = cluster | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster(self, cluster):\n if self.local_vars_configuration.client_side_validation and cluster is None: # noqa: E501\n raise ValueError(\"Invalid value for `cluster`, must not be `None`\") # noqa: E501\n\n self._cluster = cluster",
"def cluster_uuid(self, cluster_uuid):\n\n s... | [
"0.74705195",
"0.67522335",
"0.6727902",
"0.6710395",
"0.66802794",
"0.6561481",
"0.65092754",
"0.6411891",
"0.63781863",
"0.6327027",
"0.6305521",
"0.629439",
"0.62369066",
"0.62369066",
"0.62369066",
"0.6206456",
"0.61610126",
"0.61610126",
"0.61176884",
"0.611307",
"0.6108... | 0.7924548 | 5 |
Gets the status of this StackViewResponse. status of the stack | def status(self):
return self._status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_stack_status(self, stack):\n stack_description = self.cfn.describe_stacks(StackName=stack)\n return stack_description['Stacks'][0]['StackStatus']",
"def response_status(self):\n return self.__response_status",
"def status(self):\n return self._data['status']",
"def get_status(... | [
"0.7786257",
"0.72588193",
"0.7236264",
"0.7183854",
"0.71577287",
"0.71577287",
"0.71577287",
"0.7063738",
"0.7062223",
"0.7053248",
"0.70405453",
"0.70197284",
"0.70093894",
"0.6985741",
"0.6983248",
"0.69654846",
"0.69160885",
"0.6904581",
"0.68506813",
"0.68506813",
"0.68... | 0.68275845 | 34 |
Gets the node_count of this StackViewResponse. node count of the stack | def node_count(self):
return self._node_count | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count(self):\n return self.__tree.node_count",
"def node_count(self) -> int:\n return pulumi.get(self, \"node_count\")",
"def node_count(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"node_count\")",
"def node_count(self) -> pulumi.Output[int]:\n return pulumi.get(se... | [
"0.77940965",
"0.77752507",
"0.77148503",
"0.77148503",
"0.74907696",
"0.74907696",
"0.74492764",
"0.73974603",
"0.73911744",
"0.73287195",
"0.7323557",
"0.7316286",
"0.72363836",
"0.7232687",
"0.721846",
"0.721846",
"0.7208877",
"0.71493596",
"0.7014173",
"0.7000911",
"0.697... | 0.7929014 | 0 |
Gets the created of this StackViewResponse. creation time of the stack in long | def created(self):
return self._created | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_created(self):\n return self._time_created",
"def time_created(self):\n return self._time_created",
"def time_created(self):\n return self._time_created",
"def time_created(self):\n return self._time_created",
"def create_time(self):\n return self._create_time",
... | [
"0.77804285",
"0.77804285",
"0.77804285",
"0.77804285",
"0.7583143",
"0.7583143",
"0.7583143",
"0.7372045",
"0.73243034",
"0.73171425",
"0.73171425",
"0.7296496",
"0.7278038",
"0.7278038",
"0.7278038",
"0.71684086",
"0.7154693",
"0.7154693",
"0.7154693",
"0.71286476",
"0.7128... | 0.654191 | 78 |
Sets the created of this StackViewResponse. creation time of the stack in long | def created(self, created):
self._created = created | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_created(self, time_created):\n self._time_created = time_created",
"def time_created(self, time_created):\n self._time_created = time_created",
"def time_created(self, time_created):\n self._time_created = time_created",
"def time_created(self, time_created):\n self._time... | [
"0.7328695",
"0.7328695",
"0.7328695",
"0.7328695",
"0.6901494",
"0.6901494",
"0.6901494",
"0.6901494",
"0.68362445",
"0.6820908",
"0.6820908",
"0.6820908",
"0.67729604",
"0.67729604",
"0.67729604",
"0.67729604",
"0.67729604",
"0.67729604",
"0.67729604",
"0.67729604",
"0.6772... | 0.64923465 | 35 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, StackViewResponse):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.84564555",
"0.8391999",
"0.8144653",
"0.81410354",
"0.81326365",
"0.8094085",
"0.80921024",
"0.80921024",
"0.80921024",
"0.8085453",
"0.8085453",
"0.807646",
"0.807646",
"0.806588"
] | 0.0 | -1 |
Get start time of optimization. | def get_start_time(run_history: RunHistory) -> float:
start_times = []
for run_value in run_history.data.values():
if run_value.status in (StatusType.STOP, StatusType.RUNNING):
continue
elif run_value.status not in STATUS_TYPES:
raise ValueError(f'Unexpected run status: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_time(self) -> float:\n return self._start_time",
"def start_time(self):\n return self.__start",
"def start_time(self) -> pulumi.Output[Optional[int]]:\n return pulumi.get(self, \"start_time\")",
"def start_time(self):\n return self._start_time",
"def start_time(self):\... | [
"0.8008785",
"0.80023956",
"0.7901706",
"0.7818591",
"0.7818591",
"0.7818591",
"0.7818591",
"0.7818591",
"0.7818591",
"0.7818591",
"0.7818591",
"0.7761847",
"0.7722987",
"0.7722701",
"0.7720367",
"0.7684373",
"0.7684373",
"0.7660994",
"0.764271",
"0.764271",
"0.7629417",
"0... | 0.0 | -1 |
Extract information to from `ensemble_performance_history` to match the format of this class format. | def _extract_results_from_ensemble_performance_history(
self,
ensemble_performance_history: List[Dict[str, Any]]
) -> None:
if (
len(ensemble_performance_history) == 0
or f'train_{self.metric_name}' not in ensemble_performance_history[0].keys()
):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_history_snapshot(self) -> dict:\n if not self.history_snapshot:\n return {}\n\n if 1 != len(self.history_snapshot):\n raise ValueError(\"Expected history snapshot with one entry only\")\n\n first_item = self.history_snapshot[0]\n return {\n \"b... | [
"0.6318419",
"0.62133795",
"0.6106988",
"0.5830655",
"0.55511945",
"0.54927516",
"0.5435553",
"0.5409605",
"0.5391051",
"0.53752434",
"0.5340033",
"0.5339906",
"0.5339018",
"0.5222033",
"0.5172238",
"0.5157576",
"0.5149844",
"0.51258147",
"0.5123757",
"0.5086138",
"0.5076745"... | 0.71871233 | 0 |
Create main window class | def __init__(self):
super().__init__()
self.geometry('+50+50')
#self.root_y = self.winfo_y() self.winfo_width() self.winfo_height()
self.path = None # file path
self.nn_in = [] # file IN
self.nn_out = [] # file OUT
self.nn_obj = None # NN object
self.pred ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_main_window():\n main_win = MainWindow()\n main_windows.append(main_win)\n available_geometry = app.desktop().availableGeometry(main_win)\n main_win.resize(available_geometry.width() * 2 / 3,\n available_geometry.height() * 2 / 3)\n main_win.show()\n return main_win"... | [
"0.786103",
"0.76320714",
"0.7380832",
"0.7300595",
"0.72056216",
"0.71957654",
"0.7189539",
"0.7181277",
"0.7151579",
"0.7141464",
"0.7128631",
"0.7123733",
"0.7111243",
"0.711076",
"0.7080433",
"0.70770764",
"0.7040871",
"0.70302486",
"0.70302486",
"0.70302486",
"0.70169926... | 0.0 | -1 |
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes. | def add_header(response):
response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'
response.headers['Pragma'] = 'no-cache'
response.headers['Cache-Control'] = 'no-cache, no-store' #'public, max-age=0'
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response",
"def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m... | [
"0.82229453",
"0.8222136",
"0.8222136",
"0.8222136",
"0.8222136",
"0.81953955",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
"0.81629556",
... | 0.8086546 | 34 |
Capitalizes the first letter of a string. | def capitalizeFirst(word):
return word[0].upper() + word[1:] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def capitalize1(s):\n return s[:1].upper() + s[1:]",
"def capitalcase(string):\n\n string = str(string)\n if not string:\n return string\n return uppercase(string[0]) + string[1:]",
"def capitalize_first_letter(text):\n chars = list(text.strip())\n chars[0] = chars[0].upper()\n retu... | [
"0.8459813",
"0.8245206",
"0.80568814",
"0.79816806",
"0.78459686",
"0.7720976",
"0.7702196",
"0.7458719",
"0.7414266",
"0.739688",
"0.7389032",
"0.7367589",
"0.7362168",
"0.73596734",
"0.7357192",
"0.73562384",
"0.7346643",
"0.7329045",
"0.73225266",
"0.731583",
"0.72917193"... | 0.8161416 | 2 |
General renaming function for long strings into Pascal case. Text inbetween trailing parentheses is removed. Commas, dashes, and "ands" are removed. Then string is converted into Pascal case without and spaces present. | def standard_name_remapper(orig_name):
# Remove any trailing parentheses.
# TODO(tjann): to check if this is safe.
paren_start = orig_name.find("(")
if paren_start != -1:
orig_name = orig_name[:paren_start]
# Removes separating words.
orig_name = orig_name.replace(",", " ")
orig_nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pascal_case(st) -> str:\n if st.find('-') != -1 or st.find('_') != -1:\n st = ''.join(a.capitalize() for a in re.split('-|_', st))\n return st[:1].upper() + st[1: len(st)]",
"def snake_to_pascal(string):\n return string[0].upper() + re.sub('_([a-z])', lambda match: match.group(1).upper(), str... | [
"0.71323055",
"0.701514",
"0.6963957",
"0.67618906",
"0.67143583",
"0.6696562",
"0.6687625",
"0.66838896",
"0.666338",
"0.66506827",
"0.66412365",
"0.66027904",
"0.6556149",
"0.65519816",
"0.65495354",
"0.6499307",
"0.64914477",
"0.6483412",
"0.64609885",
"0.6459671",
"0.6451... | 0.71322054 | 1 |
get_elevation > float Returns the elevation of this cell | def get_elevation(self):
return self.elevation | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def elevation(self):\n return self.container['elevation']",
"def elevation(self):\n return self.altitude - self.heightAboveGround",
"def _elevation(self, node):\n return self.graph_provider.get_coords(node)['z']",
"def imu_get_elevation(self):\n return self.imu.get_elevation()",
... | [
"0.7970602",
"0.7916119",
"0.7543452",
"0.75149554",
"0.7257155",
"0.71037674",
"0.6983399",
"0.6854561",
"0.68043756",
"0.673428",
"0.6638675",
"0.66366464",
"0.65509623",
"0.6544223",
"0.6455736",
"0.6411045",
"0.63521665",
"0.6347811",
"0.6209157",
"0.6141262",
"0.6070795"... | 0.82238424 | 0 |
__init__(world, list, float) > None Constructor for this class. It initializes the world, location and elevation instance variables by calling the super class constructor. It initializes the plant instance variable by calling the reset_food_level() method. | def __init__(self, world, location, elevation):
LandCell.__init__(self, world, location, elevation)
self.plant = 0
self.reset_food_level() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, world, location, elevation):\n self.world = world\n self.location = location # (row, col)\n self.elevation = elevation\n if elevation < 0:\n self.water_level = -elevation\n else:\n self.water_level = 0\n self.pollution = 0\n ... | [
"0.811452",
"0.7235793",
"0.6986695",
"0.6953014",
"0.6894566",
"0.68102413",
"0.679176",
"0.6758241",
"0.67270863",
"0.6684999",
"0.6552263",
"0.6543817",
"0.6503856",
"0.64909214",
"0.64859706",
"0.6478806",
"0.6440966",
"0.6433067",
"0.64091337",
"0.6392701",
"0.63767767",... | 0.83024585 | 0 |
get_food_level() > float Returns this cell's current food level | def get_food_level(self):
return self.plant | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weaponValue(self, level):\n if level == 1:\n bonus = 2\n elif level == 2:\n bonus = 4\n elif level == 3:\n bonus = 6\n elif level == 4:\n bonus = 8\n else:\n bonus = 0\n\n return bonus",
"def getLevel(self):\n ... | [
"0.6393657",
"0.6283339",
"0.62776977",
"0.626585",
"0.6070821",
"0.6014998",
"0.6007829",
"0.5994121",
"0.5970132",
"0.5970132",
"0.5970132",
"0.5970132",
"0.59248203",
"0.5916472",
"0.5905953",
"0.59050035",
"0.59050035",
"0.5899641",
"0.58815455",
"0.58815455",
"0.5870626"... | 0.7593147 | 0 |
Verifying whether the ``filename`` is a valid file name or not. | def validate_filename(
filename: PathType,
platform: Optional[PlatformType] = None,
min_len: int = DEFAULT_MIN_LEN,
max_len: int = _DEFAULT_MAX_FILENAME_LEN,
fs_encoding: Optional[str] = None,
check_reserved: bool = True,
) -> None:
FileNameValidator(
platform=platform,
min_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_filename(filename):\n\n if is_fileobj(filename):\n raise ValueError(\"%r not a filename\" % filename)",
"def valid_filename(filename):\n if filename in IGNORED_FILES:\n return False\n if not os.path.exists(filename):\n return False\n _, ext = os.path.splitext(filename)... | [
"0.8821437",
"0.8165118",
"0.80915445",
"0.80587906",
"0.7959755",
"0.79146457",
"0.78715855",
"0.785762",
"0.7707238",
"0.7684971",
"0.7641946",
"0.7621673",
"0.76037115",
"0.75879824",
"0.75770736",
"0.7513519",
"0.745463",
"0.7412385",
"0.7340739",
"0.733335",
"0.7253026",... | 0.7352402 | 18 |
Check whether the ``filename`` is a valid name or not. | def is_valid_filename(
filename: PathType,
platform: Optional[PlatformType] = None,
min_len: int = DEFAULT_MIN_LEN,
max_len: Optional[int] = None,
fs_encoding: Optional[str] = None,
check_reserved: bool = True,
) -> bool:
return FileNameValidator(
platform=platform,
min_len=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_filename(filename):\n\n if is_fileobj(filename):\n raise ValueError(\"%r not a filename\" % filename)",
"def valid_filename(filename):\n if filename in IGNORED_FILES:\n return False\n if not os.path.exists(filename):\n return False\n _, ext = os.path.splitext(filename)... | [
"0.85261905",
"0.8336189",
"0.81115574",
"0.80137503",
"0.79882",
"0.79395753",
"0.79131204",
"0.79106194",
"0.78990155",
"0.7736065",
"0.76610565",
"0.7656108",
"0.762303",
"0.7603209",
"0.7452499",
"0.7411384",
"0.7318708",
"0.72380537",
"0.7228104",
"0.7226553",
"0.7213443... | 0.7741072 | 9 |
Convert the box coordinates to YOLO coordinate format which is relative (xmid, ymid, width, height). | def yolo_coords(self,
img_size: "tuple[int, int]"
) -> "tuple[float, float, float, float]":
img_w, img_h = img_size
return self.xmid / img_w, self.ymid / img_h, self.width / img_w, self.height / img_h | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_back_from_yolo(x, y, w, h):\n xmin = int(round(x - (w / 2)))\n xmax = int(round(x + (w / 2)))\n ymin = int(round(y - (h / 2)))\n ymax = int(round(y + (h / 2)))\n return xmin, ymin, xmax, ymax",
"def find_yolo_coordinates(y_top, y_bottom, x_left, x_right, width, height):\n w = (width... | [
"0.7016359",
"0.6725478",
"0.6576551",
"0.65038365",
"0.62859684",
"0.62677276",
"0.6225631",
"0.61684567",
"0.61170053",
"0.6112212",
"0.60496277",
"0.60418165",
"0.59952855",
"0.59858507",
"0.58870435",
"0.5848622",
"0.5841662",
"0.57981193",
"0.579384",
"0.5789729",
"0.577... | 0.55960196 | 40 |
Distance between two geographical locations (denoted by lat, long) | def get_distance_matrix(locations, type="fastest;car;"):
full_request = "{}?start0={}&destination0={}&mode=fastest;car&summaryAttributes=distance,traveltime&apiKey={}".format(config.MATRIX_URL, locations[0], locations[1], config.HERE_API_KEY)
response = requests.get(full_request).json()
return response['r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_distance(lat1, long1, lat2, long2):\n x = 69.1*(lat2 - lat1)\n y = 69.1*(long2 - long1) * math.cos(lat1/57.3)\n dist = math.sqrt(x*x + y*y)\n return dist",
"def get_distance_meters(location1, location2):\n dlat = location2.lat - location1.lat\n dlong = location2.lon - location1.lon\n ... | [
"0.81985664",
"0.8027252",
"0.801682",
"0.7938804",
"0.79245716",
"0.7892866",
"0.7891499",
"0.784727",
"0.7838648",
"0.7817262",
"0.77853215",
"0.77756536",
"0.7774936",
"0.7757285",
"0.7757285",
"0.7757285",
"0.7757285",
"0.7757285",
"0.7752805",
"0.7751773",
"0.77464736",
... | 0.0 | -1 |
Get name of location based on latitude and longitude. | def get_address_by_location(lat, lng):
request = "{}/{}?key={}&lat={}&lon={}&format=json".format(config.GEOCODE_URL, config.GEOCODE_REVERSE_PATH, config.GEOCODE_KEY, lat, lng)
response = requests.get(request).json()
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_location_name(lat, lon):\n for shapeRecords in sf.iterShapeRecords():\n shape, record = shapeRecords.shape, shapeRecords.record\n bbox, points = shape.bbox, shape.points\n if point_inside_polygon((lon, lat), [(bbox[0], bbox[1]), (bbox[2], bbox[1]), (bbox[2], bbox[3]... | [
"0.76845986",
"0.75239956",
"0.746868",
"0.7199531",
"0.708479",
"0.6808959",
"0.6783047",
"0.67694706",
"0.66928184",
"0.66535145",
"0.6603523",
"0.6588768",
"0.65448046",
"0.64737916",
"0.6445423",
"0.6358732",
"0.6351859",
"0.6330698",
"0.6330698",
"0.6330698",
"0.6330698"... | 0.0 | -1 |
Return a mask to determine whether an array chunk has any zeros. | def zero_mask(self):
accum = 0
for i in range(self.data.itemsize):
accum += (0x55 << (i << 3))
return accum | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_mask(self) -> bool:\n return self._mask_array is not None",
"def has_zeros(tensor, verbose=True):\n tensor_numpy = tensor.data.cpu().numpy().flatten()\n where_zero = np.argwhere(tensor_numpy == 0.0)\n\n zero_count = len(where_zero)\n zero = zero_count != 0\n\n if verbose and zero:\n... | [
"0.6552796",
"0.64409477",
"0.6373592",
"0.6327988",
"0.6321648",
"0.62395984",
"0.6213743",
"0.6173588",
"0.608891",
"0.60540605",
"0.60450613",
"0.6021274",
"0.59887624",
"0.59774715",
"0.59619784",
"0.5949329",
"0.59456754",
"0.5944145",
"0.5938512",
"0.5890166",
"0.588553... | 0.6272051 | 5 |
Return a mask to determine whether an array chunk has any ones. | def one_mask(self):
accum = 0
for i in range(self.data.itemsize):
accum += (0xAA << (i << 3))
return accum | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_mask(self) -> bool:\n return self._mask_array is not None",
"def is_full(self) -> bool:\n return self._array[0].all()",
"def isEmpty(self):\n return len(self.mask) == 0",
"def _nodata_mask(self):\n if self.nodata_value is None:\n return np.ones_like(self.array, ... | [
"0.6934317",
"0.6453607",
"0.6398193",
"0.63610476",
"0.6258612",
"0.62105155",
"0.6086739",
"0.6073837",
"0.6065538",
"0.6062087",
"0.6004628",
"0.5971189",
"0.59650844",
"0.5925708",
"0.59080124",
"0.5894839",
"0.5886453",
"0.588571",
"0.588243",
"0.58785695",
"0.5863043",
... | 0.56984794 | 34 |
Iterate through the indices of all zero items. | def iter_zeros(self):
num = quotient = 0
while num < self._len:
chunk = self.data[quotient]
if chunk & self.zero_mask:
remainder = 0
while remainder < self.width and num < self._len:
item = (chunk >> remainder) & 3
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vir_indices(self):\n indices = []\n for index,item in enumerate(self):\n if item==0:\n indices.append(index)\n return indices",
"def empty_c_enumerate():\n i,k = 55,99\n for i,k in enumerate(range(0)):\n print(i, k)\n return i, k",
"def nonzero... | [
"0.7469914",
"0.65542585",
"0.64857316",
"0.6389875",
"0.63408834",
"0.6270461",
"0.6221182",
"0.619945",
"0.61649704",
"0.6081784",
"0.59789026",
"0.58899724",
"0.58347046",
"0.5828708",
"0.58274204",
"0.58104223",
"0.57994884",
"0.57764864",
"0.5762076",
"0.5760333",
"0.575... | 0.7326734 | 1 |
r"""Return whether a function is positive unate. | def is_pos_unate(self, vs=None):
vs = self._expect_vars(vs)
basis = self.support - set(vs)
mincov = [PC_ZERO] * (1 << len(basis))
# Test whether table entries are monotonically increasing
for cf in self.iter_cofactors(vs):
for i, item in enumerate(cf.pcdata):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isnegative(x):\n if x < 0 :\n return True\n return False",
"def is_positive(self, a):\n return a > 0",
"def is_negative(self, a):\n return a < 0",
"def is_nonpositive(self, a):\n return a <= 0",
"def is_Positive(self):\n return self.signature() > 0",
"def is_n... | [
"0.74767566",
"0.7206125",
"0.70244205",
"0.70055294",
"0.69563293",
"0.69477206",
"0.6907668",
"0.68677986",
"0.68677986",
"0.68677986",
"0.6806525",
"0.6786455",
"0.6759733",
"0.6721745",
"0.6702849",
"0.65883565",
"0.6540954",
"0.647641",
"0.64318705",
"0.6419216",
"0.6361... | 0.0 | -1 |
Get the time at a given timezone | def post():
if flask.request.content_type != 'application/json':
logger.error(f"Request data type is not json (content_type="
f"'{flask.request.content_type}')")
return make_response(
jsonify(status="Error",
errors=['Only JSON data is supported'])... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_timezone(time_zone=''):\n return pytz.timezone(time_zone)",
"def timezone():\n\n return time.timezone",
"def get_timezone():\n return dates.get_timezone(_get_tz())",
"def time_zone():\n return timezone('Etc/GMT-10')",
"def timezone():\n \n pass",
"def get_timezone(timezone: s... | [
"0.7625631",
"0.7387199",
"0.71927565",
"0.7186359",
"0.71333236",
"0.7053057",
"0.69802713",
"0.69773966",
"0.69735444",
"0.6929341",
"0.6891242",
"0.68628514",
"0.6719403",
"0.66998094",
"0.66951513",
"0.66860414",
"0.66463214",
"0.6617752",
"0.65711665",
"0.6539809",
"0.65... | 0.0 | -1 |
Draw a rectangle with a given center, width, height and rotation angle around the center. The values for the color, line width and opacity are the same you would use when drawing on a FITSFigure instance. | def draw_centered_rectangle(
self,
theta: Quantity,
width: Quantity,
height: Quantity,
ra: Quantity,
dec: Quantity,
color: str,
linewidth: float = 1,
alpha: float = 0.7,
) -> None:
height /= 2.0
width /= 2.0
# position ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_rectangle_filled(center_x, center_y, width, height, color,\n tilt_angle=0):\n\n GL.glEnable(GL.GL_BLEND)\n GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)\n GL.glEnable(GL.GL_LINE_SMOOTH)\n GL.glHint(GL.GL_LINE_SMOOTH_HINT, GL.GL_NICEST)\n GL.glHint(GL.GL... | [
"0.7127856",
"0.6965112",
"0.6871782",
"0.67371005",
"0.6682518",
"0.64117277",
"0.6402314",
"0.63924706",
"0.6355689",
"0.63342637",
"0.6327853",
"0.6165512",
"0.61078155",
"0.6064275",
"0.60453415",
"0.603151",
"0.5993932",
"0.59920686",
"0.5981927",
"0.5966147",
"0.5949400... | 0.7000837 | 1 |
Returns the part of a stream file after the 're_guard' regular expression matches a complete line, then skips lines that are blank or composed by '=' characters. | def forward_stream(stream, re_guard):
for rawline in stream:
if re.match('^%s$' % re_guard, rawline):
while True:
first = next(stream)
if not re.match('(=*|)\n', first):
break
break
else:
raise ParsingError("Cannot pars... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def readFiltered(f):\n line = f.readline()\n while line:\n line = line.strip()\n if len(line) != 0:\n if line == \"### NEW EXPERIMENT ###\":\n # print (\"readFiltered: ''\")\n yield \"\"\n elif line[0] != \"#\":\n # print (\"rea... | [
"0.61371577",
"0.5976368",
"0.596423",
"0.5865053",
"0.5757546",
"0.57542294",
"0.5691772",
"0.5621619",
"0.5557751",
"0.55392605",
"0.5493795",
"0.54659706",
"0.54308766",
"0.53642976",
"0.5346902",
"0.5338635",
"0.53131336",
"0.5298904",
"0.52445704",
"0.5211992",
"0.512131... | 0.6440275 | 0 |
r""" F_{p} = \frac{1}{\lambda_{p}} \int\limits_{R} \dd{\Omega(\omega)} f(\omega) \overline{S_{p}(\omega)}. | def _integrate_region(self, rank: int) -> complex:
assert isinstance(self.mask, np.ndarray) # noqa: S101
assert isinstance(self.f, np.ndarray) # noqa: S101
s_p = ssht.inverse(
self.slepian.eigenvectors[rank],
self.L,
Method=sleplet._vars.SAMPLING_SCHEME,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skew_js_fgan_lower_bound(f):\n n = tf.cast(f.shape[0], tf.float32)\n alpha = 1/n\n f_diag = tf.linalg.tensor_diag_part(f)\n first_term = tf.reduce_mean(-tf.nn.softplus(-f_diag))\n second_term = (tf.reduce_sum(tf.nn.softplus(f)) - tf.reduce_sum(tf.nn.softplus(f_diag))) / (n * (n - 1.))\n return alpha*firs... | [
"0.5475146",
"0.5394708",
"0.5356845",
"0.5305209",
"0.530353",
"0.5266239",
"0.5236522",
"0.52339935",
"0.52049285",
"0.51911706",
"0.5176296",
"0.5172985",
"0.51650286",
"0.5156714",
"0.5138618",
"0.5109831",
"0.5077677",
"0.5074584",
"0.50648314",
"0.50581425",
"0.50390136... | 0.0 | -1 |
Returns the type of an observation | def get_observation_type(self, observation_id):
if observation_id is None:
raise ValueError("Please input an observation id")
query = f"select obs_type from ehst.observation where observation_id='{observation_id}'"
job = self.query_tap(query=query)
if any(job["obs_type"]):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_observable_type(stix_obj, log):\n obj_type = stix_obj[u\"type\"]\n if obj_type == u\"observed-data\":\n #\n # so far all the observed-data has only one embedded obj\n # if there is more, log the error\n #\n if len(stix_obj[u\"objects\"]) > 1:\n log.error(... | [
"0.74332035",
"0.7202502",
"0.6585518",
"0.6585518",
"0.65241486",
"0.6477421",
"0.64539146",
"0.63666284",
"0.6358606",
"0.63167155",
"0.63122296",
"0.6304424",
"0.62798065",
"0.6257411",
"0.6252387",
"0.624772",
"0.62475514",
"0.62475514",
"0.62475514",
"0.62475514",
"0.624... | 0.72846043 | 1 |
Panoptic deeplab model initializer. | def __init__(
self,
backbone: tf.keras.Model,
semantic_decoder: tf.keras.Model,
semantic_head: tf.keras.layers.Layer,
instance_head: tf.keras.layers.Layer,
instance_decoder: Optional[tf.keras.Model] = None,
post_processor: Optional[panoptic_deeplab_merge.PostProcessor] = None,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self,\n decoder_options,\n panoptic_deeplab_options,\n bn_layer=tf.keras.layers.BatchNormalization):\n super(PanopticDeepLab, self).__init__(name='PanopticDeepLab')\n\n low_level_feature_keys = [\n item.feature_key for item in panoptic_deeplab_opt... | [
"0.7014198",
"0.6703225",
"0.65733105",
"0.6543019",
"0.64906317",
"0.64668435",
"0.64313126",
"0.6411854",
"0.6339635",
"0.63254905",
"0.6304288",
"0.63015765",
"0.6298163",
"0.6293113",
"0.6279685",
"0.62793845",
"0.62793845",
"0.62793845",
"0.62793845",
"0.62793845",
"0.62... | 0.73851556 | 0 |
Returns the raw Point3D object that this class wraps. | def point(self) -> Point3D:
return self._point.copy() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position3d(self) -> Point3:\n return Point3.from_proto(self.proto.pos)",
"def point(self):\n return self.x, self.y, self.z",
"def readPoint3( node ):\r\n return Point3( float( node.getAttribute( 'x' ) ),\r\n float( node.getAttribute( 'y' ) ),\r\n float( ... | [
"0.7503909",
"0.70873934",
"0.66756666",
"0.6633604",
"0.65358496",
"0.6255088",
"0.6236037",
"0.62096566",
"0.6192528",
"0.6164",
"0.6135148",
"0.6104769",
"0.6085753",
"0.6074878",
"0.6043787",
"0.60326755",
"0.6005557",
"0.597409",
"0.597409",
"0.59606355",
"0.59468925",
... | 0.7798022 | 0 |
Makes a Box component the same size and in the same location of this BoundingBox. | def make_box(self, name=None) -> 'Box':
if self.size().x == 0:
box = Rect(self.size().z, self.size().y, name=name)
box.ry(90)
elif self.size().y == 0:
box = Rect(self.size().x, self.size().z, name=name)
box.rx(90)
elif self.size().z == 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def box(self, x, y, w, h):\n\t\tpass",
"def box(original, diameter):\n return Box(original, h.ones(original.size()) * diameter, None).checkSizes()",
"def __resizeBox(self, x, y):\n # Implement the correct behavior for dragging a side\n # of the box: Only change one dimension.\n if ... | [
"0.69793016",
"0.67570335",
"0.66656315",
"0.66385555",
"0.663125",
"0.66007394",
"0.66007394",
"0.65882325",
"0.6447868",
"0.636768",
"0.63557845",
"0.63527066",
"0.6335681",
"0.6335107",
"0.6319581",
"0.6260842",
"0.62176156",
"0.6199272",
"0.6132318",
"0.6130587",
"0.61173... | 0.7006979 | 0 |
Moves this component by the individual axes component of each of the 3 specified vectors. This is a powerful method that can be used in various ways to specify the location of a component. It is typically used to place this Component at some position relative to another Component or other BoundedEntity. This takes adva... | def place(self, x: _vector_like = _null_vector, y: _vector_like = _null_vector,
z: _vector_like = _null_vector):
transform = Matrix3D.create()
transform.translation = Vector3D.create(x.x, y.y, z.z)
self._local_transform.transformBy(transform)
self._reset_cache()
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position(self, x, y, z):\n self.curr_position = Vector([x, y, z])\n self.ptr.position(x, y, z)",
"def align_to(self, entity: _entity_types, vector: Vector3D) -> 'Component':\n self_body = _union_entities(self.bodies)\n other_body = _union_entities(entity, vector=vector)\n a... | [
"0.570382",
"0.5679852",
"0.5579387",
"0.5574842",
"0.55629456",
"0.5558937",
"0.54563385",
"0.54500437",
"0.5418682",
"0.5417899",
"0.54111",
"0.5407337",
"0.5377506",
"0.53680414",
"0.53625953",
"0.535682",
"0.5336096",
"0.52844864",
"0.5251608",
"0.524144",
"0.5217793",
... | 0.52573895 | 18 |
Rotates this Component around the Y axis. | def ry(self, angle: float, center: Onion[Iterable[Onion[float, int]], Point3D] = None) -> 'Component':
return self.rotate(ry=angle, center=center) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rot_y_deg(self):\n # TODO describe which axis this is\n return math.degrees(self._rot_y_rad)",
"def rot_y_rad(self):\n return self._rot_y_rad",
"def rotate_y(self, angle: float):\n self.vertices = list(\n Matrix44.y_rotate(angle).transform_vertices(self.vertices)\n ... | [
"0.74188274",
"0.7321011",
"0.70813453",
"0.68398947",
"0.6699089",
"0.6686019",
"0.6656091",
"0.6435673",
"0.63996136",
"0.6391243",
"0.6391243",
"0.63611203",
"0.6353137",
"0.63422",
"0.631384",
"0.6308991",
"0.6286511",
"0.6217883",
"0.6206301",
"0.6206301",
"0.6201484",
... | 0.0 | -1 |
Translates this Component the given distance in the Y axis. | def ty(self, ty: float) -> 'Component':
return self.translate(ty=ty) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def y(self, destination):\n destination = (self.center[0], destination)\n self.move(destination=destination, origin=self.center, axis=\"y\")",
"def ty(self, dist: float) -> \"Mate\":\n self.translate(self.y_dir, dist)\n return self",
"def y_distance(self):\n return self.get_d... | [
"0.64164954",
"0.639191",
"0.61676455",
"0.59202546",
"0.5866555",
"0.5851533",
"0.5813005",
"0.57843214",
"0.5757983",
"0.5697727",
"0.563524",
"0.56227964",
"0.56227964",
"0.5583887",
"0.55565804",
"0.55519557",
"0.5483128",
"0.5390929",
"0.53873545",
"0.53825843",
"0.53629... | 0.0 | -1 |
Adds a point to this Component with the given name. The added point will remain in the same relative position in the component even when the component is moved/transformed. | def add_named_point(self, name: str, point: Onion[Sequence[float], Point3D, Point]):
if isinstance(point, Point):
point = point.point
if isinstance(point, Point3D):
point = point.copy()
else:
point = Point3D.create(*point)
point.transformBy(self._inver... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addPoint(self, point):\n self.points.append(point)",
"def add(self, point):\n self.points.append(point)",
"def add(self, point):\n if not isinstance(point, Point):\n raise ValueError('Argument point should be an Point instance')\n self.x = self.x + point.x\n se... | [
"0.7141879",
"0.7045399",
"0.7004538",
"0.69994",
"0.6996322",
"0.68653345",
"0.6751839",
"0.6730616",
"0.67060304",
"0.66839087",
"0.663613",
"0.64381313",
"0.6348386",
"0.6340498",
"0.62892807",
"0.62892807",
"0.62892807",
"0.6271537",
"0.62693864",
"0.6264531",
"0.625913",... | 0.82228005 | 0 |
Associates a name with the specified Faces in this Component. The Faces can later be looked up by name using `named_faces(name)` | def add_named_faces(self, name: str, *faces: Face):
face_index_list = self._named_faces.get(name) or []
for face in faces:
face_index_list.append(self._find_face_index(face))
self._named_faces[name] = face_index_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFaceName(*args, **kwargs):\n return _gdi_.NativeFontInfo_SetFaceName(*args, **kwargs)",
"def SetFaceName(*args, **kwargs):\n return _gdi_.Font_SetFaceName(*args, **kwargs)",
"def named_faces(self, name) -> Optional[Sequence[Face]]:\n face_index_list = self._named_faces.get(name)\n ... | [
"0.6791572",
"0.67838544",
"0.6168486",
"0.582025",
"0.5729179",
"0.56134045",
"0.551566",
"0.55098933",
"0.5492011",
"0.5477077",
"0.5439372",
"0.5414109",
"0.5414109",
"0.5414109",
"0.5414109",
"0.5413227",
"0.5381939",
"0.5369442",
"0.5369442",
"0.53659654",
"0.5350351",
... | 0.80350316 | 0 |
Associates a name with the specified Edges in this Component. The Edges can later be looked up by name using `named_edges(name)` | def add_named_edges(self, name: str, *edges: Edge):
edge_index_list = self._named_edges.get(name) or []
for edge in edges:
edge_index_list.append(self._find_edge_index(edge))
self._named_edges[name] = edge_index_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_node(self, name, edges):\n self.nodes[name] = Node(edges)",
"def __init__(self, name):\n self.name = name\n self._edges = []",
"def update_edges(\n viewer, \n annotations, \n edge_color='white',\n name='edges',\n ):\n \n try:\n del viewer.layers[name]\n e... | [
"0.68017393",
"0.639595",
"0.628443",
"0.6124624",
"0.61165136",
"0.60602325",
"0.5991524",
"0.5907927",
"0.584544",
"0.584544",
"0.584544",
"0.584544",
"0.5764682",
"0.567917",
"0.56016576",
"0.55612785",
"0.5539054",
"0.551505",
"0.55140334",
"0.5443488",
"0.5438032",
"0.... | 0.7523582 | 0 |
Gets the maximum thickness of the component in the specified axis. | def thickness(self, axis):
self_body = _union_entities(self.bodies)
axis = axis.copy()
axis.normalize()
other_axis = _get_arbitrary_perpendicular_unit_vector(axis)
return app().measureManager.getOrientedBoundingBox(self_body, axis, other_axis).length | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def thickness(self):\n return self._thickness",
"def _scrollbar_thickness(self, orientation):\n style = self.widget.style()\n options = QtGui.QStyleOptionSlider()\n options.orientation = orientation\n return style.pixelMetric(style.PM_ScrollBarExtent, options)",
"def border_t... | [
"0.60751945",
"0.59286076",
"0.5824411",
"0.5741607",
"0.57338965",
"0.56593263",
"0.5655088",
"0.5616163",
"0.55995166",
"0.55995166",
"0.55995166",
"0.5590926",
"0.5554344",
"0.55228573",
"0.54933167",
"0.5464237",
"0.5435741",
"0.5412453",
"0.5399965",
"0.53989464",
"0.537... | 0.72173256 | 0 |
Define a line from the previous end point to the given point. | def line_to(self, point: Onion[Tuple[float, float], Point2D, Point3D, Point]):
start_point = self.last_point
end_point = _point_2d(point)
self._segments.append(Line3D.create(start_point, end_point)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def previous_line():\r\n set_point(point().previous_line())",
"def end_of_line():\r\n set_point(point().end_of_line())",
"def begining_of_line():\r\n set_point(point().begining_of_line())",
"def next_line():\r\n set_point(point().next_line())",
"def lineTo(self, pt: Tuple[float, float]) -> None:\n ... | [
"0.8086202",
"0.69992834",
"0.69946116",
"0.6972152",
"0.6844246",
"0.64684904",
"0.63794786",
"0.6333369",
"0.6333049",
"0.6171096",
"0.61476123",
"0.6129955",
"0.6114923",
"0.60592",
"0.60554975",
"0.60215133",
"0.60143006",
"0.6004489",
"0.59976375",
"0.597175",
"0.5937651... | 0.7071595 | 1 |
The bottom (starting) face of the loft. | def bottom(self) -> Face:
return self.bodies[0].faces[self._bottom_index] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bottom(self) -> float:\n bottom = 0\n for part in self.line_parts:\n if part.state.rise < 0 and -part.state.rise > bottom:\n bottom = -part.state.rise\n return bottom",
"def bottom(self):\n return self.__b",
"def bottom_y(self):\r\n return self.pos... | [
"0.68722105",
"0.6564274",
"0.65628797",
"0.65538156",
"0.65538156",
"0.6471682",
"0.64516157",
"0.6378046",
"0.6367439",
"0.6302617",
"0.6215937",
"0.62068623",
"0.61202216",
"0.6085902",
"0.6076621",
"0.60748094",
"0.6021918",
"0.6014251",
"0.60128176",
"0.59971213",
"0.597... | 0.7575258 | 0 |
All side faces of the loft. | def sides(self) -> Iterable[Face]:
side_faces = []
for i in range(0, len(self.bodies[0].faces)):
if i != self._bottom_index and i != self._top_index:
side_faces.append(self.bodies[0].faces[i])
return side_faces | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def faces(self):\r\n return self._faces",
"def side_faces(self) -> Sequence[Face]:\n if not self._cached_side_faces:\n self._cached_side_faces = self._get_faces(self._side_face_indices)\n return list(self._cached_side_faces)",
"def faces(self):\n\n if self._faces is None:... | [
"0.74334776",
"0.7254956",
"0.71003556",
"0.68691534",
"0.6796774",
"0.6521951",
"0.6497028",
"0.64240867",
"0.62861943",
"0.6273284",
"0.6241007",
"0.61804765",
"0.61716336",
"0.6133068",
"0.60586107",
"0.604666",
"0.6020978",
"0.59672135",
"0.59270746",
"0.5914804",
"0.5898... | 0.7668584 | 0 |
The faces of the resulting body that correspond to the sides of the extrusion. | def side_faces(self) -> Sequence[Face]:
if not self._cached_side_faces:
self._cached_side_faces = self._get_faces(self._side_face_indices)
return list(self._cached_side_faces) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def faces(self):\n\n if self._faces is None:\n if self._vertices is None:\n return None\n self.triangulate()\n return self._faces",
"def faces(self):\r\n return self._faces",
"def sides(self) -> Iterable[Face]:\n side_faces = []\n for i in... | [
"0.75726026",
"0.7529332",
"0.74052906",
"0.6787317",
"0.6755922",
"0.67132163",
"0.6426014",
"0.6422162",
"0.6371225",
"0.63530177",
"0.6314939",
"0.6235243",
"0.6220364",
"0.6219387",
"0.6152661",
"0.61510944",
"0.6144892",
"0.61380523",
"0.6136499",
"0.61344165",
"0.612950... | 0.6278382 | 11 |
Convert a file path on a host to a UNC path. | def convert_unc(host, path):
return ''.join(['\\\\', host, '\\', path.replace(':', '$')]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convertToURL( cPathname ):\n if len( cPathname ) > 1:\n if cPathname[1:2] == \":\":\n cPathname = \"/\" + cPathname[0] + \"|\" + cPathname[2:]\n cPathname = string.replace( cPathname, \"\\\\\", \"/\" )\n cPathname = \"file://\" + cPathname\n return cPathname",
"def convertToURL(... | [
"0.6320073",
"0.63139045",
"0.6006103",
"0.59943885",
"0.59018195",
"0.5817606",
"0.58053935",
"0.5785099",
"0.5752329",
"0.56979394",
"0.56907725",
"0.5676774",
"0.56316245",
"0.5626739",
"0.5576441",
"0.55755734",
"0.5558591",
"0.5550715",
"0.5468847",
"0.5445266",
"0.53956... | 0.6846182 | 0 |
Add the routes for the scheduler API. | def _load_api(self):
self.app.add_url_rule('/scheduler', 'get_scheduler_info', self._apply_auth(api.get_scheduler_info))
self.app.add_url_rule('/scheduler/jobs', 'add_job', self._apply_auth(api.add_job), methods=['POST'])
self.app.add_url_rule('/scheduler/jobs', 'get_jobs', self._apply_auth(api.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_routes(self):\n pass",
"def create_routes(self):\r\n self._app.route('/api/autoconf',\r\n methods=['GET'],\r\n endpoint='api_autoconf')(self.entrypoint)\r\n self._app.route('/api/autoconf/<string:session_id>',\r\n m... | [
"0.7499213",
"0.7375958",
"0.7165634",
"0.71483576",
"0.706246",
"0.7012675",
"0.6879881",
"0.67752314",
"0.6767055",
"0.6561623",
"0.6431154",
"0.6400402",
"0.636531",
"0.6342701",
"0.63256764",
"0.6289153",
"0.6285892",
"0.61776215",
"0.6135736",
"0.61179405",
"0.6110238",
... | 0.7012195 | 6 |
All initial values are set to zero until initalized using the initialize() method which reads in data using the ModelParameterDictionary and sets the random variables according to their respective distribution. REQUIRED PARAMETERS | def __init__(self, input_file=None):
# We import methods from ModelParameterDictionary
# to read the parameters from the input file.
#If the scale parameter is unknown, it can be found using the mean
# fire recurrence value, which MUST be known or estimated to run the
# get_scal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_parameters(self):\n stdv = 1. / math.sqrt(self.weight.data.size(1))\n self.weight.data.uniform_(-stdv, stdv)\n if self.bias is not None:\n self.bias.data.uniform_(-stdv, stdv)",
"def reset_parameters(self):\n logger.info('===== Initialize %s with normal distributio... | [
"0.72837156",
"0.71787727",
"0.709951",
"0.70701873",
"0.7030441",
"0.7020086",
"0.6891325",
"0.6888089",
"0.6870833",
"0.686894",
"0.68512034",
"0.684646",
"0.684646",
"0.6841072",
"0.68400097",
"0.67898464",
"0.6736047",
"0.6708219",
"0.6702966",
"0.670018",
"0.6667497",
... | 0.0 | -1 |
Linearly scale value to fit given domain | def scale_value(value, ip_range, domain=(0,1)):
x1, x2 = domain
y1, y2 = ip_range
assert(y1 <= value <= y2)
m = (x2 - x1)/(y2 - y1)
b = y1 - m * x1
return m * value - b | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def linearscale(input, boundfrom, boundto, extrema=None):\n\n\tminfrom,maxfrom = boundfrom\n\tminto,maxto = boundto\n\n\t### default from bounds are min,max of the input\n\tif minfrom is None:\n\t\tif extrema:\n\t\t\tminfrom = extrema[0]\n\t\telse:\n\t\t\tminfrom = arraystats.min(input)\n\tif maxfrom is None:\n\t\... | [
"0.7119745",
"0.708003",
"0.69508505",
"0.68585503",
"0.6790014",
"0.66305196",
"0.6525671",
"0.6507342",
"0.6465105",
"0.6455001",
"0.64510983",
"0.6441175",
"0.6386167",
"0.63564706",
"0.6304465",
"0.6259794",
"0.6206806",
"0.6192118",
"0.6182487",
"0.617389",
"0.61733735",... | 0.6909576 | 3 |
This fixture will create full application object. It can be use for accessing the db in tests. | def application(self):
if not ApplicationFixture._test_app:
app = self.APP_CLASS()
app.run_tests()
ApplicationFixture._test_app = app
return ApplicationFixture._test_app | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app():\n # create a temporary file to isolate the database for each test\n # create the app with common test config\n app = create_app({\"TESTING\": True, \"DATABASE_NAME\": \"AAPI_DB_Test\"})\n\n # create the database and load test data\n with app.app_context():\n init_db()\n\n yield ... | [
"0.7688018",
"0.7588747",
"0.75127107",
"0.7413099",
"0.73999125",
"0.7388667",
"0.73783416",
"0.73605776",
"0.7342923",
"0.7339571",
"0.73151743",
"0.7302136",
"0.7302136",
"0.7299375",
"0.7295352",
"0.72885364",
"0.72712225",
"0.72692806",
"0.7267851",
"0.72392523",
"0.7236... | 0.7114763 | 47 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.