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
Return a scalar type which is common to the input arrays. The return type will always be an inexact (i.e. floating point) scalar type, even if all the arrays are integer arrays. If one of the inputs is an integer array, the minimum precision type that is returned is a 64bit floating point dtype. All input arrays except...
def common_type(*arrays): arrays = [numpoly.aspolynomial(array) for array in arrays] arrays = [array[array.keys[0]] for array in arrays] return numpy.common_type(*arrays)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def common_type(*arrays):\n dtypes = {array.dtype.name for array in arrays}\n has_complex = not _COMPLEX_DTYPES.isdisjoint(dtypes)\n has_double = not _DOUBLE_DTYPES.isdisjoint(dtypes)\n return _DTYPE_MAP[has_complex, has_double]", "def scalar(name=None, dtype=None):\r\n if dtype is None:\r\n ...
[ "0.68365544", "0.63595915", "0.6185176", "0.59608775", "0.5895391", "0.58816814", "0.5827463", "0.5799943", "0.5797248", "0.5737268", "0.5683238", "0.5681322", "0.5662812", "0.56623214", "0.5653717", "0.56307465", "0.55718017", "0.5552709", "0.5547326", "0.5509954", "0.550467...
0.62060404
2
Initialize the bzip2 package.
def __init__(self, system): super(Bzip2106, self).__init__("bzip2-1.0.6", system, "bzip2-1.0.6.tar.gz")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs):\n\t\tself.verbose = kwargs.pop('verbose', self.verbose)\n\t\t#super(ZipArchive, self).__init__(*args, **kwargs)\n\t\tzipfile.ZipFile.__init__(self, *args, **kwargs)", "def __init__(self):\n _snap.TStrHashF_DJB_swiginit(self, _snap.new_TStrHashF_DJB())", "def hasBzip2...
[ "0.61423457", "0.5892953", "0.5870998", "0.58182406", "0.5793603", "0.5732819", "0.5602661", "0.5576144", "0.55652636", "0.55539757", "0.5521145", "0.5483834", "0.5482151", "0.54801524", "0.5467347", "0.54053587", "0.54005855", "0.53714246", "0.53280556", "0.5319646", "0.5318...
0.7995384
0
returns self's full name
def getName(self): return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_full_name(self):\n return self.name #self is base and it hits name filed", "def get_full_name(self):\n return self.name", "def get_full_name(self):\n return self.name", "def get_full_name(self):\n return self.name", "def get_full_name(self):\n return self.name", ...
[ "0.90718335", "0.88658005", "0.88658005", "0.88658005", "0.88658005", "0.88658005", "0.8824497", "0.87989116", "0.8789187", "0.87752736", "0.87752736", "0.86491096", "0.8622617", "0.8599389", "0.8584429", "0.8488957", "0.84057194", "0.84046555", "0.83086085", "0.8293897", "0....
0.0
-1
sets birthday to datetime.date format?
def setBirthday(self, birthdate): self.birthday = birthdate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setBirthday(self,month,day,year):\n self.birthday = datetime.date(year,month,day)", "def setBirthday(self,month,day,year):\n self.birthday = datetime.date(year,month,day)", "def setBirthday(self, month, day, year):\n self.birthday = datetime.date(year, month, day)", "def set_birthday...
[ "0.8183557", "0.8183557", "0.8017441", "0.80071366", "0.79808784", "0.7911469", "0.78016704", "0.7736576", "0.77311146", "0.7486346", "0.71630347", "0.6962517", "0.69354504", "0.6931364", "0.6888113", "0.6837638", "0.677436", "0.6762404", "0.675598", "0.6698934", "0.6669101",...
0.7907243
6
returns true if self's name is lexicographically less than other's name, false otherwise
def __lt__(self, other): if self.lastName == other.lastName: return self.name < other.name return self.lastName < other.lastName
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __lt__(self, other) -> bool:\n return type(self) == type(other) and \\\n self.name < other.name", "def __lt__(self, other):\n return self.name.lower() < other.name.lower()", "def __lt__(self, other):\n return self.name.lower() < other.name.lower()", "def __lt__(self, ot...
[ "0.83991265", "0.8365852", "0.8365852", "0.8289976", "0.81914055", "0.8110103", "0.7988708", "0.7988708", "0.7988708", "0.7988708", "0.7988708", "0.79862463", "0.79520786", "0.78966457", "0.78007", "0.7710017", "0.7662206", "0.75784177", "0.754334", "0.7513246", "0.7303679", ...
0.7950968
13
Helper function to check for blacklisted tokens
def check_blacklisted_token(token): token = models.TokenBlackList.query.filter_by(token=token).first() if token: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_if_token_in_blacklist(decrypted_token):\n return (\n decrypted_token[\"jti\"] in BLACKLIST\n ) # if True, go to revoked_token_callback", "def check_if_token_in_blacklist(decrypted_token):\n jti = decrypted_token['jti']\n return model.revoked_token.RevokedToken.is_blackli...
[ "0.76352197", "0.76228154", "0.7478889", "0.7431049", "0.7411897", "0.7238838", "0.7137883", "0.69916326", "0.69205165", "0.68788165", "0.66148496", "0.65662944", "0.64836353", "0.6441574", "0.635617", "0.6342027", "0.63384205", "0.62987286", "0.6216427", "0.6215166", "0.6212...
0.7947959
0
Determine the anticipated host switch name for the logical switch respresented by and store it in caller's . If an existing name is present, use it.
def _preprocess_resolve_switch_name(obj, kwargs): # Determine the expected host_switch_name from the associated # TransportZone. This must be done via API regardless of requested # execution_type. if kwargs.get('host_switch_name') is None: # XXX(jschmidt): read() should be able to default to pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_switch(self,host):\n switch_list = self.__graph_dict[host]\n switch_num = switch_list[0]\n return switch_num", "def get_initiator_host_name(self, connector):\n name = connector.get('initiator',\n connector.get('wwnns', [''])[0])[::-1]\n if se...
[ "0.59917486", "0.5900308", "0.58105445", "0.5809452", "0.57702166", "0.57147825", "0.562613", "0.558732", "0.55398726", "0.55224764", "0.5492891", "0.5492891", "0.5477548", "0.5439147", "0.53883976", "0.5365079", "0.5351319", "0.534847", "0.53416914", "0.5320049", "0.53086567...
0.7307711
0
Fit LDA from a scipy CSR matrix (X).
def fit_lda(X, vocab): print('fitting lda...') return LdaModel(matutils.Sparse2Corpus(X, documents_columns=False), num_topics=100, passes=1, iterations=500, chunksize=1000, update_every=1, id2word=dict([(i, s) for i, s in enumerate(vocab)]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, X):\n\n X_sparse = X.copy().astype(np.float64)\n self.X_sparse = X_sparse\n self._fit()\n return self", "def fit(self, X, y=None):\n #X = check_array(X, accept_sparse='csr')\n return self", "def fit(self, X: sp.csr_matrix, n_samples: int):\n X = ch...
[ "0.64050597", "0.6399704", "0.6362117", "0.62613547", "0.6251182", "0.6121596", "0.610392", "0.6086461", "0.59369344", "0.5904508", "0.5868396", "0.5860403", "0.585907", "0.58524126", "0.5779344", "0.5778336", "0.575929", "0.57262206", "0.5716203", "0.5701557", "0.569485", ...
0.75815755
0
Print the top words for each topic.
def print_topics(lda): topics = lda.show_topics(num_topics=100, num_words=10, formatted=False) for ti, topic in enumerate(topics): print('topic %d: %s' % (ti, ' '.join('%s/%.2f' % (t[1], t[0]) for t in topic)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_top_words(components, feature_names, n_top_words: int = 10):\n for topic_idx, topic in enumerate(components):\n message = \"Topic #%d: \" % topic_idx\n message += \" \".join(\n [feature_names[i] for i in topic.argsort()[: -n_top_words - 1 : -1]]\n )\n print(messa...
[ "0.80106956", "0.7843566", "0.7800577", "0.7643584", "0.76045525", "0.7579483", "0.7540006", "0.73396826", "0.73279583", "0.7300888", "0.703744", "0.70279413", "0.6986095", "0.69638085", "0.69356525", "0.6929748", "0.69172573", "0.691049", "0.6908292", "0.6858126", "0.6834454...
0.692924
16
Transform user's document vector into list of tuples
def user_doc_bow(user): user_doc = [] user_array = np.zeros(100) nonzero_idx = [item for item in user.nonzero()[1]] for i in nonzero_idx: user_doc.append((i, user[0, i])) topics = lda[user_doc] topic_dict = {topic[0]: topic[1] for topic in topics} np.put(user_array, topic_dict.keys()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ex_list(data):\n return tuple(data)", "def read_tuples_list(corpus_path):\n idx = 0\n data = []\n with open(corpus_path, encoding='utf-8') as fr:\n lines = fr.readlines()\n sent_, label_h_, pos_, ner_ = [], [], [], []\n\n for line in lines:\n idx += 1\n if line.find(\"D...
[ "0.5863828", "0.5648858", "0.56228894", "0.55880904", "0.55583906", "0.55135846", "0.5450894", "0.54424894", "0.54149765", "0.53839064", "0.5359936", "0.5349167", "0.53247696", "0.52956575", "0.5271087", "0.52633893", "0.52600634", "0.5258497", "0.5246498", "0.52325004", "0.5...
0.51671076
25
Used at initialization to update all scan groups with their database values
def load_all_groups(self): for _, group in self.scopes.items(): group.update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update(self):\n # clear group before rebuild\n self.clear()\n\n # build configuration groups\n self._config_names = []\n for i in range(self._n_configs):\n config_name = f\"config{i+1:02}\"\n self._config_names.append(config_name)\n self._bui...
[ "0.62571394", "0.6019692", "0.5947787", "0.59254926", "0.5868216", "0.5769238", "0.55904764", "0.5585611", "0.5578358", "0.5528191", "0.54845923", "0.54744333", "0.54352814", "0.5428182", "0.54216605", "0.54042125", "0.5394926", "0.538905", "0.5349979", "0.5349979", "0.534997...
0.61861694
1
Set command line arguments
def _add_argument(self, args=''): sys.argv += args.split(' ')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_args():\n # Initialise argparse object\n parser = argparse.ArgumentParser(description='Set some arguments for our script')\n # Add some arguments, elements are: short form name, long form name, type of input expected\n # default value if you don't set an argument, help string (shown if you run ...
[ "0.72329915", "0.67563385", "0.6751851", "0.6713876", "0.669729", "0.6577188", "0.65664786", "0.65365773", "0.6524342", "0.6502149", "0.6502149", "0.6502149", "0.6502149", "0.6502149", "0.6488107", "0.6472675", "0.64655954", "0.64572567", "0.6438185", "0.64359045", "0.6433804...
0.6419336
23
Detect Dunia 2 engine (Far Cry >= 3)
def _is_dunia2(self): dir_list = os.listdir(os.environ['PWD']) data_list = list(filter(lambda item: 'data_win' in item, dir_list)) # Check .../data_win*/worlds/multicommon dir for data_dir in data_list: if os.path.exists(os.path.join(os.environ['PWD'], data_dir, 'worlds/mul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detect():\n pass", "def test_denoiser_supported_version(self):\r\n\r\n pass_test = True\r\n try:\r\n check_flowgram_ali_exe()\r\n except (ApplicationNotFoundError, ApplicationError):\r\n pass_test = False\r\n\r\n self.assertTrue(pass_test,\r\n ...
[ "0.62615335", "0.5705501", "0.53740865", "0.5303324", "0.5251459", "0.5226396", "0.5159832", "0.5095531", "0.5082969", "0.50595397", "0.5016958", "0.49949306", "0.4987852", "0.497308", "0.49681222", "0.49398556", "0.4930393", "0.49208614", "0.49155763", "0.49135765", "0.49113...
0.52787036
4
Detect RAGE engine (GTA IV/V)
def _is_rage(self): # dir_list = os.listdir(os.environ['PWD']) # # Check .../*/pc/data/cdimages dir # for data_dir in dir_list: # if os.path.exists(os.path.join(os.environ['PWD'], data_dir, 'pc/data/cdimages')): # return True if os.path.exists(os.path.join(os.env...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recognize():\n return 0", "def check_gev_enabled(system):\r\n\r\n # Retrieve the System TL NodeMap and EnumerateGEVInterfaces node\r\n system_node_map = system.GetTLNodeMap()\r\n node_gev_enumeration = PySpin.CBooleanPtr(system_node_map.GetNode('EnumerateGEVInterfaces'))\r\n\r\n # Ensure t...
[ "0.5817683", "0.5808298", "0.55364543", "0.5331647", "0.50801075", "0.5075239", "0.5073693", "0.50504744", "0.5004589", "0.4935257", "0.49329326", "0.49239454", "0.49068636", "0.49019936", "0.4886496", "0.4872999", "0.4865923", "0.48630938", "0.48175597", "0.4810263", "0.4788...
0.0
-1
Detect Unreal Engine 3
def _is_ue3(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_unreal():\n\n try:\n import unreal\n except ImportError:\n return False\n\n return True", "def check_engine_light(self):\n return self._check_engine_light", "def detect():\n pass", "def get_engine_type(self):", "def test_installed(self):\n check_output('un...
[ "0.62756", "0.6017487", "0.5868715", "0.5776014", "0.5408652", "0.53976065", "0.5366726", "0.52779186", "0.52252907", "0.52045435", "0.51455265", "0.5134668", "0.5123488", "0.5076015", "0.5076015", "0.5076015", "0.5076015", "0.5076015", "0.5074704", "0.5064799", "0.5050235", ...
0.53666824
7
Detect Unreal Engine 4
def _is_ue4(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_unreal():\n\n try:\n import unreal\n except ImportError:\n return False\n\n return True", "def check_engine_light(self):\n return self._check_engine_light", "def detect():\n pass", "def get_engine_type(self):", "def is_vrpd():\n cpu_type = platform.machine...
[ "0.6195017", "0.5961009", "0.5948301", "0.5744054", "0.54943156", "0.5477433", "0.5392364", "0.5354996", "0.5268304", "0.52287185", "0.5200947", "0.5200522", "0.5179119", "0.51672095", "0.51497275", "0.5115229", "0.51007545", "0.507543", "0.5072135", "0.5057048", "0.50519335"...
0.55713475
4
Show some information about engine
def info(self): if self.engine_name == 'RAGE': self._add_argument('-help') self._log('info', 'command line arguments') else: self._log('info', 'not supported', True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def engine():\r\n document.add_heading('Engine details', 1)\r\n\r\n engine_metrics = ['customProperties','listenerPorts','autosaveInterval', 'tableFilesDirectory', 'genericUndoBufferMaxSize', 'documentTimeout','documentDirectory',\r\n 'allowDataLineage', 'qrsHttpNotificationPort', 'stan...
[ "0.6732129", "0.6522818", "0.64047635", "0.64047635", "0.63712054", "0.63676304", "0.63366336", "0.63179624", "0.63136", "0.63030654", "0.62724555", "0.6268214", "0.62365055", "0.6205008", "0.61519957", "0.61519957", "0.6136013", "0.6124394", "0.6102039", "0.6079782", "0.6079...
0.64630115
2
Generate header for oauth2
def oauth_headers(oauth): import base64 encoded_credentials = base64.b64encode(('{0}:{1}'.format(oauth.client_id, oauth.client_secret)).encode('utf-8')) headers = { 'Authorization': 'Basic {0}'.format(encoded_credentials.decode('utf-8')), 'Content-Type': 'application/x-www-form-urlen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_oauth_headers(access_token: str) -> dict:\n return {'Authorization': 'Bearer ' + access_token}", "def __header_base64(self):\n header_base64 = base64.b64encode(f'{self.client_id}:{self.client_secret}'.encode('ascii'))\n header_base64 = str(header_base64).split(\"'\")[1]\n ret...
[ "0.7510096", "0.71629244", "0.71587896", "0.7056566", "0.7027807", "0.69251823", "0.6914705", "0.6914705", "0.68121415", "0.67767835", "0.6775404", "0.67447174", "0.67390746", "0.67297125", "0.6694022", "0.66927457", "0.66704285", "0.6578851", "0.65618974", "0.64950544", "0.6...
0.73699313
1
Checks to see if the token is still valid
def token_valid_check(start_time): #calculate the time elapsed since token was last refreshed elapsed_time = time.time() - start_time #take action if token is expired if elapsed_time > 3540: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unused_token_is_valid(self):\n assert self.token.is_valid()", "async def validate_token(self, token):", "def verify_token(self, token):\n return False", "def test_live_thread_token_is_valid(self):\n assert self.token.is_valid()", "def validate_token():\n global vault_token\...
[ "0.847552", "0.82011956", "0.81599474", "0.80262107", "0.7823794", "0.775227", "0.7649238", "0.75251055", "0.7454413", "0.7403214", "0.7285629", "0.7264365", "0.7250214", "0.72220445", "0.71471286", "0.71447253", "0.714289", "0.714289", "0.7124884", "0.70873654", "0.70527405"...
0.7541496
7
Creates an access token from the supplied oauth2.0 object
def create_access_token(oauth): #create parameters for API authorization redirect_uri = 'oob' params = {'client_secret': oauth.client_secret, 'redirect_uri': redirect_uri, 'response_type': 'code'} #store the access code url = oauth.get_authorize_url(**params) #open a web browser to get access token ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_oauth2_access_token(self):\n if not isinstance(self.session, DropboxSession):\n raise ValueError(\"This call requires a DropboxClient that is configured with an \"\n \"OAuth 1 access token.\")\n url, params, headers = self.request(\"/oauth2/token_from...
[ "0.77427965", "0.7283522", "0.6906905", "0.6883373", "0.68754137", "0.6776269", "0.6742007", "0.6687795", "0.66251546", "0.6614909", "0.6581949", "0.65400434", "0.6519731", "0.6517932", "0.65080005", "0.64990944", "0.6489406", "0.6487857", "0.648599", "0.64817834", "0.6473712...
0.7380083
1
API query to return all available players, ssorted by number of fantasy points\n
def available_players_query(): #start the calculation timer calc_start = time.time() #initialize everything last_first_names = [] full_names = [] player_key = [] player_pos = [] start = 1 done = False #this is where the data is actually created #loop thru to get all of the players available while(not done...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def playerStandings():\n\n getPlayers = \"SELECT id, name, wins, matches FROM playerstats ORDER BY wins DESC\"\n players = executeQuery({'dbname': 'tournament', 'query' : getPlayers, 'type' : 'find'})\n return players", "def player_stats_query(week, player_list, session=s): \n #initialize lists\n ...
[ "0.688901", "0.668698", "0.6631293", "0.6608959", "0.6578679", "0.656035", "0.65281093", "0.6521085", "0.6487832", "0.6485906", "0.64535034", "0.64514905", "0.6449632", "0.63346374", "0.63248485", "0.63226306", "0.6192959", "0.61134183", "0.60795534", "0.6069883", "0.60646695...
0.74588764
0
Finds the players of a given team\n
def team_players_query(): #start the calculation timer calc_start = time.time() #initialize everything last_first_names = [] full_names = [] player_key = [] player_pos = [] #build the query URL query_url = base_query_url + 'team/' + leagueID + teamID + '/roster' #get the j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_players_for_team(self, team, src='roster', season=None):\n # creating class wide variable to hold current team\n if type(team) is str:\n team = Team.find(team)\n\n print(\"+ Searching %s players for %s\" % (src, team))\n\n if src == 'roster':\n players = s...
[ "0.75389177", "0.723137", "0.7144066", "0.6916057", "0.6833467", "0.6824319", "0.67805666", "0.6601074", "0.6552959", "0.6516057", "0.64962745", "0.64800054", "0.6478671", "0.6455705", "0.6425193", "0.64149076", "0.64145464", "0.63946116", "0.63882154", "0.6386933", "0.637103...
0.6251081
25
Returns the player stats for the given week\n Takes the player list as an argument so the function can be used for available players and rostered players\n Only works for offensive players (QB, WR, RB, TE) right now
def player_stats_query(week, player_list, session=s): #initialize lists pos_list = [] team_list = [] #cycle thru each player that is currently available for player in avail_player_key: #build the API url for the unique player key url_player = base_query_url+'league/'+leagueI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player_stats_from_game(team, year, week):", "def get_players_game_stats_for_season_for_week(self, season, week, season_type=\"REG\"):\n try:\n season = int(season)\n week = int(week)\n if season_type not in [\"REG\", \"PRE\", \"POST\"]:\n raise Value...
[ "0.85106057", "0.6774097", "0.67719406", "0.6636765", "0.6384417", "0.6382811", "0.6193241", "0.616072", "0.6121495", "0.60404086", "0.60138744", "0.59989476", "0.59980756", "0.5972492", "0.5948775", "0.58840317", "0.58802027", "0.5877149", "0.5872693", "0.58488315", "0.58389...
0.8211842
1
Build and display svg view for current tab.
def refresh_svg_canvas(self): if self.ui.tabWidget.currentIndex() == 0: self.ui.svg_canvas.build_schematic() self.ui.svg_canvas.viewport().update() elif self.ui.tabWidget.currentIndex() in (1,2): self.ui.svg_canvas.build_pcb() self.ui.svg_canvas.viewport().update() else: raise ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self, stats=[]):\n clear_output(wait=True)\n svg_html = self.to_html(stats)\n display(svg_html)", "def _repr_svg_(self):\n pass", "def _repr_svg_(self):\n if not IPythonConsole.ipython_useSVG:\n return None\n mol = self.owner.mol\n keku = IPy...
[ "0.62321585", "0.6213278", "0.6118039", "0.6118039", "0.6038661", "0.58348596", "0.58015627", "0.5744214", "0.5506525", "0.54956293", "0.5444143", "0.54360074", "0.54353726", "0.54283196", "0.5415451", "0.5410552", "0.53604287", "0.5355877", "0.5347241", "0.52882683", "0.5273...
0.68582183
0
Reload all valus from model to show in UI elements.
def on_model_reset(self): cmp = self.mdl.cmp ui = self.ui cmp.pcb_layers["silkscreen"].attribs["stroke-width"] = "0.5" # Set values on schematic tab ui.txt_label.setText(cmp.part_name) ui.spnbox_pincount.setValue(len(cmp.connectors)) ui.spn_add_width.setValue(cmp.s_add_width) ui.spn_ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_view(self):\n for row in self.view.obj_list:\n for obj in row:\n obj._update(self.model)", "def reload(self):\n for name, param in self.components.items():\n param_path = os.path.join(self.model_path, \"%s.mat\" % name)\n param_values = sci...
[ "0.6759079", "0.6681325", "0.66621333", "0.66519105", "0.6564058", "0.65607035", "0.65437347", "0.6483663", "0.6483663", "0.64394903", "0.6437808", "0.6432464", "0.6432464", "0.6315515", "0.62948334", "0.6291024", "0.62580323", "0.62535304", "0.6237264", "0.6191947", "0.61895...
0.55130196
81
Change mount. Only smd and tht supported by Friting.
def on_mount_changed(self, btn): sender = self.sender() if sender == self.ui.radio_smd: self.mdl.cmp.mount = ComponentBase.MOUNT_SMD elif sender == self.ui.radio_tht: self.mdl.cmp.mount = ComponentBase.MOUNT_THT self.refresh_svg_canvas()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mount(self, mount):\n assert mount in (ComponentBase.MOUNTS)\n if mount==self.MOUNT_HYB:\n raise Exception(\"Unsupported mount.\")\n self._mount = mount\n self._check_mount()", "def mount(self, dev, path, mount_options):\n # if directory is not a mount point, mount it\n if not ...
[ "0.7536546", "0.67045027", "0.6439409", "0.64367807", "0.63337016", "0.6122933", "0.6095733", "0.59617585", "0.5953434", "0.5928632", "0.5925651", "0.5891891", "0.5875534", "0.58752507", "0.5847054", "0.5811964", "0.58091146", "0.58027476", "0.5790931", "0.57767016", "0.57611...
0.63388246
4
Add or remove component connectors.
def on_pincount_change(self, val): if val<0: return rows = self.mdl.rowCount() if rows<val: # Add rows for i in range(rows, val): self.mdl.insertRow(i) elif rows>val: # Remove rows for i in range(rows, val, -1): self.mdl.removeRow(i-1) self.refresh_svg_ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_connector(self):\n \n no = len(self.connectors)\n state = {}\n state[\"s_pin\"] = no\n state[\"p_pin\"] = no\n state[\"s_label\"] = \"C%d\" % no\n \n if len(self.connectors)>0:\n state = self.connectors[-1].get_state()\n state[...
[ "0.63449883", "0.6032346", "0.57559407", "0.53216934", "0.52627605", "0.5195182", "0.51838595", "0.5173958", "0.5141519", "0.5141155", "0.51190317", "0.51025146", "0.50760615", "0.50538504", "0.502889", "0.5020217", "0.5013656", "0.50024843", "0.49962837", "0.49697974", "0.49...
0.0
-1
Change name on component.
def on_name_change(self, txt): self.mdl.cmp.part_name = txt self.refresh_svg_canvas()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, newname=\"\"):\n self.name = newname", "def new_name(self,new_name):\n self.name = new_name", "def update_name(self, new_name):\r\n self.__name = new_name", "def update_name(self, new_name):\r\n self.__name = new_name", "def updateName(self,name):\n sel...
[ "0.7760173", "0.7759742", "0.7747133", "0.7747133", "0.7532761", "0.7531982", "0.75248784", "0.74675447", "0.74527305", "0.7436896", "0.7427096", "0.7427096", "0.7427096", "0.7427096", "0.7427096", "0.74243397", "0.7422197", "0.7418796", "0.7418796", "0.7418796", "0.7418796",...
0.0
-1
Adds extra vertical spacing between schematic pins.
def on_pcb_v_spacing_changed(self, txt): if self.ui.txt_spacing_v.hasAcceptableInput(): self.mdl.cmp.p_spacing_v = float(txt.replace(",", ".")) self.refresh_svg_canvas() else: self.ui.txt_spacing_v.setText("%0.3f" % self.mdl.cmp.p_spacing_v)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def additional_vertical_padding(self):\n return 0", "def custom_spacing(width, height):\n\t\treturn c.lift(imgui.dummy, width, height)", "def vertical_spacing(self):\r\n return self.padding[0] + self.padding[2] + self.margin[0] + self.margin[2]", "def SetSpacerPixels(self, s):\r\n\r\n se...
[ "0.66273147", "0.65561676", "0.6366731", "0.59444165", "0.58789814", "0.5694909", "0.5682465", "0.5503588", "0.5499777", "0.54681957", "0.5457708", "0.5428778", "0.54203933", "0.5412702", "0.53952616", "0.53752977", "0.5370524", "0.53443474", "0.5329409", "0.53142804", "0.531...
0.4634174
82
Adds extra horisontal spacing between schematic pins.
def on_pcb_h_spacing_changed(self, txt): if self.ui.txt_spacing_h.hasAcceptableInput(): self.mdl.cmp.p_spacing_h = float(txt.replace(",", ".")) self.refresh_svg_canvas() else: self.ui.txt_spacing_h.setText("%0.3f" % self.mdl.cmp.p_spacing_h)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom_spacing(width, height):\n\t\treturn c.lift(imgui.dummy, width, height)", "def SetSpacing(self, p_int, ):\n ...", "def style_spacer_xs(self) -> str:\n style_spacer_xs = \"\"\".spacer--xs\n {margin-bottom: 15px;}\\n\"\"\"\n self.html_doc = self.html_doc + style_spacer_xs\n ...
[ "0.6626817", "0.61980224", "0.5979083", "0.5896608", "0.5769577", "0.56942433", "0.5647765", "0.5548821", "0.5529602", "0.55290693", "0.5499842", "0.54984343", "0.54756695", "0.54718214", "0.54642105", "0.5373114", "0.53434235", "0.53388673", "0.5329868", "0.5329478", "0.5300...
0.51542515
29
Adds extra height to schematic body
def on_body_height_add(self, val): val = max(0, int(val)) self.mdl.cmp.s_add_height = val self.refresh_svg_canvas()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def footprint_height():", "def body_resize(self):", "def setHeight(*args):", "def setHeight(*args):", "def setHeight(*args):", "def setHeight(*args):", "def setHeight(*args):", "def setHeight(*args):", "def setHeight(*args):", "def setHeight(*args):", "def setHeight(*args):", "def setHeight(*...
[ "0.6295264", "0.61815864", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.60334027", "0.5969041", "0.58549297", "0.57929575", "0.578066", "0.5753543", "0.5753543", "0.5753543", "0....
0.7480933
0
Adds extra width to schematic body
def on_body_width_add(self, val): val = max(0, int(val)) self.mdl.cmp.s_add_width = val self.refresh_svg_canvas()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _extra_width(self) -> int:\n width = 0\n if self.box and self.show_edge:\n width += 2\n if self.box:\n width += len(self.columns) - 1\n return width", "def body_resize(self):", "def width(self):\n\t\tpass", "def width(self) -> int:", "def width(self) ->...
[ "0.6539015", "0.64924866", "0.60851705", "0.6076208", "0.6076208", "0.6055567", "0.6055567", "0.6055567", "0.6055567", "0.6055567", "0.6055567", "0.6055567", "0.6055567", "0.6055567", "0.6055567", "0.6055567", "0.5926316", "0.58366567", "0.5834761", "0.58082455", "0.5742201",...
0.7276638
0
Display the online documentation in a help window.
def on_help(self): d = QtGui.QDialog(parent=self) dialog = Ui_Dialog() dialog.setupUi(d) dialog.webView.setUrl(QUrl("http://code.google.com/p/svg-component-creator/wiki/UserDocumentation")) d.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def openOnlineHelp(self):\r\n url = QUrl(\"http://freeseer.readthedocs.org\")\r\n QDesktopServices.openUrl(url)", "def documentation():\n return render_template('help.html')", "def help(self):\n if not self.fv.gpmon.has_plugin('WBrowser'):\n self._help_docstring()\n ...
[ "0.8012712", "0.7895543", "0.76795626", "0.74728966", "0.7437503", "0.7407703", "0.7359206", "0.7359206", "0.7358967", "0.7340628", "0.7313576", "0.7298534", "0.72881734", "0.72871894", "0.7275768", "0.7271275", "0.7243446", "0.723041", "0.7159798", "0.7159798", "0.71316636",...
0.0
-1
Show a file dialogue and save componet to a file.
def on_save(self): filename = QtGui.QFileDialog.getSaveFileName(self, "Save file", "", "*.scc") if filename == "": return print("Save file ", filename) f = open(filename, mode="wb") state = self.mdl.cmp.get_state() pickle.dump(state, f, pickle.HIGHEST_PROTOCOL) f.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_fileDialog(self):\n\n if self.check_data():\n options = QFileDialog.Options()\n options |= QFileDialog.DontUseNativeDialog\n fileName, _ = QFileDialog.getSaveFileName(self, \"Сохранить как\", os.path.expanduser(\"~\"), \"Все файлы (*);;XML Файлы (*.xml);;JSON Файлы ...
[ "0.7724752", "0.7255473", "0.7255473", "0.7255473", "0.7255473", "0.72310436", "0.7226843", "0.7139409", "0.70886636", "0.69758683", "0.6960584", "0.69558215", "0.6949092", "0.6913201", "0.6889274", "0.6876284", "0.68659836", "0.6844143", "0.681732", "0.6783393", "0.67787975"...
0.6094384
92
Show a file dialoge and load saved componet.
def on_load(self): filename = QtGui.QFileDialog.getOpenFileName(self, "Open file", "", "*.scc") print("Load file ", filename) if filename == "": return f = open(filename, mode="rb") state = pickle.load(f) f.close() cmp = ComponentRect() cmp.set_state(state) self.mdl.set_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load():\n messagebox.showinfo(\"Information\", \"Veuillez entrer le nom du fichier dans la console.\")\n file_name = input(\"Nom du fichier : \")\n ferme_fenetre()\n Hitori(file_name)", "def fileCmd(self):\n filename = askopenfilename() \n self.cnvImgOrig.displayIm...
[ "0.65958446", "0.6539871", "0.6426099", "0.64201653", "0.6310796", "0.6266483", "0.62280816", "0.62094724", "0.6201977", "0.61690474", "0.6166653", "0.6125027", "0.6091769", "0.60856396", "0.6052059", "0.60477245", "0.6044098", "0.6012188", "0.60100627", "0.600295", "0.599834...
0.6267885
5
Run figure's event loop while listening to interactive events. The events listed in event_names are passed to handler. This function is used to implement `.Figure.waitforbuttonpress`, `.Figure.ginput`, and `.Axes.clabel`.
def blocking_input_loop(figure, event_names, timeout, handler): if figure.canvas.manager: figure.show() # Ensure that the figure is shown if we are managing it. # Connect the events to the on_event function call. cids = [figure.canvas.mpl_connect(name, handler) for name in event_names] try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fig1_press(event):\n if event.key == 'n':\n if results.type is not None:\n print(\"Moving to next neuron\")\n callback.next_move = 'next'\n plt.close(fig1)\n else:\n print('Ensure type is set')\n\n if event.key == '...
[ "0.58663946", "0.5447554", "0.54228073", "0.53521365", "0.53415567", "0.5315508", "0.5248115", "0.52316606", "0.5220068", "0.5174886", "0.5119426", "0.51046586", "0.5099623", "0.5095802", "0.5055943", "0.503854", "0.5026388", "0.4981488", "0.49244776", "0.4902189", "0.4895454...
0.7370716
0
Calculates the perimeter given the bottom length, top length, 1st side length, and 2nd side length.
def perimeter(self): return self.sidelength1 + self.sidelength2 + self.baselength1 + self.baselength2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perimeter(self):\n return (\n self.side_1_length +\n self.side_2_length +\n self.side_3_length +\n self.side_4_length\n )", "def calculateperimeter(self):\r\n return (self.width * 2) + (self.height * 2)", "def perimeter(self):\n\t\treturn 2 *...
[ "0.73933774", "0.7245891", "0.720648", "0.7175091", "0.7159154", "0.7143771", "0.7052815", "0.6963846", "0.6854498", "0.6804715", "0.6780466", "0.6780466", "0.6722681", "0.6501043", "0.6399388", "0.63739026", "0.63721514", "0.6371612", "0.6364265", "0.63316923", "0.6298338", ...
0.76503986
0
Calculates the area given the bottom length, top length, and height.
def area(self): return (self.baselength1 + self.baselength2)*self.height/2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectangle_area(base, height):\n return (base * height)", "def rectArea(base, height):\n return base * height", "def area(base, height):\n\n return base * height", "def areaRect(length, width):\n return length * width", "def area_rect(w, h):\n return w * h", "def area_of(self, left_top,...
[ "0.7216957", "0.71193826", "0.7107749", "0.7080084", "0.7019711", "0.70039344", "0.6993964", "0.6874019", "0.6871876", "0.6871876", "0.6824662", "0.6784132", "0.6711688", "0.66958904", "0.66664284", "0.66632086", "0.664994", "0.6608759", "0.66025525", "0.65858614", "0.6525023...
0.7118867
2
player names and bid / trick / score headers
def init_column_headers(self): col_headers = {1: "bid", 2: "tricks", 3: "score"} for player in range(1, 5): ent_player_name = tk.Entry(self.master, font='courier 10 bold', fg='blue', borderwidth=2, relief="groove") ent_player_name.grid(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_player_data():\n names = [\"Gunther O'Brian\",\n 'Workman Gloom',\n 'Esme Ramsey',\n 'Cornelius Games',\n 'Kline Greenlemon',\n 'Hotbox Sato',\n 'Famous Owens',\n 'Jenkins Good']\n nums = [77, 31, 37, 6, 14, 53, 7, ...
[ "0.6582695", "0.6475915", "0.6052055", "0.60238695", "0.59894055", "0.5905075", "0.5861272", "0.5828725", "0.5781333", "0.576649", "0.57659", "0.5753501", "0.5747915", "0.57395995", "0.57395816", "0.573417", "0.5696014", "0.56830585", "0.5673088", "0.5660423", "0.5632163", ...
0.6398447
2
labels with round numbers
def init_round_numbers(self): for round_num in range(1, 13): lbl_round_num = tk.Label(self.master, text=str(round_num), font='courier 10 bold', fg='green', pady=2) lbl_round_num.grid(row=round_num+1, column=0) row = 14 for trump ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autolabel(X_pos,values,height_lift):\r\n\theight= np.round(np.nan_to_num(values),2);y_pos = height_lift*height\r\n\tfor i in range(len(height)):\r\n\t\tax.text(X_pos[i],y_pos[i],'%4.2f' % height[i], ha='center', va='bottom',size=4)", "def getLabels(self):\n return self.numToLabel", "def label(self, marg...
[ "0.6358072", "0.635775", "0.6293751", "0.621447", "0.6207149", "0.62016577", "0.6130753", "0.61188644", "0.61017317", "0.60645777", "0.6025209", "0.60067993", "0.59946424", "0.5989236", "0.59892356", "0.597898", "0.597898", "0.597898", "0.59719455", "0.5968639", "0.59655595",...
0.65299755
0
entry widgets for bids and tricks, labels for scores
def init_round_results(self): for player in range(0, 4): for round_num in range(0, 17): spin_bid = tk.Spinbox(self.master, from_=-1, to=min(round_num+1, 13), width=10) spin_bid.grid(row=round_num+2, column=player*3+1, padx=2) self.spin_bids[player...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_widgets(self):\n Label(self, text=\"Choose your favorite movie type\").grid(row=0, column=0, sticky=W)\n\n # instructions\n Label(self, text=\"Select all that apply:\").grid(row=1, column=0, sticky=W)\n\n # comedy check button\n self.comedy = BooleanVar()\n Chec...
[ "0.62600446", "0.619926", "0.6122178", "0.61055934", "0.5994453", "0.5788945", "0.57255733", "0.5698006", "0.5689652", "0.5653045", "0.55936646", "0.55931014", "0.553044", "0.55082005", "0.54880196", "0.5463582", "0.5454248", "0.5442131", "0.5441836", "0.5441345", "0.54390967...
0.5555503
12
label for total score for each player
def init_totals(self): for player in range(0, 4): lbl_total = tk.Label(self.master, text="0", font='courier 10 bold', fg='red', width=10, borderwidth=2, relief="groove", anchor="e") lbl_total.grid(row=19, column=player*3+3, sticky=tk.W+tk.E) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def augmenter_score():\n\n global label_score\n global score\n\n score += 1\n label_score.config(text= \"score : \" + str(score))", "def disp_score():", "def update_scores(self):\r\n totals = [0, 0, 0, 0]\r\n for player in range(0, 4):\r\n for round_num in range(0, 17):\r\n...
[ "0.69694656", "0.6935289", "0.67277586", "0.6526006", "0.65202165", "0.6453057", "0.64485866", "0.6444573", "0.64286613", "0.6387012", "0.6325333", "0.625666", "0.6240114", "0.6235395", "0.6225145", "0.6225145", "0.6217871", "0.6213417", "0.6205035", "0.61613077", "0.6159299"...
0.65591896
3
command button that calculates scores
def init_button_calc(self): btn_calc = tk.Button(self.master, text='calculate', font='courier 10 bold', fg='purple', command=self.update_scores) btn_calc.grid(row=20, column=1, columnspan=3, sticky=tk.W+tk.E, pady=5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disp_score():", "def update_score():\n pass", "def enter_game_scores():\n pass", "def score(self):", "def update_score(self, engine, *args):\n #pdb.set_trace()\n self.score_label.text = \"Gold: {}/{}\".format(str(engine.score),\n ...
[ "0.695034", "0.676045", "0.66949934", "0.668477", "0.6502419", "0.649244", "0.64213395", "0.63838565", "0.62789667", "0.62286115", "0.6212426", "0.62090117", "0.61582416", "0.61512876", "0.6119021", "0.61164653", "0.61131734", "0.6094686", "0.60794663", "0.6069196", "0.605037...
0.6769738
1
calculate and display scores for each valid bid x trick pair
def update_scores(self): totals = [0, 0, 0, 0] for player in range(0, 4): for round_num in range(0, 17): try: bid = int(self.spin_bids[player][round_num].get()) tricks = int(self.spin_tricks[player][round_num].get()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disp_score():", "def resultat_match(self, binomes):\n for binome in binomes:\n while True:\n score_un = self.vue.entree_resultats(binome[0])\n score_deux = self.vue.entree_resultats(binome[1])\n if score_un + score_deux != 1:\n ...
[ "0.6550589", "0.64147127", "0.6227076", "0.60567015", "0.6029427", "0.6025697", "0.5990587", "0.5938982", "0.5932216", "0.59277326", "0.592605", "0.59216154", "0.5920696", "0.5903962", "0.58853215", "0.5872225", "0.5831863", "0.58293426", "0.5814984", "0.58139294", "0.581041"...
0.6524363
1
Get the current time, with an offset from setting the time.
def get_current_time(): cur_time = datetime.datetime.now() + offset_time return [cur_time.year, cur_time.month, cur_time.day, cur_time.hour, cur_time.min, cur_time.second]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time(self):\n return datetime.datetime.now(self.time_zone)", "def get_time(offset=0, with_second=True):\n today = datetime.datetime.now() - datetime.timedelta(seconds=offset)\n hour = str(today.hour)\n minute = str(today.minute)\n second = str(today.second)\n if with_second:\n re...
[ "0.7146425", "0.714417", "0.7019261", "0.7012288", "0.6905133", "0.6807562", "0.67945784", "0.672395", "0.665871", "0.6616153", "0.6525835", "0.6525835", "0.6448199", "0.64471346", "0.6427538", "0.64143443", "0.6411822", "0.6398357", "0.6368899", "0.6362611", "0.6362475", "...
0.6917492
4
Accept an uploaded file. This method is not named do_POST because it is only enabled if the upload flag (u) is used.
def action_POST(self): # Use the content-length header, though being user-defined input it's not really trustworthy. try: l = int(self.headers.get('content-length', 0)) if l < 0: # Parsed properly, but some joker put in a negative number. raise Va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n if validate(request.form):\n handle_upload(request.files['qqfile'], request.form)\n return make_response(200, {\"success\": True})\n else:\n return make_response(400, {\"error\": \"Invalid request\"})", "def upload_validated(request):\n if 'file' ...
[ "0.65835524", "0.6582667", "0.6471456", "0.6334828", "0.6298631", "0.62456393", "0.6204695", "0.61989796", "0.61686116", "0.61154824", "0.61117285", "0.6110108", "0.60809696", "0.6070663", "0.60542065", "0.60350883", "0.60237575", "0.59959", "0.59802985", "0.5974787", "0.5948...
0.61218333
9
Common code for GET and HEAD commands. This sends the response code and MIME headers. Return value is either a file object (which has to be copied to the outputfile by the caller unless the command was HEAD, and must be closed by the caller under all circumstances), or None, in which case the caller has nothing further...
def do_GET(self): path = self.file_path if os.path.exists(path): # Symbolic link judgement. # Paths with denied symbolic links will pretend to be 404 errors. if args[TITLE_LOCAL_LINKS] and not ("%s/" % os.path.realpath(path)).startswith(os.getcwd() + "/"): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_GET(self):\n f = self.send_head()\n if f:\n try:\n self.copyfile(f, self.wfile)\n finally:\n f.close()", "def do_GET(self):\n f = self.send_head()\n if f:\n try:\n \n self.copyfile(f, s...
[ "0.73561096", "0.7330471", "0.724983", "0.71072185", "0.7020951", "0.7008843", "0.69666696", "0.6840107", "0.6787616", "0.6743435", "0.6736264", "0.66644365", "0.66616446", "0.661352", "0.6601374", "0.65817034", "0.6558699", "0.6517581", "0.64791644", "0.6423894", "0.6351152"...
0.6008821
39
Helper to produce a directory listing (absent index.html). Return value is either a file object, or None (indicating an error). In either case, the headers are sent, making the interface the same as for send_head().
def list_directory(self, path): table_content = self.render_file_table(path) if not table_content: # Intentionally keeping the reason for this vague. # Could be due to a not-found file or a permissions problem. self.send_error(404, "Unable to list directory") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_head(self):\n print 'url_path', self.path\n file_path = self.url_path_to_file_path(self.path)\n print 'file_path', file_path\n f = None\n if os.path.isdir(file_path):\n if not self.path.endswith('/'):\n # redirect browser - doing basically what ...
[ "0.75678825", "0.7337772", "0.7279455", "0.725182", "0.7109132", "0.7086577", "0.7033438", "0.69411206", "0.6808663", "0.67981875", "0.67918867", "0.6644201", "0.66291624", "0.65504634", "0.6504529", "0.6458196", "0.63638103", "0.62457836", "0.61806464", "0.61667067", "0.6126...
0.6708497
11
Connect to address and return the socket object. Convenience function. Connect to address (a 2tuple ``(host, port)``) and return the socket object. Passing the optional timeout parameter will set the timeout on the socket instance before attempting to connect. If no timeout is supplied, the
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT): msg = "getaddrinfo returns an empty list" host, port = address for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(spec, timeout=None, nagle_off=True, cache=0,\n _cache=_connect_cache, _lock=_connect_cache_lock):\n # pylint: disable = W0102, R0912, R0915\n\n sock = None\n try:\n adi = None\n if cache > 0:\n _lock.acquire()\n try:\n if spec in _c...
[ "0.744305", "0.7351968", "0.71428746", "0.7093566", "0.69392675", "0.68707865", "0.6829429", "0.6805412", "0.67925763", "0.6737057", "0.6718961", "0.66749173", "0.6562161", "0.65577984", "0.65336025", "0.64614576", "0.6453029", "0.64274627", "0.6397214", "0.6356111", "0.63293...
0.73768765
1
Returns the target functional and the gradients
def target_and_grad(x, ref_params, data_modelers, SIM, params): target_functional = 0 grad = np.zeros(len(x)) save_name = params.geometry.optimized_detector_name if not all(params.geometry.fix.panel_rotations) and not all(params.geometry.fix.panel_rotations): geometry_refiner.update_detector(x,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getGradients(self, image, target_class=None):\n\n image = image.requires_grad_()\n out, features = self._getFeatures(image)\n\n if target_class is None:\n target_class = out.data.max(1, keepdim=True)[1]\n\n agg = 0\n for i in range(image.size(0)):\n agg...
[ "0.7091655", "0.69808656", "0.69808656", "0.6909302", "0.68390083", "0.6812944", "0.66931266", "0.6678249", "0.6654693", "0.6641082", "0.66244924", "0.66052693", "0.66036254", "0.65789163", "0.6561227", "0.65580636", "0.65580636", "0.6550413", "0.6538096", "0.6532786", "0.649...
0.64274645
24
Writes refl and exper files for each experiment modeled during the ensemble refiner
def write_output_files(Xopt, LMP, Modelers, SIM, params): opt_det = geometry_refiner.get_optimized_detector(Xopt, LMP, SIM) # Store the hessian of negative log likelihood for error estimation # must determine total number of refined Fhkls and then create a vector of 0's of that length num_fhkl_param = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _OpenOutputFiles(self):\n self.gfile = open(self.geomout, \"w\")\n self.efile = open(self.energyout, \"w\")\n self.PrintEnergyHeader()", "def write_data_model(doc_filename='data/documents.txt'):\n\n numiters = num_iters(doc_filename) + 1\n print 'number of iterations:', numiters - 1\n\n pic...
[ "0.5975395", "0.59592813", "0.58979046", "0.58952695", "0.5826259", "0.58093685", "0.58026266", "0.5795915", "0.57447165", "0.57213265", "0.57084817", "0.56667113", "0.56539685", "0.562931", "0.56153154", "0.5604128", "0.5590978", "0.5588866", "0.55703115", "0.55635935", "0.5...
0.62107396
0
Given a URL, try to return its associated region, bucket, and key names based on this object's endpoint info as well as all S3 endpoints given in the configuration.
def resolve_url_to_location(self, url): parsed_url = six.moves.urllib.parse.urlparse(url) if not parsed_url.scheme: parsed_url = six.moves.urllib.parse.urlparse('http://' + url) parsed_own_url = six.moves.urllib.parse.urlparse(self.endpoint) bucket, key = self.__match_path(pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_for_bucket(self, base_url, extra_configurations=None):\n\n warnings.warn(\n \"Use backend_config.bucket_config.BucketList.get_config_for_uri\",\n DeprecationWarning,\n )\n configs = S3BucketConfig.from_list(self.get(\"sdk.aws.s3.credentials\", []))\n ...
[ "0.6745669", "0.6435143", "0.62151855", "0.5942863", "0.59099114", "0.59099114", "0.5813266", "0.5788725", "0.5757353", "0.5635177", "0.56279933", "0.5561384", "0.55386037", "0.55036676", "0.5499892", "0.54674625", "0.54305124", "0.54026806", "0.5393976", "0.53860795", "0.536...
0.78750426
0
Get a presigned URL for this request that expires after a given number of seconds.
def get_presigned_url2(self, timeout): # requestbuilder 0.3 self.preprocess() if self.__should_use_sigv4(): # UNSIGNED-PAYLOAD is a magical string used for S3 V4 query auth. auth = requestbuilder.auth.aws.QueryHmacV4Auth.from_other( self.auth, timeout=time...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def presigned_url(self, url, expiration=3600, force_download=False):\n force_download = \"?force_download=1\" if force_download else \"\"\n public_url = Path(self.config.get(\"public_url\", \"\"))\n resource_url = public_url / url\n return resource_url.as_posix() + force_download", "d...
[ "0.7014345", "0.7014051", "0.6956774", "0.67384046", "0.6545521", "0.6445912", "0.63070875", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", "0.614691", ...
0.6424251
6
construct the P_kd (kappaDelta) matrix such that kappa = P_kd Delta equivalent to equation 31 & 32 in Simon 2009, using Delta = delta/a as in Hu and Keeton 2003
def construct_P_kd(N1,N2,z_kappa,z_Delta, cosmo=None,**kwargs): if cosmo==None: cosmo = Cosmology(**kwargs) Nj = len(z_kappa) Nk = len(z_Delta) if max(z_Delta) > max(z_kappa): print "-------" print "WARNING: construct_P_kd: singular matrix [ min(z_kappa) < min...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_kappa(D):\n\n return -0.5*D*np.log(2*np.pi) + 0.5*np.log(D*np.pi) - 1", "def em_epsilon_cdp(epsilon, delta, k):\n if delta <= 0:\n return epsilon / k\n else:\n log_delta = np.log(1 / delta)\n return max(\n epsilon / k,\n np.sqrt((8 * log_delta + 8 * epsilon) / k) -\n n...
[ "0.6006358", "0.5726812", "0.5607486", "0.55964506", "0.5561811", "0.55442095", "0.5524946", "0.5505259", "0.5502432", "0.54426163", "0.537911", "0.5328839", "0.5327884", "0.53229845", "0.53121215", "0.53063035", "0.530413", "0.52961487", "0.52916247", "0.52867043", "0.528461...
0.67988276
0
Show that basic numpy operations with Column behave sensibly
def test_numpy_ops(self): arr = np.array([1, 2, 3]) c = Column('a', arr) eq = c == arr assert np.all(eq) assert len(eq) == 3 assert type(eq) == Column assert eq.dtype.str == '|b1' eq = arr == c assert np.all(eq) lt = c - 1 < arr a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getattr__(self, col):\n return self._obj[col].to_numpy()", "def _modify_columns(self, cols, X, y=None):", "def _create_metric_column(\n data: pd.DataFrame,\n column_a: str,\n column_b: str,\n numpy_method: str,\n conjunction: str,\n) -> pd.DataFrame:\n column_operation = getattr(...
[ "0.6132716", "0.5897211", "0.57506585", "0.57329494", "0.5698936", "0.5586861", "0.55237365", "0.548468", "0.54814553", "0.5479346", "0.5474814", "0.54733694", "0.5452359", "0.54214543", "0.54059917", "0.54054594", "0.53947806", "0.53844583", "0.53784984", "0.5374963", "0.537...
0.70421773
0
Show that the formatted output from str() works
def test_format(self): MAX_LINES_val = pprint.MAX_LINES() pprint.MAX_LINES.set(7) c1 = Column(name='a', data=np.arange(2000), dtype=float, format='%6.2f') assert str(c1) == (' a \n-------\n 0.00\n' ' 1.00\n ...\n1998.00\n1999.00')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_str_(self):\n str(self.standardcode)\n repr(self.standardcode)", "def test_stringify(self) -> None:\n assert repr(Ok(1)) == str(Ok(1)) == \"Ok(1)\"\n assert repr(Err(1)) == str(Err(1)) == \"Err(1)\"", "def pretty_str(self) -> str:\n ...", "def format(self) -> str:"...
[ "0.71492827", "0.7069855", "0.6896951", "0.6828211", "0.67778987", "0.6773498", "0.67273897", "0.6725174", "0.6685986", "0.66774666", "0.6668654", "0.66682696", "0.66526073", "0.6590294", "0.658641", "0.65541434", "0.6531819", "0.65306425", "0.6523459", "0.6522288", "0.649797...
0.0
-1
Testing generators count Pallas's cats
def asd(message): if message.params[0] != 'test': for i in range(int(message.params[0])): yield str(i) + ' ' + morph.parse( 'манул')[0].make_agree_with_number(i).word time.sleep(0.5) else: try: # print(1) # server = message.cls.vk_a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_count(self):", "def Count():\n return CheckForError(lib.Generators_Get_Count())", "def count():", "def test_num_circs_shots(self):\n backend = FakeValencia()\n generator = Generator(backend)\n max_experiments = 5\n max_shots = 10\n backend._configuration.max_e...
[ "0.62914926", "0.62529856", "0.6237697", "0.6077749", "0.60630804", "0.6033289", "0.5990379", "0.596132", "0.5943474", "0.5941403", "0.5940434", "0.59065664", "0.58812034", "0.58721775", "0.58513904", "0.58485705", "0.58479345", "0.58215755", "0.5821307", "0.5818511", "0.5811...
0.0
-1
Returns a tuple for zeropadding for 2D convolution with downsampling. Arguments
def correct_pad(backend, inputs, kernel_size): img_dim = 2 if backend.image_data_format() == 'channels_first' else 1 input_size = backend.int_shape(inputs)[img_dim:(img_dim + 2)] if isinstance(kernel_size, int): kernel_size = (kernel_size, kernel_size) if input_size[0] is None: adjust ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv2d_backward(d_top, x, w, b, pad, stride):\n raise NotImplementedError\n #######################################################################\n # #\n # #\n ...
[ "0.57575804", "0.5677426", "0.561482", "0.5541626", "0.54889554", "0.54487675", "0.5432683", "0.54277915", "0.53716093", "0.53380644", "0.53306156", "0.53285414", "0.52913517", "0.52740836", "0.5271762", "0.52553904", "0.5249014", "0.5216504", "0.52129334", "0.5189569", "0.51...
0.0
-1
create a database connection to a SQLite database
def create_connection(db_file): try: conn = sqlite3.connect(db_file) c = conn.cursor() c.execute('''CREATE TABLE IF NOT EXISTS contacts (id INTEGER PRIMARY KEY, name text NOT NULL, address text NOT NULL, email text NOT NULL, phone text NOT NULL)''') e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_db(self) -> sqlite3.Connection:", "def create_connection():\n dir_path = os.path.dirname(os.path.abspath(__file__))\n db_file = dir_path + '/py_sqlite.db'\n try:\n DbUtil.connection = sqlite3.connect(db_file)\n except Error as e:\n print(e)\n f...
[ "0.8269675", "0.8154287", "0.8153167", "0.80855244", "0.8006094", "0.79054296", "0.7893724", "0.78821623", "0.7875023", "0.7869494", "0.7866777", "0.7866777", "0.7866777", "0.7866019", "0.78544617", "0.7850683", "0.78433925", "0.7838268", "0.78342485", "0.78307635", "0.782310...
0.0
-1
Returns the number of samples in this signal block
def get_num_samples(self): return self._num_samples
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _number_of_samples(self):\n return len(self._raw_data.samples)", "def sample_count(self):\n if self._sample_count:\n return self._sample_count\n else:\n return self._wave.getnframes()", "def getNrSamples(self): \r\n return self.numSamples", "def get_nu...
[ "0.83632773", "0.8249422", "0.8128629", "0.81282437", "0.7986192", "0.77264965", "0.7699206", "0.76810426", "0.76648474", "0.762112", "0.76069885", "0.7594044", "0.7592407", "0.75706035", "0.7565927", "0.7559769", "0.7524813", "0.7473026", "0.74660444", "0.7433234", "0.743323...
0.8102221
4
Method to create embedddings for documents by encoding their image.
def encode( self, docs: Optional[DocumentArray] = None, parameters: dict = {}, *args, **kwargs, ) -> None: if not docs: return batch_generator = docs.batch( traversal_paths=parameters.get('traversal_paths', self.traversal_paths), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_image_embeddings(self):\n inception_output = image_embedding.inception_v3(\n self.images,\n trainable=self.train_inception,\n is_training=self.is_training())\n\n # Map inception output onto embedding space.\n with tf.variable_scope(\"image_embedding\") as scope:\n image...
[ "0.5972184", "0.5909413", "0.5838329", "0.5812766", "0.5676898", "0.566756", "0.56353486", "0.5634795", "0.5614541", "0.560931", "0.55710936", "0.5562259", "0.5523897", "0.5518542", "0.5506819", "0.5501866", "0.54833275", "0.54608405", "0.5443685", "0.5399601", "0.5336045", ...
0.6467108
0
Test that the digits are classified correctly by a classifier.
def __test_digits(self, X, y, clf): self.assertEqual(len(X), len(y)) correct = 0 for i in xrange(len(y)): expected = y[i] prediction = clf.classify([X[i]])[0] if expected == prediction: correct += 1 self.assertGreaterEqual(correct, sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_classify(self):\n classifiers, estimates =\\\n ada_boost.train_dataset(self.larger_matrix,\n self.larger_class_labels,\n 9)\n data_to_classify = [1, 0.5]\n classifications = ada_boost.classify(data_to_cla...
[ "0.6504808", "0.6338742", "0.63143575", "0.62959284", "0.62814325", "0.62447387", "0.61741614", "0.61499375", "0.61478704", "0.61478704", "0.6142268", "0.61027217", "0.6074408", "0.6066596", "0.60418713", "0.60381013", "0.603409", "0.6030845", "0.6029761", "0.6024929", "0.601...
0.7913877
0
Load an image as grayscale.
def imgfile_to_grayscale(filename): img = cv2.imread(filename) return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_gray_scale(img):\r\n #reading image\r\n im = Image.open(\"filename\")\r\n\r\n if im.mode != \"L\":\r\n im = im.convert(\"L\")\r\n\r\n return img", "def grayscale(filename):\r\n image = SimpleImage(filename)\r\n for pixel in image:\r\n luminosity = compute_luminosity...
[ "0.7603708", "0.7325186", "0.7322381", "0.7228985", "0.7035624", "0.7020066", "0.69925356", "0.69703823", "0.69242543", "0.6916675", "0.69085276", "0.6878698", "0.6871946", "0.6870448", "0.68381256", "0.68381256", "0.67890686", "0.67610466", "0.6748764", "0.67421776", "0.6711...
0.680726
16
Load training data from digits.png
def load_digits(cls): gray = cls.imgfile_to_grayscale(cls.DIGITS_FILE) # Now we split the image to 5000 cells, each 20x20 size cells = [np.hsplit(row, 100) for row in np.vsplit(gray, 50)] # Make it into a Numpy array. It size will be (50,100,20,20) x = np.array(cells) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_digits():\n \n images, target = [], []\n for image_file in digit_image_filenames:\n image = cv2.imread(image_file)\n if image is None:\n raise RuntimeError(\"Failed to read the image file '{}'\".format(\n image_file))\n image = cv2.cvtColor(image, cv...
[ "0.708967", "0.6994615", "0.6965878", "0.6935963", "0.6672894", "0.66682076", "0.65903187", "0.6515253", "0.64869475", "0.64020413", "0.6389433", "0.6385904", "0.63520086", "0.63297844", "0.632445", "0.632055", "0.63086367", "0.62679493", "0.6263167", "0.6256531", "0.6240129"...
0.7322466
0
Using the public method mount to test _get_drive_mount_point_name
def test_get_drive_mount_point_name_unique_id_None(self): try: tmpdir = mkdtemp() root = os.path.join(tmpdir, 'mnt/gluster-object') drive = 'test' _init_mock_variables(tmpdir) gfs._allow_mount_per_server = True self.assertTrue(gfs.mount...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_googledrive_mounting_point():\n return None", "def test_get_drive_mount_point_name_unique_id_exists(self):\n try:\n tmpdir = mkdtemp()\n root = os.path.join(tmpdir, 'mnt/gluster-object')\n drive = 'test'\n\n _init_mock_variables(tmpdir)\n ...
[ "0.71002924", "0.6954491", "0.6827536", "0.6759451", "0.6704294", "0.66067576", "0.64347553", "0.6420853", "0.63291794", "0.63125104", "0.6307517", "0.62765527", "0.62722826", "0.6255401", "0.61517626", "0.61497533", "0.6133829", "0.6132875", "0.6093856", "0.6090868", "0.6059...
0.75672483
0
Using the public method mount to test _get_drive_mount_point_name and the _unique_id is already defined
def test_get_drive_mount_point_name_unique_id_exists(self): try: tmpdir = mkdtemp() root = os.path.join(tmpdir, 'mnt/gluster-object') drive = 'test' _init_mock_variables(tmpdir) gfs._allow_mount_per_server = True gfs._unique_id = 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_drive_mount_point_name_unique_id_None(self):\n try:\n tmpdir = mkdtemp()\n root = os.path.join(tmpdir, 'mnt/gluster-object')\n drive = 'test'\n\n _init_mock_variables(tmpdir)\n gfs._allow_mount_per_server = True\n self.assertT...
[ "0.8202178", "0.71788365", "0.69768405", "0.67600346", "0.659675", "0.6513326", "0.6325042", "0.62535024", "0.62465084", "0.62291175", "0.61986035", "0.61748713", "0.6147795", "0.61267954", "0.6116906", "0.6063496", "0.6041668", "0.6027162", "0.6020935", "0.6009902", "0.60019...
0.7969075
1
map key names in settings file to key names in HotKeys
def _translate_keyname(inp): convert = {'Equal': '=', 'Escape': 'Esc', 'Delete': 'Del', 'Return': 'Enter', 'Page_up': 'PgUp', 'Page_down': 'PgDn'} if inp in convert: out = convert[inp] else: out = inp return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupKeyMappings(self) :\n\t\t# first create keyMap object with default values\n\t\tself.keyMap = { \"left\":0, \"right\":0, \\\n\t\t\t\t\"forward\":0, \"backward\":0, \"dash\":0, \\\n\t\t\t\t\"slide-left\":0, \"slide-right\":0, \\\n \t\t\t\t\"cam-up\":0, \"cam-down\":0, \\\n\t\t\t\t\"cam-left\":0, \"cam-right...
[ "0.6528743", "0.6146608", "0.6123254", "0.6027307", "0.5847011", "0.5746393", "0.5736031", "0.57267994", "0.5722244", "0.57204807", "0.5720454", "0.56882066", "0.56624234", "0.5647908", "0.56392825", "0.5626465", "0.5624188", "0.5606162", "0.55517554", "0.5546671", "0.5544279...
0.0
-1
lees de keyboard definities uit het/de settings file(s) van het tool zelf en geef ze terug voor schrijven naar het csv bestand
def buildcsv(settnames, page, showinfo=True): shortcuts = collections.OrderedDict() fdesc = ("File containing keymappings", "File containing command descriptions") ## pdb.set_trace() for ix, name in enumerate(settnames): try: initial = page.settings[name] except KeyError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataSave():\n # NR5G = gui_reader()\n try: #Python3\n f = open(__file__ + \".csv\",'wt', encoding='utf-8')\n except:\n f = open(__file__ + \".csv\",'wb')\n f.write('%s,'%(entryCol.entry0.get()))\n f.write('%s,'%(entryCol.entry1.get()))\n f.write('%s,'%(entryCol.entry2.get()))\n ...
[ "0.58790845", "0.57085", "0.56216234", "0.5558641", "0.5554129", "0.5521753", "0.54928106", "0.54494387", "0.54430705", "0.54299235", "0.5418328", "0.54119194", "0.5343505", "0.5333444", "0.532513", "0.53054166", "0.53034294", "0.5302163", "0.5286992", "0.52804625", "0.528005...
0.63631856
0
specifics for extra panel
def add_extra_attributes(win): ## print(win.__dict__) win.keylist += ['Num' + x for x in string.digits] + ['>', '<'] win.contextslist = win.otherstuff['contexts'] win.contextactionsdict = win.otherstuff['actionscontext'] win.actionslist = win.otherstuff['actions'] win.descriptions = win.otherstu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hdri_adding_panel(self, context):\r\n \r\n AM = context.window_manager.asset_m\r\n layout = self.layout\r\n \r\n box = layout.box()\r\n row = box.row()\r\n row.prop(AM, \"existing_thumb\", text = \"Use existing Thumbnails\")\r\n \r\n row = box.row()\r\n row.label(\"Thumbnail exte...
[ "0.6022063", "0.60132813", "0.59916925", "0.5965154", "0.5920031", "0.5918263", "0.5831781", "0.5825664", "0.5774073", "0.575796", "0.5717596", "0.56632066", "0.56539726", "0.564417", "0.5628545", "0.56106246", "0.56101924", "0.5604618", "0.5584738", "0.55847", "0.5523856", ...
0.0
-1
Returns the graph complement of G.
def complement(G): R = G.__class__() R.add_nodes_from(G) R.add_edges_from(((n, n2) for n, nbrs in G.adjacency() for n2 in G if n2 not in nbrs if n != n2)) return R
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def complement(G):\n\n nset = set(G.nodes())\n n_nodes = G.order()\n n_edges = n_nodes * (n_nodes - 1) - G.size() + 1\n \n cmp_edges = ((u, v) for u in G.nodes()\n\t\t for v in nset - set(G.successors(u)))\n deg = make_deg(n_nodes, cmp_edges)\n cmp_edges = ((u, v) for u in G.nodes()\n\t\t ...
[ "0.8520391", "0.64977443", "0.64359856", "0.6389732", "0.6337305", "0.62457705", "0.6208965", "0.60704297", "0.60221344", "0.59848946", "0.5968795", "0.5959875", "0.59059066", "0.589863", "0.5895703", "0.5880331", "0.5879972", "0.58771133", "0.58479995", "0.58314204", "0.5827...
0.8689336
0
Returns the reverse directed graph of G.
def reverse(G, copy=True): if not G.is_directed(): raise nx.NetworkXError("Cannot reverse an undirected graph.") else: return G.reverse(copy=copy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_reversed_graph(directed_graph):\n\n reversed = directed_graph.__class__()\n for i in directed_graph.get_vertices().keys():\n reversed.add_vertex(i)\n\n for i in directed_graph.get_vertices().keys():\n vertex = directed_graph.get_vertex(i)\n for j in vertex.get_heads():\n ...
[ "0.7581556", "0.75628114", "0.7346692", "0.70150614", "0.6863429", "0.65913934", "0.64809585", "0.64787996", "0.643853", "0.63429785", "0.6326808", "0.62946874", "0.62814265", "0.627383", "0.62476474", "0.61388195", "0.6093543", "0.60812247", "0.6077702", "0.60706794", "0.605...
0.83771706
0
Reads an INIfile containing domain type definitions and fills them into a TypeDefsobject.
def readDomainTypes(self, domainTypeFilePath): result = TypeDefs() inifile = IniFile(domainTypeFilePath) for section in inifile.getSections(): if section.endswith("(n)"): td = TypeDef(section[:-3], withLength = True) else: td = TypeDef(sect...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_domain(self, domainfile):\n\n with open(domainfile) as dfile:\n dfile_array = self._get_file_as_array(dfile)\n #Deal with front/end define, problem, :domain\n if dfile_array[0:4] != ['(', 'define', '(', 'domain']:\n print('PARSING ERROR: Expected (define (domain ... at start of domain ...
[ "0.5692447", "0.56770426", "0.55325735", "0.5285232", "0.50543946", "0.4953483", "0.4840075", "0.48231658", "0.48218992", "0.4821366", "0.47643015", "0.47455364", "0.4673499", "0.4642409", "0.46207514", "0.46002218", "0.4586546", "0.4583959", "0.45795232", "0.4578879", "0.455...
0.7333319
0
write code back to directory, not the spec code
def writeCode(self,dir=""): for codefile in self.codestructures: codefile.writeCode(self.codeformatter,dir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeToFile(self, basedir, write_code=0):", "def writeSpec(self,dir=\"\"):\n for codestruct in self.codestructures:\n codestruct.writeSpec(dir)", "def write(self):\n # # Sometimes file is not written properly. So delete and rewrite it\n # os.system('rm {}'.format(snip_dir + ...
[ "0.7297589", "0.6704298", "0.6461738", "0.6427127", "0.6356845", "0.62959635", "0.6293319", "0.62514675", "0.6150123", "0.6071547", "0.60249424", "0.59400237", "0.58946234", "0.58486485", "0.57936925", "0.5743563", "0.57151085", "0.56687397", "0.56618214", "0.5659408", "0.565...
0.6584302
2
write spec back to directory, (if dir not specified is default spec dir)
def writeSpec(self,dir=""): for codestruct in self.codestructures: codestruct.writeSpec(dir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_change_dir_to_file(self):\n dir0, dir1 = self.make_temp_dirs(2)\n self.write_dir(dir0, \"foo\")\n self.sync_all()\n self.assertDirPresent(dir0, \"foo\")\n self.assertDirPresent(dir1, \"foo\")\n\n self.delete_dir(dir0, \"foo\")\n self.write_file(dir0, \"foo\...
[ "0.59088475", "0.5767855", "0.56413054", "0.54185474", "0.53972125", "0.5375559", "0.5354217", "0.5278695", "0.5238211", "0.52255595", "0.5221744", "0.5195567", "0.5194306", "0.5183714", "0.51730597", "0.5154644", "0.51394916", "0.51373714", "0.5113076", "0.5090471", "0.50892...
0.658977
0
read spec code and populate codestructures
def processSpecs(self): specSubDirName="_spec" codestructure = CodeStructure() for dir in self._dirs: if q.system.fs.exists(q.system.fs.joinPaths(dir,specSubDirName)): files=q.system.fs.listPyScriptsInDir(q.system.fs.joinPaths(dir,specSubDirName)) for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processSourceCode(self):\n specSubDirName=\"\"\n codestructure = CodeStructure() \n for dir in self._dirs:\n if q.system.fs.exists(q.system.fs.joinPaths(dir,specSubDirName)): \n files=q.system.fs.listPyScriptsInDir(q.system.fs.joinPaths(dir,specSubD...
[ "0.6069532", "0.602706", "0.5843338", "0.5768507", "0.5756641", "0.571061", "0.5692741", "0.5651732", "0.55933094", "0.5569754", "0.5564679", "0.5557777", "0.5535603", "0.54826546", "0.5445141", "0.5437613", "0.5425164", "0.535459", "0.53148675", "0.529252", "0.5287907", "0...
0.65098464
0
read source code and populate codestructures
def processSourceCode(self): specSubDirName="" codestructure = CodeStructure() for dir in self._dirs: if q.system.fs.exists(q.system.fs.joinPaths(dir,specSubDirName)): files=q.system.fs.listPyScriptsInDir(q.system.fs.joinPaths(dir,specSubDirName)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(source_code):\n tokens = tokenize(source_code)\n return read(tokens)", "def parse_main(self):\n self.decompiler = self.createDecompiler(self.compilerEnv)\n self.nf = IRFactory(self)\n self.currentScriptOrFn = self.nf.createScript()\n sourceStartOffset = self.decompiler...
[ "0.71463597", "0.65457433", "0.6436156", "0.63833", "0.617009", "0.6169049", "0.61645854", "0.6013546", "0.5984505", "0.5978225", "0.597422", "0.5926398", "0.59210396", "0.5920109", "0.58515805", "0.5847921", "0.58116406", "0.57947946", "0.5789077", "0.5787705", "0.5781246", ...
0.6231014
4
todo connect to db, insert data, handle errors
def add_to_db(name, country, catches): try: with sqlite3.connect(db_name) as db: cur = db.cursor() create_table() cur.execute('insert into chainsaw values (?,?,?)', (name, country, catches)) except sqlite3.Error as er: print('Changes being rolled back because ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_data(self):\n # Make a connexion with a mock database\n self.generate_data_collection()", "def insert_db():\n populate_tables()", "def insert_data():\n\tBase.metadata.drop_all(engine)\n\tBase.metadata.create_all(engine)\n\tu1 = insert_user(\"233@B.com\", \"/static/image/avatar.JPG\"...
[ "0.7211377", "0.693141", "0.6857348", "0.67883915", "0.67747855", "0.66680896", "0.65844685", "0.6545915", "0.6525444", "0.64385474", "0.6436744", "0.6404376", "0.63957894", "0.63482755", "0.6333015", "0.6330649", "0.63280785", "0.6319391", "0.6316546", "0.6313329", "0.630663...
0.0
-1
If the pipe is too short, the HagenPoiseuille equation may result in unphysically high flow rates; the flow
def bern_max_metric(pipe_diameter, delta_p): rho = 1000 # density of water kg/m^3 flow_rate_max = ((math.pi * (pipe_diameter**2)) / 4) * math.sqrt((2 * delta_p) / rho) return flow_rate_max
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Piping(T_in, p_in, m_dot, d_inner, l_pipe, f, epsilon_pipe, T_shield, N):\r\n\r\n ## Estimation of the influence of the arcs\r\n # Calculation according to VDI Heatatlas 2013\r\n # Assumption isoenthalpic flow\r\n state_Arc = FlowRestriction(T_in, p_in, m_dot, d_inner, f)\r\n p_Arc = state_Arc.g...
[ "0.6446182", "0.60636187", "0.6003516", "0.59648126", "0.5854791", "0.5832429", "0.5788334", "0.54462", "0.54144984", "0.5404328", "0.5350867", "0.5328617", "0.52919537", "0.5287042", "0.52654266", "0.52486366", "0.5230265", "0.5214893", "0.5213517", "0.5200162", "0.5170976",...
0.5857332
4
If the flow in the pipe is laminar, you can use the Poiseuille Equation to calculate the flow rate mu = 0.001 @ 25 degrees C Q = (pi (D4) delta_p) / (128 mu pipe_length)
def pois_metric(pipe_diameter, delta_p, pipe_length): mu = 0.001 # water @ 25 degrees C pois = mu * 10 flow_rate_lam = (math.pi * (pipe_diameter ** 4) * delta_p) / (128 * pois * pipe_length) return flow_rate_lam
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bern_metric(pipe_diameter, delta_p, pipe_length):\n fr_c = 0.003 # assuming Reynolds number is 10**5 and pipe material is smooth copper\n fr_reyn = 0.046 / (reynolds_num(pipe_diameter, delta_p, pipe_length) ** 0.2) # Taitel and Dukler approximation\n rho = 1000 # density of water @ 4 deg celsius (k...
[ "0.64306885", "0.6375345", "0.6155883", "0.6086178", "0.5807599", "0.57985467", "0.5757301", "0.5742598", "0.57329386", "0.57231694", "0.5673357", "0.56649464", "0.56552863", "0.55984855", "0.5589797", "0.55843973", "0.55824184", "0.5581834", "0.55515593", "0.5546592", "0.554...
0.7763178
0
For turbulent flow, we can use Bernoulli's Equation with a friction term. Assuming the pipe is horizontal, (delta_p / rho) + (velocity^2 / 2) = F where F accounts for friction heating and is given in terms of an empirical friction factor, fr.
def bern_metric(pipe_diameter, delta_p, pipe_length): fr_c = 0.003 # assuming Reynolds number is 10**5 and pipe material is smooth copper fr_reyn = 0.046 / (reynolds_num(pipe_diameter, delta_p, pipe_length) ** 0.2) # Taitel and Dukler approximation rho = 1000 # density of water @ 4 deg celsius (kg/m**3) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval_dryfriction():\n # Environment\n env = WAMBallInCupSim(num_dof=7, max_steps=1500)\n\n # Policy (random init)\n policy_hparam = dict(num_feat_per_dim=12, bounds=(np.array([0.0]), np.array([1.0])))\n policy = DualRBFLinearPolicy(env.spec, policy_hparam, dim_mask=2)\n\n # Do the rolllouts\n...
[ "0.58735925", "0.58659214", "0.58183104", "0.5818074", "0.5753325", "0.5712705", "0.5690621", "0.5683825", "0.56798863", "0.5655784", "0.56407523", "0.5617837", "0.56171685", "0.5589888", "0.5564685", "0.5555104", "0.555289", "0.5549329", "0.5536939", "0.55097634", "0.5494157...
0.58481055
2
Serve a file from the upload directory.
def download(path): return send_from_directory(UPLOAD_DIRECTORY, path, as_attachment=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uploaded_file(filename):\n return send_from_directory('/static/images/uploads/', filename)", "def uploaded_file(filename):\n return send_from_directory(app.config['UPLOAD_FOLDER'], filename)", "def uploaded_file(filename):\n return send_from_directory(app.config['UPLOAD_FOLDER'], filename)", "de...
[ "0.72789335", "0.7054051", "0.7054051", "0.7054051", "0.7007223", "0.69452924", "0.6715913", "0.6583728", "0.65780145", "0.65292954", "0.63780475", "0.6367171", "0.62917274", "0.6272483", "0.62396723", "0.62340975", "0.6162114", "0.6161394", "0.613007", "0.61287713", "0.60720...
0.561204
64
Create a Plotly Dash 'A' element that downloads a file from the app.
def file_download_link(filename): location = f"/{UPLOAD_DIRECTORY}/{filename}" return html.A(filename, href=location)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_download_link(filename):\n location = \"/download/{}\".format(urlquote(filename))\n return html.A(filename, href=location)", "def download_link(request, job_id, filename):\n template_values = remote_view_util.fill_job_values(request, job_id)\n template_values = remote_view_util.fill_template...
[ "0.6015341", "0.56226736", "0.55951804", "0.552248", "0.5511452", "0.5382601", "0.53783137", "0.53105325", "0.5288451", "0.52870387", "0.5222768", "0.5213722", "0.5212254", "0.5193048", "0.5184498", "0.5182813", "0.51763964", "0.51701194", "0.5161087", "0.5158966", "0.515461"...
0.61712605
0
Ground a node and look it up in the db
def query (node, grounding, db): return db.funcVal(grounding.groundNode(node))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_lookup(self, path, for_update=False):\n\n q = \"select node from nodes where path = ?\"\n self.execute(q, (path,))\n r = self.fetchone()\n if r is not None:\n return r[0]\n return None", "def get_node(self, key: str) -> Node:", "def get_node(cur, id):\n ...
[ "0.71134365", "0.6668859", "0.65132576", "0.6439901", "0.635995", "0.635122", "0.62648284", "0.62508345", "0.6188875", "0.6179738", "0.6151343", "0.6136216", "0.61359334", "0.61337614", "0.61033213", "0.609807", "0.6092274", "0.6070642", "0.6068153", "0.6040271", "0.6040146",...
0.63679963
4
Return a grounded node, with the value for its functor according to db
def fillNode(node, grounding, db): gn = copy.deepcopy(node) gn.val = query(gn, grounding, db) return gn
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query (node, grounding, db):\n return db.funcVal(grounding.groundNode(node))", "def _expr2bddnode(expr):\n\t# print(\"_expr2bddnode\")\n\tif expr.is_zero():\n\t\treturn BDDNODEZERO\n\telif expr.is_one():\n\t\treturn BDDNODEONE\n\telse:\n\t\ttop = expr.top\n\n\t\t# Register this variable\n\t\t_ = bddvar(to...
[ "0.6327783", "0.5721543", "0.552557", "0.54853195", "0.53288656", "0.5328032", "0.52322", "0.52084863", "0.5185801", "0.5182241", "0.51591873", "0.5155981", "0.51427555", "0.51391935", "0.5104471", "0.50723195", "0.5068302", "0.50631833", "0.50392216", "0.50341773", "0.502435...
0.5392836
4
Locate the value for a grounded node and its parents in a rule set, return 1 if not found. For functors with binary ranges, when all parents match but child's value does not, return 1prob for other value.
def ruleMatch (ruleSet, node, parents): def getProb (node): for rule in ruleSet: #print rule if (rule.child.eq(node) and len(rule.parentList)==len(parents) and all([n[0].eq(n[1]) for n in zip(rule.parentList,parents)])): #print "winning...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getValue(self):\n r = 1 if self.left.getValue() <= self.right.getValue() else 0\n return r", "def find(self, node):\n if not node:\n return 0\n\n left = self.find(node.left)\n right = self.find(node.right)\n cur = 1 # node.val\n path = 1\n i...
[ "0.5753097", "0.5747222", "0.57390654", "0.57036936", "0.56338394", "0.55915225", "0.5584634", "0.5555824", "0.5537557", "0.5537557", "0.5511906", "0.54953927", "0.5484709", "0.5481439", "0.5480224", "0.5455876", "0.5380829", "0.53786016", "0.53774273", "0.537409", "0.5355800...
0.62124074
0
Return default uniform distribution for the range of a functor
def default(functor): return 1.0/functorRangeSize(functor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _uniform(val_range):\r\n return np.random.uniform(val_range[0], val_range[1])", "def initializeDistribution(self):\n self.minVal = min(math.exp(self.upperBound),math.exp(self.lowerBound))\n self.maxVal = max(math.exp(self.upperBound),math.exp(self.lowerBound))", "def glorot_uniform(seed=None):\n ...
[ "0.67329484", "0.63917905", "0.634777", "0.63349366", "0.61998284", "0.61475074", "0.61413395", "0.6124729", "0.6119773", "0.61055756", "0.6086929", "0.6079064", "0.60665655", "0.6043183", "0.6039257", "0.5985008", "0.5984233", "0.59805816", "0.59690744", "0.59467566", "0.594...
0.7167602
0
Look up the range for a functor
def functorRange(functor): for (name, range) in functorRangeList: if functor == name: return range else: raise Exception ("Functor " + functor + " not present in range list")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _in_range_op(spec):", "def _range_func(self, withscores, score_cast_func, decode_value_func=lambda x: x):\n if withscores:\n return lambda score_member: (decode_value_func(score_member[1]), score_cast_func(self._encode(score_member[0]))) # noqa\n else:\n return lambda sco...
[ "0.68109703", "0.63385564", "0.6327256", "0.6227952", "0.62047696", "0.61920094", "0.61834943", "0.6165325", "0.6165325", "0.61133087", "0.61056334", "0.6076185", "0.60739946", "0.60496026", "0.6020257", "0.60012704", "0.6000408", "0.5993944", "0.5981103", "0.5969238", "0.591...
0.839487
0
Return cardinality of range for a functor
def functorRangeSize(functor): return len(functorRange(functor))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cardinality(self):\n estimate = self._alpha * math.pow(self._m, 2) / sum(math.pow(2, -x) for x in self._registers)\n\n if estimate <= 2.5 * self._m:\n # get number of registers equal to zero\n empty_registers = self._registers.count(0)\n if empty_registers != 0:\n...
[ "0.6364935", "0.6203069", "0.6184483", "0.6088533", "0.5999436", "0.5949017", "0.5914987", "0.5850817", "0.5838362", "0.58077663", "0.57850456", "0.56294644", "0.55813044", "0.5576867", "0.5546719", "0.55258554", "0.55099475", "0.5464677", "0.5460476", "0.54486597", "0.543011...
0.799879
0
For functors with a binary range, return the other element
def functorOtherValue(functor, val): range = functorRange(functor) assert len(range) == 2 if val == range[0]: return range[1] else: return range[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def functorRange(functor):\n for (name, range) in functorRangeList:\n if functor == name:\n return range\n else:\n raise Exception (\"Functor \" + functor + \" not present in range list\")", "def ranges(self, predicate):\n\n x = np.zeros(len(self)).astype(np.bool)\n f...
[ "0.6828715", "0.6507789", "0.62094086", "0.6026386", "0.5969396", "0.5849859", "0.5836691", "0.58243334", "0.57149607", "0.5674531", "0.5671843", "0.56514573", "0.56158537", "0.56145406", "0.55590016", "0.55359095", "0.5534223", "0.5493425", "0.54904515", "0.5454143", "0.5448...
0.75341356
0
Return the atoms, derived from the first entry in the joint probability table
def atomList(joints): assert len(joints) > 0 first = joints[0] functorList = first[1][:-2] # Second element of row, last two elements of that are joint prob and log prob atomList = [] for (node,_) in functorList: atomList.append(node.functor+"("+",".join(node.varList)+")") return atomLis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jointProbabilities(constants, db, ruleList, bn):\n vars = bn.variableList()\n combs = generateCombos(vars, constants)\n joints = []\n for grounding in combs:\n joints.append((grounding, bn.jointProbs(grounding, db, ruleList)))\n return (vars, atomList(joints), joints)", "def enumerate_j...
[ "0.594754", "0.5753266", "0.57007027", "0.5424559", "0.539321", "0.5265403", "0.52582085", "0.52560824", "0.5244419", "0.5229816", "0.5205455", "0.51626754", "0.51596713", "0.5148809", "0.51186013", "0.51104856", "0.51007", "0.50988847", "0.50907356", "0.5085001", "0.50847787...
0.63074166
0
Compute the joint probabilities for all combinations of values
def jointProbabilities(constants, db, ruleList, bn): vars = bn.variableList() combs = generateCombos(vars, constants) joints = [] for grounding in combs: joints.append((grounding, bn.jointProbs(grounding, db, ruleList))) return (vars, atomList(joints), joints)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def joint_proba(self, X):\n return self.weights * self._bernoulli(X)", "def joint_prob(network, assignment):\n prob = 1\n for a_key in assignment:\n conditions = []\n current = network[a_key]\n for parent in current['Parents']:\n conditions.append(True) if assignment[...
[ "0.6887764", "0.6807377", "0.6577042", "0.6448017", "0.64271957", "0.6388704", "0.621264", "0.61288685", "0.6084318", "0.60133076", "0.59769166", "0.59629256", "0.5954798", "0.5925714", "0.5911252", "0.5900835", "0.5882425", "0.5880176", "0.5865823", "0.5850093", "0.580452", ...
0.6838733
1
Generate all possible groundings (assignments of constants to variables)
def generateCombos(vars,constants): # SUPER NOT GENERALIZED---TOO LATE AT NIGHT FOR ME TO DO RECURSIVE ALGORITHMS assert len(vars) == 2 and len(constants) == 2 combs = [] for c1 in constants: for c2 in constants: combs.append(Grounding([(vars[0], c1), (vars[1], c2)])) return comb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ground_operator(self, op_name):\n op = self.domain.operators[op_name]\n self._set_operator_groundspace( op_name, op.variable_list.items() )\n for ground in self._instantiate( op_name ):\n # print('grounded', ground)\n st = dict(ground)\n gop = Operator(op_n...
[ "0.586086", "0.5699041", "0.5360215", "0.53582025", "0.53362375", "0.53046995", "0.5301871", "0.52834463", "0.521038", "0.51668525", "0.5156945", "0.51415384", "0.5131329", "0.51303786", "0.51272744", "0.51083404", "0.51081413", "0.5107868", "0.50947726", "0.5074924", "0.5066...
0.62475884
0
` Given a joint probability table, format it for LaTeX. This function will have to be tailored for every paper. This function simply generates the {tabular} part of the table. The prologue and epilogue, including the caption and label, must be specified in the including file.
def formatJointTableForLaTeX(joints): (varList, atoms, probs) = joints cols = len(varList) + len (probs[0][1]) with open("table1.tex","w") as out: out.write ("\\begin{tabular}{|" + "|".join(["c"]*(cols-2))+"||c|c|}\n") out.write ("\\hline\n") # Table header out.write (" & ".j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_latex_table(true_hmm, sampled_hmm_list, conf=0.95, dt=1, time_unit='ms', obs_name='force', obs_units='pN', outfile=None):\n\n # confidence interval\n for sampled_hmm in sampled_hmm_list:\n sampled_hmm.set_confidence(conf)\n # dt\n dt = float(dt)\n # nstates\n nstates = sampled...
[ "0.6535216", "0.6499372", "0.6494908", "0.6360739", "0.6058271", "0.605461", "0.60403585", "0.6008605", "0.59048015", "0.5904452", "0.59012544", "0.5884655", "0.58371955", "0.5809221", "0.5790608", "0.57705444", "0.576766", "0.57066625", "0.5678048", "0.56749755", "0.5656739"...
0.8194145
0
Take replay file from request Extract basic information about replay Return information to client or tell client data is invalid
async def accept_replay(request, game): game = game.lower() replay_file = request.files.get('replay') if replay_file: if game == STARCRAFT: load_map = request.args.get("load_map", False) result = await SC2Replay.analyze_replay(replay_file, load_map) if result: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def parse_replay(request, game):\n\n game = game.lower()\n replay_file = request.files.get(\"replay\")\n if replay_file:\n if game == STARCRAFT:\n basic, result = await SC2Replay.process_replay(replay_file, request.args.get(\"load_map\", False))\n if result:\n ...
[ "0.66388625", "0.6589973", "0.561222", "0.55880296", "0.55790913", "0.54335433", "0.53088397", "0.5289022", "0.52817225", "0.52215827", "0.51933885", "0.51402473", "0.5130604", "0.5128931", "0.5114549", "0.5101588", "0.50950605", "0.50752", "0.50751144", "0.50603235", "0.5057...
0.6063962
2
Take replay file that was uploaded to ObjectStore and process data and store it to database and link to account
async def parse_replay(request, game): game = game.lower() replay_file = request.files.get("replay") if replay_file: if game == STARCRAFT: basic, result = await SC2Replay.process_replay(replay_file, request.args.get("load_map", False)) if result: # Lets creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_to_restore(file_name, data):\n urlfetch.fetch(url=config.RESTORE_URL + '?name=' + file_name + '&source=db&packet',\n payload=urllib.urlencode({\"data\": services.event.entity_to_string(data)}),\n method=urlfetch.POST)", "def transfer(file_obj):", "def post_origin...
[ "0.59654164", "0.5942923", "0.58948725", "0.58847404", "0.5826352", "0.57525676", "0.5647753", "0.56387746", "0.5543896", "0.55360585", "0.5521623", "0.5506403", "0.5493576", "0.5484211", "0.54712117", "0.54331356", "0.5429796", "0.53877634", "0.5359096", "0.5353566", "0.5341...
0.62600714
0
_execute_ map the request name provided to an ID
def execute(self, requestName, conn = None, trans = False): self.sql = "SELECT request_id from reqmgr_request WHERE " self.sql += "request_name=:request_name" binds = {"request_name": requestName} reqID = self.dbi.processData(self.sql, binds, conn = conn, transaction = trans) res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _execute(self, _):\r\n pass", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):", "def getId(*args):"...
[ "0.55304587", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5463426", "0.5370444", "0.5351898", "0.53309184", "0.5321808", "0.5240275", "0.5239346", "0.52391875", "0.52137643",...
0.5936447
0
Update the matrix with the coordinates of the operation.
def update_matrix(self, ope, mat): ope_coord = [] for coord in self.coord_name: if np.isnan(ope[coord]): return ope_coord.append(int(ope[coord])) mat[tuple(ope_coord)] += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(mat) -> np.ndarray:\n return mat", "def update(self, row, col):\n self.update_m(row, col)\n self.update_ix(row, col)\n self.update_iy(row, col)", "def _UpdateCoords(self, new_coords):\n for i in range(self.mol.n_atoms):\n for j in range(const.NUMDIM):\n self.mo...
[ "0.64133954", "0.6272482", "0.6020012", "0.60073805", "0.59557956", "0.5955312", "0.5928968", "0.5921737", "0.590957", "0.586239", "0.58351856", "0.58159703", "0.579463", "0.5779063", "0.57384187", "0.57379836", "0.56909096", "0.56815416", "0.56763625", "0.5650514", "0.562645...
0.6219569
2
Use float16 for faster IO during training.
def save_float16_npy(data, path): np.save(path, data.astype(np.float16))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_use_bfloat16(configs, use_bfloat16):\n configs[\"train_config\"].use_bfloat16 = use_bfloat16", "def data_type():\n if FLAGS.use_fp16:\n return tf.float16\n else:\n return tf.float32", "def data_type():\n if FLAGS.use_fp16:\n return tf.float16\n else:\n return tf.float32...
[ "0.69121385", "0.65502363", "0.65130097", "0.647946", "0.6455792", "0.6408274", "0.63850254", "0.6354032", "0.63375044", "0.63351613", "0.6293508", "0.62589705", "0.6142071", "0.6129017", "0.60476065", "0.6029137", "0.59642065", "0.59619236", "0.5940161", "0.5863883", "0.5842...
0.7207755
0
Return if Persona object passed into args is in defaul componenti propperty
def has_componente(self, persona): return True if persona.pk in self.pks_componenti else False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def XCAFDoc_ShapeTool_IsComponent(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsComponent(*args)", "def IsComponent(*args):\n return _XCAFDoc.XCAFDoc_ShapeTool_IsComponent(*args)", "def __contains__(self, arg):\r\n\r\n return arg in self.grfx[0]", "def particleExists(*args, **kwargs)->bool:\n p...
[ "0.6626677", "0.6543731", "0.6026395", "0.60095984", "0.59585935", "0.5927557", "0.5893944", "0.5893944", "0.58926296", "0.5830509", "0.5820323", "0.57275677", "0.5694341", "0.56732976", "0.5672737", "0.5656124", "0.5637087", "0.5625537", "0.5621446", "0.5609848", "0.5569029"...
0.71104115
0
If an bundle is for native iOS, it has these properties in the Info.plist
def is_info_plist_native(plist): return ( 'CFBundleSupportedPlatforms' in plist and 'iPhoneOS' in plist['CFBundleSupportedPlatforms'] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ios_app_info(self) -> Optional[pulumi.Input['IosAppInfoArgs']]:\n return pulumi.get(self, \"ios_app_info\")", "def system_properties(self):\r\n return dict(self._get_system_properties(self.java))", "def ios_app_info(self) -> 'outputs.IosAppInfoResponse':\n return pulumi.get(self, \"ios_app...
[ "0.550685", "0.5398409", "0.5094902", "0.5077413", "0.5070626", "0.505988", "0.5054438", "0.49296305", "0.49282697", "0.48895228", "0.48720244", "0.48373243", "0.48084444", "0.48046267", "0.4804201", "0.47875956", "0.47442275", "0.47442275", "0.47250745", "0.4656228", "0.4646...
0.6288776
0