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
Sets the termination_state of this ConnectionEndPoint.
def termination_state(self, termination_state: str): allowed_values = ["LP_CAN_NEVER_TERMINATE", "LT_NOT_TERMINATED", "TERMINATED_SERVER_TO_CLIENT_FLOW", "TERMINATED_CLIENT_TO_SERVER_FLOW", "TERMINATED_BIDIRECTIONAL", "LT_PERMENANTLY_TERMINATED", "TERMINATION_STATE_UNKNOWN"] # noqa: E501 if termination...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_termination(self, termination):\n # FIXME should be internally accessible only?\n self.__termination = termination", "def terminated(self, terminated):\n\n self._terminated = terminated", "def terminated(self, terminated):\n\n self._terminated = terminated", "def terminate...
[ "0.6452473", "0.5807092", "0.5807092", "0.5807092", "0.5624698", "0.55612886", "0.54337186", "0.5364221", "0.5222837", "0.4969389", "0.4969389", "0.49535656", "0.48852345", "0.4882801", "0.48434332", "0.48371", "0.48204172", "0.47924957", "0.47783226", "0.47641855", "0.476255...
0.6799398
0
Gets the layer_protocol_name of this ConnectionEndPoint.
def layer_protocol_name(self) -> str: return self._layer_protocol_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def layer_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"layer_name\")", "def layer_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"layer_name\")", "def protocol(self) -> str:\n return self.__parameters.protocol", "def layer_protocol_name(self, layer...
[ "0.6991893", "0.6737981", "0.6655885", "0.66094315", "0.6580004", "0.6526617", "0.64756644", "0.64686406", "0.6449779", "0.6433681", "0.6416226", "0.64074725", "0.63770485", "0.63522774", "0.63161236", "0.62349397", "0.61921996", "0.618826", "0.6171238", "0.6171238", "0.61439...
0.87370723
0
Sets the layer_protocol_name of this ConnectionEndPoint.
def layer_protocol_name(self, layer_protocol_name: str): allowed_values = ["OTSiA", "OCH", "OTU", "ODU", "ETH", "ETY", "DSR"] # noqa: E501 if layer_protocol_name not in allowed_values: raise ValueError( "Invalid value for `layer_protocol_name` ({0}), must be one of {1}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def layer_protocol_name(self) -> str:\n return self._layer_protocol_name", "def layer(self, layer):\n self._layer = layer", "def protocol_id(self, protocol_id):\n self._protocol_id = protocol_id", "def protocol_id(self, protocol_id):\n\n self._protocol_id = protocol_id", "def pr...
[ "0.70598274", "0.5782147", "0.57290965", "0.57289034", "0.5708312", "0.5688233", "0.56085056", "0.56085056", "0.56085056", "0.56085056", "0.5562985", "0.54273206", "0.5392024", "0.53690857", "0.53411305", "0.52844375", "0.5257484", "0.52147466", "0.5196867", "0.50834507", "0....
0.79915446
0
Gets the connectivity_service_end_point of this ConnectionEndPoint.
def connectivity_service_end_point(self) -> str: return self._connectivity_service_end_point
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connectivity_service_end_point(self, connectivity_service_end_point: str):\n\n self._connectivity_service_end_point = connectivity_service_end_point", "def get_endpoint(self):\r\n return self._endpoint", "def __get_endpoint(self):\n return self._endpoint", "def connected_endpoint(sel...
[ "0.70261055", "0.63055533", "0.62776625", "0.6240966", "0.61877346", "0.6100025", "0.60089487", "0.60035914", "0.59879875", "0.5943736", "0.5943736", "0.56929696", "0.5629272", "0.5618605", "0.56028825", "0.55782425", "0.5570696", "0.5567195", "0.5560139", "0.5560139", "0.556...
0.825556
0
Gets the parent_node_edge_point of this ConnectionEndPoint.
def parent_node_edge_point(self) -> List[str]: return self._parent_node_edge_point
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getParent(self):\n return self.parent_edge", "def edges_parent(self):\n return self._edges_parent", "def get_parent_id(self):\n return self._parent_id", "def get_parent(self):\n return BinaryNode.or_none(self.parent)", "def parent_id(self):\n return self._parent_id", ...
[ "0.7909449", "0.7849635", "0.72225994", "0.71083087", "0.6985489", "0.6985489", "0.69378465", "0.6932805", "0.6929256", "0.6897707", "0.6897707", "0.6897707", "0.68958336", "0.686817", "0.68395025", "0.68314517", "0.6809207", "0.6806697", "0.6785802", "0.6785802", "0.67726624...
0.7929555
0
Sets the client_node_edge_point of this ConnectionEndPoint.
def client_node_edge_point(self, client_node_edge_point: List[str]): self._client_node_edge_point = client_node_edge_point
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_node_edge_point(self, parent_node_edge_point: List[str]):\n\n self._parent_node_edge_point = parent_node_edge_point", "def setParent(self, edge):\n self.parent_edge = edge", "def client_node_edge_point(self) -> List[str]:\n return self._client_node_edge_point", "def set_node(s...
[ "0.64545894", "0.5764588", "0.5657335", "0.5621235", "0.56201965", "0.5616962", "0.54884785", "0.54075307", "0.53285813", "0.5285194", "0.527346", "0.52295053", "0.50200117", "0.49891022", "0.4982168", "0.49503762", "0.49278897", "0.49262947", "0.49262947", "0.49262947", "0.4...
0.84220517
0
Gets the connection_port_direction of this ConnectionEndPoint.
def connection_port_direction(self) -> str: return self._connection_port_direction
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_port_direction(self, port):\n if port == 1:\n self.__port_b_direction = self.__bus.read_byte_data(\n self.__ioaddress, self.IODIRB)\n return self.__port_b_direction\n else:\n self.__port_a_direction = self.__bus.read_byte_data(\n ...
[ "0.7422299", "0.7100193", "0.6954227", "0.6906184", "0.6850313", "0.6784414", "0.6750329", "0.6648726", "0.6547236", "0.65026873", "0.64180374", "0.6364987", "0.63177645", "0.6307946", "0.6284133", "0.6239046", "0.62192076", "0.6218952", "0.6201423", "0.6183298", "0.61322004"...
0.8515388
0
Sets the connection_port_direction of this ConnectionEndPoint.
def connection_port_direction(self, connection_port_direction: str): allowed_values = ["BIDIRECTIONAL", "INPUT", "OUTPUT", "UNIDENTIFIED_OR_UNKNOWN"] # noqa: E501 if connection_port_direction not in allowed_values: raise ValueError( "Invalid value for `connection_port_direct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_port_direction(self, port, direction):\n\n if port == 1:\n self.__bus.write_byte_data(\n self.__ioaddress, self.IODIRB, direction)\n self.__port_b_direction = direction\n else:\n self.__bus.write_byte_data(\n self.__ioaddress, sel...
[ "0.72491103", "0.6883171", "0.61560464", "0.59813505", "0.5803918", "0.5802289", "0.5751801", "0.56792367", "0.56702006", "0.56702006", "0.5623771", "0.5623771", "0.5603514", "0.55927914", "0.558962", "0.5573132", "0.55627877", "0.5492916", "0.5368065", "0.53601414", "0.53387...
0.77216226
0
Gets the connection_port_role of this ConnectionEndPoint.
def connection_port_role(self) -> str: return self._connection_port_role
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connection_port_role(self, connection_port_role: str):\n allowed_values = [\"SYMMETRIC\", \"ROOT\", \"LEAF\", \"TRUNK\", \"UNKNOWN\"] # noqa: E501\n if connection_port_role not in allowed_values:\n raise ValueError(\n \"Invalid value for `connection_port_role` ({0}), mu...
[ "0.6675221", "0.6536682", "0.64771336", "0.643482", "0.63028085", "0.62838185", "0.62733996", "0.62726057", "0.6268773", "0.61741924", "0.61579907", "0.61579907", "0.61579907", "0.6105567", "0.6075074", "0.5997939", "0.59857833", "0.59406775", "0.59406775", "0.59406775", "0.5...
0.8586469
0
Assert two lists almost equal.
def assertDictAlmostEqual(self, dict1, dict2): self.assertListEqual(dict1.keys(), dict2.keys()) for i, j in zip(dict1.keys(), dict2.keys()): self.assertListAlmostEqual(list(dict1[i]), list(dict2[j]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertListEqual(self, list1, list2, msg=None):\r\n self.assertSequenceEqual(list1, list2, msg, seq_type=list)", "def assert_lists_equal (a, b):\n assert len(a) == len(b)\n for index, expected in enumerate(a):\n actual = b[index]\n if isinstance(actual,str) and isinstance(expected, ...
[ "0.78839517", "0.7867425", "0.7808863", "0.77782553", "0.7636701", "0.76267934", "0.7588335", "0.75672525", "0.74624133", "0.7422582", "0.73967344", "0.73932785", "0.73869914", "0.71999514", "0.71991336", "0.71881765", "0.7184004", "0.7180751", "0.7178104", "0.71668005", "0.7...
0.0
-1
Assert two lists almost equal.
def assertListAlmostEqual(self, list1, list2): for i, j in zip(list1, list2): rounded_i, rounded_j = self.round_values(i, j) self.assertAlmostEqual(rounded_i, rounded_j)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertListEqual(self, list1, list2, msg=None):\r\n self.assertSequenceEqual(list1, list2, msg, seq_type=list)", "def assert_lists_equal (a, b):\n assert len(a) == len(b)\n for index, expected in enumerate(a):\n actual = b[index]\n if isinstance(actual,str) and isinstance(expected, ...
[ "0.7885452", "0.7868807", "0.7810357", "0.77803063", "0.7637246", "0.7626845", "0.7587751", "0.75673944", "0.74629027", "0.7420716", "0.7399396", "0.73926336", "0.7385423", "0.72009677", "0.7188644", "0.7184486", "0.71817434", "0.71804357", "0.71670157", "0.70920306", "0.7074...
0.71981436
14
Return the system id.
def get_system_id(self): return system.SystemManagement(self.client).get_system_id()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_system_id(self):\n return self.machine_config_file_value(\"DEFAULT.SID\").strip('\"')", "def file_system_id(self) -> str:\n return pulumi.get(self, \"file_system_id\")", "def get_clone_system_id(self):\n\n sys_id = self.user_systems_mgr.get_system_id()\n return sys_id", "d...
[ "0.83615786", "0.7682273", "0.7644981", "0.7439022", "0.72430104", "0.7030237", "0.70283455", "0.7012562", "0.68498755", "0.6808678", "0.6769043", "0.6738126", "0.6701721", "0.6693738", "0.6680318", "0.66737354", "0.66718143", "0.6656414", "0.6632786", "0.6624779", "0.6610771...
0.9230369
0
Return the system model name.
def get_system_model_name(self): return system.SystemManagement(self.client).get_system_model_name()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_name(self) -> str:\n return self._get_string(openvr.Prop_RenderModelName_String)", "def get_model_name(self):\n\n model_name = []\n model_name.append(self.get_model_type_hash())\n model_name.append(str(int(time.time())))\n return \"_\".join(model_name) + \".model\...
[ "0.8073972", "0.7907462", "0.7865882", "0.7822895", "0.77484596", "0.77091956", "0.7602069", "0.7596205", "0.7582411", "0.75579596", "0.74520415", "0.73455113", "0.7313186", "0.72846437", "0.7255404", "0.7246455", "0.72429657", "0.72080094", "0.7186412", "0.71400344", "0.7137...
0.9344253
0
The network UUID of an external gateway for the router.
def external_network_id(self) -> str: return pulumi.get(self, "external_network_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_network_id(self):\n\t\treturn call_sdk_function('PrlVirtNet_GetNetworkId', self.handle)", "def get_device_id(self, network):\n # There could be more than one dhcp server per network, so create\n # a device id that combines host and network ids\n\n host_uuid = uuid.uuid5(uuid.NAMESPAC...
[ "0.69283426", "0.68110025", "0.67746633", "0.668923", "0.668923", "0.668923", "0.6625821", "0.6577762", "0.65629625", "0.6535451", "0.651444", "0.651444", "0.64417446", "0.6367765", "0.63646585", "0.6359441", "0.6353521", "0.63178164", "0.63145465", "0.62964016", "0.6283311",...
0.7114002
0
Function to fetch the chain from a blockchain node, parse the data, and store it locally.
def fetch_posts(): get_chain_address = F"{CONNECTED_NODE_ADDRESS}/chain" response = requests.get(get_chain_address) if response.status_code == 200: content = [] chain = json.loads(response.content) for block in chain["chain"]: for tx in block["transactions"]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_chain():\n response = {\n 'chain': blockchain.chain,\n 'length':len(blockchain.chain)\n }\n\n return jsonify(response), 200", "def get_chain(self):\n app_process = sqlite3.connect('app_process::memory:', check_same_thread=False)\n app_process_cursor = app_process.curs...
[ "0.60987407", "0.5816403", "0.56391543", "0.56332684", "0.54955184", "0.5480293", "0.54046446", "0.5368525", "0.5321379", "0.5166924", "0.51448447", "0.5138189", "0.5032647", "0.5009114", "0.50053024", "0.50045025", "0.49803552", "0.49783364", "0.49729702", "0.49098444", "0.4...
0.4319509
81
First name of the concerned natural person
def FirstName(self, reg_first_name = VALUE_NOT_SET): if reg_first_name != VALUE_NOT_SET: self.__reg_first_name = reg_first_name try: self.__contact.AdditionalInfo().FirstName(self.__reg_first_name) except: pass else: if not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_name(self) -> str:\n return self.first_name", "def first_name(self) -> str:\n return self._first_name", "def pref_first_name(self):\n return self.known_as if self.known_as else self.first_name", "def get_first_name(self):\n return self._first_name", "def first_name...
[ "0.7882423", "0.7805149", "0.77341115", "0.7712801", "0.7661111", "0.7661111", "0.7661111", "0.76325965", "0.7625189", "0.7625189", "0.7606487", "0.75807947", "0.75807947", "0.7543393", "0.75275517", "0.7521005", "0.7509602", "0.7509602", "0.7509602", "0.7509602", "0.7509602"...
0.711053
59
Last name of the concerned natural person
def LastName(self, reg_last_name = VALUE_NOT_SET): if reg_last_name != VALUE_NOT_SET: self.__reg_last_name = reg_last_name try: self.__contact.AdditionalInfo().LastName(self.__reg_last_name) except: pass else: if not self.__...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_name():\r\n\r\n return surnames()", "def get_last_name(self) -> str:\n return self.last_name", "def getLastname(self):\n return self.lastname", "def get_last_name(people, individual):\n surname = people[individual]['NAME'].split()\n return surname[1]", "def lastname(self):\n...
[ "0.8193164", "0.80822515", "0.80346006", "0.7993029", "0.79857093", "0.79683965", "0.79683965", "0.79683965", "0.79683965", "0.79683965", "0.79646444", "0.79491335", "0.79422885", "0.79334354", "0.79334354", "0.79180735", "0.79180735", "0.79180735", "0.79180735", "0.7912743", ...
0.76919675
21
returns the ClientType based on where the CrmId is found on the linked objects
def ClientType(self): self.__client_type = FRegulatoryUtils.getClientType(self.__contact) return self.__client_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_type(self) -> Optional[str]:\n return pulumi.get(self, \"client_type\")", "def type(self):\n return _internals.CorrelationId_type(self)", "def find_type(source, target):\n x = [r for r in source.synset_relations if r.target == target.id]\n if len(x) != 1:\n raise Exception...
[ "0.5487231", "0.5164598", "0.51574206", "0.51353335", "0.5011951", "0.49763677", "0.49734464", "0.49716905", "0.49659985", "0.49616665", "0.49428558", "0.49414885", "0.4923532", "0.49094817", "0.48822343", "0.48643944", "0.48532623", "0.48462522", "0.48260435", "0.48219457", ...
0.5837794
0
the structure of board is a 2d list (21x21) the surroundings of board is always filled with Edge. you can put (x, y) where the range of x and y is 1 to 19. x represents vertical axis y represents horizontal axis this method should return list which contains two 2tuple (e.g [(6, 17), (12, 15)]).
def move(self, board): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def board(self):\n board = []\n if self.flop:\n board.extend(self.flop)\n if self.turn:\n board.append(self.turn)\n if self.river:\n board.append(self.river)\n return tuple(board) if board else None", "def make_board(row_...
[ "0.7138627", "0.6863729", "0.6824034", "0.6652067", "0.6637112", "0.65947896", "0.6561225", "0.6458626", "0.64301455", "0.6420492", "0.6367527", "0.6358973", "0.6356009", "0.63284135", "0.6282831", "0.62593085", "0.6249902", "0.6245804", "0.62330335", "0.6230744", "0.62263054...
0.0
-1
Test that force_bytes knows how to convert to bytes an exception containing nonASCII characters in its args.
def test_force_bytes_exception(self): error_msg = "This is an exception, voilà" exc = ValueError(error_msg) result = force_bytes(exc) self.assertEqual(result, error_msg.encode('utf-8'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_nonASCIIBytesToString(self):\n self.assertRaises(UnicodeError, nativeString, b\"\\xFF\")", "def test_py2_transaction_exception_message_bytes_implicit_encoding_non_english():\n try:\n\n # Bytes literal with non-ascii compatible characters only allowed in\n # python 2\n\n ra...
[ "0.77594966", "0.7754345", "0.748256", "0.74188924", "0.7351609", "0.7313225", "0.7176732", "0.71660197", "0.71446127", "0.71294063", "0.7124105", "0.71056265", "0.7031364", "0.70092523", "0.6898177", "0.6873759", "0.68179154", "0.6805716", "0.6797002", "0.67729616", "0.67559...
0.81311226
0
Translates the input file into a json text.
def generate_json_from_base64_image(base64_image): # Content image content_json_obj = {'content': base64_image} # Detection type. feature_json_obj = [{'type': get_detection_type(5), 'maxResults': 50, } ] # Now add it to the re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_json(self, inputfile):\n transtransfile = json.load(inputfile)\n self.language = transfile['lang']\n self.translations = transfile['strings']", "def _read_json(cls, input_file):\n with open(input_file) as f:\n return json.load(f)", "def _read_json(cls, input_file):\n ...
[ "0.7513639", "0.68007874", "0.68007874", "0.66803414", "0.66803414", "0.65688586", "0.65220004", "0.6511892", "0.6482155", "0.6418868", "0.6394679", "0.63921416", "0.63604486", "0.6353644", "0.6273617", "0.6259363", "0.6204062", "0.6163943", "0.6163943", "0.613355", "0.610954...
0.0
-1
Determines whether a given user from the authentication server has a certain right or not.
def has_right(self, username: str, right: str) -> bool: form: str = urlencode({'username': username, 'right': right}) headers: dict = { 'Content-type': 'application/x-www-form-urlencoded' } connection: HTTPConnection = self.__get_connection() connection.request('GET',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_roles_check(request):\n logger.debug('right_user_check')\n options = {\n 'api_file': {'GET': True, 'POST': False}\n }\n url_name = request.request.resolver_match.url_name\n if not request.request.user.is_authenticated:\n return False\n user_have_right = options[url_name][re...
[ "0.6864294", "0.6832401", "0.6566839", "0.65181917", "0.650468", "0.6478974", "0.64769286", "0.64769286", "0.6463664", "0.64017993", "0.6368617", "0.634587", "0.6326526", "0.63013756", "0.6293979", "0.62584096", "0.62548155", "0.62485784", "0.62485784", "0.6244719", "0.624461...
0.7994539
0
Returns total seconds of a timedelta in a way that's safe for Python < 2.7
def total_seconds(td): if hasattr(td, 'total_seconds'): return td.total_seconds() else: return ( lag.microseconds + (lag.seconds + lag.days * 24 * 3600) * 10**6 ) / 10.0**6
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_seconds(delta):\n try:\n return delta.total_seconds()\n except AttributeError:\n return ((delta.days * 24 * 3600) + delta.seconds +\n float(delta.microseconds) / (10 ** 6))", "def total_seconds(td):\n return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 1...
[ "0.78919387", "0.78847253", "0.783023", "0.78134507", "0.76809853", "0.7531021", "0.7426013", "0.73222214", "0.7240662", "0.72142905", "0.705758", "0.70381075", "0.6971049", "0.69674176", "0.69023997", "0.6851663", "0.68447584", "0.6843502", "0.6830019", "0.6829389", "0.68122...
0.74855494
6
Powers or unpowers the bells.
def power_bells(state): if not pinlessMode: if state: for pin in bellPins: GPIO.output(pin, GPIO.HIGH) elif not state: for pin in bellPins: GPIO.output(pin, GPIO.LOW) else: logging.debug("Bell state: " + str(state))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handlePowers(self):\n self.player.sprite.handlePowers(self.get_remaining_time())", "def poweroff(self) -> None:\n pass", "def poweroff(self):\n raise NotImplementedError()", "def set_powers(self, power_1, power_2):\n pass", "def power_off(self):\n raise NotImplemented...
[ "0.64014935", "0.6041298", "0.5899135", "0.5873446", "0.58522767", "0.5775622", "0.5713468", "0.5671503", "0.5662006", "0.56604326", "0.56582326", "0.5653668", "0.56442696", "0.5575584", "0.5575584", "0.55735165", "0.55625665", "0.5539788", "0.55348086", "0.5527003", "0.55260...
0.6172118
1
Calculate Perspective and Inverse Perspective Transform Matrices
def calc_transform(src_, dst_): M_ = cv2.getPerspectiveTransform(src_, dst_) Minv_ = cv2.getPerspectiveTransform(dst_, src_) return M_, Minv_
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perspective_transform():\n src = np.float32([(220,720), (1110, 720), (570, 470), (722, 470)]) # Manually get these numbers from plot\n dst = np.float32([[320, 720], [920, 720], [320, 1], [920, 1]])\n M = cv2.getPerspectiveTransform(src, dst)\n Minv = cv2.getPerspectiveTransform(dst, src)\n\n re...
[ "0.77655315", "0.6772391", "0.67308986", "0.669059", "0.6618192", "0.65587133", "0.64216304", "0.6264239", "0.6257005", "0.62168366", "0.6215676", "0.6160854", "0.6142326", "0.6108185", "0.6086129", "0.6077356", "0.60574424", "0.6047167", "0.6012863", "0.599367", "0.5987706",...
0.7251248
1
Convert parameters from X,Y plane to Image Plane Points
def coordinates_to_imgpts(x, y): pts = np.array([np.flipud(np.transpose(np.vstack([x, y])))]) return pts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_points_plane(points, plane):\n return [project_point_plane(point, plane) for point in points]", "def xyz2plane(x,y,z, new_x=[], plane=[], origin=None):\n # preliminary stuff\n if origin != None: x = x - origin\n a,b,c,d = plane\n bottom = np.sqrt(a*a + b*b + c*c) # normalize\n a,b...
[ "0.65616685", "0.64299065", "0.6374554", "0.63244987", "0.6322487", "0.6310065", "0.6286317", "0.6259193", "0.62357223", "0.6208368", "0.6159411", "0.60882986", "0.6084627", "0.60737157", "0.60300255", "0.60300255", "0.6017754", "0.5987526", "0.5984642", "0.59726226", "0.5969...
0.59584945
21
load_data takes path and loads in the dataset identified in this project into a pandas df. It then prints high level information about the dataframe for the users reference and returns this dataframe
def load_data(path): columns = ['Item Year', 'Original Value', 'Standard Value', 'Original Currency', 'Standard Currency', 'Orignal Measure', 'Standard Measure', 'Location', 'Commodity'] col_type = [int, float, float, object, object, object, object, object] col_type_dict = di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data():\n df = pd.read_csv(\"https://raw.githubusercontent.com/Andrea-Giuliani/Python-Project/master/data/final_dataset.csv\",sep=',') \n return df", "def loadData(path_file):\n data = pd.read_csv(path_file) \n data.head()\n return data", "def load_data():\n \n data = datasets.lo...
[ "0.67460644", "0.64907336", "0.64832234", "0.6358895", "0.63168895", "0.62954944", "0.62547684", "0.6236128", "0.6230134", "0.6215533", "0.6180172", "0.61594254", "0.6152189", "0.6103808", "0.6073373", "0.6071692", "0.6057447", "0.6054861", "0.6051355", "0.6035068", "0.602572...
0.0
-1
Test that updates properly overwrite and are untagged.
def test_update(self): doc_fields = document_fields.DocumentFields({ 'foo@': 'bar', }) self.assertEquals('bar', doc_fields['foo']) doc_fields.update({ 'foo@': 'bbq', }) self.assertEquals('bbq', doc_fields['foo'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update(self):\n pass", "def test_update(self):\n pass", "def test_update(self):\n pass", "def test_update_case(self):\n pass", "def test_update_metadata(self):\n pass", "def test_update_metadata1(self):\n pass", "def test_partial_update_metadata(self):...
[ "0.723041", "0.723041", "0.723041", "0.7100334", "0.7058294", "0.70286316", "0.6987502", "0.69788766", "0.68703234", "0.6843875", "0.6841047", "0.680045", "0.67363405", "0.66987944", "0.66319287", "0.6622596", "0.6543176", "0.6509451", "0.6463772", "0.6427286", "0.6409471", ...
0.59169775
86
Creates and returns a connection to a Microsoft SQL Server database.
def create_mssql_connection( dbname, prod=True, driver="{ODBC Driver 17 for SQL Server}", driver_type="pyodbc" ): db_config = toolbox.open_system_config(prod=prod, config_type="DB_CONFIG")[dbname] if driver_type == "pyodbc": connection = pyodbc.connect( driver=driver, server=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createConnection(self):\n comp_name = os.environ['COMPUTERNAME']\n conn = py.connect('Driver=ODBC Driver 11 for SQL Server;SERVER=' +\n comp_name + '\\HAZUSPLUSSRVR; UID=SA;PWD=Gohazusplus_02')\n self.conn = conn\n return conn", "def create_connection():\r\n tr...
[ "0.69744205", "0.6950537", "0.67107075", "0.64784396", "0.6422242", "0.6395865", "0.638747", "0.638506", "0.6319929", "0.6319132", "0.6210808", "0.6189856", "0.6167106", "0.61432165", "0.6121374", "0.6109558", "0.61014706", "0.60880446", "0.60853744", "0.60759133", "0.6063821...
0.72884434
0
Return the camera's mac address as the serial number.
def serial_number(self) -> str: return self.mac_address
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_mac_address(self):\n str_hex_mac = uuid.UUID(int=uuid.getnode()).hex[-12:]\n return str_hex_mac", "def mac(self) -> str:\n return self.camera_info[\"wifi_mac\"]", "def mac_address(self) -> str:\n return self._device.mac", "def serial(self) -> str:\n return self.ca...
[ "0.74284977", "0.7396035", "0.7244921", "0.7241079", "0.7186397", "0.71549183", "0.6929182", "0.6929182", "0.68750423", "0.686168", "0.6835941", "0.6835715", "0.68190706", "0.67833877", "0.6717112", "0.6596283", "0.65792704", "0.6549326", "0.6522258", "0.6508936", "0.6494126"...
0.77441496
0
Displays normalized confusion matrix.
def create_confusion_matrix(model, X_test, y_test, test_pred, title): # Confusion matrix class_names = ["Skipped", "Not Skipped"] print("Confusion Matrix: %s" % title) print(confusion_matrix(y_test, test_pred)) disp = plot_confusion_matrix( model, X_test, y_test, dis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\")\r\n plt.figtext(0,0,'Accuracy: {}\\nError: {}\\nRecall: {}\\nPrecision: {}'.format(self.accuracy,\r\n ...
[ "0.769349", "0.76869637", "0.751314", "0.74637914", "0.7293348", "0.7269612", "0.72648704", "0.72433674", "0.72433656", "0.7228648", "0.7225077", "0.72247624", "0.7224549", "0.7219793", "0.7218805", "0.72116745", "0.71959615", "0.71941775", "0.71938807", "0.71917826", "0.7187...
0.0
-1
Creates a classification model.
def create_model(is_predicting, input_ids, input_mask, segment_ids, labels, num_labels): bert_module = hub.Module( ClassifierModel.BERT_MODEL_HUB, trainable=True) bert_inputs = dict( input_ids=input_ids, input_mask=input_mask, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_model(self):\n self.classifier = DecisionTreeClassifier(max_depth=1)", "def create_model(self, C : float =1):\n self.classifier = RandomForestClassifier(max_depth=5)", "def create_model():\n\n # Create a sequential model (a simple NN is created) adding a softmax activation at the en...
[ "0.7451048", "0.716728", "0.70753753", "0.69427526", "0.69337225", "0.69306064", "0.6929345", "0.68631464", "0.68004555", "0.6769279", "0.6737084", "0.66838384", "0.66709864", "0.660953", "0.65912193", "0.6564333", "0.6534873", "0.6526978", "0.6525293", "0.6521778", "0.651739...
0.0
-1
Returns the element at the top of the stack
def top(self): return super().peek()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top(self):\n\t\tif self.is_empty():\n\t\t\traise Empty('Stack is empty')\n\t\treturn self._head._element", "def top(self):\n if self.stack == []:\n return None\n return self.stack[-1]", "def top(self):\n if self.is_empty():\n raise Empty('Stack is empty')\n ...
[ "0.8426997", "0.83845615", "0.8306367", "0.8226858", "0.807717", "0.80328375", "0.80252784", "0.8019078", "0.797039", "0.79673326", "0.7955196", "0.79414254", "0.7932987", "0.7927457", "0.7792212", "0.77724975", "0.7744826", "0.7740041", "0.76800865", "0.76103806", "0.7591366...
0.71395046
61
Return a saved state value, None if item is undefined.
def __getitem__(self, item): return self._state["data"].get(item, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getattr__(self, item):\r\n return self...
[ "0.63567495", "0.63567495", "0.63567495", "0.6147721", "0.6147721", "0.6143838", "0.61314815", "0.60985714", "0.60985714", "0.60985714", "0.5938411", "0.5815865", "0.5792894", "0.57494944", "0.57324725", "0.57256", "0.5721121", "0.5721121", "0.5684823", "0.5684823", "0.568482...
0.6427416
0
Return a saved state value, None if item is undefined.
def __getattr__(self, item): return self._state["data"].get(item, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return se...
[ "0.64281183", "0.64281183", "0.6357475", "0.6357475", "0.6357475", "0.61450446", "0.6130774", "0.6099511", "0.6099511", "0.6099511", "0.59375536", "0.58148605", "0.5792937", "0.57490504", "0.5732397", "0.5725432", "0.572095", "0.572095", "0.56847996", "0.56847996", "0.5684799...
0.6148605
5
Create a dataset from a list of Examples and Fields.
def __init__(self, examples, filter_pred=None, **kwargs): if filter_pred is not None: make_list = isinstance(examples, list) examples = filter(filter_pred, examples) if make_list: examples = list(examples) self.examples = examples
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateDataset(all_arrays):\n dataset = Dataset()\n\n dataset._addData(all_arrays[0])\n dataset._addData(all_arrays[1])\n dataset._addData(all_arrays[3])\n dataset._addData(all_arrays[5])\n dataset._addData(all_arrays[6])\n dataset._addData(all_arrays[9])\n dataset._addData(all_arrays[8]...
[ "0.66175133", "0.65675855", "0.6489426", "0.64110506", "0.6397567", "0.63752276", "0.6319362", "0.6216499", "0.6209005", "0.6183818", "0.61597437", "0.6138031", "0.61348975", "0.6127125", "0.61253273", "0.61253273", "0.61253273", "0.6124141", "0.6122481", "0.60865337", "0.606...
0.0
-1
Create Dataset objects for multiple splits of a dataset.
def splits(cls, root='.data', train=None, validation=None, test=None, **kwargs): path = cls.download(root) train_data = None if train is None else cls(os.path.join(path, train), **kwargs) val_data = None if validation is None else cls(os.path.join(path, validation), **kwargs) test_data =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dataset(self, split, shuffle_files=None):\n return self._as_dataset(split=split, shuffle_files=shuffle_files)", "def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, s...
[ "0.714736", "0.71266127", "0.7124513", "0.6978415", "0.69318837", "0.6857103", "0.6852228", "0.6806051", "0.6730736", "0.67166394", "0.66391075", "0.66319656", "0.6599639", "0.65770274", "0.6532192", "0.6507811", "0.65007865", "0.64922684", "0.6482739", "0.64560986", "0.63962...
0.0
-1
Computes the rowwise cosine similarity matrix of a rating matrix.
def similarity_matrix(feat_mat): sim_mat = cosine_similarity(feat_mat) np.fill_diagonal(sim_mat, 0) return sim_mat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cosine_sim_cf(matrix):\n if type(matrix) is not lil_matrix:\n matrix = lil_matrix(matrix)\n\n n = matrix.shape[0]\n rows, cols, data = [], [], []\n user_items = [sorted([(item, idx) for idx, item in enumerate(matrix.rows[i])]) for i in range(n)]\n\n for i in range(n):\n i_ratings, ...
[ "0.77840763", "0.7654144", "0.7522678", "0.7134965", "0.71157086", "0.6820214", "0.67638975", "0.66730607", "0.6665848", "0.6656157", "0.6655661", "0.6623994", "0.66095823", "0.6570017", "0.6487632", "0.64274234", "0.6385559", "0.63674223", "0.63396907", "0.6329559", "0.63160...
0.72332346
3
Indicates whether the task state's result is cached.
def is_cached(self): if self.should_persist: # If our value is persistable, it can be saved either on disk or in memory, # but only the former counts as being officially "cached". return self._result_value_hash is not None else: return self._result is not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_cached(self):\n return False", "def is_cached(name, typ=\"pkl\"):\n return os.path.exists(cache_name(name, typ))", "def _may_cache(self, request, response=None):\n # any successful request may be cached\n return ((HTTPStatus.OK <= response.status_code < HTTPStatus.BAD_REQUEST)\n ...
[ "0.74749434", "0.68324715", "0.68149173", "0.6738329", "0.6655201", "0.66187906", "0.65679663", "0.6416865", "0.6415875", "0.6382452", "0.6292968", "0.62685287", "0.62240446", "0.6211946", "0.6159335", "0.61113095", "0.60873556", "0.60792947", "0.6072414", "0.6051632", "0.604...
0.79039913
0
Loads the hash of the persisted value for this task, if it exists. If the persisted value is available in the cache, this object's `is_cached` property will become True. Otherwise, nothing will happen.
def attempt_to_access_persistent_cached_value(self): assert self.is_initialized assert not self.is_cached if not self.should_persist: return if not self._cache_accessor.can_load(): return self._load_value_hash()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_value_hash(self):\n\n artifact = self._cache_accessor.load_artifact()\n if artifact is None or artifact.content_hash is None:\n raise AssertionError(\n oneline(\n f\"\"\"\n Failed to load cached value (hash) for descriptor\n ...
[ "0.72252256", "0.63859934", "0.5972734", "0.5886148", "0.5879905", "0.5804419", "0.574814", "0.5677867", "0.5613093", "0.5568389", "0.5543914", "0.54435587", "0.54258996", "0.5423656", "0.5395598", "0.53953743", "0.5376388", "0.53689486", "0.53612226", "0.53522384", "0.535086...
0.71849906
1
Returns copies of the provided TaskStates with any unnecessary state and ancestors "stripped" off; these copies can be safely transmitted to another process for computation.
def strip_states(self, states): stripped_states_by_task_key = {} def strip_state(original_state): """Returns a stripped copy of a TaskState.""" task_key = original_state.task_key if task_key in stripped_states_by_task_key: return stripped_states_by_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_state(original_state):\n\n task_key = original_state.task_key\n if task_key in stripped_states_by_task_key:\n return stripped_states_by_task_key[task_key]\n\n assert original_state in self.all_states\n assert original_state not in self.non_serial...
[ "0.7007315", "0.6059291", "0.57722616", "0.5648813", "0.54974157", "0.54269755", "0.53582656", "0.53353125", "0.52991706", "0.52278084", "0.5219097", "0.5181115", "0.5153454", "0.5147667", "0.5111569", "0.51057416", "0.5078182", "0.5068822", "0.5066051", "0.49776638", "0.4975...
0.84246093
0
Create a time stamp
def format_time(self, record): record.dbtime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(record.created)) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_time_stamp() -> str:\n\n return datetime.datetime.now().strftime(\"%Y%m%d\")", "def createTimeStamp_Time():\r\n\r\n return str(datetime.now().strftime(\"%H%M%S\"))", "def _generate_timestamp():\n\t\treturn strftime(\"%Y%m%dT%H%M%S\")", "def time_stamper() :\n\treturn datetime.now().strf...
[ "0.8233453", "0.80581737", "0.79409295", "0.7885426", "0.77232575", "0.76477885", "0.76388806", "0.7607675", "0.7506243", "0.7500952", "0.7491634", "0.7403374", "0.73812056", "0.73719895", "0.7358379", "0.72903913", "0.72595435", "0.72434366", "0.72373694", "0.7206951", "0.71...
0.0
-1
Check if two boards are equal
def board_equals(board, newboard): return (newboard == board).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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] != other.board[row]:\n return False\n return True",...
[ "0.7675659", "0.75886476", "0.75203764", "0.7315694", "0.70487416", "0.6995405", "0.697579", "0.69640183", "0.6950214", "0.6934378", "0.69289273", "0.6896391", "0.68638206", "0.6810947", "0.68063855", "0.67953414", "0.67835134", "0.67559415", "0.6735635", "0.6714601", "0.6604...
0.77490914
2
Returns the learning rate scaled by schedule(s) that will be used for the next training step
def current_lr( self, optimizer_states: types.OptimizerStates ) -> tp.Optional[jnp.ndarray]: if self.lr_schedule is not None: step = optimizer_states[-1].count return self.lr_schedule(step)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_rate_schedule(current_epoch,\n current_batch,\n batches_per_epoch,\n batch_size):\n del current_batch, batches_per_epoch # not used\n initial_learning_rate = common.BASE_LEARNING_RATE * batch_size / 128\n learning_rate =...
[ "0.79894197", "0.7785588", "0.77826655", "0.76667386", "0.76645464", "0.7660921", "0.74982613", "0.74174136", "0.74023986", "0.7375447", "0.7314137", "0.7252626", "0.7250394", "0.72385687", "0.7227012", "0.7188356", "0.717606", "0.7163271", "0.7159572", "0.7149901", "0.714215...
0.0
-1
simple base conversion using the RFC4648 base32 alphabet
def _base32_to_hex(base32): ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' x = 0 for digit in str(base32.upper().strip(' ')): x = x * len(ALPHABET) + ALPHABET.index(digit) return hex(x).lstrip('0x').rstrip('L').upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def baseEncode(number, base=36):\n if base == 10:\n return str(number)\n if not isinstance(number, int):\n raise TypeError('number must be an integer')\n alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'\n if base > 62 or base <=1:\n print(\"base should be b...
[ "0.694653", "0.6893029", "0.68493384", "0.6781506", "0.6748476", "0.6748476", "0.6748476", "0.6748476", "0.673473", "0.67151284", "0.66982746", "0.66775656", "0.6672081", "0.66119474", "0.66039515", "0.6559059", "0.6518085", "0.6504039", "0.64883107", "0.64749783", "0.6462858...
0.68664634
2
Converts a twodimensional grid with onedimensional coordinate variables to an array where each grid value is associated with its coordinates.
def grid2triple(x, y, z, msg=None, meta=False): # todo: Revisit for handling of "meta" argument # Basic sanity checks if z.ndim != 2: raise DimensionError( "ERROR grid2triple: `z` must be two dimensions !\n") if isinstance(x, xr.DataArray): x = x.values if isinstance(y,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_numpy_array_2D(self):\n wx = []\n wy = []\n for wp in self.waypoints:\n wx.append(wp.location.x)\n wy.append(wp.location.y)\n return np.array([wx, wy])", "def _getLatLonGrid(self, lats, lons):\n numLats, numLons = lats.shape\n\n #coordGrid = ...
[ "0.7030514", "0.6824461", "0.66414434", "0.659834", "0.6587743", "0.65657645", "0.6543118", "0.6542288", "0.6476765", "0.6476106", "0.6450794", "0.62825483", "0.62591165", "0.62475705", "0.62113106", "0.6190677", "0.61894315", "0.6177104", "0.61621207", "0.6114646", "0.610391...
0.0
-1
Create and configure connexion app.
def create_app(env): connexion_app = connexion.App(__name__, specification_dir='openapi/', options={'swagger_url': '/swagger'}) app = connexion_app.app env_config_class_map = { 'prod': 'config.Prod', 'testing': 'config.Testing', 'dev': 'config.Dev' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app(self):\r\n self.app = Flask(__name__, instance_relative_config=True)\r\n\r\n # Init the secret key of the app -it is a must for flask to run\r\n self.app.config.from_mapping(\r\n SECRET_KEY='!ZNeverSayNever116Z!',\r\n MONGODB_SETTINGS= {'host': 'mongodb://l...
[ "0.74086744", "0.71356195", "0.71240467", "0.7108809", "0.7074317", "0.7031925", "0.70253813", "0.7023434", "0.7022537", "0.7013904", "0.70036703", "0.69989914", "0.69644254", "0.6951114", "0.69442946", "0.693363", "0.6925931", "0.6923495", "0.6898156", "0.68892235", "0.68874...
0.7772478
0
Predicts the next action the bot should take after seeing x. This should be overwritten by more advanced policies to use ML to predict the action. Returns the index of the next action
def predict_action_probabilities(self, tracker, domain): # type: (DialogueStateTracker, Domain) -> (float, Optional[int]) x = self.featurize(tracker, domain) logger.debug('Current tracker state [\n\t{}]'.format( "\n\t".join(["{}".format(e) for e in self.featurizer.decode_features(x, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, x):\n self.eval()\n self.forward(x)\n predicted = np.argmax(self.inputs[-1], axis=1)\n return predicted", "def predict_step(self, x):\n\n input_x = self.session.graph.get_operation_by_name(\"input_x\").outputs[0]\n predictions_op = self.session.graph.ge...
[ "0.6715775", "0.66838646", "0.6628312", "0.66075236", "0.657193", "0.6548782", "0.6548782", "0.6548782", "0.6548782", "0.6533695", "0.64771754", "0.64747757", "0.6376165", "0.635955", "0.63558674", "0.6354287", "0.635243", "0.63053787", "0.62928694", "0.6230337", "0.6215346",...
0.62475294
19
Set up an interceptor so all grpc calls will have the apikey added on the header, in order to authenticate.
def set_interceptor(self, apikey): self.header_interceptor = \ interceptor.header_adder_interceptor( 'lc-api-key', apikey ) try: self.intercept_channel = grpc.intercept_channel( self.channel, self.header_interceptor) except ValueError as e: raise Exception("Attempted to connect on termninated cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate(self, api_key):\n self.headers['x-rapidapi-key'] = api_key", "def __init__(self, api_key):\n self._api_key = api_key\n self.headers = {\n \"hibp-api-key\": api_key,\n \"user-agent\": \"haveibeenpywned.py\",\n }\n \"\"\"Dict of additional h...
[ "0.6686443", "0.63640404", "0.59382933", "0.5867886", "0.5780181", "0.5739476", "0.57209116", "0.57013947", "0.56940454", "0.569231", "0.56693566", "0.56687033", "0.5631621", "0.56137", "0.5556618", "0.55513924", "0.5533995", "0.5528315", "0.55266106", "0.5516029", "0.5476392...
0.79679054
0
Convert the datapoints into a pandas DataFrame.
def to_pandas( # type: ignore [override] self, column_names: str = "external_id", include_aggregate_name: bool = True, include_granularity_name: bool = False, include_errors: bool = False, ) -> pandas.DataFrame: pd = cast(Any, local_import("pandas")) if colum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_dataframe(self, dataset_name):\n values = self[dataset_name][:]\n columns = self.get_columns(dataset_name)\n timestamps = self.get_timestamps(dataset_name)[...]\n if len(columns) < values.shape[1]:\n columns.resize(values.shape[1])\n\n # transform missing data ...
[ "0.76260304", "0.7595923", "0.74861777", "0.7397173", "0.7382126", "0.71352553", "0.7028942", "0.6888257", "0.6883333", "0.68173844", "0.68173844", "0.6742965", "0.6644486", "0.66278166", "0.66209453", "0.6607725", "0.66036254", "0.66008824", "0.6582569", "0.65765226", "0.656...
0.0
-1
Convert the DatapointsArrayList into a pandas DataFrame.
def to_pandas( # type: ignore [override] self, column_names: Literal["id", "external_id"] = "external_id", include_aggregate_name: bool = True, include_granularity_name: bool = False, ) -> pandas.DataFrame: pd = cast(Any, local_import("pandas")) dfs = [dps.to_pandas(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dataframe(self) -> \"pd.DataFrame\":\n import pandas as pd\n\n df = pd.DataFrame([row.as_series() for row in self.rows])\n return df", "def to_dataframe(dslist):\n from pytraj.utils import _import_pandas\n has_pandas, pd = _import_pandas()\n \n if not has_pandas:\n ...
[ "0.70076054", "0.68862015", "0.680678", "0.67758507", "0.6767373", "0.67039317", "0.66800386", "0.6670868", "0.66436577", "0.66392887", "0.6600126", "0.65596896", "0.65596896", "0.65123266", "0.6492922", "0.64803016", "0.6430784", "0.63652426", "0.6329354", "0.6299667", "0.62...
0.56777686
84
Get filename for simulated community produced by mete.sim_spatial_whole()
def comm_filename(S, N, ncomm, bisec, transect=False, abu=None, comm_name=None): if not comm_name: comm_name = 'S%s_N%s' % (S, N) if abu: empir = '_empirSAD' else: empir = '' if transect: runtype = 'transect' else: runtype = 'grid' return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filename(self):\n return os.path.basename(self._spatial_filename)", "def get_sim_file(cls, root_dir, constants):\n return os.path.join(root_dir, '%s.hdf5' % constants['mos_type'])", "def get_sim_file(cls, root_dir, constants):\n return os.path.join(root_dir, '%s.hdf5' % constants['mos_...
[ "0.65646577", "0.6268533", "0.6268533", "0.6141475", "0.6039565", "0.59756315", "0.5955562", "0.5923402", "0.5783788", "0.572006", "0.5696253", "0.5686741", "0.56813705", "0.5656483", "0.56059337", "0.557937", "0.5579157", "0.5563723", "0.552336", "0.5519685", "0.55115503", ...
0.5922241
8
Function implements sieve of Eratosthenes (for all numbers uptil N). Returns array erat_sieve If erat_sieve[i] is True, then 2i + 3 is a prime.
def sieve_of_erat(N): erat_sieve = [True]*int(N/2) prime_list = [] prime_list.append(2) for i in range(int((math.sqrt(N)-3)/2)+1): # Only need to run till sqrt(n) if erat_sieve[i] == True: j = i + (2*i+3) while j < int(N/2): erat_sieve[j] = False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primeSieve(n):\n result = []\n sieve = array.array('i', (True for i in range(0, n+1)))\n for k in range(2, n+1):\n if sieve[k]:\n result.append(k)\n i = k * k\n while i <= n:\n sieve[i] = False\n i += k\n return result", "def e...
[ "0.7732913", "0.7636703", "0.7548963", "0.7507189", "0.7439305", "0.7436849", "0.7405845", "0.73973405", "0.73973405", "0.7349964", "0.73457396", "0.7325795", "0.7229576", "0.72279704", "0.7197789", "0.7099972", "0.7085385", "0.70812255", "0.7055499", "0.70475835", "0.7027430...
0.77103347
1
Returns a string reprentation of this object.
def __repr__(self): dictionary = {"Question Text": self.text, "Answers": " ".join(self.answers), \ "Referers": " ".join(self.referers), "Named entities": " ".join(self.named_entities) } return repr(dictionary)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_string(self):\n return self.__repr__()", "def __repr__(self):\n return str(self)", "def __repr__(self):\n return str(self)", "def __repr__(self):\n return str(self)", "def __repr__(self):\n return str(self)", "def __repr__(self):\n return str(self)", "de...
[ "0.82876116", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.8179296", "0.816321", "0.8133825", "0.8133825", "0.8133825", "0.8133825", "0.8127164", "0.8127164", "...
0.0
-1
The set of words that are ignored (e.g. stopwords)
def censored(self): if not self._vocab: self.vocab() return self._censored
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interestingWords(self):\n words = set([])\n for token in self.importantTokenList():\n if token.isStopWord() == False:\n words.add(token.text.lower())\n return words", "def retrieveIgnoredWords(self):\n words = self.con.getIgnoredWords()\n guilds = self.con.getGuildsInfo()\n...
[ "0.7929255", "0.7721634", "0.76417553", "0.7594571", "0.7561156", "0.7558134", "0.75047934", "0.74923915", "0.7464799", "0.74498874", "0.74433726", "0.7439269", "0.7437416", "0.74312687", "0.74305564", "0.7424451", "0.7424451", "0.7424451", "0.7424451", "0.73937154", "0.73705...
0.0
-1
Return the vocab dictionary
def vocab(self): num_words = -1 if not self._vocab: c = self._conn.cursor() c.execute('select feature, censored, word_id from vocab') d = {} for ww, cc, ii in c: d[ii] = ww d[ww] = ii if cc == 1: self._censored.add(ww) num_words = max(ii, num_wo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vocab():\n symbols = DEFAULT_SPECIAL_SYMBOLS + [\"mouse\", \"dog\", \"tree\"]\n return Vocabulary(symbols)", "def get_vocab(self):\n\n\t\tself.parse_transcript() \n\t\tself.purge_words()\n\t\tself.analyze_words()\n\t\tself.sort_word_analysis()", "def get_input_vocab():\n vocab = set()\n vocab.u...
[ "0.7800878", "0.75961435", "0.7437031", "0.7317012", "0.73040634", "0.72950774", "0.7268286", "0.7198509", "0.7144368", "0.71350545", "0.7107896", "0.705793", "0.70412797", "0.7035426", "0.70024836", "0.69716805", "0.69458526", "0.69275844", "0.68653035", "0.68614393", "0.684...
0.74990356
2
Integer. Group ID of current path group. Could be used for switching active path group.
def id(self): return self._group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_id(self) -> int:\n return self._group_id", "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def group_id(self):\n return self._id", "def group_id(self):\n return self._gr...
[ "0.787597", "0.7829336", "0.7829336", "0.776296", "0.7749905", "0.7749905", "0.7749905", "0.7592762", "0.74955857", "0.7440735", "0.734738", "0.734646", "0.7330007", "0.7330007", "0.7330007", "0.7271022", "0.70585907", "0.7036965", "0.70027983", "0.70027983", "0.70027983", ...
0.77427405
7
String. Selector of current path group. Path group selector determines which path in active path group will be use to next I/O.
def selector(self): return self._selector
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self, group):\n return", "def get_group_selector(*args):\n return _ida_segment.get_group_selector(*args)", "def select_path(self):\r\n pass", "def build_path(self):\r\n return self.selmgr.select_path()", "def set_group_selector(*args):\n return _ida_segment.set_group_selector(*args...
[ "0.64250207", "0.6143256", "0.6095452", "0.59830743", "0.57778186", "0.5769308", "0.5540597", "0.54764575", "0.54764575", "0.5355067", "0.53290826", "0.522171", "0.52134025", "0.5175387", "0.5168265", "0.51633954", "0.51424783", "0.5118612", "0.511272", "0.5078855", "0.505106...
0.57455444
6
String. WWID of current mpath.
def wwid(self): return self._uuid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self) -> str:\n return '_'.join(['wavin', self._controller_id, str(self._name), 'battery'])", "def getPath(self):\n uid = str(self._result.uid)\n if not uid.startswith('/zport/dmd'):\n uid = '/zport/dmd/' + uid\n return uid", "def device_path(self):\n re...
[ "0.6177691", "0.60953784", "0.60286385", "0.59536564", "0.59037435", "0.58918136", "0.58785886", "0.58785886", "0.58731186", "0.5863684", "0.58540994", "0.5815289", "0.5815289", "0.5808639", "0.57726943", "0.57599044", "0.5754434", "0.5745627", "0.57430816", "0.57271993", "0....
0.73362756
0
List of DMMP_mpath objects.
def path_groups(self): return self._path_groups
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mps_by_device(self, devpath):\n mps = []\n mounts = self.read_mounts()\n for m in mounts:\n if devpath == m.device:\n mps.append(m.mountpoint)\n return mps", "def get_mounts(self):\n return [m.split()[0] for m in self.xlist(\"get-mounts\")[1]]"...
[ "0.6262625", "0.57818997", "0.5664515", "0.547284", "0.5466374", "0.5382272", "0.5359383", "0.535148", "0.5316523", "0.52730924", "0.5256024", "0.51935726", "0.5149534", "0.5080365", "0.5072454", "0.50651854", "0.5028563", "0.5024082", "0.50062305", "0.5006047", "0.49944177",...
0.0
-1
The string for DEVNAME used by kernel in uevent.
def kdev_name(self): return self._sysfs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_device_name(self):\n name = self._device[\"name\"]\n if not name or name == \"--\":\n name = self._mac\n\n return name", "def name(self):\n return self.devname", "def name(self):\n return f\"{get_device_name(self._data, 0, self._name)}\"", "def device_nam...
[ "0.7653964", "0.7651574", "0.7606604", "0.75387293", "0.75387293", "0.7465343", "0.7465343", "0.7457964", "0.743613", "0.73530847", "0.73530847", "0.73530847", "0.727464", "0.7246561", "0.7210606", "0.7110714", "0.7101008", "0.70763487", "0.70535266", "0.7051693", "0.7044535"...
0.77354324
0
M,N are two matrices of vectors, returns a matrix which is M if M,N have positive dot product, and 0 otherwise
def clip_at_zero(M,N): dotprod = np.sum(np.multiply(M,N),axis = 0) if (np.any(np.logical_and(dotprod <= 0, np.all(M == np.array((0,0)).reshape((2,1,1)), axis=0)))): print('clipping happened') return np.where(dotprod<=0,np.zeros_like(M),M)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def naive_matrix_dot(x, y):\n assert len(x.shape) == 2\n assert len(y.shape) == 2\n assert x.shape[1] == y.shape[0]\n\n z = np.zeros((x.shape[0], y.shape[1]))\n for i in range(x.shape[0]):\n for j in range(y.shape[1]):\n row_x = x[i, :]\n column_y = y[:, j]\n ...
[ "0.72495085", "0.7174039", "0.71379566", "0.6967614", "0.6911988", "0.68983024", "0.6875445", "0.6848363", "0.6824717", "0.6817393", "0.6791111", "0.6785556", "0.6755931", "0.6749309", "0.6747172", "0.6725255", "0.67065775", "0.66520125", "0.66332483", "0.65919644", "0.659113...
0.0
-1
Returns the scheduling actions based on highest Qvalues. This requires the model weights to be already saved.
def get_best_schedule(self): # load the model weights self.models = [load_model(f'dqn_{task_id}.h5') for task_id in range(len(self.models))] actions = [] is_scheduled = [0] * len(self.models) while (not all(is_scheduled)): observation = OrderedDict([('is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bestAction(self):\n get_q = self.getQFunction()\n maxq = -5000\n best_actions = []\n for (state, action), q in get_q.items():\n if q > maxq:\n maxq = q\n best_actions = [action]\n elif q == maxq:\n best_actions.appen...
[ "0.767564", "0.71033466", "0.69351465", "0.6854587", "0.68315357", "0.6827179", "0.68225276", "0.67966247", "0.67770445", "0.67721236", "0.67721236", "0.67337626", "0.67147684", "0.6710782", "0.66831255", "0.6642326", "0.66293216", "0.6593363", "0.65867025", "0.65508795", "0....
0.7105697
1
Splits a longer list to respect batch size
def chunks(lst, chunk_size=MAX_BATCH_SIZE): for i in range(0, len(lst), chunk_size): yield lst[i : i + chunk_size]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_chunk(list, chunk_size):\n for i in range(0, len(list), chunk_size):\n yield list[i:i + chunk_size]", "def ghetto_split(list_, chunk_size=100):\n logging.debug(f\"Splitting list of {len(list_)} length, chunk size = {chunk_size}\")\n split_lists = []\n for i in range(0,len(lis...
[ "0.75917864", "0.75681007", "0.7379371", "0.7313012", "0.72504157", "0.7228511", "0.7125443", "0.7111731", "0.7098357", "0.706227", "0.7031203", "0.7005405", "0.69943714", "0.6993998", "0.6941382", "0.69374204", "0.6936441", "0.6932338", "0.6922199", "0.6912759", "0.68996865"...
0.7232765
5
Takes a word and returns true if there are hiragana or katakana present within the word
def contains_kana(word): for k in word: if k in hiragana or k in katakana or k in small_characters: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_japanese(x):\n pattern = re.compile(r'[\\p{IsHira}\\p{IsKatakana}]', re.UNICODE)\n ret = bool(pattern.search(x))\n return ret", "def isValid(text):\n\n\n return any(word in text for word in [u\"我好看么\", u\"称赞\"])", "def is_british_english_term(word: str) -> bool:\n word = process_word(word...
[ "0.6930642", "0.68723994", "0.66538167", "0.6580591", "0.6552416", "0.65398663", "0.64157027", "0.6405542", "0.6381708", "0.6371139", "0.6359613", "0.63581526", "0.6336159", "0.6310224", "0.63045526", "0.6291132", "0.628089", "0.6279967", "0.6273224", "0.6266891", "0.625361",...
0.87406576
0
Override to default the region to the user's profile region.
def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name == 'region': if request.user.profile.region is not None: kwargs['initial'] = request.user.profile.region.pk return db_field.formfield(**kwargs) return super(RegionalObjectiveAdmin, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def region(self):\n return self.config.region", "def set_default_region(profile=None):\n if os.getenv('AWS_DEFAULT_REGION'):\n return os.getenv('AWS_DEFAULT_REGION')\n elif profile is not None:\n return awscli_region(profile_name=profile)\n return awscli_region(profile_name='default...
[ "0.6674411", "0.65948874", "0.6539426", "0.6539426", "0.6539426", "0.6539426", "0.6539426", "0.6539426", "0.6532454", "0.65130454", "0.65130454", "0.65130454", "0.65130454", "0.64127284", "0.6336552", "0.6322187", "0.6308277", "0.6253582", "0.6200991", "0.6195054", "0.6139514...
0.0
-1
Generates a list of random colours in RGB given a random number generator and the size of this list
def generate_random_colours_list(rng: random.Random, size: int) -> List[TupleInt3]: return [random_colour(rng) for _ in range(size)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_color_gen():\n r = randint(0, 255)\n g = randint(0, 255)\n b = randint(0, 255)\n return [r, g, b]", "def _random_color() -> List[float]:\n return [np.random.uniform(), np.random.uniform(), np.random.uniform()]", "def get_color_list(cluster_count):\n color_list = []\n for i in xr...
[ "0.7871541", "0.748539", "0.7485229", "0.74038225", "0.72706544", "0.71166867", "0.70931363", "0.7082866", "0.7052505", "0.696605", "0.6933918", "0.69295365", "0.6914378", "0.6914372", "0.6912016", "0.6897092", "0.6876162", "0.68433", "0.68433", "0.68433", "0.6812373", "0.6...
0.8515019
0
Calculate the greatcircle distance bewteen two points on the Earth surface.
def nphaversine(point1, point2, miles=False): # print point1 # print point2 # unpack latitude/longitude if len(point1.shape) == 1: point1 = np.array([point1]) if len(point2.shape) == 1: point2 = np.array([point2]) # print point1 # print point2 point1 = np.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long...
[ "0.76110846", "0.75128585", "0.74005204", "0.736278", "0.7334611", "0.7330116", "0.72670156", "0.72396517", "0.722976", "0.7168491", "0.71659577", "0.7156992", "0.71539944", "0.7124056", "0.71109474", "0.71105796", "0.70962393", "0.70885754", "0.70604175", "0.705747", "0.7027...
0.0
-1
return current thread name.
def get_threadname(): cur_thread = threading.current_thread() return cur_thread.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_thread_name(self) -> Optional[str]:\n return self.thread_name", "def get_name(thread_id):\r\n for thread in threading.enumerate():\r\n if thread.ident == thread_id:\r\n return thread.name", "def get_uname(self):\n return Server.t_usernames.get(threading.ge...
[ "0.80912495", "0.77005726", "0.69585633", "0.6890283", "0.6844813", "0.67890924", "0.674684", "0.670793", "0.6689467", "0.668167", "0.6630126", "0.6606617", "0.6594408", "0.6587215", "0.65800315", "0.65798545", "0.6551568", "0.6512428", "0.6499626", "0.648431", "0.6480289", ...
0.90061885
0
remove duplicate keys while preserving order. optionally return values.
def find_uniq_preserve_order(orig_keys, orig_values=None): seen = {} keys = [] values = [] for i, item in enumerate(orig_keys): if item in seen: continue seen[item] = 1 keys.append(item) if orig_values: values.append(orig_values[i]) return keys, values
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_duplicate(x):\n return list(dict.fromkeys(x))", "def _remove_duplicates(input_list):\n return list(OrderedDict.fromkeys(input_list))", "def remove_duplicates(input_list):\n return list(dict.fromkeys(input_list))", "def removeDups(lst):\n\n return list(dict.fromkeys(lst) )", "...
[ "0.75429296", "0.72203714", "0.7036629", "0.7017405", "0.6760333", "0.6731918", "0.6579014", "0.65164787", "0.64843994", "0.6472747", "0.6425572", "0.6410459", "0.6388204", "0.6381012", "0.63454247", "0.6309064", "0.62704206", "0.62684274", "0.6259605", "0.61603624", "0.61588...
0.775089
0
creates a line on the given axes using style_args. returns line_name
def _handle_create_line(self, axes, style_args): stream_data = self.server.stream_data # sample data for initial create x_data = numpy.arange(0, 2, 1) y_data = numpy.array([0]*2) line, = axes.plot(x_data, y_data, '-', **style_args) # NOTE: client may set 'label' line_name = style_args['labe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addLineStyle(dist, focus, axis, pupil):\n r = 0 #focus / 2\n g = 0 #np.log10(dist) / (25 / 3)\n b = 0 #axis / 20\n a = 0.4\n rgb = [r, g, b, a]\n line = {'style': '-', 'color': rgb}\n return line", "def create_line(uniform = True, *args):\n axis = cmds.radioButtonGrp(widgets[\"lineAxi...
[ "0.62994033", "0.6173251", "0.61364174", "0.6051291", "0.5881077", "0.58236307", "0.5810255", "0.58049214", "0.5775597", "0.5750251", "0.5716448", "0.57113814", "0.5684895", "0.5669201", "0.5652392", "0.56158364", "0.5613863", "0.55943674", "0.5562825", "0.55502826", "0.55340...
0.7652667
0
Convert a ``datetime`` object to a JSON (JavaScript) string Formats the provided datetime object to a ``str`` that is compliant with the
def time_to_str(value: datetime) -> str: if value is None or not isinstance(value, datetime): raise ValueError("provided value is not a valid datetime object") return value.strftime("%Y-%m-%dT%H:%M:%SZ")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_to_js(obj):\n if isinstance(obj, (datetime.date, datetime.datetime)):\n return obj.isoformat()", "def json_serial(obj):\n if isinstance(obj, datetime):\n return obj.isoformat()", "def object_to_json(obj):\n if isinstance(obj, (datetime.datetime, datetime.date, datetime.time)):\n...
[ "0.7582491", "0.75781405", "0.74525875", "0.7391628", "0.7342249", "0.7333236", "0.7204316", "0.7185797", "0.7180997", "0.7174835", "0.70906", "0.7060324", "0.70553344", "0.69751024", "0.6969093", "0.6942338", "0.69343144", "0.69328296", "0.6923455", "0.69231457", "0.6921015"...
0.61615
81
Convert 1d numpy array to dataframe for plotting.
def vec_to_df(coefs, n_arr, coefs_id): out = pd.DataFrame({'component': 'L2_dist', 'n': n_arr, 'value': coefs, 'id': coefs_id}) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_nparray_to_df(nparray: np.ndarray) -> pd.DataFrame:\n return pd.DataFrame(data=nparray[1:, 1:],\n index=nparray[1:, 0],\n columns=nparray[0, 1:])", "def xarray_to_df(file_path):\n df = xr.open_dataset(file_path).to_dataframe()\n df = df.reset_index(...
[ "0.7372338", "0.6829325", "0.67939925", "0.67582446", "0.6741496", "0.6593171", "0.65855", "0.6417954", "0.6330275", "0.6313056", "0.6305333", "0.6293269", "0.62197083", "0.6147745", "0.6120145", "0.6108317", "0.6108003", "0.6107391", "0.609676", "0.6074362", "0.6046519", "...
0.54785275
95
Plot 'true' and noisy coefficients.
def plot_coefs(results): coefs_noisy = pd.concat([ arr_to_df(results['obj_noisy'], n_arr, 'obj'), vec_to_df(results['dist_obj'], n_arr, 'obj'), arr_to_df(results['pos_noisy'], n_arr, 'pos'), vec_to_df(results['dist_pos'], n_arr, 'pos'), arr_to_df(results['neg_noisy'], n_arr, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_true(self, ax):\n t = self.t\n x_true = self.x_true\n b = self.b\n\n ax.plot(t, x_true, 'k-', label='true image', lw=1.5)\n ax.plot(t, b, 'ro', label='blurred')\n ax.set_title(r'True')\n ax.set_xlabel(r'$t$')\n ax.set_ylabel(r'$x$')\n leg = ax.legend(loc='upper le...
[ "0.71557194", "0.6376786", "0.6281781", "0.62380886", "0.6158362", "0.6118943", "0.61107737", "0.6098007", "0.60626245", "0.6027678", "0.59956294", "0.5971492", "0.5943495", "0.59327364", "0.5911246", "0.5910142", "0.5910142", "0.5910142", "0.5909054", "0.59012383", "0.587855...
0.6278804
3
Plot the scatter plot of measured values v. predicted values, with an identity line and a best fitted line to show the prediction difference.
def prediction_error(y_true, y_pred, ax=None): _check_parameter_validity(y_true, y_pred) if ax is None: ax = plt.gca() model = LinearRegression() if isinstance(y_true, pd.Series): y_true = y_true.values y_reshaped = y_true.reshape((-1, 1)) # it is necessary to fit the model wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_actual_predicted(self):\n predicted = [self.f(x, self.coefficients) for x in self.x_values]\n\n plt.scatter(self.x_values, self.y_values, label = \"Actual data\", c = 'b')\n plt.plot(self.x_values, predicted, label = \"Predicted data\", c = 'r')\n plt.title(f\"Graph of Prediec...
[ "0.7619803", "0.73825103", "0.6910162", "0.6828525", "0.6798043", "0.67719805", "0.6752657", "0.6736895", "0.6719012", "0.6635017", "0.6582754", "0.65477663", "0.646825", "0.6449293", "0.6447603", "0.6417375", "0.64155245", "0.64023745", "0.6390852", "0.6390345", "0.6378697",...
0.60029083
47
Takes in a dataframe and generates an interactive figure in plotly and exports it as an SVG file in the figures folder.
def visualize_count(df: pd.DataFrame = None, small_data: bool = False): if df is None: df = data_cleaning.pd_load_data(small_data) df = df.reset_index() df = df[['STATE', 'FPA_ID']] count_df = df.groupby('STATE').count() count_df = count_df.rename(columns={'FPA_ID': 'Count'}) fig = go.Fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showPlotlyScatter(self, DataFrame, x_axis, y_axis, saving_directory):\r\n fig = px.scatter(DataFrame, x = x_axis, y=y_axis, hover_name= DataFrame.index, color= 'Lib_Tag_contour_ratio',\r\n hover_data= ['Contour_soma_ratio_Lib', 'Lib_Tag_contour_ratio', 'ImgNameInfor_Lib'], width=...
[ "0.6491675", "0.6076382", "0.59671855", "0.59521836", "0.592906", "0.5924873", "0.588453", "0.5880291", "0.5853218", "0.5849005", "0.5834654", "0.5828318", "0.5821972", "0.5789379", "0.57887715", "0.5768348", "0.5747316", "0.57470936", "0.5695773", "0.56733716", "0.5663988", ...
0.0
-1
The method used to make sure that the number of starting chips for each player can be set.
def test_set_starting_chips(self): # Setup new game and attempt to set their valid number of starting chips valid_chips = [ 1, 10, 100, 9999, ] for chips in valid_chips: game = Game() game.setup_new_game() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_partial_deck_has_fewer_cards(self):\n self.assertEqual(len(self.partialDeck.deck), 46)", "def enough_players():\n return True", "def set_n_players(self):\n complain = \"\"\n while True:\n clear_output()\n try:\n self.n_players = int(\n ...
[ "0.5986601", "0.5935184", "0.591481", "0.58434373", "0.57822806", "0.5757061", "0.5752133", "0.5748309", "0.57169116", "0.56981397", "0.56899023", "0.56770945", "0.56551063", "0.56398237", "0.5611947", "0.5601338", "0.55866843", "0.55602324", "0.55322117", "0.5494507", "0.548...
0.76785713
0
Compute softmax values for each sets of scores in x.
def softmax(x): return np.exp(x)/np.sum(np.exp(x),axis=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(self, scores):\n\n\n # for each sample, for each class ,caclulate\n # np.exp(scores) : still (n_samples, n_classes)\n\n # axis = 1\n # a00, a01, a02 as a sinlge one to perfrom np_sum\n # which is the same sample \n # sum_exp : still (n_samples, 1)\n\n # ...
[ "0.7797633", "0.77625954", "0.77602196", "0.7757519", "0.76584935", "0.76584935", "0.76584935", "0.76584935", "0.7589092", "0.7433975", "0.7410552", "0.7397003", "0.7360935", "0.73204947", "0.7271785", "0.72655344", "0.7264959", "0.7259807", "0.72332364", "0.72179425", "0.720...
0.69552547
95
Return whether the buffer is full.
def is_full(self): return self.idx == self.len
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bufferIsFull(self):\n return len(self.buffer) == self.bufferSize", "def isFull(self):\n return self.__size == len(self.__buffer)", "def is_full(self):\n return len(self) == self.buffer_size", "def is_full(self):\n return len(self) == self.buffer_size", "def is_full(self):\n ...
[ "0.902843", "0.88964313", "0.8631627", "0.8631627", "0.8631627", "0.8631627", "0.8273404", "0.8033453", "0.786584", "0.7722272", "0.7716352", "0.75985116", "0.7564237", "0.75423336", "0.75304025", "0.75304025", "0.75271684", "0.7520153", "0.7509155", "0.7410427", "0.7410427",...
0.67810583
91
Get a statistic by index.
def get_by_index(cls, idx: int) -> "PermutationStatistic": return cls(*PermutationStatistic._STATISTICS[idx])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_index(self, index):\n # makes it easier for callers to just pass in a header value\n index = int(index) if index else 0\n return self.by_index.get(index)", "def get(self, index):\n raise NotImplementedError() # pragma: no cover", "def get_at_index(self, index: int) -> obj...
[ "0.7498371", "0.71451086", "0.7102152", "0.6922391", "0.67885476", "0.66309804", "0.66093", "0.6583636", "0.657459", "0.65730995", "0.6543232", "0.65285486", "0.6507778", "0.64874345", "0.64874345", "0.6459586", "0.64476395", "0.64476395", "0.642201", "0.6396596", "0.639335",...
0.709509
3
Given a bijection, check which statistics are preserved.
def check_all_preservations(cls, bijection: BijectionType) -> Iterator[str]: return (stats.name for stats in cls._get_all() if stats.preserved_in(bijection))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_all_transformed(cls, bijection: BijectionType) -> Dict[str, List[str]]:\n transf = defaultdict(list)\n all_stats = cls._get_all()\n for stat1, stat2 in product(all_stats, all_stats):\n if all(stat1.func(k) == stat2.func(v) for k, v in bijection.items()):\n t...
[ "0.66531956", "0.63910055", "0.55745256", "0.5352943", "0.52362436", "0.5194983", "0.5103389", "0.5067221", "0.5019369", "0.48898706", "0.4860377", "0.48361117", "0.48361117", "0.48361117", "0.48343045", "0.481323", "0.4766111", "0.47515914", "0.4739123", "0.472368", "0.46902...
0.5517658
3
Gets environment variable as string.
def getenv_string(setting, default=''): return os.environ.get(setting, default)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_env(key: str) -> str:\n value = os.getenv(key)\n assert isinstance(value, str), (\n f\"the {key} environment variable must be set and a string, \" f\"{value=}\"\n )\n return value", "def env(var):\n return os.environ[var]", "def windows_get_env_value(var_name:...
[ "0.81528544", "0.7418339", "0.7405049", "0.72382337", "0.72329384", "0.72261554", "0.7057835", "0.69984245", "0.69965094", "0.69708145", "0.6922805", "0.68801343", "0.68776995", "0.685753", "0.68367887", "0.68226147", "0.6817827", "0.6792033", "0.6738943", "0.67099005", "0.66...
0.7531773
1
Convert a scipy sparse matrix to a torch sparse tensor.
def sparse_mx_to_torch_sparse_tensor(sparse_mx): sparse_mx = sparse_mx.tocoo().astype(np.float32) indices = torch.from_numpy( np.vstack((sparse_mx.row, sparse_mx.col)).astype(np.int64)) values = torch.from_numpy(sparse_mx.data) shape = torch.Size(sparse_mx.shape) return torch.sparse.FloatTen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csr2tensor(self, matrix: sp.csr_matrix):\n matrix = matrix.tocoo()\n x = torch.sparse.FloatTensor(\n torch.LongTensor(np.array([matrix.row, matrix.col])),\n torch.FloatTensor(matrix.data.astype(np.float32)),\n matrix.shape,\n ).to(self.device)\n retu...
[ "0.8300307", "0.81481314", "0.80456084", "0.8032226", "0.80131984", "0.799705", "0.799705", "0.79850143", "0.79850143", "0.79850143", "0.7976765", "0.7964795", "0.77543104", "0.7712594", "0.74288416", "0.74288416", "0.7353584", "0.7196928", "0.7156608", "0.6987555", "0.696929...
0.80297416
15
Returns true if a plugin is loaded, otherwise false
def hasPlugin(self, plugin_name): if plugin_name in self.plugins: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_loaded(self, plugin):\n return self._get_name(plugin) in self.loaded_plugins", "def autoload(self):\n\t\tpath = self.world.config[\"plugin\"][\"path\"]\n\t\tif not self.load_glob(path):\n\t\t\treturn False\n\t\tif not self.check_deps():\n\t\t\treturn False\n\t\treturn True", "def has_plugin(self,...
[ "0.82449305", "0.75101715", "0.7230979", "0.7069812", "0.70386356", "0.691805", "0.6850626", "0.6843381", "0.6841373", "0.68310064", "0.66861874", "0.66766804", "0.66580296", "0.6645501", "0.66317517", "0.6622345", "0.65992326", "0.65837264", "0.6525645", "0.65177065", "0.643...
0.72091687
3
Returns if a user is an admin or not
def isAdmin(self, nick): if nick in self.config["admins"]: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_is_admin(user):\n return user in admins", "def is_admin(user):\n return user.is_authenticated and user.id == app.config.get('ADMIN')", "def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n return True\n return False", "def is...
[ "0.893059", "0.87329084", "0.8720758", "0.86934495", "0.8606972", "0.8575092", "0.85193145", "0.8454654", "0.8378569", "0.8346424", "0.8324324", "0.8313925", "0.8262614", "0.82554847", "0.8234557", "0.8232175", "0.82130915", "0.82102287", "0.820046", "0.8189302", "0.81726366"...
0.75662035
52
Determines the minimum and maximum values for any particular tuple index within the list. Returns
def ranges(self, keys:list)->list: if not isinstance(keys, list): keys = [keys] ranges = {} for key in keys: ranges[key] = [None, None] for list_item in self.list: for key in keys: if ranges[key][0] is None: ranges[k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_minmax(self, stmt, slist):\n minel = maxel = None\n for s in slist:\n if s.keyword == \"min-elements\":\n minel = s.arg\n elif s.keyword == \"max-elements\":\n maxel = s.arg\n if minel is None:\n minst = stmt.search_one(\"m...
[ "0.7201116", "0.7053451", "0.7039965", "0.6910799", "0.6879111", "0.6841572", "0.68235934", "0.6786338", "0.67859083", "0.67341435", "0.67099017", "0.6705208", "0.6695408", "0.66835827", "0.6665411", "0.6641725", "0.6620347", "0.6598788", "0.6563562", "0.6549405", "0.65433556...
0.0
-1
Determines whether the lines AB and BC make a counterclockwise or clockwise turn.
def direction(a:tuple, b:tuple, c:tuple)->int: return ((b[1] - a[1]) * (c[0] - b[0])) - ((b[0] - a[0]) * (c[1] - b[1]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isclockwise(self):\n s = sum((seg[1][0] - seg[0][0]) * (seg[1][1] + seg[0][1])\n for seg in self.segment_tuples)\n return s > 0", "def is_ccw(point_a, point_b, point_c):\r\n return is_on_line(point_a, point_b, point_c) > 0", "def is_clockwise(vertices):\n v = vert...
[ "0.74345213", "0.7050063", "0.6938256", "0.6867639", "0.67281264", "0.6570195", "0.65248144", "0.6483469", "0.6362939", "0.6355596", "0.6348816", "0.6348816", "0.6196705", "0.60618496", "0.60286784", "0.5938162", "0.5816794", "0.57985514", "0.5764117", "0.57534015", "0.575023...
0.0
-1
Determine if CCW (1), CW(1), or colinear(0)
def orientation(a:tuple, b:tuple, c:tuple)->int: d = direction(a, b, c) if d == 0: return 0 elif d > 0: return 1 else: return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_ccw(points):\n points = np.asanyarray(points, dtype=np.float64)\n\n if (len(points.shape) != 2 or\n points.shape[1] != 2):\n raise ValueError('CCW is only defined for 2D')\n xd = np.diff(points[:, 0])\n yd = np.column_stack((\n points[:, 1],\n points[:, 1])).resha...
[ "0.6975806", "0.66116494", "0.6606028", "0.65576446", "0.6379163", "0.6352987", "0.6342742", "0.625941", "0.6167342", "0.61235267", "0.60807854", "0.6079656", "0.6001425", "0.59949446", "0.58525217", "0.57770985", "0.57654357", "0.573804", "0.5721898", "0.57122684", "0.571094...
0.0
-1
Determines if the slope of a line is positive.
def positive_slope(line:tuple)->bool: return line[0][1] < line[1][1] == line[0][0] < line[1][0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_slope(self):\n\t\tif self.high_elevation != self.low_elevation:\n\t\t\treturn True\n\t\treturn False", "def slope(self):\n if self.b == 0:\n return None\n else:\n return (-1) * self.a/self.b", "def filter_slope(self,slope):\n if self.slope_interval[0] <= abs(sl...
[ "0.736785", "0.67845374", "0.66309035", "0.6547908", "0.64874506", "0.6483003", "0.6478444", "0.63426495", "0.63259435", "0.6320206", "0.62273353", "0.6205177", "0.6158633", "0.613933", "0.61122525", "0.6104726", "0.6096476", "0.6087337", "0.6063536", "0.6063536", "0.59833056...
0.83179325
0
Checks if a point is within the rectangle with edge as one of the diagonals.
def near_segment(point:tuple, edge:tuple)->bool: return between(point[0], edge[0][0], edge[1][0]) and between(point[1], edge[0][1], edge[1][1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inside(point, rectangle):\n\n ll = rectangle.getP1() # assume p1 is ll (lower left)\n ur = rectangle.getP2() # assume p2 is ur (upper right)\n\n return ll.getX() < point.getX() < ur.getX() and ll.getY() < point.getY() < ur.getY()", "def in_square(self, point):\n size = self.size\n centre =...
[ "0.70133144", "0.69797367", "0.6935007", "0.69121915", "0.687569", "0.687569", "0.6854568", "0.6748199", "0.67210734", "0.6670797", "0.6650344", "0.66328245", "0.6617512", "0.6605541", "0.6605422", "0.65742147", "0.6531653", "0.6525218", "0.65238535", "0.6522948", "0.6522948"...
0.70146877
0
Dot product of two vectors.
def dot_product(vec_1:tuple, vec_2:tuple)->float: return vec_1[0] * vec_2[0] + vec_1[1] * vec_2[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot(a, b):\n\n if len(a) != len(b):\n raise Exception(\"Input vectors must be of same length, not %d and %d\" % (len(a), len(b)))\n\n return float(sum([a[i] * b[i] for i in range(len(a))]))", "def vec_dot(v1,v2):\r\n \r\n return np.dot(v1,v2)", "def vector_dot(v1,v2):\n re...
[ "0.87841845", "0.86563873", "0.8642669", "0.86284196", "0.86162174", "0.8601663", "0.85943055", "0.85549754", "0.8492725", "0.84826726", "0.84747356", "0.843237", "0.8408973", "0.8401954", "0.8375448", "0.8345248", "0.8324872", "0.83216214", "0.8315376", "0.82187545", "0.8203...
0.8244592
19
Magnitude of a vector.
def magnitude(vector:tuple)->float: return math.sqrt(vector[0] ** 2 + vector[1] ** 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magnitude(v: Vector) -> float:\n return math.sqrt(sum_of_squares(v))", "def magnitude_of_vector(v):\n return math.sqrt(sum_of_squares(v))", "def magnitude(vector):\n return math.sqrt(sum_of_squares(vector))", "def magnitude(v: Vector) -> float:\n return math.sqrt(sum_of_squares(v)) #math.sqrt...
[ "0.82161707", "0.82127446", "0.8133831", "0.80984265", "0.80711746", "0.7985293", "0.7820759", "0.77244526", "0.77204585", "0.76303875", "0.7613427", "0.744135", "0.7276982", "0.72540486", "0.703484", "0.7024954", "0.6985379", "0.6943243", "0.690651", "0.6875509", "0.68388605...
0.75406647
11
Returns true if the vector is a zero vector, otherwise false.
def is_zero_vector(vector:tuple)->bool: return vector[0] == 0 and vector[1] == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isVecZero(vec):\n trues = [isZero(e) for e in vec]\n return all(trues)", "def is_zero(self):\n for t in self:\n if t != TRIT_ZERO:\n return False\n return True", "def isZero(self):\n return self.count == 0", "def is_zero(self):\n return self._ex...
[ "0.8560863", "0.78165585", "0.7557371", "0.753894", "0.74890184", "0.7482657", "0.7468545", "0.74608725", "0.745997", "0.7423766", "0.74129486", "0.741105", "0.7316494", "0.7311554", "0.7263635", "0.70921254", "0.7089508", "0.707456", "0.7040816", "0.7008552", "0.69950205", ...
0.8220028
1
Creates a convex line segment between two points. In the context of polygon creation, desc_y is set to True if we are building the top left or top right corner. Desc_X is set to True if we are building the top right or bottom right corner. This impacts the order we accept points and how we interpret the direction of po...
def convex_line_segment(point_list:list, desc_y:bool=False, desc_x:bool=False)->list: if len(point_list) < 3: return point_list line = [] x_extrema = None # Since the list is sorted by x second, the last point is actually the # first point of the last block of y values in the list (if more t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addRevLineSeg(self, x1, y1, x2, y2):\n # tip triangles\n if np.allclose(x1, 0.0):\n a = [x1, y1, 0.0]\n for (sa1, ca1), (sa2, ca2) in self._mesh.sincos:\n r = x2\n b = [r * sa2, y2, r * ca2]\n c = [r * sa1, y2, r * ca1]\n ...
[ "0.61220574", "0.5985634", "0.58928055", "0.586802", "0.5844202", "0.5812266", "0.5790249", "0.57509595", "0.5726299", "0.5695145", "0.5691318", "0.56896853", "0.5685234", "0.5680852", "0.56595385", "0.563459", "0.5601871", "0.5600169", "0.5596646", "0.55840945", "0.5568787",...
0.74640554
0
Determines if a line segment described by d_y, d_x, and b is right of a point.
def intersects_right(point:tuple, line:tuple, d_y:float, d_x:float, b:float, include_top:bool=False, inclusive:bool=False)->bool: min_y, max_y = line[0][1], line[1][1] if min_y > max_y: min_y, max_y = max_y, min_y if not between(point[1], min_y, max_y): # The point is above or below the line...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def point_on_line(point:tuple, line:tuple, d_y:float, d_x:float, b:float)->bool:\n if not near_segment(point, line):\n # Fast fail to handle cases where the point isn't in the bounding rectangle of the line segment.\n return False\n if b == None and point[0] == line[0][0]:\n return True\...
[ "0.779486", "0.6765233", "0.6753991", "0.6690972", "0.66500854", "0.65380234", "0.65158004", "0.64917606", "0.6466559", "0.64534605", "0.63823503", "0.63814336", "0.6377494", "0.6278903", "0.62738436", "0.6271943", "0.62362576", "0.6226385", "0.6216552", "0.62099683", "0.6205...
0.7685959
1
Determines if a point is on the segment.
def point_on_line(point:tuple, line:tuple, d_y:float, d_x:float, b:float)->bool: if not near_segment(point, line): # Fast fail to handle cases where the point isn't in the bounding rectangle of the line segment. return False if b == None and point[0] == line[0][0]: return True return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pointInSegment(point, segmentPoint1, segmentPoint2):\n\t\tx = point[0]\n\t\ty = point[1]\n\n\t\tif x < segmentPoint1[0] and x < segmentPoint2[0]:\n\t\t\treturn False\n\t\t\n\t\tif x > segmentPoint1[0] and x > segmentPoint2[0]:\n\t\t\treturn False\n\t\t\n\t\tif y < segmentPoint1[1] and y < segmentPoint2[1]:\n\t...
[ "0.7799579", "0.76022875", "0.76022875", "0.7578741", "0.755237", "0.750448", "0.7461112", "0.74219817", "0.7264109", "0.7250185", "0.7214966", "0.7196955", "0.7158082", "0.71503884", "0.71443844", "0.7110474", "0.7107299", "0.70606035", "0.7057359", "0.70439357", "0.7029545"...
0.69189537
27
Determines if the new edge would intersect the hull at any point.
def segments_intersects_hull(new_edges:list, hull:list, current_edge:tuple)->bool: new_edge_extent = extent(new_edges[0][0], new_edges[0][1], new_edges[1][1]) for k in range(0, len(hull) - 1): if new_edges[0][0] == hull[k] or new_edges[0][0] == hull[k+1]: continue elif new_edges[0][1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_new(self):\n c_up = self.upper_binary_tree().single_edge_cut_shapes()\n c_down = self.lower_binary_tree().single_edge_cut_shapes()\n return not any(x in c_up for x in c_down)", "def check_inside_hull(hull, instance):\n for face in hull:\n if not check_inside(face=face, insta...
[ "0.6484378", "0.63872766", "0.62879694", "0.6258108", "0.6223334", "0.62019885", "0.6185283", "0.6149708", "0.6138869", "0.61183757", "0.6070646", "0.60460234", "0.6039633", "0.6038786", "0.6038608", "0.6034174", "0.5997268", "0.59944534", "0.59907645", "0.5983716", "0.597896...
0.7658259
0
returns the dictionary representation of a Rectangle
def to_dictionary(self): return {"id": self.id, "x": self.x, "size": self.size, "y": self.y}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectangledict(self):\n return rectangledict(self.rectangles)", "def to_dictionary(self):\n rect = {\n \"x\": self.x,\n \"y\": self.y,\n \"id\": self.id,\n \"height\": self.height,\n \"width\": self.width\n }\n return(rect)", ...
[ "0.8602724", "0.8201665", "0.8108615", "0.8052318", "0.79804254", "0.774604", "0.7632502", "0.7477445", "0.73376447", "0.7333853", "0.7112657", "0.68645644", "0.67418987", "0.6740587", "0.67366946", "0.671641", "0.6686742", "0.6686742", "0.6638892", "0.6613355", "0.66103834",...
0.626603
32
Nose will execute this function after executing all the tests. Remove files generated during test runs
def teardown_class(cls): self = cls() self.remove_files_created_during_previous_runs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n self.remove_test_files()", "def tearDown(self):\n testing_dir = os.path.split(os.path.realpath(__file__))[0]\n for f in glob.glob(os.path.join(testing_dir, \"*\")):\n if f.split(\".\")[-1] in [\"o\", \"out\", \"pyc\", \"log\"]:\n subprocess.cal...
[ "0.79564494", "0.7922551", "0.7731818", "0.7725066", "0.7597718", "0.7541712", "0.75238997", "0.7476529", "0.7441866", "0.7432386", "0.74241424", "0.74227935", "0.7406666", "0.7307176", "0.7307176", "0.7307176", "0.73070675", "0.7299069", "0.72886336", "0.72333694", "0.723083...
0.0
-1
Gets the action_time of this Lifecycle. The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation
def action_time(self): return self._action_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_consumed(self) -> int:\n if not self.actions:\n return 0\n else:\n return self.actions[-1].time_end", "def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")", "def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")"...
[ "0.6351681", "0.6334942", "0.6334942", "0.6254808", "0.62357366", "0.615849", "0.61072457", "0.6091936", "0.6077282", "0.60503584", "0.59982574", "0.5907601", "0.5900668", "0.58995885", "0.5868122", "0.5856616", "0.5840132", "0.57963824", "0.57763684", "0.57763684", "0.577636...
0.78159416
0