code stringlengths 281 23.7M |
|---|
_heads([IndefiniteIntegralEqual, RealIndefiniteIntegralEqual, ComplexIndefiniteIntegralEqual])
def tex_IndefiniteIntegralEqual(head, args, **kwargs):
argstr = [arg.latex(**kwargs) for arg in args]
if (len(args) == 3):
(fx, gx, x) = args
fx = argstr[0]
gx = argstr[1]
x = argstr[2]... |
def extractFalinmer(item):
(vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title'])
if ((not (chp or vol or frag)) or ('preview' in item['title'].lower())):
return None
match = re.search('(\\d+)\\-(\\d+)', item['title'])
if ((not vol) and match):
vol = match.group(1)
... |
class downloadTransmissionsThread(threading.Thread):
def __init__(self, index, jobs, results):
threading.Thread.__init__(self)
self.index = index
self.jobQueue = jobs
self.resultQueue = results
def run(self):
while (not self.jobQueue.empty()):
data = self.jobQ... |
class TestGetDatasetConfigs():
def datasets_url(self, connection_config) -> str:
path = (V1_URL_PREFIX + DATASET_CONFIGS)
path_params = {'connection_key': connection_config.key}
return path.format(**path_params)
def test_get_dataset_configs_not_authenticated(self, datasets_url, api_clien... |
class WaitingPeers(Generic[TChainPeer]):
_waiting_peers: 'PriorityQueue[SortableTask[TChainPeer]]'
_response_command_type: Tuple[(Type[CommandAPI[Any]], ...)]
def __init__(self, response_command_type: Union[(Type[CommandAPI[Any]], Sequence[Type[CommandAPI[Any]]])], sort_key: Callable[([PerformanceAPI], floa... |
def export_blend_connections():
selection_list = pm.ls(tr=1, sl=1, l=1)
dialog_return = pm.fileDialog2(cap='Save As', fm=0, ff='Text Files(*.txt)')
filename = dialog_return[0]
print(filename)
print('\n\nFiles written:\n\n')
with open(filename, 'w') as fileId:
for i in range(0, len(select... |
class op(bpy.types.Operator):
bl_idname = 'uv.textools_texture_reload_all'
bl_label = 'Reload Textures and remove unused Textures'
bl_description = 'Reload all textures'
def poll(cls, context):
return True
def execute(self, context):
main(context)
return {'FINISHED'} |
def get_policy(proj_dir, policy):
def_policies = {'no_auto_import': False}
if util.is_valid_project_dir(proj_dir):
dic = util.load_fips_yml(proj_dir)
if (('policies' in dic) and (type(dic['policies']) is dict)):
if (policy in dic['policies']):
return dic['policies'][p... |
def look_at(camera, eye=mathutils.Vector((13.0, 13.0, 13.0)), at=mathutils.Vector((0.0, 0.0, 3.0)), up=mathutils.Vector((0.0, 0.0, 1.0))):
d = (eye - at).normalized()
r = up.cross(d).normalized()
u = d.cross(r).normalized()
camera.matrix_world = mathutils.Matrix(((r.x, u.x, d.x, eye.x), (r.y, u.y, d.y, ... |
class _ZebraMplsLabels(_ZebraMessageBody):
_HEADER_FMT = '!B'
HEADER_SIZE = struct.calcsize(_HEADER_FMT)
_FAMILY_FMT = '!I'
FAMILY_SIZE = struct.calcsize(_FAMILY_FMT)
_IPV4_PREFIX_FMT = '!4sB'
_IPV6_PREFIX_FMT = '!16sB'
IPV4_PREFIX_SIZE = struct.calcsize(_IPV4_PREFIX_FMT)
IPV6_PREFIX_SIZ... |
class OptionSeriesLineSonificationPointgrouping(Options):
def algorithm(self):
return self._config_get('minmax')
def algorithm(self, text: str):
self._config(text, js_type=False)
def enabled(self):
return self._config_get(True)
def enabled(self, flag: bool):
self._config(... |
class BaseObject(object):
def __init__(self, d):
try:
self._obj = self._validator.deserialize(d)
except Invalid:
raise EOSInvalidSchema('Unable to process schema for {}'.format(type(self)))
for (k, v) in self._obj.items():
setattr(self, k, v)
del s... |
class OptionSeriesScatterSonificationTracksMappingTremolo(Options):
def depth(self) -> 'OptionSeriesScatterSonificationTracksMappingTremoloDepth':
return self._config_sub_data('depth', OptionSeriesScatterSonificationTracksMappingTremoloDepth)
def speed(self) -> 'OptionSeriesScatterSonificationTracksMapp... |
class Autofix_Instruction():
def __init__(self):
self.ensure_trim_before = False
self.ensure_trim_after = False
self.ensure_ws_before = False
self.ensure_ws_after = False
self.ensure_maxgap_before = False
self.ensure_maxgap_after = False
self.delete = False
... |
_tuple
def decode_all(rlp: bytes, sedes: rlp.Serializable=None, recursive_cache: bool=False, **kwargs: Any) -> Iterable[Any]:
if (not is_bytes(rlp)):
raise DecodingError(('Can only decode RLP bytes, got type %s' % type(rlp).__name__), rlp)
end = 0
rlp_length = len(rlp)
while ((rlp_length - end) ... |
def _fuse_parallel_gemm_concat(sorted_graph: List[Tensor]) -> List[Tensor]:
sorted_ops = graph_utils.get_sorted_ops(sorted_graph)
fusion_groups = []
for op in sorted_ops:
if (op._attrs['op'] != 'concatenate'):
continue
if (not _check_cat_op(op)):
continue
cat_... |
def main():
parser = argparse.ArgumentParser()
parser.add_argument('cargo_lock', help='Path to the Cargo.lock file')
parser.add_argument('-o', '--output', required=False, help='Where to write generated sources')
parser.add_argument('-t', '--git-tarballs', action='store_true', help='Download git repos as... |
def main():
parser = OptionParser()
parser.add_option('--verify', action='store_true', dest='verify', default=False, help="return the sdk argument and warn if it doesn't exist")
parser.add_option('--sdk_path', action='store', type='string', dest='sdk_path', default='', help='user-specified SDK path; bypasse... |
class TestGobusterScan():
def setup_method(self):
self.tmp_path = Path(tempfile.mkdtemp())
self.scan = GobusterScan(target_file=__file__, results_dir=str(self.tmp_path), db_location=str((self.tmp_path / 'testing.sqlite')))
self.scan.exception = False
def teardown_method(self):
sh... |
def checkBuildPaintLinearGradient(fmt):
variable = _is_var(fmt)
color_stops = _sample_stops(variable)
(x0, y0, x1, y1, x2, y2) = (1, 2, 3, 4, 5, 6)
source = {'Format': fmt, 'ColorLine': {'ColorStop': color_stops}, 'x0': x0, 'y0': y0, 'x1': x1, 'y1': y1, 'x2': x2, 'y2': y2}
if variable:
sourc... |
def add_outlier(session, request_id, cpu_percent, memory, stacktrace, request):
(headers, environ, url) = request
outlier = Outlier(request_id=request_id, request_header=headers, request_environment=environ, request_url=url, cpu_percent=cpu_percent, memory=memory, stacktrace=stacktrace)
session.add(outlier) |
class OptionSeriesPictorialStatesSelect(Options):
def animation(self) -> 'OptionSeriesPictorialStatesSelectAnimation':
return self._config_sub_data('animation', OptionSeriesPictorialStatesSelectAnimation)
def borderColor(self):
return self._config_get('#000000')
def borderColor(self, text: s... |
def getSslOpts():
certpath = './rabbit_pub_cert/'
caCert = os.path.abspath(os.path.join(certpath, './cacert.pem'))
cert = os.path.abspath(os.path.join(certpath, './cert1.pem'))
keyf = os.path.abspath(os.path.join(certpath, './key1.pem'))
assert os.path.exists(caCert), ("No certificates found on path... |
class OptionPlotoptionsPyramid3dSonificationTracksMappingTremoloSpeed(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 Tuto(Module):
def __init__(self, platform):
crg = CRG(platform)
self.submodules += crg
led = platform.request('user_led', 1)
blink = Blink(24)
self.submodules += blink
self.comb += led.eq(blink.out)
data = platform.request('do')
ring = RingSerial... |
class LinearOutputBlock(ShapeNormalizationBlock):
def __init__(self, in_keys: Union[(str, List[str])], out_keys: Union[(str, List[str])], in_shapes: Union[(Sequence[int], List[Sequence[int]])], output_units: int):
super().__init__(in_keys=in_keys, out_keys=out_keys, in_shapes=in_shapes, in_num_dims=2, out_n... |
def test_traverse_kwargs():
provider1 = providers.Provider()
provided = provider1.provided
method = provided.method
provider2 = providers.Provider()
provider = method.call(foo='foo', bar=provider2)
all_providers = list(provider.traverse())
assert (len(all_providers) == 4)
assert (provide... |
class SupervisedPopen(QObject):
error = Signal(str, str, str)
finished = Signal(str)
def __init__(self, args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=subprocess.PIPE, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationfl... |
class TestRecursiveEject(AEATestCaseEmpty):
def test_recursive_eject_commands_positive(self):
agent_name = 'test_aea'
self.create_agents(agent_name)
self.set_agent_context(agent_name)
cwd = os.path.join(self.t, agent_name)
self.add_item('connection', str(GYM_CONNECTION_PUBLIC... |
_type(ofproto.OFPPDPT_ETHERNET)
class OFPPortDescPropEthernet(OFPPortDescProp):
def __init__(self, type_=None, length=None, curr=None, advertised=None, supported=None, peer=None, curr_speed=None, max_speed=None):
self.type = type_
self.length = length
self.curr = curr
self.advertised... |
class OptionSeriesSankeySonificationTracksMappingPitch(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('y')
def mapTo(self, text: str):
self._conf... |
.django_db
def test_budget_function_list_search(client, monkeypatch, agency_account_data, helpers):
helpers.mock_current_fiscal_year(monkeypatch)
query_params = f'?fiscal_year={helpers.get_mocked_current_fiscal_year()}&filter=NAME 6'
resp = client.get(url.format(code='007', query_params=query_params))
e... |
class OptionSeriesPyramid3dSonificationDefaultinstrumentoptionsMappingLowpassFrequency(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(sel... |
class BKZReduction():
def __init__(self, A):
if (not isinstance(A, IntegerMatrix)):
raise TypeError(("Matrix must be IntegerMatrix but got type '%s'" % type(A)))
wrapper = LLL.Wrapper(A)
wrapper()
self.A = A
self.m = GSO.Mat(A, flags=GSO.ROW_EXPO)
self.lll... |
def get_filters() -> map:
filters_details = {'rainbow': 'rainbow colors', 'vrainbow': 'rainbow colors vertical', 'hrainbow': 'rainbow colors horizontal', 'box': 'text in a box', 'vmirror': 'vertical mirror', 'hmirror': 'horizontal mirror', 'ritalic': 'skew the output a bit to the right', 'litalic': 'skew the output... |
def _get_quotation_mark_content(s):
seq = []
is_first = True
have_end_mark = False
for ch in s:
if (is_first and (ch != '"')):
raise MultipartErr('wrong content-disposition format')
if ((ch == '"') and is_first):
is_first = False
continue
if (c... |
class OptionPlotoptionsTimelineSonificationDefaultspeechoptionsPointgrouping(Options):
def algorithm(self):
return self._config_get('last')
def algorithm(self, text: str):
self._config(text, js_type=False)
def enabled(self):
return self._config_get(True)
def enabled(self, flag: b... |
def normalize_target_taxa(target_taxa, ncbi):
expanded_taxa = set()
for taxon in target_taxa:
taxid = ''
try:
taxid = int(taxon)
except ValueError:
taxid = ncbi.get_name_translator([taxon])[taxon][0]
else:
taxon = ncbi.get_taxid_translator([tax... |
def antivirus_profile(data, fos):
vdom = data['vdom']
state = data['state']
antivirus_profile_data = data['antivirus_profile']
antivirus_profile_data = flatten_multilists_attributes(antivirus_profile_data)
filtered_data = underscore_to_hyphen(filter_antivirus_profile_data(antivirus_profile_data))
... |
class Picture(Visual):
def __init__(self, filename, position=None):
if (position is None):
position = defaults.picture_position
Visual.__init__(self, position, log_comment=filename)
self._filename = filename
if (not os.path.isfile(self._filename)):
raise IOErr... |
def parseLinkDestination(string: str, pos: int, maximum: int) -> _Result:
lines = 0
start = pos
result = _Result()
if (charCodeAt(string, pos) == 60):
pos += 1
while (pos < maximum):
code = charCodeAt(string, pos)
if (code == 10):
return result
... |
class SpecialViewAction(Action):
def __init__(self, window, name, view):
self._window = window
self.name = name
self.view = view
def perform(self):
try:
meth = getattr(self._window.scene, self.view)
meth()
except AttributeError:
pass |
def _read_complex_type(msgdef: MessageSpecification, msgdefs: Dict[(str, MessageSpecification)], reader: CdrReader) -> DecodedMessage:
Msg = type(msgdef.msg_name, (SimpleNamespace,), {'__name__': msgdef.msg_name, '__slots__': [field.name for field in msgdef.fields], '__repr__': __repr__, '__str__': __repr__, '__eq_... |
_meta(definition.LaevateinCard)
class LaevateinCard():
name = ''
illustrator = ''
cv = 'VV'
description = '3,:<style=Card.Name></style><style=Card.Name></style>,,<style=Card.Name></style><style=Desc.Attention>1</style>'
is_action_valid = equip_iav
effect_string = suppress_launch_card_effect_stri... |
def _kwargtuple_compare(a: Any, b: Any) -> bool:
if (not isinstance(a, (tuple, list, ReturnValue))):
types_ = set([type(a), type(b)])
if types_.intersection([bool, type(None)]):
return (a is b)
if types_.intersection([dict, EthAddress, HexString]):
return (a == b)
... |
def test_parse_schema_accepts_nested_namespaces():
parsed_schema = fastavro.parse_schema({'namespace': 'com.example', 'name': 'Outer', 'type': 'record', 'fields': [{'name': 'a', 'type': {'type': 'record', 'name': 'Inner', 'fields': [{'name': 'the_thing', 'type': 'string'}]}}, {'name': 'b', 'type': 'Inner'}, {'name'... |
def main():
module_spec = schema_to_module_spec(versioned_schema)
mkeyname = 'name'
fields = {'access_token': {'required': False, 'type': 'str', 'no_log': True}, 'enable_log': {'required': False, 'type': 'bool', 'default': False}, 'vdom': {'required': False, 'type': 'str', 'default': 'root'}, 'member_path':... |
def collect_security_dependencies(app: FastAPI, dependency_callable: Callable):
result: List[Tuple[(Dependant, int)]] = []
for route in app.routes:
if (not isinstance(route, APIRoute)):
continue
result.extend(_collect_security_dependencies(route.dependant, dependency_callable))
_... |
def all_member_types_get(cls, version):
member_types = []
if (not (version in of_g.unified[cls])):
return ([], [])
if ('use_version' in of_g.unified[cls][version]):
v = of_g.unified[cls][version]['use_version']
members = of_g.unified[cls][v]['members']
else:
members = of_... |
def table_values(entry):
variables = entry.get_arg_with_head(Variables)
if (variables is not None):
return
table = entry.get_arg_with_head(Table)
if (table is not None):
headings = table.get_arg_with_head(TableValueHeadings)
if (headings is not None):
headings = headi... |
def allocate_distributed_tensor(shape, dtype: torch.dtype, device: torch.device, device_mesh_ranks: Optional[List[int]]=None, use_dtensor: bool=True) -> torch.Tensor:
if (ENABLE_DTENSOR and dist.is_initialized() and use_dtensor and (device_mesh_ranks is not None)):
global _device_mesh_cache
key = re... |
class OptionPlotoptionsPolygonSonificationDefaultspeechoptionsPointgrouping(Options):
def algorithm(self):
return self._config_get('last')
def algorithm(self, text: str):
self._config(text, js_type=False)
def enabled(self):
return self._config_get(True)
def enabled(self, flag: bo... |
def bilinear_ray_update(image, image_update, theta, ray_position, projected_value):
(ray_sum, weight_norm) = bilinear_ray_sum(image, theta, ray_position)
if (weight_norm > 0.0):
deviation = ((- (ray_sum - projected_value)) / weight_norm)
else:
deviation = 0.0
theta = ((theta / 180.0) * n... |
def test_update_parents(backend_db, common_db):
(fo, fw) = create_fw_with_child_fo()
backend_db.insert_multiple_objects(fw, fo)
fo_db = common_db.get_object(fo.uid)
assert (fo_db.parents == {fw.uid})
assert (fo_db.parent_firmware_uids == {fw.uid})
fw2 = create_test_firmware()
fw2.uid = 'test... |
def path(append=None, prepend=None, replace=None):
original = os.environ['PATH']
if replace:
replace = tolist(replace)
os.environ['PATH'] = os.pathsep.join(replace)
else:
if append:
append = tolist(append)
append.insert(0, os.environ['PATH'])
os.en... |
class Shop(AbstractCrudObject):
def __init__(self, fbid=None, parent_id=None, api=None):
self._isShop = True
super(Shop, self).__init__(fbid, parent_id, api)
class Field(AbstractObject.Field):
fb_sales_channel = 'fb_sales_channel'
id = 'id'
ig_sales_channel = 'ig_sales_ch... |
class UsersGroupsRoles(db.Model):
__tablename__ = 'users_groups_roles'
__table_args__ = (db.UniqueConstraint('user_id', 'group_id', 'role_id', name='uq_ugr_user_group_role'), db.UniqueConstraint('email', 'group_id', 'role_id', name='uq_ugr_email_group_role'))
id = db.Column(db.Integer, primary_key=True)
... |
class TestFormatLanguageName():
def test_unknown_language(self):
language_name = 'Unknown language (US)'
isocode = 'US'
expected_output = 'Region: US'
output = format_language_name(language_name, isocode)
assert (output == expected_output), f'Expected `{expected_output}` for ... |
class TestTransactionalSessionMaker(base.BasePyTestCase):
('bodhi.server.util.log.exception')
('bodhi.server.util.Session')
def test___call___fail_rollback_failure(self, Session, log_exception):
tsm = util.TransactionalSessionMaker()
exception = ValueError("u can't do that lol")
Sess... |
class FlytePickleTransformer(TypeTransformer[FlytePickle]):
PYTHON_PICKLE_FORMAT = 'PythonPickle'
def __init__(self):
super().__init__(name='FlytePickle', t=FlytePickle)
def assert_type(self, t: Type[T], v: T):
...
def to_python_value(self, ctx: FlyteContext, lv: Literal, expected_python... |
def main():
side = 4.0
thk = 0.3
s2 = ((2 * side) - thk)
s3 = ((2 * side) + thk)
wallR = box(pos=(side, 0, 0), size=(thk, s3, s2), color=(1, 0, 0))
wallL = box(pos=((- side), 0, 0), size=(thk, s3, s2), color=(1, 0, 0))
wallB = box(pos=(0, (- side), 0), size=(s3, thk, s3), color=(0, 0, 1))
... |
def test_scalar_spatialcoordinate_interpolation(parentmesh, vertexcoords):
if (parentmesh.name == 'immersedsphere'):
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
vertexcoords = vm.coordinates.dat.da... |
class OptionPlotoptionsPolygonSonificationDefaultinstrumentoptions(Options):
def activeWhen(self) -> 'OptionPlotoptionsPolygonSonificationDefaultinstrumentoptionsActivewhen':
return self._config_sub_data('activeWhen', OptionPlotoptionsPolygonSonificationDefaultinstrumentoptionsActivewhen)
def instrument... |
def test_get_anchor_translation_mixed_hierarchy():
anchor = (0.5, 0.5)
trans1 = Jump.UP(1)
pos1 = Pos(loc=trans1, relative_to=anchor)
trans2 = Jump.LEFT(1)
ball_pos1 = BallPos(loc=trans2, relative_to=pos1, ids={'1'})
trans3 = Jump.DOWN(1)
ball_pos2 = BallPos(loc=trans3, relative_to=ball_pos1... |
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [migrations.CreateModel(name='Badge', fields=[('id', models.AutoField(primary_key=True, serialize=False)), ('title', models.CharField(help_text='', max_length=50, unique=True, verbose_name='')), ('description', models.CharF... |
def test_create_privacy_request_sets_requested_at(db: Session, policy: Policy) -> None:
pr = PrivacyRequest.create(db=db, data={'requested_at': None, 'policy_id': policy.id, 'status': 'pending'})
assert (pr.requested_at is not None)
pr.delete(db)
pr = PrivacyRequest.create(db=db, data={'policy_id': poli... |
def test_repopulate(accounts, network, chain, rpc, network_name):
assert (len(accounts) > 0)
a = list(accounts)
chain.reset()
assert (len(accounts) == len(a))
for i in range(len(a)):
assert (a[i] == accounts[i])
network.disconnect()
assert (len(accounts) == 0)
assert (not rpc.is_... |
def test_contract_non_independend_set(construct_graph_loop, aliased_variable_y):
(nodes, cfg) = construct_graph_loop
interference_graph = InterferenceGraph(cfg)
with pytest.raises(ValueError):
interference_graph.contract_independent_set([aliased_variable_y[1], aliased_variable_y[4], aliased_variable... |
_in_both(TestOb, Tester)
def test_issue_460_and_more():
tester = Tester()
loop.iter()
tester.make_children1()
loop.iter()
tester.set_foos('A')
loop.iter()
print('-')
tester.make_children2()
loop.iter()
tester.set_foos('B')
loop.iter()
print('-')
tester.make_children3(... |
class ConfigFileRegistry(Registry):
def spec_schema_cls(self):
pass
def __init__(self, config_paths):
self.config_paths = config_paths
self._node_configs = self.load_configs(config_paths)
if (not issubclass(self.node_cls, RegistryNode)):
raise Exception('Invalid `node... |
def test_transaction_data_is_attached_to_errors_message_in_span(elasticapm_client):
elasticapm_client.begin_transaction('test')
with elasticapm.capture_span('in_span_handler_test') as span_obj:
elasticapm_client.capture_message('in_span')
transaction = elasticapm_client.end_transaction('test', 'test... |
class TestRunner():
def __init__(self, context, devices, tests):
self._context = context
self._device_discovery = DeviceDiscovery(context, devices)
self._test_runs = [TestRun(self._check_and_clean_test_config(test)) for test in tests]
self._test_directory_names = []
self._com... |
class PrometheusDialogues(Dialogues, ABC):
END_STATES = frozenset({PrometheusDialogue.EndState.SUCCESSFUL})
_keep_terminal_state_dialogues = False
def __init__(self, self_address: Address, role_from_first_message: Callable[([Message, Address], Dialogue.Role)], dialogue_class: Type[PrometheusDialogue]=Promet... |
class Td(Html.Html):
name = 'Cell'
def __init__(self, page: primitives.PageModel, components: Optional[List[Union[(Html.Html, str)]]], header: bool, position: Optional[str], width: types.SIZE_TYPE, height: types.SIZE_TYPE, align: Optional[str], options: types.OPTION_TYPE, profile: types.PROFILE_TYPE):
(... |
def test_serializable_field_immutability(type_1_a, type_1_b, type_2):
with pytest.raises(AttributeError, match="can't set attribute"):
type_1_a.field1 += 1
assert (type_1_a.field1 == 5)
with pytest.raises(AttributeError, match="can't set attribute"):
type_1_a.field2 = b'x'
assert (type_1... |
class Sensor(GenericSensor):
def setup_module(self) -> None:
sensor_spi_port: int = self.config['spi_port']
sensor_spi_device: int = self.config['spi_device']
sensor_type: str = self.config['type'].upper()
sensor_channel: int = self.config['channel']
sensor_differential: bool... |
def _delete_storage_twice(chain, contract_addr, nonce):
func_id = decode_hex('0x622ff59a')
width = b''
method_invocation = (func_id + width.rjust(32, b'\x00'))
tx = chain.create_unsigned_transaction(nonce=nonce, gas_price=1235, gas=123458, to=contract_addr, value=0, data=method_invocation)
(_, _, co... |
(scope='function')
def fullstory_connection_config(db: session, fullstory_config, fullstory_secrets) -> Generator:
fides_key = fullstory_config['fides_key']
connection_config = ConnectionConfig.create(db=db, data={'key': fides_key, 'name': fides_key, 'connection_type': ConnectionType.saas, 'access': AccessLevel... |
('copr_backend.vm_alloc.time.sleep')
('copr_backend.vm_alloc.ResallocConnection')
def test_ticket_wait_ready_fallback(_rcon, sleep):
hf = ResallocHostFactory()
host = hf.get_host()
host.ticket.collect.side_effect = _collect_side_effect(([False for _ in range(20)] + [True]), host)
host.wait_ready()
a... |
def show_repo_dicts_info(repo_dicts):
print(f'Repositories returned: {len(repo_dicts)}')
print('\nSelected information about each repository:')
for repo_dict in repo_dicts:
print('\nSelected information about first repository:')
print(f"Name: {repo_dict['name']}")
print(f"Owner: {rep... |
class DollBlastDropHandler(DollBlastHandlerCommon, THBEventHandler):
interested = ['action_before', 'action_after']
game: THBattle
def handle(self, evt_type, act):
if ((evt_type == 'action_before') and isinstance(act, DropCards)):
(src, tgt) = (act.source, act.target)
if (not... |
def extractKusareWordpressCom(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, p... |
class IngressStatusTestWithAnnotations(AmbassadorTest):
status_update = {'loadBalancer': {'ingress': [{'ip': '200.200.200.200'}]}}
def init(self):
self.target = HTTP()
def manifests(self) -> str:
return ('\n---\napiVersion: networking.k8s.io/v1\nkind: Ingress\nmetadata:\n annotations:\n ... |
class CMYKAtkinson(Processor):
__slots__ = ('gcr', 'overprinter')
def __init__(self, gcr=20):
self.gcr = max(min(100, gcr), 0)
self.overprinter = pipeline.BandFork(Atkinson, mode='CMYK')
def process(self, image):
return pipeline.Pipe(gcr.BasicGCR(self.gcr), self.overprinter).process(... |
def extractWanderingduostudiosHomeBlog(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... |
class GreetingWorkflowImpl(GreetingWorkflow):
def __init__(self):
self.greeting_activities: GreetingActivities = Workflow.new_activity_stub(GreetingActivities)
async def get_greeting(self):
futures = [Async.function(self.greeting_activities.compose_greeting, 10), Async.function(self.greeting_act... |
class ExportModelHook(tf.train.SessionRunHook):
def __init__(self, model_export_path, input_tensor, output_tensor):
self.model_export_path = model_export_path
self.input_tensor = input_tensor
self.output_tensor = output_tensor
def end(self, session):
g = session.graph
g._... |
def create_parser(parser_cls, config_env):
main_parser = define_parent_parser(parser_cls, config_env)
service_subparsers = main_parser.add_subparsers(title='service', dest='service')
define_explainer_parser(service_subparsers)
define_version_parser(service_subparsers)
define_inventory_parser(service... |
def test_swag(client, specs_data):
apispec = specs_data.get('/apispec_1.json')
assert (apispec is not None)
paths = apispec.get('paths')
expected_user_paths = ('/autovalidation', '/validateannotation', '/autovalidationfromspecdict', '/blueprint/autovalidation', '/blueprint/autovalidationfromspecdict', '... |
def create_permissions():
ownr = Role.query.filter_by(name=Role.OWNER).first()
orgr = Role.query.filter_by(name=Role.ORGANIZER).first()
coorgr = Role.query.filter_by(name=Role.COORGANIZER).first()
track_orgr = Role.query.filter_by(name=TRACK_ORGANIZER).first()
mod = Role.query.filter_by(name=MODERAT... |
class Sysupdate(BaseUtil):
def get_settings():
return dict(descr='Updates htcap and node pakages', optargs='D', minargs=0, use_dbfile=False)
def usage(self):
return ('usage: %s [-D]\n Options:\n -D use development version\n\n' % self.utilname)
def main(self, args, opts, db_file):
... |
class ConfigStoreInfoResponse(ModelNormal):
allowed_values = {}
validations = {}
_property
def additional_properties_type():
return (bool, date, datetime, dict, float, int, list, str, none_type)
_nullable = False
_property
def openapi_types():
return {'item_count': (int,)}
... |
def create_tenant(display_name, allow_password_sign_up=None, enable_email_link_sign_in=None, app=None):
tenant_mgt_service = _get_tenant_mgt_service(app)
return tenant_mgt_service.create_tenant(display_name=display_name, allow_password_sign_up=allow_password_sign_up, enable_email_link_sign_in=enable_email_link_... |
class OptionSeriesTreegraphData(Options):
def accessibility(self) -> 'OptionSeriesTreegraphDataAccessibility':
return self._config_sub_data('accessibility', OptionSeriesTreegraphDataAccessibility)
def className(self):
return self._config_get(None)
def className(self, text: str):
self... |
def test_reuse_nested_schema_by_name():
'
writer_schema = {'name': 'Writer', 'namespace': 'test', 'type': 'record', 'fields': [{'name': 'foo', 'type': {'name': 'Item', 'namespace': 'test.Writer', 'type': 'record', 'fields': [{'name': 'spam', 'type': 'string'}]}}, {'name': 'bar', 'type': {'type': 'array', 'items... |
_json
class PCSContainerInstance(ContainerInstance):
log_url: Optional[str] = None
cpu: Optional[int] = None
memory: Optional[int] = None
def from_container_instance(cls, container_instance: ContainerInstance, log_url: Optional[str]=None) -> 'PCSContainerInstance':
return cls(instance_id=contain... |
class AzureFunctionsClient(Client):
def get_service_info(self):
service_info = super().get_service_info()
service_info['framework'] = {'name': 'Azure Functions', 'version': os.environ.get('FUNCTIONS_EXTENSION_VERSION')}
service_info['runtime'] = {'name': os.environ.get('FUNCTIONS_WORKER_RUNT... |
class DeleteTemplateParamSource(ABC, ParamSource):
def __init__(self, track, params, templates, **kwargs):
super().__init__(track, params, **kwargs)
self.only_if_exists = params.get('only-if-exists', True)
self.request_params = params.get('request-params', {})
self.template_definitio... |
class Snipe(commands.Cog):
__version__ = '0.5.0'
def format_help_for_context(self, ctx):
pre_processed = super().format_help_for_context(ctx)
return f'''{pre_processed}
Cog Version: {self.__version__}'''
def __init__(self, bot):
defaults_guild = {'toggle': False, 'timeout': 30, 'max'... |
class ClientConfig():
version = '1.2.3'
name = 'bla'
logLevel = 0
isFirewallRunning = False
rules = []
config = '{\n "Server":{\n "Address": "unix:///tmp/osui.sock",\n "LogFile": "/var/log/opensnitchd.log"\n },\n "DefaultAction": "deny",\n "DefaultDuration": "once",\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.