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
Computes the forward pass for an affine (fullyconnected) layer. The input x has shape (N, d_1, ..., d_k) and contains a minibatch of N examples, where each example x[i] has shape (d_1, ..., d_k). We will reshape each input into a vector of dimension D = d_1 ... d_k, and then transform it to an output vector of dimensio...
def affine_forward(x, w, b): #raise NotImplementedError ####################################################################### # # # # # TO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def affine_forward(x, w, b):\n out = None\n \n # reshape the input into (N, d_1 *...* d_k)\n input_shape = x.shape\n prod = 1\n for i in range(1,len(input_shape)):\n prod *= input_shape[i]\n\n a = x.reshape(x.shape[0],prod)\n out = np.dot(a,w) + b\n \n cache = (x, w, b)\n re...
[ "0.6997446", "0.68818486", "0.6687843", "0.6508727", "0.6505531", "0.64564824", "0.644714", "0.64125097", "0.6408686", "0.63552046", "0.63551813", "0.634814", "0.63433015", "0.6333991", "0.63222986", "0.6308687", "0.63032967", "0.62968314", "0.6296366", "0.62950695", "0.62901...
0.6135907
39
Computes the backward pass for an affine layer.
def affine_backward(dout, cache): #raise NotImplementedError ####################################################################### # # # # # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def affine_relu_backward(dout, cache):\n fc_cache, relu_cache = cache\n da = layers.relu_backward(dout, relu_cache)\n dx, dw, db = layers.affine_backward(da, fc_cache)\n return dx, dw, db", "def affine_backward(dout, cache):\n x, w, b = cache\n dx, dw, db = None, None, None\n ###############...
[ "0.7518896", "0.751513", "0.7310849", "0.73015374", "0.73015374", "0.73015374", "0.73015374", "0.7243401", "0.7177609", "0.7174102", "0.71661735", "0.71319", "0.7106919", "0.70978165", "0.708432", "0.7068546", "0.70449376", "0.70409757", "0.6993727", "0.6986414", "0.6983679",...
0.7173503
10
Computes the forward pass for a layer of rectified linear units (ReLUs).
def relu_forward(x): #raise NotImplementedError ####################################################################### # # # # # TODO: YOUR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_relus(self):\n\n def relu_backward_hook_function(module, grad_in, grad_out):\n \"\"\"\n If there is a negative gradient, change it to zero\n \"\"\"\n # Get last forward output\n corresponding_forward_output = self.forward_relu_outputs[-1]\n ...
[ "0.6776496", "0.6630567", "0.66034645", "0.6524613", "0.65097547", "0.64478225", "0.63858074", "0.62696755", "0.620592", "0.6181689", "0.61548615", "0.6139935", "0.6063423", "0.6056323", "0.6049887", "0.60487914", "0.60198", "0.5997235", "0.59914005", "0.59708583", "0.5964868...
0.0
-1
Computes the backward pass for a layer of rectified linear units (ReLUs).
def relu_backward(dout, cache): #raise NotImplementedError ####################################################################### # # # # # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relu_backward(self, dUpper, cache):\n x = cache\n #############################################################################\n # TODO: Implement the ReLU backward pass. #\n #########################################################################...
[ "0.70412636", "0.694716", "0.6897693", "0.6847592", "0.6847592", "0.6846935", "0.6841099", "0.68178034", "0.6766849", "0.6754919", "0.67536426", "0.67530656", "0.67419785", "0.6739244", "0.6713423", "0.6708748", "0.6699276", "0.6696307", "0.6696307", "0.66860896", "0.6665928"...
0.6597477
31
The actual executing function for predicting the disorder of a sequence using metapredict. Returns a list containing predicted disorder values for the input sequence. Arguments sequence the amino acid sequence to be predicted network the network used by the predictor. See brnn_architecture BRNN_MtO for more info. devic...
def kappa_predict(sequence, network=brnn_network, device=device, encoding_scheme=encoding_scheme): # change sequence to ADK seq sequence = change_for_input(sequence) # set seq_vector equal to converted amino acid sequence that is a PyTorch tensor of one-hot vectors seq_vector = encode_sequence.one_ho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, input_sequence):\n return self.session.run(self.prediction, feed_dict={self.input_placeholder: input_sequence})", "def decode(self, received_sequence):\n return self.decode_node(received_sequence).input_history()", "def decode_sequence(self, sequence=list) -> str:\n try:\...
[ "0.55787903", "0.5394409", "0.5368819", "0.53248674", "0.5210656", "0.50722724", "0.50478786", "0.49213985", "0.48744547", "0.48431647", "0.4834561", "0.48193526", "0.4797648", "0.47840875", "0.4676878", "0.46718803", "0.46663803", "0.46406817", "0.46259552", "0.45872033", "0...
0.5765658
0
Set the value of the current marker.
def set_current(self, val: int) -> None: if (val - self._offset) % self._step != 0: raise ValueError(f'value {val} is not multiple of step size.') self._current = (val - self._offset) // self._step
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCurrent(self, value):\n\n\t\tself._current = self._setpoint - value", "def mark(self): # type: () -> None\n self._marker = self._idx", "def set_value(self, value: float):\n self.points[0, 0] = value\n return self", "def value(self, value):\n self.set_data(value)", "def s...
[ "0.69956017", "0.6694013", "0.6688986", "0.6672211", "0.6670149", "0.66624993", "0.6584124", "0.6569158", "0.65394557", "0.65394557", "0.64922523", "0.6487138", "0.6477574", "0.64572304", "0.64237803", "0.6406157", "0.640175", "0.6390843", "0.6386253", "0.6386253", "0.6337263...
0.6150167
51
Returns the last saved index.
def get_last_save(self) -> Optional[int]: return self._save_marker
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_index(self) -> int:\n return self._last_index", "def get_last_revision(self):\n return self.index.get_index_revision(self.name)", "def get_last_save(self) -> Optional[int]:\n return self._bin_iter.get_last_save()", "def last_valid_index(self):\n return (\n Data...
[ "0.8059884", "0.7504637", "0.73891056", "0.7325026", "0.7233485", "0.72185564", "0.7170764", "0.7019229", "0.7019229", "0.6925926", "0.6909408", "0.6882913", "0.6869769", "0.6817334", "0.6810632", "0.67963475", "0.677237", "0.6765704", "0.67527777", "0.67416215", "0.67329866"...
0.6975678
9
Return last save information.
def get_last_save_info(self) -> Any: return self._save_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_save_info(self) -> Any:\n return self._bin_iter.get_last_save_info()", "def lastsave(self):\n self.connect()\n self._write('LASTSAVE\\r\\n')\n return self._get_numeric_response()", "def lastsave(self):\r\n return self.format_inline('LASTSAVE')", "def get_last_s...
[ "0.89722526", "0.85279757", "0.82430357", "0.8007399", "0.788004", "0.7610971", "0.7330726", "0.70822066", "0.6998658", "0.6928949", "0.6914646", "0.6795354", "0.67539304", "0.6748196", "0.6700925", "0.6682189", "0.66325873", "0.66325873", "0.6614579", "0.6598687", "0.6595880...
0.9172279
0
Set the value of the current marker.
def set_current(self, val: int) -> None: self._bin_iter.set_current(val)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCurrent(self, value):\n\n\t\tself._current = self._setpoint - value", "def mark(self): # type: () -> None\n self._marker = self._idx", "def set_value(self, value: float):\n self.points[0, 0] = value\n return self", "def value(self, value):\n self.set_data(value)", "def s...
[ "0.6996747", "0.6696348", "0.6691076", "0.66716844", "0.6670308", "0.66627103", "0.65853775", "0.65715915", "0.6540106", "0.6540106", "0.6494586", "0.64868546", "0.64778334", "0.64574546", "0.6426425", "0.6408616", "0.64056075", "0.6390868", "0.6388772", "0.6388772", "0.63374...
0.5998851
71
Returns the last saved index.
def get_last_save(self) -> Optional[int]: return self._bin_iter.get_last_save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_index(self) -> int:\n return self._last_index", "def get_last_revision(self):\n return self.index.get_index_revision(self.name)", "def last_valid_index(self):\n return (\n DataFrameDefault.register(pandas.DataFrame.last_valid_index)(self)\n .to_pandas()\n ...
[ "0.8059884", "0.7504637", "0.7325026", "0.7233485", "0.72185564", "0.7170764", "0.7019229", "0.7019229", "0.6975678", "0.6925926", "0.6909408", "0.6882913", "0.6869769", "0.6817334", "0.6810632", "0.67963475", "0.677237", "0.6765704", "0.67527777", "0.67416215", "0.67329866",...
0.73891056
2
Return last save information.
def get_last_save_info(self) -> Any: return self._bin_iter.get_last_save_info()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_save_info(self) -> Any:\n return self._save_info", "def get_last_save_info(self) -> Any:\n return self._save_info", "def lastsave(self):\n self.connect()\n self._write('LASTSAVE\\r\\n')\n return self._get_numeric_response()", "def lastsave(self):\r\n ret...
[ "0.9172279", "0.9172279", "0.85279757", "0.82430357", "0.8007399", "0.788004", "0.7610971", "0.7330726", "0.70822066", "0.6998658", "0.6928949", "0.6914646", "0.6795354", "0.67539304", "0.6748196", "0.6700925", "0.6682189", "0.66325873", "0.66325873", "0.6614579", "0.6598687"...
0.89722526
2
Returns the last saved index.
def get_last_save(self) -> Optional[float]: return None if self._save_marker is None else self._save_marker + self._offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_index(self) -> int:\n return self._last_index", "def get_last_revision(self):\n return self.index.get_index_revision(self.name)", "def get_last_save(self) -> Optional[int]:\n return self._bin_iter.get_last_save()", "def last_valid_index(self):\n return (\n Data...
[ "0.80640113", "0.7507082", "0.7391751", "0.73269564", "0.7233087", "0.72226304", "0.7174905", "0.70141697", "0.70141697", "0.6978358", "0.69229746", "0.69128305", "0.68870735", "0.6866033", "0.6821348", "0.6815645", "0.67906594", "0.67749774", "0.67693985", "0.67573273", "0.6...
0.62504005
74
Return last save information.
def get_last_save_info(self) -> Any: return self._save_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_save_info(self) -> Any:\n return self._bin_iter.get_last_save_info()", "def lastsave(self):\n self.connect()\n self._write('LASTSAVE\\r\\n')\n return self._get_numeric_response()", "def lastsave(self):\r\n return self.format_inline('LASTSAVE')", "def get_last_s...
[ "0.89722526", "0.85279757", "0.82430357", "0.8007399", "0.788004", "0.7610971", "0.7330726", "0.70822066", "0.6998658", "0.6928949", "0.6914646", "0.6795354", "0.67539304", "0.6748196", "0.6700925", "0.6682189", "0.66325873", "0.66325873", "0.6614579", "0.6598687", "0.6595880...
0.9172279
1
Initialize a TestWithServers object.
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Always start the servers for each test variant self.start_agents_once = False self.start_servers_once = False # Whether to skip tearDown self.skip_teardown = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n self.start_servers_once = False\n self.setup_start_agents = False\n\n # force test status !!\n # use mangling trick described at\n # https://stackoverflow.com/questions/3385317/private-variables-and...
[ "0.6888252", "0.660209", "0.648664", "0.6449894", "0.6417553", "0.64153713", "0.63708556", "0.6364088", "0.63633144", "0.63631713", "0.6316102", "0.6260956", "0.6257777", "0.624245", "0.6212352", "0.6185544", "0.6158926", "0.6158916", "0.611455", "0.610989", "0.6097735", "0...
0.7187639
0
Expect that an object can be instantiated with the right attributes.
def test_init(attributes): namespace = Namespace(miriam_id="MIR:00000022", prefix="go", pattern=r"^GO:\d{7}$") instance = CompartmentAnnotation(namespace=namespace, **attributes) for attr, value in attributes.items(): assert getattr(instance, attr) == value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_constructors(self, name, obj):\n assert getattr(forge, name) == obj", "def test_constructors(self, name, obj):\n assert getattr(forge, name) == obj", "def test_from_object_fail(self):\n class InvalidClass(object):\n pass\n Invalid_object = InvalidClass()\n ...
[ "0.71503836", "0.71503836", "0.6796081", "0.67125994", "0.668577", "0.66723245", "0.6597072", "0.6565062", "0.6543619", "0.65400124", "0.6530825", "0.6482194", "0.64496", "0.6442326", "0.6433054", "0.6426752", "0.6417383", "0.6406627", "0.6394254", "0.6380104", "0.63665533", ...
0.0
-1
Returns all undirected arcs in graph. get_arcs() > arcs_list
def get_arcs(self): arcs = [] for arcs_list in self._inc.values(): record = arcs_list.get_first_record() while record is not None: arc = record.element arcs.append(arc) record = record._next return arcs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_arcs(self):\n arcs = []\n for arcs_set in self._inc.values():\n for arc in arcs_set: arcs.append(arc)\n return arcs", "def getArcs(self):\n return [ arc for arc in sorted(self._arcs) ]", "def getArcsFrom(self):\n return [ arc for arc in sorted(self._arcsFro...
[ "0.7499071", "0.74306184", "0.7165414", "0.7127766", "0.71054125", "0.681787", "0.65847176", "0.6429544", "0.59809476", "0.59109604", "0.5893879", "0.5625166", "0.5591395", "0.55446804", "0.55156904", "0.5458692", "0.5416836", "0.53254515", "0.52808005", "0.52786505", "0.5278...
0.7357747
2
Returns the number of undirected arcs in graph. get_num_arcs() > number_of_arcs
def get_num_arcs(self): num_arcs = 0 for node in self._nodes.values(): num_arcs += node._deg return (num_arcs / 2) + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_arcs(self):\n return len(self.arcs)", "def num_arcs(self):\n return sum(len(state) for state in self)", "def return_num_edges(self):\n return sum(map(lambda x: len(x),self.__adj))", "def _number_of_edges(self):\n if self._edges is None:\n return 0\n retur...
[ "0.80341387", "0.76588017", "0.6912911", "0.6762265", "0.66221523", "0.6603356", "0.6560245", "0.6498628", "0.64569664", "0.64034027", "0.6391387", "0.63166565", "0.6271878", "0.6262268", "0.6259048", "0.62554514", "0.6233253", "0.62108713", "0.6203938", "0.61763436", "0.6172...
0.79111135
2
Returns all undirected arcs in graph. get_arcs() > arcs_list
def get_arcs(self): arcs = [] for arcs_set in self._inc.values(): for arc in arcs_set: arcs.append(arc) return arcs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getArcs(self):\n return [ arc for arc in sorted(self._arcs) ]", "def get_arcs(self):\n arcs = []\n for arcs_list in self._inc.values():\n record = arcs_list.get_first_record()\n while record is not None:\n arc = record.element\n arcs.ap...
[ "0.74303085", "0.7357441", "0.7165093", "0.71280026", "0.7106027", "0.68184125", "0.6584792", "0.6429587", "0.59820795", "0.5911749", "0.58946306", "0.5624975", "0.55916166", "0.5544698", "0.5516112", "0.54596144", "0.54168606", "0.532552", "0.52816194", "0.5279009", "0.52790...
0.7498992
0
Returns the number of undirected arcs in graph. get_num_arcs() > number_of_arcs
def get_num_arcs(self): num_arcs = 0 for node in self._nodes.values(): num_arcs += node._deg return (num_arcs / 2) + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_arcs(self):\n return len(self.arcs)", "def num_arcs(self):\n return sum(len(state) for state in self)", "def return_num_edges(self):\n return sum(map(lambda x: len(x),self.__adj))", "def _number_of_edges(self):\n if self._edges is None:\n return 0\n retur...
[ "0.80372286", "0.7661691", "0.6913476", "0.6761787", "0.66245705", "0.6602966", "0.6559722", "0.64979243", "0.6455858", "0.6402722", "0.63918346", "0.63142896", "0.6270248", "0.62627816", "0.62591267", "0.6256276", "0.6234838", "0.6211756", "0.6204173", "0.61757195", "0.61711...
0.79136765
1
Sets the cluster_uuid of this HyperflexClusterAllOf.
def cluster_uuid(self, cluster_uuid): self._cluster_uuid = cluster_uuid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster(self, cluster):\n\n self._cluster = cluster", "def cluster(self, cluster):\n\n self._cluster = cluster", "def cluster(self, cluster):\n\n self._cluster = cluster", "def cluster(self, cluster):\n\n self._cluster = cluster", "def cluster(self, cluster):\n\n self...
[ "0.6429439", "0.6429439", "0.6429439", "0.6429439", "0.6429439", "0.6429439", "0.6402282", "0.62209904", "0.6195924", "0.5773054", "0.5749447", "0.563489", "0.56327045", "0.5582954", "0.54076076", "0.5392397", "0.5392397", "0.5392397", "0.5263759", "0.51589984", "0.5158502", ...
0.76086754
0
Sets the deployment_type of this HyperflexClusterAllOf.
def deployment_type(self, deployment_type): allowed_values = ["NA", "Datacenter", "Stretched Cluster", "Edge"] # noqa: E501 if self.local_vars_configuration.client_side_validation and deployment_type not in allowed_values: # noqa: E501 raise ValueError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_type(self, cluster_type):\n\n self._cluster_type = cluster_type", "def execution_type(self, execution_type):\n self._execution_type = execution_type", "def set_execution_type(self, type):\n self.execution_type = type", "def deployment(self, deployment):\n if self.local...
[ "0.60431296", "0.5086802", "0.5064511", "0.5031363", "0.49843484", "0.49203134", "0.48616284", "0.48574537", "0.47959578", "0.47540614", "0.47528192", "0.47440833", "0.4703899", "0.4646632", "0.46301425", "0.4621747", "0.45647252", "0.45608556", "0.4549358", "0.45373568", "0....
0.7309751
0
Sets the hypervisor_type of this HyperflexClusterAllOf.
def hypervisor_type(self, hypervisor_type): allowed_values = ["Unknown", "Hyper-V", "ESXi"] # noqa: E501 if self.local_vars_configuration.client_side_validation and hypervisor_type not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `hypervisor_type` ({...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_type(self, cluster_type):\n\n self._cluster_type = cluster_type", "def host_type(self, host_type):\n if host_type is None:\n raise ValueError(\"Invalid value for `host_type`, must not be `None`\") # noqa: E501\n allowed_values = [\"ESXI\", \"RHELKVM\", \"UBUNTUKVM\"] ...
[ "0.55367905", "0.5317164", "0.5315374", "0.50082", "0.49498853", "0.49016467", "0.46648487", "0.46638283", "0.46264988", "0.45733088", "0.4504203", "0.44881976", "0.44741535", "0.44719192", "0.4442753", "0.44245493", "0.4424139", "0.43838647", "0.43795475", "0.43447226", "0.4...
0.6603614
0
Sets the vm_count of this HyperflexClusterAllOf.
def vm_count(self, vm_count): self._vm_count = vm_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hyperv_host_count(self, hyperv_host_count):\n\n self._hyperv_host_count = hyperv_host_count", "def vms_every(self, vms_every):\n\n self._vms_every = vms_every", "def node_count(self, node_count):\n\n self._node_count = node_count", "def vlans_every(self, vlans_every):\n\n self...
[ "0.6480355", "0.6073736", "0.6024782", "0.5824801", "0.58180416", "0.5770712", "0.57170534", "0.56994927", "0.56954896", "0.56296235", "0.55417037", "0.5516289", "0.54838496", "0.54283017", "0.5389219", "0.53383934", "0.5328772", "0.53028303", "0.5276403", "0.5249321", "0.524...
0.7467594
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, HyperflexClusterAllOf): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, HyperflexClusterAllOf): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Converts span_info string into a list of (class_id, start, end) where start, end are coordinates of starting and ending(exclusive) tokens in input_ids of BertExample
def _get_spans(self, span_info_parts: List[str]) -> List[Tuple[int, int, int]]: result_spans = [] for p in span_info_parts: if p == "": break c, start, end = p.split(" ") if c not in self._semiotic_classes: raise KeyError("class=" + c ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_spans(span_string):\n spans = []\n for span in span_string.split(';'):\n start, end = span.split(' ')\n spans.append((int(start), int(end)))\n return spans", "def parse_spans(span_string):\n spans = []\n for span in span_string.split(';'):\n ...
[ "0.6694162", "0.6694162", "0.59442824", "0.56873554", "0.56584054", "0.5445474", "0.5369233", "0.5335527", "0.5329429", "0.530567", "0.52593035", "0.52254045", "0.51691306", "0.51481", "0.5081967", "0.50652266", "0.5064506", "0.5049527", "0.5025644", "0.5018323", "0.49570754"...
0.7336412
0
Splits tokens to WordPieces.
def _split_to_wordpieces(self, tokens: List[str]) -> Tuple[List[str], List[int]]: bert_tokens = [] # Original tokens split into wordpieces. # Index of each wordpiece that starts a new token. token_start_indices = [] for i, token in enumerate(tokens): # '+ 1' is because bert_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _wordpiece_tokenize_input(self, tokens: List[str]) -> Tuple[List[str], List[int], List[int]]:\n word_piece_tokens: List[str] = []\n end_offsets = []\n start_offsets = []\n cumulative = 0\n for token in tokens:\n if self.lowercase_input:\n token = tok...
[ "0.7718129", "0.77164775", "0.7153895", "0.7032158", "0.6962991", "0.66200703", "0.6474708", "0.6467611", "0.6329463", "0.6323796", "0.6319143", "0.6304826", "0.6293882", "0.62516576", "0.62516576", "0.62516576", "0.62516576", "0.62516576", "0.6248654", "0.6247854", "0.624779...
0.84632087
0
Get a data loader created from a given set of data.
def get_data_loader_from_data(cls, batch_size, X, Y, **kwargs): X_torch = torch.from_numpy(X).float() if ( "classification_problem" in kwargs and kwargs["classification_problem"] == False ): Y_torch = torch.from_numpy(Y).float() else: Y_to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_loader(data, json, batch_size, shuffle, num_workers):\n dataset = FinNumDataset(data, json)\n\n data_loader = torch.utils.data.DataLoader(dataset=dataset,\n batch_size=batch_size,\n shuffle=shuffle,\n ...
[ "0.7418241", "0.7164697", "0.70335335", "0.69989353", "0.6958592", "0.6948308", "0.69271505", "0.69046247", "0.68932927", "0.68793124", "0.6853601", "0.68313813", "0.68218905", "0.6807754", "0.6802762", "0.68013585", "0.6791337", "0.678437", "0.6720881", "0.66964626", "0.6679...
0.6525021
37
Return True if n is a power of two.
def is_power_of_two(n): if n <= 0: return False else: return n & (n - 1) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isPowerOfTwo(self, n: int) -> bool:\n if n <= 0:\n return False\n return bin(n).count('1') == 1", "def is_power_of_two(n):\n if n < 0:\n return False\n else:\n return n & (n - 1) == 0", "def is_power_of_two(n: Union[int, float]):\n\n if n > 1:\n if n !...
[ "0.9018986", "0.8857611", "0.86676097", "0.84409565", "0.8168425", "0.81002796", "0.81002796", "0.79719347", "0.78607", "0.7523444", "0.75003964", "0.74941194", "0.7263389", "0.7162678", "0.7140002", "0.70655465", "0.70607436", "0.69604325", "0.6865322", "0.6846204", "0.68415...
0.88537836
2
Test that the mealname details are valid characters when sending request
def test_invalid_name_details(self): with self.client: response = self.add_meal("@#$%&*", 15000) data = json.loads(response.data.decode()) self.assertEqual(data.get('message'), "Invalid characters not allowed") self.assertEqual(respons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_short_meal_name_details(self):\n with self.client:\n response = self.add_meal(\n \"qwertyuioplkjhgfdsazxcvbnmqwertyu\", 15000)\n data = json.loads(response.data.decode())\n self.assertEqual(\n data.get('message'),\n \"Mea...
[ "0.76297855", "0.752459", "0.7474777", "0.68675774", "0.67901903", "0.6785424", "0.66192967", "0.6551511", "0.63857937", "0.6332464", "0.63204396", "0.6261282", "0.62425226", "0.6226742", "0.62000394", "0.6187489", "0.6164175", "0.6141783", "0.6141425", "0.6088481", "0.606342...
0.82743394
0
Test that the meal name already exists.
def test_meal_name_already_exists(self): with self.client: self.add_meal("fries", 10000) response = self.add_meal("fries", 10000) data = json.loads(response.data.decode()) self.assertEqual(data.get('message'), "Meal name already exists") self.assertEq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_missing_meal_name_details(self):\n with self.client:\n response = self.add_meal(\"\", 15000)\n data = json.loads(response.data.decode())\n self.assertEqual(\n data.get('message'),\n \"Meal name must be between 3 to 25 characters long\")...
[ "0.6780348", "0.667173", "0.65495557", "0.6524667", "0.63617384", "0.6304246", "0.6284538", "0.6279259", "0.62737167", "0.62415534", "0.6238222", "0.60730106", "0.6058156", "0.6053416", "0.6039715", "0.6024508", "0.6006363", "0.5971962", "0.59654087", "0.59534395", "0.5948781...
0.8401512
0
Test that the mealname details are valid characters on put request
def test_invalid_name_details_put(self): with self.client: token = self.get_token() id = self.get_id() response = self.client.put('api/v1/meals/{}'.format(id), data=json.dumps(dict( meal_name="@...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_name_details(self):\n with self.client:\n response = self.add_meal(\"@#$%&*\", 15000)\n data = json.loads(response.data.decode())\n self.assertEqual(data.get('message'),\n \"Invalid characters not allowed\")\n self.asse...
[ "0.742772", "0.69959277", "0.6857145", "0.6852675", "0.6788875", "0.67586106", "0.6739723", "0.6688951", "0.6517848", "0.6350542", "0.63475436", "0.6342937", "0.6299844", "0.62980103", "0.62492305", "0.6225188", "0.61846375", "0.61774576", "0.61622924", "0.61357594", "0.61313...
0.8544771
0
Compute the pressure of the current particle configuration
def compute_pressure(particles): pressure_tail = 16 / 3 * np.pi * density ** 2 * (2 - rc ** (-9) / 3 - rc ** (-3)) pressure = pressure_tail + density / beta for i in range(n_particles): dx = dx_particles(particles, i) for j in range(i + 1, n_particles): rsq = np.dot(dx[j, :], dx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pressure(self):\r\n self._read_temperature()\r\n\r\n # Algorithm from the BME280 driver\r\n # https://github.com/BoschSensortec/BME280_driver/blob/master/bme280.c\r\n adc = self._read24(_BME280_REGISTER_PRESSUREDATA) / 16 # lowest 4 bits get dropped\r\n var1 = float(self._t_...
[ "0.73936445", "0.7337461", "0.71730494", "0.70827323", "0.7049176", "0.6989879", "0.69646585", "0.6908126", "0.6890221", "0.6882728", "0.6871883", "0.67027974", "0.6697975", "0.6679239", "0.6679239", "0.6679239", "0.6572112", "0.6558551", "0.6558551", "0.6558551", "0.64772576...
0.747002
0
draw a rectangle with a given width, height, penColor and fillColor, with the current location of the turtle being the lower left corner, and the bottom side tilted by an angle tilt (specified in degrees) relative to the horizontal axis. After the rectangle is drawn, the turtle should return to its original position wi...
def drawRectangle(width, height, tilt, penColor, fillColor): Lucia.color(penColor,fillColor) Lucia.seth(tilt) Lucia.begin_fill() for i in range(2): Lucia.forward(width) Lucia.left(90) Lucia.forward(height) Lucia.left(90) Lucia.end_fill()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawRectangle_1():\n Lucia.color(\"green\",\"yellow\") # Sets the pen color to green and fill color to yellow\n Lucia.seth(90) # Set the initial orientation of the turtle to 0 degrees\n Lucia.begin_fill()\n Lucia.forward(50) # Move the turtle forward by 50 units in the direction that it was poi...
[ "0.7304146", "0.7190478", "0.71585023", "0.7068305", "0.7068305", "0.69947356", "0.6928198", "0.6604455", "0.6480822", "0.6426968", "0.6412329", "0.63512874", "0.6303055", "0.62805146", "0.62341964", "0.6198877", "0.6169091", "0.61562616", "0.6046428", "0.60213184", "0.601331...
0.7976209
0
Returns the transport used by the client instance.
def transport(self) -> AppConnectionsServiceTransport: return self._client.transport
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transport(self):\n return self._transport", "def transport(self) -> TraceServiceTransport:\n return self._client.transport", "def transport(self) -> ServiceControllerTransport:\n return self._client.transport", "def transport(self) -> MetadataServiceTransport:\n return self._c...
[ "0.82946277", "0.7887542", "0.773594", "0.773068", "0.76806635", "0.7674273", "0.7558095", "0.7551682", "0.75303864", "0.74958986", "0.7488142", "0.7436853", "0.7423566", "0.7368433", "0.73340607", "0.721926", "0.7109823", "0.7102308", "0.68808985", "0.68144", "0.6671675", ...
0.76357967
6
r"""Gets the IAM access control policy for a function. Returns an empty policy if the function exists and does not have a policy set.
async def get_iam_policy( self, request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network_access_policy(self) -> Optional[str]:\n return pulumi.get(self, \"network_access_policy\")", "def client_access_policy(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"client_access_policy\")", "def get_policy(usage_id):\r\n return policy.get(policy_key...
[ "0.6179221", "0.6158454", "0.6112438", "0.61038685", "0.61038685", "0.60069275", "0.5966878", "0.5966878", "0.59451264", "0.59451264", "0.59343827", "0.5903599", "0.588349", "0.5872577", "0.5869546", "0.5866386", "0.58580077", "0.5834978", "0.5834978", "0.5834978", "0.5778721...
0.0
-1
Update Kubernetes config file with new image version
def __write_build_version(file_path, identifier, version): with open(file_path) as fp: lines = fp.readlines() new_lines = [] for line in lines: if line.find(identifier) > -1: parts = line.split(identifier) parts[-1] = version + '\n' new_line = identifier...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_image(self):\n\n if not self.spec.get(\"image\"):\n try:\n self.spec[\"image\"] = self._get_image_from_artifact()\n except (AttributeError, KeyError) as err:\n raise LookupError(\n f\"Could not get {self.name} container image: {...
[ "0.636528", "0.5963231", "0.588698", "0.5866082", "0.5853383", "0.5832107", "0.5717316", "0.5706842", "0.5698264", "0.5686603", "0.5670921", "0.5659763", "0.5652932", "0.56305796", "0.5627882", "0.5621333", "0.5578423", "0.5575629", "0.55399454", "0.5518833", "0.5511859", "...
0.0
-1
The output shape of the batchnorm should be (None, nr_timesteps, nr_filters)
def test_cnn_batchnorm_dim(self): model_type = CNN((None, 20, 3), 2) model = model_type.create_model(**{"filters": [32, 32], "fc_hidden_nodes": 100}) batchnormlay = model.layers[2] assert batchnormlay.output_shape == (None, 20, 32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_norm(self, inputs):\n x = inputs\n x = self.bn(x)\n return x", "def test_cnn_batchnorm_dim(self):\n model = modelgen.generate_CNN_model((None, 20, 3), 2, [32, 32], 100)\n batchnormlay = model.layers[2]\n assert batchnormlay.output_shape == (None, 20, 32)", "d...
[ "0.70630753", "0.7031779", "0.64930296", "0.6474249", "0.64451873", "0.64271545", "0.6374522", "0.6368659", "0.6357454", "0.63463193", "0.63236684", "0.63129306", "0.63121563", "0.63046867", "0.63026893", "0.6271101", "0.6255141", "0.6212837", "0.62011766", "0.6142625", "0.61...
0.71714324
0
Layer normalize the tensor x, averaging over the last dimension.
def layer_norm(x, filters=None, epsilon=1e-6, name=None, reuse=None): if filters is None: filters = common_utils.shape_list(x)[-1] with tf.variable_scope(name, default_name="layer_norm", values=[x], reuse=reuse): scale, bias = _layer_norm_vars(filters) return _layer_norm_compute(x, epsilon, scale, bias...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(self, x, train=True):\n if train is not None:\n mean, variance = tf.nn.moments(x, [0,1,2])\n assign_mean = self.mean.assign(mean)\n assign_variance = self.variance.assign(variance)\n with tf.control_dependencies([assign_mean, assign_variance]):\n return tf.nn.batch_norm_...
[ "0.7025246", "0.7000931", "0.69984037", "0.6946193", "0.6926463", "0.6913268", "0.6907985", "0.68715054", "0.6863467", "0.6787572", "0.6776529", "0.67483455", "0.6723166", "0.6712802", "0.6702004", "0.66976094", "0.6691674", "0.66691875", "0.6619964", "0.6619837", "0.65780723...
0.0
-1
Convert a number into the GDSII 8 byte real format.
def _eight_byte_real(value): if value == 0: return b"\x00\x00\x00\x00\x00\x00\x00\x00" if value < 0: byte1 = 0x80 value = -value else: byte1 = 0x00 fexp = numpy.log2(value) / 4 exponent = int(numpy.ceil(fexp)) if fexp == exponent: exponent += 1 mantiss...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _eight_byte_real(value):\n if value == 0:\n return b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n if value < 0:\n byte1 = 0x80\n value = -value\n else:\n byte1 = 0x00\n fexp = numpy.log2(value) / 4\n exponent = int(numpy.ceil(fexp))\n if fexp == exponent:\n e...
[ "0.6979643", "0.6864766", "0.58973575", "0.5896776", "0.58232516", "0.5792698", "0.57434374", "0.56907225", "0.5621632", "0.5616022", "0.5605519", "0.5580687", "0.5539226", "0.5517988", "0.5507881", "0.54723024", "0.5425649", "0.5422295", "0.54033047", "0.54002154", "0.539832...
0.7045766
0
Return True if the queen at column c clashes with any queen to its left.
def col_clashes(bs, c): for i in range(c): # Look at all columns to the left of c if share_diagonal(i, bs[i], c, bs[c]): return True return False # No clashes - col c has a safe placement.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isfree(col,queens):\n if col in queens:\n return False\n elif any([ abs(col-col1)==len(queens)-index for index,col1 in enumerate(queens)]):\n #c[r]==c[j]; r-j==c[r]-c[j]; r-j==c[j]-c[r]\n # col is the colomn to check; len(queens) just be the row index of col, dont subtract 1\n ...
[ "0.7706922", "0.7293217", "0.7145031", "0.7017852", "0.6986524", "0.69041854", "0.66964936", "0.65575945", "0.6549814", "0.65225124", "0.65224487", "0.65224487", "0.65204614", "0.65154654", "0.651165", "0.651165", "0.65029234", "0.6499915", "0.6498407", "0.64938885", "0.64930...
0.6549823
8
Create a new instance of DatabaseManager. path is the path to the location where the databases should be stored. It may be a path to a physical disk location or a URI pointing to a network resource. engine is the class of the DatabaseEngine to use.
def __init__(self, path: Union[Path, str], engine: DatabaseEngine = SQLiteEngine): self._path = path self._cache = WeakValueDictionary() self._engine = engine self._registered_models = set() if isinstance(self._path, Path) and not self._path.exists(): os.makedirs(se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, path: Union[str, Path]):\n if isinstance(path, str):\n path = Path(path)\n self.path = path\n LOG.debug(f\"Creating an engine at {path.absolute()}.\")\n self.engine = get_engine(path)\n self._metadata = deepcopy(Base.metadata)\n self._table_de...
[ "0.662756", "0.6251338", "0.6063999", "0.59831834", "0.59511465", "0.5857252", "0.57939076", "0.5696416", "0.56038505", "0.55776995", "0.5554342", "0.55351424", "0.5415121", "0.54097456", "0.5406303", "0.53913856", "0.5385", "0.5383769", "0.53420824", "0.5324332", "0.53159714...
0.6682711
0
Like get_db(), but accepts discord.Message objects instead of strings. This method will load and return the database corresponding to the server the message was posted in. If the message was posted in a private/group channel instead, or wasn't specified at all, this method will return the "global" database instead for ...
def get_db_by_message(self, msg: Message = None) -> DatabaseEngine: if msg is not None: if msg.guild: return self.get_db(msg.guild.id) #fall back to global database for DMs and unspecified messages return self.get_db("global")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_db():\n if not hasattr(g, 'mongo_db'):\n g.db = get_mongo_db()\n\n return g.db", "def get_db(self):\n self.logger.info('in get_db()')\n try:\n return self.client[self.db_name]\n except Exception as e:\n self.logger.error(f'Error occurred while getti...
[ "0.60387623", "0.6007621", "0.60039407", "0.59741694", "0.59647924", "0.5954887", "0.5894861", "0.5861517", "0.5801435", "0.5800954", "0.5796669", "0.57623184", "0.57239234", "0.5721493", "0.5661909", "0.5623637", "0.56154066", "0.5609385", "0.56032556", "0.55729735", "0.5568...
0.80646133
0
Assert a user can read attendances with a POST request.
def assert_user_can_read_attendances(self, user, video): livesession = LiveSessionFactory( email=user.email, is_registered=True, user=user, video=video, ) started = 1620800000 livesession_public = AnonymousLiveSessionFactory( e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_attendance(client, json_access_token, school_json, attendance_json, student_json):\n # create school\n res = client.post(\"/api/v1/schools\", json=school_json, headers=json_access_token)\n assert res.status_code == 200\n # create student\n res = client.post(\"/api/v1/students\", json=s...
[ "0.6773185", "0.6748962", "0.64997226", "0.6459053", "0.6109127", "0.60938007", "0.60767794", "0.6041294", "0.603253", "0.59640026", "0.5923378", "0.5914851", "0.5911544", "0.5881073", "0.5875813", "0.586984", "0.5866064", "0.5818814", "0.5817077", "0.57602245", "0.5735159", ...
0.6138403
4
Playlist instructors cannot read attendances.
def test_list_by_playlist_student(self): playlist_access = PlaylistAccessFactory( role=STUDENT, playlist=self.live.playlist ) self.assert_user_cannot_read_attendances(playlist_access.user, self.live)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_by_playlist_instructor(self):\n playlist_access = PlaylistAccessFactory(\n role=INSTRUCTOR, playlist=self.live.playlist\n )\n\n self.assert_user_can_read_attendances(playlist_access.user, self.live)", "def test_api_livesession_student_cant_read_attendances(self):\n ...
[ "0.71261066", "0.67814064", "0.65924937", "0.6538756", "0.63530916", "0.62338233", "0.62256163", "0.6147952", "0.6092726", "0.6037907", "0.5950574", "0.59284323", "0.59220904", "0.5850012", "0.577761", "0.571438", "0.5711754", "0.56460685", "0.5636679", "0.5573166", "0.555819...
0.69625235
1
Check if timestamps exist before the list of timestamp of the video they get ignored
def test_api_livesession_read_attendances_well_computed_before_start(self): started = 1620800000 # ends an hour later ended = started + 3600 video = VideoFactory( live_state=STOPPED, live_info={"started_at": str(started), "stopped_at": str(ended)}, li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_is_valid_timestamp_valid(self):\n timestamps = (\n \"XsyRkw\",\n \"Xrim9Q\",\n \"XsyR-w\",\n \"XsySD_\",\n \"Dn9r_A\",\n )\n\n for timestamp in timestamps:\n with self.subTest(timestamp=timestamp):\n resu...
[ "0.6443534", "0.63065255", "0.6281298", "0.6047148", "0.6040499", "0.60060203", "0.5967887", "0.5943085", "0.585166", "0.57882375", "0.57427007", "0.57385916", "0.56402516", "0.5624533", "0.5616949", "0.55730563", "0.55486447", "0.5546568", "0.5535536", "0.55115545", "0.55047...
0.0
-1
This method returns if a vertex is a sink vertex as vector. The method generates a 1D Tensor containing the boolean values that indicates if the vertex at position `i` is a sink vertex.
def is_not_sink_tf(self) -> tf.Tensor: return tf.not_equal(self.out_degrees_tf_vector, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_not_sink_tf_vertex(self, vertex: int) -> TF_type:\n return tf.not_equal(\n tf.reshape([self.out_degrees_tf_vertex(vertex)], [1]), 0)", "def _is_sink() -> bool:\n\n def _is_inplace(n: Node):\n \"\"\"Get the inplace argument from ``torch.fx.Node``\n \"\"\"\n ...
[ "0.71272177", "0.6080905", "0.60520786", "0.60015965", "0.60015965", "0.593374", "0.5583146", "0.5548035", "0.5546088", "0.5544098", "0.53978246", "0.52435184", "0.52233607", "0.5193353", "0.51919174", "0.518141", "0.5158784", "0.5143257", "0.51302934", "0.51260173", "0.51192...
0.6046263
3
This method returns if a vertex is a sink vertex as vector. The method generates a 1D Tensor containing the boolean values that indicates if the vertex at position `i` is a sink vertex.
def is_not_sink_tf_vertex(self, vertex: int) -> TF_type: return tf.not_equal( tf.reshape([self.out_degrees_tf_vertex(vertex)], [1]), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_sink() -> bool:\n\n def _is_inplace(n: Node):\n \"\"\"Get the inplace argument from ``torch.fx.Node``\n \"\"\"\n inplace = False\n if n.op == \"call_function\":\n inplace = n.kwargs.get(\"inplace\", False)\n ...
[ "0.6081741", "0.60543114", "0.6045907", "0.6003684", "0.6003684", "0.59358406", "0.55857277", "0.55483806", "0.5546105", "0.55444264", "0.540036", "0.524461", "0.5220987", "0.5194642", "0.51933354", "0.5182617", "0.5159223", "0.51437396", "0.5129145", "0.5127039", "0.51205236...
0.71280795
0
This method returns the degree of all vertex as vector. The method generates a 0D Array containing the outdegree of the vertex i.
def out_degrees_tf_vertex(self, vertex: int) -> tf.Tensor: return tf.gather(self.out_degrees_tf, [vertex])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_outdeg(self, vertex: np.int_):\n return len(self.__adj[vertex])", "def degree_v(self):\n return self._degree_v", "def return_indeg(self, vertex: np.int_):\n return sum(map(lambda x: x>0,self.__mat[:,vertex]))", "def degree(self, v):\n self._validateVertex(v)\n return sel...
[ "0.734286", "0.7002177", "0.69189197", "0.6837811", "0.6617623", "0.65978247", "0.65728825", "0.64671457", "0.63548636", "0.6339309", "0.6277822", "0.6169775", "0.6081024", "0.60603887", "0.6054803", "0.6033193", "0.6009052", "0.5983941", "0.59818685", "0.5956546", "0.5947304...
0.5929953
24
Method that returns the edge set of the graph as list. This method return all the edges of the graph codified as 2D matrix in which the first dimension represents each edge and second dimension the source and destination vertices of each edge.
def edge_list_tf(self) -> tf.Tensor: return tf.cast(tf.where(tf.not_equal(self.A_tf, 0)), tf.int64)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges(self):\n es = []\n for vertex1 in self.vertices():\n for vertex2 in self.out_vertices(vertex1):\n es.append(self[vertex1][vertex2])\n return es", "def getEdges(self):\n edgeList = []\n for v in self.adjList:\n for i in range(len(se...
[ "0.8006193", "0.791543", "0.77964914", "0.7778343", "0.77041215", "0.7634973", "0.76320714", "0.7575193", "0.7556009", "0.7491028", "0.7467783", "0.74677205", "0.74677205", "0.74677205", "0.74566627", "0.7448589", "0.74090827", "0.7402998", "0.7304477", "0.7300385", "0.727743...
0.0
-1
Method that returns the edge set of the graph as list. This method return all the edges of the graph codified as 2D matrix in which the first dimension represents each edge and second dimension the source and destination vertices of each edge.
def edge_list_np(self) -> np.ndarray: return self.run_tf(self.edge_list_tf)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges(self):\n es = []\n for vertex1 in self.vertices():\n for vertex2 in self.out_vertices(vertex1):\n es.append(self[vertex1][vertex2])\n return es", "def getEdges(self):\n edgeList = []\n for v in self.adjList:\n for i in range(len(se...
[ "0.8008677", "0.7918403", "0.7799045", "0.77806884", "0.7705983", "0.76370907", "0.7634346", "0.75773376", "0.7558921", "0.7493058", "0.7470372", "0.74698174", "0.74698174", "0.74698174", "0.7458055", "0.74505377", "0.74115855", "0.74056315", "0.73063046", "0.73030066", "0.72...
0.0
-1
This method returns the indegree of all vertex as vector. The method generates a 1D Array containing the indegree of the vertex `i` at position `i`
def in_degrees_np(self) -> np.ndarray: return self.run_tf(self.in_degrees_tf)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_indeg(self, vertex: np.int_):\n return sum(map(lambda x: x>0,self.__mat[:,vertex]))", "def return_outdeg(self, vertex: np.int_):\n return len(self.__adj[vertex])", "def vertice_degree(self):\r\n if(self.is_empty()):\r\n raise ValueError(\"Graph is empty.\")\r\n ...
[ "0.6871607", "0.6651398", "0.6635549", "0.6602062", "0.6527948", "0.631883", "0.62901586", "0.62744987", "0.62585884", "0.62435406", "0.62316656", "0.6226531", "0.62161696", "0.6129373", "0.6126891", "0.6118143", "0.6108225", "0.6068903", "0.60610425", "0.6059564", "0.6037401...
0.5940664
29
Return the server's URL.
def url(self): return self._client.url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server_url(self):\n\n\t\treturn self._server_url", "def server_url(self):\n\n return self._server_url", "def server_url(self):\n return self._session.server_url", "def server(self) -> str:\n return self._server_url", "def server_url(self):\n return self._session_coords.serve...
[ "0.90213203", "0.88681793", "0.8799355", "0.87774223", "0.83925575", "0.83896595", "0.83667916", "0.82467043", "0.790751", "0.7790982", "0.7718455", "0.76628506", "0.76593727", "0.7631619", "0.7603425", "0.7505372", "0.74774563", "0.7406021", "0.73974097", "0.73577845", "0.73...
0.7415998
17
Return the server's version as a string.
def version(self): return self._client.getVersion()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version_string(self):\n return self.server_version", "def get_server_version(self):\n return self.client.getServerVersion().decode('utf-8')\n return self.client.getServerVersion().decode('utf-8')", "def get_version(self) -> str:\n return versioning.get_version()", "async def v...
[ "0.9022919", "0.8375982", "0.81187874", "0.79733884", "0.7866681", "0.77831835", "0.77712953", "0.77712953", "0.77712953", "0.77712953", "0.7757843", "0.77556884", "0.77282596", "0.76880026", "0.7666072", "0.7661008", "0.76532197", "0.76532197", "0.7648751", "0.76215917", "0....
0.7092939
78
Open a session that federates several repositories. The repositories argument should be an array containing store designators, which can be Repository or RepositoryConnection objects, strings (naming a store in the root catalog, or the URL of a store), or (storename, catalogname) tuples.
def openFederated(self, repositories, autocommit=False, lifetime=None, loadinitfile=False): def asRepoString(x): if isinstance(x, str): return spec.local(x) elif isinstance(x, tuple): return spec.local(x[0], x[1]) elif isinstance(x, Repository): return x.getSpec() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repositories(db):\n repos = list()\n repos.append(RepositoryFactory(full_name='python', language='Python'))\n repos.append(RepositoryFactory(full_name='ruby', language='Ruby'))\n repos.append(RepositoryFactory(full_name='java', language='Java'))\n db.session.commit()\n return repos", "def o...
[ "0.5393022", "0.5358068", "0.51316196", "0.49571633", "0.49550796", "0.48791245", "0.4821798", "0.46716613", "0.46535861", "0.4648002", "0.46318117", "0.45726812", "0.4563642", "0.4509024", "0.44905466", "0.44007406", "0.43882567", "0.43508264", "0.43429133", "0.42945763", "0...
0.75047016
0
Generate a random client token.
def get_client_token(**_): return str(uuid.uuid4())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_client_token_by_uuid():\n return str(uuid.uuid4())", "def generate_client_token_by_uuid():\n return str(uuid.uuid4())", "def generate_token():\n return uuid4()", "def generate_token():\n chars = ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')\n rand = random...
[ "0.78147936", "0.78147936", "0.7751316", "0.7609233", "0.75524956", "0.7216405", "0.7140577", "0.70882004", "0.7029221", "0.6971429", "0.69533265", "0.6919694", "0.6835889", "0.6812662", "0.66613466", "0.66605544", "0.6571486", "0.65170556", "0.6505653", "0.64958465", "0.6456...
0.7800907
2
Returns x, y, z array of points comprising shells extending from r to r_dr. n determines the number of points in the ring. Rings are generated by constructing a unit sphere and projecting every point onto a shell of thickness dr
def _points_ring3D(r_edges, dr, n): refx_all, refy_all, refz_all = [], [], [] for r in r_edges: ref = 2*np.random.random(size=(n, 3)) - 1 ref /= np.linalg.norm(ref, axis=1).repeat(3).reshape((len(ref), 3)) ref *= dr*np.random.random(size=(len(ref), 3)) + r x, y, z = ref[:, 0], r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getShellPoints(n, minRes, thetaRes, pad):\n n = float(n)\n dx = lx / n\n dTheta = 0.5 * math.pi / float(thetaRes)\n shellRad = epsRad + float(pad) * dx\n maxDx = (1. + 1.e-8) * lx / float(minRes) \n thetaMin = math.asin(maxDx / shellRad / math.sqrt(2.0))\n thetaMax = math.acos(0.5 * maxDx / shellRad)\n ...
[ "0.7019731", "0.6351343", "0.6326232", "0.61467665", "0.60799944", "0.6079614", "0.60193473", "0.60178465", "0.5951989", "0.58725977", "0.5834473", "0.5817987", "0.57922435", "0.57543504", "0.5725783", "0.57158905", "0.56901014", "0.5666954", "0.5609906", "0.5596919", "0.5576...
0.6834648
1
Generate a random string to use as a database object name. It handles letter case according to the database type, forcing uppercase (e.g. Oracle) or lowercase (e.g. Postgres).
def _get_random_name(database, prefix='', length=5): if isinstance(database, OracleDatabase): name = '{}{}'.format(prefix.upper(), get_random_string(string.ascii_uppercase)) else: name = '{}{}'.format(prefix.lower(), get_random_string(string.ascii_lowercase)) return name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_name(self):\n letters = string.ascii_letters\n random_name = ''.join(random.choice(letters) for _ in range(10))\n assert isinstance(random_name, str)\n return random_name", "def __generate_random_string():\n return uuid4().hex[:6].upper()", "def _get_random_name(...
[ "0.75175905", "0.72178024", "0.71494067", "0.71021354", "0.7045532", "0.7039897", "0.6983421", "0.6981178", "0.6954214", "0.69175845", "0.67740923", "0.6757927", "0.67320347", "0.6718049", "0.66870725", "0.66845155", "0.6639657", "0.66349417", "0.6588731", "0.65749294", "0.65...
0.7868905
0
Generate a random string to use as a database schema name. It handles letter case according to the database type, forcing uppercase (e.g. Oracle) or lowercase (e.g. Postgres). For Oracle databases 'C' is prepended to the final name. This is a workaround needed to work against Oracle multitenant databases (e.g. our Orac...
def _get_random_schema_name(database, prefix='', length=5): prefix = f'C##{prefix}' if isinstance(database, OracleDatabase) else prefix return _get_random_name(database, prefix=prefix, length=length)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_random_name(database, prefix='', length=5):\n if isinstance(database, OracleDatabase):\n name = '{}{}'.format(prefix.upper(), get_random_string(string.ascii_uppercase))\n else:\n name = '{}{}'.format(prefix.lower(), get_random_string(string.ascii_lowercase))\n\n return name", "def...
[ "0.7421243", "0.6587565", "0.6463557", "0.6456254", "0.6320984", "0.6094259", "0.6092533", "0.60563993", "0.60467917", "0.6025921", "0.59806955", "0.5976732", "0.59549415", "0.59336054", "0.5904449", "0.58913636", "0.58862597", "0.58698773", "0.5823605", "0.57835186", "0.5777...
0.8465398
0
Return the channel that matches channel, or the channel that has channel (a nick) in its list of people. Otherwise, return the defaultSession, usually indicating that someone has /msg'd the bot and that person is not in a channel with the bot.
def findSessions(self, channel): found = [] for ss in self.sessions: try: _channel = channel.decode(ss.encoding) if _channel == ss.name: found.append(ss) if ss.matchNick(_channel): found.append(ss) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primary_channel(guild: discord.Guild) -> discord.TextChannel | None:\n if guild.system_channel is not None:\n return guild.system_channel\n\n for channel_candidate in guild.channels:\n if (\n isinstance(channel_candidate, discord.TextChannel)\n and channel_candidate.pe...
[ "0.6263049", "0.6239907", "0.6228334", "0.6165339", "0.612316", "0.6022597", "0.5884877", "0.58385336", "0.58209574", "0.57453436", "0.57453436", "0.56833625", "0.5672105", "0.5651763", "0.56473887", "0.56467044", "0.564453", "0.56347585", "0.56162", "0.5611115", "0.5569932",...
0.5710257
11
tearDown method called after each unittest to cleanup the working directory
def tearDown(self): if self.workdir and os.path.exists(self.workdir): shutil.rmtree(self.workdir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n shutil.rmtree(self.working_directory)", "def tearDown(self):\r\n shutil.rmtree(self.working_directory)", "def tearDown(self) -> None:\n self.directory.cleanup()", "def tearDown(self):\n self.remove_test_files()", "def tearDown(self):\n print(\n ...
[ "0.86926925", "0.8684253", "0.8664246", "0.86497486", "0.86089116", "0.8602593", "0.8588878", "0.85206574", "0.8495308", "0.8495308", "0.8469177", "0.846661", "0.84641296", "0.8372656", "0.8362313", "0.83570266", "0.835563", "0.8325194", "0.8319614", "0.83031386", "0.82953215...
0.82481515
22
Gets the argmax sequence from a set of scores.
def get_seq_from_scores(scores, index_to_token_maps): seq = [] for score, tok_map in zip(scores, index_to_token_maps): # score_numpy_list = score.cpu().detach().numpy() score_numpy_list = score.cpu().data.numpy() assert score.size()[0] == len(tok_map) == len(list(score_numpy_list)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def argmax(self, values):\n return self.aggregate(values, \"argmax\")", "def max(scores):\n return __builtin__.max(scores) if len(scores) else 0", "def max_score(ar, scorer: Optional[topk_scorer]=None):\n assert len(ar) > 0, \"dc.max_score is not defined for empty arrays\"\n \n if scorer is No...
[ "0.7049773", "0.7022899", "0.67072296", "0.6603623", "0.64888203", "0.6487211", "0.6440832", "0.6430841", "0.64068246", "0.6387648", "0.6337737", "0.6318445", "0.62983274", "0.6228442", "0.61723423", "0.6170085", "0.6128584", "0.6112824", "0.6099138", "0.6076264", "0.6063714"...
0.6622809
3
Get the home page with an empty WordCounterForm
def get(self, request): form = WordCounterForm() return render(request, 'words/home.html', {'form': form})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def homepage():\r\n words = story.prompts\r\n # i didn't realize you could access class variables like this\r\n\r\n return render_template(\"homepage.html\", words = words)", "def home():\n return render_template('home.html', form=None)", "def home():\n\n form = HomePageForm()\n if form.valid...
[ "0.66058785", "0.6598429", "0.64883244", "0.6343826", "0.6315902", "0.6238743", "0.61718684", "0.6123837", "0.61218464", "0.6061796", "0.5965022", "0.594235", "0.590501", "0.5843363", "0.58431953", "0.5835203", "0.58242947", "0.58215296", "0.5815156", "0.5813465", "0.5792794"...
0.75413454
0
r"""Dot product between a vector and a set of vectors.
def vector_dot(xyz, vector): if len(vector) != 3: raise Exception( "vector should be length 3, the provided length is {}".format( len(vector) ) ) return vector[0]*xyz[:, 0] + vector[1]*xyz[:, 1] + vector[2]*xyz[:, 2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_dot(x, y):\r\n return sum(a * b for a, b in zip(x, y))", "def vec_dot(v1,v2):\r\n \r\n return np.dot(v1,v2)", "def dot(self, vec):\n pass", "def dotproduct(vec1, vec2):\n import operator\n return sum(map(operator.mul, vec1, vec2))", "def dot_vectors(u, v):\n return u[0] * v[0...
[ "0.8274346", "0.81259906", "0.80873716", "0.80652696", "0.80491614", "0.8016558", "0.79929364", "0.7984816", "0.79688996", "0.7958692", "0.7934172", "0.7907916", "0.79039073", "0.77992296", "0.775462", "0.7744759", "0.7730695", "0.77125186", "0.7710873", "0.7709191", "0.77028...
0.755198
25
Stack spatially distributed scalar values to simplify multiplication with a vector. Where the input argument `scalar` defines a set of n spatially distributed scalar values, ``repeat_scalar`` repeats and stacks the input array to produce an (`n`, `dim`) array which is better for multiplying the scalar values with vecto...
def repeat_scalar(scalar, dim=3): assert len(scalar) in scalar.shape, ( "input must be a scalar. The shape you provided is {}".format( scalar.shape ) ) return np.kron(np.ones((1, dim)), np.atleast_2d(scalar).T)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_scalar(vector, scalar):\n new_coordinates = []\n index = 0\n while index < vector.dimension:\n new_value = vector.coordinates[index] * scalar\n new_coordinates.append(new_value)\n index += 1\n new_vector = Vector(new_coordinates)\n return new_vector", "def scalar_con...
[ "0.61775327", "0.60803413", "0.5713232", "0.5592595", "0.55184263", "0.5494519", "0.54570186", "0.5455352", "0.5435718", "0.53619325", "0.53513414", "0.5258329", "0.5229403", "0.5215132", "0.5181318", "0.5154122", "0.51192546", "0.5076171", "0.5076171", "0.5042005", "0.503792...
0.7614667
0
Split a string into a list of equal Nsized fragments. >>> fragmentize_str("foo12bar34baz", 3) ['foo', '12b', 'ar3', '4ba', 'z']
def fragmentize_str(s, frag_size): return [ s[i:i+frag_size] for i in range(0, len(s), frag_size) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_string(self, string, n):\n if len(string) == 0:\n return ['']\n blocks = []\n while len(string) > 0:\n blocks.append(string[:n])\n string = string[n:]\n return blocks", "def _split(string: str, n: int):\n return [string[start : start + n] for start in range(0, len(stri...
[ "0.7084863", "0.67792594", "0.6616489", "0.6232007", "0.6232007", "0.6228307", "0.5958785", "0.5924137", "0.5913661", "0.58302677", "0.5805044", "0.5793416", "0.5677134", "0.56723195", "0.56589454", "0.5651932", "0.56474006", "0.5619297", "0.56044185", "0.5601226", "0.5595836...
0.7892952
0
Get the point closest to the intersection of two lines. The lines are given by one point (p1 and p2) and a direction vector v (v1 and v2). If a batch should be processed, the multiple direction vectors can be given.
def intersectionOfTwoLines(p1, v1, p2, v2): # if we transform multiple points in one go if len(v1.shape) == 2: a1 = np.einsum('ij,ij->i', v1, v1) a2 = np.einsum('ij,ij->i', v1, v2) b1 = -np.einsum('ij,ij->i', v2, v1) b2 = -np.einsum('ij,ij->i', v2, v2) c1 = -np.einsum('ij...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_intersect(line1, line2):\n b1 = (line1[1][1] - line1[0][1]) / (line1[1][0] - line1[0][0])\n b2 = (line2[1][1] - line2[0][1]) / (line2[1][0] - line2[0][0])\n a1 = line1[0][1] - b1 * line1[0][0]\n a2 = line2[0][1] - b2 * line2[0][0]\n\n if a1 == a2 and b1 == b2:\n return line1\n\n x...
[ "0.7182244", "0.71811354", "0.69980645", "0.69146985", "0.68665415", "0.684552", "0.684109", "0.6834031", "0.6814379", "0.6782095", "0.6729366", "0.67263013", "0.6720048", "0.67169183", "0.66890395", "0.6676878", "0.66481364", "0.66456693", "0.6629493", "0.66291946", "0.66062...
0.7221954
0
The area of a 2D or 3D triangle.
def areaOfTriangle(triangle): a = np.linalg.norm(triangle[..., 0, :] - triangle[..., 1, :]) b = np.linalg.norm(triangle[..., 1, :] - triangle[..., 2, :]) c = np.linalg.norm(triangle[..., 2, :] - triangle[..., 0, :]) s = (a+b+c)/2 # Herons formula return np.sqrt(s*(s-a)*(s-b)*(s-c))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area_triangle(w, h):\n return w * h / 2", "def area_triangle(triangle):\n return 0.5 * length_vector(normal_triangle(triangle, False))", "def triangle_area(base, height):\n return (base * height) / 2", "def triangle_area(base, height): # Compute the area of a triangle\n area = (1.0...
[ "0.83226854", "0.83001643", "0.8258442", "0.817723", "0.80964535", "0.8047085", "0.78970724", "0.7874705", "0.78744954", "0.78029585", "0.77761316", "0.7723496", "0.7700167", "0.7670194", "0.76321775", "0.76320404", "0.7486235", "0.7436879", "0.7393189", "0.7361736", "0.73502...
0.77020085
12
The area of a quadrilateral.
def areaOfQuadrilateral(rect): rect = np.array(rect) A = rect[..., 0, :] B = rect[..., 1, :] C = rect[..., 2, :] D = rect[..., 3, :] return 0.5 * np.abs((A[..., 1] - C[..., 1]) * (D[..., 0] - B[..., 0]) + (B[..., 1] - D[..., 1]) * (A[..., 0] - C[..., 0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getArea(self):\n asum = 0.0\n for quad in self._quadrilaterals:\n w = get_quad_width(quad)\n l = get_quad_length(quad)\n asum = asum + w * l\n return asum", "def area(self):\n num_rows = self.row_end - self.row_start\n num_cols = self.col_en...
[ "0.8185782", "0.7899902", "0.78384155", "0.78049433", "0.7802765", "0.7776387", "0.77561986", "0.77195746", "0.77159894", "0.7704854", "0.7687631", "0.7674731", "0.76237154", "0.7617555", "0.7601126", "0.75900596", "0.758878", "0.758878", "0.7566808", "0.7565095", "0.75648874...
0.7255075
74
return current delay for highwire, depending on current time at east coast can be overriden in pubConf per hostkeyword
def _highwireDelay(self, url): hostname = urlparse.urlsplit(url)[1] for hostKey, delaySec in pubConf.highwireDelayOverride.iteritems(): if hostKey in hostname: logging.debug('Overriding normal Highwire delay with %d secs as specified in conf' % delaySec) retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delay(self):\n _delay = self.config.get('delay', {\"hours\":0, \"minutes\":10, \"seconds\":0})\n return datetime.timedelta(\n hours=_delay.get('hours', 0), minutes=_delay.get('minutes', 0),\n seconds=_delay.get('seconds', 0))", "def return_delay_time(self):\n ...
[ "0.6808034", "0.66652256", "0.66486937", "0.65763766", "0.65528965", "0.6431415", "0.64194804", "0.64194804", "0.62824833", "0.6269982", "0.62674767", "0.6256657", "0.624951", "0.624951", "0.62222135", "0.61849374", "0.61430824", "0.60847574", "0.60685503", "0.60454494", "0.6...
0.7952539
0
Initialize the transition parameters. The parameters will be initialized randomly from a uniform distribution between 0.1 and 0.1.
def reset_parameters(self) -> None: nn.init.uniform_(self.start_transitions, -0.1, 0.1) nn.init.uniform_(self.end_transitions, -0.1, 0.1) nn.init.uniform_(self.transitions, -0.1, 0.1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_parameters(self, init_transitions) -> None:\n nn.init.uniform_(self.start_transitions, -0.1, 0.1)\n nn.init.uniform_(self.end_transitions, -0.1, 0.1)\n if not init_transitions:\n nn.init.uniform_(self.transitions, -0.1, 0.1)", "def __init__(self, transition, time_steps):...
[ "0.73451084", "0.7069381", "0.69564855", "0.6894689", "0.68848574", "0.68810326", "0.6771471", "0.67523175", "0.66436225", "0.65703744", "0.6535196", "0.6523617", "0.64791125", "0.647577", "0.64482796", "0.6446289", "0.6442313", "0.6434945", "0.6431381", "0.64138424", "0.6407...
0.73760986
1
Returns iterator of messages grouped by the measurement cycles and optionally filtered only to message types contained in msg_type_filter.
def split_to_cycles(self, msg_type_filter = None, separation = 0.5): ids = {msg_type.get_message_id() for msg_type in msg_type_filter} if not len(ids): class _Everything: def __contains__(self, x): return True ids = _Everything() out...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filtered_messages(self, msg_type_set):\n ids = {msg_type.get_message_id() for msg_type in msg_type_set}\n\n while True:\n data = self._read_binary_sirf_msg()\n if sirf.bytes_to_message_id(data) in ids:\n yield sirf.from_bytes(data)", "def get_messages(self, ...
[ "0.6737803", "0.6204259", "0.6064057", "0.5966157", "0.53918743", "0.5379674", "0.5314918", "0.5045594", "0.50421774", "0.50251156", "0.5012376", "0.49756777", "0.49635535", "0.49518022", "0.4921953", "0.48644638", "0.47993279", "0.47966844", "0.4779402", "0.47647852", "0.476...
0.66525537
1
Return ``where.what`` if what is a string, otherwise what. If not found return ``default``.
def lookup(what, where, default=None): if isinstance(what, (str, unicode)): res = getattr(where, what, default) else: res = what return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def where(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"where\")", "def where(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"where\")", "def where(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"where\")", "def lookup_some_key(what...
[ "0.6415061", "0.6415061", "0.6415061", "0.6336832", "0.543057", "0.5341372", "0.511425", "0.50902086", "0.50859106", "0.5032432", "0.50301087", "0.49420592", "0.49362037", "0.49033552", "0.48405737", "0.4834364", "0.48031318", "0.48022807", "0.4783544", "0.47298265", "0.46809...
0.75953984
0
Return True iff no random number generator is in the expression graph.
def tell_deterministic(expr): return all(not hasattr(i, 'rng') for i in theano_expr_bfs(expr))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasgenerator(self):\n\t\treturn self.G is not None", "def test_rng_null(self):\n assert check_random_state(None) is np.random.mtrand._rand", "def is_nilpotent(self):\n if self._is_nilpotent is None:\n lcs = self.lower_central_series()\n terminator = lcs[len(lcs) - 1]\n ...
[ "0.71576804", "0.6580397", "0.6067666", "0.60196996", "0.601217", "0.6007414", "0.60046226", "0.5999951", "0.5946895", "0.5847713", "0.5829946", "0.58241254", "0.582219", "0.5817676", "0.5757262", "0.5743055", "0.5704075", "0.5674279", "0.5643369", "0.5616959", "0.5601564", ...
0.64591485
2
Tell whether the GPU is used the expressions contain a random number generator.
def _gpu_and_random(self, exprs): if not GPU: return False if not all(tell_deterministic(i) for i in exprs): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confused(self, rand):\n return rand > 0", "def _rand_bool(self):\n\n return (self.np_random.randint(0, 2) == 0)", "def __bool__(self) -> bool:\n return bool(mpmath.rand() < self.p)", "def hasgenerator(self):\n\t\treturn self.G is not None", "def is_rng_supported_mesh(device_mesh: D...
[ "0.6627339", "0.64854485", "0.6369258", "0.63469464", "0.63330257", "0.6227965", "0.6219852", "0.61940414", "0.61727303", "0.6166643", "0.6158665", "0.60086614", "0.60005575", "0.59789973", "0.59789973", "0.5976261", "0.59707564", "0.5950311", "0.594951", "0.5921565", "0.5910...
0.72048575
0
Returns a list of all event attributes contained in the event log.
def get_event_attributes_from_log(log): all_attributes = set() for trace in log: for event in trace: all_attributes = all_attributes.union(set(event.keys())) if xes.DEFAULT_TRANSITION_KEY in all_attributes: all_attributes.remove(xes.DEFAULT_TRANSITION_KEY) return all_attribut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attributes(self):\n\t\tcontents = self.archive.read_file('replay.attributes.events')\n\t\treturn self.protocol.decode_replay_attributes_events(contents)", "def get_attribute_list(self):\n attributes = [attr for attr in vars(self.entries[0]) if not attr.startswith('__')]\n return attributes"...
[ "0.746077", "0.72133046", "0.7004512", "0.69490683", "0.6913372", "0.6901872", "0.67657006", "0.66290164", "0.66094077", "0.6592866", "0.6589549", "0.6574144", "0.64446974", "0.6431033", "0.64172983", "0.64172983", "0.63521177", "0.6327336", "0.63147974", "0.6306192", "0.6301...
0.7417443
1
Creates a dictionary containing the vertex as key and the community as value
def create_community_dict(partition, graph): it = 0 communities = dict() for part in partition: for vertex in part: communities[graph.vs[vertex]['name']] = it it += 1 return communities
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GraphToCommunities(Network):\n comm=community.best_partition(Network)\n clusters={}\n for k in comm.keys():\n if clusters.has_key(comm[k])==False:\n clusters[comm[k]]=[]\n clusters[comm[k]].append(k)\n return (clusters)", "def detection_algorithm(G, edge_weight):\n Gc ...
[ "0.65812737", "0.62105423", "0.6099021", "0.60787535", "0.6006192", "0.6005821", "0.59781283", "0.5938694", "0.59242696", "0.59075904", "0.5843778", "0.5787999", "0.5787999", "0.5781617", "0.577084", "0.5768384", "0.572773", "0.57173073", "0.5709551", "0.5671555", "0.56556576...
0.7483303
0
Returns the indexes of the given vertices from the given graph.
def index_vertices(vertexlist, graph): return_list = list() for vertex in vertexlist: return_list.append(graph.vs.find(name=vertex).index) return return_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVertexNumbers(self):\n return self.vertexIndex.keys()", "def get_vertices(self):\n return self.graph.keys()", "def vertices(self):\n return list(self.graph_dict.keys())", "def get_indegrees(graph: Graph):\n transpose = get_transpose_graph(graph)\n return {node: len(target_no...
[ "0.6446575", "0.6367212", "0.6239323", "0.6229624", "0.61724275", "0.61724275", "0.61724275", "0.61515236", "0.61401576", "0.61344594", "0.6110107", "0.61056256", "0.608297", "0.6053884", "0.60248345", "0.60184854", "0.5995186", "0.59604424", "0.59458923", "0.58988535", "0.58...
0.7804827
0
Returns the predecessors of a given vertex in a given graph.
def get_predecessors(vertex, graph): predecessors = list() predecessors.extend(graph.predecessors(vertex)) return predecessors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_predecessors_successors(vertex, graph):\n overlaps = list()\n pre = get_unique_predecessors(vertex, graph)\n suc = get_unique_successors(vertex, graph)\n overlaps.extend(pre)\n overlaps.extend(suc)\n return overlaps", "def get_unique_predecessors(vertex, graph):\n pre_nodes_in_stage_...
[ "0.806123", "0.77842414", "0.74437", "0.73195046", "0.65637344", "0.6540712", "0.6446052", "0.6390165", "0.6365159", "0.6259706", "0.61728483", "0.6120901", "0.6120901", "0.61105984", "0.61001766", "0.5786239", "0.5751069", "0.5725038", "0.57102966", "0.5709853", "0.56923467"...
0.9146434
0
Returns predecessors of the given vertex in the given graph without duplicates.
def get_unique_predecessors(vertex, graph): pre_nodes_in_stage_i = get_predecessors(vertex, graph) return remove_duplicates(pre_nodes_in_stage_i)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_predecessors(vertex, graph):\n predecessors = list()\n predecessors.extend(graph.predecessors(vertex))\n return predecessors", "def get_unique_predecessors_successors(vertex, graph):\n overlaps = get_predecessors_successors(vertex, graph)\n ov_unique = remove_duplicates(overlaps)\n retu...
[ "0.87187177", "0.8165456", "0.8149547", "0.7427294", "0.6508126", "0.6421867", "0.6364554", "0.6330967", "0.6316748", "0.62334824", "0.6086964", "0.60284495", "0.59789884", "0.5977539", "0.5917957", "0.5909005", "0.5909005", "0.5879948", "0.582027", "0.58033466", "0.57526076"...
0.8658347
1
Returns successors of the given vertex in the given graph without duplicates.
def get_unique_successors(vertex, graph): suc_nudes_in_stage_i = get_successors(vertex, graph) return remove_duplicates(suc_nudes_in_stage_i)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_unique_predecessors_successors(vertex, graph):\n overlaps = get_predecessors_successors(vertex, graph)\n ov_unique = remove_duplicates(overlaps)\n return ov_unique", "def get_successors(vertex, graph):\n successors = list()\n successors.extend(graph.successors(vertex))\n return successo...
[ "0.8226712", "0.7994284", "0.7959788", "0.75695074", "0.68749374", "0.63759154", "0.6168715", "0.5944003", "0.5920547", "0.5785456", "0.5785456", "0.5768317", "0.5761811", "0.57175255", "0.5677555", "0.565443", "0.56330574", "0.56279504", "0.5600078", "0.5592701", "0.55904555...
0.8220229
1
Returns number of predecessors without duplicates of a list of vertices.
def get_number_of_unique_predecessors(partition, graph): pre_unique = get_unique_predecessors(partition, graph) return len(pre_unique)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_unique_predecessors(vertex, graph):\n pre_nodes_in_stage_i = get_predecessors(vertex, graph)\n return remove_duplicates(pre_nodes_in_stage_i)", "def get_unique_predecessors_successors(vertex, graph):\n overlaps = get_predecessors_successors(vertex, graph)\n ov_unique = remove_duplicates(overl...
[ "0.71033764", "0.7049059", "0.66558254", "0.6518772", "0.61019313", "0.6039541", "0.5931119", "0.58703786", "0.5694572", "0.56722516", "0.5659231", "0.5638852", "0.55846834", "0.5548406", "0.55438334", "0.5535065", "0.55244005", "0.55197936", "0.55078554", "0.5486019", "0.548...
0.7379798
0
Returns number of successors without duplicates of a list of vertices.
def get_number_of_unique_successors(partition, graph): suc_unique = get_unique_successors(partition, graph) return len(suc_unique)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_unique_predecessors_successors(vertex, graph):\n overlaps = get_predecessors_successors(vertex, graph)\n ov_unique = remove_duplicates(overlaps)\n return ov_unique", "def find_nodes(shp):\n node_count = {}\n for road in shp:\n vrts = road.vertices\n for node in vrts:\n ...
[ "0.6819421", "0.6795083", "0.6782132", "0.6543408", "0.6223553", "0.6134625", "0.6132226", "0.6061797", "0.5908543", "0.58610505", "0.5837381", "0.5828296", "0.57509124", "0.5745887", "0.57270896", "0.56933117", "0.56714433", "0.56582665", "0.5652493", "0.56388247", "0.561313...
0.6632147
3
Returns the ground truth which was previously stored in the event log in form of a list.
def get_ground_truth_list(vertices, graph, log): vertices = index_vertices(vertices, graph) vertices.sort() cluster = 0 ground_truth = list() for vertex in vertices: v_name = graph.vs[vertex]['name'] for trace in log: for event in trace: if v_name == event...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ground_truth():\n\n true_ps, obs_xs = util.io.load(os.path.join(get_root(), 'observed_data'))\n return true_ps, obs_xs", "def identify_ground_truth(log, log_name):\n if \"BPI2015\" in log_name:\n for trace in log:\n for event in trace:\n if \"AH_I\" in str(event[...
[ "0.604325", "0.59866893", "0.57737994", "0.5587313", "0.5451896", "0.5451896", "0.53235906", "0.52571344", "0.52475417", "0.52147037", "0.51765037", "0.51684606", "0.5151448", "0.5106017", "0.5090211", "0.5087137", "0.50747967", "0.507089", "0.50303286", "0.5025124", "0.50148...
0.5524604
4
Removes all duplicate values from a given list.
def remove_duplicates(input_list): return list(dict.fromkeys(input_list))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeDuplicates(list):\n\treturn set((item for item in list))", "def removeDuplicates(list):\n\treturn Set((item for item in list))", "def remove_identical(list):\n seen = set()\n seen_add = seen.add\n return [x for x in list if not (x in seen or seen_add(x))]", "def remove_duplicates(self,list...
[ "0.8336709", "0.826821", "0.8150454", "0.80406576", "0.802781", "0.80032706", "0.79544246", "0.7945618", "0.7895204", "0.78379214", "0.76465863", "0.7623023", "0.7575355", "0.7561104", "0.7540737", "0.75282013", "0.7494512", "0.74540263", "0.7428581", "0.74073255", "0.7360262...
0.7505978
16
Calculates the number of duplicates in a list.
def get_number_of_duplicates(input_list): return len(get_duplicates(input_list))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_duplicates(lst):\n \"*** YOUR CODE HERE ***\"\n return len( set(lst) ) != len(lst)", "def duplicated(list):\n u, c = np.unique(list, return_counts=True)\n dup = u[c > 1]\n return dup", "def count_unique(list):\n if len(list) == 0:\n return 0\n list.sort()\n check = list[...
[ "0.7252366", "0.713093", "0.7118927", "0.69232243", "0.69068164", "0.6904737", "0.68823004", "0.66992265", "0.6589638", "0.6568231", "0.6567865", "0.6489665", "0.6489665", "0.64618355", "0.6451086", "0.64076555", "0.64052474", "0.6326561", "0.6325014", "0.63164437", "0.630132...
0.8687196
0
Returns the number of overlaps of all nodes of a list of vertices. If a vertex shares a successor or a predecessor with an other vertex. This is referred to as overlap.
def get_number_of_overlaps(partition, graph): n_overlaps = 0 for vertex in partition: vertex_pre_suc = get_unique_predecessors_successors(vertex, graph) for v in partition: if not v == vertex: v_pre_suc = get_unique_predecessors_successors(v, graph) ov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersection_count(G=None, min_streets=2):\n spn = streets_per_node(G)\n node_ids = set(G.nodes)\n return sum(count >= min_streets and node in node_ids for node, count in spn.items())", "def overlap(g, node_1, node_2):\n inter = len(set(nx.neighbors(g, node_1)).intersection(set(nx.neighbors(g, no...
[ "0.632698", "0.6192305", "0.5782844", "0.57001", "0.5686309", "0.5595151", "0.54400545", "0.5407103", "0.5383124", "0.5378499", "0.53691816", "0.5365793", "0.5354652", "0.5290653", "0.52573913", "0.5256262", "0.5251728", "0.52229923", "0.52115047", "0.52058464", "0.51884466",...
0.6774935
0
Test a property without a valid config
def test_test_empty_config(): testutils.deploy_config_raw("") assert prop.test_prop('info', 'sdk') == 0 testutils.undeploy() return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_property_missing(self):\r\n try:\r\n value = self.config.option2\r\n assert value\r\n except Exception as e:\r\n self.assertIsInstance(e, OptionValueNotSetError)\r\n self.assertNotIn('option2', self.config.values)", "def check_property(self, ...
[ "0.76737714", "0.74934083", "0.7118994", "0.7084105", "0.6979936", "0.6879754", "0.6873085", "0.6637735", "0.65712166", "0.6535024", "0.65199155", "0.6511954", "0.65031713", "0.6457611", "0.6447513", "0.64017653", "0.6392188", "0.6386049", "0.6334654", "0.63151515", "0.631198...
0.0
-1
Convenience method to compute the model end to end.
def model(self, conjectures, axioms): with self.graph.as_default(): conjecture_embeddings = self.conjecture_embedding(conjectures) axiom_embeddings = self.axiom_embedding(axioms) predictions = self.classifier(conjecture_embeddings, axiom_embeddings) return predictions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_end_date(self):\n return self._model_end_date", "def compute_end_point(self):\n\n L = self.level\n P = L.prob\n\n # check if Mth node is equal to right point and do_coll_update is false, perform a simple copy\n if self.coll.right_is_node and not self.params.do_coll_up...
[ "0.58199894", "0.57721406", "0.56079286", "0.5605094", "0.5569777", "0.5565", "0.5546848", "0.5497238", "0.5478168", "0.54534566", "0.5451045", "0.5449872", "0.54350275", "0.5426526", "0.5400152", "0.5370089", "0.53650665", "0.53181344", "0.53021705", "0.5294778", "0.526827",...
0.0
-1
Reshape N > 2 rank tensor to rank 2 tensor for performance.
def reshape_to_matrix(self, input_tensor): ndims = input_tensor.shape.ndims if ndims < 2: raise ValueError("Input tensor must have at least rank 2." "Shape = %s" % (input_tensor.shape)) if ndims == 2: return input_tensor width = input_tensor.shape[-1] output_tenso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_last_dimension(x, n):\r\n old_shape = x.get_shape().dims\r\n last = old_shape[-1]\r\n new_shape = old_shape[:-1] + [n] + [last // n if last else None]\r\n ret = tf.reshape(x, tf.concat([tf.shape(x)[:-1], [n, -1]], 0))\r\n ret.set_shape(new_shape)\r\n return tf.transpose(ret,[0,2,1,3])",...
[ "0.6565812", "0.6553982", "0.64864945", "0.638766", "0.6327924", "0.61469126", "0.61469126", "0.61153495", "0.61153495", "0.61153495", "0.61077964", "0.6072167", "0.6071448", "0.605981", "0.6039191", "0.5978247", "0.5950206", "0.5903502", "0.5839912", "0.5833875", "0.5832991"...
0.5451794
57
Creates an optimizer with learning rate schedule.
def create_optimizer(init_lr, num_train_steps, num_warmup_steps): # Implements linear decay of the learning rate. learning_rate_fn = tf.keras.optimizers.schedules.PolynomialDecay( initial_learning_rate=init_lr, decay_steps=num_train_steps, end_learning_rate=0.0) if num_warmup_steps: learning...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _inst_optimizer(self):\n optimizer = Optimizers(self.m_cfg['configs']['lr_politics']['optimizer']).value\n lr_schedule = self.m_cfg['configs']['lr_politics']['lr']\n opt = optimizer(learning_rate=lr_schedule)\n return opt", "def build_optimizer(\n self, lr: Union[tf.keras.opt...
[ "0.7830851", "0.7798416", "0.76002425", "0.730958", "0.7308127", "0.7271429", "0.7257552", "0.72381526", "0.72161627", "0.7169744", "0.71036613", "0.7084344", "0.7020992", "0.7002498", "0.69841987", "0.6983344", "0.69699043", "0.6965906", "0.69600046", "0.69541574", "0.693480...
0.817968
0
Overrides the default .create() method so that if no user is specified in kwargs, this factory will create a user with an associated profile without relying on signals.
def create(cls, **kwargs): if "user" not in kwargs: with mute_signals(post_save): profile = ProfileFactory.create() kwargs["user"] = profile.user return super().create(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_user(self, *args, **kwargs):\n user = User.objects.create_user(*args, **kwargs)\n return get_profile(user)", "def create_user_profile(sender, instance, created, **kwargs):\n if created:\n Profile.objects.create(user=instance)", "def create_user_profile(sender, instance, creat...
[ "0.8089046", "0.7710158", "0.7710158", "0.7710158", "0.7702299", "0.7666457", "0.76453215", "0.7593763", "0.7584913", "0.75170654", "0.75133276", "0.7486732", "0.7446116", "0.74153763", "0.73974293", "0.73523927", "0.73032916", "0.7286282", "0.7260729", "0.7249335", "0.723386...
0.89510345
0
Get the action that was taken to get from parent to the state represented by this node.
def action(self): return self._action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_action(self):\n return self.current_action", "def get_previous_action(self) :\n return self.previous_action", "def get_action(self):\n return self.__action", "def _get_action(self):\n return self.__action", "def get_action(self, state):\n\n if self.path:\n ...
[ "0.7150034", "0.7073005", "0.6951777", "0.6825375", "0.67453027", "0.66584265", "0.65716916", "0.6516871", "0.64894974", "0.6410784", "0.63846713", "0.63638216", "0.63428116", "0.63428116", "0.63428116", "0.6283183", "0.6236764", "0.6200211", "0.61490446", "0.6146224", "0.614...
0.68239194
9
Get the action that was taken to get from parent to the state represented by this node.
def orientation(self): return self._orientation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_action(self):\n return self.current_action", "def get_previous_action(self) :\n return self.previous_action", "def get_action(self):\n return self.__action", "def _get_action(self):\n return self.__action", "def action(self):\n return self._action", "def action(self...
[ "0.7148122", "0.70727295", "0.69499516", "0.6823255", "0.6822342", "0.6822342", "0.6822342", "0.6822342", "0.6822342", "0.6822342", "0.67445385", "0.6658467", "0.6570484", "0.6515366", "0.648802", "0.6409777", "0.63824695", "0.6362123", "0.6341662", "0.6341662", "0.6341662", ...
0.0
-1
Get the action that was taken to get from parent to the state represented by this node.
def velocity(self): return self._velocity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_action(self):\n return self.current_action", "def get_previous_action(self) :\n return self.previous_action", "def get_action(self):\n return self.__action", "def _get_action(self):\n return self.__action", "def action(self):\n return self._action", "def action(self...
[ "0.7149977", "0.7072268", "0.69514626", "0.6824404", "0.68235594", "0.68235594", "0.68235594", "0.68235594", "0.68235594", "0.68235594", "0.6745303", "0.66578853", "0.6571686", "0.65160394", "0.6487337", "0.6412602", "0.63837594", "0.63625973", "0.63427436", "0.63427436", "0....
0.0
-1
Adds an edge between node1 and node2. Adds the nodes to the graph first if they don't exist.
def add_edge(self, node1, node2, weight=1.0, bidirectional=True): self.add_node(node1) self.add_node(node2) node1_edges = self._edges.get(node1, set()) node1_edges.add(Edge(node1, node2, weight)) self._edges[node1] = node1_edges if bidirectional: node2_edges =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self,node1,node2):\n # add nodes if not already in graph\n if node1 not in self.nodes():\n self.add_node(node1)\n if node2 not in self.nodes():\n self.add_node(node2)\n\n # make connections to nodes\n self.__graph[node1].append(node2)\n s...
[ "0.8775052", "0.8575885", "0.84401256", "0.8258184", "0.8166692", "0.81011534", "0.80282617", "0.8022696", "0.79394007", "0.78549004", "0.78378713", "0.7791494", "0.776768", "0.77168965", "0.7703608", "0.7693623", "0.7670848", "0.76523453", "0.76485234", "0.7638099", "0.76251...
0.7675281
16
Return the filter query.
def filter_query(self, request, query, view): raise NotImplementedError('.filter_query() must be implemented.') # pragma: no cover
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_query(self):\n q = db.Query(self.KIND,keys_only=self.KEYS_ONLY)\n for prop, value in self.FILTERS:\n q.filter(\"%s =\" % prop, value)\n if self.ancestor:\n q.ancestor(self.ancestor)\n q.order(self.ORDER_BY)\n return q", "def getQuery(self):\n ...
[ "0.76254714", "0.7192404", "0.7117082", "0.7113892", "0.70915204", "0.70519936", "0.6998001", "0.6946083", "0.69361687", "0.68097425", "0.6783083", "0.6775405", "0.6770303", "0.673803", "0.6714327", "0.6711792", "0.664973", "0.66460294", "0.6571933", "0.65532225", "0.65404326...
0.6138882
63
Given the model field and the value to be filtered, this should return the statement to be appended as a filter to the final query.
def build_comparision(self, field, value): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _custom_filter(self, query):\r\n return query", "def add_filter(self, field, lookup_type, negated, value):\r\n if lookup_type not in OPERATORS_MAP:\r\n raise DatabaseError(\"Lookup type %r isn't supported.\" %\r\n lookup_type)\r\n\r\n # GAE does ...
[ "0.66924316", "0.6337971", "0.62232834", "0.6157193", "0.61209303", "0.60536784", "0.60453886", "0.59232634", "0.5861579", "0.5849911", "0.5813545", "0.5809807", "0.5787079", "0.57768816", "0.57611936", "0.5749356", "0.5735346", "0.57132673", "0.57088786", "0.57050323", "0.56...
0.0
-1
There are 2 holidays in the span 1317th of April 2022, so we expect the function to adjust the timedelta by 2 days.
def test_minimum_due_date_with_holidays_before_cutoff(): assert get_minimum_due_date(day_before_easter) == (day_before_easter + timedelta(days=6)).date()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_holiday(date):\n\n holiday_dates = ['09/08/2019', '10/08/2019', '11/08/2019', '12/08/2019',\n '13/08/2019', '14/08/2019', '15/08/2019', '16/08/2019', '17/08/2019',\n '18/08/2019', '19/08/2019', '20/08/2019', '21/08/2019', '22/08/2019',\n ...
[ "0.6736093", "0.61784166", "0.5999844", "0.59617156", "0.59238225", "0.578024", "0.5735175", "0.5718821", "0.56845367", "0.56802404", "0.5663145", "0.56397706", "0.5636869", "0.5608559", "0.5603336", "0.5529013", "0.5503755", "0.5474438", "0.54700947", "0.54691315", "0.544822...
0.5048655
60
Find all the subclasses of a class given its name
def get_subclasses(self, class_name): return class_name.__subclasses__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Subclass_finder(cls):\n\n subclasses = [] # Create a list to deposit subclasses\n\n for subclass in cls.__subclasses__():\n subclasses.append(subclass) # Add founded subclass\n subclasses.extend(Subclass_finder(subclass)) # Check if there is a subclass\n ...
[ "0.7822941", "0.76084644", "0.7541864", "0.73579955", "0.7304116", "0.7218669", "0.7112324", "0.69290173", "0.6900942", "0.6872188", "0.6872188", "0.68304044", "0.6828921", "0.6817411", "0.68095064", "0.678769", "0.6765754", "0.6760897", "0.6754078", "0.6728999", "0.66450757"...
0.7820441
1