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
Name of the parameter in the connection provider's oauthSettings
def redirect_url(self) -> Optional[str]: return pulumi.get(self, "redirect_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consumer_secret_setting_name(self) -> Optional[str]:\n return pulumi.get(self, \"consumer_secret_setting_name\")", "def consumer_secret_setting_name(self) -> Optional[str]:\n return pulumi.get(self, \"consumer_secret_setting_name\")", "def consumer_secret_setting_name(self) -> Optional[str]:\...
[ "0.6730077", "0.6729896", "0.6729896", "0.6729375", "0.6729375", "0.6729375", "0.6729375", "0.6729375", "0.6729323", "0.6700254", "0.6700254", "0.6700254", "0.67001635", "0.67001635", "0.670016", "0.670016", "0.670016", "0.670016", "0.670016", "0.6699782", "0.66996837", "0....
0.0
-1
Resource Id. Typically id is populated only for responses to GET requests. Caller is responsible for passing in this value for GET requests only.
def id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_id(self) -> str:\n return pulumi.get(self, \"resource_id\")", "def resource_id(self) -> str:\n return pulumi.get(self, \"resource_id\")", "def resource_id(self) -> str:\n return pulumi.get(self, \"resource_id\")", "def resource_id(self) -> str:\n return pulumi.get(sel...
[ "0.76741433", "0.76741433", "0.76741433", "0.76741433", "0.76741433", "0.74851596", "0.7474176", "0.7474176", "0.7474176", "0.7474176", "0.7474176", "0.7474176", "0.7474176", "0.7474176", "0.7240772", "0.7233173", "0.7233173", "0.7233173", "0.7233173", "0.7233173", "0.7233173...
0.0
-1
Describes a sku for a scalable resource
def __init__(__self__, *, capacity: Optional[pulumi.Input[int]] = None, family: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, size: Optional[pulumi.Input[str]] = None, tier: Optional[pulumi.Input[str]] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> str:\n return pulumi.get(self, \"sku\")", "def sku(self) -> Optional[pulumi.Input['SkuDescriptionArgs']]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> Optional[pulumi.Input['SkuDescriptionArgs']]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> pulumi.Ou...
[ "0.7357834", "0.7268822", "0.7268822", "0.71930605", "0.7077872", "0.6999866", "0.68872607", "0.6875754", "0.6875754", "0.6828445", "0.6768923", "0.6768923", "0.6768923", "0.6752089", "0.6704324", "0.66524696", "0.66524696", "0.66524696", "0.66524696", "0.6611041", "0.6519532...
0.0
-1
Family code of the resource sku
def family(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "family")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> str:\n return pulumi.get(self, \"sku\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku(self):\n return self._sku", "def sku(self):\n return self._sku", "def sku(self):\n return self._sku", "def sku(self) -> Optional[str...
[ "0.67167664", "0.6524678", "0.64252484", "0.64252484", "0.64252484", "0.64215475", "0.6234179", "0.6234179", "0.6234179", "0.6234179", "0.6204093", "0.6057572", "0.6045564", "0.6045564", "0.59305745", "0.5926704", "0.5926704", "0.5926704", "0.5926704", "0.5926704", "0.5872172...
0.5547667
35
convert the string to upper cases
def _upper(input_string): return None if input_string is None else str.upper(input_string)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_upper(s):\n return s.upper()", "def my_upper(s):\n return s.upper()", "def upper(usr_string):\n return usr_string.upper()", "def make_upper_case(s):\n return s.upper()", "def makeupper(s):\n pass", "def upper(mystr):\n print(mystr.upper())", "def make_upper(string):\n\n ...
[ "0.83490586", "0.82196754", "0.8105188", "0.7987728", "0.7986708", "0.7986146", "0.79813164", "0.779646", "0.7744573", "0.7602446", "0.7531625", "0.7464363", "0.74562734", "0.74521554", "0.7433159", "0.74174523", "0.73979014", "0.72994274", "0.72717625", "0.72186416", "0.7111...
0.7597403
10
Initialize a Gaussian GLN.
def __init__( self, output_sizes: List[int], context_dim: int, bias_len: int = 3, bias_max_mu: float = 1., bias_sigma_sq: float = 1., name: Text = "gaussian_gln"): super(GatedLinearNetwork, self).__init__( output_sizes, context_dim, inference_fn=Gate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initilize(self, mu, sig, p0):\n init = gaussian(self.x, mu, sig, p0)\n init /= np.linalg.norm(init)\n tab = {}\n for i in range(len(self.x)):\n tab[binary(i, self.n)] = init[i]\n self.initial = tab\n # initilize\n self.circ.initialize(init, self.q)", ...
[ "0.63765305", "0.6124029", "0.61033916", "0.60552305", "0.5996021", "0.5976126", "0.5956685", "0.59048134", "0.5817347", "0.58126026", "0.5795126", "0.5759751", "0.57488906", "0.57120746", "0.5649306", "0.5639631", "0.56068367", "0.55930376", "0.5587641", "0.55435807", "0.553...
0.6551519
0
Queries whether a switch is in a given state and (optionally) whether it has been in that state for the specified number of ms. Returns True if the switch_name has been in the state for the given number of ms. If ms is not specified, returns True if the switch is in the state regardless of how long it's been in that st...
def is_state(self, switch_name, state, ms=0): if self.switches[switch_name]['state'] == state: if ms <= self.ms_since_change(switch_name): return True else: return False else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_active(self, switch_name, ms=None):\n\n return self.is_state(switch_name=switch_name,\n state=1,\n ms=ms)", "def is_inactive(self, switch_name, ms=None):\n\n return self.is_state(switch_name=switch_name,\n st...
[ "0.71537125", "0.627112", "0.5469129", "0.5446338", "0.5391438", "0.5307352", "0.5154742", "0.51006985", "0.508544", "0.5071735", "0.5025925", "0.49879208", "0.49521276", "0.49464658", "0.49377018", "0.49207142", "0.4919939", "0.48921692", "0.48847666", "0.48323518", "0.48050...
0.8163731
0
Return a jinja env which will work properly with LaTeX. Assumes you want to load the templates from the filesystem, with the templates located at `template_dir`.
def get_latex_env(template_dir=TEMPLATE_DIR): return jinja2.Environment( block_start_string="\BLOCK{", block_end_string="}", variable_start_string="\VAR{", variable_end_string="}", comment_start_string="\#{", comment_end_string="}", line_statement_prefix="%%",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_jinja2(template_dir=None):\n if template_dir is None:\n template_dir = os.path.join(os.path.dirname(__file__), 'templates')\n loader = jinja2.FileSystemLoader(template_dir)\n return jinja2.Environment(loader=loader)", "def _init_template_engine(self, **options):\n defaults = {\n...
[ "0.75890666", "0.7265975", "0.7073097", "0.70338684", "0.68228114", "0.67142564", "0.66712064", "0.6605468", "0.6582855", "0.65263426", "0.64520806", "0.6448127", "0.64094377", "0.638653", "0.6376017", "0.6364421", "0.6307701", "0.62430996", "0.6229341", "0.6211297", "0.61752...
0.8208238
0
Return the file name of the image used to register this camera.
def get_file_name(self): return os.path.basename(self.get_absolute_fp())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_name(self) -> str:\n return pulumi.get(self, \"image_name\")", "def image_name(self) -> str:\n return pulumi.get(self, \"image_name\")", "def image_name(self) -> str:\n return pulumi.get(self, \"image_name\")", "def image_name(self) -> str:\n return pulumi.get(self, \"im...
[ "0.7722355", "0.7722355", "0.7722355", "0.77223146", "0.7721602", "0.7511443", "0.7509308", "0.73990154", "0.73959345", "0.72999996", "0.72850335", "0.7081833", "0.7066916", "0.7063627", "0.7051609", "0.7017336", "0.70085233", "0.6962072", "0.6945603", "0.6936811", "0.6934756...
0.0
-1
Return the absolute file path of the corresponding image.
def get_absolute_fp(self): return self._get_absolute_fp(self._relative_fp, self._absolute_fp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_path(fname):\n root = Path(__file__).parent.parent\n return str((root / \"images\" / Path(fname)).resolve())", "def path(self):\n\t\treturn self.image.path", "def image_path(self, image_index):\r\n return os.path.join(self.base_dir, self.image_names[image_index])", "def imPath(filename...
[ "0.80912375", "0.8040363", "0.77755696", "0.77181804", "0.76495963", "0.7583317", "0.7539042", "0.7467688", "0.74429405", "0.7433483", "0.7430034", "0.7388754", "0.73282164", "0.7295874", "0.7243998", "0.7235302", "0.7217217", "0.71872026", "0.7177051", "0.7172344", "0.714943...
0.0
-1
Set the camera rotation using a quaternion.
def set_rotation_with_quaternion(self, quaternion): self._quaternion = quaternion # We must change the rotation matrixes as well. self._rotation_mat = Camera.quaternion_to_rotation_matrix(quaternion)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_rotation_with_rotation_mat(\n self, rotation_mat, check_rotation=True\n ):\n if check_rotation:\n assert self.__class__._is_rotation_mat_valid(rotation_mat)\n self._rotation_mat = rotation_mat\n # We must change the quaternion as well.\n self._quaternion = C...
[ "0.6681056", "0.66621006", "0.6652113", "0.6524144", "0.6463717", "0.63801384", "0.6355382", "0.6296078", "0.6234998", "0.6234998", "0.6220917", "0.61284286", "0.6081595", "0.59584355", "0.59584355", "0.5958364", "0.5958364", "0.59538263", "0.5915619", "0.5894907", "0.5889752...
0.8195128
0
Return the rotation as quaternion.
def get_rotation_as_quaternion(self): return self._quaternion
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asQuaternion(self):\n return Quaternion(xform.quaternion_from_matrix(self.matrix))", "def _get_rotation(self, elem: MjcfElement) -> Quaternion:\n if _is_worldbody(elem) or elem.axisangle is None:\n return quaternions.qeye()\n axisangle = elem.axisangle\n return quaternions.axangle2quat(a...
[ "0.8207338", "0.7652604", "0.7596548", "0.7596548", "0.7538894", "0.7538894", "0.74244016", "0.74244016", "0.7345304", "0.7345304", "0.7339378", "0.7261634", "0.7261634", "0.72567546", "0.72567546", "0.7223627", "0.7152841", "0.7152841", "0.7138973", "0.7138973", "0.712518", ...
0.87160003
0
Return the rotation as rotation matrix.
def get_rotation_as_rotation_mat(self): return self._rotation_mat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rotation_matrix(self):\n return self.rotation_matrix", "def generate_rotation_matrix(self):\n phi = self.get_phi()\n theta = self.get_theta()\n gamma = self.get_gamma()\n matrices = [\n rotation_about_z(-theta - 90 * DEGREES),\n rotation_matrix(-ph...
[ "0.8337491", "0.8026141", "0.792876", "0.7911356", "0.7863819", "0.7826764", "0.7802478", "0.7791388", "0.7772076", "0.7642711", "0.7640726", "0.7606014", "0.7488296", "0.7380272", "0.73152727", "0.72436315", "0.72125244", "0.71893185", "0.7176654", "0.71740097", "0.7172836",...
0.86332226
0
Convert a quaternion to a rotation matrix.
def quaternion_to_rotation_matrix(q): # Original C++ method ('SetQuaternionRotation()') is defined in # pba/src/pba/DataInterface.h. # Parallel bundle adjustment (pba) code (used by visualsfm) is provided # here: http://grail.cs.washington.edu/projects/mcba/ qq = math.sqrt(q[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_to_matrix(quaternions: torch.Tensor) ->torch.Tensor:\n r, i, j, k = torch.unbind(quaternions, -1)\n two_s = 2.0 / (quaternions * quaternions).sum(-1)\n o = torch.stack((1 - two_s * (j * j + k * k), two_s * (i * j - k * r), two_s * (i * k + j * r), two_s * (i * j + k * r), 1 - two_s * (i * i...
[ "0.8121229", "0.78885585", "0.7865551", "0.78639984", "0.7828828", "0.7728514", "0.77133477", "0.77035856", "0.7695731", "0.7625228", "0.75021416", "0.74919164", "0.73559487", "0.73559487", "0.7328954", "0.7293606", "0.7241069", "0.723012", "0.7203547", "0.717544", "0.717544"...
0.84793204
0
Convert a rotation matrix to a quaternion.
def rotation_matrix_to_quaternion(m): # Original C++ method ('GetQuaternionRotation()') is defined in # pba/src/pba/DataInterface.h # Parallel bundle adjustment (pba) code (used by visualsfm) is provided # here: http://grail.cs.washington.edu/projects/mcba/ q = np.array([0, 0, 0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotmat2quaternion(rotmat):\n qw = np.sqrt(1.0 + rotmat[0][0] + rotmat[1][1] + rotmat[2][2]) / 2.0\n qx = (rotmat[2][1] - rotmat[1][2]) / (4.0 * qw)\n qy = (rotmat[0][2] - rotmat[2][0]) / (4.0 * qw)\n qz = (rotmat[1][0] - rotmat[0][1]) / (4.0 * qw)\n return qx, qy, qz, qw", "def _get_quat_from_...
[ "0.77048665", "0.75605917", "0.7501796", "0.74892473", "0.7480807", "0.7463537", "0.7463537", "0.7405495", "0.726631", "0.7258552", "0.7258552", "0.7133546", "0.7133546", "0.7120037", "0.7079512", "0.70715636", "0.70669454", "0.70618325", "0.7049991", "0.69842964", "0.6967952...
0.78743976
0
Return the depth map file path.
def get_depth_map_fp(self): return self._depth_map_fp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_depth_map(self):\n if os.path.isfile(self._depth_map_fp):\n return self._depth_map_callback(self._depth_map_fp)\n else:\n return None", "def get_file_path(map_code):\n return config.MAP_IMAGES_FOLDER + map_code + \".png\"", "def get_map(filename):\n return os.p...
[ "0.7089484", "0.63373494", "0.6271035", "0.62357116", "0.61069924", "0.602428", "0.59198457", "0.5913233", "0.57797146", "0.5757265", "0.57485753", "0.573979", "0.57078147", "0.570072", "0.56994355", "0.5649018", "0.56399715", "0.5634188", "0.562809", "0.5622644", "0.55982167...
0.67586064
1
Make random text of given length (using ngrams of the given n).
def generate(self, length=100, n=3): word_dict = self.make_dictionary(n) seed_no = randint(0,len(self.words)-n) # choose random seed output = [self.words[seed_no+x] for x in range(n-1)] for x in range(n-1, length): next_key = tuple(output[-(n-1):]) output.append(c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_ngrams(sequence, n=3):\n ngrams = [ ]\n for i in xrange(len(sequence)-n+1):\n ngrams.append(sequence[i:(i+n)])\n return ngrams", "def ngrams(n, text):\n for i in range(num_ngrams(n, text)):\n yield text[i:i+n]", "def n_gram(sentence,n):\n\tif len(sentence) <= n:\n\t\tretu...
[ "0.72863626", "0.72310996", "0.7159336", "0.7142413", "0.7113002", "0.7062042", "0.7001911", "0.6971216", "0.6953356", "0.6950292", "0.69012743", "0.68767244", "0.6863345", "0.685005", "0.68051577", "0.68014234", "0.6783044", "0.6769917", "0.676959", "0.6760846", "0.67501736"...
0.7564615
0
Get User's ID from the current session
def get_user_id(sid): # Find UID from SID query = { "sid": sid } query_result = [i for i in db_sessions.find(query)] # Get UID if len(query_result) == 1: uid = query_result[0]["uid"] return uid else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_id(self):\n return self.authenticate()['user_id']", "def fetch_current_user_id(self):\n response = self._spotify.current_user()\n return response['id']", "def get_user_id(self):\n return self.socket.user_id", "def get_user_id(self):\n\n user_profile_results = s...
[ "0.8345867", "0.802345", "0.8006966", "0.80067575", "0.7995825", "0.7967028", "0.7957991", "0.794295", "0.79014504", "0.789034", "0.78249615", "0.7810212", "0.7780275", "0.7777369", "0.7777369", "0.7743978", "0.7734", "0.7725657", "0.7725657", "0.7720495", "0.76741815", "0....
0.0
-1
Get current session ID of user
def get_sid(): try: # Get SID sid = request.cookies.get('tourisitapp-sid') return sid except BaseException: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_get_current_user_id(self):\n\n response = self.user_get_current_user()\n return response['uri'].split('spotify:user:', 1)[1]", "def fetch_current_user_id(self):\n response = self._spotify.current_user()\n return response['id']", "def get_user_id(self):\n return self....
[ "0.81012976", "0.8051182", "0.8029003", "0.7955219", "0.7939613", "0.793872", "0.7839134", "0.7784967", "0.77716583", "0.77716583", "0.77716583", "0.7755319", "0.7746798", "0.7741471", "0.76846", "0.7683238", "0.76789963", "0.76693285", "0.76520264", "0.7620316", "0.7608114",...
0.0
-1
To compare old hash to new password (unencoded). For use during password changes.
def check_password_correlate(raw_incoming_password, current_password_hash): # Encode password in byte literals incoming_password = raw_incoming_password.encode('utf-8') # Check whether passwords match if not bcrypt.checkpw(incoming_password, current_password_hash): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def same_password_as_old(self, username: str, new_password: str) -> bool:\n\n return self.database.read_database()[username] == new_password", "def testCheckDifferentPassword(self):\n password = u'password'\n hashedPassword = hashPassword(password)\n\n password2 = u'password2'\n ...
[ "0.7543884", "0.7316927", "0.7016863", "0.68231064", "0.6794183", "0.67119104", "0.67119104", "0.6697498", "0.669616", "0.66669875", "0.66447043", "0.6641109", "0.6581223", "0.6577709", "0.6577709", "0.6459108", "0.6440075", "0.63842773", "0.63725567", "0.6318504", "0.6290751...
0.67283833
5
The size of the queue.
def size(self): return ray.get(self.actor.qsize.remote())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_length(self):\n return self.queue.qsize()", "def queue_size(self):\n\n\t\treturn len(self.q)", "def size(self):\r\n\r\n return len(self.queue)", "def qsize(self):\r\n return len(self.queue)", "def queue_length(self, queue):\n return len(queue)", "def qsize(self):\n ...
[ "0.9007027", "0.89759207", "0.89604145", "0.8948156", "0.84761155", "0.8440821", "0.84096926", "0.8399419", "0.83426845", "0.8337393", "0.82303417", "0.81693906", "0.81403375", "0.8132251", "0.8113401", "0.80770296", "0.80770296", "0.80453503", "0.8043641", "0.8036332", "0.80...
0.792051
28
The size of the queue.
def qsize(self): return self.size()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_length(self):\n return self.queue.qsize()", "def queue_size(self):\n\n\t\treturn len(self.q)", "def size(self):\r\n\r\n return len(self.queue)", "def qsize(self):\r\n return len(self.queue)", "def queue_length(self, queue):\n return len(queue)", "def qsize(self):\n ...
[ "0.90055984", "0.897432", "0.8960492", "0.89468145", "0.8474924", "0.84405696", "0.8409245", "0.8399283", "0.8342126", "0.8336891", "0.8228846", "0.81689894", "0.81410795", "0.8132399", "0.81139326", "0.8076551", "0.8076551", "0.8048474", "0.80430233", "0.8007508", "0.8003260...
0.8036554
19
Whether the queue is empty.
def empty(self): return ray.get(self.actor.qsize.remote())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsEmpty(self):\r\n return len(self._queue) == 0", "def is_empty(self):\n return len(self._queue) == 0", "def is_empty(self):\n if self.queue:\n return False\n return True", "def empty(self):\n return len(self.queue) == 0", "def empty(self):\n return len(...
[ "0.9372922", "0.9339339", "0.9332995", "0.926483", "0.926483", "0.9230871", "0.92251945", "0.91953754", "0.91938823", "0.9180779", "0.9152453", "0.9074911", "0.90485716", "0.8972323", "0.88227385", "0.87529385", "0.87233055", "0.86484843", "0.8643161", "0.8623994", "0.8623994...
0.0
-1
Whether the queue is full.
def full(self): return ray.get(self.actor.full.remote())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_is_full(self):\r\n return True if len(self.queue) == self.size else False", "def is_full(self):\n if self.size == len(self.queue):\n return True\n return False", "def queue_full(self) -> bool:\n return self._queue_maxlen is not None and len(self.queue()) >= self...
[ "0.938646", "0.9066673", "0.90183294", "0.8653742", "0.8560093", "0.85078174", "0.84704274", "0.84590346", "0.83999103", "0.83999103", "0.8368929", "0.8311815", "0.830494", "0.8294032", "0.8285481", "0.8216445", "0.8204323", "0.8202158", "0.81925315", "0.8142496", "0.8130247"...
0.0
-1
Encrypts a string using bcrypt algorithm is data to be encrypted returns bcrypt encrypted text
def encrypt( self, raw_text ): raw_text = (raw_text) # - AES requires its bnlocks to be of size mod 16 # - However we don't want unusable characters in a password # - First Pipe "|" delimits the padding from the password # - Then Tilde "~" acts as padding. if len(raw_text)%16 != 0: raw_text = raw_text+"|...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __encrypt(self, string):\r\n return self.crypt.encrypt(string)", "def fernet_encrypt(text, password, salt):\n fernet = Fernet(base64.urlsafe_b64encode(derive_encryption_key(salt, password)))\n return force_text(fernet.encrypt(force_bytes(text)))", "def encrypt(text: str) -> str:\n secret_ke...
[ "0.7683718", "0.71921974", "0.7136913", "0.7054013", "0.6880241", "0.6840293", "0.6834764", "0.6827026", "0.67681503", "0.6758127", "0.6750101", "0.673403", "0.66891223", "0.66816074", "0.6658332", "0.66302925", "0.6616415", "0.6613726", "0.6598003", "0.65970325", "0.65837395...
0.7146284
2
Return a `MessageDeletionContext` based on the given data. In addition to the normal attributes expected by the `MessageDeletionContext` model itself, this serializer also allows for passing the `deletedmessage_set` element which contains messages that were deleted as part of this context.
def create(self, validated_data: dict) -> MessageDeletionContext: messages = validated_data.pop('deletedmessage_set') deletion_context = MessageDeletionContext.objects.create(**validated_data) for message in messages: DeletedMessage.objects.create( deletion_context=de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, token, message_id=\"@original\"):\n req_url = f\"/messages/{message_id}\"\n return self.command_response(token, True, \"DELETE\", url_ending=req_url)", "def _object2proto(self) -> DeleteDatasetMessage_PB:\n return DeleteDatasetMessage_PB(\n msg_id=serialize(self.i...
[ "0.5433566", "0.5116952", "0.50301397", "0.49750295", "0.49743682", "0.49662384", "0.49401626", "0.4925447", "0.49083516", "0.47993663", "0.477219", "0.47310057", "0.4718139", "0.46869516", "0.4638746", "0.4637141", "0.45971718", "0.45967442", "0.45925474", "0.4592067", "0.45...
0.77717817
0
Return the dictionary representation of this infraction.
def to_representation(self, instance: Infraction) -> dict: ret = super().to_representation(instance) user = User.objects.get(id=ret['user']) user_data = UserSerializer(user).data ret['user'] = user_data actor = User.objects.get(id=ret['actor']) actor_data = UserSerializ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict(self):\n return {'ID': self.ID,\n 'id': self.ID,\n 'Name': self.Name,\n 'Percentage': str(self.Percentage),\n 'Amount': self.Amount,\n 'Type': self.Type}", "def as_dict(self):\n return {\"lattice\": self.lattice.as_...
[ "0.7225474", "0.7191565", "0.7147013", "0.69966334", "0.69863236", "0.6900685", "0.6888614", "0.6858757", "0.6846067", "0.68422526", "0.68176717", "0.6807335", "0.6807335", "0.6805812", "0.6805812", "0.6805812", "0.6805812", "0.6805812", "0.6801148", "0.67816585", "0.6772237"...
0.0
-1
Return the representation of this `OffTopicChannelName`. This only returns the name of the off topic channel name. As the model only has a single attribute, it is unnecessary to create a nested dictionary. Additionally, this allows off topic channel name routes to simply return an array of names instead of objects, sav...
def to_representation(self, obj: OffTopicChannelName) -> str: return obj.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_name(self):\n return self._channel_name_dict", "def __unicode__(self):\n return self.topic_name", "def __str__(self):\n \n return self.name", "def channel_name(self):\n\n return self.channel.name if self.channel is not None else None", "def __str__(self):\n\n ...
[ "0.57056534", "0.53963417", "0.50951934", "0.5026663", "0.49552906", "0.49552906", "0.49552906", "0.49371034", "0.49170935", "0.49155015", "0.49155015", "0.4909416", "0.49024114", "0.4867316", "0.4840904", "0.48338896", "0.4814025", "0.47989646", "0.47989646", "0.47989646", "...
0.77668965
0
Format a time in seconds.
def format_seconds(self, n_seconds): func = self.ok if n_seconds >= 60: n_minutes, n_seconds = divmod(n_seconds, 60) return "%s minutes %s seconds" % ( func("%d" % n_minutes), func("%.3f" % n_seconds)) else: retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_time(seconds):\n hours, remainder = divmod(seconds, 3600)\n minutes, seconds = divmod(remainder, 60)\n\n hours = int(hours)\n minutes = int(minutes)\n\n if hours > 0:\n return \"%sh %sm %ss\" % (hours, minutes, seconds)\n\n if minutes > 0:\n return \"%sm %ss\" % (minutes...
[ "0.74643886", "0.7449885", "0.73987776", "0.72961044", "0.7259979", "0.72286785", "0.71829057", "0.7161476", "0.71610266", "0.71605456", "0.7085837", "0.707831", "0.6989485", "0.6981634", "0.6976392", "0.69329745", "0.69306767", "0.68853587", "0.6884453", "0.68829775", "0.684...
0.765163
0
Appends an item at the end of the list
def append(self, item): self.tempfile.seek(0, 2) # Seek the EOF data = pickle.dumps(item) self.item_offsets.append(self.tempfile.tell()) self.item_sizes.append(len(data)) self.tempfile.write(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, item):\n self.insert_rear(item)", "def append(self,item):\n self.add(item)", "def append(self, item):\n self.insert(item, self._size)", "def append(self, item):\n list.append(self, item)\n del self[0]", "def add_last(self, new_item):\n has_space_le...
[ "0.7634821", "0.75134695", "0.7436532", "0.7422834", "0.7416729", "0.7389691", "0.7364932", "0.7358675", "0.73220557", "0.7261975", "0.71850973", "0.71614265", "0.71221334", "0.70941097", "0.7092253", "0.7033707", "0.70280284", "0.70272905", "0.6972076", "0.6940703", "0.68828...
0.0
-1
Get interval value in cents.
def get_cents(self) -> float: return self._cents
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n centimeters = self.counter.getPeriod() / 0.000010\n return units.convert(units.centimeter, self.output_units, centimeters)", "def interval(self) -> float:\n return self._interval", "def native_value(self) -> float | None:\n interval = self.coordinator.data[self.enti...
[ "0.6491831", "0.63116723", "0.615634", "0.6098489", "0.6024857", "0.6002346", "0.5984564", "0.59634143", "0.5935948", "0.59107196", "0.5894807", "0.58939683", "0.5888046", "0.58308905", "0.57527435", "0.5752013", "0.5743224", "0.57150745", "0.5713788", "0.56638896", "0.564277...
0.64560354
1
Get interval value in halfsteps + detune.
def get_halfsteps(self) -> (int, float): halfsteps = int(self._cents/100) detune = self._cents - 100*halfsteps while detune >= 50: halfsteps += 1 detune -= 100 while detune < -50: halfsteps -= 1 detune += 100 return halfsteps, detun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interval(self) -> float:\n return self._interval", "def s_interval(self) -> float:\n return self._s_interval", "def _get_adjust_interval(self):\n return self.__adjust_interval", "def _get_adjust_interval(self):\n return self.__adjust_interval", "def _get_adjust_interval(self):\n ...
[ "0.6711152", "0.6387367", "0.6350016", "0.6350016", "0.6350016", "0.6350016", "0.6350016", "0.6350016", "0.6350016", "0.6350016", "0.63165605", "0.62683606", "0.6199652", "0.6182966", "0.6157061", "0.61185837", "0.61185837", "0.61185837", "0.6118268", "0.6118268", "0.6118268"...
0.65574235
1
Dump a python object as a dill file. The file can then be loaded by function load_object()
def save_object(obj, filename): with open(filename,'wb+') as f: f = open(filename, "wb") dill.dump(obj, f) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump(object, **kwds):\n file = BytesIO()\n dill.dump(object, file)\n file.seek(0)\n return file", "def object_dump(object, filename):\n with open(filename, \"wb\") as f:\n pickle.dump(\n obj = object,\n file = f\n )", "def dumpIO(object...
[ "0.7921668", "0.747105", "0.74528855", "0.74121416", "0.7338981", "0.72755045", "0.7165364", "0.71434623", "0.71434623", "0.7098731", "0.70722765", "0.6990555", "0.6989389", "0.69238484", "0.6915227", "0.689114", "0.688955", "0.68640935", "0.6824124", "0.6819787", "0.68099004...
0.76746184
1
Test a valid approved application ends in the correct state.
def test_start_authorisation_approved_application_has_no_errors(ilb_admin_client, wood_application): wood_application.decision = wood_application.APPROVE # Set licence details _set_valid_licence(wood_application) # Create the checklist (fully valid) _add_valid_checklist(wood_application) wood...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_start_authorisation_approved_application_has_errors(ilb_admin_client, wood_application):\n\n wood_application.decision = wood_application.APPROVE\n # Create an open update request\n wood_application.update_requests.create(status=UpdateRequest.Status.OPEN)\n wood_application.save()\n\n respo...
[ "0.6391842", "0.6332567", "0.63182396", "0.61254257", "0.6033517", "0.6020442", "0.6019772", "0.59805423", "0.59711325", "0.5818521", "0.58026356", "0.57835394", "0.57376647", "0.5722659", "0.5715782", "0.5668488", "0.5629049", "0.5625975", "0.5624382", "0.5608136", "0.560075...
0.6474533
0
boxoverlap computes intersection over union for bbox a and b in KITTI format. If the criterion is 'union', overlap = (a inter b) / a union b). If the criterion is 'a', overlap = (a inter b) / a, where b should be a dontcare area.
def boxoverlap(self,a,b,criterion="union"): x1 = max(a.x1, b.x1) y1 = max(a.y1, b.y1) x2 = min(a.x2, b.x2) y2 = min(a.y2, b.y2) w = x2-x1 h = y2-y1 if w<=0. or h<=0.: return 0. inter = w*h aarea = (a.x2-a.x1) * (a.y2-a.y1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iou_bbox(box1, box2):\n #determine the (x, y)-coordinates of the intersection rectangle\n xA = max(box1[0], box2[0])\n yA = max(box1[1], box2[1])\n xB = min(box1[2], box2[2])\n yB = min(box1[3], box2[3])\n\n # compute the area of intersection rectangle\n interArea = max(0, xB - xA + 1) * m...
[ "0.7192226", "0.71857333", "0.7175004", "0.70288235", "0.6972517", "0.6961435", "0.69043547", "0.68833834", "0.68599284", "0.684158", "0.6838231", "0.6836744", "0.68300426", "0.6776578", "0.6769655", "0.67559904", "0.6727968", "0.67263734", "0.67263734", "0.67056435", "0.6682...
0.79783195
0
Returns distance from each Node to parent EnergyMeter. Corresponds to sequence in AllBusVmag. Argument2 must be 0.
def circuit_all_node_distances(self) -> List[float]: return Bridge.var_array_function(self.dss_obj.CircuitV, 13, None, '')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self) -> float:\n dist = 0\n\n def calculateDistance(x1, y1, x2, y2) -> float:\n dist = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n return dist\n\n for i in range(len(self.vertices) - 1):\n current = self[i]\n next = self[i + 1]\n\n ...
[ "0.63839823", "0.59103656", "0.5835825", "0.563432", "0.5585734", "0.5580295", "0.55467373", "0.5544848", "0.5542622", "0.5541992", "0.5514708", "0.54768974", "0.5441624", "0.54231644", "0.54027265", "0.54022455", "0.53829765", "0.53829765", "0.5379167", "0.5378442", "0.53783...
0.56654775
3
Returns array of doubles representing the voltage magnitudes for nodes on the specified phase. The phase must be specified in the Argument2.
def circuit_all_node_vmag_by_phase(self, argument: int = 1) -> List[float]: argument = Base.check_int_param(argument, default=1) # Phase 1 as default return Bridge.var_array_function(self.dss_obj.CircuitV, 14, argument, '')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circuit_all_node_distances_by_phase(self, argument: int = 1) -> List[float]:\n argument = Base.check_int_param(argument, default=1) # Phase 1 as default\n return Bridge.var_array_function(self.dss_obj.CircuitV, 16, argument, '')", "def circuit_all_node_vmag_pu_by_phase(self, argument: int = 1)...
[ "0.6497774", "0.63988864", "0.5661982", "0.5166508", "0.51370937", "0.5107083", "0.5086197", "0.5040058", "0.5038658", "0.49917063", "0.4980506", "0.4951739", "0.49335802", "0.49273276", "0.49112922", "0.49022058", "0.48792335", "0.48747322", "0.48443243", "0.483355", "0.4824...
0.6601783
0
Returns array of doubles representing the voltage magnitudes (in per unit) for nodes on the specified phase. The phase must be specified in the Argument2.
def circuit_all_node_vmag_pu_by_phase(self, argument: int = 1) -> List[float]: argument = Base.check_int_param(argument, default=1) # Phase 1 as default return Bridge.var_array_function(self.dss_obj.CircuitV, 15, argument, '')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circuit_all_node_distances_by_phase(self, argument: int = 1) -> List[float]:\n argument = Base.check_int_param(argument, default=1) # Phase 1 as default\n return Bridge.var_array_function(self.dss_obj.CircuitV, 16, argument, '')", "def circuit_all_node_vmag_by_phase(self, argument: int = 1) ->...
[ "0.6585442", "0.65071553", "0.57232827", "0.50453144", "0.49945468", "0.4961375", "0.49385372", "0.4921324", "0.49149904", "0.49122864", "0.48873448", "0.4885358", "0.488052", "0.48773143", "0.48646525", "0.48576376", "0.48500508", "0.48494828", "0.48357534", "0.48103115", "0...
0.64304316
2
Determine if the LKGR lag is acceptable for current commit activity. Returns True if the lag is within acceptable thresholds.
def CheckLKGRLag(lag_age, rev_gap, allowed_lag_hrs, allowed_rev_gap): # Lag isn't an absolute threshold because when things are slow, e.g. nights # and weekends, there could be bad revisions that don't get noticed and # fixed right away, so LKGR could go a long time without updating, but it # wouldn't be a big ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CheckLKGRLag(lag_age, rev_gap, allowed_lag_hrs, allowed_rev_gap):\n # Lag isn't an absolute threshold because when things are slow, e.g. nights\n # and weekends, there could be bad revisions that don't get noticed and\n # fixed right away, so LKGR could go a long time without updating, but it\n # wouldn't ...
[ "0.7870381", "0.63054264", "0.6015699", "0.5816762", "0.5800152", "0.57671744", "0.57664144", "0.5686108", "0.55820006", "0.55542254", "0.5510351", "0.54873306", "0.5456209", "0.5444214", "0.5441991", "0.542467", "0.5422946", "0.5390469", "0.53891927", "0.5387561", "0.5386941...
0.7877701
0
This function converts a string to a boolean.
def str2bool(string): return string.lower() in ("yes", "y", "true", "t", "1")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_to_bool(s):\n if s == 'True':\n return True\n elif s == 'False':\n return False", "def _string_to_bool(self, string):\n if string.lower() in ['true', '1', 't', 'y', 'yes']:\n return True\n if string.lower() in ['false', '0', 'n', 'f', 'no']:\n retur...
[ "0.8956001", "0.8909848", "0.8890198", "0.86419916", "0.8627908", "0.85400355", "0.85376906", "0.85212547", "0.85093015", "0.84992576", "0.8478435", "0.8446971", "0.843026", "0.8423972", "0.842053", "0.842053", "0.842053", "0.842053", "0.842053", "0.84119034", "0.83842856", ...
0.8479929
11
This function converts a string to a boolean.
def str2bool(string): return string.lower() in ("yes", "y", "true", "t", "1")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_to_bool(s):\n if s == 'True':\n return True\n elif s == 'False':\n return False", "def _string_to_bool(self, string):\n if string.lower() in ['true', '1', 't', 'y', 'yes']:\n return True\n if string.lower() in ['false', '0', 'n', 'f', 'no']:\n retur...
[ "0.8956001", "0.8909848", "0.8890198", "0.86419916", "0.8627908", "0.85400355", "0.85376906", "0.85212547", "0.85093015", "0.84992576", "0.8478435", "0.8446971", "0.843026", "0.8423972", "0.842053", "0.842053", "0.842053", "0.842053", "0.842053", "0.84119034", "0.83842856", ...
0.8479929
10
Get an index class by its name (such as recipe or ingredient).
def get_index(self, name): index = self._indexes.get(name) if not index: raise ValueError("Index '%s' not found." % name) return index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_index_class(self):\n return self.data['class']", "def class_to_index(self, class_name):\n return self.classes.index(class_name)", "def category_class_by_index(self, index):\r\n\t\treturn self.categories[index]['index']", "def index_of(self, name):\n return self.get_by_hierarchy(n...
[ "0.7472635", "0.6943264", "0.6708831", "0.6682162", "0.6655154", "0.64492035", "0.6389343", "0.6264391", "0.6190284", "0.61305195", "0.6113316", "0.6009363", "0.6002012", "0.5939367", "0.5866932", "0.5826597", "0.5803544", "0.57882637", "0.5754799", "0.5709087", "0.56898785",...
0.6221474
8
Base objective function. Overload this function and create your own objective function. Make sure that the return value is a scalar. Furthermore, the parameter vector xk is always a numpy array.
def obj(self, xk, *args): raise NotImplementedError(f'{self.__class__.__name__}.obj function is not defined')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def objective(self, x):\n pass", "def objective_function(self, x):\n pass", "def objective(self, *xs, y):\n warnings.warn(\"objective function not implemented\")\n return None", "def objective_function(self, x, **kwargs):\n\n external_sum = 0\n for i in range(4):\n ...
[ "0.77267724", "0.76699394", "0.68200654", "0.6647109", "0.6540071", "0.6538879", "0.64900273", "0.6485413", "0.6394169", "0.6265814", "0.6174913", "0.61736465", "0.61684686", "0.61599934", "0.6150122", "0.6146777", "0.60807616", "0.6063189", "0.6044503", "0.5990826", "0.59721...
0.0
-1
Return the default config or kwargs for the given framework. The default values are extracted of the corresponding framework directly.
def get_default_config(framework: str) -> dict: if framework.lower() == "scipy_minimize": return {"tol": None, "options": None, "constraints": None, "jac": None, "hess": None, "hessp": None} i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(self):\n framework = self.framework_combobox.currentText()\n if framework == '':\n framework = None\n return Config(framework=framework, wdir=self.wdir_lineedit.text())", "def framework(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"framewo...
[ "0.64739543", "0.6207953", "0.61681575", "0.5981865", "0.5864169", "0.57945335", "0.56894314", "0.56671816", "0.55625516", "0.5527689", "0.5466565", "0.5404926", "0.53994197", "0.5392593", "0.5330926", "0.5330926", "0.53255963", "0.53181636", "0.5311141", "0.530183", "0.52674...
0.72662044
0
The Amazon Resource Name (ARN) for the private CA to issue the certificate.
def certificate_authority_arn(self) -> pulumi.Input[str]: return pulumi.get(self, "certificate_authority_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def certificate_authority_arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"certificate_authority_arn\")", "def ca_certificate(self) -> str:\n return pulumi.get(self, \"ca_certificate\")", "def ca_certificate(self) -> str:\n return pulumi.get(self, \"ca_certificate\")", "def c...
[ "0.72947055", "0.6743838", "0.6743838", "0.6522364", "0.6480458", "0.64509106", "0.63189715", "0.62622637", "0.6161559", "0.611074", "0.60982895", "0.6040707", "0.5999948", "0.5999948", "0.5999948", "0.5999948", "0.5999948", "0.5999948", "0.5999948", "0.5995401", "0.5971057",...
0.7190225
1
The time before which the Certificate will be valid.
def validity(self) -> pulumi.Input['CertificateValidityArgs']: return pulumi.get(self, "validity")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_before_time(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"valid_before_time\")", "def validity_not_before(self) -> pulumi.Output[Optional['outputs.CertificateValidity']]:\n return pulumi.get(self, \"validity_not_before\")", "def startDate(self):\n asn1 = _X509_get_notB...
[ "0.6922605", "0.6761013", "0.6757104", "0.66998553", "0.6652087", "0.65565294", "0.64816356", "0.64136547", "0.6316001", "0.6308891", "0.6287711", "0.6265408", "0.61756337", "0.61559826", "0.6086948", "0.6063249", "0.5954358", "0.5954358", "0.5954358", "0.5953387", "0.5953387...
0.56148326
85
The ARN of the issued certificate.
def arn(self) -> pulumi.Output[str]: return pulumi.get(self, "arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def certificate_authority_arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"certificate_authority_arn\")", "def certificate_authority_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"certificate_authority_arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn...
[ "0.7615652", "0.7462342", "0.71060413", "0.71060413", "0.71060413", "0.71060413", "0.71060413", "0.71060413", "0.71060413", "0.6827931", "0.67384124", "0.67384124", "0.67384124", "0.67384124", "0.67384124", "0.67384124", "0.67384124", "0.67264605", "0.67128223", "0.6646443", ...
0.7141737
16
The issued certificate in base 64 PEMencoded format.
def certificate(self) -> pulumi.Output[str]: return pulumi.get(self, "certificate")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_certificate_base64_string(self):\n return self._sign_certificate_base64_string", "def encoded_pem_certificate(self) -> Optional[str]:\n return pulumi.get(self, \"encoded_pem_certificate\")", "def encoded_pem_certificate(self) -> Optional[str]:\n return pulumi.get(self, \"encoded_p...
[ "0.7578374", "0.728154", "0.728154", "0.7231096", "0.7085007", "0.70320064", "0.7009671", "0.68149024", "0.6814398", "0.68034065", "0.67994356", "0.67994356", "0.6734123", "0.6727668", "0.6701862", "0.6701862", "0.66573656", "0.6572205", "0.6550897", "0.6476944", "0.64724916"...
0.7211817
4
The Amazon Resource Name (ARN) for the private CA to issue the certificate.
def certificate_authority_arn(self) -> pulumi.Output[str]: return pulumi.get(self, "certificate_authority_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def certificate_authority_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"certificate_authority_arn\")", "def ca_certificate(self) -> str:\n return pulumi.get(self, \"ca_certificate\")", "def ca_certificate(self) -> str:\n return pulumi.get(self, \"ca_certificate\")", "def ce...
[ "0.7188554", "0.6744807", "0.6744807", "0.6523552", "0.648058", "0.6450081", "0.631931", "0.6262704", "0.6163072", "0.6110699", "0.6099822", "0.60403275", "0.5995511", "0.5995511", "0.5995511", "0.5995511", "0.5995511", "0.5995511", "0.5995511", "0.59895295", "0.5969144", "...
0.7292339
0
The time before which the Certificate will be valid.
def validity(self) -> pulumi.Output['outputs.CertificateValidity']: return pulumi.get(self, "validity")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_before_time(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"valid_before_time\")", "def validity_not_before(self) -> pulumi.Output[Optional['outputs.CertificateValidity']]:\n return pulumi.get(self, \"validity_not_before\")", "def startDate(self):\n asn1 = _X509_get_notB...
[ "0.6923524", "0.6761998", "0.6757813", "0.6701025", "0.66531396", "0.6556659", "0.64825267", "0.6414163", "0.63166237", "0.6309581", "0.6288014", "0.62663996", "0.61769176", "0.6156558", "0.6088267", "0.6064304", "0.5954548", "0.5954548", "0.5954548", "0.5953584", "0.5953584"...
0.0
-1
The movie trailer is diplayed in a web browser.
def show_trailer(self): webbrowser.open(self.trailer_youtube_url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_trailer(self):\n webbrowser.open(self.yt_trailer_url)", "def show_trailer(self):\n\t\twebbrowser.open(self.trailer_url)", "def show_trailer(self):\r\n\t\twebbrowser.open(self.trailer_youtube_url)", "def show_trailer(self):\n\t\twebbrowser.open(self.trailer_youtube_url)", "def show_trailer(s...
[ "0.8347036", "0.8305178", "0.82863295", "0.8283321", "0.82569087", "0.82569087", "0.8199774", "0.8199774", "0.81684464", "0.813548", "0.8124871", "0.81179786", "0.80994755", "0.806039", "0.8047219", "0.80088764", "0.7982566", "0.7931576", "0.7634368", "0.73474884", "0.6287435...
0.8214627
15
Draw id_string on (x, y)
def draw_id(x, y, id_string): plt.annotate( id_string, xy=(x, y), xytext=(40, -40), textcoords='offset points', ha='right', va='bottom', bbox=dict(boxstyle='round,pad=0.5', fc='green', alpha=0.5), arrowprops=dict(arrowstyle='->', connectionstyle='arc3,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_ego_id(canvas, ego_id):\n canvas.drawString(left_margin, page_begin_y - top_margin, f'Case ID: {ego_id[0]}')\n canvas.drawString(left_margin, page_begin_y - top_margin - 10, f'UUID: {ego_id[1]}')\n canvas.drawString(left_margin, page_begin_y - top_margin - 20, f'')", "def print_coords(event):\n...
[ "0.6756791", "0.6721762", "0.6526081", "0.6481706", "0.643777", "0.64262176", "0.6423114", "0.6297728", "0.6274187", "0.6250529", "0.6176083", "0.61715484", "0.616459", "0.6163838", "0.61613667", "0.6073639", "0.60719305", "0.6066602", "0.6052897", "0.60452753", "0.5996532", ...
0.8041459
0
converts CDI data excel file to numpy array
def to_numpy(file_name, sheet_name): df = pd.read_excel(file_name, sheet_name) df.dropna(inplace = True) numparr = df.to_numpy() if toPrt: print("Numpy array for ",file_name,"\n=======\n",numparr) return numparr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_excel_file(self):\n self.df = pd.read_excel(str(self.file_path))\n self.data_mat=np.array(self.df)", "def read_excel_file(self):\n self.df = pd.read_excel(str(self.file_path))\n self.data_mat = np.array(self.df).transpose()", "def read_coaps_stationinfo_xls(filename):\n ...
[ "0.7376144", "0.70771605", "0.6567564", "0.64876556", "0.64046645", "0.6328739", "0.6276377", "0.6238378", "0.6200264", "0.6120485", "0.60464835", "0.60035557", "0.5991413", "0.5950561", "0.5918421", "0.59137905", "0.59118575", "0.589911", "0.58772737", "0.5877075", "0.586231...
0.7467368
0
Test the public ``election_from_csv'' function.
def test_election_from_csv(self): path = os.path.dirname(__file__) filename = os.path.join(path, "non_existant_file.csv") with self.assertRaises(IOError): election_from_csv(filename) filename = os.path.join(path, "election_test_data.csv") # import the data ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def election_from_csv(filename):\n\n election = None\n\n with open(filename, 'rb') as csvfile:\n reader = csv.reader(csvfile, delimiter=',', quotechar='\"')\n\n # create an Election object\n election = Election()\n\n constituencies = {}\n parties = {}\n candidates = ...
[ "0.6960709", "0.64007235", "0.63332486", "0.6327784", "0.6304303", "0.62444335", "0.6210461", "0.6179829", "0.6174934", "0.616592", "0.616592", "0.61380374", "0.6133822", "0.61122", "0.60381645", "0.6037595", "0.5934035", "0.5907006", "0.5884099", "0.5867422", "0.5788048", ...
0.8264227
0
start_game is called when the player restarts the game, to reinitialize all the game variables.
def start_game(self): self.mode = "splash" self.score = 0 self.lives = 3 self.round_time = 1.00 self.rest_time = 0.50 self.rect = () self.num_rounds = 0 self.score_label.text = 'Score: {}'.format(self.score) self.lives_label.text = 'Lives: {}'.form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_game(self):\n\t\tself.ai = False\n\t\tself.clear_game()\n\t\tself.initialize_game()", "def start_game(self):\n self.game_started = True", "def start_game(self):\n\t\tself.game_started()", "def _game_start(self, **kargs):\n self.player = None\n self.player_list = list()\n ...
[ "0.7871564", "0.77748615", "0.7711362", "0.77000004", "0.73112494", "0.73112494", "0.72576463", "0.71725583", "0.71237576", "0.7052166", "0.70178103", "0.69427407", "0.6930537", "0.69195217", "0.6863981", "0.68294317", "0.6745795", "0.6739537", "0.66849226", "0.6632915", "0.6...
0.67491335
16
Make sure our slugs have a consistent format.
def _gauge_key(self, slug): return "g:{0}".format(slugify(slug))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean(self):\n if not self.slug:\n suffix = get_random_string(\n length=10, allowed_chars=string.ascii_lowercase + string.digits\n )\n\n self.slug = f\"{slugify(self.title)}-{suffix}\"", "def _SlugCheck(slug, allow=''):\n if not slug == CleanText(unic...
[ "0.6848198", "0.66607255", "0.6614808", "0.6524171", "0.64463085", "0.64125186", "0.6318155", "0.6279829", "0.6246785", "0.6201019", "0.6152963", "0.614661", "0.6131405", "0.60517704", "0.6044754", "0.603753", "0.603496", "0.6003915", "0.5979167", "0.59661627", "0.59429526", ...
0.0
-1
Return the card's self._face value.
def face(self): return self._face
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reference_face(self):\n return self.reference[\"face\"]", "def face(self):\n return self.start.face", "def feed_face(self):\n return self.feed[\"face\"]", "def card(self):\n return self.__card", "def card(self):\n return self.__card", "def getCard(self):\n re...
[ "0.7750603", "0.7208461", "0.71786034", "0.715846", "0.715846", "0.7104426", "0.7024542", "0.693659", "0.6619871", "0.65756786", "0.65145004", "0.6496983", "0.6397332", "0.6326677", "0.63098556", "0.6282599", "0.61103714", "0.6080751", "0.6080751", "0.6067881", "0.6061035", ...
0.81748134
0
Return the string representation of str().
def __str__(self): return f'{self._face} of {self._suit}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_str(self):\n return self.str", "def toString(self):\n return self.__str__()", "def to_string(self):\r\n return self.__str__()", "def __str__(self) -> str:\n tmp = self.str()\n return polish_str(tmp)", "def get_str(self):\n pass", "def to_string(self) -> st...
[ "0.7950133", "0.77869046", "0.776991", "0.774422", "0.7439706", "0.7373787", "0.73484135", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0.73120916", "0....
0.0
-1
Returns the formatted string representation
def __format__(self, format): return f'{str(self):{format}}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "...
[ "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "0.7887869", "...
0.0
-1
Returns a QuerySet from a Model, Manager, or QuerySet. Created to make get_object_or_404 and get_list_or_404 more DRY.
def _get_queryset(klass): if isinstance(klass, QuerySet): return klass elif isinstance(klass, Manager): manager = klass else: manager = klass._default_manager return manager.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_set_or_404(object, *args, **kwargs) -> QuerySet:\n detail_set = object.objects.filter(**kwargs)\n if detail_set:\n return detail_set\n else:\n raise Http404('No matches the given query.')", "def get_queryset(self):\n if self.queryset is not None:\n queryset = self...
[ "0.7341463", "0.69673496", "0.68719834", "0.6840924", "0.6827336", "0.6827336", "0.6806699", "0.6771349", "0.6752999", "0.6744517", "0.6641845", "0.6620435", "0.6620435", "0.6586452", "0.6580178", "0.6556642", "0.65219057", "0.65134716", "0.65059626", "0.64835024", "0.6457891...
0.6748383
9
Create and save a User with the given username and password.
def create_user(self, username, password, **extra_fields): if not username: raise ValueError('The username must be set') user = self.model(username=username, **extra_fields) user.set_password(password) user.save() return user
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_user(self, username, password, **extra_fields):\n user = self.model(username=username, **extra_fields)\n user.set_password(password)\n user.save(using=self._db)\n return user", "def _create_user(self, username, password, **extra_fields):\n\t\tif not username:\n\t\t\traise ...
[ "0.8430748", "0.84008884", "0.8336645", "0.8329339", "0.82661414", "0.82436687", "0.8241534", "0.8241534", "0.8224617", "0.821125", "0.8191594", "0.81898075", "0.81816727", "0.81816727", "0.81816727", "0.81816727", "0.8158088", "0.8136822", "0.81269944", "0.8116311", "0.81139...
0.83814716
2
Create and save a SuperUser with the given email and password.
def create_superuser(self, username, password, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) if extra_fields.get('is_staff') is not True: raise ValueError(('Superuser must have is_staff=True.')) if extra_fields.get('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_superuser(self, email, password, **extra_fields):\n return self._create_user(email, password, True, True,\n **extra_fields)", "def create_superuser(self, email, password, **extra_fields):\r\n extra_fields.setdefault('is_staff', True)\r\n extra_field...
[ "0.8044117", "0.79980594", "0.79412293", "0.79410416", "0.79410416", "0.79410416", "0.79410416", "0.7934616", "0.7932391", "0.7932391", "0.7932391", "0.790783", "0.7882038", "0.7878498", "0.7876537", "0.78681886", "0.7862954", "0.7860293", "0.7842809", "0.78155255", "0.781419...
0.0
-1
Applies the Grayscale transform This will return an image with only one color channel
def grayscale(img): return cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) # Or use BGR2GRAY if you read an image with cv2.imread() # return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_gray(self):\n # should be applied on undistorted images\n # converting grayscale \n color_change_spec = 'cv2.COLOR_'+self._colorspec+'2GRAY'\n self._gray = np.asarray([cv2.cvtColor(img, eval(color_change_spec)) for img in self._undistorted])", "def to_grayscale(self):\n ...
[ "0.7298954", "0.71708053", "0.7140972", "0.6965788", "0.6877837", "0.6863994", "0.68483645", "0.6847727", "0.67190427", "0.670629", "0.6697161", "0.66753525", "0.66394585", "0.6622379", "0.65756476", "0.65670663", "0.65618795", "0.6538047", "0.65263563", "0.6518243", "0.64923...
0.0
-1
Replace for OdeSolver __init__ passing h to the wrappers.
def ode_solver_init_custom(self, fun, t0, y0, t_bound, vectorized, support_complex=False): self.t_old = None self.t = t0 self._fun, self.y = check_arguments_custom(fun, y0, support_complex) self.t_bound = t_bound self.vectorized = vectorized if vectorized: def...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, solver):\n self.solver = solver\n self.backend = solver.backend", "def __init__(self, data, sol0, wgts={}, sparse=False, **kwargs):\n # XXX make this something hard to collide with\n # see https://github.com/HERA-Team/linsolve/issues/17\n self.prepend = \"d\"...
[ "0.613003", "0.6058596", "0.56735784", "0.5667577", "0.561856", "0.55374277", "0.54789466", "0.5451244", "0.5439551", "0.5436316", "0.5405908", "0.5370435", "0.5358477", "0.53540194", "0.534922", "0.53482145", "0.5340932", "0.5340932", "0.53201044", "0.5298885", "0.5293268", ...
0.5883642
2
Right rotate a sequence. >>> rotate([1, 2, 3]) [2, 3, 1]
def rotate(seq): return seq[1:] + seq[:1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rightRotate2(lst, n):\n return lst[n-1:] + lst[:n-1]", "def rotate_right(password, *args):\n steps = int(args[0])\n pwd = deque(password)\n \n while steps > 0:\n val = pwd.pop()\n pwd.appendleft(val)\n steps -= 1\n \n return list(pwd)", "def rotate_right(arr, l...
[ "0.7530503", "0.7397796", "0.7347999", "0.7158136", "0.70360935", "0.69657755", "0.69563144", "0.6946516", "0.69419056", "0.6705817", "0.66986346", "0.6653009", "0.66379523", "0.66135424", "0.6595918", "0.65914184", "0.6563915", "0.6542189", "0.6523646", "0.6513599", "0.65029...
0.824496
0
Return the default mocked config entry.
def mock_config_entry() -> MockConfigEntry: return MockConfigEntry( domain=DOMAIN, data={CONF_HOST: "192.168.1.123"}, unique_id="aabbccddeeff", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mock_config_entry() -> MockConfigEntry:\n return MockConfigEntry(\n title=\"Home Sweet Home\",\n domain=DOMAIN,\n data={CONF_LATITUDE: 52.42, CONF_LONGITUDE: 4.44, CONF_API_KEY: \"example\"},\n unique_id=\"unique_thingy\",\n )", "def mock_config_entry() -> MockConfigEntry:\n...
[ "0.75810003", "0.74951166", "0.7481845", "0.7397836", "0.7329042", "0.7218087", "0.71337163", "0.70799017", "0.68593407", "0.67928785", "0.6629185", "0.6627456", "0.6613023", "0.6598651", "0.6593331", "0.6587032", "0.65741074", "0.6532249", "0.65010494", "0.6473143", "0.64639...
0.75517344
1
Mock that Home Assistant is currently onboarding.
def mock_onboarding() -> Generator[MagicMock, None, None]: with patch( "homeassistant.components.onboarding.async_is_onboarded", return_value=False, ) as mock_onboarding: yield mock_onboarding
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_turn_on(hass: HomeAssistant) -> None:\n with patch(\"pyecobee.Ecobee.set_humidifier_mode\") as mock_turn_on:\n await setup_platform(hass, HUMIDIFIER_DOMAIN)\n\n await hass.services.async_call(\n HUMIDIFIER_DOMAIN,\n SERVICE_TURN_ON,\n {ATTR_ENTITY_ID...
[ "0.67064697", "0.64918476", "0.6099714", "0.60463583", "0.6030495", "0.6000685", "0.59381026", "0.58886427", "0.5828889", "0.5823112", "0.58198524", "0.57999784", "0.57845974", "0.5781718", "0.57744145", "0.57286483", "0.57240444", "0.56961656", "0.56898165", "0.5671126", "0....
0.6927525
0
Return a mocked WLED client.
def mock_wled(device_fixture: str) -> Generator[MagicMock, None, None]: with patch( "homeassistant.components.wled.coordinator.WLED", autospec=True ) as wled_mock, patch( "homeassistant.components.wled.config_flow.WLED", new=wled_mock ): wled = wled_mock.return_value wled.upd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patched_client():\n client = mock.MagicMock()\n get_client = mock.MagicMock()\n get_client.return_value = client\n patcher = mock.patch('smsjwplatform.jwplatform.get_jwplatform_client', get_client)\n patcher.start()\n yield client\n patcher.stop()", "def mock_rest_client(monkeypatch, moc...
[ "0.7110862", "0.6762522", "0.67385215", "0.6609488", "0.6337749", "0.62135214", "0.61771876", "0.6168423", "0.6157288", "0.60942173", "0.6088112", "0.6076555", "0.60216314", "0.5990008", "0.5987359", "0.5974374", "0.5927792", "0.5927792", "0.59183776", "0.5918183", "0.5843541...
0.6737416
3
Returns the angle in radians between vectors 'v1' and 'v2'
def angle_2d(self, v1, v2): cosang = np.dot(v1, v2) sinang = np.linalg.norm(np.cross(v1, v2)) return np.arctan2(sinang, cosang)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(v1, v2):\n\n ang = np.arccos(np.dot(v1, v2) / (length(v1) * length(v2)))\n return ang", "def angle_between(v1, v2):\n v1_u = unit_vector(v1)\n v2_u = unit_vector(v2)\n return np.arccos(np.dot(v1_u, v2_u))*180./np.pi", "def angle(v1, v2):\n return math.acos(dotproduct(v1, v2) / (leng...
[ "0.8847827", "0.8840605", "0.8809039", "0.8734659", "0.87301475", "0.86602473", "0.86513793", "0.8646928", "0.8593908", "0.8583155", "0.8534508", "0.8528404", "0.8517529", "0.8492121", "0.8484983", "0.8411889", "0.84016687", "0.8336481", "0.82629716", "0.81883955", "0.8114250...
0.84815156
15
Flatten nested lists into a single list of lists.
def flatten(lst): try: for ele in lst: if isinstance(ele, collections.Iterable) and \ not isinstance(ele, str): for sub in flatten(ele): yield sub else: yield ele except TypeError: yield lst
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flatten(list_of_lists):\n return [item for sublist in list_of_lists for item in sublist]", "def flatten(list_of_lists):\n return [item for sublist in list_of_lists for item in sublist]", "def flatten(list_of_lists):\n return [item for sublist in list_of_lists for item in sublist]", "def flatten(...
[ "0.86886173", "0.86886173", "0.86886173", "0.84902406", "0.8392982", "0.8389713", "0.8360225", "0.83219326", "0.82983464", "0.8281722", "0.82354224", "0.8195947", "0.8193294", "0.8175129", "0.8146547", "0.8137407", "0.8132887", "0.8127945", "0.8096686", "0.8073115", "0.807311...
0.0
-1
Return a recreated instance of self. Allows an otherwise oneshot context manager like _GeneratorContextManager to support use as a decorator via implicit recreation. This is a private interface just for _GeneratorContextManager. See issue 11647 for details.
def _recreate_cm(self): return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_context(cls, *args, **kwargs): # type: ('T', *Any, **Any)-> 'T'\n allow_override = kwargs.pop(\"allow_override\", False)\n context = kwargs.pop(\"_context\", None)\n\n orig_value = cls._instance\n if orig_value is not None:\n if not allow_override:\n r...
[ "0.6922301", "0.6268977", "0.6187357", "0.6167516", "0.612977", "0.61176383", "0.6094239", "0.6081285", "0.6025363", "0.6000813", "0.58365", "0.5824655", "0.58153814", "0.5810431", "0.5810431", "0.577353", "0.5751868", "0.5730296", "0.5727747", "0.5727055", "0.57269883", "0...
0.6067651
8
An utility to pass function metadata from wrapped function to a wrapper. Copies all function attributes including ``__name__``, ``__module__`` and ``__doc__``. In addition adds ``__wrapped__`` attribute referring to the wrapped function and ``__original__`` attribute referring to innermost wrapped one.
def wraps(wrapped, assigned = WRAPPER_ASSIGNMENTS, updated = WRAPPER_UPDATES): return partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap(wrapper, wrapped):\n for attr in ('__module__', '__name__', '__doc__'):\n setattr(wrapper, attr, getattr(wrapped, attr))\n for attr in ('__dict__',):\n getattr(wrapper, attr).update(getattr(wrapped, attr, {}))\n # Return the wrapper so this can be used as a decorator via partial...
[ "0.7224334", "0.7151731", "0.69496614", "0.6775491", "0.67175657", "0.65087986", "0.64896524", "0.6451621", "0.644878", "0.6419468", "0.6410596", "0.63982964", "0.6396765", "0.6392633", "0.6327881", "0.63277805", "0.6283476", "0.6269202", "0.62324905", "0.62000227", "0.618663...
0.6104235
26
Gets a collection of `InputExample`s for the train set.
def get_train_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_examples(self):\n return self.get_dialog_examples(\"train\")", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(data_dir):\r\n examples = []\r\n for line in op...
[ "0.73398817", "0.7173496", "0.7173496", "0.6853526", "0.65891296", "0.6497457", "0.6414111", "0.63857555", "0.63427144", "0.63110304", "0.6290913", "0.62820846", "0.62787473", "0.6240152", "0.62303865", "0.6227674", "0.6223068", "0.6222444", "0.62164307", "0.62111396", "0.620...
0.6247562
27
Gets the list of labels for this data set.
def get_labels(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels(self):\n if not hasattr(self, 'label_set'):\n raise NotImplementedError()\n else:\n return list(self.label_set.label_list)", "def labels(self):\n return self.dataset.labels", "def get_labels(self) -> List[str]:\n pass", "def get_labels(self):\n...
[ "0.87278146", "0.8721585", "0.8674388", "0.85576487", "0.84710133", "0.84710133", "0.8436887", "0.8436887", "0.8436887", "0.8436887", "0.8344597", "0.83083034", "0.82686037", "0.82682526", "0.8243815", "0.81718355", "0.81705415", "0.81645525", "0.8131554", "0.8096272", "0.809...
0.78908604
49
Creates examples for the training and dev sets.
def _create_examples(self, full_path, set_type): with open(full_path, 'r') as f: dataset = csv.DictReader(f) examples = [] for (i, vals) in enumerate(dataset): example = {} example['guid'] = "%s-%s" % (set_type, i) example['id']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self, examples):\n pass", "def _create_examples(self, lines, set_type):\n\n examples = []\n for (i, line) in enumerate(lines):\n # Train, dev and test set has a header\n guid = \"%s-%s\" % (set_type, i)\n if set_type == \"test\":\n te...
[ "0.72312224", "0.6805896", "0.67989063", "0.6746854", "0.66259325", "0.662385", "0.66151386", "0.65982485", "0.6572372", "0.65603733", "0.6528902", "0.6496166", "0.6484704", "0.6474796", "0.64710087", "0.6446309", "0.6418207", "0.6418207", "0.64166754", "0.64159673", "0.64116...
0.61846524
80
Truncates a sequence pair in place to the maximum length.
def _truncate_seq_pair(tokens_a, tokens_b, max_length): num_removed_from_b = 0 # This is a simple heuristic which will always truncate the longer sequence # one token at a time. This makes more sense than truncating an equal percent # of tokens from each, since if one sequence is very short then each to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _truncate_seq_pair(tokens_a, tokens_b, max_length):\n\n\t# This is a simple heuristic which will always truncate the longer sequence\n\t# one token at a time. This makes more sense than truncating an equal percent\n\t# of tokens from each, since if one sequence is very short then each token\n\t# that's truncat...
[ "0.7615645", "0.7604508", "0.7604508", "0.76036716", "0.75670713", "0.7559492", "0.7559492", "0.7529625", "0.7527809", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", "0.7522408", ...
0.73278964
30
This function checks whether the mimetype is allowed or not. We could additionally put a check in the form itself
def allowed_file(filename): return '.' in filename and filename.rsplit('.',1)[1] in ALLOWED_EXTENSIONS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_file_type(self):\n return self.get_file_type() in self.settings.MEDIA_ALLOW_EXTENSIONS", "def accepts(self, mime_type):\n accept = self.request.headers.get('Accept')\n if accept:\n return accept == mime_type", "def check_file_type(self,filename):\n suffix = filename.split(...
[ "0.78163344", "0.67759377", "0.67418194", "0.673449", "0.6689455", "0.6673881", "0.6649446", "0.66179484", "0.66166896", "0.66166896", "0.6590758", "0.6583076", "0.6578177", "0.6535327", "0.64768076", "0.63998634", "0.6396996", "0.6391761", "0.6386937", "0.63317776", "0.63096...
0.5945857
43
The profile has to be edited. The following page allows following
def edit_profile(profileid): try: """ The profileid may not be a valid ObjectId, if it's not a valid ObjectId, user must get routed to main page. """ profile_info = profiles.find_one(ObjectId(profileid)) except InvalidId: """ Flash message and route to main page """ flash("No such profile exists, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def complete_profile(self):\n data = {\n 'user': self.user,\n 'camera_type': 'canon',\n 'type_of_photography': 'animals',\n 'social_media': 'fb',\n 'website': 'www.test.com'\n }\n self.client.post(\n reverse('profile_edit', kwar...
[ "0.7508387", "0.7508387", "0.74144334", "0.7391929", "0.7155026", "0.7140812", "0.70692354", "0.7068866", "0.7058476", "0.69324976", "0.6881407", "0.68709487", "0.6855942", "0.6852088", "0.68135965", "0.68023694", "0.67973363", "0.6766069", "0.67590296", "0.67554206", "0.6754...
0.65009344
38
The providerassigned unique ID for this managed resource.
def id(self) -> str: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provider_id(self) -> str:\n return self._provider_id", "def provider_id(self):\n return self.__provider_id", "def provider_id(self):\n raise NotImplementedError", "def get_id(self):\n return \"{0} {1}\".format(self.get_issuer(), self.get_serial_number())", "def get_resource_...
[ "0.8127378", "0.8049758", "0.78517246", "0.76258355", "0.75965166", "0.7473894", "0.7473894", "0.7473894", "0.7473894", "0.7473894", "0.74436015", "0.74436015", "0.73730665", "0.73703134", "0.73703134", "0.73703134", "0.73703134", "0.73678327", "0.73378557", "0.73179185", "0....
0.0
-1
get_current_controller returns the currently active controller, if one exists, otherwise None.
def get_current_controller(self): raise NotImplementedError("Subclass must implement " "get_current_controller")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getController(self):\n\t\treturn self._controller", "def GetController(self):\r\n\r\n return self._controller", "def get_local_controller():\n return take_single(WorldInfo.subclass_of(PlayerController))", "def controller(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self,...
[ "0.66859555", "0.66177934", "0.65915924", "0.65169126", "0.65169126", "0.64106625", "0.6313426", "0.5949628", "0.5915964", "0.5876216", "0.58703", "0.5834809", "0.5833956", "0.5685825", "0.56816596", "0.5650347", "0.5605095", "0.55918765", "0.5585808", "0.55070215", "0.549932...
0.7653761
0
Remove any redundant whitespace, quotes, and return a list
def pkgbuild_arrstr_to_list(s): s = s.replace("'", '') s = s.replace('"', '') s = s.replace('\t', ' ') s = s.replace('\n', ' ') while ' ' in s: s = s.replace(' ', ' ') return s.split(' ')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_list(self, s, list_delim = ','):\n return [x.strip() for x in s.split(list_delim) if x.strip() != '']", "def cleanup_list(l):\n s = set(l)\n if \"\" in s:\n s.remove(\"\")\n l = list(s)\n for i, val in enumerate(l):\n l[i] = l[i].strip()\n return l", "def convert_to_lis...
[ "0.6916962", "0.67446715", "0.65528554", "0.649333", "0.6469217", "0.6456297", "0.6437332", "0.64362323", "0.6394348", "0.63901395", "0.6344162", "0.6342855", "0.6325567", "0.63185024", "0.6255209", "0.62448484", "0.62222755", "0.62150717", "0.62103", "0.62063575", "0.6193269...
0.6579419
2
Convert string to datetime.
def str_to_datetime(text): return datetime.datetime.fromisoformat(text.replace("Z", ""))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_to_datetime(s):\n d = datetime.datetime(*parse_date_int(s))\n return d", "def str_to_datetime(s):\n d = datetime.datetime(*parse_date_int(s))\n return d", "def str2datetime(s):\n datetime.strptime(s, '%Y-%m-%d %H:%M:%S')", "def string_to_datetime(datetime_str: str) -> datetime:\n ...
[ "0.8003907", "0.8003907", "0.7978403", "0.7772577", "0.77704334", "0.7704797", "0.76342076", "0.75998557", "0.75301796", "0.7528795", "0.74832755", "0.7475862", "0.7474038", "0.743521", "0.7427051", "0.7393907", "0.73330194", "0.7307614", "0.72777057", "0.72713697", "0.723198...
0.7424134
15
Perform 3D fft on the last three axis of d_A can accept only 2D array, where axis 0 is indicate the batch number, and axis 1 is all the data for one batch in three dimension.
def _fft3_parray(d_A, shape, econ = False, batch_size = 4): ndim = len(d_A.shape) if ndim == 2: total_inputs = d_A.shape[0] size = shape else: raise ValueError("PitchArray input to fft3 must be a 2D") realA = parray.isrealobj(d_A) if econ and not realA: print ("W...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fft3_gpuarray(d_A, econ = False, batch_size = 4):\n ndim = len(d_A.shape)\n if ndim == 3:\n total_inputs = 1\n size = d_A.shape\n elif ndim == 4:\n total_inputs = d_A.shape[0]\n size = d_A.shape[1:4]\n else:\n raise ValueError(\"Input to fft3 must be of 3D or 4D\...
[ "0.74295294", "0.6983329", "0.6625052", "0.6504447", "0.62980276", "0.6228295", "0.615962", "0.6055377", "0.6023576", "0.59560215", "0.5896125", "0.58059406", "0.57789546", "0.5721349", "0.57070327", "0.5655975", "0.5646178", "0.56350213", "0.55997026", "0.5593917", "0.557001...
0.7225023
1
Loads a floating point numpy array from a simple text format M N v11 v12 ... v1n ... vm1 vm2 ... vmn
def load_matrix(fn): f = open(fn,'r') items = ' '.join(f.readlines()) f.close() entries = items.split() m,n = int(entries[0]),int(entries[1]) assert m*n == len(entries)-2 mat = np.array([float(v) for v in entries[2:]]) mat = mat.reshape((m,n)) return mat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_vector_file(fname):\n return np.genfromtxt(fname)", "def loadtxt(filename):\n return float(np.loadtxt(filename))", "def parse_vector(line):\n return np.fromstring(line, sep=',')", "def load_dataset(file_name): # general function to parse tab -delimited floats\n data_matrix = [] # assum...
[ "0.6426119", "0.6400351", "0.63622844", "0.63319385", "0.6223067", "0.61918336", "0.6188277", "0.61691576", "0.6061781", "0.60038334", "0.59893936", "0.5939243", "0.5937471", "0.5934618", "0.5921366", "0.59133494", "0.58984554", "0.58831173", "0.58619", "0.58427775", "0.58258...
0.5884735
17
Bulk update user's statitems value (bulkIncUserStatItem_1) Bulk update user's statitems value.
def bulk_inc_user_stat_item_1( user_id: str, body: Optional[List[BulkStatItemInc]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_inc_user_stat_item(\n body: Optional[List[BulkUserStatItemInc]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ret...
[ "0.80325973", "0.7920088", "0.78776765", "0.7822074", "0.77199394", "0.7700123", "0.76964664", "0.76569605", "0.76366377", "0.760411", "0.7557951", "0.75501716", "0.75162405", "0.7478757", "0.73946506", "0.7231733", "0.7176354", "0.70747703", "0.7021272", "0.6926719", "0.6812...
0.77075577
5
Bulk update user's statitems value (bulkIncUserStatItem_1) Bulk update user's statitems value.
async def bulk_inc_user_stat_item_1_async( user_id: str, body: Optional[List[BulkStatItemInc]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_inc_user_stat_item(\n body: Optional[List[BulkUserStatItemInc]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ret...
[ "0.80326635", "0.79206085", "0.78778994", "0.78227127", "0.77204806", "0.77073455", "0.7700808", "0.7658128", "0.7636746", "0.76041836", "0.755819", "0.75504446", "0.75172985", "0.7478667", "0.73944855", "0.72300076", "0.7174648", "0.707394", "0.70203876", "0.6925198", "0.681...
0.7696266
7
Bulk update user's statitems value (bulkIncUserStatItemValue_1) Bulk update user's statitems value.
def bulk_inc_user_stat_item_value_1( user_id: str, body: Optional[List[BulkStatItemInc]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_inc_user_stat_item_value(\n body: Optional[List[BulkUserStatItemInc]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ...
[ "0.8145656", "0.8069984", "0.799167", "0.7883228", "0.77912974", "0.77478266", "0.766642", "0.7599309", "0.7484357", "0.7453121", "0.7301556", "0.72879386", "0.72765326", "0.7217426", "0.7193846", "0.7161899", "0.7106018", "0.6923178", "0.68376577", "0.6830321", "0.6783313", ...
0.7767876
5
Bulk update user's statitems value (bulkIncUserStatItemValue_1) Bulk update user's statitems value.
async def bulk_inc_user_stat_item_value_1_async( user_id: str, body: Optional[List[BulkStatItemInc]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_inc_user_stat_item_value(\n body: Optional[List[BulkUserStatItemInc]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ...
[ "0.8145436", "0.8069671", "0.79914653", "0.78828496", "0.7768347", "0.77479297", "0.76663584", "0.7599374", "0.74846387", "0.7453192", "0.7301687", "0.72886974", "0.72771496", "0.7218298", "0.7194462", "0.71609986", "0.71047664", "0.692341", "0.68377686", "0.68289024", "0.678...
0.779153
4
Public bulk update user's statitems value (bulkIncUserStatItemValue_2) Public bulk update user's statitems value.
def bulk_inc_user_stat_item_value_2( user_id: str, body: Optional[List[BulkStatItemInc]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_inc_user_stat_item_value(\n body: Optional[List[BulkUserStatItemInc]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ...
[ "0.81269664", "0.80718905", "0.8019298", "0.8015045", "0.7920201", "0.776611", "0.7720445", "0.7473271", "0.7376227", "0.7359409", "0.72288114", "0.7158099", "0.7156471", "0.7137975", "0.71192604", "0.7101876", "0.7100561", "0.69123244", "0.68980646", "0.6875888", "0.6859305"...
0.8020922
2
Public bulk update user's statitems value (bulkIncUserStatItemValue_2) Public bulk update user's statitems value.
async def bulk_inc_user_stat_item_value_2_async( user_id: str, body: Optional[List[BulkStatItemInc]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_inc_user_stat_item_value(\n body: Optional[List[BulkUserStatItemInc]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ...
[ "0.81257105", "0.80706334", "0.8020096", "0.8018337", "0.79192007", "0.77650565", "0.77192336", "0.74729097", "0.73761225", "0.7359114", "0.7228766", "0.71561563", "0.71559817", "0.7137508", "0.71173507", "0.7101548", "0.7100383", "0.69111437", "0.68962014", "0.68750507", "0....
0.8014499
4
Bulk reset multiple user's statitems value (bulkResetUserStatItem) Bulk reset multiple user's statitems value. User's statitem value will be reset to the default value defined in the statistic configuration.
def bulk_reset_user_stat_item( body: Optional[List[BulkUserStatItemReset]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: return None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def bulk_reset_user_stat_item_async(\n body: Optional[List[BulkUserStatItemReset]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\...
[ "0.77893615", "0.76215786", "0.7600255", "0.7576354", "0.7548954", "0.7519889", "0.74525535", "0.7372672", "0.73569787", "0.63900805", "0.63187844", "0.6263377", "0.625855", "0.60955364", "0.6008622", "0.59031105", "0.5893563", "0.5839315", "0.58116466", "0.57983124", "0.5690...
0.78694373
0
Bulk reset multiple user's statitems value (bulkResetUserStatItem) Bulk reset multiple user's statitems value. User's statitem value will be reset to the default value defined in the statistic configuration.
async def bulk_reset_user_stat_item_async( body: Optional[List[BulkUserStatItemReset]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_reset_user_stat_item(\n body: Optional[List[BulkUserStatItemReset]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ...
[ "0.7869585", "0.7621565", "0.76000726", "0.7576539", "0.7549327", "0.752009", "0.7452544", "0.73725057", "0.73570174", "0.63908774", "0.6318608", "0.6263977", "0.62585366", "0.60963535", "0.6009234", "0.5903697", "0.5893811", "0.58394444", "0.5812041", "0.57989556", "0.569109...
0.77893925
1
Bulk reset user's statitems value (bulkResetUserStatItem_1) Bulk reset user's statitems value for given namespace and user.
def bulk_reset_user_stat_item_1( user_id: str, body: Optional[List[BulkStatItemReset]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_reset_user_stat_item(\n body: Optional[List[BulkUserStatItemReset]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ...
[ "0.82206327", "0.8068872", "0.8055677", "0.79849666", "0.7906006", "0.7874083", "0.7768535", "0.7740296", "0.7705261", "0.72760767", "0.72649896", "0.68150157", "0.6643155", "0.6637965", "0.6580914", "0.6506147", "0.64345837", "0.63889754", "0.6308137", "0.6246697", "0.615079...
0.8115719
1
Bulk reset user's statitems value (bulkResetUserStatItem_1) Bulk reset user's statitems value for given namespace and user.
async def bulk_reset_user_stat_item_1_async( user_id: str, body: Optional[List[BulkStatItemReset]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_reset_user_stat_item(\n body: Optional[List[BulkUserStatItemReset]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ...
[ "0.82209074", "0.8115515", "0.8069249", "0.79848427", "0.79063016", "0.7873993", "0.77692837", "0.77411765", "0.77055985", "0.72749907", "0.7264149", "0.6815546", "0.66437036", "0.66374266", "0.65817225", "0.6505865", "0.6435451", "0.63895655", "0.6308731", "0.6247359", "0.61...
0.8055487
3
Public bulk reset multiple user's statitems value (bulkResetUserStatItem_2) Bulk reset multiple user's statitems value. User's statitem value will be reset to the default value defined in the statistic configuration.
def bulk_reset_user_stat_item_2( body: Optional[List[BulkUserStatItemReset]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: return None...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def bulk_reset_user_stat_item_2_async(\n body: Optional[List[BulkUserStatItemReset]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error...
[ "0.7848976", "0.77950406", "0.77251625", "0.75849193", "0.7570524", "0.7513199", "0.7437827", "0.7431319", "0.74163294", "0.65888304", "0.6509252", "0.64697874", "0.64524305", "0.6376509", "0.6316628", "0.6181678", "0.6144489", "0.5890747", "0.58444536", "0.58033276", "0.5782...
0.7940091
0
Public bulk reset multiple user's statitems value (bulkResetUserStatItem_2) Bulk reset multiple user's statitems value. User's statitem value will be reset to the default value defined in the statistic configuration.
async def bulk_reset_user_stat_item_2_async( body: Optional[List[BulkUserStatItemReset]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namespace, error = get_services_namespace() if error: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_reset_user_stat_item_2(\n body: Optional[List[BulkUserStatItemReset]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ...
[ "0.7939471", "0.7795274", "0.7725385", "0.75849676", "0.7570652", "0.7513269", "0.74379945", "0.7431119", "0.74160767", "0.65879536", "0.65078217", "0.6468982", "0.6451071", "0.6376632", "0.63166773", "0.617999", "0.6142821", "0.58896184", "0.5844513", "0.580232", "0.5782782"...
0.78482395
1
Bulk reset user's statitem values (bulkResetUserStatItemValues) Bulk reset user's statitem values for given namespace and user.
def bulk_reset_user_stat_item_values( user_id: str, additional_key: Optional[str] = None, body: Optional[List[ADTOObjectForResettingUserStatItems]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: namesp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def bulk_reset_user_stat_item_values_async(\n user_id: str,\n additional_key: Optional[str] = None,\n body: Optional[List[ADTOObjectForResettingUserStatItems]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespac...
[ "0.7813122", "0.7742275", "0.7627269", "0.7541069", "0.75367403", "0.7486878", "0.744568", "0.743949", "0.72705483", "0.6807928", "0.6773511", "0.63360345", "0.62732667", "0.61779606", "0.6154353", "0.6101062", "0.6038649", "0.5941528", "0.58913916", "0.5870418", "0.5837935",...
0.779091
1
Bulk reset user's statitem values (bulkResetUserStatItemValues) Bulk reset user's statitem values for given namespace and user.
async def bulk_reset_user_stat_item_values_async( user_id: str, additional_key: Optional[str] = None, body: Optional[List[ADTOObjectForResettingUserStatItems]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): if namespace is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_reset_user_stat_item_values(\n user_id: str,\n additional_key: Optional[str] = None,\n body: Optional[List[ADTOObjectForResettingUserStatItems]] = None,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n...
[ "0.77915645", "0.77415806", "0.76266134", "0.7541462", "0.753763", "0.74874806", "0.74445856", "0.7440591", "0.7269539", "0.6808425", "0.67736506", "0.63349235", "0.62718564", "0.6176999", "0.61531115", "0.61016715", "0.60395175", "0.5941882", "0.58909774", "0.58704966", "0.5...
0.78139627
0
This program loads an image and applies the narok filter to it by setting "bright" pixels to grayscale values.
def main(): image = SimpleImage('images/simba-sq.jpg') for pixel in image: average = (pixel.red + pixel.green + pixel.blue) / 3 if average > BRIGHTNESS_THRESHOLD: pixel.red = average pixel.green = average pixel.blue = average image.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n # load image\n image = SimpleImage('images/girl.jpeg')\n # TODO: apply monochrome filter\n for pixel in image:\n\n # See if this pixel is \"sufficiently\" black\n if should_be_black(pixel):\n pixel.red = 0\n pixel.green = 0\n pixel.blue = 0\n...
[ "0.7157632", "0.63941014", "0.6237068", "0.61901146", "0.6123618", "0.61134255", "0.60953814", "0.6051857", "0.6034998", "0.6006406", "0.6000595", "0.5980783", "0.597169", "0.5907001", "0.58912086", "0.58895683", "0.58766866", "0.5872369", "0.58590794", "0.58533955", "0.57865...
0.65117115
1
Create all strings by randomly sampling from a pool of characters.
def create_strings_randomly(length, allow_variable, count, let, num, sym, lang, max_seq_len): # If none specified, use all three if True not in (let, num, sym): let, num, sym = True, True, True pool = '' if let: if lang == 'cn': pool += ''.join([chr(i) for i in range(19968,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strings(n, chars=string.ascii_letters):\n return ''.join([random.choice(chars) for i in range(n)])", "def random_string_generator(size=10, chars=string.ascii_lowercase + string.digits):\n\n return ''.join(random.choice(chars) for _ in range(size))", "def _generate(self, characters=string.ascii_lowerc...
[ "0.74518627", "0.72282773", "0.7201424", "0.7074985", "0.70481664", "0.6966682", "0.69549567", "0.6936812", "0.6912204", "0.6891096", "0.6890036", "0.68158895", "0.6795235", "0.6703569", "0.6695412", "0.66789263", "0.66750026", "0.6667837", "0.6665445", "0.6654417", "0.664853...
0.7102479
3