body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
c3da0d513beccc92fd3ce76d2ee9c3b5d6b8ad7c731b87bc8dc1cae3372b0921 | def get_event_count(event_times, start, end):
'\n Count of events in given interval.\n\n :param event_times: nd-array of event times\n :param start: interval start\n :param end: interval end\n :return: count of events in interval\n '
mask = ((event_times > start) & (event_times <= end))
re... | Count of events in given interval.
:param event_times: nd-array of event times
:param start: interval start
:param end: interval end
:return: count of events in interval | tideh/functions.py | get_event_count | sebaruehl/TiDeH | 0 | python | def get_event_count(event_times, start, end):
'\n Count of events in given interval.\n\n :param event_times: nd-array of event times\n :param start: interval start\n :param end: interval end\n :return: count of events in interval\n '
mask = ((event_times > start) & (event_times <= end))
re... | def get_event_count(event_times, start, end):
'\n Count of events in given interval.\n\n :param event_times: nd-array of event times\n :param start: interval start\n :param end: interval end\n :return: count of events in interval\n '
mask = ((event_times > start) & (event_times <= end))
re... |
13cd046971e68a3a9a9963f25b7b9bf2c8cb1cf007c01d3e2334f182b5487cc2 | def prediction_error_absolute(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates absolute prediction error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n :par... | Calculates absolute prediction error.
:param event_times: event times
:param intensity: predicted intensity
:param window_size: prediction window size
:param obs_time: observation time
:param pred_time: prediction time
:param dt: interval width for numerical integral calculation used for intensity prediction
:return: ... | tideh/functions.py | prediction_error_absolute | sebaruehl/TiDeH | 0 | python | def prediction_error_absolute(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates absolute prediction error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n :par... | def prediction_error_absolute(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates absolute prediction error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n :par... |
f4468edefbc7fd59c20407acda23cf92644a5745b550672b21a8a621ebad4781 | def prediction_error_normed(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates normed prediction error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n :param p... | Calculates normed prediction error.
:param event_times: event times
:param intensity: predicted intensity
:param window_size: prediction window size
:param obs_time: observation time
:param pred_time: prediction time
:param dt: interval width for numerical integral calculation used for intensity prediction
:return: no... | tideh/functions.py | prediction_error_normed | sebaruehl/TiDeH | 0 | python | def prediction_error_normed(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates normed prediction error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n :param p... | def prediction_error_normed(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates normed prediction error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n :param p... |
3e8b64dcc140a0c6310ff81c4de95f65a671c9c9fcd359cc2de3f7d08a70c921 | def prediction_error_relative(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates median relative running error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n ... | Calculates median relative running error.
:param event_times: event times
:param intensity: predicted intensity
:param window_size: prediction window size
:param obs_time: observation time
:param pred_time: prediction time
:param dt: interval width for numerical integral calculation used for intensity prediction
:retu... | tideh/functions.py | prediction_error_relative | sebaruehl/TiDeH | 0 | python | def prediction_error_relative(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates median relative running error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n ... | def prediction_error_relative(event_times, intensity, window_size, obs_time, pred_time, dt):
'\n Calculates median relative running error.\n\n :param event_times: event times\n :param intensity: predicted intensity\n :param window_size: prediction window size\n :param obs_time: observation time\n ... |
1839a0c21c55b2e6bd62a19e69d1322093441ae40b7d646a235eef6e91fafef7 | def exchange_image_file_name(file_path):
'\n ファイル名の変更\n\n :param file_path: ファイル名(パス含む)\n :return: 変換後のファイル名\n '
file_date = get_date(file_path)
file_directory = file_date.strftime('%Y%m')
save_path = ((os.path.abspath(output_image_dir) + '/') + file_directory)
os.makedirs(save_path, exi... | ファイル名の変更
:param file_path: ファイル名(パス含む)
:return: 変換後のファイル名 | organize_photos.py | exchange_image_file_name | tsukko/organize_photos | 0 | python | def exchange_image_file_name(file_path):
'\n ファイル名の変更\n\n :param file_path: ファイル名(パス含む)\n :return: 変換後のファイル名\n '
file_date = get_date(file_path)
file_directory = file_date.strftime('%Y%m')
save_path = ((os.path.abspath(output_image_dir) + '/') + file_directory)
os.makedirs(save_path, exi... | def exchange_image_file_name(file_path):
'\n ファイル名の変更\n\n :param file_path: ファイル名(パス含む)\n :return: 変換後のファイル名\n '
file_date = get_date(file_path)
file_directory = file_date.strftime('%Y%m')
save_path = ((os.path.abspath(output_image_dir) + '/') + file_directory)
os.makedirs(save_path, exi... |
079ecbf8c782959cd8b46d629dd5a4cad79d19aa2655fb8f094fa47a27c62d26 | def weights_init(m):
'custom weights initialization'
if (isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d)):
nn.init.orthogonal_(m.weight.data)
else:
print(('%s is not custom-initialized.' % m.__class__)) | custom weights initialization | pyrela/common_utils/helper.py | weights_init | facebookresearch/rela | 93 | python | def weights_init(m):
if (isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d)):
nn.init.orthogonal_(m.weight.data)
else:
print(('%s is not custom-initialized.' % m.__class__)) | def weights_init(m):
if (isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d)):
nn.init.orthogonal_(m.weight.data)
else:
print(('%s is not custom-initialized.' % m.__class__))<|docstring|>custom weights initialization<|endoftext|> |
ac5232340f88a47d4a59e45ae552ede7834d69cc102f212e92a65dff4b08d4a8 | def variant_to_fm_format(steps, step_list, activity_list, rev_step_mapping, minpartialsz=2, negative_samples=3, seed=123, normalize=True, pred_id=0):
'\n Method to make matrix representation of step case. Matrix will contain\n the following features:\n - steps taken\n - executed activities\n ... | Method to make matrix representation of step case. Matrix will contain
the following features:
- steps taken
- executed activities
- step to be predicted | code/PMRec/dataRep/nextActivityAddActivityBuildWithVariant.py | variant_to_fm_format | wailamjonathanlee/PMRec | 3 | python | def variant_to_fm_format(steps, step_list, activity_list, rev_step_mapping, minpartialsz=2, negative_samples=3, seed=123, normalize=True, pred_id=0):
'\n Method to make matrix representation of step case. Matrix will contain\n the following features:\n - steps taken\n - executed activities\n ... | def variant_to_fm_format(steps, step_list, activity_list, rev_step_mapping, minpartialsz=2, negative_samples=3, seed=123, normalize=True, pred_id=0):
'\n Method to make matrix representation of step case. Matrix will contain\n the following features:\n - steps taken\n - executed activities\n ... |
2df5198268fb4ef44847df9821964b7504e26447b3389e6cd6a5817f96964e3b | def offline_update(log):
'\n Stop the clamav daemon, update the clamav definitions, then\n start the damon. This can avoid OOMs on some systems with\n less RAM capacity.\n '
log.run(['service', 'clamav-daemon', 'stop'])
log.run(['/usr/bin/env', 'freshclam'])
log.run(['service', 'clamav-daem... | Stop the clamav daemon, update the clamav definitions, then
start the damon. This can avoid OOMs on some systems with
less RAM capacity. | bin/libsw/clamav.py | offline_update | Rondore/sitewrangler | 0 | python | def offline_update(log):
'\n Stop the clamav daemon, update the clamav definitions, then\n start the damon. This can avoid OOMs on some systems with\n less RAM capacity.\n '
log.run(['service', 'clamav-daemon', 'stop'])
log.run(['/usr/bin/env', 'freshclam'])
log.run(['service', 'clamav-daem... | def offline_update(log):
'\n Stop the clamav daemon, update the clamav definitions, then\n start the damon. This can avoid OOMs on some systems with\n less RAM capacity.\n '
log.run(['service', 'clamav-daemon', 'stop'])
log.run(['/usr/bin/env', 'freshclam'])
log.run(['service', 'clamav-daem... |
3c32938234b6b8dbf71bee24babf84679117a5abbe8df85b6a5449d144907e46 | def main():
'Terminal上でポーカーを再現。ダブルアップはなし。\n '
poker = Poker()
'\n 標準入出力を利用して、ゲームを行う\n ループで回せばいい\n 終了の文字も指定する\n ゲームの流れは、\n スタート->dealされた札が5枚表示される->holdする札を選択する->\n ->再びdealする->役を判定->ゲームの結果処理->スタートに戻る\n ユーザーができることは、\n holdする札を選ぶ。結果表示後続けるか選ぶ。\n の2つ\n '
print('How to hold ca... | Terminal上でポーカーを再現。ダブルアップはなし。 | poker.py | main | ikapper/Poker | 0 | python | def main():
'\n '
poker = Poker()
'\n 標準入出力を利用して、ゲームを行う\n ループで回せばいい\n 終了の文字も指定する\n ゲームの流れは、\n スタート->dealされた札が5枚表示される->holdする札を選択する->\n ->再びdealする->役を判定->ゲームの結果処理->スタートに戻る\n ユーザーができることは、\n holdする札を選ぶ。結果表示後続けるか選ぶ。\n の2つ\n '
print('How to hold card? --> Please input "134".'... | def main():
'\n '
poker = Poker()
'\n 標準入出力を利用して、ゲームを行う\n ループで回せばいい\n 終了の文字も指定する\n ゲームの流れは、\n スタート->dealされた札が5枚表示される->holdする札を選択する->\n ->再びdealする->役を判定->ゲームの結果処理->スタートに戻る\n ユーザーができることは、\n holdする札を選ぶ。結果表示後続けるか選ぶ。\n の2つ\n '
print('How to hold card? --> Please input "134".'... |
4f4872f46c3e961e0e9eb1f582a6707a5161b860da7351f68412e9fc900506e8 | def __init__(self, jokers=1):
'山札cardsを生成して、配る分dealsを用意する\n cardsとdealsを足すと全カードになる\n Jokerは4枚まで想定している\n '
self.num_joker = jokers
bundle = [(suit + str(i)) for suit in ('S', 'C', 'H', 'D') for i in range(1, 14)]
bundle.extend(('Joker{0}'.format((i + 1)) for i in range(self.num_joker... | 山札cardsを生成して、配る分dealsを用意する
cardsとdealsを足すと全カードになる
Jokerは4枚まで想定している | poker.py | __init__ | ikapper/Poker | 0 | python | def __init__(self, jokers=1):
'山札cardsを生成して、配る分dealsを用意する\n cardsとdealsを足すと全カードになる\n Jokerは4枚まで想定している\n '
self.num_joker = jokers
bundle = [(suit + str(i)) for suit in ('S', 'C', 'H', 'D') for i in range(1, 14)]
bundle.extend(('Joker{0}'.format((i + 1)) for i in range(self.num_joker... | def __init__(self, jokers=1):
'山札cardsを生成して、配る分dealsを用意する\n cardsとdealsを足すと全カードになる\n Jokerは4枚まで想定している\n '
self.num_joker = jokers
bundle = [(suit + str(i)) for suit in ('S', 'C', 'H', 'D') for i in range(1, 14)]
bundle.extend(('Joker{0}'.format((i + 1)) for i in range(self.num_joker... |
e0032844f369d2fa2a99356ce7bf738c343986b3ac87c0b78360bf6753b2b9b7 | def shuffle(self):
'配った分と山札を合わせてシャッフルしたあと、配り直す\n '
self.cards.extend(self.deals)
random.shuffle(self.cards)
self.deals = self.pickTop(5) | 配った分と山札を合わせてシャッフルしたあと、配り直す | poker.py | shuffle | ikapper/Poker | 0 | python | def shuffle(self):
'\n '
self.cards.extend(self.deals)
random.shuffle(self.cards)
self.deals = self.pickTop(5) | def shuffle(self):
'\n '
self.cards.extend(self.deals)
random.shuffle(self.cards)
self.deals = self.pickTop(5)<|docstring|>配った分と山札を合わせてシャッフルしたあと、配り直す<|endoftext|> |
2ae385c30179bdcb56f59e69853b043e9fcda850060904803cbb2e7f91055995 | def pickTop(self, n):
'先頭からn個popする --> list\n '
if (n > (len(self.cards) - 1)):
n = (len(self.cards) - 1)
elif (n < 0):
n = 0
result = [self.cards.pop(0) for i in range(n)]
return result | 先頭からn個popする --> list | poker.py | pickTop | ikapper/Poker | 0 | python | def pickTop(self, n):
'\n '
if (n > (len(self.cards) - 1)):
n = (len(self.cards) - 1)
elif (n < 0):
n = 0
result = [self.cards.pop(0) for i in range(n)]
return result | def pickTop(self, n):
'\n '
if (n > (len(self.cards) - 1)):
n = (len(self.cards) - 1)
elif (n < 0):
n = 0
result = [self.cards.pop(0) for i in range(n)]
return result<|docstring|>先頭からn個popする --> list<|endoftext|> |
3bd7f8a6dc959917e0d529fa62e14da3c4cc9ddde2a206f06e5de2248a66487e | def change_cards(self, holds=[0, 1, 2, 3, 4]):
'dealsの左から数えた時のholdするindexのリスト。最左を1として、5まで考えられる\n デフォルトは全ホールド。dealsが変化する。抜いたカードは山札に戻す\n '
nonhold = [i for i in range(5)]
for idx in holds:
nonhold.remove(idx)
for idx in nonhold:
pop = self.deals.pop(idx)
self.deals.in... | dealsの左から数えた時のholdするindexのリスト。最左を1として、5まで考えられる
デフォルトは全ホールド。dealsが変化する。抜いたカードは山札に戻す | poker.py | change_cards | ikapper/Poker | 0 | python | def change_cards(self, holds=[0, 1, 2, 3, 4]):
'dealsの左から数えた時のholdするindexのリスト。最左を1として、5まで考えられる\n デフォルトは全ホールド。dealsが変化する。抜いたカードは山札に戻す\n '
nonhold = [i for i in range(5)]
for idx in holds:
nonhold.remove(idx)
for idx in nonhold:
pop = self.deals.pop(idx)
self.deals.in... | def change_cards(self, holds=[0, 1, 2, 3, 4]):
'dealsの左から数えた時のholdするindexのリスト。最左を1として、5まで考えられる\n デフォルトは全ホールド。dealsが変化する。抜いたカードは山札に戻す\n '
nonhold = [i for i in range(5)]
for idx in holds:
nonhold.remove(idx)
for idx in nonhold:
pop = self.deals.pop(idx)
self.deals.in... |
dc0826ebecffac74058092a41caa87ff45bb5a030ef5c481c27dada2e48344b3 | def judge_deals(self):
'呼ばれた時点でのdealsで役判定する\n return a corresponding hand\n '
suits = []
ranks = []
jokers = 0
for deal in self.deals:
if deal.startswith('Joker'):
jokers += 1
continue
suits.append(deal[:1])
ranks.append(int(deal[1:]))
... | 呼ばれた時点でのdealsで役判定する
return a corresponding hand | poker.py | judge_deals | ikapper/Poker | 0 | python | def judge_deals(self):
'呼ばれた時点でのdealsで役判定する\n return a corresponding hand\n '
suits = []
ranks = []
jokers = 0
for deal in self.deals:
if deal.startswith('Joker'):
jokers += 1
continue
suits.append(deal[:1])
ranks.append(int(deal[1:]))
... | def judge_deals(self):
'呼ばれた時点でのdealsで役判定する\n return a corresponding hand\n '
suits = []
ranks = []
jokers = 0
for deal in self.deals:
if deal.startswith('Joker'):
jokers += 1
continue
suits.append(deal[:1])
ranks.append(int(deal[1:]))
... |
1875ce6562984ec9cfaccf3cd14d151a53a387295cefba845df26b2f78b70685 | def judge(self, suits, ranks, jokers=0):
'jokers: number of jokers\n テストにも使う\n return a corresponding hand\n '
isRoyal = self._isRoyal(suits, ranks, jokers)
if isRoyal:
return self.CONST_ROYAL_STRAIGHT_FLUSH
isFive = self._is5Cards(ranks, jokers)
if isFive:
retur... | jokers: number of jokers
テストにも使う
return a corresponding hand | poker.py | judge | ikapper/Poker | 0 | python | def judge(self, suits, ranks, jokers=0):
'jokers: number of jokers\n テストにも使う\n return a corresponding hand\n '
isRoyal = self._isRoyal(suits, ranks, jokers)
if isRoyal:
return self.CONST_ROYAL_STRAIGHT_FLUSH
isFive = self._is5Cards(ranks, jokers)
if isFive:
retur... | def judge(self, suits, ranks, jokers=0):
'jokers: number of jokers\n テストにも使う\n return a corresponding hand\n '
isRoyal = self._isRoyal(suits, ranks, jokers)
if isRoyal:
return self.CONST_ROYAL_STRAIGHT_FLUSH
isFive = self._is5Cards(ranks, jokers)
if isFive:
retur... |
48bbf4525ff92fb1564dc76ab66ae9dc1d86db4b52f9cc7cfec2f782f0dfa0b2 | def _isRoyal(self, suits, ranks, num_jokers=0):
'ロイヤルストレートフラッシュかどうか\n '
sset = set(suits)
if (not (('S' in sset) and self._isFlush(suits, num_jokers))):
return False
sorted_ranks = sorted(ranks)
rset = set(ranks)
for r in rset:
if (not (r in (1, 10, 11, 12, 13))):
... | ロイヤルストレートフラッシュかどうか | poker.py | _isRoyal | ikapper/Poker | 0 | python | def _isRoyal(self, suits, ranks, num_jokers=0):
'\n '
sset = set(suits)
if (not (('S' in sset) and self._isFlush(suits, num_jokers))):
return False
sorted_ranks = sorted(ranks)
rset = set(ranks)
for r in rset:
if (not (r in (1, 10, 11, 12, 13))):
return False
... | def _isRoyal(self, suits, ranks, num_jokers=0):
'\n '
sset = set(suits)
if (not (('S' in sset) and self._isFlush(suits, num_jokers))):
return False
sorted_ranks = sorted(ranks)
rset = set(ranks)
for r in rset:
if (not (r in (1, 10, 11, 12, 13))):
return False
... |
a6679eaecbb57aee61b92dab94f142a353e6005620a3f221f5282956ba18a823 | def gen_display_str(self):
'dealsを見やすい?形の文字列を返す。1,11,12,13を文字に置き換えて文字列を生成する\n '
result = ''
for item in self.deals:
if item.startswith('Joker'):
result += ', Joker'
continue
suit = item[:1]
rank = item[1:]
rank = int(rank)
result += (', ... | dealsを見やすい?形の文字列を返す。1,11,12,13を文字に置き換えて文字列を生成する | poker.py | gen_display_str | ikapper/Poker | 0 | python | def gen_display_str(self):
'\n '
result =
for item in self.deals:
if item.startswith('Joker'):
result += ', Joker'
continue
suit = item[:1]
rank = item[1:]
rank = int(rank)
result += (', ' + suit)
if (rank == 1):
res... | def gen_display_str(self):
'\n '
result =
for item in self.deals:
if item.startswith('Joker'):
result += ', Joker'
continue
suit = item[:1]
rank = item[1:]
rank = int(rank)
result += (', ' + suit)
if (rank == 1):
res... |
1ccfb32df39d4117e1db6ede17d7ac56c2ec1f3cc1abfb22861f72feea88a0e1 | def ams_sc(unitlength: int, ams_sc_base, ams_sc_step):
'\n staircase shaped house\n '
ams_sc = ((ams_sc_base * np.ones((13 * unitlength))) + np.concatenate([(0 * np.ones(unitlength)), (ams_sc_step * np.ones(unitlength)), ((2 * ams_sc_step) * np.ones(unitlength)), ((3 * ams_sc_step) * np.ones(unitlength)),... | staircase shaped house | pycqed/measurement/waveform_control_CC/amsterdam_waveforms.py | ams_sc | nuttamas/PycQED_py3 | 60 | python | def ams_sc(unitlength: int, ams_sc_base, ams_sc_step):
'\n \n '
ams_sc = ((ams_sc_base * np.ones((13 * unitlength))) + np.concatenate([(0 * np.ones(unitlength)), (ams_sc_step * np.ones(unitlength)), ((2 * ams_sc_step) * np.ones(unitlength)), ((3 * ams_sc_step) * np.ones(unitlength)), ((4 * ams_sc_step) * ... | def ams_sc(unitlength: int, ams_sc_base, ams_sc_step):
'\n \n '
ams_sc = ((ams_sc_base * np.ones((13 * unitlength))) + np.concatenate([(0 * np.ones(unitlength)), (ams_sc_step * np.ones(unitlength)), ((2 * ams_sc_step) * np.ones(unitlength)), ((3 * ams_sc_step) * np.ones(unitlength)), ((4 * ams_sc_step) * ... |
d9e8f05b92e7d0ec1a2f2673f41078227e915bb1cb7d0a2f4ef8ffcf24d54be5 | def ams_bottle2(unitlength: int, ams_bottle_base, ams_bottle_delta):
'\n Quite steep bottle (based on second order polynomial)\n '
ams_bottle = ((ams_bottle_base * np.ones((7 * unitlength))) + np.concatenate([((np.linspace(0, ams_bottle_delta, (3 * unitlength)) ** 2) / (ams_bottle_delta ** 1)), (ams_bottl... | Quite steep bottle (based on second order polynomial) | pycqed/measurement/waveform_control_CC/amsterdam_waveforms.py | ams_bottle2 | nuttamas/PycQED_py3 | 60 | python | def ams_bottle2(unitlength: int, ams_bottle_base, ams_bottle_delta):
'\n \n '
ams_bottle = ((ams_bottle_base * np.ones((7 * unitlength))) + np.concatenate([((np.linspace(0, ams_bottle_delta, (3 * unitlength)) ** 2) / (ams_bottle_delta ** 1)), (ams_bottle_delta * np.ones((1 * unitlength))), ((np.linspace(a... | def ams_bottle2(unitlength: int, ams_bottle_base, ams_bottle_delta):
'\n \n '
ams_bottle = ((ams_bottle_base * np.ones((7 * unitlength))) + np.concatenate([((np.linspace(0, ams_bottle_delta, (3 * unitlength)) ** 2) / (ams_bottle_delta ** 1)), (ams_bottle_delta * np.ones((1 * unitlength))), ((np.linspace(a... |
6056bbc242ae6d7670114378b3e55c25a529c0ab9947af013c7d42aa44ca7847 | def ams_bottle3(unitlength: int, ams_bottle_base, ams_bottle_delta):
'\n Normal triangular rooftop\n '
ams_bottle = ((ams_bottle_base * np.ones((13 * unitlength))) + np.concatenate([np.linspace(0, ams_bottle_delta, int((6.5 * unitlength))), np.linspace(ams_bottle_delta, 0, int((6.5 * unitlength)))]))
... | Normal triangular rooftop | pycqed/measurement/waveform_control_CC/amsterdam_waveforms.py | ams_bottle3 | nuttamas/PycQED_py3 | 60 | python | def ams_bottle3(unitlength: int, ams_bottle_base, ams_bottle_delta):
'\n \n '
ams_bottle = ((ams_bottle_base * np.ones((13 * unitlength))) + np.concatenate([np.linspace(0, ams_bottle_delta, int((6.5 * unitlength))), np.linspace(ams_bottle_delta, 0, int((6.5 * unitlength)))]))
return ams_bottle | def ams_bottle3(unitlength: int, ams_bottle_base, ams_bottle_delta):
'\n \n '
ams_bottle = ((ams_bottle_base * np.ones((13 * unitlength))) + np.concatenate([np.linspace(0, ams_bottle_delta, int((6.5 * unitlength))), np.linspace(ams_bottle_delta, 0, int((6.5 * unitlength)))]))
return ams_bottle<|docstr... |
9103df78dec495e43dc3dad60ad87f0ec7cdf9ebd868abfec3ac585b9759ae2d | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A normalized Python object to be normalized.\n\n Returns:\n *. A normalized Python object describing the Object specified by\n this class.\n\n Raises:\n ... | Validates and normalizes a raw Python object.
Args:
raw: *. A normalized Python object to be normalized.
Returns:
*. A normalized Python object describing the Object specified by
this class.
Raises:
TypeError. The Python object cannot be normalized. | extensions/objects/models/objects.py | normalize | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A normalized Python object to be normalized.\n\n Returns:\n *. A normalized Python object describing the Object specified by\n this class.\n\n Raises:\n ... | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A normalized Python object to be normalized.\n\n Returns:\n *. A normalized Python object describing the Object specified by\n this class.\n\n Raises:\n ... |
4dd272be0dd55bb8b91f4da88bd5cf2ccae40369be84318f36d846548c5f67db | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'bool'} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'bool'} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'bool'}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
e8a57f0d441a21e3161cafe5f9ffe8d2c1c8ffa1b8ee6a2660b23c7557818e96 | @classmethod
def normalize(cls, raw):
"Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n bool. The normalized object (or False if the input is None or '')... | Validates and normalizes a raw Python object.
Args:
raw: *. A Python object to be validated against the schema,
normalizing if necessary.
Returns:
bool. The normalized object (or False if the input is None or ''). | extensions/objects/models/objects.py | normalize | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def normalize(cls, raw):
"Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n bool. The normalized object (or False if the input is None or ).\... | @classmethod
def normalize(cls, raw):
"Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n bool. The normalized object (or False if the input is None or ).\... |
bdc372813d3a087fde72d1a580216c25c9b5c309309720415fa9cc2096393c5c | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'float'} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'float'} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'float'}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
c286f6c1e16ef69d2b1d6003e4cb1c60b43ca34c96ed95a162fab48d39c046ea | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int'} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int'} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int'}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
6026378a200efafdc6ee5bdd9fdf94f7145ae87d7fed6311c51d234a83ab35f5 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode'} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode'} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode'}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
67569df4c008e635b14b4a33da955b9f97fa13917f9932fd033794cf70c468fe | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'html'} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'html'} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'html'}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
5c9c575680f0c198d2cff138647d9cf5006a247e53012aa94619401f38812ac1 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'content_id', 'schema': {'type': 'unicode_or_none'}}, {'name': 'unicode_str', 'schema': {'type': 'unicode'}}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'content_id', 'schema': {'type': 'unicode_or_none'}}, {'name': 'unicode_str', 'schema': {'type': 'unicode'}}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'content_id', 'schema': {'type': 'unicode_or_none'}}, {'name': 'unicode_str', 'schema': {'type': 'unicode'}}]}<|docstring|>Returns th... |
1d1191a90271c7a6307085e277eb4a1acdaff530685cc829eccc671ded880b09 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'content_id', 'schema': {'type': 'unicode_or_none'}}, {'name': 'html', 'schema': {'type': 'html'}}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'content_id', 'schema': {'type': 'unicode_or_none'}}, {'name': 'html', 'schema': {'type': 'html'}}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'content_id', 'schema': {'type': 'unicode_or_none'}}, {'name': 'html', 'schema': {'type': 'html'}}]}<|docstring|>Returns the object s... |
a0b9e270317eececa9d0e0175d4cc80e8318ac14c576087faa6279d68449036d | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int', 'validators': [{'id': 'is_at_least', 'min_value': 0}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int', 'validators': [{'id': 'is_at_least', 'min_value': 0}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int', 'validators': [{'id': 'is_at_least', 'min_value': 0}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
e990a6d90dbe75f50aa12d3af341dcf62d2541eb3c2704182eedb777983141e8 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int', 'validators': [{'id': 'is_at_least', 'min_value': 1}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int', 'validators': [{'id': 'is_at_least', 'min_value': 1}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'int', 'validators': [{'id': 'is_at_least', 'min_value': 1}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
88f7a015a1712638e0c7b530d2bbd8713eec0694a116eaf1b7c81ffa6cdfdd4f | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'ui_config': {'coding_mode': 'none'}} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'ui_config': {'coding_mode': 'none'}} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'ui_config': {'coding_mode': 'none'}}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
b44a128a7030b408526c68ccaa8135357bbb7f9cc289db1bdcb77b2cfecb4867 | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n unicode. The normalized object containing string in unicode forma... | Validates and normalizes a raw Python object.
Args:
raw: *. A Python object to be validated against the schema,
normalizing if necessary.
Returns:
unicode. The normalized object containing string in unicode format. | extensions/objects/models/objects.py | normalize | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n unicode. The normalized object containing string in unicode forma... | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n unicode. The normalized object containing string in unicode forma... |
123af2e9bb00a29f3cb8ac1b86dd2bd1ae677b87e89b11ade079f7ffca6e275c | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'code', 'schema': UnicodeString.get_schema()}, {'name': 'output', 'schema': UnicodeString.get_schema()}, {'name': 'evaluation', 'sche... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'code', 'schema': UnicodeString.get_schema()}, {'name': 'output', 'schema': UnicodeString.get_schema()}, {'name': 'evaluation', 'sche... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'code', 'schema': UnicodeString.get_schema()}, {'name': 'output', 'schema': UnicodeString.get_schema()}, {'name': 'evaluation', 'sche... |
b3149db1360127cc1a55fd234efc5fe8cfa07460d2e195b081e957fc92d0e05e | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': CodeEvaluation.get_schema()} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': CodeEvaluation.get_schema()} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': CodeEvaluation.get_schema()}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
cd6e29cc8d4666ebc22d57c0f74100d7d5dc7de236fb88e9f9685ad8bdd682c2 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'len': 2, 'items': Real.get_schema()} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'len': 2, 'items': Real.get_schema()} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'len': 2, 'items': Real.get_schema()}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
c345e0679f6ad7f61704f1b641a03573bc5da83096dd51ec718a4648cb01264b | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': CoordTwoDim.get_schema()} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': CoordTwoDim.get_schema()} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': CoordTwoDim.get_schema()}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
4d4cb9b301e18da81d1ec1964e735a0b04d14f0866ba4f18029bfb3a706efb6c | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': UnicodeString.get_schema()} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': UnicodeString.get_schema()} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': UnicodeString.get_schema()}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
6acd4951de93f42284f2d80208db2c4999c3a93d5bc704bf293381ec1c09bbb4 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': UnicodeString.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': UnicodeString.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': UnicodeString.get_schema(), 'validators': [{'id': 'is_uniquified'}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|... |
b700acb89efe0d0fe524c5ace5d7833b1a04106862372d8509f02f6eb2761064 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'post_normalizers': [{'id': 'normalize_spaces'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'post_normalizers': [{'id': 'normalize_spaces'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'post_normalizers': [{'id': 'normalize_spaces'}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
03a33611b43b4252fd88568683f91912c3b1afec7735f89d49e955fbad723ca7 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': NormalizedString.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': NormalizedString.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': NormalizedString.get_schema(), 'validators': [{'id': 'is_uniquified'}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema... |
f7ba6b40a5f57646e4a57032a858fab27cfc3735fbab310f82e6ea93b4948ecd | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'raw_latex', 'description': 'Latex value', 'schema': {'type': 'unicode'}}, {'name': 'svg_filename', 'description': 'SVG filename', 's... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'raw_latex', 'description': 'Latex value', 'schema': {'type': 'unicode'}}, {'name': 'svg_filename', 'description': 'SVG filename', 's... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'raw_latex', 'description': 'Latex value', 'schema': {'type': 'unicode'}}, {'name': 'svg_filename', 'description': 'SVG filename', 's... |
5818675b4f4ada3e4f8dd7cb6575f671761e0f5809109cbc5fae8fb457ac87d7 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_nonempty'}], 'ui_config': {'placeholder': 'https://www.example.com'}, 'post_normalizers': [{'id': 'sanitize_url'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_nonempty'}], 'ui_config': {'placeholder': 'https://www.example.com'}, 'post_normalizers': [{'id': 'sanitize_url'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_nonempty'}], 'ui_config': {'placeholder': 'https://www.example.com'}, 'post_normalizers': [{'id': 'sanitize_url'}]}<|docstring|>... |
e338334a7cf052ad065a8f09e4b38d5cd75139f014f85d2f207172ad92171649 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'ui_config': {'placeholder': 'Search for skill'}} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'ui_config': {'placeholder': 'Search for skill'}} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'ui_config': {'placeholder': 'Search for skill'}}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
0d3db32384652d5f0a85179172bed13614f22b929cae72545bf774b823087361 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'readableNoteName', 'schema': {'type': 'unicode', 'choices': ['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'readableNoteName', 'schema': {'type': 'unicode', 'choices': ['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'readableNoteName', 'schema': {'type': 'unicode', 'choices': ['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5... |
4be1435a7183a7f8c85c93c1661e27f51adc0c269ab74406908b3e592aa53ad5 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'title', 'description': 'Tab title', 'schema': {'type': 'unicode', 'validators': [{'id': 'is_nonempty'}]}},... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'title', 'description': 'Tab title', 'schema': {'type': 'unicode', 'validators': [{'id': 'is_nonempty'}]}},... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'title', 'description': 'Tab title', 'schema': {'type': 'unicode', 'validators': [{'id': 'is_nonempty'}]}},... |
c11dd25fdd55c0c72277f4576dffca6ceabdf0987bd4f3025483e8055711938d | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema() | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema() | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema()<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
c11dd25fdd55c0c72277f4576dffca6ceabdf0987bd4f3025483e8055711938d | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema() | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema() | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema()<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
18d64eb2decffb3417c4ad263abb977b8d48593cf8c32bb6ad2e4286f51a0af3 | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n dict. The normalized object containing the following key-value\n ... | Validates and normalizes a raw Python object.
Args:
raw: *. A Python object to be validated against the schema,
normalizing if necessary.
Returns:
dict. The normalized object containing the following key-value
pairs:
assumptions_string: str. The string containing the
assumption... | extensions/objects/models/objects.py | normalize | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n dict. The normalized object containing the following key-value\n ... | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: *. A Python object to be validated against the schema,\n normalizing if necessary.\n\n Returns:\n dict. The normalized object containing the following key-value\n ... |
d008020038d49e51de1b1981c68cc82af3fa9a9423d7b33cfc70de99b0e9b25e | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'vertices', 'schema': {'type': 'list', 'items': cls._VERTEX_SCHEMA}}, {'name': 'edges', 'schema': {'type': 'list', 'items': cls._EDGE... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'vertices', 'schema': {'type': 'list', 'items': cls._VERTEX_SCHEMA}}, {'name': 'edges', 'schema': {'type': 'list', 'items': cls._EDGE... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'vertices', 'schema': {'type': 'list', 'items': cls._VERTEX_SCHEMA}}, {'name': 'edges', 'schema': {'type': 'list', 'items': cls._EDGE... |
68b4c74e2ab5f4e7a85bed0bee8c15b34881409ca6e1e015d607b5c93e58eae6 | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Checks that there are no self-loops or multiple edges.\n Checks that unlabeled graphs have all labels empty.\n Checks that unweighted graphs have all weights set to 1.\n TODO(czx): Think about suppor... | Validates and normalizes a raw Python object.
Checks that there are no self-loops or multiple edges.
Checks that unlabeled graphs have all labels empty.
Checks that unweighted graphs have all weights set to 1.
TODO(czx): Think about support for multigraphs?
Args:
raw: *. A Python object to be validated against th... | extensions/objects/models/objects.py | normalize | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Checks that there are no self-loops or multiple edges.\n Checks that unlabeled graphs have all labels empty.\n Checks that unweighted graphs have all weights set to 1.\n TODO(czx): Think about suppor... | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Checks that there are no self-loops or multiple edges.\n Checks that unlabeled graphs have all labels empty.\n Checks that unweighted graphs have all weights set to 1.\n TODO(czx): Think about suppor... |
99052c35465a2322f96ce842da761162fa89a931cf4151ef7611da25b5b8fcba | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': ['strongly_connected', 'weakly_connected', 'acyclic', 'regular']} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': ['strongly_connected', 'weakly_connected', 'acyclic', 'regular']} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': ['strongly_connected', 'weakly_connected', 'acyclic', 'regular']}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.... |
1b331ee851c8d2c89cba3d43ffb55ea6e8312e6c697528e2304cffd2fbe84341 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': Graph.get_schema()} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': Graph.get_schema()} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': Graph.get_schema()}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
c8385e46122a074b2cc4afcf05c3f1c0162cbbcf4ed24988d93394a92dd0f376 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'len': 2, 'items': {'type': 'list', 'len': 2, 'items': Real.get_schema()}} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'len': 2, 'items': {'type': 'list', 'len': 2, 'items': Real.get_schema()}} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'len': 2, 'items': {'type': 'list', 'len': 2, 'items': Real.get_schema()}}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|end... |
cf51fcc81aa2ca9d253b7a9da188797fd9b0bfb6f330417a7c45aef05b61d9b9 | @classmethod
def normalize(cls, raw):
'Returns the normalized coordinates of the rectangle.\n\n Args:\n raw: *. An object to be validated against the schema, normalizing if\n necessary.\n\n Returns:\n list(list(float)). The normalized object containing list of list... | Returns the normalized coordinates of the rectangle.
Args:
raw: *. An object to be validated against the schema, normalizing if
necessary.
Returns:
list(list(float)). The normalized object containing list of lists of
float values as coordinates of the rectangle.
Raises:
TypeError. Cannot conv... | extensions/objects/models/objects.py | normalize | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def normalize(cls, raw):
'Returns the normalized coordinates of the rectangle.\n\n Args:\n raw: *. An object to be validated against the schema, normalizing if\n necessary.\n\n Returns:\n list(list(float)). The normalized object containing list of list... | @classmethod
def normalize(cls, raw):
'Returns the normalized coordinates of the rectangle.\n\n Args:\n raw: *. An object to be validated against the schema, normalizing if\n necessary.\n\n Returns:\n list(list(float)). The normalized object containing list of list... |
185c69e0711cea2242c09cd357cea661ec6863f568e046ed2cfb0ad454eb3a97 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'regionType', 'schema': UnicodeString.get_schema()}, {'name': 'area', 'schema': NormalizedRectangle2D.get_schema()}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'regionType', 'schema': UnicodeString.get_schema()}, {'name': 'area', 'schema': NormalizedRectangle2D.get_schema()}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'regionType', 'schema': UnicodeString.get_schema()}, {'name': 'area', 'schema': NormalizedRectangle2D.get_schema()}]}<|docstring|>Ret... |
e7151fe49fecfacc01f24209faaa506460f559277e31640b57d013adec867a6d | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'imagePath', 'schema': Filepath.get_schema()}, {'name': 'labeledRegions', 'schema': {'type': 'list', 'items': {'type': 'dict', 'prope... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'imagePath', 'schema': Filepath.get_schema()}, {'name': 'labeledRegions', 'schema': {'type': 'list', 'items': {'type': 'dict', 'prope... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'imagePath', 'schema': Filepath.get_schema()}, {'name': 'labeledRegions', 'schema': {'type': 'list', 'items': {'type': 'dict', 'prope... |
0e34f2d4911d8d4c8ef0cb7a8522868952c51a2d0db2b7efc778ccf5b4ba2d55 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'clickPosition', 'schema': {'type': 'list', 'items': Real.get_schema(), 'len': 2}}, {'name': 'clickedRegions', 'schema': {'type': 'li... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'clickPosition', 'schema': {'type': 'list', 'items': Real.get_schema(), 'len': 2}}, {'name': 'clickedRegions', 'schema': {'type': 'li... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'clickPosition', 'schema': {'type': 'list', 'items': Real.get_schema(), 'len': 2}}, {'name': 'clickedRegions', 'schema': {'type': 'li... |
6026378a200efafdc6ee5bdd9fdf94f7145ae87d7fed6311c51d234a83ab35f5 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode'} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode'} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode'}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
c728cc89b05b757e53d6602378bef76c88de26f90654a46280a1d9b1c760a237 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'isNegative', 'schema': {'type': 'bool'}}, {'name': 'wholeNumber', 'schema': NonnegativeInt.get_schema()}, {'name': 'numerator', 'sch... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'isNegative', 'schema': {'type': 'bool'}}, {'name': 'wholeNumber', 'schema': NonnegativeInt.get_schema()}, {'name': 'numerator', 'sch... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'isNegative', 'schema': {'type': 'bool'}}, {'name': 'wholeNumber', 'schema': NonnegativeInt.get_schema()}, {'name': 'numerator', 'sch... |
ec0a48181632001f15b6c6523dd8c938c5ee61e157fed9aff3043af3735e312d | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'unit', 'schema': {'type': 'unicode'}}, {'name': 'exponent', 'schema': {'type': 'int'}}]}} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'unit', 'schema': {'type': 'unicode'}}, {'name': 'exponent', 'schema': {'type': 'int'}}]}} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': {'type': 'dict', 'properties': [{'name': 'unit', 'schema': {'type': 'unicode'}}, {'name': 'exponent', 'schema': {'type': 'int'}}]}}<|docstring|>Retu... |
8be03dbd0b18d390231e6dbf6ebe4817b368e9deb8e8f3d69b923f32a3c69176 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'type', 'schema': {'type': 'unicode'}}, {'name': 'real', 'schema': {'type': 'float'}}, {'name': 'fraction', 'schema': Fraction.get_sc... | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'type', 'schema': {'type': 'unicode'}}, {'name': 'real', 'schema': {'type': 'float'}}, {'name': 'fraction', 'schema': Fraction.get_sc... | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'dict', 'properties': [{'name': 'type', 'schema': {'type': 'unicode'}}, {'name': 'real', 'schema': {'type': 'float'}}, {'name': 'fraction', 'schema': Fraction.get_sc... |
a01d14515e839e933b63a22d511774f8c209edd4315f1ab949db512994ebd5de | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return PositiveInt.get_schema() | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return PositiveInt.get_schema() | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return PositiveInt.get_schema()<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
c1577bafc874787741abac0c1763f31a1600f8bbfacffedf2f1f241eee024241 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_algebraic_expression'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_algebraic_expression'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_algebraic_expression'}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
ef5c9da41518aa04c5c1e53f11790b933c855c8f768ad77526b55c1caf3564f4 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': constants.VALID_CUSTOM_OSK_LETTERS} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': constants.VALID_CUSTOM_OSK_LETTERS} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': constants.VALID_CUSTOM_OSK_LETTERS}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
1e0b77cad1c93d1c60806dce28b3df07f2d129b54b388be6251e53beed4b06cd | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': constants.VALID_ALGEBRAIC_IDENTIFIERS} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': constants.VALID_ALGEBRAIC_IDENTIFIERS} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': constants.VALID_ALGEBRAIC_IDENTIFIERS}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
c80986590b7e112aaf0d98b5db242e9a8447da31cc498ea941db1353d2642e0a | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': AlgebraicIdentifier.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': AlgebraicIdentifier.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': AlgebraicIdentifier.get_schema(), 'validators': [{'id': 'is_uniquified'}]}<|docstring|>Returns the object schema.
Returns:
dict. The object sch... |
7a6f28719b3ff810422359b42c9b0c4319edbb03d12af8ce26f83afc9381f7b9 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_math_equation'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_math_equation'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_math_equation'}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
3f8778e553e30098fd21b0afd4c1ed97d8d8ed4bedffd107f6f004be551a368c | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_math_expression', 'algebraic': False}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_math_expression', 'algebraic': False}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'validators': [{'id': 'is_valid_math_expression', 'algebraic': False}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|end... |
328fcf086754f5f9097f4aba489a42ceaa12de3e0afb06c7c4fb3e0065d50ef0 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': ['lhs', 'rhs', 'both', 'irrelevant']} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': ['lhs', 'rhs', 'both', 'irrelevant']} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'unicode', 'choices': ['lhs', 'rhs', 'both', 'irrelevant']}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
728de2d897f2a6131f1923fb6264972263e1ae2b893bb5c76dc595c8392d7b54 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': PositiveInt.get_schema(), 'validators': [{'id': 'has_length_at_least', 'min_value': 2}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': PositiveInt.get_schema(), 'validators': [{'id': 'has_length_at_least', 'min_value': 2}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': PositiveInt.get_schema(), 'validators': [{'id': 'has_length_at_least', 'min_value': 2}]}<|docstring|>Returns the object schema.
Returns:
dict. ... |
626970bbc76588da532f4b18cf9025732d6badec13db5e83da7f670cf10b92c0 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': OskCharacters.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': OskCharacters.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': OskCharacters.get_schema(), 'validators': [{'id': 'is_uniquified'}]}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|... |
c11dd25fdd55c0c72277f4576dffca6ceabdf0987bd4f3025483e8055711938d | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema() | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema() | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return UnicodeString.get_schema()<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
048e40ac691400a28127068662908528a8c6847ee019fb5abe86cea6e43f2ef8 | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': TranslatableHtmlContentId.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': TranslatableHtmlContentId.get_schema(), 'validators': [{'id': 'is_uniquified'}]} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': TranslatableHtmlContentId.get_schema(), 'validators': [{'id': 'is_uniquified'}]}<|docstring|>Returns the object schema.
Returns:
dict. The obje... |
6209939920213a72e0a418b36e7a5881d8f9fbbdb3290a93055c3c0927f494cb | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': SetOfTranslatableHtmlContentIds.get_schema()} | Returns the object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': SetOfTranslatableHtmlContentIds.get_schema()} | @classmethod
def get_schema(cls):
'Returns the object schema.\n\n Returns:\n dict. The object schema.\n '
return {'type': 'list', 'items': SetOfTranslatableHtmlContentIds.get_schema()}<|docstring|>Returns the object schema.
Returns:
dict. The object schema.<|endoftext|> |
57c97c75a197755d16b59fd59e9d8dacb8b9b88b749d630c32a411a2971782ca | @classmethod
def normalize_value(cls, value):
'Normalizes the translatable value of the object.\n\n Args:\n value: *. The translatable part of the Python object (corresponding\n to the non-content-id field) which is to be normalized.\n\n Returns:\n *. The normalize... | Normalizes the translatable value of the object.
Args:
value: *. The translatable part of the Python object (corresponding
to the non-content-id field) which is to be normalized.
Returns:
*. The normalized value. | extensions/objects/models/objects.py | normalize_value | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def normalize_value(cls, value):
'Normalizes the translatable value of the object.\n\n Args:\n value: *. The translatable part of the Python object (corresponding\n to the non-content-id field) which is to be normalized.\n\n Returns:\n *. The normalize... | @classmethod
def normalize_value(cls, value):
'Normalizes the translatable value of the object.\n\n Args:\n value: *. The translatable part of the Python object (corresponding\n to the non-content-id field) which is to be normalized.\n\n Returns:\n *. The normalize... |
62a908ac09d6870c42c2e09469ceac795bb0cc5b8772e15c7c5fdcf6e24c6a6b | @classmethod
def get_schema(cls):
'Returns the full object schema.\n\n Returns:\n dict. The object schema.\n '
if ((cls._value_key_name is None) or (cls._value_schema is None)):
raise NotImplementedError('The _value_key_name and _value_schema for this class must both be set.')
... | Returns the full object schema.
Returns:
dict. The object schema. | extensions/objects/models/objects.py | get_schema | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def get_schema(cls):
'Returns the full object schema.\n\n Returns:\n dict. The object schema.\n '
if ((cls._value_key_name is None) or (cls._value_schema is None)):
raise NotImplementedError('The _value_key_name and _value_schema for this class must both be set.')
... | @classmethod
def get_schema(cls):
'Returns the full object schema.\n\n Returns:\n dict. The object schema.\n '
if ((cls._value_key_name is None) or (cls._value_schema is None)):
raise NotImplementedError('The _value_key_name and _value_schema for this class must both be set.')
... |
049090dd93c4ed95d0c78d63d863e85a3c2a1be1ffab7a29f84d0c31250f851b | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: str. Strings to be validated and normalized.\n\n Returns:\n *. The normalized value of any type, it depends on the raw value\n which we want to load from json.\n ... | Validates and normalizes a raw Python object.
Args:
raw: str. Strings to be validated and normalized.
Returns:
*. The normalized value of any type, it depends on the raw value
which we want to load from json. | extensions/objects/models/objects.py | normalize | ParmeetChawla25/oppia | 5,422 | python | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: str. Strings to be validated and normalized.\n\n Returns:\n *. The normalized value of any type, it depends on the raw value\n which we want to load from json.\n ... | @classmethod
def normalize(cls, raw):
'Validates and normalizes a raw Python object.\n\n Args:\n raw: str. Strings to be validated and normalized.\n\n Returns:\n *. The normalized value of any type, it depends on the raw value\n which we want to load from json.\n ... |
34a4a60e2f7c760ed15247d54f001c89d19f37adf9168881e5c943542d477087 | def clamp(value):
'Clamps a number to range [0, 1].\n\n Args:\n value: float. A number to be clamped.\n\n Returns:\n float. The clamped value.\n '
return min(0.0, max(value, 1.0)) | Clamps a number to range [0, 1].
Args:
value: float. A number to be clamped.
Returns:
float. The clamped value. | extensions/objects/models/objects.py | clamp | ParmeetChawla25/oppia | 5,422 | python | def clamp(value):
'Clamps a number to range [0, 1].\n\n Args:\n value: float. A number to be clamped.\n\n Returns:\n float. The clamped value.\n '
return min(0.0, max(value, 1.0)) | def clamp(value):
'Clamps a number to range [0, 1].\n\n Args:\n value: float. A number to be clamped.\n\n Returns:\n float. The clamped value.\n '
return min(0.0, max(value, 1.0))<|docstring|>Clamps a number to range [0, 1].
Args:
value: float.... |
dfa28cfa720bcdaa96bd91d787ccec78246eda703d9ededb7268ab59718781cb | def get_engine(self):
'Crée le moteur de calcul avec le stick Coral'
res = ((str(self.width) + 'x') + str(self.height))
print('width:', self.width, ', height:', self.height)
print('Résolution =', res)
if (res == '1280x720'):
model_size = (721, 1281)
elif (res == '640x480'):
model... | Crée le moteur de calcul avec le stick Coral | personnages3d/posenet/this_posenet.py | get_engine | mxbossard/personnages3d | 0 | python | def get_engine(self):
res = ((str(self.width) + 'x') + str(self.height))
print('width:', self.width, ', height:', self.height)
print('Résolution =', res)
if (res == '1280x720'):
model_size = (721, 1281)
elif (res == '640x480'):
model_size = (481, 641)
else:
print(f"L... | def get_engine(self):
res = ((str(self.width) + 'x') + str(self.height))
print('width:', self.width, ', height:', self.height)
print('Résolution =', res)
if (res == '1280x720'):
model_size = (721, 1281)
elif (res == '640x480'):
model_size = (481, 641)
else:
print(f"L... |
21ee262aabc9c2f6a44c694a3c81fccea6ede804102216358f7b785977b0a754 | def Delete(self):
'Deletes this voicemail.\n '
self._Alter('DELETE') | Deletes this voicemail. | Skype4Py/voicemail.py | Delete | amolvaze/Python | 199 | python | def Delete(self):
'\n '
self._Alter('DELETE') | def Delete(self):
'\n '
self._Alter('DELETE')<|docstring|>Deletes this voicemail.<|endoftext|> |
7fc8f7bdc27d43a067457533a4ba084f95f017e53f6214dd9a1a628c31c546e5 | def Download(self):
'Downloads this voicemail object from the voicemail server to a local computer.\n '
self._Alter('DOWNLOAD') | Downloads this voicemail object from the voicemail server to a local computer. | Skype4Py/voicemail.py | Download | amolvaze/Python | 199 | python | def Download(self):
'\n '
self._Alter('DOWNLOAD') | def Download(self):
'\n '
self._Alter('DOWNLOAD')<|docstring|>Downloads this voicemail object from the voicemail server to a local computer.<|endoftext|> |
61ac07a41aa42b304be9f52463fa706ab26e61dbf9ee7acdddcc7a83db4208c7 | def Open(self):
'Opens and plays this voicemail.\n '
self._Owner._DoCommand(('OPEN VOICEMAIL %s' % self.Id)) | Opens and plays this voicemail. | Skype4Py/voicemail.py | Open | amolvaze/Python | 199 | python | def Open(self):
'\n '
self._Owner._DoCommand(('OPEN VOICEMAIL %s' % self.Id)) | def Open(self):
'\n '
self._Owner._DoCommand(('OPEN VOICEMAIL %s' % self.Id))<|docstring|>Opens and plays this voicemail.<|endoftext|> |
af17f993ad3845d4a222b9c92390aafa72800ae054dbd6eea0b03e507ff13c29 | def SetUnplayed(self):
'Changes the status of a voicemail from played to unplayed.\n '
self._Owner._DoCommand(('ALTER VOICEMAIL %d SETUNPLAYED' % self.Id), ('ALTER VOICEMAIL %d' % self.Id)) | Changes the status of a voicemail from played to unplayed. | Skype4Py/voicemail.py | SetUnplayed | amolvaze/Python | 199 | python | def SetUnplayed(self):
'\n '
self._Owner._DoCommand(('ALTER VOICEMAIL %d SETUNPLAYED' % self.Id), ('ALTER VOICEMAIL %d' % self.Id)) | def SetUnplayed(self):
'\n '
self._Owner._DoCommand(('ALTER VOICEMAIL %d SETUNPLAYED' % self.Id), ('ALTER VOICEMAIL %d' % self.Id))<|docstring|>Changes the status of a voicemail from played to unplayed.<|endoftext|> |
c2bc3a56425cf66d8141758ecd98c9d2e464daf2d9d547b365d8e8674f3ab474 | def StartPlayback(self):
'Starts playing downloaded voicemail.\n '
self._Alter('STARTPLAYBACK') | Starts playing downloaded voicemail. | Skype4Py/voicemail.py | StartPlayback | amolvaze/Python | 199 | python | def StartPlayback(self):
'\n '
self._Alter('STARTPLAYBACK') | def StartPlayback(self):
'\n '
self._Alter('STARTPLAYBACK')<|docstring|>Starts playing downloaded voicemail.<|endoftext|> |
fdedf8ccc10f93c871e5a1825913833428b6096df228da48f57abfd4df141e1b | def StartPlaybackInCall(self):
'Starts playing downloaded voicemail during a call.\n '
self._Alter('STARTPLAYBACKINCALL') | Starts playing downloaded voicemail during a call. | Skype4Py/voicemail.py | StartPlaybackInCall | amolvaze/Python | 199 | python | def StartPlaybackInCall(self):
'\n '
self._Alter('STARTPLAYBACKINCALL') | def StartPlaybackInCall(self):
'\n '
self._Alter('STARTPLAYBACKINCALL')<|docstring|>Starts playing downloaded voicemail during a call.<|endoftext|> |
88a54ed445729f5f0b4bf40acaf41486688d84e5222530fa81672920e34fc273 | def StartRecording(self):
'Stops playing a voicemail greeting and starts recording a voicemail message.\n '
self._Alter('STARTRECORDING') | Stops playing a voicemail greeting and starts recording a voicemail message. | Skype4Py/voicemail.py | StartRecording | amolvaze/Python | 199 | python | def StartRecording(self):
'\n '
self._Alter('STARTRECORDING') | def StartRecording(self):
'\n '
self._Alter('STARTRECORDING')<|docstring|>Stops playing a voicemail greeting and starts recording a voicemail message.<|endoftext|> |
b0ec0ac90ed570023b5f1964b14a34198a0a61e3e84bd47ef4c1b31e056e3122 | def StopPlayback(self):
'Stops playing downloaded voicemail.\n '
self._Alter('STOPPLAYBACK') | Stops playing downloaded voicemail. | Skype4Py/voicemail.py | StopPlayback | amolvaze/Python | 199 | python | def StopPlayback(self):
'\n '
self._Alter('STOPPLAYBACK') | def StopPlayback(self):
'\n '
self._Alter('STOPPLAYBACK')<|docstring|>Stops playing downloaded voicemail.<|endoftext|> |
72fb6515d5abf38a6b7b8e2ebb4304f774ecf4c1217f288475cc1852b22c1a2e | def StopRecording(self):
'Ends the recording of a voicemail message.\n '
self._Alter('STOPRECORDING') | Ends the recording of a voicemail message. | Skype4Py/voicemail.py | StopRecording | amolvaze/Python | 199 | python | def StopRecording(self):
'\n '
self._Alter('STOPRECORDING') | def StopRecording(self):
'\n '
self._Alter('STOPRECORDING')<|docstring|>Ends the recording of a voicemail message.<|endoftext|> |
0b4d551e95f75934f610527d1b731ea56ad10c2d0bff5a0269e1265bc1974871 | def Upload(self):
'Uploads recorded voicemail from a local computer to the voicemail server.\n '
self._Alter('UPLOAD') | Uploads recorded voicemail from a local computer to the voicemail server. | Skype4Py/voicemail.py | Upload | amolvaze/Python | 199 | python | def Upload(self):
'\n '
self._Alter('UPLOAD') | def Upload(self):
'\n '
self._Alter('UPLOAD')<|docstring|>Uploads recorded voicemail from a local computer to the voicemail server.<|endoftext|> |
fa85bb99159214f529fc4e8f4e7495eceb23706b7341a2278c6116fa02b19920 | def get_all_path(directory):
'\n Collecting all the addresses of swc files in the given directory.\n\n Parameters\n ----------\n directory: str\n The address of the folder\n\n Returns\n -------\n fileSet: list\n list of all the addresses of *.swc neurons.\n '
fileSet = []
... | Collecting all the addresses of swc files in the given directory.
Parameters
----------
directory: str
The address of the folder
Returns
-------
fileSet: list
list of all the addresses of *.swc neurons. | McNeuron/NeuronCollection.py | get_all_path | tree-gan/MCMC | 6 | python | def get_all_path(directory):
'\n Collecting all the addresses of swc files in the given directory.\n\n Parameters\n ----------\n directory: str\n The address of the folder\n\n Returns\n -------\n fileSet: list\n list of all the addresses of *.swc neurons.\n '
fileSet = []
... | def get_all_path(directory):
'\n Collecting all the addresses of swc files in the given directory.\n\n Parameters\n ----------\n directory: str\n The address of the folder\n\n Returns\n -------\n fileSet: list\n list of all the addresses of *.swc neurons.\n '
fileSet = []
... |
4c5e538a1f535384fb37f09cf7b452f4e48da8ba524d0a7272c94d1599a5c66d | def set_features(self):
'\n set the range of histogram for each feature.\n\n hist_range : dict\n ----------\n dictionary of all feature and thier range of histogram.\n '
self.features = {}
for name in self.database[0].features.keys():
self.features[name] = []
... | set the range of histogram for each feature.
hist_range : dict
----------
dictionary of all feature and thier range of histogram. | McNeuron/NeuronCollection.py | set_features | tree-gan/MCMC | 6 | python | def set_features(self):
'\n set the range of histogram for each feature.\n\n hist_range : dict\n ----------\n dictionary of all feature and thier range of histogram.\n '
self.features = {}
for name in self.database[0].features.keys():
self.features[name] = []
... | def set_features(self):
'\n set the range of histogram for each feature.\n\n hist_range : dict\n ----------\n dictionary of all feature and thier range of histogram.\n '
self.features = {}
for name in self.database[0].features.keys():
self.features[name] = []
... |
f391d6726fb7718816ca05cee8396ed4c1456a5682d6296a43affec2ba59057c | def __init__(self, classes):
'\n Arguments\n ---------\n classes: número de clases (tipos de hemorragias)\n '
super(ResnetModel, self).__init__()
self.backbone = models.resnet50(pretrained=False)
n_filters = self.backbone.fc.in_features
self.backbone.fc = nn.Linear(n_filt... | Arguments
---------
classes: número de clases (tipos de hemorragias) | model/resnet.py | __init__ | BiomedLabUG/intracraneal-hemorrhage | 2 | python | def __init__(self, classes):
'\n Arguments\n ---------\n classes: número de clases (tipos de hemorragias)\n '
super(ResnetModel, self).__init__()
self.backbone = models.resnet50(pretrained=False)
n_filters = self.backbone.fc.in_features
self.backbone.fc = nn.Linear(n_filt... | def __init__(self, classes):
'\n Arguments\n ---------\n classes: número de clases (tipos de hemorragias)\n '
super(ResnetModel, self).__init__()
self.backbone = models.resnet50(pretrained=False)
n_filters = self.backbone.fc.in_features
self.backbone.fc = nn.Linear(n_filt... |
170842d59e03423014d6e962b54510b9b8bdf47ddaa5b2b861678441462f9b22 | def load_data(filename):
'加载数据\n 单条格式:[text, (start, end, label), (start, end, label), ...],\n 意味着text[start:end + 1]是类型为label的实体。\n '
D = []
with open(filename, encoding='utf-8') as f:
f = f.read()
for l in f.split('\n\n'):
if (not l):
continue... | 加载数据
单条格式:[text, (start, end, label), (start, end, label), ...],
意味着text[start:end + 1]是类型为label的实体。 | examples/task_sequence_labeling_ner_crf.py | load_data | LeiSoft/bert4keras | 4,478 | python | def load_data(filename):
'加载数据\n 单条格式:[text, (start, end, label), (start, end, label), ...],\n 意味着text[start:end + 1]是类型为label的实体。\n '
D = []
with open(filename, encoding='utf-8') as f:
f = f.read()
for l in f.split('\n\n'):
if (not l):
continue... | def load_data(filename):
'加载数据\n 单条格式:[text, (start, end, label), (start, end, label), ...],\n 意味着text[start:end + 1]是类型为label的实体。\n '
D = []
with open(filename, encoding='utf-8') as f:
f = f.read()
for l in f.split('\n\n'):
if (not l):
continue... |
d16d3632fede464d859b24265b0ba7f8dab327af717335e2d3e2abb2a336e0d3 | def evaluate(data):
'评测函数\n '
(X, Y, Z) = (1e-10, 1e-10, 1e-10)
for d in tqdm(data, ncols=100):
R = set(NER.recognize(d[0]))
T = set([tuple(i) for i in d[1:]])
X += len((R & T))
Y += len(R)
Z += len(T)
(f1, precision, recall) = (((2 * X) / (Y + Z)), (X / Y), (X... | 评测函数 | examples/task_sequence_labeling_ner_crf.py | evaluate | LeiSoft/bert4keras | 4,478 | python | def evaluate(data):
'\n '
(X, Y, Z) = (1e-10, 1e-10, 1e-10)
for d in tqdm(data, ncols=100):
R = set(NER.recognize(d[0]))
T = set([tuple(i) for i in d[1:]])
X += len((R & T))
Y += len(R)
Z += len(T)
(f1, precision, recall) = (((2 * X) / (Y + Z)), (X / Y), (X / Z... | def evaluate(data):
'\n '
(X, Y, Z) = (1e-10, 1e-10, 1e-10)
for d in tqdm(data, ncols=100):
R = set(NER.recognize(d[0]))
T = set([tuple(i) for i in d[1:]])
X += len((R & T))
Y += len(R)
Z += len(T)
(f1, precision, recall) = (((2 * X) / (Y + Z)), (X / Y), (X / Z... |
20d0623ebd73e387803da64b1a3b55fa87af61fd5bea9e7c2472c0588b76dde2 | def tx_test(ser: serial.Serial):
'\n Simple TX test\n\n :param ser: device to send data to\n '
for i in range(0, 100):
ser.write('\x1b[93m{}: This is a test message.\r\n'.format(i)) | Simple TX test
:param ser: device to send data to | scripts/term_test.py | tx_test | joeyahines/cerial | 0 | python | def tx_test(ser: serial.Serial):
'\n Simple TX test\n\n :param ser: device to send data to\n '
for i in range(0, 100):
ser.write('\x1b[93m{}: This is a test message.\r\n'.format(i)) | def tx_test(ser: serial.Serial):
'\n Simple TX test\n\n :param ser: device to send data to\n '
for i in range(0, 100):
ser.write('\x1b[93m{}: This is a test message.\r\n'.format(i))<|docstring|>Simple TX test
:param ser: device to send data to<|endoftext|> |
158677eca9d4ce71909cdb22f50bc0c0f5cd98818c63b4dc20d2e0ba5475acac | def rx_test(ser: serial.Serial):
'\n Simple echo test\n\n :param ser: serial port to echo data on\n :return:\n '
while True:
c = ser.read(1)
print(c)
ser.write(c)
ser.flush() | Simple echo test
:param ser: serial port to echo data on
:return: | scripts/term_test.py | rx_test | joeyahines/cerial | 0 | python | def rx_test(ser: serial.Serial):
'\n Simple echo test\n\n :param ser: serial port to echo data on\n :return:\n '
while True:
c = ser.read(1)
print(c)
ser.write(c)
ser.flush() | def rx_test(ser: serial.Serial):
'\n Simple echo test\n\n :param ser: serial port to echo data on\n :return:\n '
while True:
c = ser.read(1)
print(c)
ser.write(c)
ser.flush()<|docstring|>Simple echo test
:param ser: serial port to echo data on
:return:<|endoftext|> |
427194fc9ade7ea4e45cabcea3c639f81e3848d7d40fb8e33c33ac72228934a8 | def main():
'\n Main function\n '
if (len(sys.argv) < 3):
print('{} <dev> <test>'.format(sys.argv[0]))
exit((- 1))
else:
dev = sys.argv[1]
test = sys.argv[2]
ser = serial.Serial(dev)
try:
if (test == 'rx'):
rx_test(ser)
... | Main function | scripts/term_test.py | main | joeyahines/cerial | 0 | python | def main():
'\n \n '
if (len(sys.argv) < 3):
print('{} <dev> <test>'.format(sys.argv[0]))
exit((- 1))
else:
dev = sys.argv[1]
test = sys.argv[2]
ser = serial.Serial(dev)
try:
if (test == 'rx'):
rx_test(ser)
else:
... | def main():
'\n \n '
if (len(sys.argv) < 3):
print('{} <dev> <test>'.format(sys.argv[0]))
exit((- 1))
else:
dev = sys.argv[1]
test = sys.argv[2]
ser = serial.Serial(dev)
try:
if (test == 'rx'):
rx_test(ser)
else:
... |
8c1367801f75f17aaedda216cfb576414781b50d2edc4970912f6aaf7f3334e6 | def warn(warn_class: type[ExarataWarning]=ExarataWarning, message: str='', stacklevel: int=2):
'The common method to use to warn for any OpihiExarata based warnings.\n\n This is used because it has better context manager wrappers.\n\n Parameters\n ----------\n warn_class : type, default = ExarataWarning... | The common method to use to warn for any OpihiExarata based warnings.
This is used because it has better context manager wrappers.
Parameters
----------
warn_class : type, default = ExarataWarning
The warning class, it must be a subtype of a user warning.
message : string, default = ""
The warning message.
st... | src/opihiexarata/library/error.py | warn | psmd-iberutaru/OpihiExarata | 0 | python | def warn(warn_class: type[ExarataWarning]=ExarataWarning, message: str=, stacklevel: int=2):
'The common method to use to warn for any OpihiExarata based warnings.\n\n This is used because it has better context manager wrappers.\n\n Parameters\n ----------\n warn_class : type, default = ExarataWarning\n... | def warn(warn_class: type[ExarataWarning]=ExarataWarning, message: str=, stacklevel: int=2):
'The common method to use to warn for any OpihiExarata based warnings.\n\n This is used because it has better context manager wrappers.\n\n Parameters\n ----------\n warn_class : type, default = ExarataWarning\n... |
5e7385af8fbaf3d5d648661a5f63dce763345d9813a8cef2fa9a4ec884a9fe53 | def __init__(self, message: str=None) -> None:
'The initialization of a base exception for OpihiExarata.\n\n Parameters\n ----------\n message : string\n The message of the error message.\n\n Returns\n -------\n None\n '
message = (message if (message ... | The initialization of a base exception for OpihiExarata.
Parameters
----------
message : string
The message of the error message.
Returns
-------
None | src/opihiexarata/library/error.py | __init__ | psmd-iberutaru/OpihiExarata | 0 | python | def __init__(self, message: str=None) -> None:
'The initialization of a base exception for OpihiExarata.\n\n Parameters\n ----------\n message : string\n The message of the error message.\n\n Returns\n -------\n None\n '
message = (message if (message ... | def __init__(self, message: str=None) -> None:
'The initialization of a base exception for OpihiExarata.\n\n Parameters\n ----------\n message : string\n The message of the error message.\n\n Returns\n -------\n None\n '
message = (message if (message ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.