query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Process requests to add new category
def addCategory(): # authentication if 'username' not in login_session: flash('Please login to add category') return redirect(url_for('showCategories')) if request.method == 'POST': name = request.form['name'] description = request.form['description'] # vali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_categories_handler():\n rq = request.get_json()\n name = rq['name']\n picture = rq['picture']\n description = rq['description']\n category = addCategory(name, picture, description, g.user.id)\n return jsonify(category=category.serialize)", "def category_add(request: HttpRequest) -> Http...
[ "0.7432951", "0.69306815", "0.68379563", "0.6816585", "0.6750593", "0.6732125", "0.6676255", "0.657299", "0.6532126", "0.65211046", "0.6496525", "0.64803165", "0.64336693", "0.6420921", "0.64061916", "0.6383398", "0.6363358", "0.63617665", "0.63411766", "0.6331797", "0.632594...
0.62543315
26
Serve all items of the category
def showItems(category_id): # validation category = session.query(Category).filter_by(id=category_id).first() if not category: flash('Attempt to view non-existent category') return redirect(url_for('showCategories')) # authorization items = session.query(Item).filter_by(cate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self, request):\n item_categories = ItemCategory.objects.all()\n\n serializer = ItemCategorySerializer(\n item_categories, many=True, context={'request': request})\n return Response(serializer.data)", "def item_categories(request):\n all_item_categories = ItemType.obje...
[ "0.6862961", "0.6838752", "0.6832472", "0.6808409", "0.6759815", "0.65026784", "0.650165", "0.64309716", "0.64139295", "0.6298917", "0.6262579", "0.62359995", "0.6208312", "0.6195548", "0.6193358", "0.61109006", "0.6095865", "0.6091328", "0.6034134", "0.60246116", "0.5992183"...
0.6250752
11
Gets the ith bit (zeroindexed).
def get_bit(num, i): return 1 if num & 1 << i else 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bit(num, i):\n return num & (1 << i) != 0", "def __getitem__(self, index):\n nth_int, nth_bit = divmod(index, BitArray._UNSIGNED_INT)\n return self.bits[nth_int] & (1 << nth_bit)", "def _get_bit(byte, ii):\n return (byte >> (7 - ii)) & 1", "def bit_get(val, idx):\n return (...
[ "0.7826954", "0.7410046", "0.7386657", "0.73263216", "0.7222269", "0.7176076", "0.7137559", "0.71253127", "0.6973061", "0.6967496", "0.6958228", "0.69483864", "0.694268", "0.68543786", "0.6816369", "0.6688558", "0.66808105", "0.6567417", "0.6564154", "0.6555715", "0.653013", ...
0.81653005
0
This method assumes a list of full paths to the desired files's parent folders and returns NiftiImageTupleList whose item is a nested list with each sublist belonging to its parent folder
def from_folder(cls, folderpaths:FilePathList, modality:Union[str, Collection[str]], presort:bool=False, **kwargs): filepaths=[] for fp in folderpaths: filepath = get_files(fp, modality=modality, presort=True) filepaths.append(filepath) return cls(items=filepaths, pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ReadImageList(list_path):\n # with tf.gfile.GFile(list_path, 'r') as f:\n # image_paths = f.readlines()\n # image_paths = [entry.rstrip() for entry in image_paths]\n # return image_paths\n image_paths=[]\n for dir, subdir, files in os.walk(list_path):\n for file in files:\n image_paths.a...
[ "0.633106", "0.6182086", "0.60495406", "0.6004823", "0.58684045", "0.5851099", "0.58083504", "0.58037215", "0.5783839", "0.5763506", "0.5748211", "0.5731935", "0.57069534", "0.5659177", "0.5637448", "0.56329757", "0.56315774", "0.5613083", "0.56036484", "0.5602641", "0.559801...
0.0
-1
Resets the position and orientation of the mocap bodies to the same values as the bodies they're welded to.
def reset_mocap2body_xpos(self): if (self.sim.model.eq_type is None or self.sim.model.eq_obj1id is None or self.sim.model.eq_obj2id is None): return for eq_type, obj1_id, obj2_id in zip(self.sim.model.eq_type, self.sim.mode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_mocap2body_xpos(sim):\n\n if (sim.model.eq_type is None or\n sim.model.eq_obj1id is None or\n sim.model.eq_obj2id is None):\n return\n for eq_type, obj1_id, obj2_id in zip(sim.model.eq_type,\n sim.model.eq_obj1id,\n ...
[ "0.6893635", "0.6499374", "0.6466375", "0.63432604", "0.63174415", "0.6309813", "0.6250218", "0.6250218", "0.6250218", "0.6227424", "0.5993534", "0.59932613", "0.5980894", "0.5974436", "0.5955571", "0.59437466", "0.59390795", "0.5894605", "0.58935535", "0.5870204", "0.5842682...
0.7228065
0
Given a set of observations known to belong to different states, construct an object that will estimate the probability that new observations belong to each state (i.e. the p_observations_given_state matrix)
def __init__(self, state_observations, continuous=True, pseudocount=1): self.continuous = continuous state_observations = [numpy.asarray(so) for so in state_observations] if continuous: self.state_distributions = [kde.gaussian_kde(so) for so in state_observations] else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def observation_from_state(self, state):\n state_index = self.latent_variable_markov_chain.index_dict[state]\n return np.random.choice(self.observation_states,\n p=self.emission_probabilities[state_index, :])", "def __init__(self, num_states, observation_states, prior_probabil...
[ "0.68669397", "0.6462204", "0.6262085", "0.6136685", "0.6117178", "0.60850716", "0.60375464", "0.59944856", "0.5964485", "0.5952044", "0.59156275", "0.5894562", "0.5868372", "0.5867635", "0.58412325", "0.5838576", "0.5836713", "0.58103794", "0.5797326", "0.5746525", "0.571440...
0.63312227
2
Given a set of state sequences, estimate the initial and transition probabilities for each state (i.e. the p_initial and p_transition matrices needed for HMM inference).
def estimate_hmm_params(state_sequences, pseudocount=1, moving=True, time_sigma=1): state_sequences = numpy.asarray(state_sequences) n, t = state_sequences.shape s = state_sequences.max() + 1 # number of states initial_counts = numpy.bincount(state_sequences[:,0], minlength=s) + pseudocount p_initia...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initial_probabilities_from_trajectories(n_states, trajectories):\n p = np.zeros(n_states)\n\n for t in trajectories:\n p[t.transitions()[0][0]] += 1.0\n\n return p / len(trajectories)", "def init_start_prob(n_states):\n start_prob_est = np.random.rand(n_states, 1)\n start_prob_est /= np...
[ "0.6737312", "0.6540201", "0.643304", "0.64260924", "0.6414045", "0.6372045", "0.6327534", "0.63086444", "0.62992555", "0.62833136", "0.6242119", "0.61996263", "0.61793613", "0.6153507", "0.6136968", "0.6071576", "0.6045001", "0.6036908", "0.6011966", "0.5985723", "0.5974724"...
0.7366758
0
Given list of ``Tag`` instances, creates a string representation of the list suitable for editing by the user, such that submitting the given string representation back without changing it will give the same list of tags. Tag names which contain DELIMITER will be double quoted. Adapted from Taggit's _edit_string_for_ta...
def join_tags(tags): names = [] delimiter = settings.TAGGIT_SELECTIZE['DELIMITER'] for tag in tags: name = tag.name if delimiter in name or ' ' in name: names.append('"%s"' % name) else: names.append(name) return delimiter.join(sorted(names))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_string_for_tags(tags):\r\n names = []\r\n use_commas = False\r\n for tag in tags:\r\n name = tag.name\r\n if u',' in name:\r\n names.append('\"%s\"' % name)\r\n continue\r\n elif u' ' in name:\r\n if not use_commas:\r\n use_comm...
[ "0.74842143", "0.61348253", "0.60322964", "0.60187674", "0.5813906", "0.5634633", "0.5617626", "0.55532956", "0.55511045", "0.5493373", "0.54873353", "0.5473861", "0.5438646", "0.54261506", "0.54241925", "0.53745574", "0.53239423", "0.52918303", "0.52737874", "0.5259001", "0....
0.64570826
1
Returns the home page
def index(): resp = make_response(render_template("index.html", title='Home')) return resp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home() -> Any:\n return home_page()", "def home_page(self) -> str:\n return self._home_page", "def home():\n\n return render_template('home_page.html')", "def getHomePage(self):\n return self.home_url", "def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\...
[ "0.8479578", "0.83854204", "0.83666545", "0.8302552", "0.83024085", "0.8274201", "0.8258742", "0.8161644", "0.8155251", "0.8131846", "0.812928", "0.8122866", "0.8116592", "0.81114167", "0.81114167", "0.81114167", "0.81114167", "0.81114167", "0.81114167", "0.81114167", "0.8111...
0.0
-1
Return True if this is the last page in the pagination
def isLastPage(page_num, count_of_combos, per_page): if count_of_combos <= (page_num * per_page): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_last_page(self):\n return self.page == self.last_page", "def is_last_allowable_page(self):\n if self.countable:\n return False\n if self.is_last_page:\n return False\n\n # If we have 10-item pages, the max limit is 40, and we've skipped 38,\n # it's...
[ "0.9250832", "0.7880705", "0.7795402", "0.7709388", "0.76870424", "0.7639691", "0.7639691", "0.7639691", "0.75295895", "0.7466775", "0.72136486", "0.7156705", "0.71144503", "0.70103765", "0.69874054", "0.68787843", "0.67651737", "0.66790384", "0.66790384", "0.6663726", "0.664...
0.77416354
3
Read file and return content as a stripped list.
def read_file(filename): with open(filename, encoding='utf-8') as src: return [line.strip() for line in src.readlines()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_file(file_name):\n\n with open (file_name) as fd:\n content = fd.readlines()\n content = [x.strip() for x in content]\n return content", "def readFile(filePath):\n with open(filePath, 'r') as f:\n return [l.strip() for l in f.readlines()]", "def contents(filepath):\n f...
[ "0.7674723", "0.7563142", "0.72854227", "0.72751176", "0.72298235", "0.7206775", "0.7123672", "0.7109992", "0.7086859", "0.7061591", "0.70553654", "0.7049348", "0.7041807", "0.70393634", "0.6996994", "0.6992688", "0.69166696", "0.6877113", "0.6812788", "0.6768067", "0.6765748...
0.67492896
22
Fuck m. It could mean minutes or months.
def test_ambiguous_m(self): with self.assertRaises(ValueError): util.parse_relative_time_string("+3m")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _unit_mo(self):\n return (((self.time_base * 60.0) * 24.0) * 365.0) / 12", "def unit_mo(self):\n return (((self.time_base * 60.0) * 24.0) * 365.0) / 12", "def minutes(input=None):\n return get(input).minutes", "def mm(self):\n return '%02d' % self._month", "def Month(self):\n ...
[ "0.6905258", "0.68023515", "0.6735644", "0.66758174", "0.6309507", "0.6303951", "0.62606466", "0.62517", "0.6237802", "0.62091005", "0.61038035", "0.60716474", "0.60693926", "0.60643584", "0.60643584", "0.6048454", "0.6048005", "0.6045694", "0.6035083", "0.5966593", "0.592882...
0.59682554
19
Gets the absolute URL of the detail page for a given Study instance.
def get_absolute_url(self): return reverse('trait_browser:source:studies:pk:detail', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return ('publication_detail', (), {'slug': self.slug})", "def exam_url(self, obj):\n request = self.context.get(\"request\")\n return reverse(\"exam-detail\", args=[obj.id], request=request)", "def details_url(self):\n if self._data.get('details_url'):\...
[ "0.6810438", "0.6689379", "0.6567158", "0.64550245", "0.64396584", "0.64053893", "0.63963675", "0.6392365", "0.63474274", "0.63005847", "0.62952244", "0.6280981", "0.62611544", "0.62428", "0.62371224", "0.6232598", "0.62293047", "0.6219801", "0.62155926", "0.6194746", "0.6167...
0.7098282
0
Return a queryset of the current archived TaggedTraits from this study.
def get_archived_tagged_traits(self): return apps.get_model('tags', 'TaggedTrait').objects.archived().filter( trait__source_dataset__source_study_version__study=self ).current()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def archived_tags(self):\n archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').objects.archived().filter(trait=self)\n return apps.get_model('tags', 'Tag').objects.filter(\n pk__in=archived_tagged_traits.values_list('tag__pk', flat=True))", "def get_non_archived_tagged_traits(...
[ "0.77290195", "0.75084317", "0.72397757", "0.71252674", "0.65865415", "0.64593077", "0.64155614", "0.62145716", "0.61490464", "0.60586834", "0.6027033", "0.58406144", "0.5763332", "0.56548536", "0.5611018", "0.5603707", "0.5603707", "0.5603707", "0.55999005", "0.5566254", "0....
0.8213264
0
Return a queryset of the current nonarchived TaggedTraits from this study.
def get_non_archived_tagged_traits(self): return apps.get_model('tags', 'TaggedTrait').objects.current().non_archived().filter( trait__source_dataset__source_study_version__study=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_archived_tagged_traits(self):\n return apps.get_model('tags', 'TaggedTrait').objects.archived().filter(\n trait__source_dataset__source_study_version__study=self\n ).current()", "def get_all_tagged_traits(self):\n return apps.get_model('tags', 'TaggedTrait').objects.filter...
[ "0.775637", "0.73766696", "0.708502", "0.68280214", "0.6783516", "0.6571693", "0.6464671", "0.6396007", "0.63075525", "0.611397", "0.6077231", "0.60213524", "0.59917337", "0.590065", "0.5870306", "0.58424973", "0.5763946", "0.57431793", "0.56793123", "0.56793123", "0.56793123...
0.82755035
0
Return a queryset of SourceTraits that are new in this version compared to past versions.
def get_new_sourcetraits(self): previous_study_version = self.get_previous_version() SourceTrait = apps.get_model('trait_browser', 'SourceTrait') if previous_study_version is not None: qs = SourceTrait.objects.filter( source_dataset__source_study_version=self ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_previous_versions(self):\n return self.study.sourcestudyversion_set.filter(\n i_version__lte=self.i_version,\n i_date_added__lt=self.i_date_added\n ).order_by(\n '-i_version',\n '-i_date_added'\n )", "def get_new_sourcedatasets(self):\n ...
[ "0.6562757", "0.6290495", "0.6281095", "0.6281095", "0.6224384", "0.61902857", "0.6117538", "0.60669696", "0.59755343", "0.59755343", "0.59755343", "0.59755343", "0.59755343", "0.59755343", "0.59033275", "0.58881015", "0.5698667", "0.5668605", "0.5618832", "0.5610577", "0.560...
0.7811303
0
Gets the absolute URL of the detail page for a given SourceDataset instance.
def get_absolute_url(self): return reverse('trait_browser:source:datasets:detail', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n\t\treturn reverse('source-detail', args=[str(self.id)])", "def get_absolute_url(self):\n return reverse('trait_browser:source:studies:pk:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self):\n return ('publication_detail', (), {'slug': self.slug})", "def ...
[ "0.7320892", "0.71635264", "0.6769658", "0.66936725", "0.6665065", "0.66157633", "0.66050607", "0.658594", "0.65774614", "0.65592086", "0.6530993", "0.6519312", "0.6510253", "0.65062296", "0.65050864", "0.64783823", "0.64783823", "0.6441861", "0.6411554", "0.6410512", "0.6402...
0.75452507
0
Gets a list of trait_flavor_names for harmonized traits in this trait set version.
def get_trait_names(self): return self.harmonizedtrait_set.values_list('trait_flavor_name', flat=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_trait_flavor_name(self):\n return '{}_{}'.format(self.i_trait_name, self.harmonized_trait_set_version.harmonized_trait_set.i_flavor)", "def all_trait_names ( self ):\n return self.__class_traits__.keys()", "def trait_names ( self, **metadata ):\n return self.traits( **metadata ).ke...
[ "0.67714554", "0.6423445", "0.62995416", "0.6120722", "0.60873955", "0.5738161", "0.5715752", "0.57114977", "0.5705768", "0.56979", "0.56829286", "0.564801", "0.5582354", "0.55700886", "0.5551664", "0.5513089", "0.54857224", "0.54564124", "0.5443423", "0.5440488", "0.54381365...
0.8556329
0
Gets the absolute URL of the detail page for a given HarmonizedTraitSet instance.
def get_absolute_url(self): return reverse('trait_browser:harmonized:traits:detail', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return self.harmonized_trait_set_version.get_absolute_url()", "def get_absolute_url(self):\n return reverse('trait_browser:source:traits:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self):\n return reverse('trait_browser:source:studies:pk:detail', ...
[ "0.72508293", "0.70623827", "0.6548072", "0.64680207", "0.59867966", "0.59867966", "0.59520835", "0.59289813", "0.592246", "0.5918289", "0.58953965", "0.58434725", "0.5838052", "0.5814749", "0.57711065", "0.57669204", "0.57653147", "0.575038", "0.57430536", "0.5742923", "0.57...
0.7418204
0
Get a queryset of all the SourceTraits components for this harmonization unit (age, batch, or source).
def get_all_source_traits(self): return self.component_source_traits.all() | self.component_batch_traits.all() | self.component_age_traits.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_new_sourcetraits(self):\n previous_study_version = self.get_previous_version()\n SourceTrait = apps.get_model('trait_browser', 'SourceTrait')\n if previous_study_version is not None:\n qs = SourceTrait.objects.filter(\n source_dataset__source_study_version=sel...
[ "0.6352468", "0.60128826", "0.57998437", "0.56801885", "0.5599534", "0.5557096", "0.5557096", "0.52780604", "0.52433515", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.5181923", "0.49282494", "0.49022794", "0.490198...
0.71494865
0
Gets the absolute URL of the detail page for a given SourceTrait instance.
def get_absolute_url(self): return reverse('trait_browser:source:traits:detail', kwargs={'pk': self.pk})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n\t\treturn reverse('source-detail', args=[str(self.id)])", "def get_absolute_url(self):\n return reverse('trait_browser:source:studies:pk:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self):\n return reverse('trait_browser:harmonized:traits:detail', kwargs=...
[ "0.7119291", "0.7097896", "0.6950301", "0.6894759", "0.6431965", "0.63921607", "0.636551", "0.635845", "0.62975645", "0.62486935", "0.6246613", "0.62231576", "0.6212547", "0.6189846", "0.6181484", "0.6181484", "0.61728066", "0.6160209", "0.6159289", "0.615591", "0.6154543", ...
0.7710777
0
Return queryset of archived tags linked to this trait.
def archived_tags(self): archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').objects.archived().filter(trait=self) return apps.get_model('tags', 'Tag').objects.filter( pk__in=archived_tagged_traits.values_list('tag__pk', flat=True))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_archived_tags(self):\n non_archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').objects.non_archived().filter(trait=self)\n return apps.get_model('tags', 'Tag').objects.filter(\n pk__in=non_archived_tagged_traits.values_list('tag__pk', flat=True))", "def get_archived_ta...
[ "0.7533448", "0.74357784", "0.6842906", "0.6513351", "0.6450949", "0.63617426", "0.6330386", "0.630018", "0.6280889", "0.62478477", "0.6202606", "0.610521", "0.60856485", "0.6033715", "0.60267216", "0.60267216", "0.60267216", "0.60267216", "0.60267216", "0.60267216", "0.60267...
0.8736017
0
Return queryset of nonarchived tags linked to this trait.
def non_archived_tags(self): non_archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').objects.non_archived().filter(trait=self) return apps.get_model('tags', 'Tag').objects.filter( pk__in=non_archived_tagged_traits.values_list('tag__pk', flat=True))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_non_archived_tagged_traits(self):\n return apps.get_model('tags', 'TaggedTrait').objects.current().non_archived().filter(\n trait__source_dataset__source_study_version__study=self)", "def archived_tags(self):\n archived_tagged_traits = apps.get_model('tags', 'TaggedTrait').object...
[ "0.80429226", "0.7348492", "0.6551791", "0.6469715", "0.64208716", "0.63318914", "0.63318914", "0.6299178", "0.6227882", "0.6208177", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.6100119", "0.60505265", "0.60505265", "0.6050489...
0.8711702
0
Gets the absolute URL of the detail page for a given HarmonizedTrait instance. In this special case, goes to the detail page for the related trait set.
def get_absolute_url(self): return self.harmonized_trait_set_version.get_absolute_url()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_absolute_url(self):\n return reverse('trait_browser:harmonized:traits:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self):\n return reverse('trait_browser:source:traits:detail', kwargs={'pk': self.pk})", "def get_absolute_url(self):\n return reverse('trait_browser:source...
[ "0.76464415", "0.71848196", "0.64087236", "0.62061286", "0.6132978", "0.61097914", "0.6106136", "0.6106136", "0.6096563", "0.6088155", "0.60717404", "0.59662586", "0.5956779", "0.59459764", "0.593614", "0.5929176", "0.5916748", "0.5908745", "0.5904925", "0.58962184", "0.58962...
0.6393083
3
Build personalization instance from a dict
def create_personalization(self, **kwargs): personalization = Personalization() _diff = set(emailconf.PERSONALIZATION_KEYS).intersection(set(kwargs.keys())) if _diff: for key in _diff: item = kwargs.get(key) if item: if key in email...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(cls, dictionary):\n return cls(**dictionary)", "def create(cls, dictionary):\n return cls(**dictionary)", "def build_personalization(personalization):\n mock_personalization = Personalization()\n for to_addr in personalization['to_list']:\n personalization.add_to(to_addr)\...
[ "0.63244694", "0.63244694", "0.6232753", "0.6030198", "0.5900351", "0.58583313", "0.5845706", "0.58420676", "0.58329755", "0.5826959", "0.58106136", "0.579965", "0.5711809", "0.57004213", "0.57004213", "0.57004213", "0.57004213", "0.57004213", "0.57004213", "0.57004213", "0.5...
0.6677979
0
Update prefix with operator with best price.
def _update_prefix(self, prefix: str, operator: Operator): cached_operator: Optional[Operator] = self.lookup(prefix) if cached_operator: cached_price = cached_operator.price_for_prefix(prefix) if cached_price: if operator.has_better_price_for_prefix(prefix, cached...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_with_operator(self, operator: Operator):\n if not isinstance(operator, Operator):\n raise TypeError(\n f\"operator expected to be of type `Operator` but got type \"\n f\"{type(operator)}\"\n )\n\n for prefix in operator.rates.keys():\n ...
[ "0.6310741", "0.57850754", "0.57514006", "0.54723537", "0.54526275", "0.5421909", "0.53711325", "0.5362892", "0.5342558", "0.52658045", "0.5223748", "0.5185856", "0.51810634", "0.51768", "0.5171346", "0.5168897", "0.5147008", "0.50996333", "0.50994164", "0.50994164", "0.50835...
0.7551244
0
Find if a given number a prefix in cache.
def find(self, number: str) -> Optional[str]: if number in self.data: # noqa return number else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startsWith(self, prefix):\n ret = True\n curr = self.trie\n for i, ch in enumerate(prefix):\n curr = curr.get(ch, {})\n if curr:\n continue\n else:\n break\n \n if i==len(prefix)-1:\n ret = True\n ...
[ "0.6720833", "0.6547649", "0.6462857", "0.64407134", "0.6428188", "0.6415573", "0.62809837", "0.6258059", "0.61898506", "0.6167757", "0.6164689", "0.6134488", "0.61225975", "0.6088009", "0.60353285", "0.6033145", "0.6019844", "0.59988034", "0.5941386", "0.59368086", "0.591884...
0.53415996
84
Updates `PrefixCache` with data from given operator.
def update_with_operator(self, operator: Operator): if not isinstance(operator, Operator): raise TypeError( f"operator expected to be of type `Operator` but got type " f"{type(operator)}" ) for prefix in operator.rates.keys(): self._up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_prefix(self, prefix: str, operator: Operator):\n cached_operator: Optional[Operator] = self.lookup(prefix)\n if cached_operator:\n cached_price = cached_operator.price_for_prefix(prefix)\n if cached_price:\n if operator.has_better_price_for_prefix(pref...
[ "0.7683273", "0.6553203", "0.64049375", "0.52432764", "0.51866513", "0.51246953", "0.5072463", "0.5072463", "0.5058224", "0.50360274", "0.5033406", "0.49451602", "0.49146992", "0.48742005", "0.4850131", "0.4843754", "0.47898152", "0.47546908", "0.47544464", "0.47422978", "0.4...
0.68408626
1
Yield successive nsized chunks from l.
def chunks(array, size: int): for i in range(0, len(array), size): yield array[i:i + size]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.0
-1
Return a list of cleaned word tokens from the raw review
def review_to_words( review ): #Remove any HTML tags and convert to lower case review_text = BeautifulSoup(review).get_text().lower() #Replace smiliey and frown faces, ! and ? with coded word SM{int} in case these are valuable review_text=re.sub("(:\))",r' SM1',review_text) review_text=re.sub("(:\(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(review):\n\n token = strip_multiple_whitespaces(strip_punctuation(review))\n return [token.split() for token in simple_preprocess(token) if token not in STOPWORDS]", "def review_to_wordlist(review):\n\n words = review.lower().split()\n words = [w for w in words]\n return(words)", "d...
[ "0.7750979", "0.7179433", "0.717803", "0.7157436", "0.7142787", "0.6961613", "0.69389796", "0.67973894", "0.67853844", "0.6727003", "0.66734666", "0.6642047", "0.66097176", "0.6597971", "0.6580113", "0.65595573", "0.6555122", "0.6553047", "0.65236735", "0.65034825", "0.650111...
0.6859479
7
Get the latest version of an artifact from Pulse.
def GetLatest(server_url, project_name, username, password, command, name, filename, stage): server = xmlrpclib.ServerProxy(server_url + 'xmlrpc') token = server.RemoteApi.login(username, password) # Get the latest 100 builds of the tools. builds = server.RemoteApi.getLatestBuildsForProjec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def latest_release_get():\n try:\n return json_response.success({'version': version.latest_version()})\n except version.Error as e:\n return json_response.error(str(e)), 200", "async def get_latest_version(self, pkg: str) -> Optional[str]:\n return None", "def latest_version(self):\n...
[ "0.6555443", "0.6440459", "0.6415911", "0.63127923", "0.62560815", "0.6184736", "0.61423135", "0.6134404", "0.6098685", "0.6094916", "0.60846007", "0.60613364", "0.6056806", "0.6047666", "0.6035648", "0.60355157", "0.603404", "0.5991332", "0.58877105", "0.5863567", "0.5862828...
0.58272386
22
Preprocess requests by attempting to extract face image, and transforming to fit the model's input Returns list of NDArray Processed images in the model's expected input shape
def preprocess(self, request): img_list = [] input_shape = self.signature['inputs'][0]['data_shape'] [height, width] = input_shape[2:] param_name = self.signature['inputs'][0]['data_name'] # Iterate over all input images provided with the request, transform and append for infere...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(self, request):\n img_list = []\n param_name = self.signature['inputs'][0]['data_name']\n input_shape = self.signature['inputs'][0]['data_shape']\n\n for idx, data in enumerate(request):\n img = data.get(param_name)\n if img is None:\n ...
[ "0.73400545", "0.6653662", "0.65381366", "0.65293646", "0.6363785", "0.6331957", "0.6321112", "0.6304423", "0.62506974", "0.6235382", "0.6233115", "0.6188294", "0.61358917", "0.61200666", "0.6102832", "0.60749215", "0.6074793", "0.6067623", "0.6028816", "0.6026498", "0.602559...
0.81999916
0
Unmutes everyone that you have muted
def auto_unmute(): muted = set(t.mutes.users.ids(screen_name=TWITTER_HANDLE)["ids"]) # put user IDs of people you want to remain muted here users_keep_muted = set([]) # mute all for user_id in muted: if user_id not in users_keep_muted: t.mutes.users.destroy(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def unmute(self, ctx, user: Redeemed):\n if member == None or member == ctx.message.author:\n await ctx.send(\"You cannot unmute yourself!\")\n return \n await user.remove_roles(discord.utils.get(ctx.guild.roles, name=\"Muted\"))\n await ctx.send(f\"{user.mention}...
[ "0.7793159", "0.7562203", "0.7182035", "0.71422404", "0.71150947", "0.70955354", "0.7093954", "0.709301", "0.7084421", "0.7016341", "0.7013622", "0.68202204", "0.68122566", "0.67613274", "0.6734327", "0.6710592", "0.665197", "0.6545975", "0.6484686", "0.6455824", "0.64350253"...
0.8222266
0
Generate one random control character.
def make_control_character(): # Add one character made up of one codepoint each from # (High Surrogates + High Private Use Surrogates) and Low Surrogates. # We expect each such pair to behave as a single high-codepoint # character. controls = ('0000', '001F') return [unicode_char(char) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_charachter() -> chr:\r\n return chr(int(random.randrange(32, 126, 1)))", "def random_char():\n return chr(random.randrange(32, 126, 1))", "def get_random_char():\n return chr(randint(97, 122))", "def random_char(alph):\n char = alph[rand_generator.randrange(len(alph))]\n return char...
[ "0.78689873", "0.77449274", "0.72392774", "0.713114", "0.69535005", "0.68568593", "0.68473285", "0.6614242", "0.6555148", "0.65427595", "0.65427595", "0.6520578", "0.6508524", "0.643668", "0.636383", "0.63543737", "0.63341427", "0.62676865", "0.6259865", "0.6254233", "0.62498...
0.69967866
4
Extend `unichr` for all possible Unicode values (n).
def unicode_char(n): try: return unichr(n) except ValueError: # Generate bytes object packed as int. bytes_object = struct.pack('i', n) # Return decoded w/ utf-32 codec. return bytes_object.decode('utf-32')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int_to_unichr(codepoint):\n if PY2:\n return unichr(codepoint)\n return chr(codepoint)", "def make_unicode():\r\n for num in range(300, 320):\r\n yield unichr(num)", "def safe_unichr(intval):\n try:\n return unichr(intval)\n except ValueError:\n # ValueError: unic...
[ "0.68852764", "0.6683728", "0.6391506", "0.59930366", "0.586188", "0.58399165", "0.58334017", "0.5817205", "0.56382495", "0.5589591", "0.55534005", "0.54915816", "0.5490308", "0.5472899", "0.5450932", "0.5440723", "0.54287136", "0.5352844", "0.53169405", "0.5304779", "0.52560...
0.7051785
0
Test ``create_engine`` with invalid adapter.
def test_create_engine_no_adapters(): engine = create_engine("shillelagh://") with pytest.raises(ProgrammingError) as excinfo: Table("dummy://", MetaData(bind=engine), autoload=True) assert str(excinfo.value) == "Unsupported table: dummy://"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ensure_engine_exists():\n # Check if engine is present\n if not is_engine_binded():\n print(\"Binding new engine\")\n bind_engine(create_engine(\"sqlite:///:memory:\", echo=True))", "def test_engine(self):\n config = {\n \"url\": 'sqlite://',\n \"connect_args\...
[ "0.68235004", "0.66725576", "0.6549929", "0.6455361", "0.62477577", "0.6210242", "0.61840785", "0.61660314", "0.6095915", "0.60754657", "0.60633755", "0.6048799", "0.59452164", "0.5927696", "0.58780146", "0.5844836", "0.5800548", "0.57547444", "0.5749329", "0.57365346", "0.57...
0.83949554
0
Store Pandas DataFrame to csv file and upload it to bucket if ext_filename is set
def df_to_csv(self, df, local_filename, store_header=True): Path(os.path.dirname(local_filename)).mkdir(parents=True, exist_ok=True) if df is not None and len(df) > 0: df.to_csv(local_filename, header=store_header, index_label='id') logging.info('Stored data to {}'.format(local_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_to_gcs(df, file, bucket=settings.ASSETS.BUCKET):\n output_file = NamedTemporaryFile().name\n df.to_csv(output_file, compression=\"gzip\", index=False)\n upload_blob(bucket, output_file, file)", "def save_csv(self, bucket, key, df, compression=None, **kwargs):\n data_obj = df.to_csv(**kwa...
[ "0.73861694", "0.7355157", "0.7178081", "0.70948577", "0.68517673", "0.6824397", "0.6741467", "0.669252", "0.66792345", "0.6650497", "0.64886904", "0.6458609", "0.6369256", "0.6365549", "0.6350224", "0.6322278", "0.6280271", "0.6247275", "0.6216646", "0.62012947", "0.62007916...
0.6855781
4
Assert that an invalid response_type redirects back to the redirect_uri and provides the expected error response.
def test_authorize_invalid_response_type(self): invalid_params = self.valid_params.copy() invalid_params['response_type'] = 'invalid_code' # Simple GET with invalid code parameters random_state = six.text_type(uuid.uuid4()) response = self.get_json(path='/openid/authorize', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_http_error_raise_with_redirect(self):\n\n resp = self.r(\n HTTPError(http_status.HTTP_201_CREATED, redirect_url='http://google.com/')\n )\n\n self.assertIsInstance(\n resp, werkzeug.wrappers.Response\n )\n\n self.assertEqual(302, resp.status_code)\n...
[ "0.75191337", "0.72961164", "0.7171664", "0.70651674", "0.6875958", "0.67515904", "0.6627203", "0.6615773", "0.65987235", "0.6589537", "0.6552112", "0.6536879", "0.6508044", "0.6480439", "0.63691235", "0.6355215", "0.6341384", "0.6288093", "0.62804973", "0.62268054", "0.61819...
0.7701483
0
Assert that an nonexistent response_type redirects back to the redirect_uri and provides the expected error response.
def test_authorize_no_response_type(self): invalid_params = self.valid_params.copy() del invalid_params['response_type'] # Simple GET with invalid code parameters random_state = six.text_type(uuid.uuid4()) response = self.get_json(path='/openid/authorize', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authorize_invalid_response_type(self):\n invalid_params = self.valid_params.copy()\n invalid_params['response_type'] = 'invalid_code'\n\n # Simple GET with invalid code parameters\n random_state = six.text_type(uuid.uuid4())\n response = self.get_json(path='/openid/autho...
[ "0.7420597", "0.7164122", "0.6910888", "0.6648324", "0.6642587", "0.6474151", "0.64672065", "0.6405829", "0.6382179", "0.6363759", "0.63207835", "0.6319008", "0.62895614", "0.6289121", "0.62787527", "0.6247881", "0.6192791", "0.61116356", "0.61116356", "0.60881925", "0.608715...
0.73475444
1
Assert that a nonexistent client redirects back to the redirect_uri and provides the expected error response.
def test_authorize_no_client(self): invalid_params = self.valid_params.copy() del invalid_params['client_id'] # Simple GET with invalid code parameters random_state = six.text_type(uuid.uuid4()) response = self.get_json(path='/openid/authorize', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_http_error_raise_with_redirect(self):\n\n resp = self.r(\n HTTPError(http_status.HTTP_201_CREATED, redirect_url='http://google.com/')\n )\n\n self.assertIsInstance(\n resp, werkzeug.wrappers.Response\n )\n\n self.assertEqual(302, resp.status_code)\n...
[ "0.7657027", "0.7071766", "0.6945941", "0.6851474", "0.68442667", "0.6824086", "0.6791853", "0.67458946", "0.67314863", "0.66679996", "0.6664417", "0.6653209", "0.6645142", "0.6616033", "0.65255606", "0.6516541", "0.6504525", "0.6504525", "0.6461596", "0.64065444", "0.6398890...
0.6766306
7
Assert that an invalid client redirects back to the redirect_uri and provides the expected error response.
def test_authorize_invalid_client(self): invalid_params = self.valid_params.copy() invalid_params['client_id'] = 'invalid_client' # Simple GET with invalid code parameters random_state = six.text_type(uuid.uuid4()) response = self.get_json(path='/openid/authorize', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_http_error_raise_with_redirect(self):\n\n resp = self.r(\n HTTPError(http_status.HTTP_201_CREATED, redirect_url='http://google.com/')\n )\n\n self.assertIsInstance(\n resp, werkzeug.wrappers.Response\n )\n\n self.assertEqual(302, resp.status_code)\n...
[ "0.7972389", "0.7369733", "0.72958344", "0.71539176", "0.7042015", "0.70395124", "0.69947994", "0.6865802", "0.68044996", "0.6787957", "0.67493385", "0.6748754", "0.6746671", "0.66689926", "0.6647042", "0.66368335", "0.65603876", "0.65603876", "0.6511094", "0.64935255", "0.64...
0.7174641
3
Assert that an invalid scope redirects back to the redirect_uri and provides the expected error response.
def test_authorize_invalid_scope(self): invalid_params = self.valid_params.copy() invalid_params['scope'] = 'invalid_scope' # Simple GET with invalid code parameters random_state = six.text_type(uuid.uuid4()) response = self.get_json(path='/openid/authorize', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authorize_invalid_redirect_uri(self):\n invalid_params = self.valid_params.copy()\n invalid_params['redirect_uri'] = 'not_a_valid_uri'\n\n # Simple GET with invalid code parameters\n random_state = six.text_type(uuid.uuid4())\n response = self.get_json(path='/openid/auth...
[ "0.75373936", "0.7251968", "0.7147685", "0.7066093", "0.6928313", "0.6903567", "0.66213906", "0.65763414", "0.65235853", "0.6513123", "0.6497357", "0.626261", "0.61775184", "0.61602324", "0.61488956", "0.6142485", "0.6129963", "0.6106142", "0.60907656", "0.5985967", "0.598029...
0.7770297
0
Assert that a nonexistent scope redirects back to the redirect_uri and provides the expected error response.
def test_authorize_no_scope(self): invalid_params = self.valid_params.copy() del invalid_params['scope'] # Simple GET with invalid code parameters random_state = six.text_type(uuid.uuid4()) response = self.get_json(path='/openid/authorize', expec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authorize_invalid_scope(self):\n invalid_params = self.valid_params.copy()\n invalid_params['scope'] = 'invalid_scope'\n\n # Simple GET with invalid code parameters\n random_state = six.text_type(uuid.uuid4())\n response = self.get_json(path='/openid/authorize',\n ...
[ "0.75156254", "0.7148414", "0.7028421", "0.7019475", "0.7017566", "0.67602414", "0.6492892", "0.6403846", "0.6372125", "0.62288857", "0.6219358", "0.6178828", "0.6163945", "0.61515033", "0.6126656", "0.6096851", "0.60844594", "0.6039896", "0.6037854", "0.6014855", "0.5999588"...
0.72937465
1
Assert that a nonexistent redirect_uri returns a 400 message with the appropriate error message encoded in the body of the response.
def test_authorize_no_redirect_uri(self): invalid_params = self.valid_params.copy() del invalid_params['redirect_uri'] # Simple GET with invalid code parameters random_state = six.text_type(uuid.uuid4()) response = self.get_json(path='/openid/authorize', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authorize_invalid_redirect_uri(self):\n invalid_params = self.valid_params.copy()\n invalid_params['redirect_uri'] = 'not_a_valid_uri'\n\n # Simple GET with invalid code parameters\n random_state = six.text_type(uuid.uuid4())\n response = self.get_json(path='/openid/auth...
[ "0.7718685", "0.7033793", "0.6927159", "0.69097126", "0.69086397", "0.6898485", "0.6685903", "0.66302705", "0.65627855", "0.652894", "0.6524669", "0.649647", "0.6418248", "0.6401584", "0.6385468", "0.6310627", "0.6294222", "0.62791204", "0.6268177", "0.6264218", "0.62368065",...
0.7158007
1
This test ensures that a failed authorize request against the oauth endpoint succeeds with expected values.
def test_invalid_response_request(self, mock_post): self._mock_response(mock_post, valid=False) random_state = six.text_type(uuid.uuid4()) # Simple GET with various parameters response = self.get_json(path='/openid/authorize_return', expect_errors=True,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid_authorize_request(self):\n\n random_state = six.text_type(uuid.uuid4())\n\n # Simple GET with various parameters\n response = self.get_json(path='/openid/authorize',\n expect_errors=True,\n state=random_state,\n ...
[ "0.7597083", "0.7115931", "0.694993", "0.68572766", "0.68270195", "0.6803584", "0.6794347", "0.676999", "0.67678714", "0.6765921", "0.67112833", "0.6678244", "0.6673607", "0.6663366", "0.66527706", "0.6631267", "0.6621901", "0.6595489", "0.65829533", "0.65740633", "0.6573677"...
0.64417315
33
If the oauth response to storyboard is valid, but does not include a first name, it should error.
def test_invalid_redirect_no_name(self, mock_post): self._mock_response(mock_post, valid=True) random_state = six.text_type(uuid.uuid4()) invalid_params = self.valid_params.copy() del invalid_params['openid.sreg.fullname'] # Simple GET with various parameters response ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_account_failed_no_first_name(self):\n data = self.user_data.copy()\n data.pop('first_name')\n response = self.client.post(self.url, data, format='json')\n self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)\n self.assertEqual(response.data.get('mes...
[ "0.6980607", "0.67532706", "0.6614332", "0.6510425", "0.64004356", "0.6313224", "0.6111399", "0.6058819", "0.59927726", "0.5954338", "0.5952154", "0.59172636", "0.59120643", "0.5908101", "0.59018046", "0.5901233", "0.59007126", "0.58297175", "0.58180857", "0.57916963", "0.578...
0.56890607
27
If the oauth response to storyboard is valid, but does not include a first name, it should error.
def test_invalid_redirect_no_email(self, mock_post): self._mock_response(mock_post, valid=True) random_state = six.text_type(uuid.uuid4()) invalid_params = self.valid_params.copy() del invalid_params['openid.sreg.email'] # Simple GET with various parameters response = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_account_failed_no_first_name(self):\n data = self.user_data.copy()\n data.pop('first_name')\n response = self.client.post(self.url, data, format='json')\n self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)\n self.assertEqual(response.data.get('mes...
[ "0.69797575", "0.6752162", "0.6614019", "0.6509065", "0.6398914", "0.63115096", "0.6110045", "0.60614777", "0.5992452", "0.5954809", "0.59498775", "0.5918439", "0.5910095", "0.5906559", "0.59022", "0.5900585", "0.59002507", "0.58284384", "0.5816681", "0.579075", "0.57799935",...
0.0
-1
This test ensures that the access token request may execute properly with a valid token.
def test_valid_access_request(self): # Generate a valid auth token with base.HybridSessionManager(): authorization_code = auth_api.authorization_code_save({ 'user_id': 2, 'state': 'test_state', 'code': 'test_valid_code' }) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_read_o_auth_access_token(self):\n pass", "def test_create_o_auth_access_token(self):\n pass", "def test_access_token_get(self):\n client = oauth.Client(self.consumer, None)\n resp, content = client.request(self._uri('request_token'), \"GET\")\n\n self.assertEqual(int...
[ "0.8008994", "0.79901123", "0.7986423", "0.7827258", "0.76730573", "0.7581791", "0.7542795", "0.7538852", "0.7517634", "0.7500351", "0.7455751", "0.7445823", "0.7411423", "0.73875546", "0.7371738", "0.7253156", "0.72491294", "0.72450924", "0.72399", "0.7238495", "0.72369736",...
0.82178074
0
This test ensures that invalid grant_type parameters get the appropriate error response.
def test_invalid_grant_type(self): # Generate a valid auth token with base.HybridSessionManager(): authorization_code = auth_api.authorization_code_save({ 'user_id': 2, 'state': 'test_state', 'code': 'test_valid_code', 'expires...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testInvalidGrantType(self):\n request = self.generateValidTokenRequest(arguments={'grant_type': b'grantType\\xFF\\xFF'},\n authentication=self._VALID_CLIENT)\n result = self._TOKEN_RESOURCE.render_POST(request)\n self.assertFailedTokenRequest...
[ "0.772801", "0.72654927", "0.726257", "0.70829815", "0.68463784", "0.677205", "0.6727337", "0.6633874", "0.651238", "0.6486372", "0.6486188", "0.64548945", "0.6451076", "0.6325722", "0.62595737", "0.6252418", "0.6246032", "0.6237852", "0.6236558", "0.6236232", "0.61953956", ...
0.8002551
0
This test ensures that invalid grant_type parameters get the appropriate error response.
def test_invalid_access_token(self): content_type = 'application/x-www-form-urlencoded' # POST with content: application/x-www-form-urlencoded response = self.app.post('/v1/openid/token', params={ 'code': 'invalid_access_toke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_grant_type(self):\n\n # Generate a valid auth token\n with base.HybridSessionManager():\n authorization_code = auth_api.authorization_code_save({\n 'user_id': 2,\n 'state': 'test_state',\n 'code': 'test_valid_code',\n ...
[ "0.8002551", "0.772801", "0.72654927", "0.70829815", "0.68463784", "0.677205", "0.6727337", "0.6633874", "0.651238", "0.6486372", "0.6486188", "0.64548945", "0.6451076", "0.6325722", "0.62595737", "0.6252418", "0.6246032", "0.6237852", "0.6236558", "0.6236232", "0.61953956", ...
0.726257
3
This test ensures that an invalid refresh token can be converted into a valid access token.
def test_invalid_refresh_token(self): content_type = 'application/x-www-form-urlencoded' # Generate an auth and a refresh token. resp_1 = self.app.post('/v1/openid/token', params={ 'refresh_token': 'invalid_refresh_token', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_legacy_client_invalid_refresh_token_expired_access_token(self):\n self.legacy_client._client._expires_at = 1\n self.legacy_client.token['refresh_token'] = 'invalidrefreshtoken'\n response = self.legacy_client.request('GET', urljoin(BASE_URL, MOCK_ENDPOINT))\n self.assertEquals(...
[ "0.77855164", "0.7776032", "0.76719224", "0.76533115", "0.73654115", "0.7338942", "0.7290583", "0.7267676", "0.7238647", "0.71473265", "0.7119978", "0.7110751", "0.70527965", "0.7029916", "0.69989884", "0.69802237", "0.69181126", "0.6860301", "0.68478835", "0.6846695", "0.682...
0.8209073
0
Test retrieving all players
def test_retrieve_players(self): Player.objects.create(name='Mayita', victories=0, defeats=0) Player.objects.create(name='Moiso', victories=0, defeats=0) res = self.client.get(PLAYERS_URL) players = Player.objects.all().order_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gridironfootballplayers_get(self):\n pass", "def test_get_player(self):\n pass", "def test_player_index(self):\n player = Player(first_name='George', last_name='Smith')\n player.save()\n response = self.client.get(reverse('players'))\n self.assertQuerysetEqual...
[ "0.7851354", "0.7392498", "0.7249521", "0.7195039", "0.7023699", "0.69242185", "0.6841736", "0.68325335", "0.6792121", "0.6791838", "0.67904574", "0.6744118", "0.67069584", "0.6672156", "0.6652354", "0.6647714", "0.6608296", "0.6586247", "0.6585509", "0.6544839", "0.6533784",...
0.80052656
0
Test creating a new player with invalid payload
def test_create_player_invalid(self): payload = {'name': ''} res = self.client.post(PLAYERS_URL, payload) self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_player_created(self):\n res = self.client().post('api/v1/players/new', headers={'Content-Type': 'application/json'}, data=json.dumps(self.player))\n json_data = json.loads(res.data)\n self.assertTrue(json_data.get('jwt_token'))\n self.assertEqual(res.status_code, 201)", "def test_create_play...
[ "0.7495499", "0.74699783", "0.738127", "0.718221", "0.69524", "0.67708266", "0.6658256", "0.66042596", "0.6594715", "0.6582349", "0.6539508", "0.6506546", "0.6504157", "0.6490392", "0.6451788", "0.64410824", "0.6428347", "0.64130753", "0.6399742", "0.6389613", "0.63864726", ...
0.8654237
0
Return a new nonisomorphic binary construction tree. The more details of the operation is introduced by "Global partial orders from sequential data." return BinaryConstructionTree
def BCT_operators(self): leaves_original = [node for node, degree in self.tree.out_degree().items() if degree == 0] def split(node): # ## # Return bin-tuple of the orphaned tree # # Parameter: # node: string # # Return:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gen_test_tree_2():\n tree = BinaryNode(5)\n tree.left = BinaryNode(3)\n tree.left.left = BinaryNode(2)\n tree.left.left.left = BinaryNode(1)\n tree.left.right = BinaryNode(4)\n tree.right = BinaryNode(7)\n tree.right.left = BinaryNode(6)\n tree.right.right = BinaryNode(8)\n tree.right.right.right = B...
[ "0.65642774", "0.6500897", "0.6352472", "0.63450235", "0.63373", "0.62749153", "0.61108404", "0.6084624", "0.6027772", "0.59640837", "0.59385914", "0.5929737", "0.58415216", "0.577208", "0.5737982", "0.56831825", "0.56814563", "0.56281656", "0.5611284", "0.5605383", "0.557073...
0.56648934
17
Return a float value of inclusion probability. f(pv, s) = product_{v in s}(pv) product_{v not in s}(1 pv)
def probability_of_generating_containing_events(M, s): # initialize the probabilities of generating containing events. f = 1 s_with_inclusion_probabilities = inclusion_probability(M, s) for v, p in s_with_inclusion_probabilities.items(): f *= p return f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inclusion_probability(M, s):\n\n # initialize a dictionary to store events with inclusion probabilites\n s_with_inclusion_probabilites = {}\n\n # calculating the events of intersection and difference.\n V = [i for i in M.tree.nodes() if not (i.__contains__('parallel') or i.__contains__('series'))]\...
[ "0.65426224", "0.61161095", "0.61135066", "0.5821492", "0.57806534", "0.5777198", "0.5777198", "0.5770672", "0.57525903", "0.5751081", "0.5734077", "0.5697218", "0.5689497", "0.5657795", "0.5614329", "0.55981725", "0.5575849", "0.5567694", "0.5567694", "0.5539852", "0.5490724...
0.63304335
1
Sets the integration direction.
def _set_integration_direction(self, T0, Tend): if Tend is None: # Use the default which is increasing from 0K return if T0 > Tend: self._integration_direction = "decreasing" else: self._integration_direction = "increasing"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDirection(self,stepDir = 2):\n pass", "def setdirection(self, *args, **kwargs):\n return _coordsys.coordsys_setdirection(self, *args, **kwargs)", "def direction(self, direction):\n\n self._direction = direction", "def set_direction(self, new_dir):\n self.__direction = new_d...
[ "0.7542952", "0.7146989", "0.69682", "0.69272983", "0.69205153", "0.68018293", "0.68018293", "0.67248225", "0.67248225", "0.6560766", "0.649372", "0.6449591", "0.6381216", "0.6296564", "0.6294324", "0.6231282", "0.61218536", "0.60626364", "0.60610044", "0.6020907", "0.6015768...
0.76403767
0
Returns true if we reached the temperature end point.
def _reached_temperature_end_point(self, T, Tend): if Tend is None: # End point not give return False if self._integration_direction == "increasing": if T > Tend: return True elif self._integration_direction == "decreasing": if T <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_done(self):\n return True if self.t >= self.max_ep_len else False", "def if_end(self, **kwargs):\n\n index = self.get('_index')\n\n if index and index >= len(self.steps)-1:\n return True # all steps have been used\n\n return False", "def isFinished(self):\n ...
[ "0.68749845", "0.6486663", "0.64634204", "0.640316", "0.6394104", "0.6357551", "0.6345655", "0.63410616", "0.6326322", "0.63182914", "0.62896657", "0.62468636", "0.6238003", "0.6207513", "0.62044257", "0.6198576", "0.6184775", "0.61823577", "0.6150872", "0.61056906", "0.60730...
0.83553135
0
Convert an infix expression into a postfix expression. Assumes valid inputs.
def infix_to_postfix(infix_expr): # Append adds new item to list # Concat creates a new list every time instead opstack = StackArray() res = [] lstr = infix_expr.split() # l_para = r_para = 0 # operator precedence dict prec = { # higher val = higher prec "(" : 4, "^" : 3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infix_to_postfix(expr):\n # you may find the following precedence dictionary useful\n prec = {'*': 2, '/': 2,\n '+': 1, '-': 1}\n ops = Stack()\n postfix = []\n toks = expr.split()\n ### BEGIN SOLUTION\n opp = {'*', '/','+', '-'}\n for x in toks:\n if str.isdigit(x):\n...
[ "0.8245655", "0.81716263", "0.81700593", "0.80590487", "0.8047456", "0.79754585", "0.7934097", "0.7881377", "0.78311", "0.78090227", "0.77986723", "0.7725289", "0.7692288", "0.7676367", "0.76296026", "0.7615798", "0.7514298", "0.740857", "0.72536755", "0.72062165", "0.7127465...
0.81546026
3
To test for an invalid postfix expression. You may assume that what is passed in is a string that only contains numbers and operators. These are separated into valid tokens by spaces so you can use split and join as necessary.
def postfix_valid(postfix_expr): expr = postfix_expr.split() count = 0 if postfix_expr == "": return False for token in expr: if token[0] in '0123456789': count += 1 elif token == '~': pass else: # all other binary operators count -= 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(string):\n \n tokens = string.split()\n \n # Remembers if the previous token was an operator\n opflag = True\n \n ## Highly inefficient validity checking begins here ##\n \n # List of operators as they would appear in the infix expression\n operators = ['+', '-', '*', '/'...
[ "0.7520136", "0.6987341", "0.69246596", "0.6914398", "0.67455107", "0.6717881", "0.6708455", "0.67051095", "0.66992074", "0.6603976", "0.6578779", "0.6534092", "0.646224", "0.6458865", "0.6412046", "0.63550186", "0.63059497", "0.62621725", "0.6261374", "0.6159734", "0.6157778...
0.7960342
0
Returns the position of the set
def getPosition(self): return self.target, min(self.points), max(self.points)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pos_index(self):\n return [self.row-1, self.col-1]", "def position(self) -> int:\n return self.__pos", "def get_position(self) -> Tuple[int]:\n return self.position.copy()", "def position(self) -> int:\n return self._position", "def position(self) -> int:\n return...
[ "0.6859874", "0.6829911", "0.6805826", "0.67513704", "0.67513704", "0.6703119", "0.66213673", "0.6594951", "0.65801644", "0.65507245", "0.65507245", "0.65316844", "0.65316015", "0.652383", "0.64963824", "0.64877045", "0.64877045", "0.64877045", "0.64748806", "0.6474069", "0.6...
0.0
-1
Testing {% ageid %} with yesterday
def test_with_now_minus_1_day(self): self.assertEqual(ageid(self.now - timedelta(1)), 'age2')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), '...
[ "0.6852591", "0.68312496", "0.6746986", "0.63439506", "0.55546343", "0.5394519", "0.5380408", "0.53524274", "0.532431", "0.53095055", "0.5292067", "0.5264989", "0.52530444", "0.5232551", "0.5178952", "0.5160872", "0.5160872", "0.51382077", "0.5128389", "0.51267356", "0.512673...
0.71235526
0
Testing {% ageid %} with two days ago
def test_with_now_minus_2_days(self): self.assertEqual(ageid(self.now - timedelta(2)), 'age3')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'age2')", "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), 'age4')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'a...
[ "0.7187669", "0.71045613", "0.69863856", "0.6409827", "0.6115783", "0.6011794", "0.59129065", "0.58910406", "0.5766613", "0.57489073", "0.570259", "0.5692219", "0.56637126", "0.5635098", "0.56275165", "0.5569759", "0.5563165", "0.5558488", "0.55378413", "0.5536425", "0.551116...
0.74781424
0
Testing {% ageid %} with three days ago
def test_with_now_minus_3_days(self): self.assertEqual(ageid(self.now - timedelta(3)), 'age4')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'a...
[ "0.72407234", "0.71853626", "0.69618046", "0.6308967", "0.5874855", "0.5764519", "0.57058084", "0.5670079", "0.5669819", "0.56191695", "0.55904025", "0.5588826", "0.5547945", "0.55410856", "0.54885393", "0.5463492", "0.54514664", "0.5433101", "0.5414855", "0.5414855", "0.5396...
0.7658383
0
Testing {% ageid %} with four days ago
def test_with_now_minus_4_days(self): self.assertEqual(ageid(self.now - timedelta(4)), 'age5')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), 'age4')", "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'a...
[ "0.74405986", "0.7243347", "0.7164045", "0.64622", "0.61869997", "0.5989337", "0.5977138", "0.59006375", "0.58485234", "0.58320135", "0.5765161", "0.57545257", "0.5669327", "0.56675255", "0.5645776", "0.56452954", "0.5626133", "0.56260896", "0.5614728", "0.5614728", "0.560904...
0.76875675
0
Set a limit to indicate the list should be truncated.
def set_limit(self, limit, truncated=False): self.limit = {'limit': limit, 'type': 'limit', 'truncated': truncated}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_limit(self, limit):\n self.limit = limit\n self._prune()", "def limit(self, limit):\n self._limit = limit", "def limit(self, limit):\n raise NotImplementedError(\"This should have been implemented.\")", "def limit(self, limit):\n\n self._limit = limit", "def limit...
[ "0.75690305", "0.74136245", "0.7268453", "0.7227085", "0.7227085", "0.7227085", "0.7150918", "0.7135207", "0.70293975", "0.701623", "0.6900221", "0.68999344", "0.6751625", "0.6742927", "0.6742424", "0.66420597", "0.6582306", "0.64915013", "0.6447758", "0.6411383", "0.6300985"...
0.79677534
0
Set the hybrid weights and normalize.
def set_weights(self, weights): self._weights = weights self.normalize_weights() ########################added #self.get_weights()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_weights(self):\n total_weight = sum(self.weights)\n self.norm_weights = self.weights / float(total_weight)", "def init_weights(self) -> None:\n nn.init.kaiming_normal_(self._U)\n nn.init.kaiming_normal_(self._W)\n nn.init.kaiming_normal_(self._V)\n\n nn.ini...
[ "0.72134966", "0.6985224", "0.69822764", "0.6975164", "0.6933884", "0.6900587", "0.6896751", "0.6887905", "0.68712306", "0.6845061", "0.68007916", "0.6796026", "0.6750444", "0.67392725", "0.6735572", "0.6713388", "0.6695148", "0.6688466", "0.6679644", "0.6679555", "0.66673744...
0.68913823
7
Normalize weight vector. Negative weights set to zero, and whole vector sums to 1.0.
def normalize_weights(self): # Set negative weights to zero # Normalize to sum to one. self.new_weight=[] for i in self._weights: if any(i < 0 for i in self._weights): self.new_weight = [0,1] elif all(i == 0 for i in self._weig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_weights(self):\n total_weight = sum(self.weights)\n self.norm_weights = self.weights / float(total_weight)", "def normalize(self, weights):\n tot = sum(weights)\n newW = [-1] * self.numParticles\n for i in range(len(weights)):\n newW[i] = weights[i] / t...
[ "0.81079364", "0.789293", "0.7727452", "0.77199495", "0.76464504", "0.7522993", "0.7492114", "0.74709684", "0.7452147", "0.74076146", "0.73972994", "0.7382311", "0.72835106", "0.7223835", "0.72054964", "0.71810776", "0.7152016", "0.7151621", "0.71274734", "0.7124058", "0.7097...
0.8004195
1
Verify user's email address.
def verify_user(self, tokendict): return self.post('verify', tokendict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_email(self, data):\n user = account_models.User.objects.filter(username__iexact=data, is_active=True)\n if user:\n return data\n raise serializers.ValidationError(\"Email address not verified for any user account\")", "def verify_email(uid, token):\n return True", ...
[ "0.734524", "0.7308401", "0.72833353", "0.72769487", "0.7266312", "0.7222744", "0.719752", "0.7192644", "0.7154709", "0.71305126", "0.7122744", "0.7122744", "0.711976", "0.7107592", "0.70995986", "0.70905817", "0.7075895", "0.7061155", "0.7052013", "0.70404774", "0.70316905",...
0.0
-1
Normalize time in arbitrary timezone to UTC naive object.
def normalize_time(timestamp): offset = timestamp.utcoffset() if offset is None: return timestamp return timestamp.replace(tzinfo=None) - offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_to_utc(date, timezone):\n local_tz = pytz.timezone(timezone)\n new_date = date.replace(tzinfo = local_tz)\n utc_tz = pytz.timezone('UTC')\n new_date = new_date.astimezone(utc_tz)\n return new_date", "def normalize_time(timestamp):\r\n offset = timestamp.utcoffset()\r\n if offse...
[ "0.7121004", "0.70751613", "0.68719333", "0.6638765", "0.6492223", "0.6492223", "0.64689595", "0.6383807", "0.63305354", "0.6259214", "0.6201917", "0.61943454", "0.6189186", "0.61438674", "0.6071864", "0.6052293", "0.6044807", "0.6037905", "0.60008335", "0.60007656", "0.59903...
0.7118167
1
Return the difference between two timing objects.
def delta_seconds(before, after): delta = after - before return total_seconds(delta)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self):\r\n return self.t2 - self.t1", "def _subtract_times(self, a, b):\n td = a - b\n return td.days * 24 * 60 + td.seconds // 60", "def time_diff(dt1, dt2):\n return abs(int((dt2 - dt1).total_seconds()))", "def elapsed(t1, t2):\n # Use the timedelta's standard formatting...
[ "0.7564027", "0.73061734", "0.7275471", "0.7021707", "0.6927145", "0.6924693", "0.69082826", "0.6850764", "0.6742648", "0.6573544", "0.6448123", "0.6372256", "0.6367635", "0.6340591", "0.62391603", "0.6200217", "0.61754555", "0.61506987", "0.61456347", "0.6129372", "0.6069111...
0.0
-1
Return the total seconds of datetime.timedelta object.
def total_seconds(delta): try: return delta.total_seconds() except AttributeError: return ((delta.days * 24 * 3600) + delta.seconds + float(delta.microseconds) / (10 ** 6))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_seconds(td):\n return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6", "def total_seconds(self):\n return (\n (self.days * 86400 + self.seconds) * 10**6 + self.microseconds\n ) / 10**6", "def get_total_seconds(td):\n return (td.microseconds + (td...
[ "0.7660376", "0.76501614", "0.7579259", "0.74830866", "0.7447662", "0.7263316", "0.72183", "0.71539515", "0.70629454", "0.70629454", "0.7046123", "0.70381135", "0.6981377", "0.6980456", "0.6966398", "0.6944039", "0.68772465", "0.682706", "0.6801305", "0.67495024", "0.674575",...
0.75388104
3
Check if vocab file doesn't exist, create from corpus file
def check_vocab(vocab_file, out_dir, check_special_token=True, sos=None, eos=None, unk=None): if tf.gfile.Exists(vocab_file): utils.print_out("# Vocab file %s exist"%(vocab_file)) vocab, vocab_size = load_vocab(vocab_file) if check_special_token: if not u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_vocab(targets, fname):\n\n\tpath = os.path.join(\"data\", fname)\n\tif not os.path.isfile(path):\n\t\tworddict, wordcount = vocab.build_dictionary(targets)\n\t\tvocab.save_dictionary(worddict, wordcount, path)\n\n\treturn path", "def create_vocab(data_files, vocab_fname):\n chars = set()\n for data...
[ "0.6977475", "0.6754829", "0.67372584", "0.6708775", "0.66447884", "0.65663725", "0.6565397", "0.65651417", "0.64246404", "0.63713026", "0.6286252", "0.62843806", "0.62478554", "0.6221544", "0.6218052", "0.62025714", "0.6173772", "0.6173772", "0.6156694", "0.61282647", "0.610...
0.61879635
16
Return device specific attributes.
def device_info(self): model = self.data.wiserSmart.getWiserDeviceInfo(self.appliance_id).get("modelId") return { "name": self.appliance_name, "identifiers": {(DOMAIN, self.unique_id)}, "manufacturer": MANUFACTURER, "model": model, }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributes(self, device_id=0):\n\t\t\treturn cuda.Device(device_id).get_attributes()", "def device_info(self) -> Optional[Dict[str, Any]]:\n return {ATTR_NAME: self.name, \"identifiers\": {(DOMAIN, self._device.device_id)}}", "def device_state_attributes(self):\n attrs = {\n ATTR_A...
[ "0.80724686", "0.7450437", "0.742771", "0.7409806", "0.7293218", "0.72523683", "0.72523683", "0.719905", "0.7175151", "0.7155777", "0.7155777", "0.71476424", "0.7145971", "0.71375567", "0.7095317", "0.7051197", "0.703671", "0.7035435", "0.7017325", "0.7013673", "0.70050514", ...
0.66067904
77
Return the polling state.
def should_poll(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\r\n alarm = self._alarm()\r\n return alarm.state", "def _get_state(self):\n # gst's get_state function returns a 3-tuple; we just want the\n # status flag in position 1.\n return self.pipeline.get_state(Gst.CLOCK_TIME_NONE)[1]", "def state(self):\n ...
[ "0.70800793", "0.69442177", "0.6918493", "0.6845751", "0.68327427", "0.67729336", "0.67729336", "0.6728276", "0.6668334", "0.6641413", "0.6641413", "0.6641413", "0.6641413", "0.6641413", "0.66395515", "0.66395515", "0.66395515", "0.66395515", "0.66395515", "0.66395515", "0.66...
0.0
-1
Convert an adjacency graph in scipy sparse matrix format into an iGraph format.
def convert_sparse_to_igraph(indices, matrix): # sources, targets = matrix.nonzero() # weights = matrix[sources, targets] # weights = np.array(weights)[0] # print(dir(louvain)) # ig = igraph.Graph(zip(sources, targets), directed=True, # edge_attrs={'weight': weights}) # return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_nxgraph(G):\n return nx.to_scipy_sparse_matrix(G).astype('float32')", "def create_adjacency_matrix(graph):\n index_1 = [edge[0] for edge in graph.edges()]\n index_2 = [edge[1] for edge in graph.edges()]\n values = [1 for edge in graph.edges()]\n node_count = max(max(index_1)+1,max(index_2...
[ "0.7428788", "0.698894", "0.6937286", "0.6890723", "0.6840507", "0.6761767", "0.6671198", "0.6508733", "0.64971626", "0.6486387", "0.64698505", "0.6466938", "0.6412773", "0.6366936", "0.6302056", "0.61876756", "0.615492", "0.6137109", "0.61366796", "0.60860234", "0.6081462", ...
0.79616356
0
Reads in a file as a dataframe, expects genes as rownames, cells as colnames
def read_exprs_as_df(fn): df = pd.read_table(fn, index_col=0).T return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_data(fname, cols):\n df = (pd.read_csv(fname, header=None, sep=r\"\\s+\", comment=\"#\",\n names=cols, dtype=np.float64)\n .iloc[1:]) # First line is the total number of trees\n # Could reset_index, but we don't shuffle the DataFrame\n return df", "def _read_gff...
[ "0.68378675", "0.6703915", "0.65640306", "0.64664686", "0.6444617", "0.6426337", "0.64188665", "0.6380153", "0.6320563", "0.63187337", "0.6276507", "0.62567705", "0.62567705", "0.62567705", "0.6245474", "0.62407905", "0.62309635", "0.62281895", "0.61989623", "0.61345327", "0....
0.0
-1
Return datasource metadata for a dataproduct.
def dataproduct_datasource(self, ows_layer, session): metadata = {} if ows_layer.type == 'group': # group layer return metadata data_set = ows_layer.data_set_view.data_set data_source = data_set.data_source if data_source.connection_type == 'database': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataproduct(self, identity, dataproduct_id):\n metadata = {}\n\n permissions = self.permission.dataproduct_permissions(\n dataproduct_id, identity\n ) or {}\n\n session = self.config_models.session()\n\n # find Group or Data layer object\n OWSLayer = self.co...
[ "0.74106634", "0.6391926", "0.60912377", "0.60485494", "0.57594264", "0.5758313", "0.5735054", "0.56168944", "0.55876154", "0.55693054", "0.5500405", "0.54809636", "0.5465075", "0.54416764", "0.5426445", "0.53999317", "0.5371702", "0.53709596", "0.5331371", "0.53281933", "0.5...
0.61659366
2
Split comma separated values into list.
def split_values(self, value): if value: return [s.strip() for s in value.split(',')] else: return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_by_comma(s):\n return s.strip().split(\",\")", "def separate_comma(s):\n return s.split(',')", "def to_python(self, value):\n # Return an empty list if no input was given.\n if not value:\n return []\n return value.split(',')", "def pure_list(comma_list):\n ...
[ "0.78025526", "0.76226556", "0.7475591", "0.72795135", "0.7144818", "0.69944984", "0.69677824", "0.6933669", "0.6908274", "0.68442553", "0.6830242", "0.6824286", "0.67987007", "0.67562747", "0.6737418", "0.6710399", "0.67035455", "0.66600406", "0.6642529", "0.6638843", "0.660...
0.8507184
0
Initialize some callbacks inline Use this constructor to provide credentials and certificate callbacks inline, instead of defining your own class for these ones. You can e.g. also pass in one of the credential objects as 'credentials' instead of creating a function which returns a hardcoded object.
def __init__(self, credentials=None, certificate=None): if credentials is not None: self.credentials = credentials if certificate is not None: self.certificate = certificate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, req, credentials_fn):\n self.req = req\n self.credentials_fn = credentials_fn", "def __init__(self, cred=None, max_tries=5, callback=newcred):\n self.set_cred(cred)\n self.try_count = 1\n self.max_tries = max_tries\n self.callback = callback", "def _...
[ "0.65539837", "0.64415884", "0.6256035", "0.6152882", "0.61327577", "0.6122212", "0.60726905", "0.5963776", "0.5948654", "0.5945171", "0.5938793", "0.59084725", "0.59006447", "0.58869493", "0.5884443", "0.5865886", "0.58515286", "0.5847019", "0.57956296", "0.5794808", "0.5778...
0.7311035
0
This method returns database object.
def get_db(self): self.logger.info('in get_db()') try: return self.client[self.db_name] except Exception as e: self.logger.error(f'Error occurred while getting client {e}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db(self) -> Database:\n return self.impl.db", "def db(self):\n return DbManager(self)", "def _get_db(self):\n return DB(\n ClientStorage.ClientStorage((self.server, self.port))\n )", "def get_db(self):\n return self._db", "def get_db():\n # this is a bit...
[ "0.86168927", "0.8025105", "0.79949725", "0.7977423", "0.79444736", "0.7923698", "0.77936614", "0.77742386", "0.7715764", "0.77024984", "0.7693181", "0.76827276", "0.76591754", "0.76430446", "0.7642511", "0.7626138", "0.7614707", "0.7599347", "0.7566285", "0.7554123", "0.7538...
0.70857936
78
Compute softmax probabilities for all actions.
def softmax(x1, x2, x3, beta): xs = np.array((x1, x2, x3)) num = np.exp(xs * beta) den = np.exp(xs * beta).sum() return num / den
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(inputs):\n probs = np.exp(inputs)\n # print(probs.shape)\n # t = np.sum(probs, axis=0)\n # print(t.shape)\n\n probs /= np.sum(probs, axis=0)[np.newaxis,:]\n return probs", "def softmax(x):\n shape = x.shape\n probs = np.exp(x - np.max(x, axis=len(shape) - 1, keepdims=True))\n ...
[ "0.7465903", "0.73197216", "0.71343404", "0.71002626", "0.70893115", "0.70893115", "0.6964765", "0.6963534", "0.69254", "0.6904407", "0.6894728", "0.6893124", "0.68816084", "0.68766975", "0.68731517", "0.6869365", "0.6868904", "0.6868904", "0.6868904", "0.6868904", "0.6868904...
0.0
-1
Checks to see if the user is a librarian for certain routes
def librarian(f): @wraps(f) def decorated_function(*args, **kwargs): if current_user.lflag == 0: flash("You are not a librarian! Please sign in to a librarian account") return redirect(url_for('main')) return f(*args, **kwargs) return decorated_function
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def librarian_list(request):\n librarian = User.objects.filter(is_student=False, is_lecturer=False, is_parent=False, is_superuser=False)\n user_type = \"Librarian\"\n context = {\n \"librarian\": librarian,\n \"user_type\": user_type,\n }\n return render(request, 'library/librarians_li...
[ "0.62187976", "0.55780613", "0.5519553", "0.54693735", "0.5451162", "0.5360155", "0.53441876", "0.53240615", "0.53006685", "0.5292587", "0.5280629", "0.5270738", "0.5257878", "0.52497697", "0.5249029", "0.52322376", "0.5221979", "0.521075", "0.52094173", "0.5189399", "0.51697...
0.60173243
1
Initializes the Backtest. A Queue is used to hold the Events. The Signals, Orders, and Fills are counted.
def __init__(self, csv_dir, symbol_list, initial_capital, heartbeat, start_date, end_date, data_handler, execution_handler, portfolio, strategy, strat_params_list=None): self.csv_dir = csv_dir self.symbol_list = symbol_list self.initial_capital = initial_capital self.hea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._events = collections.deque()\n self._alarms = 0\n self._alarm_active = True\n self._kq = select.kqueue()\n self._kq_events = {}\n self.traceback = ()\n self.event_count = 0\n self._no_tb = False", "def on_init(self, queue=None, *...
[ "0.7210904", "0.7131795", "0.7033969", "0.6756145", "0.673009", "0.67163557", "0.6671295", "0.6656317", "0.6647535", "0.6618624", "0.6594603", "0.6594603", "0.6594603", "0.6594603", "0.6594603", "0.65499914", "0.6525102", "0.6469497", "0.6469497", "0.6403421", "0.63916034", ...
0.0
-1
Initializes the Backtest. A Queue is used to hold the Events. The Signals, Orders, and Fills are counted.
def __init__(self, csv_dir, symbol_list, initial_capital, heartbeat, start_date, data_handler, execution_handler, portfolio, strategy, strat_params_list=None): self.csv_dir = csv_dir self.symbol_list = symbol_list self.initial_capital = initial_capital self.heartbeat = h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._events = collections.deque()\n self._alarms = 0\n self._alarm_active = True\n self._kq = select.kqueue()\n self._kq_events = {}\n self.traceback = ()\n self.event_count = 0\n self._no_tb = False", "def on_init(self, queue=None, *...
[ "0.72095853", "0.71329", "0.70346403", "0.6754693", "0.67315227", "0.6717928", "0.6671912", "0.66584927", "0.6648384", "0.662001", "0.65959483", "0.65959483", "0.65959483", "0.65959483", "0.65959483", "0.6550823", "0.652473", "0.6470759", "0.6470759", "0.64041936", "0.639307"...
0.0
-1
Get player's opponent piece.
def opponent(self, player): # player = core.BLACK (can do this for any static var) if player == core.BLACK: return core.WHITE else: return core.BLACK
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getOpponent(self):\n return self.__opponent", "def get_opponent(self):\n for cell in self.__state.board.find_workers():\n player = self.__state.board.get_player_id(cell[0], cell[1])\n if not player == self.__pid:\n return player", "def opponent(self):\n ...
[ "0.7492938", "0.7264806", "0.7049177", "0.7040058", "0.68809295", "0.6790353", "0.6682499", "0.6642669", "0.6617875", "0.6548825", "0.65392536", "0.639095", "0.63774604", "0.63774604", "0.63543737", "0.6320625", "0.6320233", "0.6275478", "0.62690526", "0.62504077", "0.6211759...
0.70919555
2
Compute player's score (number of player's pieces minus opponent's).
def score(self,player, board): numPlayer = 0 numOpp = 0 for i in self.squares(): if board[i] == player: numPlayer+= SQUARE_WEIGHTS[i] else: numOpp+=SQUARE_WEIGHTS[i] return numPlayer-numOpp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def score2(self,player, board):\r\n numPlayer = 0\r\n numOpp = 0\r\n for i in self.squares():\r\n if board[i] == player:\r\n numPlayer+= 1\r\n else:\r\n numOpp+=1\r\n return numPlayer-numOpp", "def score(player, board):\n mine...
[ "0.77100617", "0.76665014", "0.7596806", "0.755954", "0.74644375", "0.7270104", "0.72659296", "0.7192504", "0.71761346", "0.70750165", "0.70623815", "0.7020574", "0.6970311", "0.69272745", "0.69137883", "0.68977886", "0.6897169", "0.68841004", "0.68778896", "0.68595576", "0.6...
0.7846785
0
Compute player's score (number of player's pieces minus opponent's).
def score2(self,player, board): numPlayer = 0 numOpp = 0 for i in self.squares(): if board[i] == player: numPlayer+= 1 else: numOpp+=1 return numPlayer-numOpp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def score(self,player, board):\r\n numPlayer = 0\r\n numOpp = 0\r\n for i in self.squares():\r\n if board[i] == player:\r\n numPlayer+= SQUARE_WEIGHTS[i]\r\n else:\r\n numOpp+=SQUARE_WEIGHTS[i]\r\n return numPlayer-numOpp", "def scor...
[ "0.7845445", "0.7665763", "0.7595392", "0.7558798", "0.74634653", "0.72690827", "0.72640866", "0.7191977", "0.7175509", "0.7073882", "0.70610803", "0.7019335", "0.696953", "0.69266623", "0.6912282", "0.6897905", "0.68971044", "0.68832207", "0.68773335", "0.68591225", "0.68503...
0.7709773
1
Clip the values of x from eps to 1eps and renormalize them so that they sum to 1.
def clip_and_renorm(x, eps=1e-5): x = np.clip(x, eps, 1-eps) return x / x.sum()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def threshold_and_normalize_pixels(x, eps=1e-2):\n x = torch.clamp(x, min=eps)\n x = x / torch.sum(x, dim=1, keepdim=True)\n return x", "def _normalize(x):\n tol = 1e-10\n dims = x.shape\n\n x = x.flatten()\n inverse = (np.sum(x**2) + tol) ** -.5\n x = x * inverse\n ...
[ "0.716385", "0.71209276", "0.7078646", "0.6867248", "0.68503493", "0.68422705", "0.6825308", "0.6799856", "0.6776279", "0.6757192", "0.66739017", "0.66679573", "0.6650903", "0.650148", "0.6492298", "0.64902186", "0.64388424", "0.642077", "0.6390071", "0.63312405", "0.6331007"...
0.76624894
0
Returns a (mid_row, mid_peg) tuple between (start_row, start_peg) and (end_row, end_peg).
def mid(start_row, start_peg, end_row, end_peg): if start_row + 2 == end_row: mid_row = start_row + 1 elif start_row == end_row + 2: mid_row = start_row - 1 elif start_row == end_row: mid_row = start_row if start_peg + 2 == end_peg: mid_peg = start_peg + 1 elif start...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startAndEnd(self):\n upperRow = 0\n upperCol = 0\n lowerRow = 0\n lowerCol = 0\n if self.selectionMode == kSelectionNone:\n upperRow = self.penRow\n upperCol = self.penCol\n lowerRow = self.penRow\n lowerCol = self.penCol\n e...
[ "0.6485405", "0.59999824", "0.599718", "0.57569534", "0.57080907", "0.5679897", "0.5622903", "0.5562309", "0.5506314", "0.5498558", "0.54762554", "0.54337853", "0.53962946", "0.5344107", "0.53079104", "0.52601105", "0.5217689", "0.5206089", "0.51990014", "0.51918226", "0.5168...
0.84714884
0
Compare two waypoints to see whether they are the same (within 0.5 m and 0.5 m/s)
def is_same_waypoint(self, wp1, wp2, max_d=0.5, max_v=0.5): dl = lambda a, b: math.sqrt((a.x-b.x)**2 + (a.y-b.y)**2 + (a.z-b.z)**2) ddif = dl(wp1.pose.pose.position, wp2.pose.pose.position) if ddif < max_d: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __comparing_points(self, point1, point2) -> bool:\n return (abs(point1.x - point2.x) <= self.dirt_pos_tolerance and abs(\n point1.y - point2.y) <= self.dirt_pos_tolerance)", "def match(uspec1, uspec2):\n \n if uspec1.is_power_onoff() and uspec2.is_power_onoff():\n return True\n...
[ "0.66216546", "0.65738994", "0.6439483", "0.6387838", "0.6352702", "0.63003606", "0.6274246", "0.6252439", "0.6230331", "0.62167144", "0.6209074", "0.62022907", "0.61987966", "0.61629647", "0.6139927", "0.61213946", "0.6107632", "0.6103632", "0.6090313", "0.6084919", "0.60797...
0.73450947
0
Self attention layer with memory layernorm > attn > dropout > residual
def forward(self, input_, context, pos_emb, mask_tgt, mask_src, mems=None, incremental=False, incremental_cache=None): # incremental=False, incremental_cache=None, reuse_source=True): assert context is None, "This model does not have an context encoder" coin = True if se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(\n self,\n x: torch.Tensor,\n self_attn_mask: torch.Tensor = None,\n self_attn_padding_mask: torch.Tensor = None,\n need_weights: bool = False,\n pos_bias=None\n ):\n residual = x\n\n if self.layer_norm_first:\n ...
[ "0.65101606", "0.6506882", "0.6454085", "0.644183", "0.64174455", "0.63672817", "0.633365", "0.63287926", "0.63155437", "0.6293508", "0.62866867", "0.6259745", "0.6250611", "0.62303746", "0.61847997", "0.6182898", "0.61732996", "0.61547047", "0.6128263", "0.60605913", "0.6054...
0.0
-1
initialize wight from uniform distribution
def init_w(self, size): return np.random.uniform(self.r_min, self.r_max, size=size)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def WeightInitializer():\n return np.random.uniform(-1, 1)", "def init_weights(self):\n \n self.w = np.random.randn(self.D) / np.sqrt(self.D)", "def initializeDistribution(self):\n if (self.lowerBoundUsed == False and self.upperBoundUsed == False):\n self._distribution = distribution1D...
[ "0.75663126", "0.75101614", "0.7399138", "0.7150266", "0.7104282", "0.6855432", "0.6811932", "0.680855", "0.68040025", "0.67960006", "0.6785514", "0.6735542", "0.6665591", "0.6612042", "0.66110617", "0.66074973", "0.660375", "0.66020495", "0.66020495", "0.6600997", "0.6600997...
0.71774215
3
Gets the uuid of this ConnectionEndPoint.
def uuid(self) -> str: return self._uuid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uuid(self) -> str:\n return self.__uuid", "def uuid(self):\n\n return self.__uuid", "def uuid(self): # type: ignore\n return self._uuid", "def uuid(self):\n return self._uuid", "def uuid(self):\n return self._uuid", "def uuid(self):\n return self.__uuid", ...
[ "0.7309623", "0.72664577", "0.7230148", "0.718938", "0.718938", "0.7181145", "0.7181145", "0.71802694", "0.70388645", "0.6739499", "0.6739499", "0.6739499", "0.67321247", "0.66511244", "0.66511244", "0.66511244", "0.6575948", "0.6560892", "0.6525945", "0.64700735", "0.6458992...
0.73261946
2
Gets the name of this ConnectionEndPoint.
def name(self) -> List[NameAndValue]: return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return '{} {}'.format(self._device,\n self._endpoint)", "def peername(self):\n return self.socket_.getpeername()", "def get_name(self):\n \n return 'Socket/IP'", "def getsockname(self):\r\n return self._fd.getsockname()", "de...
[ "0.756051", "0.7227606", "0.7097569", "0.7072862", "0.7072641", "0.70398873", "0.70217276", "0.6980249", "0.6921586", "0.690786", "0.689965", "0.6873805", "0.68566614", "0.67906415", "0.6777492", "0.67392117", "0.6666829", "0.6663832", "0.6663832", "0.6663832", "0.66534466", ...
0.0
-1
Sets the name of this ConnectionEndPoint.
def name(self, name: List[NameAndValue]): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self._name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\r\n self.__name = name", "def setname(self, name):\n self.__name = name", "def set_name(self, n...
[ "0.71360976", "0.71320254", "0.71320254", "0.7090261", "0.7078964", "0.7067687", "0.7067687", "0.7067687", "0.7067687", "0.7067687", "0.70375973", "0.70223016", "0.6999807", "0.6930449", "0.6930449", "0.6898523", "0.68954396", "0.68885785", "0.68592894", "0.68592894", "0.6801...
0.0
-1
Gets the operational_state of this ConnectionEndPoint.
def operational_state(self) -> str: return self._operational_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_status(self):\n return self._conn_state", "def get_connection_state(self):\n return self.connection_state", "def state(self):\n return pn_connection_state(self._impl)", "def connection_status(self):\n return self._connection_status", "def status(self) -> Optional[pulumi....
[ "0.68319815", "0.68308073", "0.6515286", "0.64101964", "0.6124702", "0.6124702", "0.6124702", "0.6124702", "0.6071668", "0.5983941", "0.5983941", "0.5983941", "0.59587127", "0.59099543", "0.5899447", "0.58726335", "0.5847335", "0.5847335", "0.5847335", "0.5847335", "0.5847335...
0.75950426
0
Gets the lifecycle_state of this ConnectionEndPoint.
def lifecycle_state(self) -> str: return self._lifecycle_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lifecycle_state(self):\n return self._lifecycle_state", "def lifecycle_state(self):\n return self._lifecycle_state", "def lifecycle_state(self):\n return self._lifecycle_state", "def lifecycle_state(self):\n return self._lifecycle_state", "def lifecycle_state(self):\n ...
[ "0.77957743", "0.77957743", "0.77957743", "0.77957743", "0.77957743", "0.6779853", "0.637915", "0.6131513", "0.612186", "0.59888816", "0.5882657", "0.5882657", "0.5882657", "0.5882657", "0.5882657", "0.57937056", "0.57937056", "0.57503927", "0.57503927", "0.57503927", "0.5750...
0.7214624
5
Gets the termination_direction of this ConnectionEndPoint.
def termination_direction(self) -> str: return self._termination_direction
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def termination_direction(self, termination_direction: str):\n allowed_values = [\"BIDIRECTIONAL\", \"SINK\", \"SOURCE\", \"UNDEFINED_OR_UNKNOWN\"] # noqa: E501\n if termination_direction not in allowed_values:\n raise ValueError(\n \"Invalid value for `termination_directio...
[ "0.6747025", "0.6339703", "0.6330633", "0.6314831", "0.6202958", "0.61843795", "0.61089504", "0.6067965", "0.60548645", "0.5998903", "0.5955845", "0.59224766", "0.58646476", "0.5852054", "0.5817432", "0.5813375", "0.5800287", "0.57266474", "0.5713044", "0.57085085", "0.570361...
0.8100644
0
Sets the termination_direction of this ConnectionEndPoint.
def termination_direction(self, termination_direction: str): allowed_values = ["BIDIRECTIONAL", "SINK", "SOURCE", "UNDEFINED_OR_UNKNOWN"] # noqa: E501 if termination_direction not in allowed_values: raise ValueError( "Invalid value for `termination_direction` ({0}), must be ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_termination(self, termination):\n # FIXME should be internally accessible only?\n self.__termination = termination", "def termination_direction(self) -> str:\n return self._termination_direction", "def direction(self, direction):\n\n self._direction = direction", "def set_...
[ "0.640824", "0.63931453", "0.56420517", "0.5394109", "0.53315324", "0.52557427", "0.52557427", "0.52557427", "0.5211987", "0.51994586", "0.5056376", "0.5056376", "0.5051297", "0.5051297", "0.5045381", "0.5027594", "0.4985935", "0.4943825", "0.49381512", "0.49232072", "0.48966...
0.7977831
0
Gets the termination_state of this ConnectionEndPoint.
def termination_state(self) -> str: return self._termination_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def termination(self):\n return self.__termination", "def get_ssl_termination(self):\n return self.manager.get_ssl_termination(self)", "def terminating_on(self):\n return self._terminating_on", "def terminated(self):\n return self._terminated", "def terminated(self):\n re...
[ "0.65559936", "0.6262929", "0.62271124", "0.6188171", "0.6188171", "0.6125202", "0.60600793", "0.6005115", "0.5923498", "0.56676537", "0.5665788", "0.56531096", "0.5590717", "0.557181", "0.5468976", "0.5463126", "0.5419899", "0.5410675", "0.5404743", "0.5395988", "0.5296206",...
0.7544638
0