text stringlengths 67 7.88k |
|---|
<|fim_prefix|>def <|fim_suffix|>(event, saltenv="base", test=None):
"""
Delete a reactor
CLI Example:
.. code-block:: bash
salt-run reactor.delete 'salt/cloud/*/destroyed'
"""
if not _reactor_system_available():
raise CommandExecutionError("Reactor system is not running.")
wi... |
<|fim_prefix|>def <|fim_suffix|>(self):
"""Test the post-login hook"""
req, info = self._generate_req_info(self.app_settings['openid.provider'])
remember_me(None, req, info)
# The user should now exist, and be a member of the releng group
user = models.User.get('lmacken')
assert user.name == 'lm... |
<|fim_prefix|>def <|fim_suffix|>(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema
cls._args_schema = super().METHOD_NAME(*args, **kwargs)
# define Arg Group ""
_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
requir... |
<|fim_prefix|>def <|fim_suffix|>(self):
return self._get(self._interfaces)['result']<|fim_middle|>interfaces<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(a : 'int', b : 'int'):
return (a-b), (a+b)<|fim_middle|>multi_return_vars_expr<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self):
"""
Runs generate.main() which should merge source files,
then compile all sources in all configured languages.
Validates output by checking all .mo files in all configured languages.
.mo files should exist, and be recently created (modified
after start of... |
<|fim_prefix|>def <|fim_suffix|>(self) -> Optional[str]:
"""
Windows IoT Device Service notes.
"""
return pulumi.get(self, "notes")<|fim_middle|>notes<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self):
# Should fit in the context window since we subtracted the number of tokens of the test prompt
# from the max request length of 2049
assert self.window_service.fits_within_context_window(TEST_PROMPT, self.window_service.max_request_length - 51)
# Should not fit wi... |
<|fim_prefix|>def <|fim_suffix|>(self) -> list[str]:
"""Return the ids of this metric's issues."""
return self.get("issue_ids", [])<|fim_middle|>issue_ids<|file_separator|> |
<|fim_prefix|> <|fim_suffix|>(self, *filepaths):<|fim_middle|>resolve_conflict<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self) -> Any:
"""
Dataset properties.
"""
return pulumi.get(self, "properties")<|fim_middle|>properties<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(site_id, api_key=None):
cycle_point = os.environ['CYLC_TASK_CYCLE_POINT']
# Try to get the information from SYNOPS.
dist = 0.0
badsites = []
fails = True
obs = None
while dist < 1 and fails:
try:
obs = synop_grab(site_id, cycle_point)
... |
<|fim_prefix|>def <|fim_suffix|>(model_fn, data_gen_fn, output_transform_fn, loss_fn, test_config):
org_model, org_optimizer, sharded_model, sharded_optimizer, criterion, booster = \
build_model_from_hybrid_plugin(model_fn, loss_fn, test_config)
org_loss, org_output, sharded_loss, sharded_output = \
... |
<|fim_prefix|>def <|fim_suffix|>(self):
return True<|fim_middle|>has_product_component<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self):
for i in range(3):
self.op.setConstant(i)
aimg = self.renderScene(self.scene, "/tmp/a_%03d.png" % i)
assert numpy.all(aimg[:, :, 0] == i), "!= %d, [0,0,0]=%d" % (i, aimg[0, 0, 0])
self.op.setConstant(42)
self.op.setDelay(1)
aimg... |
<|fim_prefix|>def <|fim_suffix|>(self):
"""Do not make a request if the archive format is unsupported."""
self.instance.archive(format="clearly fake")
assert self.session.get.called is False<|fim_middle|>test_unsupported_archive<|file_separator|> |
<|fim_prefix|>async def <|fim_suffix|>(self, app):
await self.session.close()<|fim_middle|>on_cleanup<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self) -> str:
"""
The name of the resource
"""
return pulumi.get(self, "name")<|fim_middle|>name<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(plugin, item_id, category_title, **kwargs):
"""
Build programs listing
- Les feux de l'amour
- ...
"""
resp = urlquick.get(URL_SHOWS)
root = resp.parse("div",
attrs={"id": "accordion-horizontal"})
for category_datas in root.iterfind(... |
<|fim_prefix|>def <|fim_suffix|>(request, lccn, date, edition, sequence):
"""
api/chronam/lccn/<date>/ed-<edition>/seq-<sequence>.json
Retrieve a page's info
"""
try:
_year, _month, _day = date.split("-")
_date = datetime.date(int(_year), int(_month), int(_day))
title = model... |
<|fim_prefix|>def <|fim_suffix|>(self):
# Mutating attribute with a Tensor type
class Foo(torch.nn.Module):
def __init__(self):
super().__init__()
self.a = torch.Tensor(3, 2)
def forward(self, x):
self.a = self.a.to(torch.float64)
return x.sum() + ... |
<|fim_prefix|>def <|fim_suffix|>():
return [
{
"Value": "/path/to/certs/testsite1.crt",
"Key": "test-shared/sites/testsite1/ssl/certs/SSLCertificateFile",
},
{
"Value": "/path/to/certs/testsite1.key",
"Key": "test-shared/sites/testsite1/ssl/cer... |
<|fim_prefix|>def <|fim_suffix|>(self):
"Vertical polarization should decay in (cos2θ)**2 in vertical plane and no correction in horizontal one"
self.assertTrue(abs(self.ai.polarization(factor=-1)[6] - numpy.ones(13)).max() == 0, "No correction in the horizontal plane")
self.assertTrue(abs(self.ai.polarizat... |
<|fim_prefix|>def <|fim_suffix|>(self, data):
"""Handle a pong message."""
self.last_pong = ioloop.IOLoop.current().time()<|fim_middle|>on_pong<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>():
"""
This helps trim the library a bit by excluding rates with
products with more protons than the endpoint, heavier than the
endpoint, or with relatively high or low neutron percentages.
"""
# Proton number bounds
Zlo, Zhi = 6, endpoint.Z
# Nucleon nu... |
<|fim_prefix|>f <|fim_suffix|>(self, y):<|fim_middle|>inverse_log_det_jacobian<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self):
"""Path to the environment file"""
return self._env_file<|fim_middle|>env_file<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self, load_system_with_callbacks):
scwc = load_system_with_callbacks
# Don't register this rod
mock_rod = self.MockRod(2, 3, 4, 5)
with pytest.raises(ValueError) as excinfo:
scwc.collect_diagnostics(mock_rod)
assert "was not found, did you" in str(excinfo.val... |
<|fim_prefix|>def <|fim_suffix|>(voigt_notation):
return voigt_notation_to_stiffness_tensor(
np.divide(voigt_notation, voigt_compliance_factors)
)<|fim_middle|>voigt_notation_to_compliance_tensor<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>():
"""Get a valid Bearer token for the Name Request Service."""
token_url = current_app.config.get('NAMEX_AUTH_SVC_URL')
client_id = current_app.config.get('NAMEX_SERVICE_CLIENT_USERNAME')
client_secret = current_app.config.get('NAMEX_SERVICE_CLIENT_SECRET')
data = '... |
<|fim_prefix|>def <|fim_suffix|>(self):
METHOD_NAME = abstracts_settings.get(self.event, 'announcement')
render_mode = abstracts_settings.get(self.event, 'announcement_render_mode')
return RENDER_MODE_WRAPPER_MAP[render_mode](METHOD_NAME)<|fim_middle|>announcement<|file_separator|> |
<|fim_prefix|> <|fim_suffix|>(self, field, value, idx_start, idx_end=None):<|fim_middle|>set<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self) -> None:
self.optim_step_progress.increment_ready()
self.trainer.profiler.start("optimizer_step")<|fim_middle|>on_before_step<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self):
self.assertEqual(
format_exception(
"Hello world, this is a very long message that will "
"inevitably wrap onto another line."
),
"Hello world, this is a very long message that will\n"
" inevitably wrap onto another l... |
<|fim_prefix|>def <|fim_suffix|>(self):
return [
self.InputItem(
name=_("业务 ID"),
key="biz_cc_id",
type="string",
schema=StringItemSchema(description=_("当前操作所属的 CMDB 业务 ID")),
),
self.InputItem(
name=_("定时作业名称"),
key="jo... |
<|fim_prefix|>def <|fim_suffix|>(
self, organization: RpcOrganization, data: Mapping[str, str]
) -> Mapping[str, Any]:
return {
"name": data["name"],
"external_id": data["external_id"],
"url": data["url"],
"config": {
"instance": data["instance"],
"project... |
<|fim_prefix|>def <|fim_suffix|>(self, source, mapped, Model):
for field in Model._meta.fields:
column = field.column
if hasattr(source, column):
if Model in self.overrides and column in self.overrides[Model]:
self.assertEqual(self.overrides[Model][column], getattr(mapped... |
<|fim_prefix|>def <|fim_suffix|>(self):
policy = {"timeout": 0.1}
user = "example-test"
try:
self.client.admin_query_user(user, policy)
except e.ParamError as exception:
assert exception.code == -2
assert exception.msg == "timeout is invalid"<|fim_middle|>test_query_user_with_inv... |
<|fim_prefix|>def <|fim_suffix|>(self, df):
"""
Generic data loader function
:param df: Input tensor
:return: Returns the constructed dataloader
"""
return DataLoader(
df, batch_size=self.args["batch_size"], num_workers=self.args["num_workers"]
)<|fim_middle|>create_data_loader<|file... |
<|fim_prefix|>def <|fim_suffix|>(self, environment=None):
if self._sys_path is not None:
return self._sys_path
# The sys path has not been set explicitly.
if environment is None:
environment = self.get_environment()
sys_path = list(environment.get_sys_path())
try:
sys_path.re... |
<|fim_prefix|>def <|fim_suffix|>(n_messages, messages, p_response, app_data):
"""
Simple conversation function that responds to any
prompt where the echo is off with the supplied password
"""
# Create an array of n_messages response objects
addr = CALLOC(n_messages, sizeof(PamResponse))
p_re... |
<|fim_prefix|>def <|fim_suffix|>(theyear: int, w: int = 2, l: int = 1, c: int = 6, m: int = 3) -> str: ...<|fim_middle|>calendar<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(temp_salt_minion, tmp_path):
opts = temp_salt_minion.config.copy()
opts["master_uri"] = "tcp://127.0.0.1:12323"
grains = salt.loader.grains(opts)
pillar = salt.pillar.RemotePillar(
opts,
grains,
temp_salt_minion.id,
"base",
)
mock ... |
<|fim_prefix|>def <|fim_suffix|>(num: int):
if num < 1:
raise ValueError("test")
METHOD_NAME(num - 1)<|fim_middle|>exception_fun<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self, aligned):
a = self._get_array(2e300, aligned)
with pytest.raises(TypeError,
match="error raised inside the core-loop: non-finite factor!"):
a.astype(SF(2e-300))<|fim_middle|>test_sfloat_cast_internal_errors<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(incident_comment_id: Optional[str] = None,
incident_id: Optional[str] = None,
resource_group_name: Optional[str] = None,
workspace_name: Optional[str] = None,
opts: Optional[pulumi.Invoke... |
<|fim_prefix|>def <|fim_suffix|>(cls):
return "%s.%s" % (cls.__module__, cls.__name__)<|fim_middle|>strclass<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(m, init_func, obj):
if len(list(m.children())) > 0:
if m == obj:
return
METHOD_NAME(m, init_func, m)
else:
try:
init_func(m)
except Exception as e:
print('initialize layer {} failed, exception is :{}'.format(m, ... |
<|fim_prefix|>def <|fim_suffix|>():
"""The main function. Hier spielt die Musik.
"""
# parse the command line, exit with UNKNOWN if it fails
try:
args = parse_args()
except SystemExit:
sys.exit(STATE_UNKNOWN)
# fetch data
if args.TEST is None:
result = lib.base.coe(li... |
<|fim_prefix|>def <|fim_suffix|>(table, column, profiling_result) -> RecommendedAssertion:
if column is None:
return None
schema_type = profiling_result['tables'][table]['columns'][column].get('schema_type')
if schema_type is None:
return None
test_function_name = 'assert_column_schema_t... |
<|fim_prefix|>def <|fim_suffix|>(rng, dt, sr):
ns = T.NS[dt][sr]
ok = True
attdet = AttackDetector(dt, sr)
state_c = initial_state()
x_c = np.zeros(ns+6)
for run in range(100):
### Generate noise, and an attack at random point
x = ((2 * rng.random(ns)) - 1) * (2 ** 8 - 1)
... |
<|fim_prefix|>def <|fim_suffix|>(dirpath: str, privkey_pem: bytes, cert_pem: bytes,
entropy: bytes, counter: int) -> None:
"""
Write the setup directory.
Args:
dirpath: The directory path.
key_pem: The private key PEM.
cert_pem: The certificate PEM.
entrop... |
<|fim_prefix|>def <|fim_suffix|>(cnt_viewmodel):
"""
Dispalays information about all the services of container.
:param cnt_viewmodel: ContainerViewModel: contains view info about container
:return: None
"""
io.echo('Platform:', cnt_viewmodel.soln_stk)
for i, service_info in enumerate(cnt_vie... |
<|fim_prefix|>f <|fim_suffix|>( self ):<|fim_middle|>test_include_cache_cached_new_mtime<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(_):
return '[Ping Devices]'<|fim_middle|>parse_ping_devices<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self) -> str:
"""
The name of the resource
"""
return pulumi.get(self, "name")<|fim_middle|>name<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(micros: int, logical: int) -> int:
return (micros << HybridTime.kBitsForLogicalComponent) | logical<|fim_middle|>repr_from_micros_and_logical<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self):
return self.settings.arch in ["x86", "x86_64"]<|fim_middle|>has_sse_support<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(enums, item):
for en in enums:
if item in en:
value = en[1] if wx4 else en[0]
return value<|fim_middle|>find_enum<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self) -> Optional[str]:
"""
Kind of resource.
"""
return pulumi.get(self, "kind")<|fim_middle|>kind<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(cls):
cls.use_temp_region()
cls.runModule("g.region", raster="elevation")<|fim_middle|>set_up_class<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self, ufunc, stride_in0, stride_in1,
stride_out, dtype):
ufunc(self.ufunc_args[0], self.ufunc_args[1][0], *self.ufunc_args[2:])<|fim_middle|>time_binary_scalar_in1<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(xmlfile, operation_model, expected):
response_body = _get_raw_response_body(xmlfile)
response = {'body': response_body, 'status_code': 200, 'headers': {}}
for case in SPECIAL_CASES:
if case in xmlfile:
print("SKIP: %s" % xmlfile)
return
if... |
<|fim_prefix|>async def <|fim_suffix|>(
src: StrOrBytesPath,
dst: StrOrBytesPath,
*,
src_dir_fd: int | None = ...,
dst_dir_fd: int | None = ...,
follow_symlinks: bool = ...,
loop: AbstractEventLoop | None = ...,
executor: Any = ...,
) -> None: ...<|fim_middle|>link<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(using: str, max_csv_amount: int = 30) -> None:
"""
rotate csv zip file in the {now:%Y} folder
:returns:
"""
storage = _get_storage_backend(using=using)
now = timezone.now()
src_folder = f'{storage.location}/{now:%Y}'
if os.path.exists(src_folder):
... |
<|fim_prefix|>def <|fim_suffix|>(self):
"""
Returns the description for this plugin. This is shown on the plugin configuration
page.
>>> plugin.get_description()
"""
return self.description<|fim_middle|>get_description<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(data, filename):
return _problem_directory_file(data.problem.code, filename)<|fim_middle|>problem_directory_file<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self, exe, args, csv_enabled):
self.exe_path = exe
self.exe_args = args
self.has_csv = csv_enabled<|fim_middle|>set_command<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(bytes_io, output_folder_name):
with ZipFile(bytes_io) as zf:
if output_folder_name:
os.makedirs(output_folder_name, exist_ok=True)
zf.extractall(output_folder_name)
os.remove(os.path.join(output_folder_name, 'metadata_v0.json'))
... |
<|fim_prefix|>def <|fim_suffix|>(args: List[str]) -> Optional[Dict[str, Any]]:
try:
opts, items = parse_broadcast_args(args[1:])
except SystemExit as e:
if e.code != 0:
print(e.args[0], file=sys.stderr)
input(_('Press Enter to quit'))
return None
sys.stdout.fl... |
<|fim_prefix|>def <|fim_suffix|>(cls) -> List[str]:
"""
Return a list of metadata fields that can be used to order an entity
list.
"""
return ["duration", "publication_date"]<|fim_middle|>get_allowed_meta_order_fields<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self, combined_system, molecule_name):
combined_system.remove_molecule_type(molecule_name)
# Just a sanity check
combined_system.to_files(prefix=molecule_name, decimal=8)
get_intermol_defaults(periodic=True).write_mdp_file("tmp.mdp")
_process(
_run_gmx_energy... |
<|fim_prefix|>def <|fim_suffix|>(self):
return 1<|fim_middle|>eccentricity<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(
client, phase_factory, idea_factory, user, category_factory, organisation
):
phase, module, project, idea = setup_phase(
phase_factory, idea_factory, phases.IssuePhase
)
category = category_factory(module=module)
url = reverse(
"a4_candy_ideas:idea-c... |
<|fim_prefix|>def <|fim_suffix|>(self):
return {group: {}}<|fim_middle|>setup_loader_modules<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self):
if self.mt_dict is None:
print "Cannot save GMT, please read a ModEM data and/or response file first"
self.data_array=np.zeros((len(self.mt_dict), 6))
for i in range(len(self.mt_dict)):
for ii, att in enumerate(['lon', 'lat', self.colorby, 'azimuth', '... |
<|fim_prefix|>def <|fim_suffix|>(self, available_ports):
"""
Combines all ports that should be added to the
Dockerfile into one array
"""
port_list = []
for p in available_ports:
if p.get("expose", True):
port_list.append(p.get("value"))
return port_list<|fim_middle|>port... |
<|fim_prefix|>def <|fim_suffix|>(self):
data = self.load_hdf5_file(self.events_file)
data = self.calc_rho36(data)
if any(key.startswith("unc_est") for key in self.cuts):
data = self.calc_uncertainties(data)
data = self.apply_cuts(data, self.cuts)
for name in self.output_names:
contai... |
<|fim_prefix|>def <|fim_suffix|>(self):
return MonitorAlarmShieldStrategyComponent<|fim_middle|>component_cls<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(head: Object) -> Iterator[Object]:
"""
Iterate over all of the nodes in a list.
:param head: ``struct list_head *``
:return: Iterator of ``struct list_head *`` objects.
"""
head = head.read_()
pos = head.next.read_()
while pos != head:
yield pos
... |
<|fim_prefix|>def <|fim_suffix|>(monkeypatch, clean_env):
patch_platforms(monkeypatch, [])
with pytest.raises(
RuntimeError,
match=r"No Toga backend could be loaded.",
):
_get_platform_factory()<|fim_middle|>test_no_platforms<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self, title, file_output):
save_plot_file(file_output, title, self._get_plotly_figs(title))<|fim_middle|>save_to_file<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>():
y = [None, 1, 2, None, None, 5, None, 7, None]
filled = _fill_missing_data(y, max_gap_fraction=0.5)
assert filled == [None, 1, 2, 3, 4, 5, 6, 7, None]
filled = _fill_missing_data(y, max_gap_fraction=0.1)
assert filled == [None, 1, 2, None, None, 5, 6, 7, None]<|fi... |
<|fim_prefix|>def <|fim_suffix|>(args):
tapsets = tapset_dir(args.binary)
if args.verbose:
print("Using tapset dir '%s' for binary '%s'" % (tapsets, args.binary))
def print_probes(verbose, name):
prefix = probe_prefix(args.binary)
offset = len(prefix) + 1
script = prefix + ".... |
<|fim_prefix|>def <|fim_suffix|>(function, parameters, expected_error, expected_message):
"""
Test `trace` function of `Tracer` class with bad parameters.
"""
with pytest.raises(expected_error) as excinfo:
Tracer.trace(function, parameters)
assert str(excinfo.value) == expected_message<|fim_... |
<|fim_prefix|>def <|fim_suffix|>(self):
"""Similar situation as with `mongodb-bin` above but the opposite."""
pkg_name = "guitar-pro"
correct_arch_dep_name = "lib32-portaudio"
self.remove_if_installed(pkg_name, correct_arch_dep_name)
fake_pikaur(f"-S {pkg_name}")
self.assertInstalled(pkg_name)
... |
<|fim_prefix|>def <|fim_suffix|>(self) -> str:
"""
The provisioning state of the mobile network resource.
"""
return pulumi.get(self, "provisioning_state")<|fim_middle|>provisioning_state<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(
self,
**kwargs # type: Any
):
# type: (...) -> Iterable["models.OperationsListResult"]
"""List available operations.
List the available operations supported by the Microsoft.Maintenance resource provider.
:keyword callable cls: A custom type or function that wi... |
<|fim_prefix|>def <|fim_suffix|>(self):
t = TransactionMetaData()
# Can't get data that wasn't set:
with self.assertRaises(KeyError) as c:
t.data(self)
self.assertEqual(c.exception.args, (self,))
data = dict(a=1)
t.set_data(self, data)
self.assertEqual(t.data(self), data)
# Can't... |
<|fim_prefix|>def <|fim_suffix|>(subjects_list: Iterable[Subject]) -> None:
# Check that it's an iterable
try:
iter(subjects_list)
except TypeError as e:
message = f'Subject list must be an iterable, not {type(subjects_list)}'
raise TypeError(message) from e
# Check that it's not... |
<|fim_prefix|>async def <|fim_suffix|>(self, connection: SendConnection, req: Subscribe) -> None:
self._check_topics(req.topics)
self._maybe_add_session(connection)
for topic in req.topics:
self._topic_info[topic].subscribers.add(connection.session_id)<|fim_middle|>subscribe<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(h, f):
if h[:4] == '.snd':
f = get_long_be
elif h[:4] in ('\0ds.', 'dns.'):
f = get_long_le
else:
return None
type = 'au'
hdr_size = f(h[4:8])
data_size = f(h[8:12])
encoding = f(h[12:16])
rate = f(h[16:20])
nchannels = f(h[20:... |
<|fim_prefix|>def <|fim_suffix|>(self):
graph = Graph()
opExport = OpFormattedDataExport(graph=graph)
data = numpy.random.random((100, 100)).astype(numpy.float32) * 100
data = vigra.taggedView(data, vigra.defaultAxistags("xy"))
opExport.Input.setValue(data)
sub_roi = [(10, 0), (None, 80)]
op... |
<|fim_prefix|>def <|fim_suffix|>(self, context: RuleContext) -> Optional[LintResult]:
"""Looking for DISTINCT before a bracket.
Look for DISTINCT keyword immediately followed by open parenthesis.
"""
seq = None
anchor = None
children = FunctionalContext(context).segment.children()
if context... |
<|fim_prefix|>def <|fim_suffix|>(path):
from pathlib import Path
return Path(__file__).parent / path<|fim_middle|>here<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(args=None):
"""Entry point for nuc_data_make utility."""
print(message(pyne_logo))
make_funcs = [
("atomic_mass", make_atomic_mass),
("scattering_lengths", make_scattering_lengths),
("decay", make_decay),
("simple_xs", make_simple_xs),
... |
<|fim_prefix|>def <|fim_suffix|>():
parser = argparse.ArgumentParser(description="MiSoC port to the Papilio Pro")
builder_args(parser)
soc_sdram_args(parser)
args = parser.parse_args()
soc = BaseSoC(**soc_sdram_argdict(args))
builder = Builder(soc, **builder_argdict(args))
builder.build()<|f... |
<|fim_prefix|>def <|fim_suffix|>(filter_dir=False, r_list=False):
res = _get_dir_source_name(ConfigLoader.get_items_dir(), filter_dir=filter_dir)
if res:
if r_list:
res = list(res)
return res
else:
return []<|fim_middle|>get_all_items_sources<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self: "T") -> "T":
raise NotImplementedError<|fim_middle|>find_debug<|file_separator|> |
<|fim_prefix|>def <|fim_suffix|>(self, operation, value):
self.changes.append((operation, value))<|fim_middle|>apply_changelog_event<|file_separator|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.