query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get index of right child
def get_right_index(i): pos = i + 1 right_pos = 2 * pos + 1 right_index = right_pos - 1 return right_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_right_child_index(self):\n return (2 * self.index) + 2", "def get_right_child_index(self, parent):\n return 2*parent+2", "def right_child(self, index):\n return 2 * index + 1", "def right_child(self, index):\n return 2 * index + 2", "def right_child_idx(idx):\n return...
[ "0.8933065", "0.86470544", "0.85833573", "0.8481242", "0.83146423", "0.80509824", "0.80138457", "0.78668714", "0.78668714", "0.7804404", "0.7780275", "0.77160066", "0.77091724", "0.76771295", "0.7524542", "0.74409086", "0.740755", "0.7335976", "0.7293008", "0.72079617", "0.71...
0.7053241
25
Get value at index or np.inf if it doesn't exist
def get_value_at(self, i): return self.default_value if i > self.last_item else self.heap[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self, idx):\n item = self.items[idx]\n if item is None:\n ret = -float('inf')\n else:\n ret = self.fn(item)\n return ret", "def get_value(_list, _index):\n # print(_list, len(_list))\n if _index >= len(_list):\n return None\n return _lis...
[ "0.6983909", "0.6865913", "0.67301875", "0.66794467", "0.65117055", "0.6493914", "0.63198966", "0.63175035", "0.6283424", "0.62733126", "0.6259123", "0.6183555", "0.6179405", "0.61543536", "0.6129469", "0.6128749", "0.6111963", "0.6062199", "0.6061996", "0.6040353", "0.604035...
0.6355408
6
Return the height of the heap and the maximum number of digits for any entry in the heap
def get_max_digs(self): # Get maximum number of digits # 20200607: np.ceil --> np.floor + 1 # Consider edge case n = 9 vs n = 10 # ceil(log_10(9)) == 1, ceil(log_10(10)) == 1 # floor(log_10(9)) + 1 == 1, floor(log_10(10)) + 1 == 2 max_digs = int(np.floor(np....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(heap):\n return len(heap)", "def height(self):\n if self.children == []:\n return 1 \n else:\n arr = []\n for child in self.children:\n result = 1 + child.height()\n arr.append(result)\n return max(arr)", "def build_max_heap(heap):\n\tfor j in range(heap.len/...
[ "0.7472827", "0.7241892", "0.7016466", "0.6986129", "0.6964422", "0.6905836", "0.6845946", "0.68156487", "0.67743343", "0.6735504", "0.67184144", "0.6671894", "0.6658428", "0.6652893", "0.6619757", "0.66108006", "0.66101164", "0.65899974", "0.6552006", "0.6547167", "0.6538108...
0.6795792
8
Set value at index
def set_value_at(self, i, new_value=default_value): self.heap[i] = new_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_at_index(self, index: int, value: object) -> None:\n self.data[index] = value", "def __setitem__(self, index, value):\n self._update_value_at(index, value)", "def setvalue(self, index, value):\n self._checkIndex(index)\n self._items[index].value = value", "def __setitem__(...
[ "0.84746706", "0.8103384", "0.8065691", "0.8000954", "0.7889873", "0.7880268", "0.7860388", "0.7846067", "0.7758514", "0.77272445", "0.7670536", "0.76695335", "0.76406544", "0.7637111", "0.75609124", "0.7530689", "0.7505704", "0.7435533", "0.74202067", "0.74066633", "0.739702...
0.0
-1
Swap values at index_0 and index_1
def swap(self, index_0, index_1): value_0 = self.get_value_at(index_0) value_1 = self.get_value_at(index_1) self.set_value_at(index_0, value_1) self.set_value_at(index_1, value_0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def swap(A, index1, index2):\r\n \r\n temp = A[index1]\r\n A[index1] = A[index2]\r\n A[index2] = temp", "def swap_numbers(numbers, index1, index2):\n temp = numbers[index1]\n numbers[index1] = numbers[index2]\n numbers[index2] = temp", "def __swap(self, index_1, index_2):\n temp = s...
[ "0.8045885", "0.80415386", "0.7976427", "0.7946715", "0.77399236", "0.7737298", "0.7729477", "0.76621556", "0.7614902", "0.7564756", "0.7564756", "0.737364", "0.7371236", "0.73423225", "0.727941", "0.7278792", "0.72698545", "0.71813565", "0.716901", "0.7142264", "0.7134006", ...
0.82595736
0
use dictionary to store the difference (target nums[i]).
def twoSum(self, nums: List[int], target: int) -> List[int]: diffRec = {} for i, v in enumerate(nums): if v in diffRec: return [diffRec[v], i] else: diffRec[target - v] = i return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twoSum(self, nums: List[int], target: int) -> List[int]:\n d = {}\n for i, n in enumerate(nums):\n d[n]=i\n \n for i, n in enumerate(nums):\n m = target - n\n if m in d and d[m] != i:\n return [i,d[m...
[ "0.6771178", "0.6764401", "0.6693631", "0.65968764", "0.6315861", "0.62800086", "0.62199515", "0.62003785", "0.61241025", "0.6120513", "0.61066025", "0.5899261", "0.56001204", "0.55316275", "0.5446655", "0.5416312", "0.5380408", "0.5378301", "0.537053", "0.5293179", "0.528616...
0.6832244
0
checks if user can afford item and deducts item cost from self.resources and adds the item (or the purchases effects) to the user. returns true if purchased, returns false if not. Default usage is to use an item name from purchase.py. If a Balance object "balance" is given INSTEAD of "item", then it is used directly.
def purchase(self, item=None, balance=None): if item!= None: cost = purchases.getCost(item) if self.affords(cost): self.payFor(cost) # TODO: actually do whatever was purchased # self.applyItem(item) return True e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def userCanAffordItemObj(self, user : bbUser.bbUser, item : bbItem.bbItem) -> bool:\n return user.credits >= item.getValue()", "def can_afford(self, item_name):\n item = self.get(item_name)\n for resource in RESOURCES:\n if item.cost.get(resource, 0) > self.game.resources.get(reso...
[ "0.69444394", "0.6761436", "0.6278624", "0.62341774", "0.6051828", "0.5915107", "0.5884033", "0.5883767", "0.5861438", "0.58475995", "0.5811648", "0.5739377", "0.56401324", "0.560546", "0.5601953", "0.5595759", "0.55743337", "0.5556562", "0.5518422", "0.55150044", "0.5479447"...
0.7959187
0
Returns the dictionary should be called once the dictionary is constructed.
def get_socket_dictionary(self) -> dict: socket_dictionary = { "action": self.action, "car_id": self.car_id, "username": self.username, "password": self.password, "usertoken": self.usertoken, "info_date_time": self.info_date_time, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dict(self):\n # type: () -> dict\n self.is_valid()\n return self._get_dict()", "def dict(self) -> Dict:\r\n return super().dict()", "def dict(self) -> Dict:\r\n return super().dict()", "def get_dict(self):\n return", "def __load(self) -> Dict:\n return dict()", ...
[ "0.7532119", "0.72821766", "0.72821766", "0.7258358", "0.7140809", "0.70793706", "0.7072972", "0.7072972", "0.7009909", "0.6964286", "0.6956898", "0.6956898", "0.6944875", "0.6912645", "0.6845601", "0.6812687", "0.67669713", "0.67046356", "0.66895974", "0.6679883", "0.6679883...
0.0
-1
Returns the date reformated into python datetime format.
def get_python_date(self): return dateutil.parser.parse(self.iso_date)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modis_to_from_pydatetime(date):\n \n if isinstance(date, (str, unicode)): \n return dt.datetime.strptime(date[1:], '%Y%j').date()\n return dt.datetime.strftime(date, 'A%Y%j')", "def _to_date(self, x):\n if isinstance(x, datetime.datetime):\n return x.date()\n return x...
[ "0.71629053", "0.6894753", "0.68495804", "0.6835706", "0.68110466", "0.6798551", "0.678441", "0.6690061", "0.6632137", "0.6628195", "0.66245985", "0.66197765", "0.6619198", "0.660381", "0.6570892", "0.65689874", "0.653436", "0.6477465", "0.64709014", "0.6451577", "0.6413728",...
0.70473415
1
Renders a page for a particular compound.
def CompoundPage(request): form = compound_form.CompoundForm(request.GET) if not form.is_valid(): logging.error(form.errors) raise Http404 # Compute the delta G estimate. kegg_id = form.cleaned_compoundId compound = models.Compound.objects.get(kegg_id=kegg_id) compound.Stash...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_page():\n pages=get_accounts()\n return render_template('disp.html',pages=pages)", "def renderPage():\n return render_template(\"index.html\")", "def main_page():\n return render_template(\"main_page.html\")", "def homepage():\n\n pagesClassIDs = {\n \"index\": {\n \"b...
[ "0.59548026", "0.57890856", "0.57370317", "0.5636853", "0.55066913", "0.54987985", "0.54826313", "0.54345924", "0.542592", "0.53984725", "0.53741604", "0.537301", "0.5337757", "0.5306245", "0.5297516", "0.5291385", "0.5291248", "0.5286969", "0.5282097", "0.5271443", "0.526328...
0.7018998
0
Build protocol data from message.
def toData(self): lines = [] # 1. Request and protocol version lines.append(self.request + " " + BANNER) # 2. Request arguments lines.extend(['%s: %s' % (arg, self.args[arg]) for arg in self.args]) # 3. End of message (double CR-LF) data = "\r\n".join(lines) + "\...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_data(self, msg):\n if len(msg) < 6:\n raise ValueError(\"Data message is too short - minimum length 6 bytes, got %d bytes\" % len(msg))\n\n (x, TIME) = struct.unpack(\"<HL\", msg[0:6])\n\n if x & (2**15) != 0:\n raise ValueError(\"Expected a data message, found...
[ "0.65798396", "0.64550364", "0.6363458", "0.621391", "0.61582", "0.6149012", "0.599604", "0.59846616", "0.59781426", "0.59737766", "0.59535956", "0.5951033", "0.5927215", "0.5879687", "0.58785284", "0.5871454", "0.58702606", "0.5868797", "0.5863226", "0.58508974", "0.5833903"...
0.5936232
12
Parse and extract message from protocol data.
def fromData(self, data): self.reset() request = "" version = None args = {} # Parse raw data to construct message (strip empty lines) lines = [line.strip() for line in data.splitlines() if line.strip() != ""] # If message is empty, return false if not l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_message(self, data):\r\n if TwitchChatStream._check_has_ping(data):\r\n self._maybe_print('got ping')\r\n self._send_pong()\r\n\r\n channel_name_or_false = TwitchChatStream._check_has_channel(data)\r\n if channel_name_or_false:\r\n current_channel = ...
[ "0.75778097", "0.7159968", "0.71568024", "0.71497744", "0.71487087", "0.7114772", "0.70746684", "0.7059902", "0.6972103", "0.69445956", "0.693621", "0.69232017", "0.6908883", "0.68726164", "0.68299896", "0.68240994", "0.68166345", "0.66790384", "0.66693574", "0.66176164", "0....
0.6679768
17
Returns true if the queue is empty and false otherwise Must be O(1)
def is_empty(self) -> bool: if self.num_items == 0: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def empty(self) -> bool: \n if(self.queue is not None and len(self.queue) > 0):\n print(\"len > 0\" )\n ...
[ "0.88570523", "0.87778527", "0.87778527", "0.8776103", "0.87759084", "0.8768391", "0.86971426", "0.8675233", "0.8659355", "0.8658433", "0.8606875", "0.8600865", "0.85989565", "0.8582111", "0.8568123", "0.8497459", "0.84956324", "0.8487618", "0.8420514", "0.8420514", "0.832870...
0.0
-1
enqueues item, adding it to the rear NodeList Must be O(1)
def enqueue(self, item: Any) -> None: node = Node(item, self.rear) self.rear = node self.num_items += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enqueue(self, item):\n\t\tself.items.insert(0, item)", "def enqueue(self, node):\n self.items.append(node)", "def enqueue(self, item):\n self.items.insert(0, item)", "def enqueue(self, item):\n self.items.insert(0, item)", "def enqueue(self, item):\n old_last = self.last\n ...
[ "0.78006804", "0.7710979", "0.76479787", "0.76479787", "0.75651515", "0.75481075", "0.753136", "0.7486071", "0.7372014", "0.7372014", "0.7367847", "0.7348242", "0.72837245", "0.7240521", "0.71723264", "0.71205115", "0.7076686", "0.7066437", "0.69631815", "0.6946971", "0.68910...
0.7469452
8
dequeues item, removing first item from front NodeList If front NodeList is empty, remove items from rear NodeList and add to front NodeList until rear NodeList is empty If front NodeList and rear NodeList are both empty, raise IndexError Must be O(1) general case
def dequeue(self) -> Any: if self.rear is None and self.front is None: raise IndexError elif self.front is None: while self.rear is not None: node = Node(self.rear.value, self.front) self.front = node self.rear = self.rear.rest ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self, index):\n if index < 0 or index >= len(self):\n raise AttributeError(\"i must be >= 0 and < size of queue\")\n if index == 0:\n oldItem = self._front.data\n self._front = self._front.next\n else:\n probe = self._front\n wh...
[ "0.68911767", "0.68660563", "0.658952", "0.6525972", "0.6522565", "0.6490781", "0.648833", "0.647087", "0.644473", "0.64431846", "0.6430354", "0.64276177", "0.6422422", "0.64148337", "0.64119107", "0.63734394", "0.63578594", "0.63180566", "0.6286091", "0.6252454", "0.62177724...
0.63208413
17
Returns the number of items in the queue Must be O(1)
def size(self) -> int: return self.num_items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\r\n return len(self.queue)", "def size(self):\r\n return len(self.queue)", "def size(self):\n return len(self.queue)", "def size(self):\n return len(self.queue)", "def size(self):\n return len(self.queue)", "def size(self):\n return len(self.queue...
[ "0.800648", "0.800648", "0.7884259", "0.7884259", "0.7884259", "0.7884259", "0.7839228", "0.7830114", "0.7822343", "0.77353644", "0.75935245", "0.7576671", "0.7454184", "0.7449153", "0.73749566", "0.7319964", "0.7215429", "0.7196273", "0.7196273", "0.71886265", "0.71323776", ...
0.66311985
63
Run SugarPy on a given .mzML file based on identified peptides from an evidences.csv Translated Ursgal parameters are passed to the SugarPy main function.
def _execute(self): self.time_point(tag="execution") main = self.import_engine_as_python_function() output_file = os.path.join( self.params["output_dir_path"], self.params["output_file"] ) input_file = os.path.join( self.params["input_dir_path"], self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n langs = []\n\n with open(\"sql/07_populate.sql\", 'w', encoding='utf8') as sql:\n sql.write(\"--this file is generated from csv files in data folder\\n\\n\")\n\n langs = write_lang_city(sql)\n write_groups_diets(sql, langs)\n\n with open(\"sql/10_populate_test_data.sql\"...
[ "0.5694265", "0.5572508", "0.5570067", "0.55660534", "0.55130184", "0.5468869", "0.5449003", "0.54461205", "0.5285306", "0.52705884", "0.52448237", "0.52008086", "0.5169603", "0.5167817", "0.5165798", "0.5160243", "0.5145471", "0.51369846", "0.51311797", "0.512673", "0.511855...
0.5930959
0
Initialize a player at Python Casino, we give new players 100 chips to play
def __init__(self, name="Player"): self.name = name self.chips = 100 self.hand1 = [] self.hand2 = [] self.bet = 0 self.lastbet = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newPlayer():\r\n pass", "def __init__(self):\n\n self.name = 'KuhnPoker'\n self.num_players = 2", "def initGame(self):\n self.map = {}\n self.blocks = Group()\n self.Coins =Group()\n self.players = Group()\n self.player1 = Player(1525,75,2)\n self....
[ "0.6672925", "0.6669602", "0.6631138", "0.6495722", "0.6478701", "0.6469059", "0.6440115", "0.64392686", "0.64156747", "0.6413498", "0.6401054", "0.63888377", "0.63830507", "0.6313076", "0.62933445", "0.6278405", "0.6247309", "0.62469554", "0.62101966", "0.6190493", "0.618668...
0.6768657
0
Request a bet from the player
def get_bet(self): while newbet := input(f"{self.name}: {self.chips} chips. Last bet: {self.lastbet}. Bet: "): try: newbet = int(newbet) if newbet in range(0, self.chips+1): self.bet = newbet self.chips -= newbet ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def bet(message, user: ParamType.MIXER_USER, amount):\n\n username = user.username.lower()\n username_sender = message.username.lower()\n\n mixcord_user = await database.get_user(message.user_id)\n\n # handle if somebody is trying to accept or deny\n if amount == \"accept\" or amount == \"deny...
[ "0.7001438", "0.6755639", "0.6732551", "0.66591", "0.66209906", "0.6607337", "0.63983536", "0.6385922", "0.6177575", "0.61636424", "0.6158878", "0.6030608", "0.6015223", "0.59681845", "0.595183", "0.5890456", "0.5877548", "0.5866771", "0.586661", "0.58525896", "0.5830537", ...
0.5253574
59
Get a player name to join the game
def get_name(self): name = input("What is your name? ") if len(name) > 0: self.name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self):\n return self._player_name", "def get_name_from_player(player):\r\n return player.name.lower()", "def get_current_player_name(self) -> str:\n if self.p1_turn:\n return 'p1'\n return 'p2'", "def get_player_name(self):\n return self._player_name", ...
[ "0.75537586", "0.7549152", "0.75380224", "0.7499969", "0.74118185", "0.7327175", "0.7180175", "0.7167274", "0.70668465", "0.69005984", "0.68667847", "0.6844018", "0.6836805", "0.6779528", "0.6658368", "0.6543344", "0.65326613", "0.65127695", "0.6503237", "0.64859694", "0.6484...
0.0
-1
Setup player for a new round
def prepare_round(self): self.hand1 = [] self.hand2 = [] # Note, this should already be zero from having bet paid self.bet = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newPlayer():\r\n pass", "def set_player(self, new_player):\n self.player = new_player", "def change_player(self):\n if self.__root.children is None:\n if self.__root.win[0] == 1:\n self.win = Board.PLAYER_0\n elif self.__root.win[1] == 1:\n ...
[ "0.7188657", "0.68857676", "0.67688686", "0.67233884", "0.6633779", "0.662217", "0.6593084", "0.65605456", "0.6546107", "0.65304965", "0.6521109", "0.6511719", "0.6417494", "0.63130975", "0.6311738", "0.63064224", "0.6296433", "0.6292017", "0.62892103", "0.62458867", "0.62320...
0.0
-1
Receive a card dealt during the deal round
def dealt_card(self, card): self.hand1.append(card) print(f"{self.name} was dealt a {card}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deal(self):\n dealt_card = self.deck_of_cards.pop()\n print(\"You have been dealt the {} \".format(dealt_card.value) \\\n + \"of {}.\".format(dealt_card.suit) + \"\\n\")", "def deal_card(self):\n return self._deal(1)[0]", "def deal(self):\n\n if self.dealer...
[ "0.7164214", "0.6649279", "0.6613201", "0.6463644", "0.64456797", "0.6287789", "0.62788486", "0.6256954", "0.6247799", "0.6185928", "0.618543", "0.6180968", "0.61769384", "0.61759967", "0.61480325", "0.6139512", "0.613029", "0.6088372", "0.6074345", "0.60608476", "0.6047473",...
0.7149964
1
Return the value of the players hand. Still need to handle split hands somehow
def hand_value(self): return deck.bj_hand_value(self.hand1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_hand_value(self, hand_idx=0):\n return self._get_hand_value(self.players[hand_idx]['hand'])", "def _get_hand_value(self):\n\t\tvalue_list = []\n\t\tfor index, hand in enumerate(self.player_hand):\n\t\t\tif self.status[index] == 'won':\n\t\t\t\tvalue_list.append(hand.bet)\n\t\t\telif self.status...
[ "0.7838407", "0.7544803", "0.7197065", "0.7069113", "0.68920386", "0.68238187", "0.68197185", "0.6810919", "0.68102187", "0.68066204", "0.6653587", "0.66281724", "0.6549728", "0.6535241", "0.6513264", "0.6500152", "0.64739597", "0.63902885", "0.63755286", "0.6328881", "0.6209...
0.808111
0
Lost hand, lost bet
def lose(self, dlr): print(f"Sorry {self.name}, your total of {sum(self.hand1)} didn't beat the dealers {dlr}") self.lastbet = self.bet self.bet = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lose(self) -> None:\n self._actual_money -= self._bet", "def rough_outcome(self) -> float:\n # HUYNH YOU PRICK WHY THE FUCK DO YOU MAKE US WRITE THIS SHIT EVEN IT'S NOT USED ANYWHERE\n # pick move based on this may not be optimal but better than random\n # return 1 if win immediat...
[ "0.69771945", "0.66398084", "0.65543616", "0.6549002", "0.64223045", "0.64099866", "0.6402642", "0.6375774", "0.6362669", "0.6361766", "0.6273635", "0.6248365", "0.6205552", "0.6203644", "0.6169682", "0.61347765", "0.6123261", "0.6119863", "0.61127377", "0.6111896", "0.609298...
0.7257465
0
Pay a push bet
def push(self, dlr): print(f"{self.name}'s {dlr} matched the dealers hand, push") self.chips += self.bet self.lastbet = self.bet self.bet = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pay_gold(self, something):\n print(\"GOLD PAID\")", "def awaiting_payment(self):", "def post(self):\n \n access_token = accessToken.gerated_access_token\n api_url = \"https://sandbox.safaricom.co.ke/mpesa/stkpush/v1/processrequest\"\n headers = { \"Authorization\": \"Bear...
[ "0.65109074", "0.6435573", "0.63549113", "0.62870425", "0.6262188", "0.6180678", "0.6157217", "0.5998908", "0.59986365", "0.5978201", "0.59458923", "0.5945481", "0.59274006", "0.5924785", "0.59118724", "0.5908018", "0.58982766", "0.5818431", "0.579684", "0.57960904", "0.57928...
0.0
-1
Given a bearer token, send a GET request to the API.
def obtain_bearer_token(host, path): url = '{0}{1}'.format(host, quote(path.encode('utf8'))) assert CLIENT_ID, "Please supply your client_id." assert CLIENT_SECRET, "Please supply your client_secret." data = urlencode({ 'client_id': CLIENT_ID, 'client_secret': CLIENT_SECRET, 'gra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(auth_token):\n session = requests.Session()\n session.headers.update({'Accept': 'application/json',\n 'Authorization': 'Bearer %s' % auth_token})\n return FlattrApi(session)", "def request(host, path, bearer_token, url_params=None):\n url_params = url_params or {}\n url = '{0}{1}'.f...
[ "0.74230313", "0.7217766", "0.7217766", "0.7217766", "0.7144044", "0.6993274", "0.6922886", "0.69217604", "0.6805349", "0.6731545", "0.6706645", "0.65714157", "0.6518531", "0.65005594", "0.64718956", "0.6424078", "0.6410442", "0.63174736", "0.6309319", "0.62804854", "0.623405...
0.6105324
32
Given a bearer token, send a GET request to the API.
def request_from_yelp(host, path, bearer_token, url_params=None): url_params = url_params or {} url = '{0}{1}'.format(host, quote(path.encode('utf8'))) headers = { 'Authorization': 'Bearer %s' % bearer_token, } response = requests.request('GET', url, headers=headers, params=url_params) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(auth_token):\n session = requests.Session()\n session.headers.update({'Accept': 'application/json',\n 'Authorization': 'Bearer %s' % auth_token})\n return FlattrApi(session)", "def request(host, path, bearer_token, url_params=None):\n url_params = url_params or {}\n url = '{0}{1}'.f...
[ "0.74231493", "0.7217314", "0.7217314", "0.7217314", "0.7143837", "0.6995892", "0.6923943", "0.6921158", "0.6802968", "0.6730711", "0.6707949", "0.6570709", "0.64983624", "0.64725584", "0.64226097", "0.64084786", "0.63167053", "0.63087755", "0.627998", "0.623275", "0.6221526"...
0.6519203
12
Query the Search API by a search term and location.
def search(bearer_token, term, location): url_params = { 'term': term.replace(' ', '+'), 'location': location.replace(' ', '+'), 'limit': SEARCH_LIMIT } return request_from_yelp(API_HOST, SEARCH_PATH, bearer_token, url_params=url_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(api_key, term, location):\n\n\n\n url_params = {\n\n 'term': term.replace(' ', '+'),\n\n 'location': location.replace(' ', '+'),\n\n 'limit': SEARCH_LIMIT\n\n }\n\n return request(API_HOST, SEARCH_PATH, api_key, url_params=url_params)", "def search(api_key, term, location...
[ "0.84327716", "0.8417795", "0.83943504", "0.82543755", "0.8189317", "0.81802875", "0.8086794", "0.7866687", "0.7748555", "0.7738864", "0.72571903", "0.72518456", "0.7206588", "0.7186088", "0.70739245", "0.70538163", "0.7021339", "0.69804955", "0.69747436", "0.69324064", "0.68...
0.7719189
10
Query the Business API by a business ID.
def get_business(bearer_token, business_id): business_path = BUSINESS_PATH + business_id return request_from_yelp(API_HOST, business_path, bearer_token)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_business(api_key, business_id):\r\n business_path = BUSINESS_PATH + business_id\r\n\r\n return request(API_HOST, business_path, api_key)", "def get_business(api_key, business_id):\n\n business_path = BUSINESS_PATH + business_id\n\n\n return request(API_HOST, business_path, api_key)", "def g...
[ "0.8017975", "0.79832286", "0.79655355", "0.7780533", "0.7551206", "0.7551206", "0.7551206", "0.7334066", "0.6866214", "0.6796703", "0.62649596", "0.6192476", "0.60992557", "0.60603786", "0.6021728", "0.5977142", "0.5906498", "0.5848761", "0.58446676", "0.5840517", "0.5755293...
0.73491096
7
Queries the API by the input values from the user.
def query_api(term, location): bearer_token = obtain_bearer_token(API_HOST, TOKEN_PATH) response = search(bearer_token, term, location) businesses = response.get('businesses') if not businesses: print(u'No businesses for {0} in {1} found.'.format(term, location)) return final_resu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ask_query(self):\n self.__output = list()\n return input(form('What do you want to search?\\n> '))", "def query(self, **kwargs):", "def query(self):", "def api_query(self, **kwargs):\n with self._api_lock:\n return self._api_query(kwargs)", "def query(self):\n ...
[ "0.6936234", "0.67944455", "0.66436636", "0.65685666", "0.651623", "0.6514857", "0.6289315", "0.6279256", "0.6257811", "0.62468415", "0.6245594", "0.61942685", "0.61852056", "0.6142807", "0.6141403", "0.60930455", "0.6082008", "0.6082008", "0.6081551", "0.6076993", "0.6075414...
0.5678671
53
Checks if created data class is of the right class.
def test_creates_data(self, config_filename, expected_class): data = create_data(read_config_file(config_filename)) self.assertIsInstance(data, expected_class)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_dataclass_instance(obj):\n return hasattr(type(obj), '__dataclass_fields__')", "def _check_dataclass(self) -> PossibleResult[T]:\n if is_dataclass(self.constructor):\n if not isinstance(self.obj, Mapping):\n raise DeserializeError(\n Mapping, self.ob...
[ "0.73167884", "0.70281214", "0.697299", "0.6734586", "0.65639776", "0.6543953", "0.6501673", "0.64816797", "0.6398697", "0.63877684", "0.63857174", "0.62964743", "0.62771004", "0.6239756", "0.6161517", "0.6121133", "0.6119971", "0.60966104", "0.6038572", "0.59667945", "0.5946...
0.0
-1
Checks if create date raises lookup error when name is incorrect.
def test_create_data_lookup_error(self): with self.assertRaises(LookupError): _ = create_data({"name": "fake_data"})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_name(self):\n\t\tpass", "def check_for_date(date_str):\r\n try:\r\n if rex.match(\"\\d\\d\\d\\d-\\d\\d-\\d\\d\", str(date_str)) is None:\r\n raise sqlErr(\"Not a Date!\")\r\n except Exception as e:\r\n raise e", "def _validate(self, date, format):\n...
[ "0.65987", "0.61021996", "0.60601944", "0.60601944", "0.6025887", "0.60065466", "0.5996862", "0.5987295", "0.5957946", "0.5957502", "0.59451586", "0.59265476", "0.59222174", "0.5908189", "0.5866697", "0.5861176", "0.584377", "0.5835697", "0.58273", "0.58071387", "0.58070785",...
0.56072104
33
Checks if creates data collection.
def test_creates_data_collection(self): data_collection = create_data_collection(read_config_file("test/data_collection.yaml")) self.assertIsInstance(data_collection, DataCollection)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_collection(self):\n pass", "def check_for_new_data(self):\n return", "def _validate_create_data(self, data):\n return", "def data_loaded_check(self):\n return True", "def assertExists(self):\n for db in self._db_tree:\n assert(db in self._datast...
[ "0.69012666", "0.66905195", "0.6603279", "0.64278567", "0.63041574", "0.61867595", "0.61684585", "0.6142971", "0.6142184", "0.60509443", "0.60087866", "0.60020673", "0.59476244", "0.5895808", "0.5882238", "0.58364767", "0.5814158", "0.58005524", "0.5793292", "0.57574344", "0....
0.69225866
0
(Computed) The etag of the IAM policy.
def etag(self) -> str: return pulumi.get(self, "etag")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pul...
[ "0.7073697", "0.7073697", "0.7073697", "0.7073697", "0.7073697", "0.7073697", "0.7073697", "0.69740593", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", "0.6932817", ...
0.71071345
7
The providerassigned unique ID for this managed resource.
def id(self) -> str: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provider_id(self):\n return self.get('_id')", "def provider_id(self):\n raise NotImplementedError", "def id(self):\n return self.raw_resource.uuid", "def healthcare_provider_id(self):\n return self._healthcare_provider_id", "def unique_identifier(self) -> str:\n retur...
[ "0.8193402", "0.7851373", "0.77124894", "0.7604287", "0.7477648", "0.7476093", "0.7476093", "0.7476093", "0.7425807", "0.7380237", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.7371964", "0.735787", "0.735787", "0.73477197", "...
0.0
-1
(Required only by `bigqueryanalyticshub.ListingIamPolicy`) The policy data generated by a `organizations_get_iam_policy` data source.
def policy_data(self) -> str: return pulumi.get(self, "policy_data")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy_data(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"policy_data\")", "def policy_data(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"policy_data\")", "def policy_data(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"policy_data\")", "def pol...
[ "0.76912093", "0.7415256", "0.71202403", "0.69792354", "0.69779694", "0.6871238", "0.67510366", "0.6739088", "0.6735609", "0.6735609", "0.6735609", "0.66321325", "0.6614807", "0.6489843", "0.6465918", "0.6465918", "0.6463034", "0.64587224", "0.6429678", "0.6399119", "0.637848...
0.7500135
2
Retrieves the current IAM policy data for listing example ```python import pulumi import pulumi_gcp as gcp policy = gcp.bigqueryanalyticshub.get_listing_iam_policy(project=google_bigquery_analytics_hub_listing["listing"]["project"], location=google_bigquery_analytics_hub_listing["listing"]["location"], data_exchange_id...
def get_listing_iam_policy(data_exchange_id: Optional[str] = None, listing_id: Optional[str] = None, location: Optional[str] = None, project: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_listing_iam_policy_output(data_exchange_id: Optional[pulumi.Input[str]] = None,\n listing_id: Optional[pulumi.Input[str]] = None,\n location: Optional[pulumi.Input[Optional[str]]] = None,\n project: Optional[...
[ "0.7828049", "0.6415348", "0.6217417", "0.6160221", "0.6139532", "0.6135994", "0.61296153", "0.61258733", "0.61258733", "0.61258733", "0.6070894", "0.6070894", "0.6063281", "0.6063281", "0.6063281", "0.5996258", "0.5977472", "0.59605813", "0.59031934", "0.59001213", "0.589823...
0.7959973
0
Retrieves the current IAM policy data for listing example ```python import pulumi import pulumi_gcp as gcp policy = gcp.bigqueryanalyticshub.get_listing_iam_policy(project=google_bigquery_analytics_hub_listing["listing"]["project"], location=google_bigquery_analytics_hub_listing["listing"]["location"], data_exchange_id...
def get_listing_iam_policy_output(data_exchange_id: Optional[pulumi.Input[str]] = None, listing_id: Optional[pulumi.Input[str]] = None, location: Optional[pulumi.Input[Optional[str]]] = None, project: Optional[pulumi.I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_listing_iam_policy(data_exchange_id: Optional[str] = None,\n listing_id: Optional[str] = None,\n location: Optional[str] = None,\n project: Optional[str] = None,\n opts: Optional[pulumi.InvokeOptions] = ...
[ "0.7957954", "0.6418271", "0.62199444", "0.6163126", "0.61404836", "0.6138383", "0.6131887", "0.6128473", "0.6128473", "0.6128473", "0.6072734", "0.6072734", "0.60656893", "0.60656893", "0.60656893", "0.5997886", "0.59795076", "0.5963106", "0.59044737", "0.59022045", "0.59003...
0.7827125
1
initialize with location of my articles and outdir
def __init__(self, workdir = "archived_links", outdir = "tmp"): self.workdir = workdir self.outdir = outdir self.bigdf = "" self.ArticlesLoaded = False self.clf = ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(self) -> None:\n logger.debug(f\"[nbtutorial]: Outdir is: {self.outdir}\")", "def __init__(self, texts_path, slug, metadata):\n self.texts_path = os.path.abspath(texts_path)\n\n self.slug = slug\n\n self.metadata = metadata", "def __init__(self, output_dir: str):\n s...
[ "0.6814485", "0.63777536", "0.63513637", "0.6347799", "0.631205", "0.62790346", "0.62379956", "0.6223603", "0.61957836", "0.6175018", "0.6114833", "0.6083057", "0.6074342", "0.6068505", "0.6055408", "0.6051235", "0.60070103", "0.59881234", "0.5972294", "0.59503233", "0.592627...
0.66417944
1
generates the dataframe and label
def loadArticles(self, pubList=[], outdir = ""): allArticles = {} publishers = [x for x in os.listdir(self.workdir) if x.find(".") == -1] for publisher in publishers: if len(pubList) > 0: if publisher not in pubList: continue articles ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generate_df_with_label(self):\n\n data_df = pyjstat.generate_df(self.oecd_datasets['oecd'], 'label')\n line_thirty = ['Unemployment rate', 'Belgium', 2009, 7.891892855]\n dimensions = pyjstat.get_dimensions(self.oecd_datasets['oecd'],\n 'labe...
[ "0.7051935", "0.68929803", "0.6859137", "0.6765094", "0.66359156", "0.6608978", "0.65593594", "0.6559319", "0.6543085", "0.6508285", "0.6502606", "0.64988977", "0.64407736", "0.6428954", "0.63835454", "0.63357615", "0.63354117", "0.63071513", "0.62099665", "0.62028444", "0.61...
0.0
-1
load train, test, and validation sets
def loadSets(self, indir=""): if indir=="": print("specify folder") return -1 self.train = pd.read_pickle("{}/train.pkl".format(indir)) self.valid = pd.read_pickle("{}/valid.pkl".format(indir)) self.test = pd.read_pickle("{}/test.pkl".format(indir)) pri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_training_set():\n global training_set\n f = gzip.open('mnist.pkl.gz', 'rb')\n train, valid, test = cPickle.load(f)\n [training_set, training_labels] = train\n [validation_set, validation_labels] = valid\n [testing_set, testing_labels] = test\n training_set = np.concatenate((training_set, validation...
[ "0.77761513", "0.7662758", "0.75225306", "0.7434124", "0.7416108", "0.7411986", "0.7359799", "0.73430353", "0.7298566", "0.72648185", "0.7188164", "0.7177405", "0.7131839", "0.71224463", "0.7074946", "0.7033295", "0.69873655", "0.6973563", "0.6957486", "0.69372827", "0.691362...
0.7525998
2
fine tune features for awd_listm a few times
def setupEmbeddings(self, path = "awd_lm"): try: data_lm = TextLMDataBunch.from_df(path, train_df=self.train, valid_df=self.valid,\ text_cols = "text", label_cols = "label") except: print("error creating LM") return learn = language_model_learner(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n \n # The following 5 command lines can be outcommented if the features are already created.\n # There is no need to process the data every single time.\n # Fine tuning the learning algorythm is much faster without that extra step.\n \n # by reading the train dataset the feature inde...
[ "0.6061019", "0.5993656", "0.593578", "0.592096", "0.5915068", "0.5902306", "0.5864268", "0.5861113", "0.5835116", "0.58337325", "0.58134186", "0.5757614", "0.57337815", "0.5727529", "0.568164", "0.5675858", "0.5675187", "0.5664823", "0.5611879", "0.5602952", "0.55911386", ...
0.0
-1
Print the function runtime
def timer(func): @wraps(func) def wrap_timer(*args, **kwargs): t0 = perf_counter() returned = func(*args, **kwargs) t1 = perf_counter() print(f"[Time: {t1-t0:.6f} s]") return returned return wrap_timer
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runtime_print(f):\n def decorated_fun(*args, **kwargs):\n t0 = datetime.now()\n ret = f(*args, **kwargs)\n t1 = datetime.now()\n print(f'Runtime: {t1 - t0}')\n return ret\n\n return decorated_fun", "def print_func_measuremetns():\n print(\"Measured functions:\")\n ...
[ "0.7667241", "0.7212847", "0.67484915", "0.6739686", "0.66121894", "0.6481864", "0.6399771", "0.63735133", "0.6281253", "0.6276147", "0.6228342", "0.6212566", "0.6120459", "0.61113286", "0.6105854", "0.6098444", "0.60396963", "0.6032985", "0.6006991", "0.598489", "0.59652984"...
0.0
-1
Calculate the crossentropy loss for a batch.
def forward(self, x, y): # calculate softmax probabilities x = x - np.max(x, axis=1, keepdims=True) prob = np.exp(x) prob = prob / np.sum(prob, axis=1, keepdims=True) loss = -np.sum(y * np.log(prob + 1e-8)) if self.reduction == "mean": m, _ = x.shape ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_entropy_loss(batch_out, batch_gt):\r\n criterion = torch.nn.CrossEntropyLoss()\r\n target = torch.argmax(batch_gt, 1)\r\n loss = criterion(batch_out, target)\r\n\r\n return loss", "def loss_calc(pred, label, device):\r\n # out shape batch_size x channels x h x w -> batch_size x channels ...
[ "0.7592742", "0.7591871", "0.74489385", "0.7352859", "0.7275295", "0.7253083", "0.72098607", "0.7196246", "0.7168889", "0.7168013", "0.71548504", "0.71115357", "0.7018222", "0.69646066", "0.69580334", "0.695356", "0.69529086", "0.69491434", "0.69073373", "0.68900985", "0.6882...
0.0
-1
Backward computation of gradients.
def backward(self): assert self.cache is not None, "Cannot backprop without forward first." prob, y = self.cache dX = prob - y if self.reduction == "mean": m, _ = prob.shape dX /= m # clear cache self.cache = None return dX
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backward(self, gradient):\n #TODO\n pass", "def backward(self, gradient):\n #TODO\n pass", "def backward(self, gradient):\n raise NotImplementedError()", "def backward(self, gradient: Tensor) -> Tensor:\n self.b_grad = np.sum(gradient, axis=0)\n self.w_gra...
[ "0.82506675", "0.82506675", "0.82469416", "0.8232206", "0.80324847", "0.80324847", "0.78823906", "0.7857436", "0.78483355", "0.78429383", "0.77847767", "0.7679982", "0.76649225", "0.7645512", "0.7608589", "0.7604201", "0.759334", "0.7587491", "0.75818443", "0.7530521", "0.751...
0.0
-1
Pick nth member of a randomised list of perturbation fields, and apply it to soil moistire in wrfinput.
def fractalise(fractals,n,fpath): # Use different fractals for MP n = nnn-n # Load numpy array for f in fractals: if f.endswith('{:02d}.npy'.format(n)): frac_arr = N.load(f) f_out = f # Normalise to +/- 1% frac_arr_pc = normalise(frac_arr) # Load virgin ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_town(self, people=50):\n \n #1.5 acres farm needed per person\n #farmer could farm 20-40 (30) acres\n #30/1.5 = 20 people per farm\n people_to_assign = people\n farms_needed = (self.population + people)/20 + 1\n if people_to_assign >= farms_needed:\n ...
[ "0.5138526", "0.51018333", "0.5094111", "0.49444968", "0.49331975", "0.49025005", "0.49025005", "0.48996407", "0.48993465", "0.48773155", "0.4877003", "0.4868825", "0.4847049", "0.48081005", "0.4741778", "0.47232425", "0.4711773", "0.4694738", "0.46840546", "0.4678606", "0.46...
0.0
-1
Test for the view returning hardcoded data for the template
def test_the_info_view(self): info_url = resolve('/') self.assertEqual(info_url.func.__name__, 'Info_view') self.assertEqual(self.response.status_code, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_home_view_template(self):\n response = self.client.get(self.url)\n self.assertEqual(response.status_code, 200)\n self.assertTemplateUsed(response, 'user_data.html')", "def test_get_template_data(self, mock_gsiup):\n mock_gsiup.return_value = models.UserPref(\n email='user@...
[ "0.70924264", "0.6801489", "0.6795118", "0.659572", "0.65819216", "0.65160805", "0.64946854", "0.648827", "0.64539325", "0.6453025", "0.64388144", "0.64339983", "0.6404006", "0.6361182", "0.6361182", "0.6361182", "0.6361182", "0.6361182", "0.6319067", "0.631654", "0.6288902",...
0.0
-1
Test for template correctness
def test_for_template(self): self.assertTemplateUsed(self.response, 'my_info_template.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_template_feedback(self):\r\n pass", "def test_create_template_subsciption(self):\n pass", "def test_register_template(self):\n pass", "def validate_template(template):\n if not isinstance(template, Template):\n raise TypeError(\"%s is not a template\" % template)", "...
[ "0.7268917", "0.7127761", "0.7098289", "0.68893516", "0.6856749", "0.6837006", "0.6832027", "0.6791806", "0.6789153", "0.667286", "0.65756553", "0.65742195", "0.65539366", "0.6544988", "0.6526361", "0.65153843", "0.6472864", "0.6436084", "0.64188963", "0.63870656", "0.6362022...
0.6860066
4
Test that view renders data from model
def test_the_view_render_Contact_instance(self): my_info = self.response.context_data['info'] self.assertIsInstance(my_info, Contact) model_instance = Contact.objects.first() self.assertIn(model_instance.name, self.response.content) self.assertIn(model_instance.surname, self.re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_context_data(self):\n self.view.object = self.obj\n context = self.view.get_context_data()\n self.assertIn(\"code\", context)\n self.assertIn(\"edit\", context)\n self.assertTrue(context[\"edit\"])", "def test():\n return render_template(\n 'test.html',\n...
[ "0.6840645", "0.66080403", "0.6523233", "0.64715046", "0.6451231", "0.6444405", "0.64431345", "0.6432887", "0.6404577", "0.64019704", "0.6368436", "0.63485414", "0.634387", "0.63366467", "0.63298786", "0.63038164", "0.62876505", "0.62627774", "0.62624705", "0.6258345", "0.624...
0.7052593
0
Test if unicode is in data base
def test_the_unicode_in_data_base(self): model_instance = Contact.objects.first() model_instance.name = u'Олег' model_instance.surname = u'Сенишин' model_instance.bio = u'Працюю, після роботи, самостійно вивчаю Python, Django, JavaScript.' model_instance.save() response...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsUnicodeSupported(self):\n return self._common_type.IsUnicodeSupported()", "def test_unicode_warnings(self):\n\n unicodedata = u\"Alors vous imaginez ma surprise, au lever du jour, quand \"\\\n u\"une drôle de petit voix m’a réveillé. \"\\\n u\"Elle di...
[ "0.6732994", "0.64144266", "0.6325585", "0.61495537", "0.611053", "0.6060772", "0.60573775", "0.602658", "0.6022272", "0.60210747", "0.59900254", "0.58709526", "0.58263814", "0.5813352", "0.5812566", "0.5799742", "0.57963264", "0.5767176", "0.57383955", "0.5736866", "0.569727...
0.58200395
13
Test that nothing breaks when database is empty
def test_in_case_base_data_is_empty(self): Contact.objects.all().delete() obj_list = Contact.objects.all() self.assertFalse(obj_list) response = self.client.get(reverse("my_info")) my_info = response.context_data['info'] self.assertIsNone(my_info) self.assertEqu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_db(client, test_db):\n rv = client.get(\"/\")\n assert b\"No entries yet. Add some!\" in rv.data", "def test_empty_db(self):\n rv = self.app.get('/')\n assert b'Your closet is empty.' in rv.data", "async def test_fetch_users_empty(database):\n await database.setup_database...
[ "0.81646407", "0.7992816", "0.7651522", "0.76504767", "0.7524679", "0.7524679", "0.7524679", "0.7524679", "0.7524679", "0.7524679", "0.7477498", "0.74590117", "0.74297035", "0.7413825", "0.73992026", "0.73721033", "0.73433846", "0.73256075", "0.73021424", "0.729906", "0.71927...
0.64519596
86
Test for form date field validation
def test_form_date_validation(self): form = My_add_data_form(data={'date': date(1800, 05, 03)}) self.assertEqual(form.errors['date'], ['You already dead now']) form = My_add_data_form(data={'date': date(2200, 05, 03)}) self.assertEqual(form.errors['date'], ['You not born yet'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_date_field():", "def validate(self, test_data):\n if not isinstance(test_data, datetime.date):\n raise ValidationError('Invalid type/value.', 'datetime.date',\n type(test_data))", "def check_date_format(form, field):\n try:\n field.data = da...
[ "0.79683304", "0.7457315", "0.74449104", "0.73319423", "0.73196423", "0.7264576", "0.7140698", "0.7116886", "0.70986587", "0.70432013", "0.7036628", "0.6971", "0.69465804", "0.69303936", "0.69096756", "0.69046116", "0.69046116", "0.68596894", "0.6810483", "0.67967176", "0.678...
0.84299916
0
Test for the view returning hardcoded data for the template
def test_the_data_edit_url(self): my_instance = Contact.objects.first() info_url = resolve('/to_form/%s/' % my_instance.id) self.assertEqual(info_url.func.__name__, 'my_edit_data') self.assertEqual(self.response.status_code, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_home_view_template(self):\n response = self.client.get(self.url)\n self.assertEqual(response.status_code, 200)\n self.assertTemplateUsed(response, 'user_data.html')", "def test_get_template_data(self, mock_gsiup):\n mock_gsiup.return_value = models.UserPref(\n email='user@...
[ "0.70924264", "0.6801489", "0.6795118", "0.659572", "0.65819216", "0.65160805", "0.64946854", "0.648827", "0.64539325", "0.6453025", "0.64388144", "0.64339983", "0.6404006", "0.6361182", "0.6361182", "0.6361182", "0.6361182", "0.6361182", "0.6319067", "0.631654", "0.6288902",...
0.0
-1
Test that view return errors in Json format
def test_that_view_return_errors_in_json(self): self.client.login(username='admin', password='admin') url = reverse("to_form", args=str(self.my_instance.id)) response = self.client.post(url, data={'name': 'Oleg'}, format='json') self.assertEqual(response.status_code, 200) for c ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_json(self):\r\n data = {\"Testing invalid\"}\r\n response = self.client.post(\r\n reverse('verify_student_results_callback'),\r\n data=data,\r\n content_type='application/json',\r\n HTTP_AUTHORIZATION='test BBBBBBBBBBBBBBBBBBBB: testing',\r...
[ "0.6963432", "0.68196243", "0.6738075", "0.6731617", "0.66677034", "0.66568595", "0.6615065", "0.65761465", "0.65392554", "0.6538512", "0.6524916", "0.6521766", "0.6519895", "0.6510612", "0.6499493", "0.6459137", "0.6440112", "0.6433431", "0.64058393", "0.6382526", "0.6369236...
0.8210779
0
Test that view saves data if form valid
def test_that_view_saves_data_if_form_valid(self): self.client.login(username='admin', password='admin') url = reverse("to_form", args=str(self.my_instance.id)) response = self.client.post(url, data={'name': 'Oleg', 'surname': 'Senyshyn', 'date': date(1995, 05, 03), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_submit_form_using_valid_data():", "def test_valid_form_true(self):\n form = UserRegisterForm(data=self.data)\n self.assertTrue(form.is_valid())", "def test_form_valid(self):\n form = Mock()\n form.cleaned_data = Mock()\n self.view.form_valid(form)\n self.asser...
[ "0.75905186", "0.6972983", "0.68898875", "0.68876064", "0.6843631", "0.68388474", "0.6799494", "0.6762418", "0.6688027", "0.66799116", "0.6619247", "0.6603506", "0.6595378", "0.65945286", "0.6561139", "0.65168655", "0.6509908", "0.64848745", "0.6478526", "0.6477208", "0.64530...
0.806071
0
Loads patient Procedure observations
def load(cls): # Loop through procedures and build patient procedure lists: procs = csv.reader(file(PROCEDURES_FILE,'U'),dialect='excel-tab') header = procs.next() for proc in procs: cls(dict(zip(header,proc))) # Create a procedure instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_patient(self, patient):\n \n # Maintain patient count \n self.count_total_patients += 1\n \n # Allocate patient to subunit/session\n self.allocate_patient(patient)\n \n # Add to appropriate _population lists\n patient_dict = {'negative': s...
[ "0.6553638", "0.5726791", "0.5658638", "0.56560385", "0.5612213", "0.5544604", "0.5427802", "0.533888", "0.5330403", "0.5310503", "0.5299247", "0.52846605", "0.5251733", "0.5122264", "0.5118435", "0.50937766", "0.50423414", "0.50294584", "0.50182426", "0.4999633", "0.4999633"...
0.68310565
0
Returns a tabseparated string representation of a procedure
def asTabString(self): dl = [self.pid, self.date, self.snomed, self.name[:20]] s = "" for v in dl: s += "%s\t"%v return s[0:-1] # Throw away the last tab
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asTabString(self):\n dl = [self.pid, self.start, self.snomed, self.name[:20]]\n s = \"\"\n for v in dl:\n s += \"%s\\t\"%v \n return s[0:-1] # Throw away the last tab", "def print_para_table(s):\n if MODE == 1:\n t = [['Parameter', 'Value', 'Unit'],\n ['N...
[ "0.62828636", "0.61583054", "0.57344764", "0.57325906", "0.57238656", "0.57168484", "0.57098097", "0.57098097", "0.5668657", "0.5587102", "0.55370563", "0.54839957", "0.5471588", "0.54644656", "0.542793", "0.53945804", "0.53495973", "0.5316048", "0.5290959", "0.52773845", "0....
0.62052697
1
Return a list of dictionaries from the text and attributes of the children under this XML root.
def parse_root(self, root): return [self.parse_element(child) for child in root.getchildren()] # [child for child in root.getchildren()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attributes_from_child(child):\n return [{'element': child,\n 'attribute': x.attrib,\n 'tag': x.tag,\n 'keys': x.keys()} for x in child]", "def xml_children_as_dict(node):\n return dict((e.tag, e.text) for e in node)", "def get_attributes_from_ch...
[ "0.7088785", "0.70835507", "0.7002394", "0.6750578", "0.66856766", "0.666509", "0.6659247", "0.65232205", "0.65068334", "0.63856643", "0.63711137", "0.6368282", "0.6368282", "0.6367467", "0.6303724", "0.6253999", "0.62409544", "0.6207389", "0.6205319", "0.6199433", "0.6199433...
0.56534237
65
Initiate the root XML, parse it, and return a dataframe
def process_data(self): structure_data = self.parse_root(self.root) dict_data = {} for d in structure_data: dict_data = {**dict_data, **d} df = pd.DataFrame(data=list(dict_data.values()), index=dict_data.keys()).T return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_XML(xml_file, df_cols):\n \n xtree = et.parse(xml_file)\n xroot = xtree.getroot()\n rows = []\n \n for node in xroot: \n res = []\n #res.append(node.attrib.get(df_cols[0]))\n for el in df_cols: \n if node is not None and node.find(el) is not None:\n ...
[ "0.65164536", "0.6279615", "0.6141911", "0.6138031", "0.6130271", "0.60411644", "0.6022583", "0.60092944", "0.5845552", "0.5839543", "0.58087265", "0.5732619", "0.56914544", "0.5677152", "0.5674767", "0.56603354", "0.56579065", "0.5635685", "0.5619518", "0.5595719", "0.552725...
0.6824071
0
Converts a string into a returned boolean.
def string_to_bool(arg): if arg.lower() == 'true': arg = True elif arg.lower() == 'false': arg = False else: raise ValueError('ValueError: Argument must be either "true" or "false".') return arg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toBool( string ):\r\n return string == 'true'", "def __str_to_bool(self, s):\n if s == 'True':\n return True\n elif s == 'False':\n return False\n else:\n raise ValueError", "def strToBool(s):\n\tassert type(s) == str or type(s) == unicode\n\treturn ...
[ "0.8471315", "0.84079623", "0.8271629", "0.81777906", "0.8156742", "0.8126672", "0.81109166", "0.80406594", "0.8026977", "0.80231994", "0.80016416", "0.79439914", "0.79439867", "0.7938794", "0.7926165", "0.79252136", "0.7922872", "0.78702635", "0.7863978", "0.7842485", "0.783...
0.7725143
26
Creates and returns a dictionary of parameters.
def set_parameters(targeted_flag='true', tv_flag='false', hinge_flag='true', cos_flag='false', interpolation='bilinear', model_type='small', loss_type='center', dataset_type='vgg',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameters_dict(self):\n return", "def get_params(self) -> dict:\n # initialize dictionary\n params = dict()\n\n # loop through parameters, adding to parameter dictionary\n for key in self._get_param_names():\n params[key] = getattr(self, key)\n\n return p...
[ "0.77072877", "0.76394325", "0.75884134", "0.75218064", "0.75122553", "0.7418143", "0.7411113", "0.7338234", "0.7304477", "0.7296404", "0.72799194", "0.727563", "0.7259348", "0.72202986", "0.7213263", "0.71996874", "0.7194121", "0.7186132", "0.7162062", "0.714997", "0.7136379...
0.0
-1
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(GraspableObjectList, self).__init__(*args, **kwds) # message fields cannot be None, assign default values for those that are if self.graspable_objects is None: self.graspable_objects = [] if self.image is None: self.im...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.77936506", "0.7720004", "0.7720004", "0.76861507", "0.76264745", "0.756367", "0.74394095", "0.74168324", "0.7351523", "0.7307856", "0.7280199", "0.7237893", "0.72272074", "0.7223773", "0.7223773", "0.7218694", "0.7211321", "0.7211321", "0.7211321", "0.7211321", "0.7211321"...
0.0
-1
serialize message into buffer
def serialize(self, buff): try: length = len(self.graspable_objects) buff.write(_struct_I.pack(length)) for val1 in self.graspable_objects: _x = val1.reference_frame_id length = len(_x) if python3 or type(_x) == unicode: _x = _x.encode('utf-8') length = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self, buff):\n try:\n _x = self\n buff.write(_struct_2d2q14dq.pack(_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x.ret))\n _x = self.msg\n ...
[ "0.6972838", "0.6802016", "0.6796291", "0.67317253", "0.66948694", "0.66847515", "0.6658851", "0.6626311", "0.66227144", "0.6618303", "0.6607444", "0.65361035", "0.6529462", "0.65220654", "0.64863104", "0.6467052", "0.64530367", "0.6438432", "0.6427743", "0.6426063", "0.63947...
0.0
-1
unpack serialized message in str into this message instance
def deserialize(self, str): if python3: codecs.lookup_error("rosmsg").msg_type = self._type try: if self.graspable_objects is None: self.graspable_objects = None if self.image is None: self.image = sensor_msgs.msg.Image() if self.camera_info is None: self.camera_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize(self, str):\n try:\n end = 0\n _x = self\n start = end\n end += 152\n (_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x.ret,) = _stru...
[ "0.7632397", "0.74631983", "0.731979", "0.730263", "0.7269273", "0.7222538", "0.72173554", "0.7174571", "0.7169", "0.70951414", "0.70948184", "0.7040944", "0.7029083", "0.69617283", "0.69550794", "0.69547164", "0.6943421", "0.69407064", "0.69404405", "0.6910806", "0.689353", ...
0.64665866
63
serialize message with numpy array types into buffer
def serialize_numpy(self, buff, numpy): try: length = len(self.graspable_objects) buff.write(_struct_I.pack(length)) for val1 in self.graspable_objects: _x = val1.reference_frame_id length = len(_x) if python3 or type(_x) == unicode: _x = _x.encode('utf-8') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_numpy(self, buff, numpy):\n try:\n pass\n except struct.error as se: self._check_types(se)\n except TypeError as te: self._check_types(te)", "def serialize_numpy(self, buff, numpy):\n try:\n _x = self\n buff.write(_struct_2d2q14dq.pack(_x.tcp, _x.ori, _x.zone, _x.vacuum, ...
[ "0.7994329", "0.7972612", "0.7893365", "0.785495", "0.7740611", "0.7677824", "0.7657543", "0.7626826", "0.75874037", "0.7565361", "0.75626636", "0.75620574", "0.7558187", "0.75431186", "0.7534563", "0.7527763", "0.75262064", "0.75172293", "0.75110817", "0.749996", "0.7497972"...
0.6931643
90
unpack serialized message in str into this message instance using numpy for array types
def deserialize_numpy(self, str, numpy): if python3: codecs.lookup_error("rosmsg").msg_type = self._type try: if self.graspable_objects is None: self.graspable_objects = None if self.image is None: self.image = sensor_msgs.msg.Image() if self.camera_info is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize_numpy(self, str, numpy):\n try:\n end = 0\n _x = self\n start = end\n end += 152\n (_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x....
[ "0.8089704", "0.7976802", "0.7917302", "0.7906449", "0.7893566", "0.7831728", "0.7812211", "0.78098595", "0.7784959", "0.77591026", "0.77403194", "0.77151906", "0.77145106", "0.76970345", "0.76930326", "0.76857287", "0.7673268", "0.7639446", "0.7636968", "0.76292497", "0.7624...
0.7313426
56
Prints onto the Console the contents of the given ttk.Entry. In this example, it is used as the function that is "CALLED BACK" when an event (namely, the pressing of a certain Button) occurs.
def print_contents(entry_box): contents_of_entry_box = entry_box.get() print(contents_of_entry_box)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_entry(text):\n print \"Text entered: \\n '%s'\" % text", "def display_entry(self, entry):\n border = '-' * 50\n print(border)\n print('Employee: {}'.format(entry.employee_name))\n print('Task Name: {}'.format(entry.task_name))\n print(\"Date: {}\".format(entry.date)...
[ "0.68677735", "0.66442794", "0.6286252", "0.6025847", "0.60157746", "0.5983749", "0.5923214", "0.58699477", "0.5760914", "0.5722802", "0.5621972", "0.55991316", "0.5574494", "0.5553222", "0.5552907", "0.55416965", "0.5510099", "0.54524994", "0.5447962", "0.5444517", "0.543691...
0.62130547
3
Generate the doxygen XML.
def __init__( self, doxygen_executable, runner, recursive, source_paths, output_path, warnings_as_error, ): self.doxygen_executable = doxygen_executable self.runner = runner self.recursive = recursive self.source_paths = source_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self):\n\n # Write Doxyfile\n doxyfile_content = DOXYFILE_TEMPLATE.format(\n name=\"wurfapi\",\n output_path=self.output_path,\n source_path=\" \".join(self.source_paths),\n recursive=\"YES\" if self.recursive else \"NO\",\n extra=\"...
[ "0.7742234", "0.74330884", "0.73922634", "0.67211056", "0.6559393", "0.6496459", "0.6456328", "0.6445485", "0.63774556", "0.6369798", "0.6321232", "0.6274118", "0.622829", "0.6170425", "0.6131777", "0.61040103", "0.609831", "0.6032156", "0.60005504", "0.59803677", "0.595689",...
0.0
-1
Generate the Doxygen XML. We do not have to remove any old XML or similar since we use the index.xml file to parse the rest.. So if some stale information is in the output folder it is ok we will not use it anyway
def generate(self): # Write Doxyfile doxyfile_content = DOXYFILE_TEMPLATE.format( name="wurfapi", output_path=self.output_path, source_path=" ".join(self.source_paths), recursive="YES" if self.recursive else "NO", extra="", ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_doxygen(self):\n if not getattr(self, \"doxygen_conf\", None):\n self.generator.bld.fatal(\"No doxygen configuration file supplied.\")\n if not isinstance(self.doxygen_conf, Node.Node):\n self.generator.bld.fatal(\"'doxygen_conf' must be a Node.\")\n\n self.create_task(\n ...
[ "0.70324063", "0.6946403", "0.68050563", "0.66510713", "0.6509056", "0.6443243", "0.6337205", "0.63226926", "0.62693423", "0.62597907", "0.623974", "0.62392175", "0.6145338", "0.6020383", "0.6006961", "0.6003898", "0.5965673", "0.5950159", "0.5910592", "0.5896202", "0.5866549...
0.77589625
0
Sidebar widget to select your data view
def select_data_view() -> str: st.sidebar.markdown('### Select your data view:') view_select = st.sidebar.selectbox('', DATA_VIEWS, index=0). \ replace(' (NEW)', '') return view_select
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_layout() -> None:\n\n st.sidebar.title(\"Menu\")\n app_mode = st.sidebar.selectbox(\"Please select a page\", [' I. Homepage',\n \"II. Download data\" ,\n \"III. Statistic Data\",...
[ "0.55691195", "0.5513806", "0.5493136", "0.5451674", "0.5418005", "0.5393736", "0.53791744", "0.5376035", "0.5333957", "0.53197217", "0.53023964", "0.5265653", "0.5262883", "0.52579665", "0.5177404", "0.5163641", "0.51526636", "0.5104715", "0.510281", "0.5094196", "0.5078733"...
0.61881065
0
Sidebar widget to select fiscal year
def select_fiscal_year(view_select) -> str: if 'Wage Growth' in view_select: working_fy_list = FY_LIST[:-1] else: working_fy_list = FY_LIST st.sidebar.markdown('### Select fiscal year:') fy_select = st.sidebar.selectbox('', working_fy_list, index=0).split(' ')[0] return fy_select
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_calender_year(self, year):\n self.single_selection_from_kendo_dropdown(self.calender_year_kendo_dropdown_locator, year)", "def set_start_year(self, year):\n return self.form.set_value(\"output period \\\"year from\\\"\", str(year))", "def MonthYearFieldWidget(field, request):\n return ...
[ "0.6576069", "0.6364317", "0.62365025", "0.6131743", "0.6076331", "0.5969902", "0.5813705", "0.57639", "0.5758694", "0.5715589", "0.56626064", "0.5603968", "0.5560014", "0.5438583", "0.54234385", "0.53938276", "0.5356743", "0.5356063", "0.5349551", "0.5347137", "0.53393054", ...
0.7023844
0
Sidebar widget to select pay rate conversion (hourly/annual)
def select_pay_conversion(fy_select, pay_norm, view_select) -> int: st.sidebar.markdown('### Select pay rate conversion:') conversion_select = st.sidebar.selectbox('', PAY_CONVERSION, index=0) if conversion_select == 'Hourly': if view_select != 'Trends': pay_norm = FISCAL_HOURS[fy_selec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cb_radio(label):\n global pm_rate\n rate_dict = {'0.2 Step': 0.2, '1.0 Step': 1.0}\n pm_rate = rate_dict[label]", "def select_rates_tab(self):\n self.select_static_tab(self.rates_tab_locator, True)", "def render_investip():\n\tlinewidth = 2\n\n\tst.sidebar.markdown('# Dashboard')\n\tstock =...
[ "0.55547404", "0.53186727", "0.5312881", "0.5295051", "0.5293411", "0.5169351", "0.5135066", "0.511413", "0.5101465", "0.50238144", "0.49694377", "0.49577525", "0.4831858", "0.48169535", "0.48148766", "0.4786951", "0.47772965", "0.47656235", "0.4762115", "0.47487792", "0.4740...
0.64868665
0
Sidebar widget to select trends for Trends page
def select_trends() -> str: trends_checkbox = st.sidebar.checkbox(f'Show all trends', True) if trends_checkbox: trends_select = TRENDS_LIST else: trends_select = st.sidebar.multiselect('Select your trends', TRENDS_LIST) return trends_select
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTrends(): \n api = authentication()\n names = [i.name for i in api.GetTrendsCurrent()]\n stringTrends = [i.strip('#') for i in names and ]\n trends = [i for i in stringTrends if i != \"\"]\n return trends", "def get_trends():\n return api.trends_available()", "def trending(request):\n\titems = I...
[ "0.6033017", "0.5886845", "0.54061174", "0.5199153", "0.51406914", "0.512278", "0.5105741", "0.50310594", "0.49992782", "0.49274763", "0.481228", "0.48026663", "0.47352293", "0.46986964", "0.46903226", "0.4664409", "0.466313", "0.46275526", "0.45833886", "0.45830315", "0.4561...
0.6717184
0
Sidebar widget to select minimum salary for Highest Earners page
def select_minimum_salary(df, step, college_select: str = ''): st.sidebar.markdown('### Enter minimum FTE salary:') sal_describe = df[SALARY_COLUMN].describe() number_input_settings = { 'min_value': 100000, 'max_value': int(sal_describe['max']), 'value': 500000, 'step': ste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_min_expense(self):\n pass", "def setMinMax(self):\n currentIndustryNum = self.myParent.myIndustry[self.myIndustryData.id]\n oldIndustryNum = self.myParent.myOldIndustry[self.myIndustryData.id]\n self.setMinValue(-currentIndustryNum)\n if oldIndustryNum > currentIndustr...
[ "0.50486606", "0.5035432", "0.5007743", "0.49070513", "0.48892468", "0.4817341", "0.47293594", "0.4686217", "0.468501", "0.4654785", "0.4652862", "0.464481", "0.46400693", "0.46108285", "0.46024165", "0.45971134", "0.45901182", "0.45752954", "0.45622933", "0.45582008", "0.455...
0.60446465
0
Sidebar widget to select salary bin size for histogram plots
def select_bin_size(pay_norm: int, index: int = 2, markdown_text: str = 'salary') -> float: st.sidebar.markdown(f'### Select {markdown_text} bin size:') if pay_norm == 1: bin_size = st.sidebar.selectbox('', ['$1,000', '$2,500', '$5,000', '$10,000'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_histogram(self):\n n_rows = self.df.shape[0]\n if n_rows > 250:\n fig, ax = plt.subplots()\n ax.hist(self.df[self.col_name], bins=50)\n else: \n fig, ax = plt.subplots()\n ax.hist(self.df[self.col_name], bins=int(round(n_rows/5,0)))\n return fig", "def makeHistogram(values...
[ "0.6282638", "0.6234359", "0.61944395", "0.6177648", "0.6122733", "0.5965984", "0.5894797", "0.58317345", "0.5807618", "0.57804626", "0.57664645", "0.57572645", "0.57370436", "0.57100546", "0.56775147", "0.5642595", "0.5595545", "0.55602545", "0.55257535", "0.55219674", "0.55...
0.5996436
5
Sidebar widget to identify search method for individual search page
def select_search_method(): st.sidebar.markdown('### Search method:') search_method = st.sidebar.selectbox('', ['Individual', 'Department'], index=0) return search_method
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchWidget(self):\n return self.__searchWidget", "def search_page():\n return render_template('page_query.html', search_label=g_search_type)", "def on_searchButton_clicked(self):\n self.__search()", "def search_btn_clicked(self, widget, data=None):\n # Method to handle search he...
[ "0.65629", "0.64431345", "0.6246589", "0.6217658", "0.61798435", "0.6041973", "0.5982113", "0.5897964", "0.5824327", "0.57609326", "0.57595426", "0.5737622", "0.5707807", "0.5639201", "0.5621058", "0.5614636", "0.55623174", "0.5536656", "0.5523965", "0.5495684", "0.5465359", ...
0.6213812
4
Sidebar widget to indicate sorting method
def select_sort_method(): st.sidebar.markdown('### Sort method:') sort_select = st.sidebar.selectbox('', ['Alphabetically', 'FTE Salary'], index=1) return sort_select
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mouseDoubleClickEvent(self, event):\n if event.button() == QtCore.Qt.LeftButton:\n sw = self.spw.windows['Sort']\n sw.clear()", "def OnColumnClick(self, event):\r\n columns = self.data.getParam('columns')\r\n self.SortItems(columns[event.GetColumn()],'INVERT')", "...
[ "0.64066905", "0.61197245", "0.5869867", "0.57673573", "0.5749316", "0.53632724", "0.5358934", "0.53537744", "0.5340585", "0.53209037", "0.5320746", "0.53140193", "0.5310284", "0.5279612", "0.52369547", "0.5233304", "0.52298254", "0.51825815", "0.51570153", "0.51435727", "0.5...
0.5715584
5
Wrapper around k8s.load_and_create_resource to create a SageMaker resource
def create_sagemaker_resource( resource_plural, resource_name, spec_file, replacements, namespace="default" ): reference, spec, resource = k8s.load_and_create_resource( resource_directory, CRD_GROUP, CRD_VERSION, resource_plural, resource_name, spec_file, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_resource(\n service_name: str, config_name: str = None, **resource_args\n):\n session = get_session(config_name)\n return session.resource(service_name, **resource_args)", "def create_resource():\n return wsgi.Resource(Controller())", "def create_resource():\n return wsgi.Resource(Con...
[ "0.6695489", "0.65566033", "0.6527681", "0.63303506", "0.61349356", "0.6096821", "0.6095365", "0.6082456", "0.60742486", "0.6072159", "0.6070179", "0.60697085", "0.6067538", "0.6065695", "0.60196674", "0.60108477", "0.59737706", "0.59575313", "0.59364146", "0.5927485", "0.590...
0.7768747
0
Wrapper around k8s.load_and_create_resource to create a Adopoted resource
def create_adopted_resource(replacements, namespace="default"): reference, spec, resource = k8s.load_and_create_resource( resource_directory, ADOPTED_RESOURCE_CRD_GROUP, CRD_VERSION, "adoptedresources", replacements["ADOPTED_RESOURCE_NAME"], "adopted_resource_base", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_resource(\n service_name: str, config_name: str = None, **resource_args\n):\n session = get_session(config_name)\n return session.resource(service_name, **resource_args)", "def create_sagemaker_resource(\n resource_plural, resource_name, spec_file, replacements, namespace=\"default\"\n):\n...
[ "0.6452652", "0.6253703", "0.6171513", "0.6096159", "0.59922796", "0.59912336", "0.595014", "0.58938444", "0.5844623", "0.5840295", "0.58089936", "0.57912517", "0.57580245", "0.5738343", "0.573344", "0.5730226", "0.5724765", "0.5722394", "0.5716222", "0.5712392", "0.56978524"...
0.71058977
0
Get the scale for a unit
def get_scale(units, compartmentId, volume, extracellularVolume): if compartmentId == 'c': V = volume else: V = extracellularVolume if units == 'uM': return 1. / N_AVOGADRO / V * 1e6 elif units == 'mM': return 1. / N_AVOGADRO / V * 1e3 elif units == 'molecu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getScale(self):\n return _libsbml.Unit_getScale(self)", "def scale(self):\n return self.scale_factor / CONSTANTS.AU", "def GetScale(self):\n ...", "def scale(self):\n return self._scale", "def scale(self) -> Tuple[float, float]:\n return self._scale", "def get_unit(scal...
[ "0.80368865", "0.7562799", "0.74804133", "0.73843277", "0.7313599", "0.73030704", "0.72814995", "0.7198944", "0.7182465", "0.71608347", "0.71563214", "0.71075463", "0.7067282", "0.7034129", "0.7005473", "0.69814765", "0.6953271", "0.69395196", "0.6914729", "0.6903628", "0.689...
0.7647739
1
Cosine similarity between vector and matrix.
def cos_sim(vec, mat): numer = np.dot(mat, vec) vec_norm = np.linalg.norm(vec) mat_norm = np.linalg.norm(mat, axis=1) return np.divide(numer, vec_norm * mat_norm)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cosine_similarity(cls, vec_a, vec_b):\n return np.dot(vec_a, vec_b) / \\\n (np.linalg.norm(vec_a) * np.linalg.norm(vec_b))", "def compute_cosine_similarity(self):\n cos_matrix = []\n for i in range(len(self.train_vec)):\n val = self.vec1 * self.train_vec[i]\n ...
[ "0.8128745", "0.7961435", "0.79325265", "0.7881812", "0.7870864", "0.7867077", "0.7831051", "0.7827189", "0.7769225", "0.7692766", "0.76837415", "0.7670993", "0.76513463", "0.76232105", "0.76175356", "0.75908995", "0.74540925", "0.74253607", "0.73605967", "0.7359785", "0.7347...
0.758455
16
Euclidean distance between vector and matrix.
def euclid_dist(vec, mat): return np.linalg.norm(mat - vec, axis=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidean_distance(vector_x, vector_y):\n if len(vector_x) != len(vector_y):\n raise Exception('Vectors must be same dimensions')\n return math.sqrt(sum((vector_x[dim] - vector_y[dim]) ** 2 for dim in range(len(vector_x))))", "def get_distance(self,row_vector):\n d = row_vector-self.X_test\n ...
[ "0.7465319", "0.73555523", "0.7279082", "0.7155775", "0.70827484", "0.7002339", "0.6978049", "0.69625634", "0.69552696", "0.68833405", "0.6845088", "0.684352", "0.6810883", "0.6807818", "0.6792588", "0.675617", "0.67391354", "0.668006", "0.6631312", "0.6624541", "0.6609537", ...
0.77098405
0
Hybrid similarity between vector and matrix.
def hybrid_sim(vec, mat, top_k=5, alpha=0.1): euc_vec = 0. idx = np.array(range(mat.shape[0])) if alpha > 0: # step 1: caculate euclidean distance euc_vec = euclid_dist(vec, mat) if len(euc_vec) > top_k: idx = np.argsort(euc_vec)[:top_k] euc_vec = euc_vec[idx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def self_similarity_matrix(feature_vectors):\n norm_feature_vectors, mean, std = at.normalize_features([feature_vectors.T])\n norm_feature_vectors = norm_feature_vectors[0].T\n sim_matrix = 1.0 - distance.squareform(\n distance.pdist(norm_feature_vectors.T, 'cosine'))\n return sim_matrix", "de...
[ "0.669418", "0.6659926", "0.63767517", "0.6368019", "0.6360521", "0.6356867", "0.63391316", "0.63353467", "0.63267857", "0.62889796", "0.62807196", "0.627655", "0.624859", "0.6224308", "0.62191266", "0.61848396", "0.61848396", "0.6180708", "0.61560977", "0.6126581", "0.611667...
0.55794203
67
The unit of measurement similarity. Espicially for `oz`, `lb`, `meter` etc.
def mm_similarity(s1, s2): if filter(str.isalpha, s1) == filter(str.isalpha, s2): if len(s1) < len(s2): return float(len(s1)) / len(s2) else: return float(len(s2)) / len(s1) else: return 0.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_of_measurement(self):\n return self.values.primary.units", "def unit_of_measurement(self):\n return \"%\"", "def unit_of_measurement(self):\n return self._tasmota_entity.unit", "def unit_of_measurement(self) -> str:\n return self._unit_of_measurement", "def unit_of_measurem...
[ "0.68982303", "0.6858285", "0.68522996", "0.68046606", "0.6801904", "0.67825514", "0.6745059", "0.6737694", "0.6725472", "0.6720259", "0.67040163", "0.6688806", "0.6688806", "0.6688806", "0.6688806", "0.6688806", "0.6688806", "0.6688806", "0.6688806", "0.6688806", "0.6688806"...
0.0
-1
The longest common substring similarity. A special verison.
def lcs_similarity(s1, s2): max_len = 0 i = 0 while s1[i] == s2[i]: max_len += 1 i += 1 if len(s1) == i or len(s2) == i: break if len(s1) < len(s2): return float(max_len) / len(s2) else: return float(max_len) / len(s1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findLongestCommonSubstringManyStrings(listOfStrings):", "def m_longest_common_subsequence_2(s):\n\n # Correct me if I'm wrong but I think unsorted list is faster\n lst = list(s)\n\n lcs = lst[0]\n for string in lst[1:]:\n lcs = LCS(lcs, string)\n\n return lcs", "def findLongestCommonS...
[ "0.7570705", "0.7322224", "0.71764874", "0.71665967", "0.71261054", "0.7063779", "0.7052958", "0.70349896", "0.697746", "0.6941382", "0.6925402", "0.6925334", "0.6887414", "0.6853402", "0.6841317", "0.68183476", "0.676528", "0.67370135", "0.67279613", "0.67115736", "0.6691741...
0.70683295
5
Generate a description for the combination of well, tile, channel and, optionaly, depth and/or time
def generate_tile_description(tile, time = None, depth = None): desc = "s"+ str(tile) if depth is not None: desc = desc + "_z" + str(depth) if time is not None: desc = desc + "_t" + str(time) return desc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def describe(self):\n branch = randint(0,62)\n \n if 0 <= branch <= 29: \n if self.casteOrder[0] == 'soldiers':\n if self.genesis == 'escape persecution': \n self.description = '{2}: A full service {3} for retired {1}'....
[ "0.6358604", "0.61127687", "0.60675085", "0.6044572", "0.59665823", "0.592374", "0.59180605", "0.59102285", "0.5901158", "0.5849729", "0.5839126", "0.5819639", "0.5782906", "0.5768085", "0.5766401", "0.57455444", "0.5734563", "0.5732122", "0.57276", "0.57193375", "0.5670834",...
0.7623472
0
Generate a name for a file using the description and channel
def generate_file_name(well, channel, desc): return "bPLATE_w" + well + "_" + desc + "_c" + channel + ".png"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_raw_file_name(self, well, channel, desc):\n \n return \"bPLATE_w\" + well + \"_\" + desc + \"_c\" + channel + \".png\"", "def file_name(id, title, kind=\"src\"):\n fn_template = conf.template_source_file_name\n if kind == \"tst\":\n fn_template = conf.template_test_fi...
[ "0.75195915", "0.7167804", "0.71012443", "0.70670754", "0.69943404", "0.67369324", "0.6670187", "0.66342044", "0.66167426", "0.6494215", "0.64797497", "0.6479064", "0.6476831", "0.64566636", "0.6450938", "0.64458376", "0.6431859", "0.6416797", "0.6390564", "0.63887256", "0.63...
0.80092597
0
Constructor that takes the config and the well we are generating images for.
def __init__(self, config, well, directory): self.config = config self.well = well self.directory = directory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, config):\n logging.info(\"Creating footprint\")\n # self.infra = yaml.load(config)\n self.infra = config\n self.footprint_name = self.infra.get(\"footprint\", \"ehw\")\n self.images = self.infra.get(\"images\")\n self.old_images = self.infra.get(\"old_im...
[ "0.66241646", "0.6582035", "0.6469281", "0.6385457", "0.634032", "0.6314989", "0.62429136", "0.6220419", "0.6145161", "0.61328727", "0.61167324", "0.61167324", "0.61167324", "0.61101764", "0.6095435", "0.60907704", "0.60626227", "0.6061309", "0.60489887", "0.6046789", "0.6038...
0.7127226
0
Generate overlay images containing text x, y The arguments x and y may be negative, in which case the position will be offset from the right/top edge of the image.
def generate_overlay_images(self, overlay_name, x, y): for tile in range(1, self.config.number_of_tiles + 1): for time in self.config.time_points: for depth in self.config.depth_points: desc = self.config.tile_description_generator(tile, time, depth) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _overlay_text(\n image_file_name, x_offset_from_left_px, y_offset_from_top_px,\n text_string, font_size, use_north_gravity):\n\n command_string = '\"{0:s}\" \"{1:s}\"'.format(CONVERT_EXE_NAME, image_file_name)\n if use_north_gravity:\n command_string += ' -gravity North'\n\n comma...
[ "0.733315", "0.66948533", "0.64981097", "0.64721394", "0.6364706", "0.63315034", "0.6134925", "0.6109466", "0.6081946", "0.6055199", "0.6026748", "0.60190666", "0.6002177", "0.59274775", "0.5924847", "0.5903324", "0.58893514", "0.588931", "0.5851297", "0.58502513", "0.5820367...
0.62469816
6
Generate a name for a file using the description and channel
def _generate_raw_file_name(self, well, channel, desc): return "bPLATE_w" + well + "_" + desc + "_c" + channel + ".png"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_file_name(well, channel, desc):\n \n return \"bPLATE_w\" + well + \"_\" + desc + \"_c\" + channel + \".png\"", "def file_name(id, title, kind=\"src\"):\n fn_template = conf.template_source_file_name\n if kind == \"tst\":\n fn_template = conf.template_test_file_name\n\n return f...
[ "0.80091065", "0.7165928", "0.7101471", "0.7064337", "0.69931364", "0.67345184", "0.6668517", "0.66324764", "0.66144115", "0.64927953", "0.6479", "0.6476943", "0.64755803", "0.6454013", "0.6448165", "0.6447837", "0.6430102", "0.6413977", "0.63882077", "0.63864017", "0.6377731...
0.7519707
1
Generate a name for a file using the description and channel
def _generate_overlay_file_name(self, well, channel, desc): return "c" + channel + "_w" + well + "_" + desc + ".png"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_file_name(well, channel, desc):\n \n return \"bPLATE_w\" + well + \"_\" + desc + \"_c\" + channel + \".png\"", "def _generate_raw_file_name(self, well, channel, desc):\n \n return \"bPLATE_w\" + well + \"_\" + desc + \"_c\" + channel + \".png\"", "def file_name(id, title, k...
[ "0.80092597", "0.75195915", "0.7167804", "0.70670754", "0.69943404", "0.67369324", "0.6670187", "0.66342044", "0.66167426", "0.6494215", "0.64797497", "0.6479064", "0.6476831", "0.64566636", "0.6450938", "0.64458376", "0.6431859", "0.6416797", "0.6390564", "0.63887256", "0.63...
0.71012443
3
Constructor that takes the configuration for the plate
def __init__(self, config): self.config = config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n parameters_list = []\n self.config_dict = self.open_config(parameters_list)\n\n # Define defaults\n self.disc_gt = 0.0\n self.disc_out = 0.0", "def __init__():\n self.placa = placa", "def __init__(self, projection=None, transform=ccrs.PlateCarree(...
[ "0.67734075", "0.6454328", "0.63851225", "0.63834906", "0.63531744", "0.6349419", "0.6346132", "0.6324723", "0.63021517", "0.6280164", "0.623309", "0.6228021", "0.6225777", "0.6223605", "0.62195665", "0.62195665", "0.6196393", "0.61835295", "0.61778045", "0.6167447", "0.61486...
0.60791457
32
Constructor that takes the configuration for the plate
def __init__(self, config): self.config = config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n parameters_list = []\n self.config_dict = self.open_config(parameters_list)\n\n # Define defaults\n self.disc_gt = 0.0\n self.disc_out = 0.0", "def __init__():\n self.placa = placa", "def __init__(self, projection=None, transform=ccrs.PlateCarree(...
[ "0.67721254", "0.645361", "0.63844484", "0.638197", "0.6350986", "0.6348385", "0.6343165", "0.6325039", "0.6300187", "0.6279017", "0.622937", "0.62258977", "0.6225211", "0.62215316", "0.62173843", "0.62173843", "0.6196136", "0.6180987", "0.6177326", "0.6164835", "0.61487406",...
0.607687
30
Initialize the plot text text color instance
def __init__(self, red=Black.red, green=Black.green, blue=Black.blue): self.color = Color(red, green, blue) self.template = '\ttextcolor = {textcolor};\n'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text(self, txt, ax=None, color='black'):\n _plot_text(self, txt, ax, color)", "def text(self, txt, ax=None, color='black'):\n _plot_text(self, txt, ax, color)", "def text(self, str: str, x: int, y: int, colour: int, /) -> None:", "def text_plot(self):\n if self.stext is not None:\n ...
[ "0.7327333", "0.7327333", "0.7149617", "0.7067926", "0.7030527", "0.6963405", "0.68744624", "0.6669955", "0.65810484", "0.65442663", "0.6485745", "0.6445651", "0.63656104", "0.63190436", "0.6300679", "0.6277589", "0.62424827", "0.62409574", "0.61770606", "0.6144568", "0.61280...
0.6425525
12
Converts the plot text TextColor instance to a ztree plot text text color property declaration.
def to_str(self): return self.template.format(textcolor=self.color.to_str())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text_color ( self, object ):\n return self.text_color_", "def GetTextColour(self):\r\n \r\n return self._colText", "def get_text_color ( self, object ):\n if self._is_selected( object ):\n return self.selected_text_color_\n return self.text_color_", "def ...
[ "0.72018707", "0.63388044", "0.62334913", "0.5977799", "0.5870951", "0.58445084", "0.58192", "0.57877505", "0.5772373", "0.57390344", "0.57390344", "0.5726201", "0.56486714", "0.5620535", "0.5599045", "0.55467296", "0.55348307", "0.5521071", "0.5505261", "0.54955703", "0.5466...
0.54452705
23
The function generates and returns a combined table with names of stocks in columns and dates in indexes. Profit tables for individual stocks are taken from stock_retrunrs function.
def Generating_stock_daily_return_table(): #Getting Names list Profitfile='pap//CombProfit.csv' path='D://Doktorat Marek//dane//' ProfitsFilePath=path+Profitfile quarterly_profit=pd.read_csv(ProfitsFilePath,index_col=0,header=0,parse_dates=True) Names_list=quarterly_profit.columns.tolist()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupStockTable(self):\n # Get the date\n # NOTE: This is probably un\n date = datetime.date()\n dateStr = date.month() + \"/\" + date.day() + \"/\" + date.year()\n\n stocks = (\"INTC\", \"AAPL\", \"GOOG\", \"YHOO\", \"SYK\", \"VZ\")\n\n for stock in stocks:\n ...
[ "0.63580585", "0.61449856", "0.60916585", "0.59879607", "0.586941", "0.5752481", "0.574493", "0.56445813", "0.5596955", "0.5551755", "0.5538056", "0.55360204", "0.55317575", "0.55244833", "0.5521858", "0.55173093", "0.55147207", "0.54893124", "0.54601693", "0.54540384", "0.54...
0.6858316
0
General method for costing belt filter press. Capital cost is a function of flow in gal/hr.
def cost_filter_press(blk): t0 = blk.flowsheet().time.first() # Add cost variable and constraint blk.capital_cost = pyo.Var( initialize=1, units=blk.config.flowsheet_costing_block.base_currency, bounds=(0, None), doc="Capital cost of unit operation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cond_boiler_op_cost(Q_therm_W, Q_design_W, T_return_to_boiler_K):\n if Q_therm_W > 0.0:\n\n # boiler efficiency\n eta_boiler = cond_boiler_operation(Q_therm_W, Q_design_W, T_return_to_boiler_K)\n\n E_aux_Boiler_req_W = BOILER_P_AUX * Q_therm_W\n\n Q_primary_W = Q_therm_W / eta_bo...
[ "0.60161155", "0.5890601", "0.5859548", "0.5829997", "0.5820077", "0.58090657", "0.57660633", "0.57442236", "0.5743485", "0.5697327", "0.56755006", "0.56499743", "0.5622", "0.5602251", "0.55968297", "0.5590435", "0.55680066", "0.5539766", "0.5538298", "0.5469668", "0.5467324"...
0.7558044
0
Test case for create_symlink_file
def test_create_symlink_file(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_symlink(self, source_path, main):\n main_file = os.path.realpath(os.path.join(source_path, main))\n if not os.path.isfile(main_file):\n main_file += '.js'\n if not os.path.isfile(main_file):\n print('\\tWARNING: Could not create symlink for {}, no such file.'....
[ "0.7453823", "0.7333795", "0.7322523", "0.7264164", "0.72327024", "0.71856415", "0.7102871", "0.7052772", "0.70179003", "0.701752", "0.6931252", "0.6921266", "0.69030124", "0.6874251", "0.68668115", "0.682023", "0.67737055", "0.6681461", "0.66567737", "0.6653678", "0.6610112"...
0.95351255
0
Test case for get_meta_range
def test_get_meta_range(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_range(self):\n pass", "def test_get_range_empty(self):\n\n queryset = mock.Mock()\n queryset.aggregate.return_value = None\n\n dimension = models.QuantitativeDimension(\n key='shares',\n name='Count of shares',\n description='Count of shar...
[ "0.8197148", "0.6618275", "0.6484984", "0.64601654", "0.63697124", "0.6269415", "0.6174672", "0.6106884", "0.608165", "0.6080813", "0.60700256", "0.6020781", "0.60202074", "0.5981426", "0.59406525", "0.58997625", "0.5883565", "0.5879113", "0.5847939", "0.5835961", "0.5828512"...
0.9391207
0
Test case for get_range
def test_get_range(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_meta_range(self):\n pass", "def getRange(self, p_int): # real signature unknown; restored from __doc__\n pass", "def _in_range_op(spec):", "def f_get_range(self, copy=True):\n raise NotImplementedError(\"Should have implemented this.\")", "def GetTRange(self):\n ......
[ "0.80703026", "0.7837224", "0.7255473", "0.7147124", "0.7073319", "0.7031268", "0.70060104", "0.6990455", "0.6969976", "0.6872395", "0.68121374", "0.67698324", "0.6767907", "0.6744316", "0.67391896", "0.67225266", "0.6692281", "0.66836524", "0.6643143", "0.6600423", "0.659429...
0.92907894
0