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 |
|---|---|---|---|---|---|---|
only past questions should be displayed | def test_index_view_with_future_question_and_past_question(self):
create_question(question_text="Past question", days=-30)
create_question(question_text="Future qeustion", days=30)
response = self.client.get(reverse('polls:index'))
self.assertQuerysetEqual(response.context['latest_questi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_past_questions(self):\n q = create_question(question_text=\"Past question\", days=-30)\n res = self.client.get(reverse(\"polls:detail\", args=(q.id,)))\n self.assertEqual(res.status_code, 200)\n self.assertContains(res, q.question_text)",
"def test_many_past_questions(self):\... | [
"0.7199297",
"0.7119368",
"0.70831984",
"0.7037178",
"0.70339316",
"0.7000749",
"0.6989474",
"0.69005334",
"0.6898839",
"0.6896799",
"0.6878322",
"0.6831274",
"0.6811948",
"0.6803369",
"0.67873764",
"0.67794204",
"0.6756986",
"0.6753992",
"0.67526215",
"0.6677555",
"0.6649393... | 0.66486704 | 21 |
The detail view of a question with a pub_date in the future should return a 404 not found | def test_detail_view_with_a_future_question(self):
future_question = create_question(question_text="Future question",
days=5)
response = self.client.get(reverse('polls:detail',
args=(future_question.id,)))
self.assertEqual(response.status_code, 404) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_detail_view_with_a_future_question(self):\n future_question = create_question(question_text='Future question.',\n days=5)\n response = self.client.get(reverse('polls:detail',\n args=(future_question.id,)))\n se... | [
"0.7465095",
"0.74370164",
"0.7328822",
"0.696667",
"0.6928491",
"0.68733644",
"0.68635327",
"0.6860058",
"0.6852723",
"0.67572737",
"0.6734475",
"0.6692591",
"0.6686302",
"0.66791445",
"0.66613936",
"0.66373783",
"0.65971273",
"0.6587561",
"0.6572185",
"0.6571939",
"0.657109... | 0.7454056 | 1 |
The detail of a question with a pub_date in the past should display the qeustion's text | def test_detail_view_with_a_past_question(self):
past_question = create_question(question_text="Past question",
days=-30)
response = self.client.get(reverse('polls:detail',
args=(past_question.id,)))
self.assertContains(response, past_question.question_text,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return \"question_text: \" + self.question_text \\\n + \"\\npub_date:\" + self.pub_date.__str__()",
"def test_detail_view_with_a_past_question(self):\n\t\tpast_question=create_question(question_text=\"Past question\",days=-5)\n\t\turl=reverse('polls:detail',args=(past_... | [
"0.7231983",
"0.65183586",
"0.65135074",
"0.64287055",
"0.6427096",
"0.640454",
"0.63872045",
"0.61895484",
"0.60544944",
"0.6033458",
"0.6027797",
"0.6027278",
"0.6018954",
"0.6007511",
"0.59893477",
"0.59845465",
"0.5980241",
"0.59787977",
"0.59606546",
"0.5934973",
"0.5934... | 0.6508841 | 3 |
Tests the WriteProjects function. | def testWriteProjects(self):
solution_project = resources.VSSolutionProject('name', 'file', 'guid')
file_writer = writers.VSSolutionFileWriter()
file_writer._file = io.BytesIO()
file_writer.WriteProjects([solution_project])
file_writer._file.seek(0, os.SEEK_SET)
output_data = file_writer._fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testWriteProject(self):\n solution_project = resources.VSSolutionProject('name', 'filename', 'guid')\n\n file_writer = writers.VS2010SolutionFileWriter()\n\n file_writer._file = io.BytesIO()\n\n file_writer.WriteProject(solution_project)\n\n file_writer._file.seek(0, os.SEEK_SET)\n output_dat... | [
"0.77998793",
"0.7701273",
"0.7217734",
"0.7195361",
"0.7166878",
"0.7027338",
"0.6999884",
"0.6944488",
"0.69393265",
"0.6915377",
"0.6915377",
"0.6915377",
"0.68632686",
"0.6814088",
"0.67203605",
"0.67108923",
"0.67108923",
"0.6631687",
"0.66254747",
"0.6597005",
"0.659700... | 0.8232287 | 0 |
Hide the left list with associated buttons. | def lefthide(self):
self._hideitemlist(ITEMLIST_LEFT) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide_form(self):\n\n # hide details\n if hasattr(self, '_details'): self._details.hide()\n\n # show the buttons, only if the they exists:\n toolbar = [self.toolbar] if isinstance(self.toolbar, str) else self.toolbar\n if toolbar:\n for o in toolbar:\n ... | [
"0.7199304",
"0.71847236",
"0.7032018",
"0.6765964",
"0.67150974",
"0.63869405",
"0.6375561",
"0.6357977",
"0.6335562",
"0.6312002",
"0.62731373",
"0.62177813",
"0.61750305",
"0.61573493",
"0.60736567",
"0.5938489",
"0.59095347",
"0.59063184",
"0.58670026",
"0.58586365",
"0.5... | 0.7500013 | 0 |
Add items to the left list. | def leftaddlistitems(self, items, pos):
self._leftlist.insert(pos, items) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left_merge(self,list_to_merge):\n self.items = list_to_merge + self.items\n return self.items",
"def appendleft(self, *args, **kwargs): # real signature unknown\n pass",
"def rightaddlistitems(self, items, pos):\n self._rightlist.insert(pos, items)",
"def appendleft(self, item... | [
"0.7398808",
"0.6948977",
"0.68690693",
"0.6832749",
"0.6806612",
"0.65225494",
"0.6519588",
"0.64178354",
"0.6410609",
"0.63751113",
"0.6339531",
"0.6339531",
"0.6338133",
"0.6337803",
"0.6288872",
"0.6284949",
"0.6279986",
"0.624332",
"0.6136764",
"0.61081666",
"0.6046776",... | 0.85111964 | 0 |
Replace an item in the left list. | def leftreplacelistitem(self, pos, newitem):
self._leftlist.replace(pos, newitem) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rightreplacelistitem(self, pos, newitem):\n self._rightlist.replace(pos, newitem)",
"def leftaddlistitems(self, items, pos):\n self._leftlist.insert(pos, items)",
"def shift_left(L):\n\n\t# store the first item of the list\n\tfirst_item = L[0]\n\n\t# Start the loop from the second item\n\tfor... | [
"0.7316302",
"0.6619246",
"0.6389923",
"0.61740845",
"0.61405146",
"0.6124647",
"0.6102235",
"0.6070367",
"0.5963874",
"0.5925284",
"0.5913263",
"0.5843293",
"0.57933193",
"0.5772171",
"0.57672626",
"0.575624",
"0.57463413",
"0.57104033",
"0.57059133",
"0.57059133",
"0.570474... | 0.82617414 | 0 |
Return the left list as a list of strings. | def leftgetlist(self):
return self._leftlist.get() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def left_join_list_one():\n return[\n ['wrath', 'anger', 'delight'],\n ['fond', 'enamored', 'averse'],\n ['guide', 'usher', 'jam'],\n ['outfit', 'garb', 'follow'],\n ['diligent', 'employed', 'idle'],\n ]",
"def left_view(self)->list:\n\t\tqueue=[]\n\t\... | [
"0.68093973",
"0.65685374",
"0.6259618",
"0.6227167",
"0.62120026",
"0.6176302",
"0.6133818",
"0.6035178",
"0.6029446",
"0.59406936",
"0.59406936",
"0.5810261",
"0.5777096",
"0.57002753",
"0.5653908",
"0.56286365",
"0.56286365",
"0.56265116",
"0.561089",
"0.5610578",
"0.56103... | 0.72812694 | 0 |
Hide the right list with associated buttons. | def righthide(self):
self._hideitemlist(ITEMLIST_RIGHT) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide_form(self):\n\n # hide details\n if hasattr(self, '_details'): self._details.hide()\n\n # show the buttons, only if the they exists:\n toolbar = [self.toolbar] if isinstance(self.toolbar, str) else self.toolbar\n if toolbar:\n for o in toolbar:\n ... | [
"0.770959",
"0.71673775",
"0.6930048",
"0.68198544",
"0.6734804",
"0.6733009",
"0.671899",
"0.6582263",
"0.6574639",
"0.6568872",
"0.6519914",
"0.6506404",
"0.6482521",
"0.6369918",
"0.627988",
"0.624365",
"0.61586857",
"0.61329514",
"0.61112493",
"0.6107773",
"0.6096466",
... | 0.74686515 | 1 |
Return the right list as a list of strings. | def rightgetlist(self):
return self._rightlist.get() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listToString(L):\r\n S = ''\r\n for x in L:\r\n S += str(x)\r\n return S",
"def get_list_of_str2(self):\n pass",
"def str_transform_list(L):\n return [str(x) for x in L]",
"def list_stringify(inlist):\n outlist = []\n for item in inlist:\n if not isi... | [
"0.71020573",
"0.70432144",
"0.70036364",
"0.69376296",
"0.68838024",
"0.6803394",
"0.6741269",
"0.67406344",
"0.6711513",
"0.658475",
"0.65800935",
"0.65538466",
"0.6546351",
"0.6543239",
"0.65323985",
"0.65034825",
"0.65028024",
"0.64866114",
"0.6441124",
"0.64124703",
"0.6... | 0.0 | -1 |
Builds the spatial gaussian filter | def build_filter(n, sigma):
filter_ = np.zeros((n,n))
begin = n//2
for i in range(n):
for j in range(n):
val = ((i-begin)**2 + (j-begin)**2)**0.5
filter_[i][j] = gaussian(val, sigma)
return filter_ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gaussian_filter(x):\n return _gaussian_filter(x, 3)",
"def gaussian_filter(self, sigma):\n\n mask = self.get_weighted_mask()\n mask_f = ni.gaussian_filter(mask, sigma=sigma)\n\n return SpatialReceptiveField(mask_f, self.altPos, self.aziPos, sign=self.sign,\n ... | [
"0.70848453",
"0.6906198",
"0.6858145",
"0.67343736",
"0.66166544",
"0.6580515",
"0.65506697",
"0.65310293",
"0.6440362",
"0.6429863",
"0.6310756",
"0.6308838",
"0.626769",
"0.6187668",
"0.61803114",
"0.6164105",
"0.6160716",
"0.611656",
"0.60857046",
"0.60747415",
"0.6060514... | 0.63107806 | 10 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(y_true, y_pred, classes,
normalize=False,
title=None,
cmap=plt.cm.Blues,
text=False):
if not title:
if normalize:
title = 'Normalized confusion matrix'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.8194862",
"0.80949175",
"0.8029915",
"0.8019153",
"0.79941195",
"0.7991258",
"0.7980955",
"0.7976606",
"0.79610753",
"0.79590565",
"0.79378676",
"0.7934962",
"0.7934504",
"0.79313844",
"0.7926313",
"0.7924577",
"0.79241234",
"0.7923211",
"0.7923023",
"0.7921931",
"0.791787... | 0.0 | -1 |
Declare exchange for queue. | async def declare_exchange(self) -> asyncio.Future:
# pylint: disable=protected-access
future = self._backend._create_future()
def on_declare_exchange(frame):
future.set_result(frame)
self.log.debug('Exchange `%s` declared ok', self.exchange)
self._channel.excha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_exchange(self):\n self.logger.info('declaring exchange %s', self.exchange)\n self._channel.exchange_declare(self.on_exchange_declareok, self.exchange, self.exchange_type)",
"async def declare(self) -> 'Queue':\n # we are relying to this in other functions\n self._channel = a... | [
"0.7781021",
"0.7508126",
"0.7418307",
"0.71911263",
"0.7166336",
"0.70669943",
"0.7066749",
"0.6991603",
"0.6963174",
"0.69463104",
"0.6867439",
"0.68669176",
"0.68404776",
"0.6791428",
"0.67669785",
"0.66712964",
"0.66649693",
"0.6560258",
"0.64725375",
"0.64126927",
"0.631... | 0.7245586 | 3 |
Computes the difference in days between two dates. | def days(t1, t2, date_format):
start = datetime.strptime(t1, date_format)
stop = datetime.strptime(t2, date_format)
delta = stop - start
return delta.days | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diff_dates(date1, date2):\n\n return abs(date2 - date1).days",
"def dates_diff(date2, date1):\n\n d2 = datetime.datetime.strptime(date2, '%Y-%m-%d').date()\n d1 = datetime.datetime.strptime(date1, '%Y-%m-%d').date()\n return (d2 - d1).days",
"def days_between(self, d1, d2):\n self.is_not... | [
"0.8406581",
"0.7928747",
"0.78135186",
"0.7656524",
"0.75229293",
"0.74860615",
"0.7472408",
"0.7375814",
"0.7362236",
"0.72220373",
"0.7219344",
"0.71616554",
"0.70720047",
"0.6945283",
"0.6847314",
"0.6791213",
"0.66582143",
"0.6651553",
"0.66408193",
"0.6610453",
"0.65629... | 0.73380524 | 9 |
Return the nuclear binding energy associated with an isotope. | def nuclear_binding_energy(
particle: Particle, mass_numb: Optional[Integral] = None
) -> u.J:
return particle.binding_energy.to(u.J) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bind_energy(self):\n return self._bind_energy",
"def get_energy(self):\n return self.momentum*self.momentum/(2*self.mass)",
"def energy(self):\n sum_energy = 0.0\n for i in range(0,self.natoms-1):\n for j in range(i+1,self.natoms):\n rij... | [
"0.6126995",
"0.60313594",
"0.6021848",
"0.594922",
"0.59394354",
"0.5862146",
"0.5848031",
"0.5780028",
"0.57739526",
"0.5684939",
"0.5671667",
"0.56603223",
"0.56538826",
"0.5640235",
"0.5640109",
"0.55997443",
"0.55997443",
"0.556194",
"0.55206907",
"0.55113035",
"0.548834... | 0.71787757 | 0 |
Return a particle's mass energy. If the particle is an isotope or nuclide, return the nuclear mass energy only. | def mass_energy(particle: Particle, mass_numb: Optional[Integral] = None) -> u.J:
return particle.mass_energy | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def particleMass(self):\n return self.params['particleMass']",
"def intEnergy_mass(self):\n return _cantera.reactor_intEnergy_mass(self.__reactor_id)",
"def mass_energy():\n c2 = _si.c.value**2\n return Equivalency(\n [\n (si.kg, si.J, lambda x: x * c2, lambda x: x / c2),\... | [
"0.73471344",
"0.7179936",
"0.7131407",
"0.70101446",
"0.6928021",
"0.6886441",
"0.6879889",
"0.68210626",
"0.67972165",
"0.67203254",
"0.67010635",
"0.6693287",
"0.6679324",
"0.6621035",
"0.6528675",
"0.6483354",
"0.6446284",
"0.6393113",
"0.6393113",
"0.63216066",
"0.631784... | 0.819669 | 0 |
to_categorical. Convert class vector (integers from 0 to nb_classes) to binary class matrix, for use with categorical_crossentropy. | def to_categorical(y, nb_classes):
y = np.asarray(y, dtype='int32')
if not nb_classes:
nb_classes = np.max(y)+1
Y = np.zeros((len(y), nb_classes))
for i in range(len(y)):
Y[i, y[i]] = 1.
return Y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_categorical(x, num_classes):\n return np.eye(num_classes, dtype='uint8')[x]",
"def to_categorical(y, num_classes):\n return np.eye(num_classes, dtype='uint8')[y]",
"def to_categorical(y, num_classes):\n return np.eye(num_classes, dtype='uint8')[y]",
"def to_categorical(y, num_classes)... | [
"0.82260484",
"0.80667555",
"0.80667555",
"0.80667555",
"0.80667555",
"0.80667555",
"0.8048802",
"0.80279225",
"0.789644",
"0.78796744",
"0.77850944",
"0.77732944",
"0.77316386",
"0.77169",
"0.77133614",
"0.77082926",
"0.7661918",
"0.7549069",
"0.735227",
"0.7332984",
"0.7316... | 0.7958936 | 8 |
Construct a DataSet. one_hot arg is used only if fake_data is true. `dtype` can be either `uint8` to leave the input as `[0, 255]`, or `float32` to rescale into `[0, 1]`. | def __init__(self, images, labels, batch_size, fake_data=False, one_hot=False, dtype=tf.float32, eval_data=False):
dtype = tf.as_dtype(dtype).base_dtype
if dtype not in (tf.uint8, tf.float32):
raise TypeError('Invalid image dtype %r, expected uint8 or float32' % dtype)
if fake_data:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def one_hot(x, num_classes, dtype=jnp.float32):\n return jax.nn.one_hot(x, num_classes).astype(dtype)",
"def labels_to_one_hot(\n labels: np.ndarray, categories: int, axis: int = 0,\n keepdims=False, dtype=bool\n):\n if keepdims:\n assert labels.shape[axis] == 1\n result_ndim = la... | [
"0.69277316",
"0.63685834",
"0.6323719",
"0.632244",
"0.6283671",
"0.62293434",
"0.6220528",
"0.619714",
"0.61865234",
"0.6174522",
"0.61674124",
"0.6167214",
"0.61601204",
"0.61573094",
"0.61573094",
"0.6152494",
"0.61482465",
"0.6141931",
"0.6114069",
"0.61127585",
"0.61126... | 0.0 | -1 |
Returns subscription from RH marketplace. None returned if no subscription is found. | def check_internal_api_for_subscription(namespace_user):
plans = []
if namespace_user.organization:
query = organization_skus.get_org_subscriptions(namespace_user.id)
org_subscriptions = list(query.dicts()) if query is not None else []
for subscription in org_subscriptions:
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_subscription(self):\n response = requests.get(\n 'https://www.googleapis.com/youtube/v3/subscriptions',\n params={\n 'part': 'snippet',\n 'mine': 'true',\n 'forChannelId': self.channel_id\n },\n headers=self.he... | [
"0.6917027",
"0.68124664",
"0.6391136",
"0.6391136",
"0.63900375",
"0.6244377",
"0.6237581",
"0.6237581",
"0.6227604",
"0.62093335",
"0.6112149",
"0.6108837",
"0.6075639",
"0.6073726",
"0.6056227",
"0.6023441",
"0.5971113",
"0.5897838",
"0.58673143",
"0.56633675",
"0.5612202"... | 0.0 | -1 |
Fetch any existing subscription for the user. | def get(self):
cus = None
user = get_authenticated_user()
private_repos = model.user.get_private_repo_count(user.username)
if user.stripe_id:
try:
cus = billing.Customer.retrieve(user.stripe_id)
except stripe.error.APIConnectionError as e:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self):\n user = get_authenticated_user()\n account_number = marketplace_users.get_account_number(user)\n if not account_number:\n raise NotFound()\n\n user_subscriptions = marketplace_subscriptions.get_list_of_subscriptions(account_number)\n\n for subscription ... | [
"0.727217",
"0.702665",
"0.694784",
"0.68337953",
"0.6749732",
"0.6716749",
"0.6694756",
"0.66495746",
"0.6613002",
"0.66031724",
"0.65029895",
"0.64654076",
"0.6443347",
"0.64124423",
"0.6382712",
"0.63508177",
"0.6342305",
"0.62917507",
"0.62909585",
"0.6280539",
"0.6239422... | 0.6490319 | 11 |
Fetch any existing subscription for the org. | def get(self, orgname):
cus = None
permission = AdministerOrganizationPermission(orgname)
if permission.can():
private_repos = model.user.get_private_repo_count(orgname)
organization = model.organization.get_organization(orgname)
if organization.stripe_id:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, orgname):\n permission = AdministerOrganizationPermission(orgname)\n if permission.can():\n organization = model.organization.get_organization(orgname)\n query = model.organization_skus.get_org_subscriptions(organization.id)\n\n if query:\n ... | [
"0.7433474",
"0.676344",
"0.66400635",
"0.6486406",
"0.6395439",
"0.63730305",
"0.63252914",
"0.6200402",
"0.61924785",
"0.6181714",
"0.61109835",
"0.60879236",
"0.60788506",
"0.6046341",
"0.6037981",
"0.60107756",
"0.59909296",
"0.5943589",
"0.5937596",
"0.58616847",
"0.5857... | 0.66069144 | 3 |
Get sku assigned to org | def get(self, orgname):
permission = AdministerOrganizationPermission(orgname)
if permission.can():
organization = model.organization.get_organization(orgname)
query = model.organization_skus.get_org_subscriptions(organization.id)
if query:
subscripti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sku(self):\n return self._sku",
"def sku(self) -> pulumi.Output[Optional['outputs.SkuDescriptionResponse']]:\n return pulumi.get(self, \"sku\")",
"def sku(self) -> pulumi.Output[Optional['outputs.SkuDescriptionResponse']]:\n return pulumi.get(self, \"sku\")",
"def sku(self) -> 'outpu... | [
"0.7663973",
"0.7591175",
"0.7591175",
"0.75838256",
"0.75838256",
"0.757788",
"0.757788",
"0.747845",
"0.747845",
"0.7452164",
"0.7315075",
"0.72443485",
"0.7187031",
"0.7187031",
"0.7187031",
"0.71775377",
"0.7167821",
"0.71613175",
"0.710244",
"0.7020652",
"0.69835085",
... | 0.5972239 | 32 |
The ID of the EFS volume, e.g. `fs0123cdef`. Required. Immutable. | def file_system_id(self) -> str:
return pulumi.get(self, "file_system_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def volume_id(self):\n return self._volume_id",
"def volume_id(self):\n if self.volume:\n return self.volume.id\n else:\n return None",
"def uuid(self):\n if openmediavault.string.is_fs_uuid(self._id):\n return self._id\n return self.get_udev_... | [
"0.76780653",
"0.75158453",
"0.66730714",
"0.6299974",
"0.6277481",
"0.62374896",
"0.62069404",
"0.62069404",
"0.6206588",
"0.6060854",
"0.6040502",
"0.6040502",
"0.60053104",
"0.59713244",
"0.59494144",
"0.5912962",
"0.58968335",
"0.5864999",
"0.58258766",
"0.5804685",
"0.57... | 0.63653195 | 3 |
This function prints and plots the confusion matrix. | def plot_confusion_matrix(cm, classes, acc,
cmap=plt.cm.Reds):
plt.figure(figsize=(10, 8))
title = 'Confusion Matrix (Accuracy: %0.3f%%)' % (acc * 100)
print(cm)
plt.imshow(cm, interpolation='nearest', cmap=cmap)
plt.title(title, fontsize=16)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()",
"def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\"... | [
"0.80894613",
"0.80770946",
"0.79976976",
"0.7946727",
"0.7921785",
"0.78448296",
"0.7833224",
"0.7781221",
"0.7775631",
"0.77574563",
"0.77061635",
"0.7692213",
"0.76785815",
"0.76588994",
"0.7641414",
"0.7622791",
"0.7611233",
"0.7610989",
"0.7598244",
"0.758727",
"0.758452... | 0.77016985 | 11 |
Copies the current state dictionary (`self.state`) to the simulation state dictionary (`self.sim_state`) | def updateSimState(self):
self.sim_state = {k: v for k,v in self.state.iteritems()} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_sim_state_fn(state_dict: dict):\n # state_dicts = [deepcopy(state_dict) for j in range(num_cpu)]\n sim_env.set_env_state(state_dict)",
"def set_state(self, state_dict):\n super().set_state(copy.deepcopy(state_dict))\n self._client_state = copy.deepcopy(state_dict.get(\"_client... | [
"0.71074384",
"0.6782745",
"0.6732431",
"0.6727195",
"0.6662992",
"0.6634903",
"0.66279715",
"0.66120386",
"0.65967447",
"0.6583836",
"0.6487327",
"0.6452144",
"0.64447504",
"0.64050144",
"0.63940907",
"0.638837",
"0.6377453",
"0.6366176",
"0.63551056",
"0.6346229",
"0.633461... | 0.83781934 | 0 |
Decorator to wrap chainable commands, allowing for immediate execution of the wrapped command by passing in an `execute=True` kwarg. | def execWrap(func):
@wraps(func)
def addAndExec(self, *args, **kwargs):
execute = False
if 'execute' in kwargs:
execute = kwargs.pop('execute')
if 'minimal_reset' in kwargs:
minimal_reset = kwargs.pop('minimal_reset')
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cmd_execution_wrapper(f, cmd):\n def execute_command(self, *args, **kwargs):\n args = (cmd,) + args\n return f(*args, **kwargs)\n return execute_command",
"def command(wrapped=None, synonyms=(), helphint=\"\", hidden=False,\n chat_only=False, muc_only=False):\n def decorator... | [
"0.67380124",
"0.6521982",
"0.6192524",
"0.6141728",
"0.6096048",
"0.6013635",
"0.5874178",
"0.5783662",
"0.57833076",
"0.57513505",
"0.5655654",
"0.5646015",
"0.5546433",
"0.55205965",
"0.551244",
"0.5505672",
"0.5488535",
"0.5472915",
"0.5452738",
"0.54519683",
"0.54362726"... | 0.74900055 | 0 |
Get a Kubernetes Dashboard access URL for this Cluster. | def cluster_dashboard_url_view(self):
result = self._client.get(
"{}/dashboard".format(LKECluster.api_endpoint), model=self
)
return result["url"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dashboard_url(self) -> str:\n return self._dashboard_url",
"def getCloudDashBoardLink(cloudId):\n \n dashboardLink = \"\"\n from deployment.environment import *\n controllerIPList = getAllControllers(cloudId)\n \n # if controller ip list is not empty\n if controllerIPList:\n ... | [
"0.7049282",
"0.658814",
"0.6374867",
"0.622899",
"0.5916835",
"0.5835267",
"0.564587",
"0.5611031",
"0.5587467",
"0.55657405",
"0.5496111",
"0.5494705",
"0.5464434",
"0.5422584",
"0.5366286",
"0.53152597",
"0.52988446",
"0.5274182",
"0.5267831",
"0.52314776",
"0.5222616",
... | 0.7632947 | 0 |
Removes user defined changes from config | def mock_config():
real_configuration = pymod.config.config
cfg = pymod.config.Configuration()
basename = pymod.names.config_file_basename
default_config_file = os.path.join(pymod.paths.etc_path, "defaults", basename)
defaults = pymod.config.load_config(default_config_file)
cfg.push_scope("defau... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean(self):\n all_props = self.__class__.CONFIG_PROPERTIES\n for prop_name in self._modified:\n attr_config = all_props.get(prop_name)\n if attr_config and attr_config.input_func:\n self._config[prop_name] = attr_config.input_func(self._config[prop_name])\n ... | [
"0.69350046",
"0.689565",
"0.68783915",
"0.68354017",
"0.6730011",
"0.66864425",
"0.6645544",
"0.6619824",
"0.6591215",
"0.6562911",
"0.6473854",
"0.6387824",
"0.63778603",
"0.63579047",
"0.6336389",
"0.6331546",
"0.6196735",
"0.61814016",
"0.61658597",
"0.61461383",
"0.61270... | 0.0 | -1 |
returns the train (and test if selected) loaders for the olivetti rotated faces dataset | def get_faces_loaders(batch_size=128, test=True, data_path="./data/"):
dat = np.load(data_path + "rotated_faces_data.npz")
train_images = torch.FloatTensor(dat['train_images'])
train_targets = torch.FloatTensor(dat['train_angles'])
traindata = torch.utils.data.TensorDataset(train_images, train_targets... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def creates_data_loader():\n dataset_faces = FaceDataset(\n IMG_DIR, transform=transform_train, face=True)\n\n dataset_no_faces = FaceDataset(\n IMG_DIR, transform=transform_train, face=False)\n\n datasets_faces_split = train_val_test(dataset_faces, 0.2, 0.0)\n datasets_no_faces_split = t... | [
"0.69626784",
"0.69410944",
"0.6818357",
"0.66996723",
"0.66670394",
"0.66224897",
"0.6561423",
"0.64823896",
"0.64003897",
"0.6352537",
"0.63319135",
"0.6238648",
"0.6206694",
"0.619519",
"0.61648226",
"0.6148471",
"0.6135325",
"0.6104861",
"0.6077645",
"0.60772943",
"0.6070... | 0.7952971 | 0 |
Add the item to the last level of the stack. | def push(self, item) -> None:
self.items.append(item) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append(self, item):\r\n self.stack.append(item)",
"def push(self, item):\n self.stack.append(item)",
"def push(self, item):\n self.stack.append(item)",
"def push(self, item):\r\n self.stack.insert(0, item)",
"def push(self, item: Any) -> None:\n if self.hit is True an... | [
"0.80668455",
"0.7656692",
"0.7656692",
"0.76038665",
"0.753395",
"0.7454897",
"0.741971",
"0.73342085",
"0.7237736",
"0.71183443",
"0.70895195",
"0.7011326",
"0.6972942",
"0.68915206",
"0.6885691",
"0.6846061",
"0.6832934",
"0.68147594",
"0.66794455",
"0.66783357",
"0.667631... | 0.6773966 | 18 |
Get the last item from the top of the stack. If the stack is empty, will print that the stack is empty. | def pop(self) -> object or None:
if len(self.items) > 0:
return self.items.pop() # use the pop() method from a list
else:
print("Stack is empty! \n") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top(self):\n try:\n if self.size() > 0:\n return self.items[len(self.items) - 1]\n else:\n raise IndexError('Cannot get top item, stack is empty.')\n except IndexError as err:\n print(err)\n raise",
"def top(self):\n ... | [
"0.7735729",
"0.7613924",
"0.7610834",
"0.76019424",
"0.75833285",
"0.749229",
"0.7423774",
"0.7411805",
"0.7411552",
"0.7388405",
"0.7366177",
"0.73643327",
"0.73507077",
"0.7338133",
"0.73219585",
"0.7316381",
"0.7295624",
"0.7248007",
"0.72400844",
"0.72378695",
"0.723399"... | 0.72282594 | 24 |
test if the stack is empty. | def its_empty(self) -> bool:
return self.items == [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.the_stack) == 0",
"def is_empty(self):\n return len(self.stack) == 0",
"def empty(self):\r\n return len(self.stack) == 0",
"def empty(self):\n return len(self.stack) == 0",
"def empty(self):\n return len(self.stack) == 0",
"def is_e... | [
"0.92184854",
"0.91338575",
"0.89801025",
"0.8934814",
"0.8934814",
"0.89057714",
"0.8879942",
"0.8874342",
"0.88432723",
"0.8818194",
"0.88143766",
"0.88084346",
"0.87563837",
"0.86835235",
"0.86590123",
"0.86310226",
"0.8619374",
"0.85913885",
"0.85913885",
"0.8586636",
"0.... | 0.0 | -1 |
Return the number of levels of the stack. | def height(self) -> int:
return len(self.items) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nlevels(self) -> int:\n return len(self._levels)",
"def Nlevels(self):\n return self._nlevels",
"def n_levels(self):\n return self.primary_header['Number of levels']",
"def get_num_levels(self):\n return len(self._Psi)",
"def count_level(self):\r\n count = 0\r\n\r\n ... | [
"0.818606",
"0.79850614",
"0.77469826",
"0.7497867",
"0.7483659",
"0.7447236",
"0.71516824",
"0.7103937",
"0.7100037",
"0.70526385",
"0.70526385",
"0.6889827",
"0.6850176",
"0.6824847",
"0.6822693",
"0.68187076",
"0.6769535",
"0.6765189",
"0.6764915",
"0.6750579",
"0.6731889"... | 0.0 | -1 |
Removes the input node from its current spot in the List and inserts it as the new head node of the List. | def move_to_head(self, node):
if node is self.head:
return
value = node.value
self.delete(node)
self.add_to_head(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_linked_list(input_list):\n\t\ttry:\n\t\t\thead = Node(input_list.pop(0)) #remove the first list item and return as its head\n\n\t\t\twhile (len(input_list)>0):\n\t\t\t\tcurrent_node = head\n\t\t\t\twhile current_node.next:\n\t\t\t\t\tcurrent_node = current_node.next\n\t\t\t\tcurrent_node.next = Node(inp... | [
"0.6993568",
"0.69826233",
"0.6885242",
"0.682928",
"0.6725177",
"0.66019416",
"0.65920186",
"0.65714943",
"0.6519824",
"0.6516198",
"0.65063757",
"0.6482394",
"0.6480161",
"0.64429533",
"0.6419488",
"0.6414184",
"0.63835144",
"0.63743514",
"0.63153565",
"0.6288156",
"0.62872... | 0.68576205 | 3 |
Retrieves the value associated with the given key. Moves the keyvalue pair to the end of the order such that the pair is considered mostrecently used. Returns the value associated with the key or None if the keyvalue pair doesn't exist in the cache. | def get(self, key):
node = self.head
value = None
exists = False
while node: # Loop through nodes, looking for key
if node.key == key:
exists = True
break
if exists:
if node is self.head:
value = node.value... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, key):\n if key in self.cache:\n value = self.cache[key].value\n # Re-enqueue to indicate recently used\n self._re_enqueue(self.cache[key])\n return value\n else:\n return -1",
"def get(self, key):\n hi = self.hash_index(key... | [
"0.7695546",
"0.76105016",
"0.75953025",
"0.7400571",
"0.73538",
"0.7351288",
"0.7315402",
"0.72210455",
"0.72210455",
"0.7210519",
"0.71965694",
"0.71468765",
"0.7130234",
"0.71035",
"0.7097476",
"0.7012658",
"0.69800293",
"0.69739383",
"0.6951334",
"0.69302875",
"0.69174176... | 0.72985613 | 7 |
Customized line plot with error bars. | def custom_lineplot(ax, x, y, error, xlims, ylims, color='red'):
ax.errorbar(x, y, yerr=error, color=color, ls='--', marker='o', capsize=5, capthick=1, ecolor='black')
ax.set_xlim(xlims)
ax.set_ylim(ylims)
return ax | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_lines(self, ax):\n return ax.errorbar(self.lefts + (self.widths*.5), self.values, yerr=self.yerr, xerr=.5*self.widths, marker='o', color=self.color, label=self.label, capsize=0, ls='', **self.options)",
"def hogg_errorbar(x, y, yerr, **kwargs):\n for xx, yy, yyerr in zip(x, y, yerr):\n ... | [
"0.78423524",
"0.69838136",
"0.6818331",
"0.6670741",
"0.66513264",
"0.6619109",
"0.65707105",
"0.6398022",
"0.63810647",
"0.6375475",
"0.6350077",
"0.6331567",
"0.63089806",
"0.6297852",
"0.6188824",
"0.6188333",
"0.61311907",
"0.6128361",
"0.6103672",
"0.60867417",
"0.60640... | 0.85290176 | 0 |
Customized boxplot with solid black lines for box, whiskers, caps, and outliers. | def custom_boxplot(ax, x, y, error, xlims, ylims, mediancolor='magenta'):
medianprops = {'color': mediancolor, 'linewidth': 2}
boxprops = {'color': 'black', 'linestyle': '-'}
whiskerprops = {'color': 'black', 'linestyle': '-'}
capprops = {'color': 'black', 'linestyle': '-'}
flierprops = {'color': '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def boxplot(data):\n sns.boxplot(data, width=0.5, palette=\"colorblind\")\n # add points on the plot\n sns.swarmplot(data, color='red', alpha=0.75)",
"def box_plots(norm, original):\n bp = plt.boxplot([norm, original], notch=False, patch_artist=True)\n for box in bp['boxes']:\n box.set(colo... | [
"0.70407164",
"0.66608655",
"0.6588415",
"0.6580331",
"0.65196794",
"0.6432254",
"0.6352408",
"0.62743556",
"0.6255782",
"0.6254831",
"0.6136106",
"0.59850377",
"0.59607583",
"0.5899478",
"0.58290935",
"0.5790138",
"0.5778857",
"0.5775175",
"0.5744307",
"0.57214344",
"0.56601... | 0.717696 | 0 |
converts DataStream object into pandas dataframe | def ds_to_pdf(ds, user_id=None) -> pd.DataFrame:
if user_id:
ds = ds.filter_user(user_id)
pdf = ds._data.toPandas()
if "timestamp" in pdf.columns:
return pdf.sort_values('timestamp')
return pdf | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_dataframe(self, include_metadata: bool = True) -> pd.DataFrame:\n # Get all our data first with async\n # Note that all our pandas work will tax CPU so we wouldn't expect any\n # performance gains from doing the data parsing as a callback\n records = self.to_dict()\n data ... | [
"0.7035526",
"0.69650245",
"0.6941309",
"0.6900751",
"0.68732417",
"0.68625087",
"0.67257357",
"0.67257357",
"0.6699086",
"0.66855824",
"0.6677696",
"0.6628184",
"0.6595813",
"0.6585852",
"0.6538645",
"0.6528156",
"0.64805573",
"0.63646656",
"0.6360085",
"0.631015",
"0.629770... | 0.0 | -1 |
Returns a list of pages with no parent. Pages can be filtered out by the model name. | def get_top_pages(model=None):
return get_page_children(page=None, model=model) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_empty_page(self):\n return self._slice_objects(0, 0)",
"def get_queryset(self, request):\n query = super(GipsyMenu, self).get_queryset(request)\n return query.filter(parent__isnull=True)",
"def get_page_children(page, model=None):\n children = Page.objects.published().filter(pa... | [
"0.649871",
"0.6280055",
"0.61724627",
"0.60865504",
"0.6009684",
"0.5800925",
"0.57715493",
"0.5712619",
"0.5686647",
"0.56529677",
"0.5648767",
"0.5529058",
"0.5529058",
"0.5494876",
"0.5494876",
"0.54580605",
"0.54401034",
"0.54350066",
"0.5416232",
"0.5413267",
"0.541212"... | 0.639352 | 1 |
Test response with no login | def test_check_status_no_login(self):
self.logout()
post_json = {"submission_id": self.status_check_submission_id}
response = self.app.post_json("/v1/check_status/", post_json, expect_errors=True,
headers={"x-session-id": self.session_id})
# Assert 4... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_login_no_user(self):\n post_data = client.post(LOGIN_URL, json=self.post_data1)\n self.assertEqual(post_data.status_code, 401)\n self.assertEqual(post_data.get_json()[\"msg\"], \"Incorrect username.\")",
"def test_user_login_when_no_data_provided(self):\n\n response= self.cli... | [
"0.7744629",
"0.7690361",
"0.7510976",
"0.74756134",
"0.74720526",
"0.74238825",
"0.74206483",
"0.7405921",
"0.7382385",
"0.7344785",
"0.7344138",
"0.73346186",
"0.73196286",
"0.7280091",
"0.72752887",
"0.7260706",
"0.7256556",
"0.7245649",
"0.72340417",
"0.72314936",
"0.7213... | 0.0 | -1 |
Setup test data for the route test | def setup_file_data(cls, sess, submission_id):
ready = JOB_STATUS_DICT['ready']
csv_validation = JOB_TYPE_DICT['csv_record_validation']
job = FileTests.insert_job(
sess,
filetype=FILE_TYPE_DICT['award'],
status=ready,
type_id=csv_validation,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_init(self):\n assert self.route.route[\"transform\"] == \"transform\"\n assert self.route.route[\"output\"] == \"output\"\n assert \"api\" not in self.route.route",
"def setUp(self):\n\n self.test_data_path = 'testing/test_data/'",
"def setUpTestData(cls):\n cls.url ... | [
"0.7366975",
"0.71438843",
"0.69367987",
"0.68899727",
"0.68884945",
"0.6870735",
"0.685306",
"0.6830321",
"0.6771594",
"0.67587346",
"0.6699362",
"0.6694154",
"0.66576296",
"0.66038483",
"0.6592709",
"0.65701246",
"0.6568628",
"0.65566003",
"0.6556225",
"0.6556225",
"0.65562... | 0.0 | -1 |
Does User.authenticate successfully return False when given an invalid password? | def test_user_authenticate_invalid_password(self):
user = User.authenticate("test1", "wrong_password")
self.assertEqual(user, False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_auth_user_fail_bad_password(self):\n\n self.assertFalse(User.authenticate(self.user1.username, \"invalid\"))",
"def test_user_authenticate_invalid_username(self):\n\n user = User.authenticate(\"wrong_username\", \"password\")\n\n self.assertEqual(user, False)",
"def validate_authe... | [
"0.80827516",
"0.7856305",
"0.7839419",
"0.7817098",
"0.7672274",
"0.7538237",
"0.7526854",
"0.7498649",
"0.7493765",
"0.7488445",
"0.74725235",
"0.74384",
"0.7394176",
"0.73738176",
"0.7325638",
"0.7318276",
"0.73145956",
"0.7286394",
"0.72837985",
"0.72792107",
"0.7251427",... | 0.84543574 | 0 |
Data from json file is deserialised into a dictionary. | def load_json(self, filename):
with open(filename, 'r', encoding='utf-8') as f:
data_dict = json.load(f)
return data_dict | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dictionary_from_json_file(_json_file):\n with open(_json_file) as _f:\n _dict = json.load(_f)\n return _dict",
"def import_json(self) -> dict:\n with open(self.path, encoding=\"utf8\") as json_file:\n return json.load(json_file)",
"def parse_json(json_file: str) -> dict:\n ... | [
"0.7662508",
"0.7612877",
"0.7480616",
"0.74537855",
"0.74229026",
"0.73885584",
"0.73731846",
"0.73652744",
"0.73300326",
"0.7319904",
"0.7271273",
"0.726505",
"0.7210867",
"0.7197051",
"0.7192927",
"0.7184347",
"0.7177804",
"0.71282387",
"0.7113085",
"0.71126056",
"0.709995... | 0.7956624 | 0 |
This method abstracts the methods involved in loading the json files, creating the tables into the database, and then putting information from the json files into the respective tables. | def init_service(self):
conn = self.get_conn()
c = conn.cursor()
c.execute(SQL["delete_services"])
c.execute(SQL["delete_stops"])
c.execute(SQL["delete_routes"])
bus_routes = self.load_json("bus_routes.json")
bus_services = self.load_json("bus_services.json")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_sqlite():\n\tcreate_table()\n\n\tfor file in os.listdir(JSON_PATH):\n\t\tif file.endswith('.json'):\n\t\t\tword = get_word(file)\n\t\t\tprint('inserting ' + word + ' data into db')\n\n\t\t\tpath = os.path.join(JSON_PATH, file)\n\t\t\tjson = readjson(path)\n\n\t\t\tinsert(replace_url(json))\n\n\t# improve SE... | [
"0.67310596",
"0.6527111",
"0.63684064",
"0.6316117",
"0.6209801",
"0.6190348",
"0.6181301",
"0.6179863",
"0.614958",
"0.61169547",
"0.61078864",
"0.60955846",
"0.60891885",
"0.60687226",
"0.6045678",
"0.6030447",
"0.60164297",
"0.6013029",
"0.60127383",
"0.6005869",
"0.59988... | 0.54974216 | 96 |
Location of local calibration data. Returns | def calibration_data_path():
pkgpath = (os.path.dirname(
os.path.dirname(os.path.realpath(__file__))) + os.path.sep)
caldata = os.path.join(*[pkgpath, 'data', 'models'])
return caldata | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cal_location(self):\n return self.setup_location.name",
"def extract_calibration(self):\n #TODO add function to check if the folder exists because opencv points to other error rather than saying it doesnt exist\n cv_file = cv2.FileStorage(\"calib_images/calibration.yaml\", cv2.FILE_STORA... | [
"0.6289211",
"0.60119855",
"0.59688276",
"0.5820788",
"0.58124167",
"0.5799819",
"0.5771125",
"0.57589465",
"0.57328206",
"0.5727503",
"0.5718998",
"0.57092756",
"0.57054657",
"0.56861365",
"0.56754994",
"0.56533015",
"0.565292",
"0.56421167",
"0.56401783",
"0.5632828",
"0.56... | 0.641669 | 0 |
Create a dataset (train or train+eval) loader(s). | def make_loader(model, dataset, batch_size, workers, eval_proportion):
dataset_extra_args = dict(
num_frames=model['num_frames'],
channels=model['input_type'],
action_space=model['action_space'],
steps_action=model['steps_action'],
num_signals=model['num_signals'],
nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_creator(config):\n train_dataset, val_dataset = LinearDataset(2, 5), LinearDataset(2, 5)\n train_loader = DataLoader(train_dataset, batch_size=config[\"batch_size\"])\n val_loader = DataLoader(val_dataset, batch_size=config[\"batch_size\"])\n return train_loader, val_loader",
"def creates_da... | [
"0.8084211",
"0.804269",
"0.7670781",
"0.7563746",
"0.75341815",
"0.747422",
"0.7432337",
"0.73526055",
"0.73348397",
"0.73244625",
"0.7313343",
"0.7301754",
"0.7259058",
"0.72562855",
"0.7240378",
"0.72354746",
"0.72234017",
"0.720571",
"0.719146",
"0.7169255",
"0.71683335",... | 0.6838605 | 86 |
Split a dataset into nonoverlapping sets (train and eval). | def split_dataset(dataset, eval_proportion, shuffle=False):
split_sizes = [1. - eval_proportion, eval_proportion]
split_frames = []
split_demos = []
num_demos = dataset.get_num_demos()
split_num_demos = [int(fraction * num_demos) for fraction in split_sizes]
split_num_demos[0] += num_demos - sum... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, self.valid, test_size=0.5)",
"def split_dataset(self, split):\n trunk_pos_size = math.ceil((1 - split) * len(self.Pos... | [
"0.7561424",
"0.7495133",
"0.7297663",
"0.7247306",
"0.7174917",
"0.7172446",
"0.71542263",
"0.71387476",
"0.70992184",
"0.70808214",
"0.7037028",
"0.7019662",
"0.7019662",
"0.7019662",
"0.69708747",
"0.69504017",
"0.69376594",
"0.6934545",
"0.6927647",
"0.69221956",
"0.69182... | 0.68902886 | 23 |
Integration test for the EnrollmentTermsAPI.update_enrollment_term method. | def test_update_enrollment_term(self):
# This method utilises the PUT request method and will make changes to the Canvas instance. This needs consideration.
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_enrollment_term(self):\n # This method utilises the POST request method and will make changes to the Canvas instance. This needs consideration.\n pass",
"def test_delete_enrollment_term(self):\n account_id = None # Change me!!\n id = None # Change me!!\n\n r =... | [
"0.6819804",
"0.67411304",
"0.62845933",
"0.61786294",
"0.6086481",
"0.6036968",
"0.58932084",
"0.5853434",
"0.58438593",
"0.58378583",
"0.58280605",
"0.58277136",
"0.578213",
"0.5777458",
"0.5731706",
"0.5706508",
"0.5700337",
"0.5687344",
"0.5600578",
"0.5597065",
"0.559361... | 0.8364353 | 0 |
Integration test for the EnrollmentTermsAPI.delete_enrollment_term method. | def test_delete_enrollment_term(self):
account_id = None # Change me!!
id = None # Change me!!
r = self.client.delete_enrollment_term(account_id, id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_course_enrollment(self, student_id, course_id, course_section_id, term):\n conn = sqlite3.connect(self.db_path)\n cursor = conn.cursor()\n try:\n with conn:\n cursor.execute(\n \"\"\"\n DELETE FROM course_enrollments\n ... | [
"0.6511221",
"0.64519113",
"0.6254601",
"0.6235663",
"0.61850995",
"0.61253476",
"0.60750425",
"0.6053782",
"0.6052067",
"0.60492104",
"0.6037095",
"0.6028256",
"0.60219586",
"0.6007957",
"0.5973642",
"0.5968307",
"0.5938068",
"0.59368503",
"0.5933476",
"0.59305567",
"0.59122... | 0.87833923 | 0 |
Integration test for the EnrollmentTermsAPI.retrieve_enrollment_term method. | def test_retrieve_enrollment_term(self):
account_id = None # Change me!!
id = None # Change me!!
r = self.client.retrieve_enrollment_term(account_id, id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_list_enrollment_terms(self):\n account_id = None # Change me!!\n\n r = self.client.list_enrollment_terms(\n account_id, include=None, workflow_state=None\n )",
"def test_delete_enrollment_term(self):\n account_id = None # Change me!!\n id = None # Change ... | [
"0.7324393",
"0.6751618",
"0.66040576",
"0.6033588",
"0.58641404",
"0.5367064",
"0.5329835",
"0.52798575",
"0.51613075",
"0.50997883",
"0.5036937",
"0.50354064",
"0.50215054",
"0.5013197",
"0.4992815",
"0.4991575",
"0.49663225",
"0.49651244",
"0.49602875",
"0.49538556",
"0.49... | 0.8650747 | 0 |
Returns the pitch distance between two notes Only used for chords for efficiency | def distance(a, b):
a = a[0]
b = b[0]
if lower.search(a):
if lower.search(b):
return abs(ord(b) - ord(a)) % 8
elif upper.search(b):
return abs(ord(b.lower()) - ord(a)) % 5 + 8
elif upper.search(a):
if lower.search(b):
return abs(ord(a.lower()) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_distance(pitch):\n # TODO: Use actual values calculated\n target_height = 60\n camera_height = 40\n height_difference = target_height - camera_height\n distance = math.fabs(height_difference / math.tan(math.radians(pitch)))\n\n return distance",
"def distance_midi_pitch(x, y):\r\n... | [
"0.70702267",
"0.70452297",
"0.67824394",
"0.6312901",
"0.61211693",
"0.594408",
"0.5772439",
"0.5715479",
"0.5678745",
"0.56702936",
"0.5643879",
"0.56335485",
"0.56276625",
"0.5619626",
"0.56019664",
"0.5596408",
"0.5549633",
"0.5538705",
"0.55376786",
"0.5536231",
"0.55097... | 0.0 | -1 |
Checks if a file is an allowed extension. | def has_file_allowed_extension(filename, extensions):
filename_lower = filename.lower()
return any(filename_lower.endswith(ext) for ext in extensions) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_allowed_extension(filename):\n return '.' in filename and filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS",
"def allowed_file(filename, allowed_extension):\n return '.' in filename and get_file_ext(filename) in allowed_extension",
"def is_allowed_file(filename, allowed_ext):\n ext = filename.... | [
"0.895309",
"0.8786745",
"0.8764468",
"0.87614024",
"0.8612598",
"0.8612598",
"0.8612598",
"0.8612598",
"0.8612598",
"0.8612598",
"0.85909545",
"0.85909545",
"0.85555506",
"0.8541878",
"0.8525629",
"0.8525629",
"0.85190576",
"0.85190576",
"0.85155004",
"0.8498841",
"0.8496414... | 0.8021 | 46 |
Construct a tensor by repeating A the number of times given by reps. If `reps` has length ``d``, the result will have dimension of ``max(d, A.ndim)``. If ``A.ndim d``, `reps` is promoted to `A`.ndim by prepending 1's to it. Thus for an `A` of shape (2, 3, 4, 5), a `reps` of (2, 2) is treated as (1, 1, 2, 2). | def tile(A, reps):
from ..merge import concatenate
try:
tup = tuple(reps)
except TypeError:
tup = (reps,)
d = len(tup)
if A.ndim < d:
A = A[tuple(np.newaxis for _ in range(d - A.ndim))]
elif A.ndim > d:
tup = (1,) * (A.ndim - d) + tup
a = A
for axis, re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def repeat_nd(x, reps):\n return RepeatND(reps)(x)",
"def repeat(a, repeats, axis=None):\n return afnumpy.asarray(a).repeat(repeats, axis=axis)",
"def make_repeat_elements(self, tensor, rep):\n return Lambda(lambda x, repnum: K.repeat_elements(x, repnum, axis=3), arguments={\"repnum\":rep})(tensor... | [
"0.7010756",
"0.69201905",
"0.6788992",
"0.67606866",
"0.6689007",
"0.6596998",
"0.6543955",
"0.64954805",
"0.64878523",
"0.64004296",
"0.6326022",
"0.6198227",
"0.610638",
"0.60829735",
"0.58644223",
"0.5831188",
"0.57215774",
"0.572062",
"0.57173556",
"0.5711844",
"0.565361... | 0.74626184 | 0 |
Calculate the CARLA camera transform | def get_camera_transform(self):
if not self.pose:
rospy.loginfo("no pose!")
return None
if self.pose.header.frame_id != self.role_name:
rospy.logwarn("Unsupported frame received. Supported {}, received {}".format(
self.role_name, self.pose.header... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def camera_to_object_transform(self):\n # form the full object to camera transform\n T_stp_camera = self.stp_to_camera_transform()\n T_obj_stp = self.object_to_stp_transform()\n T_obj_camera = T_stp_camera.dot(T_obj_stp)\n return T_obj_camera",
"def testCalculateTransform(self)... | [
"0.70585823",
"0.66587365",
"0.66284215",
"0.6568111",
"0.64501894",
"0.6386731",
"0.62909544",
"0.62674826",
"0.61941993",
"0.6190472",
"0.6133707",
"0.61225355",
"0.61224616",
"0.60645795",
"0.60601604",
"0.60598254",
"0.6010653",
"0.5994196",
"0.5984358",
"0.5944682",
"0.5... | 0.69467866 | 1 |
Extract a channel from the rgb image, so that a widthheight1 matrix is achieved. | def img_dict_rgb2gray(img_arr):
img_gray = img.fromarray(img_arr[0]).convert("L")
img_new_mat = np.array(img_gray)
img_new = img_new_mat[np.newaxis, :, :]#, np.newaxis]
return img_new | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __cv_extractchannel(src, channel):\n return cv2.extractChannel(src, (int)(channel + 0.5))",
"def green_channel(input_image):\n return input_image[:, :, 1]",
"def get_gray_channel(im_rgb):\n if not is_grayscale(im_rgb):\n im_yiq = rgb2yiq(im_rgb)\n return im_yiq[:, :, Y_CH].copy()... | [
"0.74041396",
"0.7108255",
"0.6975584",
"0.67663795",
"0.66270936",
"0.6571454",
"0.65473956",
"0.6413759",
"0.6221979",
"0.6164107",
"0.6164107",
"0.6160663",
"0.6122491",
"0.6112303",
"0.6098109",
"0.60962886",
"0.60876286",
"0.6065009",
"0.6064434",
"0.6044475",
"0.5990675... | 0.0 | -1 |
Exclusive cumulative product [a, b, c] => [1, a, a b] | def exclusive_cumprod(x):
batch_size, sequence_length = x.size()
if torch.cuda.is_available():
one_x = torch.cat([torch.ones(batch_size, 1).cuda(), x], dim=1)[:, :-1]
else:
one_x = torch.cat([torch.ones(batch_size, 1), x], dim=1)[:, :-1]
return torch.cumprod(one_x, dim=1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exclusive_cumprod(x):\n return torch.cumprod(torch.cat([x.new_ones(x.size(0), x.size(1), x.size(2), 1), x[:, :, :, :-1]], dim=-1), dim=-1)",
"def cross_product(a,b):\n return [a[1]*b[2]-a[2]*b[1], a[2]*b[0]-a[0]*b[2], a[0]*b[1]-a[1]*b[0]]",
"def cumprod(self):\n return self._lift(lambda c: c.c... | [
"0.6981249",
"0.64026594",
"0.63499177",
"0.62118256",
"0.6153056",
"0.6088237",
"0.60767",
"0.6069449",
"0.6062044",
"0.60343254",
"0.6004297",
"0.5996002",
"0.59782344",
"0.5973283",
"0.59523827",
"0.59431183",
"0.58982944",
"0.5862979",
"0.58599454",
"0.5832812",
"0.577326... | 0.6441153 | 1 |
Cosineweighted attention. Calculates the cosine similarity between a query and each word in memory, then applies a weighted softmax to return a sharp distribution. | def forward(self, memory, keys, strengths):
# transpose instead of conj because conj is no ops for real matrix
dot = torch.matmul(keys, torch.transpose(memory, 1, 2))
memory_norms = self._vector_norms(memory)
key_norms = self._vector_norms(keys)
norm = torch.matmul(key_norms, to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def similarity(self, query, documents):\n\n bow_query = self.dictionary.doc2bow(query)\n bow_docs = [self.dictionary.doc2bow(document) for document in documents]\n\n index = SoftCosineSimilarity(bow_docs, self.matrix)\n similarities = index[bow_query]\n\n return similarities",
... | [
"0.67910004",
"0.6393309",
"0.63338214",
"0.62562424",
"0.62043566",
"0.6111229",
"0.6033046",
"0.5948057",
"0.59330124",
"0.5932089",
"0.58731794",
"0.5859279",
"0.58306706",
"0.57961726",
"0.577468",
"0.5772171",
"0.5764055",
"0.5732465",
"0.57154137",
"0.5709897",
"0.57069... | 0.55578536 | 28 |
Returns batched `gather` for every row in the input. Equivalent of batch_gather function of original implementation | def batch_gather(self, values, indices):
idx = indices.unsqueeze(-1)
idx = idx.int()
size = indices.shape[0]
rg = torch.arange(size, dtype=torch.int32).to(self.device)
rg = rg.unsqueeze(-1)
rg = rg.repeat([1, int(indices.shape[-1])])
rg = rg.unsqueeze(-1)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def batch_gather_2d(values, indices):\n return tf.gather(tf.reshape(values, [-1]),\n tf.range(0, tf.shape(values)[0]) * tf.shape(values)[1] +\n indices)",
"def batch_gather(tensors, indices):\n is_singleton = not isinstance(tensors, (list, tuple))\n\n if is_singleton:... | [
"0.65561455",
"0.6500587",
"0.6462384",
"0.63635355",
"0.6346882",
"0.62854534",
"0.62808883",
"0.6277979",
"0.6229866",
"0.61978686",
"0.6136924",
"0.6118713",
"0.6064382",
"0.60396457",
"0.60053056",
"0.5996159",
"0.59531736",
"0.5913855",
"0.586571",
"0.585065",
"0.577589"... | 0.6642534 | 0 |
Creates enough cells to fill the board. Returns initial state of the board. | def init_cells(self):
state = list()
width = WIDTH / CELL_SIZE
height = HEIGHT / CELL_SIZE
for index in range(0, width * height):
if randint(1, 100) >= 100 - CELL_DENSITY:
# Live cell.
status = NORMAL
state.append(1)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initial_state():\n board = [[EMPTY, EMPTY, EMPTY],\n [EMPTY, EMPTY, EMPTY],\n [EMPTY, EMPTY, EMPTY]]\n return board",
"def generate():\n global BOARD\n next = [[0] * ROWS for _ in range(COLS)]\n # Loop through every spot in our 2D array and check spots neighbors\n... | [
"0.7066474",
"0.70664686",
"0.6937328",
"0.69232416",
"0.6899434",
"0.68691885",
"0.68123144",
"0.6763205",
"0.67400753",
"0.6735691",
"0.67156506",
"0.6669941",
"0.66644937",
"0.6644526",
"0.6607779",
"0.65886736",
"0.65883726",
"0.6531028",
"0.6523078",
"0.6519401",
"0.6514... | 0.68562424 | 6 |
Gets the current organization | def get_org(self, retry_on_rate_exceed=False):
return Org.deserialize(self._get_raw('org', {}, retry_on_rate_exceed)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def organization(self):\n return self._tower.get_organization_by_id(self._data.get('organization'))",
"def get_organization(self):\n return self.reference[REF_ORGANIZATION][REF_VALUE]",
"def organization_current_get(request):\n if request.organization:\n return request.organization.slug... | [
"0.8365602",
"0.83431554",
"0.78126556",
"0.78037596",
"0.76222175",
"0.7610173",
"0.7515312",
"0.7455882",
"0.7285391",
"0.7284314",
"0.72149926",
"0.72015625",
"0.714974",
"0.7137949",
"0.7126743",
"0.6981135",
"0.6948353",
"0.69405967",
"0.69192415",
"0.6896074",
"0.689607... | 0.6982778 | 15 |
Edit sys.argv to add "default_file" as an arguments file with the prefix character ("@" by default). "default_file" should be the base filename, and it should be in the same directory as the script itself. Returns a a version of sys.argv with the first element removed, ready to be given as an argument to argparse.Argum... | def include_args_from_file(argv, default_file, prefix='@'):
for arg in argv:
if arg.startswith(prefix):
return argv[1:]
script_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
default_file_path = os.path.join(script_dir, default_file)
if not os.path.isfile(default_file_path):
return argv[1:]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FixArgFileName(fileName):\n import os\n\n path, fname = os.path.split(fileName)\n if len(path) == 0:\n path = os.curdir\n path = os.path.abspath(path)\n # must check that the command line arg's path is in sys.path\n for syspath in sys.path:\n if os.path.abspath(syspath) == path:... | [
"0.5995099",
"0.5980831",
"0.59179515",
"0.5840327",
"0.5823032",
"0.5605689",
"0.55885106",
"0.5571621",
"0.55287594",
"0.54189533",
"0.53742045",
"0.53261673",
"0.5316988",
"0.52907586",
"0.52078867",
"0.5197276",
"0.51917404",
"0.51614296",
"0.51202774",
"0.5097696",
"0.50... | 0.79300225 | 0 |
Creates an AdaGrad optimizer. | def __init__(self, optimization_options, network, *args, **kwargs):
self._params = Parameters()
for path, param in network.get_variables().items():
self._params.add(path + '_gradient',
numpy.zeros_like(param.get_value()))
self._params.add(path + '_su... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getOptimizer():\n if configuration['others']['verbose']:\n sys.stdout.write(reports.seperator + reports.tabs +\n 'Optimizer : Adagrad, learning rate = {0}'.format(configuration['mlp']['lr'])\n + reports.seperator)\n return optimizers.Adagrad(lr=conf... | [
"0.6777755",
"0.66637987",
"0.6495587",
"0.6492645",
"0.6474558",
"0.64368254",
"0.63411576",
"0.6316253",
"0.62532336",
"0.623105",
"0.6213288",
"0.61988634",
"0.61832523",
"0.6173872",
"0.6162354",
"0.6160834",
"0.61492646",
"0.6144174",
"0.61296046",
"0.6120179",
"0.610382... | 0.0 | -1 |
Initialize the model. Needs to set self.size_joint_feature, the dimensionality of the joint features for an instance with labeling (x, y). | def __init__(self):
self.size_joint_feature = None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, embed_size):\n super(ImgEncoder, self).__init__()\n model = models.vgg19(pretrained=True)\n in_features = model.classifier[-1].in_features # input size of feature vector\n model.classifier = nn.Sequential(\n *list(model.classifier.children())[:-1]) # re... | [
"0.6122261",
"0.60752666",
"0.60161114",
"0.59313625",
"0.59208596",
"0.5913641",
"0.5853696",
"0.5850947",
"0.58409256",
"0.58349967",
"0.5801639",
"0.58004314",
"0.57956225",
"0.57744664",
"0.5741678",
"0.5733682",
"0.573256",
"0.57032645",
"0.57031393",
"0.5685491",
"0.567... | 0.80585605 | 0 |
Populates private member variables and initializes table. | def __init__(self, parent, config, market_data, *args):
QtCore.QAbstractTableModel.__init__(self, parent, *args)
self._config = config
self._market_data = market_data
self._start_timestamp = pd.Timestamp.now()
self._price_ladder_df = None
self._mutex = QtCore.QMutex() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.table = {}",
"def __init__(self):\n self.table = {}\n self.ls = []",
"def _init_table(self, table: \"Table\"):\n if not self.columns:\n self.columns = table.columns\n self._data = table.data",
"def __init__(self):\n\n self.table ... | [
"0.74742454",
"0.74440867",
"0.72557044",
"0.72140807",
"0.7126197",
"0.6904814",
"0.68833375",
"0.6782636",
"0.6772627",
"0.66694677",
"0.66558826",
"0.6628482",
"0.6622588",
"0.65866613",
"0.65580225",
"0.6543205",
"0.6516175",
"0.64912254",
"0.64622104",
"0.64527917",
"0.6... | 0.0 | -1 |
Get the count of rows. | def rowCount(self, parent): # pylint: disable=unused-argument
return self._config['row_count'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_num_rows(self):\n return self._num_rows",
"def row_count(self) -> int:\n return len(self.rows)",
"def row_count(self) -> int:\n return len(self.rows)",
"def count_rows(self):\n with self.conn:\n return len(self.select_all_rows())",
"def rowcount(self):\n ... | [
"0.86639076",
"0.86461794",
"0.86461794",
"0.86253",
"0.86170936",
"0.8585912",
"0.8537923",
"0.8481067",
"0.8460337",
"0.8455046",
"0.8450657",
"0.8425329",
"0.84247357",
"0.84024286",
"0.8394152",
"0.82703274",
"0.82522273",
"0.8218048",
"0.8196027",
"0.81005085",
"0.809844... | 0.7511381 | 42 |
UserDevice a model defined in Swagger | def __init__(self):
self.swagger_types = {
'id': 'str',
'name': 'str',
'device_token': 'str',
'notification_id': 'str',
'make': 'str',
'model': 'str',
'accept_notifications': 'bool',
'type': 'str',
'sessi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device(self, **kwargs):\n\n return self.api_request(self._get_method_fullname(\"device\"), kwargs)",
"def device(self, **kwargs):\n\n return self.api_request(self._get_method_fullname(\"device\"), kwargs)",
"def device(self, **kwargs):\n\n return self.api_request(self._get_method_fulln... | [
"0.5964049",
"0.5964049",
"0.5964049",
"0.5964049",
"0.587134",
"0.5759424",
"0.5684606",
"0.5645136",
"0.5617441",
"0.5614575",
"0.5574818",
"0.556786",
"0.5512877",
"0.5511858",
"0.5494178",
"0.5463347",
"0.5426104",
"0.5406459",
"0.5365637",
"0.53573716",
"0.5355642",
"0... | 0.53365785 | 23 |
Gets the id of this UserDevice. The globally unique identifier for the object. | def id(self):
return self._id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self):\n return self._device_id",
"def unique_id(self):\n return self.device_id",
"def device_id(self):\n return self.unique_id",
"def unique_id(self):\n return self._deviceId",
"def get_id(self):\n return self.uid",
"def device_id(self) -> str:\n r... | [
"0.83807796",
"0.83277017",
"0.81345356",
"0.80505246",
"0.80429274",
"0.7910526",
"0.788508",
"0.7860357",
"0.78577715",
"0.78436506",
"0.77864236",
"0.77864236",
"0.77864236",
"0.7758965",
"0.7733454",
"0.7724927",
"0.7724927",
"0.766592",
"0.766592",
"0.7654858",
"0.764149... | 0.0 | -1 |
Sets the id of this UserDevice. The globally unique identifier for the object. | def id(self, id):
self._id = id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_id(self, id):\n self.__id = id",
"def set_id(self, id_):\n\n self.id_ = id_",
"def set_id(self, id):\n self.data['id'] = id",
"def set_id(self, id):\n self.id = id\n print(\"self id = \" + str(self.id))",
"def set_id(self, id_=None):\n if id_ is None:\n ... | [
"0.7655291",
"0.7334978",
"0.73056704",
"0.72966933",
"0.7283792",
"0.7255186",
"0.7206847",
"0.7117988",
"0.7089016",
"0.70514214",
"0.70514214",
"0.70514214",
"0.70514214",
"0.70514214",
"0.70514214",
"0.70514214",
"0.70514214",
"0.70514214",
"0.70514214",
"0.70514214",
"0.... | 0.7033964 | 26 |
Gets the name of this UserDevice. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self.device.device_data[self.device_id]['name']",
"def name(self):\n return self._device.device_data[self._uuid]['name']",
"def name(self):\n return self._device.name",
"def name(self):\n return self._device.name",
"def name(self):\n return self._... | [
"0.84919244",
"0.84816146",
"0.8452498",
"0.8452498",
"0.8452498",
"0.8294042",
"0.82549566",
"0.8132761",
"0.8061604",
"0.7966753",
"0.7876267",
"0.7873436",
"0.7873436",
"0.78019863",
"0.7668528",
"0.7645159",
"0.7602345",
"0.7602345",
"0.75328076",
"0.7519385",
"0.7468166"... | 0.0 | -1 |
Sets the name of this UserDevice. | def name(self, name):
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetName(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n ... | [
"0.73049664",
"0.72883326",
"0.72883326",
"0.72883326",
"0.72883326",
"0.72883326",
"0.72771645",
"0.72492427",
"0.72492427",
"0.7208986",
"0.72032297",
"0.71394604",
"0.7092161",
"0.7064969",
"0.7051504",
"0.70501816",
"0.70501816",
"0.7024094",
"0.70052266",
"0.70052266",
"... | 0.0 | -1 |
Sets the notification_id of this UserDevice. notification id of the device. | def notification_id(self, notification_id):
self._notification_id = notification_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def notification(self, notification):\n if notification is None:\n raise ValueError(\"Invalid value for `notification`, must not be `None`\") # noqa: E501\n\n self._notification = notification",
"def notification_id(self):\n return self._notification_id",
"def put(self, notific... | [
"0.62736607",
"0.62735814",
"0.6114358",
"0.60952616",
"0.60952616",
"0.58309174",
"0.58309174",
"0.58006257",
"0.5716078",
"0.554765",
"0.5388697",
"0.5290159",
"0.5219884",
"0.5187295",
"0.51364005",
"0.5093066",
"0.50767183",
"0.50728047",
"0.49882188",
"0.4979377",
"0.496... | 0.81615084 | 0 |
Gets the model of this UserDevice. Device model | def model(self):
return self._model | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model(self):\n return self._device.device_data[self._uuid]['model']",
"def get_model(self):\n return self._model",
"def get_model(self):\n return self._model",
"def get_model(self):\n return self.model",
"def get_model(self):\n return self.model",
"def get_model(sel... | [
"0.8258449",
"0.7447884",
"0.7447884",
"0.7400542",
"0.7400542",
"0.7400542",
"0.7400542",
"0.7400542",
"0.7400542",
"0.7400542",
"0.7400542",
"0.7400542",
"0.7400542",
"0.7335135",
"0.7307975",
"0.72778255",
"0.72778255",
"0.71696603",
"0.71695936",
"0.7156349",
"0.71435314"... | 0.7243297 | 20 |
Gets the type of this UserDevice. type of the device; ios or android | def type(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_type(self):\n return self._meta['device_type']",
"def device_type(self) -> str:\n if self.android_feature_phone():\n return 'smartphone'\n\n dt = self.all_details.get('device', {}).get('type', '')\n if dt:\n return dt\n\n aat = self.android_devi... | [
"0.78153837",
"0.77710843",
"0.7586601",
"0.75778747",
"0.7514533",
"0.7476161",
"0.7448529",
"0.7303262",
"0.72996503",
"0.72996503",
"0.72996503",
"0.7201239",
"0.718353",
"0.718353",
"0.7098551",
"0.7098551",
"0.70021087",
"0.68975157",
"0.68926036",
"0.6794617",
"0.679302... | 0.0 | -1 |
Gets the session_hash of this UserDevice. | def session_hash(self):
return self._session_hash | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_session_auth_hash(self):\n key_salt = \"django.contrib.auth.models.AbstractBaseUser.get_session_auth_hash\"\n return salted_hmac(key_salt, self.password).hexdigest()",
"def get_session_key(self):\n return self.session_key",
"def device_session_identifier(self):\n return self... | [
"0.71795845",
"0.66435903",
"0.6443983",
"0.6155984",
"0.61391836",
"0.61064327",
"0.60874784",
"0.5987246",
"0.5978604",
"0.59475154",
"0.5934164",
"0.59297305",
"0.59297305",
"0.5897742",
"0.5886878",
"0.5876288",
"0.58610773",
"0.58066595",
"0.57777715",
"0.57614744",
"0.5... | 0.82030624 | 0 |
Sets the session_hash of this UserDevice. | def session_hash(self, session_hash):
self._session_hash = session_hash | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def session_id(self, session_id):\n\n self._session_id = session_id",
"def set_session_property(self, key, value):\n\n self.session[key] = value",
"def session_hash(self):\n return self._session_hash",
"def for_session(self, session_id):\n if not isinstance(session_id, str):\n ... | [
"0.5874235",
"0.57262015",
"0.5667066",
"0.56650466",
"0.562398",
"0.562398",
"0.5560218",
"0.5537229",
"0.5487958",
"0.5440087",
"0.54296845",
"0.5423286",
"0.5386625",
"0.5354536",
"0.5349379",
"0.5271652",
"0.5253677",
"0.5222333",
"0.5175303",
"0.51140374",
"0.5111057",
... | 0.78317153 | 0 |
Gets the self_uri of this UserDevice. The URI for this object | def self_uri(self):
return self._self_uri | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_uri(self):\n return self.__uri",
"def uri(self) -> str:\n return self._uri",
"def get_uri(self):\n return self.url",
"def uri(self):\n return self._uri",
"def uri(self):\n return self._uri",
"def uri(self):\n return self._uri",
"def uri(self):\n ... | [
"0.73277",
"0.7053481",
"0.7013657",
"0.6980373",
"0.6980373",
"0.6980373",
"0.6980373",
"0.6980373",
"0.6980373",
"0.69782317",
"0.6965982",
"0.69104326",
"0.67957205",
"0.67015046",
"0.66543776",
"0.6536721",
"0.6536721",
"0.6536721",
"0.6536721",
"0.6536721",
"0.6536721",
... | 0.830942 | 2 |
Sets the self_uri of this UserDevice. The URI for this object | def self_uri(self, self_uri):
self._self_uri = self_uri | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def self_uri(self):\n return self._self_uri",
"def self_uri(self):\n return self._self_uri",
"def self_uri(self):\n return self._self_uri",
"def self_uri(self):\n return self._self_uri",
"def set_uri(self, uri):\n # Parse URI\n parsed_uri = urllib.parse.url... | [
"0.6955246",
"0.6955246",
"0.6955246",
"0.6955246",
"0.62720096",
"0.61720395",
"0.6076184",
"0.58331436",
"0.58331436",
"0.58093965",
"0.58093965",
"0.5804451",
"0.57336235",
"0.56859803",
"0.56314474",
"0.56309474",
"0.56309474",
"0.56309474",
"0.56309474",
"0.56309474",
"0... | 0.8075644 | 2 |
Returns true if both objects are equal | def __eq__(self, other):
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.7961088",
"0.7961088",
"0.79433626",
"0.79303336",
"0.7926563",
"0.7897525",
"0.78826123",
"0.78826123",
"0.78806067",
"0.7872423",
"0.7868354",
"0.78668815",
"0.7825702",
"0.7819993",
"0.78162885",
"0.78078854",
"0.78068... | 0.79670393 | 27 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.8456063",
"0.83918154",
"0.8144437",
"0.8140196",
"0.8132038",
"0.8093834",
"0.80918837",
"0.80918837",
"0.80918837",
"0.80852824",
"0.80852824",
"0.807626",
"0.807626",
"0.80657643"
] | 0.0 | -1 |
Extract feature vector for part of speech frequencies | def fvsSyntax(data):
def token_to_pos(text):
tokens = nltk.word_tokenize(text)
return [p[1] for p in nltk.pos_tag(tokens)]
texts_pos = [token_to_pos(text) for id, text, author in data]
pos_list = ['NN', 'NNP', 'DT', 'IN', 'JJ', 'NNS']
fvs_syntax = np.array([[text.count(pos) for pos in ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_features(wavfile, feature, sampling_rate=16000):\n\n raw_signal, sr = librosa.core.load(wavfile,\n sampling_rate,\n mono=True,\n dtype='float'\n )\n\n\n if feature == 'MFCC':\n feat_seq = librosa.feature.mfcc(raw_signal,\n sampling_rate,\n n_ff... | [
"0.7022054",
"0.68769157",
"0.67879695",
"0.6669208",
"0.66360474",
"0.65516335",
"0.6532978",
"0.65210253",
"0.645916",
"0.6439157",
"0.63850725",
"0.63202065",
"0.62929547",
"0.62248653",
"0.61840606",
"0.61550015",
"0.61509633",
"0.61480546",
"0.6124066",
"0.6108371",
"0.6... | 0.0 | -1 |
Set userdata for state machine. | def set_sm_userdata(self, obj_desc):
rospy.loginfo('Getting parameters from server')
#obj_desc = rospy.get_param('obj_desc','{"type" : "Bar"}')
self.sm.userdata.sm_obj_desc = json.loads(obj_desc)
self.sm.userdata.state = 'pose_selection'
self.sm.userdata.sm_min_objs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetUserData(self, key, data):\n self._userdata[key] = data",
"def SetUserData(self, l):\r\n\r\n self.user_data = l",
"def set_initial_state(self, initial_states, userdata):\n raise NotImplementedError()",
"def set_user(self, user):\n self._user = user",
"def set_user(self, user)... | [
"0.67750424",
"0.6624653",
"0.6378264",
"0.62329",
"0.61468405",
"0.61283535",
"0.60416687",
"0.5984344",
"0.59561646",
"0.59118533",
"0.5888574",
"0.5867694",
"0.586069",
"0.58523023",
"0.58391786",
"0.5812252",
"0.58050495",
"0.57789344",
"0.5746965",
"0.5721594",
"0.566803... | 0.5069503 | 99 |
Derivative of the sigmoid function. | def sigmoid_prime(z):
return sigmoid(z)*(1-sigmoid(z)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid_derivative(x):\n return x * (1-x)",
"def sigmoid_derivative(x):\n return x * (1.0 - x)",
"def sigmoid_derivative(x):\n\n return sigmoid(x) * (1 - sigmoid(x))",
"def derivative_sigmoid(x):\n return x * (1 - x)",
"def derivative_sigmoid(x):\n return x * (1 - x)",
"def sigmoid_der... | [
"0.8473345",
"0.8448888",
"0.839508",
"0.8346479",
"0.8346479",
"0.8297725",
"0.80530924",
"0.7752295",
"0.77066267",
"0.7497277",
"0.74647295",
"0.74512917",
"0.74003476",
"0.7383002",
"0.73813754",
"0.7346715",
"0.73203295",
"0.73073524",
"0.7191011",
"0.71132654",
"0.70895... | 0.0 | -1 |
Mock responses for Fronius Symo inverter with meter. | def mock_responses(aioclient_mock: AiohttpClientMocker, night: bool = False) -> None:
aioclient_mock.clear_requests()
_day_or_night = "night" if night else "day"
aioclient_mock.get(
f"{MOCK_HOST}/solar_api/GetAPIVersion.cgi",
text=load_fixture("symo/GetAPIVersion.json", "fronius"),
)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def test_symo_meter(hass, aioclient_mock):\n\n def assert_state(entity_id, expected_state):\n state = hass.states.get(entity_id)\n assert state\n assert state.state == str(expected_state)\n\n mock_responses(aioclient_mock)\n config = {\n CONF_SENSOR_TYPE: TYPE_METER,\n ... | [
"0.67791754",
"0.61868787",
"0.6113946",
"0.59232605",
"0.589949",
"0.5847982",
"0.5805583",
"0.56743664",
"0.56128174",
"0.5587881",
"0.5572566",
"0.5564778",
"0.55594957",
"0.5542061",
"0.55386007",
"0.55244476",
"0.55188125",
"0.5517258",
"0.5515892",
"0.5514214",
"0.55059... | 0.6162463 | 2 |
Retrieve the Billing/Root AWS Account Id of the organization. | def _get_billing_account_id():
org_client = boto3.client("organizations")
response = org_client.describe_organization()
return response["Organization"]["MasterAccountId"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def organization_id(self) -> str:\n return pulumi.get(self, \"organization_id\")",
"def account_id(self) -> str:\n return pulumi.get(self, \"account_id\")",
"def account_id(self) -> str:\n return pulumi.get(self, \"account_id\")",
"def account_id(self) -> str:\n return pulumi.get(... | [
"0.7483909",
"0.72347695",
"0.72347695",
"0.72347695",
"0.72347695",
"0.72347695",
"0.72347695",
"0.72347695",
"0.72347695",
"0.7161343",
"0.7149964",
"0.71368206",
"0.71078295",
"0.71078295",
"0.71078295",
"0.71078295",
"0.71078295",
"0.706152",
"0.7042881",
"0.70268255",
"0... | 0.75122535 | 0 |
Get exposure value. See swagger definition for further details. | def get_exposure_value():
validate(request.json, 'exposureValueRequestSchema', 'swagger/getExposureValue.yml')
logging.info("get_exposure_value({0})".format(request.json))
return database.get_exposure_value(loc=request.json['loc'],
stime=ExposureUtil.to_timestamp(reque... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_exposure(self):\n exposure = float(self._driver.ExposureTime)\n\n return exposure",
"def exposure(self) -> Quantity:\n if self._exp is None:\n raise ModelNotAssociatedError(\"There are no XSPEC fits associated with this Spectrum\")\n else:\n exp = Quantit... | [
"0.7036424",
"0.6912415",
"0.67658675",
"0.66248137",
"0.63765323",
"0.62100214",
"0.61073315",
"0.61073315",
"0.58474326",
"0.579713",
"0.5743248",
"0.57325727",
"0.5712513",
"0.57012856",
"0.5687988",
"0.56328267",
"0.5583496",
"0.5545581",
"0.5542657",
"0.55397105",
"0.552... | 0.800687 | 0 |
Get exposure score. See swagger spec for further details. | def get_exposure_score():
validate(request.json, 'exposureScoreRequestSchema', 'swagger/getExposureScore.yml')
logging.info("get_exposure_score({0})".format(request.json))
return database.get_exposure_score(loc=request.json['loc'],
stime=ExposureUtil.to_timestamp(reque... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def score(self):\n return self.client.call('GET', self.name + 'score')",
"def get_score(self):\n return self.score",
"def get_score(self):\n return self.score",
"def get_score(self):\n return self.score",
"def get_score(self):\n return self._score",
"def get_score(self)... | [
"0.664749",
"0.63467395",
"0.63467395",
"0.63467395",
"0.62751466",
"0.62751466",
"0.62751466",
"0.62751114",
"0.6262026",
"0.6244419",
"0.619337",
"0.61548054",
"0.6143085",
"0.61291313",
"0.60853",
"0.602019",
"0.6010291",
"0.5995096",
"0.593023",
"0.5927252",
"0.5923142",
... | 0.83044446 | 0 |
Get the convolutional layers of the model. | def convolutional_layers():
x = tf.placeholder(tf.float32, [None, None, None])
# First layer
W_conv1 = weight_variable([5, 5, 1, 48])
b_conv1 = bias_variable([48])
x_expanded = tf.expand_dims(x, 3)
h_conv1 = tf.nn.relu(conv2d(x_expanded, W_conv1) + b_conv1)
h_pool1 = max_pool(h_conv1, ksize... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_conv_weight(model):\n layer_name = 'conv2d_1'\n weights = model.get_layer(layer_name).get_weights()\n # weights[0] --- kernel weights\n # weights[1] --- kernel biases\n weights = np.asarray(weights[0])\n mean_weights = np.mean(weights, axis=0)\n mean_weights = np.reshape(mean_weights,... | [
"0.68047774",
"0.67132866",
"0.65962714",
"0.65422004",
"0.64981174",
"0.6487465",
"0.64524734",
"0.63964885",
"0.6396046",
"0.6345043",
"0.6323719",
"0.6287003",
"0.6269246",
"0.6257411",
"0.6252408",
"0.6245447",
"0.620835",
"0.6193992",
"0.6188288",
"0.6174506",
"0.6053155... | 0.5947855 | 26 |
The same as the training model, except it acts on an arbitrarily sized input, and slides the 128x64 window across the image in 8x8 strides. The output is of the form `v`, where `v[i, j]` is equivalent to the output of the training model, for the window at coordinates `(8 i, 4 j)`. | def get_detect_model():
x, conv_layer, conv_vars = convolutional_layers()
# Fourth layer
W_fc1 = weight_variable([8 * 32 * 128, 2048])
W_conv1 = tf.reshape(W_fc1, [8, 32, 128, 2048])
b_fc1 = bias_variable([2048])
h_conv1 = tf.nn.relu(conv2d(conv_layer, W_conv1,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sliding_window_batch(window_size, stride=1):\n def _apply_fn(dataset):\n return _SlideDataset(dataset, window_size, stride)\n\n return _apply_fn",
"def sliding_window_decoding( model, X, input_shape, overlapping = 32 ) :\n patch_bboxes = get_patch_bboxes( X.shape, input_shape, overlapping )\n n_sa... | [
"0.59790486",
"0.59699625",
"0.5960328",
"0.59106994",
"0.58591735",
"0.58518153",
"0.5787106",
"0.5781153",
"0.57626766",
"0.5681135",
"0.5677316",
"0.56466204",
"0.56298655",
"0.56181514",
"0.5592573",
"0.5590441",
"0.5578087",
"0.557281",
"0.55574584",
"0.5552292",
"0.5537... | 0.0 | -1 |
Returns enrollment status for current student | def allowed_program_access(program, student=None):
if has_super_access():
return True
if not student:
student = get_current_student()
if student and get_enrollment('program', program, student.name):
return True
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_localized_student_status(self):\n return AssignmentGroup.status_mapping_student[self.status]",
"def get_status_student():\n if (self.status == self.CH_GRADED or \n (self.status == self.CH_AUTOGRADED and self.autograderresult.visible)):\n return \"Graded\"\n ... | [
"0.68060905",
"0.67830354",
"0.6620853",
"0.6398365",
"0.6398299",
"0.62936723",
"0.6291253",
"0.6276027",
"0.60898286",
"0.59986585",
"0.59485316",
"0.58606446",
"0.5842786",
"0.5824142",
"0.5819161",
"0.5782286",
"0.5760636",
"0.57470477",
"0.57194996",
"0.5709267",
"0.5667... | 0.0 | -1 |
Returns the variation coefficient (standard error / mean, give relative value of variation around mean) of x. | def variation_coefficient(x):
mean = np.mean(x)
if mean != 0:
return np.std(x) / mean
else:
return np.nan | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def coefficient_variation(self):\n std, mean = self.std()\n coefficient_variation = std/mean\n print(f\"Coefficient of Variation is: {coefficient_variation}\")\n return coefficient_variation",
"def variation(x, ddof=1):\n with mp.extraprec(16):\n s = std(x, ddof=ddof)\n ... | [
"0.7909317",
"0.7035592",
"0.6954637",
"0.64724946",
"0.6365021",
"0.62133896",
"0.61405116",
"0.61317706",
"0.61226314",
"0.6110114",
"0.6071603",
"0.6050877",
"0.6047893",
"0.603136",
"0.6008346",
"0.5995891",
"0.5995891",
"0.5995891",
"0.5978501",
"0.5963829",
"0.5920986",... | 0.8378508 | 0 |
Returns the sum of all data points, that are present in the time series more than once. For example sum_of_reoccurring_data_points([2, 2, 2, 2, 1]) = 8 as 2 is a reoccurring value, so all 2's are summed up. This is in contrast to ``sum_of_reoccurring_values``, where each reoccuring value is only counted once. | def sum_of_reoccurring_data_points(x):
unique, counts = np.unique(x, return_counts=True)
counts[counts < 2] = 0
return np.sum(counts * unique) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum(self):\n return sum(self.values)",
"def sum (self):\n return self.values.sum ()",
"def sum (self):\n return self.values.sum ()",
"def _find_repeats(data: Tensor) ->Tensor:\n temp = data.detach().clone()\n temp = temp.sort()[0]\n change = torch.cat([torch.tensor([True], d... | [
"0.53387666",
"0.52904224",
"0.52904224",
"0.5285019",
"0.5227271",
"0.51509017",
"0.5125435",
"0.50964093",
"0.50549966",
"0.50523293",
"0.5037906",
"0.5007963",
"0.50075114",
"0.50075114",
"0.50075114",
"0.49943295",
"0.49478376",
"0.49454275",
"0.49193886",
"0.49066535",
"... | 0.7830956 | 0 |
Test incorrect type for first name | def test_incorrect_type(self):
body = json.dumps({
"first_name": 200,
"last_name": "Holmes",
"email": "sherlock@example.com",
"password": "ilovek@ndA!"
})
errorObject = {
"error": "Bad request",
"field_errors": {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_user_signup_with_invalid_first_name(self):\n pass",
"def say_my_name(first_name, last_name=\"\"):\n\n error1 = \"first_name must be a string\"\n error2 = \"last_name must be a string\"\n\n if type(first_name) != str:\n raise TypeError(error1)\n if type(last_name) != str:\n ... | [
"0.727722",
"0.7194198",
"0.70320505",
"0.6965598",
"0.69349045",
"0.69256306",
"0.69127303",
"0.6882609",
"0.6753938",
"0.67475325",
"0.67253995",
"0.67253995",
"0.6684063",
"0.66585547",
"0.6653791",
"0.66537595",
"0.66360795",
"0.6626911",
"0.66116583",
"0.6600295",
"0.659... | 0.62752175 | 42 |
Get the Wordpress version installed in the given path. | def check_version(self):
try:
content = self.get_content()
match = re.search(r"\$wp_version = \'(.+)\';", content)
if match:
return match.group(1)
else:
raise Exception
except:
"Unable to find Wordpress in the pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_version(path=VERSION_PATH):\n namespace = {}\n exec(read(path), namespace)\n return namespace['get_version'](short=True)",
"def read_version(path):\n version = None\n if os.path.exists(path):\n version = open(path, 'r', encoding='utf-8').read().strip()\n\n if version:\n re... | [
"0.6568822",
"0.64892745",
"0.6449087",
"0.61906093",
"0.6187556",
"0.61727047",
"0.61563313",
"0.6069648",
"0.6019967",
"0.5984326",
"0.5970913",
"0.5962816",
"0.5937086",
"0.590367",
"0.58822143",
"0.58765835",
"0.5849401",
"0.58353716",
"0.58333415",
"0.58020604",
"0.57573... | 0.7808661 | 0 |
Gets states up to `n_quanta` over `n_modes` | def get_state_list_from_quanta(cls, n_quanta, n_modes, target_modes=None, only_target_modes=False):
if isinstance(n_quanta, int):
n_quanta = range(n_quanta+1)
whee = [np.flip(x) for x in BasisStateSpace.from_quanta(
HarmonicOscillatorProductBasis(n_modes),
n_quanta
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def N_states_for_learner(self):\n idx_max = []\n limits = 50, 2*_math.pi, 50, 50, 50, 50, 50, 50, 50\n for idx, limit in enumerate(limits):\n test = [0 for i in xrange(len(limits))]\n check = _arange(-limit,limit,limit/1000.)\n maxi = 0\n for v in ch... | [
"0.6026449",
"0.6025942",
"0.5941962",
"0.5855448",
"0.5796622",
"0.5796622",
"0.57090497",
"0.5633561",
"0.5625631",
"0.56219906",
"0.56085443",
"0.56046927",
"0.55898184",
"0.55821943",
"0.5576002",
"0.5568537",
"0.556061",
"0.5543732",
"0.55277145",
"0.5483961",
"0.544658"... | 0.7525478 | 0 |
Name of the process utilizing the GPU. When job_id is provided, is the unique (to the pipelinejob) name of the pipelinejob operator utilizing the GPU. When job_id is not provided, is the name of the Clara Platform managed, nonpipeline process utilizing the GPU. | def name(self) -> str:
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._job",
"def jobName(self):\n return f\"{self.config.pipeline.name}-pypette\"[:12]",
"def job_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"job_id\")",
"def job_name(self) -> str:\n return self._step_execution_context.job_name",
"def job_na... | [
"0.66767174",
"0.6538658",
"0.64989036",
"0.64652693",
"0.64171666",
"0.6405671",
"0.63670844",
"0.63662565",
"0.6213871",
"0.59919184",
"0.5988425",
"0.5974089",
"0.5974089",
"0.59574825",
"0.5923408",
"0.58923274",
"0.5878281",
"0.5858601",
"0.5856997",
"0.5856997",
"0.5856... | 0.0 | -1 |
Name of the process utilizing the GPU. When job_id is provided, is the unique (to the pipelinejob) name of the pipelinejob operator utilizing the GPU. When job_id is not provided, is the name of the Clara Platform managed, nonpipeline process utilizing the GPU. | def name(self, name: str):
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._job",
"def jobName(self):\n return f\"{self.config.pipeline.name}-pypette\"[:12]",
"def job_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"job_id\")",
"def job_name(self) -> str:\n return self._step_execution_context.job_name",
"def job_na... | [
"0.66765225",
"0.6538495",
"0.64990157",
"0.6465572",
"0.64171207",
"0.6406069",
"0.63673866",
"0.63659126",
"0.62134993",
"0.5993193",
"0.5987865",
"0.5973934",
"0.5973934",
"0.5957488",
"0.5923433",
"0.5892624",
"0.5877707",
"0.5857968",
"0.58571935",
"0.58571935",
"0.58571... | 0.0 | -1 |
Unique identifier of the pipelinejob utilizing the GPU. Only provided when the process utilizing the GPU is a pipelinejob. | def job_id(self) -> JobId:
return self._job_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n self._config_entry.entry_id, \"gpu_load\", self._gpu_name\n )",
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n self._config_entry.entry_id,\n f\"{self._process_type}_c... | [
"0.7250749",
"0.7132626",
"0.7028703",
"0.68948746",
"0.656959",
"0.6464921",
"0.6420556",
"0.6420506",
"0.64076847",
"0.6367568",
"0.63559586",
"0.63001496",
"0.6271227",
"0.6262974",
"0.62471324",
"0.6238898",
"0.6235813",
"0.6215683",
"0.62028885",
"0.6202303",
"0.6138686"... | 0.608985 | 27 |
Unique identifier of the pipelinejob utilizing the GPU. Only provided when the process utilizing the GPU is a pipelinejob. | def job_id(self, job_id: JobId):
self._job_id = job_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n self._config_entry.entry_id, \"gpu_load\", self._gpu_name\n )",
"def unique_id(self) -> str:\n return get_frigate_entity_unique_id(\n self._config_entry.entry_id,\n f\"{self._process_type}_c... | [
"0.72507715",
"0.7131893",
"0.7030559",
"0.68964815",
"0.6570852",
"0.64670855",
"0.642124",
"0.6418267",
"0.6408361",
"0.6368568",
"0.6356273",
"0.63021004",
"0.62713104",
"0.6263336",
"0.6248902",
"0.6239466",
"0.62372863",
"0.6215814",
"0.6204541",
"0.62031984",
"0.6139967... | 0.0 | -1 |
Unique (to the cluster) name of the node which contains the GPU. | def node_id(self) -> int:
return self._node_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_node_name(self):\n return util.join_names_underscore(self.name, str(self.as_pointer()))",
"def name(self):\n _LOGGER.debug(self._shelly_cloud_device_name + ' >>> ' +\n self._shelly_cloud_entity_name + ' >>> name() >>> ' +\n self._shelly_cloud_device... | [
"0.7296611",
"0.7248437",
"0.715425",
"0.71135443",
"0.70933753",
"0.7092233",
"0.70309335",
"0.7003493",
"0.69928217",
"0.69928217",
"0.6941008",
"0.6930989",
"0.691941",
"0.6903885",
"0.6903885",
"0.6903885",
"0.68518186",
"0.68437785",
"0.68378633",
"0.6818385",
"0.6805029... | 0.0 | -1 |
Unique (to the cluster) name of the node which contains the GPU. | def node_id(self, node_id: int):
self._node_id = node_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_node_name(self):\n return util.join_names_underscore(self.name, str(self.as_pointer()))",
"def name(self):\n _LOGGER.debug(self._shelly_cloud_device_name + ' >>> ' +\n self._shelly_cloud_entity_name + ' >>> name() >>> ' +\n self._shelly_cloud_device... | [
"0.72953373",
"0.7248576",
"0.7155137",
"0.7113853",
"0.7092226",
"0.7090676",
"0.70290893",
"0.7003835",
"0.69920355",
"0.69920355",
"0.69400066",
"0.69309366",
"0.6919785",
"0.6904492",
"0.6904492",
"0.6904492",
"0.6850059",
"0.6844273",
"0.6839056",
"0.68187106",
"0.680526... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.