function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def _after_run(self):
self._metrics_processor.process_elapsed_time_metric() | GoogleCloudPlatform/datacatalog-connectors-hive | [
20,
14,
20,
3,
1588024316
] |
def _make_assembled_entries(self, metadata_dict, atlas_entity_types=None):
assembled_entries = self._assembled_entry_factory.\
make_assembled_entries_list(
metadata_dict, atlas_entity_types)
return assembled_entries | GoogleCloudPlatform/datacatalog-connectors-hive | [
20,
14,
20,
3,
1588024316
] |
def _ingest_metadata(self, tag_templates_dict, assembled_entries):
metadata_ingestor = ingest.DataCatalogMetadataIngestor(
self._project_id, self._location_id, self._ENTRY_GROUP_ID)
managed_tag_template = self._tag_template_factory.\
get_tag_template_path(
self._... | GoogleCloudPlatform/datacatalog-connectors-hive | [
20,
14,
20,
3,
1588024316
] |
def __init__(self, context_name, env):
super(VcloudCleanupContext, self).__init__(context_name, env) | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def clean_all(cls, env):
"""
Cleans *all* resources, including resources that were not
created by the test
"""
super(VcloudCleanupContext, cls).clean_all(env) | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def __init__(self, cloudify_config, manager_blueprint_path, **kwargs):
super(CloudifyVcloudInputsConfigReader, self).__init__(
cloudify_config, manager_blueprint_path=manager_blueprint_path,
**kwargs) | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def vcloud_username(self):
return self.config['vcloud_username'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def vcloud_password(self):
return self.config['vcloud_password'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def vcloud_url(self):
return self.config['vcloud_url'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def vcloud_service(self):
return self.config['vcloud_service'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def vcloud_org(self):
return self.config['vcloud_org'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def vcloud_vdc(self):
return self.config['vcloud_vdc'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def manager_server_name(self):
return self.config['server_name'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def manager_server_catalog(self):
return self.config['catalog'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def manager_server_template(self):
return self.config['template'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def management_network_use_existing(self):
return self.config['management_network_use_existing'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def management_network_name(self):
return self.config['management_network_name'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def edge_gateway(self):
return self.config['edge_gateway'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def floating_ip_public_ip(self):
return self.config['floating_ip_public_ip'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def ssh_key_filename(self):
return self.config['ssh_key_filename'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def agent_private_key_path(self):
return self.config['agent_private_key_path'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def user_public_key(self):
return self.config['user_public_key'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def agent_public_key(self):
return self.config['user_public_key'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def management_port_ip_allocation_mode(self):
return self.config['management_port_ip_allocation_mode'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def vcloud_service_type(self):
return self.config['vcloud_service_type'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def vcloud_region(self):
return self.config['vcloud_region'] | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def public_catalog(self):
return 'Public Catalog' | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def ubuntu_precise_template(self):
return 'Ubuntu Server 12.04 LTS (amd64 20150127)' | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def before_bootstrap(self):
super(VcloudHandler, self).before_bootstrap()
vca = login(self.env.cloudify_config)
if vca.get_vdc(TEST_VDC):
status, task = vca.delete_vdc(TEST_VDC)
if status:
wait_for_task(vca, task)
else:
raise Ru... | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def login(env):
vca = vcloudair.VCA(
host=env['vcloud_url'],
username=env['vcloud_username'],
service_type=env['vcloud_service_type'],
version="5.7",
verify=False)
logined = (vca.login(env['vcloud_password']) and
vca.login_to_instance(env['vcloud_instance']... | cloudify-cosmo/tosca-vcloud-plugin | [
4,
10,
4,
1,
1419926867
] |
def test_not_nan(self, num_centroids: int, tau: int, magnitude: float):
"""Check that we don't get Inf."""
def compute_ll(key: chex.PRNGKey) -> float:
num_obs = jax.random.poisson(key, 1, [num_centroids])
nu = num_obs / jnp.sum(num_obs)
q_hat = jnp.ones([num_centroids, tau]) * (10 ** magnitu... | deepmind/neural_testbed | [
178,
11,
178,
1,
1633339646
] |
def api(request):
"""
API Documentation view (via iframe).
"""
context = collect_view_data(request, 'api_docs')
return render(request, 'gui/docs/api.html', context) | erigones/esdc-ce | [
106,
27,
106,
56,
1478554493
] |
def user_guide(request):
"""
User Guide view (via iframe).
"""
context = collect_view_data(request, 'user_guide')
return render(request, 'gui/docs/user_guide.html', context) | erigones/esdc-ce | [
106,
27,
106,
56,
1478554493
] |
def __init__(self, ads_uac_conn_id: str = 'google_ads_uac_default',
ads_uac_dry_run: bool = False, **kwargs) -> None:
"""Initializes the generator of a specified BigQuery table.
Args:
ads_uac_conn_id: Connection id passed to airflow.
ads_uac_dry_run: If true the hook will not send re... | google/TaglessCRM | [
16,
7,
16,
4,
1611719174
] |
def _validate_app_conversion_payload(self, payload: Dict[str, Any]) -> None:
"""Validates payload sent to UAC.
Args:
payload: The payload to be validated before sending to Google Ads UAC.
Raises:
DataOutConnectorValueError: If some value is missing or in wrong format.
"""
for key in _... | google/TaglessCRM | [
16,
7,
16,
4,
1611719174
] |
def test_upcoming_future(self):
event_future = generate_random_event(hours_ahead(1), hours_ahead(2))
self.assertTrue(event_future in Event.objects.upcoming()) | armstrong/armstrong.apps.events | [
5,
2,
5,
2,
1303427651
] |
def test_upcoming_happened_today(self):
""" don't run this at 12am! go to bed """
event_happened_today = generate_random_event(hours_ago(2),
hours_ago(1))
self.assertTrue(event_happened_today in Event.objects.upcoming())
self.assertTrue(event_happened_today in Event.objec... | armstrong/armstrong.apps.events | [
5,
2,
5,
2,
1303427651
] |
def test_upcoming_tmrw(self):
event_tmrw = generate_random_event(hours_ahead(24),
hours_ahead(25))
self.assertFalse(event_tmrw in Event.objects.upcoming(days=0))
self.assertTrue(event_tmrw in Event.objects.upcoming(days=1)) | armstrong/armstrong.apps.events | [
5,
2,
5,
2,
1303427651
] |
def test_upcoming_asc_order(self):
events = [generate_random_event(hours_ago(i), hours_ago(i + 1))
for i in random.sample(xrange(-48, 48), 10)]
upcoming = list(Event.objects.upcoming())
self.assertTrue(upcoming == sorted(upcoming,
key=lambda e: e.start_date)) | armstrong/armstrong.apps.events | [
5,
2,
5,
2,
1303427651
] |
def __init__(self, *args, **kwargs):
super(App, self).__init__(*args, **kwargs) | lagopus/lagopus | [
308,
101,
308,
61,
1406265039
] |
def switch_features_handler(self, ev):
datapath = ev.msg.datapath
[self.install_sample(datapath, n) for n in [0]] | lagopus/lagopus | [
308,
101,
308,
61,
1406265039
] |
def install_sample(self, datapath, table_id):
parser = datapath.ofproto_parser
ofproto = datapath.ofproto
req = parser.OFPQueueStatsRequest(datapath, 0, ofproto.OFPP_ANY,
ofproto.OFPQ_ALL)
datapath.send_msg(req) | lagopus/lagopus | [
308,
101,
308,
61,
1406265039
] |
def _EmptyFolderSize(self):
"""Returns the size of an empty folder.
This should match the current filesystem blocksize.
"""
size = int(subprocess.check_output(['stat', '-fc', '%s', '.']).strip())
return size | google/GiftStick | [
125,
24,
125,
13,
1540306194
] |
def testGenerateTarCopyCommand(self):
with tempfile.TemporaryDirectory() as path:
d = directory.DirectoryArtifact(path, method='tar', compress=False)
command = d._TAR_COMMAND
command.append(path)
self.assertEqual(d._GenerateCopyCommand(), command) | google/GiftStick | [
125,
24,
125,
13,
1540306194
] |
def model_creator(config):
model = tf.keras.models.Sequential([tf.keras.layers.Dense(config["hidden_size"],
input_shape=(1,)),
tf.keras.layers.Dense(1)])
model.compile(loss="mse",
optimizer=tf... | intel-analytics/analytics-zoo | [
2553,
722,
2553,
534,
1493951250
] |
def get_x_y(size):
x = np.random.rand(size)
y = x / 2
x = x.reshape((-1, 1))
y = y.reshape((-1, 1))
return x, y | intel-analytics/analytics-zoo | [
2553,
722,
2553,
534,
1493951250
] |
def create_linear_search_space():
from zoo.orca.automl import hp
return {
"hidden_size": hp.choice([5, 10]),
"lr": hp.choice([0.001, 0.003, 0.01]),
"batch_size": hp.choice([32, 64])
} | intel-analytics/analytics-zoo | [
2553,
722,
2553,
534,
1493951250
] |
def setUp(self) -> None:
from zoo.orca import init_orca_context
init_orca_context(cores=4, init_ray_on_spark=True) | intel-analytics/analytics-zoo | [
2553,
722,
2553,
534,
1493951250
] |
def test_fit(self):
auto_est = AutoEstimator.from_keras(model_creator=model_creator,
logs_dir="/tmp/zoo_automl_logs",
resources_per_trial={"cpu": 2},
name="test_fit")
data... | intel-analytics/analytics-zoo | [
2553,
722,
2553,
534,
1493951250
] |
def test_fit_metric_func(self):
auto_est = AutoEstimator.from_keras(model_creator=model_creator,
logs_dir="/tmp/zoo_automl_logs",
resources_per_trial={"cpu": 2},
name="test_fit")
... | intel-analytics/analytics-zoo | [
2553,
722,
2553,
534,
1493951250
] |
def run_impl(self, dataset: DataSet, args: argparse.Namespace) -> None:
create_submodels.run_dataset(dataset) | mapillary/OpenSfM | [
2824,
787,
2824,
167,
1415789249
] |
def __init__(self, filename):
super(BinMap, self).__init__(filename)
fp = open(filename)
for header, seq in read_block(fp, "group "):
lg = header.split()[-1]
self[lg] = []
for s in seq:
if s.strip() == "" or s[0] == ";":
co... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def __init__(self, row, startidx=3):
args = row.split()
self.id = args[0]
self.seqid, pos = self.id.split(".")
self.pos = int(pos)
self.genotype = "".join(args[startidx:]) | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def __str__(self):
return "{0}: {1}".format(self.id, self.genotype) | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def bedline(self):
return "\t".join(str(x) for x in (self.seqid, self.pos - 1, self.pos, self.id)) | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def __init__(self, filename):
super(MSTMap, self).__init__(filename)
fp = open(filename)
startidx = 1
for row in fp:
if row.startswith("locus_name"):
if row.split()[1] == "seqid":
startidx = 3
self.header = row.split()
... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def __init__(self, matrix, markerheader, population_type, missing_threshold):
self.matrix = matrix
self.markerheader = markerheader
self.population_type = population_type
self.missing_threshold = missing_threshold
self.ngenotypes = len(matrix)
self.nind = len(markerheader... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def main():
actions = (
("breakpoint", "find scaffold breakpoints using genetic map"),
("ld", "calculate pairwise linkage disequilibrium"),
("bed", "convert MSTmap output to bed format"),
("fasta", "extract markers based on map"),
("anchor", "anchor scaffolds based on map"),... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def dotplot(args):
"""
%prog dotplot map.csv ref.fasta
Make dotplot between chromosomes and linkage maps.
The input map is csv formatted, for example:
ScaffoldID,ScaffoldPosition,LinkageGroup,GeneticPosition
scaffold_2707,11508,1,0
scaffold_2707,11525,1,1.2
"""
from natsort import ... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def calc_ldscore(a, b):
assert len(a) == len(b), "{0}\n{1}".format(a, b)
# Assumes markers as A/B
c = Counter(zip(a, b))
c_aa = c[("A", "A")]
c_ab = c[("A", "B")]
c_ba = c[("B", "A")]
c_bb = c[("B", "B")]
n = c_aa + c_ab + c_ba + c_bb
if n == 0:
return 0
f = 1.0 / n
... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def header(args):
"""
%prog header map conversion_table
Rename lines in the map header. The mapping of old names to new names are
stored in two-column `conversion_table`.
"""
from jcvi.formats.base import DictFile
p = OptionParser(header.__doc__)
p.add_option("--prefix", default="", he... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def anchor(args):
"""
%prog anchor map.bed markers.blast > anchored.bed
Anchor scaffolds based on map.
"""
from jcvi.formats.blast import bed
p = OptionParser(anchor.__doc__)
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
mapbed, blastfile... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def fasta(args):
"""
%prog fasta map.out scaffolds.fasta
Extract marker sequences based on map.
"""
from jcvi.formats.sizes import Sizes
p = OptionParser(fasta.__doc__)
p.add_option(
"--extend",
default=1000,
type="int",
help="Extend seq flanking the gaps",
... | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def check_markers(a, b, maxdiff):
if a.seqid != b.seqid:
return END, None
diff = hamming_distance(a.genotype, b.genotype, ignore="-")
max_allowed = len(a) * maxdiff
if diff <= max_allowed:
return OK, None
return BREAK, (a.seqid, a.pos, b.pos) | tanghaibao/jcvi | [
570,
166,
570,
35,
1291245482
] |
def __init__(self, versions=None):
self._versions = versions | kylef/swiftenv-api | [
25,
9,
25,
10,
1464061407
] |
def versions(self):
if self._versions is None:
version_paths = Path('versions').glob('**/*.yaml')
version_files = map(str, version_paths)
versions = map(Version.fromfile, version_files)
versions = sorted(versions, key=lambda v: v.version)
self._version... | kylef/swiftenv-api | [
25,
9,
25,
10,
1464061407
] |
def filter(self, version=None, pre_release=None, snapshots=None, platform=None):
versions = self.versions
if version:
versions = [v for v in versions if v.version == version]
if pre_release is True:
versions = [v for v in versions if v.is_pre_release]
if pre_re... | kylef/swiftenv-api | [
25,
9,
25,
10,
1464061407
] |
def fromfile(cls, path):
version = os.path.splitext(os.path.basename(path))[0]
with open(path) as fp:
content = yaml.safe_load(fp.read())
binaries = {}
for (key, value) in content['binaries'].items():
# convert between old and new schema
... | kylef/swiftenv-api | [
25,
9,
25,
10,
1464061407
] |
def __str__(self):
return self.version | kylef/swiftenv-api | [
25,
9,
25,
10,
1464061407
] |
def is_pre_release(self):
return '-' in self.version | kylef/swiftenv-api | [
25,
9,
25,
10,
1464061407
] |
def is_snapshot(self):
return 'SNAPSHOT' in self.version | kylef/swiftenv-api | [
25,
9,
25,
10,
1464061407
] |
def path(self):
if self.version.startswith('DEVELOPMENT-SNAPSHOT-'):
version = self.version[len('DEVELOPMENT-SNAPSHOT-'):]
(year, month, rest) = version.split('-', 2)
return os.path.join('versions', 'DEVELOPMENT-SNAPSHOT', year, month, '{}.yaml'.format(rest))
if '-' ... | kylef/swiftenv-api | [
25,
9,
25,
10,
1464061407
] |
def have_access(self):
account = accounts.account()
if not account or not account.DRAIN_ACCESS_RIGHT:
return False
return True | spiffcode/hostile-takeover | [
168,
51,
168,
3,
1395611395
] |
def finish_post(self, selected, template_values):
drain_command = None
if self.request.get('drain'):
drain_command = 'drain'
if self.request.get('undrain'):
drain_command = 'undrain'
errors = []
if len(selected) == 0:
errors.append('Must selec... | spiffcode/hostile-takeover | [
168,
51,
168,
3,
1395611395
] |
def is_dst(zonename, date):
local_tz = pytz.timezone(zonename)
localized_time = local_tz.localize(date)
return localized_time.dst() != timedelta(0) | tidepool-org/dfaker | [
2,
5,
2,
2,
1432772585
] |
def convert_to_mmol(iterable):
conversion_factor = 18.01559
if isinstance(iterable, float) or isinstance(iterable, int):
return iterable / conversion_factor
return [reading / conversion_factor for reading in iterable] | tidepool-org/dfaker | [
2,
5,
2,
2,
1432772585
] |
def make_timesteps(start_time, offset, timelist):
""" Convert list of floats representing time into epoch time
start_time -- a timezone naive datetime object
offset -- offset in minutes
timelist -- a list of incrementing floats representing time increments
"""
timesteps = []
e... | tidepool-org/dfaker | [
2,
5,
2,
2,
1432772585
] |
def fullfact(levels):
"""
Create a general full-factorial design | tisimst/pyDOE | [
218,
111,
218,
26,
1377625323
] |
def ff2n(n):
"""
Create a 2-Level full-factorial design | tisimst/pyDOE | [
218,
111,
218,
26,
1377625323
] |
def fracfact(gen):
"""
Create a 2-level fractional-factorial design with a generator string. | tisimst/pyDOE | [
218,
111,
218,
26,
1377625323
] |
def __init__(self, db, collection_name, has_stats=False, **kwargs):
self.property_helper = None
self.log_helper = None
self.collection_name = collection_name
self.db = db
if 'logger' in kwargs:
self.log_helper = kwargs['logger']
if collection_name in self.db.c... | texttochange/vusion-backend | [
5,
1,
5,
2,
1329910064
] |
def close_connection(self):
pass | texttochange/vusion-backend | [
5,
1,
5,
2,
1329910064
] |
def save_document(self, document):
document.validate_fields()
return self.collection.save(document.get_as_dict()) | texttochange/vusion-backend | [
5,
1,
5,
2,
1329910064
] |
def set_property_helper(self, property_helper):
self.property_helper = property_helper | texttochange/vusion-backend | [
5,
1,
5,
2,
1329910064
] |
def __getattr__(self,attr):
orig_attr = self.collection.__getattribute__(attr)
if callable(orig_attr):
def hooked(*args, **kwargs):
result = orig_attr(*args, **kwargs)
# prevent wrapped_class from becoming unwrapped
if result == self.collection... | texttochange/vusion-backend | [
5,
1,
5,
2,
1329910064
] |
def log(self, msg, level='msg'):
if self.log_helper is not None:
self.log_helper.log(msg, level) | texttochange/vusion-backend | [
5,
1,
5,
2,
1329910064
] |
def bonferroni(p, n):
return np.minimum(1., p * n) | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def cluster_stats(zimg, mask, height_th, height_control='fpr',
cluster_th=0, nulls={}):
"""
Return a list of clusters, each cluster being represented by a
dictionary. Clusters are sorted by descending size order. Within
each cluster, local maxima are sorted by descending depth order.
... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def get_3d_peaks(image, mask=None, threshold=0., nn=18, order_th=0):
"""
returns all the peaks of image that are with the mask
and above the provided threshold
Parameters
----------
image, (3d) test image
mask=None, (3d) mask image
By default no masking is performed
threshold=0.... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def prepare_arrays(data_images, vardata_images, mask_images):
from .mask import intersect_masks
# Compute mask intersection
mask = intersect_masks(mask_images, threshold=1.)
# Compute xyz coordinates from mask
xyz = np.array(np.where(mask > 0))
# Prepare data & vardata arrays
data = np.arra... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def twosample_test(data_images, vardata_images, mask_images, labels, stat_id,
permutations=0, cluster_forming_th=0.01):
"""
Helper function for permutation-based mass univariate twosample group
analysis. Labels is a binary vector (1-2). Regions more active for group
1 than group 2 are... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def linear_model_fit(data_images, mask_images, design_matrix, vector):
"""
Helper function for group data analysis using arbitrary design matrix
"""
# Prepare arrays
data, vardata, xyz, mask = prepare_arrays(data_images, None, mask_images)
# Create glm instance
G = glm(data, design_matrix)... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def __init__(self, data, design_matrix, mask=None, formula=None,
model=def_model, method=None, niter=def_niter):
# Convert input data and design into sequences
if not hasattr(data, '__iter__'):
data = [data]
if not hasattr(design_matrix, '__iter__'):
des... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def contrast(self, vector):
"""Compute images of contrast and contrast variance.
"""
# Compute the overall contrast across models
c = self.glm[0].contrast(vector)
for g in self.glm[1:]:
c += g.contrast(vector)
def affect_inmask(dest, src, xyz):
if... | alexis-roche/nipy | [
1,
1,
1,
1,
1272833701
] |
def extractItsjustadreamwebWordpressCom(item):
'''
Parser for 'itsjustadreamweb.wordpress.com'
'''
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(i... | fake-name/ReadableWebProxy | [
191,
16,
191,
3,
1437712243
] |
def test_pvconst_npts_setter():
"""Test pvconst property and setter methods"""
pvconst = pvconstants.PVconstants()
assert pvconst.npts == pvconstants.NPTS
assert len(pvconst.pts) == pvconst.npts
assert pvconst.pts[0] == 0
assert pvconst.pts[-1] == 1
assert len(pvconst.negpts) == pvconst.npts... | SunPower/PVMismatch | [
56,
26,
56,
48,
1358900803
] |
def emit(self, event_name, **kwargs):
payload = self._format_outbound_data(event_name, **kwargs)
self.sendMessage(payload) | CptLemming/django-socket-server | [
7,
8,
7,
2,
1416363509
] |
def onMessage(self, payload, isBinary):
self.factory.handle_message(self, payload) | CptLemming/django-socket-server | [
7,
8,
7,
2,
1416363509
] |
def __init__(self, *args, **kwargs):
WebSocketClientFactory.__init__(self, *args, **kwargs)
self.callbacks = {}
self.register_callbacks() | CptLemming/django-socket-server | [
7,
8,
7,
2,
1416363509
] |
def on(self, event_name, callback):
self.callbacks[event_name] = callback | CptLemming/django-socket-server | [
7,
8,
7,
2,
1416363509
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.