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
Utilities for spatio temporal analysis zed.uchicago.edu For pairwise model generation; pick only the nearest neighbors to track of a point and create models of it
def generateNeighborMap(self): A=[] for key,value in self._ts_dict.iteritems(): A.append(np.array([i.replace("#"," ") .split()[0:4] for i in value.index]) .astype(float)) B=np.array(A[0]).reshape(len(A[0]),4) print (B[:,0]+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closest_points(point, points, nn=1):\n\n eu_dsts = point - points\n eu_dsts = np.sqrt((eu_dsts * eu_dsts).sum(axis=1))\n n_ids = np.argsort(eu_dsts)\n out_points = np.zeros(shape=(nn, 3))\n for i in range(nn):\n out_points[i] = points[n_ids[i], :]\n return out_points", "def create_po...
[ "0.5707754", "0.5542335", "0.5489949", "0.5440589", "0.53954345", "0.5356737", "0.53348047", "0.5333644", "0.532608", "0.53175616", "0.53087217", "0.5277371", "0.5273548", "0.5270412", "0.5265518", "0.52623814", "0.5237282", "0.5209064", "0.51936203", "0.5169329", "0.51646906...
0.0
-1
plot global distribution of events within time period specified Inputs
def showGlobalPlot(self,fsize=[14,14],cmap='jet',m=None,figname='fig'): fig=plt.figure(figsize=(14,14)) # read in data to use for plotted points A=[] for key,value in self._ts_dict.iteritems(): A.append(np.array([i.replace("#"," ") .split()[0:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pixel_ts_distribution(self):\n fig,ax = plt.subplots(figsize=(8,6))\n bins = np.linspace(0,25,501)\n tsvec=self.tsmap.vec\n ax.hist(tsvec, bins, log=True, histtype='step', lw=2, cumulative=-1, label='data');\n # make array corresponding to the hist\n h = np.histogram(t...
[ "0.6123722", "0.6043641", "0.58373654", "0.57921237", "0.5719745", "0.57124525", "0.56260604", "0.5591529", "0.5584743", "0.557683", "0.5535808", "0.55103", "0.55076784", "0.54803574", "0.54626095", "0.5461081", "0.5432566", "0.54265696", "0.54216766", "0.54160786", "0.540530...
0.0
-1
Utility function zed.uchicago.edu Converts list into string separated by dashes or empty string if input list is not list or is empty
def stringify(List): if List is None: return '' if not List: return '' return '-'.join(str(elem) for elem in List)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_to_string(in_list):\n if not in_list:\n return \"[]\"\n else:\n return \"\\n- \" + \"\\n- \".join(in_list)", "def list_to_str( L ):\n if len(L) == 0: return ''\n return L[0] + list_to_str( L[1:] )", "def list_to_str( L ):\n if len(L) == 0: return ''\n return L[0] + list_to_str(...
[ "0.7693768", "0.6974077", "0.6974077", "0.6955682", "0.6715619", "0.6706818", "0.66814554", "0.6577999", "0.6566847", "0.65541935", "0.65537137", "0.65157914", "0.6480404", "0.64604145", "0.6455032", "0.6404342", "0.63729745", "0.63619614", "0.63449293", "0.6314343", "0.62951...
0.7753648
0
Utilities for spatio temporal analysis zed.uchicago.edu Reads in output TS logfile into pd.DF and then outputs necessary CSV files in XgenESeSSfriendly format Input
def readTS(TSfile,csvNAME='TS1',BEG=None,END=None): dfts=pd.read_csv(TSfile,sep=" ",index_col=0) dfts.columns = pd.to_datetime(dfts.columns) cols=dfts.columns[np.logical_and(dfts.columns >= pd.to_datetime(BEG), dfts.columns <= pd.to_datetime(END))] dfts=dfts[cols]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataset(subs_list, indexing=True):\n\n S = None\n print(f'\\nProcess - {current_process().name} has {len(subs_list)} files to work on.\\n')\n\n try:\n start = time()\n repo = (Subject(sub) for sub in subs_list)\n for sub in repo:\n S = sub\n for i in r...
[ "0.58780235", "0.5840372", "0.58105165", "0.5806595", "0.5803117", "0.5729501", "0.56970805", "0.5673466", "0.56693894", "0.5664184", "0.5662434", "0.5633177", "0.562404", "0.55828017", "0.5571171", "0.5557831", "0.5554224", "0.55407476", "0.5506054", "0.5502374", "0.548554",...
0.55022866
20
Utilities for spatio temporal analysis zed.uchicago.edu Writes out each row of the pd.DataFrame as a separate CSVfile For XgenESeSS binary No I/O
def splitTS(TSfile,csvNAME='TS1',dirname='./',prefix="@", BEG=None,END=None): dfts=pd.read_csv(TSfile,sep=" ",index_col=0) dfts.columns = pd.to_datetime(dfts.columns) cols=dfts.columns[np.logical_and(dfts.columns >= pd.to_datetime(BEG), dfts.columns <= pd.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_csv(df: pd.DataFrame, name: str, time_series=False) -> None:\n abs_dir = os.path.dirname(__file__)\n if time_series:\n rel_dir = os.path.join(abs_dir, 'eikon_time_series_files')\n else:\n rel_dir = os.path.join(abs_dir, 'eikon_data_files')\n path = ''.join([rel_dir, '/' + name])\n\...
[ "0.662147", "0.66056687", "0.64890814", "0.6471857", "0.6447726", "0.6424269", "0.64069694", "0.6400947", "0.63799506", "0.63763857", "0.63729095", "0.63496006", "0.63397557", "0.6312564", "0.6295084", "0.6286356", "0.6265861", "0.6253045", "0.6251188", "0.62434536", "0.62170...
0.0
-1
Utilities for storing and manipulating XPFSA models inferred by XGenESeSS zed.uchicago.edu Selects the N top models as ranked by var specified value (in reverse order if reverse is True) Inputs
def select(self,var="gamma",n=None,reverse=False, store=False, outFile="modelselection.json"): some_model = [val for val in self._models.values()[:1]] assert var in some_model[0].keys(), \ "Error: Model parameter specified not valid" this_dict = {value[var]:key for key, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_model_ranking(self, pos, var):\n x = []\n keys = []\n for k in self.pos:\n if (self.pos[k] == pos) & ('_' + var + '_' in k):\n x.append(self.data[k])\n keys.append(k[:k.index(var) - 1]) # model name\n\n x = np.asarray(x)\n keys =...
[ "0.5920686", "0.5876782", "0.58111525", "0.58068573", "0.5769203", "0.57331395", "0.5698059", "0.56730765", "0.55201364", "0.55091244", "0.54951775", "0.54919577", "0.54321176", "0.5391369", "0.53734744", "0.536808", "0.5328299", "0.5325843", "0.53122205", "0.53112197", "0.52...
0.5154817
25
Utilities for storing and manipulating XPFSA models inferred by XGenESeSS zed.uchicago.edu Calculates the distance between all models and stores them under the distance key of each model; modifies instance in place No I/O
def augmentDistance(self): for key,value in self._models.iteritems(): src=[float(i) for i in value['src'].replace('#',' ').split()] tgt=[float(i) for i in value['tgt'].replace('#',' ').split()] dist = haversine((np.mean(src[0:2]),np.mean(src[2:])), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_train(self):\n\n for self.epoch in range(self.args.epochs):\n # switch to train mode\n self.set_train()\n data_loading_time = 0\n gpu_time = 0\n before_op_time = time.time()\n\n for batch_idx, inputs in enumerate(self.train_loade...
[ "0.5727781", "0.55241746", "0.55023146", "0.5344562", "0.5287414", "0.5233412", "0.5179906", "0.51727074", "0.5120181", "0.51190937", "0.5085125", "0.5083492", "0.50830466", "0.50505143", "0.5047023", "0.5040699", "0.50249517", "0.50155187", "0.50076103", "0.49986377", "0.499...
0.6418641
0
Utilities for storing and manipulating XPFSA models inferred by XGenESeSS zed.uchicago.edu Writes out updated models json to file Input
def to_json(outFile): with open(outFile, 'w') as outfile: json.dump(self._models, outfile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeModel(self):\n\n # Get the script\n modelScript = os.path.join(self.datapath, 'make3FGLxml.py')\n if not os.path.isfile(modelScript):\n # download it\n print(\"\\t=== Downloading make3FGLxml.py ===\")\n os.system('wget https://fermi.gsfc.nasa.gov/ssc/da...
[ "0.6173078", "0.60120565", "0.5975275", "0.5885461", "0.5875494", "0.5873646", "0.58637625", "0.584942", "0.5823678", "0.58222973", "0.5819418", "0.5815936", "0.5812336", "0.5801755", "0.57986027", "0.5793235", "0.57837665", "0.5778584", "0.575814", "0.575188", "0.5745891", ...
0.0
-1
Method collects all biom permissions of current action with default values and permission type
def collect_all_perms(cls): permissions = filter(lambda perm: perm.startswith('biom_perm') or perm.startswith('entity_perm'), dir(cls)) result = [{ 'perm_name': perm, 'description': getattr(cls, perm).__doc__, 'perm_type': getattr(cls, perm).action_type if hasattr(ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_permissions(self):\n try:\n # return permission_classes depending on `action`\n return [permission() for permission in self.permission_action\n [self.action]]\n except KeyError:\n # action is not set return default permission_classes\n ...
[ "0.714981", "0.714981", "0.6895174", "0.6862876", "0.68085474", "0.6785352", "0.6735046", "0.6719133", "0.67098784", "0.67098784", "0.6702679", "0.66938925", "0.668023", "0.668023", "0.66758317", "0.66377646", "0.6611043", "0.66060686", "0.6586158", "0.6580176", "0.65646994",...
0.6783265
6
Make sure login and logout works.
def test_login_logout(self): rv = login(self.client, app.config['USERNAME'], app.config['PASSWORD']) self.assertTrue(b'Play' in rv.data) rv = logout(self.client) self.assertTrue(b'Sign In' in rv.data) rv = login(self.client, app.config['USERNAME'] + 'x', app.config['PASSWORD']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ttest_login_logout(self):\n rv = self.login(\n app.config['USERNAME'],\n app.config['PASSWORD']\n )\n assert b'You were logged in' in rv.data\n rv = self.logout()\n assert b'You were logged out' in rv.data\n rv = self.login(\n app.confi...
[ "0.7865821", "0.781352", "0.7775909", "0.7647303", "0.74561095", "0.7432088", "0.7389897", "0.73577553", "0.73564583", "0.73248774", "0.73198557", "0.72890925", "0.72614825", "0.7247851", "0.7239363", "0.7235257", "0.72166586", "0.72166586", "0.72002006", "0.7142968", "0.7130...
0.77306336
3
Assesses the model with n_iter different sets of parameters through crossvalidation, choose the best one, train it on the train data and predicts on the test data.
def make_prediction(pipe, X_train, y_train, X_test): param_grid = {'svc__C': stats.uniform(loc=0, scale=10), 'svc__decision_function_shape': [None, 'ovo', 'ovr'], 'svc__shrinking': [True, False] } rand = RandomizedSearchCV(pipe, param_grid, cv=5, scoring='ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self,\n X_train,\n y_train, \n X_test, \n y_test,\n max_evals,\n **kwargs,\n ):\n \n self.max_evals = max_evals\n \n for key in self.models_dict.keys():\n \n path_model_dir = self....
[ "0.7250705", "0.7142707", "0.6941888", "0.6888644", "0.6884445", "0.6816108", "0.679953", "0.67979425", "0.6753174", "0.67356896", "0.671182", "0.6653014", "0.66369843", "0.6635218", "0.6623897", "0.65718347", "0.6570627", "0.65526783", "0.65389687", "0.6513162", "0.65088755"...
0.0
-1
Path of the directory that stores all the instances.
def instance_dir(self): return os.path.join(self.basedir, self.yml['instdir'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _InstanceDir(cls, instance_name):\n return utils.PathJoin(cls._ROOT_DIR, instance_name)", "def store_path(self):\n return path.join(env.store_home, self._store_path)", "def data_directory(self):\n\n return self.get_raw(\"data_directory\")", "def path(self):\n return self._containe...
[ "0.78036046", "0.7167195", "0.702", "0.6844666", "0.6840358", "0.6783134", "0.676215", "0.6758423", "0.67428887", "0.6675447", "0.6670271", "0.66667795", "0.66445255", "0.66307175", "0.66128314", "0.6605219", "0.6593088", "0.6589724", "0.6554919", "0.65276265", "0.6510622", ...
0.7848447
0
Collects all successful runs and optionally parses their output.
def collect_successful_results(self, parse_fn=None): def successful_runs(verbose=False): for run in self.discover_all_runs(): finished = os.access(run.output_file_path('status'), os.F_OK) if not finished: if verbose: print("Skipping unfinished run {}/{}[{}]".format(run.experiment.name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_output(self):\n pass", "def collect_output(self):\n pass", "def task_parse_results():\n pass", "def __parse_success(self, fullname, results):\n match = NUMBER_PASSED_RE.match(results[0])\n if not match:\n raise ValueError(\"All passed line incorrect: '%s'...
[ "0.6443427", "0.6443427", "0.6302049", "0.6148188", "0.6071832", "0.6046133", "0.5980672", "0.59162134", "0.5890119", "0.58879757", "0.58761954", "0.5875161", "0.5846488", "0.5807116", "0.57725614", "0.57704043", "0.5761875", "0.57333165", "0.57006025", "0.5662879", "0.565996...
0.7599388
0
Exports experiments based on their status.
def export_experiments(self, included_statuses=None): experiment_list = [] if included_statuses is not None: for run in self.discover_all_runs(): status = run.get_status() if status in included_statuses: experiment_list.append(( run.experiment.name, tuple(variant.name for variant in run...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_comparisons(self):\n print(\"Exporting comparisons:\")\n\n return", "def run(self,\n example_input : Union[str,Path,None] = None) -> EasyDict :\n outputs = []\n ok = True\n for export_config in self.export_configs :\n exporter = create_exporter(...
[ "0.5686498", "0.5624677", "0.5623435", "0.5498768", "0.546386", "0.5412859", "0.53924197", "0.5347752", "0.53329897", "0.53323716", "0.52957964", "0.5271474", "0.5201375", "0.5200578", "0.5200364", "0.5186541", "0.5160601", "0.51597124", "0.51319706", "0.5105871", "0.5100903"...
0.67712706
0
devbuilds only have a source directory instead of a repo and clone directory
def source_dir(self): assert self.revision.is_dev_build rev = self._get_dev_build_suffix() return os.path.join(self._cfg.basedir, 'develop', self.name + rev)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fork(args):\n subprocess.check_call([\"git\", \"config\", \"--global\",\n \"--add\", \"safe.directory\", args.src])\n head = subprocess.check_output([\"git\", \"rev-parse\", args.rev], cwd=args.src).strip()\n obj_dir = subprocess.check_output([\"git\", \"rev-parse\", \"--git-...
[ "0.6243398", "0.6228782", "0.6211728", "0.62041354", "0.6192375", "0.61694247", "0.6141966", "0.60571873", "0.60399204", "0.6031721", "0.6004611", "0.5989618", "0.5989434", "0.59862226", "0.5955796", "0.59555477", "0.5943259", "0.5915231", "0.5878496", "0.58773404", "0.587551...
0.67784536
0
Only account balance detail report
def default_get(self, fields): defaults = super(ExportBalanceDetailWizard, self).default_get(fields) active_model = self._context.get('active_model', False) active_id = self._context.get('active_id', False) if active_model and active_id: general_ledger = self.env[active_model...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_bank_account_details(self) -> None:\n Menu.prompt_view_bank_account_details()\n print(\"Bank Account Details:\")\n print(self.user.account)\n\n for tx_num, tx_details in \\\n self.user.tx_manager.transaction_records.items():\n print(f\"\\nTransaction #...
[ "0.7012718", "0.6964789", "0.6946847", "0.67337406", "0.67311573", "0.6661313", "0.66381043", "0.6633519", "0.66310024", "0.659897", "0.65527236", "0.6493311", "0.6437109", "0.63235724", "0.6307414", "0.63025016", "0.6263153", "0.62554604", "0.625527", "0.62519646", "0.618655...
0.0
-1
Only account balance detail report
def _compute_is_account_balance_detail_template(self): self.ensure_one() template = self.env.ref( 'pabi_general_ledger_extension.account_balance_detail_template') self.is_account_balance_detail_template = False if self.template_id == template: self.is_account_bala...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_bank_account_details(self) -> None:\n Menu.prompt_view_bank_account_details()\n print(\"Bank Account Details:\")\n print(self.user.account)\n\n for tx_num, tx_details in \\\n self.user.tx_manager.transaction_records.items():\n print(f\"\\nTransaction #...
[ "0.7012718", "0.6964789", "0.6946847", "0.67337406", "0.67311573", "0.6661313", "0.66381043", "0.6633519", "0.66310024", "0.659897", "0.65527236", "0.6493311", "0.6437109", "0.63235724", "0.6307414", "0.63025016", "0.6263153", "0.62554604", "0.625527", "0.62519646", "0.618655...
0.6018376
35
Only account balance detail report
def _compute_move_line(self): self.move_line_ids = False if self.is_account_balance_detail_template: TB = self.env['account.general.ledger.report'] _x, moves = TB._get_moves(self.fiscalyear_id.id, self.target_move, self.reconcile_cond, self.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_bank_account_details(self) -> None:\n Menu.prompt_view_bank_account_details()\n print(\"Bank Account Details:\")\n print(self.user.account)\n\n for tx_num, tx_details in \\\n self.user.tx_manager.transaction_records.items():\n print(f\"\\nTransaction #...
[ "0.7012718", "0.6964789", "0.6946847", "0.67337406", "0.67311573", "0.6661313", "0.66381043", "0.6633519", "0.66310024", "0.659897", "0.65527236", "0.6493311", "0.6437109", "0.63235724", "0.6307414", "0.63025016", "0.6263153", "0.62554604", "0.625527", "0.62519646", "0.618655...
0.0
-1
Constructor for the TemplateWithIdPreview class
def __init__(self, primary_language=None, secondary_language=None, xml_signature=None, additional_properties = {}): # Initialize members of the class self.primary_language = primary_language self.secondary_language = se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, id):\n \n self.id = id", "def __init__(self,\n id: str) -> None:\n self.id = id", "def __init__(self,\n id: str) -> None:\n self.id = id", "def __init__(self,\n id: str) -> None:\n self.id = id", "def __in...
[ "0.62204456", "0.6166899", "0.6166899", "0.6166899", "0.6166899", "0.6128319", "0.6017259", "0.59618884", "0.59618884", "0.59460723", "0.5944425", "0.5929474", "0.5929474", "0.5929474", "0.5929474", "0.5845104", "0.5818631", "0.581609", "0.581609", "0.5777787", "0.5777787", ...
0.0
-1
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary primary_language = dictionary.get('PrimaryLanguage') secondary_language = dictionary.get('SecondaryLanguage') xml_signatur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407"...
0.788838
10
This func is to select a series of dots with mouse. It is selected from the shown curve.
def sf_dotset(): global fig,ax,ss,statusL,statusM,axh,axv #get the handle of figure and axis fig=plt.gcf() ax=plt.gca() statusL,statusM=None,None ss=[] print 'Drawing a line, you should select at least 2 points' # def onmouse(event): global fig,ax,ss,statusL,statusM,axh,axv ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selectPointsUnderCursor(self):\n #spw = self.spw\n #sw = spw.windows['Sort']\n #if clear:\n # sw.uslist.clearSelection()\n # sw.nlist.clearSelection()\n x, y = self.cursorPosGL()\n sids = self.pick(x, y, pb=10, multiple=True)\n if sids == None:\n ...
[ "0.7041565", "0.7023079", "0.6246638", "0.62356895", "0.62014484", "0.61904097", "0.6099179", "0.609854", "0.6074863", "0.6068525", "0.60472685", "0.5994338", "0.59378636", "0.5905589", "0.59030867", "0.581273", "0.5783279", "0.57704127", "0.5756903", "0.5746277", "0.57343125...
0.58463234
15
Initialize an Agent object.
def __init__(self, state_size, action_size, seed): self.state_size = state_size self.action_size = action_size self.seed = random.seed(seed) # Q-Network self.qnetwork_local = QNetwork(state_size, action_size, seed).to(device) self.qnetwork_target = QNetwork(state_size, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, agent: AEA) -> None:\n self._agent = agent\n super().__init__()", "def agent_init(self):\n pass", "def __init__(self, env, agent, agent_config, remote=None):\n self.env = Environment(env)\n self.episodes = 1000\n self.remote = remote\n\n if re...
[ "0.78424275", "0.7698366", "0.7576744", "0.75063956", "0.7380445", "0.7162815", "0.6989959", "0.6956423", "0.69451666", "0.6873446", "0.6822198", "0.6817786", "0.6772045", "0.67031044", "0.66557187", "0.6651313", "0.6629612", "0.66007495", "0.6569908", "0.65372974", "0.652172...
0.0
-1
Adds the current stateaction value to the memory and lets the agent learn if UPDATE_EVERY many steps are taken and the memory has more entries then BATCH_SIZE.
def step(self, state, action, reward, next_state, done): # Save experience in replay memory self.memory.add(state, action, reward, next_state, done) # Learn every UPDATE_EVERY time steps. self.t_step = (self.t_step + 1) % PARAM.UPDATE_EVERY if self.t_step == 0: if le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, action): \n self.memory.pop(-1) \n self.memory.insert(0, [self.last_state.cpu().numpy(), action.cpu().numpy()])\n\n self.last_action = action", "def _add_to_memory(self, state, action, next_state, reward, done):\n if len(self.memory) >= self.size_max_memory:\n ...
[ "0.7732924", "0.73804665", "0.7167032", "0.7005231", "0.69732106", "0.69556653", "0.6837309", "0.6820877", "0.6817679", "0.6776465", "0.67520034", "0.67520034", "0.67520034", "0.67520034", "0.67520034", "0.67520034", "0.67520034", "0.67520034", "0.67520034", "0.67520034", "0....
0.66679215
24
Returns actions for given state as per current policy.
def act(self, state, eps=0.): state = torch.from_numpy(state).float().unsqueeze(0).to(device) self.qnetwork_local.eval() with torch.no_grad(): action_values = self.qnetwork_local(state) self.qnetwork_local.train() # Epsilon-greedy action selection if random.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getActions(self, state): \n util.raiseNotDefined()", "def get_available_actions(self, state):\n pass", "def getLegalActions(self, state):\n return self.actionFn(state)", "def getLegalActions(self,state):\n return self.actionFn(state)", "def get_actions(self, state: TState...
[ "0.81847", "0.78752404", "0.77772415", "0.77585727", "0.7377628", "0.73220915", "0.72467107", "0.72087854", "0.7112076", "0.71091956", "0.7075793", "0.706494", "0.70488673", "0.7009308", "0.7006878", "0.69928527", "0.6989333", "0.69823205", "0.6970077", "0.695084", "0.6893704...
0.0
-1
Gets the stateaction value of the target network. That is, the current estimate of the target network for the next state including the seen reward.
def get_dqg_target(self, next_states, rewards, gamma, dones): # Get predicted Q values qtarget_values = self.qnetwork_target(next_states).detach() # get max of it best_qtarget_value = qtarget_values.max(1) # reduce one dimension best_qtarget_value = best_qtarget_value[0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state_action_value(self, state, action):\n state_tensor = torch.from_numpy(state).float().to(self.device)\n output = torch.dot(self.weights[action,:],state_tensor.view(-1))\n return output", "def get_value(self, state):\n epsilon = self.epsilon\n possible_actions = self...
[ "0.74637866", "0.738342", "0.7381812", "0.72057045", "0.7147627", "0.7144865", "0.7104878", "0.7084618", "0.7046648", "0.7013591", "0.69931084", "0.6982195", "0.69723356", "0.69467", "0.6917595", "0.69127136", "0.68956476", "0.68674845", "0.67943704", "0.67933476", "0.6788547...
0.0
-1
Update value parameters using given batch of experience tuples.
def learn(self, experiences, gamma): states, actions, rewards, next_states, dones = experiences Q_targets = self.get_dqg_target(next_states, rewards, gamma, dones) # Get expected Q values q_exp = self.qnetwork_local(states) # gets the q values along dimention 1 according to t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, values: List[int]) -> None:\n ...", "def update(self, values: List[int]) -> None:\n ...", "def update(self, values):\n pass", "def update(self, batch):\n for experience in batch:\n # First calculate the expected future reward from the final state\n ...
[ "0.6765197", "0.6765197", "0.6508957", "0.6346006", "0.62429523", "0.62217015", "0.6117239", "0.6103772", "0.6048167", "0.6005078", "0.5968958", "0.5968552", "0.59434044", "0.5935012", "0.5893864", "0.58876216", "0.5860463", "0.585012", "0.5819268", "0.5778017", "0.57520366",...
0.0
-1
drawing original & divided 8 imgs.
def draw_img_old(original, bit_imgs, title, sub_title): fig = plt.figure(figsize=(17, 7)) fig.suptitle(title) for i in range(1,10): if i == 1: ax = fig.add_subplot(2, 5, i) ax.imshow(original, cmap='gray') ax.set_title(sub_title) elif i < 6: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayImg(self):\r\n\r\n\t# If you want to skip n frames, set value to 0 to see all images\r\n\tSKIP = 4500\r\n for idx in range(len(self.centers)):\r\n\t if idx < SKIP:\r\n\t\tcontinue\r\n file_left = self.lefts[idx][5]\r\n file_center = self.centers[idx][5]\r\n fil...
[ "0.63771784", "0.6351863", "0.609269", "0.60603905", "0.60569733", "0.6042662", "0.60385704", "0.60364", "0.6027411", "0.6017766", "0.5995479", "0.59777516", "0.5974092", "0.59739196", "0.59285754", "0.59271795", "0.5926349", "0.5906782", "0.5906068", "0.59037554", "0.5899282...
0.6305598
2
drawing original & divided 8 imgs.
def draw_img(original, bit_imgs, title, sub_title): fig, axs = plt.subplots(nrows=2, ncols=5, figsize=(17, 7)) fig.suptitle(title) print(axs.shape) # (2,5) img_number = 8 for i, ax in enumerate(axs): for j, a in enumerate(ax): img_number -= 1 if i == 0 and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayImg(self):\r\n\r\n\t# If you want to skip n frames, set value to 0 to see all images\r\n\tSKIP = 4500\r\n for idx in range(len(self.centers)):\r\n\t if idx < SKIP:\r\n\t\tcontinue\r\n file_left = self.lefts[idx][5]\r\n file_center = self.centers[idx][5]\r\n fil...
[ "0.63771784", "0.6351863", "0.6305598", "0.609269", "0.60603905", "0.60569733", "0.6042662", "0.60385704", "0.6027411", "0.6017766", "0.5995479", "0.59777516", "0.5974092", "0.59739196", "0.59285754", "0.59271795", "0.5926349", "0.5906782", "0.5906068", "0.59037554", "0.58992...
0.60364
8
Calculates the correlation coefficients between columns. Displays them in descending order of their absolute values.
def correlation(data, method, caption): columns = list(data) coefficients = data.astype(float).corr(method=method) results = [] for i in range(len(columns)): for j in range(i + 1, len(columns)): coefficient = coefficients[columns[i]][columns[j]] results.append(( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correlate_columns(matrix):\n return np.dot(matrix.T, matrix) / (la.norm(matrix) ** 2)", "def get_correlation(df):\n frame_correlation = df.corr()\n return frame_correlation", "def _calculate_correlation(self, anomaly):\n if self.silence_level <= 1:\n print(\"Calculating partial c...
[ "0.684586", "0.6635547", "0.6557074", "0.65286785", "0.6519738", "0.63619393", "0.63094735", "0.6283914", "0.62756026", "0.627133", "0.62701637", "0.62639886", "0.6246803", "0.6214507", "0.620774", "0.6157019", "0.6151323", "0.6137466", "0.61353064", "0.6128442", "0.61145526"...
0.76043904
0
Checks if a column exists in a given table.
def table_has_column(table: str, column: str) -> bool: config = op.get_context().config engine = engine_from_config( config.get_section(config.config_ini_section), prefix="sqlalchemy." ) insp = reflection.Inspector.from_engine(engine) try: return any(col["name"] == column for col in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_column(self, column_name, table, verbose=True): \n assert(self.connected)\n try: \n assert(self.check_table(table, verbose=False)) \n except AssertionError: \n raise TableNotFoundError\n \n \n CHECK_COLUMN_COMMAND = \"SHOW COLUMNS F...
[ "0.8527261", "0.8314371", "0.8096708", "0.80846864", "0.77050006", "0.76575935", "0.73856586", "0.7372754", "0.73057866", "0.73057866", "0.7105575", "0.6965715", "0.68270487", "0.67641026", "0.6658639", "0.6497775", "0.6388615", "0.6200891", "0.6199939", "0.61866385", "0.6141...
0.82262325
2
Generate new UUIDs for all rows in a table
def assign_uuids( model: Any, session: Session, batch_size: int = DEFAULT_BATCH_SIZE ) -> None: bind = op.get_bind() table_name = model.__tablename__ count = session.query(model).count() # silently skip if the table is empty (suitable for db initialization) if count == 0: return sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def function_uuid():\r\n yield uuid.uuid4()", "def _generate_uuid(self):\n\n return uuid.uuid4()", "def generate_uuids():\n uuid_start = str(uuid())\n while uuid_start.startswith(\"zzzzzzzz\"):\n uuid_start = str(uuid())\n uuid_end = list(deepcopy(uuid_start))\n \n char_pool = l...
[ "0.6252362", "0.6069835", "0.60602546", "0.6031163", "0.5899798", "0.58836985", "0.58688223", "0.58331877", "0.5799059", "0.5787476", "0.57632875", "0.5743339", "0.5730291", "0.57265776", "0.57037145", "0.5674246", "0.5665568", "0.5646195", "0.56417024", "0.56417024", "0.5639...
0.65638924
0
Update models in small batches so we don't have to load everything in memory.
def paginated_update( query: Query, print_page_progress: Optional[Union[Callable[[int, int], None], bool]] = None, batch_size: int = DEFAULT_BATCH_SIZE, ) -> Iterator[Any]: start = 0 count = query.count() session: Session = inspect(query).session if print_page_progress is None or print_page_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_batch(self, *args, **kwargs):\n pass", "async def update_model(model_updates):\n async for model_update in model_updates:\n model_location = model_update['model_location']\n print(f\"Updating model to: {model_location}\")\n\n # using incrementing version number to keep t...
[ "0.6971209", "0.69643724", "0.6669123", "0.65299875", "0.6319953", "0.630288", "0.62560856", "0.61606365", "0.61049205", "0.61014456", "0.6087547", "0.607247", "0.6053315", "0.6040206", "0.60398704", "0.60339373", "0.6004137", "0.5917219", "0.5912759", "0.5912155", "0.5853216...
0.0
-1
Starts the move process
def callback_queue(self, data): global command_flag, current_command #grab action command action = data.action #Discards pending messages and null/invalid messages if action.split(' ')[0] in riu.valid_cmds and not data.pending: if action in riu.interrupts: self.process_interrupt(action) elif action....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n self.spawn()\n while self.is_alive:\n self.move()\n time.sleep(.2)", "def run(self):\n return self.move_bat()", "def run(self):\n # type: () -> None\n self.move_to(self.location)", "def _move(self, pos):\n self.put_par(\"drive\", po...
[ "0.7315805", "0.7224031", "0.69296336", "0.6760997", "0.67485535", "0.6699276", "0.652494", "0.64953417", "0.6469153", "0.6459451", "0.6454574", "0.64427245", "0.64338416", "0.64247763", "0.64221346", "0.64221346", "0.64193857", "0.6376137", "0.6372804", "0.6338717", "0.63228...
0.0
-1
Updates the movement status dictionary to the turtlebot's current position and velocity
def callback_odom(self, data): global move_state #acquire a lock on global move_state with self.move_state_lock: move_state['roll'] = data.roll move_state['pitch'] = data.pitch move_state['yaw'] = data.yaw move_state['twist'] = data.twist move_state['x'] = data.position.x move_state['y'] = data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_vehicle_state(self):\n #vel = self.v + self.commands['throttle']/self.m/self.simulation_rate\n\n vel = self.commands['speed']\n steer = self.commands['steering_angle']\n\n if steer > 0.5:\n steer_cmd = 25\n elif steer < -0.5:\n steer_cmd = 185\n ...
[ "0.70230997", "0.65851307", "0.6452682", "0.6401587", "0.63653696", "0.6347469", "0.6264557", "0.61921144", "0.61820686", "0.6180512", "0.617782", "0.60477686", "0.6040164", "0.60250515", "0.59930575", "0.5981435", "0.59646755", "0.59518903", "0.59491944", "0.5907636", "0.590...
0.0
-1
Checks if action_thread is already running; if not, spawn a new thread to handle command.
def process_command(self, command): if not Mover.executing_action: cmd = command.split(' ')[0] try: param = float(command.split(' ')[1]) except: param = None finally: Mover.executing_action = True #Load sets the thread's run target and parameters self.action_thread.load(getattr(self, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action(self):\n self.action_thread = Thread(target=self._action_then_signal, daemon=True)\n self.action_thread.start()", "def _make_thread(self):\r\n pass", "def _ensure_thread(self) -> None:\n\n if not self._thread:\n thread = self._thread_factory(self.run)\n ...
[ "0.6012218", "0.59985614", "0.5906066", "0.5879578", "0.5825946", "0.5720824", "0.5614206", "0.55436355", "0.55431575", "0.5424333", "0.5341071", "0.53191227", "0.5313008", "0.52827656", "0.52175707", "0.52173704", "0.52034307", "0.5200631", "0.51673424", "0.5149323", "0.5117...
0.57459235
5
If param == 0, sets turn angle to default value. Converts current position angle from radians to degrees. Converts negative angles to positive. COntinues to turn left until the current distance to the goal is greater than the previous distance, meaning that the goal has been passed.
def left(self, param): global estop_flag, move_state #If input angle is zero, set angle to default if param: angle = param else: angle = riu.default_angle signal.alarm(0) #Disable timer interrupt for the duration of the movement #safely grab current yaw with self.move_state_lock: current_yaw = (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right(self, param):\n\t\tglobal estop_flag, move_state\n\t\t#If input angle is zero, set angle to default\n\t\tif param:\n\t\t\tangle = param\n\t\telse:\n\t\t\tangle = riu.default_angle\n\n\t\tsignal.alarm(0) #Disable timer interrupt for the duration of the movement\n\t\t#safely grab current yaw\n\t\twith self...
[ "0.7021173", "0.70137686", "0.67029786", "0.65796685", "0.63092864", "0.61473304", "0.6123353", "0.61182714", "0.61117864", "0.60715616", "0.60414594", "0.60361344", "0.59939015", "0.5975596", "0.59737754", "0.5938437", "0.59375", "0.59341085", "0.59288204", "0.5903714", "0.5...
0.7418729
0
If param == 0, sets turn angle to default value. Converts current position angle from radians to degrees. Converts negative angles to positive. COntinues to turn left until the current distance to the goal is greater than the previous distance, meaning that the goal has been passed.
def right(self, param): global estop_flag, move_state #If input angle is zero, set angle to default if param: angle = param else: angle = riu.default_angle signal.alarm(0) #Disable timer interrupt for the duration of the movement #safely grab current yaw with self.move_state_lock: current_yaw = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left(self, param):\n\t\tglobal estop_flag, move_state\n\t\t#If input angle is zero, set angle to default\n\t\tif param:\n\t\t\tangle = param\n\t\telse:\n\t\t\tangle = riu.default_angle\n\n\t\tsignal.alarm(0) #Disable timer interrupt for the duration of the movement\n\t\t#safely grab current yaw\n\t\twith self....
[ "0.7420052", "0.70118314", "0.67038393", "0.6579593", "0.6309404", "0.6147523", "0.6123622", "0.61167604", "0.6110599", "0.6072676", "0.6042288", "0.60363406", "0.59952015", "0.59768206", "0.5973986", "0.59382665", "0.59378344", "0.59349597", "0.5929142", "0.59034985", "0.587...
0.7022378
1
Gets shortest angular distance between two positions regardless of direction
def get_abs_dist(self, pos1, pos2): return min(abs(pos1 - pos2), abs(pos1 - pos2 + 360))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_distance(first: Waypoint, second: Waypoint) -> int:\n return int(distance.vincenty(first.coords(), second.coords()).m)", "def get_position_distance(pos1, pos2, ignore_strand=False):\n NaN = float('nan')\n if pos1 in SPECIAL_POSITIONS.all_undefined: return NaN\n elif pos2 in S...
[ "0.7098709", "0.70844555", "0.6993295", "0.69222057", "0.68783516", "0.68510944", "0.6760011", "0.6758225", "0.6641673", "0.66253275", "0.66251695", "0.66108775", "0.6573693", "0.65723246", "0.65262455", "0.6504858", "0.6500021", "0.6487806", "0.644004", "0.64247996", "0.6398...
0.68771785
5
Calls left 355 to approximate turning in a complete circle
def scan(self, param): self.left(355)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left_twist(self):\n self.turn_by_deg(-179)\n #time.sleep(.1)\n self.stop()\n self.turn_by_deg(-179)\n #time.sleep(.1)\n self.stop()", "def u_turn(self, direction, diameter_in):\n \n# pdb.set_trace()\n # Calculate radius of turn for the inside wheel.\...
[ "0.67077476", "0.666737", "0.64651495", "0.6459743", "0.6402393", "0.6391744", "0.6298772", "0.6274763", "0.6226703", "0.61825544", "0.6179941", "0.6137049", "0.61068386", "0.59903145", "0.5953306", "0.5945245", "0.5925505", "0.5921823", "0.5917596", "0.5917394", "0.5915323",...
0.0
-1
Calls linear_move. If no parameter, defaults to default_dist
def forward(self, param): if param: self.linear_move(param * .3048) else: self.linear_move(riu.default_dist * .3048)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_move(self, initial_position, final_position):\n if any(initial_position - final_position):\n # The desired position is not the actual position (would make a 'divide by zero' error otherwise)\n\n # Compute directional vector\n dir_vector = final_position - initial_...
[ "0.6693261", "0.66415036", "0.65412503", "0.6132586", "0.6122272", "0.60313886", "0.5981754", "0.59595865", "0.59388167", "0.58818024", "0.5879753", "0.58745044", "0.58463347", "0.5828148", "0.5824566", "0.58189654", "0.57764554", "0.5741105", "0.5720051", "0.5718488", "0.569...
0.7202606
0
Calls linear_move. Changes the input parameter to a negative value. If no parameter, defaults to default_dist
def backward(self, param): if param: self.linear_move(-1 * param * .3048) else: self.linear_move(-1 * riu.default_dist * .3048)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, param):\n\t\tif param:\n\t\t\tself.linear_move(param * .3048)\n\t\telse:\n\t\t\tself.linear_move(riu.default_dist * .3048)", "def linear_move(self, dist):\n\t\tglobal estop_flag, move_state\n\t\tsignal.alarm(0) #Disable timer interrupt for the duration of the movement\n\t\thalfway_flag = False\...
[ "0.7253888", "0.6747373", "0.64891535", "0.6274169", "0.6252882", "0.62049425", "0.5926211", "0.5910371", "0.58791304", "0.5832406", "0.579784", "0.57928425", "0.5781144", "0.5778036", "0.56768364", "0.56569725", "0.5645296", "0.5622642", "0.5621369", "0.5614227", "0.55908465...
0.6636399
2
Checks the tracking variable updated by the tracker callback. If no correction is needed, sends a linear twist message. If correction is needed, sends a left or right angular twist as appropriate. Acquires a lock on the move state to update its position. Checks for estop every cycle. Disables ready messages for duratio...
def linear_track(self, dist): global estop_flag, move_state #Disable timer interrupt, reset halfway flag, set target distance signal.alarm(0) halfway_flag = False #Set starting position with self.move_state_lock: start_x, start_y, start_z = move_state['x'], move_state['y'], move_state['z'] #Set curr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_move(self, dist):\n\t\tglobal estop_flag, move_state\n\t\tsignal.alarm(0) #Disable timer interrupt for the duration of the movement\n\t\thalfway_flag = False\n\t\t\n\t\twith self.move_state_lock:\n\t\t\tstart_x, start_y, start_z = move_state['x'], move_state['y'], move_state['z']\n\t\tcurrent_x = start_...
[ "0.6857079", "0.6112145", "0.5854988", "0.5841018", "0.58113366", "0.57477736", "0.5714076", "0.57138836", "0.5696555", "0.56912374", "0.5585474", "0.5583985", "0.557774", "0.5564837", "0.5528463", "0.55114955", "0.5441816", "0.54202133", "0.5392405", "0.53795177", "0.5377141...
0.71479756
0
Moves the robot a distance equal to dist. Checks for estop on each iteration. Publishes a Done message after completion and a Half message when the current distance is equal to half of the goal distance.
def linear_move(self, dist): global estop_flag, move_state signal.alarm(0) #Disable timer interrupt for the duration of the movement halfway_flag = False with self.move_state_lock: start_x, start_y, start_z = move_state['x'], move_state['y'], move_state['z'] current_x = start_x current_y = start_y c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drive(self, distance, tolerance=0.0, tolerance_step=0.5,\n max_attempts=10, avoid_targets=True, avoid_home=False,\n use_waypoints=True):\n self.cur_loc = self.swarmie.get_odom_location()\n start = self.cur_loc.get_pose()\n\n goal = Point()\n goal.x = start....
[ "0.64928085", "0.6398207", "0.63323027", "0.63294876", "0.62530607", "0.61761117", "0.6161925", "0.6121459", "0.60939133", "0.6092826", "0.60628915", "0.6010287", "0.5977998", "0.5970592", "0.5965475", "0.59644395", "0.5960455", "0.5934109", "0.5906981", "0.5897367", "0.58761...
0.708726
0
Returns the username in java system property argument form.
def username(self): return self._username()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def username(self) -> str:\n return self.get_env_var(self.username_var)", "def username(self) -> str:\n return self.get_env_var(self.username_var)", "def _username(self):\n if 'username' not in self._config:\n self._config['username'] = self._UI.get_input(\"Please enter your tra...
[ "0.74624604", "0.74624604", "0.7008669", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6944945", "0.6933543", "0.68644357", "0.68644357", "0.68644357", "0.6803364", "0.6795208"...
0.65675604
47
Returns the password in java system property argument form.
def password(self): return self._password()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password(self) -> str:\n return self.get_env_var(self.password_var)", "def password(self) -> str:\n return self.get_env_var(self.password_var)", "def password(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"password\")", "def password(self) -> pulumi.Input[str]:\n ret...
[ "0.7942731", "0.7942731", "0.7384854", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.73838073", "0.7376234", "0.7376234", "0.7376234", "0.7174086", "0....
0.7163494
21
Initialize the distributed environment.
def setup(rank, world_size, master_addr='127.0.0.1', master_port=12355): os.environ['MASTER_ADDR'] = str(master_addr) os.environ['MASTER_PORT'] = str(int(master_port)) dist.init_process_group("gloo", rank=rank, world_size=world_size) # initialize the process group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize():\n environment = Environment()\n environment.setup()", "def _initialize_distributed():\r\n args = get_args()\r\n\r\n device_count = torch.cuda.device_count()\r\n if torch.distributed.is_initialized():\r\n\r\n if args.rank == 0:\r\n print('torch distributed is alr...
[ "0.7673883", "0.7542333", "0.7162409", "0.71584105", "0.6866288", "0.67851424", "0.67827564", "0.6744308", "0.67387545", "0.67387545", "0.67387545", "0.67387545", "0.67387545", "0.67387545", "0.6711211", "0.6655738", "0.6625131", "0.66135144", "0.6564343", "0.65406877", "0.65...
0.6317892
27
Clean the distributed compute pipeline.
def cleanup(): dist.destroy_process_group()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up(self):\n dist.destroy_process_group()", "def cleanup(self):\n with hide(\"output\", \"warnings\", \"running\"):\n self.stop_all()\n self._execute_standard(\"rm -rf {model_repo}\".format(model_repo=MODEL_REPO))\n self._execute_root(\"docker rmi --force $(doc...
[ "0.71976703", "0.6800443", "0.6734573", "0.64912385", "0.63518906", "0.63412476", "0.62536824", "0.6208296", "0.6204782", "0.61962974", "0.6179033", "0.617475", "0.61652684", "0.61405635", "0.61350846", "0.6127614", "0.60969156", "0.6074719", "0.6072437", "0.6032038", "0.6014...
0.68549407
1
Get a data partition to use.
def use(self, partition_id, config, mpii_annotation_handle): image_scale_factor_range = (float(config.neural_network.train.data_augmentation.image_scale_factor.min), float(config.neural_network.train.data_augmentation.image_scale_factor.max)) input_resolution = int(config.neural_network.train.input_res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_partition(self, partition_spec):\n return self.partitions[partition_spec]", "def getPartition(self):\n\t\treturn self.partition", "def get_partition():\n if selection is None:\n warning(\"You need to pick something first.\")\n return\n if not selection.obj_type in ['partition...
[ "0.74296004", "0.7092693", "0.7056794", "0.6869214", "0.67465454", "0.67465454", "0.66885304", "0.6422414", "0.6421582", "0.63326484", "0.63326484", "0.6325958", "0.6294001", "0.61344606", "0.61189866", "0.61016935", "0.6048441", "0.6018342", "0.6000349", "0.59874904", "0.598...
0.0
-1
Distributed Synchronous SGD Example
def run(rank, world_size, config): setup(rank, world_size, master_addr=config.neural_network.train.DistributedDataParallel.MASTER_ADDR, master_port=config.neural_network.train.DistributedDataParallel.MASTER_PORT) torch.manual_seed(int(config.neural_network.train.random_seed)) training_dataloader, validatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sgd_optimization(dataset, learning_rate, n_epochs, batch_size):\n datasets = load_data(dataset)\n train_set_x, train_set_y = datasets[0]\n valid_set_x, valid_set_y = datasets[1]\n test_set_x, test_set_y = datasets[2]\n\n #number of minibatches\n n_train_batches = train_set_x.get_value(borrow=...
[ "0.64315987", "0.6223416", "0.602052", "0.59918475", "0.5853318", "0.5793804", "0.5776111", "0.5755776", "0.57527995", "0.57093793", "0.57017654", "0.5669587", "0.5668901", "0.5660818", "0.56590956", "0.5644157", "0.5641831", "0.5631096", "0.56299424", "0.5627335", "0.5613017...
0.0
-1
Returns a list of valid words. Words are strings of lowercase letters. Depending on the size of the word list, this function may take a while to finish.
def loadWords(): print("Loading word list from file...") # inFile: file inFile = open(WORDLIST_FILENAME, 'r') # line: string line = inFile.readline() # wordlist: list of strings wordlist = line.split() print(" ", len(wordlist), "words loaded.") return wordlist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_words(f: str, letters: List[str]) -> List[str]:\r\n forbidden_letters = [i for i in string.ascii_lowercase]\r\n for i in letters:\r\n try:\r\n forbidden_letters.remove(i)\r\n except:\r\n pass\r\n words_file = open(f)\r\n word_list = []\r\n letstr = \"\"\r\...
[ "0.77132916", "0.71703184", "0.70881295", "0.69955045", "0.6963074", "0.696277", "0.69443035", "0.6916884", "0.68984777", "0.6888594", "0.6887068", "0.68727845", "0.684664", "0.68418354", "0.6833625", "0.6832609", "0.682177", "0.68213826", "0.680509", "0.68021727", "0.6729428...
0.0
-1
Manage the OATH application.
def oath(ctx): dev = ctx.obj["device"] conn = dev.open_connection(SmartCardConnection) ctx.call_on_close(conn.close) ctx.obj["session"] = OathSession(conn) ctx.obj["oath_keys"] = AppData("oath_keys")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app():\n return aplicattion", "def startapp():", "def main():\n\n root = tk.Tk()\n root.title(\"Exploring US Bikeshare Data\")\n app = Application(master=root)\n print(\"Application loaded! Please use the GUI window to continue...\")\n app.mainloop()", "def main():\n CLI_APP.run()", ...
[ "0.6161091", "0.6057929", "0.6044224", "0.60303146", "0.60209566", "0.6003098", "0.59859675", "0.5966284", "0.5943148", "0.59315443", "0.5913396", "0.5890067", "0.58656245", "0.58575094", "0.5827109", "0.5824534", "0.5740286", "0.5723912", "0.56984925", "0.5697103", "0.569710...
0.0
-1
Display general status of the OATH application.
def info(ctx): session = ctx.obj["session"] version = session.version click.echo(f"OATH version: {version[0]}.{version[1]}.{version[2]}") click.echo("Password protection: " + ("enabled" if session.locked else "disabled")) keys = ctx.obj["oath_keys"] if session.locked and session.device_id in ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_status():\n\n pass", "def status():\n with spinner():\n is_enabled = is_witness_enabled()\n signing_key = current_signing_key()\n misses = total_missed()\n\n t = PrettyTable([\"Enabled\", \"Misses\", \"Key\"])\n t.align = \"l\"\n t.add_row([is_enabled, mis...
[ "0.74407864", "0.67104983", "0.6594999", "0.65726674", "0.6557009", "0.6550992", "0.6458308", "0.6412158", "0.63966596", "0.63714415", "0.6368729", "0.63677835", "0.63424", "0.6311805", "0.6283904", "0.6280261", "0.6270306", "0.6165676", "0.6147138", "0.61286515", "0.61152047...
0.0
-1
Reset all OATH data. This action will delete all accounts and restore factory settings for the OATH application on the YubiKey.
def reset(ctx, force): force or click.confirm( "WARNING! This will delete all stored OATH accounts and restore factory " "settings. Proceed?", abort=True, err=True, ) session = ctx.obj["session"] click.echo("Resetting OATH data...") old_id = session.device_id se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(ctx):\n\n controller = ctx.obj['controller']\n click.echo('Resetting OATH data...')\n old_id = controller.id\n controller.reset()\n\n settings = ctx.obj['settings']\n keys = settings.setdefault('keys', {})\n if old_id in keys:\n del keys[old_id]\n settings.write()\n\n ...
[ "0.8467011", "0.65540415", "0.63808334", "0.6317176", "0.6243645", "0.62291396", "0.6131616", "0.6092173", "0.6083494", "0.6074787", "0.6063735", "0.6057817", "0.6048862", "0.6033866", "0.60303414", "0.6019029", "0.601429", "0.5997502", "0.5983064", "0.59774274", "0.59740347"...
0.8467517
0
Manage password protection for OATH.
def access():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def password(self, ctx):\n pass", "def enter_password(self):", "def password(self) -> str:", "def setpassword(self, pwd):\n pass", "def acceptsPassword(self):\r\n raise NotImplementedError()", "def _encryptDBPass():\n #run encrypt tool on user given password\n controller....
[ "0.68413633", "0.6767164", "0.6509423", "0.64279366", "0.6285428", "0.6279007", "0.62434596", "0.6238656", "0.620061", "0.6151136", "0.61161023", "0.61159134", "0.609999", "0.6076949", "0.6052523", "0.60466707", "0.6025319", "0.5992021", "0.59835994", "0.597444", "0.5940144",...
0.0
-1
Change the password used to protect OATH accounts. Allows you to set or change a password that will be required to access the OATH accounts stored on the YubiKey.
def change(ctx, password, clear, new_password, remember): if clear and new_password: ctx.fail("--clear cannot be combined with --new-password.") _init_session(ctx, password, False, prompt="Enter the current password") session = ctx.obj["session"] keys = ctx.obj["oath_keys"] device_id = ses...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_password(change_account):\n change_data(change_account, changed_data='password')", "def setpassword(self, pwd):\n pass", "def change_password(self, new_password):\n dev = self.nearest_pandevice()\n self.password_hash = dev.request_password_hash(new_password)\n self.upd...
[ "0.7618517", "0.746997", "0.7434945", "0.7257479", "0.7143954", "0.70882785", "0.70502394", "0.7047161", "0.6986982", "0.6944256", "0.6928588", "0.69195575", "0.68995327", "0.68914664", "0.6882281", "0.68337", "0.6824367", "0.6823735", "0.6792913", "0.67883617", "0.67817914",...
0.73968214
3
Store the YubiKeys password on this computer to avoid having to enter it on each use.
def remember(ctx, password): session = ctx.obj["session"] device_id = session.device_id keys = ctx.obj["oath_keys"] if not session.locked: if device_id in keys: del keys[session.device_id] keys.write() logger.info("Deleted remembered access key") clic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_password(self):\n Credential.passwords.append(self)", "def save_password(self, new_password):\n # 55 iterations takes about 100 ms on a Netgear WNDR3800 or about 8ms on a\n # Core2 Duo at 1200 MHz.\n hashed = pbkdf2.crypt(new_password, iterations=55)\n self.write(self....
[ "0.6675744", "0.65866464", "0.65817255", "0.63898677", "0.6381752", "0.63418746", "0.6293246", "0.6226015", "0.62100047", "0.6160657", "0.61586887", "0.6145468", "0.6143356", "0.6109165", "0.59605056", "0.59529567", "0.5867149", "0.582038", "0.580043", "0.5765957", "0.5743831...
0.6156244
11
Remove a stored password from this computer.
def forget(ctx): session = ctx.obj["session"] device_id = session.device_id keys = ctx.obj["oath_keys"] if device_id in keys: del keys[session.device_id] keys.write() logger.info("Deleted remembered access key") click.echo("Password forgotten.") else: click.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_password(cls, media):\n for password in cls.passwords:\n if password.media.lower() == media.lower():\n cls.passwords.remove(password)", "def delete_password(self) -> None:\n\n msg = QtWidgets.QMessageBox()\n icon = QtGui.QIcon()\n icon.addPixmap(Qt...
[ "0.6645211", "0.6478664", "0.64253193", "0.6278725", "0.62367344", "0.6210454", "0.61962545", "0.61674005", "0.615477", "0.60955536", "0.60510457", "0.60510457", "0.60510457", "0.60021687", "0.5914388", "0.59058386", "0.5874533", "0.57981825", "0.578934", "0.57035446", "0.566...
0.59053725
16
Manage and use OATH accounts.
def accounts():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accounts():\n pass", "def open_account():\n print(\"\\n\")\n print(messages.open_account)\n u_id = pyip.inputInt(\"Id: \", greaterThan=0)\n name = pyip.inputCustom(raiseNameError, prompt=\"Name: \")\n address = pyip.inputCustom(raiseAddressError, prompt=\"Address: \")\n ...
[ "0.68266904", "0.65521026", "0.6182628", "0.60371274", "0.6025271", "0.6007449", "0.5981175", "0.5968835", "0.59599483", "0.59120464", "0.58873284", "0.58873284", "0.58796024", "0.58731365", "0.5872677", "0.5826017", "0.582573", "0.58219486", "0.5776078", "0.57698965", "0.576...
0.7143794
0
Add a new account. This will add a new OATH account to the YubiKey. \b NAME human readable name of the account, such as a username or email address SECRET base32encoded secret/key value provided by the server
def add( ctx, secret, name, issuer, period, oath_type, digits, touch, algorithm, counter, force, password, remember, ): digits = int(digits) if not secret: while True: secret = click_prompt("Enter a secret key (base32)") try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newaccount(accountname, account, owner, active, memo, posting, create_claimed_account):\n stm = shared_morphene_instance()\n if mph.rpc is not None:\n mph.rpc.rpcconnect()\n if not account:\n account = mph.config[\"default_account\"]\n if not unlock_wallet(stm):\n return\n a...
[ "0.692764", "0.6889752", "0.664424", "0.66392326", "0.66027886", "0.6473702", "0.646768", "0.6431205", "0.6337383", "0.6320626", "0.63136363", "0.62558633", "0.62369376", "0.620672", "0.61543274", "0.6143997", "0.6131898", "0.6082695", "0.60308576", "0.59818006", "0.5971492",...
0.67763263
2
List all accounts. List all accounts stored on the YubiKey.
def list(ctx, show_hidden, oath_type, period, password, remember): _init_session(ctx, password, remember) session = ctx.obj["session"] creds = [ cred for cred in session.list_credentials() if show_hidden or not is_hidden(cred) ] creds.sort() for cred in creds: cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_accounts(self):\n pass", "def display_accounts(cls):\n return cls.account_list", "def list_accounts():\n\n try:\n accounts = Account.query.all()\n except NoResultFound:\n print(f\"No account configured yet.\")\n return\n n_len = max([len(a.nickname) for a in...
[ "0.77831614", "0.7059491", "0.6992086", "0.68804544", "0.6816529", "0.677024", "0.67435384", "0.6720439", "0.67129004", "0.66524947", "0.6590446", "0.65834236", "0.65735555", "0.6564277", "0.6535469", "0.64419425", "0.6433965", "0.63949704", "0.6325707", "0.6317909", "0.63084...
0.5570774
95
Generate codes. Generate codes from OATH accounts stored on the YubiKey. Provide a query string to match one or more specific accounts. Accounts of type HOTP, or those that require touch, requre a single match to be triggered.
def code(ctx, show_hidden, query, single, password, remember): _init_session(ctx, password, remember) session = ctx.obj["session"] entries = session.calculate_all() creds = _search(entries.keys(), query, show_hidden) if len(creds) == 1: cred = creds[0] code = entries[cred] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code(ctx, show_hidden, query, single):\n\n ensure_validated(ctx)\n\n controller = ctx.obj['controller']\n creds = [(cr, c)\n for (cr, c) in controller.calculate_all()\n if show_hidden or not cr.is_hidden\n ]\n\n creds = _search(creds, query)\n\n if len(creds) ...
[ "0.5709946", "0.54599285", "0.52223974", "0.5158887", "0.511579", "0.49772036", "0.4926266", "0.48736855", "0.482959", "0.48240364", "0.47595084", "0.47581586", "0.47494113", "0.47327673", "0.47232696", "0.47091013", "0.47038928", "0.46369225", "0.4620117", "0.46148378", "0.4...
0.60336894
0
Rename an account (requires YubiKey 5.3 or later). \b QUERY a query to match a single account (as shown in "list")
def rename(ctx, query, name, force, password, remember): _init_session(ctx, password, remember) session = ctx.obj["session"] creds = session.list_credentials() hits = _search(creds, query, True) if len(hits) == 0: click.echo("No matches, nothing to be done.") elif len(hits) == 1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_name(change_account):\n change_data(change_account, changed_data='name')", "def userRenamed(self, oldname, newname):\n # Send messasge to Server bot.\n self.data_in(text=\"\", type=\"renamed\", oldname=oldname, newname=newname)", "def change_username(self, accountid, oldusername, ne...
[ "0.680213", "0.61724126", "0.61534506", "0.5984996", "0.58834755", "0.5820864", "0.5812739", "0.580092", "0.57732266", "0.57656634", "0.5690298", "0.56819504", "0.56756616", "0.5665553", "0.5652086", "0.56036377", "0.55914325", "0.55752826", "0.5561572", "0.5548004", "0.54920...
0.78993976
0
Delete an account. Delete an account from the YubiKey. \b QUERY a query to match a single account (as shown in "list")
def delete(ctx, query, force, password, remember): _init_session(ctx, password, remember) session = ctx.obj["session"] creds = session.list_credentials() hits = _search(creds, query, True) if len(hits) == 0: click.echo("No matches, nothing to be done.") elif len(hits) == 1: cred...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_account():\n print(\"\\n\")\n print(messages.delete_account)\n u_id = pyip.inputInt(\"User Id: \", greaterThan=0)\n\n credentials = {\"id\":u_id}\n result = BankOperationsBackend.delete_account(credentials)\n start_again() if result else BankOperationsUi.delete_...
[ "0.7632831", "0.7553542", "0.7370156", "0.7133459", "0.70442104", "0.7016698", "0.70111597", "0.69728017", "0.6969365", "0.69664097", "0.6955276", "0.69501173", "0.6761479", "0.67169905", "0.6671774", "0.66007626", "0.65042543", "0.64596933", "0.6452238", "0.6445934", "0.6404...
0.72511256
3
Returns True if provided url is valid ATOM or RSS.
def isFeedURLValid(feed_url=None): # a missing or empty feed url is never valid if not feed_url: return False try: result = urlfetch.fetch(feed_url) except urlfetch_errors.Error: return False # 200 is the status code for 'all ok' if result.status_code != 200: return False try: pars...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_url(url):\n\n return bool(re.match(re_url, url))", "def isValidURL(self, url):\n if \"imdb.com\" in url:\n return True\n else:\n return False", "def __isUrl(self, url):\n if type(url)==str:\n return url.startswith('http://') or url.startswith('htt...
[ "0.7569633", "0.7502508", "0.73820883", "0.73411655", "0.7280303", "0.7181644", "0.71765673", "0.71716577", "0.71481854", "0.71284044", "0.71284044", "0.7101685", "0.7084717", "0.70737684", "0.70601267", "0.7044573", "0.7031269", "0.6966769", "0.6956776", "0.6939639", "0.6937...
0.7483982
2
Returns True if link_id is in a valid format.
def isLinkIdFormatValid(link_id): if linkable.LINK_ID_REGEX.match(link_id): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_item_link(self, item):\n if len(item.link) > 255:\n raise ValueError(\"item.link length too long.\")\n\n return True", "def isValid(t_id):\n\tstr_id=str(t_id).strip()\n\treturn str_id.isdigit()", "def is_id_valid(id_code: str) -> bool:\n if id_code.isdigit():\n ...
[ "0.6823712", "0.6606774", "0.65906495", "0.63503116", "0.63053745", "0.62947255", "0.62471926", "0.6207654", "0.6194306", "0.6191876", "0.6190582", "0.60711575", "0.60548055", "0.6014753", "0.5996904", "0.59781694", "0.5946499", "0.59353083", "0.59190065", "0.5917687", "0.590...
0.90292734
0
Returns True if scope_path is in a valid format.
def isScopePathFormatValid(scope_path): if linkable.SCOPE_PATH_REGEX.match(scope_path): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_validate(path):\n # functionality to be added later\n return path", "def _IsWellFormattedFilePath(path):\n return path.startswith(SRC) and path.endswith(_OWNERS)", "def ValidatePath(self, root_path: str) -> bool:\n if 'silver' in root_path:\n return True\n\n return False", "def val...
[ "0.62401545", "0.6233845", "0.61344105", "0.61142206", "0.6085311", "0.6056564", "0.6019026", "0.5993043", "0.59646183", "0.5931616", "0.59268624", "0.57996225", "0.5798255", "0.5786526", "0.5785276", "0.5777391", "0.57569396", "0.5749316", "0.57310104", "0.57060814", "0.5705...
0.90448207
0
Get a data schema
def get_schema(schema): # noqa: E501 return 'do some magic!'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_schema(self) -> dict:", "def _get_schema(self):\n self._pick()\n return Schema()", "def get_schema(self):\n response = self.client.get(self._get_collection_url('schema'))\n\n return response.get('schema', {})", "def get_schema(cls):\n return cls.schema()", "def ge...
[ "0.79035777", "0.7808428", "0.774904", "0.75302166", "0.7522008", "0.74665457", "0.72975564", "0.72781396", "0.7229537", "0.7178495", "0.71265703", "0.7107381", "0.70986634", "0.70339996", "0.6992602", "0.69804245", "0.69703525", "0.6958406", "0.69463897", "0.69424665", "0.68...
0.71875787
9
Fetch latest crease xml from animation publish folder...
def _crease_XML_latest_publish(self, tk, templateFile = '', id = '', shotNum = ''): debug(app = self.app, method = '_crease_XML_latest_publish', message = 'Looking for crease xml now...', verbose = False) getCreaseXMLPublishFolder = tk.paths_from_template( templateFile, {'Step' : 'Anm', 'id' : id, 'Shot' : shot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fetchAnimPublish(self, tk, templateFile = '', fields = '', id = '', shotNum = '', inprogressBar = '', filteredPublish = ''):\r\n\t\tdebug(app = self.app, method = '_fetchAnimPublish', message = 'Fetching latest caches now....', verbose = False)\r\n\t\tdebug(app = self.app, method = '_fetchAnimPublish', messag...
[ "0.6206035", "0.55234224", "0.52666616", "0.5235553", "0.52091956", "0.5206474", "0.52010465", "0.51887625", "0.51887625", "0.5178505", "0.51600707", "0.51256144", "0.5122521", "0.50846535", "0.50757486", "0.5039742", "0.5022523", "0.5022523", "0.5006762", "0.4999023", "0.499...
0.63504636
0
Func to cleanup the FX aspects of an ocean setup for a clean rebuild
def _removeFX(self): nodesToClean = [CONST.FOAM_FLUID_SHAPENODE, CONST.WAKE_FLUID_SHAPENODE, 'fluids_hrc'] for eachNode in nodesToClean: try: cmds.delete(each) except: pass for eachCache in cmds.ls(type = 'cacheFile'): cmds.delete(eachCache)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup():", "def cleanUp(self):\n import evoware.fileutil as F\n F.tryRemove(self.f_project, verbose=(self.VERBOSITY>1), tree=1)", "def cleanup_step(self):\n self.clean_home_subdir()\n\n super(IntelBase, self).cleanup_step()", "def env_cleanup(self):\n pass", "def cl...
[ "0.75079024", "0.72766304", "0.7203938", "0.7149449", "0.7148618", "0.7132942", "0.7098037", "0.7097166", "0.70632", "0.705151", "0.70513195", "0.70179564", "0.6965721", "0.6965721", "0.6965721", "0.6941519", "0.6903252", "0.68758154", "0.68729347", "0.68729347", "0.68729347"...
0.0
-1
Func to clean up all the related ocean stuff for a full clean rebuild.
def _removeOcean(self): nodesToClean = [CONST.OCEANDISPSHADER, CONST.OCEANANIMSHADER, CONST.OCEAN_ANIM_PREVIEWPLANENAME] for eachNode in nodesToClean: try: cmds.delete(each) except: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup():", "def _clean_up(self):", "def cleanUp(self):\n import evoware.fileutil as F\n F.tryRemove(self.f_project, verbose=(self.VERBOSITY>1), tree=1)", "def cleanup_step(self):\n self.clean_home_subdir()\n\n super(IntelBase, self).cleanup_step()", "def cleanUp(self):\r\n...
[ "0.7034238", "0.6948844", "0.6938194", "0.69257504", "0.68967277", "0.68826264", "0.68699753", "0.68283665", "0.6806426", "0.67668396", "0.67551947", "0.6735371", "0.6726853", "0.67112094", "0.67112094", "0.66846704", "0.6684126", "0.66598904", "0.6635282", "0.65948325", "0.6...
0.65006167
28
Fetches all the latest published fluid containers and their caches for lighting
def _fetchFXPublish(self, tk, templateFile = '', fields = '', id = '', shotNum = '', inprogressBar = ''): ## First clean up any existing caches and fluids self._removeFX() ## CHECK FOR FX PUBLISHES NOW getFXVersionFolders = tk.paths_from_template(templateFile, {'Step' : 'FX', 'id' : id, 'Shot' : shotNum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fetchAnimPublish(self, tk, templateFile = '', fields = '', id = '', shotNum = '', inprogressBar = '', filteredPublish = ''):\r\n\t\tdebug(app = self.app, method = '_fetchAnimPublish', message = 'Fetching latest caches now....', verbose = False)\r\n\t\tdebug(app = self.app, method = '_fetchAnimPublish', messag...
[ "0.56672907", "0.5571335", "0.55697733", "0.54212946", "0.5389289", "0.53722525", "0.53226024", "0.5241255", "0.5167858", "0.5153116", "0.5110662", "0.5107825", "0.5104006", "0.5092108", "0.5091016", "0.50862485", "0.507191", "0.5070526", "0.50680923", "0.5056334", "0.5054478...
0.51527745
10
Exposing a tool to help push the ocean into the right location based off the FX published fluid containers fluids_hrc
def _setOceanLocation(self): ## If the fluids_hrc exists if cmds.objExists('fluids_hrc'): if cmds.objExists('ocean_srf'): cmds.connectAttr('fluids_hrc.translateX', 'ocean_srf.translateX', f = True) cmds.connectAttr('fluids_hrc.translateZ', 'ocean_srf.translateZ', f = True) else: cmds.warnin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n\n\n fab_list = get_fabric_list(SANNAV_IP_ADDRESS, SANNAV_FOS_USERNAME, SANNAV_FOS_PASSWORD)\n\n # Print all known facts about the fabrics and the switches\n # Comment out this print statement if this code will be used to generate\n # an Ansible Tower inventory.\n print(json.dumps(fab_l...
[ "0.5672977", "0.560191", "0.55638695", "0.55382484", "0.55016917", "0.5492851", "0.5487739", "0.547502", "0.5456432", "0.5440167", "0.54215467", "0.5404361", "0.53749293", "0.53648347", "0.53563046", "0.5336703", "0.53051615", "0.5297738", "0.52720964", "0.52703017", "0.52670...
0.5646119
1
Split out as requested by lighting to just fetch the latest ocean
def _rebuildOcean(self, tk, templateFile = '', fields = '', id = '', shotNum = '', inprogressBar = ''): debug(app = self.app, method = '_rebuildOcean', message = 'Deleting current Ocean now....', verbose = False) self._removeOcean() ## Get all the publishes from shotgun now for the blocking or animation step...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSlaves():", "def crossWalkGeoBlacklight(data):\n\n dataJsonObj=deep_get(data,\"xml.fgdc\",[])\n if len (dataJsonObj)>0:\n dataJsonObj=deep_get(dataJsonObj[0],\"data\",{})\n else:\n dataJsonObj={}\n layername=os.path.splitext(os.path.basename(data['file']))[0]\n geoserver_layer...
[ "0.5493592", "0.5329551", "0.52164626", "0.5196075", "0.5143778", "0.5120439", "0.5111923", "0.5093739", "0.50789034", "0.5073732", "0.5064189", "0.5026506", "0.50177354", "0.49574155", "0.49371618", "0.49332502", "0.49277258", "0.49213284", "0.4918263", "0.4880653", "0.48528...
0.48307702
22
Used to fetch most recent cache files
def _fetchAnimPublish(self, tk, templateFile = '', fields = '', id = '', shotNum = '', inprogressBar = '', filteredPublish = ''): debug(app = self.app, method = '_fetchAnimPublish', message = 'Fetching latest caches now....', verbose = False) debug(app = self.app, method = '_fetchAnimPublish', message = 'Template...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def files():\n return get_cached(\"files.json\")", "def fetch(\n self, output_folder: Path, cache: Dict[str, str], fetch_opts: List[Dict[str, Any]]\n ) -> List[str]:\n return [\n download_snapshot(source_config[\"url\"], output_folder, **source_config.get(\"opts\", {}))\n ...
[ "0.6888681", "0.6708136", "0.658939", "0.6533511", "0.6487432", "0.6340917", "0.63322324", "0.63005716", "0.6286395", "0.62659204", "0.6218005", "0.6218005", "0.61635375", "0.61493427", "0.61172336", "0.6110893", "0.6078489", "0.60554326", "0.6053905", "0.60533607", "0.601005...
0.0
-1
Final pass to connect existing ocean caches to the ocean shader if they exist in the scene
def _connectWakeAndFoamToOcean(self, tk, templateFile = '', id = '', shotNum = '', inprogressBar = ''): debug(app = self.app, method = '_connectWakeAndFoamToOcean', message = 'Connecting fluid textures to ocean shader....', verbose = False) #################################################### ## Straight up ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_load_scene_shaders(self):\n\n artellapipe.ShadersMgr().load_scene_shaders()", "def _on_lowres_assets(self):\n\n scene_assets = artellapipe.AssetsMgr().get_scene_assets()\n if not scene_assets:\n return\n\n for scene_asset in scene_assets:\n scene_asset.sw...
[ "0.5968839", "0.5813282", "0.57067865", "0.56659585", "0.5622924", "0.5525419", "0.5465", "0.5386124", "0.53504324", "0.53005147", "0.5141424", "0.511689", "0.50960606", "0.50883526", "0.5087522", "0.5083337", "0.50820434", "0.50608236", "0.5042474", "0.50115144", "0.49761882...
0.49265927
24
Return if the selected digits from start in the number are a palindrome
def is_number_palindrome(number, digits, start): number = str((number // 10**start) % 10**digits).zfill(digits) return is_palindrome(number)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_palindrome(n):\n d = digits(n)\n r = int(\"\".join([str(i) for i in d]))\n return n == r", "def isPalindrome(Number):\r\n ListOfDigit=[int(d) for d in str(Number)]\r\n n=len(ListOfDigit)\r\n for i in range(n//2):\r\n if ListOfDigit[i]!=ListOfDigit[-(i+1)]:\r\n return(Fa...
[ "0.7902744", "0.78919506", "0.7875554", "0.78522855", "0.780591", "0.77704966", "0.7650538", "0.7627759", "0.7580284", "0.75686455", "0.7507331", "0.75047344", "0.7498053", "0.7495534", "0.74926513", "0.74589795", "0.74185145", "0.73735946", "0.7350664", "0.73400944", "0.7291...
0.8182947
0
Model is initialized with tag model m
def __init__(self, tags): self.tags = tags
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_model(self):\n pass", "def initialize_model(self):\n pass", "def initialize(self, model):\n pass", "def __init__(self, model):\n\t\tself.model = model", "def __init__(self, model):\n self._model = model", "def __init__(self, model):\n self.model = model", "de...
[ "0.77973366", "0.77588874", "0.76936555", "0.731248", "0.7298934", "0.7228691", "0.7228691", "0.7228691", "0.7228691", "0.72052944", "0.72052944", "0.70650303", "0.688462", "0.6877822", "0.68087727", "0.67039186", "0.6681423", "0.66007894", "0.6584187", "0.6508255", "0.650825...
0.6052295
75
Get all the tag combinations possible for a tree of length n
def get_all_tag_seq(self, n): tags = list(product(self.tags, repeat=n)) return tags
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fn(n):\n if n == 1: return [TreeNode()]\n ans = []\n for nn in range(1, n, 2): \n for left in fn(nn):\n for right in fn(n-1-nn): \n ans.append(TreeNode(left=left, right=right))\n return ans", "def get_subs(n)...
[ "0.6263927", "0.61682093", "0.60873145", "0.599515", "0.596374", "0.5940209", "0.5909812", "0.5883347", "0.58303434", "0.58066684", "0.5776324", "0.57579505", "0.57390195", "0.5715532", "0.57020915", "0.5674218", "0.5645066", "0.5627819", "0.56251854", "0.56197864", "0.561497...
0.6972763
0
Get index of a tag sequence m in self.tags
def get_tag_index(self, m): return self.tags.index(m)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_in_tag(self):\n if hasattr(self, '_m_index_in_tag'):\n return self._m_index_in_tag if hasattr(self, '_m_index_in_tag') else None\n\n self._m_index_in_tag = (self.tag - 35)\n return self._m_index_in_tag if hasattr(self, '_m_index_in_tag') els...
[ "0.7142307", "0.6958829", "0.6688589", "0.66438335", "0.65356153", "0.6207758", "0.62011987", "0.6198451", "0.61982673", "0.6162026", "0.6146128", "0.6113043", "0.60828024", "0.60632235", "0.60050696", "0.5982074", "0.59499717", "0.5918507", "0.5912195", "0.5911467", "0.59011...
0.8766997
0
Given two tags and a label, return the psi factor of the two tag sequences
def get_psi_score(self, psi, pos1, pos2, lab, m1, m2): i, j = self.get_tag_index(m1), self.get_tag_index(m2) return psi[pos1, pos2, lab, i, j]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _psi_function(share1, share2):\n return (share1 - share2) * math.log(share1/share2)", "def get_emissions_probability(label_matches, given_tag, given_word, tag_counts):\r\n\tlookup_tuple = (given_word, given_tag)\r\n\tword_tag_frequency = label_matches.get(lookup_tuple, 0)\r\n\ttag_frequency = tag_counts[g...
[ "0.59438974", "0.5719111", "0.5711388", "0.5612045", "0.5503579", "0.54424065", "0.54400754", "0.5393413", "0.53729504", "0.53618443", "0.5353206", "0.5324507", "0.5300333", "0.52868974", "0.5257343", "0.52473134", "0.52161574", "0.52138144", "0.5211579", "0.5206199", "0.5191...
0.58502215
1
Given a word index and a tag, return the corresponding phi factor
def get_phi_score(self, phi, i, m): m_i = self.get_tag_index(m) return phi[i, m_i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_e(word, tag, e_word_tag_counts, q_uni_counts):\n word_tag_tupple = (word, tag)\n\n word_tag_count = 0\n if word_tag_tupple in e_word_tag_counts:\n word_tag_count = e_word_tag_counts[word_tag_tupple]\n\n nof_tag = q_uni_counts[tag]\n return float(word_tag_count) / nof_tag", "def phi_...
[ "0.60653216", "0.60379994", "0.6002697", "0.5898803", "0.561196", "0.5606778", "0.559027", "0.55902416", "0.55877733", "0.55638826", "0.5545571", "0.55339694", "0.55001754", "0.5450012", "0.54254514", "0.5408535", "0.5381232", "0.53649646", "0.53594136", "0.5357221", "0.53333...
0.60124296
2
Create phi factors for a given tree
def create_phi(self, T, pos, m, alpha=1): phi = tr.zeros((len(T), self.tag_size()), dtype=tr.float64) for i, _, _ in T: m_i = self.get_tag_index(m[i - 1]) phi[i - 1, m_i] = alpha return phi
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euler_phi(n):\n\tif n == 1: return 1\n\tif n <= 0: return 0\n\t# For each prime factor p with multiplicity n, a factor of (p**(n-1))*(p-1)\n\treturn functools.reduce(lambda a,x:a*(x[0]**(x[1]-1))*(x[0]-1),factor(n),1)", "def euler_phi(n):\r\n\t# For each prime factor p with multiplicity n, a factor of (p**(n...
[ "0.6235746", "0.6235249", "0.59856504", "0.59158146", "0.59023964", "0.582595", "0.5666644", "0.56169415", "0.555361", "0.54805905", "0.5480042", "0.5480042", "0.5477096", "0.5435909", "0.5401921", "0.53897333", "0.5374874", "0.53169054", "0.52634305", "0.5260795", "0.5258291...
0.48233575
71
Calculate the (log) agreement of a list of tags for a given tree
def log_score(self, T, pos, m, psi, phi): log_score = 0 for (i, j, lab) in T: m_i = m[i - 1] pos1 = pos[i - 1] log_score += self.get_phi_score(phi, i - 1, m_i) if j != 0: m_j = m[j - 1] pos2 = pos[j - 1] log_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtree_cond_pdf(tree1, tree2, tree2_subtree_nodes, new):\n\n # if new is isolated in the underlying graph\n\n #if len(tree2_subtree_nodes) == 1 and tree2_subtree_nodes.values()[0] is None:\n if len(tree2_subtree_nodes) == 1 and list(tree2_subtree_nodes.values())[0] is None:\n sep = frozenset([...
[ "0.54515827", "0.5316931", "0.5275841", "0.5213601", "0.52042305", "0.51962835", "0.5176608", "0.50949377", "0.50766563", "0.5068682", "0.5062237", "0.5042272", "0.5036879", "0.5017808", "0.4995817", "0.49750316", "0.49472603", "0.49305362", "0.49264774", "0.48480722", "0.484...
0.0
-1
Calculate the gradient of the log score for a given tree with respect to the psi and phi parameters
def dlog_score(self, T, pos, m, psi): dpsi = tr.zeros_like(psi) for (i, j, lab) in T: if j != 0: m_i = self.get_tag_index(m[i - 1]) pos1 = pos[i - 1] m_j = self.get_tag_index(m[j - 1]) pos2 = pos[j - 1] dpsi[pos1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grad_log(self, X):\n # \"\"\"\n # Evaluate the gradients (with respect to the input) of the log density at\n # each of the n points in X. This is the score function.\n\n # X: n x d numpy array.\n XB = np.dot(X, self.B)\n Y = 0.5*XB + self.c\n E2y = np.exp(2*Y)\n ...
[ "0.67526263", "0.6612029", "0.6377196", "0.63414973", "0.6340336", "0.63349605", "0.62160623", "0.6211794", "0.62073463", "0.6133842", "0.612299", "0.6117252", "0.6114974", "0.60872525", "0.6031914", "0.60047233", "0.60036635", "0.5983822", "0.59582996", "0.5957819", "0.59035...
0.5909217
20
Belief propagation algorithm for calculating the log of the partition function Z
def logZ(self, T, pos, psi, phi): msgs = belief_propagation(T, pos, psi, phi, True) log_z = calculate_belief_sum(msgs, True) return log_z
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_lhood(X, Z, Y, a, ep, lamb):\n \n K = Z.shape[1]\n N, T = X.shape\n \n # p(X)\n ZY = np.dot(Z,Y) \n log_pX = 0\n log_pX = log_pX + np.sum(X * np.log(1 - ((1 - lamb) ** ZY) * (1 - ep)))\n log_pX = log_pX + np.sum((1 - X) * np.log(((1 - lamb) ** ZY) * (1 - ep))) \n \n ...
[ "0.68426955", "0.67924553", "0.65790004", "0.641989", "0.6392089", "0.63153124", "0.62316066", "0.62185025", "0.6198411", "0.61977243", "0.6184737", "0.6161985", "0.61484474", "0.61339176", "0.6121981", "0.61210907", "0.6119032", "0.6114617", "0.61016893", "0.6100129", "0.609...
0.6328785
5
Belief propagation algorithm for calculating the gradient of the log of the partition function Z
def dlogZ(self, T, pos, psi, phi): msgs = belief_propagation(T, pos, psi, phi, True) dpsi = calculate_gradient(msgs, T, pos, psi, True, True) return dpsi
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grad_log(self, X):\n # \"\"\"\n # Evaluate the gradients (with respect to the input) of the log density at\n # each of the n points in X. This is the score function.\n\n # X: n x d numpy array.\n XB = np.dot(X, self.B)\n Y = 0.5*XB + self.c\n E2y = np.exp(2*Y)\n ...
[ "0.72906494", "0.69248664", "0.6920769", "0.663529", "0.663529", "0.662517", "0.6602322", "0.660013", "0.6522516", "0.64752764", "0.6431578", "0.64274055", "0.6426478", "0.6416801", "0.64133984", "0.6344967", "0.63444275", "0.63398236", "0.6332006", "0.6312257", "0.62948793",...
0.6327207
19
Calculate the conditional log probability of the tags given the tree
def log_prob(self, T, pos, m, psi, phi=tr.Tensor()): if phi.size() == tr.Size([0]): phi = self.create_phi(T, pos, m) return self.log_score(T, pos, m, psi, phi) - self.logZ(T, pos, psi, phi)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_prob(self):", "def probability(self, tokens):\n\n return 2 ** self.log_probability(tokens)", "def log_probability(self, sequence):\n sequence = self._transform(sequence)\n\n T = len(sequence)\n\n if T > 0 and sequence[0][_TAG]:\n last_state = sequence[0][_TAG]\n ...
[ "0.6678612", "0.6432416", "0.63992906", "0.633939", "0.633939", "0.6339248", "0.6256718", "0.6255451", "0.623174", "0.6225141", "0.6221682", "0.619902", "0.61507213", "0.61484003", "0.61439043", "0.60917944", "0.6077829", "0.6073268", "0.60723597", "0.6044864", "0.60433054", ...
0.0
-1
Calculate the gradient of the log probability for a given tree with respect to the psi and phi parameters
def dlog_prob(self, T, pos, m, psi, phi=tr.Tensor()): if phi.size() == tr.Size([0]): phi = self.create_phi(T, pos, m) dpsi_score = self.dlog_score(T, pos, m, psi) dpsi_Z = self.dlogZ(T, pos, psi, phi) return dpsi_score - dpsi_Z
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dlogZ(self, T, pos, psi, phi):\n msgs = belief_propagation(T, pos, psi, phi, True)\n dpsi = calculate_gradient(msgs, T, pos, psi, True, True)\n return dpsi", "def fd_grad(self, T, pos, psi, phi, eps=1e-5):\n dpsi = tr.zeros_like(psi)\n dphi = tr.zeros_like(phi)\n for...
[ "0.7159313", "0.6766048", "0.6629792", "0.6519036", "0.6494689", "0.6489138", "0.6413346", "0.64006495", "0.6371672", "0.63623327", "0.63360333", "0.63232714", "0.6310686", "0.6310686", "0.6260827", "0.62424856", "0.62325174", "0.62135476", "0.61898154", "0.61844623", "0.6144...
0.6783176
1
Belief propagation (maxproduct) algorithm for calculating the best tag sequence for a tree
def best_sequence(self, T, pos, psi, phi, fix_tags=[]): for idx, m in fix_tags: phi[idx - 1, m] = 100 # if fix_idx: # phi[fix_idx - 1, fix_m] = 100 msgs, pointers = max_product(T, pos, psi, phi, True) tags_dict = get_best_tags(T, msgs, pointers) tags = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def viterbi_tags (untagged_sentences, h):\n transitions = h[0]\n emissions = h[1]\n tags = h[2]\n maxtags = []\n #print tags\n\n for untaggedsent in untagged_sentences:\n #Create empty probtable\n words = untaggedsent.split()\n r = len(tags)\n c = len(words)\n p...
[ "0.6412046", "0.6118864", "0.6081776", "0.6072963", "0.59527105", "0.58929455", "0.58275664", "0.5798937", "0.57968605", "0.5785027", "0.57746196", "0.57544744", "0.5740327", "0.570907", "0.5700903", "0.5691829", "0.56907284", "0.56797606", "0.56477773", "0.564019", "0.563955...
0.58380824
6
Brute force algorithm for calculating the log of the partition function Z
def logZ_brute(self, T, pos, psi, phi): ms = self.get_all_tag_seq(len(T)) log_scores = tr.zeros(len(ms), dtype=tr.float64) for i in range(len(ms)): log_scores[i] = self.log_score(T, pos, ms[i], psi, phi) log_z = logsumexp(log_scores) return log_z
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partition_function(array, temp):\r\n\r\n # Constants imported from scipy.constants\r\n h = scipy.constants.h # Planck's constant\r\n # speed of light must be in cm/s as wavenumber is in cm-1\r\n c = scipy.constants.c * 100\r\n k = scipy.constants.k # Boltzmann constant\r\n T = temp # extra...
[ "0.65710264", "0.6284432", "0.61714786", "0.59657145", "0.59184784", "0.5914684", "0.5879645", "0.58559495", "0.5837734", "0.5820538", "0.5819314", "0.57771146", "0.57759076", "0.57748866", "0.57500154", "0.57367206", "0.56673867", "0.56623465", "0.5645668", "0.5631098", "0.5...
0.6006404
3
Brute force algorithm for calculating the log of the partition function Z
def best_sequence_brute(self, T, pos, psi, phi): ms = self.get_all_tag_seq(len(T)) log_scores = tr.zeros(len(ms), dtype=tr.float64) for i in range(len(ms)): log_scores[i] = self.log_score(T, pos, ms[i], psi, phi) best = ms[tr.argmax(log_scores)] tags = [] for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partition_function(array, temp):\r\n\r\n # Constants imported from scipy.constants\r\n h = scipy.constants.h # Planck's constant\r\n # speed of light must be in cm/s as wavenumber is in cm-1\r\n c = scipy.constants.c * 100\r\n k = scipy.constants.k # Boltzmann constant\r\n T = temp # extra...
[ "0.65710264", "0.6284432", "0.61714786", "0.6006404", "0.59657145", "0.59184784", "0.5914684", "0.5879645", "0.58559495", "0.5837734", "0.5820538", "0.5819314", "0.57771146", "0.57759076", "0.57748866", "0.57500154", "0.57367206", "0.56673867", "0.56623465", "0.5645668", "0.5...
0.0
-1
Finite Difference gradient computation for logZ
def fd_grad(self, T, pos, psi, phi, eps=1e-5): dpsi = tr.zeros_like(psi) dphi = tr.zeros_like(phi) for pos1 in range(psi.shape[0]): for pos2 in range(psi.shape[1]): for lab in range(psi.shape[2]): for i in range(psi.shape[3]): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logistic_grad(z):\n idx_pos = np.where(z >= 0.)\n idx_neg = np.where(z < 0.)\n res = np.empty(z.shape)\n res[idx_pos] = 1. / (1. + np.exp(-z[idx_pos]))\n res[idx_neg] = 1 - 1. / (1. + np.exp(z[idx_neg]))\n return res", "def logistic_grad(z):\n idx_pos = np.whe...
[ "0.75813544", "0.75813544", "0.7266053", "0.70977503", "0.7045134", "0.6986021", "0.69778025", "0.6907271", "0.689076", "0.6876", "0.6797919", "0.6774386", "0.67495555", "0.67483854", "0.67364544", "0.67208683", "0.67097276", "0.668161", "0.6634446", "0.6579385", "0.65332234"...
0.6227096
40
returns collection of beat times when given start/end/length
def Calc(self, a, b, size): self.eq = lambda x: (60000/((b-a)/size*x+a)) points = [] names = [str(self.offset)] points.append(0) for j in range(1, int(size)): points.append(integrate.quad(self.eq,0,j)[0]) names.append(str(points[-1]+self.offset)) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_times(self, start: int = None, end: int = None) -> List:\n return [i.time for i in self.data[start:end]]", "def get_target_timestamps(self):\n times=[]\n curr = self.begin_ts\n while curr<=self.end_ts:\n times.append(curr)\n curr = curr + 24 * 60 * 60\n ...
[ "0.6811883", "0.66345775", "0.61763304", "0.6161527", "0.61594856", "0.61594856", "0.61594856", "0.60631555", "0.5961605", "0.59090525", "0.5891341", "0.58558464", "0.5800605", "0.57836986", "0.5770535", "0.57627267", "0.5715411", "0.56829864", "0.56808645", "0.5678318", "0.5...
0.0
-1
returns beat info as string
def Beat_disp(self): return ' '.join(str(x+self.offset) for x in self.beats)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info(self):\n out = f\"sec: {self.em_sec()}\\nmin: {self.em_min()}\"\n out += f\"\\nhora: {self.em_hora()}\\ndia: {self.em_dia()}\"\n return out", "def get_at_as_string(self):\n\n return self.at.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")", "def __str__(self):\n return_text = \"...
[ "0.66582495", "0.6518425", "0.6161863", "0.6112195", "0.6085194", "0.6056986", "0.6040513", "0.59848976", "0.5980764", "0.59712094", "0.5916152", "0.59127504", "0.5898801", "0.5861905", "0.58609194", "0.5855922", "0.58121693", "0.5801718", "0.5774646", "0.5771938", "0.574199"...
0.7030934
0
Home page for app (and project)
def index(request): username = request.session.get('username', False) profile = request.session.get('profile', False) baseurl = '' workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in with open((os.path.join(workpath,'../baseurl.txt')),'r',encoding='utf-8') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\t\t\t\t year=datetime.now().year)", "def home():\r\n return render_template(\r\n 'index.html',\r\n title='Home Page',\r\n year=datetime.now().year,\r\n )", "def homepage():\n return render_template('h...
[ "0.8311739", "0.81331044", "0.81042373", "0.80418706", "0.80418706", "0.80418706", "0.80418706", "0.80418706", "0.80418706", "0.80418706", "0.80418706", "0.80418706", "0.80418706", "0.8040029", "0.799967", "0.79859835", "0.7929723", "0.79114187", "0.7904756", "0.7903732", "0....
0.0
-1
Credits page for app
def credits(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if(username): context = {'username': username,'profile':profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return redirect('MedT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credits():\n return render_template('credits.html')", "async def credits(self, ctx: commands.Context):\r\n await ctx.send(embed=CREDITS_EMBED)", "def credits(cls):\n print(\"Thank you for playing.\\nCreated by \" + cls.author+\".\\n\")", "def contact_linkup(self, request, pk):\n o...
[ "0.7859985", "0.7057577", "0.6672508", "0.62410414", "0.6223819", "0.61764616", "0.61620957", "0.61559856", "0.61495495", "0.6127247", "0.6028435", "0.6007418", "0.5978635", "0.59492284", "0.5912205", "0.5789936", "0.57580626", "0.5750479", "0.5719444", "0.5716057", "0.571447...
0.6755606
2
Credits page for app
def uploadFile(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if(username): context = {'username': username,'profile':profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return redirect('M...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credits():\n return render_template('credits.html')", "async def credits(self, ctx: commands.Context):\r\n await ctx.send(embed=CREDITS_EMBED)", "def credits(request):\n\n username = request.session.get('username', False)\n profile = request.session.get('profile', False)\n if(username):\...
[ "0.7859985", "0.7057577", "0.6755606", "0.6672508", "0.62410414", "0.6223819", "0.61764616", "0.61620957", "0.61559856", "0.61495495", "0.6127247", "0.6028435", "0.6007418", "0.5978635", "0.59492284", "0.5912205", "0.5789936", "0.57580626", "0.5750479", "0.5719444", "0.571605...
0.0
-1
Configuration page for app
def configure(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if(username): context = {'username': username,'profile':profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return redirect('Me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configuration():", "def config():", "def config():", "def config(self):\n pass", "def config(self):\n pass", "def config():\n config_django()\n config_svisor()", "def configuration_view(project):\n project_query = Project.select().where(Project.slug == project).first()\n i...
[ "0.7428864", "0.73023534", "0.73023534", "0.7212623", "0.7212623", "0.6980258", "0.68614465", "0.68128914", "0.6723701", "0.66743726", "0.66153085", "0.66144913", "0.6602604", "0.6585713", "0.6577487", "0.6575138", "0.6562094", "0.6562094", "0.65005267", "0.64869064", "0.6486...
0.0
-1
Team members' stats page for app
def team_members_stats(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if (username): context = {'username': username, 'profile': profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_stats(self):\n print(self.team_one.name + \" stats: \")\n self.team_one.stats()\n print(self.team_two.name + \" stats: \")\n self.team_two.stats()", "def info():\n print 'Loading info page'\n\n team_list = datastore.get_all_teams(engine)\n\n return render_template('i...
[ "0.72802764", "0.7093188", "0.6892792", "0.66899914", "0.65582514", "0.6528671", "0.64821774", "0.6452844", "0.64374906", "0.64060926", "0.63946265", "0.63593155", "0.63570726", "0.6330489", "0.6300333", "0.62758255", "0.6246533", "0.6213044", "0.6185886", "0.6148427", "0.613...
0.7581212
0
Update Configuration page for app
def updateConfiguration(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if(username): context = {'username': username,'profile':profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conf_update(self):\n pass", "def update(self):\n self.save_config_file()", "def configuration_view(project):\n project_query = Project.select().where(Project.slug == project).first()\n if project_query is None:\n flash(\"invalid project\")\n return redirect(url_for(\"proje...
[ "0.7255445", "0.6736466", "0.64811534", "0.63596797", "0.6235038", "0.6235038", "0.62124354", "0.618501", "0.60655963", "0.5992609", "0.59914666", "0.59606487", "0.5928038", "0.59218657", "0.5920716", "0.5906855", "0.58799803", "0.58701694", "0.58692014", "0.58270746", "0.581...
0.606258
9