query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Remove proxy of the given user from the repository
def deleteProxy( self, userDN, userGroup ): req = "DELETE FROM `ProxyDB_Proxies` WHERE UserDN='%s' AND UserGroup='%s'" % ( userDN, userGroup ) return self._update( req )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_repository(user_id):\n try:\n repository.delete_by_id(user_id)\n except KeyError:\n raise", "def delete_proxy(proxy):\n r = requests.get(\"http://127.0.0.1:5010/delete/?proxy={}\".format(proxy))", "def del_user(self, username):\n pass", "def sipserver_user_remove...
[ "0.7041249", "0.68581367", "0.65509796", "0.6449174", "0.6420472", "0.6393087", "0.6370767", "0.63116974", "0.62708056", "0.62519896", "0.62136376", "0.61899996", "0.61820936", "0.61039585", "0.6095542", "0.5970858", "0.5955024", "0.59366393", "0.59231585", "0.59097016", "0.5...
0.65430796
3
Get proxy string from the Proxy Repository for use with userDN in the userGroup
def getProxy( self, userDN, userGroup, requiredLifeTime = False ): retVal = self.__getPemAndTimeLeft( userDN, userGroup ) if not retVal[ 'OK' ]: return retVal pemData = retVal[ 'Value' ][0] timeLeft = retVal[ 'Value' ][1] chain = X509Chain() retVal = chain.loadProxyFromString( pemData ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_user(self) -> ConfigNodePropertyString:\n return self._proxy_user", "def get_proxy():\n response = requests.get(\"http://127.0.0.1:5010/get/\")\n json_response = response.json()\n proxy = json_response.get(\"proxy\")\n return 'http://{}'.format(proxy)", "def getProxyName(self):\n ...
[ "0.6668501", "0.66545826", "0.64440346", "0.6407939", "0.6364056", "0.6364056", "0.6328654", "0.62492806", "0.60299265", "0.60231507", "0.60067356", "0.60021925", "0.59735525", "0.59735525", "0.5913274", "0.58522195", "0.5838446", "0.5801967", "0.57974035", "0.57897455", "0.5...
0.5979392
12
Get proxy string from the Proxy Repository for use with userDN in the userGroup and VOMS attr
def getVOMSProxy( self, userDN, userGroup, requiredLifeTime = False, requestedVOMSAttr = False ): retVal = self.__getVOMSAttribute( userGroup, requestedVOMSAttr ) if not retVal[ 'OK' ]: return retVal vomsAttr = retVal[ 'Value' ][ 'attribute' ] vomsVO = retVal[ 'Value' ][ 'VOMSVO' ] #Look in t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_user(self) -> ConfigNodePropertyString:\n return self._proxy_user", "def get_proxy():\n response = requests.get(\"http://127.0.0.1:5010/get/\")\n json_response = response.json()\n proxy = json_response.get(\"proxy\")\n return 'http://{}'.format(proxy)", "def getProxyName(self):\n ...
[ "0.6696437", "0.64835995", "0.64139503", "0.62745327", "0.6236208", "0.621045", "0.621045", "0.6003598", "0.6001607", "0.591985", "0.58042634", "0.576691", "0.576691", "0.5765963", "0.572731", "0.57047755", "0.57029516", "0.56821537", "0.56565577", "0.56405216", "0.56217295",...
0.49967137
79
Returns the remaining time the proxy is valid
def getRemainingTime( self, userDN, userGroup ): cmd = "SELECT TIMESTAMPDIFF( SECOND, UTC_TIMESTAMP(), ExpirationTime ) FROM `ProxyDB_Proxies`" retVal = self._query( "%s WHERE UserDN = '%s' AND UserGroup = '%s'" % ( cmd, userDN, userGroup ) ) if not retVal[ 'OK' ]: return retVal data = retVal[ 'Va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_remaining(self):\n with self._lock:\n deadline = self._expiration_manager.deadline()\n return max(0.0, deadline - time.time())", "def remaining(self):\n return self._timeout - (time.time() - self._start_time)", "def ssl_valid_time_remaining(hostname):\n try:\n expires = ssl...
[ "0.74460244", "0.72668546", "0.712543", "0.7062365", "0.7062365", "0.7053912", "0.70216733", "0.7002892", "0.6868923", "0.68215346", "0.67832655", "0.6756652", "0.670691", "0.667693", "0.65322614", "0.6511018", "0.6497153", "0.64359474", "0.6383832", "0.63802505", "0.6340725"...
0.5886982
77
Get all the distinct users from the Proxy Repository. Optionally, only users with valid proxies within the given validity period expressed in seconds
def getUsers( self, validSecondsLeft = 0, dnMask = False, groupMask = False ): cmd = "SELECT UserDN, UserGroup, ExpirationTime, PersistentFlag FROM `ProxyDB_Proxies`" sqlCond = [] if validSecondsLeft: sqlCond.append( "( UTC_TIMESTAMP() + INTERVAL %d SECOND ) < ExpirationTime" % validSecondsLeft ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def online_users(room):\n threshold = datetime.now() - timedelta(seconds=10)\n authorizations = models.Authorization.gql(\"WHERE room = :room AND last_checked_in >= :threshold\", room=room, threshold=threshold).fetch(1000)\n return [x.user for x in authorizations]", "def get_all_users():", "def get_users(fi...
[ "0.57535833", "0.565889", "0.56535566", "0.56447166", "0.55493206", "0.55464524", "0.55074733", "0.5499751", "0.54948443", "0.5410248", "0.5405992", "0.53292644", "0.53161293", "0.5315384", "0.5276184", "0.5266737", "0.52615124", "0.52547234", "0.525417", "0.5224818", "0.5202...
0.70390385
0
Set the proxy PersistentFlag to the flag value
def setPersistencyFlag( self, userDN, userGroup, persistent = True ): if persistent: sqlFlag = "True" else: sqlFlag = "False" retVal = self._query( "SELECT PersistentFlag FROM `ProxyDB_Proxies` WHERE UserDN='%s' AND UserGroup='%s'" % ( userDN, userGroup ) ) sqlInsert = True if retVal[ 'O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_flag(self, new):\n self.flag = new", "def setFlag(self, flag, value) -> None:\n ...", "def setpersist(self, v = True):\n\t\tif v:\n\t\t\tpservlet.pipe_set_flag(self._pipe_desc, pservlet.PIPE_PERSIST)\n\t\telse:\n\t\t\tpservlet.pipe_clr_flag(self._pipe_desc, pservlet.PIPE_PERSIST)", "def...
[ "0.65685695", "0.6513343", "0.6107199", "0.6105782", "0.605706", "0.5902015", "0.58990586", "0.58684254", "0.5772798", "0.56335574", "0.5555304", "0.554686", "0.54772735", "0.5459912", "0.54429626", "0.5432712", "0.5316736", "0.53020555", "0.5289182", "0.52507377", "0.5246892...
0.7167987
0
Function to get the contents of the db parameters are a filter to the db
def getProxiesContent( self, selDict, sortList, start = 0, limit = 0 ): fields = ( "UserDN", "UserGroup", "ExpirationTime", "PersistentFlag" ) cmd = "SELECT %s FROM `ProxyDB_Proxies` WHERE Pem is not NULL" % ", ".join( fields ) for field in selDict: cmd += " AND (%s)" % " OR ".join( [ "%s=%s" % ( fiel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter():\n return get_filter_data(db, MyTable)", "def _select_data(\n self, db: str, table: str, column_filters: Dict[str, str]\n ) -> List[List]:\n pass", "def findJobData(table,**filters):\n\n\n s = alchemy_connect()\n\n en = s.get_bind(mapper=None)\n\n metadata = MetaData(en...
[ "0.725083", "0.65548843", "0.6200291", "0.61946756", "0.604213", "0.60220623", "0.6012864", "0.5961002", "0.596019", "0.5907979", "0.58740157", "0.5864739", "0.58435553", "0.5835898", "0.583518", "0.57957876", "0.5781186", "0.57791823", "0.57426196", "0.56948006", "0.5693433"...
0.0
-1
Add an action to the log
def logAction( self, action, issuerDN, issuerGroup, targetDN, targetGroup ): cmd = "INSERT INTO `ProxyDB_Log` ( Action, IssuerDN, IssuerGroup, TargetDN, TargetGroup, Timestamp ) VALUES " cmd += "( '%s', '%s', '%s', '%s', '%s', UTC_TIMESTAMP() )" % ( action, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, obj, action):\n action_dict = {'time': time.time(),\n 'action': action}\n self.log_data[obj.get_obj_id()]['actions'].append(action_dict)", "def log(self, reward, action):\n self.logs.append([reward, action])", "def add_action(self, action: BaseAction):\n...
[ "0.8308856", "0.7974699", "0.77241904", "0.7672241", "0.7672241", "0.7408059", "0.7375126", "0.72701496", "0.7214412", "0.7197971", "0.7134253", "0.7019214", "0.68723357", "0.6820709", "0.6765523", "0.6757886", "0.6674884", "0.6579613", "0.6577708", "0.65616804", "0.65009683"...
0.7334095
7
Purge expired requests from the db
def purgeLogs( self ): cmd = "DELETE FROM `ProxyDB_Log` WHERE TIMESTAMPDIFF( SECOND, UTC_TIMESTAMP(), ExpirationTime ) > 15552000" return self._update( cmd )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purgeExpiredRequests( self ):\n cmd = \"DELETE FROM `ProxyDB_Requests` WHERE ExpirationTime < UTC_TIMESTAMP()\"\n return self._update( cmd )", "def _purge_expired_user_tokens():\n expired = models.Token.query.filter_by(\n _user_fk=current_user.id).filter(\n models.Token.expiration_date...
[ "0.8480336", "0.7205922", "0.7128762", "0.7101229", "0.71002316", "0.6928087", "0.6907067", "0.6805617", "0.67859155", "0.6765693", "0.6757043", "0.6708776", "0.6707402", "0.6704896", "0.6678544", "0.663785", "0.66048336", "0.6479814", "0.6471831", "0.64654887", "0.6395793", ...
0.6823025
7
Function to get the contents of the logs table parameters are a filter to the db
def getLogsContent( self, selDict, sortList, start = 0, limit = 0 ): fields = ( "Action", "IssuerDN", "IssuerGroup", "TargetDN", "TargetGroup", "Timestamp" ) cmd = "SELECT %s FROM `ProxyDB_Log`" % ", ".join( fields ) if selDict: qr = [] if 'beforeDate' in selDict: qr.append( "Timestamp <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_table_logs(args: dict,\n client: Client,\n table_name: str,\n context_transformer_function: Callable[[dict], dict],\n table_context_path: str) -> Tuple[str, dict, List[Dict[str, Any]]]:\n fields, query = build_query(args, ...
[ "0.72698045", "0.6986522", "0.69454885", "0.69116044", "0.6841808", "0.684036", "0.684036", "0.6702308", "0.65687275", "0.65489274", "0.65274054", "0.6489636", "0.6389901", "0.63594717", "0.6213868", "0.6207018", "0.6105167", "0.6039942", "0.6030149", "0.5998351", "0.5998351"...
0.68150455
7
Generate and return a token and the number of uses for the token
def generateToken( self, requesterDN, requesterGroup, numUses = 1, lifeTime = 0, retries = 10 ): if not lifeTime: lifeTime = gConfig.getValue( "/DIRAC/VOPolicy/TokenLifeTime", self.__defaultTokenLifetime ) maxUses = gConfig.getValue( "/DIRAC/VOPolicy/TokenMaxUses", self.__defaultTokenMaxUses ) numUses...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_token(self):\n token = randint(100000000000000000, 999999999999999999)\n return str(token)", "def generateToken():\n token_length = random.randint(MIN_TOKEN_LEN, MAX_TOKEN_LEN)\n token = ''.join(random.choice(POSS_TOKEN_CHARS) for _ in range(token_length))\n return tok...
[ "0.71349686", "0.6834364", "0.6691918", "0.6686488", "0.66647255", "0.6659742", "0.66160893", "0.6593189", "0.65653396", "0.65539414", "0.65217", "0.6503809", "0.6473795", "0.6430297", "0.64140695", "0.6400576", "0.64001346", "0.63659817", "0.63659817", "0.6338574", "0.632993...
0.56442493
78
Segments each thresholded image in the list of images.
def fit(self, predictions, preprocessed): components = np.zeros_like(predictions, dtype=np.int32) if not predictions.shape == preprocessed.shape: raise ValueError("Arrays must be of the same shape.") if len(np.unique(predictions)) != 2: raise ValueError("Images must be ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform(self, imgList):\n res = []\n for img in tqdm(imgList):\n y_mean = np.mean(img, axis=1)\n self.get_filtration(y_mean)\n seg = self.get_segments()\n seg = sorted(seg, key=lambda x:x[0])\n res.append(seg)\n return res", "def s...
[ "0.6554912", "0.63906217", "0.6313455", "0.6307917", "0.6031613", "0.60175514", "0.59948695", "0.5958208", "0.59340566", "0.5863395", "0.5789906", "0.56916976", "0.565657", "0.56379354", "0.56131774", "0.560912", "0.5609004", "0.56081474", "0.5606187", "0.5595564", "0.5589822...
0.0
-1
Returns the fitted segmentations.
def fit_transform(self, predictions, preprocessed): return self.fit(predictions, preprocessed).components_
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_segments(self, sets=None):\n if sets is None:\n if self.sets is not None:\n sets = self.sets\n else:\n raise ValueError(\"sets and self.sets attributes are None, \\\n you need either to pass an origin argument to get_segments or ...
[ "0.59932095", "0.5905949", "0.5897672", "0.57764655", "0.5775029", "0.57539517", "0.56566566", "0.5583639", "0.55373126", "0.5514485", "0.5507249", "0.54662603", "0.54589224", "0.5393599", "0.5386952", "0.5371709", "0.5359125", "0.5356785", "0.53562206", "0.53103703", "0.5286...
0.0
-1
Returns the fitted segmentations.
def transform(self, predictions, preprocessed): return self.fit(predictions, preprocessed).components_
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_segments(self, sets=None):\n if sets is None:\n if self.sets is not None:\n sets = self.sets\n else:\n raise ValueError(\"sets and self.sets attributes are None, \\\n you need either to pass an origin argument to get_segments or ...
[ "0.59932095", "0.5905949", "0.5897672", "0.57764655", "0.5775029", "0.57539517", "0.56566566", "0.5583639", "0.55373126", "0.5514485", "0.5507249", "0.54662603", "0.54589224", "0.5393599", "0.5386952", "0.5371709", "0.5359125", "0.5356785", "0.53562206", "0.53103703", "0.5286...
0.0
-1
Finds a set of components believed to be individual nuclei using the watershed segmentation algorithm. Works quite well, even if we have several nuclei grouped together.
def watershed_cc(pred, original, nms_min_distance=1, watershed_line=True, return_mask=False): im = np.multiply(pred, original) dt = ndimage.distance_transform_edt(pred) peaks = feature.peak_local_max( dt, exclude_border=False, indic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def segment_nuclei3D_monolayer(stack, sigma1=3, sigma_dog_big=15, \n sigma_dog_small=5, seed_window=(30,30), min_seed_dist=25, \n dilation_length=5, size_min=0, size_max=np.inf, display=False):\n # Make max projection on Z.\n maxp = stack.max(axis=0)\n # Filter with DoG to make nuclei into b...
[ "0.5711863", "0.56768155", "0.5569247", "0.5509172", "0.5486973", "0.5473561", "0.54674554", "0.54341656", "0.5417853", "0.5379912", "0.5320585", "0.5293571", "0.5286684", "0.52405083", "0.5216434", "0.52032375", "0.5170825", "0.5140413", "0.5125448", "0.5107759", "0.50666624...
0.0
-1
parses S3 URIs, seperating out buckets and keys from URI
def parse_s3_uri(URIs): buckets, keys = [], [] for URI in URIs: uri_path = path.normpath(URI).split("/") buckets.append(uri_path[1]) keys.append(uri_path[2:]) return buckets, keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_uri(uri):\n if not uri.startswith(\"s3://\"):\n raise ValueError(\"Expected S3 URI\")\n\n bucket_name, key = uri.replace(\"s3://\", \"\").split(\"/\", 1)\n return bucket_name, key", "def split_uri(s3_uri):\n if not s3_uri.startswith(\"s3://\"):\n # This is a local path, indica...
[ "0.7601655", "0.75760186", "0.74301505", "0.7424966", "0.7108844", "0.70691174", "0.7015538", "0.7009675", "0.7009675", "0.6822402", "0.6709821", "0.6485721", "0.64307153", "0.623975", "0.621792", "0.6195706", "0.61945844", "0.61888546", "0.6175611", "0.6159094", "0.61582816"...
0.86739224
0
This method is deprecated. Please switch to GetRootAs.
def GetRootAsChannelBalance(cls, buf, offset=0): return cls.GetRootAs(buf, offset)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rootfs(self) -> \"Directory\":\n _args: list[Arg] = []\n _ctx = self._select(\"rootfs\", _args)\n return Directory(_ctx)", "def rootfs(self):\r\n return self._rootfs", "def rootfs(self):\r\n return self._rootfs", "def get_root(self) -> object:", "def fs(self) -> \"Dir...
[ "0.5394841", "0.53645456", "0.53645456", "0.5305339", "0.52419364", "0.5240443", "0.5240443", "0.5239821", "0.52005446", "0.5148429", "0.5112365", "0.50947225", "0.5060344", "0.505803", "0.5003554", "0.5001902", "0.49474752", "0.49453163", "0.4933029", "0.4907976", "0.4907863...
0.0
-1
Outlier detector for timeseries data using One Class SVM
def one_class_svm(current_skyline_app, parent_pid, timeseries, algorithm_parameters): # You MUST define the algorithm_name algorithm_name = 'one_class_svm' # Define the default state of None and None, anomalous does not default to # False as that is not correct, False is only correct if the algorithm ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def svm():", "def outlierdetection(data,method):\n import numpy as np\n ##########\n # 0. Input\n data = np.array(data)\n methodname = method['name']\n rule = method['rule']\n try:\n mask = rule['initmask'].copy()\n if not mask:\n mask = np.full_like(data,True,dtype=...
[ "0.6507727", "0.62450814", "0.6208604", "0.6206277", "0.62011534", "0.61712617", "0.60500234", "0.60008377", "0.5930507", "0.5920431", "0.5913056", "0.588166", "0.584529", "0.5831821", "0.5813421", "0.576175", "0.57523173", "0.5750024", "0.5742112", "0.5689782", "0.56578743",...
0.510546
94
Stores word2id dictionary from words in training vocabulary
def make_word2id(): with open("public_data/stats/stats_train.pkl", 'rb') as stats: stats = pickle.load(stats) vocab = stats["VOCAB"] word2id = {word: id for id, word in enumerate(["PAD"] + ["UNK"] + vocab)} with open('public_data/vocab/word2id.pkl', 'wb') as out: pickle.dump(word2i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vocab(self):\n word2id = {}\n for document in self.docs:\n for word in document:\n if word not in word2id.keys():\n word2id[word] = len(word2id)\n return word2id", "def construct_dict(self):\n i = 0\n self.word2idx = dict()\n...
[ "0.73038775", "0.7203376", "0.70576453", "0.6924759", "0.6815921", "0.6719704", "0.67111146", "0.6669637", "0.6546232", "0.65460104", "0.6448843", "0.64258194", "0.6423799", "0.64063257", "0.6365616", "0.63559467", "0.6345046", "0.63379437", "0.63323116", "0.63318515", "0.632...
0.7919803
0
Initializes word embeddings for each word in training vocabulary from pretrained or customtrained embedding files
def prepare_word_emb_matrices(experiment): with open("public_data/stats/stats_train.pkl", 'rb') as stats: stats = pickle.load(stats) vocab = stats["VOCAB"] stops = [word.lower() for word in set(stopwords.words('english'))] vocab = vocab + stops if experiment == "RANDOM": w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(self, preload_embeddings):\n\t\tself.__find_metadata()\n\t\tself.__parse_embedding_metadata()\n\t\tself.__parse_model_metadata()\n\t\t# should we load all of the word embeddings into memory now?\n\t\tif preload_embeddings:\n\t\t\tlog.info(\"Preloading word embeddings ...\")\n\t\t\tfor embed_id in self.emb...
[ "0.7858145", "0.7508555", "0.75004286", "0.73533785", "0.73066145", "0.7306201", "0.7295709", "0.72375834", "0.7204546", "0.7203028", "0.7153719", "0.71469235", "0.71277654", "0.7126685", "0.7108892", "0.70720536", "0.7041164", "0.70374227", "0.6961772", "0.6956591", "0.69394...
0.6554978
47
Write updated data list as inmem list and to file.
def _write(self, data): self.db.append(data) with open(self.DB_FILE, 'w') as outfile: json.dump(self.db, outfile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_update(self, data):\n file = open(\"../util/LinkedList_File\", \"r+\")\n file.truncate(0)\n file.close()\n if self.search_item(data) == True:\n self.remove(data)\n file = open(\"../util/LinkedList_File\", \"a+\")\n\n orderedlist_content = []\n ...
[ "0.679158", "0.665912", "0.650961", "0.6306783", "0.61629987", "0.61586833", "0.61474013", "0.6122947", "0.6103944", "0.60902184", "0.6079979", "0.60586274", "0.6058106", "0.60206825", "0.60011584", "0.59868616", "0.5978933", "0.5975859", "0.5948233", "0.5927299", "0.5922315"...
0.57152194
32
Formats event values using the helper.
def FormatEventValues(self, output_mediator, event_values): primary_url = event_values.get('primary_url', None) if primary_url == '': event_values['primary_url'] = 'local file'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_data(self, data):", "def formatEventMessage(self, message):\r\n\t\treturn format.formatEventMessage(message)", "def format_event(event):\n del event['period']\n try:\n name= \"\"\n for course in event['courses']:\n name = \"%s \"%(course['name'])\n del event['co...
[ "0.62208414", "0.6217709", "0.60812426", "0.60305226", "0.58333987", "0.5801298", "0.5801298", "0.5799714", "0.57810867", "0.5690141", "0.5676097", "0.5624468", "0.5603518", "0.55532235", "0.5551274", "0.55096376", "0.55087197", "0.5499524", "0.54364294", "0.543079", "0.54157...
0.56848615
10
Formats event values using the helper.
def FormatEventValues(self, output_mediator, event_values): # There appears to be an issue in either GURL.cc or # content_settings_pattern.cc where URLs with file:// scheme are stored in # the URL as an empty string, which is later detected as being Invalid, and # Chrome produces the following example l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_data(self, data):", "def formatEventMessage(self, message):\r\n\t\treturn format.formatEventMessage(message)", "def format_event(event):\n del event['period']\n try:\n name= \"\"\n for course in event['courses']:\n name = \"%s \"%(course['name'])\n del event['co...
[ "0.62208414", "0.6217709", "0.60812426", "0.60305226", "0.58333987", "0.5801298", "0.5801298", "0.5799714", "0.57810867", "0.5690141", "0.56848615", "0.5676097", "0.5624468", "0.5603518", "0.55532235", "0.5551274", "0.55096376", "0.5499524", "0.54364294", "0.543079", "0.54157...
0.55087197
17
Setup nibe uplink component
async def async_setup(hass, config): store = hass.config.path('nibe.json') def save_json_local(data): save_json(store, data) from nibeuplink import Uplink scope = None if config[DOMAIN].get(CONF_WRITEACCESS): scope = ['READSYSTEM', 'WRITESYSTEM'] else: scope = ['READS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server_link_setup(self):\n pass", "def __init__(self):\n self.__uplinker = None\n self.__downlinker = None", "def controls_setup(self):\n\n self.to_homepage = element.Link(self, class_name='nav-home', alias='Return to site Link')\n self.account = element.Link(self, class_...
[ "0.5822916", "0.56844145", "0.5620785", "0.56120604", "0.5605638", "0.5575404", "0.55546343", "0.55179006", "0.5504443", "0.5497689", "0.54445356", "0.5419904", "0.5395118", "0.5393442", "0.53845906", "0.53444666", "0.53216326", "0.52964264", "0.5291409", "0.52556247", "0.521...
0.54030174
12
Return a filtered array based on existance in a filter list
def filter_list(data: List[dict], field: str, selected: List[str]): if len(selected): return [x for x in data if x[field] in selected] else: return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_filter(function,lst):\n return list(x for x in lst if function(x))", "def filter(self, filters):", "def Filter(sourcesarray, match, include=1):\n if include:\n return Array(*[item for item in sourcesarray if item.find(match) > -1])\n else:\n return Array(*[item for item in sources...
[ "0.6683644", "0.65933347", "0.6530392", "0.6372345", "0.6365861", "0.63164407", "0.62962997", "0.62681323", "0.62503004", "0.62436765", "0.6236248", "0.61456823", "0.6075913", "0.6066385", "0.6055565", "0.6049173", "0.60201913", "0.5994618", "0.5964025", "0.5960885", "0.59446...
0.6376032
3
Keep unique discovery list, to avoid duplicate loads
def filter_discovered(self, discovery_info, platform): table = self.discovered[platform] for entry in discovery_info: object_id = entry.get(CONF_OBJECTID) if object_id in table: continue table.add(object_id) yield entry
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.ids_seen = set()", "def disable_discovery(self):", "def __init__(self):\n self.seen = {}", "def build_discovery_items(self):\n\n # discovery disk names\n self._lld_disk_names()", "def _refresh_discovery(self):\n if self.terminate_flag:\n ...
[ "0.63157904", "0.574849", "0.5661731", "0.55901134", "0.5555808", "0.55549824", "0.5511918", "0.5494652", "0.5493371", "0.5405331", "0.5401739", "0.53912646", "0.53540677", "0.5309379", "0.52819586", "0.5228537", "0.51963127", "0.5165947", "0.5148784", "0.514354", "0.51337075...
0.5167705
17
Load plaform avoding duplicates
async def load_platform(self, discovery_info, platform): load_info = list(self.filter_discovered(discovery_info, platform)) if load_info: await discovery.async_load_platform( self.hass, platform, DOMAIN, load_info, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadDuplicates(self, filename:str) -> None :\n if(not isinstance(filename,str)):\n raise TypeError(\"filename must be a string but %s was passed\"%str(type(filename)))\n if(not os.path.exists(filename) or not os.path.isfile(filename)):\n raise ValueError(\"invalid filename\"...
[ "0.5984813", "0.5843569", "0.5405093", "0.5393021", "0.53492624", "0.5349073", "0.5311702", "0.52835876", "0.52080476", "0.5198499", "0.5194162", "0.5190725", "0.5174932", "0.5173467", "0.51385826", "0.5132022", "0.5118995", "0.50896597", "0.50890756", "0.50644493", "0.505864...
0.0
-1
Create SV object for each pysam variant record.
def __init__(self, rec): self.chr1 = chromosome(rec.chrom) self.pos1 = int(rec.start) + 1 self.pos2= int(rec.stop) self.type = rec.info["SVTYPE"] if self.type == "BND": self.chr2=chromosome(rec.info["CHR2"]) else: self.chr2=self.chr1 self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_svs(self):\n sv_list = [ SV(rec) for rec in VariantFile(self.vcf).fetch()]\n sv_name_dict = {sv.name: sv for sv in sv_list}\n return sv_name_dict", "def sv_variant(store, institute_id, case_name, variant_id=None, variant_obj=None, add_case=True,\n get_overlapping=True):...
[ "0.5948981", "0.5923564", "0.5854728", "0.5840757", "0.56889427", "0.56258255", "0.55227375", "0.55044156", "0.5434997", "0.536042", "0.52940637", "0.520542", "0.51464725", "0.51232344", "0.51231813", "0.51105523", "0.5106572", "0.51047045", "0.5097932", "0.5095036", "0.50895...
0.0
-1
Creation of sample object.
def __init__( self, cns, merged_vcf, out_dir, ): # pylint: disable=line-too-long self.cns = cns self.out_dir = os.path.join(out_dir) self.vcf = str(merged_vcf) self.segs = os.path.join(self.out_dir, "segs.csv") self.circos_out = os.path...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self):\n # This method is set in __init__.\n pass", "def create_samples(self):\n self._samples = self.load_samples()\n self.modify_samples()", "def __init__(self, samples):\n self.samples = samples", "def sample(self):", "def create_sample(i):\n retu...
[ "0.75494295", "0.75220054", "0.7349675", "0.7253729", "0.71794605", "0.71450335", "0.71450335", "0.7131534", "0.7098131", "0.7057985", "0.6943872", "0.6927316", "0.6887495", "0.6802299", "0.67999476", "0.6769468", "0.67282856", "0.66420794", "0.6594825", "0.65646416", "0.6550...
0.0
-1
Get svs objects from sample vcf.
def get_svs(self): sv_list = [ SV(rec) for rec in VariantFile(self.vcf).fetch()] sv_name_dict = {sv.name: sv for sv in sv_list} return sv_name_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vcf_samples(vcffile):\n try:\n vcf_reader = vcf.Reader(open(vcffile, 'r'))\n return vcf_reader.samples\n except Exception as error:\n print(f\"Could not read vcffile {vcffile}: continuing without vcf data: {str(error)}\")\n\n return []", "def getSubsampleList(vcfname, ss_count):...
[ "0.6682491", "0.6532085", "0.5918478", "0.5818715", "0.5734617", "0.56976557", "0.5694424", "0.5552797", "0.5545813", "0.55284965", "0.54991204", "0.5493698", "0.5442525", "0.541359", "0.5402705", "0.5394836", "0.5393049", "0.53915596", "0.53641003", "0.530422", "0.5296158", ...
0.5816024
4
Set arguments and run script for creating circos plot.
def runcircos(self): pd.read_csv(self.cns, sep="\t")[ ["chromosome", "start", "end", "tcn"] ].rename({"chromosome": "chrm", "tcn": "cns"}, axis=1).to_csv( self.segs, index=None ) passed_svs = [ sv for sv in self.svs.values() ] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_plot(args):\n # print(\"running chronqc_plot\")\n chronqc_plot.main(args)", "def run(self,circos_location, seasons=True):\n self.taxonomy_plot(seasons)\n print(seasons)\n filename=self.place+'_'+self.year+'.png'\n self.run_circos(filename, circos_location)\n print...
[ "0.7341341", "0.6403861", "0.63161117", "0.62584734", "0.6240776", "0.60911417", "0.60852385", "0.6037781", "0.60110474", "0.5987008", "0.58914214", "0.5857759", "0.58060664", "0.5780569", "0.5754634", "0.5738888", "0.5714544", "0.5700746", "0.56775856", "0.5660971", "0.56425...
0.0
-1
Create asset array with all sizes of images for each product of lifecycle
def generate_assets(all_assets): assets = {} for lifecycle, products in all_assets.iteritems(): assets[lifecycle] = [] for product in products: asset_obj = OrderedDict() asset_obj["id"] = product[0] asset_obj["division"] = product[1] asset_obj["we...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _assign_sizes(self):", "def resize_images(self, images):\n \n img_list = []\n \n for img in images:\n \n yield np.resize(img, (64, 64, 3))", "def process_batch(self, image_batch):\n images = []\n for image_data in image_batch:\n image_resize = ...
[ "0.6172347", "0.5884541", "0.5736473", "0.56442803", "0.56417143", "0.55343497", "0.55309707", "0.55230796", "0.55127066", "0.54805094", "0.5476719", "0.54632604", "0.5457379", "0.54541683", "0.54203033", "0.54203033", "0.54203033", "0.5414684", "0.5413111", "0.53764224", "0....
0.6367673
0
Create separate list of products
def create_lol_non_json(): all_assets= { 'loyalist_products' : [], 'nonloyalist_products' : [] } with open('product_map.csv', 'rU') as product_map_file: reader = csv.reader(product_map_file) reader.next() for row in reader: if row[1].lower() == 'loyalist'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_products(self):\n\n lst = []\n for product in self.products.findall('product'):\n id = product.find('id').text\n name = product.find('name').text\n dispensary_id = product.find('dispensary_id').text\n dispensary_name = product.find('dispensary_name'...
[ "0.74861544", "0.72362596", "0.7197762", "0.7040266", "0.69847625", "0.6922062", "0.691666", "0.69131726", "0.6891263", "0.68896013", "0.6869908", "0.68412274", "0.68405294", "0.6837897", "0.6827034", "0.68108493", "0.673016", "0.67167586", "0.6713133", "0.6710625", "0.669335...
0.0
-1
This script gets and processes the http response
def top_ten(subreddit): url = "https://www.reddit.com/r/" + subreddit + "/hot.json?limit=10" identify = {"User-Agent": "Requests library from Python", "From": "774@holbertonschool.com"} to_print = [] hot = requests.get(url, headers=identify, allow_redirects=False) if hot.status_code ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _response(request):\n with urllib.request.urlopen(request) as response:\n status = response.getcode()\n # print(status, response.info(), )\n data = json.loads(\n response.read().decode('utf-8')\n )\n # print(data)\n if status == 200 and data[\"ok\"]:\n ret...
[ "0.6703084", "0.66665196", "0.6639998", "0.66399527", "0.6639149", "0.6597249", "0.6549161", "0.65198433", "0.65198433", "0.63763225", "0.63388866", "0.63277644", "0.62929446", "0.62929446", "0.6288604", "0.62816554", "0.6234211", "0.62265575", "0.62011707", "0.61990803", "0....
0.0
-1
Wake up every hour and log stats, and then reset them
def statsWorker(): logger.info('STATS: Starting. Will report out every {0:.1g} hours'.format( config.STATS_HOURS)) while True: gevent.sleep(timedelta(hours=config.STATS_HOURS).total_seconds()) logger.info('STATS: {0}'.format(stats)) stats.resetStats() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_monitoring(self):\n full_delta = datetime.datetime.now() - datetime.timedelta(seconds=self.time_per_sample + 5)\n\n self.time_in = self.time_in[self.time_in.time > full_delta]\n self.time_out = self.time_out[self.time_out.time > full_delta]", "def shutdown_all(self, now=False):", ...
[ "0.6193402", "0.61183417", "0.61158735", "0.6086553", "0.6029186", "0.59815824", "0.59248847", "0.5893207", "0.588353", "0.5867332", "0.5845896", "0.57497585", "0.57359594", "0.5724779", "0.5697916", "0.5680231", "0.56749666", "0.5672578", "0.56719005", "0.56719005", "0.56623...
0.6350241
0
This converts the first entry on the line to an ahref
def _convert_first_href(line): x = line.split(',') x[0] = '<a href=%(url)s>%(url)s</a>' % {'url': x[0]} return ",".join(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getanchor(self, line):\n m = anchor_re.match(line)\n if not m:\n return self._getsec(line)\n self.anchors.append(m.group(1))", "def ref_to_link(txt):\n text = txt.group(1) # because it was a match in a regular expression\n\n thecite, everythingelse = first_bracketed_st...
[ "0.63108945", "0.61250603", "0.6017764", "0.6002495", "0.5956088", "0.5952824", "0.5938942", "0.5931109", "0.5890632", "0.5864228", "0.58549714", "0.5852067", "0.58110666", "0.581035", "0.57908547", "0.5742307", "0.5735765", "0.5683315", "0.5677927", "0.5621661", "0.56175065"...
0.77906954
0
This prints out the CSV with a header added
def print_csv(): # read lines, and make the first a link show_played = request.args.get('showPlayed', 'true') == 'true' show_out_of_office = request.args.get('showOutOfOffice', 'true') == 'true' songs = database.load_songs(include_played=show_played, include_out_of_office=show_out_of_office) entries...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printCsvHeader(self):\n print \"SOURCE FILENAME, RECORD NUMBER, TIME GEN, \"\\\n \"TIME WRITE, CATEGORY, EVENTID, SOURCE, \"\\\n \"COMPUTER, SID, STRINGS, RAW DATA (HEX), \"\\\n \"DECODED DATA\"", "def printCsv(self):\n self.printCsvHeader()\n for r in se...
[ "0.77476895", "0.74596447", "0.7383138", "0.71409005", "0.69810814", "0.69635314", "0.69633526", "0.695496", "0.68683624", "0.6853501", "0.68518484", "0.6849127", "0.68360305", "0.6787503", "0.67758346", "0.6773313", "0.6755514", "0.67418337", "0.6713585", "0.6700836", "0.669...
0.763549
1
This gets the song name from the YouTube address
def get_song_name(): try: url = request.args.get('url') if url: return util.get_title_from_youtube_url(url) else: return '<URL was missing>' except Exception as ex: return str(ex.message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_song_name_from_result(result):\n return result['metadata']['music'][0]['external_metadata']['spotify']['track']['name']", "async def yt_info(self, song):\n API_KEY = 'API_KEY'\n youtube = build('youtube', 'v3', developerKey=API_KEY)\n song_data = youtube.search().list(part='snippe...
[ "0.69615036", "0.6758768", "0.6587414", "0.6573831", "0.61943185", "0.6166351", "0.6151563", "0.61483437", "0.612491", "0.6116674", "0.6101847", "0.6078137", "0.60509545", "0.6022776", "0.59889394", "0.5975916", "0.59588563", "0.5937606", "0.58966094", "0.58892465", "0.588782...
0.7844623
0
Adds an entry to the CSV database, and refreshes the home page to update
def add_entry(): username = util.remove_commas_from_string(request.form["name"]) link = util.remove_commas_from_string(request.form["ytLink"]) song = util.remove_commas_from_string(request.form["songName"]) festive = CHRISTMAS_MODE and "christmasSong" in request.form with database.connect_to_datab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new_entry(self):\n clear_screen()\n new_entry = Entry.create()\n if new_entry is None:\n print(\"Add new entry cancelled. Returning to main menu...\")\n time.sleep(1)\n return None\n self.entries.append(new_entry)\n with open(self.file_na...
[ "0.6677502", "0.6490527", "0.62061507", "0.6157329", "0.6034289", "0.5984125", "0.5916877", "0.58995205", "0.58900774", "0.5866513", "0.58586043", "0.5850422", "0.5807804", "0.57683897", "0.574883", "0.57366544", "0.5723711", "0.5639146", "0.5606884", "0.5592421", "0.558032",...
0.620994
2
Connects to database, creates tables and loads data from csv
def connect_db_and_load_data(cls): db.connect() db.create_tables([Product], safe=True) load_data(transform_data('./inventory.csv'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(csvfile, dbfile, verbose=False):\n CONN = sqlite3.connect(dbfile)\n cursor = CONN.cursor()\n create_schema(cursor)\n process_data(cursor, csvfile, verbose=verbose)\n CONN.commit()\n CONN.close()", "def load_data_to_db(self, path):\n table_names = ['train_transaction', 'train_ide...
[ "0.7633099", "0.7233952", "0.70024323", "0.6959611", "0.69234383", "0.68967825", "0.68423486", "0.6809061", "0.679033", "0.6757163", "0.6749312", "0.6674741", "0.66451144", "0.66323376", "0.6627188", "0.65659904", "0.6553499", "0.6547236", "0.6542627", "0.6540748", "0.6532193...
0.7798764
0
Closes connection to database
def close_db_connection(cls): db.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_database(self):\n if self._conn is not None:\n self._conn.close()\n self._conn = None", "def close_connection(exception):\n db = database()\n\n if db is not None:\n db.close()", "def close(self):\n Log.debug('DB -> close')\n # 关闭数据库连接\n s...
[ "0.85016555", "0.8405002", "0.82406324", "0.8214387", "0.8180319", "0.8176797", "0.8130337", "0.80947405", "0.8090644", "0.80654186", "0.80572706", "0.8053135", "0.80515546", "0.8043433", "0.8011985", "0.79536927", "0.79522735", "0.79410815", "0.7937091", "0.79334754", "0.791...
0.85548913
0
Prints out product information to user
def view_product(cls, product_id): product = Product.get_by_id(product_id) print(f'Product ID: {product.product_id}') print(f'Product Name: {product.product_name}') print(f'Quantity: {product.product_quantity}') print(f'Price: ${product.product_price / 100:.2f}\n')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_product(product):\r\n try:\r\n print(\"\\n \\\r\n Name : {} \\n \\\r\n Categories : {} \\n \\\r\n Nutri-score : {} \\n \\\r\n Stores : {} \\n \\\r\n URL : {}\".format(product.name, product.category, product.nutri_score, product.stores, product.url))\r\n exc...
[ "0.7719133", "0.7319412", "0.7306002", "0.6926241", "0.6847679", "0.6817994", "0.68163544", "0.68028635", "0.67810386", "0.6775534", "0.67506266", "0.66753685", "0.65628284", "0.6547994", "0.64796215", "0.64610463", "0.6396557", "0.63806146", "0.6356014", "0.63211477", "0.629...
0.7124964
3
Adds a new product to the database based on user input. Conflict handling will check if the product name already exists. If it already exists, the price, quantity and date_updated values will update the existing product.
def add_product(cls, product_name, price, quantity): Product.insert(product_name=product_name, product_price=price, product_quantity=quantity, date_updated=date.today()).on_conflict( conflict_target=[Product.product_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_product():\n name = input(\"\\nPlease enter the name of the new product: \")\n\n quantity = input(\"Please enter the quantity of the new product: \")\n while quantity.isdigit() == False:\n print(\"Please enter a valid number.\")\n quantity = input(\"Please enter the quantity of the n...
[ "0.7842531", "0.76138026", "0.7161013", "0.7147513", "0.7056334", "0.69976074", "0.6955493", "0.686388", "0.68623877", "0.6830491", "0.6797156", "0.6791129", "0.67237514", "0.66988385", "0.66972744", "0.6694683", "0.6676686", "0.666991", "0.66635215", "0.6643723", "0.6605917"...
0.8031394
0
Writes database values with header to a csv file
def backup_database(cls): with open('db_backup.csv', 'w', newline='') as csvfile: fieldnames = ['product_name', 'product_price', 'product_quantity', 'date_updated'] writer = csv.DictWriter(csvfile, fieldnames=f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dbtocsv():\n connection = sqlite3.connect(\"sensordata.db\")\n cursor = connection.cursor()\n cursor.execute(\"Select * from sensordata\")\n roadstationdata = cursor.fetchall()\n\n with open('roadstationdata.csv', 'w') as f:\n writer = csv.writer(f)\n wr...
[ "0.76455003", "0.7485735", "0.744107", "0.73065215", "0.72242785", "0.7182872", "0.7182053", "0.71791434", "0.71308947", "0.71163934", "0.7060005", "0.70399785", "0.7039917", "0.7022545", "0.6983291", "0.6969411", "0.69114316", "0.6907802", "0.68914586", "0.68578553", "0.6857...
0.0
-1
Convert content to rst using pandoc before processing. Probably a better way is to write a parser for specific formats (like org), but this way also works for me at the moment.
def pandoc_s2s(app, docname, source): enabled_extensions = app.config.pandoc_s2s_formats noextpath = os.path.join(app.srcdir, docname) if not os.path.exists(noextpath + ".rst"): for ext in enabled_extensions: if os.path.exists(noextpath + ext): source[0] = pypandoc.conv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert(text):\n return NewDocument.from_rst(text).format()", "def md2rst(comment):\n comment = _replace_proto_link(comment)\n comment = _replace_relative_link(comment)\n # Calling pypandoc.convert_text is slow, so we try to avoid it if there are\n # no special characters in the markdown.\n ...
[ "0.6629364", "0.63496023", "0.5978491", "0.5888104", "0.58814806", "0.5850596", "0.58104074", "0.5769398", "0.5743764", "0.56902677", "0.564775", "0.5585933", "0.55818903", "0.55590147", "0.55236834", "0.5510411", "0.54904723", "0.5478478", "0.54760224", "0.54547244", "0.5453...
0.60263896
2
Read input files for forward modeling MAG data with integral form
def readDriverFile(self, input_file): fid = open(self.basePath + input_file,'r') # Line 1 line = fid.readline() l_input = line.split('!') mshfile = l_input[0].rstrip() # Line 2 line = fid.readline() l_input = line.split('!') obsfile = l_input...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_input():\n \n argv = sys.argv\n\n # Read file names from sd input\n f_dy = argv[1] # matdyn.modes\n f_pat = argv[2] # path.out (should be in crystal coords)\n f_ph = argv[3] # ph.x output (Gamma point)\n\n # Read input card\n f_inp = open(\"input.dat\",'r')\n l1 = f_inp.readline()\n l2 ...
[ "0.6726617", "0.6331531", "0.63193476", "0.62506515", "0.6219639", "0.62157834", "0.6105938", "0.60854405", "0.608", "0.606185", "0.6054738", "0.6044497", "0.60268104", "0.6025265", "0.60024285", "0.5986286", "0.59802216", "0.5955783", "0.59379214", "0.59329593", "0.5928754",...
0.56395495
49
Read and write UBC mag file format
def readMagneticsObservations(self, obs_file): fid = open(self.basePath + obs_file,'r') # First line has the inclination,declination and amplitude of B0 line = fid.readline() B = np.array(line.split(),dtype=float) # Second line has the magnetization orientation and a flag ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_ucm(fname, flt=True): \n\n # Assume it is a file object, if that fails, assume it is\n # the name of a file.\n if not fname.endswith('.ucm'): fname += '.ucm'\n uf = open(fname, 'rb')\n start_format = check_ucm(uf)\n\n # read the header\n lmap = struct.un...
[ "0.6118707", "0.5667265", "0.5606043", "0.55985844", "0.5594466", "0.55195343", "0.5511902", "0.5482303", "0.5480723", "0.54551816", "0.5448997", "0.544842", "0.5422699", "0.5405521", "0.53641874", "0.5348649", "0.53415036", "0.5338529", "0.5332335", "0.53107554", "0.5299718"...
0.5253082
25
Extracts crater coordinates (in pixels) from a CNNpredicted target by iteratively sliding rings through the image via match_template from scikitimage.
def template_match_t(self, target, minrad=minrad_, maxrad=maxrad_, longlat_thresh2=longlat_thresh2_, rad_thresh=rad_thresh_, template_thresh=template_thresh_, target_thresh=target_thresh_, rw=rw_): # thickness of rings for template match #c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(image_path, wrapper):\n \"\"\"\n #Don't forget to store your prediction into ImgPred\n img_prediction = ImgPred(...)\n \"\"\"\n\n #This is where all of our code will probably go. Here are the steps to success\n\n \n #Step One: Make a list which will cont...
[ "0.5992719", "0.59377164", "0.59244645", "0.5877198", "0.5799066", "0.5745002", "0.57416475", "0.5725476", "0.56992644", "0.5695285", "0.56865203", "0.56704944", "0.5668689", "0.5619099", "0.55937564", "0.55932057", "0.5573753", "0.55696166", "0.55518115", "0.55396336", "0.54...
0.613752
0
Extracts crater coordinates (in pixels) from a CNNpredicted target and compares the resulting detections to the corresponding humancounted crater data.
def template_match_t2c(self, target, csv_coords, templ_coords=None, minrad=minrad_, maxrad=maxrad_, longlat_thresh2=longlat_thresh2_, rad_thresh=rad_thresh_, template_thresh=template_thresh_, target_thresh=target_thresh_, rw=rw_, rmv_oor_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_detections(self):\n self.rescue_model.setInput(self.human_blob)\n self.predictions = self.rescue_model.forward()", "def check_location_confidence(self):\n\t\t## not the best way of doing things, but since the number of targets is fairly small its not a big deal\n\t\tepsilon_pixels = .05...
[ "0.61143154", "0.5797125", "0.5749966", "0.57078636", "0.5680167", "0.56654924", "0.56583524", "0.5654925", "0.5617579", "0.55887747", "0.5530215", "0.550109", "0.55003667", "0.54896927", "0.5488162", "0.5471375", "0.5454677", "0.5451576", "0.5415351", "0.54121715", "0.541105...
0.0
-1
Get a value from a dict given the path of keys.
def _get_item(dic: dict, keys: list) -> dict: for key in keys: dic = dic[key] return dic
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_by_path(dic, keys):\n assert len(keys) > 0, \"Path key can not be an empty list.\"\n\n d = dic\n for key in keys[:-1]:\n if isinstance(key, int) or key in d:\n d = d[key]\n else:\n return None\n if keys[-1] in d or (isinstance(d, list) and keys[-1] < len(d))...
[ "0.7505709", "0.7276085", "0.7272637", "0.721048", "0.7075952", "0.70516545", "0.70516545", "0.70505357", "0.70081717", "0.6968512", "0.6761517", "0.6701562", "0.6662266", "0.66403395", "0.6639223", "0.66334224", "0.66276485", "0.66131806", "0.6607364", "0.6603064", "0.658989...
0.6345587
27
Add a value to a dict, adding keys if they dont exist.
def _add_item(dic: dict, keys: list, value): for key in keys[:-1]: dic = dic.setdefault(key, {}) dic[keys[-1]] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_value(dict_, key, value):\n values = dict_.get(key)\n if not values:\n dict_[key] = [value]\n else:\n values.append(value)", "def add(self, key, value):\n if not key in self:\n self.keys.append(key)\n self.dict[key] = value", "def add_dict_entry(dictionary: dict, k...
[ "0.7905046", "0.7517903", "0.7489459", "0.7449004", "0.7408157", "0.71363246", "0.69774604", "0.69616073", "0.6950674", "0.692607", "0.67288506", "0.6648396", "0.6645448", "0.6618874", "0.65991503", "0.65767515", "0.6559169", "0.6549345", "0.6480917", "0.6460026", "0.6449708"...
0.7445743
4
Set a value in a dict given the path of keys.
def _set_item(dic: dict, keys: list, value): dic = _get_item(dic, keys[:-1]) dic[keys[-1]] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setByPath(self, keys, value):\n self.getByPath(keys[:-1])[keys[-1]] = value", "def _set_by_path(tree, keys, value):\n _get_by_path(tree, keys[:-1])[keys[-1]] = value", "def _set_by_path(tree, keys, value):\n _get_by_path(tree, keys[:-1])[keys[-1]] = value", "def set_by_path(data: Dict[str, T...
[ "0.82699955", "0.8231239", "0.8231239", "0.77619416", "0.7758317", "0.76248884", "0.7571507", "0.7554948", "0.74835116", "0.72777414", "0.72438604", "0.71699643", "0.6984562", "0.6948759", "0.66502666", "0.64740515", "0.6352684", "0.6308593", "0.6277035", "0.6261442", "0.6190...
0.680276
14
Remove a value in a dict given the path of keys.
def _del_item(dic: dict, keys: list): dic = _get_item(dic, keys[:-1]) del dic[keys[-1]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_by_path(data: Dict[str, T], path: Sequence[str]):\n del get_by_path(data, path[:-1])[path[-1]]", "def remove_from_dictionary(self,dictionary,*keys):\r\n for key in keys:\r\n if key in dictionary:\r\n value = dictionary.pop(key)\r\n logger.info(\"remov...
[ "0.7306085", "0.7012701", "0.6798138", "0.6667919", "0.66424066", "0.6637091", "0.6566849", "0.6552376", "0.6508199", "0.6453562", "0.637957", "0.6378392", "0.63694", "0.6334072", "0.6256144", "0.6209542", "0.61809266", "0.61768186", "0.6146161", "0.61303407", "0.60953987", ...
0.66727555
3
Tests that the CLI can properly init a new project install packages and build it 1. `enamlnative init` works to create a new project 2. `enamlnative install ` properly installs and links modules 3. `enamlnative buildpython` succeeds 4. `enamlnative buildandroid` succeeds
def init_build(): if 'TRAVIS' in os.environ: return #: Doesn't work on travis try: enamlnative = sh.Command('enaml-native') bundle_id = 'com.mycompany.myapp' print(enamlnative('init', 'MyApp', bundle_id, 'tmp/test_cli/')) with cd('tmp/test_cli/MyApp'): #: Mak...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_native_SDK3_project(self):\n self.make_project()\n self.add_file(\"main.c\", SIMPLE_MAIN)\n self.compile()\n self.check_compile_success()\n\n # self.check_package_manifest(manifest, package_options={'dependencies': deps})", "def test_native_SDK2_project(self):\n ...
[ "0.6791964", "0.63297325", "0.6315993", "0.60872173", "0.60378206", "0.60377306", "0.60319066", "0.5935328", "0.59059525", "0.5905044", "0.58770114", "0.58520967", "0.58490705", "0.5831709", "0.58151686", "0.5778338", "0.57725954", "0.5745965", "0.56459093", "0.564228", "0.55...
0.79316795
0
The function takes a list of words as its argument. Returns a score generated as follows, > Start with a net score of 0 > If the element is a alphastring, +1 > If the element is a number, 1
def alphanum_score(words): #Our score variable. score = 0 #Iterating over the list for i in words: if i.isalpha(): #A method to check if the word contains only alphabets. score += 1 elif i.isdigit():#A method to check if the word contains...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alphanum_score(words):\n\n\t# Add your code here\n\treturn", "def wordscore(word):\n return sum(letterscore[l] for l in word)", "def getWordScore(word, n):\n score = 0\n for letter in word:\n score += SCRABBLE_LETTER_VALUES[letter]\n score *= len(word)\n if len(word) == n:\n sc...
[ "0.7432295", "0.72729456", "0.6914699", "0.6846633", "0.68115157", "0.68013614", "0.6784953", "0.6776121", "0.6689199", "0.6604378", "0.6591572", "0.6557978", "0.6543751", "0.65320504", "0.64311683", "0.6414645", "0.6356937", "0.6258017", "0.6220672", "0.6216013", "0.62052256...
0.7487107
0
The function takes a list of words and a letter as its arguments. Returns a list sorted by the number of times the given letter occurs.
def occurences(words, letter): # Add your code here #An empty list that holds the number of occurences for each word. times = [] #Iterating over the list for i in words: times.append(i.count(letter)) #str.count(substr) is a method to find the occurence...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def letter_frequency(sentence, alphabet):\n sentence = sentence.lower()\n letter_frequency = []\n for char in alphabet:\n counter = sentence.count(char)\n letter_frequency.append((counter, char))\n sorted_frequency = sorted(letter_frequency)\n sorted_frequency.sort(reverse=True...
[ "0.78400177", "0.73378974", "0.7074989", "0.70550966", "0.70459694", "0.68162876", "0.6673813", "0.665069", "0.6647478", "0.6644844", "0.6631719", "0.65978014", "0.6554031", "0.6553464", "0.6523389", "0.65077704", "0.64865404", "0.6483174", "0.64714116", "0.6457109", "0.64385...
0.8560076
0
The functions takes two lists of 2tuples as its arguments. Returns a list of the form [tuples1 sorted by first element, tuples2 sorted by second element]
def function(tuples1, tuples2): # Add your code here #Main idea is to sort the tuples separately and concatenate them later. tuples1.sort() #Default argument is always the first element in a tuple. tuples2.sort(key = lambda x: x[1]) return tuples1 + tuples2 """ Altern...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_by_return(list_of_tuples):\n list_of_tuples = sorted(list_of_tuples, key=lambda item: item[0])\n left_side = list_of_tuples[0:2]\n right_side = list_of_tuples[2:4]\n left_side = sorted(left_side, key=lambda item: item[1])\n right_side = sorted(right_side, key=lambda item: item[1])\n resu...
[ "0.736006", "0.70949495", "0.7086582", "0.691162", "0.664975", "0.6569251", "0.6535565", "0.65042037", "0.6476197", "0.6445468", "0.64145356", "0.63522243", "0.6341892", "0.63319397", "0.63228965", "0.63190734", "0.6275016", "0.6194278", "0.6166531", "0.61547875", "0.61241627...
0.7919305
0
Initialize the LUNOS fans from config.
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): name = config.get(CONF_NAME, DEFAULT_LUNOS_NAME) relay_w1 = config.get(CONF_RELAY_W1) relay_w2 = config.get(CONF_RELAY_W2) default_speed = config.get(CONF_DEFAULT_SPEED) LOG.info(f"LUNOS fan '{name}' using relay...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Init(self, config):\r\n pass", "def initialize_from_config(self):", "def __init__(self, config, params):\n self.feature_dir = config.directories.opensmile_feats\n\n 'Initialization'\n self.list_IDs = params['files']\n self.mode = params[\"mode\"]", "def fan_init():\n dev...
[ "0.61067224", "0.6098123", "0.60075104", "0.5896833", "0.58445865", "0.5663469", "0.5585839", "0.5579746", "0.556924", "0.55532914", "0.5551684", "0.5442925", "0.5424319", "0.5419457", "0.5416812", "0.5393416", "0.5380878", "0.53572965", "0.5339995", "0.53384584", "0.53384477...
0.49863333
69
Once entity has been added to HASS, subscribe to state changes.
async def async_added_to_hass(self) -> None: await super().async_added_to_hass() # setup listeners to track changes to the W1/W2 relays async_track_state_change_event( self.hass, [self._relay_w1, self._relay_w2], self._detected_relay_state_change, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_added_to_hass(self):\n await super().async_added_to_hass()\n\n def on_state_changed():\n self.schedule_update_ha_state()\n\n for service in self._device.device_services:\n service.subscribe_callback(self.entity_id, on_state_changed)", "async def async_ad...
[ "0.71601", "0.6583371", "0.64190006", "0.6400421", "0.6393467", "0.6393467", "0.6350765", "0.6348705", "0.6336199", "0.6330525", "0.6267962", "0.6266046", "0.6231996", "0.6227355", "0.6158459", "0.6131308", "0.611768", "0.6110589", "0.6095292", "0.60749567", "0.6073431", "0...
0.566848
40
Whenever W1 or W2 relays change state, the fan speed needs to be updated
def _detected_relay_state_change(self, event): # ensure there is a delay if any additional state change occurs to # avoid confusing the LUNOS hardware controller self._record_relay_state_change() entity = event.data.get("entity_id") to_state = event.data["new_state"].state ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_set_speed(self, speed: str) -> None:\n switch_states = self._relay_state_map.get(speed)\n if not switch_states:\n LOG.warning(\n f\"LUNOS '{self._name}' DOES NOT support speed '{speed}'; ignoring speed change.\"\n )\n return\n\n #...
[ "0.654397", "0.6431654", "0.6424133", "0.63789564", "0.6370531", "0.6313728", "0.62521315", "0.625102", "0.62263256", "0.6209053", "0.6179188", "0.6178033", "0.6143569", "0.61357963", "0.61346716", "0.60986364", "0.60957795", "0.60572034", "0.6050834", "0.6033623", "0.6022424...
0.0
-1
Update any speed/state based attributes
def _update_speed_attributes(self): self._attributes[ATTR_SPEED] = self._current_speed if self._current_speed is None: return coding = self._attributes[CONF_CONTROLLER_CODING] controller_config = LUNOS_CODING_CONFIG[coding] if not controller_config: LOG.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n bondState = self._bond.getDeviceState(self._deviceId)\n if 'power' in bondState:\n self._state = True if bondState['power'] == 1 else False\n if self._state and bondState['speed'] in self._speed_name_by_value:\n self._attributes['current_speed'...
[ "0.7656136", "0.7104007", "0.6732699", "0.66890204", "0.6628044", "0.66127306", "0.66127306", "0.6612705", "0.6576689", "0.6559547", "0.6549842", "0.6462424", "0.6423813", "0.635823", "0.6349929", "0.63344187", "0.63335216", "0.6323203", "0.6307892", "0.6307892", "0.6307892",...
0.74510974
1
Return the name of the fan.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return f\"{get_device_name(self._data, 0, self._name)}\"", "def get_name() -> str:\n pass", "def name(self):\n return f\"{self._name} {self._sensor_name}\"", "def get_name() -> str:", "def name(self) -> str:", "def name(self) -> str:", "def name(self) -> str:", ...
[ "0.6794877", "0.6788239", "0.67876464", "0.6779532", "0.6748485", "0.6748485", "0.6748485", "0.6748485", "0.6748485", "0.67407566", "0.671406", "0.66934806", "0.66934806", "0.66934806", "0.66934806", "0.66917795", "0.66917795", "0.66917795", "0.66917795", "0.66917795", "0.669...
0.0
-1
Return the current speed.
def speed(self) -> str: return self._current_speed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_speed(self):\n return self._speed", "def speed(self):\n return self._speed.value", "def speed(self) -> float:\n return self._speed", "def speed(self) -> float:\n return self._speed", "def speed(self) -> str:\n return self._attributes.get(\"current_speed\")", "de...
[ "0.8788659", "0.8596774", "0.8521592", "0.8521592", "0.8486947", "0.8331615", "0.8331615", "0.8326152", "0.82587576", "0.82587576", "0.8232207", "0.82066435", "0.8165421", "0.8136782", "0.8136782", "0.80556864", "0.7951729", "0.7887643", "0.7849337", "0.7849337", "0.78484523"...
0.8565341
2
Return true if entity is on.
def is_on(self) -> bool: return self._current_speed != SPEED_OFF
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_on(self) -> bool:\n return self.entity_description.is_on_fn(self._client)", "def is_on(self) -> bool:\n return self.entity_description.state_fn(self._valve)", "def is_on(hass, entity_id):\n return hass.states.is_state(entity_id, STATE_ON)", "def is_on(self) -> bool:\n return se...
[ "0.85540265", "0.8216411", "0.8045664", "0.7860732", "0.7860732", "0.75340164", "0.7447756", "0.7408673", "0.73520595", "0.73520595", "0.73520595", "0.73520595", "0.73520595", "0.73107237", "0.7309693", "0.7309128", "0.7309128", "0.7309128", "0.7309128", "0.7309128", "0.73091...
0.0
-1
Return the current preset_mode.
def preset_mode(self) -> str: # NOTE: fan speeds are not really presets...the only presets LUNOS has is vent mode return self._vent_mode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preset_mode(self):\n return self._preset_mode", "def preset_mode(self) -> Optional[str]:\n return self._preset", "def preset_mode(self) -> str | None:\n state = self._state\n return state.custom_preset or _PRESETS.from_esphome(\n state.preset_compat(self._api_version)...
[ "0.92077225", "0.8650025", "0.86068445", "0.8189484", "0.7741249", "0.7717448", "0.75312", "0.75280756", "0.74334514", "0.743306", "0.7390331", "0.7351321", "0.72917575", "0.72768205", "0.72474235", "0.72394204", "0.72010374", "0.72010374", "0.72010374", "0.7178097", "0.71779...
0.7862598
4
Get the list of available preset modes.
def preset_modes(self) -> list: return self._preset_modes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preset_modes(self):\n return self._preset_modes", "def preset_modes(self) -> List[str]:\n return self._support_presets", "def preset_modes(self):\n return list(PRESET_MODE_TO_DPS_MODE.keys())", "def preset_modes(self) -> list[str]:\n # Use the Vallox profile names for the pres...
[ "0.85059565", "0.85046875", "0.8159078", "0.8132896", "0.780501", "0.76593965", "0.7572532", "0.75182325", "0.7515777", "0.7489958", "0.7480582", "0.74632555", "0.73047006", "0.72556746", "0.7186609", "0.71617156", "0.70367336", "0.6996852", "0.69910216", "0.69773203", "0.690...
0.8712399
0
Set the fan speed
async def async_set_preset_mode(self, preset_mode: str) -> None: if preset_mode not in self.preset_modes: LOG.warning( f"LUNOS preset '{preset_mode}' is not valid: {self.preset_modes}" ) return if preset_mode in self._fan_speeds: await sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_fan_speed(self, value):\n self.parent.fancoolers.set_speed(value)", "def setspeed(speed):\n if speed is None:\n click.echo(\"speed value is required\")\n raise click.Abort()\n\n for fan in range(_wrapper_get_num_fans()):\n status = _wrapper_set_fan_speed(fan, speed)\n ...
[ "0.88144314", "0.8245427", "0.8217601", "0.8073663", "0.7883645", "0.78086805", "0.780113", "0.7767136", "0.769425", "0.7659422", "0.7634827", "0.7617419", "0.75891185", "0.75322205", "0.7497115", "0.74938846", "0.74902636", "0.7488847", "0.7480079", "0.7456682", "0.73192173"...
0.0
-1
Reset ventilation to LUNOS normal operation
async def async_set_ventilation_mode(self, vent_mode: str) -> None: # if summer vent was known to previously be on, turn it off if self._vent_mode == PRESET_SUMMER_VENT: await self.async_turn_off_summer_ventilation() if vent_mode == VENT_SUMMER: await self.async_turn_on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_punteggio(self):\n self.execute(TABELLE['punteggio']['reset'])", "def full_reset(self):\n self.at_cmd('CFUN=1')", "def reset():\n Vessel.reset_instances()", "def reset(self):\n self.vrp = np.matrix([0.5, 0.5, 1])\n self.vpn = np.matrix([0, 0, -1])\n ...
[ "0.64833677", "0.6321551", "0.63066435", "0.6282813", "0.6218257", "0.6208391", "0.6199387", "0.6166136", "0.6160281", "0.60709727", "0.6064801", "0.60466987", "0.599481", "0.599481", "0.599481", "0.59759265", "0.5971499", "0.5966772", "0.5958531", "0.5951688", "0.5934709", ...
0.0
-1
Probe W1/W2 relays for current states and then match to a speed
def _determine_current_relay_speed(self): w1 = self.hass.states.get(self._relay_w1) if not w1: LOG.warning( f"W1 entity {self._relay_w1} not found, cannot determine {self._name} LUNOS speed." ) return None w2 = self.hass.states.get(self._relay...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def speed_detect(motion_first, motion_second, distance):\n if (GPIO.input(motion_first) == 1):\n # Determines if first motion sensor is triggered first.\n speed(timing(motion_second), distance)\n # Sends speed as message to server when corresponding sensor triggered.\n ensure_low(mot...
[ "0.6513912", "0.5851191", "0.5842303", "0.5761352", "0.57429296", "0.5655584", "0.5653277", "0.5639711", "0.56101817", "0.5596971", "0.55832094", "0.5499165", "0.5468255", "0.54663295", "0.5430599", "0.5424834", "0.5406324", "0.54036164", "0.5398869", "0.53947705", "0.5389341...
0.6577904
0
Update the current speed (+ refresh any dependent attributes)
def _update_speed(self, speed): if speed is None: return if speed == self._current_speed: return self._current_speed = speed self._update_speed_attributes() LOG.info( f"Updated LUNOS {self._name}: {self.percentage}% {self._current_speed}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_speed_attributes(self):\n self._attributes[ATTR_SPEED] = self._current_speed\n if self._current_speed is None:\n return\n\n coding = self._attributes[CONF_CONTROLLER_CODING]\n controller_config = LUNOS_CODING_CONFIG[coding]\n if not controller_config:\n ...
[ "0.76170844", "0.7530956", "0.7251622", "0.7234627", "0.71615994", "0.70546925", "0.7049263", "0.70340717", "0.6993405", "0.69703823", "0.6955602", "0.693422", "0.6907308", "0.69017524", "0.6848571", "0.6830297", "0.6827584", "0.6826347", "0.68106616", "0.67763335", "0.676170...
0.7635065
0
Set the fan speed
async def async_set_speed(self, speed: str) -> None: switch_states = self._relay_state_map.get(speed) if not switch_states: LOG.warning( f"LUNOS '{self._name}' DOES NOT support speed '{speed}'; ignoring speed change." ) return # save the pendi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_fan_speed(self, value):\n self.parent.fancoolers.set_speed(value)", "def setspeed(speed):\n if speed is None:\n click.echo(\"speed value is required\")\n raise click.Abort()\n\n for fan in range(_wrapper_get_num_fans()):\n status = _wrapper_set_fan_speed(fan, speed)\n ...
[ "0.88144314", "0.8245427", "0.8217601", "0.8073663", "0.7883645", "0.78086805", "0.780113", "0.7767136", "0.769425", "0.7659422", "0.7634827", "0.7617419", "0.75891185", "0.75322205", "0.7497115", "0.74938846", "0.74902636", "0.7488847", "0.7480079", "0.7456682", "0.73192173"...
0.0
-1
Determine current state of the fan by inspecting relay states.
async def async_update(self): LOG.debug(f"{self._name} async_update() called") # delay reading allow any pending switch changes to be applied await asyncio.sleep(1.0) actual_speed = self._determine_current_relay_speed() LOG.debug(f"{self._name} async_update() = {actual_speed}")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fan_state(self):\n return self.__sensor_states[1]", "def current_fan_mode(self):\n if self._device.fan == self._device.FAN_AUTO:\n return STATE_AUTO\n elif self._device.fan == self._device.FAN_ON:\n return STATE_ON\n return STATE_UNKNOWN", "def is_on(se...
[ "0.7395595", "0.6739828", "0.66893977", "0.65969056", "0.6508881", "0.63887954", "0.6340194", "0.6340194", "0.6332151", "0.61439145", "0.60945857", "0.60448885", "0.6026992", "0.59968615", "0.59950024", "0.5992172", "0.5983513", "0.5983513", "0.594321", "0.5901327", "0.590014...
0.0
-1
Function to determine the upload path dynamically at runtime.
def get_upload_path(instance, filename): return os.path.join(getattr(settings, "FILEBROWSER_DIRECTORY"), str(instance.project.short_name.lower()), filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_upload_path(self):\n location = self.get_storage().location\n return self.cleaned_data['key_name'][len(location):]", "def get_upload_path(instance, filename):\n from os import path\n from django.conf import settings\n from django.template.defaultfilters import slugify\n \n if...
[ "0.71676576", "0.71320295", "0.6944558", "0.67605346", "0.67438084", "0.671779", "0.67083836", "0.66566396", "0.6645561", "0.66301817", "0.6609568", "0.6606849", "0.65414953", "0.64136505", "0.6357498", "0.6327135", "0.6317124", "0.6282201", "0.62768865", "0.6217946", "0.6200...
0.70405626
2
Is the logical type of the column equal to the other column.
def is_type_equivalent(self, other): mine = self._replace_defaults() theirs = other._replace_defaults() def remove_base(dct): # removes base attributes in the phyiscal layer. basekeys = Column._replace_defaults(self).keys() for k in basekeys: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return super(Column, self).__eq__(tuple(other))", "def conformability(self, other):\r\n if self.columns == other.rows:\r\n return True\r\n else:\r\n return False", "def _is_equal_same_type(self, other):\n return True", "def __eq__(s...
[ "0.70812297", "0.6932587", "0.6804235", "0.6796748", "0.67400944", "0.66611063", "0.6654303", "0.66352093", "0.65839386", "0.65638554", "0.6563409", "0.6555065", "0.6536806", "0.6502776", "0.64863825", "0.64399666", "0.64218426", "0.6402173", "0.63337994", "0.63291293", "0.63...
0.66202605
8
Allocate a new column like the given column
def column_empty_like(column, dtype, masked): data = cuda.device_array(shape=len(column), dtype=dtype) params = dict(data=Buffer(data)) if masked: mask = utils.make_mask(data.size) params.update(dict(mask=Buffer(mask), null_count=data.size)) return Column(**params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_column(self, new_column, dtype):\n self.logger.debug(\"[%u] Ready to add column %s\" %\n (os.getpid(), new_column))\n ddl = \"\"\"\n ALTER TABLE {schema}.{table}\n ADD COLUMN IF NOT EXISTS {col} {type}\n \"\"\"\n # TODO Replace b...
[ "0.6827339", "0.6720581", "0.6563295", "0.64829767", "0.64047736", "0.63903886", "0.6377255", "0.6369746", "0.6314652", "0.62279457", "0.62077713", "0.6203525", "0.6128301", "0.6112873", "0.61074305", "0.61010355", "0.60677403", "0.6065311", "0.6020187", "0.6003351", "0.59993...
0.0
-1
Create a new empty Column with the same length and the same mask.
def column_empty_like_same_mask(column, dtype): data = cuda.device_array(shape=len(column), dtype=dtype) params = dict(data=Buffer(data)) if column.has_null_mask: params.update(mask=column.nullmask) return Column(**params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_empty_like(column, dtype, masked):\n data = cuda.device_array(shape=len(column), dtype=dtype)\n params = dict(data=Buffer(data))\n if masked:\n mask = utils.make_mask(data.size)\n params.update(dict(mask=Buffer(mask), null_count=data.size))\n return Column(**params)", "def _m...
[ "0.7123332", "0.60310805", "0.6025068", "0.5759655", "0.5578718", "0.5557745", "0.5551191", "0.5484889", "0.547497", "0.5465928", "0.5449626", "0.53719026", "0.5368725", "0.5352053", "0.52982235", "0.5274085", "0.52357614", "0.5221875", "0.5208956", "0.51223946", "0.5119306",...
0.6882463
1
Select by a boolean mask to a column. Returns (selected_column, selected_positions)
def column_select_by_boolmask(column, boolmask): from .numerical import NumericalColumn assert not column.has_null_mask boolbits = cudautils.compact_mask_bytes(boolmask.to_gpu_array()) indices = cudautils.arange(len(boolmask)) _, selinds = cudautils.copy_to_dense(indices, mask=boolbits) _, selva...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _select(self,X,y=None):\n return X.loc[:,self.columns], y", "def select_mask(cls, dataset, selection):\n mask = np.ones(len(dataset), dtype=np.bool_)\n for dim, sel in selection.items():\n if isinstance(sel, tuple):\n sel = slice(*sel)\n arr = cls.val...
[ "0.6214352", "0.61018", "0.59364384", "0.56666255", "0.55793685", "0.5498983", "0.54978466", "0.5472354", "0.5470962", "0.54663765", "0.54368514", "0.5411798", "0.53567463", "0.53495824", "0.5324205", "0.5319597", "0.53014255", "0.5246769", "0.51611763", "0.5132307", "0.51158...
0.8456476
0
Create a Column from an arbitrary object
def as_column(arbitrary): from . import numerical, categorical if isinstance(arbitrary, Column): if not isinstance(arbitrary, TypedColumnBase): # interpret as numeric return arbitrary.view(numerical.NumericalColumn, dtype=arbitrary.dtype) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_column(options, name, column):\n # (ElasticsearchFDWOptions, str, multicorn.ColumnDefinition) -> Column\n assert name not in {\n options.rowid_column,\n options.score_column,\n options.query_column,\n }, \"Programmer error: bad name passed to make_column {name}\".format(name=...
[ "0.649813", "0.63020957", "0.6183909", "0.6177261", "0.616855", "0.6118176", "0.60003996", "0.59737426", "0.5890849", "0.58798385", "0.58009464", "0.5756097", "0.5717887", "0.5705321", "0.570067", "0.56722784", "0.5639067", "0.55907947", "0.5586503", "0.557187", "0.55572414",...
0.6075769
6
Apply a elemenwise function to transform the values in the Column.
def column_applymap(udf, column, out_dtype): core = njit(udf) results = cuda.device_array(shape=len(column), dtype=out_dtype) values = column.data.to_gpu_array() if column.mask: # For masked columns @cuda.jit def kernel_masked(values, masks, results): i = cuda.grid(1)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform(self, col_df: dd.Series) -> dd.Series:\n\n result = col_df.map(self.compute_val)\n return result", "def apply(self, fn, column_label):\n return [fn(v) for v in self[column_label]]", "def _convert_column(self, col, function):\n col_new = []\n for x in self[col]:\...
[ "0.6831966", "0.63735145", "0.6169184", "0.60199684", "0.60121214", "0.58993953", "0.58202386", "0.58112884", "0.58078164", "0.57875055", "0.57627106", "0.56869614", "0.5663434", "0.55942386", "0.5591315", "0.55322516", "0.5525826", "0.55013925", "0.55013925", "0.5463288", "0...
0.58085525
8
Tokenizes a text file.
def tokenize(self, path): assert os.path.exists(path) # Add words to the dictionary with open(path, 'r', encoding="utf8") as f: tokens = 0 for line in f: words = line.split() + ['<eos>'] tokens += len(words) for word in word...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize_file(filename):\n filename, text = read_file(filename)\n token_text = word_tokenize(text)\n return filename, token_text", "def tokenize_text_file(path, sanitize=True, remove_duplicates=False, stopwords=None):\n with open(path, 'r') as f:\n text_string = f.read()\n tokens = ...
[ "0.7720039", "0.7554531", "0.7166004", "0.7100323", "0.69714755", "0.6951602", "0.6949265", "0.6920043", "0.6891936", "0.6826545", "0.6826545", "0.6814913", "0.68058044", "0.6729129", "0.6702407", "0.6685226", "0.6624703", "0.6610691", "0.65961534", "0.6592447", "0.65916055",...
0.68438613
9
StoreProfile a model defined in Swagger
def __init__(self, id=None, meta=None, name=None, description=None, contact_info=None, billing_info=None, facebook=None, twitter=None, youtube=None, instagram=None, pinterest=None, linkedin=None): self._id = id self._meta = None self._name = None self._description = None self._c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_profile(self):\n self.save()", "def perform_create(self, serializer): # this method runs everytime a POST method is called\n serializer.save(user_profile=self.request.user)", "def save_user_profile(instance, **_):\n instance.profile.save()", "def save_profile():\n state = request...
[ "0.61888355", "0.60197604", "0.5968089", "0.5935591", "0.5932385", "0.5916962", "0.58568895", "0.5853983", "0.5853983", "0.5846799", "0.5846799", "0.5846799", "0.5846799", "0.5846799", "0.5846799", "0.581939", "0.57648695", "0.57594365", "0.57438797", "0.5729028", "0.55766666...
0.0
-1
Gets the meta of this StoreProfile.
def meta(self): return self._meta
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meta(self) -> Meta:\n return Meta(\n object_type=\"profile\",\n extra_custom_props=[\n (\"property\", \"profile.username\", self.user.username),\n (\"property\", \"profile.first_name\", self.user.first_name),\n (\"property\", \"profi...
[ "0.75090975", "0.6818852", "0.6687395", "0.6506509", "0.6486768", "0.6472494", "0.63900566", "0.6342975", "0.63346213", "0.6325228", "0.6315868", "0.6256557", "0.62344116", "0.61842823", "0.6178086", "0.6144196", "0.6142889", "0.6142889", "0.6099836", "0.60929203", "0.6089251...
0.7010534
2
Sets the meta of this StoreProfile.
def meta(self, meta): self._meta = meta
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_meta(self, meta):\n self._meta['user_meta'] = meta\n return self", "def set_meta(self, meta):\n self._meta['user_meta'] = meta", "def meta(self, meta):\n if not isinstance(meta, GiftiMetaData):\n raise TypeError(\"Not a valid GiftiMetaData instance\")\n sel...
[ "0.7819315", "0.7818888", "0.67449343", "0.66985893", "0.65722406", "0.65123516", "0.6260251", "0.62471706", "0.6044548", "0.6044548", "0.59576315", "0.58976823", "0.5802497", "0.5802497", "0.5802497", "0.5802497", "0.5802497", "0.5802497", "0.5802497", "0.5786732", "0.574352...
0.7229527
3
Gets the name of this StoreProfile.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self) -> str:\n return self.profile_device.name", "def name(self):\n return self.properties.get('name', None)", "def name(self):\n return self.measurement_profile.name", "def name(self):\n return self.properties.get('name')", "def name(self):\n return self.proper...
[ "0.76981187", "0.733422", "0.7321972", "0.7318531", "0.7318531", "0.72827613", "0.7189084", "0.7160284", "0.71291465", "0.71291465", "0.7111798", "0.7087537", "0.7087537", "0.70873374", "0.70873374", "0.70873374", "0.70739406", "0.7037252", "0.7032549", "0.7026763", "0.702676...
0.0
-1
Sets the name of this StoreProfile.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def profile_name(self, profile_name):\n\n self._profile_name = profile_name", "def profile_name(self, profile_name):\n\n self._profile_name = profile_name", "def set_name(self, name):\n self._name = name", "def set_name(self, name: str):\n self._name = name", "def set_name(self,...
[ "0.76024014", "0.76024014", "0.73460335", "0.7331119", "0.73240584", "0.73240584", "0.73240584", "0.73240584", "0.73240584", "0.73008317", "0.719803", "0.7145583", "0.71070445", "0.71070445", "0.7063145", "0.706168", "0.70541626", "0.70541626", "0.70182437", "0.69738054", "0....
0.0
-1
Gets the description of this StoreProfile.
def description(self): return self._description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):\n return self.__description", "def getDescription(self):\n return self.description", "def getDescription(self):\n return self._description", "def get_description(self):\n return self._description", "def get_description(self):\n\n return self._de...
[ "0.6791806", "0.67796797", "0.67580754", "0.6744666", "0.6726742", "0.67260855", "0.67260855", "0.67260855", "0.67260855", "0.6714615", "0.6714615", "0.6714615", "0.6714615", "0.6714615", "0.6714615", "0.6714615", "0.6714615", "0.6714615", "0.6714615", "0.6714615", "0.6714615...
0.6608305
75
Sets the description of this StoreProfile.
def description(self, description): self._description = description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_description(self, description):\n self.description = description", "def set_description(self, description):\n self._description = description", "def set_description(self, description):\n self.__description = description", "def set_description(self, description):\r\n self._...
[ "0.7216981", "0.7169391", "0.7163605", "0.7136314", "0.7072769", "0.6972964", "0.6972557", "0.68284494", "0.68284494", "0.68284494", "0.68284494", "0.6813767", "0.6771052", "0.6771052", "0.6771052", "0.6771052", "0.66920125", "0.656157", "0.6513287", "0.6509549", "0.6437283",...
0.68255776
42
Gets the contact_info of this StoreProfile.
def contact_info(self): return self._contact_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_details(self):\n return self.data.get(\"contactDetails\")", "def contact_information(self) -> ContactInformation:\n return self._contact_information", "def contact_details(self) -> 'outputs.ContactDetailsResponse':\n return pulumi.get(self, \"contact_details\")", "def contact...
[ "0.7382779", "0.7178758", "0.7069896", "0.7069896", "0.7069896", "0.6821688", "0.6670985", "0.6670985", "0.66625243", "0.6414609", "0.6294944", "0.60695684", "0.6056503", "0.6021642", "0.59559315", "0.5888848", "0.5851236", "0.5751502", "0.57204616", "0.57056797", "0.56871384...
0.78388166
0
Sets the contact_info of this StoreProfile.
def contact_info(self, contact_info): self._contact_info = contact_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact(self, contact):\n\n self.logger.debug(\"In 'contact' setter.\")\n\n self._contact = contact", "def contact(self, contact):\n\n self._contact = contact", "def contact(self, contact):\n\n self._contact = contact", "def contact_information(self, contact_information: Conta...
[ "0.69299614", "0.67071474", "0.67071474", "0.65718716", "0.6284828", "0.61824167", "0.61538726", "0.61538726", "0.5976365", "0.5943649", "0.5943649", "0.58734804", "0.58734804", "0.58521116", "0.57365626", "0.57365626", "0.5732711", "0.57138306", "0.56584156", "0.5627489", "0...
0.7964371
0
Gets the billing_info of this StoreProfile.
def billing_info(self): return self._billing_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def billing_info(self):\r\n return BillingInfo(self)", "def billing(self):\n return self._billing", "def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account\")", "def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"bill...
[ "0.77087563", "0.71477145", "0.6761446", "0.6761446", "0.6761446", "0.6540891", "0.6534776", "0.64655393", "0.63661957", "0.63661957", "0.61825705", "0.61825705", "0.61659193", "0.61363465", "0.6119282", "0.61044437", "0.6019976", "0.5942303", "0.5787421", "0.55749315", "0.55...
0.8297777
0
Sets the billing_info of this StoreProfile.
def billing_info(self, billing_info): self._billing_info = billing_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def billing(self, billing):\n\n self._billing = billing", "def billing_contact(self, billing_contact):\n\n self._billing_contact = billing_contact", "def billing_currency(self, billing_currency):\n\n self._billing_currency = billing_currency", "def billing_info(self):\n return sel...
[ "0.6947018", "0.6334089", "0.59712374", "0.5709125", "0.56954914", "0.5641454", "0.52830344", "0.5201318", "0.5174602", "0.51457936", "0.5099419", "0.5058219", "0.5058219", "0.50350636", "0.50086355", "0.49812788", "0.49464315", "0.49219757", "0.49004814", "0.4897163", "0.485...
0.8221735
0
Gets the facebook of this StoreProfile.
def facebook(self): return self._facebook
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fb_profile(self):\n return FBProfile.objects.get(fb_id=self.fb_id)", "def facebook(self):\n try:\n from facebook import Facebook\n except ImportError:\n log.warning(\"PyFacebook is not installed!\")\n else:\n if self.user and self.user.profile.uses...
[ "0.72637475", "0.68482184", "0.5892476", "0.56854427", "0.55518615", "0.5514546", "0.5474069", "0.53818136", "0.52848524", "0.5200367", "0.51482517", "0.5139177", "0.49755865", "0.49698114", "0.49656677", "0.49522483", "0.49521646", "0.49469793", "0.49355954", "0.49290457", "...
0.7497802
0
Sets the facebook of this StoreProfile.
def facebook(self, facebook): self._facebook = facebook
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_url(self, facebook_url):\n\n self._facebook_url = facebook_url", "def facebook(self):\n try:\n from facebook import Facebook\n except ImportError:\n log.warning(\"PyFacebook is not installed!\")\n else:\n if self.user and self.user.profile...
[ "0.6374106", "0.5990116", "0.5905431", "0.54284465", "0.5185664", "0.5098087", "0.50038993", "0.4828573", "0.4786767", "0.4675968", "0.46523046", "0.46096033", "0.4588999", "0.45869476", "0.4569041", "0.4569041", "0.4555865", "0.4552569", "0.45499423", "0.4545021", "0.4514413...
0.7717775
0
Gets the twitter of this StoreProfile.
def twitter(self): return self._twitter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_twitter():\n \n return TwitterAPI(consumer_key, consumer_secret, access_token, access_token_secret)", "def twitter_handle(self):\n return self.twitter.strip().strip('/').split('/')[-1]", "def get_twitter():\n return TwitterAPI(consumer_key, consumer_secret, access_token, access_token_se...
[ "0.6313362", "0.63018733", "0.6151999", "0.6151999", "0.6151999", "0.6151999", "0.59864783", "0.5978816", "0.5908569", "0.58812046", "0.5767627", "0.57602674", "0.56825304", "0.5620173", "0.5508046", "0.54835796", "0.54588556", "0.5448028", "0.5362051", "0.53491855", "0.53206...
0.81262565
0
Sets the twitter of this StoreProfile.
def twitter(self, twitter): self._twitter = twitter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twitter(self):\n return self._twitter", "def set_twitter_auth():\n auth = ty.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)\n auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)\n api = ty.API(auth)\n return api", "def save_tweet(self, twitter) -> None:\n if isinstance(twitter, dict):...
[ "0.67886657", "0.5879685", "0.58475894", "0.5459259", "0.5391684", "0.53389937", "0.531319", "0.5291508", "0.5286032", "0.52285236", "0.5221684", "0.52161473", "0.5190828", "0.5125012", "0.508939", "0.50773615", "0.5071382", "0.5068609", "0.5046601", "0.5046601", "0.5046601",...
0.8175747
0
Gets the youtube of this StoreProfile.
def youtube(self): return self._youtube
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def youtube(self, youtube):\n\n self._youtube = youtube", "def get_youtube_api_key(self):\n key = self.bot_data_file[\"youtube\"][\"key\"]\n if self.check_empty_key(key):\n return key\n else:\n print(\n \"ERROR GETTING THE YOUTUBE KEY (check bot do...
[ "0.6090054", "0.5948142", "0.5814511", "0.57243747", "0.5691043", "0.5570341", "0.5460085", "0.54214174", "0.5418943", "0.5391258", "0.5333565", "0.5277207", "0.5272169", "0.5246922", "0.5221705", "0.5219989", "0.52189547", "0.5195068", "0.51844424", "0.51579475", "0.5124477"...
0.79352546
0
Sets the youtube of this StoreProfile.
def youtube(self, youtube): self._youtube = youtube
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def youtube(self):\n return self._youtube", "def isYouTube(self):\n if 'youtube' in self.link.split('.'):\n return True\n return None", "def play_youtube(self, media_id):\n pass", "def set_y(self, y):\n self._y = y", "def SetY(self, y):\r\n\r\n self._y =...
[ "0.6800553", "0.54981285", "0.52603334", "0.52439976", "0.5157042", "0.5153385", "0.5152133", "0.5151252", "0.5134109", "0.5134109", "0.50935537", "0.504834", "0.5020317", "0.4995652", "0.49926963", "0.49606714", "0.4948556", "0.49337053", "0.49234337", "0.49103868", "0.48708...
0.8214083
0
Gets the instagram of this StoreProfile.
def instagram(self): return self._instagram
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def self(self):\n\n url = \"https://api.instagram.com/v1/users/self/?access_token=\" + self.access_token\n request = requests.get(url)\n return request.json()", "def get_gallery_profile(self):\n url = (\"https://api.imgur.com/3/account/{0}/\"\n \"gallery_profile\".format...
[ "0.6358503", "0.5790814", "0.57500106", "0.5704466", "0.54454136", "0.54388595", "0.5421649", "0.5314913", "0.5236288", "0.52185434", "0.51092464", "0.5101984", "0.5048644", "0.5047885", "0.50447875", "0.50331956", "0.49664336", "0.49385908", "0.49379966", "0.4937163", "0.493...
0.80316
0
Sets the instagram of this StoreProfile.
def instagram(self, instagram): self._instagram = instagram
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instagram(self):\n return self._instagram", "def change_profile_img(self):\n get_photo = reddit_scrapper()\n get_photo.get_image()\n # Send image to instagram profile picture on the hidden input tag\n profile_pic_button = self.driver.find_elements_by_xpath(\n '//...
[ "0.6435948", "0.53311217", "0.51667714", "0.51479274", "0.5049256", "0.49257427", "0.48655903", "0.48561212", "0.48192295", "0.47847643", "0.47819746", "0.4762666", "0.47518057", "0.47216386", "0.47202426", "0.46568915", "0.4634103", "0.46039426", "0.4603206", "0.45948482", "...
0.8030566
0
Gets the pinterest of this StoreProfile.
def pinterest(self): return self._pinterest
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interests(self):\n if \"interests\" in self._prop_dict:\n return self._prop_dict[\"interests\"]\n else:\n return None", "def get_percent_interest(self):\n return self.__percentage_interest", "def get_profile(self):\n endpoint = '/profile'\n return se...
[ "0.65898913", "0.62914765", "0.58359545", "0.5743681", "0.5684692", "0.562656", "0.5506814", "0.5492201", "0.5492201", "0.53988117", "0.5398023", "0.53309345", "0.5324174", "0.5252778", "0.52367723", "0.52086645", "0.5199404", "0.51921695", "0.5150444", "0.5120884", "0.511402...
0.7561153
0