function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def sample_add_context_children():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.AddContextChildrenRequest(
context="context_value",
)
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_query_context_lineage_subgraph():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.QueryContextLineageSubgraphRequest(
context="context_value",
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_create_execution():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.CreateExecutionRequest(
parent="parent_value",
)
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_get_execution():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.GetExecutionRequest(
name="name_value",
)
# Make the... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_list_executions():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListExecutionsRequest(
parent="parent_value",
)
# ... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_update_execution():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.UpdateExecutionRequest(
)
# Make the request
response... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_delete_execution():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.DeleteExecutionRequest(
name="name_value",
)
# Ma... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_purge_executions():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.PurgeExecutionsRequest(
parent="parent_value",
filter="filter_... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_add_execution_events():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.AddExecutionEventsRequest(
execution="execution_value",
)
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_query_execution_inputs_and_outputs():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.QueryExecutionInputsAndOutputsRequest(
execution="execution_valu... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_create_metadata_schema():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
metadata_schema = aiplatform_v1.MetadataSchema()
metadata_schema.schema = "schema_value"
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_get_metadata_schema():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.GetMetadataSchemaRequest(
name="name_value",
)
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_list_metadata_schemas():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListMetadataSchemasRequest(
parent="parent_value",
)
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_query_artifact_lineage_subgraph():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.QueryArtifactLineageSubgraphRequest(
artifact="artifact_value",
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def escape_name(name: str) -> str:
return name.lower().replace(' ', '_') | lowRISC/opentitan | [
1741,
534,
1741,
1020,
1566837016
] |
def _get_awparam_name(iface_name: Optional[str]) -> str:
return (iface_name or 'Iface').capitalize() + 'Aw' | lowRISC/opentitan | [
1741,
534,
1741,
1020,
1566837016
] |
def get_type_name_pfx(block: IpBlock, iface_name: Optional[str]) -> str:
return block.name.lower() + ('' if iface_name is None
else '_{}'.format(iface_name.lower())) | lowRISC/opentitan | [
1741,
534,
1741,
1020,
1566837016
] |
def get_iface_tx_type(block: IpBlock,
iface_name: Optional[str],
hw2reg: bool) -> str:
x2x = 'hw2reg' if hw2reg else 'reg2hw'
pfx = get_type_name_pfx(block, iface_name)
return '_'.join([pfx, x2x, 't']) | lowRISC/opentitan | [
1741,
534,
1741,
1020,
1566837016
] |
def gen_rtl(block: IpBlock, outdir: str) -> int:
# Read Register templates
reg_top_tpl = Template(
filename=resource_filename('reggen', 'reg_top.sv.tpl'))
reg_pkg_tpl = Template(
filename=resource_filename('reggen', 'reg_pkg.sv.tpl'))
# Generate <block>_reg_pkg.sv
#
# This defin... | lowRISC/opentitan | [
1741,
534,
1741,
1020,
1566837016
] |
def __init__(self, json):
if json is not None:
if 'enabled' in json.keys():
self.enabled = json['enabled']
else:
self.enabled = None
if 'primaryKey' in json.keys():
self.primary_key = json['primaryKey']
else:
self.primary_key = None
if 'secondaryKey' in ... | XiaoMi/galaxy-fds-sdk-python | [
49,
22,
49,
2,
1416560004
] |
def enabled(self):
return self['enabled'] | XiaoMi/galaxy-fds-sdk-python | [
49,
22,
49,
2,
1416560004
] |
def enabled(self, enabled):
self['enabled'] = enabled | XiaoMi/galaxy-fds-sdk-python | [
49,
22,
49,
2,
1416560004
] |
def primary_key(self):
return self['primaryKey'] | XiaoMi/galaxy-fds-sdk-python | [
49,
22,
49,
2,
1416560004
] |
def primary_key(self, primary_key):
self['primaryKey'] = primary_key | XiaoMi/galaxy-fds-sdk-python | [
49,
22,
49,
2,
1416560004
] |
def secondary_key(self):
return self['secondaryKey'] | XiaoMi/galaxy-fds-sdk-python | [
49,
22,
49,
2,
1416560004
] |
def get_dataset(
dataset: str,
global_batch_size: int,
rng: np.ndarray,
train_preprocessing_fn: Optional[Callable[[Any], Any]] = None,
eval_preprocessing_fn: Optional[Callable[[Any], Any]] = None,
num_epochs: Optional[int] = None,
filter_fn: Optional[Callable[[Any], Any]] = None,
**kwarg... | google-research/google-research | [
27788,
6881,
27788,
944,
1538678568
] |
def _image_preprocess_fn(features):
if "image" in features:
features["image"] = tf.cast(features["image"], tf.float32) / 255.0
if "id" in features: # Included in some TFDS datasets, breaks JAX.
del features["id"]
return features | google-research/google-research | [
27788,
6881,
27788,
944,
1538678568
] |
def _get_birds200_dataset(
mode: str,
rng: np.ndarray) -> Tuple[tf.data.Dataset, tf.data.Dataset, int]:
"""Load the caltech_birds2011 dataset."""
assert jax.host_count() == 1, (
"caltech_birds2011 dataset does not support multihost training. "
"Found {} hosts.".format(jax.host_count()))
datas... | google-research/google-research | [
27788,
6881,
27788,
944,
1538678568
] |
def _prepare_dataset(
dataset: tf.data.Dataset,
global_batch_size: int,
shuffle: bool,
rng: np.ndarray,
preprocess_fn: Optional[Callable[[Any], Any]] = None,
num_epochs: Optional[int] = None,
filter_fn: Optional[Callable[[Any], Any]] = None) -> tf.data.Dataset:
"""Batches, shuffles, prefet... | google-research/google-research | [
27788,
6881,
27788,
944,
1538678568
] |
def test_forwarding_rules_scanner_all_match(self):
rules_local_path = get_datafile_path(__file__,
'forward_rule_test_1.yaml')
scanner = forwarding_rule_scanner.ForwardingRuleScanner(
{}, {}, mock.MagicMock(), '', '', rules_local_path)
project_id = "abc-123"
gcp_... | forseti-security/forseti-security | [
1276,
291,
1276,
17,
1487268086
] |
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
self.message = str(self) | jimgoo/zipline-fork | [
1,
3,
1,
2,
1449499397
] |
def __init__(self, root):
if isdir(root):
self.root = abspath(root)
else:
raise ValueError("Invalid root directory '%s'" % root)
self.nodeCache = {}
self.nodeCachingBehavior = DEFAULT_NODE_CACHING_BEHAVIOR | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def createTree(cls, root, **props):
"""Create and returns a new Ceres tree with the given properties
:param root: The root directory of the new Ceres tree
:param \*\*props: Arbitrary key-value properties to store as tree metadata
:returns: :class:`CeresTree`
"""
ceresDir = join(root, '.ceres-... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def getFilesystemPath(self, nodePath):
"""Get the on-disk path of a Ceres node given a metric name
:param nodePath: A metric name e.g. ``carbon.agents.graphite-a.cpuUsage``
:returns: The Ceres node path on disk"""
return join(self.root, nodePath.replace('.', os.sep)) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def hasNode(self, nodePath):
"""Returns whether the Ceres tree contains the given metric
:param nodePath: A metric name e.g. ``carbon.agents.graphite-a.cpuUsage``
:returns: `True` or `False`"""
return isdir(self.getFilesystemPath(nodePath)) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def getNode(self, nodePath):
"""Returns a Ceres node given a metric name. Because nodes are looked up in
every read and write, a caching mechanism is provided. Cache behavior is set
using :func:`setNodeCachingBehavior` and defaults to the value set in
``DEFAULT_NODE_CACHING_BEHAVIOR``
The following... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def createNode(self, nodePath, **properties):
"""Creates a new metric given a new metric name and optional per-node metadata
:param nodePath: The new metric name.
:param \*\*properties: Arbitrary key-value properties to store as metric metadata.
:returns: :class:`CeresNode`
"""
return Cer... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def fetch(self, nodePath, fromTime, untilTime):
"""Fetch data within a given interval from the given metric
:param nodePath: The metric name to fetch from
:param fromTime: Requested interval start time in unix-epoch.
:param untilTime: Requested interval end time in unix-epoch.
:returns: :c... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def __init__(self, tree, nodePath, fsPath):
self.tree = tree
self.nodePath = nodePath
self.fsPath = fsPath
self.metadataFile = join(fsPath, '.ceres-node')
self.timeStep = None
self.aggregationMethod = 'average'
self.sliceCache = None
self.sliceCachingBehavior = DEFAULT_SLICE_CACHING_BEHA... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def create(cls, tree, nodePath, **properties):
"""Create a new :class:`CeresNode` on disk with the specified properties.
:param tree: The :class:`CeresTree` this node is associated with
:param nodePath: The name of the metric this node represents
:param \*\*properties: A set of key-value properties to ... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def isNodeDir(path):
"""Tests whether the given path is a :class:`CeresNode`
:param path: Path to test
:returns `True` or `False`
"""
return isdir(path) and exists(join(path, '.ceres-node')) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def fromFilesystemPath(cls, fsPath):
"""Instantiate a :class:`CeresNode` from the on-disk path of an existing node
:params fsPath: The filesystem path of an existing node
:returns: :class:`CeresNode`
"""
dirPath = dirname(fsPath)
while True:
ceresDir = join(dirPath, '.ceres-tree')
... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def slice_info(self):
"""A property providing a list of current information about each slice
:returns: ``[(startTime, endTime, timeStep), ...]``
"""
return [(slice.startTime, slice.endTime, slice.timeStep) for slice in self.slices] | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def writeMetadata(self, metadata):
"""Writes new metadata to disk
:param metadata: a JSON-serializable dict of node metadata
"""
self.timeStep = int(metadata['timeStep'])
with open(self.metadataFile, 'w') as fh:
json.dump(metadata, fh) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def slices(self):
"""A property providing access to information about this node's underlying slices. Because this | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def readSlices(self):
"""Read slice information from disk
:returns: ``[(startTime, timeStep), ...]``
"""
if not exists(self.fsPath):
raise NodeDeleted()
slice_info = []
for filename in os.listdir(self.fsPath):
if filename.endswith('.slice'):
startTime, timeStep = filename[:... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def clearSliceCache(self):
"""Clear slice cache, forcing a refresh from disk at the next access"""
self.sliceCache = None | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def read(self, fromTime, untilTime):
"""Read data from underlying slices and return as a single time-series
:param fromTime: Beginning of interval in unix epoch seconds
:param untilTime: End of interval in unix epoch seconds
:returns: :class:`TimeSeriesData`
"""
if self.timeStep is None:
... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def compact(self, datapoints):
"""Compacts datapoints into a list of contiguous, sorted lists of points with duplicate | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def __init__(self, node, startTime, timeStep):
self.node = node
self.startTime = startTime
self.timeStep = timeStep
self.fsPath = join(node.fsPath, '%d@%d.slice' % (startTime, timeStep)) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def isEmpty(self):
return getsize(self.fsPath) == 0 | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def endTime(self):
return self.startTime + ((getsize(self.fsPath) // DATAPOINT_SIZE) * self.timeStep) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def mtime(self):
return getmtime(self.fsPath) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def create(cls, node, startTime, timeStep):
slice = cls(node, startTime, timeStep)
fileHandle = open(slice.fsPath, 'wb')
fileHandle.close()
os.chmod(slice.fsPath, SLICE_PERMS)
return slice | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def write(self, sequence):
beginningTime = sequence[0][0]
timeOffset = beginningTime - self.startTime
pointOffset = timeOffset // self.timeStep
byteOffset = pointOffset * DATAPOINT_SIZE
values = [v for t, v in sequence]
format = '!' + ('d' * len(values))
packedValues = struct.pack(format, *... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def __lt__(self, other):
return self.startTime < other.startTime | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def __init__(self, startTime, endTime, timeStep, values):
self.startTime = startTime
self.endTime = endTime
self.timeStep = timeStep
self.values = values | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def timestamps(self):
return range(self.startTime, self.endTime, self.timeStep) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def __len__(self):
return len(self.values) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def __init__(self, node, problem):
Exception.__init__(self, problem)
self.node = node
self.problem = problem | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def aggregate(aggregationMethod, values):
# Filter out None values
knownValues = list(filter(lambda x: x is not None, values))
if len(knownValues) is 0:
return None
# Aggregate based on method
if aggregationMethod == 'average':
return float(sum(knownValues)) / float(len(knownValues))
elif aggregatio... | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def getTree(path):
while path not in (os.sep, ''):
if isdir(join(path, '.ceres-tree')):
return CeresTree(path)
path = dirname(path) | graphite-project/ceres | [
354,
78,
354,
12,
1336452383
] |
def tags(config, args):
"""
List all tags.
"""
return config.repo.tags() | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def _delete_ref(repo, ref_name, force, dry_run):
ref = repo.ref(ref_name)
if not ref and not force:
raise ValueError("Reference not found: %s" % ref_name)
if not dry_run:
ref.delete()
return lib.status("Deleted %s" % ref_name, dry_run=dry_run) | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def branches_full(config, args):
"""
List full info about all branches.
"""
for b in config.repo.branches():
yield config.repo.branch(b.name) | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def delete_branches(config, args):
"""
Delete branches supplied on stdin.
"""
for ref_name in lib.input_json_lines():
yield _delete_ref(config.repo, "heads/" + ref_name, args.force, args.dry_run) | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def show_refs(config, args):
"""
Show refs supplied on stdin.
"""
for item in lib.input_json_lines():
yield config.repo.ref(item) | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def pull_requests(config, args):
"""
List all PRs.
"""
return config.repo.pull_requests(state=args.get("state", "open")) | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def contributor_stats(config, args):
"""
List contributor statistics.
"""
return config.repo.contributor_statistics() | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def releases(config, args):
"""
List all releases.
"""
return config.repo.releases() | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def create_release(config, args):
"""
Create a new release.
"""
yield config.repo.create_release(args.tag_name, name=args.name,
target_commitish=args.get("target_commitish"), body=args.get("body"),
draft=args.get_bool("draft"), prerelease=arg... | jlevy/ghizmo | [
80,
12,
80,
1,
1441065153
] |
def parse_json(http_response, response):
"""If the body is not empty, convert it to a python object and set as the value of
response.body. http_response is always closed if no error occurs.
:param http_response: the http_response object returned by HTTPConnection.getresponse()
:type http_response: http... | baidubce/bce-sdk-python | [
21,
10,
21,
4,
1429591184
] |
def GetSimLimits():
servo_limits = [_CONFIG['sim']['servos_sim'][i]['servo_drive']
for i in range(len(_SERVOS))]
return {_SERVOS[i]: (servo_limits[i]['ref_model_min_position_limit'],
servo_limits[i]['ref_model_max_position_limit'])
for i in range(len(_SERVOS))} | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def _GetControlOutputLimits(output, lower_limit='lower_flap_limits',
upper_limit='upper_flap_limits'):
return {_FLAPS[i]: (output[lower_limit][i], output[upper_limit][i])
for i in range(len(_FLAPS))} | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def GetControlCrosswindFlareLimits():
return _GetControlOutputLimits(_CONFIG['control']['crosswind']['output'],
lower_limit='lower_flap_limits_flare') | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def GetControlHoverLimits():
return _GetControlOutputLimits(_CONFIG['control']['hover']['output']) | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def GetAvionicsServoLimits():
"""Get the avionics servo mechanical limits for the current system."""
sys_conf = system_config.SystemConfig.GetSystemConfigBySerial(
_CONFIG['system']['wing_serial'])
config_file = os.path.join(makani.HOME,
'avionics/servo/firmware/config_params.ya... | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def _RudderFlapToServo(flap_angle):
servo_config = _CONFIG['system']['servos'][system_types.kServoR1]
return math.asin(flap_angle / servo_config['nonlinear_servo_to_flap_ratio']) | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def ServosToFlaps(servos):
"""Convert servo limits to flap limits."""
flaps = {}
for servo, servo_range in servos.iteritems():
if servo.startswith('A'):
flaps[servo] = servo_range
flaps['Elevator'] = (0.5 * (servos['E1'][0] + servos['E2'][0]),
0.5 * (servos['E1'][1] + servos['E2... | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def _PrintServos(name, limits, print_header):
if print_header:
print ('%15s A1 A2 A4 A5 A7 A8'
' E1 E2 R1 R2' % '')
print ('%15s min:' + ' %5.1f' * 10) % (
(name,) + tuple([math.degrees(limits[_SERVOS[i]][0])
for i in range(len(_SERVOS))... | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def GetServoLimits():
return [(l.name, FlapsToServos(l.limits) if l.is_flap_limit else l.limits)
for l in _LIMITS] | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def Main():
print '\nFlap limits:'
print_header = True
for name, flaps in GetFlapLimits():
_PrintFlaps(name, flaps, print_header)
print_header = False
print '\nServo limits:'
print_header = True
for name, servos in GetServoLimits():
_PrintServos(name, servos, print_header)
print_header = Fal... | google/makani | [
1163,
104,
1163,
5,
1589825605
] |
def main(self):
if not self.nested_command:
try:
self.setup()
# Give some time for the topology to start.
time.sleep(10)
self._run()
finally:
self.teardown() | netsec-ethz/scion | [
22,
27,
22,
14,
1512059421
] |
def _renewal_request(
self,
isd_as: scion_addr.ISD_AS,
mode: str = "--force", | netsec-ethz/scion | [
22,
27,
22,
14,
1512059421
] |
def read_file(filename: str) -> str:
with open(as_dir / "crypto/as" / filename) as f:
return f.read() | netsec-ethz/scion | [
22,
27,
22,
14,
1512059421
] |
def _check_key_cert(self, cs_configs: List[pathlib.Path]):
not_ready = [*cs_configs]
for _ in range(5):
logger.info(
"Checking if all control servers have reloaded the key and certificate..."
)
for cs_config in not_ready:
conn = client... | netsec-ethz/scion | [
22,
27,
22,
14,
1512059421
] |
def _extract_skid(self, file: pathlib.Path):
out = subprocess.check_output(
['openssl', 'x509', '-in', file, '-noout', '-text'])
lines = out.splitlines()
for i, v in enumerate(lines):
if v.decode("utf-8").find("Subject Key Identifier") > -1:
skid = lines[i... | netsec-ethz/scion | [
22,
27,
22,
14,
1512059421
] |
def _to_as_dir(self, isd_as: scion_addr.ISD_AS) -> pathlib.Path:
return pathlib.Path("%s/gen/AS%s" %
(self.test_state.artifacts, isd_as.as_file_fmt())) | netsec-ethz/scion | [
22,
27,
22,
14,
1512059421
] |
def _local_flags(self, isd_as: scion_addr.ISD_AS) -> List[str]:
return [
"--local",
self.execute("tester_%s" % isd_as.file_fmt(), "sh", "-c",
"echo $SCION_LOCAL_ADDR").strip(),
] | netsec-ethz/scion | [
22,
27,
22,
14,
1512059421
] |
def __init__(
self,
*,
host: str = "dialogflow.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
scopes: Sequence[str] = None,
channel: grpc.Channel = None,
api_mtls_endpoint: str = None,
client_cert_sou... | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def create_channel(
cls,
host: str = "dialogflow.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
**kwargs, | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def grpc_channel(self) -> grpc.Channel:
"""Return the channel designed to connect to this service.
"""
return self._grpc_channel | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def list_session_entity_types(
self, | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def get_session_entity_type(
self, | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def create_session_entity_type(
self, | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def update_session_entity_type(
self, | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def delete_session_entity_type(
self, | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def close(self):
self.grpc_channel.close() | googleapis/python-dialogflow | [
387,
145,
387,
4,
1508880371
] |
def __init__(self, s3_image_root, http_image_root):
self.s3_image_root = s3_image_root
self.http_image_root = http_image_root | airbnb/knowledge-repo | [
5286,
711,
5286,
126,
1471476770
] |
def skip_image(self, kp, image):
import re
if re.match('http[s]?://', image['src']):
return True
return False | airbnb/knowledge-repo | [
5286,
711,
5286,
126,
1471476770
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.