code stringlengths 281 23.7M |
|---|
def extractNovelsformyBlogspotCom(item):
(vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title'])
if ((not (chp or vol)) or ('preview' in item['title'].lower())):
return None
tagmap = [('Daughter of the emperor', 'Daughter of the emperor', 'translated'), ('Queen with a scalpel', '... |
class BaseHandler(tornado.web.RequestHandler):
def __init__(self, *request, **kwargs):
self.include_host = False
super(BaseHandler, self).__init__(*request, **kwargs)
def get_current_user(self):
try:
return self.get_secure_cookie('user_password')
except Exception:
... |
class OptionSeriesFunnel3dSonificationTracks(Options):
def activeWhen(self) -> 'OptionSeriesFunnel3dSonificationTracksActivewhen':
return self._config_sub_data('activeWhen', OptionSeriesFunnel3dSonificationTracksActivewhen)
def instrument(self):
return self._config_get('piano')
def instrumen... |
def test_circular_dependency_dfvs_2(circular_dependency_phi_functions, variable_v, variable_u):
list_of_phi_functions = circular_dependency_phi_functions
list_of_phi_functions[6].substitute(variable_v[6], variable_u[5])
graph = PhiDependencyGraph(list_of_phi_functions)
directed_fvs = graph.compute_direc... |
def customer_record(request, pk):
if request.user.is_authenticated:
customer_record = Record.objects.get(id=pk)
return render(request, 'record.html', {'customer_record': customer_record})
else:
messages.success(request, 'You Must Be Logged In To View That Page...')
return redirec... |
class SkillBar(Html.Html):
name = 'Skill Bars'
_option_cls = OptSliders.OptionsSkillbars
def __init__(self, page: primitives.PageModel, data, y_column, x_axis, title, width, height, html_code, options, profile, verbose: bool=False):
super(SkillBar, self).__init__(page, '', html_code=html_code, profi... |
def test_error_if_input_df_contains_na_in_transform(df_vartypes, df_na):
age_dict = {'Age': [0, 10, 20, 30, np.Inf]}
with pytest.raises(ValueError):
transformer = ArbitraryDiscretiser(binning_dict=age_dict)
transformer.fit(df_vartypes)
transformer.transform(df_na[['Name', 'City', 'Age', ... |
class Query(object):
def DenomTrace(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None):
return grpc.experimental.unary_unary(request, target, '/ibc.applications.transfer.v1.Query/DenomTrace', ibc_d... |
class SchemaType(_common.FlyteIdlEntity):
class SchemaColumn(_common.FlyteIdlEntity):
class SchemaColumnType(object):
INTEGER = _types_pb2.SchemaType.SchemaColumn.INTEGER
FLOAT = _types_pb2.SchemaType.SchemaColumn.FLOAT
STRING = _types_pb2.SchemaType.SchemaColumn.STRING
... |
class ReshapeTestCase(unittest.TestCase):
def _infer_shape(self, x, shape):
new_shape = list(shape)
cur_shape = x
unknown_idx = (- 1)
prod = 1
for (idx, v) in enumerate(new_shape):
if (v == (- 1)):
assert (unknown_idx == (- 1))
unkn... |
def test_clean_html_latex(cli, build_resources):
(books, tocs) = build_resources
path = books.joinpath('clean_cache')
result = cli.invoke(build, path.as_posix())
assert (result.exit_code == 0)
build_path = path.joinpath('_build')
assert build_path.exists()
os.mkdir(os.path.join(build_path, '... |
def get_minimal_attendee(db, user=None, owner=False, event_status='published'):
attendee = AttendeeOrderTicketSubFactory(order__user=(user if (not owner) else None), event__state=event_status)
if owner:
(role, _) = get_or_create(Role, name='owner', title_name='Owner')
UsersEventsRoles(user=user,... |
class InlineResponse2007(ModelNormal):
allowed_values = {}
validations = {}
_property
def additional_properties_type():
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type)
_nullable = False
_property
def openapi_types():
lazy_import()
... |
def test_centered_product_frame_with_given_mean(traces):
mean = _read('centered_product_given_mean.npz')
expected = _read('centered_product_result_given_mean_frame1_dist_10.npz')
frame = slice(None, 50)
result = scared.preprocesses.high_order.CenteredProduct(mean=mean, frame_1=frame, distance=10)(traces... |
def test_base_tree(tree_node, tree_args, nuts):
nuts._multinomial_sampling = False
tree_args = tree_args._replace(log_slice=(torch.log1p((- torch.rand(()))) - tree_args.initial_energy))
tree = nuts._build_tree_base_case(root=tree_node, args=tree_args)
assert isinstance(tree, _Tree)
assert (torch.isc... |
class Polynomial(IntegrationTestFunction):
def __init__(self, expected_result=None, coeffs=[2], integration_dim=1, domain=None, is_complex=False, backend=None, integrand_dims=1):
super().__init__(expected_result, integration_dim, domain, is_complex, backend, integrand_dims)
if (backend == 'tensorflo... |
.requires_eclipse
.usefixtures('use_tmpdir', 'init_eclrun_config')
def test_no_hdf5_output_by_default_with_ecl100(source_root):
shutil.copy(os.path.join(source_root, 'test-data/eclipse/SPE1.DATA'), 'SPE1.DATA')
econfig = ecl_config.Ecl100Config()
ecl_run.run(econfig, ['SPE1.DATA', '--version=2019.3'])
a... |
def extractAlbert325TranslationsWordpressCom(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, na... |
def test_capture_serverless_s3_batch(event_s3_batch, context, elasticapm_client):
os.environ['AWS_LAMBDA_FUNCTION_NAME'] = 'test_func'
_serverless
def test_func(event, context):
with capture_span('test_span'):
time.sleep(0.01)
return
test_func(event_s3_batch, context)
ass... |
class Vectorizer():
def __init__(self, type_vectorizers=None, column_vectorizers=None):
self.type_vectorizers = ({} if (type_vectorizers is None) else type_vectorizers)
self.column_vectorizers = ({} if (column_vectorizers is None) else column_vectorizers)
def clear(self):
self.type_vecto... |
def iconButton_paintEvent(button: QtWidgets.QPushButton, pixmap: QtGui.QPixmap, event: QtGui.QPaintEvent):
QtWidgets.QPushButton.paintEvent(button, event)
pos_x = (5 + int((((30 - pixmap.width()) * 0.5) + 0.5)))
pos_y = ((button.height() - pixmap.height()) / 2)
painter = QtGui.QPainter(button)
paint... |
class OptionPlotoptionsVariablepieSonificationContexttracksMappingRate(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):
... |
.use_numba
def test_laplace_equation_cartesian():
region = (2000.0, 10000.0, (- 3000.0), 5000.0)
points = vd.scatter_points(region, size=30, extra_coords=(- 1000.0), random_state=0)
masses = np.arange(points[0].size)
coordinates = vd.grid_coordinates(region=region, spacing=1000.0, extra_coords=0)
g_... |
def test_duration_validation():
class MyConfig(_ConfigBase):
microsecond = _DurationConfigValue('US', allow_microseconds=True)
millisecond = _DurationConfigValue('MS')
second = _DurationConfigValue('S')
minute = _DurationConfigValue('M')
default_unit_ms = _DurationConfigValue... |
def get_job_environment() -> 'JobEnvironment':
envs = get_job_environments()
if ('_TEST_CLUSTER_' in os.environ):
c = os.environ['_TEST_CLUSTER_']
assert (c in envs), f"Unknown $_TEST_CLUSTER_='{c}', available: {envs.keys()}."
return envs[c]
for env in envs.values():
if env.a... |
def __check_single_track_as_recording(mb_recording, disc_track):
priority = 0
if (hasattr(disc_track, 'isrc') and (disc_track.isrc is not None)):
mb_isrc_list = mb_recording.get('isrc-list')
if (mb_isrc_list is not None):
if (disc_track.isrc in mb_isrc_list):
priority... |
def deploy_storage_churn_contract(chain, nonce=0):
deploy_tx = chain.create_unsigned_transaction(nonce=nonce, gas_price=1234, gas=3000000, to=b'', value=0, data=decode_hex('fd5bf3fefd5bce01cb0dff59aadbdc1578063ef6537b5146100ef575b600080fd5b61007dfd5bd565bf35b6100bfafd5bb005b6100eddfd5be565b005b61011bfd5bb005bb3073f... |
class TestJzCzhz(util.ColorAssertsPyTest):
COLORS = [('red', 'color(--jzczhz 0.13438 0.16252 43.502)'), ('orange', 'color(--jzczhz 0.16937 0.12698 75.776)'), ('yellow', 'color(--jzczhz 0.2096 0.1378 102)'), ('green', 'color(--jzczhz 0.09203 0.10932 132.99)'), ('blue', 'color(--jzczhz 0.09577 0.19029 257.61)'), ('in... |
def extractKieukieudaysCom(item):
(vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title'])
if ((not (chp or vol)) or ('preview' in item['title'].lower())):
return None
if ('WATTT' in item['tags']):
return buildReleaseMessageWithType(item, 'WATTT', vol, chp, frag=frag, post... |
def run_tasks(tasks: Union[(str, Dict[(str, str)], List[Union[(Dict[(str, str)], str)]])]) -> None:
from src.task import run_task
logging.debug('run_tasks(%s)', tasks)
if isinstance(tasks, dict):
for k in tasks:
run_task(k, tasks[k])
elif isinstance(tasks, list):
for task in ... |
class M3UConverter(FormatConverter):
title = _('M3U Playlist')
content_types = ['audio/x-mpegurl', 'audio/mpegurl']
def __init__(self):
FormatConverter.__init__(self, 'm3u')
def export_to_file(self, playlist, path, options=None):
with GioFileOutputStream(Gio.File.new_for_uri(path)) as st... |
class FileEntry(FSEntry):
def __init__(self, *args, filetypes=[], defaultextension='', action, **kwargs):
super().__init__(*args, **kwargs)
self.defaultextension = defaultextension
self.filetypes = filetypes
if (action == 'save'):
self.ask_func = filedialog.asksaveasfilen... |
.skipif((not has_hf_transformers), reason='requires huggingface transformers')
.parametrize('torch_device', TORCH_DEVICES)
.parametrize('with_torch_sdp', [False, True])
def test_encoder(torch_device, with_torch_sdp):
assert_encoder_output_equals_hf(RoBERTaEncoder, 'explosion-testing/roberta-test', torch_device, wit... |
def test_handle_cancel_timer_failed(decider, mock_decision: DecisionStateMachine):
event = HistoryEvent()
event.event_id = DECISION_EVENT_ID
ret = decider.handle_cancel_timer_failed(event)
assert (ret is True)
mock_decision.handle_cancellation_failure_event.assert_called_once()
(args, kwargs) = ... |
class AddResponseHeaders(OptionTest):
parent: Test
VALUES: ClassVar[Sequence[Dict[(str, Dict[(str, Union[(str, bool)])])]]] = [{'foo': {'value': 'bar'}}, {'moo': {'value': 'arf'}}, {'zoo': {'append': True, 'value': 'bar'}}, {'xoo': {'append': False, 'value': 'dwe'}}, {'aoo': {'value': 'tyu'}}]
def config(se... |
def filter_firewall_internet_service_sld_data(json):
option_list = ['id', 'name']
json = remove_invalid_fields(json)
dictionary = {}
for attribute in option_list:
if ((attribute in json) and (json[attribute] is not None)):
dictionary[attribute] = json[attribute]
return dictionary |
def check_source(source, allowed_sources):
if (not allowed_sources):
allowed_sources = ['*']
elif type_util.is_string(allowed_sources):
allowed_sources = [allowed_sources]
elif type_util.is_list_or_tuple(allowed_sources):
allowed_sources = list(allowed_sources)
all_sources = ['*'... |
def create_items_if_not_exist(order):
for item in order.get('line_items', []):
product_id = item['product_id']
variant_id = item.get('variant_id')
sku = item.get('sku')
product = ShopifyProduct(product_id, variant_id=variant_id, sku=sku)
if (not product.is_synced()):
... |
class Lab(Labish, Space):
CHANNELS = (Channel('l', 0.0, 1.0), Channel('a', 1.0, 1.0, flags=FLG_MIRROR_PERCENT), Channel('b', 1.0, 1.0, flags=FLG_MIRROR_PERCENT))
CHANNEL_ALIASES = {'lightness': 'l'}
def is_achromatic(self, coords: Vector) -> bool:
return (alg.rect_to_polar(coords[1], coords[2])[0] <... |
class OptionSeriesGaugeLabel(Options):
def boxesToAvoid(self):
return self._config_get(None)
def boxesToAvoid(self, value: Any):
self._config(value, js_type=False)
def connectorAllowed(self):
return self._config_get(False)
def connectorAllowed(self, flag: bool):
self._con... |
class SupportAction(UserAction):
def apply_action(self):
sk = self.associated_card
assert isinstance(sk, Support)
cl = sk.associated_cards
src = self.source
tgt = self.target
lst = src.tags.get('daiyousei_spnum', 0)
n = len(cl)
if (lst < 3 <= (lst + n)... |
def test_scheduler_device(test_device: Device):
if (test_device.type == 'cpu'):
warn('not running on CPU, skipping')
pytest.skip()
scheduler = DDIM(num_inference_steps=30, device=test_device)
x = randn(1, 4, 32, 32, device=test_device)
noise = randn(1, 4, 32, 32, device=test_device)
... |
def test_proj_data(tmp_path):
f = np.linspace(.0, .0, 10)
r = np.atleast_1d(5)
theta = np.linspace(0, np.pi, 10)
phi = np.linspace(0, (2 * np.pi), 20)
coords_tp = dict(r=r, theta=theta, phi=phi, f=f)
values_tp = ((1 + 1j) * np.random.random((len(r), len(theta), len(phi), len(f))))
scalar_fie... |
class Comment(AbstractCrudObject):
def __init__(self, fbid=None, parent_id=None, api=None):
self._isComment = True
super(Comment, self).__init__(fbid, parent_id, api)
class Field(AbstractObject.Field):
admin_creator = 'admin_creator'
application = 'application'
attachment... |
class StoreCatalogSettings(AbstractCrudObject):
def __init__(self, fbid=None, parent_id=None, api=None):
self._isStoreCatalogSettings = True
super(StoreCatalogSettings, self).__init__(fbid, parent_id, api)
class Field(AbstractObject.Field):
id = 'id'
page = 'page'
def get_end... |
class TestPackagesLogic(CoprsTestCase):
def test_last_successful_build_chroots(self, f_users, f_fork_prepare, f_build_few_chroots):
builds_p4 = PackagesLogic.last_successful_build_chroots(self.p4)
builds_p5 = PackagesLogic.last_successful_build_chroots(self.p5)
assert (builds_p4 == {self.b6:... |
class bsn_flow_checksum_bucket_stats_request(bsn_stats_request):
version = 4
type = 18
stats_type = 65535
experimenter = 6035143
subtype = 10
def __init__(self, xid=None, flags=None, table_id=None):
if (xid != None):
self.xid = xid
else:
self.xid = None
... |
class King(Piece):
def __init__(self, x, y, c):
super().__init__(x, y, c)
self.set_letter('K')
def drag(self, new_p, pieces):
if self.grabbed:
x = (new_p[0] - self.start_x)
y = (new_p[1] - self.start_y)
if (self.direction == False):
if ... |
def extractBlogMillenniumsnowCom(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_type)... |
def extractThesolsticewarCom(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_type) in ... |
class TestHTMLCompress(unittest.TestCase):
extension = browsepy.transform.htmlcompress.HTMLCompress
def setUp(self):
self.env = jinja2.Environment(autoescape=True, extensions=[self.extension])
def render(self, html, **kwargs):
return self.env.from_string(html).render(**kwargs)
def test_c... |
def _test_correct_response_for_recipient_location_country_with_geo_filters(client):
resp = client.post('/api/v2/search/spending_by_geography', content_type='application/json', data=json.dumps({'scope': 'recipient_location', 'geo_layer': 'country', 'geo_layer_filters': ['JPN', 'USA'], 'filters': {'time_period': [{'s... |
class FrontierComputation(BaseComputation):
opcodes = FRONTIER_OPCODES
_precompiles = FRONTIER_PRECOMPILES
def apply_message(cls, state: StateAPI, message: MessageAPI, transaction_context: TransactionContextAPI) -> ComputationAPI:
snapshot = state.snapshot()
if (message.depth > STACK_DEPTH_L... |
_track_metadata_processor
def track_metadata_processor(album, metadata, track_node, release_node):
log.info('received track metadata trigger')
lfmws = LastFMTagger(album, metadata, release_node)
lfmws.before_finalize.append(lfmws.process_track_tags)
lfmws.request_track_toptags()
lfmws.request_artist... |
(IFontDialog)
class FontDialog(Dialog):
font = PyfaceFont()
def _create_contents(self, parent):
pass
def close(self):
if (self.control.result() == QtGui.QDialog.DialogCode.Accepted):
qfont = self.control.selectedFont()
self.font = Font.from_toolkit(qfont)
retu... |
class TestCritpathEndpoint(base.BasePyTestCase):
('bodhi.server.util.get_grouped_critpath_components')
def test_defaults(self, mocked_get_critpath):
mocked_get_critpath.return_value = {}
self.app.get('/get_critpath_components')
mocked_get_critpath.assert_called_once_with('rawhide', 'rpm'... |
class Disamparsulator():
def __init__(self):
self.rules = list()
def frobblesnizz(self, f):
xmltree = xml.etree.ElementTree.parse(f)
root = xmltree.getroot()
if (root.get('version') != '0.0.0'):
print('Unsupported version', root.get('version'))
rules = list()
... |
class PlaylistsPanelPlaylistMenu(menu.MultiProviderMenu):
def __init__(self, parent):
menu.MultiProviderMenu.__init__(self, ['playlist-panel-menu', 'track-panel-menu', 'playlist-panel-context-menu'], parent)
def get_context(self):
context = common.LazyDict(self._parent)
context['needs-co... |
class CharacterForm(ObjectForm):
class Meta():
model = class_from_module(settings.BASE_CHARACTER_TYPECLASS, fallback=settings.FALLBACK_CHARACTER_TYPECLASS)
fields = ('db_key',)
labels = {'db_key': 'Name'}
desc = forms.CharField(label='Description', max_length=2048, required=False, widget... |
class Args():
def __init__(self, arch):
self.operations = 'all'
self.build_dir = ''
self.curr_build_dir = ''
self.rocm_version = '5.0.2'
self.generator_target = ''
self.architectures = arch
self.kernels = 'all'
self.ignore_kernels = ''
self.ker... |
class DataSchemaProperties():
def __init__(self, context: dict):
self._context = context
def keys(self):
return self._context['keys']
def values(self):
return self._context['values']
def columns(self):
return list((self.keys | self.values))
def funcs(self):
re... |
def test_encode_categories_in_k_minus_1_binary_plus_list_of_variables(df_enc_big):
encoder = OneHotEncoder(top_categories=None, variables=['var_A', 'var_B'], drop_last=True)
X = encoder.fit_transform(df_enc_big)
assert (encoder.top_categories is None)
assert (encoder.variables == ['var_A', 'var_B'])
... |
def init_baseline_json():
datasets = ['spider']
models = ['llama2-7b-chat', 'llama2-13b-chat', 'codellama-7b-instruct', 'codellama-13b-instruct', 'baichuan2-7b-chat', 'baichuan2-13b-chat', 'qwen-7b-chat', 'qwen-14b-chat', 'chatglm3-6b']
methods = ['base', 'lora', 'qlora']
prompts = ['alpaca']
metric... |
def test_ssh_connection_error(f_build_rpm_case, caplog):
class _SideEffect():
counter = 0
def __call__(self):
self.counter += 1
if (self.counter == 1):
return (1, 'err stdout', 'err stderr')
return (0, '', '')
config = f_build_rpm_case
ssh ... |
class DefinitionsCollector(EnvironmentCollector):
def clear_doc(self, app, env, docname):
for kind in KINDS:
storage = get_storage(env, kind)
for item in list(storage.values()):
if (item.document == docname):
del storage[item.id]
def merge_othe... |
class Quantifier(atom):
_fields = ('op', 'vars', 'place', 'child', 'distinct')
_attributes = ('lineno', 'col_offset')
def __init__(self, op, place, child, distinct, vars=[], lineno=0, col_offset=0, **ARGS):
atom.__init__(self, **ARGS)
self.op = op
self.vars = list(vars)
self.... |
class Compressed(amp.String):
def fromBox(self, name, strings, objects, proto):
value = BytesIO()
value.write(self.fromStringProto(strings.get(name), proto))
for counter in count(2):
chunk = strings.get((b'%s.%d' % (name, counter)))
if (chunk is None):
... |
class MacOSEnableNewServiceDisrupter(Disrupter):
def __init__(self, device, parameters):
super().__init__(device, parameters)
self._restrict_parameters(must_disrupt=True, must_restore=False)
self._primary_service = None
def setup(self):
L.describe('Ensure there are two active net... |
class ReimuExterminateHandler(THBEventHandler):
interested = ['action_apply', 'action_after']
execute_after = ['DyingHandler', 'CheatingHandler', 'IbukiGourdHandler', 'DisarmHandler', 'FreakingPowerHandler', 'LunaticHandler', 'AyaRoundfanHandler', 'NenshaPhoneHandler']
def handle(self, evt_type, act):
... |
def _create_feature():
fc1 = QuarterlyFeatures(data_key='quarterly', columns=QUARTER_COLUMNS, quarter_counts=QUARTER_COUNTS, max_back_quarter=MAX_BACK_QUARTER, min_back_quarter=MIN_BACK_QUARTER, verbose=VERBOSE)
fc2 = BaseCompanyFeatures(data_key='base', cat_columns=CAT_COLUMNS, verbose=VERBOSE)
fc3 = Daily... |
class TestTotalProduction(unittest.TestCase):
def test_create_generation(self):
generation = TotalProduction(zoneKey=ZoneKey('DE'), datetime=datetime(2023, 1, 1, tzinfo=timezone.utc), source='trust.me', value=1)
assert (generation.zoneKey == ZoneKey('DE'))
assert (generation.datetime == date... |
class SequencerExtension(object):
(pm.nodetypes.Sequencer)
def manager(self):
return pm.ls(self.connections(), type='sequenceManager')[0]
(pm.nodetypes.Sequencer)
def get_sequence_name(self):
if (not self.hasAttr('sequence_name')):
self.set_sequence_name('')
return se... |
class custom_build_ext(build_ext):
def build_extensions(self):
self.parallel = True
try:
self.compiler.linker_so.remove('-Wl,-pie')
self.compiler.compiler_so.remove('-fPIE')
self.compiler.linker_so.remove('-fPIE')
self.compiler.compiler.remove('-fPIE')... |
class OptionPlotoptionsWindbarbSonificationContexttracks(Options):
def activeWhen(self) -> 'OptionPlotoptionsWindbarbSonificationContexttracksActivewhen':
return self._config_sub_data('activeWhen', OptionPlotoptionsWindbarbSonificationContexttracksActivewhen)
def instrument(self):
return self._c... |
_toolkit([ToolkitName.qt, ToolkitName.wx])
class TestSimpleSetEditor(BaseTestMixin, unittest.TestCase):
def setUp(self):
BaseTestMixin.setUp(self)
def tearDown(self):
BaseTestMixin.tearDown(self)
def setup_gui(self, model, view):
with create_ui(model, dict(view=view)) as ui:
... |
class OptionSeriesSplineZones(Options):
def className(self):
return self._config_get(None)
def className(self, text: str):
self._config(text, js_type=False)
def color(self):
return self._config_get(None)
def color(self, text: str):
self._config(text, js_type=False)
de... |
def extractLuminelletranslationsBlogspotCom(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, nam... |
class SchedulerPopen():
deltat = 0.2
def __init__(self, parallel=True):
self.progress = Progress(redirect_stdout=False, redirect_stderr=False)
if (mpi.rank > 0):
return
self.processes = []
if parallel:
self.limit_nb_processes = max(1, (multiprocessing.cpu_... |
class MapNode():
symbol = '#'
display_symbol = None
interrupt_path = False
prototype = None
node_index = None
multilink = True
direction_spawn_defaults = {'n': ('north', 'n'), 'ne': ('northeast', 'ne', 'north-east'), 'e': ('east', 'e'), 'se': ('southeast', 'se', 'south-east'), 's': ('south',... |
class ButterworthFilter(eagerx.Node):
def make(name: str, rate: float, index: int=0, N: int=2, Wn: float=1, btype: str='lowpass', process: Optional[int]=eagerx.NEW_PROCESS, color: Optional[str]='grey'):
spec = ButterworthFilter.get_specification()
spec.config.update(name=name, rate=rate, process=pro... |
def delete_dir(path: str) -> None:
if (not os.path.exists(path)):
return
for (root, dirs, files) in os.walk(path, topdown=False):
for name in files:
os.remove(os.path.join(root, name))
for name in dirs:
os.rmdir(os.path.join(root, name))
os.rmdir(path) |
class LexerReflect():
def __init__(self, ldict, log=None, reflags=0):
self.ldict = ldict
self.error_func = None
self.tokens = []
self.reflags = reflags
self.stateinfo = {'INITIAL': 'inclusive'}
self.modules = set()
self.error = False
self.log = (PlyLog... |
class WafExclusion(ModelNormal):
allowed_values = {}
validations = {}
_property
def additional_properties_type():
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type)
_nullable = False
_property
def openapi_types():
lazy_import()
... |
class Task():
def __init__(self, idx: typing.Union[(int, str)], cmd: str, name: str, **kwargs) -> None:
self._finished = False
self._is_timeout = False
self._failed = False
self._idx = idx
self._cmd = cmd
self._name = name
self._ret = None
self._assign... |
class OptionSeriesDependencywheelSonificationContexttracks(Options):
def activeWhen(self) -> 'OptionSeriesDependencywheelSonificationContexttracksActivewhen':
return self._config_sub_data('activeWhen', OptionSeriesDependencywheelSonificationContexttracksActivewhen)
def instrument(self):
return s... |
def observations_for_obs_keys(res: LibresFacade, obs_keys: List[str]) -> List[Dict[(str, Any)]]:
observations = []
for key in obs_keys:
observation = res.config.observations[key]
obs = {'name': key, 'values': list(observation.observations.values.flatten()), 'errors': list(observation['std'].valu... |
def test_nonce_manual(BrownieTester, accounts):
assert (accounts[0].nonce == 0)
c = accounts[0].deploy(BrownieTester, True, nonce=0)
assert (type(c) == ProjectContract)
assert (accounts[0].nonce == 1)
c = accounts[0].deploy(BrownieTester, True, nonce=1)
assert (type(c) == ProjectContract) |
class AbstractStorage(Storage):
def __init__(self, label='abstract_storage'):
self.array = z3.Array(label, z3.BitVecSort(svm_utils.VECTOR_LEN), z3.BitVecSort(svm_utils.VECTOR_LEN))
def store(self, index, value):
self.array = z3.Store(self.array, index, value)
def load(self, index):
r... |
class OptionSeriesDependencywheelSonificationDefaultspeechoptionsActivewhen(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... |
(['animation', 'previs', 'shot previs'], publisher_type=POST_PUBLISHER_TYPE)
def generate_playblast(progress_controller=None):
if (progress_controller is None):
progress_controller = ProgressControllerBase()
shots = pm.ls(type='shot')
progress_controller.maximum = (len(shots) + 2)
for shot in sh... |
class TestSuperFencesCustom(util.MdCase):
extension = ['pymdownx.superfences']
extension_configs = {'pymdownx.superfences': {'custom_fences': [{'name': 'test', 'class': 'test', 'format': custom_format, 'validator': custom_validator}]}}
def test_failure(self):
self.check_markdown('\n ```te... |
def test_encode_something(simple_attribute):
(some_type, _, expected_value) = simple_attribute
class SomeClass():
d: Dict[(str, some_type)] = field(default_factory=dict)
l: List[Tuple[(some_type, some_type)]] = field(default_factory=list)
t: Dict[(str, Optional[some_type])] = field(defau... |
def select(what, key):
if (what == 1):
selected_key = key[0:16]
elif (what == 2):
selected_key = key[1:]
elif (what == 3):
selected_key = key[2:]
selected_key.append(key[0])
elif (what == 4):
selected_key = key[3:]
selected_key.extend(key[:2])
elif (wh... |
def run_cmd(cmd, cwd='.', raise_on_error=True):
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd, encoding='utf-8')
try:
(stdout, stderr) = process.communicate()
except OSError as e:
raise RunCommandException(str(e))
result = munch.Munch(cmd=cmd, st... |
class LiteEthPHYMII(LiteXModule):
dw = 8
tx_clk_freq = .0
rx_clk_freq = .0
def __init__(self, clock_pads, pads, with_hw_init_reset=True):
self.crg = LiteEthPHYMIICRG(clock_pads, pads, with_hw_init_reset)
self.tx = ClockDomainsRenamer('eth_tx')(LiteEthPHYMIITX(pads))
self.rx = Clo... |
class OptionSeriesAreasplinerangeSonificationContexttracksMappingHighpass(Options):
def frequency(self) -> 'OptionSeriesAreasplinerangeSonificationContexttracksMappingHighpassFrequency':
return self._config_sub_data('frequency', OptionSeriesAreasplinerangeSonificationContexttracksMappingHighpassFrequency)
... |
class Context():
def __init__(self, default=NoDefault):
self.__dict__['_local'] = threading.local()
self.__dict__['_default'] = default
def __getattr__(self, attr):
if attr.startswith('_'):
raise AttributeError
try:
stack = self._local.stack
except... |
def test_mac_address_parsing():
s = 'AA-F2-C9-A6-B3-4F AB:F2:C9:A6:B3:4F ACF2.C9A6.B34F'
iocs = find_iocs(s)
assert (len(iocs['mac_addresses']) == 3)
assert ('AA-F2-C9-A6-B3-4F' in iocs['mac_addresses'])
assert ('AB:F2:C9:A6:B3:4F' in iocs['mac_addresses'])
assert ('ACF2.C9A6.B34F' in iocs['mac_... |
def set_bake_color_space_int(bake_mode):
preferences = bpy.context.preferences.addons[__package__].preferences
if ('normal_' in bake_mode):
if ((preferences.bake_color_space_def == 'ASTANDARD') or (preferences.bake_color_space_def == 'APBR')):
return 3
else:
return 1
... |
def upgrade():
op.drop_column('email_notification', 'next_event')
op.drop_column('email_notification', 'new_paper')
op.drop_column('email_notification', 'session_accept_reject')
op.drop_column('email_notification', 'session_schedule')
op.add_column('email_notification', sa.Column('next_event', sa.In... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.