query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Retrieve the ItopapiOrganization corresponding to this server | def find_organization(self):
if self.org_id is not None:
ItopapiPrototype.get_itop_class('Organization').find(self.org_id)
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def organization(self):\n return self._tower.get_organization_by_id(self._data.get('organization'))",
"def get_organization(self):\n return self.reference[REF_ORGANIZATION][REF_VALUE]",
"def getOrganization(self):\n return _libsbml.ModelCreator_getOrganization(self)",
"def get_organizati... | [
"0.7651209",
"0.71187073",
"0.7091516",
"0.68542224",
"0.6810734",
"0.680332",
"0.67780435",
"0.6712279",
"0.6706957",
"0.66816705",
"0.6667797",
"0.6625002",
"0.65964967",
"0.6589382",
"0.6561183",
"0.6561183",
"0.6561183",
"0.65521574",
"0.6543021",
"0.64575344",
"0.6378819... | 0.75703514 | 1 |
Determine whether a Roman token is the next logical Roman token. This test is for Roman levels 3 or 6, and checks whether the next token is both a Roman numeral and the next bigger Roman numeral. For instance 'v' is a valid Roman numeral. But unless the current Roman evaluates to 4, the 'v' must be a level1 alpha marke... | def roman_surf_test(self, token, next_token):
if not token:
return False
for each in [token, next_token]:
if not roman_to_int(each):
return False
return roman_to_int(next_token) == roman_to_int(token) + 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_roman_numeral(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"Only strings may be tested \")\n return bool(_romanNumeralPattern.match(s))",
"def roman_numerals_decoder(roman):\n roman_numerals = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}\n result... | [
"0.5724986",
"0.55127585",
"0.53830534",
"0.52930975",
"0.5107975",
"0.5093595",
"0.49485403",
"0.49321708",
"0.4916438",
"0.49055704",
"0.48494673",
"0.48381567",
"0.48101753",
"0.47975814",
"0.47125",
"0.47098485",
"0.46954077",
"0.46896818",
"0.46814248",
"0.46712714",
"0.... | 0.6816487 | 0 |
Fetch token from the server using the provided user, password resulting in subsequent web service requests for waveforms being authenticated for potential access to restricted data. | def _retrieve_jwt_token(self, user, password):
# force https so that we don't send around tokens unsecurely
url = 'https://{}/api/token'.format(urlparse(self.base_url).netloc)
# paranoid: check again that we only send the token to https
if urlparse(url).scheme != "https":
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_token(self, user_id, password):\n url = buildCommandUrl(self.server, \"/as/user/token\")\n result = json_request(\"POST\", url, {\n \"userId\": user_id,\n \"password\": password\n })\n return result[\"token\"]",
"def _request_token(self):\n respo... | [
"0.68086314",
"0.6705352",
"0.660126",
"0.6583421",
"0.6583421",
"0.6573778",
"0.645508",
"0.6440794",
"0.64196825",
"0.64065206",
"0.6396614",
"0.63819987",
"0.63676745",
"0.63418996",
"0.63418996",
"0.6296961",
"0.62778217",
"0.62672204",
"0.6247356",
"0.6242239",
"0.619417... | 0.6948478 | 0 |
A check if the jwt token is valid | def _validate_jwt_token(self):
# force https so that we don't send around tokens unsecurely
url = 'https://{}/api/token/verify'.format(urlparse(self.base_url).netloc)
# paranoid: check again that we only send the token to https
if urlparse(url).scheme != "https":
msg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isValid(token):\n try:\n decoded = jwt.decode(token, SECRET_KEY)\n return True\n except:\n return False",
"def __token_is_valid(self):\n\n if not self.__login_token or len(self.__login_token) < 10:\n # Token is not set or totally invalid\n return False\... | [
"0.8520996",
"0.8204527",
"0.80866903",
"0.7793878",
"0.7776991",
"0.7762956",
"0.77588475",
"0.7680332",
"0.7579834",
"0.7543709",
"0.74756145",
"0.74731255",
"0.74194485",
"0.7321448",
"0.7219745",
"0.71922845",
"0.7190927",
"0.71824664",
"0.7138779",
"0.7125586",
"0.712098... | 0.8363303 | 1 |
Helper method to fetch response via get_stations() and attach it to each trace in stream. | def _attach_responses(self, st):
netids = {}
for tr in st:
if tr.id not in netids:
netids[tr.id] = (tr.stats.starttime, tr.stats.endtime)
continue
netids[tr.id] = (
min(tr.stats.starttime, netids[tr.id][0]),
max(tr.s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_stations(response: Response,\n source: StationSourceEnum = StationSourceEnum.UNSPECIFIED):\n try:\n logger.info('/stations/')\n\n weather_stations = await get_stations_as_geojson(source)\n response.headers[\"Cache-Control\"] = no_cache\n\n return W... | [
"0.6360263",
"0.6021909",
"0.59900856",
"0.5956896",
"0.5865758",
"0.56059825",
"0.5558574",
"0.548664",
"0.5460832",
"0.54202706",
"0.53476536",
"0.5343625",
"0.5334587",
"0.5327473",
"0.52983934",
"0.52805454",
"0.5267272",
"0.525761",
"0.52528024",
"0.52523386",
"0.5234326... | 0.7019285 | 0 |
Get full version information of webservice as a string. | def _get_webservice_versionstring(self, service):
version = self.get_webservice_version(service)
return ".".join(map(str, version)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_version(self):\n return self.http_call(\"get\", url=f\"{self.base_url}/version\").json()",
"def GetVersion(self):\n return self._SendRequest(HTTP_GET, \"/version\", None, None)",
"def version():\n version_info = pbr.version.VersionInfo('ardana-service')\n return version_info.version_str... | [
"0.75000274",
"0.7449257",
"0.73129904",
"0.7277117",
"0.7266704",
"0.7241125",
"0.72253454",
"0.7220058",
"0.7202378",
"0.7146718",
"0.7130265",
"0.711573",
"0.71138686",
"0.71088123",
"0.7105085",
"0.7094832",
"0.7075875",
"0.69911677",
"0.69908917",
"0.6990632",
"0.6978907... | 0.7781521 | 0 |
Attaches the actually used dataselet URL to each Trace. | def _attach_dataselect_url_to_stream(self, st):
url = self._build_url("dataselect", "query")
for tr in st:
tr.stats._fdsnws_dataselect_url = url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __traces_url(self):\n path = AGENT_TRACES_PATH % self.from_.pid\n return \"http://%s:%s/%s\" % (self.host, self.port, path)",
"def getDataUrls(self):\n sub1 = self.id[0:3]\n sub2 = self.id[3:6]\n sub3 = self.id[6:9]\n self.xml = \"%s/static/model/%s/%s/%s/%s.xml\" % ... | [
"0.58800995",
"0.557478",
"0.5461198",
"0.5454662",
"0.5379516",
"0.5288198",
"0.51027226",
"0.50803655",
"0.5057965",
"0.50400174",
"0.500458",
"0.4987462",
"0.49711695",
"0.49326184",
"0.49326184",
"0.49260262",
"0.49156776",
"0.4909598",
"0.4874118",
"0.48735803",
"0.48605... | 0.58549017 | 1 |
Takes any value and converts it to a string compliant with the FDSN webservices. Will raise a ValueError if the value could not be converted. >>> print(convert_to_string("abcd")) abcd >>> print(convert_to_string(1)) 1 >>> print(convert_to_string(1.2)) 1.2 >>> print(convert_to_string( \ UTCDateTime(2012, 1, 2, 3, 4, 5, ... | def convert_to_string(value):
if isinstance(value, str):
return value
# Boolean test must come before integer check!
elif isinstance(value, bool):
return str(value).lower()
elif isinstance(value, int):
return str(value)
elif isinstance(value, float):
return str(value)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_to_string(value: Any) -> str:\n if isinstance(value, str):\n return value\n\n if isinstance(value, bytes):\n return value.decode(\"utf-8\")\n\n return str(value)",
"def convert_to_str(input_string):\n\n if sys.version < '3':\n\n if isinstance(input_string, str) \\\n ... | [
"0.6892246",
"0.6521637",
"0.64140946",
"0.6409152",
"0.6387546",
"0.630994",
"0.6246186",
"0.62287396",
"0.6162186",
"0.61320966",
"0.61231935",
"0.6070894",
"0.6000176",
"0.5963317",
"0.59516305",
"0.5947143",
"0.5946218",
"0.589599",
"0.58766305",
"0.5855638",
"0.5848334",... | 0.7913156 | 0 |
Test `construct_compose_dict` returns expected compose dict. | def test_construct_compose_dict(self):
expected_examplescraper_compose_dict = {
"version": "3",
"services": {
"scp1": {
"container_name": "scp1",
"environment": [
"TOR_PORT=9051",
"TOR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_construct_compose_dict_nonexisting_scraper(self):\n with self.assertRaises(ModuleNotFoundError):\n docker_compose.construct_compose_dict(\"nonexisting\")",
"def test_build_exchange_dictionary(self):\n expected = {\n \"USD\": {\"USD\": Decimal(1.0), \"AUD\": Decimal(2.... | [
"0.611908",
"0.59375006",
"0.56059444",
"0.5426353",
"0.54253703",
"0.54189974",
"0.5415257",
"0.5411503",
"0.5383426",
"0.537418",
"0.52742",
"0.52094966",
"0.51827496",
"0.5154304",
"0.51462847",
"0.51409686",
"0.5090625",
"0.5080768",
"0.50691545",
"0.5063073",
"0.50582147... | 0.70209265 | 0 |
Test `construct_compose_dict` raises `ModuleNotFoundError` for a nonexisting scraper. | def test_construct_compose_dict_nonexisting_scraper(self):
with self.assertRaises(ModuleNotFoundError):
docker_compose.construct_compose_dict("nonexisting") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_construct_compose_dict(self):\n expected_examplescraper_compose_dict = {\n \"version\": \"3\",\n \"services\": {\n \"scp1\": {\n \"container_name\": \"scp1\",\n \"environment\": [\n \"TOR_PORT=9051\",\... | [
"0.6682241",
"0.5706916",
"0.5090552",
"0.5024181",
"0.4941659",
"0.48633698",
"0.48114425",
"0.4799155",
"0.47261176",
"0.4679527",
"0.46407944",
"0.46372876",
"0.46235257",
"0.46136138",
"0.45923778",
"0.45748225",
"0.45726362",
"0.45706356",
"0.4561969",
"0.4499325",
"0.44... | 0.862838 | 0 |
Test the rating limit | def _testRatingLimit(self):
comment = models.Comment.objects.all()[0]
type = models.RatingType.objects.all()[0]
try:
val = type.limit + 10
rating = models.Rating(comment=comment, type=type, value=val)
rating.save()
assert rating.value == type.limi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_unsuccessful_rating_with_rate_value_more_than_five(self):\n response = self.client.post(\n reverse('articles:rate', kwargs={'slug': self.slug}),\n {'rating': 6},\n format=\"json\",\n **self.headers)\n self.assertEqual(response.status_code, status.H... | [
"0.70283306",
"0.696573",
"0.68655944",
"0.670783",
"0.649507",
"0.6459995",
"0.6455193",
"0.64220494",
"0.63810766",
"0.63534164",
"0.63452977",
"0.6326962",
"0.6323487",
"0.6303592",
"0.6256071",
"0.6230649",
"0.62118495",
"0.6192096",
"0.61686665",
"0.6168111",
"0.6138926"... | 0.7624382 | 0 |
Test individual comment rating | def _testCommentRating(self):
try:
host = models.Host.objects.all()[0]
comment = models.Comment(text='test', host=host)
comment.save()
types = models.RatingType.objects.all()
items = []
for value, type in zip([3, 4, 5], types):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_upvote_modifies_comment_score(self):\n comment = Comment.objects.get(body=\"987XYZ\")\n self.assertEqual(comment.score, DEFAULT_SCORE)\n vote = Vote.create(comment=comment, value=1, voter=self.user)\n comment = Comment.objects.get(body=\"987XYZ\")\n self.assertEqual(comm... | [
"0.70396376",
"0.68224984",
"0.6756108",
"0.65874946",
"0.6557403",
"0.65549046",
"0.64839643",
"0.6482616",
"0.64394224",
"0.6431737",
"0.63834304",
"0.6381632",
"0.63514405",
"0.6258549",
"0.62077975",
"0.6185496",
"0.613789",
"0.61266005",
"0.6110438",
"0.61005175",
"0.609... | 0.7833201 | 0 |
Test individual host rating | def _testHostRating(self):
try:
user = auth.User.objects.all()[0]
category = models.Category.objects.all()[0]
host = models.Host(user=user, category=category,
url='http://blah.com')
host.save()
comment = models.Comment(text='test', ho... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_connection_score(self, current_connection):\n orange_score = int(Setup.orange_score)\n red_score = int(Setup.red_score)\n if Setup.system_status == 'orange':\n if current_connection['score'] <= int(orange_score):\n self.block_ip_address(current_connection['ip... | [
"0.6140125",
"0.60586387",
"0.5988735",
"0.5964071",
"0.5828688",
"0.58104444",
"0.5805761",
"0.5743598",
"0.55654544",
"0.55423003",
"0.54669577",
"0.5444215",
"0.5438256",
"0.5420251",
"0.54023296",
"0.5397459",
"0.5385342",
"0.5385126",
"0.5348706",
"0.5313948",
"0.530791"... | 0.72438645 | 0 |
Test the different rating categories | def _testRatingCategories(self):
try:
user = auth.User.objects.all()[0]
category = models.Category.objects.all()[0]
host = models.Host(user=user, category=category,
url='http://blah.com')
host.save()
comment = models.Comment(text='te... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_cat_score(self):\n classes = ['blue skin', 'pointy ears']\n negated_classes = []\n categories = ['ear feature', 'skin feature']\n\n categorical_score = self.annot_scorer._get_categorical_score(\n classes, negated_classes, categories,\n self.negation_we... | [
"0.67347944",
"0.6602649",
"0.6267001",
"0.62622076",
"0.588277",
"0.5818572",
"0.57982117",
"0.5775886",
"0.5757851",
"0.57468426",
"0.5741155",
"0.57397753",
"0.5724523",
"0.57127404",
"0.5693196",
"0.5673478",
"0.56529504",
"0.56025386",
"0.5571396",
"0.5566037",
"0.556075... | 0.7431953 | 0 |
Hit a BJcard and append it. Then, find all possible sums and the current hand. The current hand is defined as max. of possible sums The current hand should be 1 if burst | def hit(self, card):
self.append(card)
values=[]
values.append(card.value())
if values[0] < 2:
values.append(values[0]+ 10)
new_sums =set([v+s for v in values for s in self.possible_sums if v+s <=21])
new_sums =sorted(new_sums)
if len(new_sums) ==0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum_hand(self, cards):\n self.totalValue = 0\n for card in cards:\n self.totalValue += DeckOfCards.value(self, card)\n\n for card in cards:\n if self.totalValue > 21 and 'A' in card:\n self.totalValue -= 10\n \n if self.totalValue ... | [
"0.688753",
"0.6112849",
"0.6100922",
"0.6085325",
"0.5997567",
"0.5966301",
"0.5873897",
"0.5858032",
"0.58062357",
"0.5799236",
"0.5777938",
"0.57645684",
"0.5712703",
"0.5693552",
"0.5690028",
"0.5632079",
"0.5579677",
"0.557833",
"0.55535036",
"0.5553048",
"0.5537502",
... | 0.70891213 | 0 |
Is current cards the Blackjack? | def is_blackjack(self):
if self.hand == 21 and len(list(self)) ==2:
print '%s = Blackjack'%self
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hasBlackjack(self):\n return len(self.cards) == 2 and self.getPoints() == 21",
"def is_blackjack(self) -> bool:\n if self.score == 21 and len(self.cards) == 2:\n return True\n else:\n return False",
"def check_for_blackjack(self):\n if (self.dealer.hand.val... | [
"0.8288965",
"0.81736314",
"0.7500575",
"0.72958475",
"0.7241689",
"0.7119909",
"0.7114075",
"0.69564337",
"0.68808556",
"0.6869995",
"0.67837375",
"0.6718618",
"0.66275245",
"0.6555914",
"0.6503698",
"0.6475533",
"0.6465826",
"0.64576113",
"0.64328235",
"0.642792",
"0.642430... | 0.81807315 | 1 |
Restart another round. Check the remaining budget and leave the game if budget <= 0. Create new BJCards | def restart(self):
self.state ='active'
if self.budget <= 0:
return self.leave()
self.cards =BJCards()
self.bet_amount =0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def restart(self):\r\n\r\n self.pot = 0\r\n self.actions = 0\r\n self.previous_bet = self.small_blind\r\n self.initiate_blind(self.small_blind + self.big_blind)\r\n\r\n for player in self.players:\r\n player.credits = self.starting_credits\r\n\r\n # Let the firs... | [
"0.61270714",
"0.6029881",
"0.5949783",
"0.5931026",
"0.58528876",
"0.5843963",
"0.5828268",
"0.5805273",
"0.5793747",
"0.5761536",
"0.5664966",
"0.5653092",
"0.5644708",
"0.5637475",
"0.5613593",
"0.5606919",
"0.5594004",
"0.5582903",
"0.55661905",
"0.5557825",
"0.5552996",
... | 0.77978367 | 0 |
Bet the amount of money. Cannot exceed player's budget | def bet(self, amount):
if amount >self.budget:
print 'you cannot bet because of little money'
else:
self.bet_amount = amount
print 'you bet %s' % (amount) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bet(self, amount):\r\n\r\n if self.players[self.active_player].credits < self.big_blind:\r\n message = \"Player {} won! Not enough money remaining.\".format(self.players[(self.active_player + 1) %\r\n len(se... | [
"0.7924277",
"0.77066535",
"0.7635262",
"0.7549707",
"0.73498285",
"0.7271914",
"0.7244077",
"0.7236459",
"0.7130203",
"0.70558107",
"0.70258206",
"0.69620943",
"0.6960594",
"0.6937988",
"0.6884604",
"0.68403745",
"0.67884886",
"0.6780848",
"0.6771703",
"0.67711383",
"0.67351... | 0.8240085 | 0 |
Hit a card and check if bust | def hit(self, card):
self.cards.hit(card)
if self.cards.hand ==-1:
self.state ='burst' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hit(player):\n deal_random_card(player)",
"def action_hit(self) -> None:\n print(self.deal_card(self.user))",
"def hit(self, player):\n\n hit_card = self.deck.draw()\n hit_card.flip()\n player.take_card(hit_card)\n\n if self.verbose:\n print(player, 'receive... | [
"0.74350667",
"0.71425444",
"0.70626",
"0.7058777",
"0.70395243",
"0.69725394",
"0.691524",
"0.68729144",
"0.6838547",
"0.68238586",
"0.6760089",
"0.6660787",
"0.6624675",
"0.6563094",
"0.6508721",
"0.6479972",
"0.6469464",
"0.642803",
"0.63956666",
"0.63560945",
"0.63471985"... | 0.76179534 | 0 |
Face up dealer's hidden card and balance with players in the game | def showdown(self):
print "%s: %s" %(self.name, repr(self.cards)) # open dealer's cards
for player in self.game.players:
win = self.balance(player)
if win > 0:
print player.name, 'wins', win
elif win == 0:
print player.name, 'draw... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def balance(self, player):\n print 'hand of %s: %s'%(player.name,player.cards.hand)\n print 'hand of %s: %s'%(self.name,self.cards.hand)\n if player.cards.hand == self.cards.hand:\n return 0\n elif player.cards.hand > self.cards.hand:\n return player.bet_amount*2\n... | [
"0.75316435",
"0.6755466",
"0.6731837",
"0.66685313",
"0.6465247",
"0.6453599",
"0.644847",
"0.63940364",
"0.63748866",
"0.6362192",
"0.63309693",
"0.6303815",
"0.6255874",
"0.6199245",
"0.61905754",
"0.61843073",
"0.6167011",
"0.61617035",
"0.6152823",
"0.61407375",
"0.61354... | 0.71721745 | 1 |
Dealer have no choice. Stand if hand >= 17, otherwise hit | def deal_self(self):
self.cards.hit(self.get_card())
if self.cards.hand < 17 and self.cards.hand>=0:
self.state = 'active'
elif self.cards.hand >= 17 and self.cards.hand <= 21:
self.state = 'stand'
elif self.cards.hand==-1:
self.state = 'burst' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stand(hand=bj.player1.hand):\r\n phv = bj.player1.hand_value_check(hand) # check player hand value\r\n phv = [x for x in phv if x <= 21]\r\n if hand == bj.player1.hand:\r\n if len(phv) > 0:\r\n bj.player1.final_hand_val = max(phv)\r\n ... | [
"0.7471603",
"0.74018157",
"0.72898954",
"0.7104887",
"0.7001504",
"0.6908795",
"0.6888352",
"0.68266976",
"0.6750696",
"0.6739227",
"0.6719116",
"0.66749984",
"0.6645196",
"0.66190434",
"0.65957236",
"0.6576811",
"0.6549812",
"0.65478945",
"0.65337396",
"0.6461222",
"0.64541... | 0.74406487 | 1 |
Finds valid positions for Tile mover in Skilaverkefni 8 Takes in current position of the game | def validpositions(tile):
if tile == 11 or tile == 21:
valid_pos = "n"
elif tile == 12:
valid_pos = "nes"
elif tile == 13:
valid_pos = "es"
elif tile == 22 or tile == 33:
valid_pos = "sw"
elif tile == 23:
valid_pos = "ew"
elif tile == 32:
valid_pos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkMoves(self,board):\n possibleMoves = []\n\n for c in xrange(0,8):\n for r in xrange(0,8):\n if board.isValidMove(self.tile,c,r):\n possibleMoves.append(c+r*8)\n\n return possibleMoves",
"def winningMove():\r\n\tglobal turn, tile1, tile2, ... | [
"0.6583925",
"0.6443366",
"0.642417",
"0.6352862",
"0.62645966",
"0.62173724",
"0.61744225",
"0.6168146",
"0.61642736",
"0.61634237",
"0.61494106",
"0.6132909",
"0.61250454",
"0.6120502",
"0.6100356",
"0.6093781",
"0.6078856",
"0.6061042",
"0.6057439",
"0.6056023",
"0.6047237... | 0.68247694 | 0 |
Changes the tile according to what letter was put in a string Takes 2 arguments one for which direction was chosen and one for which tile it is currently located at Returns new tile | def tile_change(direction, tile):
lower_direction = direction.lower()
if lower_direction == "n":
tile += 1
elif lower_direction == "s":
tile -= 1
elif lower_direction == "e":
tile += 10
else:
tile -= 10
return tile | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def changeTile (self, posY, posX, tile=\"t\"):\r\n self.grid[posY][posX] = tile",
"def move_character(self, old_y, old_x, y_pos, x_pos):\n self.map[old_y][old_x] = ' '\n self.map[y_pos][x_pos] = 'G'",
"def get_tile(self, char):\n if char == \"#\":\n return self.tiles[0:32... | [
"0.65772283",
"0.63926816",
"0.63005394",
"0.6223129",
"0.6160206",
"0.5935179",
"0.59308314",
"0.5923742",
"0.58938473",
"0.5884255",
"0.58656144",
"0.5764994",
"0.5759222",
"0.57555896",
"0.57501453",
"0.5739916",
"0.5730088",
"0.5726009",
"0.5652192",
"0.559732",
"0.555341... | 0.7330949 | 0 |
Initialize appointment's creation workflow; Pass to date definition | def create_appointment():
msg = render_template('date')
return question(msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_workflow():\n pass",
"def test_cron_workflow_service_create_cron_workflow(self):\n pass",
"def _create_schedules(self):\n\n ''''''",
"def adc_api_workflow_create():\n workflow_json = request.get_json(force=True)\n\n return jsonify(adc.workflow_create(workflow_json=workflow_jso... | [
"0.6407841",
"0.5967415",
"0.58864933",
"0.57573587",
"0.5667341",
"0.5589588",
"0.5531992",
"0.55230147",
"0.5515364",
"0.54900604",
"0.5475908",
"0.5444646",
"0.544376",
"0.54394084",
"0.54327065",
"0.541028",
"0.5404114",
"0.5402616",
"0.5401141",
"0.5400178",
"0.5390388",... | 0.65402335 | 0 |
Set appointment's begin date; Pass to appointment's begin time | def appointment_date(begin_date):
session.attributes['begin_date'] = str(begin_date)
qs = render_template('time')
return question(qs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_begin_date(self, begin_date):\n self.set_value_into_input_field(self.begin_date_inputbox_locator, begin_date)",
"def begin_date(self, value):\n\n if not isinstance(value, datetime):\n raise TypeError(_pretty_message(\n '''\n begin_date must be an ins... | [
"0.7065128",
"0.7005564",
"0.697397",
"0.6942992",
"0.65339845",
"0.64918524",
"0.6489678",
"0.647476",
"0.6436995",
"0.6375545",
"0.62956077",
"0.61982006",
"0.61860764",
"0.61311483",
"0.6118447",
"0.6097708",
"0.6097708",
"0.6097708",
"0.6097708",
"0.6097708",
"0.6097708",... | 0.7202706 | 0 |
Set appointment's begin_time; Pass to apppointment's end date | def appointment_time(begin_time):
session.attributes['begin_time'] = str(begin_time)
msg = render_template('end_date')
return question(msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def appointment_date(begin_date):\n\n session.attributes['begin_date'] = str(begin_date)\n qs = render_template('time')\n return question(qs)",
"def begin_time(self, begin_time):\n if begin_time is None:\n raise ValueError(\"Invalid value for `begin_time`, must not be `None`\") # noqa... | [
"0.6985581",
"0.65532726",
"0.64899975",
"0.6089194",
"0.60122746",
"0.60122746",
"0.60034096",
"0.59809184",
"0.59809184",
"0.59809184",
"0.59809184",
"0.59809184",
"0.59553194",
"0.5918142",
"0.5905272",
"0.5746406",
"0.5744839",
"0.57072085",
"0.56862944",
"0.5659291",
"0.... | 0.77024466 | 0 |
Set appointment's end date; Pass to appointment's end time | def appointment_end_date(end_date):
session.attributes['end_date'] = str(end_date)
msg = render_template('end_time')
return question(msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_end_date(self, date):\n pass",
"def end_date_time(self, end_date_time):\n\n self._end_date_time = end_date_time",
"def end_date(self, end_date):\n self._end_date = end_date",
"def change_end_date(self, new_end_date):\n self.end_date = new_end_date",
"def appointment_end_... | [
"0.76225775",
"0.7512484",
"0.7296414",
"0.72335875",
"0.72125554",
"0.71424943",
"0.71424943",
"0.71424943",
"0.71424943",
"0.71424943",
"0.71424943",
"0.71424943",
"0.71424943",
"0.7120749",
"0.7087847",
"0.6900266",
"0.6880423",
"0.6880423",
"0.6826085",
"0.6826085",
"0.68... | 0.78313226 | 0 |
Set appointment's end time; Create new appointment and rendere result | def appointment_end_time(end_time):
session.attributes['end_time'] = str(end_time)
form = AppointmentForm(session.attributes)
form.submit()
return render_result(form) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def appointment_time(begin_time):\n\n session.attributes['begin_time'] = str(begin_time)\n msg = render_template('end_date')\n return question(msg)",
"def appointment_end_date(end_date):\n\n session.attributes['end_date'] = str(end_date)\n msg = render_template('end_time')\n return question(msg... | [
"0.7324631",
"0.707775",
"0.64345574",
"0.61964524",
"0.6116282",
"0.6012545",
"0.59737736",
"0.5958537",
"0.58682275",
"0.5739396",
"0.56900465",
"0.5664058",
"0.5664058",
"0.5635635",
"0.5621515",
"0.5621515",
"0.5621515",
"0.56020176",
"0.5596119",
"0.5588781",
"0.5569192"... | 0.75025403 | 0 |
Significant duration model by Abrahamson and Silva (1996) Empirical ground motion models, report prepared for Brookhaven National Laboratory. Input | def abrahamson_silva_ds_1999(magnitude=7.0,distance=10.0,soil=True,duration_type='DS575H'):
# map the duration_type to integer key
dur_map = {'DS575H': 0,
'DS575V': 1,
'DS595H': 2,
'DS595V': 3}
dur_tag = dur_map.get(duration_type.upper(),None)
if dur_tag is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bommer_stafford_alarcon_ds_2009(magnitude=7.0, distance=10.0, vs30=760.0, ztor=0.0, duration_type='DS575H'):\n\n # duration type map\n dur_map = {'DS575H':0, 'DS595H': 1}\n dur_tag = dur_map.get(duration_type.upper(), None)\n if dur_tag is None:\n print(\"SignificantDurationModel.bommer_staf... | [
"0.5894989",
"0.5636878",
"0.5595273",
"0.5590827",
"0.5589143",
"0.55404943",
"0.5539545",
"0.55124915",
"0.5504166",
"0.5484351",
"0.5466944",
"0.5432563",
"0.5431083",
"0.5426489",
"0.54122007",
"0.5407446",
"0.54009956",
"0.53980666",
"0.5388078",
"0.53808546",
"0.5372438... | 0.6149179 | 0 |
Make n bars dataframe seeing past n bars. The row size of `df` must be greater than or equal to `n_bars`, or raise ValueError. | def make_nbars_past(df: pd.DataFrame, n_bars: int, cols: List[str] = ['Close'], datetime_col: Union[str, None] = 'Date') -> pd.DataFrame:
if df.shape[0] < n_bars + 1:
raise ValueError(
f'row size of the df (={df.shape[0]}) must be greater than or equal to n_bars + 1 (={n_bars + 1})')
df = df... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_nbars_future(df: pd.DataFrame, n_bars: int, cols: List[str] = ['Close'], datetime_col: Union[str, None] = 'Date') -> pd.DataFrame:\n if df.shape[0] < n_bars + 1:\n raise ValueError(\n f'row size of the df (={df.shape[0]}) must be greater than or equal to n_bars + 1 (={n_bars + 1})')\n... | [
"0.5731061",
"0.5586702",
"0.5446808",
"0.53735137",
"0.53575814",
"0.53006095",
"0.5197947",
"0.5093131",
"0.5072677",
"0.50318915",
"0.49762776",
"0.49578872",
"0.49176425",
"0.49153638",
"0.48178166",
"0.4813536",
"0.47499412",
"0.47253093",
"0.46960294",
"0.46573168",
"0.... | 0.65518504 | 0 |
Make n bars dataframe seeing future n bars. The row size of `df` must be greater than or equal to `n_bars`, or raise ValueError. | def make_nbars_future(df: pd.DataFrame, n_bars: int, cols: List[str] = ['Close'], datetime_col: Union[str, None] = 'Date') -> pd.DataFrame:
if df.shape[0] < n_bars + 1:
raise ValueError(
f'row size of the df (={df.shape[0]}) must be greater than or equal to n_bars + 1 (={n_bars + 1})')
df = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_nbars_past(df: pd.DataFrame, n_bars: int, cols: List[str] = ['Close'], datetime_col: Union[str, None] = 'Date') -> pd.DataFrame:\n if df.shape[0] < n_bars + 1:\n raise ValueError(\n f'row size of the df (={df.shape[0]}) must be greater than or equal to n_bars + 1 (={n_bars + 1})')\n ... | [
"0.6623224",
"0.5880733",
"0.56581855",
"0.5601714",
"0.5332026",
"0.52718735",
"0.52266806",
"0.5171003",
"0.51566476",
"0.5070246",
"0.5067792",
"0.4987947",
"0.4968835",
"0.49510282",
"0.49025717",
"0.48347977",
"0.47774142",
"0.4759826",
"0.46863613",
"0.4677156",
"0.4670... | 0.61674595 | 1 |
Usage When you call the DescribeDBInstanceEncryptionKey operation, the instance must have transparent data encryption (TDE) enabled in BYOK mode. You can call the [ModifyDBInstanceTDE](~~131267~~) operation to enable TDE. | def describe_dbinstance_encryption_key_with_options(
self,
request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:
UtilClient.validate_model(request)
query = {}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def describe_dbinstance_encryption_key(\n self,\n request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,\n ) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:\n runtime = util_models.RuntimeOptions()\n return self.describe_dbinstance_encryption_key_with_op... | [
"0.673887",
"0.6716472",
"0.65085775",
"0.6401395",
"0.6124461",
"0.6019866",
"0.5743563",
"0.5593969",
"0.5453083",
"0.53697926",
"0.50822043",
"0.5020621",
"0.50204563",
"0.50042874",
"0.4984543",
"0.49620974",
"0.49530983",
"0.48969638",
"0.4866419",
"0.4756271",
"0.472960... | 0.6771073 | 0 |
Usage When you call the DescribeDBInstanceEncryptionKey operation, the instance must have transparent data encryption (TDE) enabled in BYOK mode. You can call the [ModifyDBInstanceTDE](~~131267~~) operation to enable TDE. | def describe_dbinstance_encryption_key(
self,
request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,
) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:
runtime = util_models.RuntimeOptions()
return self.describe_dbinstance_encryption_key_with_options(requ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def describe_dbinstance_encryption_key_with_options(\n self,\n request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,\n runtime: util_models.RuntimeOptions,\n ) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:\n UtilClient.validate_model(request)\n ... | [
"0.6771073",
"0.6716472",
"0.65085775",
"0.6401395",
"0.6124461",
"0.6019866",
"0.5743563",
"0.5593969",
"0.5453083",
"0.53697926",
"0.50822043",
"0.5020621",
"0.50204563",
"0.50042874",
"0.4984543",
"0.49620974",
"0.49530983",
"0.48969638",
"0.4866419",
"0.4756271",
"0.47296... | 0.673887 | 1 |
You can use the custom key obtained by calling the DescribeUserEncryptionKeyList operation to enable TDE. For more information, see [ModifyDBInstanceTDE](~~131267~~). | def describe_user_encryption_key_list_with_options(
self,
request: dds_20151201_models.DescribeUserEncryptionKeyListRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.DescribeUserEncryptionKeyListResponse:
UtilClient.validate_model(request)
query = {}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modify_dbinstance_tdewith_options(\n self,\n request: dds_20151201_models.ModifyDBInstanceTDERequest,\n runtime: util_models.RuntimeOptions,\n ) -> dds_20151201_models.ModifyDBInstanceTDEResponse:\n UtilClient.validate_model(request)\n query = {}\n if not UtilClient... | [
"0.6331765",
"0.5759311",
"0.56402856",
"0.55784595",
"0.55656636",
"0.5502756",
"0.54750466",
"0.5373099",
"0.5144797",
"0.5122141",
"0.5041896",
"0.5034966",
"0.49652913",
"0.49571082",
"0.49031255",
"0.48929504",
"0.47773162",
"0.47277826",
"0.47213864",
"0.46845135",
"0.4... | 0.57961434 | 1 |
This operation is available only for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances. If you have applied for a public endpoint for the ApsaraDB for MongoDB instance, you must call the [ReleasePublicNetworkAddress](~~67604~~) operation to release the public endpoint before you call t... | def migrate_available_zone_with_options(
self,
request: dds_20151201_models.MigrateAvailableZoneRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.MigrateAvailableZoneResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def migrate_available_zone(\n self,\n request: dds_20151201_models.MigrateAvailableZoneRequest,\n ) -> dds_20151201_models.MigrateAvailableZoneResponse:\n runtime = util_models.RuntimeOptions()\n return self.migrate_available_zone_with_options(request, runtime)",
"def test_migrate_... | [
"0.52417934",
"0.50473094",
"0.5008553",
"0.49998647",
"0.48307848",
"0.47682485",
"0.47216007",
"0.4666874",
"0.46228546",
"0.45956224",
"0.4590136",
"0.45401716",
"0.45268676",
"0.4509593",
"0.45067737",
"0.4491239",
"0.44909394",
"0.4489098",
"0.44764355",
"0.44562212",
"0... | 0.5335884 | 0 |
This operation is available only for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances. If you have applied for a public endpoint for the ApsaraDB for MongoDB instance, you must call the [ReleasePublicNetworkAddress](~~67604~~) operation to release the public endpoint before you call t... | def migrate_available_zone(
self,
request: dds_20151201_models.MigrateAvailableZoneRequest,
) -> dds_20151201_models.MigrateAvailableZoneResponse:
runtime = util_models.RuntimeOptions()
return self.migrate_available_zone_with_options(request, runtime) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def migrate_available_zone_with_options(\n self,\n request: dds_20151201_models.MigrateAvailableZoneRequest,\n runtime: util_models.RuntimeOptions,\n ) -> dds_20151201_models.MigrateAvailableZoneResponse:\n UtilClient.validate_model(request)\n query = {}\n if not UtilCl... | [
"0.5335884",
"0.50473094",
"0.5008553",
"0.49998647",
"0.48307848",
"0.47682485",
"0.47216007",
"0.4666874",
"0.46228546",
"0.45956224",
"0.4590136",
"0.45401716",
"0.45268676",
"0.4509593",
"0.45067737",
"0.4491239",
"0.44909394",
"0.4489098",
"0.44764355",
"0.44562212",
"0.... | 0.52417934 | 1 |
Precautions The instance must be in the Running state when you call this operation. If you call this operation to modify specific instance parameters and the modification for part of the parameters can take effect only after an instance restart, the instance is automatically restarted after this operation is called. Yo... | def modify_parameters_with_options(
self,
request: dds_20151201_models.ModifyParametersRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.ModifyParametersResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.cha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def runtime_updatable_params(self) -> pulumi.Output['outputs.RuntimeUpdatableParamsResponse']:\n return pulumi.get(self, \"runtime_updatable_params\")",
"def set_parameters(self,params):\n K3Supervisor.set_parameters(self,params)\n self.gtg.set_parameters(self.parameters)\n self.avoid... | [
"0.52970576",
"0.5158294",
"0.5146255",
"0.51394826",
"0.5136844",
"0.5133746",
"0.51167595",
"0.5108743",
"0.5072519",
"0.5060148",
"0.5052976",
"0.4969164",
"0.4969164",
"0.4955536",
"0.49382296",
"0.4936451",
"0.4931274",
"0.4930858",
"0.4930858",
"0.4930858",
"0.4930858",... | 0.53479296 | 0 |
This operation can be used to release the internal endpoint of a shard or Configserver node in a sharded cluster instance. For more information, see [Release the endpoint of a shard or Configserver node](~~134067~~). To release the public endpoint of a shard or Configserver node in a sharded cluster instance, you can c... | def release_node_private_network_address(
self,
request: dds_20151201_models.ReleaseNodePrivateNetworkAddressRequest,
) -> dds_20151201_models.ReleaseNodePrivateNetworkAddressResponse:
runtime = util_models.RuntimeOptions()
return self.release_node_private_network_address_with_option... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release_address(self, public_ip=None, allocation_id=None):\r\n params = {}\r\n\r\n if public_ip is not None:\r\n params['PublicIp'] = public_ip\r\n elif allocation_id is not None:\r\n params['AllocationId'] = allocation_id\r\n\r\n return self.get_status('Releas... | [
"0.5712464",
"0.5554131",
"0.54412097",
"0.524051",
"0.52084637",
"0.5085088",
"0.50104165",
"0.49779233",
"0.49513933",
"0.49257186",
"0.4916261",
"0.48996267",
"0.48951858",
"0.48708498",
"0.48667976",
"0.48482025",
"0.47911367",
"0.47712603",
"0.47670642",
"0.4749826",
"0.... | 0.5607081 | 1 |
The instance must be in the running state when you call this operation. > The available database versions depend on the storage engine used by the instance. For more information, see [Upgrades of MongoDB major versions](~~398673~~). You can also call the [DescribeAvailableEngineVersion](~~141355~~) operation to query t... | def upgrade_dbinstance_engine_version(
self,
request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceEngineVersionResponse:
runtime = util_models.RuntimeOptions()
return self.upgrade_dbinstance_engine_version_with_options(request,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def database_version(self) -> Optional[pulumi.Input['InstanceDatabaseVersion']]:\n return pulumi.get(self, \"database_version\")",
"def db_version(engine):\n return IMPL.db_version(engine)",
"def db_version():\n return IMPL.db_version()",
"def mmo_mongo_version(self, mmo_connection):\n re... | [
"0.60887057",
"0.57711166",
"0.56431997",
"0.55289644",
"0.5520775",
"0.54857856",
"0.5430625",
"0.5372646",
"0.5360392",
"0.52892214",
"0.5286582",
"0.5278977",
"0.52780265",
"0.52661526",
"0.5259783",
"0.5211577",
"0.51565385",
"0.514894",
"0.5146001",
"0.5137969",
"0.51183... | 0.58272535 | 1 |
When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state. > The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances. > The instance will be restarted once during the upgrade. Call this operation... | def upgrade_dbinstance_kernel_version(
self,
request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:
runtime = util_models.RuntimeOptions()
return self.upgrade_dbinstance_kernel_version_with_options(request,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def upgrade_dbinstance_kernel_version_async(\n self,\n request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:\n runtime = util_models.RuntimeOptions()\n return await self.upgrade_dbinstance_kernel_v... | [
"0.713365",
"0.7097949",
"0.65763366",
"0.6048078",
"0.56803346",
"0.5636641",
"0.55429274",
"0.5415511",
"0.53714454",
"0.5316516",
"0.5281482",
"0.52180755",
"0.5102098",
"0.50040174",
"0.499213",
"0.49542388",
"0.49341667",
"0.48674172",
"0.4845689",
"0.4839142",
"0.482721... | 0.79366666 | 0 |
When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state. > The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances. > The instance will be restarted once during the upgrade. Call this operation... | async def upgrade_dbinstance_kernel_version_async(
self,
request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:
runtime = util_models.RuntimeOptions()
return await self.upgrade_dbinstance_kernel_version_wit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upgrade_dbinstance_kernel_version(\n self,\n request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:\n runtime = util_models.RuntimeOptions()\n return self.upgrade_dbinstance_kernel_version_with_option... | [
"0.7936817",
"0.70986426",
"0.6577163",
"0.60453767",
"0.56828487",
"0.5638934",
"0.55407673",
"0.54129595",
"0.53686017",
"0.5318697",
"0.5280949",
"0.5216302",
"0.5101547",
"0.5003827",
"0.49964812",
"0.49521586",
"0.4936471",
"0.48645243",
"0.48442766",
"0.48389387",
"0.48... | 0.71337795 | 1 |
Use features and result to train Support Vector Machine | def train(features, result):
clf = grid_search(result)
clf.fit(features, result)
return clf | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trainModel( self, featureTrain, classTrain):",
"def trainNewModel():\n print \"Creating feature vectors for trainset...\"\n trainDependencies = getDependency(trainDepFilename)\n trainLabel, trainFeatureVectors = \\\n createFeatureVectors(trainFilename, trainDependencies)\n print \"Length o... | [
"0.7079623",
"0.6985331",
"0.6951296",
"0.68263084",
"0.67677474",
"0.6763887",
"0.67388266",
"0.66454804",
"0.66344404",
"0.6605667",
"0.6589454",
"0.65607995",
"0.6531744",
"0.6518474",
"0.6516882",
"0.64959514",
"0.6491756",
"0.64540136",
"0.64505",
"0.64383566",
"0.643159... | 0.700062 | 1 |
When a user asks for a potential_category, rank the possible categories by relevance and return the top match | def find_match(potential_category: str, categories: List[str]):
return process.extractOne(potential_category, categories)[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FoodRank(search_term):\n return _ranks[search_term.lower()]",
"def test_category(self):\n # XXX identifiers would be groovy\n self.check_search(\n dict(category=u'36:self'), # trap\n [u'Ingrain'],\n 'simple category search, vs self',\n exact=True,\n... | [
"0.5779498",
"0.5776032",
"0.57445335",
"0.5656867",
"0.56513745",
"0.5642086",
"0.5516284",
"0.5513393",
"0.5420318",
"0.54119575",
"0.53935814",
"0.5359446",
"0.532522",
"0.5297809",
"0.5292416",
"0.5278605",
"0.52570313",
"0.5227728",
"0.52234787",
"0.52224135",
"0.5209769... | 0.66086555 | 0 |
Gets the is_bot of this UserBase. A boolean specifying whether the user is a bot or full account. | def is_bot(self):
return self._is_bot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bot(self) -> bool:\n if self._bot is not None:\n return hasattr(self, 'ubot')\n return bool(Config.BOT_TOKEN)",
"def is_bot(self) -> undefined.UndefinedOr[bool]:",
"def bot_type(self):\n return self._bot_type",
"def is_bot(self) -> bool:",
"def bot(self):\n ret... | [
"0.774403",
"0.6506757",
"0.6466639",
"0.63527393",
"0.6351612",
"0.59704244",
"0.5953491",
"0.5796303",
"0.5599795",
"0.55755657",
"0.55704886",
"0.5508024",
"0.5390804",
"0.5384107",
"0.5262253",
"0.52469635",
"0.52303284",
"0.522477",
"0.5224286",
"0.5201915",
"0.5175014",... | 0.7682634 | 1 |
Sets the is_bot of this UserBase. A boolean specifying whether the user is a bot or full account. | def is_bot(self, is_bot):
self._is_bot = is_bot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bot(self):\n return self._is_bot",
"def is_bot(self) -> bool:\n if self._bot is not None:\n return hasattr(self, 'ubot')\n return bool(Config.BOT_TOKEN)",
"def bot_type(self, bot_type):\n\n self._bot_type = bot_type",
"def set_is_ai(self, is_ai):\n self.__... | [
"0.6343722",
"0.6289822",
"0.58650166",
"0.57027304",
"0.544486",
"0.5285852",
"0.51772743",
"0.5169832",
"0.50523525",
"0.5034742",
"0.5024811",
"0.50076777",
"0.48692012",
"0.48260602",
"0.48116446",
"0.4810998",
"0.48001114",
"0.4750782",
"0.47010517",
"0.46964487",
"0.468... | 0.7644477 | 0 |
Gets the avatar_url of this UserBase. | def avatar_url(self):
return self._avatar_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_url(self) -> typing.Optional[files.URL]:\n return self.make_avatar_url()",
"def avatar_url(self):\n if self.avatar and hasattr(self.avatar, 'url'):\n return self.avatar.url\n else:\n return '/static/defaults/!default_user_avatar/user.gif'",
"def avatar_url(... | [
"0.83125377",
"0.80434006",
"0.79306704",
"0.7921607",
"0.7852214",
"0.7280996",
"0.7254777",
"0.7066657",
"0.6957944",
"0.69364053",
"0.6856294",
"0.6781074",
"0.6680307",
"0.6594353",
"0.6536579",
"0.6501867",
"0.634738",
"0.6297715",
"0.6278013",
"0.6261349",
"0.625929",
... | 0.8626505 | 0 |
Sets the avatar_url of this UserBase. | def avatar_url(self, avatar_url):
self._avatar_url = avatar_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_url(self):\n if self.avatar and hasattr(self.avatar, 'url'):\n return self.avatar.url\n else:\n return '/static/defaults/!default_user_avatar/user.gif'",
"def avatar_url(self):\n return self._avatar_url",
"def avatar_url(self) -> typing.Optional[files.URL]:... | [
"0.7171562",
"0.7052809",
"0.6945081",
"0.65909845",
"0.65333134",
"0.64174134",
"0.63824266",
"0.6325658",
"0.6313757",
"0.62597895",
"0.62147564",
"0.6207663",
"0.61743844",
"0.6130403",
"0.5995444",
"0.59891415",
"0.59879833",
"0.5912891",
"0.5886393",
"0.5850929",
"0.5847... | 0.83707076 | 0 |
Gets the avatar_version of this UserBase. Version for the user's avatar. Used for cachebusting requests for the user's avatar. Clients generally shouldn't need to use this; most avatar URLs sent by Zulip will already end with `?v={avatar_version}`. | def avatar_version(self):
return self._avatar_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_version(self, avatar_version):\n\n self._avatar_version = avatar_version",
"def GetAvatar(self):\n\n return self.__GetJsonOrNone(\"/users/\"+self.userName+\"/avatar\", False)",
"def avatar_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"avatar_url\")",
"def avatar... | [
"0.6582307",
"0.6567599",
"0.627431",
"0.62414306",
"0.6070075",
"0.60053706",
"0.5953287",
"0.5907676",
"0.59010553",
"0.5892529",
"0.58835626",
"0.58578086",
"0.58211213",
"0.55421185",
"0.5502481",
"0.54706377",
"0.5448654",
"0.5431678",
"0.540974",
"0.53088725",
"0.527344... | 0.80662423 | 0 |
Sets the avatar_version of this UserBase. Version for the user's avatar. Used for cachebusting requests for the user's avatar. Clients generally shouldn't need to use this; most avatar URLs sent by Zulip will already end with `?v={avatar_version}`. | def avatar_version(self, avatar_version):
self._avatar_version = avatar_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avatar_version(self):\n return self._avatar_version",
"def avatar_url(self, avatar_url):\n\n self._avatar_url = avatar_url",
"def update_avatar(self, url):\n if self.avatar:\n logging.info(f'{self} already has an avatar: {self.avatar}')\n # TODO: check if image ha... | [
"0.6936227",
"0.649719",
"0.59142345",
"0.5799783",
"0.57989764",
"0.5582525",
"0.54501593",
"0.5385766",
"0.5370928",
"0.5284951",
"0.5270443",
"0.5203477",
"0.5187659",
"0.51164407",
"0.5090491",
"0.50683516",
"0.5042792",
"0.503107",
"0.50070167",
"0.498359",
"0.49506572",... | 0.8566245 | 0 |
Gets the is_admin of this UserBase. A boolean specifying whether the user is an organization administrator. | def is_admin(self):
return self._is_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_admin(self):\n return self.admin",
"def is_admin(self) -> bool:\n return self._is_admin",
"def is_admin(self):\r\n return self.admin",
"def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n return True\n return False"... | [
"0.7881886",
"0.77665955",
"0.77486885",
"0.7689977",
"0.7461093",
"0.73404866",
"0.7156036",
"0.71471244",
"0.71004605",
"0.7084834",
"0.7068",
"0.7034636",
"0.70345366",
"0.6991166",
"0.69782645",
"0.6957708",
"0.6923771",
"0.6915408",
"0.6905435",
"0.6894784",
"0.6880022",... | 0.7862511 | 1 |
Sets the is_admin of this UserBase. A boolean specifying whether the user is an organization administrator. | def is_admin(self, is_admin):
self._is_admin = is_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n self._is_admin = is_admin",
"def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n ... | [
"0.83135295",
"0.66889644",
"0.6337106",
"0.626878",
"0.62481576",
"0.62481576",
"0.62017304",
"0.6183351",
"0.6072974",
"0.60349",
"0.601608",
"0.59858966",
"0.59276825",
"0.58737713",
"0.58411723",
"0.5830839",
"0.5752557",
"0.5735811",
"0.5708521",
"0.57063186",
"0.5701734... | 0.8068177 | 1 |
Gets the is_owner of this UserBase. | def is_owner(self):
return self._is_owner | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_user_is_owner(self):\n return self._tag == 'user_is_owner'",
"def get_owner_object(self):\n return False",
"def isowner(self, o):\n return self._owner is o",
"def get_owner(self):\n return self.__owner",
"def owner(self) -> discord.User:\n if self.config.owner_id:\... | [
"0.7645217",
"0.7104894",
"0.6914149",
"0.6853681",
"0.67683494",
"0.6743861",
"0.66868156",
"0.65692985",
"0.6566306",
"0.6566306",
"0.6566118",
"0.6552337",
"0.65283376",
"0.6492521",
"0.64828247",
"0.6478465",
"0.64477557",
"0.6443881",
"0.64351815",
"0.6400954",
"0.632009... | 0.79326665 | 0 |
Sets the is_owner of this UserBase. | def is_owner(self, is_owner):
self._is_owner = is_owner | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_owner(self, owner):\n self.__owner = owner",
"def set_owner(self, owner):\n self.settings[\"owner\"] = owner",
"def is_user_is_owner(self):\n return self._tag == 'user_is_owner'",
"def set_owner(self, owner, is_stream=False):\n if is_stream:\n self._logger.debug... | [
"0.6996318",
"0.69127315",
"0.6491776",
"0.64011246",
"0.63992107",
"0.63773704",
"0.636248",
"0.63547474",
"0.63318616",
"0.6193567",
"0.6193567",
"0.6193567",
"0.6193567",
"0.6184652",
"0.61401767",
"0.61401767",
"0.61401767",
"0.61401767",
"0.6025569",
"0.59794116",
"0.597... | 0.8064309 | 0 |
Gets the is_billing_admin of this UserBase. | def is_billing_admin(self):
return self._is_billing_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_billing_admin(self, is_billing_admin):\n\n self._is_billing_admin = is_billing_admin",
"def is_admin(self):\n return self.admin",
"def is_admin(self):\r\n return self.admin",
"def is_admin(self):\n if self.user is None:\n return False\n if unicode(self.use... | [
"0.75745505",
"0.6962725",
"0.6885912",
"0.6775686",
"0.67065483",
"0.6678298",
"0.6678298",
"0.66013443",
"0.6554211",
"0.6432071",
"0.6286309",
"0.6203971",
"0.61566216",
"0.6140026",
"0.61183566",
"0.60726625",
"0.6026393",
"0.6017969",
"0.59559476",
"0.59489256",
"0.59279... | 0.8872368 | 0 |
Sets the is_billing_admin of this UserBase. | def is_billing_admin(self, is_billing_admin):
self._is_billing_admin = is_billing_admin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_billing_admin(self):\n return self._is_billing_admin",
"def is_admin(self, is_admin):\n\n self._is_admin = is_admin",
"def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n ... | [
"0.737039",
"0.6722866",
"0.6429481",
"0.59705704",
"0.5679304",
"0.5440798",
"0.5371101",
"0.52895933",
"0.52759075",
"0.52700037",
"0.52601206",
"0.5256608",
"0.5244197",
"0.5224175",
"0.517771",
"0.51590234",
"0.5110502",
"0.50515014",
"0.503452",
"0.503452",
"0.50335866",... | 0.8755264 | 0 |
Gets the bot_type of this UserBase. | def bot_type(self):
return self._bot_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chat_type(self) -> str:\n return self.user.chat_type.name",
"def lobby_type(self):\n return self._get(\"lobby_type\")",
"def get_type(self) -> str:\n return Tables.USER.name",
"def user_type(self):\n if \"userType\" in self._prop_dict:\n return self._prop_dict[\"use... | [
"0.64627266",
"0.6358613",
"0.614378",
"0.6125625",
"0.6125625",
"0.59903854",
"0.59903854",
"0.5968016",
"0.5968016",
"0.59540266",
"0.5942109",
"0.58541214",
"0.585159",
"0.58268684",
"0.58268684",
"0.58098865",
"0.57802206",
"0.5750634",
"0.5730113",
"0.56939965",
"0.56846... | 0.83526576 | 0 |
Sets the bot_type of this UserBase. | def bot_type(self, bot_type):
self._bot_type = bot_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bot_type(self):\n return self._bot_type",
"def set_type(self, rtype=ALL_USERS):\r\n self.type = rtype",
"def set_type(self, type):\n self.type = type",
"def set_type(self, type):\n self.type = type",
"def is_bot(self, is_bot):\n\n self._is_bot = is_bot",
"def set_ty... | [
"0.6873118",
"0.60826707",
"0.5980632",
"0.5980632",
"0.5958783",
"0.59285235",
"0.58882517",
"0.56953204",
"0.56326497",
"0.5610567",
"0.55728096",
"0.5503789",
"0.5461631",
"0.54612577",
"0.5455133",
"0.5455133",
"0.5455133",
"0.5455133",
"0.5442875",
"0.5397702",
"0.539770... | 0.8411738 | 0 |
Gets the bot_owner_id of this UserBase. | def bot_owner_id(self):
return self._bot_owner_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def owner(self) -> None:\n return self.bot.get_user(self.bot.config.owner_ids[0])",
"def owner_id(self) -> int:\n return self.proto.owner",
"def owner_id(self):\n return self._owner_id",
"def owner_id(self) -> str:\n return self.__owner_id",
"def owner_id(self) -> str:\n ... | [
"0.74863726",
"0.7462389",
"0.7429973",
"0.73903984",
"0.7214011",
"0.7123705",
"0.70963526",
"0.7041297",
"0.6885209",
"0.6862868",
"0.68442214",
"0.6656169",
"0.66238314",
"0.65125304",
"0.65125304",
"0.6489912",
"0.6465008",
"0.639576",
"0.636058",
"0.63590413",
"0.6319276... | 0.86790913 | 0 |
Sets the bot_owner_id of this UserBase. | def bot_owner_id(self, bot_owner_id):
self._bot_owner_id = bot_owner_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def owner_id(self, owner_id):\n\n self._owner_id = owner_id",
"def owner_id(self, owner_id):\n self._owner_id = owner_id",
"def bot_owner_id(self):\n return self._bot_owner_id",
"def set_owner(self, owner):\n self.__owner = owner",
"def owner_id(self, owner_id):\n if owne... | [
"0.73704034",
"0.733693",
"0.71219534",
"0.69730103",
"0.6940321",
"0.6678052",
"0.64090276",
"0.62162405",
"0.62162405",
"0.62162405",
"0.62162405",
"0.6192035",
"0.6192035",
"0.6192035",
"0.6192035",
"0.60748756",
"0.6034818",
"0.59885144",
"0.5901746",
"0.58401716",
"0.578... | 0.8572632 | 0 |
Gets the is_guest of this UserBase. A boolean specifying whether the user is a guest user. | def is_guest(self):
return self._is_guest | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guest(self):\n return self._guest",
"def is_guest(self, is_guest):\n\n self._is_guest = is_guest",
"def get_guest_user():\n\n guest = User.query.filter_by(username=\"guest\").first()\n\n if guest == None:\n guest = User(username=\"guest\",\n pas... | [
"0.67751104",
"0.652903",
"0.6333875",
"0.5840743",
"0.5831468",
"0.57090145",
"0.54347944",
"0.53395015",
"0.5297339",
"0.52234644",
"0.5145995",
"0.514241",
"0.5127566",
"0.5127566",
"0.50955236",
"0.50857407",
"0.5083316",
"0.5064882",
"0.5058896",
"0.5041641",
"0.50172037... | 0.78533375 | 0 |
Sets the is_guest of this UserBase. A boolean specifying whether the user is a guest user. | def is_guest(self, is_guest):
self._is_guest = is_guest | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guest(self, guest):\n if guest is None:\n raise ValueError(\"Invalid value for `guest`, must not be `None`\")\n\n self._guest = guest",
"def is_guest(self):\n return self._is_guest",
"def is_admin(self, is_admin):\n\n self._is_admin = is_admin",
"def is_admin(self, ... | [
"0.63713956",
"0.63543206",
"0.5549084",
"0.52629703",
"0.50986946",
"0.48912513",
"0.47999674",
"0.47975162",
"0.474734",
"0.4700092",
"0.46394247",
"0.46394247",
"0.4637681",
"0.46297148",
"0.45938712",
"0.4591176",
"0.45438093",
"0.4535325",
"0.45209828",
"0.45110002",
"0.... | 0.82178175 | 0 |
Gets the date_joined of this UserBase. The time the user account was created. | def date_joined(self):
return self._date_joined | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_account_created_date(self):\n return self.account_created_date",
"def getJoiningTime(self):\n return self.__joinTime",
"def created_at(self):\n created_at = self.joined_at\n if created_at is None:\n created_at = DISCORD_EPOCH_START\n \n return create... | [
"0.62656933",
"0.6219153",
"0.59980553",
"0.59758735",
"0.5934436",
"0.587002",
"0.57954764",
"0.5775895",
"0.5775895",
"0.5775895",
"0.57507694",
"0.57064766",
"0.57064766",
"0.56547153",
"0.56547153",
"0.56422794",
"0.5618498",
"0.5597825",
"0.55175257",
"0.550172",
"0.5483... | 0.7982348 | 0 |
Sets the date_joined of this UserBase. The time the user account was created. | def date_joined(self, date_joined):
self._date_joined = date_joined | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date_joined(self):\n return self._date_joined",
"def test_user_creation_old_date_joined(self):\n new_user = self.registration_profile.objects.create_inactive_user(\n site=Site.objects.get_current(), **self.user_info)\n self.assertEqual(new_user.get_username(), 'alice')\n ... | [
"0.66438895",
"0.581493",
"0.56453663",
"0.51747286",
"0.5124787",
"0.5048352",
"0.49426377",
"0.49251464",
"0.49251464",
"0.49176228",
"0.49075496",
"0.49066377",
"0.49043387",
"0.48563272",
"0.48563272",
"0.48563272",
"0.48529363",
"0.48464775",
"0.48464775",
"0.48464775",
... | 0.7769368 | 0 |
Gets the delivery_email of this UserBase. The user's real email address. This field is present only if [email address visibility](/help/restrictvisibilityofemailaddresses) is limited and you are an administrator with access to real email addresses under the configured policy. | def delivery_email(self):
return self._delivery_email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')",
"def email(self):\n billing_contact = self.owner.organization_user.user\n return billing_contact.email",
"def get_email(self):\n return self._email",
"def get... | [
"0.6896622",
"0.68197286",
"0.66776025",
"0.6648298",
"0.64765364",
"0.6463804",
"0.6460512",
"0.64135796",
"0.64135796",
"0.64135796",
"0.64135796",
"0.63343066",
"0.63343066",
"0.6321957",
"0.63091224",
"0.62989455",
"0.6274076",
"0.6220656",
"0.62095183",
"0.6136559",
"0.6... | 0.8150735 | 0 |
Sets the delivery_email of this UserBase. The user's real email address. This field is present only if [email address visibility](/help/restrictvisibilityofemailaddresses) is limited and you are an administrator with access to real email addresses under the configured policy. | def delivery_email(self, delivery_email):
self._delivery_email = delivery_email | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delivery_email(self):\n return self._delivery_email",
"def delivery(self, delivery):\n if self.local_vars_configuration.client_side_validation and delivery is None: # noqa: E501\n raise ValueError(\"Invalid value for `delivery`, must not be `None`\") # noqa: E501\n\n self._d... | [
"0.69637316",
"0.6370568",
"0.59695375",
"0.59579545",
"0.58683085",
"0.5863861",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.58421206",
"0.582248",
"0.5751209",
"0.5748383",
"0.5698401",
"0.... | 0.812475 | 0 |
Gets the profile_data of this UserBase. A dictionary containing custom profile field data for the user. Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user's data for that field. Generally the data includes just a single `value` key; for those custom profile ... | def profile_data(self):
return self._profile_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_profile_data(id):\n user = User.query.get(id)\n return user.to_dict_profile()",
"def get_object_data(self, **kwargs):\n user = self.request.user\n return UserProfile.objects.get(user=user)",
"def profile(self) -> dict:\n endpoint = \"/api/users/profile/\"\n ret = self... | [
"0.69240314",
"0.6456976",
"0.64322084",
"0.6248396",
"0.6248396",
"0.62341315",
"0.622801",
"0.6204653",
"0.6138357",
"0.611971",
"0.6103204",
"0.6066835",
"0.6032334",
"0.60309625",
"0.5982074",
"0.5944301",
"0.59439224",
"0.5938915",
"0.5907476",
"0.58976126",
"0.5869983",... | 0.6958784 | 0 |
Sets the profile_data of this UserBase. A dictionary containing custom profile field data for the user. Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user's data for that field. Generally the data includes just a single `value` key; for those custom profile ... | def profile_data(self, profile_data):
self._profile_data = profile_data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_user_data(self, user_data, user_info):\n self.user_info = AttrDict(user_info)\n self.user_data = AttrDict(user_data)\n self.score_user = self.scoresaber.get_user_data(self.user_data.id)",
"def update_user_profile(req_data):\n logger.debug(\"entering function update_user_profile\")... | [
"0.6163082",
"0.6090175",
"0.6075812",
"0.6008002",
"0.59890383",
"0.5896696",
"0.5854722",
"0.58466715",
"0.58388495",
"0.58365136",
"0.58214825",
"0.58029795",
"0.58013165",
"0.57626474",
"0.5759382",
"0.5732638",
"0.56859213",
"0.56347704",
"0.5612301",
"0.5607427",
"0.560... | 0.7260224 | 0 |
Check the northbound queue for RPC's queued by GUI or SOAP requests. A client should connect triggered by a CONNECTION_REQUEST and any RPC's queued by the northbound will be then added to the session queue by this function. | def add_nb_queue_to_session_queue(self, session):
rpc_list = []
client_id = get_element('cid', session['client'])
if client_id is not None and client_id in RPCS.Northbound_Queue:
# Check if all commands have been serviced
if RPCS.Northbound_Queue[client_id]:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_in(self):\n etree = self._encapsulate_request(self._generate_ping())\n self.zmq_scheduler_request_queue.put_nowait(etree)",
"def _check_queue(self):\n self._process_incoming_queue_messages()\n self._root.after(200, self._check_queue)",
"def request_already_queued(self, req... | [
"0.6413275",
"0.63343513",
"0.5929305",
"0.59155464",
"0.5869772",
"0.57600075",
"0.56298584",
"0.5565722",
"0.5554399",
"0.55359644",
"0.5532582",
"0.5485062",
"0.54757154",
"0.54550743",
"0.54375905",
"0.53650355",
"0.53436047",
"0.53087854",
"0.53064525",
"0.5301316",
"0.5... | 0.6457678 | 0 |
When NB requests are queued put them in the session queue. If there are RPCs in queue to be sent, return prepared RPC and move to ExpectResponse. Otherwise, go to Listening and send a 'done' RPC. | def run(self, session):
rpc = None
if session['client']['event'] == 'CONNECTION_REQUEST':
self.add_nb_queue_to_session_queue(session)
while rpc is None and session['queue']:
try:
# Loop through queue until there is an RPC to send, or until
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_nb_queue_to_session_queue(self, session):\n rpc_list = []\n client_id = get_element('cid', session['client'])\n\n if client_id is not None and client_id in RPCS.Northbound_Queue:\n # Check if all commands have been serviced\n if RPCS.Northbound_Queue[client_id]:\n... | [
"0.63733757",
"0.58320886",
"0.5644144",
"0.5606107",
"0.55666107",
"0.55509126",
"0.55193716",
"0.551203",
"0.5509601",
"0.5445808",
"0.5436328",
"0.5436328",
"0.5414003",
"0.5397534",
"0.5392256",
"0.5372994",
"0.53597814",
"0.5358608",
"0.52984124",
"0.5293183",
"0.5270412... | 0.6577181 | 0 |
This function determines the common supported protocol version. This is determined by a version supported by the RPCS server that is in the range of numbers that exist between the value of the first integer of the earliest supported protocol version and the value of the first integer of the latest supported protocol ve... | def determine_supported_protocol(self, earliest, latest):
earliest = int(earliest.split('.')[0])
latest = int(latest.split('.')[0])
if earliest <= latest:
supported = range(earliest, latest + 1)
for version in (reversed(supported)):
if version in RPCS.SUPP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare_protocol_versions(self, session):\n # First parse protocol version strings to check for invalid formatting\n invalid_string = self.parse_protocol_version(\n [self.earliest_protocol_version, self.latest_protocol_version])\n if invalid_string is not None:\n ... | [
"0.7081918",
"0.70504236",
"0.6895096",
"0.63376284",
"0.63264036",
"0.63264036",
"0.61619365",
"0.60787296",
"0.60647607",
"0.6016684",
"0.5973124",
"0.5794255",
"0.57867813",
"0.5767949",
"0.5725214",
"0.5694531",
"0.5666855",
"0.56289035",
"0.562115",
"0.5615987",
"0.56040... | 0.8174987 | 0 |
This function is responsible for parsing, validating and making all necessary comparisons between provided and supported protocol versions. | def compare_protocol_versions(self, session):
# First parse protocol version strings to check for invalid formatting
invalid_string = self.parse_protocol_version(
[self.earliest_protocol_version, self.latest_protocol_version])
if invalid_string is not None:
# Erro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _sanityCheckProtocolVersions(other):\n if other.minVersion > other.maxVersion:\n raise ValueError(\"Versions set incorrectly\")\n if other.minVersion not in KNOWN_VERSIONS:\n raise ValueError(\"minVersion set incorrectly\")\n if other.maxVersion not in KNOWN_VERSIONS:... | [
"0.7269251",
"0.6852072",
"0.68450886",
"0.6574904",
"0.645231",
"0.6396166",
"0.63311136",
"0.6159254",
"0.61516625",
"0.6143125",
"0.6079563",
"0.6043297",
"0.6020891",
"0.5971723",
"0.5925532",
"0.5903397",
"0.58636093",
"0.57814234",
"0.57633996",
"0.5755667",
"0.57490414... | 0.7876382 | 0 |
If a client_id is provided together with the inform message, Now we have enough information to get the data from the database | def handle_client_id(self, session):
if session['client']['cid'] is not None:
# A subscriber ID may only contain letters, numbers, spaces and
# the following special characters: - _ \ / ( ) # .
p = re.compile('^[A-Za-z0-9-_\\\. #/()]+$')
if p.match(session['clien... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_inform(self, session, request):\n # Verify the parameters\n params = get_element('params', request)\n # Default value for protocol_compression\n protocol_compression = 'NONE'\n response = {}\n\n if params is not None:\n try:\n # Fetch i... | [
"0.5811888",
"0.55938053",
"0.5496945",
"0.54101413",
"0.5383944",
"0.53775185",
"0.5357722",
"0.53567284",
"0.5239797",
"0.5234531",
"0.5225566",
"0.5214078",
"0.51944524",
"0.519301",
"0.518485",
"0.51753753",
"0.5170485",
"0.5164536",
"0.51571465",
"0.51501626",
"0.5137739... | 0.6117542 | 0 |
Validates received protocol compression parameter. Sets protocol compression to be used in session according to result of this validation. | def handle_protocol_compression(self, session):
if self.protocol_compression is not None:
valid = RPCS.VALID_COMPRESSION_METHODS
if self.protocol_compression not in valid:
self.protocol_compression = 'NONE'
raise ClientRequestError('InvalidParameterValue',... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate(\n self,\n is_full_msg: bool,\n msg_type: Optional[bytes],\n header_len: int,\n payload_len: Optional[int],\n input_buffer: InputBuffer\n ) -> None:\n\n if self._connection_protocol_version >= self.FIRST_VALIDATING_VERSION:\n self._validat... | [
"0.51522434",
"0.513435",
"0.5105154",
"0.50020367",
"0.4987997",
"0.49288347",
"0.48937827",
"0.48890725",
"0.48640823",
"0.48285913",
"0.48197266",
"0.47871244",
"0.47853112",
"0.47634792",
"0.4761809",
"0.47489363",
"0.47361204",
"0.47114277",
"0.4680672",
"0.46734345",
"0... | 0.73079675 | 0 |
(str) > bool Return True if correct service name | def is_service_name_correct(self, service):
return service in self.services | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_name(name, allow_services=False):",
"def istype(client, service_name: str):\n\n if is_client(client):\n return (\n client.meta.service_model.service_name.lower()\n == service_name.strip().lower()\n )\n return False",
"def definition_of_services(self):\r\n ... | [
"0.74874175",
"0.7102973",
"0.6658793",
"0.65929854",
"0.6531604",
"0.6523252",
"0.64808494",
"0.64768475",
"0.64768475",
"0.64768475",
"0.6421063",
"0.6411934",
"0.63543",
"0.63014257",
"0.62521374",
"0.6246466",
"0.61115396",
"0.60908616",
"0.60830384",
"0.60830384",
"0.606... | 0.83579403 | 0 |
(str) > bool Return True if correct class mail type | def is_class_mail_types_correct(self, class_mail_type):
return class_mail_type in self.class_mail_types | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_mail_types_correct(self, mail_type):\r\n return mail_type in self.mail_types",
"def email_type(verifield, required):\n return verifield is None or parseaddr(verifield) != ('','')",
"def __CheckType(self, t):\n t = string.upper(t)\n \"\"\" convert lower letters to upper letters \"... | [
"0.7468366",
"0.6942029",
"0.6129135",
"0.6121263",
"0.60874057",
"0.60748357",
"0.59902066",
"0.5907582",
"0.5859858",
"0.58163",
"0.5788119",
"0.57557553",
"0.5746743",
"0.57291144",
"0.5729054",
"0.5723128",
"0.5698093",
"0.56697905",
"0.56547284",
"0.55967015",
"0.5573413... | 0.7834716 | 0 |
(str) > bool Return True if correct container type | def is_container_type_correct(self, container):
return container in self.containers | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_container(item):\n if isinstance(item, str):\n return False\n elif hasattr(item, \"__iter__\"):\n return True\n\n return False",
"def is_str_or_coll(value):\n return bool(is_str(value)) or bool(is_tuple_or_list(value))",
"def is_iterable_container(value):\n # strings are ite... | [
"0.7596315",
"0.6735085",
"0.6629723",
"0.6603197",
"0.6592958",
"0.65436935",
"0.6490295",
"0.64833474",
"0.6360425",
"0.634218",
"0.6331468",
"0.633145",
"0.63053995",
"0.6277777",
"0.6248238",
"0.6234861",
"0.6221624",
"0.6171583",
"0.61659265",
"0.61386937",
"0.6130888",
... | 0.7524484 | 1 |
(class xml.etree.ElementTree.Element) > list Return dictionary with all Postage information | def get_postage_from_response(self, xml_response):
postages = xml_response.find("Package").findall("Postage")
postages_list = []
if postages:
for postage in postages:
postages_list.append(self.get_response_information(postage))
return postages_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xml_to_dict(self):\n medicine_node = ['medicines', 'dose', 'unit', 'unit_price', 'goods_num', 'dose_that',\n 'remark', 'm_usage', 'goods_norms', 'goods_orgin', 'MedPerDos', 'MedPerDay']\n dict_data = {}\n n = 0\n xq_childs = 0\n for child in self.root.... | [
"0.63759995",
"0.620662",
"0.6160831",
"0.6134572",
"0.6060549",
"0.6026878",
"0.60247046",
"0.5937487",
"0.5935178",
"0.5895591",
"0.5833998",
"0.58304346",
"0.5824379",
"0.58219045",
"0.5707903",
"0.5669245",
"0.5667443",
"0.56660455",
"0.5661833",
"0.5661833",
"0.5661279",... | 0.6353038 | 1 |
(str) > bool Return True if correct mail type | def is_mail_types_correct(self, mail_type):
return mail_type in self.mail_types | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email_type(verifield, required):\n return verifield is None or parseaddr(verifield) != ('','')",
"def is_class_mail_types_correct(self, class_mail_type):\r\n return class_mail_type in self.class_mail_types",
"def get_receive_mail_str(self):\n ret = False\n if self.__mail:\n ... | [
"0.73987883",
"0.6967432",
"0.67043835",
"0.62827927",
"0.62815034",
"0.61875695",
"0.60421157",
"0.5943893",
"0.590512",
"0.5892637",
"0.587241",
"0.5855261",
"0.5816171",
"0.5768737",
"0.56882554",
"0.56593686",
"0.56416327",
"0.56387013",
"0.5634344",
"0.55975133",
"0.5586... | 0.7832249 | 0 |
Get the event information for a Betfair market ID. | def get_event_info(self, market_id: str) -> Tuple[str, str, str]:
market_filter_ = market_filter(market_ids=[market_id])
event_type = (
self._client
.betting
.list_event_types(filter=market_filter_)[0]
.event_type
.name
)
even... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_market_info(\n self, market_id: str\n ) -> Tuple[str, datetime, Dict[int, str]]:\n market_filter_ = market_filter(market_ids=[market_id])\n\n market = (\n self._client\n .betting\n .list_market_catalogue(\n filter=market_filter_,\n... | [
"0.6362536",
"0.63047844",
"0.61040074",
"0.59841615",
"0.5915983",
"0.58161205",
"0.5800413",
"0.5745946",
"0.5725486",
"0.5675717",
"0.56645864",
"0.5656346",
"0.5621131",
"0.55494666",
"0.55292183",
"0.5473335",
"0.5443154",
"0.5440933",
"0.5433231",
"0.5430904",
"0.542923... | 0.78798735 | 0 |
Get the market information from a Betfair market ID. | def get_market_info(
self, market_id: str
) -> Tuple[str, datetime, Dict[int, str]]:
market_filter_ = market_filter(market_ids=[market_id])
market = (
self._client
.betting
.list_market_catalogue(
filter=market_filter_,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_market_info_lite(self, market_id):\n req = BFExchangeFactory.create(\"ns1:GetMarketInfoReq\")\n req.marketId = market_id\n rsp = self._soapcall(BFExchangeService.getMarketInfo, req)\n if rsp.errorCode != GetMarketErrorEnum.OK:\n error_code = rsp.errorCode\n ... | [
"0.7296463",
"0.6786435",
"0.64976203",
"0.645441",
"0.6436033",
"0.6377452",
"0.6353565",
"0.6345084",
"0.6292913",
"0.6270462",
"0.6263126",
"0.62144077",
"0.6168539",
"0.6146066",
"0.6135332",
"0.6084566",
"0.6076271",
"0.6071816",
"0.6056507",
"0.6041295",
"0.5983031",
... | 0.74244684 | 0 |
Stop a running Betfair ladder stream. | def stop_betfair_ladder_stream(self) -> None:
if self.stream is not None:
logger.info("Stopping the Betfair market stream.")
self.stream.stop()
self.stream.listener.output_queue.put("Terminate")
self.stream = None
else:
logger.info("No existing... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_stream(self):\n pass",
"def stop(self) -> None:\n self._stream.stop()",
"def stop(self):\n\t\tself.stream.stop_stream()",
"def stop(self):\n self.stream.stop()\n self.running = False",
"def stop(self) -> None:\n self._stream.stop()",
"def stop() -> None:",
"def s... | [
"0.8050214",
"0.80189526",
"0.7999657",
"0.7922578",
"0.7622994",
"0.7271031",
"0.7232619",
"0.71897453",
"0.71808064",
"0.7150011",
"0.71426904",
"0.7123477",
"0.7123477",
"0.7122764",
"0.7122764",
"0.71187675",
"0.7106935",
"0.7099712",
"0.7099712",
"0.7099712",
"0.7099712"... | 0.83448356 | 0 |
Returns class by interpreting input string as module path and class name. Module path should be separated by dots as usual. Separate class name from module by '/'. | def get_class(string):
logger = logman.getLogger(__name__)
if '/' not in string:
logger.error("The string is not properly formatted. Use '/' to separate module path from classname. String is: {}".format(string))
return
module_name, class_name = string.split('/')
try:
logger.debug... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_class(full_class_string):\r\n class_data = full_class_string.split(\".\")\r\n module_path = \".\".join(class_data[:-1])\r\n class_str = class_data[-1]\r\n module = importlib.import_module(module_path)\r\n return getattr(module, class_str)",
"def getClass(strname):\n \n modulename, c... | [
"0.7585165",
"0.7544114",
"0.7541174",
"0.7536624",
"0.75242513",
"0.74492747",
"0.7387409",
"0.7375805",
"0.73551124",
"0.7353887",
"0.7324937",
"0.72359395",
"0.72320575",
"0.72180814",
"0.71838266",
"0.71719867",
"0.7155751",
"0.7124456",
"0.711404",
"0.7071752",
"0.705921... | 0.87269014 | 0 |
FresnelReflection takes the smallest angle between the ray direction and the normal. Thus the flipped normal will also work. | def test_antinormal_reflection(self):
n1 = 1.0
n2 = 1.5
normal = (0.0, 0.0, -1.0)
angle = 0.0
ray = Ray(position=(0.0, 0.0, 0.0), direction=(0.0, 0.0, 1.0), wavelength=None)
fresnel = FresnelReflection()
assert np.isclose(fresnel.reflectivity(angle, n1, n2), 0.04)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reflect(self, ray):\n normal = self.normal(ray.position)\n if normal.dot(ray.direction) > 0:\n normal = -normal\n return Ray(\n ray.direction - 2 * dot(ray.direction, normal) * normal, ray.position)",
"def refract(self, ray, rho):\n normal = self.normal(ray.position)\n if normal.do... | [
"0.6952331",
"0.59180486",
"0.58824384",
"0.57535976",
"0.57386696",
"0.55146694",
"0.5512906",
"0.5464423",
"0.5416558",
"0.5369161",
"0.5335698",
"0.52933735",
"0.52365685",
"0.5117482",
"0.50288486",
"0.49778453",
"0.49726534",
"0.49646103",
"0.49436632",
"0.49390393",
"0.... | 0.8033125 | 0 |
Tests the API endpoint to get hashrate resale details with missing field | def test_mining_hashrate_resale_details_with_missing_field(params):
client = Client(key, secret)
client.mining_hashrate_resale_details.when.called_with(**params).should.throw(
ParameterRequiredError
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_mining_hashrate_resale_details():\n\n client = Client(key, secret)\n response = client.mining_hashrate_resale_details(123, \"user_name\")\n response.should.equal(mock_item)",
"def test_retire_rate_plan(self):\n pass",
"def test_validation_get_valid_resampling(self):\n self.asser... | [
"0.6968484",
"0.62199587",
"0.61830664",
"0.6144193",
"0.61011153",
"0.59623325",
"0.58962244",
"0.58485985",
"0.5811617",
"0.5798121",
"0.5735763",
"0.5712043",
"0.56655514",
"0.5655179",
"0.56484246",
"0.5585292",
"0.5584498",
"0.5572597",
"0.5553329",
"0.55408216",
"0.5536... | 0.7106652 | 0 |
Tests the API endpoint to get hashrate resale details | def test_mining_hashrate_resale_details():
client = Client(key, secret)
response = client.mining_hashrate_resale_details(123, "user_name")
response.should.equal(mock_item) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_retire_rate_plan(self):\n pass",
"def test_retrieve_list_resgate_to_user_authenticated(self):\n sample_resgate(user=self.user, value=500)\n sample_resgate(user=self.user, value=200)\n\n response = self.client.get(RESGATE_URL)\n\n resgates = Resgate.objects.all().order_... | [
"0.63951224",
"0.6310697",
"0.6241689",
"0.62342453",
"0.60122466",
"0.59688497",
"0.5942244",
"0.5845871",
"0.5801503",
"0.578017",
"0.5748117",
"0.5727169",
"0.57210433",
"0.5657565",
"0.56426114",
"0.56349385",
"0.5620731",
"0.56199795",
"0.5606225",
"0.5600434",
"0.559901... | 0.74108505 | 0 |
Takes a url and email, sends POST request and display body | def main():
post_url = argv[1]
params = {
'email': argv[2]
}
query_string = parse.urlencode(params)
post_data = query_string.encode("ascii")
with request.urlopen(post_url, post_data) as post_response:
response_text = post_response.read()
print(response_text.decode("UTF-8"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post(self):\n return send_email(request.args)",
"def send_mail():\n email_address = request.args.get('emailAddress') # get email address from the form\n response = call_sendmail_endpoint(session['access_token'], session['alias'], email_address)\n print(session)\n if response == 'SUCCESS':\... | [
"0.66343814",
"0.630883",
"0.6291691",
"0.62672955",
"0.62664545",
"0.6248591",
"0.62434167",
"0.61401975",
"0.6046999",
"0.5980318",
"0.5960414",
"0.5922105",
"0.5918039",
"0.5868241",
"0.5860079",
"0.5837165",
"0.5816196",
"0.58109957",
"0.5810417",
"0.57976925",
"0.5796052... | 0.71457523 | 0 |
Return stock move name by type. | def next_move(ttype):
count = db.session.query(StockMove.id).count() + 1
return str('SO/' if ttype =='sale' else 'PO/') + str(count) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def typeToName(type: int) -> unicode:\n ...",
"def get_item_name(sp, item_type, item_id):\n if item_type == 'playlist':\n name = sp.playlist(playlist_id=item_id, fields='name').get('name')\n elif item_type == 'album':\n name = sp.album(album_id=item_id).get('name')\n elif item_type ... | [
"0.6108094",
"0.59010094",
"0.5656677",
"0.555516",
"0.5488487",
"0.547423",
"0.5448434",
"0.54116297",
"0.5408066",
"0.5407569",
"0.5393827",
"0.53872436",
"0.53552365",
"0.53311074",
"0.5316032",
"0.53117967",
"0.5291321",
"0.5275399",
"0.5212203",
"0.51964265",
"0.51749265... | 0.63632435 | 0 |
Load and return the vowel training dataset. Returns (X_train, X_test, y_train, y_test) Tuple A tuple of data and target | def load_vowel():
train = _load_vowel_train()
test = _load_vowel_test()
return (train[0], train[1].reshape(-1, 1), test[0], test[1].reshape(-1, 1)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_vowel_test():\n vowel_data = np.loadtxt(_VOWEL_TEST_PATH, delimiter=',', skiprows=1)\n X = vowel_data[:, -10:]\n y = vowel_data[:, 1].astype(int)\n return (X, y)",
"def load_data():\n X = load_pickle(config['image_paths']['train_images_pickle'])\n y = load_train_labels()\n y = to_c... | [
"0.7972531",
"0.6284241",
"0.62223625",
"0.61976546",
"0.6173541",
"0.6136231",
"0.6088554",
"0.60739297",
"0.60504085",
"0.60448134",
"0.60420364",
"0.60369146",
"0.60268086",
"0.60214686",
"0.60152215",
"0.6013476",
"0.6010893",
"0.5968949",
"0.5953889",
"0.5910949",
"0.589... | 0.8670741 | 0 |
Load and return the vowel testing dataset. Returns (X, y) Tuple A tuple of data and target | def _load_vowel_test():
vowel_data = np.loadtxt(_VOWEL_TEST_PATH, delimiter=',', skiprows=1)
X = vowel_data[:, -10:]
y = vowel_data[:, 1].astype(int)
return (X, y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_vowel():\n train = _load_vowel_train()\n test = _load_vowel_test()\n return (train[0], train[1].reshape(-1, 1), test[0], test[1].reshape(-1, 1))",
"def learn_vowels(self, data=None):\n #pdb.set_trace()\n if not data:\n data = self.memory\n # find acoustic prototy... | [
"0.8300088",
"0.6068408",
"0.5904717",
"0.5585258",
"0.55028343",
"0.54649633",
"0.54600555",
"0.5418553",
"0.5395617",
"0.53787655",
"0.53458136",
"0.5342534",
"0.52974266",
"0.5277391",
"0.526091",
"0.52232075",
"0.52189106",
"0.5207462",
"0.5204022",
"0.5163287",
"0.514756... | 0.83285666 | 0 |
Load and return the breast cancer wisconsin dataset (classification). The breast cancer dataset is a classic and very easy binary classification dataset. Returns (X_train, X_test, y_train, y_test) Tuple A tuple of data and target The copy of UCI ML Breast Cancer Wisconsin (Original) dataset is | def load_breast_cancer():
bc_data_train = np.load(_BREAST_CANCER_FOLDER+'bc_data.train')
bc_data_test = np.load(_BREAST_CANCER_FOLDER+'bc_data.test')
bc_target_train = np.load(_BREAST_CANCER_FOLDER+'bc_target.train')
bc_target_test = np.load(_BREAST_CANCER_FOLDER+'bc_target.test')
for i in range(len... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_breast_cancer():\n data = load_breast_cancer_sk()\n X = pd.DataFrame(data.data, columns=data.feature_names)\n y = pd.Series(data.target)\n y = y.map(lambda x: data[\"target_names\"][x])\n\n X.ww.init()\n y = ww.init_series(y)\n return X, y",
"def load_data():\n df = pd.read_csv(\... | [
"0.7141485",
"0.69764185",
"0.6372257",
"0.6351349",
"0.6293626",
"0.60629076",
"0.5941613",
"0.59359765",
"0.5885802",
"0.5858357",
"0.58188754",
"0.57530105",
"0.5714098",
"0.5703062",
"0.56975883",
"0.5686469",
"0.5659355",
"0.5605132",
"0.560234",
"0.55977595",
"0.5596762... | 0.76880604 | 0 |
sub(Vector,Vector) subtracts second vector from first one | def sub(first, other):
if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector):
return FreeCAD.Vector(first.x-other.x, first.y-other.y, first.z-other.z) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vector_sub(v1,v2):\n return Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z)",
"def vec_sub(x, y):\r\n return [a - b for a, b in zip(x, y)]",
"def vector_subtract(v1, v2):\n return v1[0] - v2[0], v1[1] - v2[1]",
"def vector_substraction(a, b):\n return a[0] - b[0], a[1] - b[1]",
"def vec_sub (x,... | [
"0.8428072",
"0.8130589",
"0.81168246",
"0.80479693",
"0.7928738",
"0.7876339",
"0.78062",
"0.7775048",
"0.77688444",
"0.7703792",
"0.7700997",
"0.7661297",
"0.76243055",
"0.76243055",
"0.76243055",
"0.7616531",
"0.7509781",
"0.7507299",
"0.7501865",
"0.7447214",
"0.7437817",... | 0.8258668 | 1 |
Test that a valid message is sent to a valid webhook. | def test_valid_webhook(self, mock_send):
send_notification("valid_webhook", self.message)
mock_send.assert_called() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_simple_message(self):\n messaging = {\n 'sender': {'id': '1331235'},\n 'recipient': {'id': '1111111'},\n 'message': {'text': 'Hello world.'}\n }\n event = self.create_message_event(messaging)\n c = Client()\n response = c.post(self.webhoo... | [
"0.73162293",
"0.72650135",
"0.70089185",
"0.6989183",
"0.6965128",
"0.6857879",
"0.68053627",
"0.67763484",
"0.6760223",
"0.6692867",
"0.66774166",
"0.66758436",
"0.665029",
"0.66362166",
"0.66284573",
"0.65982944",
"0.65941006",
"0.6593365",
"0.65475965",
"0.6529135",
"0.65... | 0.7538486 | 0 |
Sets up biosafe and stores it as an object variable. | def setup_biosafe(self):
# Generate dummy data in the right format
species_presence = pd.DataFrame(
np.random.randint(2, size=len(self.links_law)),
columns=['speciesPresence'], index=self.links_law.index)
ecotope_area = pd.DataFrame(
np.ones(len(s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup(self):\n self.ae = None",
"def __init__(self, barcamp, handler):\n self.barcamp = barcamp\n self.handler = handler\n self.app = self.handler.app\n self.config = self.handler.app.config\n self.user = self.handler.user",
"def setup():\n global zb\n # Signal... | [
"0.56603616",
"0.5621632",
"0.55927515",
"0.5504273",
"0.53797036",
"0.5317156",
"0.5243224",
"0.52396697",
"0.52148014",
"0.5166802",
"0.51143235",
"0.51060176",
"0.50999767",
"0.50967854",
"0.50958705",
"0.50950307",
"0.50940466",
"0.5094038",
"0.50789654",
"0.5071926",
"0.... | 0.6278834 | 0 |
Calculate the total area of all ecotopes on the playing board. | def ecotope_area_sums(self, board):
# clean up the input and merge into a single dataframe
cols = ['geometry', 'z_reference', 'landuse', 'biosafe']
board_clean = board.loc[board.biosafe, cols]
board_eco = pd.merge(board_clean, self.vr_eco,
on=['z_reference',... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def area(self):\n area = 0\n\n for room in self.rooms:\n area += room.polygon.area()\n\n for wall in self.walls:\n area += wall.polygon.area()\n\n return area",
"def _area(self):\n self.area = 0.0\n for sail in self.sails:\n self.area += ... | [
"0.72191346",
"0.69285345",
"0.6818615",
"0.6791541",
"0.6719441",
"0.6589277",
"0.6585048",
"0.6579154",
"0.65724313",
"0.65674067",
"0.6542835",
"0.651549",
"0.6497927",
"0.64875937",
"0.64872205",
"0.6446514",
"0.6436132",
"0.6436132",
"0.6436132",
"0.6436132",
"0.6428201"... | 0.7589144 | 0 |
Function that calculates the biodiversity score based on the Biosafe output. the numbers 29.33 and 1.4349 follow from running MC simulations to determine the lowest and highest possible scores. The biodiversity score reflects the 0100% range between the two. | def set_score(self):
if self.PotTax_intervention is None:
if self.PotTax_reference is not None:
self.score = (((self.PotTax_reference.sum().TFI - 29.33) /
1.4349) / 100)
else:
print("There is no Biosafe output to score")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ucbScore(self,totalPlayedTimes):\n winRate = self.winRate()\n #print totalPlayedTimes\n #print self.playedTimes\n confidenceInterval = math.sqrt(2 * math.log(totalPlayedTimes,math.e) / self.playedTimes)\n \n return winRate + confidenceInterval",
"def calc_score(score... | [
"0.6018452",
"0.589307",
"0.58814985",
"0.58546895",
"0.5849375",
"0.5819225",
"0.57758874",
"0.5774465",
"0.573999",
"0.571513",
"0.56816",
"0.56671625",
"0.56617856",
"0.5648553",
"0.5645618",
"0.56252235",
"0.55905104",
"0.5585876",
"0.5570236",
"0.55351394",
"0.550514",
... | 0.5997721 | 1 |
Like `Flask.app.route` but takes only a function that returns HtmlSanitizedStr | def safe_route(app: Flask, rule, **options) -> Callable[[RouteFunction], None]:
original_decorator = app.route(rule, **options)
def decorator(fn: RouteFunction):
return original_decorator(compose(str, fn)) # type: ignore
return decorator | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strip_html(func):\n\n cleaner = re.compile(\"<.*?>\")\n def new_func(*args, strip_html=False, **kwargs):\n name = func(*args, **kwargs)\n if strip_html:\n if isinstance(name, str):\n return html.unescape(re.sub(cleaner, \"\", name))\n elif isinstance(nam... | [
"0.60575014",
"0.5710384",
"0.54833734",
"0.54531986",
"0.52721405",
"0.52415216",
"0.5219625",
"0.51628417",
"0.51594687",
"0.5052998",
"0.50139946",
"0.5011002",
"0.5004929",
"0.4984093",
"0.49426973",
"0.49259076",
"0.49226424",
"0.48769718",
"0.48679265",
"0.48450527",
"0... | 0.5955667 | 1 |
Program entry point. Loads a CSV file of observations Determines how items were exchanged during various rendezvous Prints the exchanges as they happen, if desired Prints the latest owner of a specific item, if desired. Otherwise neatly prints a dictionary mapping suspects to the item they currently own. This program w... | def main(args):
# Tuple of carried items and timeline
time_tuple = load_timeline(args.observations)
# For each Observation in list, calculated final held item
for suspectPair in time_tuple[1].rendezvous():
# If user wanted exchanges, print each exchange
if args.exchanges:
pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run():\n options = [\"Add\", \"Remove\", \"Update\", \"Oldest person\", \"Persons closest to average\"]\n common_options = [\"Name: \", \"Year: \"]\n file = \"model/hr/persons.csv\"\n title_list = [\"Id\", \"Name\", \"Year\"]\n choice = None\n dont_clear = False\n while choice != '0':\n ... | [
"0.6056687",
"0.57561624",
"0.5681713",
"0.5558769",
"0.5533532",
"0.55103606",
"0.54816645",
"0.5471882",
"0.5470575",
"0.5453268",
"0.54475284",
"0.5446846",
"0.5314073",
"0.53068393",
"0.5291783",
"0.52585655",
"0.52576137",
"0.5234658",
"0.5230194",
"0.5194857",
"0.51882"... | 0.6281538 | 0 |
Keep only notNaN column positions in all arrays. | def drop_nan_columns(arrays):
# Keep all column indices
not_nan_filter = ones(len(arrays[0]), dtype=bool)
# Currently keeping all columns!
# Keep column indices without missing value in all arrays
# for a in arrays:
# not_nan_filter &= ~isnan(a)
return [a[not_nan_filter] for a in arr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def columns_with_na_values(data):\n aux = data.isna().sum() > 0\n return aux.index[aux.values].values",
"def remove_nans(coords):\n s = np.apply_along_axis(sum,1,np.isnan(coords[1])) == 0\n coords[0] = (np.asarray(coords[0])[s]).tolist()\n coords[1] = coords[1][s,:]",
"def remove_nans(arr):\n ... | [
"0.68530303",
"0.67052513",
"0.669365",
"0.6676535",
"0.66358685",
"0.6495949",
"0.6456195",
"0.64343864",
"0.6338271",
"0.63302857",
"0.62897485",
"0.62503976",
"0.6189583",
"0.61509717",
"0.61466753",
"0.6088549",
"0.6019746",
"0.5990693",
"0.59600526",
"0.5936195",
"0.5896... | 0.7522396 | 0 |
Drop slice that contains only value from df. | def drop_uniform_slice_from_dataframe(df, value, axis=0):
if axis == 0:
dropped = (df == value).all(axis=0)
if any(dropped):
print('Removed {} column index(ices) whose values are all {}.'.
format(dropped.sum(), value))
return df.ix[:, ~dropped]
elif axis =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_values(df, value=0, axis=0):\n \n if axis:\n return df.loc[:, (df != value).any(axis=1-axis)]\n else:\n return df.loc[(df != value).any(axis=1-axis)]",
"def remove(df, pattern):\n return df[~df.index.isin(df.query(pattern).index)]",
"def drop_transafers(df):\n re... | [
"0.6749588",
"0.659988",
"0.6581077",
"0.64866114",
"0.64584786",
"0.64093405",
"0.62364835",
"0.6224",
"0.6223723",
"0.6217032",
"0.6179184",
"0.6157227",
"0.61414427",
"0.6132971",
"0.6130289",
"0.6113223",
"0.610663",
"0.60877687",
"0.60699916",
"0.6052917",
"0.6052265",
... | 0.75481135 | 0 |
Split df into n_split blocks (by row). | def split_dataframe(df, n_split, axis=0):
# TODO: implement axis logic
if df.shape[0] < n_split:
raise ValueError(
'n_split ({}) can\'t be greater than the number of rows ({}).'.
format(n_split, df.shape[0]))
elif n_split <= 0:
raise ValueError('n_split ({}) can... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_df(df, n_chunks):\n chunk_size = int(np.ceil(df.shape[0] / n_chunks))\n assert n_chunks * chunk_size >= df.shape[0]\n chunks = []\n for i in range(0, df.shape[0], chunk_size):\n chunks.append(df[i:i + chunk_size])\n assert len(chunks) == n_chunks\n return chunks",
"def split_da... | [
"0.80189484",
"0.7166912",
"0.68179005",
"0.67057437",
"0.6623575",
"0.6451587",
"0.6366774",
"0.6241725",
"0.61946136",
"0.6189358",
"0.61609524",
"0.6113555",
"0.6094658",
"0.6066726",
"0.6060644",
"0.6053875",
"0.60479224",
"0.5984508",
"0.59791416",
"0.59433573",
"0.59427... | 0.7756274 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.