query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Yield successive nsized chunks from lst.
def chunks(lst, n): for i in range(0, len(lst), n): yield lst[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "def chunks(lst: list, n: int):\n for i in range(0, len(lst), n):\n yield lst[i : i + n]", "def chunks(lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "de...
[ "0.83065915", "0.81933653", "0.819034", "0.819034", "0.81895167", "0.81260854", "0.8121158", "0.8121158", "0.8076653", "0.8051997", "0.8051997", "0.8051997", "0.8051997", "0.8051997", "0.800331", "0.78704953", "0.7845633", "0.7828545", "0.78267735", "0.7813666", "0.780187", ...
0.8052682
28
close the underlying sqlite connection does nothing if db is not open
def close(self): if self._dbopen: self._dbcon.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_db(nothing):\n if hasattr(g, 'sqlite_db'):\n g.sqlite_db.close()", "def close_db(error):\n if hasattr(g, 'sqlite_db'):\n g.sqlite_db.close()", "def close_db(connection: sqlite3.Connection):\n connection.commit()\n connection.close()", "def close_db(error):\n if hasa...
[ "0.8454129", "0.8149841", "0.8129209", "0.8094868", "0.8084425", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "0.8078737", "...
0.7719619
36
Get the value at the position i. This function enables the direct use of [] on the class variable.
def __getitem__(self, i): if i < self.n: return self.v[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, i):\n return self.__x[i]", "def __getitem__(self, i):\n return self._ar[i]", "def __getitem__(self, i):\n return self.data[i]", "def __getitem__(self, i):\n return self.get(i, i + 1)", "def __getitem__(self,i):\n return self._items[i]", "def __geti...
[ "0.7798214", "0.7780655", "0.7698075", "0.7553668", "0.7417038", "0.7406207", "0.73919463", "0.73919463", "0.73455113", "0.72985995", "0.7201157", "0.7168332", "0.711198", "0.711198", "0.7078776", "0.7071229", "0.70249987", "0.6970516", "0.6964313", "0.6954501", "0.69464606",...
0.76488507
3
Log an error to wsgi.error Prepends timestamp and request info to message, and writes the result out to the WSGI server's error stream (wsgi.error).
def log_error(self, message): u = six.text_type log_line = ( u('{0:%Y-%m-%d %H:%M:%S} [FALCON] [ERROR] {1} {2}?{3} => {4}\n'). format(datetime.now(), self.method, self.path, self.query_string, message) ) self._wsgierrors.write(log_line)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def err(message):\n\n timestamp = format_time(get_time())\n message = '{} - [ERROR] - {}'.format(timestamp, message)\n _log_status(message)", "def error(error_message: str):\n logger.error(error_message)", "def log_error(task_request, message):\n _log(logger.error, task_request, message)", "de...
[ "0.7171848", "0.69868", "0.6958807", "0.6930659", "0.69059", "0.6839625", "0.6751055", "0.67479265", "0.674449", "0.67396736", "0.66925055", "0.6686761", "0.66611993", "0.6657639", "0.6657271", "0.66560084", "0.6643298", "0.6623296", "0.66136605", "0.6601584", "0.6571023", ...
0.808306
0
Get the value of the indexth node in the linked list. If the index is invalid, return 1.
def get(self, index): if index < 0 or index >= self._size: return -1 current = self._head for _ in range(index): current = current.next return current.val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, index: int) -> int:\n node = self.get_node(index)\n if node:\n return node.val\n else:\n return -1", "def get(self, index: int) -> int:\n cnt = 0\n cur = self.head \n while cur != None:\n if(cnt == index):\n r...
[ "0.8311008", "0.82245135", "0.8102407", "0.79835325", "0.7973164", "0.7967605", "0.79506755", "0.7929558", "0.7907135", "0.7801121", "0.77369666", "0.77333367", "0.7653241", "0.758598", "0.75087315", "0.74754", "0.74559134", "0.73894787", "0.73894787", "0.7385615", "0.7339518...
0.7953716
6
Add a node of value val before the first element of the list.
def addAtHead(self, val): new_head = Node(val) if self._size == 0: self._head = new_head self._tail = self._head else: new_head.next = self._head self._head = new_head self._size += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_first(self, value):\n self.head = Node(value, self.head)", "def push_front(self, val: Generic[T]) -> None:\n first_node = self.node.next\n\n self.node.next = Node(val)\n latest_first = self.node.next\n\n latest_first.prev = self.node #pushes the node to the fron...
[ "0.75359005", "0.75086516", "0.7265766", "0.7210811", "0.7187026", "0.7126818", "0.7114664", "0.7041331", "0.7002334", "0.6998083", "0.6960361", "0.6928426", "0.6926228", "0.6917831", "0.6886178", "0.6874261", "0.6874261", "0.6840014", "0.68365437", "0.679333", "0.6742933", ...
0.67412835
21
Add a node of value val after the last element of the list.
def addAtTail(self, val): new_tail = Node(val) if self._size == 0: self._head = new_head self._tail = self._head else: self._tail.next = new_tail self._tail = new_tail self._size += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_last(cls, node, value):\n # Check if element is the last element\n if node.next_ is None:\n node.next_ = Node(value)\n return\n\n # Recursively go to next node\n cls._add_last(node.next_, value)", "def add_last(self, value):\n # Checking for empty...
[ "0.77002114", "0.7513865", "0.74891615", "0.7414042", "0.7398241", "0.7382787", "0.73721033", "0.72939277", "0.72939277", "0.72505826", "0.72505206", "0.7214177", "0.7208675", "0.7198463", "0.7197716", "0.71453947", "0.711029", "0.68684894", "0.68575907", "0.66421765", "0.658...
0.71226496
16
Add a node of value val before the indexth node in the list. If the index equals the length of the list, the node will be appended to the end of the list. If the index is greater than the length, the node will not be inserted.
def addAtIndex(self, index, val): if index < 0 or index > self._size: return elif index == 0: self.addAtHead(val) return elif index == self._size: self.addAtTail(val) return current = self._head for _ in range(index - 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addAtIndex(self, index, val):\n if index > 0 and not self.head:\n return\n \n tmp = Node(val)\n if index == 0 and not self.head:\n self.head = tmp\n self.tail = self.head\n return\n if index == 0 and self.head:\n tmp.nxt ...
[ "0.7801983", "0.7746048", "0.77117217", "0.756655", "0.7557875", "0.75423664", "0.75372857", "0.75194174", "0.74926656", "0.74786055", "0.7406398", "0.739157", "0.739157", "0.7191553", "0.7156409", "0.6995385", "0.6900678", "0.68737906", "0.6870034", "0.6850803", "0.68461645"...
0.73364395
13
initializeWeights return the random weights for Neural Network given the number of node in the input layer and output layer
def initializeWeights(n_in,n_out): epsilon = sqrt(6) / sqrt(n_in + n_out + 1); W = (np.random.rand(n_out, n_in + 1)*2* epsilon) - epsilon; return W
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(no_input, no_hidden, no_output):\r\n weight_lst = []\r\n no_of_weights = (no_input * no_hidden) + (no_hidden * no_output)\r\n\r\n for weight in range(no_of_weights):\r\n weight = 0.01 * random.random()\r\n weight_lst.append(weight)\r\n\r\n return weight_lst", "def init_...
[ "0.7995273", "0.7987062", "0.79761446", "0.77877796", "0.7781093", "0.7772578", "0.7736843", "0.76852494", "0.7664244", "0.7654055", "0.7639197", "0.76340383", "0.76330215", "0.75987977", "0.75979745", "0.7582952", "0.756378", "0.749872", "0.7494168", "0.7485116", "0.74713874...
0.7468421
22
Notice that z can be a scalar, a vector or a matrix return the sigmoid of input z
def sigmoid(z): return vSigmoid(z);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(z): \n return 1/(1 + np.e**(-z))", "def sigmoid(z):\r\n \r\n return 1.0 / (1.0+np.exp(-z))", "def sigmoid(z):\n return 1 / (1 + np.exp(-1 * z))", "def sigmoid(z):\n\treturn 1.0/(1.0+np.exp(-z))", "def sigmoid(z):\n return 1 / (1 + np.exp(-z))", "def sigmoid(z):\n return 1.0...
[ "0.89285356", "0.8770069", "0.87670714", "0.8723193", "0.87211955", "0.8716885", "0.8681525", "0.86775136", "0.86584294", "0.86462337", "0.8634294", "0.8619663", "0.8604683", "0.8585694", "0.8568702", "0.8556937", "0.8535373", "0.85267645", "0.85234636", "0.8511279", "0.85052...
0.89412093
0
Returns True if debugger REPL is currently active.
def is_debugger_active() -> bool: global _is_debugger_active return _is_debugger_active
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_enabled(self):\n try:\n import SublimeREPL # noqa\n return bool(self.get_virtualenv())\n except ImportError:\n return False", "def is_interactive_mode():\n return 'INTERACTIVE_MODE' in os.environ and os.environ['INTERACTIVE_MODE']=='true'", "def _is_int...
[ "0.69906026", "0.6908528", "0.6903691", "0.6875724", "0.6796649", "0.6792559", "0.6785219", "0.6719658", "0.667868", "0.66521037", "0.65209067", "0.6504046", "0.64560485", "0.6451899", "0.641265", "0.6363826", "0.63502914", "0.63413477", "0.6339366", "0.6336778", "0.63202816"...
0.7801601
0
Returns the namespace of the current running job or ''.
def get_current_job_namespace(required=True) -> str: scheduler = get_current_scheduler(required=required) if scheduler: job = scheduler.get_current_job() if job: return job.task.namespace return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namespace(self):\n return self._execution_namespace.maps[0]", "def namespace(self) -> Optional[str]:\n return pulumi.get(self, \"namespace\")", "def namespace(self) -> Optional[str]:\n return pulumi.get(self, \"namespace\")", "def namespace(self) -> Optional[str]:\n return pul...
[ "0.7477391", "0.74336064", "0.74336064", "0.74336064", "0.7420307", "0.7420307", "0.7420307", "0.7420307", "0.7420307", "0.7300208", "0.7246103", "0.7246103", "0.7246103", "0.7246103", "0.7246103", "0.7246103", "0.7246103", "0.7246103", "0.7246103", "0.7246103", "0.7246103", ...
0.8890766
0
Increments the resource limits used with the supplied job limits.
def _consume_resources(self, job_limits: Dict[str, int]) -> None: for limit_name, count in job_limits.items(): self.limits_used[limit_name] += count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _release_resources(self, job_limits: Dict[str, int]) -> None:\n for limit_name, count in job_limits.items():\n self.limits_used[limit_name] -= count", "def _add_job_pending_limits(self, job: Job, eval_args: Tuple[Tuple, dict]) -> None:\n self._jobs_pending_limits.append((job, eval_ar...
[ "0.7476188", "0.62513745", "0.5766711", "0.5553519", "0.5472164", "0.5360784", "0.53416866", "0.5199512", "0.5175988", "0.5175453", "0.51278937", "0.50853205", "0.5075789", "0.5073169", "0.5043231", "0.5030346", "0.501035", "0.49935257", "0.49776602", "0.49582", "0.49422598",...
0.75109017
0
Returns True if the value is valid. Valid Nested Values must have all of their subvalues be valid.
def is_valid_value(self, value: Any) -> bool: return self.type_registry.is_valid_nested(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_valid_values(self):\n for element, value in self.items():\n if not (0 <= value <= 1):\n return False\n return True", "def is_valid(self):\n return self.has_valid_values() and self.has_valid_sum()", "def is_valid_value(self, value):\n return value in...
[ "0.6912215", "0.68771243", "0.6813258", "0.6422075", "0.6400205", "0.63942474", "0.6225781", "0.6197763", "0.6194301", "0.6171466", "0.61584455", "0.6151103", "0.61449265", "0.61285686", "0.611772", "0.61024266", "0.6100298", "0.60888094", "0.6087818", "0.6078333", "0.607575"...
0.82905567
0
Apply tags to a value. Returns the original value.
def apply_tags( scheduler: Scheduler, parent_job: Job, sexpr: SchedulerExpression, value: Any, tags: List[Tuple[str, Any]], ) -> Promise: def then(args): value, tags = args value_hash = scheduler.backend.record_value(value) parent_job.value_tags.append((value_hash, tags)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags_handler(ctx, param, value):\n retval = from_like_context(ctx, param, value)\n if retval is None and value:\n try:\n retval = dict(p.split('=') for p in value)\n except:\n raise click.BadParameter(\n \"'%s' contains a malformed tag.\" % value,\n ...
[ "0.60863465", "0.60103345", "0.58741117", "0.5756815", "0.56959736", "0.5685469", "0.559556", "0.5582953", "0.55477524", "0.5525336", "0.5520321", "0.550311", "0.5488146", "0.54735464", "0.5465069", "0.5444343", "0.54108995", "0.54002804", "0.5390809", "0.53198767", "0.530468...
0.60370874
1
test get single order endpoint
def test_get_one(self): response = self.client.get('/api/v1/parcels/100') self.assertEqual(response.status_code, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_single_order(client):\n resp = client.get(\n '/v1/orders/1/', headers={'Authorization': 'Bearer ' + signin(client)})\n assert resp.status_code == 200\n assert b'order_id' in resp.data", "def test_get_order(self):\n test_order = self._create_orders(1)[0]\n resp = self.ap...
[ "0.86216414", "0.79897094", "0.79393685", "0.79091305", "0.7850304", "0.78040946", "0.7795355", "0.7675466", "0.76710373", "0.75352573", "0.75261855", "0.74449664", "0.7442665", "0.73159933", "0.730178", "0.7255196", "0.7191828", "0.7168795", "0.71075267", "0.71075267", "0.71...
0.681013
35
test get single user orders endpoint
def test_get_all_by_one_user(self): response = self.client.get('/api/v1/users/5/parcels') result = json.loads(response.data.decode()) self.assertEqual(result["message"], "User does not have orders", msg = "User orders") self.assertEqual(response.status_code, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_single_order_by_user(client):\n resp = client.get(\n '/v1/orders/1/', headers={'Authorization': 'Bearer ' + user_two(client)})\n assert resp.status_code == 401\n assert b'Not authorized' in resp.data", "def test_get_single_order(client):\n resp = client.get(\n '/v1/orders/1...
[ "0.84673715", "0.7977571", "0.7890604", "0.76547015", "0.7630685", "0.7593679", "0.75713634", "0.7476535", "0.7325753", "0.725968", "0.71052", "0.70971084", "0.70817274", "0.7028726", "0.701616", "0.70158327", "0.69560057", "0.6910765", "0.68999344", "0.6897784", "0.68625677"...
0.75452715
7
Allows using [] operator for a BitBoard object to set the nth bit from the right.
def __setitem__(self, n, bit): self.num ^= (np.uint64(-bit) ^ self.num) & (UINT64_ONE << np.uint64(n))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\n nth_int, nth_bit = divmod(index, BitArray._UNSIGNED_INT)\n return self.bits[nth_int] & (1 << nth_bit)", "def __getitem__(self, n):\n return (self.num >> np.uint64(n)) & UINT64_ONE", "def __right(self,i):\n return (1+i)<<1", "def bit_get(val, idx):\n ...
[ "0.6600082", "0.6420377", "0.63657767", "0.62556946", "0.6144708", "0.6117865", "0.6029796", "0.6002378", "0.5959951", "0.586552", "0.5807293", "0.5789982", "0.57855594", "0.5774379", "0.57019717", "0.5695542", "0.5632656", "0.5592799", "0.559118", "0.55899686", "0.5588455", ...
0.6546778
1
Allows using the equality operator (==) on a BitBoard object. Returns True if self and other have the same number, False otherwise.
def __eq__(self, other): return self.num == other.num
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n\n return self.board == other.board", "def __eq__(self, other) -> None:\n\t\tfor k, v in enumerate(self.board):\n\t\t\tif v != other.board[k]:\n\t\t\t\treturn False\n\t\treturn True", "def __eq__(self, other):\n for row in range( self.n ):\n if self.board[row]...
[ "0.8070382", "0.805799", "0.77454346", "0.767191", "0.76465017", "0.76300716", "0.7608308", "0.75929505", "0.7576381", "0.75488883", "0.75417995", "0.7526526", "0.75236315", "0.75236315", "0.7514441", "0.7502197", "0.7491754", "0.74679625", "0.7439439", "0.74248344", "0.73516...
0.79679054
2
Returns the indices of bits with value 1. Returns list of int the indices of bits with value 1
def indices(self): # We used lookup tables here. Read more about other methods here: # https://chessprogramming.wikispaces.com/Bitboard+Serialization if self.num == 0: return [] bits = [] for i in [0, 1, 2, 3, 4, 5, 6, 7]: row = (self.num >> UINT64_PAD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bit_positions(bit_mask):\n\tbit_positions = []\n\t# find bit positions of enabled bits in mask\n\tfor i in range(16):\n\t\tif (bit_mask & (1 << i)) != 0:\n\t\t\tbit_positions.append(i)\n\treturn bit_positions", "def get_34index_list(self):\n msk = self.load_mask()\n return [i for (i,v) in e...
[ "0.6909748", "0.6833257", "0.67429155", "0.67052376", "0.6481154", "0.6463856", "0.64460653", "0.64271104", "0.6426531", "0.64205873", "0.63719845", "0.636592", "0.6326136", "0.6322175", "0.6287802", "0.6279872", "0.6268501", "0.6246899", "0.6188786", "0.6179556", "0.61688864...
0.750294
0
Adds the speficied dictionary of error tables as an instance variable. (Replaces an older value disctionary if set)
def add_error_tables(self, error_tables): self.error_distribution = error_tables
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addErrorNodesDict(self, errorDict):\n self.errorDict.update(errorDict)", "def _initialize_error_dictionaries(self):\n for task_id in self.task_ids.keys():\n self.training_errors[task_id] = []\n self.validation_errors[task_id] = []", "def _setErrorNodesDict(self, errorDic...
[ "0.63875175", "0.63237154", "0.6250422", "0.61268705", "0.58674365", "0.57235926", "0.5662186", "0.5658745", "0.56573224", "0.5638606", "0.5595749", "0.5590731", "0.5580868", "0.54845446", "0.5465659", "0.545673", "0.54328537", "0.538873", "0.53511834", "0.5336923", "0.532571...
0.69739336
0
populates a dictionary counting all ngrams in the specified text.
def build_model(self , text, n=3): #should be called build_model self.n = n self.vocab = Counter(words(text)) tokens=tokenize(text) for gram in list(ngrams(tokens,self.n)): self.lm_dict[tuple(gram[:-1])][gram[-1]]+=1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_ngrams(self, n):\n\n output = {}\n\n for i in range(len(self.text)-n+1):\n s = ' '.join(self.text[i:i+n])\n # if s is not already in dictionary, set value to 0\n output.setdefault(s, 0)\n output[s] += 1\n return output", "def calculate_ngr...
[ "0.76285636", "0.743605", "0.72238445", "0.7215294", "0.70278937", "0.6968827", "0.6953542", "0.694321", "0.69221735", "0.6906369", "0.6857672", "0.6839784", "0.67987186", "0.67811936", "0.6777076", "0.67605853", "0.67380834", "0.6720923", "0.67070496", "0.65778077", "0.65403...
0.6347514
32
create_app creates an Flask app object, and a socket io object. It also registers a blue print that is imported by the files in the main package
def create_app(debug=False): global app app.config.from_object(__name__) app.config['UPLOAD_FOLDER'] = '/uploads' app.debug = debug app.config['SECRET_KEY'] = 'asdq2312ds1242!67#' from .main import main as main_blueprint app.register_blueprint(main_blueprint) socketio.init_app(app) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app():\n app = Flask(__name__)\n app.register_blueprint(playlists)\n app.register_blueprint(comments)\n return app", "def create_app():\n app = Flask(__name__, instance_relative_config=False)\n app.config.from_object('config.Config')\n db.init_app(app)\n flask_bcrypt.init_app(a...
[ "0.7563264", "0.7527995", "0.7485648", "0.74477476", "0.74352574", "0.73063874", "0.7306316", "0.7302207", "0.72605777", "0.7174654", "0.7147145", "0.7112591", "0.70951277", "0.7070864", "0.70504856", "0.7037347", "0.7022989", "0.6999846", "0.69853395", "0.6979507", "0.696476...
0.7959263
0
Put a dummy file in the storage path for a specific org / repo / oid combination This is useful where we want to test download / verify actions without relying on 'put' actions to work This assumes cleanup is done somewhere else (e.g. in the 'storage_path' fixture)
def create_file_in_storage(storage_path, org, repo, filename, size=1): repo_path = os.path.join(storage_path, org, repo) os.makedirs(repo_path, exist_ok=True) with open(os.path.join(repo_path, filename), 'wb') as f: for c in (b'0' for _ in range(size)): f.write(c)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_upload_existing_empty_file(self):\n ps = PersistenceStore(s3_client=S3ExistingEmptyUpload())\n\n with pytest.raises(Exception) as e:\n ps.update({}, 'filename.json')\n\n assert str(e.value) == 'Unable to get the json data path: ' \\\n 'develope...
[ "0.6258613", "0.6189135", "0.61518425", "0.60565114", "0.60427105", "0.6016234", "0.5982426", "0.5973468", "0.59150803", "0.58627594", "0.5852138", "0.583377", "0.5828712", "0.58081144", "0.5781546", "0.5768488", "0.57525533", "0.57150567", "0.5677788", "0.5660889", "0.564079...
0.6378536
0
Updates the configured email address in json with the specified one.
async def update_email_address(self, ctx, email_address: str): author = ctx.message.author if not EmailAddressCRUD.validate_email_address(email_address): await ctx.send("Enter a valid Email Address..!") return if not self.email_list: with open("data/email/em...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def add_email_address(self, ctx, email_address: str):\n author = ctx.message.author\n\n if not EmailAddressCRUD.validate_email_address(email_address):\n await ctx.send(\"Enter a valid Email Address..!\")\n return\n\n if not self.email_list:\n with open(\"...
[ "0.6758696", "0.6649319", "0.66205174", "0.65814", "0.6533284", "0.65299386", "0.6464649", "0.64231926", "0.6363455", "0.63367385", "0.63367385", "0.63367385", "0.63367385", "0.63367385", "0.63367385", "0.63367385", "0.63367385", "0.63367385", "0.63367385", "0.62972623", "0.6...
0.73792857
0
Returns the first element child of this element.
def get_first_element_child(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def firstElementChild(self):\n ret = libxml2mod.xmlFirstElementChild(self._o)\n if ret is None:return None\n __tmp = xmlNode(_obj=ret)\n return __tmp", "def get_first_node_child(self):\n\n pass", "def first(self) -> Element:\n return typing.cast(Element, self[0])", "...
[ "0.8507301", "0.8238897", "0.79082304", "0.7360048", "0.72247976", "0.72134984", "0.71871084", "0.6927866", "0.68941164", "0.6875892", "0.68544686", "0.68317795", "0.6822144", "0.6801163", "0.677644", "0.6774803", "0.6774803", "0.6774803", "0.6774803", "0.6774803", "0.6754091...
0.88465154
0
Returns the pytz timezone for a given profile.
def getTimezone(profile): try: return timezone(profile['timezone']) except: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_timezone(time_zone=''):\n return pytz.timezone(time_zone)", "def get_timezone():\n return dates.get_timezone(_get_tz())", "def get_timezone(timezone: str=None) -> datetime.tzinfo:\n if timezone[0] in ('+', '-'):\n timezone = 'UTC' + timezone\n result = tz.gettz(timezone)\n if resu...
[ "0.69419193", "0.67402077", "0.66546315", "0.6631868", "0.66101515", "0.6541733", "0.6470264", "0.6251289", "0.62325686", "0.6216805", "0.61196643", "0.6094955", "0.60639185", "0.60381806", "0.5943455", "0.58599806", "0.5823649", "0.57957953", "0.57694757", "0.575144", "0.575...
0.83175576
0
Returns the name of the materializer.
def name (self): assert False, "To be implemented by child"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMediatorName(self):\n return self.mediatorName", "def name ( self ) :\n return self.__name if self.__name else ''", "def name(self):\n return self.__name__", "def name(self):\n return self.__class__.__name__", "def name(self):\n return self.__class__.__name__", "...
[ "0.65224195", "0.63775295", "0.62668407", "0.6200436", "0.6200436", "0.6200436", "0.6200436", "0.6200436", "0.618134", "0.61380786", "0.61380786", "0.61380786", "0.61380786", "0.61380786", "0.61380786", "0.61380786", "0.61380786", "0.61380786", "0.61380786", "0.61333406", "0....
0.0
-1
Return the neighbor edges of a set of nodes.
def get_neighbor_edges(G, nodes_in_community, weak_neighbor=False): neighbor_nodes = [] for n in nodes_in_community: neighbor_nodes.extend([n for n in nx.neighbors(G, n) if n not in nodes_in_community]) neighbor_nodes = set(neighbor_nodes) neighbor_edges = [e for e in G.edges(neighbor_nodes)] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges(self) -> Set[Tuple[int, int]] : \n edges : Set[Tuple[int, int]] = set()\n for node_id in self.nodes: # iterator over id's\n for adj_node in self.nodes[node_id]:\n edge = (node_id, adj_node)\n if self.directed:\n edges.add(edge)\n ...
[ "0.7348738", "0.7197039", "0.7146783", "0.6978789", "0.6972652", "0.6972293", "0.69439906", "0.6938552", "0.6898308", "0.6862105", "0.68566513", "0.6813812", "0.67470586", "0.6730679", "0.6730679", "0.6730679", "0.67134553", "0.67109674", "0.66546625", "0.663519", "0.6599332"...
0.659339
21
Find the local community for the seed node.
def find_local_community(G, seed_node, weight, debug_log=False): nodes_in_community = seed_node if isinstance(seed_node, list) else [seed_node] modularity = edge_modularity(G, nodes_in_community=nodes_in_community, weight=weight) neighbor_edges = get_neighbor_edges(G, nodes_in_community=nodes_in_community) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def community(self):\n return self._community", "def _community(G, u, community):\n node_u = G.node[u]\n try:\n return node_u[community]\n except KeyError:\n raise nx.NetworkXAlgorithmError('No community information')", "def _find_community(root, graph, visited):\n community = ...
[ "0.652206", "0.6459925", "0.5959517", "0.58640003", "0.5684736", "0.5551548", "0.55422515", "0.5508503", "0.5450635", "0.544914", "0.5366517", "0.53642875", "0.5312185", "0.5310343", "0.53053504", "0.5293446", "0.52867824", "0.52631557", "0.52428997", "0.51661354", "0.5139232...
0.7691389
0
A Test Fixture method that sets up your testing evironment.
def setUp(self): self.phonebook = Phonebook()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n test_env_setup()", "def setUp(self):\n self.setup_beets()", "def setUpFixture(self):\n pass", "def setUp(self):\n set_environment_vars()\n\n # Careful! We must set the environment variables to test values\n # _before_ importing the espresso app, ot...
[ "0.80293226", "0.7630762", "0.7500551", "0.74952453", "0.7489597", "0.7480113", "0.74644", "0.74414784", "0.7425531", "0.74181616", "0.7417286", "0.7369186", "0.7368695", "0.73341686", "0.7333627", "0.7332773", "0.7328504", "0.73250586", "0.7321159", "0.7321159", "0.7305308",...
0.0
-1
Set up a 2D list with 0 as starting value. Basically an empty maze
def init_maze(width: int, height: int) -> list[int]: return [0] * width * height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_grid(grid):\r\n for i in range (4):\r\n grid.append ([])\r\n for j in range (4):\r\n grid[i].append (0)", "def __maze_generator(self):\n grid = []\n for row in range(self.__row_count):\n new_row = []\n for col in range(self.__col_count):\...
[ "0.7078072", "0.6726312", "0.6667954", "0.65988696", "0.6592018", "0.6586149", "0.65791607", "0.65193844", "0.6518248", "0.6514708", "0.6500651", "0.64990073", "0.6433521", "0.6429563", "0.6405995", "0.6403955", "0.6391828", "0.63908464", "0.63875794", "0.6382868", "0.6342751...
0.8038226
0
Convert string to int, float or bool.
def convert_string(string): if is_int(string): return int(string) elif is_float(string): return float(string) elif convert_bool(string)[0]: return convert_bool(string)[1] elif string == 'None': return None else: return string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_to_value(s):\n s = s.strip()\n if _int_matcher.match(s):\n return int(s)\n elif _float_matcher.match(s):\n return float(s)\n elif _bool_matcher.match(s):\n return (s.lower() == 'true')\n return s", "def coerce(s1):\n if s1==\"true\":\n return True\n elif s...
[ "0.76828194", "0.76553977", "0.73779297", "0.72374725", "0.7179624", "0.71139807", "0.70939726", "0.70842993", "0.7072454", "0.7065246", "0.70618755", "0.69620097", "0.6934844", "0.69268525", "0.69156003", "0.6890665", "0.68512964", "0.68299043", "0.68206966", "0.6815045", "0...
0.72516483
3
Sets the learning rate
def adjust_learning_rate(optimizer, gamma, epoch, step_index, iteration, epoch_size): warmup_epoch = -1 if epoch <= warmup_epoch: lr = 1e-6 + (initial_lr-1e-6) * iteration / (epoch_size * warmup_epoch) else: lr = initial_lr * (gamma ** (step_index)) for param_group in optimizer.par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_learning_rate(self, rate):\n self.SGD.set_learning_rate(rate)", "def adjust_lr(self):\n learning_rate = self.params.base_lr * (1 - float(self.epoch) / self.params.num_epoch) ** self.params.power\n for param_group in self.opt.param_groups:\n param_group['lr'] = learning_rat...
[ "0.8623272", "0.76981455", "0.7697208", "0.7697208", "0.7636927", "0.758479", "0.7572249", "0.7514606", "0.7490861", "0.74744666", "0.74288964", "0.7413075", "0.739503", "0.73916996", "0.73894364", "0.73817927", "0.73783433", "0.7377333", "0.7363047", "0.7362884", "0.7362884"...
0.0
-1
Returns whether or not current DCC support URI scheme implementation
def supports_uri_scheme(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_compatible_scheme(url):\n return url.startswith(('http://', 'https://'))", "def isRegularURI(self):\n return self._isRegularURI", "def isPkgURIEnabled(self, *args):\n return _libsbml.SBase_isPkgURIEnabled(self, *args)", "def _isurl(self, path):\n\n # We do this here to reduce ...
[ "0.7197058", "0.65631914", "0.63984764", "0.6365035", "0.63350475", "0.6291965", "0.6282432", "0.62231255", "0.6218938", "0.6122386", "0.6116158", "0.609617", "0.6037339", "0.58740777", "0.5857427", "0.5800984", "0.5788891", "0.57773966", "0.5712446", "0.57089776", "0.5688984...
0.859689
0
Load the image of mask. This works with Supervisely annotation json file.
def load_mask(path, image, mask_name='module_unet', center=True): with open(path, 'r') as file: data = json.load(file) # if len(data["objects"]) == 0: # return None # code = data["objects"][0]["bitmap"]["data"] # origin = data["objects"][0]["bitmap"]["origin"] # else: # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_mask(self):\n mask_file = fetch_one_file(self.ica_dir, self._mask_fname, pat_type='re.match')\n return niimg.load_img(mask_file)", "def load_annaation(self, image_id):\n info = self.image_info[image_id]\n # Get mask directory from image path\n mask_dir = os.path.join(o...
[ "0.7540442", "0.75327075", "0.7476259", "0.73453903", "0.70858043", "0.707864", "0.6993998", "0.69673216", "0.69632465", "0.69568247", "0.69354737", "0.6841621", "0.6828853", "0.68196183", "0.68090135", "0.67677844", "0.67606544", "0.6743097", "0.67394066", "0.67362666", "0.6...
0.7401739
3
Apply the given mask to the image.
def apply_mask(image, mask, color): for c in range(3): image[:, :, c] = np.where(mask == 1, image[:, :, c] + color[c], image[:, :, c]) return image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_mask(self, mask_band=None, mask_val=None):\n pass", "def apply_mask_to_image(image, mask, return_as_image=True):\n (n,m,k) = np.shape(image)\n image = np.reshape(image, (n*m, k))\n mask = np.ravel(mask)\n\n if return_as_image:\n image[np.invert(mask), :] = 0\n image = n...
[ "0.75504893", "0.73056287", "0.72248185", "0.72057945", "0.7145598", "0.7126981", "0.70481926", "0.7020258", "0.69846356", "0.69273317", "0.68956983", "0.6871981", "0.68613625", "0.68212813", "0.67841756", "0.66909254", "0.6669622", "0.6626324", "0.66110665", "0.65875024", "0...
0.71063143
6
Load a JSON file into a dictionary object
def load_json(path): with open(path) as data_file: return json.load(data_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_json(file_path):\n\n \n with open(file_path, 'r') as json_file:\n # print(file_path)\n dictionary = json.loads(json_file.read())\n\n return dictionary", "def json_load(path):\n with open(path) as f:\n dictionary = json.load(f)\n return dictionary", "def load_json(fi...
[ "0.8200822", "0.8155211", "0.81521964", "0.81478196", "0.80547947", "0.8003142", "0.7955173", "0.79148436", "0.78972894", "0.78889567", "0.7887031", "0.786984", "0.78247756", "0.7800903", "0.77757156", "0.7761933", "0.77475476", "0.7707722", "0.7693044", "0.7685587", "0.76743...
0.73054796
72
Return primary monitor desktop offset in points.
def getDesktopOffset(force_refresh=False): global __desktop_offset if __desktop_offset is None or force_refresh: refreshDesktopOffset() return __desktop_offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDesktopSize(self):\n return convToUnits(self.desktopBytes, divby=1000)", "def wm_offset(self):\n return self.get_par(\"offset\")", "def screenPos(self):\n return Point(self._screenPos)", "def screenPos(self):\n return Point(self._screenPos)", "def screenPos(self):\n return...
[ "0.6662204", "0.6655784", "0.664291", "0.664291", "0.664291", "0.64892423", "0.64192665", "0.64087564", "0.6281043", "0.6261143", "0.6179859", "0.6086983", "0.6045123", "0.6001935", "0.59499735", "0.5931384", "0.5931384", "0.5923738", "0.5847856", "0.5838969", "0.5837365", ...
0.71903294
0
Return primary monitor workarea offset in points. Workarea is the desktop area not covered with taskbar and appbars.
def getWorkareaOffset(force_refresh=False): global __workarea_offset if __workarea_offset is None or force_refresh: refreshWorkareaOffset() return __workarea_offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDesktopOffset(force_refresh=False):\n global __desktop_offset\n if __desktop_offset is None or force_refresh:\n refreshDesktopOffset()\n return __desktop_offset", "def get_offset(tk_window):\n\n width_offset = int(\n (tk_window.winfo_screenwidth() / 2) - (tk_window.winfo_...
[ "0.63393426", "0.61591697", "0.6150354", "0.60519344", "0.5935901", "0.5818543", "0.5691967", "0.55492973", "0.55326104", "0.5528017", "0.5526002", "0.55244094", "0.5519584", "0.5519127", "0.5495766", "0.54810524", "0.5468406", "0.5464962", "0.54371643", "0.54123706", "0.5399...
0.6507861
0
This function plots heatmap for the confusion matrix generated using y_targeted and y_predicted data
def plot_confusion_matrix(y_targeted, y_predicted, instrument_classes, directory_name): cm = confusion_matrix(y_targeted, y_predicted) np.set_printoptions(precision=2) cm = cm / cm.astype(np.float).sum(axis=1) print("Normalized confusion matrix:\n", cm) fig = plt.figure(figsize=(10, 7)) cmap = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_conf_mat(y_test, y_preds):\n sns.set(font_scale=1.5) # Increase font size\n fig, ax = plt.subplots(figsize=(3, 3))\n ax = sns.heatmap(confusion_matrix(y_test, y_preds),\n annot=True, # Annotate the boxes\n cbar=False)\n plt.xlabel(\"Predicted label\") ...
[ "0.8066013", "0.80252665", "0.7778315", "0.7759368", "0.77332276", "0.77152336", "0.7713815", "0.7702695", "0.7671126", "0.76672614", "0.7659139", "0.7652628", "0.7648334", "0.76348954", "0.7628704", "0.76260024", "0.7625177", "0.7621298", "0.7617312", "0.76113206", "0.759762...
0.77046
7
If the value is None, none of the options are selected, even if the choices have an empty option.
def test_render_none(self): self.check_html( self.widget(choices=(("", "Unknown"),) + self.beatles), "beatles", None, html=( """<select multiple name="beatles"> <option value="">Unknown</option> <option value="J">John</optio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def form_SelectChoiceNoneOption(request):\n schema = schemaish.Structure()\n schema.add('mySelect', schemaish.Integer())\n options = [(1,'a'),(2,'b'),(3,'c')]\n\n form = formish.Form(schema, 'form')\n form['mySelect'].widget = formish.SelectChoice(options,none_option=(None, '--select--'))\n retur...
[ "0.73666894", "0.71223015", "0.6943403", "0.6818605", "0.679304", "0.66263384", "0.64865226", "0.647536", "0.6461249", "0.64589727", "0.63959527", "0.6200899", "0.61092174", "0.60448635", "0.5958023", "0.5958023", "0.5958023", "0.5958023", "0.5958023", "0.5875806", "0.583616"...
0.645006
10
If the value corresponds to a label (but not to an option value), none of the options are selected.
def test_render_value_label(self): self.check_html( self.widget(choices=self.beatles), "beatles", ["John"], html=( """<select multiple name="beatles"> <option value="J">John</option> <option value="P">Paul</option> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_initially_selected(self, value):\n return value in self._get_selected_values_set()", "def is_option_selected(option, field):\n if field.attr.default and option[0] == field.attr.default: # and option[0] != self.empty:\n return ' selected=\"selected\"'\n else:\n return ''", "def...
[ "0.6433461", "0.6280617", "0.61070347", "0.60176915", "0.5815001", "0.5782318", "0.57336885", "0.57087183", "0.56286997", "0.562658", "0.561335", "0.5601482", "0.5585172", "0.55557424", "0.54440963", "0.5425419", "0.54213285", "0.5419213", "0.5282968", "0.528117", "0.527784",...
0.59219635
4
Sums all the mortgage amortization. It should add to the total principal, but currently the calculation is off
def total_amortization(self): return sum(self.table["amortization"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patrimony_total(self):\n pass", "def __add__(self, other):\n add_mortgage = Mortgage(self.principle + other.principle,\n self.interest_rate + other.interest_rate,\n self.year + self.year)\n return add_mortgage", "def total_p...
[ "0.647219", "0.639063", "0.6294372", "0.61901015", "0.61525685", "0.61238", "0.60279775", "0.6022122", "0.5950162", "0.587477", "0.57335323", "0.57253546", "0.57229096", "0.5661687", "0.56520647", "0.5635031", "0.56190145", "0.5566339", "0.5544127", "0.5538678", "0.5524931", ...
0.61009634
6
Determines if the default value is a class instance or undefined
def auto_create(self): return getattr(self, '_auto_create', False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _class_default(self):\n if self.auto_create:\n return self.instance_class\n return utils.undefined", "def test_instance_type_get_by_None_name_returns_default(self):\n default = instance_types.get_default_instance_type()\n actual = instance_types.get_instance_type_by_nam...
[ "0.7069194", "0.6725037", "0.65143675", "0.65143675", "0.65143675", "0.6465582", "0.6364496", "0.6363402", "0.63292426", "0.63022715", "0.6200147", "0.6176509", "0.6147603", "0.60661495", "0.60496604", "0.60468775", "0.6045812", "0.59634167", "0.5938387", "0.59352845", "0.589...
0.0
-1
Serialize instance to JSON If the value is a HasProperties instance, it is serialized with the include_class argument passed along. Otherwise, to_json is called.
def serialize(self, value, **kwargs): kwargs.update({'include_class': kwargs.get('include_class', True)}) if self.serializer is not None: return self.serializer(value, **kwargs) if value is None: return None if isinstance(value, HasProperties): return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(value, **kwargs):\n if isinstance(value, HasProperties):\n return value.serialize(**kwargs)\n try:\n return json.loads(json.dumps(value))\n except TypeError:\n raise TypeError(\n \"Cannot convert type {} to JSON without calling 'seria...
[ "0.74319196", "0.6433768", "0.6339223", "0.6339223", "0.61455107", "0.61295074", "0.6098114", "0.6036568", "0.6005711", "0.596792", "0.59677947", "0.5962791", "0.594594", "0.59456927", "0.59456927", "0.594365", "0.594365", "0.594365", "0.594365", "0.594365", "0.594365", "0....
0.8178763
0
Function for creating DataFrame of trial history related variables. Can be used for design matrix X or to pick and choose useful columns.
def trial_history_columns_df(mouse, meta): # add a binary column for choice, 1 for go 0 for nogo new_meta = {} new_meta['choice'] = np.zeros(len(meta)) new_meta['choice'][meta['trialerror'].isin([0, 3, 5, 7]).values] = 1 meta_df_out = pd.DataFrame(data=new_meta, index=meta.index) # meta_df_out =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_df(Varr, Iarr, POA, T, mode):\n df = pd.DataFrame()\n df['voltage'] = Varr\n df['current'] = Iarr\n df['E'] = POA\n df['T'] = T\n df['mode'] = mode\n return df", "def simple_trial_history_columns_df(mouse, meta):\n # add a binary column for choice, 1 for go 0 for nogo\n new_...
[ "0.6419075", "0.63809985", "0.6367483", "0.63235784", "0.63175976", "0.625328", "0.6215031", "0.60782367", "0.6038968", "0.60110885", "0.60077137", "0.5887368", "0.58663785", "0.5858449", "0.58322334", "0.58090556", "0.5769348", "0.57577574", "0.57574666", "0.57538664", "0.57...
0.65549505
0
Helper function to rename pillow orientation columns to reflect initial training CS.
def add_pillow_interactions(mouse, meta_df, pillow_df): pillow_ori_lookup = {'ori_270_pillow': 270, 'ori_135_pillow': 135, 'ori_0_pillow': 0} # get your unadulterated pillow weight vectors pillow_cols = pillow_df.columns pillow_cols = [s for s in pillow_cols if 'pillow' in s] # loop over differen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_orientation(self):\n self.shape = self.shape.T", "def fix_orientation(self, pImg):\n path = pImg\n lImg = Image.open(pImg)\n lExif = lImg._getexif()\n if lExif != None:\n for tag, value in lExif.items():\n decoded = TAGS.get(tag, tag)\n ...
[ "0.58279693", "0.5704302", "0.56078434", "0.55085444", "0.54635656", "0.5456614", "0.54549474", "0.53871775", "0.53042644", "0.5288474", "0.5285983", "0.5256764", "0.52397776", "0.52055573", "0.52053845", "0.51986295", "0.5175399", "0.5164373", "0.514934", "0.51314", "0.51243...
0.0
-1
Return HTTP Date format string for the given date.
def http_date(d=None): if not d: d = datetime.datetime.utcnow() return d.strftime("%a, %d %b %Y %H:%M:%S GMT")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def httpdate(date_obj):\n return date_obj.strftime(\"%a, %d %b %Y %H:%M:%S GMT\")", "def format_date(self, data):\r\n if self.datetime_formatting == 'rfc-2822':\r\n return format_date(data)\r\n\r\n return data.isoformat()", "def http_date(epoch_seconds=None):\n return formatdate(...
[ "0.7564408", "0.71736807", "0.70907044", "0.7041993", "0.7020039", "0.6957993", "0.69402647", "0.6937533", "0.681382", "0.6779001", "0.6757382", "0.6748315", "0.6686438", "0.6681356", "0.6680811", "0.6673426", "0.6640214", "0.6639268", "0.6624753", "0.6600319", "0.6589593", ...
0.7430065
1
Get the item groups defined on this menu item.
def item_groups(self): return [c for c in self.children if isinstance(c, ItemGroup)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def groups(self):\n return self.get_data(\"groups\")", "def groups(self):\n return self._groups", "def groups(self):\n return self._groups", "def groups(self):\n return self._groups", "def getGroups(self):\n return [g[0] for g in grp.getgrall()]", "def getGroups():\r\n ...
[ "0.7455532", "0.72525597", "0.72525597", "0.72525597", "0.7091769", "0.70838684", "0.7030034", "0.70178616", "0.6910916", "0.68864363", "0.6714535", "0.67005545", "0.6623934", "0.6593663", "0.6585952", "0.6513092", "0.64993805", "0.64914525", "0.64826405", "0.6476484", "0.643...
0.7998321
0
Yield successive nsized chunks from l.
def chunks(l, n): for i in xrange(0, len(l), n): yield l[i:i+n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.74221736
99
Check whether all operators defined in this graph.
def check_nodes(self) -> bool: # check the input-output consistency for op_name in self.__ops: op = cast(Operator, self.__ops[op_name]) inputs: Dict[str, Operator] = op.input_ops for i in inputs.values(): if op not in i.output_op_list: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_unsupported_ops(self):\n unsupported_ops_set = set()\n\n for op_idx in range(self.subgraph.OperatorsLength()):\n op = self.subgraph.Operators(op_idx)\n op_code_str = self.get_op_code_str(op)\n if op_code_str not in self.convert_map:\n unsuppor...
[ "0.681793", "0.67518973", "0.66923434", "0.6670488", "0.66500777", "0.6538026", "0.6447377", "0.6429194", "0.63006896", "0.61979556", "0.6182226", "0.60867333", "0.6051191", "0.599039", "0.5912957", "0.586952", "0.5859405", "0.58540213", "0.5836321", "0.58137226", "0.58137226...
0.6921312
0
return float unix timestamp for timestamp string
def parse_timestamp(ts_str): dt = dateutil.parser.parse(ts_str) return (time.mktime(dt.timetuple()) + dt.microsecond/1000000.0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timestamp_to_unix(timestamp):\n return timestamp / 1e6", "def _get_timestamp(self, timestamp):\n return int(timestamp * 1e6)", "def unix_to_timestamp(unix):\n return int(round(unix * 1e6))", "def unix_timestamp():\n return int(time.time())", "def to_unix_time(timestamp):\n date = dat...
[ "0.76481307", "0.75004333", "0.7454796", "0.72080797", "0.71833223", "0.71688515", "0.7116566", "0.70855683", "0.7076595", "0.70574826", "0.69982064", "0.69758546", "0.6914333", "0.6886947", "0.6824994", "0.68143016", "0.6757515", "0.674048", "0.6712844", "0.67057204", "0.669...
0.6710278
19
format timestamp to datetime string
def format_timestamp(timestamp, msec=False): datefmt="%Y-%m-%dT%H:%M:%S" try: t= datetime.datetime.fromtimestamp(int(timestamp)).strftime(datefmt) if msec: if timestamp == 0: t = "%s.000" % t else: t="{0}.{1:03d}".format(t, int((timestamp*1000)%1000)) t = "%s%s" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_datetime(timestamp):\n return f\"<!date^{int(timestamp)}^{{date_pretty}} at {{time}}| >\"", "def _format_ts(cls, timestamp):\n return localtime(timestamp).strftime('%Y-%m-%d %H:%M:%S')", "def format_timestamp(timestamp):\n try:\n date = datetime.strptime(timestamp, '%Y-%m-%d %H:%...
[ "0.8000468", "0.796402", "0.7861729", "0.78546417", "0.78546417", "0.78546417", "0.7721323", "0.7688386", "0.7688386", "0.75868225", "0.74758357", "0.746605", "0.7423134", "0.7406287", "0.73696965", "0.7364619", "0.73340565", "0.7333523", "0.7280673", "0.7199112", "0.7189158"...
0.7278687
19
Tells the GUI wether the option should be enabled or disabled. Returns True if the option should be enabled and False if it should be disabled. is_set is a function that returns True if an option is enabled and has been edited by the user, else False. It takes one argument, the name of an option as a string. get_value ...
def _canEnable(self, is_set, get_value): parents = any([is_set(parent) for parent in self.parents]) \ or not self.parents non_parents = all([(not is_set(non_parent) or self.non_parent_exceptions.count(non_parent) or non_parent==self.name) \ for non_parent in self.non_parents]) \ or not self.no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _canEnableContinousOption(self, is_set, get_value):\n\t\tr = self._canEnable(is_set, get_value)\n\t\tif r and is_set(self._speaker) and \\\n\t\t\t get_value(self._speaker)[0] in self._enable_values:\n\t\t\treturn r\n\t\telse:\n\t\t\treturn False", "def get_bool(options, name, default=False):\n value =...
[ "0.56875503", "0.5626715", "0.5483612", "0.5368945", "0.5270328", "0.5239146", "0.5170919", "0.5101752", "0.5101752", "0.5101752", "0.5101752", "0.5101752", "0.5101752", "0.5101752", "0.5101752", "0.5101752", "0.5101752", "0.5101752", "0.5095999", "0.5095999", "0.5095999", ...
0.5683669
1
Returns True for mandatory options. Similar to canEnable.
def isMandatory(self, is_set, get_value): if self._mandatory and not is_set(self.name): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def required(self) -> pulumi.Input[bool]:\n return pulumi.get(self, \"required\")", "def params_required(self) -> bool:\n if self.no_params or self.params_optional:\n return False\n else:\n return True", "def check_enable_mode(self, *args, **kwargs):\n pass", ...
[ "0.6743455", "0.6681238", "0.66694736", "0.6602361", "0.6602361", "0.6564656", "0.6442865", "0.6415704", "0.6413495", "0.6411688", "0.63829434", "0.6381977", "0.6379248", "0.6379248", "0.6379248", "0.6379248", "0.6379248", "0.6379248", "0.6379248", "0.6379248", "0.6379248", ...
0.6311278
70
Compare two events Compared to `compare_dict`, this transforms "Detail" keys from JSON serialized string into dict. This compares only based on the keys in 'a'. Therefore, you should put the test event as the first parameter.
def compare_event(a: dict, b: dict): for key, value in a.items(): assert key in b if key not in b: continue if key == "Detail" and isinstance(value, str): value = json.loads(value) b[key] = json.loads(b[key]) if isinstance(value, dict): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_json(test_name): # , json_object, filters):\n baseline_json = None\n result_json = None\n try:\n with open(robot_dir + \"/output/baseline/{}.json\".format(test_name.replace(' ', ''))) as baseline_file:\n try:\n with open(robot_dir + \"/output/results/{}.json\"...
[ "0.5772593", "0.5763287", "0.5721768", "0.5622362", "0.5537146", "0.55266505", "0.55023146", "0.54470634", "0.5401647", "0.5398616", "0.53715765", "0.5329773", "0.5314032", "0.53100026", "0.52800256", "0.5275216", "0.5203936", "0.5172735", "0.517142", "0.5154183", "0.51533127...
0.86670905
0
Feed forward network to calculate the spacial action probabilities.
def actor_spacial_head(features, sizes): spacial_x = [] spacial_y = [] with tf.variable_scope('actor_spacial_x', reuse=tf.AUTO_REUSE): for i in range(int(len(sizes) / 2)): spacial_x.append(tf.layers.dense(features, units=sizes[i * 2], activati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feedforward(self, inputs):\n processsum = 0\n for i in range(len(inputs)):\n processsum = processsum + inputs[i] * self.weights[i]\n return self.activate(processsum)", "def _precompute_probabilities(self):\n\n d_graph = self.d_graph\n first_travel_done = set()\n\...
[ "0.6254032", "0.6204487", "0.61677766", "0.6157795", "0.61552924", "0.6149894", "0.6118731", "0.6103347", "0.6071567", "0.6036709", "0.60204804", "0.5996701", "0.598876", "0.59558094", "0.59341127", "0.5931776", "0.5927991", "0.5927204", "0.59151554", "0.59147096", "0.5904977...
0.0
-1
Plot Absolute Total Travel Time vs distance
def plot_tttd(data_frame): figtt, axtt = plot_var( data_frame=data_frame, x_var="distance", y_var="totalTT", label_var="mpr", pivot="flow", x_label="Distance [m]", y_label="Total Travel Time [s]", t_label="Flow [veh/h]: ", legends=[r"0 \%", r"1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(df):\n print('\\nCalculating Total Travel Time...\\n')\n start_time = time.time()\n travel_durations = pd.to_datetime(df['End Time']) - pd.to_datetime(df['Start Time'])\n\n # TO DO: display total travel time\n print()\n td_sum = df['Total Travel Time'].sum()\n sum_secon...
[ "0.5991333", "0.5974185", "0.5959261", "0.5911471", "0.5909492", "0.5871874", "0.5866941", "0.5857713", "0.5854735", "0.5851414", "0.579076", "0.5785121", "0.57847613", "0.57735", "0.57709414", "0.5756345", "0.5755743", "0.57532287", "0.5749566", "0.5745649", "0.574251", "0...
0.5704738
28
Plot Absolute Total Travel Time vs distance
def plot_mttd(data_frame): figtt, axtt = plot_var( data_frame=data_frame, x_var="distance", y_var="meanTT", label_var="mpr", pivot="flow", x_label="Distance [m]", y_label="Average Travel Time [s]", t_label="Flow [veh/h]: ", legends=[r"0 \%", r"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(df):\n print('\\nCalculating Total Travel Time...\\n')\n start_time = time.time()\n travel_durations = pd.to_datetime(df['End Time']) - pd.to_datetime(df['Start Time'])\n\n # TO DO: display total travel time\n print()\n td_sum = df['Total Travel Time'].sum()\n sum_secon...
[ "0.5991333", "0.5974185", "0.5959261", "0.5911471", "0.5909492", "0.5871874", "0.5866941", "0.5857713", "0.5854735", "0.5851414", "0.579076", "0.5785121", "0.57847613", "0.57735", "0.57709414", "0.5756345", "0.5755743", "0.57532287", "0.5749566", "0.5745649", "0.574251", "0...
0.0
-1
Plot Absolute Total Travel Time vs distance
def plot_ttcd(data_frame): figtt, axtt = plot_var( data_frame=data_frame, x_var="distance", y_var="timetC", label_var="mpr", pivot="flow", x_label="Distance [m]", y_label="Time To Collision [s]", t_label="Flow [veh/h]: ", legends=[r"0 \%", r"10...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(df):\n print('\\nCalculating Total Travel Time...\\n')\n start_time = time.time()\n travel_durations = pd.to_datetime(df['End Time']) - pd.to_datetime(df['Start Time'])\n\n # TO DO: display total travel time\n print()\n td_sum = df['Total Travel Time'].sum()\n sum_secon...
[ "0.5991333", "0.5974185", "0.5959261", "0.5911471", "0.5909492", "0.5871874", "0.5866941", "0.5857713", "0.5854735", "0.5851414", "0.579076", "0.5785121", "0.57847613", "0.57735", "0.57709414", "0.5756345", "0.5755743", "0.57532287", "0.5749566", "0.5745649", "0.574251", "0...
0.56232554
43
Get stage configuration including the global section, temporary, source and destination directories.
def stage_cfg(self, stage_name: str): stage_cfg = self._app_cfg['stages'][stage_name] global_cfg = self._app_cfg['global'] # Copy all of the global configuration items into the stage config section stage_cfg['parameters'].update(**global_cfg) return stage_cfg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_full_config(self):\n return self._read_config()", "def default(self, stage=False):\n return self._build_config(state='default', stage=stage)", "def configuration(self):\n # type: () -> Dict[str, str]\n return {\n 'source': self.source,\n 'location': sel...
[ "0.58905184", "0.5842106", "0.57821536", "0.5687692", "0.5644515", "0.56425613", "0.56335044", "0.5619607", "0.5595299", "0.55899024", "0.55805373", "0.555469", "0.55391836", "0.55324036", "0.5525109", "0.54951656", "0.5491966", "0.5477152", "0.54655063", "0.54613763", "0.545...
0.707392
0
Path to the temporary directory
def tmp_dir_path(self) -> str: return self._tmp_dir_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_temp_path():\n return os.getcwd() + \"/temp/\"", "def tempdir():\n\n # Create a directory and return the path\n return tempfile.mkdtemp()", "def tempdir(self):\n path = tempfile.gettempdir()\n return os.path.join(path, 'parquet-index-test-' + str(uuid.uuid4()))", "def get_temp_...
[ "0.86474264", "0.8441564", "0.8403943", "0.82864594", "0.82856137", "0.8266832", "0.82653344", "0.8205435", "0.8198226", "0.81844383", "0.80655783", "0.8050048", "0.7944794", "0.7937984", "0.7909771", "0.7899935", "0.78797644", "0.7853521", "0.78517514", "0.7803357", "0.77985...
0.8389147
3
Two numpy one hot arrays
def get_metrics(target, logits, one_hot_rep=True): if one_hot_rep: label = np.argmax(target, axis=1) predict = np.argmax(logits, axis=1) else: label = target predict = logits accuracy = accuracy_score(label, predict) precision = precision_score(label, predict) reca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(self, y):\n\n one_hot = np.zeros((self.n_samples, self.n_classes))\n\n # using np.array to select elements of another np.array\n\n # first diemention index\n # np.arange(self.n_samples) : (1, n_samples)\n # row vectors (0,1,2.....n_samples-1) \n\n # second dime...
[ "0.7473184", "0.732682", "0.72331905", "0.7110888", "0.7049653", "0.70042974", "0.70032334", "0.6987552", "0.69430614", "0.6938048", "0.69335353", "0.6922968", "0.6922968", "0.6922968", "0.6922968", "0.6916119", "0.69056004", "0.6866187", "0.6865059", "0.68593395", "0.6838912...
0.0
-1
Takes the average of each value for a given key in the given list of dicts, returning a single dict containing the average for each key.
def avg_rows(rows): if len(rows) == 1: return rows[0] agg_vals = {k: [rows[j][k] for j in range(len(rows))] for k in rows[0].keys()} return {k: (reduce(np.add, v) / len(v)) for k, v in agg_vals.items()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_average(dict_list, key):\n working_sum = 0\n for num in dict_list:\n working_sum += float(num[key])\n return round(working_sum / len(dict_list), 2)", "def average_dictlist(dict_list):\r\n avg=sum(dict_list)/len(dict_list)\r\n return avg", "def average_grades(grades):\r\n\r\n\tfor...
[ "0.81283087", "0.8076289", "0.7022589", "0.69858956", "0.6862206", "0.6595517", "0.6592123", "0.65357", "0.6532652", "0.63524765", "0.63381326", "0.63339394", "0.6297491", "0.62593675", "0.6240509", "0.6238489", "0.6205266", "0.6198819", "0.6161661", "0.61496556", "0.6128529"...
0.63392335
10
Calculate true and false positives per binary classification threshold.
def _binary_clf_curve( y_true, y_score, pos_label=None, sample_weight=None, session=None, run_kwargs=None ): y_type = type_of_target(y_true).to_numpy(session=session, **(run_kwargs or dict())) if not (y_type == "binary" or (y_type == "multiclass" and pos_label is not None)): raise ValueError(f"{y_ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary_predict(probs, threshold = 0.5):\n return (probs >= threshold) * np.ones(len(probs))", "def binary_classification_metrics(prediction, ground_truth):\n precision = 0\n recall = 0\n accuracy = 0\n f1 = 0\n\n correct = sum(a == b for a, b in zip(prediction, ground_truth))\n\n true_po...
[ "0.72858477", "0.7178873", "0.71700084", "0.70652574", "0.6872478", "0.6812764", "0.67682606", "0.67504483", "0.6720072", "0.6555941", "0.6544707", "0.6531244", "0.650584", "0.6488155", "0.6440363", "0.64390707", "0.6436647", "0.64338964", "0.64246184", "0.6423984", "0.642181...
0.0
-1
returns the residual for the given measurement (z). Does not alter the state of the filter.
def residual_of(self, z): raise "Not implemented yet" return z - dot(self._H, self._x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def residual_of(self, z):\n return np.subtract(z, self.HJacob(self.x)@self.x_prior)", "def residual(us):\n return self.h_S(z0, us) - h_P", "def residuals(x, z=None, max_time=np.inf):\n if z is None:\n return x\n n_samples = x.shape[0]\n residuals = np.zeros_like(x)\n length...
[ "0.7594592", "0.7394567", "0.68412524", "0.6240067", "0.5935702", "0.59130114", "0.58512014", "0.57680964", "0.5740834", "0.56955564", "0.56799614", "0.56455976", "0.5625991", "0.56134766", "0.55619967", "0.5553281", "0.5550101", "0.54963684", "0.5495011", "0.54783815", "0.54...
0.8129559
0
Reject requests for sessions with email addresses Do not lookup user with current email and assign to customer as it is privilege escalation Also don't provide ValidationError that email exists as can be used to check db contents
def clean_email(self): if getattr(self.instance, 'email', None): raise ValidationError(self.registered_error) return self.cleaned_data['email']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_already_validated_email(self):\n token = self.authenticate_user(self.auth_user_data).data[\"token\"]\n verification_url = reverse(\n 'authentication:verify_email', kwargs={'token': token})\n\n response = self.client.get(\n verification_url,\n HTTP_AUTH...
[ "0.6736022", "0.64072067", "0.63895", "0.63715184", "0.6368517", "0.6353353", "0.6351078", "0.6268455", "0.62545395", "0.62186426", "0.6199948", "0.6199948", "0.6166389", "0.6159571", "0.61542916", "0.6153669", "0.61323494", "0.6130199", "0.6130199", "0.60694695", "0.604942",...
0.0
-1
A list of parameter rules. See `config_rule_parameters` below.
def config_rule_parameters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AggregateCompliancePackConfigRuleConfigRuleParameterArgs']]]]: return pulumi.get(self, "config_rule_parameters")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_rule_parameters(self) -> Optional[Sequence['outputs.CompliancePackConfigRuleConfigRuleParameter']]:\n return pulumi.get(self, \"config_rule_parameters\")", "def config_rule_parameters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['CompliancePackConfigRuleConfigRuleParameterArgs']]]]:\n ...
[ "0.6591533", "0.65825087", "0.657194", "0.65262836", "0.6484703", "0.64447474", "0.6372168", "0.6284343", "0.6219744", "0.6164855", "0.6155788", "0.6104082", "0.6095166", "0.60067964", "0.60000676", "0.59681064", "0.5962869", "0.5956988", "0.59493977", "0.5942893", "0.5938839...
0.6327826
7
The rule ID of Aggregate Config Rule.
def config_rule_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "config_rule_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_rule_id(self) -> str:\n return pulumi.get(self, \"config_rule_id\")", "def config_rule_id(self) -> str:\n return pulumi.get(self, \"config_rule_id\")", "def config_rule_id(self) -> str:\n return pulumi.get(self, \"config_rule_id\")", "def config_rule_id(self) -> str:\n ...
[ "0.8523939", "0.8523939", "0.8523939", "0.8523939", "0.8289458", "0.81522363", "0.81522363", "0.76127535", "0.740866", "0.7401294", "0.7344906", "0.7344906", "0.73176056", "0.7157632", "0.7157632", "0.6953851", "0.6953851", "0.6928749", "0.68633544", "0.68353754", "0.6479877"...
0.81129134
8
A list of Config Rule Parameters. See `config_rule_parameters` below.
def config_rule_parameters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['CompliancePackConfigRuleConfigRuleParameterArgs']]]]: return pulumi.get(self, "config_rule_parameters")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_rule_parameters(self) -> Optional[Sequence['outputs.CompliancePackConfigRuleConfigRuleParameter']]:\n return pulumi.get(self, \"config_rule_parameters\")", "def config_rule_parameters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AggregateCompliancePackConfigRuleConfigRuleParameterArgs'...
[ "0.7549047", "0.73954594", "0.7373033", "0.72942793", "0.6999339", "0.64008105", "0.6108071", "0.6046775", "0.6030475", "0.6016424", "0.59917104", "0.5981634", "0.5906509", "0.5904397", "0.5820268", "0.5790313", "0.5786285", "0.5779738", "0.57746214", "0.57685894", "0.5677224...
0.7695557
0
The rule ID of Config Rule.
def config_rule_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "config_rule_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_rule_id(self) -> str:\n return pulumi.get(self, \"config_rule_id\")", "def config_rule_id(self) -> str:\n return pulumi.get(self, \"config_rule_id\")", "def config_rule_id(self) -> str:\n return pulumi.get(self, \"config_rule_id\")", "def config_rule_id(self) -> str:\n ...
[ "0.9227865", "0.9227865", "0.9227865", "0.9227865", "0.88453764", "0.88097996", "0.88097996", "0.8082578", "0.7680346", "0.7680346", "0.7512799", "0.74273443", "0.7417218", "0.7417218", "0.71960586", "0.71960586", "0.7013749", "0.68643725", "0.6795767", "0.6651074", "0.663275...
0.87683296
7
Creates a file name with whitespaces and comma in it.
def main(): # We could test ?><:*|"' and chr(1 to 32) on linux. # We could test ?<>*|"' on OSX. # On Windows, skip the Chinese characters for now as the log parsing code is # using the current code page to generate the log. if sys.platform == 'win32': filename = u'foo, bar, ~p#o,,ué^t%t .txt' else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_filename (self):\n\t\tassert self.__patient_name and self.__location_name, \"New filename could not be determined, one or more needed arguments is empty!\"\n\t\t_patient_name = self.__patient_name.split(' ')\n\t\t_patient_name.reverse()\n\t\t\n\t\treturn os.path.join(os.path.dirname(self.file._path), \"...
[ "0.6311297", "0.61566633", "0.6099529", "0.5912327", "0.58958834", "0.5796131", "0.5716558", "0.57034683", "0.5701581", "0.566149", "0.5656592", "0.5636747", "0.56219584", "0.5620714", "0.55743927", "0.55133545", "0.54821044", "0.5458007", "0.5458007", "0.5458007", "0.5447742...
0.0
-1
Returns the final render limits in drawing units.
def render_limits( origin: tuple[float, float], size_in_inches: tuple[float, float], scale: float, ) -> tuple[float, float, float, float]: min_x, min_y = origin max_x = min_x + size_in_inches[0] * scale max_y = min_y + size_in_inches[1] * scale return min_x, min_y, max_x, max_y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_render_area_size(self):\n render_area = self._get_render_area()\n return (render_area.width(), render_area.height())", "def limits(self):\n return self._limits", "def getLimit(self) :\n\t\treturn (self.modelSizeX, self.modelSizeY)", "def getExtentUnits(self):\n return _li...
[ "0.64869076", "0.6246936", "0.62459916", "0.6198676", "0.61402845", "0.6135662", "0.6098194", "0.6047764", "0.6047367", "0.60120845", "0.6002889", "0.6002087", "0.5988555", "0.59336525", "0.58845633", "0.5884055", "0.5876222", "0.5874457", "0.58665425", "0.5848205", "0.582979...
0.58823484
16
If user does not exist raise 404
def test_package_browser_no_use(self): r = self.client.get( reverse('jp_browser_user_addons', args=['not_a_user'])) eq_(r.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_user_404(self):\n resp = self.app.get('/users/thisuserdoesntexist')\n assert resp.status_code == 404", "def test_returns_404_if_user_doesnt_exist(self):\n # Act\n response = self.client.get(\"/api/v2/projects/queries/non_existent/touched/\")\n self.assertEqual(resp...
[ "0.7784908", "0.75018907", "0.7315309", "0.7218134", "0.71437484", "0.7109212", "0.7105639", "0.7088962", "0.70444095", "0.70382386", "0.69319147", "0.6901871", "0.6898351", "0.68502396", "0.6784059", "0.67245686", "0.6715634", "0.6709655", "0.6661238", "0.6653801", "0.660908...
0.0
-1
Returns windows' bottom left and upper right coordinates.
def real_boundaries(self): return (self._points[0][1], self._points[0][3])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bounds(self):\n bottom_right = np.asarray([self.coords[k][0] for k in range(self.dim)])\n upper_left = np.asarray([self.coords[k][-1] for k in range(self.dim)])\n return bottom_right, upper_left", "def bottomLeftCorner(self):\n self._updateExtents()\n return (self._mMin...
[ "0.7588765", "0.7371377", "0.7364667", "0.7273465", "0.7175858", "0.71603", "0.6978559", "0.6955939", "0.69496405", "0.69457185", "0.69152683", "0.6864769", "0.6842592", "0.6741698", "0.6732085", "0.6692326", "0.6636758", "0.65708774", "0.65470517", "0.65089947", "0.6504737",...
0.0
-1
find item at index O(logn)
def __getitem__(self, index): node = self.head index += 1 for level in reversed(range(self.max_levels)): while node.width[level] <= index: index -= node.width[level] node = node.next[level] return node.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_search(alist, key):\n for i in range(len(alist)):\n if alist[i] == key:\n return i\n return -1", "def index_equals_value_search1(arr):\n for key, value in enumerate(arr):\n if value == key:\n return value\n return -1", "def find(self,item):\n si...
[ "0.73403645", "0.7285283", "0.7256406", "0.72192067", "0.7076826", "0.70636237", "0.7017031", "0.7004161", "0.6980659", "0.6977091", "0.6956756", "0.6955723", "0.6947856", "0.69336104", "0.6928404", "0.6908248", "0.68609035", "0.6830031", "0.67474884", "0.6713557", "0.6701740...
0.0
-1
Checks if the username is taken.
def is_username_taken(self, username): return self._send_command_to_entity_server(us.SERVER_COMMAND_IS_USERNAME_TAKEN, username)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_name(self, username: str) -> bool:\n\t\treturn not self.registry.name_taken(username)", "def _check_username(self, username):\n if self.username_regex.search(username) is not None:\n print(\"Correct username\")\n return True\n else: \n print(\"Wrong use...
[ "0.81478673", "0.80027384", "0.7977952", "0.79088664", "0.78071237", "0.77540445", "0.77000445", "0.76849204", "0.76560986", "0.7654159", "0.76199186", "0.759584", "0.7577727", "0.7518458", "0.75051093", "0.7501145", "0.74822515", "0.74822515", "0.7481107", "0.7427473", "0.74...
0.83023614
0
Sets an entity owner's account type.
def set_entity_owner_account_type(self, username, account_type): return self._send_command_to_entity_server(us.SERVER_COMMAND_ENTITY_OWNER_SUDO_OPERATION, us.SERVER_COMMAND_SET_ENTITY_OWNER_ACCOUNT_TYPE + ':' + username + '|' + account_type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner_type(self, owner_type):\n\n self._owner_type = owner_type", "def account_type(self, account_type):\n\n self._account_type = account_type", "def account_type(self, account_type):\n\n self._account_type = account_type", "def account_type(self, account_type):\n\n self._acco...
[ "0.7410548", "0.7158551", "0.7158551", "0.7158551", "0.7158551", "0.6882924", "0.684857", "0.6795967", "0.62622094", "0.61940455", "0.6181932", "0.6143483", "0.598256", "0.59306407", "0.5928705", "0.5928705", "0.59151745", "0.5794388", "0.57399946", "0.573809", "0.57057524", ...
0.8488248
0
Test that 404 is received if stream keying is active and no key is supplied.
def testStreamKeying2(self): yield self.connect(self.get_body_node(connect=True, useKey=True)) try: yield self.proxy.send(self.get_body_node(useKey=False)) except httpb_client.HTTPBNetworkTerminated as e: self.failUnlessEqual(e.body_tag.getAttribute('condition', None), '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_key_not_found(self):\n self.expect_datatore_lookup('SomeBlobKey', False)\n self.mox.ReplayAll()\n self.assertResponse('404 %s' % httplib.responses[404], [], '', self.app,\n self._environ)", "def testStreamKeying4(self):\n yield self.connect(self.get_body_node(conne...
[ "0.71751565", "0.68717134", "0.6758383", "0.6712094", "0.6623941", "0.65079397", "0.63736016", "0.63221323", "0.62995946", "0.6291591", "0.6198733", "0.61873883", "0.6119805", "0.6104908", "0.60972327", "0.6089556", "0.60793036", "0.6070781", "0.6057753", "0.60511345", "0.602...
0.6948038
1
Test that 404 is received if stream keying is active and an invalid key is supplied.
def testStreamKeying3(self): yield self.connect(self.get_body_node(connect=True, useKey=True)) try: yield self.proxy.send(self.get_body_node(useKey=True, key='0'*40)) except httpb_client.HTTPBNetworkTerminated as e: self.failUnlessEqual(e.body_tag.getAttribute('condition...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_key_not_found(self):\n self.expect_datatore_lookup('SomeBlobKey', False)\n self.mox.ReplayAll()\n self.assertResponse('404 %s' % httplib.responses[404], [], '', self.app,\n self._environ)", "def _transport_key_not_found():\n pecan.abort(404, u._('Not Found. Transport K...
[ "0.70581234", "0.6773711", "0.6703525", "0.6577645", "0.64888525", "0.6487448", "0.6433129", "0.64217377", "0.64207226", "0.63452977", "0.6323731", "0.63000107", "0.6277581", "0.6276906", "0.6187017", "0.6178576", "0.61544955", "0.6140631", "0.6140631", "0.61278945", "0.60901...
0.63721424
9
Test that 404 is received if we supply a key on a connection without active keying.
def testStreamKeying4(self): yield self.connect(self.get_body_node(connect=True, useKey=False)) try: yield self.proxy.send(self.get_body_node(key='0'*40)) except httpb_client.HTTPBNetworkTerminated as e: self.failUnlessEqual(e.body_tag.getAttribute('condition', None), 'i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_key_not_found(self):\n self.expect_datatore_lookup('SomeBlobKey', False)\n self.mox.ReplayAll()\n self.assertResponse('404 %s' % httplib.responses[404], [], '', self.app,\n self._environ)", "def _transport_key_not_found():\n pecan.abort(404, u._('Not Found. Transport K...
[ "0.74655044", "0.7324034", "0.67250246", "0.6582305", "0.6524632", "0.651834", "0.65116256", "0.6484993", "0.64640075", "0.6426485", "0.63820726", "0.6365951", "0.6349338", "0.634543", "0.63412136", "0.63242966", "0.63227385", "0.6307354", "0.63016105", "0.6301024", "0.627006...
0.64702964
8
Calculates the scaled dot product attention
def sdp_attention(Q, K, V, mask=None): matmul_qk = tf.matmul(Q, K, transpose_b=True) # scale matmul_qk dk = tf.cast(tf.shape(K)[-1], tf.float32) scaled_attention_logits = matmul_qk / tf.math.sqrt(dk) # add mask to scaled tensor if mask is not None: scaled_attention_logits += (mask * -1e9...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scaled_dot_product_attention(q, k, v, mask):\n matmul_qk = tf.matmul(q, k, transpose_b=True) # [..., q_len, kv_len]\n # scale matmul_qk\n dk = tf.cast(tf.shape(k)[-1], tf.float32)\n scaled_attention_logits = matmul_qk / tf.sqrt(dk)\n # print(\"scaled_attention_logits\", tf.nn.top_k(scaled_atten...
[ "0.70013", "0.69744056", "0.6910764", "0.6848379", "0.6848379", "0.6844328", "0.684218", "0.683746", "0.681162", "0.669818", "0.65013546", "0.6460076", "0.64451927", "0.6365774", "0.6238608", "0.62133294", "0.6199948", "0.6149572", "0.59957415", "0.5993061", "0.59593284", "...
0.0
-1
Testing the header BundleFailed. This function will test all code values for this enum class.
def test_error_message_header_bundle_failed_codes(self): error_type = 17 error_type_value = Error.ErrorType.OFPET_BUNDLE_FAILED error_code = 0 iter_given_code = Error.ErrorType.get_class(error_type_value).__iter__() length = Error.ErrorType.get_class(error_type_value).__len__(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_error_message_header_bad_action_codes(self):\n\n error_type = 2\n error_type_value = Error.ErrorType.OFPET_BAD_ACTION\n\n error_code = 0\n\n iter_given_code = Error.ErrorType.get_class(error_type_value).__iter__()\n length = Error.ErrorType.get_class(error_type_value).__...
[ "0.6854216", "0.68238926", "0.6742314", "0.66837996", "0.66063106", "0.6599182", "0.6596785", "0.6550373", "0.64881974", "0.6480709", "0.6388697", "0.6345695", "0.63311666", "0.6312015", "0.6262921", "0.6209131", "0.6205707", "0.6202694", "0.61926794", "0.6191609", "0.6164562...
0.7616201
0
Generates batches of images from image_generator. Yields batches of images, image embeddings and class labels
def image_batch_generator(img_paths, model, batch_size, features=True): while True: ig = image_generator(img_paths) batch_img, batch_features, batch_labels = [], [], [] for img, lab in ig: # Add the image and mask to the batch if features: img = np.ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_images(generator_model, output_dir, epoch, n_class, batch_size=128):\n label = np.random.randint(0, n_class, size=(batch_size, 1))\n label = np_utils.to_categorical(label, num_classes=n_class)\n test_image_stack = generator_model.predict([np.random.rand(10, 100), label])\n test_image_stack...
[ "0.724984", "0.7093016", "0.7084492", "0.695288", "0.6944777", "0.6895919", "0.68900627", "0.68779296", "0.68654627", "0.6860123", "0.68406713", "0.6833361", "0.68241405", "0.67093205", "0.670478", "0.66874576", "0.666385", "0.6634802", "0.66271895", "0.6620623", "0.66002846"...
0.73834807
0
residual block for convolutional encoder
def residual(n_filters, input): shape = input.shape _, h, w, d = shape l1 = Conv2D(n_filters, (5, 5), padding='valid', activation='elu')(input) l2 = Conv2D(n_filters, (1, 1), padding='valid', activation='linear')(l1) l3 = Cropping2D(cropping=2)(input) added = Add()([l2, l3]) return added
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def residual_block(x,index,step=\"encoding\"):\r\n if step != \"encoding\":\r\n index = \"decode_{}\".format(index)\r\n \r\n x_new = kl.Conv2D(128,(3,3),padding=\"same\",activation=\"selu\",kernel_initializer=initializer,\r\n name=\"conv1_res_{}\".format(index))(x)\r\n ...
[ "0.7649921", "0.74739087", "0.74001074", "0.73615426", "0.7342737", "0.73328227", "0.73307055", "0.7252453", "0.7178753", "0.71580565", "0.69932663", "0.698503", "0.6974107", "0.69735676", "0.6959267", "0.6935483", "0.69116217", "0.689626", "0.68945765", "0.68642795", "0.6785...
0.6471796
28
Function for gathering lists of image paths on the disk and splitting them to train and test data classes list of classes that should be gathered in dataset_path. They are names of folders, and then names of folders are considered as labels
def get_train_test_lists(dataset_path, classes=('glare_small', 'normal'), test_size=0.25): image_set = [] label_set = [] for cls in classes: dir = os.path.join(dataset_path, cls) img_list = glob.glob(dir + '/*.png') img_list.extend(glob.glob(dir + '/*.jpg')) label = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_paths_and_labels(self,classes):\n\t\tim_paths , im_labels = [], [] \n\n\t\tfor image_type in classes:\n\t\t\tmypath = self.data_path + self.dataset + '/' + image_type\n\t\t\tonlyfiles = [ f for f in listdir(mypath) if isfile(join(mypath,f)) ]\n\t\t\tclass_support = 0\n\t\t\tfor file_name in onlyfiles:\n\t...
[ "0.7684645", "0.7579565", "0.7276159", "0.7268057", "0.72623914", "0.72380525", "0.719673", "0.7180717", "0.71574926", "0.7132667", "0.70951617", "0.7068589", "0.70428675", "0.70253223", "0.70020163", "0.69968307", "0.695199", "0.69496536", "0.6892565", "0.68697196", "0.68610...
0.76423645
1
Create an instance of type LinkedList. Allow data to be passed in.
def __init__(self, data=None): self.head = None self.tail = None if data is not None: try: for item in data: if item is data[0]: self.head = Node(item, next=None) self.tail = self.head ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n node = ListNode(0) # dummy\n self.head = node\n self.tail = node\n self.len = 0", "def simple_ll():\n ll = LinkedList()\n ll.push(20)\n ll.push(4)\n ll.push(15)\n ll.push(85)\n return ll", "def __init__(self, data=None):\n if data is n...
[ "0.6913204", "0.68632394", "0.6852119", "0.6798918", "0.66747683", "0.66606814", "0.6533949", "0.6531399", "0.6500879", "0.6485104", "0.6449696", "0.6448955", "0.6448955", "0.644425", "0.64330465", "0.64116734", "0.6401485", "0.6358894", "0.6353688", "0.6348854", "0.63437706"...
0.7110324
0
Creates date object from MAL date string
def date_from_string(my_string): if my_string: return datetime.strptime(my_string, DATE_FORMAT).date() return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string_to_date(string):\n params = string.strip().split('-')\n year = int(params[0])\n month = int(params[1])\n day = int(params[2])\n d = date(year, month, day)\n return d", "def from_date_string(cls, date_string: str):\n date_lst = [int(ele) for ele in date_...
[ "0.7390956", "0.724717", "0.7034429", "0.7033988", "0.70308965", "0.6910145", "0.69050604", "0.6902696", "0.6837709", "0.68255466", "0.6800793", "0.6792672", "0.6729699", "0.67273295", "0.66814417", "0.66730183", "0.663877", "0.65925974", "0.65781224", "0.65544796", "0.653991...
0.61020505
67
calculate the PPS skew fall difference.
def calc_fall_diff(self): ch1_fall = self.read_channel(2) ch2_fall = self.read_channel(3) if (len(ch1_fall)==0) or (len(ch2_fall)==0): print("TDC readout error") return try: ch1_i=0 ch2_i=0 fall_diff_list=[] while ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skew(self) -> float:\n return float(ss.skew(self.tsdf.pct_change().values, bias=True, nan_policy='omit'))", "def calculateP(SD, numDiff):\n return numDiff/SD", "def calculateP(SD, numDiff):\n return numDiff/SD", "def wind_ppa():\n per_kwh = 0.0384 # [$/kWh]\n\n return per_kwh", "def...
[ "0.602884", "0.59352046", "0.59352046", "0.59067804", "0.5774577", "0.5734194", "0.56210107", "0.5607008", "0.56009334", "0.55715984", "0.5516547", "0.5466388", "0.5451766", "0.54362035", "0.54031175", "0.5386985", "0.53595835", "0.53456163", "0.5338788", "0.5325208", "0.5304...
0.5063408
47
Normalize a matrix so that each row vector has a Euclidean norm of 1. If a vector is passed in, we treat it as a matrix with a single row.
def normalize_matrix(matrix, axis=1): if len(matrix.shape) == 1: # turn vector into matrix with one row matrix = matrix[np.newaxis, :] divisor = np.linalg.norm(matrix, axis=axis)[:, np.newaxis] # only normalize where divisor is not zero result = np.divide(matrix, divisor, out=np.zeros(ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalise1D(*vector):\n\n vector = np.array(vector).flatten() # 1D vector\n\n norm = np.linalg.norm(vector) # vector norm\n if norm == 0: return vector # vector is 0\n return vector/norm", "def normalize(vectors):\n if len(np.asarray(vectors).shape) == 1:\n return vectors / np.lin...
[ "0.7969215", "0.72398895", "0.7218774", "0.71803224", "0.71326554", "0.7077896", "0.7066542", "0.7039434", "0.7027425", "0.70229024", "0.7010408", "0.70064217", "0.6987403", "0.6976482", "0.69626105", "0.69532454", "0.69477797", "0.6938035", "0.69054806", "0.6894304", "0.6855...
0.7671009
1
Check if a numpy matrix contains a row with the same values as the variable `row`.
def contains_row(matrix, row): return (matrix == row).all(axis=1).any()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_row(sudoku):\r\n for row in range(len(sudoku)):\r\n for col in range(len(sudoku)):\r\n if sudoku[row].count(sudoku[row][col]) != 1:\r\n return True #returns True is there is more than two of the same numbers in a row\r", "def row_is_in_array(row, array):\n return ...
[ "0.77201223", "0.75901115", "0.7516611", "0.7009039", "0.70081276", "0.69381815", "0.68853056", "0.67625016", "0.6672804", "0.6664632", "0.66555256", "0.66123796", "0.6610709", "0.65916854", "0.64841956", "0.6450899", "0.6398128", "0.63943046", "0.63871175", "0.6374781", "0.6...
0.84777
0
Return an ordered list of indices. Batches will be constructed based on this order.
def ordered_indices(self): return self.d1.ordered_indices() # RETURN BASED ON D1's sizes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ordered_indices(self):\r\n return np.arange(len(self), dtype=np.int64)", "def ordered_indices(self):\n return self.base_dataset.ordered_indices()", "def get_indexes(self):\n indexes = []\n for c in self.components:\n indexes.extend(c.get_indexes())\n return ind...
[ "0.7877737", "0.78238994", "0.7392575", "0.73646766", "0.7234698", "0.7088341", "0.7078515", "0.7076954", "0.707424", "0.70301586", "0.70283735", "0.69826525", "0.6944714", "0.69391733", "0.68995196", "0.6896396", "0.6883154", "0.6861051", "0.6805219", "0.6694801", "0.6588738...
0.73083484
4
Find a global threshold for a grayscale image by choosing the threshold to be the mean of the two peaks of the bimodal histogram. Will fail and return 0 if the histogram is not bimodal
def intermodes(I): n = 255 y = np.histogram(I.ravel(), bins=n+1, range=(0, n))[0].astype(float) iter = 0 while not bimodtest(y): h = np.ones(3) / 3 y = np.convolve(y, h, mode='same') iter += 1 if iter > 10000: return 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imthresh(img):\n img_vecs = img.flatten()\n\n # pre-calculate the histogram and cumulative histogram.\n vbins = np.arange(0, 257, 1)\n img_hist, hist_edges = np.histogram(img_vecs, vbins)\n vbins = (hist_edges[:-1] + hist_edges[1:])/2\n \n hist_times_gray = np.cumsum(img_hist * np.arange(0...
[ "0.7353051", "0.70555973", "0.70077443", "0.6897841", "0.6839656", "0.6743144", "0.6651191", "0.6638801", "0.661403", "0.65546846", "0.6524581", "0.6514374", "0.64493847", "0.63868046", "0.63337594", "0.62814605", "0.62776625", "0.6271481", "0.62531227", "0.62234646", "0.6220...
0.0
-1
A worker leaves a barrier. This is useful for garbage collection of used barriers.
def leave(self, worker_id, barrier_id): self.barriers[barrier_id].leave() if self.barriers[barrier_id].all_leave(): del self.barriers[barrier_id]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __graceful_exit_worker():\n #print \"GEW START\"\n assert this.exit_barrier is not None\n # Wait for the handler to tell us we're exting\n this.exit_barrier.wait()\n #print \"GEW PAST BARRIER\"\n with this.lock:\n #print \"GEW DOING EXIT WORK\"\n for call in this.exit_list:\n ...
[ "0.68815327", "0.6371032", "0.6312291", "0.5838245", "0.5810506", "0.5764221", "0.575634", "0.57377344", "0.57220906", "0.57218015", "0.5670469", "0.56654644", "0.5598296", "0.55571437", "0.54274553", "0.54264617", "0.5423499", "0.54172754", "0.54132414", "0.5405347", "0.5385...
0.81848615
0
Return the line graph of this graph.
def line_graph(self, backtracking=True, shared=False): raise Exception("Graph store doesn't support creating an line matrix.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_line(self):\n v = self.vertices + self.vertices[0]\n return Line(v, properties=self.properties, crs=self.crs)", "def line_axes (self):\n return self._line_axes", "def line_graph():\n fig = plt.figure()\n ax = plt.axes()\n x = [1, 2, 3]\n y = [5, 6, 7]\n plt.plot(x, y)...
[ "0.69421196", "0.66094303", "0.65163636", "0.6508966", "0.64072347", "0.6395848", "0.6268945", "0.6254995", "0.62520796", "0.62520796", "0.62454784", "0.6243992", "0.6210982", "0.61400455", "0.6048266", "0.6040779", "0.6035213", "0.602751", "0.59967977", "0.59967977", "0.5973...
0.69998544
0
The id of the current worker using the graph store. When a worker connects to a graph store, it is assigned with a worker id. This is useful for the graph store server to identify who is sending requests. The worker id is a unique number between 0 and num_workers. This is also useful for user's code. For example, user'...
def worker_id(self): return self._worker_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def worker_id(self):\n return self.assignment.WorkerId", "def get_worker_index():\n # Get TensorFlow worker index\n if env.get_env(_TF_CONFIG) is not None:\n tf_config = json.loads(os.environ.get(_TF_CONFIG))\n task_config = tf_config.get(_TASK)\n task_type = task_config.get(_TY...
[ "0.79644775", "0.6867604", "0.67427415", "0.6534", "0.6517408", "0.65023816", "0.63878566", "0.626391", "0.62478197", "0.62402785", "0.61907613", "0.61850846", "0.61850846", "0.6155047", "0.6154011", "0.613194", "0.6098799", "0.6036889", "0.59988403", "0.5997603", "0.59669125...
0.8178549
0
Linear learning rate schedule.
def linear_schedule(initial_value: float) -> Callable[[float], float]: def func(progress_remaining: float) -> float: """ Progress will decrease from 1 (beginning) to 0. :param progress_remaining: (float) :return: (float) current learning rate """ return progress_rem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lr_schedule(epoch, current_lr):\n lr = current_lr\n if epoch == 23: lr *= 0.5\n elif epoch == 21: lr *= 1e-1\n elif epoch == 16: lr *= 1e-1\n elif epoch == 11: lr *= 1e-1\n return lr", "def lr_schedule(epoch,lr):\r\n learning_rate = lr\r\n if epoch > 10:\r\n learning_rate *= 0.1\r\n ...
[ "0.75147927", "0.7498791", "0.74401283", "0.7395729", "0.73818046", "0.73818046", "0.73818046", "0.73818046", "0.7321529", "0.73215175", "0.7317692", "0.731659", "0.731496", "0.72786736", "0.7256097", "0.7231925", "0.7225809", "0.72007567", "0.71790355", "0.71790355", "0.7156...
0.7111894
22
Get the command line arguments
def get_command_line_arguments(): parser = argparse.ArgumentParser(description='Training script for Lux RL agent.') parser.add_argument('--id', help='Identifier of this run', type=str, default=str(random.randint(0, 10000))) parser.add_argument('--learning_rate', help='Learning rate', type=float, default=0.0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cli_arguments(self):\n pass", "def get_args():\n\n parser = get_argument_parser()\n args = parser.parse_args()\n\n return args", "def get_command_line_args():\n \n parser = argparse.ArgumentParser()\n parser.add_argument('-s', '--symbol', help='symbol query')\n\n ...
[ "0.81876403", "0.78115046", "0.7758656", "0.7589955", "0.7581819", "0.75676763", "0.7533646", "0.75306165", "0.7524564", "0.7522715", "0.74770534", "0.7473281", "0.74606335", "0.74426633", "0.7437458", "0.7433479", "0.7403201", "0.7399979", "0.73626983", "0.7356871", "0.73470...
0.0
-1
Checks if current value is prime. Returns True or False.
def is_prime(value): if value < 2: raise ValueError for i in range(2, value): if value % i == 0: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_prime(self):\n pass", "def is_prime(num: int) -> bool:\n return factorial(num - 1) % num != 0", "def is_prime(value: int) -> bool:\n\n if value == 1:\n return False\n if value <= 0:\n raise ValueError(\"Value must be greater than zero\")\n\n for i in range(2, int(value**...
[ "0.80649674", "0.7807129", "0.7773812", "0.76800424", "0.7579584", "0.75628823", "0.7498487", "0.74832773", "0.7441865", "0.7435454", "0.7424535", "0.74090767", "0.73964554", "0.7391202", "0.73834187", "0.737528", "0.73695165", "0.73431134", "0.734006", "0.7332288", "0.732334...
0.76975924
3