prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
return 1
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
return 0
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
__init__
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
delete
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
generate
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
walkSpeed
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
start
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
__decideNextState
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
enterOff
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
exitOff
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
enterLonely
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
exitLonely
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
__goForAWalk
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
enterChatty
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
exitChatty
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
enterWalk
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
exitWalk
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
avatarEnterNextState
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
avatarExitNextState
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
handleHolidays
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
getCCLocation
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
enterTransitionToCostume
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import * import DistributedCCharBaseAI from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import random from toontown.toonba...
exitTransitionToCostume
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime <|fim▁hole|>from flask import current_app from flask.cli import with_appcontext from invenio_db import db from hepdata.cli import fix from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords from hepdata...
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime from flask import current_app from flask.cli import with_appcontext from invenio_db import db from hepdata.cli import fix from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords from hepdata.modules.su...
missing_submissions = DataSubmission.query \ .join(HEPSubmission, HEPSubmission.publication_recid == DataSubmission.publication_recid) \ .filter( DataSubmission.associated_recid == None, DataSubmission.publication_inspire_id == None, DataSubmission.version == HEPS...
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime from flask import current_app from flask.cli import with_appcontext from invenio_db import db from hepdata.cli import fix from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords from hepdata.modules.su...
print("No datasubmissions found with missing record or inspire ids.") return
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime from flask import current_app from flask.cli import with_appcontext from invenio_db import db from hepdata.cli import fix from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords from hepdata.modules.su...
submissions_by_publication[submission.publication_recid].append(submission)
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime from flask import current_app from flask.cli import with_appcontext from invenio_db import db from hepdata.cli import fix from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords from hepdata.modules.su...
submissions_by_publication[submission.publication_recid] = [submission]
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime from flask import current_app from flask.cli import with_appcontext from invenio_db import db from hepdata.cli import fix from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords from hepdata.modules.su...
generate_doi_for_table.delay(submission.doi) print(f"Generated DOI {submission.doi}")
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime from flask import current_app from flask.cli import with_appcontext from invenio_db import db from hepdata.cli import fix from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords from hepdata.modules.su...
print(f"Would generate DOI {submission.doi}")
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime from flask import current_app from flask.cli import with_appcontext from invenio_db import db from hepdata.cli import fix from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords from hepdata.modules.su...
create_missing_datasubmission_records
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>__version_info__ = ( 1, 12, 0 )<|fim▁end|>
__version__ = "1.12.0"
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): <|fim_middle|> <|fim▁end|>
def test_transpose_parameters_into_template(self): self.maxDiff = None template = "kinto.tpl" dest = tempfile.mktemp() config.render_template(template, dest, secret='secret', storage_backend='storage_backend', ...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
self.maxDiff = None template = "kinto.tpl" dest = tempfile.mktemp() config.render_template(template, dest, secret='secret', storage_backend='storage_backend', cache_backend='cache_backend', ...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
dest = os.path.join(tempfile.mkdtemp(), 'config', 'kinto.ini') config.render_template("kinto.tpl", dest, secret='secret', storage_backend='storage_backend', cache_backend='cache_backend', ...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
config.init('kinto.ini', 'postgresql') args, kwargs = list(mocked_render_template.call_args) self.assertEquals(type(kwargs['secret']), six.text_type)
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
config.init('kinto.ini', 'postgresql') args, kwargs = list(mocked_render_template.call_args) self.assertEquals(args, ('kinto.tpl', 'kinto.ini')) postgresql_url = "postgres://postgres:postgres@localhost/postgres" self.assertDictEqual(kwargs, { 'secret': kwargs['secre...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
config.init('kinto.ini', 'redis') args, kwargs = list(mocked_render_template.call_args) self.assertEquals(args, ('kinto.tpl', 'kinto.ini')) redis_url = "redis://localhost:6379" self.maxDiff = None # See the full diff in case of error self.assertDictEqual(kwargs, { ...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
config.init('kinto.ini', 'memory') args, kwargs = list(mocked_render_template.call_args) self.assertEquals(args, ('kinto.tpl', 'kinto.ini')) self.assertDictEqual(kwargs, { 'secret': kwargs['secret'], 'storage_backend': 'kinto.core.storage.memory', 'c...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
temp_path = tempfile.mkdtemp() destination = os.path.join(temp_path, 'config/kinto.ini') config.render_template('kinto.tpl', destination, **{ 'secret': "abcd-ceci-est-un-secret", 'storage_backend': 'kinto.core.storage.memory', 'cache_backend': 'kinto.core.cach...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
temp_path = tempfile.mkdtemp() os.chdir(temp_path) config.render_template('kinto.tpl', 'kinto.ini', **{ 'secret': "abcd-ceci-est-un-secret", 'storage_backend': 'kinto.core.storage.memory', 'cache_backend': 'kinto.core.cache.memory', 'permission_bac...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def <|fim_middle|>(self): self.maxDiff = None ...
test_transpose_parameters_into_template
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
test_create_destination_directory
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
test_hmac_secret_is_text
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
test_init_postgresql_values
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
test_init_redis_values
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
test_init_memory_values
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
test_render_template_creates_directory_if_necessary
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs import mock import os import tempfile import unittest from time import strftime import six from kinto import config from kinto import __version__ class ConfigTest(unittest.TestCase): def test_transpose_parameters_into_template(self): ...
test_render_template_works_with_file_in_cwd
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
import re from openscrapers.modules import cleantitle, source_utils, cfscrape
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
def __init__(self): self.priority = 1 self.language = ['en'] self.domains = ['coolmoviezone.online'] self.base_link = 'https://coolmoviezone.online' self.scraper = cfscrape.create_scraper() def movie(self, imdb, title, localtitle, aliases, year): try: ...
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
self.priority = 1 self.language = ['en'] self.domains = ['coolmoviezone.online'] self.base_link = 'https://coolmoviezone.online' self.scraper = cfscrape.create_scraper()
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
try: title = cleantitle.geturl(title) url = self.base_link + '/%s-%s' % (title, year) return url except: return
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
try: sources = [] r = self.scraper.get(url).content match = re.compile('<td align="center"><strong><a href="(.+?)"').findall(r) for url in match: host = url.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0]....
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
return url
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
__init__
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
movie
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
sources
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#....
resolve
<|file_name|>test_dauth.py<|end_file_name|><|fim▁begin|>from nintendo import dauth, switch from anynet import http import pytest CHALLENGE_REQUEST = \ "POST /v6/challenge HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ <|fim▁hole|> "Accept: */*\r\n" \ "X-Nintendo-PowerState: FA\r\n" \ "Content-Length: 17\r...
"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" \
<|file_name|>test_dauth.py<|end_file_name|><|fim▁begin|> from nintendo import dauth, switch from anynet import http import pytest CHALLENGE_REQUEST = \ "POST /v6/challenge HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ "User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" ...
async def handler(client, request): if request.path == "/v6/challenge": assert request.encode().decode() == CHALLENGE_REQUEST response = http.HTTPResponse(200) response.json = { "challenge": "vaNgVZZH7gUse0y3t8Cksuln-TAVtvBmcD-ow59qp0E=", "data": "dlL7ZBNSLmYo1hUlKYZiUA==" } return res...
<|file_name|>test_dauth.py<|end_file_name|><|fim▁begin|> from nintendo import dauth, switch from anynet import http import pytest CHALLENGE_REQUEST = \ "POST /v6/challenge HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ "User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" ...
if request.path == "/v6/challenge": assert request.encode().decode() == CHALLENGE_REQUEST response = http.HTTPResponse(200) response.json = { "challenge": "vaNgVZZH7gUse0y3t8Cksuln-TAVtvBmcD-ow59qp0E=", "data": "dlL7ZBNSLmYo1hUlKYZiUA==" } return response else: assert request.enco...
<|file_name|>test_dauth.py<|end_file_name|><|fim▁begin|> from nintendo import dauth, switch from anynet import http import pytest CHALLENGE_REQUEST = \ "POST /v6/challenge HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ "User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" ...
assert request.encode().decode() == CHALLENGE_REQUEST response = http.HTTPResponse(200) response.json = { "challenge": "vaNgVZZH7gUse0y3t8Cksuln-TAVtvBmcD-ow59qp0E=", "data": "dlL7ZBNSLmYo1hUlKYZiUA==" } return response
<|file_name|>test_dauth.py<|end_file_name|><|fim▁begin|> from nintendo import dauth, switch from anynet import http import pytest CHALLENGE_REQUEST = \ "POST /v6/challenge HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ "User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" ...
assert request.encode().decode() == TOKEN_REQUEST response = http.HTTPResponse(200) response.json = { "device_auth_token": "device token" } return response
<|file_name|>test_dauth.py<|end_file_name|><|fim▁begin|> from nintendo import dauth, switch from anynet import http import pytest CHALLENGE_REQUEST = \ "POST /v6/challenge HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ "User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" ...
test_dauth
<|file_name|>test_dauth.py<|end_file_name|><|fim▁begin|> from nintendo import dauth, switch from anynet import http import pytest CHALLENGE_REQUEST = \ "POST /v6/challenge HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ "User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" ...
handler
<|file_name|>base.py<|end_file_name|><|fim▁begin|>""" Django settings for lwc project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproj...
]
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
images after preprocessing.
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
"""Runs an iterative process on the CIFAR-10 classification task. This method will load and pre-process dataset and construct a model used for the task. It then uses `iterative_process_builder` to create an iterative process that it applies to the task, using `federated_research.utils.training_loop`. We as...
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
return tff.learning.from_keras_model( keras_model=model_builder(), input_spec=input_spec, loss=loss_builder(), metrics=metrics_builder())
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
del round_num return evaluate_fn(model_weights, [cifar_test])
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
return evaluate_fn(model_weights, [cifar_test])
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
client_weight_fn = tff.learning.ClientWeighting.UNIFORM
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
client_weight_fn = tff.learning.ClientWeighting.NUM_EXAMPLES
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
run_federated
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
tff_model_fn
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
validation_fn
<|file_name|>federated_cifar10.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
test_fn
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Provides functionality to emulate keyboard presses on host machine. For more details about this component, please refer to the documentation at https://home-assistant.io/components/keyboard/ """ import voluptuous as vol from homeassistant.const import ( SE...
keyboard.tap_key(keyboard.media_next_track_key), schema=TAP_KEY_SCHEMA)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Provides functionality to emulate keyboard presses on host machine. For more details about this component, please refer to the documentation at https://home-assistant.io/components/keyboard/ """ import voluptuous as vol from homeassistant.const import ( SE...
"""Listen for keyboard events.""" import pykeyboard # pylint: disable=import-error keyboard = pykeyboard.PyKeyboard() keyboard.special_key_assignment() hass.services.register(DOMAIN, SERVICE_VOLUME_UP, lambda service: keyboard.tap_key(keyboard...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Provides functionality to emulate keyboard presses on host machine. For more details about this component, please refer to the documentation at https://home-assistant.io/components/keyboard/ """ import voluptuous as vol from homeassistant.const import ( SE...
setup
<|file_name|>worker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2013 ASMlover. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: #<|fim▁hole|># # * ...
# * Redistributions of source code must retain the above copyright # notice, this list ofconditions and the following disclaimer.
<|file_name|>worker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2013 ASMlover. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributio...
ctx = zmq.Context() worker = ctx.socket(zmq.PULL) worker.connect('tcp://localhost:5555') sinker = ctx.socket(zmq.PUSH) sinker.connect('tcp://localhost:6666') print 'all workers are ready ...' while True: try: msg = worker.recv() print 'begin to work on task use `%s ms`' % msg time...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tform.save() messages.add_message(request, messages.SUCCESS, 'Tool Type Configuration Successfully Created.',
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
if request.method == 'POST': tform = ToolTypeForm(request.POST, instance=Tool_Type()) if tform.is_valid(): tform.save() messages.add_message(request, messages.SUCCESS, 'Tool Type Configuration Successfully Crea...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tool_type = Tool_Type.objects.get(pk=ttid) if request.method == 'POST': tform = ToolTypeForm(request.POST, instance=tool_type) if tform.is_valid(): tform.save() messages.add_message(request, messages.SUCCESS, ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
confs = Tool_Type.objects.all().order_by('name') add_breadcrumb(title="Tool Type List", top_level=not len(request.GET), request=request) return render(request, 'dojo/tool_type.html', {'confs': confs, })
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tform = ToolTypeForm(request.POST, instance=Tool_Type()) if tform.is_valid(): tform.save() messages.add_message(request, messages.SUCCESS, 'Tool Type Configuration Successfully Created.', ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tform.save() messages.add_message(request, messages.SUCCESS, 'Tool Type Configuration Successfully Created.', extra_tags='alert-success') return HttpResponseRedirect(reverse('tool_type'...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tform = ToolTypeForm() add_breadcrumb(title="New Tool Type Configuration", top_level=False, request=request)
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tform = ToolTypeForm(request.POST, instance=tool_type) if tform.is_valid(): tform.save() messages.add_message(request, messages.SUCCESS, 'Tool Type Configuration Successfully Updated.', ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tform.save() messages.add_message(request, messages.SUCCESS, 'Tool Type Configuration Successfully Updated.', extra_tags='alert-success') return HttpResponseRedirect(reverse('tool_type'...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tform = ToolTypeForm(instance=tool_type)
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
new_tool_type
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
edit_tool_type
<|file_name|>views.py<|end_file_name|><|fim▁begin|># # product import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from dojo.utils import add_brea...
tool_type
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (c) 2010-2017, GEM Foundation, G. Weatherill, M. Pagani, # D. Monelli. # # The Hazard Modeller's Toolkit is free software: you can redistribute # it and/or modify it under...
#is released as a prototype implementation on behalf of # scientists and engineers working within the GEM Foundation (Global #Earthquake Model). #
<|file_name|>setAwayMessageEvent.py<|end_file_name|><|fim▁begin|>from common.log import logUtils as log from constants import clientPackets from constants import serverPackets def handle(userToken, packetData): # get token data username = userToken.username # Read packet data packetData = clientPackets.setAwayMe...
fokaMessage = "Your away message is now: {}".format(packetData["awayMessage"]) userToken.enqueue(serverPackets.sendMessage("FokaBot", username, fokaMessage)) log.info("{} has changed their away message to: {}".format(username, packetData["awayMessage"]))
<|file_name|>setAwayMessageEvent.py<|end_file_name|><|fim▁begin|>from common.log import logUtils as log from constants import clientPackets from constants import serverPackets def handle(userToken, packetData): # get token data <|fim_middle|> <|fim▁end|>
username = userToken.username # Read packet data packetData = clientPackets.setAwayMessage(packetData) # Set token away message userToken.awayMessage = packetData["awayMessage"] # Send private message from fokabot if packetData["awayMessage"] == "": fokaMessage = "Your away message has been reset" else: ...