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 the formal charge of the atom. Returns | def get_charge(self):
return self._charge | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_charges(self, atoms):\n if 'charges' in self.results:\n return self.results['charges']\n else:\n return None",
"def getCharge(self):\n return _libsbml.Species_getCharge(self)",
"def getCharge(self):\n return _libsbml.FbcSpeciesPlugin_getCharge(self)",
... | [
"0.65921676",
"0.6480362",
"0.6326302",
"0.6322137",
"0.62564534",
"0.611431",
"0.605492",
"0.59702843",
"0.58818704",
"0.57437885",
"0.5686103",
"0.56282187",
"0.5620057",
"0.5620057",
"0.56146234",
"0.56070817",
"0.55312276",
"0.5499543",
"0.5479982",
"0.54717684",
"0.54691... | 0.5953874 | 8 |
Create a new FakeRequest. | def __init__(self, payload):
self.payload = payload | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_request(params={}, path='/', method='POST'):\n request = DummyRequest(path)\n request.method = method\n request.args = params\n return request",
"def request_factory() -> RequestFactory:\n\n return RequestFactory()",
"def createRequest(test, url, headers=None):\n request = HTTPRequ... | [
"0.73175603",
"0.7217251",
"0.71283996",
"0.7102335",
"0.69908273",
"0.69307697",
"0.6744699",
"0.6716033",
"0.6707411",
"0.6690388",
"0.6652037",
"0.6641294",
"0.65867877",
"0.6542175",
"0.6535971",
"0.6518881",
"0.64871156",
"0.6450684",
"0.6338459",
"0.6326255",
"0.6318199... | 0.0 | -1 |
Create and return the client final message. | def client_final_message(self):
return "c=biws,r={},p={}".format(self.nonce, base64.b64encode(self.client_proof).decode()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def construct_message(self):\n msg_type = self.msg_type\n if msg_type == \"PUBMSG\":\n msg_type = \"PRIVMSG\"\n ret = \"{} {}\".format(msg_type, self.target)\n if self.content:\n ret += \" :{}\".format(self.content)\n return ret + \"\\r\\n\"",
"def create_... | [
"0.7200423",
"0.68963915",
"0.6847836",
"0.65430474",
"0.6453687",
"0.6336548",
"0.63121253",
"0.6258828",
"0.6250206",
"0.62453645",
"0.6231146",
"0.6203862",
"0.6164318",
"0.6156037",
"0.61532164",
"0.6137883",
"0.61344695",
"0.6063995",
"0.6045266",
"0.6025768",
"0.5957407... | 0.6773863 | 3 |
This setUp is in common for all the test cases below, and it's only execuded once We are ensuring all the entries are in the database. | def setUpClass(cls):
cls.local_compounds = csv_to_compounds(CSV_FILE)
# clear the DB so we are sure that the local compounds are the same as the remote ones
r = api_clear(BASE_URL)
assert r.status_code == 204
r = api_batchadd(BASE_URL, cls.local_compounds)
assert r.status... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n super(InfiniteFeedTests, self).setUp()\n self.db_set_up()",
"def setUp(self):\n self.db_handler = DynamoDBHandler(ModelTests.TABLE_NAME)\n self.init_table()\n self.items = {}\n self.init_items()\n self.populate_table()",
"def setUp(self):\n ... | [
"0.8266936",
"0.8077561",
"0.80119467",
"0.79985225",
"0.79949707",
"0.78880525",
"0.7854587",
"0.7846121",
"0.7814978",
"0.779376",
"0.77839947",
"0.77683526",
"0.7748396",
"0.7708525",
"0.7704946",
"0.77044225",
"0.7699264",
"0.76699656",
"0.76596683",
"0.7651447",
"0.76277... | 0.0 | -1 |
Utility for converting time to a readable format | def format_seconds(duration):
return stats_utils.format_seconds(duration) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_time_human_readable():\n return time.strftime(\"%A, %H:%M\")",
"def get_time_str():\n return time.strftime(time_fmt)",
"def format_time(self, time):\n hh = time[0:2]\n mm = time[2:4]\n ss = time[4:]\n return \"%s:%s:%s UTC\" % (hh,mm,ss)",
"def __format_time(in_time)... | [
"0.79482764",
"0.7790982",
"0.7768226",
"0.77604693",
"0.76974124",
"0.76054263",
"0.75550926",
"0.7520432",
"0.7505294",
"0.74749476",
"0.7465713",
"0.73153657",
"0.73056006",
"0.72978073",
"0.7266752",
"0.7255068",
"0.7254812",
"0.7253192",
"0.7233307",
"0.72093713",
"0.713... | 0.0 | -1 |
Add a userdefined rule for processing | def add_rule(self, regexp, actions):
act_list = actions if hasattr(actions, "append") else [actions]
self._user_rules.append(
grep(regexp, act_list)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_rule(self, rule):\n self.rule.append(rule)",
"def add_rule(self, rule):\n \n self.rules.append(rule)",
"def add_rule(self, rule) -> None:\n self.add_rules([rule])",
"def add_rule(self, rule: Rule):\n self.rules.append(rule)",
"def add_rule(self, rule):\n as... | [
"0.788966",
"0.7666368",
"0.7665126",
"0.74553794",
"0.7424087",
"0.7262521",
"0.71553975",
"0.7155152",
"0.70289135",
"0.6844776",
"0.68376344",
"0.6812977",
"0.6787777",
"0.6764527",
"0.67004496",
"0.6698899",
"0.6639478",
"0.66062474",
"0.6590142",
"0.6527615",
"0.6511653"... | 0.68808675 | 9 |
add item to beginning of deque | def push_front(self, param):
if self.size == self.capacity:
self.resize(2 * self.size)
for _ in range(self.arr):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_first(self, data):\n self.deque.insert(0, data)",
"def add_front(self, item):\n\n self.items.insert(0, item)",
"def enqueue_front(self, item):\n self._items.insert(0, item)",
"def insertFront(self, item):\n self.sentinel.insertAfter(item)\n self.N += 1",
"def enqu... | [
"0.7701063",
"0.7685327",
"0.7683865",
"0.7565719",
"0.7230589",
"0.720988",
"0.720988",
"0.7207769",
"0.71705633",
"0.7158093",
"0.71211654",
"0.70987415",
"0.7076816",
"0.7029194",
"0.6987425",
"0.69452715",
"0.6875677",
"0.6854924",
"0.6816049",
"0.6794837",
"0.67788875",
... | 0.6286526 | 55 |
Gets the force_pull of this V1CustomBuildStrategy. ForcePull describes if the controller should configure the build pod to always pull the images for the builder or only pull if it is not present locally | def force_pull(self):
return self._force_pull | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def force_pull(self, force_pull):\n\n self._force_pull = force_pull",
"def _determine_image_pull_policy(self) -> ImagePullPolicy:\n if not self.image_pull_policy:\n _, tag = self._get_image_and_tag()\n if tag == \"latest\" or not tag:\n return ImagePullPolicy.AL... | [
"0.7006594",
"0.61882716",
"0.6007951",
"0.5567015",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.552425",
"0.... | 0.7259151 | 0 |
Gets the secrets of this V1CustomBuildStrategy. Secrets is a list of additional secrets that will be included in the build pod | def secrets(self):
return self._secrets | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def secrets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SecretArgs']]]]:\n return pulumi.get(self, \"secrets\")",
"def secrets(self): # pylint: disable=no-self-use\n return []",
"def secrets(self):\n return self._secrets_store",
"def pod_secrets(self) -> Optional[Sequence['out... | [
"0.70832676",
"0.69684964",
"0.6773169",
"0.67016417",
"0.662107",
"0.6442236",
"0.63763225",
"0.63763225",
"0.6275013",
"0.61757606",
"0.6013842",
"0.5927664",
"0.5909263",
"0.5815483",
"0.57218266",
"0.5701877",
"0.56932366",
"0.5661639",
"0.5660847",
"0.5631284",
"0.557468... | 0.7129593 | 0 |
Gets the build_api_version of this V1CustomBuildStrategy. BuildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder | def build_api_version(self):
return self._build_api_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_version(self):\n return self.api_version",
"def getAPIVersion(self):\r\n self._update('getAPIVersion')\r\n return API_VERSION",
"def api_version(self):\n\n return self._api_version",
"def api_version(self):\n\n\t\treturn self._api_version",
"def get_api_version(self):\n ... | [
"0.64504695",
"0.6431397",
"0.6379104",
"0.62855005",
"0.62324035",
"0.6210222",
"0.6132111",
"0.6126697",
"0.6126697",
"0.6126697",
"0.6126697",
"0.6126697",
"0.60074884",
"0.60074884",
"0.60074884",
"0.60074884",
"0.60074884",
"0.60074884",
"0.60074884",
"0.60074884",
"0.60... | 0.74310917 | 0 |
Sets the build_api_version of this V1CustomBuildStrategy. BuildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder | def build_api_version(self, build_api_version):
self._build_api_version = build_api_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_api_version(self):\n return self._build_api_version",
"def builder_version(self, builder_version):\n\n self._builder_version = builder_version",
"def fusion_api_set_default_api_version(self, api=None):\n return self.version.set(api=api)",
"def hxdp_build_version(self, hxdp_... | [
"0.63503325",
"0.5667395",
"0.56616575",
"0.55100876",
"0.51271164",
"0.506362",
"0.50615346",
"0.50322396",
"0.49999204",
"0.496703",
"0.4929081",
"0.49075648",
"0.49068657",
"0.49051067",
"0.4883797",
"0.48580274",
"0.48178354",
"0.48059365",
"0.48026252",
"0.4757807",
"0.4... | 0.78767705 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
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.7961088",
"0.7961088",
"0.79433626",
"0.79303336",
"0.7926563",
"0.7897525",
"0.78826123",
"0.78826123",
"0.78806067",
"0.7872423",
"0.7868354",
"0.78668815",
"0.7825702",
"0.7819993",
"0.78162885",
"0.78078854",
"0.78068... | 0.79670393 | 39 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
returns energy of spin at site i (which is set to S = len3 array) | def spin_energy(self, i, S):
iplus1 = (i + 1) % self.N
iminus1 = (i - 1) % self.N
return - self.J * np.dot(spinlib.get_spin_at_index(self.s0,iplus1)+ \
spinlib.get_spin_at_index(self.s0,iminus1),
S) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Single_spin_energy(sublattice,angles):\n s1 = Spin(angles[0],angles[1])\n s2 = Spin(angles[2],angles[3])\n s3 = Spin(angles[4],angles[5])\n s4 = Spin(angles[6],angles[7])\n s_dict = {0:s1,1:s2,2:s3,3:s4}\n energy = 0\n \n for i in range(0,4):\n energy += C*s_dict[sublattice] @ J_... | [
"0.6101109",
"0.5951018",
"0.5888443",
"0.5834395",
"0.5802993",
"0.5775375",
"0.57557124",
"0.57188636",
"0.5699719",
"0.56758624",
"0.5670992",
"0.5659201",
"0.5654406",
"0.56166524",
"0.56040317",
"0.5589373",
"0.5569809",
"0.55461323",
"0.55054134",
"0.5502522",
"0.547465... | 0.73400074 | 0 |
Appends an edge to the vertex if it does not exist yet. | def add_edge(self, edge: e.Edge) -> None:
if edge not in self.edges:
self.edges.append(edge)
self.num_edges = self.num_edges + 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_edge(self, edge):\n assert edge not in self.edges\n self.edges.append(edge)",
"def add_edge(self, v1, v2):\n if v1 in self.vertices and v2 in self.vertices:\n self.vertices[v1].edges.add(v2)\n self.vertices[v2].edges.add(v1)\n else:\n raise Ind... | [
"0.7604013",
"0.75487155",
"0.7484112",
"0.74597365",
"0.7453258",
"0.7448443",
"0.7413356",
"0.7392337",
"0.737835",
"0.7364973",
"0.73527324",
"0.73176026",
"0.724065",
"0.7232611",
"0.7220248",
"0.7186194",
"0.71579844",
"0.7151704",
"0.7141823",
"0.71259767",
"0.7100011",... | 0.75856924 | 1 |
Inits CHP_Mapper, letting the parent class take care of it. | def __init__(self, url):
super(CHP_Mapper, self).__init__('CHP Incidents', url) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self._map = {}",
"def __init__(self, mapper=None):\n if mapper is None:\n mapper = VFMapperOrderedPVArray()\n self.mapper = mapper",
"def __init__(self, *, base=None):\n self._base = base\n\n self._map = {}",
"def __init__(self, mapElement=N... | [
"0.6665576",
"0.66312385",
"0.66086334",
"0.6604457",
"0.65957046",
"0.6554023",
"0.6551223",
"0.65042365",
"0.6489166",
"0.64539725",
"0.6397595",
"0.6386508",
"0.6290725",
"0.62713313",
"0.6267423",
"0.62620795",
"0.62028897",
"0.6193151",
"0.6169187",
"0.61271596",
"0.6085... | 0.0 | -1 |
checks whether a file is supported (usually based on file extension) | def supports(cls, filename_):
raise BookInfoNotImplementedError('supports', cls.__name__) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isExtensionSupported(filename):\n\treturn os.path.splitext(filename)[-1].split('.')[-1].lower() in ALLOWABLE",
"def file_allowed(self):\n if self._allowed_ext:\n if self.get_ext() not in self._allowed_ext:\n return False\n \n return True",
"def check_file_type(... | [
"0.82368326",
"0.79529864",
"0.7812168",
"0.7802542",
"0.7618935",
"0.75671077",
"0.75449544",
"0.7434008",
"0.7433417",
"0.74324346",
"0.74261576",
"0.7421957",
"0.74171734",
"0.7410488",
"0.7370248",
"0.73522943",
"0.7348116",
"0.73415965",
"0.73415965",
"0.73415965",
"0.73... | 0.0 | -1 |
Authenticates us and returns the api.API. Authenticates users and apps in the self._credentials and returns the | def authenticate(self) -> api.API:
original_api = api.API()
for c in self._credentials: # each app
user_auth = tweepy.OAuthHandler(c.consumer_key, c.consumer_secret)
user_auth.set_access_token(c.access_token, c.access_secret)
app_auth = tweepy.AppAuthHandler(c.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auth(self):\n return self.api(self.token)",
"def authenticate(self):\n auth = tw.OAuthHandler(self.consumer_key, self.consumer_secret)\n auth.set_access_token(self.access_token, self.access_secret)\n return tw.API(auth)",
"def api_authentication():\r\n apikey = request.args.g... | [
"0.74522656",
"0.6943314",
"0.6670792",
"0.66693664",
"0.66318035",
"0.65263337",
"0.649108",
"0.64906216",
"0.64639795",
"0.64376366",
"0.64247215",
"0.64170045",
"0.63672036",
"0.635011",
"0.63299376",
"0.6298993",
"0.6226942",
"0.6226475",
"0.6204906",
"0.62011606",
"0.619... | 0.7257922 | 1 |
Returns the list of the projects on the server | def get_projects(self):
return self.http_call("get", url=f"{self.base_url}/projects").json() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_projects(self):\n res = self.conn.cursor().execute(\"SELECT * FROM projects\")\n return res.fetchall()",
"def get_projects(self):\n projects = []\n page = 1\n while not len(projects) % 100:\n projects += self._get('/projects?{0}'.format(urllib.urlencode({'per... | [
"0.8474279",
"0.8458842",
"0.84545606",
"0.84037936",
"0.82411945",
"0.82348156",
"0.81707937",
"0.8125155",
"0.81145376",
"0.81022495",
"0.8082807",
"0.79827887",
"0.7954017",
"0.79135674",
"0.7856712",
"0.7851414",
"0.7850082",
"0.7825641",
"0.780371",
"0.7790957",
"0.77847... | 0.86749756 | 0 |
Returns the drawing by searching for the `svg` or the `drawing_id`. | def get_drawing(self, drawing_id=None):
if not self.drawings:
self.get_drawings()
try:
return next(
_drawing
for _drawing in self.drawings
if _drawing["drawing_id"] == drawing_id
)
except StopIteration:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_drawing(self, name, index):\n try:\n if name not in self._categories:\n # try and get the closest matching drawing. If nothing suitable foumd then return a scorpion\n name = self._category_mapping.get(name, 'scorpion')\n if index < 0 or index >= 10... | [
"0.60212386",
"0.59713256",
"0.5715111",
"0.55603194",
"0.5494275",
"0.5105928",
"0.5105928",
"0.5070965",
"0.50424117",
"0.5032529",
"0.5021456",
"0.49840453",
"0.49535578",
"0.49262595",
"0.48082048",
"0.48070395",
"0.47645715",
"0.47435388",
"0.4707673",
"0.4657674",
"0.46... | 0.78873676 | 0 |
Takes a list of integers and zero pads it from the left with [0]s. | def left_zero_pad(l: List[int], n: int) -> List[int]:
return [0] * (n - len(l)) + l | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def moveZeroes(self, nums: List[int]) -> None:\n pos =0\n for i in nums:\n if i==0:\n continue\n else:\n nums[pos]=i\n pos+=1\n nums[pos:] = [0] * (len(nums)-pos)",
"def pad_with_zero(list, max_length, pad_type):\n padded_... | [
"0.75776315",
"0.7566504",
"0.75110173",
"0.7431826",
"0.7431059",
"0.73011357",
"0.7245347",
"0.724187",
"0.7241765",
"0.71731764",
"0.71466243",
"0.71301794",
"0.71148884",
"0.71142054",
"0.7096442",
"0.70867056",
"0.708499",
"0.7079688",
"0.70729375",
"0.7069374",
"0.70674... | 0.82894343 | 0 |
load data from json file | def load_data():
dataFile = open('transactions.json', 'r')
data = json.load(dataFile)
transactions = data['transactions']#TID
items = data['items']#item sets
return items, transactions | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_data_from_json(self, filename):\n with open(filename, 'r') as f:\n self.data = json.load(f, object_pairs_hook=OrderedDict)",
"def _load(self):\n if self.file_path.exists():\n with open(self.file_path) as fid:\n self.data = json.load(fid)",
"def load_da... | [
"0.8107666",
"0.7834338",
"0.78210264",
"0.7782435",
"0.77811277",
"0.77406526",
"0.77384186",
"0.7627601",
"0.7612073",
"0.75803113",
"0.7546987",
"0.75011784",
"0.74468184",
"0.7437525",
"0.7374603",
"0.7322796",
"0.732176",
"0.73216665",
"0.73144585",
"0.72868615",
"0.7271... | 0.0 | -1 |
Return the number table rows. | def number_of_rows(self):
if self.number_of_columns():
return self._number_of_rows
else:
return 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getNumRows(self) -> int:\n ...",
"def getNumRows(self):\n return self.__rows",
"def getRowCount(self) -> int:\n ...",
"def num_rows(self) -> str:\n return pulumi.get(self, \"num_rows\")",
"def row_count(self) -> int:\n return len(self.rows)",
"def row_count(self) ->... | [
"0.8687114",
"0.8353838",
"0.8256548",
"0.80447686",
"0.79965144",
"0.79965144",
"0.7925463",
"0.7915425",
"0.786233",
"0.78540987",
"0.78486884",
"0.7832166",
"0.7827024",
"0.7825267",
"0.78224266",
"0.78153557",
"0.7812026",
"0.7796706",
"0.77515095",
"0.76862335",
"0.76851... | 0.80342555 | 4 |
test a graph with zero vertices given | def test_graph_no_vertices(self):
# initialize empty vertex graph
vertices = []
vertex_frame = self.context.frame.create(vertices, self.vertex_schema)
graph = self.context.graph.create(vertex_frame, self.doc_edge_frame)
# call sparktk to calculate deg cen result
res = gr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_random_zero_regular_graph(self):\n seed = 42\n G = random_regular_graph(0, 10, seed)\n assert_equal(len(G), 10)\n assert_equal(sum(1 for _ in G.edges()), 0)",
"def test_no_vertex_in_graph(self):\n self.assertEquals(\n Dijkstras().dijkstras(self.g11, 'a', 'b'... | [
"0.7662234",
"0.7468911",
"0.7205087",
"0.719978",
"0.71543163",
"0.70582736",
"0.696471",
"0.6789812",
"0.67720497",
"0.67526853",
"0.6566185",
"0.6507636",
"0.6502867",
"0.64874274",
"0.6379047",
"0.6284049",
"0.6250289",
"0.6231617",
"0.62192005",
"0.6213751",
"0.62045664"... | 0.76254076 | 1 |
Set the rotation of the point of view. | def setOrientation(self, direction=None, up=None):
if direction is None: # Use current direction
direction = self.direction
else:
assert len(direction) == 3
direction = numpy.array(direction, copy=True, dtype=numpy.float32)
direction /= numpy.linalg.norm(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setRotation(self, angle=0.0):\n axis = (0, 0, 1)\n oldp = self.transform.pos\n newpos = oldp + glm.vec3(0, -40, 0)\n self.transform.setPos(newpos)\n self.transform.setRot(glm.angleAxis(glm.radians(angle),\n glm.vec3(axis)))\n self.transform.setPos(oldp)"... | [
"0.7661325",
"0.7340683",
"0.7338011",
"0.72786695",
"0.71370727",
"0.70414835",
"0.69523287",
"0.6748088",
"0.6656014",
"0.65957755",
"0.6576316",
"0.6533558",
"0.6529668",
"0.65239954",
"0.6485575",
"0.64770585",
"0.6473336",
"0.6473102",
"0.64004517",
"0.6390107",
"0.63888... | 0.0 | -1 |
Coordinates of the point of view as a numpy.ndarray of 3 float32. | def position(self):
return self._position.copy() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def points(self):\n return self._arr.T.ravel().view(\n dtype=[('x', self.dtype), ('y', self.dtype), ('z', self.dtype)])",
"def coordinates(self):\n return np.array([self.x, self.y])",
"def xyz(self) -> np.ndarray:\n return np.vstack((self.x, self.y, self.z)).transpose()",
"... | [
"0.7448454",
"0.7183838",
"0.7129984",
"0.7114555",
"0.7022504",
"0.69364476",
"0.68954456",
"0.68572676",
"0.6819143",
"0.68147635",
"0.6808464",
"0.6799408",
"0.6792076",
"0.67887616",
"0.67609465",
"0.67609465",
"0.67558694",
"0.67328596",
"0.6668634",
"0.6649002",
"0.6564... | 0.0 | -1 |
Vector pointing upward in the image plane (ndarray of 3 float32). | def up(self):
return self._up.copy() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def up(self, x, y, z):\n self.curr_up = Vector([x, y, z])\n self.ptr.up(x, y, z)",
"def rotateZUp(self):\n MV = self.MV\n MV[:3, 1] = 0, 0, 1 # 2nd col is up vector, make it point along z axis\n # set bottom left and bottom right z values to zero:\n MV[2, 0] = 0\n ... | [
"0.686878",
"0.6711407",
"0.6711407",
"0.6404477",
"0.63681275",
"0.6295873",
"0.62082344",
"0.61488545",
"0.6147175",
"0.60988593",
"0.60740435",
"0.6047639",
"0.60165375",
"0.6008867",
"0.59943247",
"0.59048146",
"0.5901409",
"0.5897249",
"0.5878537",
"0.5875203",
"0.583904... | 0.0 | -1 |
Vector pointing towards the side of the image plane. ndarray of 3 float32 | def side(self):
return self._side.copy() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uv(vec):\n return vec / sqrt(dot(vec, vec))",
"def plane_point_side_v3(p: np.ndarray, v: np.ndarray) -> Any:\n return p[:3].dot(v) + p[3]",
"def vector(self) -> Vector:\n return self._normal * self._distance_from_origin",
"def __pos__(self):\r\n return vec4(+self.x, +self.y, +self... | [
"0.6715703",
"0.6617088",
"0.64729697",
"0.6462744",
"0.637154",
"0.622446",
"0.6204779",
"0.6190666",
"0.6138991",
"0.6136419",
"0.61094856",
"0.6102307",
"0.6086981",
"0.6076096",
"0.60495996",
"0.60133463",
"0.60122263",
"0.60081464",
"0.6006431",
"0.6003507",
"0.5993029",... | 0.0 | -1 |
Move the camera relative to the image plane. | def move(self, direction, step=1.):
if direction in ('up', 'down'):
vector = self.up * (1. if direction == 'up' else -1.)
elif direction in ('left', 'right'):
vector = self.side * (1. if direction == 'right' else -1.)
elif direction in ('forward', 'backward'):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _moveCamera(self, displacement):\n if type(displacement) is not Vec2:\n displacement = Vec2(displacement)\n\n self.camCenter += displacement",
"def move(self):\n self.center_x += self._vx\n self.center_y += self._vy",
"def move(self):\r\n min_x = self.__screen.... | [
"0.7552061",
"0.71024525",
"0.6847155",
"0.6782502",
"0.65680116",
"0.6543754",
"0.6523516",
"0.6517082",
"0.65036064",
"0.649976",
"0.64792097",
"0.64664745",
"0.64553064",
"0.6425988",
"0.64002854",
"0.6391806",
"0.63523936",
"0.6348557",
"0.6323312",
"0.6317281",
"0.631268... | 0.0 | -1 |
Intrinsic camera parameters, i.e., projection matrix. | def intrinsic(self):
return self._intrinsic | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_camera(self) -> None:\n self.world.camera.update(\n cam_base_pos=(0, -3, 0),\n cam_dist=1.2*self.world.env_dim,\n cam_yaw=0,\n cam_pitch=-60\n )",
"def getCameraMatrix(self): # real signature unknown; restored from __doc__\n pass",
"def... | [
"0.6608927",
"0.6415826",
"0.6352593",
"0.63487923",
"0.6285882",
"0.62111944",
"0.6143827",
"0.6135035",
"0.61305976",
"0.6057601",
"0.60454494",
"0.6035909",
"0.60180455",
"0.59766716",
"0.5972908",
"0.59583145",
"0.5938437",
"0.5934274",
"0.5934128",
"0.5894838",
"0.588596... | 0.0 | -1 |
Extrinsic camera parameters, i.e., position and orientation. | def extrinsic(self):
return self._extrinsic | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exteriorOrientationParameters(self):\n return self.__exteriorOrientationParameters",
"def get_camera_metadata(self):\n return self.camera.getHeight(), self.camera.getWidth(), 4 # channels",
"def build_camera_info(attributes):\n camera_info = CameraInfo()\n # store info without header\n... | [
"0.6276097",
"0.6250388",
"0.60907876",
"0.6072059",
"0.60546774",
"0.6052766",
"0.59104353",
"0.5843786",
"0.58264494",
"0.57727367",
"0.5733514",
"0.57252014",
"0.5713712",
"0.5703949",
"0.56366533",
"0.56118876",
"0.5606309",
"0.5593476",
"0.5582585",
"0.55586857",
"0.5553... | 0.54801553 | 26 |
this function is trying to reverse the last n characters from vals | def reverse_last(vals, n):
if len(vals)<=n:
return vals[::-1]
else:
old=vals[0:len(vals)-n]
new=vals[-1:len(vals)-n-1:-1]
return old+new | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse_slice(n):\n return n[::-1]",
"def reversed_of_string(n):\n return ''.join(reversed(n))",
"def rev(n):\n return int(''.join(reversed(str(n))))",
"def evens_reversed(N):\n\n if N == 0 or N == 1: #nothing returned\n return ''\n\n output = ''\n num_pads = len(str(N)) #num of ... | [
"0.6828785",
"0.68280214",
"0.6512577",
"0.64922583",
"0.6467967",
"0.64595705",
"0.6435747",
"0.63816744",
"0.6349212",
"0.6285224",
"0.62807274",
"0.62592214",
"0.6258128",
"0.62575",
"0.6205536",
"0.619954",
"0.61921704",
"0.61921227",
"0.61821634",
"0.61806667",
"0.617063... | 0.77552915 | 0 |
Get a user by ID | def get_user_by_id(user_id: IntOrStr, **params) -> JsonResponse:
response = get(f'{API_V1}/users', ids=user_id, allow_str_ids=True, **params)
results = response.json()['results']
if not results:
return {}
return convert_generic_timestamps(results[0]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_by_id(self, id):\n\t\treturn self.users.get(id)",
"def get_user(id):\n pass",
"def get(id):\n return User.query.filter_by(id=id).first()",
"def getUser(self, id : int) -> bbUser.bbUser:\n id = self.validateID(id)\n return self.users[id]",
"def get_single_user(self, id):... | [
"0.8792969",
"0.87872624",
"0.86924756",
"0.853347",
"0.8445263",
"0.8433324",
"0.8417379",
"0.83611023",
"0.8316352",
"0.8262265",
"0.8258542",
"0.8255396",
"0.82451",
"0.8196948",
"0.819005",
"0.819005",
"0.819005",
"0.819005",
"0.8189882",
"0.8184195",
"0.81832767",
"0.8... | 0.0 | -1 |
Gets the platform_type of this ShowInstanceDetailResponse. | def platform_type(self):
return self._platform_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_platform(self):\n return self._platform",
"def platform(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"platform\")",
"def get_platform_type(device):\n\n try:\n out = device.parse('show version')\n except SubCommandFailure:\n log.info('Could not get device ver... | [
"0.6500356",
"0.6413572",
"0.6357047",
"0.631787",
"0.62189364",
"0.6166719",
"0.6138307",
"0.61155635",
"0.60626024",
"0.6050106",
"0.60287845",
"0.6019198",
"0.6004431",
"0.6004431",
"0.6004431",
"0.6004431",
"0.6004431",
"0.6004431",
"0.6004431",
"0.6004431",
"0.6004431",
... | 0.76110876 | 0 |
Sets the platform_type of this ShowInstanceDetailResponse. | def platform_type(self, platform_type):
self._platform_type = platform_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def platform_type(self):\n return self._platform_type",
"def platform(self, platform):\n # type: (string_types) -> None\n\n if platform is not None:\n if not isinstance(platform, string_types):\n raise TypeError(\"Invalid type for `platform`, type has to be `string_... | [
"0.60361105",
"0.6002751",
"0.55748445",
"0.5369716",
"0.52994025",
"0.5250543",
"0.5250543",
"0.52197665",
"0.51590115",
"0.5154099",
"0.5109442",
"0.50189734",
"0.50189734",
"0.50189734",
"0.50189734",
"0.50132906",
"0.5001434",
"0.49967003",
"0.4991788",
"0.49679396",
"0.4... | 0.7584566 | 0 |
Gets the status_detail of this ShowInstanceDetailResponse. | def status_detail(self):
return self._status_detail | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detail(self):\n return self.status[\"health\"][\"detail\"]",
"def detailed_status(self) -> str:\n return pulumi.get(self, \"detailed_status\")",
"def detailed_status(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"detailed_status\")",
"def detailed_status(self) -> pulumi.Out... | [
"0.69682634",
"0.66956407",
"0.66443765",
"0.66443765",
"0.64564216",
"0.6339017",
"0.6339017",
"0.63274443",
"0.62666446",
"0.6244358",
"0.62004507",
"0.6188391",
"0.61865604",
"0.613004",
"0.6129157",
"0.61100185",
"0.61100185",
"0.61100185",
"0.60743433",
"0.60691595",
"0.... | 0.7964249 | 0 |
Sets the status_detail of this ShowInstanceDetailResponse. | def status_detail(self, status_detail):
self._status_detail = status_detail | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status_detail(self, status_detail):\n\n self._status_detail = status_detail",
"def detailed_status(self, detailed_status):\n\n self._detailed_status = detailed_status",
"def setStatus(self, status, details=None):\n self.onStatusSent(None, status)",
"def status(self, status):\n ... | [
"0.811624",
"0.7056993",
"0.6349227",
"0.61626244",
"0.61106753",
"0.61106753",
"0.61106753",
"0.6030321",
"0.6030321",
"0.602323",
"0.6022512",
"0.6022512",
"0.6022512",
"0.6022512",
"0.6022512",
"0.6022512",
"0.6022512",
"0.6022512",
"0.6022512",
"0.6022512",
"0.6022512",
... | 0.8050524 | 1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, ShowInstanceDetailResponse):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Provide helpful representation when printed. | def __repr__(self):
return "<User user_id=%s email=%s>" % (self.user_id, self.email) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n return self.pretty_print(self.__dict__)",
"def nice_output(self):\n return self.des",
"def nice_output(self):\n return self.des",
"def __str__(self):\n return self.printable()",
"def _printable(self):\n toPrint = \"Qubit ID: \" + str(self.qubit_id) +... | [
"0.7529561",
"0.7511525",
"0.7511525",
"0.74975544",
"0.7394847",
"0.72965956",
"0.7293301",
"0.7226869",
"0.7225389",
"0.7205555",
"0.71771973",
"0.71743053",
"0.7146052",
"0.7134735",
"0.71325094",
"0.71289283",
"0.7126178",
"0.71148866",
"0.7109676",
"0.7082562",
"0.707800... | 0.0 | -1 |
Provide helpful representation when printed. | def __repr__(self):
return "<Studio studio_id=%s name=%s>" % (self.studio_id, self.name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n return self.pretty_print(self.__dict__)",
"def nice_output(self):\n return self.des",
"def nice_output(self):\n return self.des",
"def __str__(self):\n return self.printable()",
"def _printable(self):\n toPrint = \"Qubit ID: \" + str(self.qubit_id) +... | [
"0.7529561",
"0.7511525",
"0.7511525",
"0.74975544",
"0.7394847",
"0.72965956",
"0.7293301",
"0.7226869",
"0.7225389",
"0.7205555",
"0.71771973",
"0.71743053",
"0.7146052",
"0.7134735",
"0.71325094",
"0.71289283",
"0.7126178",
"0.71148866",
"0.7109676",
"0.7082562",
"0.707800... | 0.0 | -1 |
Provide helpful representation when printed. | def __repr__(self):
return "<Review review_id=%s user_id=%s studio_id=%s>" % (self.review_id, self.user_id, self.studio_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n return self.pretty_print(self.__dict__)",
"def nice_output(self):\n return self.des",
"def nice_output(self):\n return self.des",
"def __str__(self):\n return self.printable()",
"def _printable(self):\n toPrint = \"Qubit ID: \" + str(self.qubit_id) +... | [
"0.7529561",
"0.7511525",
"0.7511525",
"0.74975544",
"0.7394847",
"0.72965956",
"0.7293301",
"0.7226869",
"0.7225389",
"0.7205555",
"0.71771973",
"0.71743053",
"0.7146052",
"0.7134735",
"0.71325094",
"0.71289283",
"0.7126178",
"0.71148866",
"0.7109676",
"0.7082562",
"0.707800... | 0.0 | -1 |
Provide helpful representation when printed. | def __repr__(self):
return "<Instructor instructor_id=%s name=%s>" % (self.instructor_id, self.name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n return self.pretty_print(self.__dict__)",
"def nice_output(self):\n return self.des",
"def nice_output(self):\n return self.des",
"def __str__(self):\n return self.printable()",
"def _printable(self):\n toPrint = \"Qubit ID: \" + str(self.qubit_id) +... | [
"0.7529561",
"0.7511525",
"0.7511525",
"0.74975544",
"0.7394847",
"0.72965956",
"0.7293301",
"0.7226869",
"0.7225389",
"0.7205555",
"0.71771973",
"0.71743053",
"0.7146052",
"0.7134735",
"0.71325094",
"0.71289283",
"0.7126178",
"0.71148866",
"0.7109676",
"0.7082562",
"0.707800... | 0.0 | -1 |
I think these are the equations for the x independent stresses from the base profile. | def x_independent_profile(PSI):
Cyy = zeros(vecLen, dtype='complex')
Cyy[N*M] += 1.0
Cxy = zeros(vecLen, dtype='complex')
Cxy = Wi*dot(MDYY, PSI)
Cxx = zeros(vecLen, dtype='complex')
Cxx = 2*Wi*Wi*Cxy*Cxy
Cxx[N*M] += 1.0
return (Cxx, Cxy, Cyy) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def x(self):\n values = self._interpolate_table(\"x\")\n values += self._corrections((\"ortho_eop\", iers.ortho_eop, 0, 1e-6), (\"pmsdnut2\", iers.pmsdnut2, 0, 1e-6))\n return values",
"def zsx_0(self):\n return self.glb[iz0]/self.glb[ix0]",
"def zsx_s(self):\n\n return self.... | [
"0.622491",
"0.6161177",
"0.61303806",
"0.6074397",
"0.60576624",
"0.6016752",
"0.5977206",
"0.5931189",
"0.57652247",
"0.57440555",
"0.5720678",
"0.5685158",
"0.5685158",
"0.5679539",
"0.5673104",
"0.5639944",
"0.5633417",
"0.5627377",
"0.56228966",
"0.56037736",
"0.55917674... | 0.0 | -1 |
Sets the learning rate to the initial LR decayed by 10 every 30 epochs | def adjust_learning_rate(optimizer, epoch, args):
"""Comes from pytorch demo"""
lr = args.lr * (0.1 ** (epoch // 30))
for param_group in optimizer.param_groups:
param_group['lr'] = lr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr",
"def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l... | [
"0.7913536",
"0.7906521",
"0.7849834",
"0.777524",
"0.77338326",
"0.77306354",
"0.7722718",
"0.77224237",
"0.771982",
"0.77092624",
"0.7693604",
"0.76742035",
"0.7665748",
"0.7665748",
"0.7665748",
"0.7655329",
"0.76419765",
"0.76399755",
"0.7637868",
"0.7626077",
"0.76247585... | 0.7598349 | 26 |
Creates a new superuser | def create_superuser(self, email, name, password):
user = self.create_user(email, name, password)
# Make this user an admin.
user.is_superuser = True
user.is_staff = True
user.save(using=self._db)
return user | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createsuperuser():\n\n email = prompt('User E-Mail')\n email_confirm = prompt('Confirm E-Mail')\n\n if not email == email_confirm:\n sys.exit('\\nCould not create user: E-Mail did not match')\n\n if not EMAIL_REGEX.match(email):\n sys.exit('\\nCould not create user: Invalid E-Mail add... | [
"0.80412585",
"0.7921864",
"0.7915325",
"0.77885205",
"0.77613276",
"0.77593327",
"0.7739667",
"0.7705691",
"0.7691871",
"0.76866704",
"0.76856697",
"0.7680962",
"0.7672732",
"0.766203",
"0.76611584",
"0.7630425",
"0.7623007",
"0.7620972",
"0.7617647",
"0.7606459",
"0.7603212... | 0.77949375 | 3 |
Gets user full name | def get_full_name(self):
return self.name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_full_name(self):\n full_name = '%s %s' % (self.user.first_name.strip(), self.user.last_name.strip())\n if len(full_name.strip()) == 0:\n full_name = self.user.username\n return full_name.strip()",
"def get_full_name(self):\n return self.username",
"def get_full_na... | [
"0.87490374",
"0.8723116",
"0.8723116",
"0.87211084",
"0.8659905",
"0.8628989",
"0.86097383",
"0.8550003",
"0.850894",
"0.848014",
"0.82230866",
"0.8215219",
"0.81873226",
"0.81509435",
"0.813707",
"0.81305563",
"0.8096639",
"0.8095032",
"0.8094177",
"0.80926865",
"0.8076496"... | 0.7584439 | 94 |
Get name of VMware Storage Policy profile associated with the specified entities | def check_storage_profile_associated(profile_manager, ref, name):
profile_ids = profile_manager.PbmQueryAssociatedProfile(ref)
if len(profile_ids) > 0:
profiles = profile_manager.PbmRetrieveContent(profileIds=profile_ids)
for profile in profiles:
if profile.name == name:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_profile_names():\n import botocore.session\n return botocore.session.get_session().full_config.get('profiles', {}).keys()",
"def get_policyname(self):\n return self.options[\"policyname\"]",
"def get_policyname(self):\n return self.options['policyname']",
"def policy_name(self) ->... | [
"0.5752688",
"0.5666046",
"0.56285954",
"0.5536714",
"0.5536714",
"0.55023414",
"0.54529655",
"0.5378374",
"0.53680223",
"0.53575444",
"0.5342156",
"0.53416854",
"0.53203946",
"0.53201973",
"0.5316135",
"0.52728826",
"0.52728826",
"0.52728826",
"0.52728826",
"0.52728826",
"0.... | 0.0 | -1 |
Return configuration form for apps. | def _async_apps_form(self, app_id: str) -> FlowResult:
app_schema = {
vol.Optional(
CONF_APP_NAME,
description={"suggested_value": self._apps.get(app_id, "")},
): str,
}
if app_id == APPS_NEW_ID:
data_schema = vol.Schema({**app_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_app_form():\n\t\n\treturn render_template(\"application-form.html\")",
"def app_form():\n\n return render_template(\"application-form.html\")",
"def application_form():\n\n\treturn render_template(\"application-form.html\")",
"def application():\n\n return render_template(\"application-form.htm... | [
"0.74206626",
"0.6864017",
"0.6551376",
"0.6439755",
"0.6328698",
"0.6247581",
"0.612097",
"0.6112767",
"0.60953647",
"0.6049512",
"0.60375196",
"0.59740597",
"0.5951114",
"0.5906394",
"0.58915955",
"0.5882851",
"0.5864854",
"0.5863126",
"0.58575326",
"0.5796898",
"0.57661843... | 0.66284955 | 2 |
This function generates a 2D scatter plot given the inputs and their corresponding labels. Inputs with different classes are represented with different colours. | def visualize_2d_data(X, y):
assert len(X.shape) == len(y.shape) == 2, f"Input/output pairs must be 2D-arrays. X: {X.shape}, y: {y.shape}"
(N, D) = X.shape
assert N == y.shape[0], f"Number of samples must match for input/output pairs. X: {N}, y: {y.shape[0]}"
assert D == 2, f"Expected 2 features. Got: {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scatter_plot(x_train, y_train, x_test, y_test, class1, class2):\n train_c0 = x_train[y_train == 0, :]\n train_c1 = x_train[y_train == 1, :]\n test_c0 = x_test[y_test == 0, :]\n test_c1 = x_test[y_test == 1, :]\n fig, a = plt.subplots(1, 2)\n fig.set_size_inches(11, 5)\n a[0].scatter(train_... | [
"0.7380091",
"0.72378266",
"0.7031409",
"0.6989784",
"0.696256",
"0.6941738",
"0.69289213",
"0.68483156",
"0.6812628",
"0.680862",
"0.6766454",
"0.67389846",
"0.67186767",
"0.67063254",
"0.66660726",
"0.66634953",
"0.66431606",
"0.65923584",
"0.65541166",
"0.653203",
"0.65277... | 0.5982095 | 77 |
Splits a sentence. Returns an array of words. | def split_sentence(sentence):
words = [] # An array of words and punctuation.
number_of_words = 0
length = len(sentence)
start_index = 0
while (start_index < length):
ch = ' '
# Skip spaces, etc.
while (start_index < length):
ch = sentence[start_index]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def word_split(self, sentence):\n return re.split(self.word_split_pattern, sentence)",
"def split_into_words(sentences):\n return list(sentences.split(\" \"))",
"def split_sentence(sentence):\n sentences = []\n split = nltk.sent_tokenize(sentence)\n for s in split:\n sentences.append(... | [
"0.8394406",
"0.7914362",
"0.77626485",
"0.7696968",
"0.7639039",
"0.7639039",
"0.7607761",
"0.7486167",
"0.74568903",
"0.73574156",
"0.7305894",
"0.7191113",
"0.7157531",
"0.71538323",
"0.70700896",
"0.69762975",
"0.6963618",
"0.69454724",
"0.6908545",
"0.6825234",
"0.679260... | 0.73161775 | 10 |
Set a creator/P170 claim for an unknown creator. Allows for simple anonymous claims as well as more complex "in the manner of" etc. | def set_anonymous_creator(self, target_item, related_info, reference):
anonymous_q = 'Q4233718'
anon_statement = WD.Statement(self.wd.QtoItemPage(anonymous_q))
# set any related qualifiers
if related_info:
anon_statement.addQualifier(
WD.Qualifier(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_known_creator(self, target_item, creator_Q, reference):\n creator_item = self.wd.QtoItemPage(creator_Q)\n self.wd.addNewClaim(\n u'P170',\n WD.Statement(creator_item),\n target_item,\n reference)",
"def creator(self, creator):\n self._creat... | [
"0.72238004",
"0.6037545",
"0.5994627",
"0.59047586",
"0.59047586",
"0.59047586",
"0.5731607",
"0.56893694",
"0.527351",
"0.52653724",
"0.5229727",
"0.5189891",
"0.51533353",
"0.51364464",
"0.5135632",
"0.50766855",
"0.50457627",
"0.50236815",
"0.50152403",
"0.5010809",
"0.50... | 0.70400375 | 1 |
Set a creator/P170 claim for a known creator. | def set_known_creator(self, target_item, creator_Q, reference):
creator_item = self.wd.QtoItemPage(creator_Q)
self.wd.addNewClaim(
u'P170',
WD.Statement(creator_item),
target_item,
reference) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_anonymous_creator(self, target_item, related_info, reference):\n anonymous_q = 'Q4233718'\n anon_statement = WD.Statement(self.wd.QtoItemPage(anonymous_q))\n\n # set any related qualifiers\n if related_info:\n anon_statement.addQualifier(\n WD.Qualifier... | [
"0.66407",
"0.6478759",
"0.6437175",
"0.6437175",
"0.6437175",
"0.60733074",
"0.60618424",
"0.5639715",
"0.55911636",
"0.55337334",
"0.54880476",
"0.54795575",
"0.54784775",
"0.52961445",
"0.5265465",
"0.5250215",
"0.5235939",
"0.5224072",
"0.52082115",
"0.5203073",
"0.519699... | 0.76741564 | 0 |
Test that comparing a Commit to a number gives an error. | def test_lt_invalid(self):
with self.assertRaises(TypeError):
self.instance < 12 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_lt_false(self):\n self.assertFalse(self.instance < Commit('f3ccd0b70fe758b539c28319735d9a6489c0fb10'))",
"def test_lt_true(self):\n self.assertTrue(self.instance < Commit('ede9c381daf318a87a58ed9607549132e150f145'))",
"def test_commit(self):\n # TODO: Test errors while committing ... | [
"0.681696",
"0.6595572",
"0.64651245",
"0.6441211",
"0.61963636",
"0.6121472",
"0.6117242",
"0.60690445",
"0.6068011",
"0.6062101",
"0.6038362",
"0.600986",
"0.600986",
"0.59954476",
"0.5982048",
"0.5977618",
"0.5963366",
"0.5954761",
"0.59328043",
"0.59328043",
"0.59328043",... | 0.5552208 | 88 |
Test if a newer commit is not less then the instance. | def test_lt_false(self):
self.assertFalse(self.instance < Commit('f3ccd0b70fe758b539c28319735d9a6489c0fb10')) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_lt_true(self):\n self.assertTrue(self.instance < Commit('ede9c381daf318a87a58ed9607549132e150f145'))",
"def older(a, b):\n\treturn not newer(a, b)",
"def use_newer(self) -> bool:\n return self._action == 'newer'",
"def older(self, timestamp):\r\n return self._added < timestamp",... | [
"0.7746152",
"0.6399233",
"0.6245954",
"0.62316406",
"0.6211757",
"0.61369765",
"0.60966974",
"0.6093489",
"0.60454345",
"0.5971237",
"0.5944412",
"0.59143794",
"0.59143364",
"0.5904176",
"0.59009707",
"0.5880737",
"0.5877041",
"0.58610046",
"0.58382565",
"0.58244985",
"0.582... | 0.7683077 | 1 |
Reinitializes the weights of a given layer | def reinitialize_weights(self, scope_name):
variables = tf.contrib.framework.get_variables(scope_name)
init = tf.variables_initializer(variables)
self.sess.run(init) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_weights(self):\n tf.nest.map_structure(\n weights_initializer.WeightsInitializer.initialize_layer_or_model,\n self._layer_nest)",
"def init_weights(layer):\r\n layer_name = layer.__class__.__name__\r\n if layer_name.find(\"Conv\") != -1:\r\n layer.weight.data.normal_(... | [
"0.77201146",
"0.7707208",
"0.76968217",
"0.7642865",
"0.75886583",
"0.7513413",
"0.75046635",
"0.745799",
"0.7447679",
"0.7416753",
"0.7395073",
"0.7389386",
"0.73675716",
"0.7324961",
"0.72788745",
"0.7222396",
"0.7214152",
"0.71888995",
"0.7171713",
"0.7171713",
"0.7151385... | 0.74599314 | 7 |
Compute the magnitude of the field. | def mag(field):
return np.sqrt(np.sum(field**2, axis=0, keepdims=True)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def magnitude(self):\n return self.real ** 2 + numpy.inner(self.pure, self.pure)",
"def magnitude(self):\n\t\treturn sqrt(self.dot(self))",
"def magnitude(self): # @todo @caution check: something wrong?\n\n return (math.sqrt(reduce(lambda x, y: x+y,\n [x**2 for x in self.vector])))... | [
"0.78958493",
"0.7819724",
"0.7622221",
"0.75933385",
"0.7461859",
"0.7372662",
"0.7372662",
"0.72682",
"0.7231113",
"0.69953483",
"0.69894916",
"0.6952739",
"0.6906011",
"0.6835235",
"0.683414",
"0.681529",
"0.67609596",
"0.675806",
"0.6703489",
"0.66821706",
"0.66479754",
... | 0.7085307 | 9 |
Compute the root mean square of the field. | def rms(field):
return np.nanstd(field, axis=3, keepdims=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def root_mean_square_value( values ):\n return ma.sqrt(mean_square_value( values ))",
"def root_mean_square(xs):\n squares = xs ** 2\n sum_squares = np.sum(squares)\n\n rms = math.sqrt((len(xs) ** -1) * sum_squares)\n return rms",
"def average(self):\n s = self.sum()\n flat_shape =... | [
"0.7453015",
"0.71897036",
"0.6911831",
"0.67985654",
"0.67705065",
"0.6763532",
"0.67584527",
"0.6751884",
"0.67343915",
"0.6729531",
"0.6726054",
"0.66899604",
"0.6663132",
"0.66606396",
"0.6656032",
"0.6645968",
"0.6638511",
"0.6627513",
"0.6624689",
"0.66156745",
"0.65579... | 0.0 | -1 |
Compute the derivative of a field with respect to the xaxis. | def ddx(field, method=None):
if method == None or method == 'central':
new_field = field-field
# Apply central differencing in the 'core' region
new_field[:,1:-1] = (field[:,2:]-field[:,:-2])/field.dL/2
# Apply second order forward/backward differences at boundaries
new_fie... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derivativeX(self, x, y):\n xShift = self.lowerBound(y)\n dfdx_out = self.func.derivativeX(x - xShift, y)\n return dfdx_out",
"def calculate_derivative_value(self, x: np.array) -> np.array:\n pass",
"def derivativeX(self, x, y, z):\n xShift = self.lowerBound(y)\n df... | [
"0.7440254",
"0.7186431",
"0.70762146",
"0.6829919",
"0.6734729",
"0.6697652",
"0.66931677",
"0.6608272",
"0.6588263",
"0.6551362",
"0.6543324",
"0.6526889",
"0.6526889",
"0.6494436",
"0.64695245",
"0.64334613",
"0.64151376",
"0.6397129",
"0.63773316",
"0.6286732",
"0.6278945... | 0.66892534 | 7 |
Compute the derivative of a field with respect to the yaxis. | def ddy(field, method=None):
if method == None or method == 'central':
new_field = field-field
# Apply central differencing in the 'core' region
new_field[:,:,1:-1] = (field[:,:,2:]-field[:,:,:-2])/field.dL/2
# Apply second order forward/backward differences at boundaries
n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derivative_given_y(self, y):\n raise NotImplementedError()",
"def derivative_given_y(self, y):\n\n return np.dot(y, np.subtract(1.0, y))",
"def derivativeY(self, x, y):\n xShift, xShiftDer = self.lowerBound.eval_with_derivative(y)\n dfdy_out = self.func.derivativeY(\n ... | [
"0.75702286",
"0.7449167",
"0.7412104",
"0.72393024",
"0.70576465",
"0.69516337",
"0.66649383",
"0.66210926",
"0.6604702",
"0.6522235",
"0.6513144",
"0.6475875",
"0.64484954",
"0.63530046",
"0.6338029",
"0.63284683",
"0.62845695",
"0.6258141",
"0.6244466",
"0.62111884",
"0.61... | 0.6450686 | 12 |
Sets the learning rate to the initial LR decayed by 10 every 30 epochs | def adjust_learning_rate(optimizer, epoch):
lr = 0.001 * (0.1 ** (epoch // 30))
for param_group in optimizer.param_groups:
param_group['lr'] = lr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr",
"def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l... | [
"0.7913536",
"0.7906521",
"0.7849834",
"0.777524",
"0.77338326",
"0.77306354",
"0.7722718",
"0.77224237",
"0.771982",
"0.77092624",
"0.7693604",
"0.76742035",
"0.7665748",
"0.7665748",
"0.7665748",
"0.7655329",
"0.76419765",
"0.76399755",
"0.7637868",
"0.7626077",
"0.76247585... | 0.7621199 | 21 |
Returns the tpx labels for absolute values | def get_tpx_labels_abs():
#labels_abs = ["tpx_all_abs", "tpx_date_abs", "tpx_time_abs", "tpx_duration_abs", "tpx_set_abs", "tpx_date_none_abs", "tpx_date_year_abs",
#"tpx_date_year_month_abs", "tpx_date_month_abs", "tpx_date_day_abs", "tpx_date_month_day_abs", "tpx_date_any_abs", "tpx_date_full_abs",
#"tpx_date_pas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tpx_labels():\n\t\n\tlabels_abs = get_tpx_labels_abs()\n\tlabels_rel = get_tpx_labels_rel()\n\tlabels_prop = get_tpx_labels_prop()\n\tlabels_special = get_tpx_labels_special()\n\tlabels = copy.copy(labels_abs) + copy.copy(labels_rel) + copy.copy(labels_prop) + copy.copy(labels_special)\n\t\n\treturn labels... | [
"0.6896252",
"0.6457872",
"0.62574464",
"0.61195236",
"0.6105629",
"0.6054358",
"0.60341495",
"0.5841535",
"0.58326703",
"0.58229655",
"0.5795569",
"0.5795569",
"0.5795569",
"0.5786497",
"0.5778579",
"0.57605565",
"0.5759446",
"0.5754277",
"0.5753458",
"0.5681255",
"0.5652885... | 0.7896187 | 0 |
Returns the tpx labels for proportional values | def get_tpx_labels_prop():
#labels_prop = ["tpx_date_prop", "tpx_time_prop", "tpx_duration_prop", "tpx_set_prop", "tpx_date_none_prop", "tpx_date_year_prop",
#"tpx_date_year_month_prop", "tpx_date_month_prop", "tpx_date_day_prop", "tpx_date_month_day_prop", "tpx_date_any_prop", "tpx_date_full_prop",
#"tpx_date_past... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tpx_labels():\n\t\n\tlabels_abs = get_tpx_labels_abs()\n\tlabels_rel = get_tpx_labels_rel()\n\tlabels_prop = get_tpx_labels_prop()\n\tlabels_special = get_tpx_labels_special()\n\tlabels = copy.copy(labels_abs) + copy.copy(labels_rel) + copy.copy(labels_prop) + copy.copy(labels_special)\n\t\n\treturn labels... | [
"0.7370604",
"0.65740013",
"0.64317197",
"0.62459105",
"0.62047666",
"0.6136239",
"0.61158967",
"0.6086172",
"0.60789293",
"0.60454637",
"0.5983116",
"0.5980754",
"0.5890958",
"0.58616483",
"0.58392286",
"0.5824896",
"0.5799895",
"0.57981044",
"0.57965815",
"0.5789279",
"0.57... | 0.769221 | 0 |
Converts integer value into enumeration. | def from_int(cls, value: int) -> 'Enum':
if value not in cls.tags():
raise ValueError(f'the following integer value is not defined within the enumeration: {str(value)}')
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_python(self, value):\n if isinstance(value, self.enum_class):\n return value\n value = super(self.__class__, self).to_python(value)\n if isinstance(value, int):\n return self.enum_class(value)\n assert value is None\n return None",
"def convertToEnu... | [
"0.68614554",
"0.6452594",
"0.6413445",
"0.6408221",
"0.6299187",
"0.62552184",
"0.61738443",
"0.6136661",
"0.6100885",
"0.60601926",
"0.6043841",
"0.60104376",
"0.59844506",
"0.5963049",
"0.5962964",
"0.59103715",
"0.59103715",
"0.5860371",
"0.58132535",
"0.57985497",
"0.579... | 0.79843813 | 0 |
Wrapper for dot product operation, in order to be compatible with both Theano and Tensorflow | def dot_product(x, kernel):
if K.backend() == 'tensorflow':
return K.squeeze(K.dot(x, K.expand_dims(kernel)), axis=-1)
else:
return K.dot(x, kernel) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dot_prod(t1: torch.Tensor, t2: torch.Tensor, verbose: bool = False):\n assert t1.size() == t2.size(), \"Sizes for dot-product must match\"\n return mo.dot_prod(t1, t2, verbose)",
"def _dot(a, b):\n return np.einsum('ijk,ikl->ijl', a, b)",
"def dot(a, b):\r\n a, b = as_tensor_variable(a), as_ten... | [
"0.7651703",
"0.7612058",
"0.75893337",
"0.7534747",
"0.75176203",
"0.7497563",
"0.7466278",
"0.74372244",
"0.7428822",
"0.7417398",
"0.7380012",
"0.7374917",
"0.73432904",
"0.7331172",
"0.7310363",
"0.73097545",
"0.7274956",
"0.7270772",
"0.72633255",
"0.72409874",
"0.720415... | 0.7489667 | 9 |
Set's the plague's name. Leave blank to show the current name. | async def name(self, ctx, *, name: str = None):
plagueName = await self.config.plagueName()
if not name:
message = f"The current plague's name is `{plagueName}`."
else:
await self.config.plagueName.set(name)
message = f"Set the current plague's name to `{name}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, newname=\"\"):\n self.name = newname",
"def new_name(self,new_name):\n self.name = new_name",
"def __set_name(self, name):\r\n\t\tself.__name = name\r\n\t\tself._window.chat_panel.place_name = name\r\n\t\tself.encode_message(action=\"NO\", selected_name=name)",
"def set_name(... | [
"0.7628181",
"0.7382631",
"0.7328584",
"0.72631717",
"0.7243533",
"0.7239482",
"0.7239482",
"0.7120054",
"0.7120054",
"0.7120054",
"0.7120054",
"0.7120054",
"0.70931834",
"0.70257103",
"0.6998385",
"0.6998385",
"0.6988412",
"0.6978862",
"0.6973388",
"0.69595504",
"0.69595504"... | 0.82648855 | 0 |
Set the Plague Game infection rate. | async def rate(self, ctx: commands.Context, rate: hundred_int):
await self.config.rate.set(rate)
await ctx.send(f"The Plague Game rate has been set to {rate}%.") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_rate(self):\r\n interval = self.data.iloc[2, 0] - self.data.iloc[1, 0]\r\n self.rate = int(1 / interval)",
"def set_current_rate(self, rate_to_set):\n pass",
"def update_recruiting(self, rate):\n self.recruit = int(np.ceil(self.INITIAL_POPULATION*rate))",
"def changeFps(s... | [
"0.6537899",
"0.6476173",
"0.6194691",
"0.61277837",
"0.6122415",
"0.60193396",
"0.6016265",
"0.594481",
"0.58925945",
"0.58925945",
"0.58155185",
"0.5802125",
"0.5790754",
"0.56930536",
"0.56546116",
"0.56423604",
"0.56423604",
"0.5611345",
"0.55977356",
"0.559575",
"0.55957... | 0.73317456 | 0 |
Return true if user has access to the document. | def user_has_access(self, user):
if self.visibility == self.PUBLIC:
return True
elif self.visibility == self.PRIVATE and self.created_by == user:
return True
elif self.visibility in (self.ORG_ONLY, self.ORG_ONLY_NO_EXTERNAL):
if user.external and self.visibili... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user_has_access(self):\n return self.user_has_access(users.get_current_user())",
"def has_permission(self, request, view):\n\n # Fallback to has_object_permission unless it's a POST\n if request.method != 'POST':\n return True\n\n # Need this information to make a d... | [
"0.80368054",
"0.7762715",
"0.7668463",
"0.7591568",
"0.7519087",
"0.7514855",
"0.7510113",
"0.739244",
"0.73190254",
"0.726173",
"0.7239984",
"0.7184765",
"0.7182338",
"0.718063",
"0.7149214",
"0.7148742",
"0.71331215",
"0.71313983",
"0.7125082",
"0.7113898",
"0.7109396",
... | 0.7364114 | 8 |
Check `y` parameter for all transformers and adapt it if needed. | def check_consistent_y(self, y):
# Y must be the time serie!
if y is None:
raise ValueError("TSF transformers need to receive the time serie data as Y input.")
# Y must be ndarray-type
if not isinstance(y, np.ndarray):
y = np.array(y)
# Y must be 2D
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fit_transform(self, X, y=...):\n ...",
"def fit_transform(self, y):\n self.fit(y)\n y = self.transform(y)\n return y",
"def fit_transform(self, y):\n return self.fit(y).transform(y)",
"def _validate_y(self, y):\n y_encoded = super()._validate_y(y)\n if (\n... | [
"0.63571626",
"0.6329644",
"0.6256087",
"0.6239312",
"0.6186153",
"0.59435165",
"0.59435165",
"0.59166265",
"0.5913362",
"0.5913362",
"0.5907132",
"0.59030825",
"0.5894817",
"0.5869181",
"0.5860686",
"0.5860686",
"0.5849377",
"0.58461577",
"0.58354646",
"0.58160996",
"0.58151... | 0.5824808 | 19 |
Check `X` and `y` parameters for all transformers and adapt it if needed. | def check_consistent_params(self, X, y):
y = self.check_consistent_y(y)
X = self.check_consistent_X(X)
return X, y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fit_transform(self, X, y=...):\n ...",
"def _check_transformers(self):\n\n assert all([hasattr(trf, \"fit\") for trf in self.transformer_list]), \"At least one transformer object is not \" \\\n \"compatible with 'fit' me... | [
"0.6721865",
"0.6456814",
"0.6238531",
"0.60539395",
"0.6052629",
"0.60452086",
"0.5953004",
"0.5923598",
"0.58932537",
"0.58851457",
"0.5880926",
"0.58474123",
"0.5804074",
"0.57910395",
"0.5766051",
"0.57233894",
"0.57233894",
"0.5717895",
"0.5717895",
"0.5714157",
"0.56982... | 0.0 | -1 |
Plot the estimated image after iteration q. | def plot_image_estimate(self, fig, ax, q, cmap=plt.cm.gray_r,
colorbar=True, vmax=None):
if q == -1:
q = self.N_itr - 1
try:
res = self.image_ests[q]
except KeyError:
image_est = self.data['EM_data/{}/image_est'.format(q)].ravel()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_em_estimate(self, q, figsize=None):\n if q == -1:\n q = self.N_itr - 1\n\n n_time_steps = self.data['EM_data/{}/time_steps'.format(q)]\n\n if figsize is None:\n figsize = (3.5, 5)\n fig, ax = plt.subplots(nrows=3, ncols=2, figsize=figsize)\n # fig.... | [
"0.7050197",
"0.66024405",
"0.65898466",
"0.6437642",
"0.6433364",
"0.63560355",
"0.63489854",
"0.629037",
"0.62660635",
"0.6249372",
"0.62122965",
"0.6209293",
"0.6191247",
"0.61880225",
"0.6178075",
"0.6167758",
"0.6156939",
"0.61446995",
"0.61351365",
"0.6064277",
"0.60566... | 0.71788716 | 0 |
Plot the image with the neuron RF centers. | def plot_image_and_rfs(self, fig=None, ax=None, legend=True, q=None,
alpha_rf=0.5, cmap=plt.cm.gray_r):
if fig is None:
fig, ax = plt.subplots(1, 1)
if q is None:
dx, dy = 0., 0.
xr, yr = self.xr, self.yr
else:
dx = sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot(self):\n\t\tself.plotOfTF().plot()",
"def plot(self):\n self.plotsite()\n self.plotbond()\n plt.show()",
"def plot(self):\n\t\tself.plotOfXray().plot()",
"def draw_image(self):\n \n pixel_array = self.imageprepare(self.image_path)\n newArr = self.reshape_pixel... | [
"0.6807687",
"0.6468258",
"0.63203174",
"0.6291895",
"0.6288261",
"0.62856156",
"0.62714726",
"0.6244385",
"0.618934",
"0.61522084",
"0.61139596",
"0.6092988",
"0.6071771",
"0.6068946",
"0.6067372",
"0.60644674",
"0.60379404",
"0.60339534",
"0.6021741",
"0.60065997",
"0.60043... | 0.5786423 | 56 |
Eagerly load the training labels and data, reshaping data to have features in final dim. | def transpose_load_concat(self, **kwargs):
if self.mask_train:
datamask=self.add_mask()
thedatas={}
for key, value in kwargs.items():
if not self.mask_train:
thedatas[key]=value.X_train.transpose('a','x','y','features').values
if self.mask_trai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_preprocess_training_batch(batch_id, batch_size):\n path, dataset = select_dataset(training = True)\n data = dataset_lib.get_data(batch_id, dataset=dataset, path=path)\n features = [np.array(x[1]) for x in data]\n labels = np.array([x[0] for x in data])\n\n # Return the training data in batc... | [
"0.6668322",
"0.654929",
"0.65225536",
"0.6517502",
"0.6453421",
"0.6387107",
"0.63758844",
"0.6340945",
"0.6326373",
"0.629427",
"0.6278527",
"0.62583846",
"0.62561625",
"0.62543815",
"0.62326795",
"0.6217918",
"0.62119955",
"0.61870986",
"0.6181849",
"0.6149866",
"0.6145448... | 0.5989931 | 45 |
Retrain the compiled DL model, save the trained model, and save the history and metric information from training to ``self.dl_filedirectory``. | def retrain_dl(self):
if self.print_sequential:
print("Opening files...")
data=self.open_files()
if self.print_sequential:
print("Generating training data and labels...")
train_data, label_data=self.transpose_load_concat(**data)
if self.print_sequential:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self):\n checkpoint = torch.load(\n 'model_lr_finder.pth.tar',\n map_location=self.device)\n self.model.load_state_dict(checkpoint['state_dict'])\n self.optimizer.load_state_dict(checkpoint['optimizer'])\n self.model.to(self.device)\n self.model.tr... | [
"0.67211753",
"0.6693274",
"0.6603331",
"0.6576942",
"0.647895",
"0.64555275",
"0.6449664",
"0.6387158",
"0.6311406",
"0.6302969",
"0.62941915",
"0.62839305",
"0.6272072",
"0.6254605",
"0.6252977",
"0.62327206",
"0.62091357",
"0.62080884",
"0.6155563",
"0.6139587",
"0.6128579... | 0.8312446 | 0 |
Mark a video as flagged. | def flag_video(self, video_id, flag_reason=""):
print("flag_video needs implementation") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flag_video(self, video_id, flag_reason=\"Not supplied\"):\n video = self._video_library.get_video(video_id)\n if not video:\n print(\"Cannot flag video: Video does not exist\")\n return\n if video.flag is not None:\n print(\"Cannot flag video: Video is alre... | [
"0.7585753",
"0.7543017",
"0.6934897",
"0.68738246",
"0.67508376",
"0.6579819",
"0.65071416",
"0.59914064",
"0.5956641",
"0.583062",
"0.5781579",
"0.5766682",
"0.57447886",
"0.57447886",
"0.57447886",
"0.57447886",
"0.56196725",
"0.5476563",
"0.54668385",
"0.53899056",
"0.535... | 0.7286989 | 3 |
Compute the output of the neural net given the input. The input has to be a ndarray of shape input_size or (input_size, N) where N is the batch_size. | def compute(self,input):
for layer in self.layers:
input = layer.compute(input)
return input | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Evaluate(self, input_data: np.ndarray) -> np.ndarray:\n if input_data.shape[0] != self.input_layer_size:\n raise IndexError(f\"Input data length is {input_data.shape[0]}, must match length of input layer size {self.input_layer_size}\")\n\n # Evaulate hidden layer given input values\n hidden_layer... | [
"0.7471102",
"0.690292",
"0.65959746",
"0.6594167",
"0.655678",
"0.65384686",
"0.64864445",
"0.6464291",
"0.64630115",
"0.64605486",
"0.6455232",
"0.6454307",
"0.64344686",
"0.6419709",
"0.6382697",
"0.63661134",
"0.63661134",
"0.6358324",
"0.635055",
"0.63265884",
"0.6307754... | 0.6359508 | 17 |
Remove unwanted characters from filename. | def clean_filename(self, filename):
return remove(filename,self.unwanted_chars_in_filenames) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def processFilename(filename):\n\n badchars = [\" \", \",\", \"+\", \"$\", \"_\", \"{\", \"}\", \"/\", \"&\"]\n fn = filename\n for bc in badchars:\n fn = fn.replace(bc, \"\")\n return fn",
"def cleanFilename(filename):\n badChars = {ord('?'): None, ord('*'): None, ord('/'): None,\n ... | [
"0.8398575",
"0.83859897",
"0.8350601",
"0.82670814",
"0.8205197",
"0.81188583",
"0.80649894",
"0.80484325",
"0.8015434",
"0.79582447",
"0.7895721",
"0.7838113",
"0.78226405",
"0.77994764",
"0.77861166",
"0.7675766",
"0.7651447",
"0.76467323",
"0.7586942",
"0.7478048",
"0.747... | 0.85275155 | 0 |
Close summary writer instance. | def __del__ (self) -> None:
if self.summary_writer is not None and isinstance(self.summary_writer, SummaryWriter):
self.summary_writer.close() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close(self):\n self._closed = True\n self._writer.close()",
"def close(self):\n self.out_file.close()",
"def close(self):\n self.file_out.close()",
"def close(self):\r\n if self.__writer is not None:\r\n self.__writer.close()",
"def close(self):\n se... | [
"0.6785186",
"0.6767773",
"0.66555554",
"0.6627166",
"0.6604468",
"0.6538984",
"0.6488689",
"0.6484089",
"0.64665776",
"0.64038444",
"0.6329559",
"0.6236305",
"0.6170235",
"0.6170235",
"0.6124325",
"0.6123393",
"0.6123393",
"0.61071444",
"0.6094225",
"0.6073233",
"0.60667455"... | 0.7943646 | 0 |
Extract the coordinates from a given object or explicitly given attrs The coordinates, latitude and longitude, are usually one point for the dataset, such as a mooring or a CTD cast, or a sequence of coordinates such as the alongtrack of a TSG. This function searches for the coordinates associated with a dataset. | def extract_coordinates(obj, attrs=None, latname=None, lonname=None):
try:
return _coordinate_flex_vocabulary(obj, latname, lonname)
except LookupError:
pass
if attrs is not None:
try:
return _coordinate_flex_vocabulary(attrs, latname, lonname)
except LookupError:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_coords(data, id):\n return data[id]['lat'], data[id]['lon']",
"def _extract_coords_loc_entities(loc_entities: Iterable[GeoLocation]):\n return [\n (loc[\"Latitude\"], loc[\"Longitude\"])\n for loc in loc_entities\n if \"Latitude\" in loc and \"Longitude\" in loc\n ]",
"def... | [
"0.6373732",
"0.6198705",
"0.6006441",
"0.5999348",
"0.5999348",
"0.5923629",
"0.58764064",
"0.5726027",
"0.5660463",
"0.5617779",
"0.56094825",
"0.5589053",
"0.55710137",
"0.5530968",
"0.5509228",
"0.5503941",
"0.54544544",
"0.53860575",
"0.5365368",
"0.53450227",
"0.534449"... | 0.6902324 | 0 |
Limit variables in the plasma. | def limit_plasma(self, n_min=1e11, n_max=1e22, T_min=0.001, T_max=100.0):
self.ne = np.clip(self.ne, n_min, n_max)
self.ni = np.clip(self.ni, n_min, n_max)
self.nn = np.clip(self.nn, n_min, n_max)
self.Te = np.clip(self.Te, T_min, T_max)
self.Ti = np.clip(self.Ti, T_min, T_max) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def determinePlotLimits(self):\n max_str = \"up99\"\n min_str = \"dn99\"\n if self.keywords.get(\"limit_type\",\"99per\") == \"minmax\":\n max_str = \"max\"\n min_str = \"min\"\n \n # Determine the min/max of variables over all models\n limits = {... | [
"0.5719771",
"0.5622539",
"0.5601838",
"0.55423576",
"0.551243",
"0.5498661",
"0.54273796",
"0.5407416",
"0.53361064",
"0.53361064",
"0.53361064",
"0.5289541",
"0.52448493",
"0.5229126",
"0.5220726",
"0.51361024",
"0.5129288",
"0.5123883",
"0.5099115",
"0.50677574",
"0.505175... | 0.6678111 | 0 |
Gets `freqscale` input of Klang. | def freqscale(self):
index = self._ordered_input_names.index('freqscale')
return self._inputs[index] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_scale_freq():\n return sf / 2 / (num_freq-1)",
"def GetUserScale(*args, **kwargs):\n return _gdi_.DC_GetUserScale(*args, **kwargs)",
"def GetScale(self):\n ...",
"def scaling_frequencies():\r\n ret_out = utils.run(current_scaling_freq).stdout.strip('\\n').replace(',', ' ')\r\n ... | [
"0.7665983",
"0.63172144",
"0.6219043",
"0.61471736",
"0.6142088",
"0.61237776",
"0.60949004",
"0.6057772",
"0.60247964",
"0.60243344",
"0.60016376",
"0.59972584",
"0.59762216",
"0.59656197",
"0.59504724",
"0.59082747",
"0.5897841",
"0.5895813",
"0.58680457",
"0.58477575",
"0... | 0.7947428 | 0 |
Init a Graph instance given edges. If edges are not given, init an empty graph. | def __init__(self, edges=None, directed=False):
self._graph = defaultdict(dict)
self._directed = directed
if edges:
self.add_edges(edges) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, edges=None, nodes=None, graph=None):\n self.edges = edges\n self.nodes = nodes\n self.graph = graph",
"def _init_graph(self):\n self.G = nx.Graph()\n self.G.add_nodes_from([1,2,3,4,5])\n self.G.add_edges_from([(1,2),(2,3),(2,4)\\\n ... | [
"0.7907357",
"0.6808131",
"0.67216235",
"0.6699312",
"0.6667479",
"0.66645825",
"0.6662588",
"0.6642915",
"0.66428787",
"0.6579253",
"0.65648687",
"0.6482207",
"0.6468058",
"0.64353323",
"0.6398501",
"0.63427716",
"0.6305664",
"0.6284647",
"0.6273636",
"0.6197751",
"0.6172768... | 0.7776141 | 1 |
Add directed or bidirected edge between node1 and node2. If the edge already exists, update the edge weight. | def add(self, node1, node2, weight=1.):
self._graph[node1][node2] = weight
if not self._directed:
self._graph[node2][node1] = weight | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_edge(self, n1, n2, weight=0):\n self.add_node(n1)\n self.add_node(n2)\n if n2 in self.node_dict[n1]:\n raise ValueError(\"Edge already exists\")\n self.node_dict[n1][n2] = weight",
"def add_Edge(self, node1, node2, weight=1):\n if node1 and node2 in self._adj... | [
"0.86090434",
"0.8333767",
"0.8301639",
"0.828959",
"0.828264",
"0.81178445",
"0.80472666",
"0.8043774",
"0.8040117",
"0.7990929",
"0.7932589",
"0.7916668",
"0.78177065",
"0.7774829",
"0.77719915",
"0.7656922",
"0.7613943",
"0.76099795",
"0.7569731",
"0.7548905",
"0.75448614"... | 0.7621384 | 16 |
Return all nodes in the graph as a set. | def nodes(self):
nodes = []
for key, val in self._graph.items():
nodes.append(key)
nodes.extend([v for v in val.keys() if v not in nodes])
return set(nodes) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nodes(self):\n\n return list(set(self._graph.keys() + [x for x in itertools.chain.from_iterable(self._graph.values())]))",
"def get_nodeset(self):\n return set(self.nodeset) # return the nodeset",
"def nodes(self):\n return set(self.values())",
"def get_nodes(self):\n return_... | [
"0.8234579",
"0.8215675",
"0.79805046",
"0.77652586",
"0.76267713",
"0.7593721",
"0.7529319",
"0.74176335",
"0.7375266",
"0.73243386",
"0.73047864",
"0.72664815",
"0.7217121",
"0.721464",
"0.70989513",
"0.70616",
"0.70616",
"0.70489573",
"0.70397997",
"0.70312285",
"0.6972851... | 0.79107106 | 3 |
Return all adjacent nodes in the graph of a given node. If the node is not in the graph, an empty set will be returned. | def adjacent_nodes_of(self, node):
adj_nodes = set(self._graph[node].keys())
if not adj_nodes:
self.remove(node, remove_edges_only=True)
return adj_nodes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def neighbors_of(self, node: Node) -> Set[Node]:\n return self._neighbors[node].copy()",
"def get_node_neighbors(self, node):\n return_set = set()\n for index, element in enumerate(self._adjmatrix[self._name.index(node)]):\n if element:\n return_set.add(self._name[i... | [
"0.74123037",
"0.7214495",
"0.69414246",
"0.68861103",
"0.67288274",
"0.6577851",
"0.65467346",
"0.653652",
"0.64346504",
"0.64225644",
"0.6359586",
"0.6329879",
"0.63194704",
"0.6310771",
"0.6307396",
"0.6286142",
"0.6253437",
"0.6240762",
"0.62090874",
"0.61901444",
"0.6162... | 0.79109585 | 0 |
Initialize a CNOTDihedral operator object. | def __init__(
self,
data: CNOTDihedral | QuantumCircuit | Instruction | None = None,
num_qubits: int | None = None,
validate: bool = True,
):
if num_qubits:
# initialize n-qubit identity
self._num_qubits = num_qubits
# phase polynomial
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, op, expression1, expression2):\n LinearExpression.__init__(self)\n\n self.op = op\n self.expression1 = expression1\n self.expression2 = expression2",
"def _from_circuit(self, circuit):\n if not isinstance(circuit, (QuantumCircuit, Instruction)):\n ... | [
"0.60210705",
"0.6009914",
"0.5863902",
"0.5861921",
"0.5859795",
"0.5831668",
"0.5749515",
"0.571036",
"0.570902",
"0.567959",
"0.565492",
"0.562223",
"0.5615621",
"0.5614811",
"0.561222",
"0.56040686",
"0.5602085",
"0.5577438",
"0.55564964",
"0.55553794",
"0.5530209",
"0.... | 0.6032015 | 0 |
Unique string identifier for operation type. | def name(self):
return "cnotdihedral" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def operation_id(self) -> Optional[str]:\n return pulumi.get(self, \"operation_id\")",
"def _get_singa_op_type(cls, op):\n return type(op).__name__",
"def operation_type(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"operation_type\")",
"def unique_id(self):\n ... | [
"0.69974273",
"0.6985285",
"0.69820863",
"0.6894799",
"0.6811279",
"0.67129385",
"0.6630601",
"0.6598833",
"0.6596271",
"0.65912664",
"0.65765226",
"0.65315366",
"0.6509212",
"0.64632875",
"0.6416627",
"0.64048076",
"0.63964814",
"0.63964814",
"0.63964814",
"0.63964814",
"0.6... | 0.0 | -1 |
Apply a CX gate to this element. Left multiply the element by CX(i, j). | def _append_cx(self, i, j):
if not 0 <= i < self.num_qubits or not 0 <= j < self.num_qubits:
raise QiskitError("CX qubits are out of bounds.")
self.linear[j] = (self.linear[i] + self.linear[j]) % 2
self.shift[j] = (self.shift[i] + self.shift[j]) % 2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def CX(self, qubit_expr):\n self.apply_gate_operation(cirq.ops.CX, qubit_expr)",
"def __call__(self, x):\n if self.dropout > 0:\n x = ht.dropout_op(x, 1 - self.dropout)\n x = ht.matmul_op(x, self.weight)\n msg = x + ht.broadcastto_op(self.bias, x)\n x = ht.csrmm_op(s... | [
"0.630172",
"0.55143523",
"0.5318893",
"0.52920705",
"0.5229278",
"0.52088296",
"0.5181431",
"0.51400846",
"0.5133389",
"0.51253676",
"0.5125028",
"0.5124258",
"0.50962716",
"0.50914264",
"0.50914264",
"0.50852555",
"0.5066616",
"0.50499827",
"0.50337887",
"0.50214434",
"0.49... | 0.55816364 | 1 |
Return a Gate instruction implementing the CNOTDihedral object. | def to_instruction(self):
return self.to_circuit().to_gate() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return \"cnotdihedral\"",
"def to_circuit(self):\n from qiskit.synthesis.cnotdihedral import synth_cnotdihedral_full\n\n return synth_cnotdihedral_full(self)",
"def gate_logic(self):\r\n return self._gate_logic",
"def _from_circuit(self, circuit):\n if not... | [
"0.654134",
"0.6159482",
"0.5539059",
"0.5284799",
"0.5219212",
"0.52119976",
"0.5167287",
"0.51612526",
"0.51273036",
"0.5092963",
"0.50870794",
"0.5044816",
"0.4981318",
"0.49812052",
"0.49448925",
"0.49229518",
"0.490348",
"0.49012855",
"0.48829442",
"0.48794165",
"0.48783... | 0.6277051 | 1 |
Convert to an Operator object. | def to_operator(self) -> Operator:
return Operator(self.to_instruction()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_op(self):\n raise NotImplementedError",
"def convert(self, operator: OperatorBase) -> OperatorBase:\n # pylint: disable=cyclic-import,import-outside-toplevel\n from ..evolutions.evolved_op import EvolvedOp\n\n if isinstance(operator, ListOp):\n if isinstance(operator... | [
"0.7314822",
"0.70962125",
"0.68901265",
"0.68216527",
"0.655981",
"0.6526954",
"0.6446311",
"0.6419526",
"0.62623423",
"0.6236161",
"0.6225145",
"0.61160827",
"0.60868067",
"0.59478796",
"0.5909923",
"0.58929354",
"0.5803807",
"0.5733097",
"0.56855446",
"0.5625735",
"0.56253... | 0.8329919 | 0 |
return abs path of module's directory | def ModulePath(self):
return os.path.join(self._module.workspace, self._module.module_cvspath) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def module_path():\n return os.path.dirname(unicode(__file__, sys.getfilesystemencoding( )))",
"def _get_module_path():\n\n return os.path.dirname(os.path.realpath(__file__))",
"def module_directory(file_path):\n return os.path.dirname(os.path.realpath(file_path))",
"def get_module_path(module):\n ... | [
"0.8254426",
"0.8125783",
"0.80325514",
"0.7845504",
"0.78311765",
"0.7777206",
"0.7733997",
"0.77049303",
"0.7638604",
"0.7599676",
"0.7500204",
"0.7491217",
"0.74866754",
"0.7452219",
"0.74370754",
"0.7406202",
"0.74029994",
"0.73924786",
"0.7362808",
"0.73421204",
"0.73302... | 0.0 | -1 |
Compares EvalItem objects. Checks if self has less (or equal) genes, but better (or at least similar result). | def pareto_better(self, other: "EvalItem") -> bool:
return self.size <= other.size and other.result <= self.result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_test_if_better(self):\n\n if self.__genes_test is None or self.__fitness_test is None:\n raise ValueError(\"Test values should not be None.\")\n\n # if test is better\n if self.__fitness_test < self.__fitness:\n self.genes = self.__genes_test\n self._... | [
"0.60385275",
"0.6037134",
"0.5864756",
"0.5822088",
"0.57959324",
"0.57649183",
"0.5657762",
"0.56092143",
"0.5561726",
"0.5561385",
"0.55514026",
"0.5547464",
"0.55369115",
"0.5529964",
"0.5518938",
"0.5494191",
"0.5491489",
"0.5477876",
"0.5474787",
"0.54617405",
"0.545531... | 0.6976804 | 0 |
Extracts episodes list of a series. | def scrapPage(idSeries, pageIMDB, credit=False, dicChars=None):
urlIDMB = requests.get(pageIMDB).text
soup = BeautifulSoup(urlIDMB, 'lxml')
seriesData = ""
creditsData = ""
nbSeasons = len(soup.find(id="bySeason").find_all('option')) + 1
for season in range(1, nbSeasons):
linkSeason =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def episodes(self):\n episodes = []\n for series in self.series:\n episodes.extend(series.episodes)\n return episodes",
"def _get_episodes(self):\n return [series_episode for series_episode in SeriesEpisode.objects.filter(series=self)]",
"def episodes(self):\n epis... | [
"0.8180665",
"0.77799803",
"0.764737",
"0.70763695",
"0.7039987",
"0.6979854",
"0.69421047",
"0.69209945",
"0.68453395",
"0.679682",
"0.6651206",
"0.65845966",
"0.6534319",
"0.6522302",
"0.6474611",
"0.6417491",
"0.6410377",
"0.6360032",
"0.62862295",
"0.62570786",
"0.6154105... | 0.5454541 | 75 |
Returns a copy of the open transactions list. | def get_open_transactions(self):
return self.__open_transactions[:] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transactions(self):\n return copy.deepcopy(self._transactions)",
"def transactions(self):\r\n return tx.Transactions(self)",
"def all_transactions(self):\n self._update()\n with self.all_tx_lock:\n all_tx_copy = copy.deepcopy(self._all_transactions)\n return al... | [
"0.74073327",
"0.69930035",
"0.6982965",
"0.67889047",
"0.67787904",
"0.6553464",
"0.64532",
"0.6304627",
"0.62987214",
"0.6267927",
"0.6201191",
"0.61947536",
"0.61570275",
"0.61521894",
"0.6120035",
"0.6119235",
"0.61105096",
"0.59384155",
"0.59369034",
"0.5926564",
"0.5923... | 0.82025146 | 0 |
Returns a copy of the open chipsactions list. | def get_open_chipsactions(self):
return self.__open_chipsactions[:] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getChips(self):\n return self._chips",
"def _pending_chips(self):\n assert not (self._deleted and self._new)\n # NOTE: This is ce4 specific code and could be factored out.\n deliver_at = gametime.now()\n\n chips = []\n # If this is a DELETE, send an empty dict.\n ... | [
"0.63576806",
"0.62891483",
"0.6273887",
"0.62653565",
"0.6210261",
"0.5960292",
"0.5945517",
"0.5938602",
"0.59367687",
"0.5871798",
"0.5871798",
"0.58629596",
"0.5763202",
"0.5763202",
"0.5763202",
"0.57266444",
"0.5723594",
"0.5708961",
"0.5692077",
"0.5691463",
"0.5682342... | 0.8577128 | 0 |
Returns the last value of the current blockchain. | def get_last_blockchain_value(self):
if len(self.__chain) < 1:
return None
return self.__chain[-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_last_blockchain_value():\n return blockchain[-1]",
"def last_value():\n return blockchain[-1]",
"def get_last_blockchainvalue(self):\n if len(self.__chain) < 1:\n return None\n return self.__chain[-1]",
"def get_last_blockchain_value():\n if len(blockchai... | [
"0.9384939",
"0.9372068",
"0.91123897",
"0.9008081",
"0.9004173",
"0.89812165",
"0.8174881",
"0.81667095",
"0.80762106",
"0.7772129",
"0.77565527",
"0.76207167",
"0.7565783",
"0.7550907",
"0.7512734",
"0.7454145",
"0.741592",
"0.7406254",
"0.73910964",
"0.73910964",
"0.737972... | 0.91086453 | 6 |
Return a list of all connected peer nodes. | def get_peer_nodes(self):
return list(self.__peer_nodes) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def peer_list_all(self):\n return self.client.call('GET', self.name + 'peer-list/all')",
"def peer_list_reachable(self):\n return self.client.call('GET', self.name + 'peer-list/reachable')",
"def list_nodes(self):\n return self.ironic_client.node.list()",
"def get_all_nodes(self):\n ... | [
"0.7392213",
"0.70041364",
"0.69801885",
"0.69239604",
"0.6883451",
"0.6803804",
"0.6792793",
"0.6770912",
"0.6726549",
"0.66532004",
"0.6605565",
"0.658651",
"0.6585198",
"0.65564847",
"0.6541461",
"0.6538914",
"0.6531504",
"0.653033",
"0.65255666",
"0.64994526",
"0.64958656... | 0.8496255 | 0 |
reshape an image and pad it while keeping the ratio. | def reshape_and_pad(image: np.ndarray, target_size: Union[List[int], Tuple[int]]):
# input shapes
input_shape = image.shape[:2]
# calculate the width and height
w_ratio = float(target_size[1]) / input_shape[1]
h_ratio = float(target_size[0]) / input_shape[0]
# take the smaller ratio to ens... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _pad_image(self, img: ndarray, pad_width: int = 10) -> ndarray:\n self.padded_img = np.zeros(\n (img.shape[0] + pad_width*2, img.shape[1]+pad_width*2))\n self.padded_img[pad_width:-pad_width, pad_width:-pad_width] = img\n return self.padded_img",
"def _pad_img(self, results):\... | [
"0.671313",
"0.65869385",
"0.65226316",
"0.64735305",
"0.6429868",
"0.6426964",
"0.63919014",
"0.63753116",
"0.6356884",
"0.63436484",
"0.63273036",
"0.6303279",
"0.62877494",
"0.6265354",
"0.62513965",
"0.62240124",
"0.6218474",
"0.61861354",
"0.6163912",
"0.61282444",
"0.61... | 0.73125803 | 0 |
Return the very original `Task` that this `Task` had overridden. If this task has been overridden multiple times, this will return the very first/original task. Return `self` if the task was not overridden | def root_orig(self):
if hasattr(self, "orig"):
return self.orig.root_orig
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def task(self) -> base_model.BaseTask:\n return self._task",
"def get_previous_task():\n return _tasks[0] if len(_tasks) != 0 else None",
"def original(self):\n return self._original",
"def original(self):\n return self._original",
"def __previousTask(self):\n self.activeWindow()... | [
"0.64324754",
"0.60787785",
"0.59293354",
"0.59293354",
"0.57849663",
"0.5709106",
"0.57029593",
"0.5698762",
"0.5698762",
"0.5698762",
"0.5698762",
"0.5698762",
"0.56857145",
"0.5660207",
"0.5645483",
"0.56320506",
"0.5515284",
"0.5401499",
"0.5384192",
"0.53704864",
"0.5328... | 0.0 | -1 |
Constructor region the AWS region name bucket the S3 bucket name. The bucket gets created if it does not exist. keyPrefix the S3 key prefix to be used for each log export to S3, e.g., logs/ where is the name of the CloudFormation stack associated with the root template for a given deployment. The root stack name is uni... | def __init__(self,region=None, bucket=None, keyPrefix='logs', fqdn=None):
object.__init__(self)
if (not region):
raise MissingArgumentException("The AWS region name must be provided.")
#endIf
self.region = region
if (not bucket):
raise MissingArgumentException("The S3 bucket n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__, *,\n s3_bucket_name: Optional[str] = None,\n s3_key_prefix: Optional[str] = None):\n if s3_bucket_name is not None:\n pulumi.set(__self__, \"s3_bucket_name\", s3_bucket_name)\n if s3_key_prefix is not None:\n pulumi.set(__se... | [
"0.6942516",
"0.6357444",
"0.61786485",
"0.6134088",
"0.6061361",
"0.60233086",
"0.5989732",
"0.5954416",
"0.5937549",
"0.5927632",
"0.586492",
"0.58465475",
"0.5837934",
"0.57873744",
"0.57865876",
"0.5766515",
"0.571961",
"0.56968075",
"0.5684547",
"0.56679547",
"0.56624395... | 0.80993795 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.