body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1 value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
f148fb5edc927e0946837de61dc95bf2a14fa855124629e42c762f6f2d127064 | def test_create_new_super_user(self):
'Test creating a new super user'
user = get_user_model().objects.create_superuser(email='example@example.com', password='test@123')
self.assertTrue(user.is_superuser)
self.assertTrue(user.is_staff) | Test creating a new super user | app/core/tests/test_models.py | test_create_new_super_user | swastik-goyal/recipe-app-api | 0 | python | def test_create_new_super_user(self):
user = get_user_model().objects.create_superuser(email='example@example.com', password='test@123')
self.assertTrue(user.is_superuser)
self.assertTrue(user.is_staff) | def test_create_new_super_user(self):
user = get_user_model().objects.create_superuser(email='example@example.com', password='test@123')
self.assertTrue(user.is_superuser)
self.assertTrue(user.is_staff)<|docstring|>Test creating a new super user<|endoftext|> |
ad4233a642085dde17e5ef7e61ee5053739633046175d46d7456333a40b9c121 | def test_tag_str(self):
'Test the tag string representation'
tag = models.Tag.objects.create(user=sample_user(), name='Vegan')
self.assertEqual(str(tag), tag.name) | Test the tag string representation | app/core/tests/test_models.py | test_tag_str | swastik-goyal/recipe-app-api | 0 | python | def test_tag_str(self):
tag = models.Tag.objects.create(user=sample_user(), name='Vegan')
self.assertEqual(str(tag), tag.name) | def test_tag_str(self):
tag = models.Tag.objects.create(user=sample_user(), name='Vegan')
self.assertEqual(str(tag), tag.name)<|docstring|>Test the tag string representation<|endoftext|> |
ce53402148baff10563a65c2544c968af00dda5ededd201443b28a5745dbac6c | def test_ingredient_str(self):
'Test the ingredient string representation'
ingredient = models.Ingredient.objects.create(user=sample_user(), name='Cucumber')
self.assertEqual(str(ingredient), ingredient.name) | Test the ingredient string representation | app/core/tests/test_models.py | test_ingredient_str | swastik-goyal/recipe-app-api | 0 | python | def test_ingredient_str(self):
ingredient = models.Ingredient.objects.create(user=sample_user(), name='Cucumber')
self.assertEqual(str(ingredient), ingredient.name) | def test_ingredient_str(self):
ingredient = models.Ingredient.objects.create(user=sample_user(), name='Cucumber')
self.assertEqual(str(ingredient), ingredient.name)<|docstring|>Test the ingredient string representation<|endoftext|> |
fc08a820974edac5409f8e2790a530e5829033d002fdcfb3ee78e69a046986ec | def _check_signature(self, signature, data):
'\n _check_signature computes the sha1 hexdigest of the request payload with\n the applications secret key and compares it to the requests hexdigest signature.\n\n :param signature: hexdigest signature of the request\n :param data: bytes object containing the request payload\n :return: boolean result of the digest comparison\n '
hashed = hmac.new(self.secret_token, data, sha1)
sig_check = f'sha1={hashed.hexdigest()}'
return hmac.compare_digest(signature, sig_check) | _check_signature computes the sha1 hexdigest of the request payload with
the applications secret key and compares it to the requests hexdigest signature.
:param signature: hexdigest signature of the request
:param data: bytes object containing the request payload
:return: boolean result of the digest comparison | ghooklistener/listener.py | _check_signature | G-Node/github-hook-handler | 0 | python | def _check_signature(self, signature, data):
'\n _check_signature computes the sha1 hexdigest of the request payload with\n the applications secret key and compares it to the requests hexdigest signature.\n\n :param signature: hexdigest signature of the request\n :param data: bytes object containing the request payload\n :return: boolean result of the digest comparison\n '
hashed = hmac.new(self.secret_token, data, sha1)
sig_check = f'sha1={hashed.hexdigest()}'
return hmac.compare_digest(signature, sig_check) | def _check_signature(self, signature, data):
'\n _check_signature computes the sha1 hexdigest of the request payload with\n the applications secret key and compares it to the requests hexdigest signature.\n\n :param signature: hexdigest signature of the request\n :param data: bytes object containing the request payload\n :return: boolean result of the digest comparison\n '
hashed = hmac.new(self.secret_token, data, sha1)
sig_check = f'sha1={hashed.hexdigest()}'
return hmac.compare_digest(signature, sig_check)<|docstring|>_check_signature computes the sha1 hexdigest of the request payload with
the applications secret key and compares it to the requests hexdigest signature.
:param signature: hexdigest signature of the request
:param data: bytes object containing the request payload
:return: boolean result of the digest comparison<|endoftext|> |
e9e25b2e26d5cc57180d976bbcb02fc59955bf2b59ff15cb6b9a81827f4da70a | def payload_from_form(form, prefix='', delete=False):
'\n Generate a payload for a POST request based on a ModelForm\n '
prefix = (f'{prefix}-' if prefix else '')
payload = {f'{prefix}{k}': form[k].value() for (k, v) in form.fields.items() if form[k].value()}
if getattr(form.instance, 'id'):
payload['id'] = form.instance.id
if delete:
payload['delete'] = True
return payload | Generate a payload for a POST request based on a ModelForm | mysign_app/tests/routes/form_helpers.py | payload_from_form | mindhashnl/roomsignage | 0 | python | def payload_from_form(form, prefix=, delete=False):
'\n \n '
prefix = (f'{prefix}-' if prefix else )
payload = {f'{prefix}{k}': form[k].value() for (k, v) in form.fields.items() if form[k].value()}
if getattr(form.instance, 'id'):
payload['id'] = form.instance.id
if delete:
payload['delete'] = True
return payload | def payload_from_form(form, prefix=, delete=False):
'\n \n '
prefix = (f'{prefix}-' if prefix else )
payload = {f'{prefix}{k}': form[k].value() for (k, v) in form.fields.items() if form[k].value()}
if getattr(form.instance, 'id'):
payload['id'] = form.instance.id
if delete:
payload['delete'] = True
return payload<|docstring|>Generate a payload for a POST request based on a ModelForm<|endoftext|> |
4e6f39ce18956b36c4f33450796992d0ef25966d8e10709d40d82cdf4632dc77 | @click.command(name='ppmi-to-bids')
@cli_param.dataset_directory
@cli_param.clinical_data_directory
@cli_param.bids_directory
def cli(dataset_directory: PathLike, clinical_data_directory: PathLike, bids_directory: PathLike) -> None:
'PPMI to BIDS converter.\n\n Convert the imaging and clinical data of PPMI (https://www.ppmi-info.org/), located in DATASET_DIRECTORY and\n CLINICAL_DATA_DIRECTORY respectively, to a BIDS dataset in the target BIDS_DIRECTORY.\n '
from clinica.iotools.converters.ppmi_to_bids.ppmi_to_bids import convert_images
from clinica.utils.check_dependency import check_dcm2niix
from clinica.utils.stream import cprint
check_dcm2niix()
convert_images(dataset_directory, bids_directory, clinical_data_directory)
cprint('Conversion to BIDS succeeded.') | PPMI to BIDS converter.
Convert the imaging and clinical data of PPMI (https://www.ppmi-info.org/), located in DATASET_DIRECTORY and
CLINICAL_DATA_DIRECTORY respectively, to a BIDS dataset in the target BIDS_DIRECTORY. | clinica/iotools/converters/ppmi_to_bids/ppmi_to_bids_cli.py | cli | VadymV/clinica | 0 | python | @click.command(name='ppmi-to-bids')
@cli_param.dataset_directory
@cli_param.clinical_data_directory
@cli_param.bids_directory
def cli(dataset_directory: PathLike, clinical_data_directory: PathLike, bids_directory: PathLike) -> None:
'PPMI to BIDS converter.\n\n Convert the imaging and clinical data of PPMI (https://www.ppmi-info.org/), located in DATASET_DIRECTORY and\n CLINICAL_DATA_DIRECTORY respectively, to a BIDS dataset in the target BIDS_DIRECTORY.\n '
from clinica.iotools.converters.ppmi_to_bids.ppmi_to_bids import convert_images
from clinica.utils.check_dependency import check_dcm2niix
from clinica.utils.stream import cprint
check_dcm2niix()
convert_images(dataset_directory, bids_directory, clinical_data_directory)
cprint('Conversion to BIDS succeeded.') | @click.command(name='ppmi-to-bids')
@cli_param.dataset_directory
@cli_param.clinical_data_directory
@cli_param.bids_directory
def cli(dataset_directory: PathLike, clinical_data_directory: PathLike, bids_directory: PathLike) -> None:
'PPMI to BIDS converter.\n\n Convert the imaging and clinical data of PPMI (https://www.ppmi-info.org/), located in DATASET_DIRECTORY and\n CLINICAL_DATA_DIRECTORY respectively, to a BIDS dataset in the target BIDS_DIRECTORY.\n '
from clinica.iotools.converters.ppmi_to_bids.ppmi_to_bids import convert_images
from clinica.utils.check_dependency import check_dcm2niix
from clinica.utils.stream import cprint
check_dcm2niix()
convert_images(dataset_directory, bids_directory, clinical_data_directory)
cprint('Conversion to BIDS succeeded.')<|docstring|>PPMI to BIDS converter.
Convert the imaging and clinical data of PPMI (https://www.ppmi-info.org/), located in DATASET_DIRECTORY and
CLINICAL_DATA_DIRECTORY respectively, to a BIDS dataset in the target BIDS_DIRECTORY.<|endoftext|> |
f1fbe5d5e34cdd4edc29d1823089e9f3023c999d82c0fd2bc758791e0fdf5b82 | def header(repository: 'OAIRepository', identifier: str, xmlb: etree._Element):
'\n Generate and append a <header> OAI element to and XML doc.\n Args:\n repository (OAIRepository): An instantiated repository class\n identifier (str): A valid identifier string\n xmlb (lxml.etree._Element): The element to add the header to\n Returns:\n A lxml.etree._Element for the root of the header\n '
head = repository.data.get_record_header(identifier)
xhead = etree.SubElement(xmlb, 'header')
xident = etree.SubElement(xhead, 'identifier')
xident.text = head.identifier
xstamp = etree.SubElement(xhead, 'datestamp')
xstamp.text = (granularity_format(repository.data.get_identify().granularity, head.datestamp) if isinstance(head.datestamp, datetime) else head.datestamp)
for setspec in head.setspecs:
xset = etree.SubElement(xhead, 'setSpec')
xset.text = setspec | Generate and append a <header> OAI element to and XML doc.
Args:
repository (OAIRepository): An instantiated repository class
identifier (str): A valid identifier string
xmlb (lxml.etree._Element): The element to add the header to
Returns:
A lxml.etree._Element for the root of the header | src/oai_repo/getrecord.py | header | MSU-Libraries/oai_repo | 1 | python | def header(repository: 'OAIRepository', identifier: str, xmlb: etree._Element):
'\n Generate and append a <header> OAI element to and XML doc.\n Args:\n repository (OAIRepository): An instantiated repository class\n identifier (str): A valid identifier string\n xmlb (lxml.etree._Element): The element to add the header to\n Returns:\n A lxml.etree._Element for the root of the header\n '
head = repository.data.get_record_header(identifier)
xhead = etree.SubElement(xmlb, 'header')
xident = etree.SubElement(xhead, 'identifier')
xident.text = head.identifier
xstamp = etree.SubElement(xhead, 'datestamp')
xstamp.text = (granularity_format(repository.data.get_identify().granularity, head.datestamp) if isinstance(head.datestamp, datetime) else head.datestamp)
for setspec in head.setspecs:
xset = etree.SubElement(xhead, 'setSpec')
xset.text = setspec | def header(repository: 'OAIRepository', identifier: str, xmlb: etree._Element):
'\n Generate and append a <header> OAI element to and XML doc.\n Args:\n repository (OAIRepository): An instantiated repository class\n identifier (str): A valid identifier string\n xmlb (lxml.etree._Element): The element to add the header to\n Returns:\n A lxml.etree._Element for the root of the header\n '
head = repository.data.get_record_header(identifier)
xhead = etree.SubElement(xmlb, 'header')
xident = etree.SubElement(xhead, 'identifier')
xident.text = head.identifier
xstamp = etree.SubElement(xhead, 'datestamp')
xstamp.text = (granularity_format(repository.data.get_identify().granularity, head.datestamp) if isinstance(head.datestamp, datetime) else head.datestamp)
for setspec in head.setspecs:
xset = etree.SubElement(xhead, 'setSpec')
xset.text = setspec<|docstring|>Generate and append a <header> OAI element to and XML doc.
Args:
repository (OAIRepository): An instantiated repository class
identifier (str): A valid identifier string
xmlb (lxml.etree._Element): The element to add the header to
Returns:
A lxml.etree._Element for the root of the header<|endoftext|> |
3f437d9f57290873c7e322ddefadbc278241be75c2c0ecd3e8c07ac7d0c64711 | def record(repository: 'OAIRepository', identifier: str, metadataprefix: str, xmlb: etree._Element):
'\n Generate and append a <record> OAI element to and XML doc.\n Args:\n repository (OAIRepository): An instantiated repository class\n identifier (str): A valid identifier string\n xmlb (lxml.etree._Element): The element to add the header to\n Returns:\n A lxml.etree._Element for the root of the header\n '
xrec = etree.SubElement(xmlb, 'record')
header(repository, identifier, xrec)
xmeta = etree.SubElement(xrec, 'metadata')
xmeta.append(repository.data.get_record_metadata(identifier, metadataprefix))
abouts = repository.data.get_record_abouts(identifier)
for about in abouts:
xabout = etree.SubElement(xrec, 'about')
xabout.append(about) | Generate and append a <record> OAI element to and XML doc.
Args:
repository (OAIRepository): An instantiated repository class
identifier (str): A valid identifier string
xmlb (lxml.etree._Element): The element to add the header to
Returns:
A lxml.etree._Element for the root of the header | src/oai_repo/getrecord.py | record | MSU-Libraries/oai_repo | 1 | python | def record(repository: 'OAIRepository', identifier: str, metadataprefix: str, xmlb: etree._Element):
'\n Generate and append a <record> OAI element to and XML doc.\n Args:\n repository (OAIRepository): An instantiated repository class\n identifier (str): A valid identifier string\n xmlb (lxml.etree._Element): The element to add the header to\n Returns:\n A lxml.etree._Element for the root of the header\n '
xrec = etree.SubElement(xmlb, 'record')
header(repository, identifier, xrec)
xmeta = etree.SubElement(xrec, 'metadata')
xmeta.append(repository.data.get_record_metadata(identifier, metadataprefix))
abouts = repository.data.get_record_abouts(identifier)
for about in abouts:
xabout = etree.SubElement(xrec, 'about')
xabout.append(about) | def record(repository: 'OAIRepository', identifier: str, metadataprefix: str, xmlb: etree._Element):
'\n Generate and append a <record> OAI element to and XML doc.\n Args:\n repository (OAIRepository): An instantiated repository class\n identifier (str): A valid identifier string\n xmlb (lxml.etree._Element): The element to add the header to\n Returns:\n A lxml.etree._Element for the root of the header\n '
xrec = etree.SubElement(xmlb, 'record')
header(repository, identifier, xrec)
xmeta = etree.SubElement(xrec, 'metadata')
xmeta.append(repository.data.get_record_metadata(identifier, metadataprefix))
abouts = repository.data.get_record_abouts(identifier)
for about in abouts:
xabout = etree.SubElement(xrec, 'about')
xabout.append(about)<|docstring|>Generate and append a <record> OAI element to and XML doc.
Args:
repository (OAIRepository): An instantiated repository class
identifier (str): A valid identifier string
xmlb (lxml.etree._Element): The element to add the header to
Returns:
A lxml.etree._Element for the root of the header<|endoftext|> |
e3fc73dbd66c21b9c0b272538e0c34a2e139f0761ca05e7a926150316f7e00f7 | def errors(self):
'\n Verify fields are valid and present where required. Returning a list of descriptive\n errors if any issues were found.\n '
failures = []
failures.extend(self._identifier_failures())
failures.extend(self._datestamp_failures())
failures.extend(self._setspecs_failures())
failures.extend(self._status_failures())
return failures | Verify fields are valid and present where required. Returning a list of descriptive
errors if any issues were found. | src/oai_repo/getrecord.py | errors | MSU-Libraries/oai_repo | 1 | python | def errors(self):
'\n Verify fields are valid and present where required. Returning a list of descriptive\n errors if any issues were found.\n '
failures = []
failures.extend(self._identifier_failures())
failures.extend(self._datestamp_failures())
failures.extend(self._setspecs_failures())
failures.extend(self._status_failures())
return failures | def errors(self):
'\n Verify fields are valid and present where required. Returning a list of descriptive\n errors if any issues were found.\n '
failures = []
failures.extend(self._identifier_failures())
failures.extend(self._datestamp_failures())
failures.extend(self._setspecs_failures())
failures.extend(self._status_failures())
return failures<|docstring|>Verify fields are valid and present where required. Returning a list of descriptive
errors if any issues were found.<|endoftext|> |
98ac9eaabaf48881ac4b2b6e81aec6e4299a60821e630dcacb3f44bb28c2281d | def _metadata_identifier_failures(self):
'Return a list of identifier failures'
return [] | Return a list of identifier failures | src/oai_repo/getrecord.py | _metadata_identifier_failures | MSU-Libraries/oai_repo | 1 | python | def _metadata_identifier_failures(self):
return [] | def _metadata_identifier_failures(self):
return []<|docstring|>Return a list of identifier failures<|endoftext|> |
5199a6dc8851beec5006c1405cd73170e4d3dc4533b5f23b56d68133332a647c | def _datestamp_failures(self):
'Return a list of datestamp failures'
return [] | Return a list of datestamp failures | src/oai_repo/getrecord.py | _datestamp_failures | MSU-Libraries/oai_repo | 1 | python | def _datestamp_failures(self):
return [] | def _datestamp_failures(self):
return []<|docstring|>Return a list of datestamp failures<|endoftext|> |
7603da96426fbc42226402349e7a0bb7ed248259d3f865b4b2416418d4391573 | def _setspecs_failures(self):
'Return a list of setspecs failures'
return [] | Return a list of setspecs failures | src/oai_repo/getrecord.py | _setspecs_failures | MSU-Libraries/oai_repo | 1 | python | def _setspecs_failures(self):
return [] | def _setspecs_failures(self):
return []<|docstring|>Return a list of setspecs failures<|endoftext|> |
83ba9fa5a0efbc2f2c29999b0ea2c9d1c544785ab47aeb9b449b49cddc66be5d | def _status_failures(self):
'Return a list of setspecs failures'
return (["RecordHeader.status can only be None or 'deleted'"] if (self.status and (self.status != 'deleted')) else []) | Return a list of setspecs failures | src/oai_repo/getrecord.py | _status_failures | MSU-Libraries/oai_repo | 1 | python | def _status_failures(self):
return (["RecordHeader.status can only be None or 'deleted'"] if (self.status and (self.status != 'deleted')) else []) | def _status_failures(self):
return (["RecordHeader.status can only be None or 'deleted'"] if (self.status and (self.status != 'deleted')) else [])<|docstring|>Return a list of setspecs failures<|endoftext|> |
d55a1d4bd3cfb2e94a176574a6eabd69b64dc804c9bc7a4c84f9d01f869d977c | def post_parse(self):
'Runs after args are parsed'
self.identifier = self.args.get('identifier')
self.metadataprefix = self.args.get('metadataPrefix') | Runs after args are parsed | src/oai_repo/getrecord.py | post_parse | MSU-Libraries/oai_repo | 1 | python | def post_parse(self):
self.identifier = self.args.get('identifier')
self.metadataprefix = self.args.get('metadataPrefix') | def post_parse(self):
self.identifier = self.args.get('identifier')
self.metadataprefix = self.args.get('metadataPrefix')<|docstring|>Runs after args are parsed<|endoftext|> |
871f6f649c3e3e91abcd207839c4b1ecfa933e32dd2438cdbec3dbd130c97c75 | def body(self) -> etree.Element:
'Response body'
(identifier, metadataprefix) = (self.request.identifier, self.request.metadataprefix)
if (not self.repository.data.is_valid_identifier(identifier)):
raise OAIErrorIdDoesNotExist('The given identifier does not exist.')
mdformats = self.repository.data.get_metadata_formats(identifier)
if (metadataprefix not in [mdf.metadata_prefix for mdf in mdformats]):
raise OAIErrorCannotDisseminateFormat('The requested metadataPrefix does not exist for the given identifier.')
granularity = self.repository.data.get_identify().granularity
xmlb = etree.Element('GetRecord')
record(self.repository, identifier, metadataprefix, xmlb)
return xmlb | Response body | src/oai_repo/getrecord.py | body | MSU-Libraries/oai_repo | 1 | python | def body(self) -> etree.Element:
(identifier, metadataprefix) = (self.request.identifier, self.request.metadataprefix)
if (not self.repository.data.is_valid_identifier(identifier)):
raise OAIErrorIdDoesNotExist('The given identifier does not exist.')
mdformats = self.repository.data.get_metadata_formats(identifier)
if (metadataprefix not in [mdf.metadata_prefix for mdf in mdformats]):
raise OAIErrorCannotDisseminateFormat('The requested metadataPrefix does not exist for the given identifier.')
granularity = self.repository.data.get_identify().granularity
xmlb = etree.Element('GetRecord')
record(self.repository, identifier, metadataprefix, xmlb)
return xmlb | def body(self) -> etree.Element:
(identifier, metadataprefix) = (self.request.identifier, self.request.metadataprefix)
if (not self.repository.data.is_valid_identifier(identifier)):
raise OAIErrorIdDoesNotExist('The given identifier does not exist.')
mdformats = self.repository.data.get_metadata_formats(identifier)
if (metadataprefix not in [mdf.metadata_prefix for mdf in mdformats]):
raise OAIErrorCannotDisseminateFormat('The requested metadataPrefix does not exist for the given identifier.')
granularity = self.repository.data.get_identify().granularity
xmlb = etree.Element('GetRecord')
record(self.repository, identifier, metadataprefix, xmlb)
return xmlb<|docstring|>Response body<|endoftext|> |
ea8362102177d6a06dd3ae78f1f007fbf62dc7bce212ed8bcdfd85d5a73fc423 | def train_step(self, data):
"The logic for one training step.\n This method can be overridden to support custom training logic.\n This method is called by `Model.make_train_function`.\n This method should contain the mathemetical logic for one step of training.\n This typically includes the forward pass, loss calculation, backpropagation,\n and metric updates.\n Configuration details for *how* this logic is run (e.g. `tf.function` and\n `tf.distribute.Strategy` settings), should be left to\n `Model.make_train_function`, which can also be overridden.\n Arguments:\n data: A nested structure of `Tensor`s.\n Returns:\n A `dict` containing values that will be passed to\n `tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the\n values of the `Model`'s metrics are returned. Example:\n `{'loss': 0.2, 'accuracy': 0.7}`.\n "
data = data_adapter.expand_1d(data)
(x, y, sample_weight) = data_adapter.unpack_x_y_sample_weight(data)
self.assigned_inputs = x
with backprop.GradientTape(persistent=True) as tape:
self.tape_handler = tape
tape.watch(x)
y_pred = self(x, training=True)
loss = self.compiled_loss(y, y_pred, sample_weight, regularization_losses=self.losses)
_minimize(self.distribute_strategy, tape, self.optimizer, loss, self.trainable_variables)
self.compiled_metrics.update_state(y, y_pred, sample_weight)
return {m.name: m.result() for m in self.metrics} | The logic for one training step.
This method can be overridden to support custom training logic.
This method is called by `Model.make_train_function`.
This method should contain the mathemetical logic for one step of training.
This typically includes the forward pass, loss calculation, backpropagation,
and metric updates.
Configuration details for *how* this logic is run (e.g. `tf.function` and
`tf.distribute.Strategy` settings), should be left to
`Model.make_train_function`, which can also be overridden.
Arguments:
data: A nested structure of `Tensor`s.
Returns:
A `dict` containing values that will be passed to
`tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the
values of the `Model`'s metrics are returned. Example:
`{'loss': 0.2, 'accuracy': 0.7}`. | ku/engine_ext/training.py | train_step | tonandr/keras_unsupervised | 4 | python | def train_step(self, data):
"The logic for one training step.\n This method can be overridden to support custom training logic.\n This method is called by `Model.make_train_function`.\n This method should contain the mathemetical logic for one step of training.\n This typically includes the forward pass, loss calculation, backpropagation,\n and metric updates.\n Configuration details for *how* this logic is run (e.g. `tf.function` and\n `tf.distribute.Strategy` settings), should be left to\n `Model.make_train_function`, which can also be overridden.\n Arguments:\n data: A nested structure of `Tensor`s.\n Returns:\n A `dict` containing values that will be passed to\n `tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the\n values of the `Model`'s metrics are returned. Example:\n `{'loss': 0.2, 'accuracy': 0.7}`.\n "
data = data_adapter.expand_1d(data)
(x, y, sample_weight) = data_adapter.unpack_x_y_sample_weight(data)
self.assigned_inputs = x
with backprop.GradientTape(persistent=True) as tape:
self.tape_handler = tape
tape.watch(x)
y_pred = self(x, training=True)
loss = self.compiled_loss(y, y_pred, sample_weight, regularization_losses=self.losses)
_minimize(self.distribute_strategy, tape, self.optimizer, loss, self.trainable_variables)
self.compiled_metrics.update_state(y, y_pred, sample_weight)
return {m.name: m.result() for m in self.metrics} | def train_step(self, data):
"The logic for one training step.\n This method can be overridden to support custom training logic.\n This method is called by `Model.make_train_function`.\n This method should contain the mathemetical logic for one step of training.\n This typically includes the forward pass, loss calculation, backpropagation,\n and metric updates.\n Configuration details for *how* this logic is run (e.g. `tf.function` and\n `tf.distribute.Strategy` settings), should be left to\n `Model.make_train_function`, which can also be overridden.\n Arguments:\n data: A nested structure of `Tensor`s.\n Returns:\n A `dict` containing values that will be passed to\n `tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the\n values of the `Model`'s metrics are returned. Example:\n `{'loss': 0.2, 'accuracy': 0.7}`.\n "
data = data_adapter.expand_1d(data)
(x, y, sample_weight) = data_adapter.unpack_x_y_sample_weight(data)
self.assigned_inputs = x
with backprop.GradientTape(persistent=True) as tape:
self.tape_handler = tape
tape.watch(x)
y_pred = self(x, training=True)
loss = self.compiled_loss(y, y_pred, sample_weight, regularization_losses=self.losses)
_minimize(self.distribute_strategy, tape, self.optimizer, loss, self.trainable_variables)
self.compiled_metrics.update_state(y, y_pred, sample_weight)
return {m.name: m.result() for m in self.metrics}<|docstring|>The logic for one training step.
This method can be overridden to support custom training logic.
This method is called by `Model.make_train_function`.
This method should contain the mathemetical logic for one step of training.
This typically includes the forward pass, loss calculation, backpropagation,
and metric updates.
Configuration details for *how* this logic is run (e.g. `tf.function` and
`tf.distribute.Strategy` settings), should be left to
`Model.make_train_function`, which can also be overridden.
Arguments:
data: A nested structure of `Tensor`s.
Returns:
A `dict` containing values that will be passed to
`tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the
values of the `Model`'s metrics are returned. Example:
`{'loss': 0.2, 'accuracy': 0.7}`.<|endoftext|> |
1fb8cf9a8409308f88ddb6014fcf8a675d8db81d5cf57d4fff5115ce9cfe4f0e | def test_step(self, data):
"The logic for one evaluation step.\n This method can be overridden to support custom evaluation logic.\n This method is called by `Model.make_test_function`.\n This function should contain the mathemetical logic for one step of\n evaluation.\n This typically includes the forward pass, loss calculation, and metrics\n updates.\n Configuration details for *how* this logic is run (e.g. `tf.function` and\n `tf.distribute.Strategy` settings), should be left to\n `Model.make_test_function`, which can also be overridden.\n Arguments:\n data: A nested structure of `Tensor`s.\n Returns:\n A `dict` containing values that will be passed to\n `tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the\n values of the `Model`'s metrics are returned.\n "
data = data_adapter.expand_1d(data)
(x, y, sample_weight) = data_adapter.unpack_x_y_sample_weight(data)
self.assigned_inputs = x
with backprop.GradientTape(persistent=True) as tape:
self.tape_handler = tape
tape.watch(x)
y_pred = self(x, training=False)
loss = self.compiled_loss(y, y_pred, sample_weight, regularization_losses=self.losses)
self.compiled_metrics.update_state(y, y_pred, sample_weight)
return {m.name: m.result() for m in self.metrics} | The logic for one evaluation step.
This method can be overridden to support custom evaluation logic.
This method is called by `Model.make_test_function`.
This function should contain the mathemetical logic for one step of
evaluation.
This typically includes the forward pass, loss calculation, and metrics
updates.
Configuration details for *how* this logic is run (e.g. `tf.function` and
`tf.distribute.Strategy` settings), should be left to
`Model.make_test_function`, which can also be overridden.
Arguments:
data: A nested structure of `Tensor`s.
Returns:
A `dict` containing values that will be passed to
`tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the
values of the `Model`'s metrics are returned. | ku/engine_ext/training.py | test_step | tonandr/keras_unsupervised | 4 | python | def test_step(self, data):
"The logic for one evaluation step.\n This method can be overridden to support custom evaluation logic.\n This method is called by `Model.make_test_function`.\n This function should contain the mathemetical logic for one step of\n evaluation.\n This typically includes the forward pass, loss calculation, and metrics\n updates.\n Configuration details for *how* this logic is run (e.g. `tf.function` and\n `tf.distribute.Strategy` settings), should be left to\n `Model.make_test_function`, which can also be overridden.\n Arguments:\n data: A nested structure of `Tensor`s.\n Returns:\n A `dict` containing values that will be passed to\n `tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the\n values of the `Model`'s metrics are returned.\n "
data = data_adapter.expand_1d(data)
(x, y, sample_weight) = data_adapter.unpack_x_y_sample_weight(data)
self.assigned_inputs = x
with backprop.GradientTape(persistent=True) as tape:
self.tape_handler = tape
tape.watch(x)
y_pred = self(x, training=False)
loss = self.compiled_loss(y, y_pred, sample_weight, regularization_losses=self.losses)
self.compiled_metrics.update_state(y, y_pred, sample_weight)
return {m.name: m.result() for m in self.metrics} | def test_step(self, data):
"The logic for one evaluation step.\n This method can be overridden to support custom evaluation logic.\n This method is called by `Model.make_test_function`.\n This function should contain the mathemetical logic for one step of\n evaluation.\n This typically includes the forward pass, loss calculation, and metrics\n updates.\n Configuration details for *how* this logic is run (e.g. `tf.function` and\n `tf.distribute.Strategy` settings), should be left to\n `Model.make_test_function`, which can also be overridden.\n Arguments:\n data: A nested structure of `Tensor`s.\n Returns:\n A `dict` containing values that will be passed to\n `tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the\n values of the `Model`'s metrics are returned.\n "
data = data_adapter.expand_1d(data)
(x, y, sample_weight) = data_adapter.unpack_x_y_sample_weight(data)
self.assigned_inputs = x
with backprop.GradientTape(persistent=True) as tape:
self.tape_handler = tape
tape.watch(x)
y_pred = self(x, training=False)
loss = self.compiled_loss(y, y_pred, sample_weight, regularization_losses=self.losses)
self.compiled_metrics.update_state(y, y_pred, sample_weight)
return {m.name: m.result() for m in self.metrics}<|docstring|>The logic for one evaluation step.
This method can be overridden to support custom evaluation logic.
This method is called by `Model.make_test_function`.
This function should contain the mathemetical logic for one step of
evaluation.
This typically includes the forward pass, loss calculation, and metrics
updates.
Configuration details for *how* this logic is run (e.g. `tf.function` and
`tf.distribute.Strategy` settings), should be left to
`Model.make_test_function`, which can also be overridden.
Arguments:
data: A nested structure of `Tensor`s.
Returns:
A `dict` containing values that will be passed to
`tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the
values of the `Model`'s metrics are returned.<|endoftext|> |
c9c63dd1a7713377d944ee12bb3a169ed43fecca263f6c2586d45707a666ff2a | def glue_layers(self, gluing_layers, glued_layer_names):
'Glue layers to the model.\n \n Parameters\n ----------\n gluing_layers: List or tuple.\n Gluing layers.\n glued_layer_names: List or tuple.\n Glued layer names between beginning and ending.\n '
layer_names = [layer.name for layer in self.layers]
assert ((len(glued_layer_names) == 2) and (glued_layer_names[0] or glued_layer_names[0]))
if glued_layer_names[0]:
assert (glued_layer_names[0] in layer_names)
if glued_layer_names[1]:
assert (glued_layer_names[1] in layer_names)
if ((not glued_layer_names[0]) and glued_layer_names[1]):
assert (isinstance(gluing_layers[0], tf.Tensor) and (len(gluing_layers) >= 2))
if (glued_layer_names[0] and (not glued_layer_names[1])):
s_idx = layer_names.index(glued_layer_names[0])
upper_layer_name_idxes = range((s_idx + 1))
inputs = [[Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in model_input] for model_input in self.inputs]
x = inputs
for (i, layer_name_idx) in enumerate(upper_layer_name_idxes):
x = self.get_layer(layer_names[layer_name_idx])(x)
for layer in gluing_layers:
x = layer(x)
return Model(inputs, x)
elif (glued_layer_names[0] and glued_layer_names[1]):
s_idx = layer_names.index(glued_layer_names[0])
e_idx = layer_names.index(glued_layer_names[1])
inputs = [[Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in model_input] for model_input in self.inputs]
x = inputs
for idx in range(s_idx):
x = self.get_layer(layer_names[idx])(x)
for layer in gluing_layers:
x = layer(x)
for idx in range(e_idx, len(layer_names)):
x = self.get_layer(layer_names[idx])(x)
return Model(inputs, x)
else:
e_idx = layer_names.index(glued_layer_names[1])
lower_layer_name_idxes = range(e_idx, len(layer_names))
inputs = gluing_layers[0]
x = inputs
for layer in gluing_layers[1:]:
x = layer(x)
for (i, layer_name_idx) in enumerate(lower_layer_name_idxes):
x = self.get_layer(layer_names[layer_name_idx])(x)
return Model(inputs, x) | Glue layers to the model.
Parameters
----------
gluing_layers: List or tuple.
Gluing layers.
glued_layer_names: List or tuple.
Glued layer names between beginning and ending. | ku/engine_ext/training.py | glue_layers | tonandr/keras_unsupervised | 4 | python | def glue_layers(self, gluing_layers, glued_layer_names):
'Glue layers to the model.\n \n Parameters\n ----------\n gluing_layers: List or tuple.\n Gluing layers.\n glued_layer_names: List or tuple.\n Glued layer names between beginning and ending.\n '
layer_names = [layer.name for layer in self.layers]
assert ((len(glued_layer_names) == 2) and (glued_layer_names[0] or glued_layer_names[0]))
if glued_layer_names[0]:
assert (glued_layer_names[0] in layer_names)
if glued_layer_names[1]:
assert (glued_layer_names[1] in layer_names)
if ((not glued_layer_names[0]) and glued_layer_names[1]):
assert (isinstance(gluing_layers[0], tf.Tensor) and (len(gluing_layers) >= 2))
if (glued_layer_names[0] and (not glued_layer_names[1])):
s_idx = layer_names.index(glued_layer_names[0])
upper_layer_name_idxes = range((s_idx + 1))
inputs = [[Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in model_input] for model_input in self.inputs]
x = inputs
for (i, layer_name_idx) in enumerate(upper_layer_name_idxes):
x = self.get_layer(layer_names[layer_name_idx])(x)
for layer in gluing_layers:
x = layer(x)
return Model(inputs, x)
elif (glued_layer_names[0] and glued_layer_names[1]):
s_idx = layer_names.index(glued_layer_names[0])
e_idx = layer_names.index(glued_layer_names[1])
inputs = [[Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in model_input] for model_input in self.inputs]
x = inputs
for idx in range(s_idx):
x = self.get_layer(layer_names[idx])(x)
for layer in gluing_layers:
x = layer(x)
for idx in range(e_idx, len(layer_names)):
x = self.get_layer(layer_names[idx])(x)
return Model(inputs, x)
else:
e_idx = layer_names.index(glued_layer_names[1])
lower_layer_name_idxes = range(e_idx, len(layer_names))
inputs = gluing_layers[0]
x = inputs
for layer in gluing_layers[1:]:
x = layer(x)
for (i, layer_name_idx) in enumerate(lower_layer_name_idxes):
x = self.get_layer(layer_names[layer_name_idx])(x)
return Model(inputs, x) | def glue_layers(self, gluing_layers, glued_layer_names):
'Glue layers to the model.\n \n Parameters\n ----------\n gluing_layers: List or tuple.\n Gluing layers.\n glued_layer_names: List or tuple.\n Glued layer names between beginning and ending.\n '
layer_names = [layer.name for layer in self.layers]
assert ((len(glued_layer_names) == 2) and (glued_layer_names[0] or glued_layer_names[0]))
if glued_layer_names[0]:
assert (glued_layer_names[0] in layer_names)
if glued_layer_names[1]:
assert (glued_layer_names[1] in layer_names)
if ((not glued_layer_names[0]) and glued_layer_names[1]):
assert (isinstance(gluing_layers[0], tf.Tensor) and (len(gluing_layers) >= 2))
if (glued_layer_names[0] and (not glued_layer_names[1])):
s_idx = layer_names.index(glued_layer_names[0])
upper_layer_name_idxes = range((s_idx + 1))
inputs = [[Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in model_input] for model_input in self.inputs]
x = inputs
for (i, layer_name_idx) in enumerate(upper_layer_name_idxes):
x = self.get_layer(layer_names[layer_name_idx])(x)
for layer in gluing_layers:
x = layer(x)
return Model(inputs, x)
elif (glued_layer_names[0] and glued_layer_names[1]):
s_idx = layer_names.index(glued_layer_names[0])
e_idx = layer_names.index(glued_layer_names[1])
inputs = [[Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in model_input] for model_input in self.inputs]
x = inputs
for idx in range(s_idx):
x = self.get_layer(layer_names[idx])(x)
for layer in gluing_layers:
x = layer(x)
for idx in range(e_idx, len(layer_names)):
x = self.get_layer(layer_names[idx])(x)
return Model(inputs, x)
else:
e_idx = layer_names.index(glued_layer_names[1])
lower_layer_name_idxes = range(e_idx, len(layer_names))
inputs = gluing_layers[0]
x = inputs
for layer in gluing_layers[1:]:
x = layer(x)
for (i, layer_name_idx) in enumerate(lower_layer_name_idxes):
x = self.get_layer(layer_names[layer_name_idx])(x)
return Model(inputs, x)<|docstring|>Glue layers to the model.
Parameters
----------
gluing_layers: List or tuple.
Gluing layers.
glued_layer_names: List or tuple.
Glued layer names between beginning and ending.<|endoftext|> |
32be13727b0a7c22a5ced40736ea44510bf84c7a63e058db357f740316d63835 | def create_prog_model(self, prog_mode, prog_depth, fixed_layer_names, compile_f=True):
'Create a progressive model for progressive learning.\n \n Parameters\n ----------\n prog_mode: Integer.\n Progressive mode: Forward (0), backward (1).\n prog_depth: Integer.\n Depth of a progressive model.\n fixed_layer_names: List or tuple.\n Layer names not learned progressively.\n compile_f: Boolean.\n Progressive model compiling flag (default: True).\n '
layer_names = [layer.name for layer in self.layers]
total_depth = len(layer_names)
assert ((prog_mode in [self.PROGRESSIVE_MODE_FORWARD, self.PROGRESSIVE_MODE_BACKWARD]) and (len(fixed_layer_names) == 2))
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
assert fixed_layer_names[0]
assert (fixed_layer_names[0] in layer_names)
fixed_s_layer_depth = layer_names.index(fixed_layer_names[0])
assert (fixed_s_layer_depth < prog_depth)
if fixed_layer_names[1]:
assert (fixed_layer_names[1] in layer_names)
fixed_e_layer_depth = layer_names.index(fixed_layer_names[1])
assert (fixed_e_layer_depth > prog_depth)
else:
fixed_e_layer_depth = (- 1)
if (prog_mode == self.PROGRESSIVE_MODE_BACKWARD):
assert ((not fixed_layer_names[0]) and fixed_layer_names[1])
assert (fixed_layer_names[1] in layer_names)
fixed_e_layer_depth = layer_names.index(fixed_layer_names[1])
assert (fixed_e_layer_depth > prog_depth)
fixed_s_layer_depth = (- 1)
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
inputs = [Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in self.inputs]
x = inputs
for idx in range(len(inputs), (fixed_s_layer_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
for idx in range((fixed_s_layer_depth + 1), (prog_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
if (fixed_e_layer_depth != (- 1)):
for idx in range(fixed_e_layer_depth, total_depth):
x = self.get_layer(layer_names[idx])(x)
outputs = x
prog_model = ModelExt(inputs, outputs, name='forward_prog_model')
if compile_f:
assert self._is_compiled
prog_model.compile(optimizer=self.optimizer, loss=self.losses, loss_weights=self.loss_weights, run_eagerly=True)
else:
inputs = [Input(K.int_shape(self.get_layer(layer_names[prog_depth]).input)[1:])]
x = inputs
for idx in range(prog_depth, (fixed_e_layer_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
if (len(self.inputs) > 1):
aug_inputs = [Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in self.inputs[1:]]
for idx in range((fixed_e_layer_depth + 1), total_depth):
layer = self.get_layer(layer_names[idx])
if (len(layer.inputs) > 1):
x = layer(([x] + aug_inputs))
else:
x = layer(x)
outputs = x
prog_model = ModelExt(inputs, outputs, name='backward_prog_model')
if compile_f:
assert self._is_compiled
prog_model.compile(optimizer=self.optimizer, loss=self.losses, loss_weights=self.loss_weights, run_eagerly=True)
return prog_model | Create a progressive model for progressive learning.
Parameters
----------
prog_mode: Integer.
Progressive mode: Forward (0), backward (1).
prog_depth: Integer.
Depth of a progressive model.
fixed_layer_names: List or tuple.
Layer names not learned progressively.
compile_f: Boolean.
Progressive model compiling flag (default: True). | ku/engine_ext/training.py | create_prog_model | tonandr/keras_unsupervised | 4 | python | def create_prog_model(self, prog_mode, prog_depth, fixed_layer_names, compile_f=True):
'Create a progressive model for progressive learning.\n \n Parameters\n ----------\n prog_mode: Integer.\n Progressive mode: Forward (0), backward (1).\n prog_depth: Integer.\n Depth of a progressive model.\n fixed_layer_names: List or tuple.\n Layer names not learned progressively.\n compile_f: Boolean.\n Progressive model compiling flag (default: True).\n '
layer_names = [layer.name for layer in self.layers]
total_depth = len(layer_names)
assert ((prog_mode in [self.PROGRESSIVE_MODE_FORWARD, self.PROGRESSIVE_MODE_BACKWARD]) and (len(fixed_layer_names) == 2))
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
assert fixed_layer_names[0]
assert (fixed_layer_names[0] in layer_names)
fixed_s_layer_depth = layer_names.index(fixed_layer_names[0])
assert (fixed_s_layer_depth < prog_depth)
if fixed_layer_names[1]:
assert (fixed_layer_names[1] in layer_names)
fixed_e_layer_depth = layer_names.index(fixed_layer_names[1])
assert (fixed_e_layer_depth > prog_depth)
else:
fixed_e_layer_depth = (- 1)
if (prog_mode == self.PROGRESSIVE_MODE_BACKWARD):
assert ((not fixed_layer_names[0]) and fixed_layer_names[1])
assert (fixed_layer_names[1] in layer_names)
fixed_e_layer_depth = layer_names.index(fixed_layer_names[1])
assert (fixed_e_layer_depth > prog_depth)
fixed_s_layer_depth = (- 1)
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
inputs = [Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in self.inputs]
x = inputs
for idx in range(len(inputs), (fixed_s_layer_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
for idx in range((fixed_s_layer_depth + 1), (prog_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
if (fixed_e_layer_depth != (- 1)):
for idx in range(fixed_e_layer_depth, total_depth):
x = self.get_layer(layer_names[idx])(x)
outputs = x
prog_model = ModelExt(inputs, outputs, name='forward_prog_model')
if compile_f:
assert self._is_compiled
prog_model.compile(optimizer=self.optimizer, loss=self.losses, loss_weights=self.loss_weights, run_eagerly=True)
else:
inputs = [Input(K.int_shape(self.get_layer(layer_names[prog_depth]).input)[1:])]
x = inputs
for idx in range(prog_depth, (fixed_e_layer_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
if (len(self.inputs) > 1):
aug_inputs = [Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in self.inputs[1:]]
for idx in range((fixed_e_layer_depth + 1), total_depth):
layer = self.get_layer(layer_names[idx])
if (len(layer.inputs) > 1):
x = layer(([x] + aug_inputs))
else:
x = layer(x)
outputs = x
prog_model = ModelExt(inputs, outputs, name='backward_prog_model')
if compile_f:
assert self._is_compiled
prog_model.compile(optimizer=self.optimizer, loss=self.losses, loss_weights=self.loss_weights, run_eagerly=True)
return prog_model | def create_prog_model(self, prog_mode, prog_depth, fixed_layer_names, compile_f=True):
'Create a progressive model for progressive learning.\n \n Parameters\n ----------\n prog_mode: Integer.\n Progressive mode: Forward (0), backward (1).\n prog_depth: Integer.\n Depth of a progressive model.\n fixed_layer_names: List or tuple.\n Layer names not learned progressively.\n compile_f: Boolean.\n Progressive model compiling flag (default: True).\n '
layer_names = [layer.name for layer in self.layers]
total_depth = len(layer_names)
assert ((prog_mode in [self.PROGRESSIVE_MODE_FORWARD, self.PROGRESSIVE_MODE_BACKWARD]) and (len(fixed_layer_names) == 2))
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
assert fixed_layer_names[0]
assert (fixed_layer_names[0] in layer_names)
fixed_s_layer_depth = layer_names.index(fixed_layer_names[0])
assert (fixed_s_layer_depth < prog_depth)
if fixed_layer_names[1]:
assert (fixed_layer_names[1] in layer_names)
fixed_e_layer_depth = layer_names.index(fixed_layer_names[1])
assert (fixed_e_layer_depth > prog_depth)
else:
fixed_e_layer_depth = (- 1)
if (prog_mode == self.PROGRESSIVE_MODE_BACKWARD):
assert ((not fixed_layer_names[0]) and fixed_layer_names[1])
assert (fixed_layer_names[1] in layer_names)
fixed_e_layer_depth = layer_names.index(fixed_layer_names[1])
assert (fixed_e_layer_depth > prog_depth)
fixed_s_layer_depth = (- 1)
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
inputs = [Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in self.inputs]
x = inputs
for idx in range(len(inputs), (fixed_s_layer_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
for idx in range((fixed_s_layer_depth + 1), (prog_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
if (fixed_e_layer_depth != (- 1)):
for idx in range(fixed_e_layer_depth, total_depth):
x = self.get_layer(layer_names[idx])(x)
outputs = x
prog_model = ModelExt(inputs, outputs, name='forward_prog_model')
if compile_f:
assert self._is_compiled
prog_model.compile(optimizer=self.optimizer, loss=self.losses, loss_weights=self.loss_weights, run_eagerly=True)
else:
inputs = [Input(K.int_shape(self.get_layer(layer_names[prog_depth]).input)[1:])]
x = inputs
for idx in range(prog_depth, (fixed_e_layer_depth + 1)):
x = self.get_layer(layer_names[idx])(x)
if (len(self.inputs) > 1):
aug_inputs = [Input(shape=K.int_shape(t)[1:], dtype=t.dtype) for t in self.inputs[1:]]
for idx in range((fixed_e_layer_depth + 1), total_depth):
layer = self.get_layer(layer_names[idx])
if (len(layer.inputs) > 1):
x = layer(([x] + aug_inputs))
else:
x = layer(x)
outputs = x
prog_model = ModelExt(inputs, outputs, name='backward_prog_model')
if compile_f:
assert self._is_compiled
prog_model.compile(optimizer=self.optimizer, loss=self.losses, loss_weights=self.loss_weights, run_eagerly=True)
return prog_model<|docstring|>Create a progressive model for progressive learning.
Parameters
----------
prog_mode: Integer.
Progressive mode: Forward (0), backward (1).
prog_depth: Integer.
Depth of a progressive model.
fixed_layer_names: List or tuple.
Layer names not learned progressively.
compile_f: Boolean.
Progressive model compiling flag (default: True).<|endoftext|> |
819295ae11573019c88f0aeb48fff483d03aad60e55a6d4bf33f62e90e4286b5 | def create_inner_prog_model(self, prog_mode, prog_depth, fixed_layer_names, compile_f=True):
'Create a progressive model for progressive learning within the current model.\n \n Parameters\n ----------\n prog_mode: Integer.\n Progressive mode: Forward (0), backward (1).\n prog_depth: Integer.\n Depth of a progressive model.\n fixed_layer_names: List or tuple.\n Layer names not learned progressively.\n compile_f: Boolean.\n Progressive model compiling flag (default: True).\n '
assert ((prog_mode in [self.PROGRESSIVE_MODE_FORWARD, self.PROGRESSIVE_MODE_BACKWARD]) and (len(fixed_layer_names) == 2))
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
self.forward_prog_model = self.create_prog_model(prog_mode, prog_depth, fixed_layer_names, compile_f=compile_f)
else:
self.backward_prog_model = self.create_prog_model(prog_mode, prog_depth, fixed_layer_names, compile_f=compile_f) | Create a progressive model for progressive learning within the current model.
Parameters
----------
prog_mode: Integer.
Progressive mode: Forward (0), backward (1).
prog_depth: Integer.
Depth of a progressive model.
fixed_layer_names: List or tuple.
Layer names not learned progressively.
compile_f: Boolean.
Progressive model compiling flag (default: True). | ku/engine_ext/training.py | create_inner_prog_model | tonandr/keras_unsupervised | 4 | python | def create_inner_prog_model(self, prog_mode, prog_depth, fixed_layer_names, compile_f=True):
'Create a progressive model for progressive learning within the current model.\n \n Parameters\n ----------\n prog_mode: Integer.\n Progressive mode: Forward (0), backward (1).\n prog_depth: Integer.\n Depth of a progressive model.\n fixed_layer_names: List or tuple.\n Layer names not learned progressively.\n compile_f: Boolean.\n Progressive model compiling flag (default: True).\n '
assert ((prog_mode in [self.PROGRESSIVE_MODE_FORWARD, self.PROGRESSIVE_MODE_BACKWARD]) and (len(fixed_layer_names) == 2))
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
self.forward_prog_model = self.create_prog_model(prog_mode, prog_depth, fixed_layer_names, compile_f=compile_f)
else:
self.backward_prog_model = self.create_prog_model(prog_mode, prog_depth, fixed_layer_names, compile_f=compile_f) | def create_inner_prog_model(self, prog_mode, prog_depth, fixed_layer_names, compile_f=True):
'Create a progressive model for progressive learning within the current model.\n \n Parameters\n ----------\n prog_mode: Integer.\n Progressive mode: Forward (0), backward (1).\n prog_depth: Integer.\n Depth of a progressive model.\n fixed_layer_names: List or tuple.\n Layer names not learned progressively.\n compile_f: Boolean.\n Progressive model compiling flag (default: True).\n '
assert ((prog_mode in [self.PROGRESSIVE_MODE_FORWARD, self.PROGRESSIVE_MODE_BACKWARD]) and (len(fixed_layer_names) == 2))
if (prog_mode == self.PROGRESSIVE_MODE_FORWARD):
self.forward_prog_model = self.create_prog_model(prog_mode, prog_depth, fixed_layer_names, compile_f=compile_f)
else:
self.backward_prog_model = self.create_prog_model(prog_mode, prog_depth, fixed_layer_names, compile_f=compile_f)<|docstring|>Create a progressive model for progressive learning within the current model.
Parameters
----------
prog_mode: Integer.
Progressive mode: Forward (0), backward (1).
prog_depth: Integer.
Depth of a progressive model.
fixed_layer_names: List or tuple.
Layer names not learned progressively.
compile_f: Boolean.
Progressive model compiling flag (default: True).<|endoftext|> |
e8bb832028ce68048eaf5f2dbb52d0db039fe6ebbef6f9648d859a1feaf67e4e | def train_on_batch_forward_prog_model(self, x, y=None, sample_weight=None, class_weight=None, reset_metrics=True):
'Runs a single gradient update on a single batch of data for the forward progressive model.\n \n Parameters\n ----------\n x: Input data. It could be:\n - A Numpy array (or array-like), or a list of arrays\n (in case the model has multiple inputs).\n - A TensorFlow tensor, or a list of tensors\n (in case the model has multiple inputs).\n - A dict mapping input names to the corresponding array/tensors,\n if the model has named inputs.\n - A `tf.data` dataset.\n y: Target data. Like the input data `x`, it could be either Numpy\n array(s) or TensorFlow tensor(s). It should be consistent with `x`\n (you cannot have Numpy inputs and tensor targets, or inversely). If\n `x` is a dataset, `y` should not be specified\n (since targets will be obtained from the iterator).\n sample_weight: Optional array of the same length as x, containing\n weights to apply to the model\'s loss for each sample. In the case of\n temporal data, you can pass a 2D array with shape (samples,\n sequence_length), to apply a different weight to every timestep of\n every sample. In this case you should make sure to specify\n sample_weight_mode="temporal" in compile(). This argument is not\n supported when `x` is a dataset.\n class_weight: Optional dictionary mapping class indices (integers) to a\n weight (float) to apply to the model\'s loss for the samples from this\n class during training. This can be useful to tell the model to "pay\n more attention" to samples from an under-represented class.\n reset_metrics: If `True`, the metrics returned will be only for this\n batch. If `False`, the metrics will be statefully accumulated across\n batches.\n Returns\n -------\n Scalar training loss\n (if the model has a single output and no metrics)\n or list of scalars (if the model has multiple outputs\n and/or metrics). The attribute `model.metrics_names` will give you\n the display labels for the scalar outputs.\n Raises\n ------\n ValueError: In case of invalid user-provided arguments.\n '
assert (hasattr(self, 'forward_prog_model') and self.forward_prog_model._is_compiled)
return self.forward_prog_model.train_on_batch(x, y=y, sample_weight=sample_weight, class_weight=class_weight, reset_metrics=reset_metrics) | Runs a single gradient update on a single batch of data for the forward progressive model.
Parameters
----------
x: Input data. It could be:
- A Numpy array (or array-like), or a list of arrays
(in case the model has multiple inputs).
- A TensorFlow tensor, or a list of tensors
(in case the model has multiple inputs).
- A dict mapping input names to the corresponding array/tensors,
if the model has named inputs.
- A `tf.data` dataset.
y: Target data. Like the input data `x`, it could be either Numpy
array(s) or TensorFlow tensor(s). It should be consistent with `x`
(you cannot have Numpy inputs and tensor targets, or inversely). If
`x` is a dataset, `y` should not be specified
(since targets will be obtained from the iterator).
sample_weight: Optional array of the same length as x, containing
weights to apply to the model's loss for each sample. In the case of
temporal data, you can pass a 2D array with shape (samples,
sequence_length), to apply a different weight to every timestep of
every sample. In this case you should make sure to specify
sample_weight_mode="temporal" in compile(). This argument is not
supported when `x` is a dataset.
class_weight: Optional dictionary mapping class indices (integers) to a
weight (float) to apply to the model's loss for the samples from this
class during training. This can be useful to tell the model to "pay
more attention" to samples from an under-represented class.
reset_metrics: If `True`, the metrics returned will be only for this
batch. If `False`, the metrics will be statefully accumulated across
batches.
Returns
-------
Scalar training loss
(if the model has a single output and no metrics)
or list of scalars (if the model has multiple outputs
and/or metrics). The attribute `model.metrics_names` will give you
the display labels for the scalar outputs.
Raises
------
ValueError: In case of invalid user-provided arguments. | ku/engine_ext/training.py | train_on_batch_forward_prog_model | tonandr/keras_unsupervised | 4 | python | def train_on_batch_forward_prog_model(self, x, y=None, sample_weight=None, class_weight=None, reset_metrics=True):
'Runs a single gradient update on a single batch of data for the forward progressive model.\n \n Parameters\n ----------\n x: Input data. It could be:\n - A Numpy array (or array-like), or a list of arrays\n (in case the model has multiple inputs).\n - A TensorFlow tensor, or a list of tensors\n (in case the model has multiple inputs).\n - A dict mapping input names to the corresponding array/tensors,\n if the model has named inputs.\n - A `tf.data` dataset.\n y: Target data. Like the input data `x`, it could be either Numpy\n array(s) or TensorFlow tensor(s). It should be consistent with `x`\n (you cannot have Numpy inputs and tensor targets, or inversely). If\n `x` is a dataset, `y` should not be specified\n (since targets will be obtained from the iterator).\n sample_weight: Optional array of the same length as x, containing\n weights to apply to the model\'s loss for each sample. In the case of\n temporal data, you can pass a 2D array with shape (samples,\n sequence_length), to apply a different weight to every timestep of\n every sample. In this case you should make sure to specify\n sample_weight_mode="temporal" in compile(). This argument is not\n supported when `x` is a dataset.\n class_weight: Optional dictionary mapping class indices (integers) to a\n weight (float) to apply to the model\'s loss for the samples from this\n class during training. This can be useful to tell the model to "pay\n more attention" to samples from an under-represented class.\n reset_metrics: If `True`, the metrics returned will be only for this\n batch. If `False`, the metrics will be statefully accumulated across\n batches.\n Returns\n -------\n Scalar training loss\n (if the model has a single output and no metrics)\n or list of scalars (if the model has multiple outputs\n and/or metrics). The attribute `model.metrics_names` will give you\n the display labels for the scalar outputs.\n Raises\n ------\n ValueError: In case of invalid user-provided arguments.\n '
assert (hasattr(self, 'forward_prog_model') and self.forward_prog_model._is_compiled)
return self.forward_prog_model.train_on_batch(x, y=y, sample_weight=sample_weight, class_weight=class_weight, reset_metrics=reset_metrics) | def train_on_batch_forward_prog_model(self, x, y=None, sample_weight=None, class_weight=None, reset_metrics=True):
'Runs a single gradient update on a single batch of data for the forward progressive model.\n \n Parameters\n ----------\n x: Input data. It could be:\n - A Numpy array (or array-like), or a list of arrays\n (in case the model has multiple inputs).\n - A TensorFlow tensor, or a list of tensors\n (in case the model has multiple inputs).\n - A dict mapping input names to the corresponding array/tensors,\n if the model has named inputs.\n - A `tf.data` dataset.\n y: Target data. Like the input data `x`, it could be either Numpy\n array(s) or TensorFlow tensor(s). It should be consistent with `x`\n (you cannot have Numpy inputs and tensor targets, or inversely). If\n `x` is a dataset, `y` should not be specified\n (since targets will be obtained from the iterator).\n sample_weight: Optional array of the same length as x, containing\n weights to apply to the model\'s loss for each sample. In the case of\n temporal data, you can pass a 2D array with shape (samples,\n sequence_length), to apply a different weight to every timestep of\n every sample. In this case you should make sure to specify\n sample_weight_mode="temporal" in compile(). This argument is not\n supported when `x` is a dataset.\n class_weight: Optional dictionary mapping class indices (integers) to a\n weight (float) to apply to the model\'s loss for the samples from this\n class during training. This can be useful to tell the model to "pay\n more attention" to samples from an under-represented class.\n reset_metrics: If `True`, the metrics returned will be only for this\n batch. If `False`, the metrics will be statefully accumulated across\n batches.\n Returns\n -------\n Scalar training loss\n (if the model has a single output and no metrics)\n or list of scalars (if the model has multiple outputs\n and/or metrics). The attribute `model.metrics_names` will give you\n the display labels for the scalar outputs.\n Raises\n ------\n ValueError: In case of invalid user-provided arguments.\n '
assert (hasattr(self, 'forward_prog_model') and self.forward_prog_model._is_compiled)
return self.forward_prog_model.train_on_batch(x, y=y, sample_weight=sample_weight, class_weight=class_weight, reset_metrics=reset_metrics)<|docstring|>Runs a single gradient update on a single batch of data for the forward progressive model.
Parameters
----------
x: Input data. It could be:
- A Numpy array (or array-like), or a list of arrays
(in case the model has multiple inputs).
- A TensorFlow tensor, or a list of tensors
(in case the model has multiple inputs).
- A dict mapping input names to the corresponding array/tensors,
if the model has named inputs.
- A `tf.data` dataset.
y: Target data. Like the input data `x`, it could be either Numpy
array(s) or TensorFlow tensor(s). It should be consistent with `x`
(you cannot have Numpy inputs and tensor targets, or inversely). If
`x` is a dataset, `y` should not be specified
(since targets will be obtained from the iterator).
sample_weight: Optional array of the same length as x, containing
weights to apply to the model's loss for each sample. In the case of
temporal data, you can pass a 2D array with shape (samples,
sequence_length), to apply a different weight to every timestep of
every sample. In this case you should make sure to specify
sample_weight_mode="temporal" in compile(). This argument is not
supported when `x` is a dataset.
class_weight: Optional dictionary mapping class indices (integers) to a
weight (float) to apply to the model's loss for the samples from this
class during training. This can be useful to tell the model to "pay
more attention" to samples from an under-represented class.
reset_metrics: If `True`, the metrics returned will be only for this
batch. If `False`, the metrics will be statefully accumulated across
batches.
Returns
-------
Scalar training loss
(if the model has a single output and no metrics)
or list of scalars (if the model has multiple outputs
and/or metrics). The attribute `model.metrics_names` will give you
the display labels for the scalar outputs.
Raises
------
ValueError: In case of invalid user-provided arguments.<|endoftext|> |
e744663d946cb536dc932a9452cacfb580ab8dea7bbb2cdb2cff976c3bd1c2fc | def train_on_batch_backward_prog_model(self, x, y=None, sample_weight=None, class_weight=None, reset_metrics=True):
'Runs a single gradient update on a single batch of data for the backward progressive model.\n \n Parameters\n ----------\n x: Input data. It could be:\n - A Numpy array (or array-like), or a list of arrays\n (in case the model has multiple inputs).\n - A TensorFlow tensor, or a list of tensors\n (in case the model has multiple inputs).\n - A dict mapping input names to the corresponding array/tensors,\n if the model has named inputs.\n - A `tf.data` dataset.\n y: Target data. Like the input data `x`, it could be either Numpy\n array(s) or TensorFlow tensor(s). It should be consistent with `x`\n (you cannot have Numpy inputs and tensor targets, or inversely). If\n `x` is a dataset, `y` should not be specified\n (since targets will be obtained from the iterator).\n sample_weight: Optional array of the same length as x, containing\n weights to apply to the model\'s loss for each sample. In the case of\n temporal data, you can pass a 2D array with shape (samples,\n sequence_length), to apply a different weight to every timestep of\n every sample. In this case you should make sure to specify\n sample_weight_mode="temporal" in compile(). This argument is not\n supported when `x` is a dataset.\n class_weight: Optional dictionary mapping class indices (integers) to a\n weight (float) to apply to the model\'s loss for the samples from this\n class during training. This can be useful to tell the model to "pay\n more attention" to samples from an under-represented class.\n reset_metrics: If `True`, the metrics returned will be only for this\n batch. If `False`, the metrics will be statefully accumulated across\n batches.\n Returns\n -------\n Scalar training loss\n (if the model has a single output and no metrics)\n or list of scalars (if the model has multiple outputs\n and/or metrics). The attribute `model.metrics_names` will give you\n the display labels for the scalar outputs.\n Raises\n ------\n ValueError: In case of invalid user-provided arguments.\n '
assert (hasattr(self, 'backward_prog_model') and self.backward_prog_model._is_compiled)
return self.backward_prog_model.train_on_batch(x, y=y, sample_weight=sample_weight, class_weight=class_weight, reset_metrics=reset_metrics) | Runs a single gradient update on a single batch of data for the backward progressive model.
Parameters
----------
x: Input data. It could be:
- A Numpy array (or array-like), or a list of arrays
(in case the model has multiple inputs).
- A TensorFlow tensor, or a list of tensors
(in case the model has multiple inputs).
- A dict mapping input names to the corresponding array/tensors,
if the model has named inputs.
- A `tf.data` dataset.
y: Target data. Like the input data `x`, it could be either Numpy
array(s) or TensorFlow tensor(s). It should be consistent with `x`
(you cannot have Numpy inputs and tensor targets, or inversely). If
`x` is a dataset, `y` should not be specified
(since targets will be obtained from the iterator).
sample_weight: Optional array of the same length as x, containing
weights to apply to the model's loss for each sample. In the case of
temporal data, you can pass a 2D array with shape (samples,
sequence_length), to apply a different weight to every timestep of
every sample. In this case you should make sure to specify
sample_weight_mode="temporal" in compile(). This argument is not
supported when `x` is a dataset.
class_weight: Optional dictionary mapping class indices (integers) to a
weight (float) to apply to the model's loss for the samples from this
class during training. This can be useful to tell the model to "pay
more attention" to samples from an under-represented class.
reset_metrics: If `True`, the metrics returned will be only for this
batch. If `False`, the metrics will be statefully accumulated across
batches.
Returns
-------
Scalar training loss
(if the model has a single output and no metrics)
or list of scalars (if the model has multiple outputs
and/or metrics). The attribute `model.metrics_names` will give you
the display labels for the scalar outputs.
Raises
------
ValueError: In case of invalid user-provided arguments. | ku/engine_ext/training.py | train_on_batch_backward_prog_model | tonandr/keras_unsupervised | 4 | python | def train_on_batch_backward_prog_model(self, x, y=None, sample_weight=None, class_weight=None, reset_metrics=True):
'Runs a single gradient update on a single batch of data for the backward progressive model.\n \n Parameters\n ----------\n x: Input data. It could be:\n - A Numpy array (or array-like), or a list of arrays\n (in case the model has multiple inputs).\n - A TensorFlow tensor, or a list of tensors\n (in case the model has multiple inputs).\n - A dict mapping input names to the corresponding array/tensors,\n if the model has named inputs.\n - A `tf.data` dataset.\n y: Target data. Like the input data `x`, it could be either Numpy\n array(s) or TensorFlow tensor(s). It should be consistent with `x`\n (you cannot have Numpy inputs and tensor targets, or inversely). If\n `x` is a dataset, `y` should not be specified\n (since targets will be obtained from the iterator).\n sample_weight: Optional array of the same length as x, containing\n weights to apply to the model\'s loss for each sample. In the case of\n temporal data, you can pass a 2D array with shape (samples,\n sequence_length), to apply a different weight to every timestep of\n every sample. In this case you should make sure to specify\n sample_weight_mode="temporal" in compile(). This argument is not\n supported when `x` is a dataset.\n class_weight: Optional dictionary mapping class indices (integers) to a\n weight (float) to apply to the model\'s loss for the samples from this\n class during training. This can be useful to tell the model to "pay\n more attention" to samples from an under-represented class.\n reset_metrics: If `True`, the metrics returned will be only for this\n batch. If `False`, the metrics will be statefully accumulated across\n batches.\n Returns\n -------\n Scalar training loss\n (if the model has a single output and no metrics)\n or list of scalars (if the model has multiple outputs\n and/or metrics). The attribute `model.metrics_names` will give you\n the display labels for the scalar outputs.\n Raises\n ------\n ValueError: In case of invalid user-provided arguments.\n '
assert (hasattr(self, 'backward_prog_model') and self.backward_prog_model._is_compiled)
return self.backward_prog_model.train_on_batch(x, y=y, sample_weight=sample_weight, class_weight=class_weight, reset_metrics=reset_metrics) | def train_on_batch_backward_prog_model(self, x, y=None, sample_weight=None, class_weight=None, reset_metrics=True):
'Runs a single gradient update on a single batch of data for the backward progressive model.\n \n Parameters\n ----------\n x: Input data. It could be:\n - A Numpy array (or array-like), or a list of arrays\n (in case the model has multiple inputs).\n - A TensorFlow tensor, or a list of tensors\n (in case the model has multiple inputs).\n - A dict mapping input names to the corresponding array/tensors,\n if the model has named inputs.\n - A `tf.data` dataset.\n y: Target data. Like the input data `x`, it could be either Numpy\n array(s) or TensorFlow tensor(s). It should be consistent with `x`\n (you cannot have Numpy inputs and tensor targets, or inversely). If\n `x` is a dataset, `y` should not be specified\n (since targets will be obtained from the iterator).\n sample_weight: Optional array of the same length as x, containing\n weights to apply to the model\'s loss for each sample. In the case of\n temporal data, you can pass a 2D array with shape (samples,\n sequence_length), to apply a different weight to every timestep of\n every sample. In this case you should make sure to specify\n sample_weight_mode="temporal" in compile(). This argument is not\n supported when `x` is a dataset.\n class_weight: Optional dictionary mapping class indices (integers) to a\n weight (float) to apply to the model\'s loss for the samples from this\n class during training. This can be useful to tell the model to "pay\n more attention" to samples from an under-represented class.\n reset_metrics: If `True`, the metrics returned will be only for this\n batch. If `False`, the metrics will be statefully accumulated across\n batches.\n Returns\n -------\n Scalar training loss\n (if the model has a single output and no metrics)\n or list of scalars (if the model has multiple outputs\n and/or metrics). The attribute `model.metrics_names` will give you\n the display labels for the scalar outputs.\n Raises\n ------\n ValueError: In case of invalid user-provided arguments.\n '
assert (hasattr(self, 'backward_prog_model') and self.backward_prog_model._is_compiled)
return self.backward_prog_model.train_on_batch(x, y=y, sample_weight=sample_weight, class_weight=class_weight, reset_metrics=reset_metrics)<|docstring|>Runs a single gradient update on a single batch of data for the backward progressive model.
Parameters
----------
x: Input data. It could be:
- A Numpy array (or array-like), or a list of arrays
(in case the model has multiple inputs).
- A TensorFlow tensor, or a list of tensors
(in case the model has multiple inputs).
- A dict mapping input names to the corresponding array/tensors,
if the model has named inputs.
- A `tf.data` dataset.
y: Target data. Like the input data `x`, it could be either Numpy
array(s) or TensorFlow tensor(s). It should be consistent with `x`
(you cannot have Numpy inputs and tensor targets, or inversely). If
`x` is a dataset, `y` should not be specified
(since targets will be obtained from the iterator).
sample_weight: Optional array of the same length as x, containing
weights to apply to the model's loss for each sample. In the case of
temporal data, you can pass a 2D array with shape (samples,
sequence_length), to apply a different weight to every timestep of
every sample. In this case you should make sure to specify
sample_weight_mode="temporal" in compile(). This argument is not
supported when `x` is a dataset.
class_weight: Optional dictionary mapping class indices (integers) to a
weight (float) to apply to the model's loss for the samples from this
class during training. This can be useful to tell the model to "pay
more attention" to samples from an under-represented class.
reset_metrics: If `True`, the metrics returned will be only for this
batch. If `False`, the metrics will be statefully accumulated across
batches.
Returns
-------
Scalar training loss
(if the model has a single output and no metrics)
or list of scalars (if the model has multiple outputs
and/or metrics). The attribute `model.metrics_names` will give you
the display labels for the scalar outputs.
Raises
------
ValueError: In case of invalid user-provided arguments.<|endoftext|> |
a619a2e380d01aaee4c0120920e701fe0476a13aa3e5cd07c1f0caefbcc95097 | def get_response(self, action, params, path='/', parent=None, verb='POST', list_marker='Set'):
'\n Utility method to handle calls to IAM and parsing of responses.\n '
if (not parent):
parent = self
response = self.make_request(action, params, path, verb)
body = response.read()
boto.log.debug(body)
if (response.status == 200):
if body:
e = boto.jsonresponse.Element(list_marker=list_marker, pythonize_name=True)
h = boto.jsonresponse.XmlHandler(e, parent)
h.parse(body)
return e
else:
return {}
else:
boto.log.error(('%s %s' % (response.status, response.reason)))
boto.log.error(('%s' % body))
raise self.ResponseError(response.status, response.reason, body) | Utility method to handle calls to IAM and parsing of responses. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_response | bopopescu/google-cloud-sdk | 15 | python | def get_response(self, action, params, path='/', parent=None, verb='POST', list_marker='Set'):
'\n \n '
if (not parent):
parent = self
response = self.make_request(action, params, path, verb)
body = response.read()
boto.log.debug(body)
if (response.status == 200):
if body:
e = boto.jsonresponse.Element(list_marker=list_marker, pythonize_name=True)
h = boto.jsonresponse.XmlHandler(e, parent)
h.parse(body)
return e
else:
return {}
else:
boto.log.error(('%s %s' % (response.status, response.reason)))
boto.log.error(('%s' % body))
raise self.ResponseError(response.status, response.reason, body) | def get_response(self, action, params, path='/', parent=None, verb='POST', list_marker='Set'):
'\n \n '
if (not parent):
parent = self
response = self.make_request(action, params, path, verb)
body = response.read()
boto.log.debug(body)
if (response.status == 200):
if body:
e = boto.jsonresponse.Element(list_marker=list_marker, pythonize_name=True)
h = boto.jsonresponse.XmlHandler(e, parent)
h.parse(body)
return e
else:
return {}
else:
boto.log.error(('%s %s' % (response.status, response.reason)))
boto.log.error(('%s' % body))
raise self.ResponseError(response.status, response.reason, body)<|docstring|>Utility method to handle calls to IAM and parsing of responses.<|endoftext|> |
a7aea973f9a7b3221767d9bd17e3e0f6eb6ba2f983415797924bbeab6b95ba02 | def get_all_groups(self, path_prefix='/', marker=None, max_items=None):
"\n List the groups that have the specified path prefix.\n\n :type path_prefix: string\n :param path_prefix: If provided, only groups whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {}
if path_prefix:
params['PathPrefix'] = path_prefix
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroups', params, list_marker='Groups') | List the groups that have the specified path prefix.
:type path_prefix: string
:param path_prefix: If provided, only groups whose paths match
the provided prefix will be returned.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_all_groups | bopopescu/google-cloud-sdk | 15 | python | def get_all_groups(self, path_prefix='/', marker=None, max_items=None):
"\n List the groups that have the specified path prefix.\n\n :type path_prefix: string\n :param path_prefix: If provided, only groups whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {}
if path_prefix:
params['PathPrefix'] = path_prefix
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroups', params, list_marker='Groups') | def get_all_groups(self, path_prefix='/', marker=None, max_items=None):
"\n List the groups that have the specified path prefix.\n\n :type path_prefix: string\n :param path_prefix: If provided, only groups whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {}
if path_prefix:
params['PathPrefix'] = path_prefix
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroups', params, list_marker='Groups')<|docstring|>List the groups that have the specified path prefix.
:type path_prefix: string
:param path_prefix: If provided, only groups whose paths match
the provided prefix will be returned.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
8fdeade9b69167a9be9ca9eaf391cf6329b72c6eb476964c1c442a793f2ad59f | def get_group(self, group_name, marker=None, max_items=None):
"\n Return a list of users that are in the specified group.\n\n :type group_name: string\n :param group_name: The name of the group whose information should\n be returned.\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'GroupName': group_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('GetGroup', params, list_marker='Users') | Return a list of users that are in the specified group.
:type group_name: string
:param group_name: The name of the group whose information should
be returned.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_group | bopopescu/google-cloud-sdk | 15 | python | def get_group(self, group_name, marker=None, max_items=None):
"\n Return a list of users that are in the specified group.\n\n :type group_name: string\n :param group_name: The name of the group whose information should\n be returned.\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'GroupName': group_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('GetGroup', params, list_marker='Users') | def get_group(self, group_name, marker=None, max_items=None):
"\n Return a list of users that are in the specified group.\n\n :type group_name: string\n :param group_name: The name of the group whose information should\n be returned.\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'GroupName': group_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('GetGroup', params, list_marker='Users')<|docstring|>Return a list of users that are in the specified group.
:type group_name: string
:param group_name: The name of the group whose information should
be returned.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
d2ce000951685e8a07d6256e7725d775e796543b00858c621465f035e5f9eff6 | def create_group(self, group_name, path='/'):
'\n Create a group.\n\n :type group_name: string\n :param group_name: The name of the new group\n\n :type path: string\n :param path: The path to the group (Optional). Defaults to /.\n\n '
params = {'GroupName': group_name, 'Path': path}
return self.get_response('CreateGroup', params) | Create a group.
:type group_name: string
:param group_name: The name of the new group
:type path: string
:param path: The path to the group (Optional). Defaults to /. | platform/gsutil/third_party/boto/boto/iam/connection.py | create_group | bopopescu/google-cloud-sdk | 15 | python | def create_group(self, group_name, path='/'):
'\n Create a group.\n\n :type group_name: string\n :param group_name: The name of the new group\n\n :type path: string\n :param path: The path to the group (Optional). Defaults to /.\n\n '
params = {'GroupName': group_name, 'Path': path}
return self.get_response('CreateGroup', params) | def create_group(self, group_name, path='/'):
'\n Create a group.\n\n :type group_name: string\n :param group_name: The name of the new group\n\n :type path: string\n :param path: The path to the group (Optional). Defaults to /.\n\n '
params = {'GroupName': group_name, 'Path': path}
return self.get_response('CreateGroup', params)<|docstring|>Create a group.
:type group_name: string
:param group_name: The name of the new group
:type path: string
:param path: The path to the group (Optional). Defaults to /.<|endoftext|> |
58e64b96ebd2af34dde48afb970a337ff7a137633888710550fc2f6e7bb2246b | def delete_group(self, group_name):
'\n Delete a group. The group must not contain any Users or\n have any attached policies\n\n :type group_name: string\n :param group_name: The name of the group to delete.\n\n '
params = {'GroupName': group_name}
return self.get_response('DeleteGroup', params) | Delete a group. The group must not contain any Users or
have any attached policies
:type group_name: string
:param group_name: The name of the group to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_group | bopopescu/google-cloud-sdk | 15 | python | def delete_group(self, group_name):
'\n Delete a group. The group must not contain any Users or\n have any attached policies\n\n :type group_name: string\n :param group_name: The name of the group to delete.\n\n '
params = {'GroupName': group_name}
return self.get_response('DeleteGroup', params) | def delete_group(self, group_name):
'\n Delete a group. The group must not contain any Users or\n have any attached policies\n\n :type group_name: string\n :param group_name: The name of the group to delete.\n\n '
params = {'GroupName': group_name}
return self.get_response('DeleteGroup', params)<|docstring|>Delete a group. The group must not contain any Users or
have any attached policies
:type group_name: string
:param group_name: The name of the group to delete.<|endoftext|> |
46bf899d1863f6c424c644e741696efb91506fe52d27018423069c0f869d9b14 | def update_group(self, group_name, new_group_name=None, new_path=None):
'\n Updates name and/or path of the specified group.\n\n :type group_name: string\n :param group_name: The name of the new group\n\n :type new_group_name: string\n :param new_group_name: If provided, the name of the group will be\n changed to this name.\n\n :type new_path: string\n :param new_path: If provided, the path of the group will be\n changed to this path.\n\n '
params = {'GroupName': group_name}
if new_group_name:
params['NewGroupName'] = new_group_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateGroup', params) | Updates name and/or path of the specified group.
:type group_name: string
:param group_name: The name of the new group
:type new_group_name: string
:param new_group_name: If provided, the name of the group will be
changed to this name.
:type new_path: string
:param new_path: If provided, the path of the group will be
changed to this path. | platform/gsutil/third_party/boto/boto/iam/connection.py | update_group | bopopescu/google-cloud-sdk | 15 | python | def update_group(self, group_name, new_group_name=None, new_path=None):
'\n Updates name and/or path of the specified group.\n\n :type group_name: string\n :param group_name: The name of the new group\n\n :type new_group_name: string\n :param new_group_name: If provided, the name of the group will be\n changed to this name.\n\n :type new_path: string\n :param new_path: If provided, the path of the group will be\n changed to this path.\n\n '
params = {'GroupName': group_name}
if new_group_name:
params['NewGroupName'] = new_group_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateGroup', params) | def update_group(self, group_name, new_group_name=None, new_path=None):
'\n Updates name and/or path of the specified group.\n\n :type group_name: string\n :param group_name: The name of the new group\n\n :type new_group_name: string\n :param new_group_name: If provided, the name of the group will be\n changed to this name.\n\n :type new_path: string\n :param new_path: If provided, the path of the group will be\n changed to this path.\n\n '
params = {'GroupName': group_name}
if new_group_name:
params['NewGroupName'] = new_group_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateGroup', params)<|docstring|>Updates name and/or path of the specified group.
:type group_name: string
:param group_name: The name of the new group
:type new_group_name: string
:param new_group_name: If provided, the name of the group will be
changed to this name.
:type new_path: string
:param new_path: If provided, the path of the group will be
changed to this path.<|endoftext|> |
7c0250230ef6f3c934bbb7e42ce12df8854d80d3e9b2b566dc47bea40402e8ec | def add_user_to_group(self, group_name, user_name):
'\n Add a user to a group\n\n :type group_name: string\n :param group_name: The name of the group\n\n :type user_name: string\n :param user_name: The to be added to the group.\n\n '
params = {'GroupName': group_name, 'UserName': user_name}
return self.get_response('AddUserToGroup', params) | Add a user to a group
:type group_name: string
:param group_name: The name of the group
:type user_name: string
:param user_name: The to be added to the group. | platform/gsutil/third_party/boto/boto/iam/connection.py | add_user_to_group | bopopescu/google-cloud-sdk | 15 | python | def add_user_to_group(self, group_name, user_name):
'\n Add a user to a group\n\n :type group_name: string\n :param group_name: The name of the group\n\n :type user_name: string\n :param user_name: The to be added to the group.\n\n '
params = {'GroupName': group_name, 'UserName': user_name}
return self.get_response('AddUserToGroup', params) | def add_user_to_group(self, group_name, user_name):
'\n Add a user to a group\n\n :type group_name: string\n :param group_name: The name of the group\n\n :type user_name: string\n :param user_name: The to be added to the group.\n\n '
params = {'GroupName': group_name, 'UserName': user_name}
return self.get_response('AddUserToGroup', params)<|docstring|>Add a user to a group
:type group_name: string
:param group_name: The name of the group
:type user_name: string
:param user_name: The to be added to the group.<|endoftext|> |
4a8e638e1409daa7278c7742fcb3bc9ebca2e66d774bca0625de313e6a4d22d1 | def remove_user_from_group(self, group_name, user_name):
'\n Remove a user from a group.\n\n :type group_name: string\n :param group_name: The name of the group\n\n :type user_name: string\n :param user_name: The user to remove from the group.\n\n '
params = {'GroupName': group_name, 'UserName': user_name}
return self.get_response('RemoveUserFromGroup', params) | Remove a user from a group.
:type group_name: string
:param group_name: The name of the group
:type user_name: string
:param user_name: The user to remove from the group. | platform/gsutil/third_party/boto/boto/iam/connection.py | remove_user_from_group | bopopescu/google-cloud-sdk | 15 | python | def remove_user_from_group(self, group_name, user_name):
'\n Remove a user from a group.\n\n :type group_name: string\n :param group_name: The name of the group\n\n :type user_name: string\n :param user_name: The user to remove from the group.\n\n '
params = {'GroupName': group_name, 'UserName': user_name}
return self.get_response('RemoveUserFromGroup', params) | def remove_user_from_group(self, group_name, user_name):
'\n Remove a user from a group.\n\n :type group_name: string\n :param group_name: The name of the group\n\n :type user_name: string\n :param user_name: The user to remove from the group.\n\n '
params = {'GroupName': group_name, 'UserName': user_name}
return self.get_response('RemoveUserFromGroup', params)<|docstring|>Remove a user from a group.
:type group_name: string
:param group_name: The name of the group
:type user_name: string
:param user_name: The user to remove from the group.<|endoftext|> |
1e0b73bbf581f6ba450ec143ca509e263063dd4c50c7c7b46c84d59e8fbcb984 | def put_group_policy(self, group_name, policy_name, policy_json):
'\n Adds or updates the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n :type policy_json: string\n :param policy_json: The policy document.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name, 'PolicyDocument': policy_json}
return self.get_response('PutGroupPolicy', params, verb='POST') | Adds or updates the specified policy document for the specified group.
:type group_name: string
:param group_name: The name of the group the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to get.
:type policy_json: string
:param policy_json: The policy document. | platform/gsutil/third_party/boto/boto/iam/connection.py | put_group_policy | bopopescu/google-cloud-sdk | 15 | python | def put_group_policy(self, group_name, policy_name, policy_json):
'\n Adds or updates the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n :type policy_json: string\n :param policy_json: The policy document.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name, 'PolicyDocument': policy_json}
return self.get_response('PutGroupPolicy', params, verb='POST') | def put_group_policy(self, group_name, policy_name, policy_json):
'\n Adds or updates the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n :type policy_json: string\n :param policy_json: The policy document.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name, 'PolicyDocument': policy_json}
return self.get_response('PutGroupPolicy', params, verb='POST')<|docstring|>Adds or updates the specified policy document for the specified group.
:type group_name: string
:param group_name: The name of the group the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to get.
:type policy_json: string
:param policy_json: The policy document.<|endoftext|> |
7f136b2aee6ac7a4194b016aff92e4c88049a8e21ee9b75802bdc4616dd75c9b | def get_all_group_policies(self, group_name, marker=None, max_items=None):
"\n List the names of the policies associated with the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'GroupName': group_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroupPolicies', params, list_marker='PolicyNames') | List the names of the policies associated with the specified group.
:type group_name: string
:param group_name: The name of the group the policy is associated with.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_all_group_policies | bopopescu/google-cloud-sdk | 15 | python | def get_all_group_policies(self, group_name, marker=None, max_items=None):
"\n List the names of the policies associated with the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'GroupName': group_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroupPolicies', params, list_marker='PolicyNames') | def get_all_group_policies(self, group_name, marker=None, max_items=None):
"\n List the names of the policies associated with the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'GroupName': group_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroupPolicies', params, list_marker='PolicyNames')<|docstring|>List the names of the policies associated with the specified group.
:type group_name: string
:param group_name: The name of the group the policy is associated with.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
715809081ef5f7e52227c55d21ebbeceb056ad31b496594ce2e092140816f4c9 | def get_group_policy(self, group_name, policy_name):
'\n Retrieves the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name}
return self.get_response('GetGroupPolicy', params, verb='POST') | Retrieves the specified policy document for the specified group.
:type group_name: string
:param group_name: The name of the group the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to get. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_group_policy | bopopescu/google-cloud-sdk | 15 | python | def get_group_policy(self, group_name, policy_name):
'\n Retrieves the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name}
return self.get_response('GetGroupPolicy', params, verb='POST') | def get_group_policy(self, group_name, policy_name):
'\n Retrieves the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name}
return self.get_response('GetGroupPolicy', params, verb='POST')<|docstring|>Retrieves the specified policy document for the specified group.
:type group_name: string
:param group_name: The name of the group the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to get.<|endoftext|> |
009fb2bb260a822246ffb3548605095df32ab3abb1e06a65b33ba9bd59ccd489 | def delete_group_policy(self, group_name, policy_name):
'\n Deletes the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to delete.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name}
return self.get_response('DeleteGroupPolicy', params, verb='POST') | Deletes the specified policy document for the specified group.
:type group_name: string
:param group_name: The name of the group the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_group_policy | bopopescu/google-cloud-sdk | 15 | python | def delete_group_policy(self, group_name, policy_name):
'\n Deletes the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to delete.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name}
return self.get_response('DeleteGroupPolicy', params, verb='POST') | def delete_group_policy(self, group_name, policy_name):
'\n Deletes the specified policy document for the specified group.\n\n :type group_name: string\n :param group_name: The name of the group the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to delete.\n\n '
params = {'GroupName': group_name, 'PolicyName': policy_name}
return self.get_response('DeleteGroupPolicy', params, verb='POST')<|docstring|>Deletes the specified policy document for the specified group.
:type group_name: string
:param group_name: The name of the group the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to delete.<|endoftext|> |
9a34f4246fea52f707e01fc7616d1ffda19c4131d4e70e6134fd06ed90f7655e | def get_all_users(self, path_prefix='/', marker=None, max_items=None):
"\n List the users that have the specified path prefix.\n\n :type path_prefix: string\n :param path_prefix: If provided, only users whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'PathPrefix': path_prefix}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListUsers', params, list_marker='Users') | List the users that have the specified path prefix.
:type path_prefix: string
:param path_prefix: If provided, only users whose paths match
the provided prefix will be returned.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_all_users | bopopescu/google-cloud-sdk | 15 | python | def get_all_users(self, path_prefix='/', marker=None, max_items=None):
"\n List the users that have the specified path prefix.\n\n :type path_prefix: string\n :param path_prefix: If provided, only users whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'PathPrefix': path_prefix}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListUsers', params, list_marker='Users') | def get_all_users(self, path_prefix='/', marker=None, max_items=None):
"\n List the users that have the specified path prefix.\n\n :type path_prefix: string\n :param path_prefix: If provided, only users whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'PathPrefix': path_prefix}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListUsers', params, list_marker='Users')<|docstring|>List the users that have the specified path prefix.
:type path_prefix: string
:param path_prefix: If provided, only users whose paths match
the provided prefix will be returned.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
fc7ccd06cfca0add7e91bba8ca69af1dee26e62540d22eb7c9029867be00345d | def create_user(self, user_name, path='/'):
'\n Create a user.\n\n :type user_name: string\n :param user_name: The name of the new user\n\n :type path: string\n :param path: The path in which the user will be created.\n Defaults to /.\n\n '
params = {'UserName': user_name, 'Path': path}
return self.get_response('CreateUser', params) | Create a user.
:type user_name: string
:param user_name: The name of the new user
:type path: string
:param path: The path in which the user will be created.
Defaults to /. | platform/gsutil/third_party/boto/boto/iam/connection.py | create_user | bopopescu/google-cloud-sdk | 15 | python | def create_user(self, user_name, path='/'):
'\n Create a user.\n\n :type user_name: string\n :param user_name: The name of the new user\n\n :type path: string\n :param path: The path in which the user will be created.\n Defaults to /.\n\n '
params = {'UserName': user_name, 'Path': path}
return self.get_response('CreateUser', params) | def create_user(self, user_name, path='/'):
'\n Create a user.\n\n :type user_name: string\n :param user_name: The name of the new user\n\n :type path: string\n :param path: The path in which the user will be created.\n Defaults to /.\n\n '
params = {'UserName': user_name, 'Path': path}
return self.get_response('CreateUser', params)<|docstring|>Create a user.
:type user_name: string
:param user_name: The name of the new user
:type path: string
:param path: The path in which the user will be created.
Defaults to /.<|endoftext|> |
ff5e7a273552700f4372303b2368c7caf318caca29e4cb884ada904141137f18 | def delete_user(self, user_name):
"\n Delete a user including the user's path, GUID and ARN.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The name of the user to delete.\n\n "
params = {'UserName': user_name}
return self.get_response('DeleteUser', params) | Delete a user including the user's path, GUID and ARN.
If the user_name is not specified, the user_name is determined
implicitly based on the AWS Access Key ID used to sign the request.
:type user_name: string
:param user_name: The name of the user to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_user | bopopescu/google-cloud-sdk | 15 | python | def delete_user(self, user_name):
"\n Delete a user including the user's path, GUID and ARN.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The name of the user to delete.\n\n "
params = {'UserName': user_name}
return self.get_response('DeleteUser', params) | def delete_user(self, user_name):
"\n Delete a user including the user's path, GUID and ARN.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The name of the user to delete.\n\n "
params = {'UserName': user_name}
return self.get_response('DeleteUser', params)<|docstring|>Delete a user including the user's path, GUID and ARN.
If the user_name is not specified, the user_name is determined
implicitly based on the AWS Access Key ID used to sign the request.
:type user_name: string
:param user_name: The name of the user to delete.<|endoftext|> |
ab669c7ecf9f96501d748ca135ee9dcb6a9b0c13e051cc13915f5002f8291927 | def get_user(self, user_name=None):
'\n Retrieve information about the specified user.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The name of the user to retrieve.\n If not specified, defaults to user making request.\n '
params = {}
if user_name:
params['UserName'] = user_name
return self.get_response('GetUser', params) | Retrieve information about the specified user.
If the user_name is not specified, the user_name is determined
implicitly based on the AWS Access Key ID used to sign the request.
:type user_name: string
:param user_name: The name of the user to retrieve.
If not specified, defaults to user making request. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_user | bopopescu/google-cloud-sdk | 15 | python | def get_user(self, user_name=None):
'\n Retrieve information about the specified user.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The name of the user to retrieve.\n If not specified, defaults to user making request.\n '
params = {}
if user_name:
params['UserName'] = user_name
return self.get_response('GetUser', params) | def get_user(self, user_name=None):
'\n Retrieve information about the specified user.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The name of the user to retrieve.\n If not specified, defaults to user making request.\n '
params = {}
if user_name:
params['UserName'] = user_name
return self.get_response('GetUser', params)<|docstring|>Retrieve information about the specified user.
If the user_name is not specified, the user_name is determined
implicitly based on the AWS Access Key ID used to sign the request.
:type user_name: string
:param user_name: The name of the user to retrieve.
If not specified, defaults to user making request.<|endoftext|> |
d7c5bf28bbe2478af28bb63e200facccdfd66fb65b54a779967fc33c2a81d605 | def update_user(self, user_name, new_user_name=None, new_path=None):
'\n Updates name and/or path of the specified user.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type new_user_name: string\n :param new_user_name: If provided, the username of the user will be\n changed to this username.\n\n :type new_path: string\n :param new_path: If provided, the path of the user will be\n changed to this path.\n\n '
params = {'UserName': user_name}
if new_user_name:
params['NewUserName'] = new_user_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateUser', params) | Updates name and/or path of the specified user.
:type user_name: string
:param user_name: The name of the user
:type new_user_name: string
:param new_user_name: If provided, the username of the user will be
changed to this username.
:type new_path: string
:param new_path: If provided, the path of the user will be
changed to this path. | platform/gsutil/third_party/boto/boto/iam/connection.py | update_user | bopopescu/google-cloud-sdk | 15 | python | def update_user(self, user_name, new_user_name=None, new_path=None):
'\n Updates name and/or path of the specified user.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type new_user_name: string\n :param new_user_name: If provided, the username of the user will be\n changed to this username.\n\n :type new_path: string\n :param new_path: If provided, the path of the user will be\n changed to this path.\n\n '
params = {'UserName': user_name}
if new_user_name:
params['NewUserName'] = new_user_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateUser', params) | def update_user(self, user_name, new_user_name=None, new_path=None):
'\n Updates name and/or path of the specified user.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type new_user_name: string\n :param new_user_name: If provided, the username of the user will be\n changed to this username.\n\n :type new_path: string\n :param new_path: If provided, the path of the user will be\n changed to this path.\n\n '
params = {'UserName': user_name}
if new_user_name:
params['NewUserName'] = new_user_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateUser', params)<|docstring|>Updates name and/or path of the specified user.
:type user_name: string
:param user_name: The name of the user
:type new_user_name: string
:param new_user_name: If provided, the username of the user will be
changed to this username.
:type new_path: string
:param new_path: If provided, the path of the user will be
changed to this path.<|endoftext|> |
208e5456d0fd34551a96c122d4d3765c626ac7e492ccbf56f662cb97b9a1eb0b | def get_all_user_policies(self, user_name, marker=None, max_items=None):
"\n List the names of the policies associated with the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListUserPolicies', params, list_marker='PolicyNames') | List the names of the policies associated with the specified user.
:type user_name: string
:param user_name: The name of the user the policy is associated with.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_all_user_policies | bopopescu/google-cloud-sdk | 15 | python | def get_all_user_policies(self, user_name, marker=None, max_items=None):
"\n List the names of the policies associated with the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListUserPolicies', params, list_marker='PolicyNames') | def get_all_user_policies(self, user_name, marker=None, max_items=None):
"\n List the names of the policies associated with the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListUserPolicies', params, list_marker='PolicyNames')<|docstring|>List the names of the policies associated with the specified user.
:type user_name: string
:param user_name: The name of the user the policy is associated with.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
add2683580a950e2fc33150af0258a1b34dcae0ca9d7a6c5407d1d8abf14d4cb | def put_user_policy(self, user_name, policy_name, policy_json):
'\n Adds or updates the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n :type policy_json: string\n :param policy_json: The policy document.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name, 'PolicyDocument': policy_json}
return self.get_response('PutUserPolicy', params, verb='POST') | Adds or updates the specified policy document for the specified user.
:type user_name: string
:param user_name: The name of the user the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to get.
:type policy_json: string
:param policy_json: The policy document. | platform/gsutil/third_party/boto/boto/iam/connection.py | put_user_policy | bopopescu/google-cloud-sdk | 15 | python | def put_user_policy(self, user_name, policy_name, policy_json):
'\n Adds or updates the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n :type policy_json: string\n :param policy_json: The policy document.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name, 'PolicyDocument': policy_json}
return self.get_response('PutUserPolicy', params, verb='POST') | def put_user_policy(self, user_name, policy_name, policy_json):
'\n Adds or updates the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n :type policy_json: string\n :param policy_json: The policy document.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name, 'PolicyDocument': policy_json}
return self.get_response('PutUserPolicy', params, verb='POST')<|docstring|>Adds or updates the specified policy document for the specified user.
:type user_name: string
:param user_name: The name of the user the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to get.
:type policy_json: string
:param policy_json: The policy document.<|endoftext|> |
81369918661ddd658624ef59b3c156421a68904dd98102ccbe82e19c7c6a6088 | def get_user_policy(self, user_name, policy_name):
'\n Retrieves the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name}
return self.get_response('GetUserPolicy', params, verb='POST') | Retrieves the specified policy document for the specified user.
:type user_name: string
:param user_name: The name of the user the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to get. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_user_policy | bopopescu/google-cloud-sdk | 15 | python | def get_user_policy(self, user_name, policy_name):
'\n Retrieves the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name}
return self.get_response('GetUserPolicy', params, verb='POST') | def get_user_policy(self, user_name, policy_name):
'\n Retrieves the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to get.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name}
return self.get_response('GetUserPolicy', params, verb='POST')<|docstring|>Retrieves the specified policy document for the specified user.
:type user_name: string
:param user_name: The name of the user the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to get.<|endoftext|> |
c49cbae5179228b4cf1bfd7e33157a5ff4b6df4c57e04c68e5b361404d7e4c1a | def delete_user_policy(self, user_name, policy_name):
'\n Deletes the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to delete.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name}
return self.get_response('DeleteUserPolicy', params, verb='POST') | Deletes the specified policy document for the specified user.
:type user_name: string
:param user_name: The name of the user the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_user_policy | bopopescu/google-cloud-sdk | 15 | python | def delete_user_policy(self, user_name, policy_name):
'\n Deletes the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to delete.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name}
return self.get_response('DeleteUserPolicy', params, verb='POST') | def delete_user_policy(self, user_name, policy_name):
'\n Deletes the specified policy document for the specified user.\n\n :type user_name: string\n :param user_name: The name of the user the policy is associated with.\n\n :type policy_name: string\n :param policy_name: The policy document to delete.\n\n '
params = {'UserName': user_name, 'PolicyName': policy_name}
return self.get_response('DeleteUserPolicy', params, verb='POST')<|docstring|>Deletes the specified policy document for the specified user.
:type user_name: string
:param user_name: The name of the user the policy is associated with.
:type policy_name: string
:param policy_name: The policy document to delete.<|endoftext|> |
70ac5924c6aa5c5dfd83cd9c00bed4d8ad53c1ae643348bbab326cb80bbcab82 | def get_groups_for_user(self, user_name, marker=None, max_items=None):
"\n List the groups that a specified user belongs to.\n\n :type user_name: string\n :param user_name: The name of the user to list groups for.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroupsForUser', params, list_marker='Groups') | List the groups that a specified user belongs to.
:type user_name: string
:param user_name: The name of the user to list groups for.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_groups_for_user | bopopescu/google-cloud-sdk | 15 | python | def get_groups_for_user(self, user_name, marker=None, max_items=None):
"\n List the groups that a specified user belongs to.\n\n :type user_name: string\n :param user_name: The name of the user to list groups for.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroupsForUser', params, list_marker='Groups') | def get_groups_for_user(self, user_name, marker=None, max_items=None):
"\n List the groups that a specified user belongs to.\n\n :type user_name: string\n :param user_name: The name of the user to list groups for.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListGroupsForUser', params, list_marker='Groups')<|docstring|>List the groups that a specified user belongs to.
:type user_name: string
:param user_name: The name of the user to list groups for.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
3db6e115c323c383a6799f34e48a0b49b487315b8a316492a8750b8db3ef1f2a | def get_all_access_keys(self, user_name, marker=None, max_items=None):
"\n Get all access keys associated with an account.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListAccessKeys', params, list_marker='AccessKeyMetadata') | Get all access keys associated with an account.
:type user_name: string
:param user_name: The username of the user
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_all_access_keys | bopopescu/google-cloud-sdk | 15 | python | def get_all_access_keys(self, user_name, marker=None, max_items=None):
"\n Get all access keys associated with an account.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListAccessKeys', params, list_marker='AccessKeyMetadata') | def get_all_access_keys(self, user_name, marker=None, max_items=None):
"\n Get all access keys associated with an account.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListAccessKeys', params, list_marker='AccessKeyMetadata')<|docstring|>Get all access keys associated with an account.
:type user_name: string
:param user_name: The username of the user
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
459488bc06cfdf14b3c62c99e26a2b52748ec756dd9c61517bee08c6d0d77842 | def create_access_key(self, user_name=None):
'\n Create a new AWS Secret Access Key and corresponding AWS Access Key ID\n for the specified user. The default status for new keys is Active\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'UserName': user_name}
return self.get_response('CreateAccessKey', params) | Create a new AWS Secret Access Key and corresponding AWS Access Key ID
for the specified user. The default status for new keys is Active
If the user_name is not specified, the user_name is determined
implicitly based on the AWS Access Key ID used to sign the request.
:type user_name: string
:param user_name: The username of the user | platform/gsutil/third_party/boto/boto/iam/connection.py | create_access_key | bopopescu/google-cloud-sdk | 15 | python | def create_access_key(self, user_name=None):
'\n Create a new AWS Secret Access Key and corresponding AWS Access Key ID\n for the specified user. The default status for new keys is Active\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'UserName': user_name}
return self.get_response('CreateAccessKey', params) | def create_access_key(self, user_name=None):
'\n Create a new AWS Secret Access Key and corresponding AWS Access Key ID\n for the specified user. The default status for new keys is Active\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'UserName': user_name}
return self.get_response('CreateAccessKey', params)<|docstring|>Create a new AWS Secret Access Key and corresponding AWS Access Key ID
for the specified user. The default status for new keys is Active
If the user_name is not specified, the user_name is determined
implicitly based on the AWS Access Key ID used to sign the request.
:type user_name: string
:param user_name: The username of the user<|endoftext|> |
20f614d3e402b07259577533352ddbe1881937f69527f7d19a39b6657163b8e4 | def update_access_key(self, access_key_id, status, user_name=None):
"\n Changes the status of the specified access key from Active to Inactive\n or vice versa. This action can be used to disable a user's key as\n part of a key rotation workflow.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type access_key_id: string\n :param access_key_id: The ID of the access key.\n\n :type status: string\n :param status: Either Active or Inactive.\n\n :type user_name: string\n :param user_name: The username of user (optional).\n\n "
params = {'AccessKeyId': access_key_id, 'Status': status}
if user_name:
params['UserName'] = user_name
return self.get_response('UpdateAccessKey', params) | Changes the status of the specified access key from Active to Inactive
or vice versa. This action can be used to disable a user's key as
part of a key rotation workflow.
If the user_name is not specified, the user_name is determined
implicitly based on the AWS Access Key ID used to sign the request.
:type access_key_id: string
:param access_key_id: The ID of the access key.
:type status: string
:param status: Either Active or Inactive.
:type user_name: string
:param user_name: The username of user (optional). | platform/gsutil/third_party/boto/boto/iam/connection.py | update_access_key | bopopescu/google-cloud-sdk | 15 | python | def update_access_key(self, access_key_id, status, user_name=None):
"\n Changes the status of the specified access key from Active to Inactive\n or vice versa. This action can be used to disable a user's key as\n part of a key rotation workflow.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type access_key_id: string\n :param access_key_id: The ID of the access key.\n\n :type status: string\n :param status: Either Active or Inactive.\n\n :type user_name: string\n :param user_name: The username of user (optional).\n\n "
params = {'AccessKeyId': access_key_id, 'Status': status}
if user_name:
params['UserName'] = user_name
return self.get_response('UpdateAccessKey', params) | def update_access_key(self, access_key_id, status, user_name=None):
"\n Changes the status of the specified access key from Active to Inactive\n or vice versa. This action can be used to disable a user's key as\n part of a key rotation workflow.\n\n If the user_name is not specified, the user_name is determined\n implicitly based on the AWS Access Key ID used to sign the request.\n\n :type access_key_id: string\n :param access_key_id: The ID of the access key.\n\n :type status: string\n :param status: Either Active or Inactive.\n\n :type user_name: string\n :param user_name: The username of user (optional).\n\n "
params = {'AccessKeyId': access_key_id, 'Status': status}
if user_name:
params['UserName'] = user_name
return self.get_response('UpdateAccessKey', params)<|docstring|>Changes the status of the specified access key from Active to Inactive
or vice versa. This action can be used to disable a user's key as
part of a key rotation workflow.
If the user_name is not specified, the user_name is determined
implicitly based on the AWS Access Key ID used to sign the request.
:type access_key_id: string
:param access_key_id: The ID of the access key.
:type status: string
:param status: Either Active or Inactive.
:type user_name: string
:param user_name: The username of user (optional).<|endoftext|> |
8686afb78ce443965aa03d9ba76bf32aa6e128382a41c8950af87fad390bc0a1 | def delete_access_key(self, access_key_id, user_name=None):
'\n Delete an access key associated with a user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type access_key_id: string\n :param access_key_id: The ID of the access key to be deleted.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'AccessKeyId': access_key_id}
if user_name:
params['UserName'] = user_name
return self.get_response('DeleteAccessKey', params) | Delete an access key associated with a user.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type access_key_id: string
:param access_key_id: The ID of the access key to be deleted.
:type user_name: string
:param user_name: The username of the user | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_access_key | bopopescu/google-cloud-sdk | 15 | python | def delete_access_key(self, access_key_id, user_name=None):
'\n Delete an access key associated with a user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type access_key_id: string\n :param access_key_id: The ID of the access key to be deleted.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'AccessKeyId': access_key_id}
if user_name:
params['UserName'] = user_name
return self.get_response('DeleteAccessKey', params) | def delete_access_key(self, access_key_id, user_name=None):
'\n Delete an access key associated with a user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type access_key_id: string\n :param access_key_id: The ID of the access key to be deleted.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'AccessKeyId': access_key_id}
if user_name:
params['UserName'] = user_name
return self.get_response('DeleteAccessKey', params)<|docstring|>Delete an access key associated with a user.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type access_key_id: string
:param access_key_id: The ID of the access key to be deleted.
:type user_name: string
:param user_name: The username of the user<|endoftext|> |
b16956c90a4a60d02ebbca3d52b756d12cb1350ecbfff80bdebb8108c7bcbc99 | def get_all_signing_certs(self, marker=None, max_items=None, user_name=None):
"\n Get all signing certificates associated with an account.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n :type user_name: string\n :param user_name: The username of the user\n\n "
params = {}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
if user_name:
params['UserName'] = user_name
return self.get_response('ListSigningCertificates', params, list_marker='Certificates') | Get all signing certificates associated with an account.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.
:type user_name: string
:param user_name: The username of the user | platform/gsutil/third_party/boto/boto/iam/connection.py | get_all_signing_certs | bopopescu/google-cloud-sdk | 15 | python | def get_all_signing_certs(self, marker=None, max_items=None, user_name=None):
"\n Get all signing certificates associated with an account.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n :type user_name: string\n :param user_name: The username of the user\n\n "
params = {}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
if user_name:
params['UserName'] = user_name
return self.get_response('ListSigningCertificates', params, list_marker='Certificates') | def get_all_signing_certs(self, marker=None, max_items=None, user_name=None):
"\n Get all signing certificates associated with an account.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n :type user_name: string\n :param user_name: The username of the user\n\n "
params = {}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
if user_name:
params['UserName'] = user_name
return self.get_response('ListSigningCertificates', params, list_marker='Certificates')<|docstring|>Get all signing certificates associated with an account.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.
:type user_name: string
:param user_name: The username of the user<|endoftext|> |
dd8248e87f0a8dbc8256fd109c444ea99f937a405815ef40ffa31799ce366bd8 | def update_signing_cert(self, cert_id, status, user_name=None):
'\n Change the status of the specified signing certificate from\n Active to Inactive or vice versa.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type cert_id: string\n :param cert_id: The ID of the signing certificate\n\n :type status: string\n :param status: Either Active or Inactive.\n\n :type user_name: string\n :param user_name: The username of the user\n '
params = {'CertificateId': cert_id, 'Status': status}
if user_name:
params['UserName'] = user_name
return self.get_response('UpdateSigningCertificate', params) | Change the status of the specified signing certificate from
Active to Inactive or vice versa.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type cert_id: string
:param cert_id: The ID of the signing certificate
:type status: string
:param status: Either Active or Inactive.
:type user_name: string
:param user_name: The username of the user | platform/gsutil/third_party/boto/boto/iam/connection.py | update_signing_cert | bopopescu/google-cloud-sdk | 15 | python | def update_signing_cert(self, cert_id, status, user_name=None):
'\n Change the status of the specified signing certificate from\n Active to Inactive or vice versa.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type cert_id: string\n :param cert_id: The ID of the signing certificate\n\n :type status: string\n :param status: Either Active or Inactive.\n\n :type user_name: string\n :param user_name: The username of the user\n '
params = {'CertificateId': cert_id, 'Status': status}
if user_name:
params['UserName'] = user_name
return self.get_response('UpdateSigningCertificate', params) | def update_signing_cert(self, cert_id, status, user_name=None):
'\n Change the status of the specified signing certificate from\n Active to Inactive or vice versa.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type cert_id: string\n :param cert_id: The ID of the signing certificate\n\n :type status: string\n :param status: Either Active or Inactive.\n\n :type user_name: string\n :param user_name: The username of the user\n '
params = {'CertificateId': cert_id, 'Status': status}
if user_name:
params['UserName'] = user_name
return self.get_response('UpdateSigningCertificate', params)<|docstring|>Change the status of the specified signing certificate from
Active to Inactive or vice versa.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type cert_id: string
:param cert_id: The ID of the signing certificate
:type status: string
:param status: Either Active or Inactive.
:type user_name: string
:param user_name: The username of the user<|endoftext|> |
a428070129cb4cd06072d2f10f4d0efefa24cda06044e8034bdf3e4a71beba3f | def upload_signing_cert(self, cert_body, user_name=None):
'\n Uploads an X.509 signing certificate and associates it with\n the specified user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type cert_body: string\n :param cert_body: The body of the signing certificate.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'CertificateBody': cert_body}
if user_name:
params['UserName'] = user_name
return self.get_response('UploadSigningCertificate', params, verb='POST') | Uploads an X.509 signing certificate and associates it with
the specified user.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type cert_body: string
:param cert_body: The body of the signing certificate.
:type user_name: string
:param user_name: The username of the user | platform/gsutil/third_party/boto/boto/iam/connection.py | upload_signing_cert | bopopescu/google-cloud-sdk | 15 | python | def upload_signing_cert(self, cert_body, user_name=None):
'\n Uploads an X.509 signing certificate and associates it with\n the specified user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type cert_body: string\n :param cert_body: The body of the signing certificate.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'CertificateBody': cert_body}
if user_name:
params['UserName'] = user_name
return self.get_response('UploadSigningCertificate', params, verb='POST') | def upload_signing_cert(self, cert_body, user_name=None):
'\n Uploads an X.509 signing certificate and associates it with\n the specified user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type cert_body: string\n :param cert_body: The body of the signing certificate.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'CertificateBody': cert_body}
if user_name:
params['UserName'] = user_name
return self.get_response('UploadSigningCertificate', params, verb='POST')<|docstring|>Uploads an X.509 signing certificate and associates it with
the specified user.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type cert_body: string
:param cert_body: The body of the signing certificate.
:type user_name: string
:param user_name: The username of the user<|endoftext|> |
34bdd82abf2afd9e9ad980f1fbe3b637a75ffad04f6b3cc49fd19e4fbb8f352c | def delete_signing_cert(self, cert_id, user_name=None):
'\n Delete a signing certificate associated with a user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type cert_id: string\n :param cert_id: The ID of the certificate.\n\n '
params = {'CertificateId': cert_id}
if user_name:
params['UserName'] = user_name
return self.get_response('DeleteSigningCertificate', params) | Delete a signing certificate associated with a user.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type user_name: string
:param user_name: The username of the user
:type cert_id: string
:param cert_id: The ID of the certificate. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_signing_cert | bopopescu/google-cloud-sdk | 15 | python | def delete_signing_cert(self, cert_id, user_name=None):
'\n Delete a signing certificate associated with a user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type cert_id: string\n :param cert_id: The ID of the certificate.\n\n '
params = {'CertificateId': cert_id}
if user_name:
params['UserName'] = user_name
return self.get_response('DeleteSigningCertificate', params) | def delete_signing_cert(self, cert_id, user_name=None):
'\n Delete a signing certificate associated with a user.\n\n If the user_name is not specified, it is determined implicitly based\n on the AWS Access Key ID used to sign the request.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type cert_id: string\n :param cert_id: The ID of the certificate.\n\n '
params = {'CertificateId': cert_id}
if user_name:
params['UserName'] = user_name
return self.get_response('DeleteSigningCertificate', params)<|docstring|>Delete a signing certificate associated with a user.
If the user_name is not specified, it is determined implicitly based
on the AWS Access Key ID used to sign the request.
:type user_name: string
:param user_name: The username of the user
:type cert_id: string
:param cert_id: The ID of the certificate.<|endoftext|> |
dc1cea8a75c36b545a401037fd56a003f01344d15bcab6399ccbb84ea0b593d7 | def list_server_certs(self, path_prefix='/', marker=None, max_items=None):
"\n Lists the server certificates that have the specified path prefix.\n If none exist, the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: If provided, only certificates whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n "
params = {}
if path_prefix:
params['PathPrefix'] = path_prefix
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListServerCertificates', params, list_marker='ServerCertificateMetadataList') | Lists the server certificates that have the specified path prefix.
If none exist, the action returns an empty list.
:type path_prefix: string
:param path_prefix: If provided, only certificates whose paths match
the provided prefix will be returned.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | list_server_certs | bopopescu/google-cloud-sdk | 15 | python | def list_server_certs(self, path_prefix='/', marker=None, max_items=None):
"\n Lists the server certificates that have the specified path prefix.\n If none exist, the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: If provided, only certificates whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n "
params = {}
if path_prefix:
params['PathPrefix'] = path_prefix
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListServerCertificates', params, list_marker='ServerCertificateMetadataList') | def list_server_certs(self, path_prefix='/', marker=None, max_items=None):
"\n Lists the server certificates that have the specified path prefix.\n If none exist, the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: If provided, only certificates whose paths match\n the provided prefix will be returned.\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n "
params = {}
if path_prefix:
params['PathPrefix'] = path_prefix
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListServerCertificates', params, list_marker='ServerCertificateMetadataList')<|docstring|>Lists the server certificates that have the specified path prefix.
If none exist, the action returns an empty list.
:type path_prefix: string
:param path_prefix: If provided, only certificates whose paths match
the provided prefix will be returned.
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
3dce1359f516b4ec51bafd8b33da530d1db045b14198688790f190b4b8df322f | def update_server_cert(self, cert_name, new_cert_name=None, new_path=None):
"\n Updates the name and/or the path of the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate that you want\n to update.\n\n :type new_cert_name: string\n :param new_cert_name: The new name for the server certificate.\n Include this only if you are updating the\n server certificate's name.\n\n :type new_path: string\n :param new_path: If provided, the path of the certificate will be\n changed to this path.\n "
params = {'ServerCertificateName': cert_name}
if new_cert_name:
params['NewServerCertificateName'] = new_cert_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateServerCertificate', params) | Updates the name and/or the path of the specified server certificate.
:type cert_name: string
:param cert_name: The name of the server certificate that you want
to update.
:type new_cert_name: string
:param new_cert_name: The new name for the server certificate.
Include this only if you are updating the
server certificate's name.
:type new_path: string
:param new_path: If provided, the path of the certificate will be
changed to this path. | platform/gsutil/third_party/boto/boto/iam/connection.py | update_server_cert | bopopescu/google-cloud-sdk | 15 | python | def update_server_cert(self, cert_name, new_cert_name=None, new_path=None):
"\n Updates the name and/or the path of the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate that you want\n to update.\n\n :type new_cert_name: string\n :param new_cert_name: The new name for the server certificate.\n Include this only if you are updating the\n server certificate's name.\n\n :type new_path: string\n :param new_path: If provided, the path of the certificate will be\n changed to this path.\n "
params = {'ServerCertificateName': cert_name}
if new_cert_name:
params['NewServerCertificateName'] = new_cert_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateServerCertificate', params) | def update_server_cert(self, cert_name, new_cert_name=None, new_path=None):
"\n Updates the name and/or the path of the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate that you want\n to update.\n\n :type new_cert_name: string\n :param new_cert_name: The new name for the server certificate.\n Include this only if you are updating the\n server certificate's name.\n\n :type new_path: string\n :param new_path: If provided, the path of the certificate will be\n changed to this path.\n "
params = {'ServerCertificateName': cert_name}
if new_cert_name:
params['NewServerCertificateName'] = new_cert_name
if new_path:
params['NewPath'] = new_path
return self.get_response('UpdateServerCertificate', params)<|docstring|>Updates the name and/or the path of the specified server certificate.
:type cert_name: string
:param cert_name: The name of the server certificate that you want
to update.
:type new_cert_name: string
:param new_cert_name: The new name for the server certificate.
Include this only if you are updating the
server certificate's name.
:type new_path: string
:param new_path: If provided, the path of the certificate will be
changed to this path.<|endoftext|> |
093c050a52dff79ac043e04db84cc9c5ec4b6630ebaaa4f231c9e6cd0992ebf4 | def upload_server_cert(self, cert_name, cert_body, private_key, cert_chain=None, path=None):
'\n Uploads a server certificate entity for the AWS Account.\n The server certificate entity includes a public key certificate,\n a private key, and an optional certificate chain, which should\n all be PEM-encoded.\n\n :type cert_name: string\n :param cert_name: The name for the server certificate. Do not\n include the path in this value.\n\n :type cert_body: string\n :param cert_body: The contents of the public key certificate\n in PEM-encoded format.\n\n :type private_key: string\n :param private_key: The contents of the private key in\n PEM-encoded format.\n\n :type cert_chain: string\n :param cert_chain: The contents of the certificate chain. This\n is typically a concatenation of the PEM-encoded\n public key certificates of the chain.\n\n :type path: string\n :param path: The path for the server certificate.\n '
params = {'ServerCertificateName': cert_name, 'CertificateBody': cert_body, 'PrivateKey': private_key}
if cert_chain:
params['CertificateChain'] = cert_chain
if path:
params['Path'] = path
return self.get_response('UploadServerCertificate', params, verb='POST') | Uploads a server certificate entity for the AWS Account.
The server certificate entity includes a public key certificate,
a private key, and an optional certificate chain, which should
all be PEM-encoded.
:type cert_name: string
:param cert_name: The name for the server certificate. Do not
include the path in this value.
:type cert_body: string
:param cert_body: The contents of the public key certificate
in PEM-encoded format.
:type private_key: string
:param private_key: The contents of the private key in
PEM-encoded format.
:type cert_chain: string
:param cert_chain: The contents of the certificate chain. This
is typically a concatenation of the PEM-encoded
public key certificates of the chain.
:type path: string
:param path: The path for the server certificate. | platform/gsutil/third_party/boto/boto/iam/connection.py | upload_server_cert | bopopescu/google-cloud-sdk | 15 | python | def upload_server_cert(self, cert_name, cert_body, private_key, cert_chain=None, path=None):
'\n Uploads a server certificate entity for the AWS Account.\n The server certificate entity includes a public key certificate,\n a private key, and an optional certificate chain, which should\n all be PEM-encoded.\n\n :type cert_name: string\n :param cert_name: The name for the server certificate. Do not\n include the path in this value.\n\n :type cert_body: string\n :param cert_body: The contents of the public key certificate\n in PEM-encoded format.\n\n :type private_key: string\n :param private_key: The contents of the private key in\n PEM-encoded format.\n\n :type cert_chain: string\n :param cert_chain: The contents of the certificate chain. This\n is typically a concatenation of the PEM-encoded\n public key certificates of the chain.\n\n :type path: string\n :param path: The path for the server certificate.\n '
params = {'ServerCertificateName': cert_name, 'CertificateBody': cert_body, 'PrivateKey': private_key}
if cert_chain:
params['CertificateChain'] = cert_chain
if path:
params['Path'] = path
return self.get_response('UploadServerCertificate', params, verb='POST') | def upload_server_cert(self, cert_name, cert_body, private_key, cert_chain=None, path=None):
'\n Uploads a server certificate entity for the AWS Account.\n The server certificate entity includes a public key certificate,\n a private key, and an optional certificate chain, which should\n all be PEM-encoded.\n\n :type cert_name: string\n :param cert_name: The name for the server certificate. Do not\n include the path in this value.\n\n :type cert_body: string\n :param cert_body: The contents of the public key certificate\n in PEM-encoded format.\n\n :type private_key: string\n :param private_key: The contents of the private key in\n PEM-encoded format.\n\n :type cert_chain: string\n :param cert_chain: The contents of the certificate chain. This\n is typically a concatenation of the PEM-encoded\n public key certificates of the chain.\n\n :type path: string\n :param path: The path for the server certificate.\n '
params = {'ServerCertificateName': cert_name, 'CertificateBody': cert_body, 'PrivateKey': private_key}
if cert_chain:
params['CertificateChain'] = cert_chain
if path:
params['Path'] = path
return self.get_response('UploadServerCertificate', params, verb='POST')<|docstring|>Uploads a server certificate entity for the AWS Account.
The server certificate entity includes a public key certificate,
a private key, and an optional certificate chain, which should
all be PEM-encoded.
:type cert_name: string
:param cert_name: The name for the server certificate. Do not
include the path in this value.
:type cert_body: string
:param cert_body: The contents of the public key certificate
in PEM-encoded format.
:type private_key: string
:param private_key: The contents of the private key in
PEM-encoded format.
:type cert_chain: string
:param cert_chain: The contents of the certificate chain. This
is typically a concatenation of the PEM-encoded
public key certificates of the chain.
:type path: string
:param path: The path for the server certificate.<|endoftext|> |
b292aeb68b2ab559a8239b52cbc85ff3d7c0122ea4e38123e69f74e601ba78c6 | def get_server_certificate(self, cert_name):
'\n Retrieves information about the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate you want\n to retrieve information about.\n\n '
params = {'ServerCertificateName': cert_name}
return self.get_response('GetServerCertificate', params) | Retrieves information about the specified server certificate.
:type cert_name: string
:param cert_name: The name of the server certificate you want
to retrieve information about. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_server_certificate | bopopescu/google-cloud-sdk | 15 | python | def get_server_certificate(self, cert_name):
'\n Retrieves information about the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate you want\n to retrieve information about.\n\n '
params = {'ServerCertificateName': cert_name}
return self.get_response('GetServerCertificate', params) | def get_server_certificate(self, cert_name):
'\n Retrieves information about the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate you want\n to retrieve information about.\n\n '
params = {'ServerCertificateName': cert_name}
return self.get_response('GetServerCertificate', params)<|docstring|>Retrieves information about the specified server certificate.
:type cert_name: string
:param cert_name: The name of the server certificate you want
to retrieve information about.<|endoftext|> |
a70c23a8f4d8ea2b47797938f5c900c328cc393996937b40720bc33f671d42d6 | def delete_server_cert(self, cert_name):
'\n Delete the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate you want\n to delete.\n\n '
params = {'ServerCertificateName': cert_name}
return self.get_response('DeleteServerCertificate', params) | Delete the specified server certificate.
:type cert_name: string
:param cert_name: The name of the server certificate you want
to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_server_cert | bopopescu/google-cloud-sdk | 15 | python | def delete_server_cert(self, cert_name):
'\n Delete the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate you want\n to delete.\n\n '
params = {'ServerCertificateName': cert_name}
return self.get_response('DeleteServerCertificate', params) | def delete_server_cert(self, cert_name):
'\n Delete the specified server certificate.\n\n :type cert_name: string\n :param cert_name: The name of the server certificate you want\n to delete.\n\n '
params = {'ServerCertificateName': cert_name}
return self.get_response('DeleteServerCertificate', params)<|docstring|>Delete the specified server certificate.
:type cert_name: string
:param cert_name: The name of the server certificate you want
to delete.<|endoftext|> |
6d62d7056d3ffab41c7f7700badbf91f5ba82a6de8d56c6ddeb70833a71d43a6 | def get_all_mfa_devices(self, user_name, marker=None, max_items=None):
"\n Get all MFA devices associated with an account.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListMFADevices', params, list_marker='MFADevices') | Get all MFA devices associated with an account.
:type user_name: string
:param user_name: The username of the user
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_all_mfa_devices | bopopescu/google-cloud-sdk | 15 | python | def get_all_mfa_devices(self, user_name, marker=None, max_items=None):
"\n Get all MFA devices associated with an account.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListMFADevices', params, list_marker='MFADevices') | def get_all_mfa_devices(self, user_name, marker=None, max_items=None):
"\n Get all MFA devices associated with an account.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type marker: string\n :param marker: Use this only when paginating results and only\n in follow-up request after you've received a response\n where the results are truncated. Set this to the value of\n the Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this only when paginating results to indicate\n the maximum number of groups you want in the response.\n\n "
params = {'UserName': user_name}
if marker:
params['Marker'] = marker
if max_items:
params['MaxItems'] = max_items
return self.get_response('ListMFADevices', params, list_marker='MFADevices')<|docstring|>Get all MFA devices associated with an account.
:type user_name: string
:param user_name: The username of the user
:type marker: string
:param marker: Use this only when paginating results and only
in follow-up request after you've received a response
where the results are truncated. Set this to the value of
the Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results to indicate
the maximum number of groups you want in the response.<|endoftext|> |
2424896e3bc4760047286a8105ecc76503651d3782f7ffb1617b74b3ce66025d | def enable_mfa_device(self, user_name, serial_number, auth_code_1, auth_code_2):
'\n Enables the specified MFA device and associates it with the\n specified user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n :type auth_code_1: string\n :param auth_code_1: An authentication code emitted by the device.\n\n :type auth_code_2: string\n :param auth_code_2: A subsequent authentication code emitted\n by the device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number, 'AuthenticationCode1': auth_code_1, 'AuthenticationCode2': auth_code_2}
return self.get_response('EnableMFADevice', params) | Enables the specified MFA device and associates it with the
specified user.
:type user_name: string
:param user_name: The username of the user
:type serial_number: string
:param serial_number: The serial number which uniquely identifies
the MFA device.
:type auth_code_1: string
:param auth_code_1: An authentication code emitted by the device.
:type auth_code_2: string
:param auth_code_2: A subsequent authentication code emitted
by the device. | platform/gsutil/third_party/boto/boto/iam/connection.py | enable_mfa_device | bopopescu/google-cloud-sdk | 15 | python | def enable_mfa_device(self, user_name, serial_number, auth_code_1, auth_code_2):
'\n Enables the specified MFA device and associates it with the\n specified user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n :type auth_code_1: string\n :param auth_code_1: An authentication code emitted by the device.\n\n :type auth_code_2: string\n :param auth_code_2: A subsequent authentication code emitted\n by the device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number, 'AuthenticationCode1': auth_code_1, 'AuthenticationCode2': auth_code_2}
return self.get_response('EnableMFADevice', params) | def enable_mfa_device(self, user_name, serial_number, auth_code_1, auth_code_2):
'\n Enables the specified MFA device and associates it with the\n specified user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n :type auth_code_1: string\n :param auth_code_1: An authentication code emitted by the device.\n\n :type auth_code_2: string\n :param auth_code_2: A subsequent authentication code emitted\n by the device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number, 'AuthenticationCode1': auth_code_1, 'AuthenticationCode2': auth_code_2}
return self.get_response('EnableMFADevice', params)<|docstring|>Enables the specified MFA device and associates it with the
specified user.
:type user_name: string
:param user_name: The username of the user
:type serial_number: string
:param serial_number: The serial number which uniquely identifies
the MFA device.
:type auth_code_1: string
:param auth_code_1: An authentication code emitted by the device.
:type auth_code_2: string
:param auth_code_2: A subsequent authentication code emitted
by the device.<|endoftext|> |
f875d8219b07f8bb5b8c23457848d8ffadd8bc403ec1541f2349e316c37b7d8c | def deactivate_mfa_device(self, user_name, serial_number):
'\n Deactivates the specified MFA device and removes it from\n association with the user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number}
return self.get_response('DeactivateMFADevice', params) | Deactivates the specified MFA device and removes it from
association with the user.
:type user_name: string
:param user_name: The username of the user
:type serial_number: string
:param serial_number: The serial number which uniquely identifies
the MFA device. | platform/gsutil/third_party/boto/boto/iam/connection.py | deactivate_mfa_device | bopopescu/google-cloud-sdk | 15 | python | def deactivate_mfa_device(self, user_name, serial_number):
'\n Deactivates the specified MFA device and removes it from\n association with the user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number}
return self.get_response('DeactivateMFADevice', params) | def deactivate_mfa_device(self, user_name, serial_number):
'\n Deactivates the specified MFA device and removes it from\n association with the user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number}
return self.get_response('DeactivateMFADevice', params)<|docstring|>Deactivates the specified MFA device and removes it from
association with the user.
:type user_name: string
:param user_name: The username of the user
:type serial_number: string
:param serial_number: The serial number which uniquely identifies
the MFA device.<|endoftext|> |
8b146eb13fced89831de6f721a9e7725ab6d23bee30375d9b64093746d4be166 | def resync_mfa_device(self, user_name, serial_number, auth_code_1, auth_code_2):
'\n Syncronizes the specified MFA device with the AWS servers.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n :type auth_code_1: string\n :param auth_code_1: An authentication code emitted by the device.\n\n :type auth_code_2: string\n :param auth_code_2: A subsequent authentication code emitted\n by the device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number, 'AuthenticationCode1': auth_code_1, 'AuthenticationCode2': auth_code_2}
return self.get_response('ResyncMFADevice', params) | Syncronizes the specified MFA device with the AWS servers.
:type user_name: string
:param user_name: The username of the user
:type serial_number: string
:param serial_number: The serial number which uniquely identifies
the MFA device.
:type auth_code_1: string
:param auth_code_1: An authentication code emitted by the device.
:type auth_code_2: string
:param auth_code_2: A subsequent authentication code emitted
by the device. | platform/gsutil/third_party/boto/boto/iam/connection.py | resync_mfa_device | bopopescu/google-cloud-sdk | 15 | python | def resync_mfa_device(self, user_name, serial_number, auth_code_1, auth_code_2):
'\n Syncronizes the specified MFA device with the AWS servers.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n :type auth_code_1: string\n :param auth_code_1: An authentication code emitted by the device.\n\n :type auth_code_2: string\n :param auth_code_2: A subsequent authentication code emitted\n by the device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number, 'AuthenticationCode1': auth_code_1, 'AuthenticationCode2': auth_code_2}
return self.get_response('ResyncMFADevice', params) | def resync_mfa_device(self, user_name, serial_number, auth_code_1, auth_code_2):
'\n Syncronizes the specified MFA device with the AWS servers.\n\n :type user_name: string\n :param user_name: The username of the user\n\n :type serial_number: string\n :param serial_number: The serial number which uniquely identifies\n the MFA device.\n\n :type auth_code_1: string\n :param auth_code_1: An authentication code emitted by the device.\n\n :type auth_code_2: string\n :param auth_code_2: A subsequent authentication code emitted\n by the device.\n\n '
params = {'UserName': user_name, 'SerialNumber': serial_number, 'AuthenticationCode1': auth_code_1, 'AuthenticationCode2': auth_code_2}
return self.get_response('ResyncMFADevice', params)<|docstring|>Syncronizes the specified MFA device with the AWS servers.
:type user_name: string
:param user_name: The username of the user
:type serial_number: string
:param serial_number: The serial number which uniquely identifies
the MFA device.
:type auth_code_1: string
:param auth_code_1: An authentication code emitted by the device.
:type auth_code_2: string
:param auth_code_2: A subsequent authentication code emitted
by the device.<|endoftext|> |
810b38e732ea2b6de0803d871aa720ccff8d68aad6c3b862894f2e17c8f1f870 | def get_login_profiles(self, user_name):
'\n Retrieves the login profile for the specified user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'UserName': user_name}
return self.get_response('GetLoginProfile', params) | Retrieves the login profile for the specified user.
:type user_name: string
:param user_name: The username of the user | platform/gsutil/third_party/boto/boto/iam/connection.py | get_login_profiles | bopopescu/google-cloud-sdk | 15 | python | def get_login_profiles(self, user_name):
'\n Retrieves the login profile for the specified user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'UserName': user_name}
return self.get_response('GetLoginProfile', params) | def get_login_profiles(self, user_name):
'\n Retrieves the login profile for the specified user.\n\n :type user_name: string\n :param user_name: The username of the user\n\n '
params = {'UserName': user_name}
return self.get_response('GetLoginProfile', params)<|docstring|>Retrieves the login profile for the specified user.
:type user_name: string
:param user_name: The username of the user<|endoftext|> |
f034e593e13c5824669b5b3630963aef868bfe4eed94309782435819d2b27eac | def create_login_profile(self, user_name, password):
'\n Creates a login profile for the specified user, give the user the\n ability to access AWS services and the AWS Management Console.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type password: string\n :param password: The new password for the user\n\n '
params = {'UserName': user_name, 'Password': password}
return self.get_response('CreateLoginProfile', params) | Creates a login profile for the specified user, give the user the
ability to access AWS services and the AWS Management Console.
:type user_name: string
:param user_name: The name of the user
:type password: string
:param password: The new password for the user | platform/gsutil/third_party/boto/boto/iam/connection.py | create_login_profile | bopopescu/google-cloud-sdk | 15 | python | def create_login_profile(self, user_name, password):
'\n Creates a login profile for the specified user, give the user the\n ability to access AWS services and the AWS Management Console.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type password: string\n :param password: The new password for the user\n\n '
params = {'UserName': user_name, 'Password': password}
return self.get_response('CreateLoginProfile', params) | def create_login_profile(self, user_name, password):
'\n Creates a login profile for the specified user, give the user the\n ability to access AWS services and the AWS Management Console.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type password: string\n :param password: The new password for the user\n\n '
params = {'UserName': user_name, 'Password': password}
return self.get_response('CreateLoginProfile', params)<|docstring|>Creates a login profile for the specified user, give the user the
ability to access AWS services and the AWS Management Console.
:type user_name: string
:param user_name: The name of the user
:type password: string
:param password: The new password for the user<|endoftext|> |
c356e30c45a8d779a03c5886bcdcd91b80f8f63ab1e0ea9285a51d7361da6f92 | def delete_login_profile(self, user_name):
'\n Deletes the login profile associated with the specified user.\n\n :type user_name: string\n :param user_name: The name of the user to delete.\n\n '
params = {'UserName': user_name}
return self.get_response('DeleteLoginProfile', params) | Deletes the login profile associated with the specified user.
:type user_name: string
:param user_name: The name of the user to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_login_profile | bopopescu/google-cloud-sdk | 15 | python | def delete_login_profile(self, user_name):
'\n Deletes the login profile associated with the specified user.\n\n :type user_name: string\n :param user_name: The name of the user to delete.\n\n '
params = {'UserName': user_name}
return self.get_response('DeleteLoginProfile', params) | def delete_login_profile(self, user_name):
'\n Deletes the login profile associated with the specified user.\n\n :type user_name: string\n :param user_name: The name of the user to delete.\n\n '
params = {'UserName': user_name}
return self.get_response('DeleteLoginProfile', params)<|docstring|>Deletes the login profile associated with the specified user.
:type user_name: string
:param user_name: The name of the user to delete.<|endoftext|> |
7acce2d0d7aa51c63607209eac72dcd3ec2bd4b338baf061e3bfb995b132544c | def update_login_profile(self, user_name, password):
"\n Resets the password associated with the user's login profile.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type password: string\n :param password: The new password for the user\n\n "
params = {'UserName': user_name, 'Password': password}
return self.get_response('UpdateLoginProfile', params) | Resets the password associated with the user's login profile.
:type user_name: string
:param user_name: The name of the user
:type password: string
:param password: The new password for the user | platform/gsutil/third_party/boto/boto/iam/connection.py | update_login_profile | bopopescu/google-cloud-sdk | 15 | python | def update_login_profile(self, user_name, password):
"\n Resets the password associated with the user's login profile.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type password: string\n :param password: The new password for the user\n\n "
params = {'UserName': user_name, 'Password': password}
return self.get_response('UpdateLoginProfile', params) | def update_login_profile(self, user_name, password):
"\n Resets the password associated with the user's login profile.\n\n :type user_name: string\n :param user_name: The name of the user\n\n :type password: string\n :param password: The new password for the user\n\n "
params = {'UserName': user_name, 'Password': password}
return self.get_response('UpdateLoginProfile', params)<|docstring|>Resets the password associated with the user's login profile.
:type user_name: string
:param user_name: The name of the user
:type password: string
:param password: The new password for the user<|endoftext|> |
1ec3a54d4591949480b464a8959b3641e35730dd324fb886dffb69ce0faf4e4e | def create_account_alias(self, alias):
'\n Creates a new alias for the AWS account.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n\n :type alias: string\n :param alias: The alias to attach to the account.\n '
params = {'AccountAlias': alias}
return self.get_response('CreateAccountAlias', params) | Creates a new alias for the AWS account.
For more information on account id aliases, please see
http://goo.gl/ToB7G
:type alias: string
:param alias: The alias to attach to the account. | platform/gsutil/third_party/boto/boto/iam/connection.py | create_account_alias | bopopescu/google-cloud-sdk | 15 | python | def create_account_alias(self, alias):
'\n Creates a new alias for the AWS account.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n\n :type alias: string\n :param alias: The alias to attach to the account.\n '
params = {'AccountAlias': alias}
return self.get_response('CreateAccountAlias', params) | def create_account_alias(self, alias):
'\n Creates a new alias for the AWS account.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n\n :type alias: string\n :param alias: The alias to attach to the account.\n '
params = {'AccountAlias': alias}
return self.get_response('CreateAccountAlias', params)<|docstring|>Creates a new alias for the AWS account.
For more information on account id aliases, please see
http://goo.gl/ToB7G
:type alias: string
:param alias: The alias to attach to the account.<|endoftext|> |
3de64f70d46fb5e1d0f1c684da170455807a0f51a635d79797a165047bcaffd9 | def delete_account_alias(self, alias):
'\n Deletes an alias for the AWS account.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n\n :type alias: string\n :param alias: The alias to remove from the account.\n '
params = {'AccountAlias': alias}
return self.get_response('DeleteAccountAlias', params) | Deletes an alias for the AWS account.
For more information on account id aliases, please see
http://goo.gl/ToB7G
:type alias: string
:param alias: The alias to remove from the account. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_account_alias | bopopescu/google-cloud-sdk | 15 | python | def delete_account_alias(self, alias):
'\n Deletes an alias for the AWS account.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n\n :type alias: string\n :param alias: The alias to remove from the account.\n '
params = {'AccountAlias': alias}
return self.get_response('DeleteAccountAlias', params) | def delete_account_alias(self, alias):
'\n Deletes an alias for the AWS account.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n\n :type alias: string\n :param alias: The alias to remove from the account.\n '
params = {'AccountAlias': alias}
return self.get_response('DeleteAccountAlias', params)<|docstring|>Deletes an alias for the AWS account.
For more information on account id aliases, please see
http://goo.gl/ToB7G
:type alias: string
:param alias: The alias to remove from the account.<|endoftext|> |
313b28f8fe1f775a42a09d88cd3c5958ebe6a34676db0ecb793a3a4b81a4ae7d | def get_account_alias(self):
'\n Get the alias for the current account.\n\n This is referred to in the docs as list_account_aliases,\n but it seems you can only have one account alias currently.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n '
return self.get_response('ListAccountAliases', {}, list_marker='AccountAliases') | Get the alias for the current account.
This is referred to in the docs as list_account_aliases,
but it seems you can only have one account alias currently.
For more information on account id aliases, please see
http://goo.gl/ToB7G | platform/gsutil/third_party/boto/boto/iam/connection.py | get_account_alias | bopopescu/google-cloud-sdk | 15 | python | def get_account_alias(self):
'\n Get the alias for the current account.\n\n This is referred to in the docs as list_account_aliases,\n but it seems you can only have one account alias currently.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n '
return self.get_response('ListAccountAliases', {}, list_marker='AccountAliases') | def get_account_alias(self):
'\n Get the alias for the current account.\n\n This is referred to in the docs as list_account_aliases,\n but it seems you can only have one account alias currently.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n '
return self.get_response('ListAccountAliases', {}, list_marker='AccountAliases')<|docstring|>Get the alias for the current account.
This is referred to in the docs as list_account_aliases,
but it seems you can only have one account alias currently.
For more information on account id aliases, please see
http://goo.gl/ToB7G<|endoftext|> |
f401074b8b2b7c1ae93b0777e508ae075b673b2f59ae89cd0f91419e0ebec3b5 | def get_signin_url(self, service='ec2'):
"\n Get the URL where IAM users can use their login profile to sign in\n to this account's console.\n\n :type service: string\n :param service: Default service to go to in the console.\n "
alias = self.get_account_alias()
if (not alias):
raise Exception('No alias associated with this account. Please use iam.create_account_alias() first.')
resp = alias.get('list_account_aliases_response', {})
result = resp.get('list_account_aliases_result', {})
aliases = result.get('account_aliases', [])
if (not len(aliases)):
raise Exception('No alias associated with this account. Please use iam.create_account_alias() first.')
alias = aliases[0]
if (self.host == 'iam.us-gov.amazonaws.com'):
return ('https://%s.signin.amazonaws-us-gov.com/console/%s' % (alias, service))
elif self.host.endswith('amazonaws.com.cn'):
return ('https://%s.signin.amazonaws.cn/console/%s' % (alias, service))
else:
return ('https://%s.signin.aws.amazon.com/console/%s' % (alias, service)) | Get the URL where IAM users can use their login profile to sign in
to this account's console.
:type service: string
:param service: Default service to go to in the console. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_signin_url | bopopescu/google-cloud-sdk | 15 | python | def get_signin_url(self, service='ec2'):
"\n Get the URL where IAM users can use their login profile to sign in\n to this account's console.\n\n :type service: string\n :param service: Default service to go to in the console.\n "
alias = self.get_account_alias()
if (not alias):
raise Exception('No alias associated with this account. Please use iam.create_account_alias() first.')
resp = alias.get('list_account_aliases_response', {})
result = resp.get('list_account_aliases_result', {})
aliases = result.get('account_aliases', [])
if (not len(aliases)):
raise Exception('No alias associated with this account. Please use iam.create_account_alias() first.')
alias = aliases[0]
if (self.host == 'iam.us-gov.amazonaws.com'):
return ('https://%s.signin.amazonaws-us-gov.com/console/%s' % (alias, service))
elif self.host.endswith('amazonaws.com.cn'):
return ('https://%s.signin.amazonaws.cn/console/%s' % (alias, service))
else:
return ('https://%s.signin.aws.amazon.com/console/%s' % (alias, service)) | def get_signin_url(self, service='ec2'):
"\n Get the URL where IAM users can use their login profile to sign in\n to this account's console.\n\n :type service: string\n :param service: Default service to go to in the console.\n "
alias = self.get_account_alias()
if (not alias):
raise Exception('No alias associated with this account. Please use iam.create_account_alias() first.')
resp = alias.get('list_account_aliases_response', {})
result = resp.get('list_account_aliases_result', {})
aliases = result.get('account_aliases', [])
if (not len(aliases)):
raise Exception('No alias associated with this account. Please use iam.create_account_alias() first.')
alias = aliases[0]
if (self.host == 'iam.us-gov.amazonaws.com'):
return ('https://%s.signin.amazonaws-us-gov.com/console/%s' % (alias, service))
elif self.host.endswith('amazonaws.com.cn'):
return ('https://%s.signin.amazonaws.cn/console/%s' % (alias, service))
else:
return ('https://%s.signin.aws.amazon.com/console/%s' % (alias, service))<|docstring|>Get the URL where IAM users can use their login profile to sign in
to this account's console.
:type service: string
:param service: Default service to go to in the console.<|endoftext|> |
01818d0f35d2a60decb03e21cc0ab22b39ea5e1fb6b2c586caedaf168b070b68 | def get_account_summary(self):
'\n Get the alias for the current account.\n\n This is referred to in the docs as list_account_aliases,\n but it seems you can only have one account alias currently.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n '
return self.get_object('GetAccountSummary', {}, SummaryMap) | Get the alias for the current account.
This is referred to in the docs as list_account_aliases,
but it seems you can only have one account alias currently.
For more information on account id aliases, please see
http://goo.gl/ToB7G | platform/gsutil/third_party/boto/boto/iam/connection.py | get_account_summary | bopopescu/google-cloud-sdk | 15 | python | def get_account_summary(self):
'\n Get the alias for the current account.\n\n This is referred to in the docs as list_account_aliases,\n but it seems you can only have one account alias currently.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n '
return self.get_object('GetAccountSummary', {}, SummaryMap) | def get_account_summary(self):
'\n Get the alias for the current account.\n\n This is referred to in the docs as list_account_aliases,\n but it seems you can only have one account alias currently.\n\n For more information on account id aliases, please see\n http://goo.gl/ToB7G\n '
return self.get_object('GetAccountSummary', {}, SummaryMap)<|docstring|>Get the alias for the current account.
This is referred to in the docs as list_account_aliases,
but it seems you can only have one account alias currently.
For more information on account id aliases, please see
http://goo.gl/ToB7G<|endoftext|> |
d7757d45669fd098da25096b8486dfab25c34e37bc1465f4a347eae25496c3bc | def add_role_to_instance_profile(self, instance_profile_name, role_name):
'\n Adds the specified role to the specified instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to update.\n\n :type role_name: string\n :param role_name: Name of the role to add.\n '
return self.get_response('AddRoleToInstanceProfile', {'InstanceProfileName': instance_profile_name, 'RoleName': role_name}) | Adds the specified role to the specified instance profile.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to update.
:type role_name: string
:param role_name: Name of the role to add. | platform/gsutil/third_party/boto/boto/iam/connection.py | add_role_to_instance_profile | bopopescu/google-cloud-sdk | 15 | python | def add_role_to_instance_profile(self, instance_profile_name, role_name):
'\n Adds the specified role to the specified instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to update.\n\n :type role_name: string\n :param role_name: Name of the role to add.\n '
return self.get_response('AddRoleToInstanceProfile', {'InstanceProfileName': instance_profile_name, 'RoleName': role_name}) | def add_role_to_instance_profile(self, instance_profile_name, role_name):
'\n Adds the specified role to the specified instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to update.\n\n :type role_name: string\n :param role_name: Name of the role to add.\n '
return self.get_response('AddRoleToInstanceProfile', {'InstanceProfileName': instance_profile_name, 'RoleName': role_name})<|docstring|>Adds the specified role to the specified instance profile.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to update.
:type role_name: string
:param role_name: Name of the role to add.<|endoftext|> |
36a4b8816bd0261fedfc82eacdeb20e09d0535136bbffceed684834e8e989d95 | def create_instance_profile(self, instance_profile_name, path=None):
'\n Creates a new instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to create.\n\n :type path: string\n :param path: The path to the instance profile.\n '
params = {'InstanceProfileName': instance_profile_name}
if (path is not None):
params['Path'] = path
return self.get_response('CreateInstanceProfile', params) | Creates a new instance profile.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to create.
:type path: string
:param path: The path to the instance profile. | platform/gsutil/third_party/boto/boto/iam/connection.py | create_instance_profile | bopopescu/google-cloud-sdk | 15 | python | def create_instance_profile(self, instance_profile_name, path=None):
'\n Creates a new instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to create.\n\n :type path: string\n :param path: The path to the instance profile.\n '
params = {'InstanceProfileName': instance_profile_name}
if (path is not None):
params['Path'] = path
return self.get_response('CreateInstanceProfile', params) | def create_instance_profile(self, instance_profile_name, path=None):
'\n Creates a new instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to create.\n\n :type path: string\n :param path: The path to the instance profile.\n '
params = {'InstanceProfileName': instance_profile_name}
if (path is not None):
params['Path'] = path
return self.get_response('CreateInstanceProfile', params)<|docstring|>Creates a new instance profile.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to create.
:type path: string
:param path: The path to the instance profile.<|endoftext|> |
311c56c931b8d4e3b2ce75863acb15fade72b184c22fd3bbeec93b51ace38040 | def create_role(self, role_name, assume_role_policy_document=None, path=None):
'\n Creates a new role for your AWS account.\n\n The policy grants permission to an EC2 instance to assume the role.\n The policy is URL-encoded according to RFC 3986. Currently, only EC2\n instances can assume roles.\n\n :type role_name: string\n :param role_name: Name of the role to create.\n\n :type assume_role_policy_document: ``string`` or ``dict``\n :param assume_role_policy_document: The policy that grants an entity\n permission to assume the role.\n\n :type path: string\n :param path: The path to the instance profile.\n '
params = {'RoleName': role_name, 'AssumeRolePolicyDocument': self._build_policy(assume_role_policy_document)}
if (path is not None):
params['Path'] = path
return self.get_response('CreateRole', params) | Creates a new role for your AWS account.
The policy grants permission to an EC2 instance to assume the role.
The policy is URL-encoded according to RFC 3986. Currently, only EC2
instances can assume roles.
:type role_name: string
:param role_name: Name of the role to create.
:type assume_role_policy_document: ``string`` or ``dict``
:param assume_role_policy_document: The policy that grants an entity
permission to assume the role.
:type path: string
:param path: The path to the instance profile. | platform/gsutil/third_party/boto/boto/iam/connection.py | create_role | bopopescu/google-cloud-sdk | 15 | python | def create_role(self, role_name, assume_role_policy_document=None, path=None):
'\n Creates a new role for your AWS account.\n\n The policy grants permission to an EC2 instance to assume the role.\n The policy is URL-encoded according to RFC 3986. Currently, only EC2\n instances can assume roles.\n\n :type role_name: string\n :param role_name: Name of the role to create.\n\n :type assume_role_policy_document: ``string`` or ``dict``\n :param assume_role_policy_document: The policy that grants an entity\n permission to assume the role.\n\n :type path: string\n :param path: The path to the instance profile.\n '
params = {'RoleName': role_name, 'AssumeRolePolicyDocument': self._build_policy(assume_role_policy_document)}
if (path is not None):
params['Path'] = path
return self.get_response('CreateRole', params) | def create_role(self, role_name, assume_role_policy_document=None, path=None):
'\n Creates a new role for your AWS account.\n\n The policy grants permission to an EC2 instance to assume the role.\n The policy is URL-encoded according to RFC 3986. Currently, only EC2\n instances can assume roles.\n\n :type role_name: string\n :param role_name: Name of the role to create.\n\n :type assume_role_policy_document: ``string`` or ``dict``\n :param assume_role_policy_document: The policy that grants an entity\n permission to assume the role.\n\n :type path: string\n :param path: The path to the instance profile.\n '
params = {'RoleName': role_name, 'AssumeRolePolicyDocument': self._build_policy(assume_role_policy_document)}
if (path is not None):
params['Path'] = path
return self.get_response('CreateRole', params)<|docstring|>Creates a new role for your AWS account.
The policy grants permission to an EC2 instance to assume the role.
The policy is URL-encoded according to RFC 3986. Currently, only EC2
instances can assume roles.
:type role_name: string
:param role_name: Name of the role to create.
:type assume_role_policy_document: ``string`` or ``dict``
:param assume_role_policy_document: The policy that grants an entity
permission to assume the role.
:type path: string
:param path: The path to the instance profile.<|endoftext|> |
25c72e3bcd98003591ebe3254b7bda776c3eebfaa602969d41cb77e4ad61d48c | def delete_instance_profile(self, instance_profile_name):
'\n Deletes the specified instance profile. The instance profile must not\n have an associated role.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to delete.\n '
return self.get_response('DeleteInstanceProfile', {'InstanceProfileName': instance_profile_name}) | Deletes the specified instance profile. The instance profile must not
have an associated role.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_instance_profile | bopopescu/google-cloud-sdk | 15 | python | def delete_instance_profile(self, instance_profile_name):
'\n Deletes the specified instance profile. The instance profile must not\n have an associated role.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to delete.\n '
return self.get_response('DeleteInstanceProfile', {'InstanceProfileName': instance_profile_name}) | def delete_instance_profile(self, instance_profile_name):
'\n Deletes the specified instance profile. The instance profile must not\n have an associated role.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to delete.\n '
return self.get_response('DeleteInstanceProfile', {'InstanceProfileName': instance_profile_name})<|docstring|>Deletes the specified instance profile. The instance profile must not
have an associated role.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to delete.<|endoftext|> |
d4633e907ba801f10bf1feab449bfe14f33f6505988bdd6c81cd7b2370385084 | def delete_role(self, role_name):
'\n Deletes the specified role. The role must not have any policies\n attached.\n\n :type role_name: string\n :param role_name: Name of the role to delete.\n '
return self.get_response('DeleteRole', {'RoleName': role_name}) | Deletes the specified role. The role must not have any policies
attached.
:type role_name: string
:param role_name: Name of the role to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_role | bopopescu/google-cloud-sdk | 15 | python | def delete_role(self, role_name):
'\n Deletes the specified role. The role must not have any policies\n attached.\n\n :type role_name: string\n :param role_name: Name of the role to delete.\n '
return self.get_response('DeleteRole', {'RoleName': role_name}) | def delete_role(self, role_name):
'\n Deletes the specified role. The role must not have any policies\n attached.\n\n :type role_name: string\n :param role_name: Name of the role to delete.\n '
return self.get_response('DeleteRole', {'RoleName': role_name})<|docstring|>Deletes the specified role. The role must not have any policies
attached.
:type role_name: string
:param role_name: Name of the role to delete.<|endoftext|> |
6a4091c16154fbc0622fc4ad21f533da5a5dae9588e766e0b2a13a81ea7ce68c | def delete_role_policy(self, role_name, policy_name):
'\n Deletes the specified policy associated with the specified role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n\n :type policy_name: string\n :param policy_name: Name of the policy to delete.\n '
return self.get_response('DeleteRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name}) | Deletes the specified policy associated with the specified role.
:type role_name: string
:param role_name: Name of the role associated with the policy.
:type policy_name: string
:param policy_name: Name of the policy to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_role_policy | bopopescu/google-cloud-sdk | 15 | python | def delete_role_policy(self, role_name, policy_name):
'\n Deletes the specified policy associated with the specified role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n\n :type policy_name: string\n :param policy_name: Name of the policy to delete.\n '
return self.get_response('DeleteRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name}) | def delete_role_policy(self, role_name, policy_name):
'\n Deletes the specified policy associated with the specified role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n\n :type policy_name: string\n :param policy_name: Name of the policy to delete.\n '
return self.get_response('DeleteRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name})<|docstring|>Deletes the specified policy associated with the specified role.
:type role_name: string
:param role_name: Name of the role associated with the policy.
:type policy_name: string
:param policy_name: Name of the policy to delete.<|endoftext|> |
e83d9f22d0e826d4798a322911ad6ecba1227397ebad1f5c842598265768318b | def get_instance_profile(self, instance_profile_name):
"\n Retrieves information about the specified instance profile, including\n the instance profile's path, GUID, ARN, and role.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to get\n information about.\n "
return self.get_response('GetInstanceProfile', {'InstanceProfileName': instance_profile_name}) | Retrieves information about the specified instance profile, including
the instance profile's path, GUID, ARN, and role.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to get
information about. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_instance_profile | bopopescu/google-cloud-sdk | 15 | python | def get_instance_profile(self, instance_profile_name):
"\n Retrieves information about the specified instance profile, including\n the instance profile's path, GUID, ARN, and role.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to get\n information about.\n "
return self.get_response('GetInstanceProfile', {'InstanceProfileName': instance_profile_name}) | def get_instance_profile(self, instance_profile_name):
"\n Retrieves information about the specified instance profile, including\n the instance profile's path, GUID, ARN, and role.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to get\n information about.\n "
return self.get_response('GetInstanceProfile', {'InstanceProfileName': instance_profile_name})<|docstring|>Retrieves information about the specified instance profile, including
the instance profile's path, GUID, ARN, and role.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to get
information about.<|endoftext|> |
a5da9e1fbb3f1f5ef007d20a1f8e96c7c7fa3a8f5750f1708595a3a89c204b8c | def get_role(self, role_name):
"\n Retrieves information about the specified role, including the role's\n path, GUID, ARN, and the policy granting permission to EC2 to assume\n the role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n "
return self.get_response('GetRole', {'RoleName': role_name}) | Retrieves information about the specified role, including the role's
path, GUID, ARN, and the policy granting permission to EC2 to assume
the role.
:type role_name: string
:param role_name: Name of the role associated with the policy. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_role | bopopescu/google-cloud-sdk | 15 | python | def get_role(self, role_name):
"\n Retrieves information about the specified role, including the role's\n path, GUID, ARN, and the policy granting permission to EC2 to assume\n the role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n "
return self.get_response('GetRole', {'RoleName': role_name}) | def get_role(self, role_name):
"\n Retrieves information about the specified role, including the role's\n path, GUID, ARN, and the policy granting permission to EC2 to assume\n the role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n "
return self.get_response('GetRole', {'RoleName': role_name})<|docstring|>Retrieves information about the specified role, including the role's
path, GUID, ARN, and the policy granting permission to EC2 to assume
the role.
:type role_name: string
:param role_name: Name of the role associated with the policy.<|endoftext|> |
c58a6f8d16668f6ad32e2993477c9a7334620303c3b5624e7137814da3a885f1 | def get_role_policy(self, role_name, policy_name):
'\n Retrieves the specified policy document for the specified role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n\n :type policy_name: string\n :param policy_name: Name of the policy to get.\n '
return self.get_response('GetRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name}) | Retrieves the specified policy document for the specified role.
:type role_name: string
:param role_name: Name of the role associated with the policy.
:type policy_name: string
:param policy_name: Name of the policy to get. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_role_policy | bopopescu/google-cloud-sdk | 15 | python | def get_role_policy(self, role_name, policy_name):
'\n Retrieves the specified policy document for the specified role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n\n :type policy_name: string\n :param policy_name: Name of the policy to get.\n '
return self.get_response('GetRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name}) | def get_role_policy(self, role_name, policy_name):
'\n Retrieves the specified policy document for the specified role.\n\n :type role_name: string\n :param role_name: Name of the role associated with the policy.\n\n :type policy_name: string\n :param policy_name: Name of the policy to get.\n '
return self.get_response('GetRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name})<|docstring|>Retrieves the specified policy document for the specified role.
:type role_name: string
:param role_name: Name of the role associated with the policy.
:type policy_name: string
:param policy_name: Name of the policy to get.<|endoftext|> |
0b165038fdbcac3c19afdb635b0560546595a6976302fa5c80e7d86d28f7020c | def list_instance_profiles(self, path_prefix=None, marker=None, max_items=None):
"\n Lists the instance profiles that have the specified path prefix. If\n there are none, the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: The path prefix for filtering the results. For\n example: /application_abc/component_xyz/, which would get all\n instance profiles whose path starts with\n /application_abc/component_xyz/.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {}
if (path_prefix is not None):
params['PathPrefix'] = path_prefix
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListInstanceProfiles', params, list_marker='InstanceProfiles') | Lists the instance profiles that have the specified path prefix. If
there are none, the action returns an empty list.
:type path_prefix: string
:param path_prefix: The path prefix for filtering the results. For
example: /application_abc/component_xyz/, which would get all
instance profiles whose path starts with
/application_abc/component_xyz/.
:type marker: string
:param marker: Use this parameter only when paginating results, and
only in a subsequent request after you've received a response
where the results are truncated. Set it to the value of the
Marker element in the response you just received.
:type max_items: int
:param max_items: Use this parameter only when paginating results to
indicate the maximum number of user names you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | list_instance_profiles | bopopescu/google-cloud-sdk | 15 | python | def list_instance_profiles(self, path_prefix=None, marker=None, max_items=None):
"\n Lists the instance profiles that have the specified path prefix. If\n there are none, the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: The path prefix for filtering the results. For\n example: /application_abc/component_xyz/, which would get all\n instance profiles whose path starts with\n /application_abc/component_xyz/.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {}
if (path_prefix is not None):
params['PathPrefix'] = path_prefix
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListInstanceProfiles', params, list_marker='InstanceProfiles') | def list_instance_profiles(self, path_prefix=None, marker=None, max_items=None):
"\n Lists the instance profiles that have the specified path prefix. If\n there are none, the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: The path prefix for filtering the results. For\n example: /application_abc/component_xyz/, which would get all\n instance profiles whose path starts with\n /application_abc/component_xyz/.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {}
if (path_prefix is not None):
params['PathPrefix'] = path_prefix
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListInstanceProfiles', params, list_marker='InstanceProfiles')<|docstring|>Lists the instance profiles that have the specified path prefix. If
there are none, the action returns an empty list.
:type path_prefix: string
:param path_prefix: The path prefix for filtering the results. For
example: /application_abc/component_xyz/, which would get all
instance profiles whose path starts with
/application_abc/component_xyz/.
:type marker: string
:param marker: Use this parameter only when paginating results, and
only in a subsequent request after you've received a response
where the results are truncated. Set it to the value of the
Marker element in the response you just received.
:type max_items: int
:param max_items: Use this parameter only when paginating results to
indicate the maximum number of user names you want in the response.<|endoftext|> |
1081dd7c037a93eed35ecc50391d1421bf705923b78a89ad2fe3a1f869127c79 | def list_instance_profiles_for_role(self, role_name, marker=None, max_items=None):
"\n Lists the instance profiles that have the specified associated role. If\n there are none, the action returns an empty list.\n\n :type role_name: string\n :param role_name: The name of the role to list instance profiles for.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {'RoleName': role_name}
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListInstanceProfilesForRole', params, list_marker='InstanceProfiles') | Lists the instance profiles that have the specified associated role. If
there are none, the action returns an empty list.
:type role_name: string
:param role_name: The name of the role to list instance profiles for.
:type marker: string
:param marker: Use this parameter only when paginating results, and
only in a subsequent request after you've received a response
where the results are truncated. Set it to the value of the
Marker element in the response you just received.
:type max_items: int
:param max_items: Use this parameter only when paginating results to
indicate the maximum number of user names you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | list_instance_profiles_for_role | bopopescu/google-cloud-sdk | 15 | python | def list_instance_profiles_for_role(self, role_name, marker=None, max_items=None):
"\n Lists the instance profiles that have the specified associated role. If\n there are none, the action returns an empty list.\n\n :type role_name: string\n :param role_name: The name of the role to list instance profiles for.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {'RoleName': role_name}
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListInstanceProfilesForRole', params, list_marker='InstanceProfiles') | def list_instance_profiles_for_role(self, role_name, marker=None, max_items=None):
"\n Lists the instance profiles that have the specified associated role. If\n there are none, the action returns an empty list.\n\n :type role_name: string\n :param role_name: The name of the role to list instance profiles for.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n Marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {'RoleName': role_name}
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListInstanceProfilesForRole', params, list_marker='InstanceProfiles')<|docstring|>Lists the instance profiles that have the specified associated role. If
there are none, the action returns an empty list.
:type role_name: string
:param role_name: The name of the role to list instance profiles for.
:type marker: string
:param marker: Use this parameter only when paginating results, and
only in a subsequent request after you've received a response
where the results are truncated. Set it to the value of the
Marker element in the response you just received.
:type max_items: int
:param max_items: Use this parameter only when paginating results to
indicate the maximum number of user names you want in the response.<|endoftext|> |
18ad6b2fe88c6bad97a3570bee42a646af3a6e7e372a2ddfc8f2ed2730dc935b | def list_role_policies(self, role_name, marker=None, max_items=None):
"\n Lists the names of the policies associated with the specified role. If\n there are none, the action returns an empty list.\n\n :type role_name: string\n :param role_name: The name of the role to list policies for.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {'RoleName': role_name}
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListRolePolicies', params, list_marker='PolicyNames') | Lists the names of the policies associated with the specified role. If
there are none, the action returns an empty list.
:type role_name: string
:param role_name: The name of the role to list policies for.
:type marker: string
:param marker: Use this parameter only when paginating results, and
only in a subsequent request after you've received a response
where the results are truncated. Set it to the value of the
marker element in the response you just received.
:type max_items: int
:param max_items: Use this parameter only when paginating results to
indicate the maximum number of user names you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | list_role_policies | bopopescu/google-cloud-sdk | 15 | python | def list_role_policies(self, role_name, marker=None, max_items=None):
"\n Lists the names of the policies associated with the specified role. If\n there are none, the action returns an empty list.\n\n :type role_name: string\n :param role_name: The name of the role to list policies for.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {'RoleName': role_name}
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListRolePolicies', params, list_marker='PolicyNames') | def list_role_policies(self, role_name, marker=None, max_items=None):
"\n Lists the names of the policies associated with the specified role. If\n there are none, the action returns an empty list.\n\n :type role_name: string\n :param role_name: The name of the role to list policies for.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {'RoleName': role_name}
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListRolePolicies', params, list_marker='PolicyNames')<|docstring|>Lists the names of the policies associated with the specified role. If
there are none, the action returns an empty list.
:type role_name: string
:param role_name: The name of the role to list policies for.
:type marker: string
:param marker: Use this parameter only when paginating results, and
only in a subsequent request after you've received a response
where the results are truncated. Set it to the value of the
marker element in the response you just received.
:type max_items: int
:param max_items: Use this parameter only when paginating results to
indicate the maximum number of user names you want in the response.<|endoftext|> |
dc15f246cfbeec0f874efdf934ef20a207592ce20427b2965c4c0145f747a9df | def list_roles(self, path_prefix=None, marker=None, max_items=None):
"\n Lists the roles that have the specified path prefix. If there are none,\n the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: The path prefix for filtering the results.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {}
if (path_prefix is not None):
params['PathPrefix'] = path_prefix
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListRoles', params, list_marker='Roles') | Lists the roles that have the specified path prefix. If there are none,
the action returns an empty list.
:type path_prefix: string
:param path_prefix: The path prefix for filtering the results.
:type marker: string
:param marker: Use this parameter only when paginating results, and
only in a subsequent request after you've received a response
where the results are truncated. Set it to the value of the
marker element in the response you just received.
:type max_items: int
:param max_items: Use this parameter only when paginating results to
indicate the maximum number of user names you want in the response. | platform/gsutil/third_party/boto/boto/iam/connection.py | list_roles | bopopescu/google-cloud-sdk | 15 | python | def list_roles(self, path_prefix=None, marker=None, max_items=None):
"\n Lists the roles that have the specified path prefix. If there are none,\n the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: The path prefix for filtering the results.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {}
if (path_prefix is not None):
params['PathPrefix'] = path_prefix
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListRoles', params, list_marker='Roles') | def list_roles(self, path_prefix=None, marker=None, max_items=None):
"\n Lists the roles that have the specified path prefix. If there are none,\n the action returns an empty list.\n\n :type path_prefix: string\n :param path_prefix: The path prefix for filtering the results.\n\n :type marker: string\n :param marker: Use this parameter only when paginating results, and\n only in a subsequent request after you've received a response\n where the results are truncated. Set it to the value of the\n marker element in the response you just received.\n\n :type max_items: int\n :param max_items: Use this parameter only when paginating results to\n indicate the maximum number of user names you want in the response.\n "
params = {}
if (path_prefix is not None):
params['PathPrefix'] = path_prefix
if (marker is not None):
params['Marker'] = marker
if (max_items is not None):
params['MaxItems'] = max_items
return self.get_response('ListRoles', params, list_marker='Roles')<|docstring|>Lists the roles that have the specified path prefix. If there are none,
the action returns an empty list.
:type path_prefix: string
:param path_prefix: The path prefix for filtering the results.
:type marker: string
:param marker: Use this parameter only when paginating results, and
only in a subsequent request after you've received a response
where the results are truncated. Set it to the value of the
marker element in the response you just received.
:type max_items: int
:param max_items: Use this parameter only when paginating results to
indicate the maximum number of user names you want in the response.<|endoftext|> |
2983a4c9fba6cfa20d789909c493d2359abe36fcf0e1ed68eb69f91e73e3d4bf | def put_role_policy(self, role_name, policy_name, policy_document):
'\n Adds (or updates) a policy document associated with the specified role.\n\n :type role_name: string\n :param role_name: Name of the role to associate the policy with.\n\n :type policy_name: string\n :param policy_name: Name of the policy document.\n\n :type policy_document: string\n :param policy_document: The policy document.\n '
return self.get_response('PutRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name, 'PolicyDocument': policy_document}) | Adds (or updates) a policy document associated with the specified role.
:type role_name: string
:param role_name: Name of the role to associate the policy with.
:type policy_name: string
:param policy_name: Name of the policy document.
:type policy_document: string
:param policy_document: The policy document. | platform/gsutil/third_party/boto/boto/iam/connection.py | put_role_policy | bopopescu/google-cloud-sdk | 15 | python | def put_role_policy(self, role_name, policy_name, policy_document):
'\n Adds (or updates) a policy document associated with the specified role.\n\n :type role_name: string\n :param role_name: Name of the role to associate the policy with.\n\n :type policy_name: string\n :param policy_name: Name of the policy document.\n\n :type policy_document: string\n :param policy_document: The policy document.\n '
return self.get_response('PutRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name, 'PolicyDocument': policy_document}) | def put_role_policy(self, role_name, policy_name, policy_document):
'\n Adds (or updates) a policy document associated with the specified role.\n\n :type role_name: string\n :param role_name: Name of the role to associate the policy with.\n\n :type policy_name: string\n :param policy_name: Name of the policy document.\n\n :type policy_document: string\n :param policy_document: The policy document.\n '
return self.get_response('PutRolePolicy', {'RoleName': role_name, 'PolicyName': policy_name, 'PolicyDocument': policy_document})<|docstring|>Adds (or updates) a policy document associated with the specified role.
:type role_name: string
:param role_name: Name of the role to associate the policy with.
:type policy_name: string
:param policy_name: Name of the policy document.
:type policy_document: string
:param policy_document: The policy document.<|endoftext|> |
f1bd6f12118df4a0ca3694b0203151f77893b77ee0fe2dcaf62b34d0649d9c18 | def remove_role_from_instance_profile(self, instance_profile_name, role_name):
'\n Removes the specified role from the specified instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to update.\n\n :type role_name: string\n :param role_name: Name of the role to remove.\n '
return self.get_response('RemoveRoleFromInstanceProfile', {'InstanceProfileName': instance_profile_name, 'RoleName': role_name}) | Removes the specified role from the specified instance profile.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to update.
:type role_name: string
:param role_name: Name of the role to remove. | platform/gsutil/third_party/boto/boto/iam/connection.py | remove_role_from_instance_profile | bopopescu/google-cloud-sdk | 15 | python | def remove_role_from_instance_profile(self, instance_profile_name, role_name):
'\n Removes the specified role from the specified instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to update.\n\n :type role_name: string\n :param role_name: Name of the role to remove.\n '
return self.get_response('RemoveRoleFromInstanceProfile', {'InstanceProfileName': instance_profile_name, 'RoleName': role_name}) | def remove_role_from_instance_profile(self, instance_profile_name, role_name):
'\n Removes the specified role from the specified instance profile.\n\n :type instance_profile_name: string\n :param instance_profile_name: Name of the instance profile to update.\n\n :type role_name: string\n :param role_name: Name of the role to remove.\n '
return self.get_response('RemoveRoleFromInstanceProfile', {'InstanceProfileName': instance_profile_name, 'RoleName': role_name})<|docstring|>Removes the specified role from the specified instance profile.
:type instance_profile_name: string
:param instance_profile_name: Name of the instance profile to update.
:type role_name: string
:param role_name: Name of the role to remove.<|endoftext|> |
4e7be6044e288dc8c4eb66e78a575c6e795b07db1a50b980491aead11e7d3602 | def update_assume_role_policy(self, role_name, policy_document):
'\n Updates the policy that grants an entity permission to assume a role.\n Currently, only an Amazon EC2 instance can assume a role.\n\n :type role_name: string\n :param role_name: Name of the role to update.\n\n :type policy_document: string\n :param policy_document: The policy that grants an entity permission to\n assume the role.\n '
return self.get_response('UpdateAssumeRolePolicy', {'RoleName': role_name, 'PolicyDocument': policy_document}) | Updates the policy that grants an entity permission to assume a role.
Currently, only an Amazon EC2 instance can assume a role.
:type role_name: string
:param role_name: Name of the role to update.
:type policy_document: string
:param policy_document: The policy that grants an entity permission to
assume the role. | platform/gsutil/third_party/boto/boto/iam/connection.py | update_assume_role_policy | bopopescu/google-cloud-sdk | 15 | python | def update_assume_role_policy(self, role_name, policy_document):
'\n Updates the policy that grants an entity permission to assume a role.\n Currently, only an Amazon EC2 instance can assume a role.\n\n :type role_name: string\n :param role_name: Name of the role to update.\n\n :type policy_document: string\n :param policy_document: The policy that grants an entity permission to\n assume the role.\n '
return self.get_response('UpdateAssumeRolePolicy', {'RoleName': role_name, 'PolicyDocument': policy_document}) | def update_assume_role_policy(self, role_name, policy_document):
'\n Updates the policy that grants an entity permission to assume a role.\n Currently, only an Amazon EC2 instance can assume a role.\n\n :type role_name: string\n :param role_name: Name of the role to update.\n\n :type policy_document: string\n :param policy_document: The policy that grants an entity permission to\n assume the role.\n '
return self.get_response('UpdateAssumeRolePolicy', {'RoleName': role_name, 'PolicyDocument': policy_document})<|docstring|>Updates the policy that grants an entity permission to assume a role.
Currently, only an Amazon EC2 instance can assume a role.
:type role_name: string
:param role_name: Name of the role to update.
:type policy_document: string
:param policy_document: The policy that grants an entity permission to
assume the role.<|endoftext|> |
c5e6a210b175c4f1c5666714ce36115070c1920007ad1bbbb07972c395e2a10f | def create_saml_provider(self, saml_metadata_document, name):
"\n Creates an IAM entity to describe an identity provider (IdP)\n that supports SAML 2.0.\n\n The SAML provider that you create with this operation can be\n used as a principal in a role's trust policy to establish a\n trust relationship between AWS and a SAML identity provider.\n You can create an IAM role that supports Web-based single\n sign-on (SSO) to the AWS Management Console or one that\n supports API access to AWS.\n\n When you create the SAML provider, you upload an a SAML\n metadata document that you get from your IdP and that includes\n the issuer's name, expiration information, and keys that can\n be used to validate the SAML authentication response\n (assertions) that are received from the IdP. You must generate\n the metadata document using the identity management software\n that is used as your organization's IdP.\n This operation requires `Signature Version 4`_.\n For more information, see `Giving Console Access Using SAML`_\n and `Creating Temporary Security Credentials for SAML\n Federation`_ in the Using Temporary Credentials guide.\n\n :type saml_metadata_document: string\n :param saml_metadata_document: An XML document generated by an identity\n provider (IdP) that supports SAML 2.0. The document includes the\n issuer's name, expiration information, and keys that can be used to\n validate the SAML authentication response (assertions) that are\n received from the IdP. You must generate the metadata document\n using the identity management software that is used as your\n organization's IdP.\n For more information, see `Creating Temporary Security Credentials for\n SAML Federation`_ in the Using Temporary Security Credentials\n guide.\n\n :type name: string\n :param name: The name of the provider to create.\n\n "
params = {'SAMLMetadataDocument': saml_metadata_document, 'Name': name}
return self.get_response('CreateSAMLProvider', params) | Creates an IAM entity to describe an identity provider (IdP)
that supports SAML 2.0.
The SAML provider that you create with this operation can be
used as a principal in a role's trust policy to establish a
trust relationship between AWS and a SAML identity provider.
You can create an IAM role that supports Web-based single
sign-on (SSO) to the AWS Management Console or one that
supports API access to AWS.
When you create the SAML provider, you upload an a SAML
metadata document that you get from your IdP and that includes
the issuer's name, expiration information, and keys that can
be used to validate the SAML authentication response
(assertions) that are received from the IdP. You must generate
the metadata document using the identity management software
that is used as your organization's IdP.
This operation requires `Signature Version 4`_.
For more information, see `Giving Console Access Using SAML`_
and `Creating Temporary Security Credentials for SAML
Federation`_ in the Using Temporary Credentials guide.
:type saml_metadata_document: string
:param saml_metadata_document: An XML document generated by an identity
provider (IdP) that supports SAML 2.0. The document includes the
issuer's name, expiration information, and keys that can be used to
validate the SAML authentication response (assertions) that are
received from the IdP. You must generate the metadata document
using the identity management software that is used as your
organization's IdP.
For more information, see `Creating Temporary Security Credentials for
SAML Federation`_ in the Using Temporary Security Credentials
guide.
:type name: string
:param name: The name of the provider to create. | platform/gsutil/third_party/boto/boto/iam/connection.py | create_saml_provider | bopopescu/google-cloud-sdk | 15 | python | def create_saml_provider(self, saml_metadata_document, name):
"\n Creates an IAM entity to describe an identity provider (IdP)\n that supports SAML 2.0.\n\n The SAML provider that you create with this operation can be\n used as a principal in a role's trust policy to establish a\n trust relationship between AWS and a SAML identity provider.\n You can create an IAM role that supports Web-based single\n sign-on (SSO) to the AWS Management Console or one that\n supports API access to AWS.\n\n When you create the SAML provider, you upload an a SAML\n metadata document that you get from your IdP and that includes\n the issuer's name, expiration information, and keys that can\n be used to validate the SAML authentication response\n (assertions) that are received from the IdP. You must generate\n the metadata document using the identity management software\n that is used as your organization's IdP.\n This operation requires `Signature Version 4`_.\n For more information, see `Giving Console Access Using SAML`_\n and `Creating Temporary Security Credentials for SAML\n Federation`_ in the Using Temporary Credentials guide.\n\n :type saml_metadata_document: string\n :param saml_metadata_document: An XML document generated by an identity\n provider (IdP) that supports SAML 2.0. The document includes the\n issuer's name, expiration information, and keys that can be used to\n validate the SAML authentication response (assertions) that are\n received from the IdP. You must generate the metadata document\n using the identity management software that is used as your\n organization's IdP.\n For more information, see `Creating Temporary Security Credentials for\n SAML Federation`_ in the Using Temporary Security Credentials\n guide.\n\n :type name: string\n :param name: The name of the provider to create.\n\n "
params = {'SAMLMetadataDocument': saml_metadata_document, 'Name': name}
return self.get_response('CreateSAMLProvider', params) | def create_saml_provider(self, saml_metadata_document, name):
"\n Creates an IAM entity to describe an identity provider (IdP)\n that supports SAML 2.0.\n\n The SAML provider that you create with this operation can be\n used as a principal in a role's trust policy to establish a\n trust relationship between AWS and a SAML identity provider.\n You can create an IAM role that supports Web-based single\n sign-on (SSO) to the AWS Management Console or one that\n supports API access to AWS.\n\n When you create the SAML provider, you upload an a SAML\n metadata document that you get from your IdP and that includes\n the issuer's name, expiration information, and keys that can\n be used to validate the SAML authentication response\n (assertions) that are received from the IdP. You must generate\n the metadata document using the identity management software\n that is used as your organization's IdP.\n This operation requires `Signature Version 4`_.\n For more information, see `Giving Console Access Using SAML`_\n and `Creating Temporary Security Credentials for SAML\n Federation`_ in the Using Temporary Credentials guide.\n\n :type saml_metadata_document: string\n :param saml_metadata_document: An XML document generated by an identity\n provider (IdP) that supports SAML 2.0. The document includes the\n issuer's name, expiration information, and keys that can be used to\n validate the SAML authentication response (assertions) that are\n received from the IdP. You must generate the metadata document\n using the identity management software that is used as your\n organization's IdP.\n For more information, see `Creating Temporary Security Credentials for\n SAML Federation`_ in the Using Temporary Security Credentials\n guide.\n\n :type name: string\n :param name: The name of the provider to create.\n\n "
params = {'SAMLMetadataDocument': saml_metadata_document, 'Name': name}
return self.get_response('CreateSAMLProvider', params)<|docstring|>Creates an IAM entity to describe an identity provider (IdP)
that supports SAML 2.0.
The SAML provider that you create with this operation can be
used as a principal in a role's trust policy to establish a
trust relationship between AWS and a SAML identity provider.
You can create an IAM role that supports Web-based single
sign-on (SSO) to the AWS Management Console or one that
supports API access to AWS.
When you create the SAML provider, you upload an a SAML
metadata document that you get from your IdP and that includes
the issuer's name, expiration information, and keys that can
be used to validate the SAML authentication response
(assertions) that are received from the IdP. You must generate
the metadata document using the identity management software
that is used as your organization's IdP.
This operation requires `Signature Version 4`_.
For more information, see `Giving Console Access Using SAML`_
and `Creating Temporary Security Credentials for SAML
Federation`_ in the Using Temporary Credentials guide.
:type saml_metadata_document: string
:param saml_metadata_document: An XML document generated by an identity
provider (IdP) that supports SAML 2.0. The document includes the
issuer's name, expiration information, and keys that can be used to
validate the SAML authentication response (assertions) that are
received from the IdP. You must generate the metadata document
using the identity management software that is used as your
organization's IdP.
For more information, see `Creating Temporary Security Credentials for
SAML Federation`_ in the Using Temporary Security Credentials
guide.
:type name: string
:param name: The name of the provider to create.<|endoftext|> |
0c964ed38989d4f2acc59c868db4b252cb13de9ef903a98fd128f4fcf92124f2 | def list_saml_providers(self):
'\n Lists the SAML providers in the account.\n This operation requires `Signature Version 4`_.\n '
return self.get_response('ListSAMLProviders', {}) | Lists the SAML providers in the account.
This operation requires `Signature Version 4`_. | platform/gsutil/third_party/boto/boto/iam/connection.py | list_saml_providers | bopopescu/google-cloud-sdk | 15 | python | def list_saml_providers(self):
'\n Lists the SAML providers in the account.\n This operation requires `Signature Version 4`_.\n '
return self.get_response('ListSAMLProviders', {}) | def list_saml_providers(self):
'\n Lists the SAML providers in the account.\n This operation requires `Signature Version 4`_.\n '
return self.get_response('ListSAMLProviders', {})<|docstring|>Lists the SAML providers in the account.
This operation requires `Signature Version 4`_.<|endoftext|> |
640335e1d9f12b0ad4ab0af0f1c2ee4aee93aa2ebaa210aec2a494234bdf3759 | def get_saml_provider(self, saml_provider_arn):
'\n Returns the SAML provider metadocument that was uploaded when\n the provider was created or updated.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to get information about.\n\n '
params = {'SAMLProviderArn': saml_provider_arn}
return self.get_response('GetSAMLProvider', params) | Returns the SAML provider metadocument that was uploaded when
the provider was created or updated.
This operation requires `Signature Version 4`_.
:type saml_provider_arn: string
:param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML
provider to get information about. | platform/gsutil/third_party/boto/boto/iam/connection.py | get_saml_provider | bopopescu/google-cloud-sdk | 15 | python | def get_saml_provider(self, saml_provider_arn):
'\n Returns the SAML provider metadocument that was uploaded when\n the provider was created or updated.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to get information about.\n\n '
params = {'SAMLProviderArn': saml_provider_arn}
return self.get_response('GetSAMLProvider', params) | def get_saml_provider(self, saml_provider_arn):
'\n Returns the SAML provider metadocument that was uploaded when\n the provider was created or updated.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to get information about.\n\n '
params = {'SAMLProviderArn': saml_provider_arn}
return self.get_response('GetSAMLProvider', params)<|docstring|>Returns the SAML provider metadocument that was uploaded when
the provider was created or updated.
This operation requires `Signature Version 4`_.
:type saml_provider_arn: string
:param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML
provider to get information about.<|endoftext|> |
028fc2d3e05ee5999f0ac96bd12a427fe9bb59dd5aab757250f6dbeb9f74ca54 | def update_saml_provider(self, saml_provider_arn, saml_metadata_document):
"\n Updates the metadata document for an existing SAML provider.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to update.\n\n :type saml_metadata_document: string\n :param saml_metadata_document: An XML document generated by an identity\n provider (IdP) that supports SAML 2.0. The document includes the\n issuer's name, expiration information, and keys that can be used to\n validate the SAML authentication response (assertions) that are\n received from the IdP. You must generate the metadata document\n using the identity management software that is used as your\n organization's IdP.\n\n "
params = {'SAMLMetadataDocument': saml_metadata_document, 'SAMLProviderArn': saml_provider_arn}
return self.get_response('UpdateSAMLProvider', params) | Updates the metadata document for an existing SAML provider.
This operation requires `Signature Version 4`_.
:type saml_provider_arn: string
:param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML
provider to update.
:type saml_metadata_document: string
:param saml_metadata_document: An XML document generated by an identity
provider (IdP) that supports SAML 2.0. The document includes the
issuer's name, expiration information, and keys that can be used to
validate the SAML authentication response (assertions) that are
received from the IdP. You must generate the metadata document
using the identity management software that is used as your
organization's IdP. | platform/gsutil/third_party/boto/boto/iam/connection.py | update_saml_provider | bopopescu/google-cloud-sdk | 15 | python | def update_saml_provider(self, saml_provider_arn, saml_metadata_document):
"\n Updates the metadata document for an existing SAML provider.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to update.\n\n :type saml_metadata_document: string\n :param saml_metadata_document: An XML document generated by an identity\n provider (IdP) that supports SAML 2.0. The document includes the\n issuer's name, expiration information, and keys that can be used to\n validate the SAML authentication response (assertions) that are\n received from the IdP. You must generate the metadata document\n using the identity management software that is used as your\n organization's IdP.\n\n "
params = {'SAMLMetadataDocument': saml_metadata_document, 'SAMLProviderArn': saml_provider_arn}
return self.get_response('UpdateSAMLProvider', params) | def update_saml_provider(self, saml_provider_arn, saml_metadata_document):
"\n Updates the metadata document for an existing SAML provider.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to update.\n\n :type saml_metadata_document: string\n :param saml_metadata_document: An XML document generated by an identity\n provider (IdP) that supports SAML 2.0. The document includes the\n issuer's name, expiration information, and keys that can be used to\n validate the SAML authentication response (assertions) that are\n received from the IdP. You must generate the metadata document\n using the identity management software that is used as your\n organization's IdP.\n\n "
params = {'SAMLMetadataDocument': saml_metadata_document, 'SAMLProviderArn': saml_provider_arn}
return self.get_response('UpdateSAMLProvider', params)<|docstring|>Updates the metadata document for an existing SAML provider.
This operation requires `Signature Version 4`_.
:type saml_provider_arn: string
:param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML
provider to update.
:type saml_metadata_document: string
:param saml_metadata_document: An XML document generated by an identity
provider (IdP) that supports SAML 2.0. The document includes the
issuer's name, expiration information, and keys that can be used to
validate the SAML authentication response (assertions) that are
received from the IdP. You must generate the metadata document
using the identity management software that is used as your
organization's IdP.<|endoftext|> |
a7a36870f4587da1d035c1307660accb1ce8ecb4bf02686c44fc3393c05a1f14 | def delete_saml_provider(self, saml_provider_arn):
'\n Deletes a SAML provider.\n\n Deleting the provider does not update any roles that reference\n the SAML provider as a principal in their trust policies. Any\n attempt to assume a role that references a SAML provider that\n has been deleted will fail.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to delete.\n\n '
params = {'SAMLProviderArn': saml_provider_arn}
return self.get_response('DeleteSAMLProvider', params) | Deletes a SAML provider.
Deleting the provider does not update any roles that reference
the SAML provider as a principal in their trust policies. Any
attempt to assume a role that references a SAML provider that
has been deleted will fail.
This operation requires `Signature Version 4`_.
:type saml_provider_arn: string
:param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML
provider to delete. | platform/gsutil/third_party/boto/boto/iam/connection.py | delete_saml_provider | bopopescu/google-cloud-sdk | 15 | python | def delete_saml_provider(self, saml_provider_arn):
'\n Deletes a SAML provider.\n\n Deleting the provider does not update any roles that reference\n the SAML provider as a principal in their trust policies. Any\n attempt to assume a role that references a SAML provider that\n has been deleted will fail.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to delete.\n\n '
params = {'SAMLProviderArn': saml_provider_arn}
return self.get_response('DeleteSAMLProvider', params) | def delete_saml_provider(self, saml_provider_arn):
'\n Deletes a SAML provider.\n\n Deleting the provider does not update any roles that reference\n the SAML provider as a principal in their trust policies. Any\n attempt to assume a role that references a SAML provider that\n has been deleted will fail.\n This operation requires `Signature Version 4`_.\n\n :type saml_provider_arn: string\n :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML\n provider to delete.\n\n '
params = {'SAMLProviderArn': saml_provider_arn}
return self.get_response('DeleteSAMLProvider', params)<|docstring|>Deletes a SAML provider.
Deleting the provider does not update any roles that reference
the SAML provider as a principal in their trust policies. Any
attempt to assume a role that references a SAML provider that
has been deleted will fail.
This operation requires `Signature Version 4`_.
:type saml_provider_arn: string
:param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML
provider to delete.<|endoftext|> |
0993b56b3c1f5027e9ca776beab783b40a979165822f76499c394c75dee0e280 | def test_data(self):
'Verify a sample file is created.'
path = os.path.join(FILES, 'mine.yml')
if os.path.exists(path):
os.remove(path)
data = Data()
yorm.sync(data, path)
itunes = Application('itunes')
itunes.versions.mac = ''
itunes.versions.windows = 'iTunes.exe'
iphoto = Application('iphoto')
iphoto.versions.mac = 'iPhoto'
mac = Computer('macbook', 'Other.local')
mac2 = Computer('macbook-pro')
configuration = ProgramConfig()
configuration.applications = [itunes, iphoto]
configuration.computers = [mac, mac2]
data.config = configuration
mac_state = State('macbook-pro')
mac_state.timestamp.started = 444
itunes_status = Status('itunes')
itunes_status.computers = [mac_state]
status = ProgramStatus()
status.applications = [itunes_status]
status.counter = 499
data.status = status
assert os.path.exists(path) | Verify a sample file is created. | tests/test_all.py | test_data | jacebrowning/mine | 18 | python | def test_data(self):
path = os.path.join(FILES, 'mine.yml')
if os.path.exists(path):
os.remove(path)
data = Data()
yorm.sync(data, path)
itunes = Application('itunes')
itunes.versions.mac =
itunes.versions.windows = 'iTunes.exe'
iphoto = Application('iphoto')
iphoto.versions.mac = 'iPhoto'
mac = Computer('macbook', 'Other.local')
mac2 = Computer('macbook-pro')
configuration = ProgramConfig()
configuration.applications = [itunes, iphoto]
configuration.computers = [mac, mac2]
data.config = configuration
mac_state = State('macbook-pro')
mac_state.timestamp.started = 444
itunes_status = Status('itunes')
itunes_status.computers = [mac_state]
status = ProgramStatus()
status.applications = [itunes_status]
status.counter = 499
data.status = status
assert os.path.exists(path) | def test_data(self):
path = os.path.join(FILES, 'mine.yml')
if os.path.exists(path):
os.remove(path)
data = Data()
yorm.sync(data, path)
itunes = Application('itunes')
itunes.versions.mac =
itunes.versions.windows = 'iTunes.exe'
iphoto = Application('iphoto')
iphoto.versions.mac = 'iPhoto'
mac = Computer('macbook', 'Other.local')
mac2 = Computer('macbook-pro')
configuration = ProgramConfig()
configuration.applications = [itunes, iphoto]
configuration.computers = [mac, mac2]
data.config = configuration
mac_state = State('macbook-pro')
mac_state.timestamp.started = 444
itunes_status = Status('itunes')
itunes_status.computers = [mac_state]
status = ProgramStatus()
status.applications = [itunes_status]
status.counter = 499
data.status = status
assert os.path.exists(path)<|docstring|>Verify a sample file is created.<|endoftext|> |
7648edc1cb5b26adf829dc893562fac0281cc956d00dcf480e86d4227ea64465 | def test_data_out(self):
'Verify a sample file is created.'
path = os.path.join(FILES, 'mine-out.yml')
if os.path.exists(path):
os.remove(path)
data = Data()
yorm.sync(data, path)
itunes = Application('itunes')
itunes.versions.mac = ''
itunes.versions.windows = 'iTunes.exe'
iphoto = Application('iphoto')
iphoto.versions.mac = 'iPhoto'
mac = Computer('macbook', 'Jaces-MacBook', 'AA:BB:CC:DD:EE:FF')
mac2 = Computer('macbook-pro', 'Jaces-MacBook-2', '11:22:33:44:55:66')
configuration = ProgramConfig()
configuration.applications = [itunes, iphoto]
configuration.computers = [mac, mac2]
data.config = configuration
mac_state = State('macbook-pro')
mac_state.timestamp.started = 444
itunes_status = Status('itunes')
itunes_status.computers = [mac_state]
status = ProgramStatus()
status.applications = [itunes_status]
status.counter = 499
data.status = status
assert os.path.exists(path) | Verify a sample file is created. | tests/test_all.py | test_data_out | jacebrowning/mine | 18 | python | def test_data_out(self):
path = os.path.join(FILES, 'mine-out.yml')
if os.path.exists(path):
os.remove(path)
data = Data()
yorm.sync(data, path)
itunes = Application('itunes')
itunes.versions.mac =
itunes.versions.windows = 'iTunes.exe'
iphoto = Application('iphoto')
iphoto.versions.mac = 'iPhoto'
mac = Computer('macbook', 'Jaces-MacBook', 'AA:BB:CC:DD:EE:FF')
mac2 = Computer('macbook-pro', 'Jaces-MacBook-2', '11:22:33:44:55:66')
configuration = ProgramConfig()
configuration.applications = [itunes, iphoto]
configuration.computers = [mac, mac2]
data.config = configuration
mac_state = State('macbook-pro')
mac_state.timestamp.started = 444
itunes_status = Status('itunes')
itunes_status.computers = [mac_state]
status = ProgramStatus()
status.applications = [itunes_status]
status.counter = 499
data.status = status
assert os.path.exists(path) | def test_data_out(self):
path = os.path.join(FILES, 'mine-out.yml')
if os.path.exists(path):
os.remove(path)
data = Data()
yorm.sync(data, path)
itunes = Application('itunes')
itunes.versions.mac =
itunes.versions.windows = 'iTunes.exe'
iphoto = Application('iphoto')
iphoto.versions.mac = 'iPhoto'
mac = Computer('macbook', 'Jaces-MacBook', 'AA:BB:CC:DD:EE:FF')
mac2 = Computer('macbook-pro', 'Jaces-MacBook-2', '11:22:33:44:55:66')
configuration = ProgramConfig()
configuration.applications = [itunes, iphoto]
configuration.computers = [mac, mac2]
data.config = configuration
mac_state = State('macbook-pro')
mac_state.timestamp.started = 444
itunes_status = Status('itunes')
itunes_status.computers = [mac_state]
status = ProgramStatus()
status.applications = [itunes_status]
status.counter = 499
data.status = status
assert os.path.exists(path)<|docstring|>Verify a sample file is created.<|endoftext|> |
550d3341fa10e5ce2602088702d9e51bcba2d86f01cd0f30bf15c6ee002ee629 | def test_data_in(self):
'Verify a sample file is loaded.'
path = os.path.join(FILES, 'mine-in.yml')
data = Data()
yorm.sync(data, path)
assert data.config.applications
for application in data.config.applications:
if (application.name == 'slack'):
break
else:
assert False | Verify a sample file is loaded. | tests/test_all.py | test_data_in | jacebrowning/mine | 18 | python | def test_data_in(self):
path = os.path.join(FILES, 'mine-in.yml')
data = Data()
yorm.sync(data, path)
assert data.config.applications
for application in data.config.applications:
if (application.name == 'slack'):
break
else:
assert False | def test_data_in(self):
path = os.path.join(FILES, 'mine-in.yml')
data = Data()
yorm.sync(data, path)
assert data.config.applications
for application in data.config.applications:
if (application.name == 'slack'):
break
else:
assert False<|docstring|>Verify a sample file is loaded.<|endoftext|> |
202dd0ae277ae35794388d6215c45a50381b395b5bb425435189aad7764ceec2 | def _store_data(self):
'Set up initial data file for tests.'
self.data = Data()
self.data.config.applications.append(self.application)
self.computer = self.data.config.computers.get_current()
yorm.sync(self.data, self.path) | Set up initial data file for tests. | tests/test_all.py | _store_data | jacebrowning/mine | 18 | python | def _store_data(self):
self.data = Data()
self.data.config.applications.append(self.application)
self.computer = self.data.config.computers.get_current()
yorm.sync(self.data, self.path) | def _store_data(self):
self.data = Data()
self.data.config.applications.append(self.application)
self.computer = self.data.config.computers.get_current()
yorm.sync(self.data, self.path)<|docstring|>Set up initial data file for tests.<|endoftext|> |
a40b967cd7e12821a4dba568cd3c0694c3a3b98d6a220c7df68f8742aadcf5d1 | def _fetch_data(self):
'Read the final data file back for verification.'
data = Data()
yorm.sync(data, self.path)
return data | Read the final data file back for verification. | tests/test_all.py | _fetch_data | jacebrowning/mine | 18 | python | def _fetch_data(self):
data = Data()
yorm.sync(data, self.path)
return data | def _fetch_data(self):
data = Data()
yorm.sync(data, self.path)
return data<|docstring|>Read the final data file back for verification.<|endoftext|> |
d50332c7ed8f7ec0c790b752b4fb409b8fd47c19811c24f33ec31dec6b30fe82 | def _start_application(self):
'Start the example application.'
if (not self._process):
self._process = subprocess.Popen(['yes'], stdout=subprocess.PIPE)
log.info('%s is started', self.application) | Start the example application. | tests/test_all.py | _start_application | jacebrowning/mine | 18 | python | def _start_application(self):
if (not self._process):
self._process = subprocess.Popen(['yes'], stdout=subprocess.PIPE)
log.info('%s is started', self.application) | def _start_application(self):
if (not self._process):
self._process = subprocess.Popen(['yes'], stdout=subprocess.PIPE)
log.info('%s is started', self.application)<|docstring|>Start the example application.<|endoftext|> |
5c6e85119433fbb773f334a38ad7f76ba85cc47fb5d2edf430b1a0063fefd976 | def _stop_application(self):
'Stop the example application.'
if self._process:
if (self._process.poll() is None):
self._process.kill()
self._process = None
log.info('%s is stopped', self.application) | Stop the example application. | tests/test_all.py | _stop_application | jacebrowning/mine | 18 | python | def _stop_application(self):
if self._process:
if (self._process.poll() is None):
self._process.kill()
self._process = None
log.info('%s is stopped', self.application) | def _stop_application(self):
if self._process:
if (self._process.poll() is None):
self._process.kill()
self._process = None
log.info('%s is stopped', self.application)<|docstring|>Stop the example application.<|endoftext|> |
27e88a48dc3f78ae077f6dbc59d3a023922d6300dd4ae22effa33ba961ddf22a | def _is_application_running(self):
'Determine if the sample application is running.'
return (self._process and (self._process.poll() is None)) | Determine if the sample application is running. | tests/test_all.py | _is_application_running | jacebrowning/mine | 18 | python | def _is_application_running(self):
return (self._process and (self._process.poll() is None)) | def _is_application_running(self):
return (self._process and (self._process.poll() is None))<|docstring|>Determine if the sample application is running.<|endoftext|> |
3d7de5030155ba900c4cada841699450e6175c840003291d0344382181c7f4aa | def teardown_method(self, _):
'Stop the sample application and clean up the file.'
self._stop_application()
if os.path.exists(self.path):
os.remove(self.path) | Stop the sample application and clean up the file. | tests/test_all.py | teardown_method | jacebrowning/mine | 18 | python | def teardown_method(self, _):
self._stop_application()
if os.path.exists(self.path):
os.remove(self.path) | def teardown_method(self, _):
self._stop_application()
if os.path.exists(self.path):
os.remove(self.path)<|docstring|>Stop the sample application and clean up the file.<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.