function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def get_script(self):
return self.script.strip() | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def set_service(self, service):
self.service = service | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def set_version(self, version):
self.version = version | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def set_script(self, script):
self.script = script | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def parse(fd):
"""
Parse the data according to several regexes | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def parse_xml(xml_file):
"""
Parse the XML file | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def is_format_valid(fmt):
"""
Check for the supplied custom output format
@param fmt : the supplied format | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def formatted_item(host, format_item):
"""
return the attribute value related to the host | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def repeat_attributes(attribute_list):
"""
repeat attribute lists to the maximum for the | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def generate_csv(fd, results, options):
"""
Generate a plain ';' separated csv file with the desired or default attribute format
@param fd : output file descriptor, could be a true file or stdout
"""
if results:
spamwriter = csv.writer(fd, delimiter=options.delimiter, quoting=csv.QU... | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def main():
global parser | maaaaz/nmaptocsv | [
350,
93,
350,
5,
1348413900
] |
def play_example(cls, dur=5, toprint=True, double=False):
"""
Execute the documentation example of the object given as an argument.
:Args:
cls: PyoObject class or string
Class reference of the desired object example. If this argument
is the string of the full path of an exa... | belangeo/pyo | [
1154,
119,
1154,
25,
1440516200
] |
def find_median(arr):
# O(n)
heapq.heapify(arr)
num_elements = len(arr)
if num_elements % 2 != 0:
return arr[(num_elements + 1)/2 - 1]
else:
return (arr[num_elements/2 - 1] + arr[num_elements/2 + 1 - 1])/2.0 | amitsaha/learning | [
4,
4,
4,
20,
1413605035
] |
def __init__(self, errors):
self.errors = errors
Exception.__init__(self, errors) | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def __init__(self):
self.messages = [] | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def __init__(self):
self._destinations = [BufferingDestination()]
self._any_added = False
self._globalFields = {} | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def send(self, message):
"""
Deliver a message to all destinations.
The passed in message might be mutated.
@param message: A message dictionary that can be serialized to JSON.
@type message: L{dict}
"""
message.update(self._globalFields)
errors = []
... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def remove(self, destination):
"""
Remove an existing destination.
@param destination: A destination previously added with C{self.add}.
@raises ValueError: If the destination is unknown.
"""
self._destinations.remove(destination) | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def write(dictionary, serializer=None):
"""
Write a dictionary to the appropriate destination.
@note: This method is thread-safe.
@param serializer: Either C{None}, or a
L{eliot._validation._MessageSerializer} which can be used to
validate this message.
... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def _safeUnicodeDictionary(self, dictionary):
"""
Serialize a dictionary to a unicode string no matter what it contains.
The resulting dictionary will loosely follow Python syntax but it is
not expected to actually be a lossless encoding in all cases.
@param dictionary: A L{dic... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def exclusively(f):
"""
Decorate a function to make it thread-safe by serializing invocations
using a per-instance lock.
"""
@wraps(f)
def exclusively_f(self, *a, **kw):
with self._lock:
return f(self, *a, **kw)
return exclusively_f | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def __init__(self, encoder=EliotJSONEncoder):
"""
@param encoder: A JSONEncoder subclass to use when encoding JSON.
"""
self._lock = Lock()
self._encoder = encoder
self.reset() | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def flushTracebacks(self, exceptionType):
"""
Flush all logged tracebacks whose exception is of the given type.
This means they are expected tracebacks and should not cause the test
to fail.
@param exceptionType: A subclass of L{Exception}.
@return: C{list} of flushed ... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def write(self, dictionary, serializer=None):
"""
Add the dictionary to list of messages.
"""
# Validate copy of the dictionary, to ensure what we store isn't
# mutated.
try:
self._validate_message(dictionary.copy(), serializer)
except Exception as e:
... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def validate(self):
"""
Validate all written messages.
Does minimal validation of types, and for messages with corresponding
serializers use those to do additional validation.
As a side-effect, the messages are replaced with their serialized
contents.
@raises T... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def serialize(self):
"""
Serialize all written messages.
This is the Field-based serialization, not JSON.
@return: A C{list} of C{dict}, the serialized messages.
"""
result = []
for dictionary, serializer in zip(self.messages, self.serializers):
dict... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def reset(self):
"""
Clear all logged messages.
Any logged tracebacks will also be cleared, and will therefore not
cause a test failure.
This is useful to ensure a logger is in a known state before testing
logging of a specific code path.
"""
self.messag... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def __new__(cls, file, encoder=EliotJSONEncoder):
if isinstance(file, IOBase) and not file.writable():
raise RuntimeError("Given file {} is not writeable.")
unicodeFile = False
try:
file.write(b"")
except TypeError:
unicodeFile = True
if unic... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def to_file(output_file, encoder=EliotJSONEncoder):
"""
Add a destination that writes a JSON message per line to the given file.
@param output_file: A file-like object.
@param encoder: A JSONEncoder subclass to use when encoding JSON.
"""
Logger._destinations.add(FileDestination(file=output_fi... | ScatterHQ/eliot | [
1026,
64,
1026,
113,
1397056339
] |
def __init__(self):
self.con = mysql.connector.connect(**config) | aitoralmeida/eu-elections | [
4,
1,
4,
2,
1396527867
] |
def insert_users(self,tweet):
#id TEXT, screen_name TEXT, total_tweets INT
keys = [tweet['user']['id'], tweet['user']['screen_name'],1]
try:
cursor = self.con.cursor()
select = "SELECT id, total_tweets from twitter_users where id="+str(keys[0])
cursor.execute(... | aitoralmeida/eu-elections | [
4,
1,
4,
2,
1396527867
] |
def insert_mention(self,tweet):
#user_id INT, target_id INT, day DATE, weight INT
replies = tweet['in_reply_to_user_id']
replies_screen_name = tweet['in_reply_to_screen_name']
date= time.strftime('%Y-%m-%d', time.strptime(tweet['created_at'],'%a %b %d %H:%M:%S +0000 %Y'))
if rep... | aitoralmeida/eu-elections | [
4,
1,
4,
2,
1396527867
] |
def insert_language_candidate(self,tweet):
#lang TEXT, candidate_id INT, total INT
keys = [tweet['lang'], 44101578, 1]
try:
cursor = self.con.cursor()
cursor.execute("SELECT total from language_candidate WHERE ( lang='"+tweet['lang']+"' AND candidate_id ='"+str(44... | aitoralmeida/eu-elections | [
4,
1,
4,
2,
1396527867
] |
def insert_hash_group(self,tweet):
#text TEXT, group_id TEXT, day DATE, total INT
hashtags = tweet['entities']['hashtags']
date= time.strftime('%Y-%m-%d', time.strptime(tweet['created_at'],'%a %b %d %H:%M:%S +0000 %Y'))
for h in hashtags:
hashtag = h['text']
try:... | aitoralmeida/eu-elections | [
4,
1,
4,
2,
1396527867
] |
def capitalizeFirst(word):
""" Capitalizes the first letter of a string. """
return word[0].upper() + word[1:] | datacommonsorg/tools | [
5,
20,
5,
34,
1590014482
] |
def _create_naics_map():
""" Downloads all NAICS codes across long and short form codes. """
# Read in list of industry topics.
naics_codes = pd.read_excel(
"https://www.census.gov/eos/www/naics/2017NAICS/2-6%20digit_2017_Codes.xlsx"
)
naics_codes = naics_codes.iloc[:, [1, 2]]
naics_code... | datacommonsorg/tools | [
5,
20,
5,
34,
1590014482
] |
def test_push_file(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/push_file'),
)
dest_path = '/path/to/file.txt'
data = base64.b64encode(bytes('HelloWorld', 'utf-8')).decode('u... | appium/python-client | [
1415,
523,
1415,
30,
1396890095
] |
def test_push_file_invalid_arg_exception_without_src_path_and_base64data(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/push_file'),
)
dest_path = '/path/to/file.txt'
with pyt... | appium/python-client | [
1415,
523,
1415,
30,
1396890095
] |
def test_push_file_invalid_arg_exception_with_src_file_not_found(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/push_file'),
)
dest_path = '/dest_path/to/file.txt'
src_path = '... | appium/python-client | [
1415,
523,
1415,
30,
1396890095
] |
def test_pull_file(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/pull_file'),
body='{"value": "SGVsbG9Xb3JsZA=="}',
)
dest_path = '/path/to/file.txt'
assert drive... | appium/python-client | [
1415,
523,
1415,
30,
1396890095
] |
def rescore_all(workdir, nbestdir, config):
for tsk in ['nbestlist_{}_{}'.format(a, b) for a in ['dt05', 'et05'] for b in ['real', 'simu']]:
print('process ' + tsk)
nbest_txt = nbestdir + tsk + '/words_text'
outdir = workdir + nbestdir.split('/')[-2] + '/' + tsk + '/'
wb.mkdir(outdir... | wbengine/SPMILM | [
18,
10,
18,
1,
1470972882
] |
def __init__(self, host_dir, conf, image='bgperf/quagga'):
super(Quagga, self).__init__(self.CONTAINER_NAME, image, host_dir, self.GUEST_DIR, conf) | osrg/bgperf | [
76,
30,
76,
5,
1450693323
] |
def build_image(cls, force=False, tag='bgperf/quagga', checkout='HEAD', nocache=False):
cls.dockerfile = ''' | osrg/bgperf | [
76,
30,
76,
5,
1450693323
] |
def write_config(self, scenario_global_conf):
config = """hostname bgpd | osrg/bgperf | [
76,
30,
76,
5,
1450693323
] |
def gen_neighbor_config(n):
local_addr = n['local-address']
c = """neighbor {0} remote-as {1} | osrg/bgperf | [
76,
30,
76,
5,
1450693323
] |
def _BuildConfig(self, additional_config_str=''):
"""Builds a metrics config."""
config = motion_metrics_pb2.MotionMetricsConfig()
config_text = """
track_steps_per_second: 10
prediction_steps_per_second: 10
track_history_samples: 0
track_future_samples: 4
step_configurations {
mea... | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def setUp(self):
super(MotionMetricsOpsTest, self).setUp()
self._config = self._BuildConfig()
self._gt = self._CreateTestScenario() | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def testComputeMissRateNoMisses(self):
pred_score = np.reshape([0.5], (1, 1, 1))
pred_trajectory = np.reshape([[[4, 4], [6, 6], [8, 8], [10, 10]],
[[-2, 0], [-3, 0], [-4, 0], [-5, 0]]],
(1, 1, 1, 2, 4, 2))
val = self._RunEval(pred_score, pr... | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def testComputeMissRateLateral_2(self):
pred_score = np.reshape([0.5], (1, 1, 1))
pred_trajectory = np.reshape(
[[[4, 4], [6, 6], [8, 8], [10, 10]],
[[-2, 1.01], [-3, 1.01], [-4, 1.01], [-5, 1.01]]], (1, 1, 1, 2, 4, 2))
val = self._RunEval(pred_score, pred_trajectory)
# miss_rate of Veh... | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def testComputeMissRateLongitudinal_2(self):
pred_score = np.reshape([0.5], (1, 1, 1))
pred_trajectory = np.reshape([[[4, 4], [6, 6], [8, 8], [10, 10]],
[[-2, 0], [-3, 0], [-4, 0], [-7.01, 0]]],
(1, 1, 1, 2, 4, 2))
val = self._RunEval(pred_s... | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def testComputeNoMissLongitudinal_1(self):
pred_score = np.reshape([0.5], (1, 1, 1))
pred_trajectory = np.reshape([[[4, 4], [6, 6], [8, 8], [11.414, 11.414]],
[[-2, 0], [-3, 0], [-4, 0], [-5, 0]]],
(1, 1, 1, 2, 4, 2))
val = self._RunEval(pre... | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def testComputeVelocityScalingLongitudinal(self):
pred_score = np.reshape([0.5], (1, 1, 1))
pred_trajectory = np.reshape([[[4, 4], [6, 6], [8, 8], [10, 10]],
[[-2, 0], [-3, 0], [-4, 0], [-6.5, 0]]],
(1, 1, 1, 2, 4, 2))
config = motion_metri... | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def testTwoJointPredictionsNoMiss(self):
pred_score = np.reshape([0.8, 0.5], (1, 1, 2))
pred_trajectory = np.reshape([[[[4, 4], [6, 6], [8, 8], [10, 10]],
[[-2, 0], [-3, 0], [-4, 0], [-7.01, 0]]],
[[[4, 4], [6, 6], [8, 8], [10, 10]],
... | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def testComputeMinADE(self):
pred_score = np.reshape([0.5, 0.5], (1, 1, 2))
pred_trajectory = np.reshape(
[[[[4, 0], [6, 0], [8, 0], [10, 0]], [[0, 2], [0, 3], [0, 4], [0, 5]]],
[[[14, 0], [16, 0], [18, 0], [20, 0]],
[[0, 22], [0, 23], [0, 24], [0, 25]]]], (1, 1, 2, 2, 4, 2))
val ... | waymo-research/waymo-open-dataset | [
2097,
494,
2097,
229,
1560442662
] |
def get_admin_user():
return {
'username': 'admin',
'password': 'admin',
'role': ADMIN_ROLE
} | cloudify-cosmo/cloudify-manager | [
135,
77,
135,
11,
1396350407
] |
def get_test_users():
test_users = [
{
'username': 'alice',
'password': 'alice_password',
'role': ADMIN_ROLE
},
{
'username': 'bob',
'password': 'bob_password',
'role': USER_ROLE
},
{
'usernam... | cloudify-cosmo/cloudify-manager | [
135,
77,
135,
11,
1396350407
] |
def test_reference_to_providers_from_core(self):
for filename in glob.glob(f"{ROOT_FOLDER}/example_dags/**/*.py", recursive=True):
self.assert_file_not_contains(filename, "providers") | apache/incubator-airflow | [
29418,
12032,
29418,
869,
1428948298
] |
def assert_file_not_contains(self, filename: str, pattern: str):
with open(filename, 'rb', 0) as file, mmap.mmap(file.fileno(), 0, access=mmap.ACCESS_READ) as content:
if content.find(bytes(pattern, 'utf-8')) != -1:
self.fail(f"File {filename} not contains pattern - {pattern}") | apache/incubator-airflow | [
29418,
12032,
29418,
869,
1428948298
] |
def test_providers_modules_should_have_tests(self):
"""
Assert every module in /airflow/providers has a corresponding test_ file in tests/airflow/providers.
"""
# Deprecated modules that don't have corresponded test
expected_missing_providers_modules = {
(
... | apache/incubator-airflow | [
29418,
12032,
29418,
869,
1428948298
] |
def filepath_to_module(filepath: str):
filepath = os.path.relpath(os.path.abspath(filepath), ROOT_FOLDER)
return filepath.replace("/", ".")[: -(len('.py'))] | apache/incubator-airflow | [
29418,
12032,
29418,
869,
1428948298
] |
def test_example_dags(self):
operators_modules = itertools.chain(
*(self.find_resource_files(resource_type=d) for d in ["operators", "sensors", "transfers"])
)
example_dags_files = self.find_resource_files(resource_type="example_dags")
# Generate tuple of department and servi... | apache/incubator-airflow | [
29418,
12032,
29418,
869,
1428948298
] |
def test_detect_invalid_system_tests(self, resource_type, filename_suffix):
operators_tests = self.find_resource_files(top_level_directory="tests", resource_type=resource_type)
operators_files = self.find_resource_files(top_level_directory="airflow", resource_type=resource_type)
files = {f for ... | apache/incubator-airflow | [
29418,
12032,
29418,
869,
1428948298
] |
def find_resource_files(
top_level_directory: str = "airflow",
department: str = "*",
resource_type: str = "*",
service: str = "*", | apache/incubator-airflow | [
29418,
12032,
29418,
869,
1428948298
] |
def get_equivalent_k(k, supercell_size):
return itertools.product(
*[
(np.linspace(0, 1, s, endpoint=False) + ki / s)
for ki, s in zip(k, supercell_size)
]
) | Z2PackDev/TBmodels | [
32,
25,
32,
10,
1440401352
] |
def test_supercell_simple(get_model, t_values, supercell_size, sparse):
"""
Test that the eigenvalues from a supercell model match the folded
eigenvalues of the base model, for a simple model.
"""
model = get_model(*t_values, sparse=sparse)
supercell_model = model.supercell(size=supercell_size)
... | Z2PackDev/TBmodels | [
32,
25,
32,
10,
1440401352
] |
def test_supercell_simple_2d(get_model, t_values, supercell_size):
"""
Test that the eigenvalues from a supercell model match the folded
eigenvalues of the base model, for a simple model.
"""
model = get_model(*t_values, dim=2)
supercell_model = model.supercell(size=supercell_size)
for k in ... | Z2PackDev/TBmodels | [
32,
25,
32,
10,
1440401352
] |
def test_supercell_simple_4d(get_model, t_values, supercell_size):
"""
Test that the eigenvalues from a supercell model match the folded
eigenvalues of the base model, for a simple model.
"""
model = get_model(*t_values, dim=4)
supercell_model = model.supercell(size=supercell_size)
for k in ... | Z2PackDev/TBmodels | [
32,
25,
32,
10,
1440401352
] |
def test_supercell_inas(sample, supercell_size):
"""
Test that the eigenvalues from a supercell model match the folded
eigenvalues of the base model, for the realistic InAs model.
"""
model = tbmodels.io.load(sample("InAs_nosym.hdf5"))
supercell_model = model.supercell(size=supercell_size)
f... | Z2PackDev/TBmodels | [
32,
25,
32,
10,
1440401352
] |
def data_masking(self, cluster_name, db_name, sql, sql_result):
result = {'status': 0, 'msg': 'ok', 'data': []}
# 通过inception获取语法树,并进行解析
try:
print_info = self.query_tree(sql, cluster_name, db_name)
except Exception as msg:
result['status'] = 1
result[... | jly8866/archer | [
1509,
649,
1509,
34,
1480664527
] |
def query_tree(self, sqlContent, cluster_name, dbName):
try:
print_info = inceptionDao.query_print(sqlContent, cluster_name, dbName)
except Exception as e:
raise Exception('通过inception获取语法树异常,请检查inception配置,并确保inception可以访问实例:' + str(e))
if print_info:
id = pr... | jly8866/archer | [
1509,
649,
1509,
34,
1480664527
] |
def query_table_ref(self, sqlContent, cluster_name, dbName):
result = {'status': 0, 'msg': 'ok', 'data': []}
try:
print_info = self.query_tree(sqlContent, cluster_name, dbName)
except Exception as msg:
result['status'] = 1
result['msg'] = str(msg)
... | jly8866/archer | [
1509,
649,
1509,
34,
1480664527
] |
def analy_query_tree(self, query_tree, cluster_name):
try:
query_tree_dict = json.loads(query_tree)
except JSONDecodeError:
query_tree_dict = json.loads(repair_json_str(query_tree))
select_list = query_tree_dict.get('select_list')
table_ref = query_tree_dict.get(... | jly8866/archer | [
1509,
649,
1509,
34,
1480664527
] |
def hit_column(self, DataMaskingColumnsOb, cluster_name, table_schema, table_name, column_name):
column_info = DataMaskingColumnsOb.filter(cluster_name=cluster_name, table_schema=table_schema,
table_name=table_name, column_name=column_name, active=1)
hi... | jly8866/archer | [
1509,
649,
1509,
34,
1480664527
] |
def hit_table(self, DataMaskingColumnsOb, cluster_name, table_schema, table_name):
columns_info = DataMaskingColumnsOb.filter(cluster_name=cluster_name, table_schema=table_schema,
table_name=table_name, active=1)
# 命中规则
hit_columns_info = []
... | jly8866/archer | [
1509,
649,
1509,
34,
1480664527
] |
def regex(self, DataMaskingRulesOb, rule_type, value):
rules_info = DataMaskingRulesOb.get(rule_type=rule_type)
if rules_info:
rule_regex = rules_info.rule_regex
hide_group = rules_info.hide_group
# 正则匹配必须分组,隐藏的组会使用****代替
try:
p = re.compil... | jly8866/archer | [
1509,
649,
1509,
34,
1480664527
] |
def foo(*args):
print "foo!", args
import sys; sys.stdout.flush() | boakley/robotframework-workbench | [
22,
6,
22,
16,
1332542179
] |
def __init__(self, app):
self.app = app
pass | boakley/robotframework-workbench | [
22,
6,
22,
16,
1332542179
] |
def evaluate(step, width, height):
return (0.1 + width * step / 100) ** (-1) + height * 0.01 | ray-project/ray | [
24488,
4264,
24488,
2914,
1477424310
] |
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
info.
Args:
info (dict): The service account private key info.
args: Additional arguments to pass to the constructor.
kwa... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to p... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def get_mtls_endpoint_and_cert_source(
cls, client_options: Optional[ClientOptions] = None | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def transport(self) -> MetadataServiceTransport:
"""Returns the transport used by the client instance.
Returns:
MetadataServiceTransport: The transport used by the client instance.
"""
return self._client.transport | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def __init__(
self,
*,
credentials: ga_credentials.Credentials = None,
transport: Union[str, MetadataServiceTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_create_metadata_store():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.CreateMetadataStoreRequest(
parent="parent_value",
)
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_get_metadata_store():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.GetMetadataStoreRequest(
name="name_value",
)
#... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_list_metadata_stores():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListMetadataStoresRequest(
parent="parent_value",
)
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_delete_metadata_store():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.DeleteMetadataStoreRequest(
name="name_value",
)
... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_create_artifact():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.CreateArtifactRequest(
parent="parent_value",
)
# ... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_get_artifact():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.GetArtifactRequest(
name="name_value",
)
# Make the r... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_list_artifacts():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListArtifactsRequest(
parent="parent_value",
)
# Ma... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_update_artifact():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.UpdateArtifactRequest(
)
# Make the request
response =... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_delete_artifact():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.DeleteArtifactRequest(
name="name_value",
)
# Make... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_purge_artifacts():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.PurgeArtifactsRequest(
parent="parent_value",
filter="filter_va... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_create_context():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.CreateContextRequest(
parent="parent_value",
)
# Ma... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_get_context():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.GetContextRequest(
name="name_value",
)
# Make the req... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_list_contexts():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListContextsRequest(
parent="parent_value",
)
# Make... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_update_context():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.UpdateContextRequest(
)
# Make the request
response = c... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_delete_context():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.DeleteContextRequest(
name="name_value",
)
# Make t... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_purge_contexts():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.PurgeContextsRequest(
parent="parent_value",
filter="filter_valu... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
def sample_add_context_artifacts_and_executions():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.AddContextArtifactsAndExecutionsRequest(
context="context_valu... | googleapis/python-aiplatform | [
306,
205,
306,
52,
1600875819
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.