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
Check if the object is a sequence (list, tuple etc.).
def _is_sequence(obj): return hasattr(obj, "__iter__") and not isinstance(obj, str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isSequence(obj):\n # type: (Any) -> bool\n return isinstance(obj, Sequence)", "def issequence(obj) -> bool:\n return hasattr(type(obj), '__iter__') and hasattr(type(obj), '__len__')", "def is_sequence(value):\n return (hasattr(value, \"__iter__\") and not\n isinstance(value, (six.str...
[ "0.8953333", "0.83248264", "0.7846735", "0.78247154", "0.78127986", "0.7638199", "0.74116284", "0.7345645", "0.7330602", "0.7319191", "0.7267001", "0.725599", "0.7080316", "0.6960354", "0.6894684", "0.68897045", "0.6880353", "0.687899", "0.6847223", "0.6815162", "0.6810685", ...
0.8593363
1
The atom indices for the bonds in the view.
def atom_idxs(self): return np.array([atom.atom_idxs for atom in self])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_indices(self):\r\n return self._indices", "def getIndices(self):\r\n return self._indices", "def indices(self) -> np.ndarray:\n return self.impl.indices", "def indices(self):\n return self.index.indices", "def binding_site_idxs(self):\n\n return self._receptor_idx...
[ "0.69417524", "0.68456584", "0.6845123", "0.6833176", "0.6666939", "0.6659314", "0.6579228", "0.6572174", "0.6467447", "0.6447904", "0.6446042", "0.63287413", "0.62753254", "0.6251202", "0.6206059", "0.61795497", "0.61464053", "0.6144061", "0.6110637", "0.6079771", "0.6059443...
0.77573925
0
np.array the bond orders of the bonds in the view.
def order(self): return np.array([bond.order for bond in self])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_bond_orders(molecule):\n return nps.vtk_to_numpy(molecule.GetBondOrdersArray())", "def get_bond_order(molecule, bond_index):\n return molecule.GetBondOrder(bond_index)", "def orders(self):\n return np.arange(31, 10, -1, dtype=int)", "def getOrderList(self):\r\n\t\treturn self.pair.or...
[ "0.71431446", "0.62650025", "0.61989427", "0.6098361", "0.601775", "0.5986392", "0.58253336", "0.58168155", "0.579146", "0.57281893", "0.56735283", "0.55524075", "0.55313927", "0.5515426", "0.5496617", "0.54656833", "0.5457667", "0.54537314", "0.54495215", "0.54152876", "0.53...
0.80799085
0
np.array whether each of the bonds in the view are aromatic.
def is_aromatic(self): return np.array([bond.is_aromatic for bond in self])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_achromatic(self) -> bool:\n\n value = self._space.is_achromatic(self.coords(nans=False))\n if value is None:\n xyz = self.convert('xyz-d65')\n return bool(xyz._space.is_achromatic(xyz[:-1]))\n return value", "def is_ray(self): \n return False", "d...
[ "0.57014066", "0.5680662", "0.5631589", "0.5606931", "0.5606931", "0.55910355", "0.5567891", "0.5567891", "0.55659467", "0.5511951", "0.5505132", "0.5489161", "0.54765666", "0.5468775", "0.5465771", "0.5451662", "0.54257923", "0.541142", "0.5406786", "0.5404114", "0.5395802",...
0.82127804
0
np.array whether each of the bonds in the view are c onjugated.
def is_conjugated(self): return np.array([bond.is_conjugated for bond in self])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test01(self):\n a = np.arange(1, 11) < 0\n b = bcolz.carray(a)\n wt = a.nonzero()[0].tolist()\n cwt = [i for i in b.wheretrue()]\n # print \"numpy ->\", a.nonzero()[0].tolist()\n # print \"where ->\", [i for i in b.wheretrue()]\n self.assertTrue(wt == cwt, \"whe...
[ "0.6017207", "0.6000847", "0.5998023", "0.5995041", "0.59912586", "0.5845757", "0.5743255", "0.5733359", "0.5656569", "0.56321657", "0.5623796", "0.5616919", "0.5582934", "0.55598396", "0.5553415", "0.5527968", "0.55156106", "0.5472473", "0.5447129", "0.5441544", "0.54214376"...
0.68522453
0
Show the index template.
def index(request): return render(request, "products/index.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self):\n\t\treturn render_template('index.html')", "def show_index_page():\n\n return render_template('index.html')", "def index(self):\n return render_template('main/index.html')", "def index():\n return render_template(\"index.html\",\n title='Index')", "d...
[ "0.8361439", "0.83110887", "0.83001566", "0.82826036", "0.8219167", "0.81996936", "0.81876254", "0.81876254", "0.8184232", "0.8007108", "0.80016726", "0.80016726", "0.7974979", "0.7951259", "0.7909838", "0.7909586", "0.7909586", "0.7909586", "0.7909586", "0.7909586", "0.79095...
0.0
-1
Convert letters to 1, then spaces to 0
def to_10(s): s = re.sub(r'\w', '1', s) s = re.sub(r'\s', '0', s) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change(st):\n return ''.join('1' if a in st.lower() else '0' for a in map(chr, range(97, 123)))", "def convert_char(char):\n if char == 'F' or char == 'L':\n return 0\n \n return 1", "def wordToKeypad(word):\n return ''.join([alphaValues.get(letter, \"0\") for letter in word])", "def ...
[ "0.7043855", "0.65437925", "0.63354343", "0.61945313", "0.60676545", "0.59969145", "0.59881645", "0.58923453", "0.5853847", "0.58344865", "0.5796575", "0.5765858", "0.5754348", "0.575012", "0.57421476", "0.5740566", "0.57312405", "0.57276917", "0.5709102", "0.5668213", "0.566...
0.6459986
2
Compute softmax values for array x.
def softmax(x): e_x = np.exp(x - np.max(x)) return e_x / e_x.sum()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(self, x):\n\n out = np.zeros(x.shape)\n for i in range(x.shape[0]):\n max_x = x[i] - np.max(x[i])\n out[i] = np.exp(max_x) / np.sum(np.exp(max_x), axis=0)\n\n return out", "def softmax(x: npt.NDArray) -> npt.NDArray:\n row_wise_max = np.max(x, axis=1).res...
[ "0.90306276", "0.88411176", "0.8807707", "0.87764406", "0.8773226", "0.8753934", "0.8752351", "0.8746926", "0.87418604", "0.872269", "0.8716919", "0.87027436", "0.8698795", "0.8689462", "0.8689462", "0.8688854", "0.8682719", "0.8676888", "0.8666252", "0.8654555", "0.8654555",...
0.8649669
33
Set the internal value to value.
def put(self, value): with self.mutex: self.value = value return self.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_value(self, val):\n self._value = val", "def set_value(self, val):\n self._value = val", "def set_value(self, value):\n self.value = value", "def set_value(self, value):\n self.value = value", "def set_value(self, value):\n self.value = value", "def setValue(sel...
[ "0.84153163", "0.84153163", "0.8398162", "0.8398162", "0.8398162", "0.83873045", "0.83410496", "0.82258886", "0.8221155", "0.815362", "0.815362", "0.815362", "0.815362", "0.815362", "0.815362", "0.814524", "0.814524", "0.81419665", "0.8130044", "0.8097627", "0.79245067", "0...
0.0
-1
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('Hello! Let\'s explore some US bikeshare data!') # get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs #city = input ('Select from the following cities that you would like information for:\n : ') # For all user input...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.66718096", "0.6536446", "0.64608175", "0.63732874", "0.6349621", "0.6310782", "0.62876326", "0.6260145", "0.6230216", "0.62113076", "0.62061083", "0.61823773", "0.61707395", "0.6170415", "0.6160548", "0.6158978", "0.6154724", "0.61454946", "0.6130887", "0.61055917", "0.610...
0.5688391
95
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): df = pd.read_csv(CITY_DATA[city]) df['Start Time'] = pd.to_datetime(df['Start Time']) df['month'] = df['Start Time'].dt.month df['day'] = df['Start Time'].dt.weekday_name df['hour'] = df['Start Time'].dt.hour if month != 'all': # use the index of t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.81320685", "0.8108889", "0.8045821", "0.8042514", "0.80090284", "0.80071104", "0.79991937", "0.7998333", "0.7988789", "0.797905", "0.79737365", "0.79610896", "0.7956163", "0.7947432", "0.79463065", "0.7908287", "0.7908229", "0.7904569", "0.7900715", "0.78930074", "0.788921...
0.78407556
27
Displays statistics on the most frequent times of travel. Used Calendar module to convert the numeric month into the more userfriendly textual month name.
def time_stats(df): print('\nCalculating The Most Frequent Times of Travel...\n') start_time = time.time() #adding histogram of times plt.hist(df['Start Time'].dt.hour, bins='auto', edgecolor='black') plt.title('Histogram of Travel Frequency by Hour') plt.xlabel('Hour of the Day') plt....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\n test= months[df['month'].mode()[0]]\n print('\\nCalculating The Most Frequent Times of Travel...\\n')\n start_time = time.time()\n\n # TO DO: display the most common month\n print(\"\\nThe most common month of travel is {}\".format(months[df['month'].mode()[0]]))\n\n # TO DO...
[ "0.7455488", "0.74537337", "0.73997486", "0.73617023", "0.7342227", "0.72462046", "0.7226487", "0.7205983", "0.7191425", "0.7183063", "0.71794474", "0.7170179", "0.71687156", "0.7157346", "0.7138861", "0.71286833", "0.7116405", "0.7114478", "0.7106604", "0.70895314", "0.70776...
0.0
-1
Displays statistics on the most popular stations and trip.
def station_stats(df): print('\nCalculating The Most Popular Stations and Trip...\n') start_time = time.time() # display most commonly used start station popular_start_station = df['Start Station'].mode().loc[0] print('Most Popular Starting Station: ',popular_start_station) # display mos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m...
[ "0.78170687", "0.76637906", "0.75547594", "0.74924624", "0.7475916", "0.7447317", "0.74322265", "0.7424947", "0.74187243", "0.7401574", "0.7388717", "0.73868257", "0.7366443", "0.7360476", "0.735797", "0.7356537", "0.73533744", "0.7352685", "0.7351529", "0.73434633", "0.73414...
0.0
-1
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() # display total travel time tot_travel = df['Trip Duration'].sum() print('Total Travel Time: ',tot_travel) # display mean travel time mean_time = df['Trip Duration'].mean() print('Mean ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri...
[ "0.814274", "0.8025143", "0.80041367", "0.79496753", "0.7937415", "0.79312176", "0.7926815", "0.7915187", "0.79142886", "0.7908032", "0.79055744", "0.7900715", "0.7891682", "0.78894734", "0.7886722", "0.78851086", "0.7884266", "0.7882474", "0.78738385", "0.78686154", "0.78664...
0.7773498
54
Renders the home page.
def home(): return render_template( 'index.html', title='Home Page', year=datetime.now().year, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template('home_page.html')", "def home():\n\n return render_template(\"home.html\")", "def home():\n return render_template('home.html')", "def home():\n return render_template('home.html')", "def ...
[ "0.85574406", "0.853399", "0.8351404", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.827363", "...
0.8061255
37
Renders the about page.
def about(): return render_template( 'about.html', title='About', year=datetime.now().year, message='Your application description page.' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82680845", "0.8243358", "0.8239194", "0.8224137", "0.82079816", "0.8204868", "0.8173699", "0.8172736", "0.80967313", "0.80501616", "0.80501616", "0.80501616", "0.80501616", "0.80501616", "0....
0.82709616
8
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=0' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.822267", "0.8221825", "0.8221825", "0.8221825", "0.8221825", "0.81952775", "0.81124204", "0.808633", "0.79727536", "0.7865728", "0.76610935", "0.723666", "0.7158999", "0.71525455", "0.71525455", "0.7150065", "0.7150065", "0.71414053", "0.71365863", "0.7127653", "0.7127653"...
0.8162643
17
Closes the underlying output file.
def close(self): self.output.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_output(out_file):\n require_type(is_output(out_file), 'the parameter must be an output file')\n out_file.close()", "def close(self):\n self.file_out.close()", "def close(self):\n self.out_file.close()", "def endFileOutput(self):\n self._outputFile.close()", "def close(s...
[ "0.81632054", "0.81522524", "0.8151966", "0.78645605", "0.7511011", "0.7478327", "0.74634", "0.7455484", "0.732646", "0.71555287", "0.71359456", "0.71359456", "0.71114486", "0.7106999", "0.7101728", "0.70255077", "0.69981396", "0.69981396", "0.6960758", "0.694434", "0.694434"...
0.7678095
4
Setup and teardown temporary directory.
def mp_tmpdir(): # shutil.rmtree(TEMP_DIR, ignore_errors=True) os.makedirs(TEMP_DIR) yield TEMP_DIR shutil.rmtree(TEMP_DIR, ignore_errors=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.tmp = TemporaryDirectory()", "def setUp(self):\n self.tmpdir = mkdtemp()", "def setUp(self):\n tempDir.safe_mkdir(parents=True)\n os.chdir(tempDir.as_posix())", "def setUp(self):\n super(TestCaseWithTempDir, self).setUp()\n self.tempdir = tempfile.mkd...
[ "0.7995422", "0.78868467", "0.7843819", "0.77916664", "0.77854973", "0.77854973", "0.75484604", "0.7543933", "0.7543756", "0.7522257", "0.7467853", "0.7435784", "0.73330086", "0.7324915", "0.7301948", "0.7295143", "0.72937727", "0.72930557", "0.7277404", "0.72572505", "0.7249...
0.7419959
12
Store dataset with `dataset_id` as the unique internal ID. Store a new dataset with an ID given by `dataset_id` is exists, otherwise reate a random UUID for this dataset. Additionally, set the created at time to the current time and the state to pending.
def save(self, dataset_id=None): if dataset_id is None: dataset_id = uuid.uuid4().hex record = { DATASET_ID: dataset_id, DATASET_OBSERVATION_ID: uuid.uuid4().hex, self.AGGREGATED_DATASETS: {}, self.CREATED_AT: strftime("%Y-%m-%d %H:%M:%S", gmt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_dataset(self, dataset_uuid):\n assert os.path.exists(os.path.join(DATASETS_PATH, dataset_uuid))\n self.dataset_uuid = dataset_uuid\n if self.name is None:\n self.set_name(dataset_uuid)", "def create_sandbox_dataset(project_id, dataset_id):\n sandbox_dataset_id = get_...
[ "0.6872541", "0.67768544", "0.65597034", "0.6500556", "0.64891326", "0.6260515", "0.6190658", "0.6178079", "0.61668134", "0.6085386", "0.6083766", "0.6072766", "0.60193026", "0.597889", "0.5921548", "0.588775", "0.5882537", "0.5871939", "0.58687705", "0.58431363", "0.58337504...
0.74322355
0
Return dataset for `dataset_id`.
def find_one(cls, dataset_id): return super(cls, cls).find_one({DATASET_ID: dataset_id})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset(self, dataset_id):\n return self.session.query(self.Dataset).get(dataset_id)", "def get_dataset(self):\n return datasets.get_dataset(self.dataset_id)", "def get_by_id(self, id: str) -> \"Dataset\":\n raise NotImplementedError", "def get(id: str) -> DataSet:\n pass"...
[ "0.87192416", "0.7682555", "0.73775953", "0.7224774", "0.72125584", "0.7157496", "0.7112476", "0.71070707", "0.7094702", "0.70392627", "0.69897205", "0.698843", "0.69881594", "0.69881594", "0.69881594", "0.6905936", "0.6899166", "0.6862082", "0.68138504", "0.68037826", "0.669...
0.6918197
15
Return datasets for `dataset_id`.
def find(cls, dataset_id): return super(cls, cls).find({DATASET_ID: dataset_id})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_dataset(self, dataset_id=None):\n url = self.prism_endpoint + \"/datasets\"\n\n if dataset_id is not None:\n url = url + \"/\" + dataset_id\n\n headers = {\"Authorization\": \"Bearer \" + self.bearer_token}\n\n r = requests.get(url, headers=headers)\n\n if r.s...
[ "0.7884486", "0.75144154", "0.7392964", "0.6875546", "0.6868735", "0.6659589", "0.6614666", "0.6582767", "0.6564071", "0.654725", "0.65078", "0.63993484", "0.6361446", "0.6280215", "0.6217165", "0.6205369", "0.6194097", "0.6089962", "0.60555714", "0.6054278", "0.6034563", "...
0.60536957
20
Return observations for this dataset.
def observations(self, query=None, select=None, limit=0, order_by=None, as_cursor=False): return Observation.find(self, query, select, limit=limit, order_by=order_by, as_cursor=as_cursor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def observations(self):\n\n ret = np.zeros_like(self._observations)\n for input in range(len(self._observations)):\n ret[input] = self._observations[input].getSlice(0)\n\n return ret", "def observations(self):\n\n ret = np.zeros_like(self._observations)\n for input i...
[ "0.8173518", "0.8173518", "0.758575", "0.7192722", "0.70841736", "0.706311", "0.6824516", "0.6673921", "0.6642235", "0.6618175", "0.6481312", "0.6464544", "0.64575475", "0.6423998", "0.6414631", "0.63178444", "0.6313938", "0.6257978", "0.625366", "0.62309194", "0.62019455", ...
0.6612331
10
Update `dataset` with new `data`.
def add_observations(self, json_data): record = self.record update_id = uuid.uuid4().hex self.add_pending_update(update_id) new_data = json.loads(json_data) calculator = Calculator(self) new_dframe_raw = calculator.dframe_from_update( new_data, self.schema.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_data(self, newData):\r\n self.AllData = newData", "def update(self, data):\n self.data.update(data)", "def update_dataset(self, dataset, name=None, description=None):\n uri = URITemplate(self.baseuri + '/{owner}/{id}').expand(\n owner=self.username, id=dataset)\n ...
[ "0.7308878", "0.724746", "0.72205055", "0.7133375", "0.70761704", "0.7068003", "0.7047015", "0.7026002", "0.6970092", "0.68575656", "0.68533146", "0.68532693", "0.678265", "0.67550033", "0.6750984", "0.67439884", "0.6743443", "0.6742223", "0.6731198", "0.6703996", "0.6675124"...
0.0
-1
Center on a object in both height and sway
def object_center(self, goal): self.depth_I = 0. def rc_to_obj(self, goal): """Add constant rc commands to depth and heading hold""" channels = self.depth_heading_rc(goal) # move to object yrc_cmd = self.get_obj_y(goal, False) zrc_cmd = self.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center(self):\r\n self.centerx = self.screen_rect.centerx \r\n self.centery = self.screen_rect.centery", "def center_mario(self):\n self.rect.midbottom = self.screen_rect.midbottom\n self.x, self.y = float(self.rect.x), float(self.rect.y)", "def center(self):\n if self.pos ...
[ "0.7481983", "0.7481805", "0.7405797", "0.7365858", "0.7092228", "0.70797455", "0.6959974", "0.6954687", "0.6925074", "0.69002175", "0.6896049", "0.68865335", "0.68865335", "0.67773294", "0.6770409", "0.6770409", "0.6770409", "0.6770409", "0.67658645", "0.6759881", "0.6758974...
0.0
-1
Create a bit array of a given size filled with zeros or ones.
def __init__(self, nbits, fill=0): # assuming that the size of ``unsigned int`` is 32 bits. if divisible(nbits, BitArray._UNSIGNED_INT): nints = nbits // BitArray._UNSIGNED_INT else: nints = (nbits // BitArray._UNSIGNED_INT) + 1 fill = (2 ** BitArray._UNSIGNED_INT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary(num, size=32):\n ret = np.zeros(size, dtype=np.int)\n n = np.array([int(x) for x in list(bin(num)[2:])])\n ret[ret.size - n.size:] = n\n return ret", "def binary(num, size=32):\n ret = np.zeros(size, dtype=np.int)\n n = np.array([int(x) for x in list(bin(num)[2:])])\n ret[ret.size...
[ "0.7106937", "0.7106937", "0.675236", "0.66336364", "0.6578361", "0.65058696", "0.638559", "0.63830644", "0.61971086", "0.61812276", "0.6166116", "0.6155007", "0.6145402", "0.6141965", "0.6109589", "0.6097868", "0.6072402", "0.5999301", "0.5969802", "0.5967384", "0.59644526",...
0.6161984
11
Get the bit at ``index``.
def __getitem__(self, index): nth_int, nth_bit = divmod(index, BitArray._UNSIGNED_INT) return self.bits[nth_int] & (1 << nth_bit)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bit_get(val, idx):\n return (val >> idx) & 1", "def bit(self, idx: int) -> int:\n pos = self.start() + idx\n chunk = self.raw_key()[(pos // 8)]\n bit = pos % 8\n return ((1 << bit) & chunk) >> bit", "def get_bit(self, register, bit_index):\n return (self.device.rea...
[ "0.7827475", "0.72956824", "0.7177435", "0.70147115", "0.7011416", "0.6986113", "0.69496924", "0.68439037", "0.6742177", "0.67403346", "0.673317", "0.66872543", "0.6674189", "0.66248083", "0.65586466", "0.6533622", "0.6520334", "0.63393116", "0.6215593", "0.6115247", "0.61138...
0.84909666
0
A factory wrapper function to perform some of the boilerplate involved in making cuPy RawKernels typeagnostic. Until a better method is created, either by RAPIDS or cuPy, this function will perform a string search and replace of cbased datatype primitives in ``nvrtc_kernel_str`` using a numerical placeholder (eg. {0}, ...
def cuda_kernel_factory(nvrtc_kernel_str, dtypes, kernel_name=None): dtype_strs = get_dtype_strs(dtypes) for idx, dtype in enumerate(dtypes): nvrtc_kernel_str = nvrtc_kernel_str.replace( "{%d}" % idx, dtype_strs[idx] ) kernel_name = f"""{uuid1() if kernel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_kernel_string(kernel_name, kernel_string, params, grid, threads, block_size_names):\n logging.debug('prepare_kernel_string called for %s', kernel_name)\n\n grid_dim_names = [\"grid_size_x\", \"grid_size_y\", \"grid_size_z\"]\n for i, g in enumerate(grid):\n kernel_string = \"#define \" ...
[ "0.5899154", "0.54452646", "0.5406287", "0.5154495", "0.5145631", "0.5141353", "0.5049778", "0.499358", "0.49077976", "0.4861079", "0.47189337", "0.46968913", "0.46888083", "0.46824497", "0.46349213", "0.46251643", "0.46248394", "0.46151614", "0.45986924", "0.45963177", "0.45...
0.74485874
0
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
def adjust_learning_rate(optimizer, epoch, args_lr, epoch_adjust): lr = args_lr * (0.1 ** (epoch // epoch_adjust)) for param_group in optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr", "def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l...
[ "0.79134107", "0.7906755", "0.7850054", "0.7775328", "0.773414", "0.7731414", "0.77228016", "0.7721925", "0.77193093", "0.77092254", "0.76932764", "0.76743245", "0.7665481", "0.7665481", "0.7665481", "0.7654962", "0.76418406", "0.7639415", "0.76375794", "0.7626146", "0.762473...
0.0
-1
Add and edge connecting vertex1 to vertex2. An edge is not added if it is already present.
def add_edge(self, vertex1, vertex2): self._numedges += 1 self._adjacents[vertex1].append(vertex2) if not self._directed: self._adjacents[vertex2].append(vertex1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, vertex1, vertex2):\n\n vertex1.add_outgoing_node(vertex2)\n vertex2.add_incoming_node(vertex1)", "def add_edge(self, v1, v2):\n # add the 2nd node to the list of edges for the first node\n if v1 in self.vertices and v2 in self.vertices:\n\n self.vertices[...
[ "0.8849438", "0.8699402", "0.8697188", "0.86681926", "0.8660385", "0.86575866", "0.85989404", "0.85896474", "0.85226756", "0.85214067", "0.8455027", "0.84535795", "0.84387165", "0.83928996", "0.83777267", "0.8341214", "0.82697785", "0.8166376", "0.8110151", "0.80316794", "0.8...
0.82472414
17
Return a string containg the Table name and the Column name this Column is linked to if the column is a foreign key. None otherwise
def isForeignKey(self): return self._foreignKey
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fk_colspec(\n fk: ForeignKey,\n metadata_schema: Optional[str],\n namespace_metadata: MetaData,\n) -> str:\n colspec = fk._get_colspec() # type:ignore[attr-defined]\n tokens = colspec.split(\".\")\n tname, colname = tokens[-2:]\n\n if metadata_schema is not None and len(tokens) == 2:\n ...
[ "0.68180937", "0.6746921", "0.65656483", "0.64930403", "0.64023453", "0.6382571", "0.62783515", "0.6250296", "0.6250296", "0.62471896", "0.6177169", "0.61673445", "0.61244804", "0.60737133", "0.6046827", "0.6046019", "0.6038782", "0.60216355", "0.6011526", "0.5985996", "0.596...
0.5509461
46
Return the name of the column of the target used to sort the elements retrieved with the relation
def getOrder(self): return self._order
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def columnName(self):\n return self.__column", "def get_name(self):\n return self.col_name", "def column(self):\n return self[\"column\"]", "def name(self) -> SortDirection:\n return self.__name", "def getColumn(self):\n return _libsbml.SBase_getColumn(self)", "def targ...
[ "0.6339488", "0.6302877", "0.61982936", "0.6142369", "0.6128963", "0.6128665", "0.60924876", "0.6074717", "0.6033371", "0.5968165", "0.59622926", "0.59202856", "0.59199977", "0.58647907", "0.58483094", "0.58326733", "0.58239645", "0.5806171", "0.5796723", "0.5796723", "0.5748...
0.0
-1
Test that get_rrule_end returns the rrule end correctly
def test_get_rrule_end(self): # when until is provided # pylint: disable=line-too-long rule1 = "DTSTART:20180501T210000Z RRULE:FREQ=YEARLY;BYDAY=SU;BYSETPOS=1;BYMONTH=1;UNTIL=20480521T210000Z" # noqa end1 = get_rrule_end(rrulestr(rule1)) # must be timezone aware self.ass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_end(self):\n return self._end", "def get_end(self):\n return self.__end", "def end(self):\n return self.__end_line", "def test_end(self):\n return self._endTest('\\x05')", "def get_end(self):\n return self._end", "def test_get_rrule_start(self):\n # test...
[ "0.62018627", "0.6027984", "0.5969879", "0.59500325", "0.5941808", "0.5929118", "0.591435", "0.5906802", "0.55877656", "0.5587524", "0.55295235", "0.5511963", "0.55080783", "0.5504855", "0.54968816", "0.54961485", "0.5493171", "0.5492466", "0.5488146", "0.5485071", "0.5484904...
0.79205424
0
Provide the output type for the Google places search.
def GetOutputType(self, response_type): if response_type == "KML": return "xml" return "json"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_type(self):\n return self._output_type.value", "def _type(self) -> str:\n ...", "def get_type(self):\n types = dict(ADDRESS_TYPE_CHOICES)\n return types.get(self.address_type, \"N/A\")", "def _get_output_type(self):\n return self.__output_type", "def _get_output_type(s...
[ "0.54595923", "0.54427195", "0.53845924", "0.5377169", "0.5377169", "0.5377169", "0.5377169", "0.5377169", "0.5377169", "0.53293914", "0.53071046", "0.53071046", "0.52884704", "0.52884704", "0.52884704", "0.52884704", "0.52884704", "0.52884704", "0.52884704", "0.52884704", "0...
0.58760613
0
Regular user cannot softdelete a feature.
def test_delete__forbidden(self): testing_config.sign_in('one@example.com', 123567890) with register.app.test_request_context(self.request_path): with self.assertRaises(werkzeug.exceptions.Forbidden): self.handler.do_delete(self.feature_id) revised_feature = models.Feature.get_by_id(self.fea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_model_delete(self, model):\n if not current_user.is_active or not current_user.is_authenticated:\n abort(403)\n if not user_has_permission(current_user, 'can_delete','bigfirms'):\n abort(403)", "def _safedelete_policy(self):\n from customers.models import Ordered...
[ "0.6623906", "0.6614458", "0.65629345", "0.6511823", "0.64087695", "0.6357982", "0.6352455", "0.6320963", "0.6184557", "0.6155092", "0.6154917", "0.6121467", "0.61127794", "0.60797405", "0.6076461", "0.6051047", "0.60359544", "0.60342014", "0.60053045", "0.5940048", "0.591835...
0.72087544
0
Checks if the sprites of player bird and pipes collide
def __collision_sprite(self) -> bool: if pygame.sprite.spritecollide(self.player.sprite,self.pipes,False): return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_crash(self):\n # check if the bird is aware of the pipes\n\n assert Bird.upper_pipes is not None and Bird.lower_pipes is not None, 'Set a reference to the pipes after ' \\\n 'initializing the first bird'\n\n ...
[ "0.780799", "0.7768568", "0.7646179", "0.7609221", "0.7574355", "0.7455437", "0.72885436", "0.7286847", "0.70167285", "0.70136845", "0.6970339", "0.6933163", "0.67471445", "0.6693948", "0.66916895", "0.6641474", "0.6585716", "0.65632755", "0.6554359", "0.65345526", "0.6525484...
0.7941508
0
In the constructor we instantiate two nn.Linear modules and assign them as member variables.
def __init__(self, ): super().__init__() channels = 3 # Initial convolution block out_features = 64 # encoder self.input = nn.Sequential( nn.ReflectionPad2d(channels), nn.Conv2d(3, out_features, (7, 7)), nn.InstanceNorm2d(out_features)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args):\n super(LinearND, self).__init__()\n self.fc = nn.Linear(*args)", "def __init__(self, linear_args, activation_functions, softmax=False):\n super(NN, self).__init__()\n assert len(activation_functions) == len(linear_args) - 1\n k = len(linear_args)\n ...
[ "0.7740072", "0.7548834", "0.75081503", "0.74344265", "0.73660135", "0.7334781", "0.7314765", "0.7287295", "0.7273534", "0.72733206", "0.72733206", "0.72666913", "0.72433686", "0.722051", "0.72023505", "0.7166179", "0.7110662", "0.70774037", "0.70662636", "0.7062287", "0.7052...
0.0
-1
Initialize the squall line path effect.
def __init__(self, color='black', spacing=75): self.marker_margin = 10 self.spacing = spacing self.color = mcolors.to_rgba(color) self._symbol_width = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _defLine(self):\n self._dline=GPath(points = [0,100,GAME_WIDTH,100], linewidth = 1.5,\n linecolor = 'cyan')", "def __init__(self, limb, kin, total_time, center_pos, num_way, radius, z_height=0.1):\n MotionPath.__init__(self, limb, kin, total_time)\n self.center_pos = center_po...
[ "0.64785254", "0.63691777", "0.6269279", "0.62131345", "0.5923235", "0.5901745", "0.5843731", "0.58288836", "0.57975274", "0.57765007", "0.5723992", "0.56553626", "0.5644054", "0.5641611", "0.56248856", "0.5617786", "0.56096154", "0.56056327", "0.5603472", "0.5593385", "0.556...
0.0
-1
Approximate distance and bearing between two points defined by lat1,lon1 and lat2,lon2 This is a slight underestimate but is close enough for our purposes, We're never moving more than 10 meters between trackpoints Bearing calculation fails if one of the points is a pole.
def geo_distance(lat1,lon1,lat2,lon2): # radius of earth in km R=6373.0 # pi pi=math.pi lat1=math.radians(lat1) lat2=math.radians(lat2) lon1=math.radians(lon1) lon2=math.radians(lon2) dlon=lon2 - lon1 dlat=lat2 - lat1 a=sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bearing(lat1, lon1, lat2, lon2):\n lat1 = math.radians(lat1)\n lon1 = math.radians(lon1)\n lat2 = math.radians(lat2)\n lon2 = math.radians(lon2)\n y = math.sin(lon2 - lon1) * math.cos(lat2)\n x = math.cos(lat1) * math.sin(lat2) - math.sin(lat1) * math.cos(lat2) * math.cos(lon2 - lon1)\n ...
[ "0.7947657", "0.7293514", "0.7257876", "0.72464615", "0.71705586", "0.7155593", "0.69335836", "0.675216", "0.67151266", "0.6702965", "0.663044", "0.6614405", "0.6560764", "0.6517577", "0.6517416", "0.6511648", "0.6500572", "0.64869493", "0.64804983", "0.64651537", "0.6459018"...
0.6422896
23
Getter method for the entity_type
def get_entity_type(self): return self.entity_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_type(self):\n return self._entity_type", "def entity_type(self) -> str:\n return self._entity_type", "def entity_type(self) -> Optional[str]:\n return pulumi.get(self, \"entity_type\")", "def entity_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"entity_ty...
[ "0.8471152", "0.8321664", "0.8109621", "0.79049665", "0.7629152", "0.7330869", "0.70950264", "0.6996613", "0.6937381", "0.6907609", "0.6907609", "0.68969953", "0.68680996", "0.68565613", "0.6853812", "0.6822592", "0.6822592", "0.6822592", "0.6822592", "0.6822592", "0.6822592"...
0.88433814
0
Return true if a is a subtype of b.
def PyType_IsSubtype(space, a, b): w_type1 = from_ref(space, rffi.cast(PyObject, a)) w_type2 = from_ref(space, rffi.cast(PyObject, b)) return int(abstract_issubclass_w(space, w_type1, w_type2)) #XXX correct?
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subclassof(c, b):\n try:\n return issubclass(c, b)\n except TypeError:\n return False", "def is_subtype(self, left: ProperType, right: ProperType) -> bool:\n if isinstance(right, AnyType):\n # trivial case\n return True\n if isinstance(right, UnionType)...
[ "0.7896247", "0.7016743", "0.6851775", "0.6716112", "0.6546822", "0.6412554", "0.63912296", "0.63854504", "0.630078", "0.62889063", "0.62741274", "0.62660205", "0.6216818", "0.62145144", "0.6171248", "0.6166062", "0.6147318", "0.6136703", "0.6117473", "0.61160713", "0.6113206...
0.74741864
1
Parse the given value and return result.
def parseValue(self, value): if self.isNumericVector(): return map(self._pythonType, value.split(',')) if self.typ == 'boolean': return _parseBool(value) return self._pythonType(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_value(cls, value):\n return value", "def parse_value(cls, value):\n return value", "def parse(self, value):\n raise NotImplementedError(\"Please implement the Class\")", "def parse(value):\n return int(value)", "def _parse_value(value):\n # Check if it is a ...
[ "0.7974688", "0.7974688", "0.7261008", "0.7120971", "0.6881182", "0.6852022", "0.67339504", "0.6715495", "0.67003936", "0.6669743", "0.64898634", "0.6456737", "0.64243406", "0.6397607", "0.6366889", "0.6339907", "0.63226676", "0.6285214", "0.6276252", "0.62635857", "0.6249181...
0.69888103
4
r"""A customizable string representation of the operator.
def label(self, decimals=None, base_label=None, cache=None): pauli_word = self.hyperparameters["pauli_word"] op_label = base_label or ("R" + pauli_word) # TODO[dwierichs]: Implement a proper label for parameter-broadcasted operators if decimals is not None and self.batch_size is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_attr(self):\n return str(self.operator)", "def __str__(self):\n result = \"\"\n if self.operator is not None:\n result = \"Operator: \" + self.operator + \"\\n\"\n result += self.dictkey() + \"\\n\"\n return result", "def __repr__(self):\n return f\"...
[ "0.83271104", "0.811341", "0.7820866", "0.7613354", "0.7438028", "0.7438028", "0.73064524", "0.7267912", "0.7135072", "0.71005356", "0.70331305", "0.6918284", "0.69112355", "0.68451303", "0.67995334", "0.67971027", "0.6769715", "0.67676055", "0.673612", "0.67265105", "0.67142...
0.0
-1
initialize the instance of Jacobi polynomial
def __init__(self, n, end=1): # TODO: check the type and vlaue of end self.end = end # right Radau; R(x) = (-1)^n * 0.5 * (L_n - L_{n-1}) if end == 1: coeffs = (Legendre(n) - Legendre(n-1)).coeffs if n % 2 == 1: coeffs *= (-1) # left Rada...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, p_order=None):\n\n self.p_order = p_order\n self.alpha = 0\n self.beta = 0\n self.reference_interval = [-1, 1]\n\n # Considering a homogeneous p-order\n # Evaluate the weights and nodes of the\n # element\n if isinstance(p_order, int):\n ...
[ "0.69439155", "0.6915524", "0.68152237", "0.6574863", "0.64140207", "0.6313438", "0.62998796", "0.626407", "0.6242278", "0.6197995", "0.61414105", "0.6116165", "0.6093841", "0.6084288", "0.6012212", "0.59901255", "0.5980673", "0.59620917", "0.5927282", "0.5911447", "0.5910225...
0.6357164
5
Gets the path to the launcher module for this platform.
def GetLauncherPath(self): return os.path.dirname(__file__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def launcher_path() -> Optional[str]:\n return u.resource(LAUNCHER_SCRIPT)", "def get_executable(self) -> str:\n ...", "def module_path():\r\n if hasattr(sys, \"frozen\"):\r\n return os.path.dirname(sys.executable)\r\n return os.path.dirname(__file__)", "def executable_path(self):\n ...
[ "0.73829705", "0.7259083", "0.6936624", "0.69122934", "0.67962146", "0.6784276", "0.6767793", "0.66596454", "0.6656506", "0.6628211", "0.65045315", "0.64700174", "0.6431885", "0.6422051", "0.63770264", "0.6367987", "0.6342633", "0.6299877", "0.62877285", "0.6264012", "0.62582...
0.7842312
0
Convert datasets into torch.utils.data.DataLoader
def get_dataloaders(datasets, split, args, is_eval=False): dataloaders = [] for task, dataset in datasets.items(): if is_eval: num_rows = dataset.num_rows if args.eval_rows == -1 else args.eval_rows else: num_rows = dataset.num_rows if args.train_rows == -1 else args.trai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataloaders():\n # train data path\n data_train = '../dataset/train/'\n # set transformations\n train_transforms = transforms.Compose([\n transforms.Resize((224, 224)),\n transforms.ToTensor(),\n transforms.Normalize([0.485, 0.456, 0.406],\n ...
[ "0.7666076", "0.74303603", "0.74198025", "0.74112135", "0.73361903", "0.7281004", "0.72657275", "0.7196792", "0.71148366", "0.7114448", "0.7112639", "0.70618916", "0.705085", "0.7049162", "0.7023081", "0.6973244", "0.69704187", "0.694238", "0.6937094", "0.6936128", "0.6928919...
0.65765035
54
Given a flat list, create nested sublists each <= length.
def nest_sublists(lst, length): return [ [sublist for sublist in lst[index:index+length]] for index in range(0, len(lst), length) if index <= len(lst) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flat_list_of_lists(l):\n return [item for sublist in l for item in sublist]", "def _recursive(inputlst, dimsizes):\n if len(dimsizes) == 1:\n return list(inputlst)\n\n outerlist = []\n chunksize = len(inputlst)//dimsizes[0]\n for i in range(0, len(inputlst), chunksiz...
[ "0.66221595", "0.65823245", "0.6501033", "0.648648", "0.6428944", "0.6385143", "0.635952", "0.6336243", "0.6326698", "0.6326698", "0.6240167", "0.62347883", "0.62100285", "0.61847097", "0.61843675", "0.6173624", "0.61396605", "0.6128898", "0.6116287", "0.60647255", "0.6011950...
0.8001856
0
Returns the root folder for module file installation.
def root_path(name, module_set_name): defaults = { "lmod": "$spack/share/spack/lmod", "tcl": "$spack/share/spack/modules", } # Root folders where the various module files should be written roots = spack.config.get("modules:%s:roots" % module_set_name, {}) # Merge config values into ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root_dir():\r\n return Path(__file__).parent.parent", "def root_dir():\n return dirname(dirname(__file__))", "def get_root_dir():\n return os.path.dirname(os.path.dirname(__file__))", "def get_root_directory() -> str:\n return \"{}/../\".format(get_cur_directory(__file__))", "def rootdir():...
[ "0.79218656", "0.790745", "0.78905374", "0.7873232", "0.78513837", "0.78367466", "0.77492994", "0.7690774", "0.76622736", "0.76622736", "0.76091945", "0.75067484", "0.7477414", "0.74191916", "0.73731154", "0.7300748", "0.72444934", "0.72258025", "0.7205753", "0.71929884", "0....
0.7041546
28
Calculate and display the order price.
def showOrderPrice(self, order): order.CalculateOrderPrice() label3 = Label(self, text="$:"+str(order.GetTotalPrice), font=LARGE_FONT) label3.grid(row=2, column=5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_order_price(self):\n\n price = self.calculate_price()\n self.price = price\n return self.price", "def get_order_price(self):\r\n if self.price is not None:\r\n return self.price #typical limit price order\r\n else:\r\n #Check the orderbook\r\n ...
[ "0.770952", "0.76699966", "0.7183351", "0.7161448", "0.7044833", "0.7019624", "0.7014924", "0.7014924", "0.7014924", "0.69977343", "0.69182026", "0.6893471", "0.6893471", "0.68702096", "0.6841965", "0.6805581", "0.6777113", "0.67751694", "0.6746683", "0.6746435", "0.6722649",...
0.865185
0
parse uniform data from a line
def parse_data_uniform(line): if b'(' in line: return np.array([float(x) for x in line.split(b'(')[1].split(b')')[0].split()]) return float(line.split(b'uniform')[1].split(b';')[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parseDataUniform(line):\n if b'(' in line:\n return np.array([float(x) for x in line.split(b'(')[1].split(b')')[0].split()])\n return float(line.split(b'uniform')[1].split(b';')[0])", "def parse_line(self, line):\n raise NotImplementedError", "def parse(cls, line):\r\n raise NotImplementedEr...
[ "0.80688715", "0.6554141", "0.6505636", "0.64298505", "0.6330034", "0.6302194", "0.6222594", "0.6213122", "0.6146236", "0.60555375", "0.6055196", "0.6013839", "0.6003124", "0.5996162", "0.59928846", "0.59849095", "0.59731615", "0.5965432", "0.59533185", "0.59510154", "0.59475...
0.79729223
1
Set the humanreadable name of the schedule
def name(self, name): if name is None: self._set('name', name) elif isinstance(name, basestring): # Server does not allow name to be blank (but it can be null) if not name: raise ValidationError("Schedule name cannot be empty.") self._set('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_name(self, schedule_name):\n\n self._schedule_name = schedule_name", "def setName(self, name):\n self.name = str(name)", "def setName(self,value):\n assert value == None or type(value) == str, repr(value)+' is not a valid name'\n self._name = value", "def set_name(sel...
[ "0.7844636", "0.65831643", "0.65459925", "0.6489918", "0.64716727", "0.64708376", "0.6466509", "0.64335537", "0.6388341", "0.6360856", "0.63492274", "0.6335438", "0.6335438", "0.6312467", "0.6312467", "0.6312467", "0.6312467", "0.6312467", "0.6294727", "0.6282132", "0.6274234...
0.6876592
1
Get the associated task template IDs for this schedule.
def task_template_ids(self): return self._get('task_templates')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_templates(self):\n from .task_template import TaskTemplate\n return [TaskTemplate.load(task_template_id) for task_template_id in self.task_template_ids]", "def _template_ids(self):\n raise NotImplementedError()", "def task_template_ids(self, task_template_ids):\n if task_te...
[ "0.7528108", "0.6511253", "0.60980284", "0.60670215", "0.6044819", "0.5853633", "0.58437794", "0.5836055", "0.5823491", "0.58115333", "0.5795463", "0.5785588", "0.5766781", "0.57468176", "0.57307327", "0.57255244", "0.56983685", "0.5674276", "0.5662235", "0.5654228", "0.56522...
0.8560558
0
Get the associated task template for this schedule.
def task_templates(self): from .task_template import TaskTemplate return [TaskTemplate.load(task_template_id) for task_template_id in self.task_template_ids]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_template(self):\n return self.template", "def get_template(self, name):\n return self.templates.get(name)", "def template(self):\n template_names = self.get_template_names()\n if template_names:\n return template_names[0]\n return None", "def _get_templat...
[ "0.6677574", "0.6612549", "0.6587909", "0.6334875", "0.63090783", "0.6287123", "0.6209829", "0.61913586", "0.61913586", "0.61913586", "0.6185729", "0.6170216", "0.6150414", "0.6137095", "0.6128788", "0.61124253", "0.6106459", "0.6102434", "0.60325795", "0.60137844", "0.597502...
0.5985546
20
Get if this schedule is enabled and should schedule tasks.
def enabled(self): return self._get('enabled')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isScheduleRunning(self):\n if DPxIsDinSchedRunning() == 0:\n schedule_running = False\n else:\n schedule_running = True\n return schedule_running", "def is_task_in_schedule(self, tid: str) -> bool:\n return tid in self.__tasks", "def should_run(self, task: ...
[ "0.7149534", "0.676867", "0.6587803", "0.6362768", "0.6332571", "0.6332571", "0.6332571", "0.6332571", "0.6332571", "0.6332571", "0.6332571", "0.6332571", "0.63226163", "0.62889516", "0.6285166", "0.62760085", "0.62760085", "0.62760085", "0.62760085", "0.62760085", "0.6276008...
0.60700077
33
Set the repeat frequency of the schedule (e.g., every 2 days).
def frequency(self, frequency): if Number.is_integer(frequency): if not Number.is_finite_positive(frequency): raise ValidationError("Frequency must be a finite positive number (frequency is %s)." % frequency) self._set('frequency', frequency) else: rai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeat_interval(self, repeat_interval):\n\n self._repeat_interval = repeat_interval", "def setScheduleCount(self, count):\n DPxSetDinSchedCount(count)", "def set_frequency(self, new_freq):\n self.freq = new_freq\n self.ts_resample()", "async def set_repeat(self, value: models....
[ "0.6624328", "0.6379836", "0.61233467", "0.60217947", "0.59205586", "0.5821666", "0.5812797", "0.579884", "0.57714725", "0.5753956", "0.57534826", "0.57316864", "0.57117534", "0.57117534", "0.56901866", "0.5687408", "0.5680267", "0.5650914", "0.56352204", "0.56273097", "0.562...
0.0
-1
Get the timestamp for the last scheduled instance (as a datetime).
def end(self): return self._get('end')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_timestamp(self):\n LOGGER.debug('Getting last_timestamp as: %s', self._last_timestamp)\n return self._last_timestamp", "def last_time(self) -> datetime:\n return self.activities[-1].timestamp", "def last_timestamp(self):\n return self._last_timestamp", "def get_last_time(...
[ "0.77856266", "0.7606132", "0.7527099", "0.7287878", "0.71134967", "0.7057456", "0.7053698", "0.70400256", "0.692607", "0.68421644", "0.6748534", "0.6727727", "0.67237043", "0.6676377", "0.6667136", "0.66621333", "0.6651209", "0.6646482", "0.6646482", "0.6643321", "0.66292036...
0.0
-1
Get the duration as a datetime.timedelta object that this is valid for scheduling.
def duration(self): return self._get('duration')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self) -> datetime.timedelta:\n return self._duration", "def timedelta(self) -> datetime.timedelta:\n factor = -1 if self.negative else 1\n return datetime.timedelta(\n hours=factor * self.hours, minutes=factor * self.minutes\n )", "def duration(self):\n ...
[ "0.744504", "0.73023325", "0.7000551", "0.6881587", "0.687724", "0.67860675", "0.6732472", "0.6732472", "0.6732472", "0.6723134", "0.6722413", "0.66889995", "0.6657453", "0.6647671", "0.6647671", "0.65403146", "0.6529965", "0.65298706", "0.65298706", "0.65298706", "0.65298706...
0.64220047
30
Returns AutoScaling group name for given environment and cluster.
def get_as_name(as_connection, environment, cluster): list_as_groups = [] config = {'env': environment, 'cluster': cluster, 'role': 'feeds'} for as_group in get_all_as_groups(as_connection): result = 0 for tag in as_group.tags: if tag.key in config: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asg_name_lookup(session, hostname):\n if session is None:\n return None\n\n client = session.client('autoscaling')\n response = client.describe_auto_scaling_groups()\n if len(response['AutoScalingGroups']) == 0:\n return None\n else:\n # DP NOTE: Unfortunatly describe_auto_s...
[ "0.6610168", "0.6571153", "0.64017445", "0.63852084", "0.6305004", "0.6305004", "0.62214786", "0.62214786", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6170561", "0.6139448",...
0.0
-1
Add random effects term.
def addRandomEffect(self, K=None, is_noise=False, normalize=False, Kcross=None, trait_covar_type='freeform', rank=1, fixed_trait_covar=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_effects(self, var: ndarray) -> ndarray:\n beta, gamma = self.get_vars(var)\n residual = split_by_sizes(self.get_residual(beta),\n self.data.group_sizes)\n obsvar = split_by_sizes(self.get_obsvar(),\n self.data.group...
[ "0.56367886", "0.55188495", "0.54015106", "0.5307205", "0.5157569", "0.51379347", "0.5109697", "0.50834566", "0.5053285", "0.5043372", "0.5043372", "0.50221837", "0.5017858", "0.50083584", "0.49875566", "0.49383983", "0.49237552", "0.48826158", "0.48821935", "0.48338008", "0....
0.55789113
1
Return the trait limix covariance function for term term_i
def getTraitCovarFun(self, term_i): assert term_i < self.n_randEffs, 'VarianceDecomposition:: specied term out of range' return self.trait_covars[term_i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTraitCovar(self, term_i=None):\n assert term_i < self.n_randEffs, 'VarianceDecomposition:: specied term out of range'\n\n if term_i is None:\n RV = sp.zeros((self.P, self.P))\n for term_i in range(self.n_randEffs):\n RV += self.getTraitCovarFun().K()\n ...
[ "0.718753", "0.69372725", "0.6536122", "0.6505277", "0.6186062", "0.6118794", "0.6099199", "0.5971912", "0.57988757", "0.5747455", "0.5720042", "0.57098854", "0.569393", "0.5685325", "0.56717986", "0.5623863", "0.5608817", "0.5578779", "0.55760443", "0.55510736", "0.5545529",...
0.7290337
0
Returns standard errors on trait covariances from term_i (for the covariance estimate \see getTraitCovar)
def getTraitCovarStdErrors(self, term_i): assert self.init, 'GP not initialised' assert self.fast is False, 'Not supported for fast implementation' if self.P == 1: out = (2 * self.getScales()[term_i])**2 * \ self._getLaplaceCovar()[term_i, term_i] else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTraitCorrCoef(self, term_i=None):\n cov = self.getTraitCovar(term_i)\n stds = sp.sqrt(cov.diagonal())[:, sp.newaxis]\n RV = cov / stds / stds.T\n return RV", "def getTraitCovar(self, term_i=None):\n assert term_i < self.n_randEffs, 'VarianceDecomposition:: specied term o...
[ "0.74225277", "0.7187067", "0.6948667", "0.6872767", "0.6346244", "0.63101226", "0.5865709", "0.5854538", "0.571666", "0.56159663", "0.5539201", "0.55359215", "0.55160004", "0.55016977", "0.5492382", "0.5474694", "0.54522413", "0.54208183", "0.54038614", "0.5401302", "0.53997...
0.82474864
0
Internal function for parameter initialization Returns Gaussian perturbation
def _perturbation(self): if self.P > 1: scales = [] for term_i in range(self.n_randEffs): _scales = sp.randn(self.diag[term_i].shape[0]) if self.jitter[term_i] > 0: _scales = sp.concatenate((_scales, sp.zeros(1))) scales...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GaussianPosteriorSample(bs, ls) :\n def gps(args) :\n mu, log_var = args\n eps = K.random_normal(shape=(bs, ls), mean=0.0, stddev=1.0) # 10 x 2\n return mu + K.exp(log_var / 2.) * eps\n return gps", "def estimate_gaussian_params(X):\n mu = X.mean(axis=0)\n var = X.std(axis=0)...
[ "0.66711503", "0.66330534", "0.6613454", "0.66052234", "0.64030635", "0.63168645", "0.6298865", "0.62183076", "0.6212963", "0.6210719", "0.6208016", "0.620416", "0.61803955", "0.61519814", "0.61460745", "0.61436397", "0.6141911", "0.6126179", "0.6110798", "0.6102602", "0.6091...
0.0
-1
Convert quaternion coefficients to rotation matrix.
def quat2mat(quat): norm_quat = torch.cat([quat[:, :1].detach() * 0 + 1, quat], dim=1) norm_quat = norm_quat / norm_quat.norm(p=2, dim=1, keepdim=True) w, x, y, z = norm_quat[:, 0], norm_quat[:, 1], norm_quat[:, 2], norm_quat[:, 3] B = quat.size(0) w2, x2, y2, z2 = w.pow(2), x.pow(2), y.pow(2), z.pow(2) w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_to_rotation_matrix(quaternion):\n\n q_w, q_x, q_y, q_z = quaternion\n sqw, sqx, sqy, sqz = np.square(quaternion)\n norm = (sqx + sqy + sqz + sqw)\n rotation_matrix = np.zeros((3, 3))\n\n # division of square length if quaternion is not already normalized\n rotation_matrix[0, 0] = (...
[ "0.7666401", "0.7480785", "0.74480975", "0.7431791", "0.7220662", "0.72003317", "0.7190068", "0.7073628", "0.6941468", "0.6884496", "0.6882422", "0.6881994", "0.685318", "0.68479955", "0.68037885", "0.67919123", "0.677245", "0.6759796", "0.672846", "0.670579", "0.66775787", ...
0.6605263
26
View function for home page of site.
def index(request): question_list = Question.objects.all() context = { 'question_list': question_list, } return render(request, 'index.html', context=context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n\treturn render(request, \"compta/home.html\")", "def home_page(request):\r\n return render(request, 'ez_main/home_page.html')", "def home(request):\r\n return render(request, 'home.html')", "def homepage(request):\n\treturn render(request, 'core/homepage.html')", "def homepage(req...
[ "0.8493426", "0.84268916", "0.83415145", "0.83306193", "0.82976943", "0.8295291", "0.8276345", "0.82545686", "0.82155704", "0.8132563", "0.81246215", "0.81224865", "0.8121264", "0.81049734", "0.8098485", "0.80935514", "0.80935514", "0.80935514", "0.80935514", "0.80935514", "0...
0.0
-1
Finds the best neighbour for the 'sender' from the network_nodes array. This function only will call when you are a root peer.
def __get_neighbour(self, sender: Address) -> Address: if self.is_root: return self.network_graph.find_live_node(sender)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neighbour(self):\n if self._neighbour is None:\n my_idx = self.sorted_peer_keys.index(self.vk)\n self._neighbour = self.sorted_peer_keys[(my_idx + 1) % len(self.sorted_peer_keys)]\n return self._neighbour", "def best_node(self):\n nodes = self._all_nodes()\n ...
[ "0.6475417", "0.5959123", "0.5852934", "0.5666992", "0.5610795", "0.5604046", "0.558701", "0.5568377", "0.5549134", "0.5549134", "0.5512942", "0.54803896", "0.54606795", "0.54471856", "0.5362109", "0.5280843", "0.5278713", "0.527046", "0.5268886", "0.526823", "0.52651113", ...
0.72702515
0
Returns a dictionary of stateful variables.
def state_dict(self): return {k: getattr(self, k) for k in self.VARS}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dictOfVariables(self):\n return {x.name: x for x in self.variables}", "def __getstate__(self):\n\n state = {}\n for key in self.__slots__:\n state[key] = getattr(self, key)\n\n return state", "def get_state(self):\n\n # TODO: Assemble a dictionary containing the tr...
[ "0.73083735", "0.7296083", "0.71357095", "0.7087762", "0.70602655", "0.70602655", "0.70387185", "0.701347", "0.69626397", "0.69584876", "0.68853015", "0.6875528", "0.68726975", "0.6858552", "0.68489665", "0.68458045", "0.6845104", "0.68292034", "0.6809699", "0.6809699", "0.68...
0.83818245
0
Saves a checkpoint with arbitrary suffix(es) appended.
def _save_model(self, metric=None, suffix="", do_symlink=False): # Construct file name fname = self.exp_id if metric: print("Saving best model based on {}".format(metric.name), flush=True) fname += "-val{:03d}.best.{}_{:.3f}".format( self.vctr, metric.name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkpoint_save(self, epoch, model, label=None, checkpoint=None, path=\"\"):\n\n if label is None:\n label = f\"checkpoint-{epoch}\"\n else:\n label = f\"{label}-checkpoint-{epoch}\"\n\n if checkpoint is None:\n pass\n elif checkpoint == -1:\n ...
[ "0.7539387", "0.7392682", "0.71251327", "0.69059235", "0.684631", "0.6765321", "0.664671", "0.66189486", "0.661525", "0.65999854", "0.65593237", "0.6533697", "0.6529818", "0.6525717", "0.6524647", "0.64641243", "0.6451438", "0.6415673", "0.64103", "0.6405602", "0.63877046", ...
0.0
-1
Updates score lists and current bests.
def update_dev_scores(self, results): for metric in results: print("Validation {} -> {} | lr: {}".format(self.vctr, metric, self.optimizer.param_groups[0]['lr']), flush=True) self.val_scores[metric.name].append(metric) self.cur_bests[metric.name] = self.best_score(self.val_sc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_scores(self, score):\n self.result_list.append(score)\n\n if self.best_score == 0 and self.worst_score == 0:\n self.best_score = score\n self.worst_score = score\n\n if score < self.best_score:\n self.best_score = score\n\n if score > self.wor...
[ "0.78992283", "0.7061573", "0.70271826", "0.70214796", "0.68328494", "0.67067766", "0.6681274", "0.6540518", "0.6420633", "0.6378942", "0.63667995", "0.6348619", "0.634337", "0.6341063", "0.6314564", "0.6311756", "0.62573075", "0.62476355", "0.62429374", "0.62360436", "0.6232...
0.7034817
2
Obtain a list of tile coordinates (starting row, ending row, starting column, ending column, row number, column number).
def get_tile_indices(rows, cols, row_tile_size, col_tile_size): indices = list() num_row_tiles, num_col_tiles = get_num_tiles(rows, cols, row_tile_size, col_tile_size) for r in range(0, num_row_tiles): start_r = r * row_tile_size end_r = ((r + 1) * row_tile_size) if (r < num_row_tiles - 1) else rows f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_coords(self):\n return [(x, y) for y in range(self.height) for x in range(self.width)]", "def get_tile_location(self):\n if self.rect.x == 0:\n tile_x = 0\n elif self.rect.x % 32 == 0:\n tile_x = (self.rect.x / 32)\n else:\n tile_x = 0\n\n ...
[ "0.77079755", "0.7690596", "0.746926", "0.74345946", "0.7341714", "0.706681", "0.70521617", "0.7027248", "0.6980167", "0.6930729", "0.6889165", "0.6882042", "0.68563765", "0.68330127", "0.683114", "0.67471254", "0.6701604", "0.6685065", "0.6673461", "0.665722", "0.6642528", ...
0.63018847
69
Create Matplotlib histogram of an RGB channel for an RGB image and return the histogram as a NumPy array image.
def np_rgb_channel_histogram(rgb, ch_num, ch_name): ch = rgb[:, :, ch_num] ch = ch.flatten() title = "RGB %s Histogram, mean=%.2f, std=%.2f" % (ch_name, np.mean(ch), np.std(ch)) return np_histogram(ch, title, bins=256)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def np_rgb_r_histogram(rgb):\n hist = np_rgb_channel_histogram(rgb, 0, \"R\")\n return hist", "def rgb_histogram(img, channels=[\"r\", \"g\", \"b\"]):\n hist = {}\n for ii, color in enumerate(channels):\n hist[color] = cv2.calcHist([img], [ii], None, [256], [0, 256])\n return hist", "def np_r...
[ "0.76413864", "0.751002", "0.7239808", "0.71815753", "0.7167207", "0.69881034", "0.69221276", "0.68958324", "0.6866154", "0.68094754", "0.67952126", "0.67755467", "0.6743097", "0.6716315", "0.67140573", "0.669965", "0.66942275", "0.6684631", "0.66495585", "0.6649372", "0.6630...
0.7320509
2
Obtain RGB R channel histogram as a NumPy array image.
def np_rgb_r_histogram(rgb): hist = np_rgb_channel_histogram(rgb, 0, "R") return hist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def np_rgb_g_histogram(rgb):\n hist = np_rgb_channel_histogram(rgb, 1, \"G\")\n return hist", "def np_rgb_b_histogram(rgb):\n hist = np_rgb_channel_histogram(rgb, 2, \"B\")\n return hist", "def np_rgb_channel_histogram(rgb, ch_num, ch_name):\n\n ch = rgb[:, :, ch_num]\n ch = ch.flatten()\n title = \"RGB...
[ "0.73075914", "0.7073082", "0.70711094", "0.70352525", "0.6868852", "0.6466459", "0.64621925", "0.64069664", "0.6381617", "0.6333518", "0.6315015", "0.62516576", "0.6138408", "0.61364526", "0.61323345", "0.6110094", "0.6093606", "0.6091408", "0.6087404", "0.6057547", "0.60533...
0.8308623
0
Obtain RGB G channel histogram as a NumPy array image.
def np_rgb_g_histogram(rgb): hist = np_rgb_channel_histogram(rgb, 1, "G") return hist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def np_rgb_r_histogram(rgb):\n hist = np_rgb_channel_histogram(rgb, 0, \"R\")\n return hist", "def RgbHistogram(self):\n if not self._rgbHistogram is 0:\n return self._rgbHistogram\n [width, height, depth] = self._opencvimg.shape\n histogram = numpy.zeros(48, dtype=numpy.float32...
[ "0.70907176", "0.6818483", "0.67461985", "0.66885227", "0.6620615", "0.66191506", "0.66058344", "0.64873064", "0.644219", "0.6416976", "0.6373809", "0.63243663", "0.63238144", "0.62884", "0.62536615", "0.6215713", "0.6208963", "0.6134328", "0.611324", "0.6059027", "0.6054701"...
0.80046797
0
Obtain RGB B channel histogram as a NumPy array image.
def np_rgb_b_histogram(rgb): hist = np_rgb_channel_histogram(rgb, 2, "B") return hist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def np_rgb_r_histogram(rgb):\n hist = np_rgb_channel_histogram(rgb, 0, \"R\")\n return hist", "def np_rgb_g_histogram(rgb):\n hist = np_rgb_channel_histogram(rgb, 1, \"G\")\n return hist", "def RgbHistogram(self):\n if not self._rgbHistogram is 0:\n return self._rgbHistogram\n [wid...
[ "0.75700927", "0.73600745", "0.7173094", "0.70491886", "0.68943244", "0.67173046", "0.66911787", "0.66447943", "0.6609958", "0.6546533", "0.6535455", "0.6524363", "0.6519062", "0.6511621", "0.6480133", "0.64759773", "0.64483", "0.64413476", "0.64375615", "0.6419318", "0.64138...
0.80660397
0
Compute scoring factor based on purple and pink HSV hue deviations and degree to which a narrowed hue color range average is purple versus pink.
def hsv_purple_pink_factor(rgb): hues = rgb_to_hues(rgb) hues = hues[hues >= 260] # exclude hues under 260 hues = hues[hues <= 340] # exclude hues over 340 if len(hues) == 0: return 0 # if no hues between 260 and 340, then not purple or pink pu_dev = hsv_purple_deviation(hues) pi_dev = hsv_pink_devia...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hsv_purple_vs_pink_average_factor(rgb, tissue_percentage):\n\n factor = 1\n # only applies to slides with a high quantity of tissue\n if tissue_percentage < TISSUE_HIGH_THRESH:\n return factor\n\n hues = rgb_to_hues(rgb)\n hues = hues[hues >= 200] # Remove hues under 200\n if len(hues) == 0:\n ret...
[ "0.75695944", "0.6744083", "0.66514224", "0.6629734", "0.65352106", "0.64999753", "0.6497369", "0.63982177", "0.6351033", "0.63467145", "0.6306811", "0.6290739", "0.6246979", "0.61899364", "0.61035717", "0.609743", "0.606257", "0.60356426", "0.6019331", "0.60180587", "0.60127...
0.75142634
1
Function that checks if in maze.
def is_in_maze(handler_input): # type: (HandlerInput) -> bool attr = handler_input.attributes_manager.persistent_attributes in_maze = 'NO' if 'in_maze' in attr: in_maze = attr['in_maze'] return in_maze
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMazeExists(self):\n\n pass", "def testMazeExists(self):\n pass", "def maze_guard():\n cell_guard = all([1 <= len(row) <= 100 for row in maze])\n row_guard = 1 <= len(maze) <= 100\n return cell_guard and row_guard", "def check_move(self, y, x):\n return 0 <= y...
[ "0.75926924", "0.75316936", "0.7139741", "0.6774308", "0.669608", "0.66889346", "0.66444546", "0.6624192", "0.659369", "0.6534783", "0.6502502", "0.64899856", "0.64193857", "0.6404902", "0.63897365", "0.63752705", "0.63714087", "0.6361771", "0.634372", "0.63394064", "0.631499...
0.748955
2
Function that checks if in maze.
def ready_for_boss(handler_input): # type: (HandlerInput) -> bool attr = handler_input.attributes_manager.persistent_attributes ready = False if 'ready_for_boss' in attr: ready = attr['ready_for_boss'] return ready
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMazeExists(self):\n\n pass", "def testMazeExists(self):\n pass", "def is_in_maze(handler_input):\n # type: (HandlerInput) -> bool\n attr = handler_input.attributes_manager.persistent_attributes\n in_maze = 'NO'\n if 'in_maze' in attr:\n in_maze = attr['in_maze']\n\n ...
[ "0.75925213", "0.7531607", "0.7489063", "0.7140214", "0.6774305", "0.6695534", "0.66889465", "0.66450906", "0.6624788", "0.659387", "0.6535314", "0.6503084", "0.6489868", "0.6419303", "0.64031625", "0.63908446", "0.6374975", "0.6371746", "0.6361211", "0.63444036", "0.6339718"...
0.0
-1
AMAZON.FallbackIntent is only available in enUS locale. This handler will not be triggered except in that locale, so it is safe to deploy on any locale.
def fallback_handler(handler_input): # type: (HandlerInput) -> Response session_attr = handler_input.attributes_manager.session_attributes speech_text = ( "The {} skill can't help you with that.".format(SKILL_NAME)) handler_input.response_builder.speak( speech_text).set_should_end_sess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fall_back_message():\r\n card_title = \"Fallback Message\"\r\n fallback_string = \"Sorry. I couldn't understood it. Please say again.\"\r\n should_end_session = False\r\n session_attributes = { \r\n \"speech_output\": fallback_string,\r\n \r\n ...
[ "0.58753115", "0.56072706", "0.5588063", "0.5460929", "0.5460929", "0.5407374", "0.53527844", "0.53527844", "0.529969", "0.5269353", "0.5180608", "0.5173138", "0.5173138", "0.516404", "0.51529306", "0.5061759", "0.5029379", "0.49786597", "0.49311855", "0.4866266", "0.4850489"...
0.50707155
15
Check if the given event is the target of another event's relation. An event is the target of an event relation if it has a valid m.relates_to with a rel_type and event_id pointing to parent_id in the
async def event_is_target_of_relation(self, parent_id: str) -> bool: result = await self.db_pool.simple_select_one_onecol( table="event_relations", keyvalues={"relates_to_id": parent_id}, retcol="event_id", allow_none=True, desc="event_is_target_of_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_relationship(self, source_node: Node, target_node: Node) -> bool: # pylint: disable=no-self-use\n return source_node.node_id in target_node.in_nodes_ids", "async def event_includes_relation(self, event_id: str) -> bool:\n\n result = await self.db_pool.simple_select_one_onecol(\n ...
[ "0.6492252", "0.60521686", "0.56309354", "0.5617483", "0.5606949", "0.5575651", "0.5560648", "0.55529356", "0.5545725", "0.5543121", "0.5530233", "0.5493499", "0.5489115", "0.5447581", "0.54052347", "0.5366882", "0.5355927", "0.530572", "0.52909124", "0.52174854", "0.52134526...
0.79060423
0
Get a list of annotations on the event, grouped by event type and aggregation key, sorted by count. This is used e.g. to get the what and how many reactions have happend on an event.
async def get_aggregation_groups_for_event( self, event_id: str, room_id: str, limit: int = 5 ) -> List[JsonDict]: args = [ event_id, room_id, RelationTypes.ANNOTATION, limit, ] sql = """ SELECT type, aggregation_key, COUN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_annotations(self) -> List[Dict[int, Dict[str, Any]]]:\n annotations = []\n for item in self.collector:\n data_file_type = os.path.basename(item).split(\".\")[-1]\n annotations.append(\n load_annotation_file(\n os.path.join(\n ...
[ "0.60938144", "0.5840345", "0.5698002", "0.5667262", "0.56389564", "0.5579175", "0.5550326", "0.5502397", "0.54922426", "0.5476369", "0.544836", "0.54439044", "0.54351395", "0.54338014", "0.54322517", "0.54168785", "0.53957397", "0.5310426", "0.52808183", "0.5228135", "0.5099...
0.6182581
0
Get the number of threaded replies for a set of users. This is used, in conjunction with get_thread_summaries, to calculate an accurate count of the replies to a thread by subtracting ignored users.
async def get_threaded_messages_per_user( self, event_ids: Collection[str], users: FrozenSet[str] = frozenset(), ) -> Dict[Tuple[str, str], int]: if not users: return {} # Fetch the number of threaded replies. sql = """ SELECT parent.event_id,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_replies_count(khoros_object, user_settings=None, user_id=None, login=None, email=None):\n user_settings = _process_settings_and_user_id(khoros_object, user_settings, user_id, login, email)\n select_fields = ('messages.count(*)', 'topics.count(*)')\n api_response = query_users_table_by_id(khoros_ob...
[ "0.7318131", "0.58300686", "0.5795108", "0.5764767", "0.5669651", "0.5543869", "0.55056167", "0.5434257", "0.54324746", "0.54275376", "0.5423134", "0.54207873", "0.5378991", "0.5353041", "0.5309694", "0.528433", "0.5259013", "0.5256701", "0.52470654", "0.52218467", "0.5221846...
0.67851937
1
Root page view. This is essentially a singlepage app, if you ignore the login and admin parts.
def index(request): # Get a list of rooms, ordered alphabetically import json rooms = Room.objects.order_by("title") roomslist = [] chat_participants = [] participant_count=1 user = User.objects.get(username=request.user.username) #print(user) tuj_list =TaskUserJunction.objects.filte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root(request):\n\n return render(request, 'users/index.html')", "def homepage():\n form = LoginForm()\n return render_template(\"admin/index.html\", title=\"Admin\", form=form)", "def root():\n return render_template('index.html')", "def root():\n return render_template('index.html')", "...
[ "0.7617549", "0.7462244", "0.7447427", "0.7447427", "0.7447427", "0.7405806", "0.72587985", "0.725353", "0.72362155", "0.72300816", "0.7205301", "0.7195987", "0.7182089", "0.7130325", "0.71232593", "0.7118478", "0.7113679", "0.7102731", "0.70723486", "0.7056422", "0.70423454"...
0.0
-1
Return True if n does not have a unique factorization into two factors between 1 and 100 and exactly 1 factorization cannot be expressed as the sum of two prime numbers.
def has_single_eligible_pair(n): pairs = [(a,b) for a,b in pairs_of_factors(n) if 1<a<100 and 1<b<100] num_eligible_pairs = sum(not is_sum_of_primes(a+b) for a,b in pairs) return len(pairs) > 1 and num_eligible_pairs==1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prime_t(n: int) -> bool:\n tests = set(range(2, int(math.sqrt(n) + 1)))\n non_factors = set(takewhile(lambda i: n % i != 0, tests))\n return tests == non_factors", "def prime_t(n: int) -> bool:\n tests = set(range(2, int(math.sqrt(n) + 1)))\n non_factors = set(takewhile(lambda i: n % i != 0, t...
[ "0.7965246", "0.7965246", "0.7890046", "0.7881527", "0.7881527", "0.77694184", "0.7608477", "0.75690323", "0.7558906", "0.7472013", "0.7458843", "0.744599", "0.74436027", "0.73865134", "0.7363823", "0.7362152", "0.73538375", "0.73221636", "0.73094046", "0.73052025", "0.730291...
0.74383825
13
Returns the minimax action using self.depth and self.evaluationFunction
def getAction(self, gameState): "*** YOUR CODE HERE ***" def maxValue(gameState,depth,alpha,beta): #Pacman depth += 1 v = float("-inf") actions = gameState.getLegalActions(0) if gameState.isWin() or gameState.isLose() or depth == self.depth: #Termi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAction(self, gameState: GameState):\n _max = float(\"-inf\")\n action = None\n for move in gameState.getLegalActions(0):\n util = minimax(self.evaluationFunction, 1, 0,\n gameState.generateSuccessor(0, move), self.depth)\n if util > _max o...
[ "0.7483784", "0.7382961", "0.7182151", "0.7109776", "0.7087655", "0.70691997", "0.7068039", "0.70480233", "0.70028436", "0.696494", "0.6964087", "0.69627494", "0.6943741", "0.68970716", "0.6896859", "0.6884144", "0.68286437", "0.6765058", "0.6757903", "0.6754119", "0.6707149"...
0.0
-1
Assert that ``did`` can be used as a PID for creating a new object with MNStorage.create() or MNStorage.update().
def is_valid_pid_for_create(did): if not d1_gmn.app.did.is_valid_pid_for_create(did): raise d1_common.types.exceptions.IdentifierNotUnique( 0, 'Identifier is already in use as {}. did="{}"'.format( d1_gmn.app.did.classify_identifier(did), did ), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_existing_object(did):\n if not d1_gmn.app.did.is_existing_object(did):\n raise d1_common.types.exceptions.NotFound(\n 0,\n \"Identifier is {}. Expected a Persistent ID (PID) for an existing \"\n 'object. id=\"{}\"'.format(d1_gmn.app.did.classify_identifier(did), di...
[ "0.59771496", "0.5736521", "0.560397", "0.556752", "0.53540677", "0.5327777", "0.52259475", "0.52169216", "0.52004045", "0.50813574", "0.5045496", "0.50439674", "0.5042392", "0.5019849", "0.50005585", "0.49400398", "0.49354824", "0.49195772", "0.49167734", "0.49101257", "0.48...
0.6189828
0
Raise NotFound if object does not exist.
def is_existing_object(did): if not d1_gmn.app.did.is_existing_object(did): raise d1_common.types.exceptions.NotFound( 0, "Identifier is {}. Expected a Persistent ID (PID) for an existing " 'object. id="{}"'.format(d1_gmn.app.did.classify_identifier(did), did), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def raise_not_found(*_, **__):\n e = boto.exception.S3ResponseError(400, 'missing')\n e.error_code = 'NoSuchBucket'\n raise e", "def get_or_raise(self, _id):\n res = super(CustomQuery, self).get(_id)\n if not res:\n raise NotFoundException\n return...
[ "0.6742066", "0.661028", "0.65861696", "0.6547284", "0.6502915", "0.6497948", "0.64213824", "0.6360936", "0.6340305", "0.6266913", "0.6256397", "0.62553734", "0.6247619", "0.6230613", "0.6206148", "0.61901784", "0.6187557", "0.61419183", "0.6111518", "0.61041397", "0.6093073"...
0.5944009
32
create gradient op by optimiser.apply_gradients this function sets ``self.gradient_op``. Override this function for more complex optimisations such as using different optimisers for subnetworks.
def set_network_gradient_op(self, gradients): grad_list_depth = util_common.list_depth_count(gradients) if grad_list_depth == 3: # nested depth 3 means: gradients list is nested in terms of: # list of networks -> list of network variables self.gradient_op = [self.opti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def op_grad(self, save=True):\n return GradientOperator(self.model, save=save, geometry=self.geometry,\n kernel=self.kernel, space_order=self.space_order,\n **self._kwargs)", "def gradient(self):\n if self.operator is None:\n ...
[ "0.7052911", "0.6909245", "0.6659545", "0.6623767", "0.6557469", "0.65537715", "0.6455267", "0.6454432", "0.6419043", "0.64024943", "0.63899773", "0.6363964", "0.6346706", "0.63430107", "0.632974", "0.6325674", "0.6322554", "0.6322533", "0.6306514", "0.6305442", "0.629613", ...
0.7187101
0
add a TF placeholder for switching between train/valid graphs, this function sets ``self.is_validation``. ``self.is_validation`` can be used by applications.
def add_validation_flag(self): self.is_validation = \ tf.placeholder_with_default(False, [], 'is_validation')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_train(self):\n return tf.placeholder(dtype=tf.bool,\n name='is_train')", "def _build_placeholder(self):\n self.x = tf.placeholder(tf.float32, (None, self.input_size))\n self.y = tf.placeholder(tf.float32, [None, self.nb_targets])\n self.is_training...
[ "0.71300495", "0.65036786", "0.5806559", "0.57795703", "0.5754967", "0.5737809", "0.5727859", "0.565789", "0.56350905", "0.5625518", "0.5602453", "0.5575075", "0.55612886", "0.5558276", "0.5524915", "0.550343", "0.55021363", "0.54964566", "0.5469362", "0.5469362", "0.5458165"...
0.85394436
0
Add a set of n_variables variables all with same lower bounds, upper bounds and variable types.
def add_variables(self, n_variables, lb=None, ub=None, var_type=None): curr_n_vars = self.problem.variables.get_num() lb = convert_cplex_val(lb) ub = convert_cplex_val(ub) if var_type.lower() == "real" or var_type.lower() == "continuous": vtype = cplex.Cplex.variables.type....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_variables(self, variables):\n for variable in variables:\n self.variables.append(variable)", "def add(self, variables):\n if not isinstance(variables, (list, tuple)):\n variables = [variables]\n\n for v in variables:\n if isinstance(v, Variable):\n ...
[ "0.72584414", "0.657944", "0.65093094", "0.6432305", "0.63744444", "0.6240631", "0.6052686", "0.6033878", "0.600063", "0.59869707", "0.5957127", "0.5952298", "0.5935499", "0.59185004", "0.58994657", "0.5893091", "0.58846444", "0.58719516", "0.5833892", "0.57975787", "0.573002...
0.7770452
0
Sets the position of this dialog into the middle of the screen, unless that would cover the preview window, which it's then moved.
def set_position( self ): screen_rect = self.get_preview_window_screen_rect( ) while screen_rect.Intersects( self.GetScreenRect( ) ): pos = self.GetPosition( ) self.SetPosition( ( pos[ 0 ] - 2, pos[ 1 ] + 2 ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_on_screen(self):\n window_frame = self.frameGeometry()\n screen_center = QtGui.QDesktopWidget().availableGeometry().center()\n window_frame.moveCenter(screen_center)\n self.move(window_frame.topLeft())", "def centre(self):\n self.top.update_idletasks()\n # The...
[ "0.7848061", "0.78127086", "0.7723969", "0.769156", "0.7600058", "0.75827605", "0.75709105", "0.7550491", "0.7550491", "0.7509069", "0.7507597", "0.7491723", "0.7352147", "0.71621484", "0.71338266", "0.70658594", "0.7062997", "0.70537525", "0.6998688", "0.6862984", "0.6850574...
0.73971355
12
Get the configuration facade associated with this plugin.
def plugin_configuration(self): return self.__plugin_specific_facade
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(self):\n return self.config", "def get_config(cls):\n if not cls.config:\n import aha\n cls.config = aha.Config()\n return cls.config", "def get_config(cls) -> \"__Config\":\n if cls.__instance is None:\n cls.__instance = cls.__Config(...
[ "0.75835437", "0.73944145", "0.7346711", "0.73453575", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414", "0.73400414",...
0.8342699
0
Gets the id associated with the plugin.
def plugin_id(self): return self.__plugin_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\n\n\t\treturn self.__id", "def getid(self):\n return self.__id", "def get_id(self):\n return self.__id", "def get_id(self):\n return self.__id", "def get_id(self):\n return self.id", "def get_id(self):\n return self.id", "def get_id(self):\n r...
[ "0.742306", "0.7407126", "0.73649186", "0.73649186", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", "0.7338952", ...
0.837172
0
Gets the description of the plugin.
def plugin_description(self): return self.__plugin_description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(cls):\n return \"{} v{}\".format(cls.PLUGIN_NAME, cls.PLUGIN_VERSION)", "def getDescription(self):\n return self.description", "def get_description(self) -> str:\n pass", "def get_description(self):\n pass", "def get_description(self):\n return self.bot_da...
[ "0.8242069", "0.7884335", "0.783948", "0.78152436", "0.7814843", "0.7810102", "0.7810102", "0.7810102", "0.7810102", "0.78013104", "0.77801776", "0.77798647", "0.7760244", "0.7760244", "0.7760244", "0.7760244", "0.7760244", "0.7760244", "0.7760244", "0.7760244", "0.7760244", ...
0.87893456
0
Gets the optional configuration items for the plugin.
def plugin_configuration(self): return self.__plugin_configuration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gather_configs(self):\n configs = []\n for what in self.order:\n for key in self.plugins[what]:\n mgr = self.plugins[what][key]\n c = mgr.config(what='get')\n if c is not None:\n c.update({\n 'descri...
[ "0.63282007", "0.631417", "0.6293966", "0.6231009", "0.62015873", "0.6103507", "0.60760957", "0.6070853", "0.6019221", "0.5992403", "0.5909199", "0.5896117", "0.5854726", "0.58467823", "0.58467823", "0.5837443", "0.58163404", "0.58151346", "0.58135164", "0.58085364", "0.58006...
0.6065974
8
Gets a value indicating whether the plugin is enabled by default.
def plugin_enabled_by_default(self): return self.__plugin_enabled_by_default
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enabled(self) -> typing.Optional[bool]:\n return self._values.get('enabled')", "def enabled(self):\n return self._get('enabled')", "def enabled(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"enabled\")", "def enabled(self) -> pulumi.Output[Optional[bool]]:\n ...
[ "0.77858526", "0.77241457", "0.7658339", "0.7658339", "0.7658339", "0.7658339", "0.7650219", "0.76353735", "0.76353735", "0.76353735", "0.76353735", "0.76353735", "0.76353735", "0.76353735", "0.76353735", "0.74537766", "0.7402742", "0.7402742", "0.7402742", "0.7402742", "0.74...
0.84165627
0
Creates a new exported `MTProtoSender` for the given `dc_id` and returns it. This method should be used by `_borrow_exported_sender`.
async def _create_exported_sender(self: 'TelegramClient', dc_id): # Thanks badoualy/kotlogram on /telegram/api/DefaultTelegramClient.kt # for clearly showing how to export the authorization dc = next(dc for dc in await self._session.get_all_dc() if dc.id == dc_id) # Can't reuse self._sender._connection ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _borrow_exported_sender(self: 'TelegramClient', dc_id):\n async with self._borrow_sender_lock:\n self._log[__name__].debug('Borrowing sender for dc_id %d', dc_id)\n state, sender = self._borrowed_senders.get(dc_id, (None, None))\n\n if state is None:\n state = _ExportSt...
[ "0.7217384", "0.52276224", "0.49650896", "0.4693416", "0.46321505", "0.46231443", "0.43640688", "0.42434174", "0.41984987", "0.41977885", "0.41458058", "0.4062867", "0.4038644", "0.40264404", "0.402358", "0.40206975", "0.39805055", "0.39801347", "0.39801347", "0.3976405", "0....
0.76553065
0
Gets the entity_id of this GnbrEntity.
def entity_id(self) -> str: return self._entity_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def tracked_entity_id(sel...
[ "0.83816034", "0.83816034", "0.83816034", "0.83816034", "0.83816034", "0.73604214", "0.6684855", "0.66122913", "0.6603361", "0.6560944", "0.6560944", "0.6554045", "0.65469015", "0.65469015", "0.65469015", "0.65469015", "0.65469015", "0.65469015", "0.6537821", "0.6526907", "0....
0.82305014
5
Sets the entity_id of this GnbrEntity.
def entity_id(self, entity_id: str): self._entity_id = entity_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_id(self, entity_id):\n\n self._entity_id = entity_id", "def entity_id(self, entity_id):\n if entity_id is None:\n raise ValueError(\"Invalid value for `entity_id`, must not be `None`\")\n\n self._entity_id = entity_id", "def entities_id(self, entities_id):\n\n ...
[ "0.8288201", "0.8143605", "0.710147", "0.6396977", "0.61571753", "0.6148404", "0.6097774", "0.6081623", "0.6022661", "0.59523666", "0.592483", "0.59076554", "0.58642125", "0.58642125", "0.58642125", "0.58642125", "0.58642125", "0.5847443", "0.5830166", "0.5777051", "0.5768798...
0.8314648
0
Gets the entity_type of this GnbrEntity.
def entity_type(self) -> str: return self._entity_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_entity_type(self):\n return self.entity_type", "def entity_type(self):\n return self._entity_type", "def entity_type(self) -> Optional[str]:\n return pulumi.get(self, \"entity_type\")", "def entity_type(self) -> pulumi.Input['EntityTypes']:\n return pulumi.get(self, \"enti...
[ "0.8542432", "0.84792125", "0.79119366", "0.78808355", "0.7716083", "0.70651644", "0.68521446", "0.6791437", "0.668665", "0.6685961", "0.6685961", "0.6645466", "0.6559821", "0.6556425", "0.6556425", "0.64717364", "0.6438633", "0.643395", "0.642919", "0.64279866", "0.6407762",...
0.8336438
2
Sets the entity_type of this GnbrEntity.
def entity_type(self, entity_type: str): self._entity_type = entity_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_type(self, entity_type):\n\n self._entity_type = entity_type", "def entity_type(self, entity_type):\n self._entity_type = entity_type", "def entity_type_desc(self, entity_type_desc):\n\n self._entity_type_desc = entity_type_desc", "def set_type(self, type):\n self._type...
[ "0.84701186", "0.84087425", "0.6599031", "0.6574622", "0.65536606", "0.65536606", "0.6332872", "0.6294857", "0.6275292", "0.608498", "0.6057113", "0.6003545", "0.5960835", "0.5960835", "0.59415346", "0.59415346", "0.59415346", "0.59415346", "0.59415346", "0.59415346", "0.5941...
0.85579747
0
Returns available memory in RAM in desired unit.
def check_available_memory(self,unit='B'): free = psutil.virtual_memory().available if unit == 'MB': return free/10**6 elif unit == 'GB': return free/10**9 else: return free
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_available_memory():\n if platform == 'linux' or platform == 'linux2':\n return _get_available_memory_linux()\n elif platform == 'darwin':\n return _get_available_memory_darwin()\n else:\n raise Exception('Platform not supported')", "def memory():\n sin = psutil.virtual_me...
[ "0.81729186", "0.80453295", "0.79690474", "0.7938131", "0.79042554", "0.7829366", "0.7782277", "0.77715117", "0.7622908", "0.7603248", "0.75250715", "0.7492936", "0.74622285", "0.74622285", "0.74622285", "0.74622285", "0.74622285", "0.74622285", "0.74622285", "0.7448267", "0....
0.80129975
2