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
An interface for adding the tensor outputs of a keras layer. Encapsulates trace_tensor.
def keras_layer_tracepoint(layer, checkpoint_name): try: outputs = layer.output if tensor_util.is_tf_type(outputs): trace_tensor(outputs, '%s' % (checkpoint_name)) else: idx = 0 for output_tensor in outputs: if tensor_util.is_tf_type(outputs): trace_tensor(output_tensor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trace(tensor):\n raise NotImplementedError", "def _add_node(self, input_tensors, output_tensors):\n raise NotImplementedError", "def trace_tensor(tensor, tracepoint_name=None):\n if tracepoint_name is None:\n tracepoint_name = tensor.name\n tensor.graph.get_collection(_TENSOR_TRACER_COLL...
[ "0.67857146", "0.6388953", "0.63715225", "0.6257437", "0.6257437", "0.6228444", "0.62104905", "0.6142885", "0.6114395", "0.60825926", "0.60685295", "0.602036", "0.6011695", "0.5970463", "0.5943941", "0.591428", "0.5906252", "0.59019965", "0.58907664", "0.587499", "0.5870185",...
0.6519989
1
Returns True if TensorTracer is enabled.
def is_enabled(): try: enable = tensor_tracer_flags.TTParameters().is_enabled() # Add metrics to determine API usage. if enable: tt_gauge.get_cell('is_enabled').set(True) return enable except (ValueError, RuntimeError) as e: logging.warning( 'Tensor Tracer V1 flags proces...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trace_enabled(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"trace_enabled\")", "def has_tracing_enabled(options):\n # type: (Dict[str, Any]) -> bool\n\n return bool(\n options.get(\"traces_sample_rate\") is not None\n or options.get(\"traces_sampler\") is not N...
[ "0.7352318", "0.6993896", "0.67367506", "0.6653039", "0.6437213", "0.6221225", "0.60980266", "0.6041605", "0.5997682", "0.59908676", "0.5865279", "0.583192", "0.57753474", "0.5765052", "0.56993747", "0.56993747", "0.56993747", "0.56993747", "0.56993747", "0.56993747", "0.5691...
0.77441347
0
Initializes a TensorTracer. Sets the various member fields from the flags (if given) or the defaults.
def __init__(self): self._replica_id = None self._tt_config = tensor_tracer_report.TensorTracerConfig() self._parameters = tensor_tracer_flags.TTParameters() self._host_call_fn = {} # _cache_variables is a dict (key = graph, value = dicts # (key = name, value = tensors)) self._cache_variable...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_tracing(tracer=None, start_span_cb=None):\n if start_span_cb is not None and not callable(start_span_cb):\n raise ValueError('start_span_cb is not callable')\n\n global _g_tracer, _g_start_span_cb\n if hasattr(tracer, '_tracer'):\n tracer = tracer._tracer\n\n _g_tracer = tracer\n...
[ "0.60568595", "0.60088533", "0.59830976", "0.5968764", "0.58912414", "0.587532", "0.5856739", "0.5849403", "0.58392364", "0.5776628", "0.5775846", "0.5773352", "0.5754781", "0.5748357", "0.57385355", "0.57230204", "0.57172567", "0.5693982", "0.567977", "0.5675176", "0.5672812...
0.6583369
0
Creates a variable as the cache to store intermediate tensor values.
def _create_or_get_tensor_values_cache(self, cache_name, graph, shape=None, dtype=dtypes.float32): if graph is None: raise ValueError('Invalid graph.') graph_cache_var = self._cache_variable_for_graph(graph) if cache_name not in graph_cache_var: if shap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_shared_variable(val):\r\n return tensor_constructor(val)", "def cache(self):\n self.cached_mu = self.mu.eval()\n self.cached_var = self.var.eval()\n self.cached_count = self.count.eval()", "def _create_temp_cache(self, num_traced_tensors, num_signatures, graph):\n init_value...
[ "0.70055306", "0.6747109", "0.66498315", "0.6506411", "0.62963825", "0.6243984", "0.6232762", "0.61714506", "0.61712897", "0.61198336", "0.60760653", "0.6070976", "0.58924294", "0.58900154", "0.57658064", "0.5740284", "0.5729406", "0.5718902", "0.5706372", "0.5702549", "0.570...
0.7105806
0
Returns true if the intermediate values should be stacked instead of being stored in a tf.Variable.
def _use_temp_cache(self): # If full tensors need to be stored tf.variables, then do not use temp # variables to store them. if self._use_tensor_buffer(): return False if self._use_tensor_values_cache(): return self._parameters.use_temp_cache_var else: # Temporary caches only repla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_stack(self) -> bool:\n return self.layers > 1", "def check_if_reduce_needed(vars_to_modify):\n for var in vars_to_modify:\n if len(var.dimensions) > 2 and var[0,0,:].mask.all() and \\\n var[-1,1,:,:].mask.all():\n return True\n return False", "def is_reducin...
[ "0.6048697", "0.5971611", "0.5710397", "0.5619038", "0.5598955", "0.5590325", "0.53867996", "0.53844666", "0.5345319", "0.53421265", "0.53105307", "0.5286167", "0.52738845", "0.5273864", "0.5272531", "0.5256374", "0.52537984", "0.52448654", "0.5216769", "0.51903856", "0.51879...
0.5320932
10
Creates a new tf.Variable and a new tf.Operation that assigns the value of the tensor to this variable.
def _snapshot_tensor(self, tensor): snapshot_variable = self._create_or_get_tensor_values_cache( tensor.name, tensor.op.graph, tensor.shape.as_list(), tensor.dtype) return state_ops.assign(snapshot_variable, tensor).op
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variable(value, dtype, name=None, broadcastable=None):\n return tf.Variable(value, dtype=dtype, name=name)", "def assign(self, other):\n\n assert isinstance(other, VarList)\n assert len(self) == len(other)\n ops = []\n for (my_var, other_var) in zip(self.vars_, other.vars_):\n ops.append(...
[ "0.7086066", "0.65979517", "0.6486898", "0.6359577", "0.6303178", "0.62906426", "0.62873197", "0.62840164", "0.62840164", "0.6103901", "0.60994834", "0.606198", "0.6040132", "0.6025503", "0.60185015", "0.59964055", "0.5975711", "0.5944911", "0.5895868", "0.5891965", "0.588817...
0.59726536
17
Returns true if the op is at the same level with the training loop. Returns false if the op is in an inner while loop or if it is outside of the training loop.
def _is_in_outmost_while_loop(self, op): ctxt = self._get_op_control_flow_context(op) outer_while_context = control_flow_util.GetContainingWhileContext(ctxt) return outer_while_context == control_flow_util.GetContainingWhileContext( self._outmost_context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _in_while_loop(control_flow_node_map, op_name):\n return op_name in control_flow_node_map and \"LoopCond\" in control_flow_node_map[op_name]", "def while_loop_op(op):\n return (control_flow_util.IsLoopSwitch(op) or\n control_flow_util.IsLoopMerge(op) or\n control_flow_util.IsLo...
[ "0.67206365", "0.6643843", "0.610397", "0.60806173", "0.59005386", "0.57906383", "0.5759867", "0.5722015", "0.5584763", "0.5563943", "0.55123514", "0.5496754", "0.54837847", "0.5472309", "0.5446198", "0.5442353", "0.5428745", "0.53709555", "0.5353489", "0.53505546", "0.534481...
0.6994096
0
Creates a temporary cache with the given dimensions. Fills the self._temp_cache_var with num_traced_tensors tf.constant() ops that have shape of [num_signatures].
def _create_temp_cache(self, num_traced_tensors, num_signatures, graph): init_value = constant_op.constant(_COMPACT_TRACE_ENTRY_INIT_VALUE, dtype=dtypes.float32, shape=[num_signatures]) self._temp_cache_var[graph] = [ init_value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_or_get_tensor_values_cache(self, cache_name, graph,\n shape=None, dtype=dtypes.float32):\n if graph is None:\n raise ValueError('Invalid graph.')\n\n graph_cache_var = self._cache_variable_for_graph(graph)\n\n if cache_name not in graph_cache_var:\n...
[ "0.63529843", "0.6059687", "0.56912345", "0.5540874", "0.53828937", "0.52646154", "0.49738878", "0.48838246", "0.48829386", "0.4804552", "0.47643253", "0.4763133", "0.47207418", "0.4718563", "0.47168207", "0.4706097", "0.46977234", "0.4676159", "0.46719626", "0.46638885", "0....
0.7776393
0
Writes the given caches as tensor summary.
def _write_cache(step, event_file_suffix=None, **kwargs): file_suffix = _TT_EVENT_FILE_SUFFIX if event_file_suffix is not None: file_suffix = string_ops.string_join([file_suffix, event_file_suffix], separator='.') # TODO(deveci): Parametrize max_que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_summary(self):\n for k, v in self.metrics.items():\n tf.summary.scalar(k, v)\n \n self.summary_op = tf.summary.merge_all()", "def _inspect_summary_cache(self, cache, replica_id, step_num, output_stream,\n tensor_trace_order):\n def _inspect_tensor(tensor):\n...
[ "0.62373126", "0.6211419", "0.61969113", "0.6189914", "0.6168754", "0.5829025", "0.5809746", "0.5802566", "0.5793453", "0.5787205", "0.57535094", "0.5752002", "0.57258844", "0.5705497", "0.56813705", "0.562398", "0.5612645", "0.5610259", "0.5548419", "0.5537438", "0.55310524"...
0.5770509
10
Get the local path to the query interface Returns str Path to the query interface
def query_interface_path(): import concordancer.server return str(pathlib.Path(concordancer.server.__file__).parents[0] / "dist/index.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saved_query_path(self) -> str:\n return self.join_path(self.rest_api_saved_query.arg)", "def queries_path(tmpdir):\n return Path(tmpdir) / \"queries\"", "def querypath(self, code) -> str:\n return f'{self.scriptpath(code)}/query.php'", "def get_query(self):\r\n\r\n split = self.pa...
[ "0.7560793", "0.72178215", "0.69427603", "0.6552635", "0.65501314", "0.6470023", "0.6345656", "0.62637967", "0.6196307", "0.6196307", "0.61442584", "0.6069796", "0.6050089", "0.6012457", "0.60050875", "0.599463", "0.5990045", "0.5990045", "0.5990045", "0.5990045", "0.5990045"...
0.68800527
3
Compute the sparse least squares update for u per section 3.2.1 of the paper The rhs of the ls problem needs to be recomputed every time since w_0 and w are variables The lhs should be precomputed in advance for computational efficiency
def u_update(eta_0, eta, eta_lin, w_0, w, w_lin, eta_T_H_L_stacked, premultiplied_lhs = None, nnls_max_iter=50): # PREMULTIPLIED LHS IS AN EXTRA ARGUMENT! Set it to None and add solver! """In the following +[[]] and [:-1] are added to keep thing 1dim array of objects and still multiply it elemtwisely""" # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solver(u_init, eta_0, eta, eta_lin, T, H, L_lhs, L_rhs, alpha, gamma, B, D, C, ftol = 1e-3, max_iter = 5000, verbose = 0, nnls_max_iter=30):\n\n # Raise('NotImplementedError: only adjusted the arguments.')\n #Need to incorporate L_lhs into stacked and appropriate w_lin updates, u_update and eta_lin incre...
[ "0.70971364", "0.69212496", "0.67300016", "0.63234544", "0.61302644", "0.60571796", "0.6040179", "0.6027713", "0.60185385", "0.6016433", "0.6011073", "0.5998979", "0.5990436", "0.597067", "0.59691066", "0.5943357", "0.59225035", "0.59133816", "0.58944416", "0.58914286", "0.58...
0.6811894
2
Ensure user is not created with no password.
def test_create_user_with_no_password(self): data = { 'username': 'foobar', 'email': 'foobar@example.com', 'password': '' } response = self.client.post(self.create_url, data, format='json') self.assertEqual(User.objects.count(), 1) self.assertE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_creation_without_password(self, user):\n with pytest.raises(mongoengine.errors.ValidationError):\n user.save()", "def test_dont_create_user(self):\n self.assertFalse(User.objects.exists())", "def test_create_user_invalid_password(self):\r\n print(\"Create user invalid p...
[ "0.7623653", "0.75486773", "0.7176564", "0.7047765", "0.6966404", "0.6900393", "0.6864475", "0.68414086", "0.68090117", "0.67989016", "0.6794892", "0.67774653", "0.67742616", "0.67722416", "0.6758322", "0.67077434", "0.6657933", "0.66565204", "0.66258895", "0.6609708", "0.659...
0.7279704
2
Ensure user is not created if a user with the same username already exists
def test_create_user_with_preexisting_username(self): data = { 'username': 'test_user', 'email': 'test@example.com', 'password': 'testpassword' } response = self.client.post(self.create_url, data, format='json') self.assertEqual(User.objects.count(), 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dont_create_user(self):\n self.assertFalse(User.objects.exists())", "def test_create_user_invalid_username(self):\r\n print(\"Create user invalid username (already taken)\")\r\n u_id = 3\r\n username = \"100\"\r\n password = \"test9999\"\r\n u_type = 1\r\n\r\n ...
[ "0.7600812", "0.7525696", "0.74614483", "0.7457946", "0.74328053", "0.73718536", "0.7238513", "0.72200084", "0.7175557", "0.7166411", "0.71644723", "0.7147632", "0.70900244", "0.7081625", "0.7071533", "0.7071499", "0.7062999", "0.70582616", "0.7036029", "0.7013217", "0.694712...
0.6824656
34
Ensure user is not created with an invalid email
def test_create_user_with_invalid_email(self): data = data = { 'username': 'foobar', 'email': 'testing', 'password': 'testpassword' } response = self.client.post(self.create_url, data, format='json') self.assertEqual(User.objects.count(), 1) se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_private_create_user_without_email(self):\n with pytest.raises(ValueError) as exinfo:\n EmailUser.objects._create_user(None, None, False, False)\n self.assertIn('email must be set', str(exinfo.value))", "def test_create_use_with_invalid_email(self):\n with self.assertRaise...
[ "0.8287806", "0.8175898", "0.8170805", "0.81610084", "0.81512934", "0.81358635", "0.8127811", "0.8127281", "0.8103175", "0.81016153", "0.80948347", "0.8093309", "0.80913407", "0.80913407", "0.80913407", "0.80913407", "0.80913407", "0.80659455", "0.80529404", "0.8036108", "0.7...
0.74769104
28
Ensure user is not created without an email
def test_create_user_with_no_email(self): data = data = { 'username': 'foobar', 'email': '', 'password': 'testpassword' } response = self.client.post(self.create_url, data, format='json') self.assertEqual(User.objects.count(), 1) self.assertEqu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_private_create_user_without_email(self):\n with pytest.raises(ValueError) as exinfo:\n EmailUser.objects._create_user(None, None, False, False)\n self.assertIn('email must be set', str(exinfo.value))", "def test_user_creation_no_email(self):\n self.registration_profile.ob...
[ "0.809932", "0.7832809", "0.7743485", "0.77125674", "0.7619968", "0.74492943", "0.7448719", "0.7404325", "0.73889196", "0.7387381", "0.73864526", "0.7383292", "0.7375014", "0.73642695", "0.73576325", "0.73576325", "0.73576325", "0.73576325", "0.73576325", "0.73542297", "0.733...
0.72434855
29
Ensure we cannot authenticate a user if we are given a blank username
def test_authenticate_user_with_no_username(self): data = { 'username': '', 'password': 'testpassword' } response = self.client.post(self.authenticate_url, data, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_auth_none(self, username):\n return AUTH_FAILED", "def test_auth_user_fail_bad_username(self):\n\n self.assertFalse(User.authenticate(\"invalid\", \"allison\"))", "def validate_username(self, username):\n user = User.query.filter_by(username=username.data).first()\n if use...
[ "0.837919", "0.8134554", "0.75647277", "0.74679124", "0.73858154", "0.73339015", "0.73185027", "0.72769094", "0.71925473", "0.7115826", "0.7096848", "0.7085231", "0.70651865", "0.70624185", "0.706138", "0.704638", "0.7003717", "0.6948561", "0.69125056", "0.6872944", "0.684412...
0.7024288
16
Ensure we cannot authenticate a user if we are given a blank password
def test_authenticate_user_with_no_password(self): data = { 'username': 'test_user', 'password': '' } response = self.client.post(self.authenticate_url, data, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_auth_user_fail_bad_password(self):\n\n self.assertFalse(User.authenticate(self.user1.username, \"invalid\"))", "def test_auth_user_fail_bad_username(self):\n\n self.assertFalse(User.authenticate(\"invalid\", \"allison\"))", "def test_login_with_bad_password(self):\n resp = self.cl...
[ "0.7693631", "0.7543654", "0.7408975", "0.73944926", "0.7305289", "0.72950023", "0.7291412", "0.7282313", "0.72413546", "0.72387516", "0.7231195", "0.7209531", "0.72035354", "0.7202927", "0.71617824", "0.7135228", "0.7082839", "0.70537686", "0.7052462", "0.7047135", "0.701559...
0.7233731
10
Ensure we cannot authenticate a user if we are given an incorrect username
def test_authenticate_user_with_incorrect_username(self): data = { 'username': 'test_user_2', 'password': 'testpassword' } response = self.client.post(self.authenticate_url, data, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_auth_user_fail_bad_username(self):\n\n self.assertFalse(User.authenticate(\"invalid\", \"allison\"))", "def check_auth_none(self, username):\n return AUTH_FAILED", "def test_user_authenticate_invalid_username(self):\n\n user = User.authenticate(\"wrong_username\", \"password\")\n\...
[ "0.85252064", "0.80036956", "0.78180283", "0.7404895", "0.73670876", "0.7276735", "0.7235713", "0.7098317", "0.70515686", "0.70403093", "0.70128584", "0.69934356", "0.69871634", "0.69377285", "0.6930042", "0.69232506", "0.6903995", "0.6876713", "0.685478", "0.68443984", "0.68...
0.7354706
5
Ensure we cannot authenticate a user if we are given an incorrect username
def test_authenticate_user_with_incorrect_password(self): data = { 'username': 'test_user', 'password': 'testpassword_2' } response = self.client.post(self.authenticate_url, data, format='json') self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_auth_user_fail_bad_username(self):\n\n self.assertFalse(User.authenticate(\"invalid\", \"allison\"))", "def check_auth_none(self, username):\n return AUTH_FAILED", "def test_user_authenticate_invalid_username(self):\n\n user = User.authenticate(\"wrong_username\", \"password\")\n\...
[ "0.85252064", "0.80036956", "0.78180283", "0.7404895", "0.73670876", "0.7354706", "0.7276735", "0.7235713", "0.7098317", "0.70515686", "0.70403093", "0.70128584", "0.69934356", "0.69871634", "0.69377285", "0.6930042", "0.69232506", "0.6903995", "0.6876713", "0.685478", "0.684...
0.0
-1
find all variable definitions.
def find_variabledefs(self, node): #- gives variable definitions. if clang.cindex.Cursor_is_def(node): if node.kind == clang.cindex.CursorKind.VAR_DECL or node.kind == clang.cindex.CursorKind.PARM_DECL or node.kind == clang.cindex.CursorKind.STRUCT_DECL or node.kind == clang.cindex.CursorKind.UNIO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variables_declared (self) :\r\n\t\tresult = {}\r\n\r\n\t\tfor var in self.variables :\r\n\t\t\tresult[var.name.upper()] = var\r\n\t\t\r\n\t\treturn result", "def variables(self):\n return {u for u in self if u.type == 'var'}", "def get_all_variables(self):\n return []", "def variables_decla...
[ "0.7008761", "0.6826084", "0.6737132", "0.66949856", "0.6689962", "0.665618", "0.6632569", "0.66054916", "0.65854424", "0.65536", "0.6469792", "0.64125735", "0.63931966", "0.62532175", "0.62504715", "0.6159233", "0.614085", "0.61167824", "0.60921293", "0.60829693", "0.6076479...
0.7513789
0
find all variable references.
def find_variablerefs(self, node, parent, userdata): #- get all variable references/used #if node.kind.is_reference(): #if node.kind.is_statement() : #if (not node.kind.is_invalid()) and (not clang.cindex.Cursor_displayname(node) == "") and (not node.kind == clang.cindex.CursorKind.VAR_DECL) and...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variables_referenced(text):\n return set(substitution_pattern.findall(text))", "def __get_references(self):\n named_references = []\n for usage in self.xml_cache.get_xml_tree(\"usagemodel\"):\n variable_usages = usage.findall(\".//namedReference__VariableUsage\")\n for ...
[ "0.70831215", "0.68738055", "0.68206716", "0.64130825", "0.6260108", "0.6224151", "0.62091905", "0.6183214", "0.6179734", "0.6143947", "0.6068276", "0.6035985", "0.59923255", "0.598996", "0.5983211", "0.59772897", "0.59245044", "0.5911925", "0.5829187", "0.58259785", "0.57860...
0.7058895
1
Function that takes a numpy 1D array of [lat, lon] and returns the distance to the coast
def getDistanceToCoast(self, longitudeArray, latitudeArray): # Generate the map indexes longIdx = np.zeros(longitudeArray.size) latIdx = np.zeros(latitudeArray.size) it = np.nditer([longitudeArray, latitudeArray, None, None]) for longitude, latitude, longIdx, la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def curvilinear_distance(lon: np.ndarray, lat: np.ndarray,\n radius: float) -> np.ndarray:\n lat1 = np.radians(lat[0:-1])\n lat2 = np.radians(lat[1:])\n dlon = np.radians(np.diff(lon))\n\n distance = np.zeros_like(lon)\n distance[1:] = np.arccos(\n np.sin(lat1) * np.si...
[ "0.62877554", "0.5602629", "0.55377555", "0.54176754", "0.54111797", "0.54077476", "0.5403657", "0.5402054", "0.5398642", "0.53956836", "0.53947115", "0.53855157", "0.5332569", "0.532302", "0.5319578", "0.53186566", "0.5315231", "0.5314175", "0.53038937", "0.5287257", "0.5286...
0.739904
0
Convert coordinates of box from format (center x, center y, width, height) to format (x1, y1, x2, y2) where xy1=topleft, xy2=bottomright
def xmymwh2xyxy(coords: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]: new_coords = coords.clone() if isinstance(coords, torch.Tensor) else coords.copy() new_coords[:, 0] = coords[:, 0] - coords[:, 2] / 2 # top left x new_coords[:, 1] = coords[:, 1] - coords[:, 3] / 2 # t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert(size, box):\n # TODO rewrite box to be [TL, BR] coordinates\n #pdb.set_trace()\n dw = 1./size[0]\n dh = 1./size[1]\n x = (box[0] + box[1])/2.0\n y = (box[2] + box[3])/2.0\n w = box[1] - box[0]\n h = box[3] - box[2]\n x = x*dw\n w = w*dw\n y = y*dh\n h = h*dh\n ret...
[ "0.741545", "0.7392813", "0.7284722", "0.7190906", "0.7182979", "0.7154211", "0.7123096", "0.71174866", "0.70556617", "0.70417756", "0.69756097", "0.6871905", "0.68521637", "0.68361527", "0.68091464", "0.68086463", "0.67906094", "0.6731699", "0.67304313", "0.67274034", "0.669...
0.0
-1
Convert nx4 boxes coordinates from xyxy format to xmymwh format. (x1, y1, x2, y2) where xy1=topleft, xy2=bottomright (xm, ym, w, h) xcenter ycenter, width, height.
def xyxy2xmymwh(coords:Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]: new_coords = coords.clone() if isinstance(coords, torch.Tensor) else coords.copy() new_coords[:, 0] = (coords[:, 0] + coords[:, 2]) / 2 # x center new_coords[:, 1] = (coords[:, 1] + coords[:, 3]) / 2 # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xywh_to_xyxy(boxes: np.array) -> np.array:\n boxes[..., 0] = boxes[..., 0] - boxes[..., 2]/2\n boxes[..., 1] = boxes[..., 1] - boxes[..., 3]/2\n boxes[..., 2] = boxes[..., 0] + boxes[..., 2]\n boxes[..., 3] = boxes[..., 1] + boxes[..., 3]\n return boxes", "def xywh_xyxy(boxes):\n bbox = np....
[ "0.72790796", "0.72380066", "0.70485616", "0.69318014", "0.6900929", "0.683451", "0.67552704", "0.66656977", "0.66656196", "0.65630454", "0.6550723", "0.64708453", "0.6383549", "0.63413745", "0.6299441", "0.62793684", "0.624992", "0.6157106", "0.6126333", "0.6105238", "0.6066...
0.64998883
11
Returns a tuple that is the [lower, upper) bounds of this bucket. The lower bound of the first bucket is Infinity, and the upper bound of the last bucket is +Infinity.
def bucket_boundaries(self, bucket): if bucket < 0 or bucket >= self.total_buckets: raise IndexError('bucket %d out of range' % bucket) if bucket == self.total_buckets - 1: return (self._lower_bounds[bucket], float('Inf')) return (self._lower_bounds[bucket], self._lower_bounds[bucket + 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_bucket_boundaries(self):\n\n lower = self._lower_bounds[0]\n for i in xrange(1, self.total_buckets):\n upper = self._lower_bounds[i]\n yield (lower, upper)\n lower = upper\n\n yield (lower, float('Inf'))", "def get_bounds(self):\r\n left, bottom, front = 10000, 10000, 10000\r\...
[ "0.8170204", "0.72578526", "0.7065659", "0.7021958", "0.69613093", "0.68987477", "0.6888175", "0.68696576", "0.6862277", "0.6831296", "0.6825643", "0.677113", "0.6686822", "0.6675468", "0.66671413", "0.66648155", "0.6624111", "0.6610917", "0.66108996", "0.65763694", "0.657167...
0.82785773
0
Generator that produces the [lower, upper) bounds of all buckets.
def all_bucket_boundaries(self): lower = self._lower_bounds[0] for i in xrange(1, self.total_buckets): upper = self._lower_bounds[i] yield (lower, upper) lower = upper yield (lower, float('Inf'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bucket_boundaries(self, bucket):\n\n if bucket < 0 or bucket >= self.total_buckets:\n raise IndexError('bucket %d out of range' % bucket)\n if bucket == self.total_buckets - 1:\n return (self._lower_bounds[bucket], float('Inf'))\n return (self._lower_bounds[bucket], self._lower_bounds[bucket...
[ "0.7573677", "0.73628", "0.6909603", "0.68796027", "0.68222916", "0.6327313", "0.6302399", "0.62847596", "0.62519956", "0.6121042", "0.6089689", "0.6057429", "0.6056241", "0.6044407", "0.60231084", "0.5976366", "0.5970544", "0.59474784", "0.5943578", "0.5915982", "0.58931535"...
0.87313205
0
takes the dot product of the vector and another vector
def dot(self, other): if self.shape != other.shape: raise ShapeException() else: return sum([self.values[index] * other.values[index] for index in range(len(self.values))])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector_dot(v1,v2):\n return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z)", "def dot(vector1, vector2):\n return sum(a1 * a2 for a1, a2 in zip(vector1, vector2))", "def vec_dot(v1,v2):\r\n \r\n return np.dot(v1,v2)", "def dot(a, b):\n\n if len(a) != len(b):\n raise Exception...
[ "0.87325376", "0.86952156", "0.84879315", "0.84399253", "0.8425274", "0.83896273", "0.8377463", "0.8363828", "0.8357046", "0.83329153", "0.8285499", "0.8279161", "0.82709223", "0.826449", "0.825345", "0.82238436", "0.81963176", "0.81900704", "0.817703", "0.81731206", "0.81713...
0.0
-1
Returns the magnitude of the vector
def mag(self): return math.sqrt(sum([coefficient ** 2 for coefficient in self.values]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magnitude(self): # @todo @caution check: something wrong?\n\n return (math.sqrt(reduce(lambda x, y: x+y,\n [x**2 for x in self.vector])))", "def magnitude(vector):\n return math.sqrt(sum_of_squares(vector))", "def magnitude(v: Vector) -> float:\n return math.sqrt(sum_of_squares(...
[ "0.8607332", "0.83465797", "0.8337714", "0.8268874", "0.8267131", "0.8244777", "0.8046047", "0.803577", "0.791312", "0.7877694", "0.7852275", "0.7811192", "0.77554786", "0.76608247", "0.76422673", "0.76422673", "0.7610301", "0.7584126", "0.75666547", "0.75289005", "0.7493118"...
0.68726724
34
Creates new instances from dictionary.
def FromDict(raw_config, factory): c = Config() c.raw_config = raw_config c.base_directory = raw_config["base_directory"] c.scratch_directory = raw_config["scratch_directory"] sections = ["resources"] for section in sections: section_list = getattr(c, section) LoadSectionLi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(cls, dictionary):\n return cls(**dictionary)", "def create(cls, dictionary):\n return cls(**dictionary)", "def from_dict(cls, dictionary):\n instance = cls()\n for key, value in dictionary.items():\n instance.__dict__[key] = value\n\n return instance", ...
[ "0.7975714", "0.7975714", "0.755238", "0.7451603", "0.7370652", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.736379", "0.7...
0.0
-1
Type of the monitoring job.
def monitoring_type(cls): return "ModelBias"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_type(self):\n return self._job_type", "def job_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"job_type\")", "def type(self) -> Optional[pulumi.Input['JobType']]:\n return pulumi.get(self, \"type\")", "def job_details_type(self) -> str:\n return pulumi.get(se...
[ "0.79452276", "0.7710846", "0.7402716", "0.7004238", "0.7004238", "0.7004238", "0.6752077", "0.6486656", "0.62885904", "0.62340164", "0.6185555", "0.6114646", "0.6076853", "0.60511374", "0.60511374", "0.60511374", "0.60511374", "0.60511374", "0.60511374", "0.60511374", "0.605...
0.0
-1
Sets this object's schedule name to the name provided. This allows subsequent describe_schedule or list_executions calls to point to the given schedule.
def attach(cls, monitor_schedule_name, sagemaker_session=None): sagemaker_session = sagemaker_session or Session() schedule_desc = sagemaker_session.describe_monitoring_schedule( monitoring_schedule_name=monitor_schedule_name ) monitoring_type = schedule_desc["MonitoringSched...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_name(self, schedule_name):\n\n self._schedule_name = schedule_name", "def set_schedule(self, schedule_name):\n url = 'schedules'\n options = '?query={}'.format(schedule_name.replace(' ', '%'))\n schedule_definition = self._pagerduty_session_get(url, options).json()\n\n ...
[ "0.88192904", "0.7999869", "0.7830659", "0.7159031", "0.70395786", "0.69394153", "0.69394153", "0.653065", "0.6498086", "0.64289886", "0.6303668", "0.6217492", "0.61572874", "0.61572874", "0.6145142", "0.6125495", "0.6119232", "0.60983247", "0.6076833", "0.60676503", "0.60671...
0.0
-1
Type of the monitoring job.
def monitoring_type(cls): return "ModelExplainability"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_type(self):\n return self._job_type", "def job_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"job_type\")", "def type(self) -> Optional[pulumi.Input['JobType']]:\n return pulumi.get(self, \"type\")", "def job_details_type(self) -> str:\n return pulumi.get(se...
[ "0.79452276", "0.7710846", "0.7402716", "0.7004238", "0.7004238", "0.7004238", "0.6752077", "0.6486656", "0.62885904", "0.62340164", "0.6185555", "0.6114646", "0.6076853", "0.60511374", "0.60511374", "0.60511374", "0.60511374", "0.60511374", "0.60511374", "0.60511374", "0.605...
0.604203
57
Sets this object's schedule name to the name provided. This allows subsequent describe_schedule or list_executions calls to point to the given schedule.
def attach(cls, monitor_schedule_name, sagemaker_session=None): sagemaker_session = sagemaker_session or Session() schedule_desc = sagemaker_session.describe_monitoring_schedule( monitoring_schedule_name=monitor_schedule_name ) monitoring_type = schedule_desc["MonitoringSched...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_name(self, schedule_name):\n\n self._schedule_name = schedule_name", "def set_schedule(self, schedule_name):\n url = 'schedules'\n options = '?query={}'.format(schedule_name.replace(' ', '%'))\n schedule_definition = self._pagerduty_session_get(url, options).json()\n\n ...
[ "0.88192904", "0.7999869", "0.7830659", "0.7159031", "0.70395786", "0.69394153", "0.69394153", "0.653065", "0.6498086", "0.64289886", "0.6303668", "0.6217492", "0.61572874", "0.61572874", "0.6145142", "0.6125495", "0.6119232", "0.60983247", "0.6076833", "0.60676503", "0.60671...
0.0
-1
Tests the triangle_area function.
def test(x_0, y_0, x_1, y_1, x_2, y_2): print("A triangle with vertices (" + str(x_0) + "," + str(y_0) + "),") print("(" + str(x_1) + "," + str(y_1) + "), and") print("(" + str(x_2) + "," + str(y_2) + ") has an area of") print(str(triangle_area(x_0, y_0, x_1, y_1, x_2, y_2)) + ".")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_triangle_area(self):\n self.assertEqual(6, triangle_area(\n self.values['base'], self.values['height']))", "def test_triangle(self):\n result = shape_area.triangle_area(10,5)\n self.assertEqual(result,25)", "def test_get_triangle_area():\n v1 = (0,0); v2 = (1...
[ "0.86155367", "0.856417", "0.85050195", "0.79427975", "0.7842579", "0.76150316", "0.741595", "0.73901117", "0.73285645", "0.7316956", "0.7307981", "0.7201154", "0.71656376", "0.7159693", "0.71319467", "0.7101162", "0.7070409", "0.70696735", "0.70656854", "0.7062248", "0.70501...
0.7353802
8
Sets the warehouse_id of this ProductInventory.
def warehouse_id(self, warehouse_id): self._warehouse_id = warehouse_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inventory_id(self, inventory_id):\n\n self._inventory_id = inventory_id", "def change_product_qty(self):\n Inventory = self.env['stock.inventory']\n\n\n for wizard in self:\n product = wizard.product_id.with_context(location=wizard.location_id.id, lot_id=wizard.lot_id.id)\n ...
[ "0.6164509", "0.57944274", "0.56671536", "0.56671536", "0.5652377", "0.53858393", "0.5384447", "0.5361004", "0.5318009", "0.5301065", "0.52795684", "0.5219352", "0.51637465", "0.5142357", "0.4920947", "0.48942694", "0.4867124", "0.48104545", "0.47848165", "0.47802722", "0.478...
0.8336979
0
Sets the in_stock of this ProductInventory.
def in_stock(self, in_stock): self._in_stock = in_stock
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_in_stock(self, is_in_stock):\n if is_in_stock is None:\n raise ValueError(\"Invalid value for `is_in_stock`, must not be `None`\")\n\n self._is_in_stock = is_in_stock", "def stock_id(self, stock_id):\n\n self._stock_id = stock_id", "def update_stock(self, productid, new_s...
[ "0.7377579", "0.59913296", "0.5934978", "0.5934945", "0.5870628", "0.57754326", "0.57432187", "0.56522363", "0.5627049", "0.5610558", "0.5603841", "0.56013626", "0.54913306", "0.5463092", "0.53783", "0.53699446", "0.5362714", "0.5338288", "0.5305871", "0.5302662", "0.52313966...
0.83905125
0
Sets the additional_fields of this ProductInventory.
def additional_fields(self, additional_fields): self._additional_fields = additional_fields
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom_fields(self, custom_fields):\n\n self._custom_fields = custom_fields", "def custom_fields(self, custom_fields):\n\n self._custom_fields = custom_fields", "def custom_fields(self, custom_fields):\n\n self._custom_fields = custom_fields", "def custom_fields(self, custom_fields):...
[ "0.5752643", "0.5752643", "0.5752643", "0.5752643", "0.5752643", "0.5632876", "0.5627395", "0.5565864", "0.5512944", "0.54463583", "0.5362765", "0.533865", "0.52753925", "0.5234363", "0.5213341", "0.5210302", "0.5203737", "0.51939094", "0.5171562", "0.5169301", "0.5150748", ...
0.6904246
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ProductInventory): return False return self.__dict__ == other.__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): return not self == other
{ "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.84560555", "0.83913696", "0.8143685", "0.81403786", "0.8131871", "0.8093231", "0.80915105", "0.80915105", "0.80915105", "0.8084564", "0.8084564", "0.8075547", "0.8075547", "0.8065006" ]
0.0
-1
Given a DataFrame, plot the correlation between columns. Function assumes all numeric continuous data. It masks the top half of the correlation matrix, since this holds the same values. Decomissioned for use of the dython associations function.
def plot_var_cor(x: Union[pd.DataFrame, np.ndarray], ax=None, return_values: bool = False, **kwargs) -> Optional[np.ndarray]: if isinstance(x, pd.DataFrame): corr = x.corr().values elif isinstance(x, np.ndarray): corr = np.corrcoef(x, rowvar=False) else: raise ValueError('Unknown dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_corr_matrix(df):\n f = plt.figure(figsize=(19, 15))\n plt.matshow(df.corr().abs(), fignum=f.number)\n cb = plt.colorbar()\n cb.ax.tick_params(labelsize=14)\n plt.title('Correlation Matrix', fontsize=16)", "def fast_corr(df, col_name):\n\n if not isinstance(df, pd.DataFrame):\n r...
[ "0.7461798", "0.7347706", "0.73251384", "0.70350003", "0.6985054", "0.69759643", "0.6969627", "0.6957218", "0.69535625", "0.69255793", "0.69004166", "0.6882208", "0.6758976", "0.67368037", "0.6705809", "0.6702674", "0.66998357", "0.66799664", "0.6666793", "0.665836", "0.65973...
0.6171213
38
Plot continous density function on optionally given ax. If no ax, cdf is plotted and shown.
def cdf(data_r, data_f, xlabel: str = 'Values', ylabel: str = 'Cumulative Sum', ax=None): x1 = np.sort(data_r) x2 = np.sort(data_f) y = np.arange(1, len(data_r) + 1) / len(data_r) ax = ax if ax else plt.subplots()[1] axis_font = {'size': '14'} ax.set_xlabel(xlabel, **axis_font) ax.set_ylab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_cdf(self, data, ax=None, survival=False, **kwargs):\n bins, CDF = self.cdf(data, survival=survival, **kwargs)\n if not ax:\n fig, ax = plt.subplots()\n ax.loglog(bins, CDF, **kwargs)\n else:\n fig = ax.get_figure()\n ax.plot(bins, CDF, **kwa...
[ "0.7151131", "0.640917", "0.63557786", "0.621272", "0.61949044", "0.61315835", "0.6122382", "0.61173147", "0.6033304", "0.5762083", "0.5757444", "0.5717196", "0.57103103", "0.5702478", "0.565598", "0.56171894", "0.55526465", "0.55511624", "0.5542126", "0.55248004", "0.5512110...
0.5228244
48
Try to load the string with the json module. If successful it's a json file.
def sniff( self, filename ): try: json.load( open(filename) ) return True except Exception: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load(self, json_str, string_name):\n try:\n self.json_dict = json.loads(json_str)\n self.filename = string_name\n return self.json_dict\n except ValueError:\n print('JSON string content error in _load()')\n raise ValueError", "def test_loa...
[ "0.7805877", "0.7704909", "0.73687", "0.73673046", "0.724741", "0.722549", "0.7211943", "0.71838015", "0.717326", "0.71039796", "0.70954967", "0.7087735", "0.70365024", "0.6962103", "0.6911919", "0.68721926", "0.6851505", "0.6828451", "0.6823047", "0.67897516", "0.6781209", ...
0.0
-1
Compute softmax probability over raw logits.
def _compute_softmax(scores): if not scores: return [] max_score = None for score in scores: if max_score is None or score > max_score: max_score = score exp_scores = [] total_sum = 0.0 for score in scores: x = np.exp(score - max_score) exp_scores.append(x) total_sum += x prob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x):\r\n exps = np.exp(x)\r\n return exps / np.sum(exps)", "def softmax(x):\n npX = np.array(x)\n expX = np.exp(x)\n\n return expX/sum(expX)", "def softmax(inputs):\n probs = np.exp(inputs)\n # print(probs.shape)\n # t = np.sum(probs, axis=0)\n # print(t.shape)\n\n prob...
[ "0.77200097", "0.7704036", "0.77031845", "0.7689372", "0.76789933", "0.7667026", "0.7667026", "0.7614546", "0.7609603", "0.75957626", "0.7592047", "0.75795877", "0.7579332", "0.7575453", "0.7566295", "0.75662047", "0.7563993", "0.7556705", "0.7556705", "0.7556705", "0.7556705...
0.0
-1
The full URL to this host when deployed, for use in href attributes.
def link(self): return 'http://{}:{}'.format(self.basic_url, self.port)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_url(self):\n return \"%s://%s%s\" % (self.protocol, self.host, self.uri)", "def get_url(self) -> str:\n return urljoin(self._base_url, self.url)", "def _get_url(self):\n return 'http://{}:{}'.format(self.host, self.port)", "def get_public_baseurl(self):\n server_name = se...
[ "0.7733112", "0.75688636", "0.75384086", "0.7512936", "0.747791", "0.7476851", "0.7444745", "0.7424831", "0.7318727", "0.7298595", "0.729839", "0.72969544", "0.72949106", "0.7290604", "0.7290604", "0.7290604", "0.7254489", "0.7233823", "0.7220661", "0.7199187", "0.71988064", ...
0.0
-1
Whether or not the associated resource group exists on the cloud.
def group_exists(self): return AzureTools().group_exists(names.group_name(self))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_group_exists(self, short_name):\n return self.get_target_group_info(short_name) is not None", "def has_group(self, resolvable):\n group = self._resolve_group(resolvable)\n\n for g in self.groups.query(name=group.name):\n if g.name == group.name:\n return ...
[ "0.70838195", "0.6911127", "0.68680817", "0.6582228", "0.6557702", "0.6529358", "0.6526806", "0.6418921", "0.63955855", "0.6372062", "0.6323255", "0.6314798", "0.6300838", "0.62944514", "0.6255041", "0.6254257", "0.6238047", "0.6232726", "0.6216354", "0.6176009", "0.6155225",...
0.7980444
0
Return the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document)
def decode(self, s, _w=WHITESPACE.match, _PY3=PY3): if _PY3 and isinstance(s, binary_type): s = s.decode(self.encoding) obj, end = self.raw_decode(s) end = _w(s, end).end() if end != len(s): raise JSONDecodeError("Extra data", s, end, len(s)) return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_json(s):\n return json.dumps(s.as_dict())", "def as_json_response(s):\n return JsonResponse(s.as_dict(), safe=False)", "def json_str(js: Union[Dict[str, Any], Input, str]) -> str:\n if type(js) is dict:\n js = json.dumps(js)\n elif type(js) is Input:\n js = json.dumps(j...
[ "0.7389859", "0.6503537", "0.6422268", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", "0.63213587", ...
0.0
-1
Return an ASCIIonly JSON representation of a Python string
def py_encode_basestring_ascii(s, _PY3=PY3): if _PY3: if isinstance(s, binary_type): s = s.decode('utf-8') else: if isinstance(s, str) and HAS_UTF8.search(s) is not None: s = s.decode('utf-8') def replace(match): s = match.group(0) try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string2json(self, string):\n kwargs = {\n 'cls': BytesEncoder, # use the IPython bytes encoder\n 'indent': 1,\n 'sort_keys': True,\n 'separators': (',', ': '),\n }\n return cast_unicode(json.dumps(string, **kwargs), 'utf-8')", "def convert_to_...
[ "0.8173381", "0.7761752", "0.73871756", "0.7306732", "0.7114988", "0.6949071", "0.6896345", "0.68929964", "0.6786643", "0.67857534", "0.6751209", "0.66860336", "0.66523707", "0.66367877", "0.6627448", "0.66205585", "0.6590046", "0.6590046", "0.6590046", "0.6590046", "0.659004...
0.0
-1
Constructor for JSONEncoder, with sensible defaults. If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped. If ensure_ascii is true, the output is guaranteed to be str objects with all incoming unicode char...
def __init__(self, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, encoding='utf-8', default=None, use_decimal=True, namedtuple_as_object=True, tuple_as_array=True, bigint_as_string=False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True,\n allow_nan=True, cls=None, indent=None, separators=None,\n encoding='utf-8', default=None, sort_keys=False, **kw):\n # cached encoder\n if (not skipkeys and ensure_ascii and\n check_circular and allow_nan and\n ...
[ "0.7841536", "0.76318866", "0.6674009", "0.6602294", "0.64573807", "0.6386735", "0.61420614", "0.5870939", "0.583436", "0.582956", "0.58067137", "0.57632715", "0.57514626", "0.5742633", "0.5742329", "0.56044716", "0.55965227", "0.5562437", "0.55547315", "0.55540115", "0.54955...
0.5755817
12
Checks if the ball enters the provided regions
def get_validation_status(self, world) -> ValidationStatus: for region in self.regions: if tbots.contains( region, tbots.createPoint(world.ball.current_state.global_position) ): return ValidationStatus.PASSING return ValidationStatus.FAILING
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_overlapping(self, region):\n if self.x2 < region.x1:\n return False # this box is left the other\n if self.x1 > region.x2:\n return False # this box is right the other\n if self.y2 < region.y1:\n return False # this box is above the other\n if ...
[ "0.69990134", "0.6617942", "0.6469112", "0.6441537", "0.6407256", "0.6396766", "0.63359696", "0.6300389", "0.6299785", "0.62835896", "0.6273223", "0.6267162", "0.62645406", "0.623665", "0.6203495", "0.6199588", "0.61965483", "0.6186781", "0.6151584", "0.61507994", "0.61301345...
0.0
-1
Get absolute path to resource, works for dev and for PyInstaller
def absPath(myPath): try: # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS return os.path.join(base_path, os.path.basename(myPath)) except Exception: base_path = os.path.abspath(os.path.dirname(__file__)) return os.path.join(base_pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_path():\n return os.path.join(os.path.dirname(__file__), \"resources\") + os.path.sep", "def resourcePath(relative):\r\n try:\r\n # PyInstaller creates a temp folder and stores path in _MEIPASS\r\n base_path = sys._MEIPASS\r\n except Exception:\r\n base_path = os.pa...
[ "0.83695436", "0.8280479", "0.82485795", "0.8139178", "0.8114118", "0.80985415", "0.80940944", "0.80797124", "0.80677074", "0.80673695", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.8062465", "0.80569947", "0.80545217", "0.80448323", "0.804...
0.7358136
67
Yield successive nsized chunks from l.
def chunks(l, n): for i in range(0, len(l), n): yield l[i:i+n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.80379355", "0.79237956", "0.7922027", "0.78840584", "0.7876208", "0.78144675", "0.77643776", "0.77544284", "0.7743112", "0.7730491", "0.772761", "0.7723601", "0.7701434", "0.768797", "0.768797", "0.7662925", "0.765581", "0.765473", "0.765473", "0.76447", "0.76447", "0.76...
0.743674
98
generate a nonce any approach which produces a relatively random alphanumeric string should be OK.
def _oauth_nonce_generate(self): raw_data = random.getrandbits(32 * 8) raw_str = '' for i in range(32): new_part = raw_data % 256 raw_data /= 256 raw_str += chr(new_part) encoded = base64.b64encode(raw_str) return encoded.rstrip('=').replace('+', 'A').replace('/', 'B')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_nonce():\n return str(int(round(time.time() * 1000)))", "def generate_nonce():\n return uuid4().hex", "def make_nonce():\n time_format = '%Y-%m-%dT%H:%M:%SZ'\n time_component = time.strftime(time_format, time.gmtime())\n valid_chars = ''\n\n # iterate over all the aschii characte...
[ "0.8591053", "0.8586692", "0.85286474", "0.8491104", "0.8491104", "0.8474032", "0.83049124", "0.82906467", "0.8214552", "0.8138846", "0.80913", "0.80913", "0.7977414", "0.78299505", "0.78022283", "0.7548465", "0.7408869", "0.73951733", "0.7339227", "0.7295845", "0.72536653", ...
0.76117766
15
Add new experience to memory
def add(self, state, action, reward, next_state, done): experience = Experience(state, action, reward, next_state, done) self.memory.append(experience)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new_experience(self, state, action, reward, next_state, done):\n e = self.experience(state, action, reward, next_state, done, self.max_priority)\n self.memory.append(e)", "def remember(self, experience):\n self.memory.append(experience)", "def add(self, experience):\n self.b...
[ "0.7707071", "0.7609556", "0.7474518", "0.728529", "0.72838557", "0.709813", "0.7017289", "0.6950786", "0.69280106", "0.6862262", "0.6862262", "0.6862262", "0.6862262", "0.6862262", "0.6862262", "0.6862262", "0.6862262", "0.6862262", "0.6862262", "0.6862262", "0.6766821", "...
0.74314296
3
Build an actor (policy) network that maps states > actions.
def build_model(self): states = layers.Input(shape=(self.state_size, ), name='states') # Kernel initializer with fan-in mode and scale of 1.0 kernel_initializer = initializers.VarianceScaling(scale=1.0, mode='fan_in', distribution='normal', seed=None) # Add hidden layers ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_actor_network(states, num_controls, params, scope_name):\n scope_key = scope_name + '/'\n with tf.variable_scope(scope_name):\n hidden_1 = tf.layers.dense(states,\n units=params.actor_hidden_units[0],\n activation=None,\n ...
[ "0.69356495", "0.636351", "0.6270465", "0.62087923", "0.62009275", "0.6187312", "0.61473614", "0.6146225", "0.6128509", "0.60179603", "0.6002386", "0.5976266", "0.5959938", "0.5952642", "0.594925", "0.59280884", "0.5916518", "0.5898108", "0.58937097", "0.5891148", "0.5880467"...
0.0
-1
Assume that MAZE is a rectangular 2D array (list of lists) where maze[r][c] is true iff there is a concrete block occupying column c of row r. ROW0 and COL0 are the initial row and column of the prisoner. Returns true iff there is a path of empty squares that are horizontally or vertically adjacent to each other starti...
def solve_maze(row0, col0, maze): visited = set() # Set of visited cells cols, rows = range(len(maze[0])), range(len(maze)) def escapep(r, c): """True iff is a path of empty, unvisited cells from (R, C) out of maze.""" if r not in rows or c not in cols: return True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def board_full(board):\n\n for row in board:\n for piece in row:\n if piece == '*': return False;\n\n return True;", "def surroundingIsEmpty(board, row, column):\n\n neighboursList = list(BoardUtils.neighborsList(board, 1, row, column))\n for element in neighboursList:\n ...
[ "0.6406011", "0.63258815", "0.62363464", "0.6219696", "0.6212434", "0.62058043", "0.61897993", "0.6116551", "0.60529155", "0.60384476", "0.6036287", "0.6032698", "0.6012134", "0.60030794", "0.59859455", "0.59746796", "0.5953047", "0.5921198", "0.5915295", "0.58916277", "0.588...
0.7195388
0
True iff is a path of empty, unvisited cells from (R, C) out of maze.
def escapep(r, c): if r not in rows or c not in cols: return True elif maze[r][c] or (r, c) in visited: return False else: visited.add((r,c)) return escapep(r+1, c) or escapep(r-1, c) \ or escapep(r, c+1) or escapep(r, c-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve_maze(row0, col0, maze):\n visited = set() # Set of visited cells\n cols, rows = range(len(maze[0])), range(len(maze))\n def escapep(r, c): \n \"\"\"True iff is a path of empty, unvisited cells from (R, C) out of maze.\"\"\"\n if r not in rows or c not in cols:\n ...
[ "0.70624137", "0.68595284", "0.6733619", "0.65522736", "0.6527314", "0.64794415", "0.64671725", "0.64547527", "0.63852763", "0.63625515", "0.63525426", "0.6348405", "0.63012356", "0.6231833", "0.62082386", "0.6181732", "0.6176096", "0.6172059", "0.61506987", "0.6145246", "0.6...
0.5904503
43
A Tree with given label and children. For convenience, if children[k] is not a Tree, it is converted into a leaf whose operator is children[k].
def __init__(self, label, *children): self.__label = label; self.__children = \ [ c if type(c) is Tree else Tree(c) for c in children]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, label, *children):\n self.__label = label;\n self.__children = \\\n [ c if type(c) is Tree else Tree(c) for c in children]", "def tree(label, branches=[]):\n for branch in branches:\n assert is_tree(branch), 'branches must be trees'\n return [label] + list(b...
[ "0.7163515", "0.64173216", "0.6144817", "0.5953546", "0.5890156", "0.5888928", "0.57656956", "0.5721938", "0.5655272", "0.56364053", "0.56037146", "0.5599821", "0.55800366", "0.5574726", "0.5572648", "0.55561084", "0.55426395", "0.5532823", "0.55194116", "0.5519082", "0.54744...
0.7147395
1
Number of leaf nodes in the Tree T.
def leaf_count(T): if T.is_leaf: return 1 else: s = 0 for child in T: s += leaf_count(child) return s # Can you put the else clause in one line instead? return functools.reduce(operator.add, map(leaf_count, T), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leaf_count(t: Tree) -> int:\n if t.children == []:\n return 1\n else:\n return sum([leaf_count(child) for child in t.children])", "def leaf_count(self) -> int:\n if self.children == []:\n return 1\n else:\n return sum([x.leaf_count() for x in self.child...
[ "0.87792015", "0.86984694", "0.8363531", "0.83214927", "0.8320937", "0.789062", "0.78523636", "0.78494376", "0.7846712", "0.7814548", "0.76643425", "0.7588327", "0.7572381", "0.75621325", "0.7480115", "0.7463508", "0.73346376", "0.7332298", "0.7326017", "0.73081714", "0.72246...
0.8069077
5
Returns the number of ways of representing n using the coins 1, 5, 10, 25.
def number_of_ways(n): return number_of_ways_helper([1, 5, 10, 25], n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_ways(n):\n if n < 0:\n return 0\n elif n == 0:\n return 1\n else:\n total = 0\n for i in range(1, min(n, 3) + 1):\n total += count_ways(n - i)\n return total", "def num_of_ways(n):\n if n == 0 or n == 1:\n return 1\n \n n_minus_2_st...
[ "0.8170431", "0.7707872", "0.7638492", "0.70050895", "0.66066194", "0.6571325", "0.6491194", "0.6465131", "0.6441236", "0.64319307", "0.6426987", "0.64118636", "0.6405003", "0.6394261", "0.63854074", "0.63723606", "0.63432866", "0.63349", "0.6324204", "0.63181853", "0.6287646...
0.8904059
0
r""" Returns whether a candidate username is valid. It must contain
def is_valid_username(username): import string if not (len(username) > 2 and len(username) < 65): return False if not username[0] in string.letters: return False m = re_valid_username.match(username) return m.start() == 0 and m.end() == len(username)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_usr(username: str) -> bool:\n if MIN_USERNAME_LENGHT <= len(username) < MAX_USERNAME_LENGHT:\n return bool(re.search(ALLOWED_CHARACTERS_PATTERN, username))\n\n return False", "def is_valid_username(self, username):\n rex = \"^[a-zA-Z]{3,}$\"\n return re.match(rex, username...
[ "0.82025987", "0.8173515", "0.80325276", "0.8028382", "0.7975582", "0.79197615", "0.78914243", "0.78454524", "0.78387666", "0.7767522", "0.77501625", "0.77213436", "0.77108395", "0.7708148", "0.7706937", "0.768852", "0.7686954", "0.76003015", "0.7584706", "0.75082517", "0.750...
0.79633546
5
r""" Return True if and only if ``password`` is valid, i.e., is between 4 and 32 characters long, doesn't contain space(s), and doesn't contain ``username``.
def is_valid_password(password, username): import string if len(password) < 4 or ' ' in password: return False if username: if string.lower(username) in string.lower(password): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_validator(username, password):\n digits = re.search(r'\\d+', password)\n capital_letters = re.search(r'[A-Z]+', password)\n lenght = len(password) > PASSWORD_MIN_LENGTH\n special_symbol = re.search(r'[\\-\\/\\@\\?\\!\\,\\.\\#\\&\\*]+', password)\n\n statement = digits and capital_letter...
[ "0.8413704", "0.8253108", "0.81500554", "0.81450474", "0.80467796", "0.80194587", "0.80037874", "0.79487133", "0.79376817", "0.793012", "0.790427", "0.79011995", "0.7829927", "0.7755393", "0.7753331", "0.77316546", "0.77077174", "0.7703221", "0.7693121", "0.7687667", "0.76866...
0.88350177
0
Goes to the home page
def go_to_home_page(): driver.get(home_page)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def go_home(self):\r\n if self.home_url is not None:\r\n self.set_url(self.home_url)", "def start_page():\n if not _home:\n abort(404)\n return redirect(_home)", "def start_page():\n if not _home:\n abort(404)\n return redirect(_home)", "def go_home(request):\n\n ...
[ "0.8276103", "0.8050566", "0.8050566", "0.801638", "0.79798096", "0.78557956", "0.7794467", "0.7788585", "0.7787083", "0.7738189", "0.77336496", "0.7720103", "0.77095175", "0.7690481", "0.7649062", "0.7635818", "0.7622547", "0.7541022", "0.7534915", "0.75132096", "0.75105333"...
0.7698908
13
Given a linear index (integer between 0 and outdim), returns the bin indices for each of the state dimensions.
def getBinIndices(self, linear_index): return linear_index / self.magic_array % self.nbins_across_dims
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_bin_indices(X_part, bin_limits=None, n_bins=20):\n if bin_limits is None:\n bin_limits = []\n for variable_data in range(X_part.shape[1]):\n bin_limits.append(numpy.linspace(numpy.min(variable_data), numpy.max(variable_data), n_bins + 1)[1: -1])\n\n bin_indices = numpy.ze...
[ "0.6318626", "0.60193294", "0.5965671", "0.5952402", "0.5927503", "0.5797661", "0.5770164", "0.57490516", "0.572948", "0.57134926", "0.5675638", "0.5661051", "0.56601435", "0.56357145", "0.56357145", "0.56162226", "0.5607805", "0.5594806", "0.55804384", "0.5574714", "0.555152...
0.71380746
0
Return instance of player by index in the list
def getPlayer(self, idx): return self.players[idx]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPlayer(self, index):\n if type(index) is not int:\n raise TypeError(\"The index passed to getPlayer must be of type int.\")\n elif index < 0 or index >= len(self.__colordict__.keys()):\n raise IndexError(\"Index less than 0 or greater than or equal to the number of \" +\n...
[ "0.7225015", "0.7059273", "0.68231434", "0.6478474", "0.647411", "0.6439984", "0.6266633", "0.62629753", "0.61795074", "0.6134053", "0.60877204", "0.6051445", "0.5985431", "0.59811187", "0.5975781", "0.5903814", "0.5899067", "0.58785975", "0.5859788", "0.5832354", "0.5830776"...
0.7650819
0
Returns the status of the pod.
def get_status(): # TODO tie this in with requests that can fetch the status of the pod from the cluster if request.method == "GET": """ request looks like: { "workflow_name": "test-workflow" } """ req = request.get_json(force=True) if workfl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self) -> pulumi.Output['outputs.JobStatus']:\n return pulumi.get(self, \"status\")", "def status(self):\n return self._get(path='status')", "def status(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"status\")", "def status(self) -> pulumi.Output[Optional[st...
[ "0.72762626", "0.72277206", "0.7176679", "0.7176679", "0.7176679", "0.71301764", "0.7123881", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", "0.7107593", ...
0.79594374
0
Build and return a data loader.
def get_loader(config): train_transform = [T.Resize((256, 128)), T.RandomHorizontalFlip(), T.ToTensor(), T.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])] train_transform = T.Compose(train_transform) test_transform = [T.Resize((256, 128)), T.ToTensor(), T....
{ "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.74896806", "0.7352408", "0.7116231", "0.703314", "0.6993853", "0.69911397", "0.69694024", "0.69258267", "0.6925624", "0.6866596", "0.68356377", "0.68205285", "0.6814369", "0.6809004", "0.6807265", "0.6693439", "0.66928136", "0.6689916", "0.66793126", "0.665312", "0.6646554...
0.6316193
35
Tests whether ``ApplicationRoleConnection.__repr__`` works as intended.
def test__ApplicationRoleConnection__repr(): platform_name = 'buta' platform_user_name = 'otome' metadata_values = {'old': '1'} connection = ApplicationRoleConnection( platform_name = platform_name, platform_user_name = platform_user_name, metadata_values = metadata_values, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_repr(cls) -> bool:\n raise NotImplementedError", "def test_repr(self):\n self.assertEquals(\n repr(self.tabView),\n \"<TabView topLevel=False tabs=%r>\" % self.tabs)", "def test_repr(self, r, rep):\n assert repr(r) == rep", "def test_repr(self):\n d...
[ "0.6745693", "0.65486985", "0.65423334", "0.6459256", "0.62968767", "0.62698096", "0.6243799", "0.615087", "0.61474997", "0.60385793", "0.60331905", "0.6028509", "0.6010869", "0.60008466", "0.59883606", "0.59846157", "0.59846157", "0.5938847", "0.5897374", "0.58890253", "0.58...
0.806551
0
Tests whether ``ApplicationRoleConnection.__eq__`` works as intended.
def test__ApplicationRoleConnection__eq(): platform_name = 'buta' platform_user_name = 'otome' metadata_values = {'old': '1'} keyword_parameters = { 'platform_name': platform_name, 'platform_user_name': platform_user_name, 'metadata_values': metadata_values, } c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other: 'Role') -> bool:\n if not isinstance(other, self.__class__):\n return False\n return self.__dict__ == other.__dict__", "def __eq__(self, other):\n if isinstance(other, _MethodConnection):\n return (self._im_func == other._im_func and\n ...
[ "0.71062076", "0.7066842", "0.6988803", "0.68393695", "0.68366027", "0.6831782", "0.66683984", "0.6653032", "0.66249555", "0.66249555", "0.66249555", "0.66249555", "0.66249555", "0.66249555", "0.66249555", "0.66249555", "0.66249555", "0.66249555", "0.66249555", "0.6578068", "...
0.7928563
0
Get the answers list of a given question_id
def get_answers(question_id, api_site_parameter, rpc = None, page = 1, body = False, comments = False, pagesize = 100, sort = 'votes'): path = "questions/%d/answers" % question_id query_filter = '.p-I38n' if body: query_filter = '-m8C*uMP-q0' if comments: query_filter = ')(Ybp0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, question_id):\n response = Answers.get_all_answers(question_id)\n\n return response", "def get_answers_by_answer_id(self, answer_id):\n return self._answers_by_id.get(answer_id)", "def find_answers_to_a_question(list_name, question_id):\n\n my_items = [element for element ...
[ "0.7881036", "0.74949026", "0.7257717", "0.7236561", "0.7148829", "0.68085486", "0.6751629", "0.6680172", "0.6677202", "0.66614604", "0.65761554", "0.6564532", "0.65357995", "0.6373324", "0.62934756", "0.6293136", "0.62627447", "0.6252867", "0.6192842", "0.6075509", "0.604657...
0.67658585
6
Builds the API URL for fetching results.
def __build_url(path, api_site_parameter, **params): query = ["%s=%s" % (key, params[key]) for key in params if (params[key] or key == 'pagesize') ] query_string = "&".join(query) url = "%s/%s/%s?" % (__api_endpoint, __api_version, path) url += query_string return url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_api_url(self, query_, api):\n api_url = \"%s%s%s\" % (api, query_, self.api_key)\n\n return api_url", "def __build_url(self, api_call, **kwargs):\n kwargs['key'] = self.api_key\n if 'language' not in kwargs:\n kwargs['language'] = self.language\n if 'format' ...
[ "0.77091813", "0.75082874", "0.74344903", "0.72820085", "0.71979994", "0.71971315", "0.7070169", "0.7069157", "0.7069157", "0.70579827", "0.6947857", "0.6916341", "0.69012713", "0.68881667", "0.6878032", "0.6861863", "0.68463403", "0.67982954", "0.67475265", "0.6737456", "0.6...
0.70509595
10
Returns the item at position iter_counter from iterable iter_num. First we try to retrieve it from the cache. If we fail, then retrieve it from the iterable. Returns None if no more items are left.
def GetItemAt(self, iter_num, iter_counter): assert iter_num < len(self.iterables) item = self.history_items[iter_num].get(iter_counter, "unexplored") if item == "unexplored": try: item = self.iterables[iter_num].next() except StopIteration: item = None self.history_items[i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_item_by_idx(self, iterator, idx):\r\n size = len(self)\r\n idx = operator.index(idx)\r\n if not -size <= idx < size:\r\n raise IndexError('index {} is out of range'.format(idx))\r\n idx %= size\r\n return next(itertools.islice(iterator, idx, None))", "def ge...
[ "0.6466208", "0.61976546", "0.610565", "0.60025674", "0.5975917", "0.5896563", "0.5891029", "0.5882008", "0.5769617", "0.5724124", "0.56661123", "0.5661857", "0.5642048", "0.5608716", "0.55899316", "0.5588746", "0.5581726", "0.55711037", "0.5548941", "0.5545475", "0.5538849",...
0.6891464
0
Returns a tuple with the first element of the iterable, and the iterable. It returns None if the iterable is exhausted.
def PeekIterable(iterable): try: head_element = iterable.next() new_iterable = itertools.chain([head_element], iterable) return head_element, new_iterable except StopIteration: return None, iterable
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_consistent_generator(iterable):\n try:\n first = next(iterable)\n except StopIteration:\n return None\n\n if first is None:\n return None\n\n return itertools.chain([first], iterable)", "def first(iterable: t.Iterable[T]) -> T:\n return next(iter(iterable))", "def un...
[ "0.72285706", "0.6918471", "0.6651263", "0.6537334", "0.64549786", "0.6413649", "0.63581884", "0.635215", "0.635215", "0.6339364", "0.63305384", "0.632527", "0.6275617", "0.6250987", "0.62166786", "0.61677766", "0.6158402", "0.6071349", "0.60561216", "0.6054858", "0.6038312",...
0.7495007
0
Takes in a list of all raw text Returns list of raw text without stop words based on document frequency and TFIDF
def remove_stop_words(raw_corpus, doc_freq=0.75): vectorizer = TfidfVectorizer() vectors = vectorizer.fit_transform([doc.lower() for doc in raw_corpus]) feature_names = vectorizer.get_feature_names() dense = vectors.todense() denselist = dense.tolist() words_tfidf = pd.DataFrame(denselist, colum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processes_and_tokenize(raw_document):\n\ttokenizer = RegexpTokenizer(r'\\w+')\n\ttokens = tokenizer.tokenize(raw_document.lower())\t\t# tokens = nltk.word_tokenize(corpus.lower()) # without removing punctiation\n\n\t#remove stop words\n\tstop_words = set(nltk.corpus.stopwords.words('english'))\n\t#stop_words =...
[ "0.69431984", "0.6630494", "0.6602285", "0.6583488", "0.6578389", "0.6571684", "0.6531152", "0.6481732", "0.64261454", "0.64218646", "0.6381453", "0.6365398", "0.6362743", "0.63601077", "0.6340669", "0.63333184", "0.6323711", "0.6313189", "0.6302088", "0.6294493", "0.627699",...
0.6817782
1
return true if obj is exactly a class
def is_same_class(obj, a_class): return(type(obj) is a_class)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_kind_of_class(obj, a_class):\n if isinstance(obj, a_class) is True:\n return True\n else:\n return False", "def isclass(object):\r\n return isinstance(object, (type, types.ClassType))", "def is_kind_of_class(obj, a_class):\n if isinstance(obj, a_class):\n return True\n ...
[ "0.8230429", "0.8198473", "0.8196204", "0.8196204", "0.81858844", "0.8147639", "0.8143109", "0.8136343", "0.8117038", "0.8117038", "0.8117038", "0.8117038", "0.8117038", "0.8117038", "0.80860734", "0.8085975", "0.8058114", "0.8052911", "0.80333", "0.80274004", "0.7980031", ...
0.79976004
20
Gets the avg_inference_time of this Dashboard.
def avg_inference_time(self): return self._avg_inference_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_training_time(self):\n return self._avg_training_time", "def avgtime(self):\n return (self._total_time['value'] / 1000) / self._total_time['count'] if self._total_time['count'] else 0", "def avg_inference_time(self, avg_inference_time):\n\n self._avg_inference_time = avg_inference_...
[ "0.7688986", "0.7378882", "0.7085033", "0.6965324", "0.6965324", "0.6965324", "0.68854594", "0.6841707", "0.67688745", "0.6650615", "0.6546919", "0.6546919", "0.6474598", "0.64510095", "0.64407456", "0.6419536", "0.637936", "0.6369307", "0.62679136", "0.6213513", "0.6203301",...
0.8750952
0
Gets the avg_latency of this Dashboard.
def avg_latency(self): return self._avg_latency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def average_latency_per_iop(self):\n return self._average_latency_per_iop", "def average_speed(self):\n return self._average_speed", "def average_speed(self):\n return self.total_distance * 3600 / self.total_time", "def avgtime(self):\n return (self._total_time['value'] / 1000) / ...
[ "0.7002933", "0.68997884", "0.6851817", "0.6824462", "0.6778096", "0.67746073", "0.66578525", "0.65238416", "0.64111894", "0.6406071", "0.63798845", "0.63798845", "0.63798845", "0.6372547", "0.6355915", "0.62166494", "0.62070835", "0.6131814", "0.6080654", "0.6071413", "0.605...
0.86059934
1
Gets the avg_training_time of this Dashboard.
def avg_training_time(self): return self._avg_training_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_inference_time(self):\n return self._avg_inference_time", "def avg_training_time(self, avg_training_time):\n\n self._avg_training_time = avg_training_time", "def avgtime(self):\n return (self._total_time['value'] / 1000) / self._total_time['count'] if self._total_time['count'] else...
[ "0.7506201", "0.7159708", "0.7058346", "0.684442", "0.6722557", "0.6722557", "0.6705557", "0.6705557", "0.6705557", "0.66139954", "0.654946", "0.65014553", "0.64305717", "0.63712406", "0.6343276", "0.63094103", "0.63054085", "0.62871736", "0.6204863", "0.6202335", "0.61831266...
0.8810325
0
Gets the enable_health of this Dashboard.
def enable_health(self): return self._enable_health
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_health(self):\n return self.__health", "def get_health(self):\n return self.health", "def Gethealth(self):\n return self.health", "def get_health(self):\n return self.__healthy", "def get_current_health(self):\n return self.health", "def health(self):\n r...
[ "0.7512435", "0.7488104", "0.7402548", "0.7016691", "0.6954334", "0.69409657", "0.69409657", "0.68736297", "0.6552519", "0.65186435", "0.6502406", "0.6502406", "0.6483834", "0.643544", "0.64260054", "0.63999337", "0.63261014", "0.6322474", "0.62189955", "0.61582977", "0.61525...
0.8434188
0
Sets the ion_instance of this Dashboard.
def ion_instance(self, ion_instance): self._ion_instance = ion_instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ion(self, ion):\n\n self._ion = ion", "def set_instance(self, instance):\n self.instance = instance", "def set_instance(self, instance):\n self.instance = instance", "def set_instance(self, instance):\n self.instance = instance", "def set_instance(self, instance):\n s...
[ "0.6787115", "0.6573194", "0.6573194", "0.6573194", "0.6573194", "0.6573194", "0.6409853", "0.63181776", "0.6265229", "0.5963499", "0.56104624", "0.55304074", "0.55137837", "0.54621404", "0.5434859", "0.5347679", "0.53132266", "0.51905864", "0.51905864", "0.51905864", "0.5190...
0.80882585
0
Gets the is_ml_healthy of this Dashboard.
def is_ml_healthy(self): return self._is_ml_healthy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_ml_healthy(self, is_ml_healthy):\n\n self._is_ml_healthy = is_ml_healthy", "def is_ml_healthy(self, is_ml_healthy):\n\n self._is_ml_healthy = is_ml_healthy", "def get_health(self):\n return self.__healthy", "def is_healthy(self) -> bool:\n return False", "def is_system_he...
[ "0.813105", "0.813105", "0.7209838", "0.69925964", "0.6922049", "0.6823707", "0.680214", "0.67930883", "0.6685253", "0.61448264", "0.6069192", "0.6005631", "0.59968466", "0.5957496", "0.59371406", "0.5922947", "0.59106916", "0.5894872", "0.5894872", "0.5894872", "0.5894872", ...
0.88365185
1
Gets the operation_mode of this Dashboard.
def operation_mode(self): return self._operation_mode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def operation_mode(self) -> int:\n op_mode = self._read_u8(_REG_OP_MODE)\n return (op_mode >> 2) & 0b111", "def get_mode(self):\r\n return self._api.get_mode()", "def getMode(self):\n return self._mode", "def getmode(self):\n return self.mode", "def get_mode(self):\r\n ...
[ "0.7838033", "0.7746636", "0.7497163", "0.74531657", "0.74391294", "0.74110365", "0.72917336", "0.72220725", "0.72198814", "0.7200436", "0.7171177", "0.7161535", "0.71283394", "0.71283394", "0.71283394", "0.7103808", "0.70693433", "0.70677537", "0.70672023", "0.70672023", "0....
0.84856904
0
Gets the status of this Dashboard.
def status(self): return self._status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return self._get(path='status')", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def get_status(self):\n r = requests.get(self.base_url + '/status')\n re...
[ "0.802181", "0.7888734", "0.7888734", "0.7888734", "0.7854777", "0.7853983", "0.7794157", "0.7759545", "0.7753214", "0.77168816", "0.7698679", "0.76866144", "0.76688194", "0.7645983", "0.76382256", "0.76220614", "0.75926965", "0.75720483", "0.7559108", "0.7559108", "0.7559108...
0.7476286
70
Gets the total_data_processed of this Dashboard.
def total_data_processed(self): return self._total_data_processed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_bytes_processed(self):\n total_bytes_processed = self._properties.get(\"totalBytesProcessed\")\n if total_bytes_processed is not None:\n return int(total_bytes_processed)", "def get_total_count(self):\n return self.total_count", "def get_TotalCount(self):\n retu...
[ "0.73769915", "0.73075116", "0.73067", "0.7302086", "0.72489244", "0.7246251", "0.72313356", "0.7166553", "0.7118288", "0.7102905", "0.7088142", "0.70527405", "0.6970937", "0.6962205", "0.69501203", "0.6941027", "0.68699205", "0.68479675", "0.684391", "0.6824782", "0.6813029"...
0.861788
0
Sets the total_data_processed of this Dashboard.
def total_data_processed(self, total_data_processed): self._total_data_processed = total_data_processed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_samples_processed(self, total_samples_processed):\n\n self._total_samples_processed = total_samples_processed", "def total(self, total):\n\n self._total = total", "def total(self, total):\n\n self._total = total", "def total(self, total):\n\n self._total = total", "def...
[ "0.7049226", "0.68256205", "0.68256205", "0.68256205", "0.68256205", "0.68256205", "0.68256205", "0.68256205", "0.68256205", "0.68031895", "0.64619446", "0.6373086", "0.6309745", "0.6308942", "0.630299", "0.62930256", "0.6233852", "0.6215431", "0.621347", "0.6134889", "0.6131...
0.86530817
0
Gets the total_models_updated of this Dashboard.
def total_models_updated(self): return self._total_models_updated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_models_updated(self, total_models_updated):\n\n self._total_models_updated = total_models_updated", "def total_models_produced(self):\n return self._total_models_produced", "def get_num_updates(self):\n return self._num_updates", "def total(self):\n if self.dynamic:\n ...
[ "0.7211526", "0.6658129", "0.65444165", "0.63419837", "0.6284991", "0.6205161", "0.59438735", "0.58653957", "0.586409", "0.581988", "0.5811029", "0.5776755", "0.5775125", "0.5738407", "0.571537", "0.5698881", "0.56909597", "0.565398", "0.5649401", "0.5643217", "0.5637602", ...
0.876
0
Sets the total_predictions of this Dashboard.
def total_predictions(self, total_predictions): self._total_predictions = total_predictions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_predictions(self):\n return self._total_predictions", "def predictions(self, predictions):\n\n self._predictions = predictions", "def draw_predictions(self):\n self.vis.draw_predictions()", "def score(self, predictions):\n return 0.", "def total(self, total):\n\n ...
[ "0.72526914", "0.67309004", "0.61389494", "0.6097807", "0.5889469", "0.5889469", "0.5889469", "0.5889469", "0.5889469", "0.5889469", "0.5889469", "0.5889469", "0.58128315", "0.5769351", "0.5683086", "0.56372076", "0.5603803", "0.555724", "0.5543685", "0.55434895", "0.5500842"...
0.8787851
0
Gets the total_samples_processed of this Dashboard.
def total_samples_processed(self): return self._total_samples_processed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_data_processed(self):\n return self._total_data_processed", "def total_bytes_processed(self):\n total_bytes_processed = self._properties.get(\"totalBytesProcessed\")\n if total_bytes_processed is not None:\n return int(total_bytes_processed)", "def total_samples(self):...
[ "0.75298214", "0.7332648", "0.7303424", "0.72026956", "0.7153452", "0.71260434", "0.7040016", "0.69730455", "0.687591", "0.6859451", "0.682129", "0.6738427", "0.6715235", "0.6669595", "0.6662182", "0.6659618", "0.66531247", "0.6627849", "0.66063005", "0.6590494", "0.6569571",...
0.8658058
0
Sets the total_samples_processed of this Dashboard.
def total_samples_processed(self, total_samples_processed): self._total_samples_processed = total_samples_processed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_data_processed(self, total_data_processed):\n\n self._total_data_processed = total_data_processed", "def total_samples_processed(self):\n return self._total_samples_processed", "def reads_total(self, reads_total):\n\n self._reads_total = reads_total", "def total_copies(self, to...
[ "0.74044716", "0.69159865", "0.63528943", "0.63419914", "0.62626487", "0.62496924", "0.62496924", "0.62496924", "0.62496924", "0.62496924", "0.62496924", "0.62496924", "0.62496924", "0.612097", "0.6102538", "0.6066606", "0.5975876", "0.59652287", "0.5851357", "0.5806901", "0....
0.8502352
0
asserts that abs(ab/(a+b))<ratio. If a+b are an underflow, we error out right now.
def assertEqualToWithin(self, a, b, ratio=1e-7, msg=None): if msg is None: msg = "%s != %s to within %s of the sum"%(a, b, ratio) denom = abs(a+b) self.failUnless(abs(a-b)/denom<ratio, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consistancy_test(a, b, aErr, bErr = 0):#TODO: fully test this aproach\n return int(np.ceil(np.abs(b - a) / np.sqrt(bErr**2 + aErr**2)))", "def almost_equal(a, b, tol=0.0001):\n \n try:\n return a==b or (max(a, b)/min(a, b)) - 1 < tol\n except ZeroDivisionError:\n return False", "d...
[ "0.7358371", "0.66254807", "0.6521883", "0.65050066", "0.6449601", "0.6401195", "0.6396084", "0.6393364", "0.62814593", "0.6261673", "0.6259443", "0.6236319", "0.61901605", "0.61901605", "0.6128072", "0.61068314", "0.61023176", "0.6097711", "0.60512173", "0.60392064", "0.6034...
0.7253796
1
Sets the operation_state of this V1alpha1ApplicationStatus.
def operation_state(self, operation_state): self._operation_state = operation_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def operational_status(self, operational_status):\n\n self._operational_status = operational_status", "def operational_status(self, operational_status):\n\n self._operational_status = operational_status", "def operational_state(self, operational_state: str):\n allowed_values = [\"DISABLED\...
[ "0.61507636", "0.61507636", "0.5949264", "0.5696181", "0.56286985", "0.55063367", "0.53397185", "0.5336757", "0.52983826", "0.5260551", "0.5246371", "0.5239253", "0.52015436", "0.51887983", "0.51887983", "0.51887983", "0.5111096", "0.50920767", "0.50906014", "0.50811106", "0....
0.6980252
0
Sets the source_type of this V1alpha1ApplicationStatus.
def source_type(self, source_type): self._source_type = source_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source_type(self, source_type):\n if source_type is None:\n raise ValueError(\"Invalid value for `source_type`, must not be `None`\")\n allowed_values = [\"PROCESSOR\", \"REMOTE_INPUT_PORT\", \"REMOTE_OUTPUT_PORT\", \"INPUT_PORT\", \"OUTPUT_PORT\", \"FUNNEL\"]\n if source_type n...
[ "0.6924241", "0.5907548", "0.5868112", "0.5808144", "0.5653231", "0.5427961", "0.53869885", "0.5380671", "0.5270179", "0.525405", "0.525405", "0.525405", "0.5247243", "0.51593596", "0.51593596", "0.51593596", "0.51593596", "0.51593596", "0.51593596", "0.51593596", "0.5135225"...
0.7221481
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, V1alpha1ApplicationStatus): 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.80886984", "0.80886984", "0.8055307", "0.7983415", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, V1alpha1ApplicationStatus): 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
r"""Gets an attestor. Returns NOT_FOUND if the attestor does not exist.
def Get(self, request, global_params=None): config = self.GetMethodConfig('Get') return self._RunMethod( config, request, global_params=global_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_4_getautor(self):\n self.app.getAutor(1)", "def attestation_authority(self) -> pulumi.Output['outputs.AttestationAuthorityResponse']:\n return pulumi.get(self, \"attestation_authority\")", "def test_get_specific_pacient_not_found(self):\n url = '/api/v1/pacientes/AAA/'\n re...
[ "0.5476859", "0.5434072", "0.52487147", "0.5230785", "0.52038616", "0.51578623", "0.5099478", "0.5058455", "0.50464344", "0.50330085", "0.49977604", "0.49969175", "0.49940065", "0.49587908", "0.49484286", "0.49183556", "0.49150467", "0.4904164", "0.48963606", "0.48773664", "0...
0.0
-1
r"""A policy specifies the attestors that must attest to. a container image, before the project is allowed to deploy that image. There is at most one policy per project. All image admission requests are permitted if a project has no policy. Gets the policy for this project. Returns a default policy if the project does ...
def GetPolicy(self, request, global_params=None): config = self.GetMethodConfig('GetPolicy') return self._RunMethod( config, request, global_params=global_params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy(self) -> Optional[pulumi.Input['ServicePolicyArgs']]:\n return pulumi.get(self, \"policy\")", "def policy(self) -> Optional[pulumi.Input['ServicePolicyArgs']]:\n return pulumi.get(self, \"policy\")", "def policy(self) -> typing.Optional[\"BucketPolicy\"]:\n return jsii.get(self,...
[ "0.68192047", "0.68192047", "0.67501944", "0.67501944", "0.6656044", "0.6587022", "0.6587022", "0.6587022", "0.65520436", "0.64265966", "0.64265966", "0.64265966", "0.63386905", "0.63386905", "0.6282369", "0.62444496", "0.61737216", "0.61178595", "0.61143225", "0.60101265", "...
0.5603377
69
Creates a timestamp with a timezone and offset in days
def create_timestamp_w_tz_and_offset(timezone=None, days=0, hours=0, minutes=0, seconds=0): if timezone is None: timezone = time.strftime("%z") timestamp = '{time}{timezone}'.format( time=(datetime.datetime.today() + datetime.timedelta(days=days, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_date(zone, offset=0):\n return datetime.date(datetime.fromtimestamp(\n time.time() + 86400 * offset, tz=zone))", "def get_timestamp(self, days=1):\n offset = datetime.datetime.utcnow().date() - datetime.timedelta(days=days-1)\n # est = tz.gettz('Europe/Amsterdam')\n # tempo...
[ "0.6918239", "0.6670805", "0.62720466", "0.6256378", "0.60689795", "0.5998587", "0.5996574", "0.5963465", "0.5952184", "0.59323317", "0.58728915", "0.5826471", "0.5763407", "0.5755451", "0.56876653", "0.56705695", "0.55962193", "0.5591352", "0.55668265", "0.5544842", "0.55122...
0.8148346
0
Sum the quantity of player's points
def sum_points(self) -> int: return sum([card.rank_value for card in self.deck.cards])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_points(self):\n total_points = 0.0\n for ingredient in self.ingredients:\n if (ingredient.has_property('ppg')):\n # Use given value if specified\n total_points += ingredient.property('ppg').to('ppg') * ingredient.quantity.to('lb')\n else:\...
[ "0.6939034", "0.6713888", "0.6518515", "0.6507416", "0.6504014", "0.6458282", "0.6399612", "0.6229231", "0.6217279", "0.6197217", "0.6190142", "0.61326945", "0.61238325", "0.6110782", "0.610348", "0.6089072", "0.60308164", "0.60287845", "0.60252935", "0.6025237", "0.60227716"...
0.7183356
0
get next page url return url string
def next_page(browser): pages = browser.find(class_='pages') for page in pages: if page.string == NEXT_PAGE: return page return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_url(request):\n next = request.REQUEST.get(\"next\", \"\")\n host = request.get_host()\n return next if next and is_safe_url(next, host=host) else None", "def get_next_page_url(self, response):\n return None", "def next_url(self):\n if self.has_next:\n kwargs = g.requ...
[ "0.8284485", "0.79817075", "0.7885116", "0.77592736", "0.7658762", "0.76225215", "0.7614582", "0.7570373", "0.7535425", "0.75084984", "0.74679697", "0.74578935", "0.7450493", "0.7414621", "0.7413333", "0.7364251", "0.7352222", "0.7235328", "0.7188004", "0.71653914", "0.706589...
0.620411
56
Get SEN information of m1.
def get_m1_m4_SEN_info(tx, ty, m1_info, y_k): """ 1 Get information from m1_info """ x_m1 = m1_info[0] y_m1 = m1_info[1] z_m = m1_info[2] t_m = z_m / 3 t_sen = m1_info[4] m1_points = m1_info[3] m1_p0 = m1_points[0] m1_p1 = m1_points[1] m1_p2 = m1_points[2] m1_p3 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_m2_m3_SEN_info(dx, dy, m_info, x_k):\n \"\"\"\n 1 Get information from m_info\n \"\"\"\n x_m = m_info[0]\n y_m = m_info[1]\n z_m = m_info[2]\n t_m = z_m / 3\n\n t_sen = m_info[4]\n\n m_points = m_info[3]\n\n m_p0 = m_points[0]\n m_p1 = m_points[1]\n m_p2 = m_points[2]\...
[ "0.62744147", "0.55263764", "0.5517202", "0.5517202", "0.5418137", "0.53576267", "0.53576267", "0.5332228", "0.53206706", "0.53069717", "0.5306769", "0.52975816", "0.5252321", "0.52439135", "0.52369094", "0.51948607", "0.51542157", "0.51261246", "0.5116743", "0.5115453", "0.5...
0.6605167
0
Make list of Y direction upper shapes points.
def Y_upper_shape_points(ix, iy, w_sen, t_sen, n_w_sen): p0 = (ix, iy) p1 = (ix - t_sen, iy - w_sen + n_w_sen / 2) p2 = (ix, iy - w_sen + n_w_sen / 2) p3 = (ix, iy - n_w_sen / 2) p4 = (ix + t_sen, iy - n_w_sen / 2) p5 = (ix + t_sen, iy + w_sen - n_w_sen / 2) p6 = (ix, iy + w_sen - n_w_sen / ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def m1_make_upper_shape_points_list(tx, ty, m1_info, SEN_info):\n \"\"\"\n 1 Get information from m1_info & SEN_info\n \"\"\"\n x_m1 = m1_info[0]\n y_m1 = m1_info[1]\n z_m = m1_info[2]\n\n m1_points = m1_info[3]\n\n m1_p0 = m1_points[0]\n m1_p1 = m1_points[1]\n m1_p2 = m1_points[2]\...
[ "0.6447427", "0.6425065", "0.6360502", "0.63538593", "0.62190753", "0.61287504", "0.6095526", "0.6071502", "0.604048", "0.5937894", "0.5934886", "0.5903958", "0.5889333", "0.5886241", "0.5779479", "0.5772985", "0.5727114", "0.5695548", "0.5695548", "0.5658319", "0.56419516", ...
0.65152735
0