function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def test_xavier_uniform(self):
self._test_xavier(initializers.xavier_initializer, [100, 40],
2. / (100. + 40.), True) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_xavier_scalar(self):
self._test_xavier(initializers.xavier_initializer, [], 0.0, True) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_xavier_conv2d_normal(self):
self._test_xavier(tf_slim.xavier_initializer_conv2d, [100, 40, 5, 7],
2. / (100. * 40 * (5 + 7)), False) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_wrong_dtype(self):
with self.assertRaisesRegexp(
TypeError, 'Cannot create initializer for non-floating point type.'):
initializers.variance_scaling_initializer(dtype=dtypes.int32)
initializer = initializers.variance_scaling_initializer()
with self.assertRaisesRegexp(
TypeErro... | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_fan_in(self):
for uniform in [False, True]:
self._test_variance(
initializers.variance_scaling_initializer,
shape=[100, 40],
variance=2. / 100.,
factor=2.0,
mode='FAN_IN',
uniform=uniform) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_fan_avg(self):
for uniform in [False, True]:
self._test_variance(
initializers.variance_scaling_initializer,
shape=[100, 40],
variance=4. / (100. + 40.),
factor=2.0,
mode='FAN_AVG',
uniform=uniform) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_conv2d_fan_out(self):
for uniform in [False, True]:
self._test_variance(
initializers.variance_scaling_initializer,
shape=[100, 40, 5, 7],
variance=2. / (100. * 40. * 7.),
factor=2.0,
mode='FAN_OUT',
uniform=uniform) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_xavier_uniform(self):
self._test_variance(
initializers.variance_scaling_initializer,
shape=[100, 40],
variance=2. / (100. + 40.),
factor=1.0,
mode='FAN_AVG',
uniform=True) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_xavier_scalar(self):
self._test_variance(
initializers.variance_scaling_initializer,
shape=[],
variance=0.0,
factor=1.0,
mode='FAN_AVG',
uniform=False) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_xavier_conv2d_normal(self):
self._test_variance(
initializers.variance_scaling_initializer,
shape=[100, 40, 5, 7],
variance=2. / (100. * 40. * (5. + 7.)),
factor=1.0,
mode='FAN_AVG',
uniform=True) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def test_1d_shape_fan_out(self):
for uniform in [False, True]:
self._test_variance(
initializers.variance_scaling_initializer,
shape=[100],
variance=2. / 100.,
factor=2.0,
mode='FAN_OUT',
uniform=uniform) | google-research/tf-slim | [
334,
98,
334,
11,
1561681288
] |
def __init__(self, config=None):
bce_base_client.BceBaseClient.__init__(self, config) | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def _send_request(self, http_method, path,
body=None, headers=None, params=None,
config=None, body_parser=None):
config = self._merge_config(config)
if body_parser is None:
body_parser = handler.parse_json
if headers is None:
he... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_loadbalancer(self, vpc_id, subnet_id, name=None,
desc=None, client_token=None, config=None):
"""
Create a app LoadBalancer with the specified options.
:param name:
the name of LoadBalancer to create
:type name: string
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_loadbalancer(self, blb_id, name=None, desc=None,
client_token=None, config=None):
"""
Modify the special attribute to new value of the LoadBalancer
owned by the user.
:param name:
name of LoadBalancer to describe
:ty... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_app_loadbalancer_detail(self, blb_id, config=None):
"""
Return detail imformation of specific LoadBalancer
:param blb_id:
id of LoadBalancer to describe
:type blb_id: string
:param config:
:type config: baidubce.BceClientConfiguration
:... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def delete_app_loadbalancer(self, blb_id, client_token=None, config=None):
"""
delete the LoadBalancer owned by the user.
:param blb_id:
id of LoadBalancer to describe
:type blb_id: string
:param client_token:
If the clientToken is not specified ... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_tcp_listener(self, blb_id, listener_port,
scheduler, client_token=None,
config=None):
"""
Create a app tcp listener rule with the specified options.
:param blb_id:
the id of blb which the listener work on... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_udp_listener(self, blb_id, listener_port,
scheduler, client_token=None,
config=None):
"""
Create a app udp listener rule with the specified options.
:param blb_id:
the id of blb which the listener work on... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_http_listener(self, blb_id, listener_port,
scheduler, keep_session=None,
keep_session_type=None,
keep_session_timeout=None,
keep_session_cookie_name=None,
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_https_listener(self, blb_id, listener_port,
scheduler, cert_ids,
keep_session=None,
keep_session_type=None,
keep_session_timeout=None,
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_ssl_listener(self, blb_id, listener_port,
scheduler, cert_ids,
ie6_compatible=None,
encryption_type=None,
encryption_protocols=None,
dual_auth=No... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_tcp_listener(self, blb_id, listener_port,
scheduler=None,
client_token=None,
config=None):
"""
update a app tcp listener rule with the specified options.
:param blb_id:
the... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_udp_listener(self, blb_id, listener_port,
scheduler=None, client_token=None,
config=None):
"""
update a app udp listener rule with the specified options.
:param blb_id:
the id of blb which the listene... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_http_listener(self, blb_id, listener_port,
scheduler=None, keep_session=None,
keep_session_type=None,
keep_session_timeout=None,
keep_session_cookie_name=None,
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_https_listener(self, blb_id, listener_port,
scheduler=None,
keep_session=None,
keep_session_type=None,
keep_session_timeout=None,
keep_... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_ssl_listener(self, blb_id, listener_port,
scheduler=None,
cert_ids=None,
ie6_compatible=None,
encryption_type=None,
encryption_protocols=None,
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_app_tcp_listener(self, blb_id, listener_port=None,
marker=None, max_keys=None,
config=None):
"""
get app tcp listeners identified by bibID
:param blb_id
the id of blb which the listener work on
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_app_udp_listener(self, blb_id, listener_port=None,
marker=None, max_keys=None,
config=None):
"""
get app udp listeners identified by bibID
:param blb_id
the id of blb which the listener work on
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_app_http_listener(self, blb_id, listener_port=None,
marker=None, max_keys=None,
config=None):
"""
get app http listeners identified by bibID
:param blb_id
the id of blb which the listener work on
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_app_https_listener(self, blb_id, listener_port=None,
marker=None, max_keys=None,
config=None):
"""
get app https listeners identified by bibID
:param blb_id
the id of blb which the listener work on... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_app_ssl_listener(self, blb_id, listener_port=None,
marker=None, max_keys=None, config=None):
"""
get app ssl listeners identified by bibID
:param blb_id
the id of blb which the listener work on
:type blb_id:string
:param l... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def delete_app_listeners(self, blb_id, portList,
client_token=None,
config=None):
"""
Release app listener under the specified LoadBalancer,
the listener is specified by listening to the port.
:param blb_id:
id of Loa... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_policys(self, blb_id, listener_port,
app_policy_vos, client_token=None,
config=None):
"""
Create policys.
:param blb_id:
the id of blb which the listener work on
:type blb_id: string
:param listener_port:
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_policys(self, blb_id, listener_port,
marker=None, max_keys=None,
config=None):
"""
get policys
:param blb_id
the id of blb which the listener work on
:type blb_id:string
:param listener_port
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def delete_policys(self, blb_id, listener_port,
policys_list,
client_token=None, config=None):
"""
Release the listener under the specified LoadBalancer,
the listener is specified by listening to the port.
:param blb_id:
id o... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_server_group(self, blb_id,
name=None,
desc=None,
backend_server_list=None,
client_token=None,
config=None):
"""
create server gro... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_server_group(self, blb_id, sg_id,
name=None,
desc=None,
client_token=None,
config=None):
"""
update the information of the app server group
of the specif... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_app_server_group(self, blb_id,
name=None,
exactly_match=None,
marker=None,
max_keys=None, config=None):
"""
Query the imformation of app server group
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def delete_app_server_group(self, blb_id, sg_id,
client_token=None,
config=None):
"""
delete the app server group of the specified LoadBalancer,
:param blb_id:
id of LoadBalancer
:type blb_id:string
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_server_group_port(self, blb_id, sg_id,
port, protocol_type,
health_check=None,
health_check_port=None,
health_check_urlpath=None,
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_server_group_port(self, blb_id, sg_id, port_id,
health_check=None,
health_check_port=None,
health_check_urlpath=None,
health_check_timeout_insecond=None,
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def delete_app_server_group_port(self, blb_id, sg_id,
port_list,
client_token=None, config=None):
"""
delete server group of the specified LoadBalancer,
:param blb_id:
id of LoadBalancer
:type blb_id:s... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def create_app_blb_rs(self, blb_id, sg_id,
backend_server_list,
client_token=None,
config=None):
"""
Add backend server for the specified LoadBalancer and server group,
support batch add
:param blb_id:
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def update_app_blb_rs(self, blb_id, sg_id,
backend_server_list,
client_token=None,
config=None):
"""
update backend server for the specified LoadBalancer and server group,
support batch update
:param blb_id:
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_app_blb_rs(self, blb_id, sg_id,
marker=None, max_keys=None,
config=None):
"""
Query the list of backend servers under the specified LoadBalancer
and server group
:param blb_id:
Id of LoadBalancer
:t... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def delete_app_blb_rs(self, blb_id, sg_id,
backend_server_list,
client_token=None,
config=None):
"""
delete backend server for the specified LoadBalancer and server group,
support batch delete
:param blb_id:
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_rs_mount(self, blb_id, sg_id, config=None):
"""
describe servers of specific server group
:param blb_id:
id of LoadBalancer
:type blb_id:string
:param sg_id:
id of the server group
:type sg_id:string
:param config:
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def describe_rs_unmount(self, blb_id, sg_id, config=None):
"""
describe servers of specific server group
:param blb_id:
id of LoadBalancer
:type blb_id:string
:param sg_id:
id of the server group
:type sg_id:string
:param config:
... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def get_current_namespace():
"""Returns current namespace if available, else kubeflow"""
try:
current_namespace = open(
"/var/run/secrets/kubernetes.io/serviceaccount/namespace"
).read()
except:
current_namespace = "kubeflow"
return current_namespace | kubeflow/pipelines | [
3125,
1400,
3125,
892,
1526085107
] |
def mnist_train(
namespace: str = get_current_namespace(),
worker_replicas: int = 1,
ttl_seconds_after_finished: int = -1,
job_timeout_minutes: int = 600,
delete_after_done: bool = False, | kubeflow/pipelines | [
3125,
1400,
3125,
892,
1526085107
] |
def __init__(self):
super(MainProgram, self).__init__() | StratusLab/client | [
2,
1,
2,
1,
1335119615
] |
def checkOptions(self):
super(MainProgram, self).checkOptions()
if not self.uuids:
printError('Please provide at least one persistent disk UUID to detach')
if self.options.instance < 0:
printError('Please provide a VM ID on which to detach disk')
try:
... | StratusLab/client | [
2,
1,
2,
1,
1335119615
] |
def doWork(self):
configHolder = ConfigHolder(self.options.__dict__, self.config or {})
configHolder.pdiskProtocol = "https"
pdisk = VolumeManagerFactory.create(configHolder)
for uuid in self.uuids:
try:
target = pdisk.hotDetach(self.options.instance, uuid)
... | StratusLab/client | [
2,
1,
2,
1,
1335119615
] |
def parse_output(lines):
results = {}
results['succeeded'] = True
seen_header = False
streams = {}
dest_ip = None
dest_port = None
src_ip = None
src_port = None
for line in lines:
# ignore bogus sessions
if re.match('\(nan%\)', line):
results[... | perfsonar/pscheduler | [
45,
31,
45,
115,
1452259533
] |
def logpmf(k, p, loc=0):
k, p, loc = jnp._promote_args_inexact("geom.logpmf", k, p, loc)
zero = _lax_const(k, 0)
one = _lax_const(k, 1)
x = lax.sub(k, loc)
log_probs = xlog1py(lax.sub(x, one), -p) + lax.log(p)
return jnp.where(lax.le(x, zero), -jnp.inf, log_probs) | google/jax | [
22193,
2080,
22193,
1296,
1540502702
] |
def silence_tf_error_messages(func):
"""Decorator that temporarily changes the TF logging levels."""
def wrapper(*args, **kwargs):
cur_verbosity = tf.compat.v1.logging.get_verbosity()
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.FATAL)
func(*args, **kwargs)
tf.compat.v1.logging.set_verbo... | google-research/federated | [
505,
161,
505,
11,
1600124947
] |
def test_sum_no_noise(self):
with self.cached_session() as sess:
record1 = tf.constant([2, 0], dtype=tf.int32)
record2 = tf.constant([-1, 1], dtype=tf.int32)
query = ddg_sum_query(l2_norm_bound=10, local_scale=0.0)
query_result, _ = test_utils.run_query(query, [record1, record2])
resu... | google-research/federated | [
505,
161,
505,
11,
1600124947
] |
def test_sum_multiple_shapes(self, sample_size):
with self.cached_session() as sess:
t1 = tf.constant([2, 0], dtype=tf.int32)
t2 = tf.constant([-1, 1, 3], dtype=tf.int32)
t3 = tf.constant([-2], dtype=tf.int32)
record = [t1, t2, t3]
sample = [record] * sample_size
query = ddg_sum... | google-research/federated | [
505,
161,
505,
11,
1600124947
] |
def test_sum_nested_record_structure(self, sample_size):
with self.cached_session() as sess:
t1 = tf.constant([1, 0], dtype=tf.int32)
t2 = tf.constant([1, 1, 1], dtype=tf.int32)
t3 = tf.constant([1], dtype=tf.int32)
t4 = tf.constant([[1, 1], [1, 1]], dtype=tf.int32)
record = [t1, dict(... | google-research/federated | [
505,
161,
505,
11,
1600124947
] |
def test_sum_raise_on_l2_norm_excess(self, l2_norm_bound):
with self.cached_session() as sess:
record = tf.constant([10, 10], dtype=tf.int32)
query = ddg_sum_query(l2_norm_bound=l2_norm_bound, local_scale=0.0)
with self.assertRaises(tf.errors.InvalidArgumentError):
query_result, _ = test_... | google-research/federated | [
505,
161,
505,
11,
1600124947
] |
def test_sum_local_noise_shares(self, local_scale, num_records):
"""Test the noise level of the sum of discrete Gaussians applied locally.
The sum of discrete Gaussians is not a discrete Gaussian, but it will be
extremely close for sigma >= 2. We will thus compare the aggregated noise
to a central disc... | google-research/federated | [
505,
161,
505,
11,
1600124947
] |
def test_ascii(self):
self.assertEqual("abc".encode("ascii", errors="surrogatepass"), b"abc")
self.assertEqual(b"abc".decode("ascii", errors="surrogatepass"), "abc") | IronLanguages/ironpython3 | [
2070,
249,
2070,
270,
1393537849
] |
def test_utf_8(self):
self.assertEqual("abc\ud810xyz".encode("utf_8", errors="surrogatepass"), b"abc\xed\xa0\x90xyz")
self.assertEqual(b"abc\xed\xa0\x90xyz".decode("utf_8", errors="surrogatepass"), "abc\ud810xyz") | IronLanguages/ironpython3 | [
2070,
249,
2070,
270,
1393537849
] |
def test_utf_16_be(self):
# lone high surrogate
self.assertEqual("\ud810".encode("utf_16_be", errors="surrogatepass"), b"\xd8\x10")
self.assertEqual(b"\xd8\x10".decode("utf_16_be", errors="surrogatepass"), "\ud810")
#lone low surrogate
self.assertEqual("\udc0a".encode("utf_16_be... | IronLanguages/ironpython3 | [
2070,
249,
2070,
270,
1393537849
] |
def test_utf_32_le(self):
# lone high surrogate
self.assertEqual("\ud810".encode("utf_32_le", errors="surrogatepass"), b"\x10\xd8\x00\x00")
self.assertEqual(b"\x10\xd8\x00\x00".decode("utf_32_le", errors="surrogatepass"), "\ud810")
#lone low surrogate
self.assertEqual("\udc0a".e... | IronLanguages/ironpython3 | [
2070,
249,
2070,
270,
1393537849
] |
def test_utf_32_be(self):
# lone high surrogate
self.assertEqual("\ud810".encode("utf_32_be", errors="surrogatepass"), b"\x00\x00\xd8\x10")
self.assertEqual(b"\x00\x00\xd8\x10".decode("utf_32_be", errors="surrogatepass"), "\ud810")
#lone low surrogate
self.assertEqual("\udc0a".e... | IronLanguages/ironpython3 | [
2070,
249,
2070,
270,
1393537849
] |
def setUp(self):
self.set_filename('unicode_shift_jis.xlsx')
self.set_text_file('unicode_shift_jis.txt') | jmcnamara/XlsxWriter | [
3172,
594,
3172,
18,
1357261626
] |
def index_to_dict(instance):
keys = ('identifier', 'referenced_type', 'referenced_id', 'relationship')
return {k: str(getattr(instance, k)) for k in keys} | dimagi/commcare-hq | [
465,
201,
465,
202,
1247158807
] |
def setUp(self):
super(CaseClaimTests, self).setUp()
self.domain = create_domain(DOMAIN)
self.user = CommCareUser.create(DOMAIN, USERNAME, PASSWORD, None, None)
self.restore_user = get_restore_user(DOMAIN, self.user, None)
self.host_case_id = uuid4().hex
self.host_case_na... | dimagi/commcare-hq | [
465,
201,
465,
202,
1247158807
] |
def create_case(self):
case_block = CaseBlock.deprecated_init(
create=True,
case_id=self.host_case_id,
case_name=self.host_case_name,
case_type=self.host_case_type,
owner_id='in_soviet_russia_the_case_owns_you',
).as_xml()
post_case_blo... | dimagi/commcare-hq | [
465,
201,
465,
202,
1247158807
] |
def test_claim_case(self):
"""
claim_case should create an extension case
"""
claim_id = claim_case(DOMAIN, self.restore_user, self.host_case_id,
host_type=self.host_case_type, host_name=self.host_case_name)
self.assert_claim(claim_id=claim_id) | dimagi/commcare-hq | [
465,
201,
465,
202,
1247158807
] |
def test_first_claim_one(self):
"""
get_first_claim should return one claim
"""
claim_id = claim_case(DOMAIN, self.restore_user, self.host_case_id,
host_type=self.host_case_type, host_name=self.host_case_name)
claim = get_first_claim(DOMAIN, self.use... | dimagi/commcare-hq | [
465,
201,
465,
202,
1247158807
] |
def test_closed_claim(self):
"""
get_first_claim should return None if claim case is closed
"""
claim_id = claim_case(DOMAIN, self.restore_user, self.host_case_id,
host_type=self.host_case_type, host_name=self.host_case_name)
self._close_case(claim_i... | dimagi/commcare-hq | [
465,
201,
465,
202,
1247158807
] |
def test_call_agg():
primitive = Max()
# the assert is run twice on purpose
for _ in range(2):
assert 5 == primitive(range(6)) | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def test_uses_calc_time():
primitive = TimeSinceLast()
primitive_h = TimeSinceLast(unit="hours")
datetimes = pd.Series([datetime(2015, 6, 6), datetime(2015, 6, 7)])
answer = 86400.0
answer_h = 24.0
assert answer == primitive(datetimes, time=datetime(2015, 6, 8))
assert answer_h == primitive_... | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def test_get_function_called_once():
class TestPrimitive(TransformPrimitive):
def __init__(self):
self.get_function_call_count = 0
def get_function(self):
self.get_function_call_count += 1
def test(x):
return x
return test
primit... | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def __init__(self, bool=True, int=0, float=None):
self.bool = bool
self.int = int
self.float = float | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def test_single_args_string():
assert IsIn([1, 2, 3]).get_args_string() == ', list_of_outputs=[1, 2, 3]' | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def test_args_string_mixed():
class Primitive(TransformPrimitive):
def __init__(self, bool=True, int=0, float=None):
self.bool = bool
self.int = int
self.float = float
primitive = Primitive(bool=False, int=0)
string = primitive.get_args_string()
assert string... | Featuretools/featuretools | [
6538,
841,
6538,
165,
1504908917
] |
def testMapFileLine(self):
self.assertTrue(unpack_pak.ParseLine(' {"path.js", IDR_PATH}')) | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def testGetFileAndDirName(self):
(f, d) = unpack_pak.GetFileAndDirName(
'out/build/gen/foo/foo.unpak', 'out/build/gen/foo', 'a/b.js')
self.assertEquals('b.js', f)
self.assertEquals('out/build/gen/foo/foo.unpak/a', d) | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/armor/padded/shared_armor_padded_s01_gloves.iff"
result.attribute_template_id = 0
result.stfName("wearables_name","armor_padded_s01_gloves") | anhstudios/swganh | [
62,
37,
62,
37,
1297996365
] |
def color_name(self):
return self.random_element(self.all_colors.keys()) | deanishe/alfred-fakeum | [
283,
20,
283,
6,
1419863299
] |
def hex_color(self):
return "#{0}".format(
("%x" %
self.random_int(
1, 16777215)).ljust(
6, '0')) | deanishe/alfred-fakeum | [
283,
20,
283,
6,
1419863299
] |
def rgb_color(self):
return ','.join(map(str, (self.random_int(0, 255) for _ in range(3)))) | deanishe/alfred-fakeum | [
283,
20,
283,
6,
1419863299
] |
def create(kernel):
result = Building()
result.template = "object/building/player/shared_player_house_naboo_medium_style_01.iff"
result.attribute_template_id = -1
result.stfName("building_name","housing_naboo_medium") | anhstudios/swganh | [
62,
37,
62,
37,
1297996365
] |
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_doak_sif.iff"
result.attribute_template_id = 9
result.stfName("npc_name","human_base_male") | anhstudios/swganh | [
62,
37,
62,
37,
1297996365
] |
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/droid/shared_binary_load_lifter_droid_chassis.iff"
result.attribute_template_id = -1
result.stfName("craft_droid_ingredients_n","binary_load_lifter_droid_chassis") | anhstudios/swganh | [
62,
37,
62,
37,
1297996365
] |
def main(log_file, test_suite):
worker_test_dict = {}
with open(log_file, 'r') as console_file:
for line in console_file:
regex_search = re.search(fr'\[gw(\d+)] (PASSED|FAILED|SKIPPED|ERROR) (\S+)', line)
if regex_search:
worker_num_string = regex_search.group(1)
... | eduNEXT/edunext-platform | [
28,
7,
28,
10,
1414072000
] |
def upgrade():
with op.batch_alter_table("slices") as batch_op:
batch_op.add_column(sa.Column("certified_by", sa.Text(), nullable=True))
batch_op.add_column(
sa.Column("certification_details", sa.Text(), nullable=True)
) | apache/incubator-superset | [
50904,
10257,
50904,
1280,
1437504934
] |
def setUp(self):
super().setUp()
for record in (1, 2, 3):
# This will store into CSMHE via the post_save signal
csm = StudentModuleFactory.create(
module_state_key=LOCATION('usage_id'),
course_id=COURSE_KEY,
state=json.dumps({'type'... | eduNEXT/edx-platform | [
5,
3,
5,
6,
1390926698
] |
def test_get_history_true_true(self):
student_module = StudentModule.objects.all()
history = BaseStudentModuleHistory.get_history(student_module)
assert len(history) == 6
assert {'type': 'csmhe', 'order': 3} == json.loads(history[0].state)
assert {'type': 'csmhe', 'order': 2} == ... | eduNEXT/edx-platform | [
5,
3,
5,
6,
1390926698
] |
def test_get_history_true_false(self):
student_module = StudentModule.objects.all()
history = BaseStudentModuleHistory.get_history(student_module)
assert len(history) == 3
assert {'type': 'csmhe', 'order': 3} == json.loads(history[0].state)
assert {'type': 'csmhe', 'order': 2} ==... | eduNEXT/edx-platform | [
5,
3,
5,
6,
1390926698
] |
def test_get_history_false_true(self):
student_module = StudentModule.objects.all()
history = BaseStudentModuleHistory.get_history(student_module)
assert len(history) == 3
assert {'type': 'csmh', 'order': 3} == json.loads(history[0].state)
assert {'type': 'csmh', 'order': 2} == j... | eduNEXT/edx-platform | [
5,
3,
5,
6,
1390926698
] |
def pytest_configure(config):
# register the capabilities marker
config.addinivalue_line(
"markers",
"capabilities: mark test to use capabilities"
) | nwjs/chromium.src | [
136,
133,
136,
45,
1453904223
] |
def capabilities():
"""Default capabilities to use for a new WebDriver session."""
return {} | nwjs/chromium.src | [
136,
133,
136,
45,
1453904223
] |
def event_loop():
"""Change event_loop fixture to global."""
global _event_loop
if _event_loop is None:
_event_loop = asyncio.get_event_loop_policy().new_event_loop()
return _event_loop | nwjs/chromium.src | [
136,
133,
136,
45,
1453904223
] |
def http(configuration):
return HTTPRequest(configuration["host"], configuration["port"]) | nwjs/chromium.src | [
136,
133,
136,
45,
1453904223
] |
def server_config():
with open(os.environ.get("WD_SERVER_CONFIG_FILE"), "r") as f:
return json.load(f) | nwjs/chromium.src | [
136,
133,
136,
45,
1453904223
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.