code stringlengths 281 23.7M |
|---|
def extractKaparinTranslations(item):
(vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title'])
if ((not (chp or vol)) or ('preview' in item['title'].lower())):
return False
if ('WATTT' in item['tags']):
return buildReleaseMessageWithType(item, 'WATTT', vol, chp, frag=frag,... |
def get_material(mode):
if (modes[mode].material == ''):
return None
name = modes[mode].material
path = os.path.join(os.path.dirname(__file__), 'resources/materials.blend', 'Material')
if (('bevel' in mode) or ('thickness' in mode)):
path = os.path.join(os.path.dirname(__file__), 'resour... |
class TestGaussianPrivacyEngine():
def _init_privacy_engine(self, alphas=[(1 + (x / 10.0)) for x in range(1, 100)], noise_multiplier=1.0, target_delta=1e-05, users_per_round=10, num_total_users=10, global_model_parameter_val=5.0, noise_seed=0):
privacy_setting = PrivacySetting(alphas=alphas, noise_multiplie... |
def extractLittleShanksTranslations(item):
(vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title'])
if ((not (chp or vol or frag)) or ('preview' in item['title'].lower())):
return None
if ('Rebirth Thief' in item['tags']):
return buildReleaseMessageWithType(item, 'Rebirth ... |
def get_databases():
dargs = keepmenu.CONF.items('database')
args_dict = dict(dargs)
dbases = [i for i in args_dict if i.startswith('database')]
dbs = []
for dbase in dbases:
dbn = args_dict[dbase]
idx = dbase.rsplit('_', 1)[(- 1)]
try:
keyfile = args_dict[f'keyfi... |
class OptionPlotoptionsSankeySonificationContexttracksActivewhen(Options):
def crossingDown(self):
return self._config_get(None)
def crossingDown(self, num: float):
self._config(num, js_type=False)
def crossingUp(self):
return self._config_get(None)
def crossingUp(self, num: floa... |
class OptionXaxisTitleStyle(Options):
def color(self):
return self._config_get('#666666')
def color(self, text: str):
self._config(text, js_type=False)
def fontSize(self):
return self._config_get('0.8em')
def fontSize(self, num: float):
self._config(num, js_type=False) |
_all_methods(bind_proxy)
class BuildChrootProxy(BaseProxy):
def get(self, build_id, chrootname):
endpoint = '/build-chroot'
params = {'build_id': build_id, 'chrootname': chrootname}
response = self.request.send(endpoint=endpoint, params=params)
return munchify(response)
def get_l... |
class RMTTestReqNote(object):
def rmttest_positive_01(self):
(config, req) = create_parameters()
rt = ReqNote(config)
(name, value) = rt.rewrite('Note-test', req)
assert ('Note' == name)
assert (value is None)
def rmttest_positive_02(self):
(config, req) = create_... |
def test_simple_model_can_from_dict():
model = Maxout(5, 10, nP=2).initialize()
model_dict = model.to_dict()
assert model.can_from_dict(model_dict)
assert Maxout(5, 10, nP=2).can_from_dict(model_dict)
assert (not Maxout(10, 5, nP=2).can_from_dict(model_dict))
assert Maxout(5, nP=2).can_from_dict... |
def _generate_apidocs_aea_modules() -> None:
for module_path in filter(is_not_dir, Path(AEA_DIR).rglob('*')):
print(f'Processing {module_path}... ', end='')
if should_skip(module_path):
continue
parents = module_path.parts[:(- 1)]
parents_without_root = module_path.parts[... |
def make_tx(input_txo_1: Output, inclusion_proof_1, input_txo_2: Output, inclusion_proof_2) -> (Transaction, Output, Output):
fee = Field.random(1, 10)
input_val = 0
if (input_txo_1 is not None):
input_val += input_txo_1.v
if (input_txo_2 is not None):
input_val += input_txo_2.v
outp... |
class AutumnWindEffect(GenericAction):
def apply_action(self):
(src, tgt) = (self.source, self.target)
g = self.game
catnames = ('cards', 'showncards', 'equips')
cats = [getattr(tgt, i) for i in catnames]
card = g.user_input([src], ChoosePeerCardInputlet(self, tgt, catnames))... |
class DefinedVarsCollector(ast.NodeVisitor):
def __init__(self, defined_vars, defined_constraints):
self.defined_vars = defined_vars
self.defined_constraints = defined_constraints
def visit_Name(self, node):
if (type(node.ctx) is ast.Store):
self.defined_vars.add(node.id)
... |
def fetch_production_capacity(zone_key: ZoneKey, target_datetime: datetime, session: Session) -> (dict[(str, Any)] | None):
r: Response = session.get(REQUEST_URL)
if (not r.ok):
raise ValueError(f'Failed to fetch capacity data for DE at {target_datetime.date()}')
data = r.json()
all_capacity = {... |
()
def graph_with_input_arguments_different_variable_types_2(arg1, arg2, variable_v, variable_u, variable_x, variable_y) -> Tuple[(List[BasicBlock], ControlFlowGraph)]:
instructions = [Branch(Condition(OperationType.less, [arg2[0], arg1[0]])), Phi(arg2[2], [arg2[0], arg1[0]]), Branch(Condition(OperationType.greater... |
def test_history(testbot):
assert ('up' in testbot.exec_command('!uptime'))
assert ('uptime' in testbot.exec_command('!history'))
orig_sender = testbot.bot.sender
testbot.bot.sender = testbot.bot.build_identifier('non_default_person')
testbot.push_message('!history')
with pytest.raises(Empty):
... |
class LMQLModule(object):
def __init__(self, compiled_file, lmql_code=None, output_variables=None):
self.compiled_file = compiled_file
self._code = None
self.lmql_code = lmql_code
self.output_variables = (output_variables or [])
def load(self):
sys.path.append(os.path.dir... |
class ResetStrategy(object):
def __init__(self, port, reset_delay=DEFAULT_RESET_DELAY):
self.port = port
self.reset_delay = reset_delay
def __call__():
pass
def _setDTR(self, state):
self.port.setDTR(state)
def _setRTS(self, state):
self.port.setRTS(state)
... |
def exposed_streaming_incremental_delete_invalid_urls():
print('Purge invalid URLs')
rulemgr = RuleManager()
bad_tot = 1
step = 2500
bad_tot = 1
out_sampler = 1
try:
with db.session_context(name='query_sess', override_timeout_ms=(((1000 * 60) * 60) * 15)) as sess:
print('... |
def extractLazysakuratranslationsCom(item):
(vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title'])
if ((not (chp or vol)) or ('preview' in item['title'].lower())):
return None
tagmap = [('PRC', 'PRC', 'translated'), ('Loiterous', 'Loiterous', 'oel')]
for (tagname, name, tl_t... |
def test_get_features_to_drop():
sel = ProbeFeatureSelection(estimator=LogisticRegression(), n_probes=1)
sel.feature_importances_ = pd.Series([11, 12, 9, 10], index=['var1', 'var2', 'var3', 'probe'])
sel.probe_features_ = pd.DataFrame({'probe': [1, 1, 1, 1, 1]})
sel.variables_ = ['var1', 'var2', 'var3']... |
def construct_command(operation: dict) -> list:
cmd = []
if ('bufferingMode' in operation):
cmd += ['-B', operation['bufferingMode']]
if ('format' in operation):
cmd += ['-f', operation['format']]
if ('outputFile' in operation):
cmd += ['-o', operation['outputFile']]
if (('de... |
class Page(AbstractCrudObject):
def __init__(self, fbid=None, parent_id=None, api=None):
self._isPage = True
super(Page, self).__init__(fbid, parent_id, api)
class Field(AbstractObject.Field):
about = 'about'
access_token = 'access_token'
ad_campaign = 'ad_campaign'
... |
_bad_request
def price_per_unit_by_presentation(request, entity_code, bnf_code):
date = _specified_or_last_date(request, 'prescribing')
presentation = get_object_or_404(Presentation, pk=bnf_code)
primary_code = _get_primary_substitutable_bnf_code(bnf_code)
if (bnf_code != primary_code):
url = re... |
class MayaviOffscreen(MayaviApp):
def _script_default(self):
from mayavi.plugins.script import Script
from mayavi.core.off_screen_engine import OffScreenEngine
engine = OffScreenEngine()
engine.start()
s = Script(engine=engine)
return s
def setup_logger(self):
... |
class initialize():
def __init__(self, config_path: Optional[str]=_UNSPECIFIED_, job_name: Optional[str]=None, caller_stack_depth: int=1) -> None:
from hydra import initialize as real_initialize
message = 'hydra.experimental.initialize() is no longer experimental. Use hydra.initialize()'
if ... |
def plot_boxes(*, curr_for_plots: Boxes, ref_for_plots: Optional[Boxes], color_options: ColorOptions):
current_color = color_options.get_current_data_color()
reference_color = color_options.get_reference_data_color()
fig = go.Figure()
trace = go.Box(lowerfence=curr_for_plots.mins, q1=curr_for_plots.lowe... |
def run():
fn = '07_ref_rx_phosphine_def2tzvp_reopt.xyz'
geom = geom_from_xyz_file(fn)
bm = get_bond_mat(geom)
print(bm)
node_attrs = {i: {'atom': atom} for (i, atom) in enumerate(geom.atoms)}
g = nx.from_numpy_array(bm)
nx.set_node_attributes(g, node_attrs)
prod_fn = '01_ref_rx_product_... |
class DeptBase(SchemaBase):
name: str
parent_id: (int | None) = Field(default=None, description='ID')
sort: int = Field(default=0, ge=0, description='')
leader: (str | None) = None
phone: (CustomPhoneNumber | None) = None
email: (EmailStr | None) = None
status: StatusType = Field(default=Sta... |
class OpticalSystem(OpticalElement):
def __init__(self, optical_elements):
self.optical_elements = optical_elements
def forward(self, wavefront):
wf = wavefront
for optical_element in self.optical_elements:
wf = optical_element.forward(wf)
return wf
def backward(s... |
def init(target_bytes: bytes):
symbols.spim_context.fillDefaultBannedSymbols()
if options.opts.libultra_symbols:
symbols.spim_context.globalSegment.fillLibultraSymbols()
if options.opts.ique_symbols:
symbols.spim_context.globalSegment.fillIQueSymbols()
if options.opts.hardware_regs:
... |
class PyTorchEstimator(Estimator):
def __init__(self, statement_set: StatementSet, model: torch.nn.Module, loss: Loss, optimizer: OPTIMIZER_CREATOR_T, worker_num: int, feature_cols: List[str], label_col: str, max_epochs: int=1, lr_scheduler_creator: Optional[LR_SCHEDULER_CREATOR_T]=None, batch_size: Optional[int]=3... |
def gen_function_call(func_attrs, backend_spec, indent=' '):
x = func_attrs['inputs'][0]
outputs = func_attrs['outputs']
split_dim = func_attrs['split_dim']
num_splits = len(func_attrs['outputs'])
output_names = ',\n '.join([i._attrs['name'] for i in outputs])
output_shape_defs = []
ou... |
def get_input_data(config, dir):
if (config is not None):
conf = configparser.ConfigParser()
conf.optionxform = str
conf.read(config)
groups = conf.items('samples')
groups = [(g[0], os.path.abspath(os.path.expanduser(g[1]))) for g in groups]
for sample in groups:
... |
def test_analysis_raise_exception_if_convergence_step_is_not_positive_integer(template_klass, sf, building_container):
with pytest.raises(TypeError):
template_klass(container_building=building_container, reverse_selection_function=sf, model=scared.Monobit(5), convergence_step='foo', selection_function=sf)
... |
class OptionSeriesBubbleSonificationContexttracksMappingGapbetweennotes(Options):
def mapFunction(self):
return self._config_get(None)
def mapFunction(self, value: Any):
self._config(value, js_type=False)
def mapTo(self):
return self._config_get(None)
def mapTo(self, text: str):
... |
class SetDefaultWeightWidthSlantTest(object):
.parametrize('location, expected', [({'wght': 0}, 1), ({'wght': 1}, 1), ({'wght': 100}, 100), ({'wght': 1000}, 1000), ({'wght': 1001}, 1000)])
def test_wght(self, ttFont, location, expected):
set_default_weight_width_slant(ttFont, location)
assert (t... |
class serienRecCheckForRecording():
epgrefresh_instance = None
__instance = None
def __init__(self):
assert (not serienRecCheckForRecording.__instance), 'serienRecCheckForRecording is a singleton class!'
serienRecCheckForRecording.__instance = self
self.session = None
self.da... |
class Terminal(CmdModules):
def __init__(self, session):
cmd.Cmd.__init__(self)
self.session = session
self.prompt = 'weevely> '
self._load_modules()
self._load_history()
self.intro = template.Template(messages.terminal.welcome_to_s).render(path=self.session.get('path... |
class OptionSeriesNetworkgraphStatesSelectMarker(Options):
def enabled(self):
return self._config_get(None)
def enabled(self, flag: bool):
self._config(flag, js_type=False)
def enabledThreshold(self):
return self._config_get(2)
def enabledThreshold(self, num: float):
self... |
def test_analysis_config_iter_config_dict_initialisation():
expected_case_format = 'case_%d'
analysis_config = AnalysisConfig.from_dict({ConfigKeys.NUM_REALIZATIONS: 10, ConfigKeys.ITER_CASE: expected_case_format, ConfigKeys.ITER_COUNT: 42, ConfigKeys.ITER_RETRY_COUNT: 24})
assert (analysis_config.case_form... |
class RobotWebServer(object):
def __init__(self, robot, handler_class, port_number=8000):
self.content_server = None
self.handler_class = handler_class
self.handler_class.robot = robot
self.port_number = port_number
def run(self):
try:
log.info(('Started HTTP ... |
def create_customer(doc):
customer = frappe.get_doc({'doctype': 'Customer', 'customer_name': doc.patient_name, 'customer_group': (doc.customer_group or frappe.db.get_single_value('Selling Settings', 'customer_group')), 'territory': (doc.territory or frappe.db.get_single_value('Selling Settings', 'territory')), 'cus... |
class OptionPlotoptionsSankeySonificationTracksMappingHighpassFrequency(Options):
def mapFunction(self):
return self._config_get(None)
def mapFunction(self, value: Any):
self._config(value, js_type=False)
def mapTo(self):
return self._config_get(None)
def mapTo(self, text: str):
... |
class StateMemoryStorage(StateStorageBase):
def __init__(self) -> None:
self.data = {}
async def set_state(self, chat_id, user_id, state):
if hasattr(state, 'name'):
state = state.name
if (chat_id in self.data):
if (user_id in self.data[chat_id]):
... |
class Solution():
def findNumOfValidWords(self, words: List[str], puzzles: List[str]) -> List[int]:
word_count = Counter((self.mask(word) for word in words))
result = []
for word in puzzles:
(mask, first) = (self.mask(word[1:]), self.mask(word[0]))
(submask, count) = ... |
def test_dstdirs_to_youngest_phase() -> None:
all_jobs = [job_w_dstdir_phase('/plots1', job.Phase(1, 5)), job_w_dstdir_phase('/plots2', job.Phase(1, 1)), job_w_dstdir_phase('/plots2', job.Phase(3, 1)), job_w_dstdir_phase('/plots2', job.Phase(2, 1)), job_w_dstdir_phase('/plots3', job.Phase(4, 1))]
assert (manage... |
class Generator(nn.Module):
def __init__(self, latent_dim: int, n_classes: int, code_dim: int, img_size: int, channels: int) -> None:
super().__init__()
input_dim = ((latent_dim + n_classes) + code_dim)
self.init_size: int = (img_size // 4)
self.l1: nn.modules.Sequential = nn.Sequent... |
class Color(metaclass=ColorMeta):
CS_MAP = {}
DE_MAP = {}
FIT_MAP = {}
CAT_MAP = {}
CONTRAST_MAP = {}
FILTER_MAP = {}
INTERPOLATE_MAP = {}
CCT_MAP = {}
PRECISION = util.DEF_PREC
FIT = util.DEF_FIT
INTERPOLATE = util.DEF_INTERPOLATE
DELTA_E = util.DEF_DELTA_E
HARMONY =... |
def example():
c1 = ft.Container(ft.Text('Hello!', style=ft.TextThemeStyle.HEADLINE_MEDIUM), alignment=ft.alignment.center, width=200, height=200, bgcolor=ft.colors.GREEN)
c2 = ft.Container(ft.Text('Bye!', size=50), alignment=ft.alignment.center, width=200, height=200, bgcolor=ft.colors.YELLOW)
c = ft.Anima... |
class Stability_ComputeNode(ComputeNode):
_instance = None
def get_instance(cls):
if (cls._instance is None):
cls._instance = Stability_ComputeNode()
return cls._instance
def declare_user_config(cls):
user_config = AIStorage.get_instance().get_user_config()
user_c... |
class SetActiveAttributeFactory(PipeFactory):
point_scalars = String(adapts='point_scalars_name', help='The name of the active point scalars')
point_vectors = String(adapts='point_vectors_name', help='The name of the active point vectors')
point_tensors = String(adapts='point_tensors_name', help='The name o... |
class PokerEngine():
def __init__(self, table: PokerTable, small_blind: int, big_blind: int):
self.table = table
self.small_blind = small_blind
self.big_blind = big_blind
self.evaluator = Evaluator()
self.state = PokerGameState.new_hand(self.table)
self.wins_and_losse... |
class MH_Style(command_line.MISS_HIT_Back_End):
def __init__(self):
super().__init__('MH Style')
def process_wp(cls, wp):
rule_set = wp.extra_options['rule_set']
autofix = wp.options.fix
fd_tree = wp.extra_options['fd_tree']
debug_validate_links = wp.options.debug_validat... |
class OptionPlotoptionsXrangeSonificationContexttracksMappingLowpass(Options):
def frequency(self) -> 'OptionPlotoptionsXrangeSonificationContexttracksMappingLowpassFrequency':
return self._config_sub_data('frequency', OptionPlotoptionsXrangeSonificationContexttracksMappingLowpassFrequency)
def resonanc... |
class FalAdapterMixin(TeleportAdapter, metaclass=AdapterMeta):
ConnectionManager = FalConnectionManager
def __init__(self, config, db_adapter: BaseAdapter):
self.config = config
self._db_adapter = db_adapter
self._relation_data_location_cache: DataLocation = DataLocation({})
if s... |
def pohlig(E, H, P) -> int:
bases = []
resids = []
for (i, j) in factor(E.order()):
e = (i ** j)
logging.info(f' pohlig: {e}')
t = (E.order() // e)
tH = (H * t)
tP = (P * t)
dlog = bsgs(tP, tH, (0, e), '+')
bases.append(dlog)
resids.append(e)
... |
class ExcludeFieldsSerializerMixinTests(SerializerMixinTestCase):
def serialize(self, **context):
return CarModelTestSerializer(self.carmodel_model_s, context=context).data
def test_no_exclude_implicit(self):
self.assertDictEqual(self.serialize(), self.expected_complete_data)
def test_no_exc... |
class FirewallOfsList(dict):
def __init__(self):
super(FirewallOfsList, self).__init__()
def get_ofs(self, dp_id):
if (len(self) == 0):
raise ValueError('firewall sw is not connected.')
dps = {}
if (dp_id == REST_ALL):
dps = self
else:
... |
class Status(object):
def __init__(self, name, value=None):
self._name = name
self._value = value
__pnmltag__ = 'status'
def __pnmldump__(self):
return Tree(self.__pnmltag__, None, Tree('name', self._name), Tree('value', None, Tree.from_obj(self._value)))
def __pnmlload__(cls, tr... |
class ASDLSyntaxError():
def __init__(self, lineno, token=None, msg=None):
self.lineno = lineno
self.token = token
self.msg = msg
def __str__(self):
if (self.msg is None):
return ("Error at '%s', line %d" % (self.token, self.lineno))
else:
return (... |
class Game(object):
BG_TILE_IMG = 'images/brick_tile.png'
(SCREEN_WIDTH, SCREEN_HEIGHT) = (580, 500)
GRID_SIZE = 20
FIELD_SIZE = (400, 400)
CREEP_FILENAMES = [('images/bluecreep_0.png', 'images/bluecreep_45.png'), ('images/greencreep_0.png', 'images/greencreep_45.png'), ('images/yellowcreep_0.png', ... |
('/stop_match', methods=['GET', 'POST'])
_origin(allow_headers=['*'])
def stop_match():
global match_details, live_video_process
try:
socket_io.emit('kill_self', {'data': 'Sleep'})
match_details = constants.MATCH_DETAILS_TEMPLATE
return (jsonify({'response': 'Success'}), 200)
except ... |
class BadgeFormList(ResourceList):
def query(self, view_kwargs):
query_ = self.session.query(BadgeForms)
if view_kwargs.get('badge_id'):
events = safe_query_kwargs(Event, view_kwargs, 'event_id')
query_ = self.session.query(BadgeForms).filter_by(event_id=events.id)
... |
class OptionPlotoptionsSplineDatalabels(Options):
def align(self):
return self._config_get('center')
def align(self, text: str):
self._config(text, js_type=False)
def allowOverlap(self):
return self._config_get(False)
def allowOverlap(self, flag: bool):
self._config(flag,... |
def extract_quotes_li(tree: lxml.html.HtmlElement, max_quotes: int, headings: Optional[List[Text]]=None, word_blacklist: Optional[List[Text]]=None) -> List[Text]:
remove_toc(tree)
quotes_list = []
skip_to_next_heading = bool(tree.xpath('//h2|//h3'))
node_list = tree.xpath('//div/ul/li|//div/dl|//h2|//h3... |
class ProfileCacheDB():
def __init__(self, target: str, path: str=None, uri: str=None, port: str=None):
self._target = target
self._mode = CacheMode.LOCAL
self._db_commit_flag = False
self._gemm_cache_version = ait_cache_version()
self._conv_cache_version = ait_cache_version(... |
.parametrize('endpoint__monitor_level', [1])
def test_set_rule_post(dashboard_user, endpoint, session):
response = dashboard_user.post('dashboard/api/set_rule', data={'name': endpoint.name, 'value': 3})
assert (response.status_code == 200)
assert (response.data == b'OK')
endpoint = session.query(Endpoin... |
(EcsClient, '__init__')
def test_scale_action(client):
action = ScaleAction(client, CLUSTER_NAME, SERVICE_NAME)
updated_service = action.scale(5)
assert isinstance(updated_service, EcsService)
client.describe_services.assert_called_once_with(cluster_name=CLUSTER_NAME, service_name=SERVICE_NAME)
clie... |
def extractSlavetranslationWordpressCom(item):
(vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title'])
if ((not (chp or vol)) or ('preview' in item['title'].lower())):
return None
tagmap = [('PRC', 'PRC', 'translated'), ('Loiterous', 'Loiterous', 'oel')]
for (tagname, name, t... |
_loss('alpha_reg')
class AlphaRegLoss(Loss):
def __init__(self, alpha: float, inputs: List[str], lambda_alpha_l1: float, lambda_alpha_l0: float, l1_end_step: int):
super().__init__(alpha, inputs=inputs)
self.lambda_alpha_l1 = lambda_alpha_l1
self.lambda_alpha_l0 = lambda_alpha_l0
sel... |
def create_session_name(node=''):
if (node is None):
return ''
result = rospy.names.ns_join('/', node).replace(SLASH_SEP, ('%s%s' % (SLASH_SEP, SLASH_SEP)))
result = result.replace('/', SLASH_SEP)
if (len(result) > SCREEN_NAME_MAX_CHARS):
result = ('_~%s' % result[((len(result) - SCREEN_... |
def log_fortianalyzer3_filter(data, fos):
vdom = data['vdom']
log_fortianalyzer3_filter_data = data['log_fortianalyzer3_filter']
filtered_data = underscore_to_hyphen(filter_log_fortianalyzer3_filter_data(log_fortianalyzer3_filter_data))
return fos.set('log.fortianalyzer3', 'filter', data=filtered_data, ... |
.feature('unit')
.story('services', 'south', 'ingest')
class TestIngest():
def setup_method(self):
Ingest._core_management_host = ''
Ingest._core_management_port = 0
Ingest.readings_storage_async = None
Ingest.storage_async = None
Ingest._readings_stats = 0
Ingest._di... |
def _showLayer(layer):
layer = (('(' + layer) + ')')
size = (('((CGRect)[(id)' + layer) + ' bounds]).size')
width = float(fb.evaluateExpression((('(CGFloat)(' + size) + '.width)')))
height = float(fb.evaluateExpression((('(CGFloat)(' + size) + '.height)')))
if ((width == 0.0) or (height == 0.0)):
... |
def build_jobs_list(main_job_names: typing.Sequence[str], releases: typing.Sequence[str], options: dict) -> typing.List[Job]:
main_jobs = []
for job_name in main_job_names:
for release in releases:
job_class = AVAILABLE_JOBS[job_name]
if (release in job_class.skip_releases):
... |
def _downgrade_vfp_entries():
bind = op.get_bind()
session = orm.Session(bind=bind)
child_to_parents = {}
for (parent, child) in session.execute(select(included_files_table.c.parent_uid, included_files_table.c.child_uid)):
child_to_parents.setdefault(child, set()).add(parent)
full_paths = {u... |
class EfRegister(Register):
def __init__(self):
super().__init__()
self.renderfuncs[Sgr] = renderfunc.sgr
self.b = Style(Sgr(1))
self.bold = Style(Sgr(1))
self.dim = Style(Sgr(2))
self.i = Style(Sgr(3))
self.italic = Style(Sgr(3))
self.u = Style(Sgr(4)... |
def test_clean_pop(app):
app.testing = False
called = []
_request
def teardown_req(error=None):
(1 / 0)
_appcontext
def teardown_app(error=None):
called.append('TEARDOWN')
try:
with app.test_request_context():
called.append(flask.current_app.name)
exce... |
class Ticket(SoftDeletionModel):
__tablename__ = 'tickets'
__table_args__ = (db.UniqueConstraint('name', 'event_id', 'deleted_at', name='name_event_deleted_at_uc'),)
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False)
description = db.Column(db.String)
is_des... |
class ContactResponse(ModelComposed):
allowed_values = {('contact_type',): {'PRIMARY': 'primary', 'BILLING': 'billing', 'TECHNICAL': 'technical', 'SECURITY': 'security', 'EMERGENCY': 'emergency', 'GENERAL_COMPLIANCE': 'general compliance'}}
validations = {}
_property
def additional_properties_type():
... |
class TimeBasedResultsCache(ResultsCacheBase):
_cache = {}
_cache_expiration = {}
_default_expiration_in_seconds = 3600
def get(self, key):
if ((key not in self._cache) or (key not in self._cache_expiration)):
return None
if (self._cache_expiration[key] < datetime.datetime.ut... |
class SimpleGridModel(GridModel):
data = Any()
rows = Union(None, List(Instance(GridRow)))
columns = Union(None, List(Instance(GridColumn)))
def get_column_count(self):
if (self.columns is not None):
count = len(self.columns)
else:
count = len(self.data[0])
... |
def sentence_split_and_markup(text, max=50, lang='auto', speaker_lang=None):
if ((speaker_lang is not None) and (len(speaker_lang) == 1)):
if ((lang.upper() not in ['AUTO', 'MIX']) and (lang.lower() != speaker_lang[0])):
logging.debug(f'lang "{lang}" is not in speaker_lang {speaker_lang},automat... |
class Twente(flx.Widget):
def init(self):
with flx.HFix():
flx.Widget(flex=1)
with flx.VBox(flex=0, minsize=200):
with flx.GroupWidget(title='Plot options'):
flx.Label(text='Month')
self.month = flx.ComboBox(options=months, sele... |
class NeighborsConfListener(BaseConfListener):
def __init__(self, neighbors_conf):
super(NeighborsConfListener, self).__init__(neighbors_conf)
neighbors_conf.add_listener(NeighborsConf.ADD_NEIGH_CONF_EVT, self.on_add_neighbor_conf)
neighbors_conf.add_listener(NeighborsConf.REMOVE_NEIGH_CONF_... |
def test_non_symmetric_custom_medium_to_gds(tmp_path):
geometry = td.Box(size=(1, 2, 1), center=(0.5, 0, 2.5))
(nx, ny, nz) = (150, 80, 180)
x = np.linspace(0, 2, nx)
y = np.linspace((- 1), 1, ny)
z = np.linspace(2, 3, nz)
f = np.array([td.C_0])
(mx, my, mz, _) = np.meshgrid(x, y, z, f, inde... |
class OptionSeriesColumnrangeSonificationDefaultinstrumentoptionsMappingPlaydelay(Options):
def mapFunction(self):
return self._config_get(None)
def mapFunction(self, value: Any):
self._config(value, js_type=False)
def mapTo(self):
return self._config_get(None)
def mapTo(self, te... |
('builtins.open', mock_open(read_data='opened_file'))
('aea.cli.registry.push.check_is_author_logged_in')
('aea.cli.registry.push.list_missing_packages', return_value=[])
('aea.cli.registry.utils._rm_tarfiles')
('aea.cli.registry.push.os.getcwd', return_value='cwd')
('aea.cli.registry.push._compress_dir')
('aea.cli.reg... |
class OptionSeriesSunburstSonificationTracksMappingTime(Options):
def mapFunction(self):
return self._config_get(None)
def mapFunction(self, value: Any):
self._config(value, js_type=False)
def mapTo(self):
return self._config_get(None)
def mapTo(self, text: str):
self._co... |
_group.command('coverage')
('-o', '--os-filter', default='all', help='Filter rule coverage summary by OS. (E.g. windows) Default: all')
def rta_coverage(os_filter: str):
all_rules = RuleCollection.default()
triggered_rules = get_triggered_rules()
coverage_map = build_coverage_map(triggered_rules, all_rules)... |
(scope='function')
def privacy_request_awaiting_consent_email_send(db: Session, consent_policy: Policy) -> PrivacyRequest:
privacy_request = _create_privacy_request_for_policy(db, consent_policy)
privacy_request.status = PrivacyRequestStatus.awaiting_email_send
privacy_request.save(db)
(yield privacy_re... |
class OptionSeriesHistogramSonificationDefaultinstrumentoptionsMappingTime(Options):
def mapFunction(self):
return self._config_get(None)
def mapFunction(self, value: Any):
self._config(value, js_type=False)
def mapTo(self):
return self._config_get(None)
def mapTo(self, text: str... |
def delete_snapshot(repo_name, snapshot_name):
if (repo_name and snapshot_name):
configure_snapshot_repository(repo_name)
try:
logger.info(' Deleting snapshot {0} from {1} ...'.format(snapshot_name, repo_name))
es_client = create_es_client()
es_client.snapshot.del... |
def generate_lists(install_dir):
list_oftypes = set()
for uclass in loxi_globals.unified.classes:
for ofclass in uclass.version_classes.values():
for m in ofclass.members:
if (isinstance(m, ir.OFDataMember) and loxi_utils.oftype_is_list(m.oftype)):
list_of... |
class CacheActiveDirectoryView(ActiveDirectoryView):
USER_LOCKED_FILTER = (lambda _: {'files': ['users_locked']})
GROUPS_FILTER = (lambda _: {'files': ['groups']})
USER_ALL_FILTER = (lambda _: {'files': ['users_all']})
USER_SPN_FILTER = (lambda _: {'files': ['users_spn']})
COMPUTERS_FILTER = (lambda... |
class TestAccount(BaseEvenniaCommandTest):
([(0, True, 1, 'You are out-of-character'), (1, True, 1, 'You are out-of-character'), (2, True, 1, 'You are out-of-character'), (3, True, 1, 'You are out-of-character'), (0, False, 1, 'Account TestAccount'), (1, False, 1, 'Account TestAccount'), (2, False, 1, 'Account Test... |
class SGDGrafting(Grafting):
def __init__(self, param: Tensor):
super(SGDGrafting, self).__init__(param)
def precondition(self, grad: Tensor, iteration: int) -> Tensor:
return grad
def direction_norm(self, grad: Tensor, iteration: int) -> Tensor:
return torch.linalg.norm(grad) |
class Connection(ConnectionAPI, Service):
_protocol_handlers: DefaultDict[(Type[ProtocolAPI], Set[HandlerFn])]
_msg_handlers: Set[HandlerFn]
_command_handlers: DefaultDict[(Type[CommandAPI[Any]], Set[HandlerFn])]
_logics: Dict[(str, LogicAPI)]
def __init__(self, multiplexer: MultiplexerAPI, devp2p_r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.