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
17d739dbbe8728fb06c24aad2d1d32bee5060406583af13f2e3fa0b39ba7ecea
@crprofileset.command(name='verify_url', pass_context=True) async def crprofileset_verify_url(self, ctx, url): 'Set player verification endpoint' self.model.verify_url = url (await self.bot.say('Verification URL updated.')) (await self.bot.delete_message(ctx.message))
Set player verification endpoint
crprofile/crprofile.py
crprofileset_verify_url
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='verify_url', pass_context=True) async def crprofileset_verify_url(self, ctx, url): self.model.verify_url = url (await self.bot.say('Verification URL updated.')) (await self.bot.delete_message(ctx.message))
@crprofileset.command(name='verify_url', pass_context=True) async def crprofileset_verify_url(self, ctx, url): self.model.verify_url = url (await self.bot.say('Verification URL updated.')) (await self.bot.delete_message(ctx.message))<|docstring|>Set player verification endpoint<|endoftext|>
c71772f86032381cc9d3d26b2ac1cdb4f3e50773979b05f7a23a0a2f6f3b3365
@crprofileset.command(name='auth', pass_context=True) async def crprofileset_auth(self, ctx, token): 'Set auth header' self.model.auth = token (await self.bot.say('Auth updated.')) (await self.bot.delete_message(ctx.message))
Set auth header
crprofile/crprofile.py
crprofileset_auth
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='auth', pass_context=True) async def crprofileset_auth(self, ctx, token): self.model.auth = token (await self.bot.say('Auth updated.')) (await self.bot.delete_message(ctx.message))
@crprofileset.command(name='auth', pass_context=True) async def crprofileset_auth(self, ctx, token): self.model.auth = token (await self.bot.say('Auth updated.')) (await self.bot.delete_message(ctx.message))<|docstring|>Set auth header<|endoftext|>
a391ebc29b0aae59da9652089beec45936eeae7bdde6be1a3207d7c051e0aff9
@crprofileset.command(name='official_auth', pass_context=True) async def crprofileset_official_auth(self, ctx, token): 'Set auth header' self.model.official_auth = token (await self.bot.say('Auth updated.')) (await self.bot.delete_message(ctx.message))
Set auth header
crprofile/crprofile.py
crprofileset_official_auth
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='official_auth', pass_context=True) async def crprofileset_official_auth(self, ctx, token): self.model.official_auth = token (await self.bot.say('Auth updated.')) (await self.bot.delete_message(ctx.message))
@crprofileset.command(name='official_auth', pass_context=True) async def crprofileset_official_auth(self, ctx, token): self.model.official_auth = token (await self.bot.say('Auth updated.')) (await self.bot.delete_message(ctx.message))<|docstring|>Set auth header<|endoftext|>
86971ccf05a0398bddc91461b2dcf40d61c4d6ca85f8625a7ca2a5535b8bdb9c
@crprofileset.command(name='initserver', pass_context=True) async def crprofileset_initserver(self, ctx): 'Init CR Profile: server settings.' server = ctx.message.server self.model.init_server(server) (await self.bot.say('Server settings initialized.'))
Init CR Profile: server settings.
crprofile/crprofile.py
crprofileset_initserver
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='initserver', pass_context=True) async def crprofileset_initserver(self, ctx): server = ctx.message.server self.model.init_server(server) (await self.bot.say('Server settings initialized.'))
@crprofileset.command(name='initserver', pass_context=True) async def crprofileset_initserver(self, ctx): server = ctx.message.server self.model.init_server(server) (await self.bot.say('Server settings initialized.'))<|docstring|>Init CR Profile: server settings.<|endoftext|>
60f239d586f55da8508e28fca1af5bc704af1aab7a21600ce0710ee81554a0fe
@crprofileset.command(name='initplayers', pass_context=True) async def crprofileset_initplayers(self, ctx): 'Init CR Profile: players settings.' server = ctx.message.server self.model.init_players(server) (await self.bot.say('Clan settings initialized.'))
Init CR Profile: players settings.
crprofile/crprofile.py
crprofileset_initplayers
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='initplayers', pass_context=True) async def crprofileset_initplayers(self, ctx): server = ctx.message.server self.model.init_players(server) (await self.bot.say('Clan settings initialized.'))
@crprofileset.command(name='initplayers', pass_context=True) async def crprofileset_initplayers(self, ctx): server = ctx.message.server self.model.init_players(server) (await self.bot.say('Clan settings initialized.'))<|docstring|>Init CR Profile: players settings.<|endoftext|>
c3e0f632d0ddfff7f762f5408acf5a908bd96660dd74ad501b3dafcf46931851
@crprofileset.command(name='badgeurl', pass_context=True) async def crprofileset_badgeurl(self, ctx, url): 'badge URL base.\n\n Format:\n If path is hhttp://domain.com/path/LQQ\n Enter http://domain.com/path/\n ' self.model.badge_url = url (await self.bot.say('Badge URL updated.'...
badge URL base. Format: If path is hhttp://domain.com/path/LQQ Enter http://domain.com/path/
crprofile/crprofile.py
crprofileset_badgeurl
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='badgeurl', pass_context=True) async def crprofileset_badgeurl(self, ctx, url): 'badge URL base.\n\n Format:\n If path is hhttp://domain.com/path/LQQ\n Enter http://domain.com/path/\n ' self.model.badge_url = url (await self.bot.say('Badge URL updated.'...
@crprofileset.command(name='badgeurl', pass_context=True) async def crprofileset_badgeurl(self, ctx, url): 'badge URL base.\n\n Format:\n If path is hhttp://domain.com/path/LQQ\n Enter http://domain.com/path/\n ' self.model.badge_url = url (await self.bot.say('Badge URL updated.'...
4b98e76512518c1b3057c3edeeb546477fd5231793e6e73cc03e752fe07fc650
@crprofileset.command(name='apitoken', pass_context=True) async def crprofileset_apiauth(self, ctx, token): 'API Authentication token.' self.model.profile_api_token = token (await self.bot.say('API token saved.'))
API Authentication token.
crprofile/crprofile.py
crprofileset_apiauth
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='apitoken', pass_context=True) async def crprofileset_apiauth(self, ctx, token): self.model.profile_api_token = token (await self.bot.say('API token saved.'))
@crprofileset.command(name='apitoken', pass_context=True) async def crprofileset_apiauth(self, ctx, token): self.model.profile_api_token = token (await self.bot.say('API token saved.'))<|docstring|>API Authentication token.<|endoftext|>
4bbc19232e68a55af4a01b248db7f04cab94fb900e00494db8f190c37956b734
@crprofileset.command(name='api_provider', pass_context=True) async def crprofileset_api_provider(self, ctx, value): 'API Provider.\n\n Accepted values:\n cr-api\n official\n ' if ((value == 'cr-api') or (value == 'official')): self.model.api_provider = value (await s...
API Provider. Accepted values: cr-api official
crprofile/crprofile.py
crprofileset_api_provider
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='api_provider', pass_context=True) async def crprofileset_api_provider(self, ctx, value): 'API Provider.\n\n Accepted values:\n cr-api\n official\n ' if ((value == 'cr-api') or (value == 'official')): self.model.api_provider = value (await s...
@crprofileset.command(name='api_provider', pass_context=True) async def crprofileset_api_provider(self, ctx, value): 'API Provider.\n\n Accepted values:\n cr-api\n official\n ' if ((value == 'cr-api') or (value == 'official')): self.model.api_provider = value (await s...
a8aa16fac31020a284773c96e42d1ebf1b26a0510c811c8fc7a86bfe7d59477f
@crprofileset.command(name='rmmembertag', pass_context=True) async def crprofileset_rm_member_tag(self, ctx, member: discord.Member): 'Remove player tag of a user.' server = ctx.message.server self.model.rm_player_tag(server, member=member) (await self.bot.say('Removed player tag for {}'.format(member))...
Remove player tag of a user.
crprofile/crprofile.py
crprofileset_rm_member_tag
zodpixel/SML-Cogs
17
python
@crprofileset.command(name='rmmembertag', pass_context=True) async def crprofileset_rm_member_tag(self, ctx, member: discord.Member): server = ctx.message.server self.model.rm_player_tag(server, member=member) (await self.bot.say('Removed player tag for {}'.format(member)))
@crprofileset.command(name='rmmembertag', pass_context=True) async def crprofileset_rm_member_tag(self, ctx, member: discord.Member): server = ctx.message.server self.model.rm_player_tag(server, member=member) (await self.bot.say('Removed player tag for {}'.format(member)))<|docstring|>Remove player ta...
e5ffb64fdae9d0de8e516b7223b9fe3026576e2ef7fc98834c2fe37c24d0c145
@checks.mod_or_permissions() @crprofileset.command(name='rmtag', pass_context=True) async def crprofileset_rm_tag(self, ctx, tag): 'Remove player tag of a user.' server = ctx.message.server self.model.rm_player_tag(server, tag=tag) (await self.bot.say('Removed player tag {} from associated member'.forma...
Remove player tag of a user.
crprofile/crprofile.py
crprofileset_rm_tag
zodpixel/SML-Cogs
17
python
@checks.mod_or_permissions() @crprofileset.command(name='rmtag', pass_context=True) async def crprofileset_rm_tag(self, ctx, tag): server = ctx.message.server self.model.rm_player_tag(server, tag=tag) (await self.bot.say('Removed player tag {} from associated member'.format(tag)))
@checks.mod_or_permissions() @crprofileset.command(name='rmtag', pass_context=True) async def crprofileset_rm_tag(self, ctx, tag): server = ctx.message.server self.model.rm_player_tag(server, tag=tag) (await self.bot.say('Removed player tag {} from associated member'.format(tag)))<|docstring|>Remove pl...
12814ec72dd281090bc7ad509a97ec3ee2881f34cf6415a9da283a7aa6520a3a
@commands.group(pass_context=True, no_pm=True) async def crprofile(self, ctx): 'Clash Royale Player Profile.' if (self.model.auth is None): (await self.bot.say('You must have a cr-api.com developer key to run this command. Please visit http://docs.cr-api.com/#/authentication to learn how to obtain one, ...
Clash Royale Player Profile.
crprofile/crprofile.py
crprofile
zodpixel/SML-Cogs
17
python
@commands.group(pass_context=True, no_pm=True) async def crprofile(self, ctx): if (self.model.auth is None): (await self.bot.say('You must have a cr-api.com developer key to run this command. Please visit http://docs.cr-api.com/#/authentication to learn how to obtain one, then run `!crprofileset auth i...
@commands.group(pass_context=True, no_pm=True) async def crprofile(self, ctx): if (self.model.auth is None): (await self.bot.say('You must have a cr-api.com developer key to run this command. Please visit http://docs.cr-api.com/#/authentication to learn how to obtain one, then run `!crprofileset auth i...
d27cacd0865413498a9d5df45120d5bee702b1dc94e0894f5c4bd1b81c6c4690
@crprofile.command(name='settag', pass_context=True, no_pm=True) async def crprofile_settag(self, ctx, playertag, member: discord.Member=None): 'Set playertag to discord member.\n\n Setting tag for yourself:\n !crprofile settag C0G20PR2\n\n Setting tag for others (requires Bot Commander role):\...
Set playertag to discord member. Setting tag for yourself: !crprofile settag C0G20PR2 Setting tag for others (requires Bot Commander role): !crprofile settag C0G20PR2 SML !crprofile settag C0G20PR2 @SML !crprofile settag C0G20PR2 @SML#6443
crprofile/crprofile.py
crprofile_settag
zodpixel/SML-Cogs
17
python
@crprofile.command(name='settag', pass_context=True, no_pm=True) async def crprofile_settag(self, ctx, playertag, member: discord.Member=None): 'Set playertag to discord member.\n\n Setting tag for yourself:\n !crprofile settag C0G20PR2\n\n Setting tag for others (requires Bot Commander role):\...
@crprofile.command(name='settag', pass_context=True, no_pm=True) async def crprofile_settag(self, ctx, playertag, member: discord.Member=None): 'Set playertag to discord member.\n\n Setting tag for yourself:\n !crprofile settag C0G20PR2\n\n Setting tag for others (requires Bot Commander role):\...
11c0d0981681c84872230169e98ab76a1e1ea664d16df67b7691be828c87e9e7
@crprofile.command(name='gettag', pass_context=True, no_pm=True) async def crprofile_gettag(self, ctx, member: discord.Member=None): 'Get playertag from Discord member.' server = ctx.message.server author = ctx.message.author if (member is None): member = author tag = (await self.model.membe...
Get playertag from Discord member.
crprofile/crprofile.py
crprofile_gettag
zodpixel/SML-Cogs
17
python
@crprofile.command(name='gettag', pass_context=True, no_pm=True) async def crprofile_gettag(self, ctx, member: discord.Member=None): server = ctx.message.server author = ctx.message.author if (member is None): member = author tag = (await self.model.member2tag(server, member)) if (tag i...
@crprofile.command(name='gettag', pass_context=True, no_pm=True) async def crprofile_gettag(self, ctx, member: discord.Member=None): server = ctx.message.server author = ctx.message.author if (member is None): member = author tag = (await self.model.member2tag(server, member)) if (tag i...
77490a0440a6cf932bccae82476a03820475fd9dd28e89c846dfd053fafe11c9
@crprofile.command(name='tag', pass_context=True, no_pm=True) async def crprofile_tag(self, ctx, tag): 'Player profile by tag\n\n Display player info\n ' (await self.bot.type()) sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_error_msg)) return ...
Player profile by tag Display player info
crprofile/crprofile.py
crprofile_tag
zodpixel/SML-Cogs
17
python
@crprofile.command(name='tag', pass_context=True, no_pm=True) async def crprofile_tag(self, ctx, tag): 'Player profile by tag\n\n Display player info\n ' (await self.bot.type()) sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_error_msg)) return ...
@crprofile.command(name='tag', pass_context=True, no_pm=True) async def crprofile_tag(self, ctx, tag): 'Player profile by tag\n\n Display player info\n ' (await self.bot.type()) sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_error_msg)) return ...
c413b38892e0085628b4f5b5414850c8b083591ab8a9903671ad75f4dc2f9563
async def get_profile(self, ctx, member: discord.Member=None, **kwargs): 'Logic for profile' (await self.bot.type()) author = ctx.message.author server = ctx.message.server if (member is None): member = author tag = (await self.model.member2tag(server, member)) if (tag is None): ...
Logic for profile
crprofile/crprofile.py
get_profile
zodpixel/SML-Cogs
17
python
async def get_profile(self, ctx, member: discord.Member=None, **kwargs): (await self.bot.type()) author = ctx.message.author server = ctx.message.server if (member is None): member = author tag = (await self.model.member2tag(server, member)) if (tag is None): (await self.bot...
async def get_profile(self, ctx, member: discord.Member=None, **kwargs): (await self.bot.type()) author = ctx.message.author server = ctx.message.server if (member is None): member = author tag = (await self.model.member2tag(server, member)) if (tag is None): (await self.bot...
b444a0989c36550efeb363aa064d222974fe1d6e58355a607334ffaec34e41c9
@crprofile.command(name='get', pass_context=True, no_pm=True) async def crprofile_get(self, ctx, member: discord.Member=None): 'Player profile\n\n if member is not entered, retrieve own profile\n ' try: (await self.get_profile(ctx, member, sections=['overview', 'stats'])) except APIErr...
Player profile if member is not entered, retrieve own profile
crprofile/crprofile.py
crprofile_get
zodpixel/SML-Cogs
17
python
@crprofile.command(name='get', pass_context=True, no_pm=True) async def crprofile_get(self, ctx, member: discord.Member=None): 'Player profile\n\n if member is not entered, retrieve own profile\n ' try: (await self.get_profile(ctx, member, sections=['overview', 'stats'])) except APIErr...
@crprofile.command(name='get', pass_context=True, no_pm=True) async def crprofile_get(self, ctx, member: discord.Member=None): 'Player profile\n\n if member is not entered, retrieve own profile\n ' try: (await self.get_profile(ctx, member, sections=['overview', 'stats'])) except APIErr...
940ee8528da20413fd57725e095bc3c8f5ca117cc457ce0d0752a877aa18ee45
@crprofile.command(name='cards', pass_context=True, no_pm=True) async def crprofile_cards(self, ctx, member: discord.Member=None): 'Card collection.' try: (await self.get_profile(ctx, member, sections=['cards'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format...
Card collection.
crprofile/crprofile.py
crprofile_cards
zodpixel/SML-Cogs
17
python
@crprofile.command(name='cards', pass_context=True, no_pm=True) async def crprofile_cards(self, ctx, member: discord.Member=None): try: (await self.get_profile(ctx, member, sections=['cards'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.status, ...
@crprofile.command(name='cards', pass_context=True, no_pm=True) async def crprofile_cards(self, ctx, member: discord.Member=None): try: (await self.get_profile(ctx, member, sections=['cards'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.status, ...
74a3ba387580ace7487d20b4659928eba14c0b75bea1692aae4e8ba452667067
@crprofile.command(name='trade', pass_context=True, no_pm=True) async def crprofile_trade(self, ctx, member: discord.Member=None): 'Tradeable cards.' try: (await self.get_profile(ctx, member, sections=['trade'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format...
Tradeable cards.
crprofile/crprofile.py
crprofile_trade
zodpixel/SML-Cogs
17
python
@crprofile.command(name='trade', pass_context=True, no_pm=True) async def crprofile_trade(self, ctx, member: discord.Member=None): try: (await self.get_profile(ctx, member, sections=['trade'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.status, ...
@crprofile.command(name='trade', pass_context=True, no_pm=True) async def crprofile_trade(self, ctx, member: discord.Member=None): try: (await self.get_profile(ctx, member, sections=['trade'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.status, ...
a3fe98d114cc72860be71b50b3f5c1fe95a235463d672191fda79439ad8ba2f4
@crprofile.command(name='tradetag', pass_context=True, no_pm=True) async def crprofile_tradetag(self, ctx, tag): 'Tradeable cards by tag.' tag = clean_tag(tag) try: (await self.display_profile(ctx, tag, sections=['trade'])) except APIError as e: (await self.bot.say('API Error {status} {m...
Tradeable cards by tag.
crprofile/crprofile.py
crprofile_tradetag
zodpixel/SML-Cogs
17
python
@crprofile.command(name='tradetag', pass_context=True, no_pm=True) async def crprofile_tradetag(self, ctx, tag): tag = clean_tag(tag) try: (await self.display_profile(ctx, tag, sections=['trade'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e....
@crprofile.command(name='tradetag', pass_context=True, no_pm=True) async def crprofile_tradetag(self, ctx, tag): tag = clean_tag(tag) try: (await self.display_profile(ctx, tag, sections=['trade'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e....
8f8f3c34f7fa7be9fc85af3af7351176d54aff203618c637f6e5ced05ea1d39a
@crprofile.command(name='chests', pass_context=True, no_pm=True) async def crprofile_chests(self, ctx, member: discord.Member=None): 'Upcoming chests.' try: (await self.get_profile(ctx, member, sections=['chests'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.for...
Upcoming chests.
crprofile/crprofile.py
crprofile_chests
zodpixel/SML-Cogs
17
python
@crprofile.command(name='chests', pass_context=True, no_pm=True) async def crprofile_chests(self, ctx, member: discord.Member=None): try: (await self.get_profile(ctx, member, sections=['chests'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.statu...
@crprofile.command(name='chests', pass_context=True, no_pm=True) async def crprofile_chests(self, ctx, member: discord.Member=None): try: (await self.get_profile(ctx, member, sections=['chests'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.statu...
fe8a601d218fe97a1d75c84a66fbb8a6bcd00c974b90636751e010f15d30ee45
@crprofile.command(name='deck', pass_context=True, no_pm=True) async def crprofile_deck(self, ctx, member: discord.Member=None): 'Current deck.' try: (await self.get_profile(ctx, member, sections=['deck'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(statu...
Current deck.
crprofile/crprofile.py
crprofile_deck
zodpixel/SML-Cogs
17
python
@crprofile.command(name='deck', pass_context=True, no_pm=True) async def crprofile_deck(self, ctx, member: discord.Member=None): try: (await self.get_profile(ctx, member, sections=['deck'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.status, mes...
@crprofile.command(name='deck', pass_context=True, no_pm=True) async def crprofile_deck(self, ctx, member: discord.Member=None): try: (await self.get_profile(ctx, member, sections=['deck'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.status, mes...
c1574c30be111726e331c01c0b9f4e707e209d3ac02fb29c77070a7220e41574
@crprofile.command(name='tagdeck', pass_context=True, no_pm=True) async def crprofile_tagdeck(self, ctx, tag): 'Current deck of player tag.' try: (await self.display_profile(ctx, tag, sections=['deck'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e...
Current deck of player tag.
crprofile/crprofile.py
crprofile_tagdeck
zodpixel/SML-Cogs
17
python
@crprofile.command(name='tagdeck', pass_context=True, no_pm=True) async def crprofile_tagdeck(self, ctx, tag): try: (await self.display_profile(ctx, tag, sections=['deck'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.status, message=e.message)))
@crprofile.command(name='tagdeck', pass_context=True, no_pm=True) async def crprofile_tagdeck(self, ctx, tag): try: (await self.display_profile(ctx, tag, sections=['deck'])) except APIError as e: (await self.bot.say('API Error {status} {message}'.format(status=e.status, message=e.message)))...
a2435975d09dc196b33849f9725888a5d8e6c6835facb44b85ea1f56a4ee111e
@crprofile.command(name='mini', pass_context=True, no_pm=True) async def crprofile_mini(self, ctx, member: discord.Member=None): 'Player profile\n\n if member is not entered, retrieve own profile\n ' try: (await self.get_profile(ctx, member, sections=['overview'])) except APIError as e...
Player profile if member is not entered, retrieve own profile
crprofile/crprofile.py
crprofile_mini
zodpixel/SML-Cogs
17
python
@crprofile.command(name='mini', pass_context=True, no_pm=True) async def crprofile_mini(self, ctx, member: discord.Member=None): 'Player profile\n\n if member is not entered, retrieve own profile\n ' try: (await self.get_profile(ctx, member, sections=['overview'])) except APIError as e...
@crprofile.command(name='mini', pass_context=True, no_pm=True) async def crprofile_mini(self, ctx, member: discord.Member=None): 'Player profile\n\n if member is not entered, retrieve own profile\n ' try: (await self.get_profile(ctx, member, sections=['overview'])) except APIError as e...
3feb0c6392176d9d847a270a99debe87d3d4321f70908a3974b02f0bdc86a4d6
@crprofile.command(name='minitag', pass_context=True, no_pm=True) async def crprofile_mini(self, ctx, tag): 'Player profile\n\n if member is not entered, retrieve own profile\n ' (await self.bot.type()) sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_erro...
Player profile if member is not entered, retrieve own profile
crprofile/crprofile.py
crprofile_mini
zodpixel/SML-Cogs
17
python
@crprofile.command(name='minitag', pass_context=True, no_pm=True) async def crprofile_mini(self, ctx, tag): 'Player profile\n\n if member is not entered, retrieve own profile\n ' (await self.bot.type()) sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_erro...
@crprofile.command(name='minitag', pass_context=True, no_pm=True) async def crprofile_mini(self, ctx, tag): 'Player profile\n\n if member is not entered, retrieve own profile\n ' (await self.bot.type()) sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_erro...
086ab6ad0a344e6ce38dbf67cbe2b8d70a27d7fceb4e46e5107241a43a9e2bd0
async def display_profile(self, ctx, tag, **kwargs): 'Display profile.' sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_error_msg)) return try: player_data = (await self.model.player_data(sctag.tag)) except json.decoder.JSONDecodeError: play...
Display profile.
crprofile/crprofile.py
display_profile
zodpixel/SML-Cogs
17
python
async def display_profile(self, ctx, tag, **kwargs): sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_error_msg)) return try: player_data = (await self.model.player_data(sctag.tag)) except json.decoder.JSONDecodeError: player_data = self.mod...
async def display_profile(self, ctx, tag, **kwargs): sctag = SCTag(tag) if (not sctag.valid): (await self.bot.say(sctag.invalid_error_msg)) return try: player_data = (await self.model.player_data(sctag.tag)) except json.decoder.JSONDecodeError: player_data = self.mod...
65bd0a6f4fb328cc4a59f83c3ee077efd6773e7253da504622ae0ed9c038a9b5
def embed_profile_overview(self, player: CRPlayerModel, server=None, color=None): 'Discord Embed: profile overview.' bem = self.bot_emoji.name member = self.model.tag2member(server, player.tag) mention = '_' if (member is not None): mention = member.mention profile_url = 'http://RoyaleAP...
Discord Embed: profile overview.
crprofile/crprofile.py
embed_profile_overview
zodpixel/SML-Cogs
17
python
def embed_profile_overview(self, player: CRPlayerModel, server=None, color=None): bem = self.bot_emoji.name member = self.model.tag2member(server, player.tag) mention = '_' if (member is not None): mention = member.mention profile_url = 'http://RoyaleAPI.com/player/{}'.format(player.tag...
def embed_profile_overview(self, player: CRPlayerModel, server=None, color=None): bem = self.bot_emoji.name member = self.model.tag2member(server, player.tag) mention = '_' if (member is not None): mention = member.mention profile_url = 'http://RoyaleAPI.com/player/{}'.format(player.tag...
6b808a4c52af042074617ec6cba61df9b6ecc730852ef57b001f6b29aed5f2be
def embed_profile_stats(self, player: CRPlayerModel, color=None): 'Discord Embed: profile stats.' em = discord.Embed(title=' ', color=color) bem = self.bot_emoji.name def fmt(num, emoji_name): emoji = self.bot_emoji.name(emoji_name) if (emoji is not None): return '{:,} {}'.f...
Discord Embed: profile stats.
crprofile/crprofile.py
embed_profile_stats
zodpixel/SML-Cogs
17
python
def embed_profile_stats(self, player: CRPlayerModel, color=None): em = discord.Embed(title=' ', color=color) bem = self.bot_emoji.name def fmt(num, emoji_name): emoji = self.bot_emoji.name(emoji_name) if (emoji is not None): return '{:,} {}'.format(num, emoji) if (playe...
def embed_profile_stats(self, player: CRPlayerModel, color=None): em = discord.Embed(title=' ', color=color) bem = self.bot_emoji.name def fmt(num, emoji_name): emoji = self.bot_emoji.name(emoji_name) if (emoji is not None): return '{:,} {}'.format(num, emoji) if (playe...
2615bd807a442e08d8bd376f891cd2826c809f592a33ea5a12fb7e9cf5f29ec1
def embed_profile_cards(self, player: CRPlayerModel, color=None): 'Card Collection.' profile_url = 'http://RoyaleAPI.com/player/{}/cards'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}'.format(player.name, player.tag), color=color, url=profile_url) cards = player.card_collection(self.bo...
Card Collection.
crprofile/crprofile.py
embed_profile_cards
zodpixel/SML-Cogs
17
python
def embed_profile_cards(self, player: CRPlayerModel, color=None): profile_url = 'http://RoyaleAPI.com/player/{}/cards'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}'.format(player.name, player.tag), color=color, url=profile_url) cards = player.card_collection(self.bot_emoji) cards...
def embed_profile_cards(self, player: CRPlayerModel, color=None): profile_url = 'http://RoyaleAPI.com/player/{}/cards'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}'.format(player.name, player.tag), color=color, url=profile_url) cards = player.card_collection(self.bot_emoji) cards...
9aa58a6f633a868223efc154ea35590be42f22061eab36b1a9e1ff15568fc4de
def embed_profile_chests(self, player: CRPlayerModel, color=None): 'Upcoming chests' profile_url = 'http://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}: Chest Cycle'.format(player.name, player.tag), color=color, url=profile_url) em.add_field(name='Chests', val...
Upcoming chests
crprofile/crprofile.py
embed_profile_chests
zodpixel/SML-Cogs
17
python
def embed_profile_chests(self, player: CRPlayerModel, color=None): profile_url = 'http://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}: Chest Cycle'.format(player.name, player.tag), color=color, url=profile_url) em.add_field(name='Chests', value=player.chest_l...
def embed_profile_chests(self, player: CRPlayerModel, color=None): profile_url = 'http://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}: Chest Cycle'.format(player.name, player.tag), color=color, url=profile_url) em.add_field(name='Chests', value=player.chest_l...
f91916684b8b2b819f61b6ed0abcc15962b03e0c9e80969dbbfc17e39c45f0e7
def embed_profile_deck(self, player: CRPlayerModel, color=None): 'Current deck.' profile_url = 'https://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) desc_copy = '[Copy deck]({url})'.format(url=player.deck_link) desc_stats = '[Deck stats]({url})'.format(url=player.deck_stats_url) desc_log ...
Current deck.
crprofile/crprofile.py
embed_profile_deck
zodpixel/SML-Cogs
17
python
def embed_profile_deck(self, player: CRPlayerModel, color=None): profile_url = 'https://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) desc_copy = '[Copy deck]({url})'.format(url=player.deck_link) desc_stats = '[Deck stats]({url})'.format(url=player.deck_stats_url) desc_log = '[Battle Log]...
def embed_profile_deck(self, player: CRPlayerModel, color=None): profile_url = 'https://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) desc_copy = '[Copy deck]({url})'.format(url=player.deck_link) desc_stats = '[Deck stats]({url})'.format(url=player.deck_stats_url) desc_log = '[Battle Log]...
63511c16a84801aa03086191cdab4f7b91f350f6d05866139a50be81e516246f
def embed_profile_trade(self, player: CRPlayerModel, color=None): 'Current deck.' decklink_url = player.deck_link profile_url = 'http://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}'.format(player.name, player.tag), color=color, url=decklink_url) trade_list...
Current deck.
crprofile/crprofile.py
embed_profile_trade
zodpixel/SML-Cogs
17
python
def embed_profile_trade(self, player: CRPlayerModel, color=None): decklink_url = player.deck_link profile_url = 'http://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}'.format(player.name, player.tag), color=color, url=decklink_url) trade_list = player.trade...
def embed_profile_trade(self, player: CRPlayerModel, color=None): decklink_url = player.deck_link profile_url = 'http://RoyaleAPI.com/player/{}'.format(player.tag.lstrip('#')) em = discord.Embed(title='{} #{}'.format(player.name, player.tag), color=color, url=decklink_url) trade_list = player.trade...
4bbeccb1515bf344eea3a01b8d6a73b0d4a5fb8362260d305552474b024d7660
def embeds_profile(self, player: CRPlayerModel, server=None, sections=('overview', 'stats')): 'Return Discord Embed of player profile.' embeds = [] color = random_discord_color() if ('overview' in sections): embeds.append(self.embed_profile_overview(player, server=server, color=color)) if ('...
Return Discord Embed of player profile.
crprofile/crprofile.py
embeds_profile
zodpixel/SML-Cogs
17
python
def embeds_profile(self, player: CRPlayerModel, server=None, sections=('overview', 'stats')): embeds = [] color = random_discord_color() if ('overview' in sections): embeds.append(self.embed_profile_overview(player, server=server, color=color)) if ('stats' in sections): embeds.appen...
def embeds_profile(self, player: CRPlayerModel, server=None, sections=('overview', 'stats')): embeds = [] color = random_discord_color() if ('overview' in sections): embeds.append(self.embed_profile_overview(player, server=server, color=color)) if ('stats' in sections): embeds.appen...
a7d228ac4d320a6b1e74d8b772422c7a1f1e447355aabfc2a550000c320f797c
async def on_message(self, msg): 'Do transforms.' if (self.bot.user.name != 'R2.Dev'): (await self.transform_friendlink(msg))
Do transforms.
crprofile/crprofile.py
on_message
zodpixel/SML-Cogs
17
python
async def on_message(self, msg): if (self.bot.user.name != 'R2.Dev'): (await self.transform_friendlink(msg))
async def on_message(self, msg): if (self.bot.user.name != 'R2.Dev'): (await self.transform_friendlink(msg))<|docstring|>Do transforms.<|endoftext|>
7eeb60676f66cea81751dd93763583be0a2f5a5bf553160b4bb85fd7c3bb56b5
async def transform_friendlink(self, msg): 'Convert friend invite links to embeds.\n\n https://link.clashroyale.com/invite/friend/en?tag={tag}&token={token}&platform={platform}\n ' m = re.search('https://link.clashroyale.com/invite/friend/..\\?tag=([A-Z0-9]+)&token=([a-z0-9]+)&platform=([A-Za-z0-9...
Convert friend invite links to embeds. https://link.clashroyale.com/invite/friend/en?tag={tag}&token={token}&platform={platform}
crprofile/crprofile.py
transform_friendlink
zodpixel/SML-Cogs
17
python
async def transform_friendlink(self, msg): 'Convert friend invite links to embeds.\n\n https://link.clashroyale.com/invite/friend/en?tag={tag}&token={token}&platform={platform}\n ' m = re.search('https://link.clashroyale.com/invite/friend/..\\?tag=([A-Z0-9]+)&token=([a-z0-9]+)&platform=([A-Za-z0-9...
async def transform_friendlink(self, msg): 'Convert friend invite links to embeds.\n\n https://link.clashroyale.com/invite/friend/en?tag={tag}&token={token}&platform={platform}\n ' m = re.search('https://link.clashroyale.com/invite/friend/..\\?tag=([A-Z0-9]+)&token=([a-z0-9]+)&platform=([A-Za-z0-9...
f621ba1c7430e34b3fc6e33a77ce3f35409b38f7dc6827f1a560a43b097a0a66
def _get_updated_endpoints(original_end_points): "Adds the keys 'logits' and 'probs' to the\n end points dictionary of ResNet50-v2.\n\n Args:\n original_end_points (dict): Original dictionary of end points\n\n Returns:\n dict: Dictionary of end points with the new keys.\n " end_points ...
Adds the keys 'logits' and 'probs' to the end points dictionary of ResNet50-v2. Args: original_end_points (dict): Original dictionary of end points Returns: dict: Dictionary of end points with the new keys.
shield/models/resnet_50_v2.py
_get_updated_endpoints
yfor1008/jpeg-defense
0
python
def _get_updated_endpoints(original_end_points): "Adds the keys 'logits' and 'probs' to the\n end points dictionary of ResNet50-v2.\n\n Args:\n original_end_points (dict): Original dictionary of end points\n\n Returns:\n dict: Dictionary of end points with the new keys.\n " end_points ...
def _get_updated_endpoints(original_end_points): "Adds the keys 'logits' and 'probs' to the\n end points dictionary of ResNet50-v2.\n\n Args:\n original_end_points (dict): Original dictionary of end points\n\n Returns:\n dict: Dictionary of end points with the new keys.\n " end_points ...
366c8c3b7a81da3d5dfa2eeab171251b21b42444be7eb016cb3a24384984d640
def __init__(self, x, num_classes=15, is_training=False): 'Initializes the tensorflow graph for the ResNet50-v2 model.\n\n Args:\n x (tf.Variable): The variable in the tensorflow graph\n that feeds into the model nodes.\n num_classes (int):\n Number of pred...
Initializes the tensorflow graph for the ResNet50-v2 model. Args: x (tf.Variable): The variable in the tensorflow graph that feeds into the model nodes. num_classes (int): Number of predicted classes for classification tasks. If 0 or None, the features before the logit layer are returne...
shield/models/resnet_50_v2.py
__init__
yfor1008/jpeg-defense
0
python
def __init__(self, x, num_classes=15, is_training=False): 'Initializes the tensorflow graph for the ResNet50-v2 model.\n\n Args:\n x (tf.Variable): The variable in the tensorflow graph\n that feeds into the model nodes.\n num_classes (int):\n Number of pred...
def __init__(self, x, num_classes=15, is_training=False): 'Initializes the tensorflow graph for the ResNet50-v2 model.\n\n Args:\n x (tf.Variable): The variable in the tensorflow graph\n that feeds into the model nodes.\n num_classes (int):\n Number of pred...
6056fa0e5e01d95be165096bb123bb343087cae7f8f68dd46b75d1ecb17798fc
def load_weights(self, checkpoint_path, sess=None): 'Load weights from a checkpoint file into the tensorflow graph.\n\n Args:\n checkpoint_path (str): Path to the checkpoint file.\n sess (tf.Session): The tensorflow session holding the model graph.\n ' if (sess is None): ...
Load weights from a checkpoint file into the tensorflow graph. Args: checkpoint_path (str): Path to the checkpoint file. sess (tf.Session): The tensorflow session holding the model graph.
shield/models/resnet_50_v2.py
load_weights
yfor1008/jpeg-defense
0
python
def load_weights(self, checkpoint_path, sess=None): 'Load weights from a checkpoint file into the tensorflow graph.\n\n Args:\n checkpoint_path (str): Path to the checkpoint file.\n sess (tf.Session): The tensorflow session holding the model graph.\n ' if (sess is None): ...
def load_weights(self, checkpoint_path, sess=None): 'Load weights from a checkpoint file into the tensorflow graph.\n\n Args:\n checkpoint_path (str): Path to the checkpoint file.\n sess (tf.Session): The tensorflow session holding the model graph.\n ' if (sess is None): ...
902a93f2b2c564abcffe48695341a297121a25b140f9e92b4f973407ac341c68
def get_params(self): "Lists the model's parameters.\n\n Returns:\n list: A list of the model's parameters.\n " return None
Lists the model's parameters. Returns: list: A list of the model's parameters.
shield/models/resnet_50_v2.py
get_params
yfor1008/jpeg-defense
0
python
def get_params(self): "Lists the model's parameters.\n\n Returns:\n list: A list of the model's parameters.\n " return None
def get_params(self): "Lists the model's parameters.\n\n Returns:\n list: A list of the model's parameters.\n " return None<|docstring|>Lists the model's parameters. Returns: list: A list of the model's parameters.<|endoftext|>
7e60feacda828fe18c636f74784a8f15227c6611ebc46735283b1704a6f3408f
def fprop(self, x): 'Exposes all the layers of the model.\n\n Args:\n x (tf.Variable): Tensor which is input to the model.\n\n Returns:\n dict: A dictionary mapping layer names to the corresponding\n node in the tensorflow graph.\n ' if (x is self.x): ...
Exposes all the layers of the model. Args: x (tf.Variable): Tensor which is input to the model. Returns: dict: A dictionary mapping layer names to the corresponding node in the tensorflow graph.
shield/models/resnet_50_v2.py
fprop
yfor1008/jpeg-defense
0
python
def fprop(self, x): 'Exposes all the layers of the model.\n\n Args:\n x (tf.Variable): Tensor which is input to the model.\n\n Returns:\n dict: A dictionary mapping layer names to the corresponding\n node in the tensorflow graph.\n ' if (x is self.x): ...
def fprop(self, x): 'Exposes all the layers of the model.\n\n Args:\n x (tf.Variable): Tensor which is input to the model.\n\n Returns:\n dict: A dictionary mapping layer names to the corresponding\n node in the tensorflow graph.\n ' if (x is self.x): ...
3000f1d88d18c6360fff732db5491fc9d37fa74789e57c659e3dde92e23f36bb
def finalize_options(self): 'Abstract method that is required to be overwritten'
Abstract method that is required to be overwritten
setup.py
finalize_options
mpavlase/nginx-config-builder
149
python
def finalize_options(self):
def finalize_options(self): <|docstring|>Abstract method that is required to be overwritten<|endoftext|>
22d06d819c11bd70f87fba9923c4366111478aa18202381e277b79529f6abaf7
def getHint(self, secret, guess): '\n :type secret: str\n :type guess: str\n :rtype: str\n ' cnt = defaultdict(int) A = 0 B = 0 for c in secret: cnt[c] += 1 for (i, v) in enumerate(guess): if (v == secret[i]): A += 1 cnt[v] -= 1...
:type secret: str :type guess: str :rtype: str
299 Bulls and Cows.py
getHint
ChiFire/legend_LeetCode
1
python
def getHint(self, secret, guess): '\n :type secret: str\n :type guess: str\n :rtype: str\n ' cnt = defaultdict(int) A = 0 B = 0 for c in secret: cnt[c] += 1 for (i, v) in enumerate(guess): if (v == secret[i]): A += 1 cnt[v] -= 1...
def getHint(self, secret, guess): '\n :type secret: str\n :type guess: str\n :rtype: str\n ' cnt = defaultdict(int) A = 0 B = 0 for c in secret: cnt[c] += 1 for (i, v) in enumerate(guess): if (v == secret[i]): A += 1 cnt[v] -= 1...
e9d100e4ca0766691773a21748317edff1e72f272b73c70493106a731b7545f8
def test_anbieter_mapping(self): '\n Test that all mapping point to correct fields\n ' for field in set(Anbieter.FIELD_NAME_MAPPING.values()): if (field is None): continue else: Anbieter._meta.get_field(field)
Test that all mapping point to correct fields
anbieter/tests.py
test_anbieter_mapping
CarliJoy/RoWoOekostromDB
0
python
def test_anbieter_mapping(self): '\n \n ' for field in set(Anbieter.FIELD_NAME_MAPPING.values()): if (field is None): continue else: Anbieter._meta.get_field(field)
def test_anbieter_mapping(self): '\n \n ' for field in set(Anbieter.FIELD_NAME_MAPPING.values()): if (field is None): continue else: Anbieter._meta.get_field(field)<|docstring|>Test that all mapping point to correct fields<|endoftext|>
89bef0cb915d5b31719d8fe8042a66e020419c481c64a06c1cb88e51606573cd
def test_homepage_kriterium_mapping(self): '\n Test that all mapping point to correct fields\n ' for field in set(HomepageKriterium.FIELD_NAME_MAPPING.values()): HomepageKriterium._meta.get_field(field)
Test that all mapping point to correct fields
anbieter/tests.py
test_homepage_kriterium_mapping
CarliJoy/RoWoOekostromDB
0
python
def test_homepage_kriterium_mapping(self): '\n \n ' for field in set(HomepageKriterium.FIELD_NAME_MAPPING.values()): HomepageKriterium._meta.get_field(field)
def test_homepage_kriterium_mapping(self): '\n \n ' for field in set(HomepageKriterium.FIELD_NAME_MAPPING.values()): HomepageKriterium._meta.get_field(field)<|docstring|>Test that all mapping point to correct fields<|endoftext|>
0fdf527f6c7b9ba1342f660a94d40e9931a31ab34ead6dde51c5e91eac198841
def np_arr_to_poly(np_arr): ' Using numpy 2d array ([0]-h, [1]-w) to construct polygon.\n\n Parameters\n -------\n np_arr : np.array\n contour with standard numpy 2d array format\n\n Returns\n -------\n poly : Polygon\n contour with shapely polygon format\n\n ' np_arr = swap_w...
Using numpy 2d array ([0]-h, [1]-w) to construct polygon. Parameters ------- np_arr : np.array contour with standard numpy 2d array format Returns ------- poly : Polygon contour with shapely polygon format
pycontour/poly_transform.py
np_arr_to_poly
PingjunChen/pycontour
8
python
def np_arr_to_poly(np_arr): ' Using numpy 2d array ([0]-h, [1]-w) to construct polygon.\n\n Parameters\n -------\n np_arr : np.array\n contour with standard numpy 2d array format\n\n Returns\n -------\n poly : Polygon\n contour with shapely polygon format\n\n ' np_arr = swap_w...
def np_arr_to_poly(np_arr): ' Using numpy 2d array ([0]-h, [1]-w) to construct polygon.\n\n Parameters\n -------\n np_arr : np.array\n contour with standard numpy 2d array format\n\n Returns\n -------\n poly : Polygon\n contour with shapely polygon format\n\n ' np_arr = swap_w...
63c70674d96ecdbab3a394e90310ec7b05b7b869b9bfed54aedafe055975310a
def point_list_to_poly(point_list): ' Using point list to construct polygon.\n\n Parameters\n -------\n point_list : list\n list of point set ([0]-h, [1]-w)\n\n Returns\n -------\n poly : Polygon\n contour with shapely polygon format\n\n ' wh_point_list = [] for ind in np....
Using point list to construct polygon. Parameters ------- point_list : list list of point set ([0]-h, [1]-w) Returns ------- poly : Polygon contour with shapely polygon format
pycontour/poly_transform.py
point_list_to_poly
PingjunChen/pycontour
8
python
def point_list_to_poly(point_list): ' Using point list to construct polygon.\n\n Parameters\n -------\n point_list : list\n list of point set ([0]-h, [1]-w)\n\n Returns\n -------\n poly : Polygon\n contour with shapely polygon format\n\n ' wh_point_list = [] for ind in np....
def point_list_to_poly(point_list): ' Using point list to construct polygon.\n\n Parameters\n -------\n point_list : list\n list of point set ([0]-h, [1]-w)\n\n Returns\n -------\n poly : Polygon\n contour with shapely polygon format\n\n ' wh_point_list = [] for ind in np....
33d9cb29b3dad2f45841ce9563deb3a7d285499f027b81801afcf3cf3ecf6247
def bbox_to_poly(min_h, min_w, max_h, max_w): ' Using bounding box to construct polygon.\n\n Parameters\n -------\n min_h : int\n minimum y coordinate of polygon\n min_w : int\n minimum x coordinate of polygon\n max_h : int\n maximum y coordinate of polygon\n max_w : int\n ...
Using bounding box to construct polygon. Parameters ------- min_h : int minimum y coordinate of polygon min_w : int minimum x coordinate of polygon max_h : int maximum y coordinate of polygon max_w : int maximum x coordinate of polygon Returns ------- poly : Polygon contour with shapely polygon fo...
pycontour/poly_transform.py
bbox_to_poly
PingjunChen/pycontour
8
python
def bbox_to_poly(min_h, min_w, max_h, max_w): ' Using bounding box to construct polygon.\n\n Parameters\n -------\n min_h : int\n minimum y coordinate of polygon\n min_w : int\n minimum x coordinate of polygon\n max_h : int\n maximum y coordinate of polygon\n max_w : int\n ...
def bbox_to_poly(min_h, min_w, max_h, max_w): ' Using bounding box to construct polygon.\n\n Parameters\n -------\n min_h : int\n minimum y coordinate of polygon\n min_w : int\n minimum x coordinate of polygon\n max_h : int\n maximum y coordinate of polygon\n max_w : int\n ...
4b63b3d6162334c541330e756fcfb39d3efd36b1fa65d57d77e804f356fc84a3
def poly_to_np_arr(poly): ' Convert shapely Polygon to numpy 2d array ([0]-h, [1]-w).\n\n Parameters\n -------\n poly : Polygon\n contour with shapely polygon format\n\n Returns\n -------\n cnt_arr : np.array\n contour with standard numpy 2d array format\n\n ' (x_coors, y_coor...
Convert shapely Polygon to numpy 2d array ([0]-h, [1]-w). Parameters ------- poly : Polygon contour with shapely polygon format Returns ------- cnt_arr : np.array contour with standard numpy 2d array format
pycontour/poly_transform.py
poly_to_np_arr
PingjunChen/pycontour
8
python
def poly_to_np_arr(poly): ' Convert shapely Polygon to numpy 2d array ([0]-h, [1]-w).\n\n Parameters\n -------\n poly : Polygon\n contour with shapely polygon format\n\n Returns\n -------\n cnt_arr : np.array\n contour with standard numpy 2d array format\n\n ' (x_coors, y_coor...
def poly_to_np_arr(poly): ' Convert shapely Polygon to numpy 2d array ([0]-h, [1]-w).\n\n Parameters\n -------\n poly : Polygon\n contour with shapely polygon format\n\n Returns\n -------\n cnt_arr : np.array\n contour with standard numpy 2d array format\n\n ' (x_coors, y_coor...
bb9bc7de05f6be28311bc5f0dd01a4ac108a94b2e158f2448954b54b79bd6b3b
def reshape(a, recshape=None): 'Convert a nested, non-string iterable into a flat generator and its shape.\n Raggedly shaped data will be processed recursively by calling recshape.\n If recshape is None, then ragged data wil raise ShapeError.\n To leave ragged data unshaped, pass recshape=unshape.\n ' ...
Convert a nested, non-string iterable into a flat generator and its shape. Raggedly shaped data will be processed recursively by calling recshape. If recshape is None, then ragged data wil raise ShapeError. To leave ragged data unshaped, pass recshape=unshape.
titanfp/titanic/ndarray.py
reshape
billzorn/fpunreal
4
python
def reshape(a, recshape=None): 'Convert a nested, non-string iterable into a flat generator and its shape.\n Raggedly shaped data will be processed recursively by calling recshape.\n If recshape is None, then ragged data wil raise ShapeError.\n To leave ragged data unshaped, pass recshape=unshape.\n ' ...
def reshape(a, recshape=None): 'Convert a nested, non-string iterable into a flat generator and its shape.\n Raggedly shaped data will be processed recursively by calling recshape.\n If recshape is None, then ragged data wil raise ShapeError.\n To leave ragged data unshaped, pass recshape=unshape.\n ' ...
1e76c5e350fc96dd064a1bb4a23e45451df67666d104a81444ddbb95a5272332
def unshape_tuple(data, shape): 'Expand a flat iterable and its shape into a nested tuple.\n ' a = data for dim in reversed(shape[1:]): a = zip(*([iter(a)] * dim)) return tuple(a)
Expand a flat iterable and its shape into a nested tuple.
titanfp/titanic/ndarray.py
unshape_tuple
billzorn/fpunreal
4
python
def unshape_tuple(data, shape): '\n ' a = data for dim in reversed(shape[1:]): a = zip(*([iter(a)] * dim)) return tuple(a)
def unshape_tuple(data, shape): '\n ' a = data for dim in reversed(shape[1:]): a = zip(*([iter(a)] * dim)) return tuple(a)<|docstring|>Expand a flat iterable and its shape into a nested tuple.<|endoftext|>
dde06d46b03b19604d824d010d787a2d5640b0da6c4759c1aac6825b3b621797
def unshape_list(data, shape): 'Expand a flat list and its shape into a nested list.\n ' a = data for dim in reversed(shape[1:]): a = [a[(chunk * dim):((chunk + 1) * dim)] for chunk in range((len(a) // dim))] return a
Expand a flat list and its shape into a nested list.
titanfp/titanic/ndarray.py
unshape_list
billzorn/fpunreal
4
python
def unshape_list(data, shape): '\n ' a = data for dim in reversed(shape[1:]): a = [a[(chunk * dim):((chunk + 1) * dim)] for chunk in range((len(a) // dim))] return a
def unshape_list(data, shape): '\n ' a = data for dim in reversed(shape[1:]): a = [a[(chunk * dim):((chunk + 1) * dim)] for chunk in range((len(a) // dim))] return a<|docstring|>Expand a flat list and its shape into a nested list.<|endoftext|>
978ba36717f50178de977e87b75fb243d3be6aee795806ddcff6bd3181d6ca9c
def unshape_gen(data, shape): 'Expand a flat list and its shape into a nested generator.\n ' a = data for dim in reversed(shape[1:]): a = (a[(chunk * dim):((chunk + 1) * dim)] for chunk in range((len(a) // dim))) return a
Expand a flat list and its shape into a nested generator.
titanfp/titanic/ndarray.py
unshape_gen
billzorn/fpunreal
4
python
def unshape_gen(data, shape): '\n ' a = data for dim in reversed(shape[1:]): a = (a[(chunk * dim):((chunk + 1) * dim)] for chunk in range((len(a) // dim))) return a
def unshape_gen(data, shape): '\n ' a = data for dim in reversed(shape[1:]): a = (a[(chunk * dim):((chunk + 1) * dim)] for chunk in range((len(a) // dim))) return a<|docstring|>Expand a flat list and its shape into a nested generator.<|endoftext|>
a327ba1f1f3e87d84a764dc061728171f3aed8ca83a8c08a9830691da4a84eba
def describe(a, descr=repr, sep=', ', lparen='(', rparen=')'): 'Convert a shaped or unshaped iterable into a one-line string,\n using the provided printing method and separators.\n ' if (isinstance(a, Iterable) and (not isinstance(a, str))): return ''.join([lparen, sep.join((describe(elt, descr=de...
Convert a shaped or unshaped iterable into a one-line string, using the provided printing method and separators.
titanfp/titanic/ndarray.py
describe
billzorn/fpunreal
4
python
def describe(a, descr=repr, sep=', ', lparen='(', rparen=')'): 'Convert a shaped or unshaped iterable into a one-line string,\n using the provided printing method and separators.\n ' if (isinstance(a, Iterable) and (not isinstance(a, str))): return .join([lparen, sep.join((describe(elt, descr=desc...
def describe(a, descr=repr, sep=', ', lparen='(', rparen=')'): 'Convert a shaped or unshaped iterable into a one-line string,\n using the provided printing method and separators.\n ' if (isinstance(a, Iterable) and (not isinstance(a, str))): return .join([lparen, sep.join((describe(elt, descr=desc...
16ec861dc4a0c96367d3b44ad1ed28d809cd7b7a3c4860f644edbd2348e56a0a
def describe_nd(a, descr=repr, dimsep=dimsep_array, lparen='(', rparen=')', depth=0): 'Convert a shaped or unshaped iterable into a string and a count of dimensions,\n using the provided printing method and separators.\n dimsep is a function that computes the separator given a logical depth and height\n fr...
Convert a shaped or unshaped iterable into a string and a count of dimensions, using the provided printing method and separators. dimsep is a function that computes the separator given a logical depth and height from the top and bottom of the data structure, and the parentheses.
titanfp/titanic/ndarray.py
describe_nd
billzorn/fpunreal
4
python
def describe_nd(a, descr=repr, dimsep=dimsep_array, lparen='(', rparen=')', depth=0): 'Convert a shaped or unshaped iterable into a string and a count of dimensions,\n using the provided printing method and separators.\n dimsep is a function that computes the separator given a logical depth and height\n fr...
def describe_nd(a, descr=repr, dimsep=dimsep_array, lparen='(', rparen=')', depth=0): 'Convert a shaped or unshaped iterable into a string and a count of dimensions,\n using the provided printing method and separators.\n dimsep is a function that computes the separator given a logical depth and height\n fr...
b711967069254a36e269af2ac96d111c8e0e3b0591b603401fa7328eb1e22e20
def locate(shape, pos): 'Given a shape and a position vector, return the index of that position in the flat array.\n ' idx = 0 scale = 1 for (dim, coord) in zip(reversed(shape), reversed(pos)): idx += (coord * scale) scale *= dim return idx
Given a shape and a position vector, return the index of that position in the flat array.
titanfp/titanic/ndarray.py
locate
billzorn/fpunreal
4
python
def locate(shape, pos): '\n ' idx = 0 scale = 1 for (dim, coord) in zip(reversed(shape), reversed(pos)): idx += (coord * scale) scale *= dim return idx
def locate(shape, pos): '\n ' idx = 0 scale = 1 for (dim, coord) in zip(reversed(shape), reversed(pos)): idx += (coord * scale) scale *= dim return idx<|docstring|>Given a shape and a position vector, return the index of that position in the flat array.<|endoftext|>
7f060b6f522785774e35cd6a883950cd93448eacfe8bc4eca5080ad9cd72ea55
def position(shape, idx): 'Given a shape and a flat index, return the corresponding position vector.\n ' quot = idx pos = [] for dim in reversed(shape): (quot, rem) = divmod(quot, dim) pos.append(rem) return tuple(reversed(pos))
Given a shape and a flat index, return the corresponding position vector.
titanfp/titanic/ndarray.py
position
billzorn/fpunreal
4
python
def position(shape, idx): '\n ' quot = idx pos = [] for dim in reversed(shape): (quot, rem) = divmod(quot, dim) pos.append(rem) return tuple(reversed(pos))
def position(shape, idx): '\n ' quot = idx pos = [] for dim in reversed(shape): (quot, rem) = divmod(quot, dim) pos.append(rem) return tuple(reversed(pos))<|docstring|>Given a shape and a flat index, return the corresponding position vector.<|endoftext|>
569b0acbcc486ba568b1b9d987ab4c2d39bc113c3f20c021cc282468b4f3b76e
def check_bounds(shape, pos): 'Given a shape, check if a position vector is in bounds for that shape.\n Raises IndexError if the position is out of bounds.\n ' for (dim, coord) in zip(shape, pos): if ((coord < 0) or (dim <= coord)): raise IndexError(f'{pos!r} out of range for shape {sh...
Given a shape, check if a position vector is in bounds for that shape. Raises IndexError if the position is out of bounds.
titanfp/titanic/ndarray.py
check_bounds
billzorn/fpunreal
4
python
def check_bounds(shape, pos): 'Given a shape, check if a position vector is in bounds for that shape.\n Raises IndexError if the position is out of bounds.\n ' for (dim, coord) in zip(shape, pos): if ((coord < 0) or (dim <= coord)): raise IndexError(f'{pos!r} out of range for shape {sh...
def check_bounds(shape, pos): 'Given a shape, check if a position vector is in bounds for that shape.\n Raises IndexError if the position is out of bounds.\n ' for (dim, coord) in zip(shape, pos): if ((coord < 0) or (dim <= coord)): raise IndexError(f'{pos!r} out of range for shape {sh...
7a9589bf9970c99b7df2179a92ec0082f0dba5d45ef5792b8600fcbe212fa479
def calc_size(shape): 'Compute the size of a shape (the len of the backing flat array).\n ' if shape: scale = 1 for dim in shape: scale *= dim return scale else: return 0
Compute the size of a shape (the len of the backing flat array).
titanfp/titanic/ndarray.py
calc_size
billzorn/fpunreal
4
python
def calc_size(shape): '\n ' if shape: scale = 1 for dim in shape: scale *= dim return scale else: return 0
def calc_size(shape): '\n ' if shape: scale = 1 for dim in shape: scale *= dim return scale else: return 0<|docstring|>Compute the size of a shape (the len of the backing flat array).<|endoftext|>
3f9c2878f8db67a835460edb6bb0eafdaf380a4015fdb904a811febd67cebc49
def check_size(data, shape): 'Given a shape and a flat sequence, check if the sequence has the expected length.\n Raises ShapeError if the length is wrong.\n ' if shape: scale = 1 for dim in shape: scale *= dim else: scale = 0 if (len(data) != scale): ra...
Given a shape and a flat sequence, check if the sequence has the expected length. Raises ShapeError if the length is wrong.
titanfp/titanic/ndarray.py
check_size
billzorn/fpunreal
4
python
def check_size(data, shape): 'Given a shape and a flat sequence, check if the sequence has the expected length.\n Raises ShapeError if the length is wrong.\n ' if shape: scale = 1 for dim in shape: scale *= dim else: scale = 0 if (len(data) != scale): ra...
def check_size(data, shape): 'Given a shape and a flat sequence, check if the sequence has the expected length.\n Raises ShapeError if the length is wrong.\n ' if shape: scale = 1 for dim in shape: scale *= dim else: scale = 0 if (len(data) != scale): ra...
bf52dc4f02b85a272299c58ce5f70f8f961532c60454187bf53123b7c477d24f
def calc_strides(shape): 'Calculate stride values for a shape.\n Returns the computed strides, and the overall size of the shape.\n ' if shape: scale = 1 strides = [] for dim in reversed(shape): strides.append(scale) scale *= dim return (tuple(revers...
Calculate stride values for a shape. Returns the computed strides, and the overall size of the shape.
titanfp/titanic/ndarray.py
calc_strides
billzorn/fpunreal
4
python
def calc_strides(shape): 'Calculate stride values for a shape.\n Returns the computed strides, and the overall size of the shape.\n ' if shape: scale = 1 strides = [] for dim in reversed(shape): strides.append(scale) scale *= dim return (tuple(revers...
def calc_strides(shape): 'Calculate stride values for a shape.\n Returns the computed strides, and the overall size of the shape.\n ' if shape: scale = 1 strides = [] for dim in reversed(shape): strides.append(scale) scale *= dim return (tuple(revers...
a61234325afe805fce013a5a8b379c33fe5a48db64feca185f16d9b7b2cfe8e1
def calc_offset(shape, strides, lookup): 'Given a shape with strides and a lookup, calculate a start offset and new strides.\n Returns the start offset, the new shape, the new strides, and the rest of the lookup.\n ' new_shape = [] new_strides = [] start = 0 fused = 0 for (dim, stride, que...
Given a shape with strides and a lookup, calculate a start offset and new strides. Returns the start offset, the new shape, the new strides, and the rest of the lookup.
titanfp/titanic/ndarray.py
calc_offset
billzorn/fpunreal
4
python
def calc_offset(shape, strides, lookup): 'Given a shape with strides and a lookup, calculate a start offset and new strides.\n Returns the start offset, the new shape, the new strides, and the rest of the lookup.\n ' new_shape = [] new_strides = [] start = 0 fused = 0 for (dim, stride, que...
def calc_offset(shape, strides, lookup): 'Given a shape with strides and a lookup, calculate a start offset and new strides.\n Returns the start offset, the new shape, the new strides, and the rest of the lookup.\n ' new_shape = [] new_strides = [] start = 0 fused = 0 for (dim, stride, que...
9611c8697ea2d4f35185dd0c1a0e3580d7c7a231859cd0142d47d1f815c4be1c
def check_offset(data, shape, start, strides): 'Check if a shape with a start offset and given strides is in bounds for some backing list.\n Raises ShapeError if the shape does not fit within the data.\n ' min_offset = 0 max_offset = 0 for (dim, stride) in zip(shape, strides): offset = (ma...
Check if a shape with a start offset and given strides is in bounds for some backing list. Raises ShapeError if the shape does not fit within the data.
titanfp/titanic/ndarray.py
check_offset
billzorn/fpunreal
4
python
def check_offset(data, shape, start, strides): 'Check if a shape with a start offset and given strides is in bounds for some backing list.\n Raises ShapeError if the shape does not fit within the data.\n ' min_offset = 0 max_offset = 0 for (dim, stride) in zip(shape, strides): offset = (ma...
def check_offset(data, shape, start, strides): 'Check if a shape with a start offset and given strides is in bounds for some backing list.\n Raises ShapeError if the shape does not fit within the data.\n ' min_offset = 0 max_offset = 0 for (dim, stride) in zip(shape, strides): offset = (ma...
c5c06fdf353370c38c0b5d92a14073625142b2e8ed240064b1b97c84dbe6f1df
def _mk_view(cls): "Create a new view type from an existing n-dimensional sequence type.\n\n Due to the way inheritance works with assigning to __class__\n it is necessary that the derived view type inherit directly from the base sequence type\n or we won't be able to reify due to differing object layout.\...
Create a new view type from an existing n-dimensional sequence type. Due to the way inheritance works with assigning to __class__ it is necessary that the derived view type inherit directly from the base sequence type or we won't be able to reify due to differing object layout. The only way to implement this inherita...
titanfp/titanic/ndarray.py
_mk_view
billzorn/fpunreal
4
python
def _mk_view(cls): "Create a new view type from an existing n-dimensional sequence type.\n\n Due to the way inheritance works with assigning to __class__\n it is necessary that the derived view type inherit directly from the base sequence type\n or we won't be able to reify due to differing object layout.\...
def _mk_view(cls): "Create a new view type from an existing n-dimensional sequence type.\n\n Due to the way inheritance works with assigning to __class__\n it is necessary that the derived view type inherit directly from the base sequence type\n or we won't be able to reify due to differing object layout.\...
7ddf55fb2fb9ae22f49e46e736a54f7764b7636e45260500b2666d50800b0963
def forward(self, input_ids, attention_mask): '\n\t\tInputs:\n\t\t\t-input_ids : Tensor of shape [B, T] containing token ids of sequences\n\t\t\t-attention_mask : Tensor of shape [B, T] containing attention masks to be used to avoid contibution of PAD tokens\n\t\t\t(where B is the batch size and T is the input leng...
Inputs: -input_ids : Tensor of shape [B, T] containing token ids of sequences -attention_mask : Tensor of shape [B, T] containing attention masks to be used to avoid contibution of PAD tokens (where B is the batch size and T is the input length)
language/models.py
forward
MadryLab/DebuggableDeepNetworks
32
python
def forward(self, input_ids, attention_mask): '\n\t\tInputs:\n\t\t\t-input_ids : Tensor of shape [B, T] containing token ids of sequences\n\t\t\t-attention_mask : Tensor of shape [B, T] containing attention masks to be used to avoid contibution of PAD tokens\n\t\t\t(where B is the batch size and T is the input leng...
def forward(self, input_ids, attention_mask): '\n\t\tInputs:\n\t\t\t-input_ids : Tensor of shape [B, T] containing token ids of sequences\n\t\t\t-attention_mask : Tensor of shape [B, T] containing attention masks to be used to avoid contibution of PAD tokens\n\t\t\t(where B is the batch size and T is the input leng...
c13d0da99f854fbc3612926c761c086e9678a58aa41a46502dc525cd17d6308f
def memoized_parse_block(code): 'Memoized version of parse_block.' try: result = parse_block_memo[code] except KeyError: try: parsed = COMPILER.parse_block(code) except Exception as err: result = err else: result = parsed parse_bloc...
Memoized version of parse_block.
coconut/icoconut/root.py
memoized_parse_block
CS121Fresh/runner
0
python
def memoized_parse_block(code): try: result = parse_block_memo[code] except KeyError: try: parsed = COMPILER.parse_block(code) except Exception as err: result = err else: result = parsed parse_block_memo[code] = result if isins...
def memoized_parse_block(code): try: result = parse_block_memo[code] except KeyError: try: parsed = COMPILER.parse_block(code) except Exception as err: result = err else: result = parsed parse_block_memo[code] = result if isins...
a33334254ba87823bedf4ba1057dc0a111e0be6434295bb9eb5768e192447918
def memoized_parse_sys(code): 'Memoized version of parse_sys.' return COMPILER.header_proc(memoized_parse_block(code), header='sys', initial='none')
Memoized version of parse_sys.
coconut/icoconut/root.py
memoized_parse_sys
CS121Fresh/runner
0
python
def memoized_parse_sys(code): return COMPILER.header_proc(memoized_parse_block(code), header='sys', initial='none')
def memoized_parse_sys(code): return COMPILER.header_proc(memoized_parse_block(code), header='sys', initial='none')<|docstring|>Memoized version of parse_sys.<|endoftext|>
635ebafe3bb7654d5161aa82bc527ec30a8f8af4acdf370fe2d9cfd5d59da34e
def ast_parse(self, source, *args, **kwargs): 'Version of ast_parse that compiles Coconut code first.' try: compiled = memoized_parse_sys(source) except CoconutException as err: raise err.syntax_err() else: return super(CoconutCompiler, self).ast_parse(compiled, *args, **kwargs)
Version of ast_parse that compiles Coconut code first.
coconut/icoconut/root.py
ast_parse
CS121Fresh/runner
0
python
def ast_parse(self, source, *args, **kwargs): try: compiled = memoized_parse_sys(source) except CoconutException as err: raise err.syntax_err() else: return super(CoconutCompiler, self).ast_parse(compiled, *args, **kwargs)
def ast_parse(self, source, *args, **kwargs): try: compiled = memoized_parse_sys(source) except CoconutException as err: raise err.syntax_err() else: return super(CoconutCompiler, self).ast_parse(compiled, *args, **kwargs)<|docstring|>Version of ast_parse that compiles Coconut c...
f6394d331642d6000f480ff0dc1d89d8c9c6906f7125cb94e28f6f81b3254f19
def cache(self, code, *args, **kwargs): 'Version of cache that compiles Coconut code first.' try: compiled = memoized_parse_sys(code) except CoconutException: traceback.print_exc() return None else: return super(CoconutCompiler, self).cache(compiled, *args, **kwargs)
Version of cache that compiles Coconut code first.
coconut/icoconut/root.py
cache
CS121Fresh/runner
0
python
def cache(self, code, *args, **kwargs): try: compiled = memoized_parse_sys(code) except CoconutException: traceback.print_exc() return None else: return super(CoconutCompiler, self).cache(compiled, *args, **kwargs)
def cache(self, code, *args, **kwargs): try: compiled = memoized_parse_sys(code) except CoconutException: traceback.print_exc() return None else: return super(CoconutCompiler, self).cache(compiled, *args, **kwargs)<|docstring|>Version of cache that compiles Coconut code ...
9b3df0f3d55d643327cc78f030f7493e62130a909eaf1d2f93532f96c1e944e7
def __init__(self, *args, **kwargs): 'Version of __init__ that sets up Coconut code compilation.' super(CoconutSplitter, self).__init__(*args, **kwargs) self._compile = self._coconut_compile
Version of __init__ that sets up Coconut code compilation.
coconut/icoconut/root.py
__init__
CS121Fresh/runner
0
python
def __init__(self, *args, **kwargs): super(CoconutSplitter, self).__init__(*args, **kwargs) self._compile = self._coconut_compile
def __init__(self, *args, **kwargs): super(CoconutSplitter, self).__init__(*args, **kwargs) self._compile = self._coconut_compile<|docstring|>Version of __init__ that sets up Coconut code compilation.<|endoftext|>
1aae8dc460325507b4d05e801c5dfec61755b35e8747c9676dd5c146db8316cb
def _coconut_compile(self, source, *args, **kwargs): 'Version of _compile that checks Coconut code.\n None means that the code should not be run as is.\n Any other value means that it can.' if source.endswith('\n\n'): return True elif should_indent(source): return None ...
Version of _compile that checks Coconut code. None means that the code should not be run as is. Any other value means that it can.
coconut/icoconut/root.py
_coconut_compile
CS121Fresh/runner
0
python
def _coconut_compile(self, source, *args, **kwargs): 'Version of _compile that checks Coconut code.\n None means that the code should not be run as is.\n Any other value means that it can.' if source.endswith('\n\n'): return True elif should_indent(source): return None ...
def _coconut_compile(self, source, *args, **kwargs): 'Version of _compile that checks Coconut code.\n None means that the code should not be run as is.\n Any other value means that it can.' if source.endswith('\n\n'): return True elif should_indent(source): return None ...
e8ea3996ab99a37aa6214678ed998f803482de2751e5a79c19be75f7da1d9ba6
def init_instance_attrs(self): 'Version of init_instance_attrs that uses CoconutCompiler.' super(CoconutShell, self).init_instance_attrs() self.compile = CoconutCompiler()
Version of init_instance_attrs that uses CoconutCompiler.
coconut/icoconut/root.py
init_instance_attrs
CS121Fresh/runner
0
python
def init_instance_attrs(self): super(CoconutShell, self).init_instance_attrs() self.compile = CoconutCompiler()
def init_instance_attrs(self): super(CoconutShell, self).init_instance_attrs() self.compile = CoconutCompiler()<|docstring|>Version of init_instance_attrs that uses CoconutCompiler.<|endoftext|>
5a37a0170132e7deabb7d8e165acd6e0e1e785b8165197bd6e27d47f134339d3
def init_create_namespaces(self, *args, **kwargs): 'Version of init_create_namespaces that adds Coconut built-ins to globals.' super(CoconutShell, self).init_create_namespaces(*args, **kwargs) RUNNER.update_vars(self.user_global_ns)
Version of init_create_namespaces that adds Coconut built-ins to globals.
coconut/icoconut/root.py
init_create_namespaces
CS121Fresh/runner
0
python
def init_create_namespaces(self, *args, **kwargs): super(CoconutShell, self).init_create_namespaces(*args, **kwargs) RUNNER.update_vars(self.user_global_ns)
def init_create_namespaces(self, *args, **kwargs): super(CoconutShell, self).init_create_namespaces(*args, **kwargs) RUNNER.update_vars(self.user_global_ns)<|docstring|>Version of init_create_namespaces that adds Coconut built-ins to globals.<|endoftext|>
0ffea3c0220e52118ecaeca5c68c34c827c2e7f7a67da7cd01616ecdf321493b
def run_cell(self, raw_cell, store_history=False, silent=False, shell_futures=None): 'Version of run_cell that always uses shell_futures.' return super(CoconutShell, self).run_cell(raw_cell, store_history, silent, shell_futures=True)
Version of run_cell that always uses shell_futures.
coconut/icoconut/root.py
run_cell
CS121Fresh/runner
0
python
def run_cell(self, raw_cell, store_history=False, silent=False, shell_futures=None): return super(CoconutShell, self).run_cell(raw_cell, store_history, silent, shell_futures=True)
def run_cell(self, raw_cell, store_history=False, silent=False, shell_futures=None): return super(CoconutShell, self).run_cell(raw_cell, store_history, silent, shell_futures=True)<|docstring|>Version of run_cell that always uses shell_futures.<|endoftext|>
50b6c461784b75457aff90a953924b397292eaa4c698bf9595ef6ca7d3e88ca9
def user_expressions(self, expressions): 'Version of user_expressions that compiles Coconut code first.' compiled_expressions = {} for (key, expr) in expressions.items(): try: compiled_expressions[key] = COMPILER.parse_eval(expr) except CoconutException: compiled_expr...
Version of user_expressions that compiles Coconut code first.
coconut/icoconut/root.py
user_expressions
CS121Fresh/runner
0
python
def user_expressions(self, expressions): compiled_expressions = {} for (key, expr) in expressions.items(): try: compiled_expressions[key] = COMPILER.parse_eval(expr) except CoconutException: compiled_expressions[key] = expr return super(CoconutShell, self).user_e...
def user_expressions(self, expressions): compiled_expressions = {} for (key, expr) in expressions.items(): try: compiled_expressions[key] = COMPILER.parse_eval(expr) except CoconutException: compiled_expressions[key] = expr return super(CoconutShell, self).user_e...
fba6cdc8881867e39db7354c2174658c645fac328154160e3b35e90c925739b6
def test_purge_old_personal_api_key_events_rejects_invalid_arguments(self): 'The purge_old_personal_api_key_events command should reject invalid arguments' event = PersonApiKeyEventFactory(time=(datetime.datetime.now() - datetime.timedelta(days=30))) with self.assertRaises(CommandError): self._call_...
The purge_old_personal_api_key_events command should reject invalid arguments
ietf/person/management/commands/tests.py
test_purge_old_personal_api_key_events_rejects_invalid_arguments
Spectre17/datatracker
25
python
def test_purge_old_personal_api_key_events_rejects_invalid_arguments(self): event = PersonApiKeyEventFactory(time=(datetime.datetime.now() - datetime.timedelta(days=30))) with self.assertRaises(CommandError): self._call_command('purge_old_personal_api_key_events') with self.assertRaises(Command...
def test_purge_old_personal_api_key_events_rejects_invalid_arguments(self): event = PersonApiKeyEventFactory(time=(datetime.datetime.now() - datetime.timedelta(days=30))) with self.assertRaises(CommandError): self._call_command('purge_old_personal_api_key_events') with self.assertRaises(Command...
d9495b538d491cc13f8bfc95daec225606cb90643f5e73427285d954c9265177
def push_monitor(model, name, transfer_experience=False, save_records=False): '\n When you load a model in a yaml file and you want to store its\n old monitor under a different name and start a new monitor, wrap\n the model in this function call.\n\n\n Parameters\n ----------\n model : pylearn2.mo...
When you load a model in a yaml file and you want to store its old monitor under a different name and start a new monitor, wrap the model in this function call. Parameters ---------- model : pylearn2.models.model.Model The model you loaded name : str Will save the old monitor to model.name transfer_experience...
pylearn2/monitor.py
push_monitor
fxyu/pylearn2
2,045
python
def push_monitor(model, name, transfer_experience=False, save_records=False): '\n When you load a model in a yaml file and you want to store its\n old monitor under a different name and start a new monitor, wrap\n the model in this function call.\n\n\n Parameters\n ----------\n model : pylearn2.mo...
def push_monitor(model, name, transfer_experience=False, save_records=False): '\n When you load a model in a yaml file and you want to store its\n old monitor under a different name and start a new monitor, wrap\n the model in this function call.\n\n\n Parameters\n ----------\n model : pylearn2.mo...
43600a31e18dc27fed663bc7f1de5eb152522f8bca165bcc159bd7bcada3f03c
def read_channel(model, channel_name, monitor_name='monitor'): '\n Returns the last value recorded in a channel.\n\n Parameters\n ----------\n model : Model\n The model to read the channel from\n channel_name : str\n The name of the channel to read from\n monitor_name : str, optional...
Returns the last value recorded in a channel. Parameters ---------- model : Model The model to read the channel from channel_name : str The name of the channel to read from monitor_name : str, optional The name of the Monitor to read from (In case you want to read from an old Monitor moved by `push...
pylearn2/monitor.py
read_channel
fxyu/pylearn2
2,045
python
def read_channel(model, channel_name, monitor_name='monitor'): '\n Returns the last value recorded in a channel.\n\n Parameters\n ----------\n model : Model\n The model to read the channel from\n channel_name : str\n The name of the channel to read from\n monitor_name : str, optional...
def read_channel(model, channel_name, monitor_name='monitor'): '\n Returns the last value recorded in a channel.\n\n Parameters\n ----------\n model : Model\n The model to read the channel from\n channel_name : str\n The name of the channel to read from\n monitor_name : str, optional...
851c2766bd9c79f35ea4853dd2377b2cd7b34b6a763cc60763a46300104fbbc6
def get_channel(model, dataset, channel, cost, batch_size): "\n Make a temporary monitor and return the value of a channel in it.\n\n Parameters\n ----------\n model : pylearn2.models.model.Model\n Will evaluate the channel for this Model.\n dataset : pylearn2.datasets.Dataset\n The Dat...
Make a temporary monitor and return the value of a channel in it. Parameters ---------- model : pylearn2.models.model.Model Will evaluate the channel for this Model. dataset : pylearn2.datasets.Dataset The Dataset to run on channel : str A string identifying the channel name to evaluate cost : pylearn2.cos...
pylearn2/monitor.py
get_channel
fxyu/pylearn2
2,045
python
def get_channel(model, dataset, channel, cost, batch_size): "\n Make a temporary monitor and return the value of a channel in it.\n\n Parameters\n ----------\n model : pylearn2.models.model.Model\n Will evaluate the channel for this Model.\n dataset : pylearn2.datasets.Dataset\n The Dat...
def get_channel(model, dataset, channel, cost, batch_size): "\n Make a temporary monitor and return the value of a channel in it.\n\n Parameters\n ----------\n model : pylearn2.models.model.Model\n Will evaluate the channel for this Model.\n dataset : pylearn2.datasets.Dataset\n The Dat...
bccbeabe18d6f6ee001b319bcec8c081b137fa402f593befed215d442b80e3cc
def get_monitor_doc(var): '\n Returns the __doc__ field of var or None. This field is used on\n theano Variables to document the meaning of monitor channels.\n\n Parameters\n ----------\n var : theano.gof.Variable\n The variable to get the documentation of\n\n Returns\n -------\n doc ...
Returns the __doc__ field of var or None. This field is used on theano Variables to document the meaning of monitor channels. Parameters ---------- var : theano.gof.Variable The variable to get the documentation of Returns ------- doc : str or None var.__doc__ if var has an instance-level doc, otherwise None
pylearn2/monitor.py
get_monitor_doc
fxyu/pylearn2
2,045
python
def get_monitor_doc(var): '\n Returns the __doc__ field of var or None. This field is used on\n theano Variables to document the meaning of monitor channels.\n\n Parameters\n ----------\n var : theano.gof.Variable\n The variable to get the documentation of\n\n Returns\n -------\n doc ...
def get_monitor_doc(var): '\n Returns the __doc__ field of var or None. This field is used on\n theano Variables to document the meaning of monitor channels.\n\n Parameters\n ----------\n var : theano.gof.Variable\n The variable to get the documentation of\n\n Returns\n -------\n doc ...
0f50bc99d8fda887284d17e123df0b8646c0fbb239d40ed413a2ad2cb0e8b106
def _build_data_specs(self): '\n Computes a nested data_specs for input and all channels\n\n Also computes the mapping to flatten it. This function is\n called from redo_theano.\n ' (m_space, m_source) = self.model.get_monitoring_data_specs() input_spaces = [m_space] input_so...
Computes a nested data_specs for input and all channels Also computes the mapping to flatten it. This function is called from redo_theano.
pylearn2/monitor.py
_build_data_specs
fxyu/pylearn2
2,045
python
def _build_data_specs(self): '\n Computes a nested data_specs for input and all channels\n\n Also computes the mapping to flatten it. This function is\n called from redo_theano.\n ' (m_space, m_source) = self.model.get_monitoring_data_specs() input_spaces = [m_space] input_so...
def _build_data_specs(self): '\n Computes a nested data_specs for input and all channels\n\n Also computes the mapping to flatten it. This function is\n called from redo_theano.\n ' (m_space, m_source) = self.model.get_monitoring_data_specs() input_spaces = [m_space] input_so...
d175c435015a096df301f692e54598154c07fb1fba3deec2069f8efd57874cca
def set_theano_function_mode(self, mode): '\n .. todo::\n\n WRITEME\n\n Parameters\n ----------\n mode : theano.compile.Mode\n Theano functions for the monitoring channels will be\n compiled and run using this mode.\n ' if (self.theano_function...
.. todo:: WRITEME Parameters ---------- mode : theano.compile.Mode Theano functions for the monitoring channels will be compiled and run using this mode.
pylearn2/monitor.py
set_theano_function_mode
fxyu/pylearn2
2,045
python
def set_theano_function_mode(self, mode): '\n .. todo::\n\n WRITEME\n\n Parameters\n ----------\n mode : theano.compile.Mode\n Theano functions for the monitoring channels will be\n compiled and run using this mode.\n ' if (self.theano_function...
def set_theano_function_mode(self, mode): '\n .. todo::\n\n WRITEME\n\n Parameters\n ----------\n mode : theano.compile.Mode\n Theano functions for the monitoring channels will be\n compiled and run using this mode.\n ' if (self.theano_function...
8888bee1e642db432aeb77e71edaf1a97f935736f3071e3c7ef4e00e7e5fce97
def add_dataset(self, dataset, mode='sequential', batch_size=None, num_batches=None, seed=None): "\n Determines the data used to calculate the values of each channel.\n\n Parameters\n ----------\n dataset : object\n A `pylearn2.datasets.Dataset` object.\n mode : str or ...
Determines the data used to calculate the values of each channel. Parameters ---------- dataset : object A `pylearn2.datasets.Dataset` object. mode : str or object, optional Iteration mode; see the docstring of the `iterator` method on `pylearn2.datasets.Dataset` for details. batch_size : int, optional ...
pylearn2/monitor.py
add_dataset
fxyu/pylearn2
2,045
python
def add_dataset(self, dataset, mode='sequential', batch_size=None, num_batches=None, seed=None): "\n Determines the data used to calculate the values of each channel.\n\n Parameters\n ----------\n dataset : object\n A `pylearn2.datasets.Dataset` object.\n mode : str or ...
def add_dataset(self, dataset, mode='sequential', batch_size=None, num_batches=None, seed=None): "\n Determines the data used to calculate the values of each channel.\n\n Parameters\n ----------\n dataset : object\n A `pylearn2.datasets.Dataset` object.\n mode : str or ...
c5b759dc09539dfe6c014add9d030cbba2d13f741f7f9e4b54b545ea1dd80298
def __call__(self): '\n Runs the model on the monitoring dataset in order to add one\n data point to each of the channels.\n ' if self._dirty: self.redo_theano() datasets = self._datasets self.begin_record_entry() for (d, i, b, n, a, sd, ne) in safe_izip(datasets, self._...
Runs the model on the monitoring dataset in order to add one data point to each of the channels.
pylearn2/monitor.py
__call__
fxyu/pylearn2
2,045
python
def __call__(self): '\n Runs the model on the monitoring dataset in order to add one\n data point to each of the channels.\n ' if self._dirty: self.redo_theano() datasets = self._datasets self.begin_record_entry() for (d, i, b, n, a, sd, ne) in safe_izip(datasets, self._...
def __call__(self): '\n Runs the model on the monitoring dataset in order to add one\n data point to each of the channels.\n ' if self._dirty: self.redo_theano() datasets = self._datasets self.begin_record_entry() for (d, i, b, n, a, sd, ne) in safe_izip(datasets, self._...
70b9adf5bc2e2a53ef8eea7216717735bbcc2ca440e1fb5fedd8d78f9e205fc7
def run_prereqs(self, data, dataset): '\n Runs all "prerequistie functions" on a batch of data. Always\n called right before computing the monitoring channels on that\n batch.\n\n Parameters\n ----------\n data : tuple or Variable\n a member of the Space used as ...
Runs all "prerequistie functions" on a batch of data. Always called right before computing the monitoring channels on that batch. Parameters ---------- data : tuple or Variable a member of the Space used as input to the monitoring functions dataset : Dataset the Dataset the data was drawn from
pylearn2/monitor.py
run_prereqs
fxyu/pylearn2
2,045
python
def run_prereqs(self, data, dataset): '\n Runs all "prerequistie functions" on a batch of data. Always\n called right before computing the monitoring channels on that\n batch.\n\n Parameters\n ----------\n data : tuple or Variable\n a member of the Space used as ...
def run_prereqs(self, data, dataset): '\n Runs all "prerequistie functions" on a batch of data. Always\n called right before computing the monitoring channels on that\n batch.\n\n Parameters\n ----------\n data : tuple or Variable\n a member of the Space used as ...
9fa27de96b858fdb362bc46dabac9c8a3aa831461488aa2d2d74860315e0e469
def get_batches_seen(self): '\n Returns the number of batches the model has learned on\n (assuming that the learning code has been calling\n Monitor.report_batch correctly).\n ' return self._num_batches_seen
Returns the number of batches the model has learned on (assuming that the learning code has been calling Monitor.report_batch correctly).
pylearn2/monitor.py
get_batches_seen
fxyu/pylearn2
2,045
python
def get_batches_seen(self): '\n Returns the number of batches the model has learned on\n (assuming that the learning code has been calling\n Monitor.report_batch correctly).\n ' return self._num_batches_seen
def get_batches_seen(self): '\n Returns the number of batches the model has learned on\n (assuming that the learning code has been calling\n Monitor.report_batch correctly).\n ' return self._num_batches_seen<|docstring|>Returns the number of batches the model has learned on (assuming...
e990849ac81538ee1aea3960e995caadfa369ded69d3810aab0d56a2a40c4efc
def get_epochs_seen(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n epochs_seen : int\n The number of epochs the model has been trained on.\n One "epoch" is one pass through Dataset.iterator.\n ' return self._epochs_seen
.. todo:: WRITEME Returns ------- epochs_seen : int The number of epochs the model has been trained on. One "epoch" is one pass through Dataset.iterator.
pylearn2/monitor.py
get_epochs_seen
fxyu/pylearn2
2,045
python
def get_epochs_seen(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n epochs_seen : int\n The number of epochs the model has been trained on.\n One "epoch" is one pass through Dataset.iterator.\n ' return self._epochs_seen
def get_epochs_seen(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n epochs_seen : int\n The number of epochs the model has been trained on.\n One "epoch" is one pass through Dataset.iterator.\n ' return self._epochs_seen<|docstring|>.....
3bbb7d946908a296a329b60cf8798651678d7236e96aed2dc30e4322c72647b2
def get_examples_seen(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n examples_seen : int\n The number of examples the model has learned on (assuming\n that the learning code has been calling Monitor.report_batch\n correctly)\n ...
.. todo:: WRITEME Returns ------- examples_seen : int The number of examples the model has learned on (assuming that the learning code has been calling Monitor.report_batch correctly)
pylearn2/monitor.py
get_examples_seen
fxyu/pylearn2
2,045
python
def get_examples_seen(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n examples_seen : int\n The number of examples the model has learned on (assuming\n that the learning code has been calling Monitor.report_batch\n correctly)\n ...
def get_examples_seen(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n examples_seen : int\n The number of examples the model has learned on (assuming\n that the learning code has been calling Monitor.report_batch\n correctly)\n ...
6e1befab375da5db76d3bfa3ec8682efcd395fbacfa95bd8e6bcb597dbc51752
def report_batch(self, num_examples): '\n Call this whenever the model has learned on another batch of\n examples. Report how many examples were learned on.\n\n Parameters\n ----------\n num_examples : int\n The number of examples learned on in this minibatch.\n ...
Call this whenever the model has learned on another batch of examples. Report how many examples were learned on. Parameters ---------- num_examples : int The number of examples learned on in this minibatch.
pylearn2/monitor.py
report_batch
fxyu/pylearn2
2,045
python
def report_batch(self, num_examples): '\n Call this whenever the model has learned on another batch of\n examples. Report how many examples were learned on.\n\n Parameters\n ----------\n num_examples : int\n The number of examples learned on in this minibatch.\n ...
def report_batch(self, num_examples): '\n Call this whenever the model has learned on another batch of\n examples. Report how many examples were learned on.\n\n Parameters\n ----------\n num_examples : int\n The number of examples learned on in this minibatch.\n ...
c22fc100b771bae982dd2c5a6629008476c6402395e5ea224d6c9780fa52c541
def report_epoch(self): '\n Call this whenever the model has completed another "epoch" of\n learning. We regard one pass through Dataset.iterator as one\n epoch.\n ' self._epochs_seen += 1
Call this whenever the model has completed another "epoch" of learning. We regard one pass through Dataset.iterator as one epoch.
pylearn2/monitor.py
report_epoch
fxyu/pylearn2
2,045
python
def report_epoch(self): '\n Call this whenever the model has completed another "epoch" of\n learning. We regard one pass through Dataset.iterator as one\n epoch.\n ' self._epochs_seen += 1
def report_epoch(self): '\n Call this whenever the model has completed another "epoch" of\n learning. We regard one pass through Dataset.iterator as one\n epoch.\n ' self._epochs_seen += 1<|docstring|>Call this whenever the model has completed another "epoch" of learning. We regard o...
11685c2c0a79e8e40375b55b1cfc74bc005cf1ed72fcc1a01db335b6294dd611
def redo_theano(self): '\n Recompiles Theano functions used by this monitor.\n\n This is called any time we need to evaluate the channels and\n the channel definitions have changed since last we called it,\n or if the theano functions are unavailable for any other reason\n (first ...
Recompiles Theano functions used by this monitor. This is called any time we need to evaluate the channels and the channel definitions have changed since last we called it, or if the theano functions are unavailable for any other reason (first time they are needed after construction or deserialization, etc.) All chan...
pylearn2/monitor.py
redo_theano
fxyu/pylearn2
2,045
python
def redo_theano(self): '\n Recompiles Theano functions used by this monitor.\n\n This is called any time we need to evaluate the channels and\n the channel definitions have changed since last we called it,\n or if the theano functions are unavailable for any other reason\n (first ...
def redo_theano(self): '\n Recompiles Theano functions used by this monitor.\n\n This is called any time we need to evaluate the channels and\n the channel definitions have changed since last we called it,\n or if the theano functions are unavailable for any other reason\n (first ...
b7dc7209cb1fa893730e5c7ef5f33a8603695bab1497d367b9894da52148f1c1
def register_names_to_del(self, names): '\n Register names of fields that should be deleted before pickling.\n\n Parameters\n ----------\n names : list\n A list of attribute names as strings.\n ' for name in names: if (name not in self.names_to_del): ...
Register names of fields that should be deleted before pickling. Parameters ---------- names : list A list of attribute names as strings.
pylearn2/monitor.py
register_names_to_del
fxyu/pylearn2
2,045
python
def register_names_to_del(self, names): '\n Register names of fields that should be deleted before pickling.\n\n Parameters\n ----------\n names : list\n A list of attribute names as strings.\n ' for name in names: if (name not in self.names_to_del): ...
def register_names_to_del(self, names): '\n Register names of fields that should be deleted before pickling.\n\n Parameters\n ----------\n names : list\n A list of attribute names as strings.\n ' for name in names: if (name not in self.names_to_del): ...
00c91be01a8bb81a212b868b6f964d45f068378bfa8b721374c6abe373fdf1ec
def __getstate__(self): "\n In order to avoid pickling a copy of the dataset whenever a\n monitor is saved, the __getstate__ method replaces the dataset\n field with the dataset's yaml source. This is not a perfect\n solution because it won't work with job resuming, which would\n ...
In order to avoid pickling a copy of the dataset whenever a monitor is saved, the __getstate__ method replaces the dataset field with the dataset's yaml source. This is not a perfect solution because it won't work with job resuming, which would require saving the state of the dataset's random number generator. Like in...
pylearn2/monitor.py
__getstate__
fxyu/pylearn2
2,045
python
def __getstate__(self): "\n In order to avoid pickling a copy of the dataset whenever a\n monitor is saved, the __getstate__ method replaces the dataset\n field with the dataset's yaml source. This is not a perfect\n solution because it won't work with job resuming, which would\n ...
def __getstate__(self): "\n In order to avoid pickling a copy of the dataset whenever a\n monitor is saved, the __getstate__ method replaces the dataset\n field with the dataset's yaml source. This is not a perfect\n solution because it won't work with job resuming, which would\n ...
029c5904fcf1a3f3ebb0d00e953c4da3f374c7267ca411042915a314429cd5db
def __setstate__(self, d): '\n Sets the object to have the state described by `d`.\n\n Parameters\n ----------\n d : dict\n A dictionary mapping string names of fields to values for\n these fields.\n ' if ('_dataset' in d): d['_datasets'] = [d['_d...
Sets the object to have the state described by `d`. Parameters ---------- d : dict A dictionary mapping string names of fields to values for these fields.
pylearn2/monitor.py
__setstate__
fxyu/pylearn2
2,045
python
def __setstate__(self, d): '\n Sets the object to have the state described by `d`.\n\n Parameters\n ----------\n d : dict\n A dictionary mapping string names of fields to values for\n these fields.\n ' if ('_dataset' in d): d['_datasets'] = [d['_d...
def __setstate__(self, d): '\n Sets the object to have the state described by `d`.\n\n Parameters\n ----------\n d : dict\n A dictionary mapping string names of fields to values for\n these fields.\n ' if ('_dataset' in d): d['_datasets'] = [d['_d...
2f63dfc76cf601aa15afa52145f8c48b62e0a8a07763293a9e633adb536f9d18
def add_channel(self, name, ipt, val, dataset=None, prereqs=None, data_specs=None): '\n Asks the monitor to start tracking a new value. Can be called\n even after the monitor is already in use.\n\n Parameters\n ----------\n name : str\n The display name in the monitor....
Asks the monitor to start tracking a new value. Can be called even after the monitor is already in use. Parameters ---------- name : str The display name in the monitor. ipt : tensor_like The symbolic tensor which should be clamped to the data. (or a list/tuple containing symbolic tensors, following the ...
pylearn2/monitor.py
add_channel
fxyu/pylearn2
2,045
python
def add_channel(self, name, ipt, val, dataset=None, prereqs=None, data_specs=None): '\n Asks the monitor to start tracking a new value. Can be called\n even after the monitor is already in use.\n\n Parameters\n ----------\n name : str\n The display name in the monitor....
def add_channel(self, name, ipt, val, dataset=None, prereqs=None, data_specs=None): '\n Asks the monitor to start tracking a new value. Can be called\n even after the monitor is already in use.\n\n Parameters\n ----------\n name : str\n The display name in the monitor....
cb38977ab1b8b42b6558358c174630fbc679a77afc9c0b0feb0d47b654a29b6d
def _sanity_check(self): "\n Sometimes we serialize models and then load them somewhere else\n but still try to use their Monitor, and the Monitor is in a\n mangled state. I've added some calls to _sanity_check to try to\n catch when that happens. Not sure what to do for a long term\n ...
Sometimes we serialize models and then load them somewhere else but still try to use their Monitor, and the Monitor is in a mangled state. I've added some calls to _sanity_check to try to catch when that happens. Not sure what to do for a long term fix. I think it requires making theano graphs serializable first.
pylearn2/monitor.py
_sanity_check
fxyu/pylearn2
2,045
python
def _sanity_check(self): "\n Sometimes we serialize models and then load them somewhere else\n but still try to use their Monitor, and the Monitor is in a\n mangled state. I've added some calls to _sanity_check to try to\n catch when that happens. Not sure what to do for a long term\n ...
def _sanity_check(self): "\n Sometimes we serialize models and then load them somewhere else\n but still try to use their Monitor, and the Monitor is in a\n mangled state. I've added some calls to _sanity_check to try to\n catch when that happens. Not sure what to do for a long term\n ...
366455c8da314b173b276c45242495837a068addf71d1065cc167da59844afa5
@classmethod def get_monitor(cls, model): "\n Returns a model's monitor. If the model doesn't have a monitor\n yet, installs one and returns that.\n\n Parameters\n ----------\n model : object\n An object that implements the `Model` interface specified\n in `p...
Returns a model's monitor. If the model doesn't have a monitor yet, installs one and returns that. Parameters ---------- model : object An object that implements the `Model` interface specified in `pylearn2.models`.
pylearn2/monitor.py
get_monitor
fxyu/pylearn2
2,045
python
@classmethod def get_monitor(cls, model): "\n Returns a model's monitor. If the model doesn't have a monitor\n yet, installs one and returns that.\n\n Parameters\n ----------\n model : object\n An object that implements the `Model` interface specified\n in `p...
@classmethod def get_monitor(cls, model): "\n Returns a model's monitor. If the model doesn't have a monitor\n yet, installs one and returns that.\n\n Parameters\n ----------\n model : object\n An object that implements the `Model` interface specified\n in `p...
940b096da2fa58243757ee958283c0f9284ddd904a09a006bbcce2d397b040a2
@property def batch_size(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n batch_size : int\n The size of the batches used for monitoring\n ' return self._batch_size
.. todo:: WRITEME Returns ------- batch_size : int The size of the batches used for monitoring
pylearn2/monitor.py
batch_size
fxyu/pylearn2
2,045
python
@property def batch_size(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n batch_size : int\n The size of the batches used for monitoring\n ' return self._batch_size
@property def batch_size(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n batch_size : int\n The size of the batches used for monitoring\n ' return self._batch_size<|docstring|>.. todo:: WRITEME Returns ------- batch_size : int The size ...
690472128f13d949f1b900f7b8f1f1fa9dc2b1da63795658c1e59707716e7b83
@property def num_batches(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n num_batches : int\n The number of batches used for monitoring\n ' return self._num_batches
.. todo:: WRITEME Returns ------- num_batches : int The number of batches used for monitoring
pylearn2/monitor.py
num_batches
fxyu/pylearn2
2,045
python
@property def num_batches(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n num_batches : int\n The number of batches used for monitoring\n ' return self._num_batches
@property def num_batches(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n num_batches : int\n The number of batches used for monitoring\n ' return self._num_batches<|docstring|>.. todo:: WRITEME Returns ------- num_batches : int The num...
1ecadaadb497038af85c81640a79426e0bdae6942c2361e51efc912e3c91e4ca
def setup(self, dataset, cost, batch_size, num_batches=None, extra_costs=None, mode='sequential', obj_prereqs=None, cost_monitoring_args=None): "\n Sets up the monitor for a cost minimization problem.\n Adds channels defined by both the model and the cost for\n the specified dataset(s), as well...
Sets up the monitor for a cost minimization problem. Adds channels defined by both the model and the cost for the specified dataset(s), as well as a channel called 'objective' defined by the costs' __call__ method. Parameters ---------- dataset : pylearn2.datasets.Dataset Dataset or dictionary mapping string names...
pylearn2/monitor.py
setup
fxyu/pylearn2
2,045
python
def setup(self, dataset, cost, batch_size, num_batches=None, extra_costs=None, mode='sequential', obj_prereqs=None, cost_monitoring_args=None): "\n Sets up the monitor for a cost minimization problem.\n Adds channels defined by both the model and the cost for\n the specified dataset(s), as well...
def setup(self, dataset, cost, batch_size, num_batches=None, extra_costs=None, mode='sequential', obj_prereqs=None, cost_monitoring_args=None): "\n Sets up the monitor for a cost minimization problem.\n Adds channels defined by both the model and the cost for\n the specified dataset(s), as well...
f85464a65c5c915473fbf9327ef1016bd32799829c60f8243d2ece0405bf8811
def __str__(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n s : str\n A reasonably human-readable string representation of the object.\n ' try: graph_input_str = str(self.graph_input) except Exception: graph_input_str = '<bad ...
.. todo:: WRITEME Returns ------- s : str A reasonably human-readable string representation of the object.
pylearn2/monitor.py
__str__
fxyu/pylearn2
2,045
python
def __str__(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n s : str\n A reasonably human-readable string representation of the object.\n ' try: graph_input_str = str(self.graph_input) except Exception: graph_input_str = '<bad ...
def __str__(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n s : str\n A reasonably human-readable string representation of the object.\n ' try: graph_input_str = str(self.graph_input) except Exception: graph_input_str = '<bad ...
81214f28ebd419608ee4b250b304d277448185a487f14cf51aa1f31dd92408a7
def __getstate__(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n d : dict\n A dictionary mapping the string names of the fields of the class\n to values appropriate for pickling.\n ' if hasattr(self, 'val'): doc = get_monitor_d...
.. todo:: WRITEME Returns ------- d : dict A dictionary mapping the string names of the fields of the class to values appropriate for pickling.
pylearn2/monitor.py
__getstate__
fxyu/pylearn2
2,045
python
def __getstate__(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n d : dict\n A dictionary mapping the string names of the fields of the class\n to values appropriate for pickling.\n ' if hasattr(self, 'val'): doc = get_monitor_d...
def __getstate__(self): '\n .. todo::\n\n WRITEME\n\n Returns\n -------\n d : dict\n A dictionary mapping the string names of the fields of the class\n to values appropriate for pickling.\n ' if hasattr(self, 'val'): doc = get_monitor_d...