content stringlengths 22 815k | id int64 0 4.91M |
|---|---|
def get_f1_score(labels, pre_file, gold_file):
"""
Get F1 scores for each label.
Args:
labels: list of labels.
pre_file: prediction file.
gold_file: ground truth file.
Returns:
average F1 score on all labels.
"""
pre_lines = [json.loads(line.strip())['label'] fo... | 67,200 |
def calendar_date(year, doy):
"""
Calendar date from day of year
@param year : int
@param doy : int
day of year
@return: tuple of ints
(year, month, day)
"""
if doy < 32:
month = 1
day = doy
elif doy < 60 + leap_year(year):
month = 2
day = doy - 31
else:
if leap_year(yea... | 67,201 |
def test_qfe1700a1_qfe1700a1_v(mode, save_output, output_format):
"""
TEST :3.3.2 XML Representation of Element Declaration Schema
Components : A1:XmlValidation for xsi:nil="false" even though
processContents="skip"
"""
assert_bindings(
schema="msData/element/QFE1700a.xsd",
insta... | 67,202 |
def get_vulnerabilities():
"""Return a paginated list of available vulnerabilities
For vulnerability details see
:http:get:`/api/1.0/vulnerabilities/(int:vuln_id)`
**Example request**:
.. sourcecode:: http
GET /api/1.0/vulnerabilities HTTP/1.1
Host: cp.cert.europa.eu
Accep... | 67,203 |
def alpha_075(enddate, index='all'):
"""
Inputs:
enddate: 必选参数,计算哪一天的因子
index: 默认参数,股票指数,默认为所有股票'all'
Outputs:
eries:index为成分股代码,values为1或-1,当满足条件时为1,否则为-1
公式:
(rank(correlation(vwap, volume, 4.24304)) < rank(correlation(rank(low), rank(adv50), 12.4413)))
"""
... | 67,204 |
def overlayisrhist(P):
"""
1) read ISR plasma line
2) read ISR long pulse
3) sum over power from in NEIAL altitude range
4) load HiST video
5) register ISR to HST
6) plot overlay joint data
"""
if P["optfn"] and P["azelfn"]:
optfn = Path(P["optfn"]).expanduser()
azelf... | 67,205 |
def test_examples_protocol_advanced_https_ota_example_chunked(dut: Dut) -> None:
"""
This is a positive test case, which downloads complete binary file multiple number of times.
Number of iterations can be specified in variable iterations.
steps: |
1. join AP
2. Fetch OTA image over HTTPS
... | 67,206 |
def change_referential(
self,
rotation_speed,
is_waveform,
atol=1e-9,
axes_list_change=list(),
arg_list=list(),
freqs_new=np.array([]),
I1=np.array([]),
Irf_un=np.array([]),
sym_t_new=dict(),
ta_in=tuple(),
ta_out=tuple(),
atol_freq=1e-6,
):
"""Change referential ... | 67,207 |
def get_model(tree_type='lgb', objective='regression', n_tree=100,
max_depth=5, random_state=1, max_bins=255, learning_rate=0.3):
"""
Return the ensemble object from the specified framework and objective.
"""
if tree_type == 'cb':
class_fn = CatBoostRegressor if objective == 'regr... | 67,208 |
def alert_gwg_owners(team, subject=None, body=None):
"""Direct messages the owners of the GWG challenge that there isn't a form available
for todays game and that their players are angry!!!
"""
owners = secrets.get_team_contacts(team)
if not subject:
subject = "GWG form not created yet for ... | 67,209 |
def test_del_node_with_edge_deletes_node_and_edge(full_graph_1):
"""Test that deleting a node with an edge deletes both node and edge."""
g = full_graph_1
g.del_node(4)
g.del_node(3)
assert 4 not in g.node_set
assert 3 not in g.node_set
assert (3, 5) not in g.edge_set
assert (5, 3) not i... | 67,210 |
def setup_logger(name, level=logging.INFO):
"""Function setup as many loggers as you want"""
if not os.path.exists('log'):
os.makedirs('log') # pragma: no cover
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
handler = logging.StreamHandler(sys.stdout)
handler.setFor... | 67,211 |
def make_client(args, password='BadKangaroo'):
"""Make an app3 client that talks to an olinapp3 server."""
if 'local' in args:
client = App3Client('localhost:8080', password)
else:
client = App3Client('olinapp3.appspot.com', password)
return client | 67,212 |
def app(args): # pragma: no cover
"""
Dumps Concepticon's contents for English, German, Chinese, and French.
Notes
-----
Data are by default dumped into a structured JSON file in html/data.js.
Examples
--------
$ concepticon html
"""
data = defaultdict(list)
def key(g, l)... | 67,213 |
def test_notify_sparkpost_plugin_attachments(mock_post):
"""
API: NotifySparkPost() Attachments
"""
# Disable Throttling to speed testing
plugins.NotifyBase.request_rate_per_sec = 0
plugins.NotifySparkPost.sparkpost_retry_wait_sec = 0.1
plugins.NotifySparkPost.sparkpost_retry_attempts = 3
... | 67,214 |
def GetConfigFilePaths():
"""Returns a list of the path(s) to the boto config file(s) to be loaded."""
potential_config_paths = BotoConfigLocations
# When Boto's pyami.config.Config class is initialized, it attempts to read
# this file, transform it into valid Boto config syntax, and load credentials
# from ... | 67,215 |
def separate_qtranslate_content(text):
"""Parse the content of a wordpress post or page and separate
the various language specific contents when they are delimited
with qtranslate tags: <!--:LL-->blabla<!--:-->"""
# TODO: uniformize qtranslate tags <!--/en--> => <!--:-->
qt_start = "<!--:"
qt_en... | 67,216 |
def get_current_user_info(token):
"""Returns information about the authenticated user."""
return _fetch_api(token, GITHUB_API_ROOT + '/user', bust_cache=True) | 67,217 |
def test_upload_empty_files(test_client, init_database):
"""
GIVEN a Flask application
WHEN an logged-in user uploads only empty valid txt-files on '/user/upload-project' (POST)
THEN check if it is not redirected to any other routes due to invalid inputs:
1. the response is valid -> user stays at '/user/upload-p... | 67,218 |
def make_typos(basephrase, mutators):
"""Generate a series of strings, each of which is one typo off from the
original string.
"""
for mutator in mutators:
for index in xrange(len(basephrase)):
phrase = mutator(basephrase, index)
yield phrase | 67,219 |
def generate_loop_matrix_element(process_definition, reuse, output_path=None,
cmd = FakeInterface(), proc_name=None, loop_filter=None):
""" Generate a loop matrix element from the process definition, and returns
it along with the timing information dictionary.
If reuse is True, it re... | 67,220 |
def test_resource_merge_list_of_named_dict():
""" Test merge lists of named dictionary objects
This is unique for Big-IP resources that are
lists of named objects (the resources must have
a unique property 'name').
"""
test_data = [
# desired, existing, merged
(
... | 67,221 |
def remove_no_include(wikicode: mwparserfromhell.wikicode.Wikicode) -> mwparserfromhell.wikicode.Wikicode:
"""Removes the noinclude tags"""
for tag in wikicode.filter_tags():
if tag.tag.matches('noinclude'):
try:
wikicode.remove(tag)
except ValueError:
... | 67,222 |
def parse_query_params(connection: HTTPConnection) -> Dict[str, Any]:
"""
Parses and normalize a given connection's query parameters into a regular dictionary
"""
qs = cast(Union[str, bytes], connection.scope.get("query_string", ""))
return reduce(
_query_param_reducer,
parse_qsl(qs ... | 67,223 |
def _get_state(self):
"""Get dictionary of dataclass fiels."""
return _dc.asdict(self) | 67,224 |
def twilightFunc(xdata, *args, amCut=1.0):
"""
xdata: numpy array with columns 'alt', 'az', 'sunAlt' all in radians.
az should be relative to the sun (i.e., sun is at az zero.
based on what I've seen, here's my guess for how to fit the twilight:
args[0] = ratio of (zenith twilight flux at sunAlt = ... | 67,225 |
def matrix_constant_mult(m, c):
"""
Multiply components of matrix m by constant c
"""
return [mult(row_m, c) for row_m in m] | 67,226 |
def rasterize_geom(geom, affine, shape):
""" Rasterize geometry to a matching affine and shape. """
geoms = [(geom, 1)]
rv_array = features.rasterize(
geoms,
out_shape=shape,
transform=affine,
fill=0,
dtype='uint8'
)
return rv_array.astype(bool) | 67,227 |
def test_build():
""" Test building a packet. """
packet = Packet.build(
payload_module=ReadCentral,
controller_id=0,
connection_handle=0x0040,
attribute_handle=0x0003
)
assert isinstance(packet, Packet)
assert packet.controller_id == 0
assert packet.payload_type... | 67,228 |
def test_config_keys() -> None:
"""Tests the config key parser with both string and full email formats."""
with pytest.raises(ConfigFileError):
f = StringIO("""
configs:
has.periods:
urls:
- json://localhost
""")
load_config(_lo... | 67,229 |
def count_plot(values, display='both'):
"""
Plots a horizontal histogram counting the number of samples in each category.
Parametres
----------
values: array-like, pd.Series, shape (n_sample, )
The observed values to count. If pd.Series with a name, will use
name in the legend.
... | 67,230 |
def top_usernames_used():
"""
Get top usernames used according to module
Returns:
JSON/Dict of top usernames used
"""
module_name = get_value_from_request("module_name")
module_query = [
group_by_ip_dest_and_username,
{
"$skip": fix_skip(
get_... | 67,231 |
def assert_equal(
actual: Tuple[
int, int, int, Literal["coordinate"], Literal["pattern"], Literal["general"]
],
desired: Tuple[
int, int, int, Literal["coordinate"], Literal["pattern"], Literal["general"]
],
):
"""
usage.scipy: 1
"""
... | 67,232 |
def robust_match_fundamental(p1, p2, matches, config):
"""Filter matches by estimating the Fundamental matrix via RANSAC."""
if len(matches) < 8:
return np.array([])
p1 = p1[matches[:, 0]][:, :2].copy()
p2 = p2[matches[:, 1]][:, :2].copy()
FM_RANSAC = cv2.FM_RANSAC if context.OPENCV3 else ... | 67,233 |
def beam_position(images):
"""Returns first moment of beam position (X1,Y1) in units of pixels
relative to the center pixel in images. The mask is assumed to be 7x7."""
from numpy import array,arange
height,width = images[0].shape
N_bkg = background_mask().sum()
X0 = int((width-1)/2)
Y0 = in... | 67,234 |
def median_freq_balancing(dataloader, num_classes):
"""Computes class weights using median frequency balancing as described in https://arxiv.org/abs/1411.4734:
w_class = median_freq / freq_class,
where freq_class is the number of pixels of a given class divided by the total number of pixels in images wh... | 67,235 |
def filter(params: LDS,
x_hist: chex.Array,
jump_size: chex.Array,
dt: chex.Array):
"""
Compute the online version of the Kalman-Filter, i.e,
the one-step-ahead prediction for the hidden state or the
time update step
Parameters
----------
x_hist: array(times... | 67,236 |
def poly_trace(m, a):
"""Compute the coefficients of the trace polynomial of (a*x) mod m."""
out = [0, a]
for i in range(FIELD_BITS - 1):
out = poly_sqr(out)
while len(out) < 2:
out += [0]
out[1] = a
poly_divmod(m, out)
return out | 67,237 |
def test_flexx_in_thread5():
""" Test using loop arg for easier use.
"""
res = []
server = app.create_server(loop=asyncio.new_event_loop())
assert server.serving
# note: mmmm, I don't particularly like this, but need it to get Tornado working
assert server._loop is asyncio.get_event_loop()
... | 67,238 |
def totalStatistics(totalData, saveLoc):
"""Plots the error in a combined box plot
Input arguments:
totalData = error data which is to be analysed
saveLoc = where to save the image
"""
mean = np.zeros([10,36])
std = np.zeros([10,36])
index = 0
for _, dataSet in enumerate(totalDat... | 67,239 |
def convert_examples_to_features(examples, tokenizer, max_seq_length,
is_training):
"""Loads a data file into a list of `InputBatch`s."""
# RACE is a multiple choice task. To perform this task using Bert,
# we will use the formatting proposed in "Improving Language
# Un... | 67,240 |
def binRV(time, rv, err=None, stat='wmean', tstat='wmean', estat='addquad',
binning_indices=False, n_consecutive=None, consecutive_step=None,
seed=None):
""" Bin a dataset of radial-velocity observations.
Parameters
----------
time : array
The array of times where the radial... | 67,241 |
def get_secret(secret_id):
"""
Get a Secret from Secrets Manager.
"""
return secrets_client.get_secret_value(SecretId=secret_id)["SecretString"] | 67,242 |
def generate_mutation_tracker(old_attributes, new_attributes):
"""
Given old attributes of an entity and the new attributes in a Properties object, this method creates a new
dictionary based on the whole old attributes dictionary, with:
- the attributes in old_attributes updated with the attributes in ... | 67,243 |
def build_model(model_name: str) -> Tuple[transformers.FeatureExtractionMixin, torch.nn.Module]:
"""
Builds the model given its name
Args:
model_name (str): The name of the ViT
Returns:
Tuple[transformers.FeatureExtractionMixin, torch.nn.Module]: The feature extractor and the model
... | 67,244 |
def suppress_oserror(*errnos):
"""Suppress OSError Exceptions
This is an extension to `contextlib.suppress()` from the python standard
library. It catches any `OSError` exceptions and suppresses them. However,
it only catches the exceptions that match the specified error numbers.
Parameters
--... | 67,245 |
def verify_chassis_pic_exists_under_mic(device,
mic,
fpc,
invert=False,
max_time=60,
check_interval=10):
""" Verif... | 67,246 |
def selection_sort(lst):
"""This function will do a sort on a string of input."""
for i in range(len(lst)):
if len(lst) == 0:
return False
min_position = i
for j in range(i+1, len(lst)):
if lst[min_position] > lst[j]:
min_position = j
temp... | 67,247 |
def transform(transformation_matrix, points):
"""
Does homographic transformation to points using given transformation matrix.
See
http://www.corrmap.com/features/homography_transformation.php
https://wp.optics.arizona.edu/visualopticslab/wp-content/uploads/sites/52/2016/08/Lectures6_7.pdf
"""... | 67,248 |
def the_task_has_finished_with_status_group1_after_group2_checks(step, status, checks):
"""
Step: Waits for task execution. It will check after 5 seconds the task status. Number of checks by param 'checks'
"""
finished = wait_for_task_finished(vdc_id=world.tenant_id, task_id=world.task_id,
... | 67,249 |
def load_rollouts_from_dir(
ex_dir: str, key: Optional[str] = "rollout", file_exts: Tuple[str] = ("pt", "pkl")
) -> Tuple[List[StepSequence], List[str]]:
"""
Crawl through the given directory and load all rollouts, i.e. all files that include the key.
:param ex_dir: directory, e.g. and experiment folde... | 67,250 |
def sort(in_file, out_file):
"""Sorts the given file.
"""
filehandle = open(in_file, 'r')
lines = filehandle.readlines()
filehandle.close()
lines.sort()
filehandle = open(out_file, 'w')
for line in lines:
filehandle.write(line)
filehandle.close() | 67,251 |
def test_b_traversal_from_deep_node_gets_full_node_list(full_graph_tree):
"""Test that traversing from deep node gets all the nodes."""
assert full_graph_tree.breadth_first_traversal(1) == [1, 2, 3, 5, 4, 6, 7] | 67,252 |
def TextureAddMemoryHints(builder, memoryHints):
"""This method is deprecated. Please switch to AddMemoryHints."""
return AddMemoryHints(builder, memoryHints) | 67,253 |
def S_outlier_filter(_data_list, _factor=4):
"""
Returns data samples where data samples significantly greater than median are discarded.
"""
n_data = []
ds = len(_data_list)
p_d = S_translate_to_positive_axis_values(_data_list)
m_d = mining.S_median_sample_values(p_d)
b_v = m_d[1] ... | 67,254 |
def get_default_palette():
"""
Return the default color palette, which slightly
tweaks the Digital Standards for better flexibility on
light/dark backgrounds.
"""
palette = {}
# the standard set of colors
palette["blue"] = "#2176d2"
palette["green"] = "#58c04d"
palette["yellow... | 67,255 |
def _read_plist_file(root, file_name):
"""
:param root: The root path of the plist file
:param file_name: The name of the plist file
:return: An empty dictionary if the plist file was invalid, otherwise, a dictionary with plist data
"""
file_path = os.path.join(root, file_name)
log.debug("r... | 67,256 |
def _Vdual(s,R,V = None):
"""Finds the dual of the potential matrix.
Args:
s (list of int): The number of samples points along each
basis vector.
R (numpy.ndarray): The basis vectors for the unit cell.
V (function, optional): The function that defines the potential.
... | 67,257 |
def iv():
"""
The initialization vector to use for encryption or decryption.
It is ignored for MODE_ECB and MODE_CTR.
"""
return chr(0) * 16 | 67,258 |
def build_inputs(data_params, input_context=None):
"""Returns tf.data.Dataset for sentence_prediction task."""
return data_loader_factory.get_data_loader(data_params).load(input_context) | 67,259 |
def test_sersic_profile():
"""This test generates a simple Sersic light profile with Galsim and GalFlow,
then checks that the same image stamp is recovered
"""
# check scale_radius input
obj = galsim.Sersic(n=n, scale_radius=scale_radius)
image_galsim_scale_radius = obj.drawImage(nx=stamp_size, ny=stamp_... | 67,260 |
def support_index():
"""
Renders a page with the details on how to get support for the Wikimetrics project.
"""
return render_template('support.html') | 67,261 |
def send_notifications(entries):
"""
We don't expect any Exceptions from this function - all exceptions inside
this func must be catched and logged.
"""
notify_telegram(entries) | 67,262 |
def SetDeWeReadDmaUart(func):
"""Set dewe read dma uart"""
global f_dewe_read_dma_uart
f_dewe_read_dma_uart = func | 67,263 |
def peak_count_hist(dat, bins=20, lim=None, neighborhood_size=5, threshold=0, log=True, mean=True):
"""Make the histogram of the peak count of data.
Arguments
---------
dat : input data (numpy array, first dimension for the sample)
bins : number of bins for the histogram (default 20)
lim : li... | 67,264 |
def url(value,
allow_empty = False,
allow_special_ips = False,
**kwargs):
"""Validate that ``value`` is a valid URL.
.. note::
URL validation is...complicated. The methodology that we have
adopted here is *generally* compliant with
`RFC 1738 <https://tools.ietf.org/ht... | 67,265 |
def get_indent(text):
"""Get text indentation.
Args:
text: Text to analyze.
Returns:
Number of leftmost spaces.
Notes:
Input text must be tab expanded, otherwise indent will be incorrect.
"""
return len(text) - len(text.lstrip()) | 67,266 |
async def remove_token(token):
"""Remove token from database."""
async with get_pool().acquire() as connection:
await connection.execute('''
DELETE FROM tokens WHERE token = $1
''', token) | 67,267 |
def ray_get_if_needed(obj: Any) -> Any:
"""If obj is an ObjectRef, do ray.get, otherwise return obj"""
if isinstance(obj, ray.ObjectRef):
return ray.get(obj)
return obj | 67,268 |
def get_mark(name, task):
"""Getting marks of students for certain student and task"""
return int(input('Mark for {}, task {} > '.format(name, task))) | 67,269 |
def svn_opt_args_to_target_array3(*args):
"""
svn_opt_args_to_target_array3(apr_array_header_t targets_p, apr_getopt_t os, apr_array_header_t known_targets,
apr_pool_t pool) -> svn_error_t
"""
return apply(_core.svn_opt_args_to_target_array3, args) | 67,270 |
def func(x):
# type: (str) -> int
"""Docstring""" | 67,271 |
def is_unary(s: str) -> bool:
"""Checks if the given string is a unary operator.
Parameters:
s: string to check.
Returns:
``True`` if the given string is a unary operator, ``False`` otherwise.
"""
return s == '~' | 67,272 |
def prior_current_next(iterable, pad=None):
""""
s -> (pad, s0, s1), (s0,s1,s2), ..., (sN-1, sN, pad).
Aka 'prior, current, and next' elements in an iteration all
at once.
Lets you visit each element in an iterable while also being
presented with the prior and next element... | 67,273 |
def test_suite():
"""Test suite including all test suites"""
testSuite = unittest.TestSuite()
testSuite.addTest(test_listtools("test_unique"))
testSuite.addTest(test_listtools("test_sort"))
return testSuite | 67,274 |
def load_sql(conn: pg.Connection, sql: str):
"""
Convenience function to load and commit sql.
"""
with conn.cursor() as cur:
cur.execute(sql)
conn.commit() | 67,275 |
def create_db_session(*, engine: Engine) -> scoped_session:
"""Broadly speaking, the Session establishes all conversations with the database.
It represents a “holding zone” for all the objects which you’ve loaded or
associated with it during its lifespan.
"""
return scoped_session(
sessio... | 67,276 |
def to_html_dicts(*, indent='', open_icon='<i class="fa fa-square-o"></i> ',
done_icon='<i class="fa fa-check-square-o"></i> '):
"""
Takes our todo list, and returns two dictionaries of where the keys equal
to the project name, and the value is a string of the todo items for ... | 67,277 |
def select_locale():
"""
Selects the locale. Babel uses this to
determine which language to go with.
"""
try:
if opt['VERBOSE']:
print(session['LANG'])
return session['LANG']
except Exception, ex:
return opt['LANG'] | 67,278 |
def _format_line(k, v):
"""
Format a readable line.
"""
return "0x%08x: %20s --> %s\n" % (v.start, str(k), str(v)) | 67,279 |
def pick_device_id() -> int:
"""Tries to use a library to list video devices"""
try:
import pymf # noqa
except ImportError:
return 0
device_list = pymf.get_MF_devices()
if not device_list:
raise RuntimeError('No video devices found...')
elif len(device_list) == 1:
... | 67,280 |
def feature_extraction(activity, location, word2vec_file):
"""feature extraction function giving word embedding, demographics, case no.,
weather and social dist. levels"""
# initiate placeholder and progress bar
bar = st.progress(0)
placeholder = st.empty()
# get current date
date =... | 67,281 |
def runTest(init=False, show=True):
"""Test the simple car problem with finite difference approximation."""
x0 = np.array([1, 0, 0, 0])
xf = np.array([0, 1, 0, 0])
N = 10
h = 2.0 / (N - 1) # to make time meet
prob = CarProb(OmniCar(), CircleConstr(), x0, xf, N, h)
cfg = snoptConfig()
cf... | 67,282 |
def axialslices_plotting(value):
"""creates graphical objects for similarities at level1/2 for plotting purposes"""
layout_plot = go.Layout(width=600, height=500, autosize=True,
margin=go.layout.Margin(l=5, r=5, b=5, t=5, pad=0),
scene=dict(
... | 67,283 |
def get_sample_sheet_text(p7_index_length, p5_index_length):
"""
Gets the sample sheet text that will demux cells into one set of files
"""
sample_sheet_template = """[DATA]
Lane,Sample_ID,Sample_Name,index,index2
%s"""
line = ',fake,fake,%s,%s' % ('N' * p7_index_length, 'N' * p5_index_length)
... | 67,284 |
def truncate_money(money: Money) -> Money:
"""Truncates money amount to the number of decimals corresponding to the currency"""
amount = truncate_to(money.amount, money.currency)
return Money(amount, money.currency) | 67,285 |
def test_jieba_extract3(monkeypatch):
"""测试地名出现两次省名的情况"""
monkeypatch.setattr(cpca, 'province_map', {'江苏': '江苏省', '上海市': '上海市'})
monkeypatch.setattr(cpca, 'city_map', _dict2addr_map({'淮安': '淮安市'}))
monkeypatch.setattr(cpca, 'area_map', _dict2addr_map({'清浦区': '清浦区'}))
pca, addr = cpca._jieba_extract... | 67,286 |
def elephantblog_patterns(list_kwargs={}, detail_kwargs={}):
"""
Returns an instance of ready-to-use URL patterns for the blog.
In the future, we will have a few configuration parameters here:
- A parameter to specify a custom mixin for all view classes (or for
list / detail view classes?)
-... | 67,287 |
def vadd(v1, v2):
""" Add two 3 dimensional vectors.
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vadd_c.html
:param v1: First vector to be added.
:type v1: 3-Element Array of floats
:param v2: Second vector to be added.
:type v2: 3-Element Array of floats
:return: v1+v2
:r... | 67,288 |
def get_average_precisions(gt: list, predictions: list, class_names: list, iou_thresholds: list) -> np.array:
"""Returns an array with an average precision per class.
Args:
gt: list of dictionaries in the format described below.
predictions: list of dictionaries in the format described b... | 67,289 |
def test_catkin_lint_tool_plugin_parse_valid():
"""Verify that we can parse the normal output of catkin_lint."""
cltp = setup_catkin_lint_tool_plugin()
output = "custom_pkg: notice: use ${PROJECT_NAME} instead of 'custom_pkg'"
package = Package(
"valid_package", os.path.join(os.path.dirname(__fi... | 67,290 |
def make_stan_person(num1, num2):
"""字段列表
"busi_reg_no":"客户号",
"ctnm":"客户名称",
"cten":"拼音/英文名称",
"client_tp":"客户类别",1客户,2商户
"account_tp":"账户分类",1/2/3代表1、2、3类账号
"busi_type":"业务类型",
"smid":"主体特约商户编号",
"citp":"证件类型",
"citp_ori":"证件类型原值",
"citp_nt":"证件类型说明",
"ctid":"证件号码",
... | 67,291 |
def run_emmax(
gene_id,
vcfs,
regions,
phenotypes,
samples,
kin,
tempdir,
outdir,
covariates=None,
num_lesser_pval=15,
min_permut=1000,
max_permut=10000,
maf=0.05,
bcftools_path='bcftools',
pEmmax_path='pEmmax',
verbose=False,
):
"""
Run ... | 67,292 |
async def my_roles(ctx):
"""Command to generate a list of the users current roles
Args:
- ctx: context that the command occured use this to access the message and other attributes
"""
mentions = ctx.message.mentions
channel = ctx.channel
if len(mentions) < 1:
member = ctx.aut... | 67,293 |
def zeros(shape, dtype=None, name=None):
"""
The OP creates a tensor of specified :attr:`shape` and :attr:`dtype`, and fills it with 0.
Args:
shape(tuple|list|Tensor): Shape of the Tensor to be created, the data type of ``shape`` is int32 or int64.
dtype(np.dtype|str, optional): Data type o... | 67,294 |
def scroll_array(array: numpy.ndarray, dx: int=0, dy: int=0) -> numpy.ndarray:
"""
Scroll pixels inside a 3d array (RGB values)
Use dy to scroll up or down (move the image of dy pixels)
:param dx: int, Use dx for scrolling right or left (move the image of dx pixels)
:param dy: int, Use dy to ... | 67,295 |
def available_datasets(dataset_path=None, keys_only=True):
"""Get a list of available datasets.
Parameters
----------
dataset_path: path
location of saved dataset files
"""
if dataset_path is None:
dataset_path = processed_data_path
else:
dataset_path = pathlib.Path(... | 67,296 |
def test_multi_episodes_continuous():
# type: () -> None
"""A two-part episode should not have the episode name repeated
"""
ep = EpisodeInfo(
seriesname = 'Stargate SG-1',
seasonnumber = 1,
episodenumbers = [1, 2],
episodename = [
'Children of the Gods (1)',
... | 67,297 |
def onMouseWheelScroll( event ):
""" Checks the widget under the mouse when a scroll event occurs, and then looks through the GUI geometry
for parent widgets that may have scroll wheel support (indicated by the "scrollFlag" bool attribute). """
# Cross-platform resources on scrolling:
# - http://stackoverflow.c... | 67,298 |
def get_user_by_username(username):
"""
Get user by username helper
:param username:
:return: user query object
"""
user = User.query.filter_by(username=username).first()
return user | 67,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.