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
bfe14d2d205a7f2cf929776335cdaf08018715c94d9c21acd5b8bd8a5fb5684e
def __init__(self, n_neurons, eps=1e-05): '\n Initializes CustomBatchNormManualModule object.\n\n Args:\n n_neurons: int specifying the number of neurons\n eps: small float to be added to the variance for stability\n ' super(CustomBatchNormManualModule, self).__init__() self.n_neurons = n_neurons self.eps = eps self.beta = nn.Parameter(torch.zeros(self.n_neurons)) self.gamma = nn.Parameter(torch.ones(self.n_neurons))
Initializes CustomBatchNormManualModule object. Args: n_neurons: int specifying the number of neurons eps: small float to be added to the variance for stability
assignment_1/custom_batchnorm.py
__init__
RaymondKoopmanschap/DL_assignment_code
0
python
def __init__(self, n_neurons, eps=1e-05): '\n Initializes CustomBatchNormManualModule object.\n\n Args:\n n_neurons: int specifying the number of neurons\n eps: small float to be added to the variance for stability\n ' super(CustomBatchNormManualModule, self).__init__() self.n_neurons = n_neurons self.eps = eps self.beta = nn.Parameter(torch.zeros(self.n_neurons)) self.gamma = nn.Parameter(torch.ones(self.n_neurons))
def __init__(self, n_neurons, eps=1e-05): '\n Initializes CustomBatchNormManualModule object.\n\n Args:\n n_neurons: int specifying the number of neurons\n eps: small float to be added to the variance for stability\n ' super(CustomBatchNormManualModule, self).__init__() self.n_neurons = n_neurons self.eps = eps self.beta = nn.Parameter(torch.zeros(self.n_neurons)) self.gamma = nn.Parameter(torch.ones(self.n_neurons))<|docstring|>Initializes CustomBatchNormManualModule object. Args: n_neurons: int specifying the number of neurons eps: small float to be added to the variance for stability<|endoftext|>
8e67ea31cca7138cae58b31700b35358c1d65b76ad3ac3c4e0e1c0db7d687005
def forward(self, input): '\n Compute the batch normalization via CustomBatchNormManualFunction\n\n Args:\n input: input tensor of shape (n_batch, n_neurons)\n Returns:\n out: batch-normalized tensor\n ' assert (input.shape[1] == self.n_neurons) batch_norm_custom = CustomBatchNormManualFunction() out = batch_norm_custom.apply(input, self.gamma, self.beta, self.eps) return out
Compute the batch normalization via CustomBatchNormManualFunction Args: input: input tensor of shape (n_batch, n_neurons) Returns: out: batch-normalized tensor
assignment_1/custom_batchnorm.py
forward
RaymondKoopmanschap/DL_assignment_code
0
python
def forward(self, input): '\n Compute the batch normalization via CustomBatchNormManualFunction\n\n Args:\n input: input tensor of shape (n_batch, n_neurons)\n Returns:\n out: batch-normalized tensor\n ' assert (input.shape[1] == self.n_neurons) batch_norm_custom = CustomBatchNormManualFunction() out = batch_norm_custom.apply(input, self.gamma, self.beta, self.eps) return out
def forward(self, input): '\n Compute the batch normalization via CustomBatchNormManualFunction\n\n Args:\n input: input tensor of shape (n_batch, n_neurons)\n Returns:\n out: batch-normalized tensor\n ' assert (input.shape[1] == self.n_neurons) batch_norm_custom = CustomBatchNormManualFunction() out = batch_norm_custom.apply(input, self.gamma, self.beta, self.eps) return out<|docstring|>Compute the batch normalization via CustomBatchNormManualFunction Args: input: input tensor of shape (n_batch, n_neurons) Returns: out: batch-normalized tensor<|endoftext|>
0c6014da3a27b0678b2a662918e4bdae97b2e801ab6d8bc64ab0630a006ad9e1
def from_class(*, save_callback: bool=False, return_as: ReturnAs=1, loop: typing.Optional[asyncio.AbstractEventLoop]=None) -> typing.Callable[(..., typing.Callable[(..., typing.Any)])]: '``|decorator|``\n\n Parameters:\n -----------\n save_callback: :class:`bool` = False [Keyword only]\n If True, will keep the function callback.\n\n return_as: :class:`ReturnAs` = 1 [Keyword only]\n Returns an object depending on the selected type.\n\n loop: :class:`typing.Optional[asyncio.AbstractEventLoop]` = None [Keyword only]\n Asyncio loop.\n ' def inner(cls: typing.Callable[(..., typing.Any)]) -> typing.Callable[(..., typing.Any)]: @functools.wraps(cls) def wrapper(*args: typing.Any, **kwargs: typing.Any) -> FromClassInstance: cfg = {'cls': cls(*args, **kwargs), 'save_callback': save_callback, 'return_as': return_as, 'loop': loop} return FromClass(**cfg).invoke_and_hook_all(*args, **kwargs) return wrapper return inner
``|decorator|`` Parameters: ----------- save_callback: :class:`bool` = False [Keyword only] If True, will keep the function callback. return_as: :class:`ReturnAs` = 1 [Keyword only] Returns an object depending on the selected type. loop: :class:`typing.Optional[asyncio.AbstractEventLoop]` = None [Keyword only] Asyncio loop.
multibar/core/ext/from_class.py
from_class
Animatea/DiscordProgressbar
12
python
def from_class(*, save_callback: bool=False, return_as: ReturnAs=1, loop: typing.Optional[asyncio.AbstractEventLoop]=None) -> typing.Callable[(..., typing.Callable[(..., typing.Any)])]: '``|decorator|``\n\n Parameters:\n -----------\n save_callback: :class:`bool` = False [Keyword only]\n If True, will keep the function callback.\n\n return_as: :class:`ReturnAs` = 1 [Keyword only]\n Returns an object depending on the selected type.\n\n loop: :class:`typing.Optional[asyncio.AbstractEventLoop]` = None [Keyword only]\n Asyncio loop.\n ' def inner(cls: typing.Callable[(..., typing.Any)]) -> typing.Callable[(..., typing.Any)]: @functools.wraps(cls) def wrapper(*args: typing.Any, **kwargs: typing.Any) -> FromClassInstance: cfg = {'cls': cls(*args, **kwargs), 'save_callback': save_callback, 'return_as': return_as, 'loop': loop} return FromClass(**cfg).invoke_and_hook_all(*args, **kwargs) return wrapper return inner
def from_class(*, save_callback: bool=False, return_as: ReturnAs=1, loop: typing.Optional[asyncio.AbstractEventLoop]=None) -> typing.Callable[(..., typing.Callable[(..., typing.Any)])]: '``|decorator|``\n\n Parameters:\n -----------\n save_callback: :class:`bool` = False [Keyword only]\n If True, will keep the function callback.\n\n return_as: :class:`ReturnAs` = 1 [Keyword only]\n Returns an object depending on the selected type.\n\n loop: :class:`typing.Optional[asyncio.AbstractEventLoop]` = None [Keyword only]\n Asyncio loop.\n ' def inner(cls: typing.Callable[(..., typing.Any)]) -> typing.Callable[(..., typing.Any)]: @functools.wraps(cls) def wrapper(*args: typing.Any, **kwargs: typing.Any) -> FromClassInstance: cfg = {'cls': cls(*args, **kwargs), 'save_callback': save_callback, 'return_as': return_as, 'loop': loop} return FromClass(**cfg).invoke_and_hook_all(*args, **kwargs) return wrapper return inner<|docstring|>``|decorator|`` Parameters: ----------- save_callback: :class:`bool` = False [Keyword only] If True, will keep the function callback. return_as: :class:`ReturnAs` = 1 [Keyword only] Returns an object depending on the selected type. loop: :class:`typing.Optional[asyncio.AbstractEventLoop]` = None [Keyword only] Asyncio loop.<|endoftext|>
47e3186a5884d2f31dcaba30d1abbe792b23fb3e4f4cc6d56d220595d733f0be
@classmethod def from_dict(cls: typing.Type[Chars[T]], instance: typing.Any, chars: CharsSnowflake) -> Chars[T]: '``|classmethod|``\n\n The second way is to pass characters to create a progress bar.\n\n Example of usage:\n -----------------\n ```py\n\n [Optional] from bar.core.variants import FromClassBase\n\n @from_class()\n class Example(FromClassBase):\n ("\n Example of usage `from_class` deco.\n It is not necessary to inherit from FromClassBase,\n it is only necessary for the convenience of working\n with methods inside the class and to avoid various\n warnings from mypy.\n ")\n\n async def foo(self):\n self.now(self, 10)\n self.needed(self, 100)\n self.chars.from_dict(\n self,\n {\'fill\': \'+\', \'line\': \'-\'}\n )\n\n example = Example()\n print(example.foo)\n ++------------------\n ' return cls(instance, **chars)
``|classmethod|`` The second way is to pass characters to create a progress bar. Example of usage: ----------------- ```py [Optional] from bar.core.variants import FromClassBase @from_class() class Example(FromClassBase): (" Example of usage `from_class` deco. It is not necessary to inherit from FromClassBase, it is only necessary for the convenience of working with methods inside the class and to avoid various warnings from mypy. ") async def foo(self): self.now(self, 10) self.needed(self, 100) self.chars.from_dict( self, {'fill': '+', 'line': '-'} ) example = Example() print(example.foo) ++------------------
multibar/core/ext/from_class.py
from_dict
Animatea/DiscordProgressbar
12
python
@classmethod def from_dict(cls: typing.Type[Chars[T]], instance: typing.Any, chars: CharsSnowflake) -> Chars[T]: '``|classmethod|``\n\n The second way is to pass characters to create a progress bar.\n\n Example of usage:\n -----------------\n ```py\n\n [Optional] from bar.core.variants import FromClassBase\n\n @from_class()\n class Example(FromClassBase):\n ("\n Example of usage `from_class` deco.\n It is not necessary to inherit from FromClassBase,\n it is only necessary for the convenience of working\n with methods inside the class and to avoid various\n warnings from mypy.\n ")\n\n async def foo(self):\n self.now(self, 10)\n self.needed(self, 100)\n self.chars.from_dict(\n self,\n {\'fill\': \'+\', \'line\': \'-\'}\n )\n\n example = Example()\n print(example.foo)\n ++------------------\n ' return cls(instance, **chars)
@classmethod def from_dict(cls: typing.Type[Chars[T]], instance: typing.Any, chars: CharsSnowflake) -> Chars[T]: '``|classmethod|``\n\n The second way is to pass characters to create a progress bar.\n\n Example of usage:\n -----------------\n ```py\n\n [Optional] from bar.core.variants import FromClassBase\n\n @from_class()\n class Example(FromClassBase):\n ("\n Example of usage `from_class` deco.\n It is not necessary to inherit from FromClassBase,\n it is only necessary for the convenience of working\n with methods inside the class and to avoid various\n warnings from mypy.\n ")\n\n async def foo(self):\n self.now(self, 10)\n self.needed(self, 100)\n self.chars.from_dict(\n self,\n {\'fill\': \'+\', \'line\': \'-\'}\n )\n\n example = Example()\n print(example.foo)\n ++------------------\n ' return cls(instance, **chars)<|docstring|>``|classmethod|`` The second way is to pass characters to create a progress bar. Example of usage: ----------------- ```py [Optional] from bar.core.variants import FromClassBase @from_class() class Example(FromClassBase): (" Example of usage `from_class` deco. It is not necessary to inherit from FromClassBase, it is only necessary for the convenience of working with methods inside the class and to avoid various warnings from mypy. ") async def foo(self): self.now(self, 10) self.needed(self, 100) self.chars.from_dict( self, {'fill': '+', 'line': '-'} ) example = Example() print(example.foo) ++------------------<|endoftext|>
3a8223ad63cc183cf83773453e21a7f5dffcbc37966ab9e0074b07fa6ea8a422
def invoke_and_hook_all(self, *args: typing.Any, **kwargs: typing.Any) -> FromClassInstance: '``|method|``\n\n The main method where all methods are called and their values are set.\n ' for c in itertools.filterfalse((lambda i: i.startswith('_')), dir((base := FromClassSetup()))): setattr(self.__cls, c, getattr(base, c)) for method_name in dir(self.__cls): if all(((not method_name.startswith('_')), (not hasattr((method := getattr(self.__cls, method_name)), '__progress_object__')), (not hasattr(method, '__progress_ignored__')), inspect.ismethod(method))): try: if inspect.iscoroutinefunction(method): callback = asyncio.run(method(*args, **kwargs)) else: callback = method(*args, **kwargs) except Exception as exc: raise errors.ProgressInvokeError(exc) from exc wrapped_callback = asyncio.run(self.wrap_callback(self.__cls, callback)) if (self.__return_as == CallbackAs.default): setattr(self.__cls, method.__name__, wrapped_callback) elif (self.__return_as == CallbackAs.callable): setattr(self.__cls, method.__name__, AsCallable(wrapped_callback)) elif (self.__return_as == CallbackAs.awaitable): setattr(self.__cls, method.__name__, to_async(loop=self.__loop)((lambda : wrapped_callback))) else: raise errors.BadCallbackTypeSpecified(self.__return_as, 'Literal[1, 2, 3]') return self.__cls
``|method|`` The main method where all methods are called and their values are set.
multibar/core/ext/from_class.py
invoke_and_hook_all
Animatea/DiscordProgressbar
12
python
def invoke_and_hook_all(self, *args: typing.Any, **kwargs: typing.Any) -> FromClassInstance: '``|method|``\n\n The main method where all methods are called and their values are set.\n ' for c in itertools.filterfalse((lambda i: i.startswith('_')), dir((base := FromClassSetup()))): setattr(self.__cls, c, getattr(base, c)) for method_name in dir(self.__cls): if all(((not method_name.startswith('_')), (not hasattr((method := getattr(self.__cls, method_name)), '__progress_object__')), (not hasattr(method, '__progress_ignored__')), inspect.ismethod(method))): try: if inspect.iscoroutinefunction(method): callback = asyncio.run(method(*args, **kwargs)) else: callback = method(*args, **kwargs) except Exception as exc: raise errors.ProgressInvokeError(exc) from exc wrapped_callback = asyncio.run(self.wrap_callback(self.__cls, callback)) if (self.__return_as == CallbackAs.default): setattr(self.__cls, method.__name__, wrapped_callback) elif (self.__return_as == CallbackAs.callable): setattr(self.__cls, method.__name__, AsCallable(wrapped_callback)) elif (self.__return_as == CallbackAs.awaitable): setattr(self.__cls, method.__name__, to_async(loop=self.__loop)((lambda : wrapped_callback))) else: raise errors.BadCallbackTypeSpecified(self.__return_as, 'Literal[1, 2, 3]') return self.__cls
def invoke_and_hook_all(self, *args: typing.Any, **kwargs: typing.Any) -> FromClassInstance: '``|method|``\n\n The main method where all methods are called and their values are set.\n ' for c in itertools.filterfalse((lambda i: i.startswith('_')), dir((base := FromClassSetup()))): setattr(self.__cls, c, getattr(base, c)) for method_name in dir(self.__cls): if all(((not method_name.startswith('_')), (not hasattr((method := getattr(self.__cls, method_name)), '__progress_object__')), (not hasattr(method, '__progress_ignored__')), inspect.ismethod(method))): try: if inspect.iscoroutinefunction(method): callback = asyncio.run(method(*args, **kwargs)) else: callback = method(*args, **kwargs) except Exception as exc: raise errors.ProgressInvokeError(exc) from exc wrapped_callback = asyncio.run(self.wrap_callback(self.__cls, callback)) if (self.__return_as == CallbackAs.default): setattr(self.__cls, method.__name__, wrapped_callback) elif (self.__return_as == CallbackAs.callable): setattr(self.__cls, method.__name__, AsCallable(wrapped_callback)) elif (self.__return_as == CallbackAs.awaitable): setattr(self.__cls, method.__name__, to_async(loop=self.__loop)((lambda : wrapped_callback))) else: raise errors.BadCallbackTypeSpecified(self.__return_as, 'Literal[1, 2, 3]') return self.__cls<|docstring|>``|method|`` The main method where all methods are called and their values are set.<|endoftext|>
a159827409a7044408d07df58d85b49b477d09b28bdd57b93de525d218123601
async def wrap_callback(self, instance: FromClassInstance, callback: typing.Union[(PackArgs, ProgressObject)], /) -> typing.Union[(PackArgs, ProgressObject)]: '``|coro|``\n\n The method in which we wrap the callback by setting a new value to it.\n\n Parameters:\n -----------\n instance: :class:`FromClassInstance` [Positional only]\n The state of the class from which the parameters will be taken.\n\n callback: :class:`typing.Union[PackArgs, ProgressObject]` [Positional only]\n Initial function callback.\n ' deque = getattr(instance, 'deque_param', None) length = getattr(instance, 'length_param', None) chars = getattr(instance, 'chars_param', None) bar: ProgressBar = ProgressBar(instance.now_param.value, instance.needed_param.value, length=(20 if (not hasattr(length, 'value')) else length.value), deque=(False if (not hasattr(length, 'value')) else deque.value)) progress = (await bar.async_write_progress((ProgressTemplates.ADVANCED if (not hasattr(chars, 'value')) else chars.value))) if self.__save_callback: return PackArgs(callback=callback, progress=progress) else: return progress
``|coro|`` The method in which we wrap the callback by setting a new value to it. Parameters: ----------- instance: :class:`FromClassInstance` [Positional only] The state of the class from which the parameters will be taken. callback: :class:`typing.Union[PackArgs, ProgressObject]` [Positional only] Initial function callback.
multibar/core/ext/from_class.py
wrap_callback
Animatea/DiscordProgressbar
12
python
async def wrap_callback(self, instance: FromClassInstance, callback: typing.Union[(PackArgs, ProgressObject)], /) -> typing.Union[(PackArgs, ProgressObject)]: '``|coro|``\n\n The method in which we wrap the callback by setting a new value to it.\n\n Parameters:\n -----------\n instance: :class:`FromClassInstance` [Positional only]\n The state of the class from which the parameters will be taken.\n\n callback: :class:`typing.Union[PackArgs, ProgressObject]` [Positional only]\n Initial function callback.\n ' deque = getattr(instance, 'deque_param', None) length = getattr(instance, 'length_param', None) chars = getattr(instance, 'chars_param', None) bar: ProgressBar = ProgressBar(instance.now_param.value, instance.needed_param.value, length=(20 if (not hasattr(length, 'value')) else length.value), deque=(False if (not hasattr(length, 'value')) else deque.value)) progress = (await bar.async_write_progress((ProgressTemplates.ADVANCED if (not hasattr(chars, 'value')) else chars.value))) if self.__save_callback: return PackArgs(callback=callback, progress=progress) else: return progress
async def wrap_callback(self, instance: FromClassInstance, callback: typing.Union[(PackArgs, ProgressObject)], /) -> typing.Union[(PackArgs, ProgressObject)]: '``|coro|``\n\n The method in which we wrap the callback by setting a new value to it.\n\n Parameters:\n -----------\n instance: :class:`FromClassInstance` [Positional only]\n The state of the class from which the parameters will be taken.\n\n callback: :class:`typing.Union[PackArgs, ProgressObject]` [Positional only]\n Initial function callback.\n ' deque = getattr(instance, 'deque_param', None) length = getattr(instance, 'length_param', None) chars = getattr(instance, 'chars_param', None) bar: ProgressBar = ProgressBar(instance.now_param.value, instance.needed_param.value, length=(20 if (not hasattr(length, 'value')) else length.value), deque=(False if (not hasattr(length, 'value')) else deque.value)) progress = (await bar.async_write_progress((ProgressTemplates.ADVANCED if (not hasattr(chars, 'value')) else chars.value))) if self.__save_callback: return PackArgs(callback=callback, progress=progress) else: return progress<|docstring|>``|coro|`` The method in which we wrap the callback by setting a new value to it. Parameters: ----------- instance: :class:`FromClassInstance` [Positional only] The state of the class from which the parameters will be taken. callback: :class:`typing.Union[PackArgs, ProgressObject]` [Positional only] Initial function callback.<|endoftext|>
54d966b665781a3b2d93cc0284400271355a1d0ecbb1068842c11327947c36eb
def session_manager(func): '\n Check if session has been passed by calling function,\n if true, then reuse same session,\n else fetch a new session and handle session commit/rollback\n :param func:\n :return:\n ' @functools.wraps(func) def wrapper_session_manager(*args, **kwargs): if ((len(args) > 0) and isinstance(args[0], Session)): value = func(*args, **kwargs) return value else: with session_scope() as session: value = func(session, *args, **kwargs) return value return wrapper_session_manager
Check if session has been passed by calling function, if true, then reuse same session, else fetch a new session and handle session commit/rollback :param func: :return:
paranuara_challenge/services/db/session_manager.py
session_manager
sapangupta15/paranuara_planet
0
python
def session_manager(func): '\n Check if session has been passed by calling function,\n if true, then reuse same session,\n else fetch a new session and handle session commit/rollback\n :param func:\n :return:\n ' @functools.wraps(func) def wrapper_session_manager(*args, **kwargs): if ((len(args) > 0) and isinstance(args[0], Session)): value = func(*args, **kwargs) return value else: with session_scope() as session: value = func(session, *args, **kwargs) return value return wrapper_session_manager
def session_manager(func): '\n Check if session has been passed by calling function,\n if true, then reuse same session,\n else fetch a new session and handle session commit/rollback\n :param func:\n :return:\n ' @functools.wraps(func) def wrapper_session_manager(*args, **kwargs): if ((len(args) > 0) and isinstance(args[0], Session)): value = func(*args, **kwargs) return value else: with session_scope() as session: value = func(session, *args, **kwargs) return value return wrapper_session_manager<|docstring|>Check if session has been passed by calling function, if true, then reuse same session, else fetch a new session and handle session commit/rollback :param func: :return:<|endoftext|>
f301813ea7d2459967f26586b4d4dcd837f6195cfb5989788f970f9a0b443c4a
def apply_one_op(): 'Populate a popup menu with the names of currently applicable\n operators, and let the user choose which one to apply.' currently_applicable_ops = applicable_ops(CURRENT_STATE) print('Now need to apply the op')
Populate a popup menu with the names of currently applicable operators, and let the user choose which one to apply.
AutoPlayer.py
apply_one_op
emowen4/InfoFlow
2
python
def apply_one_op(): 'Populate a popup menu with the names of currently applicable\n operators, and let the user choose which one to apply.' currently_applicable_ops = applicable_ops(CURRENT_STATE) print('Now need to apply the op')
def apply_one_op(): 'Populate a popup menu with the names of currently applicable\n operators, and let the user choose which one to apply.' currently_applicable_ops = applicable_ops(CURRENT_STATE) print('Now need to apply the op')<|docstring|>Populate a popup menu with the names of currently applicable operators, and let the user choose which one to apply.<|endoftext|>
b735db8ad0e3ef1b6cfd2014d58e68dc37dff2eb4f3fd8b81d42893056a5e1ba
def applicable_ops(s): 'Returns the subset of OPERATORS whose preconditions are\n satisfied by the state s.' return [o for o in OPERATORS if o.is_applicable(s)]
Returns the subset of OPERATORS whose preconditions are satisfied by the state s.
AutoPlayer.py
applicable_ops
emowen4/InfoFlow
2
python
def applicable_ops(s): 'Returns the subset of OPERATORS whose preconditions are\n satisfied by the state s.' return [o for o in OPERATORS if o.is_applicable(s)]
def applicable_ops(s): 'Returns the subset of OPERATORS whose preconditions are\n satisfied by the state s.' return [o for o in OPERATORS if o.is_applicable(s)]<|docstring|>Returns the subset of OPERATORS whose preconditions are satisfied by the state s.<|endoftext|>
6d8f6b189aa602e86f8b1ef060d3764c226d6f23a4c27b9baf05f4f3a215a953
def set_togglebar(self): 'Adds paired QPushbuttons to toggle the current display' layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) for (title, attrname) in WIDGETS: slot = partial(self.clicked, attrname) button = widgets.ClickButton(title, slot, checkable=True) layout.addWidget(button) setattr(self, attrname, button)
Adds paired QPushbuttons to toggle the current display
xldlib/gui/views/discoverer/crosslinkers.py
set_togglebar
Alexhuszagh/XLDiscoverer
0
python
def set_togglebar(self): layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) for (title, attrname) in WIDGETS: slot = partial(self.clicked, attrname) button = widgets.ClickButton(title, slot, checkable=True) layout.addWidget(button) setattr(self, attrname, button)
def set_togglebar(self): layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) for (title, attrname) in WIDGETS: slot = partial(self.clicked, attrname) button = widgets.ClickButton(title, slot, checkable=True) layout.addWidget(button) setattr(self, attrname, button)<|docstring|>Adds paired QPushbuttons to toggle the current display<|endoftext|>
f21e172fe7711103dd3e74abec7da3e5e8bb531326159fd189ef041e2dd67f97
def clicked(self, key): '\n Changes the current hierarchical/level_separated checksattes\n and the input_files backing store.\n ' self.view = key self.toggle_checkstate() self.parent().change_view()
Changes the current hierarchical/level_separated checksattes and the input_files backing store.
xldlib/gui/views/discoverer/crosslinkers.py
clicked
Alexhuszagh/XLDiscoverer
0
python
def clicked(self, key): '\n Changes the current hierarchical/level_separated checksattes\n and the input_files backing store.\n ' self.view = key self.toggle_checkstate() self.parent().change_view()
def clicked(self, key): '\n Changes the current hierarchical/level_separated checksattes\n and the input_files backing store.\n ' self.view = key self.toggle_checkstate() self.parent().change_view()<|docstring|>Changes the current hierarchical/level_separated checksattes and the input_files backing store.<|endoftext|>
18974648d09421554d12de98082589e7900a685184a14a7475e798e4769cd7c8
def toggle_checkstate(self): '\n Toggles the current checkstates for the level_separated/hierarchical\n input mods\n ' self.crosslinkers.setChecked(self.crosslinker) self.isotope_labeling.setChecked((not self.crosslinker))
Toggles the current checkstates for the level_separated/hierarchical input mods
xldlib/gui/views/discoverer/crosslinkers.py
toggle_checkstate
Alexhuszagh/XLDiscoverer
0
python
def toggle_checkstate(self): '\n Toggles the current checkstates for the level_separated/hierarchical\n input mods\n ' self.crosslinkers.setChecked(self.crosslinker) self.isotope_labeling.setChecked((not self.crosslinker))
def toggle_checkstate(self): '\n Toggles the current checkstates for the level_separated/hierarchical\n input mods\n ' self.crosslinkers.setChecked(self.crosslinker) self.isotope_labeling.setChecked((not self.crosslinker))<|docstring|>Toggles the current checkstates for the level_separated/hierarchical input mods<|endoftext|>
b86dec833b09a41702d18af92b7bf24aea27354aca5128e877d091eb25022def
def set_crosslinkers(self, interval=2): 'Adds the crosslinkers to the current layout' self.crosslinkers = [] for (id_, crosslinker) in chemical_defs.CROSSLINKERS.items(): button = CrossLinkerButton(crosslinker, self) self.crosslinkers.append(button) if (id_ % interval): layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) layout.addWidget(button)
Adds the crosslinkers to the current layout
xldlib/gui/views/discoverer/crosslinkers.py
set_crosslinkers
Alexhuszagh/XLDiscoverer
0
python
def set_crosslinkers(self, interval=2): self.crosslinkers = [] for (id_, crosslinker) in chemical_defs.CROSSLINKERS.items(): button = CrossLinkerButton(crosslinker, self) self.crosslinkers.append(button) if (id_ % interval): layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) layout.addWidget(button)
def set_crosslinkers(self, interval=2): self.crosslinkers = [] for (id_, crosslinker) in chemical_defs.CROSSLINKERS.items(): button = CrossLinkerButton(crosslinker, self) self.crosslinkers.append(button) if (id_ % interval): layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) layout.addWidget(button)<|docstring|>Adds the crosslinkers to the current layout<|endoftext|>
57eac2732def2a0241d80eaea9dd683a7300a0f5bf4f11fa8ad852c1de4d32b1
@decorators.overloaded def changesize(self): 'Changes the crosslinker widget sizes upon window size changes' for crosslinker in self.crosslinkers: crosslinker.resize()
Changes the crosslinker widget sizes upon window size changes
xldlib/gui/views/discoverer/crosslinkers.py
changesize
Alexhuszagh/XLDiscoverer
0
python
@decorators.overloaded def changesize(self): for crosslinker in self.crosslinkers: crosslinker.resize()
@decorators.overloaded def changesize(self): for crosslinker in self.crosslinkers: crosslinker.resize()<|docstring|>Changes the crosslinker widget sizes upon window size changes<|endoftext|>
ec2c005af0de6753184eac92e9aa5b78c917b13d2ba0c9799ce807d96f141711
def closeEvent(self, event): 'On editing of the QcomboBox::lineEdit()' self.profile.removenulls() event.accept()
On editing of the QcomboBox::lineEdit()
xldlib/gui/views/discoverer/crosslinkers.py
closeEvent
Alexhuszagh/XLDiscoverer
0
python
def closeEvent(self, event): self.profile.removenulls() event.accept()
def closeEvent(self, event): self.profile.removenulls() event.accept()<|docstring|>On editing of the QcomboBox::lineEdit()<|endoftext|>
350d9c40005a1defd1d50ea1a18c5aadc8ac25ec0094db59fe939a457256937e
def save(self): 'Saves the current profile' self.profile.removenulls() if (self.index not in chemical_defs.PROFILES): chemical_defs.PROFILES[self.index] = self.profile self.view.profile_combo.appendnew() self.table.reset_view() chemical_defs.PROFILES.save()
Saves the current profile
xldlib/gui/views/discoverer/crosslinkers.py
save
Alexhuszagh/XLDiscoverer
0
python
def save(self): self.profile.removenulls() if (self.index not in chemical_defs.PROFILES): chemical_defs.PROFILES[self.index] = self.profile self.view.profile_combo.appendnew() self.table.reset_view() chemical_defs.PROFILES.save()
def save(self): self.profile.removenulls() if (self.index not in chemical_defs.PROFILES): chemical_defs.PROFILES[self.index] = self.profile self.view.profile_combo.appendnew() self.table.reset_view() chemical_defs.PROFILES.save()<|docstring|>Saves the current profile<|endoftext|>
9f6b40a1c5552e778e21bedc9b0d6d57878e24714a5db8600d24fffad6f5a441
def set_header(self): 'Adds a header to the layout' self.header = widgets.Banner('Crosslinker & Labeling Settings') self.layout.addWidget(self.header)
Adds a header to the layout
xldlib/gui/views/discoverer/crosslinkers.py
set_header
Alexhuszagh/XLDiscoverer
0
python
def set_header(self): self.header = widgets.Banner('Crosslinker & Labeling Settings') self.layout.addWidget(self.header)
def set_header(self): self.header = widgets.Banner('Crosslinker & Labeling Settings') self.layout.addWidget(self.header)<|docstring|>Adds a header to the layout<|endoftext|>
4bc1f1e34e493e9ed3f5cb2a8f592b3ce3da46e633584e90462a7754a9e00f24
def set_view(self): 'Sets the selection view' if self.quantitative: cls = VIEWS[self.qt['crosslinker_view']] self.view = cls(self) self.layout.insertWidget(4, self.view) else: self.view = SelectCrosslinkersView(self) self.layout.insertWidget(2, self.view)
Sets the selection view
xldlib/gui/views/discoverer/crosslinkers.py
set_view
Alexhuszagh/XLDiscoverer
0
python
def set_view(self): if self.quantitative: cls = VIEWS[self.qt['crosslinker_view']] self.view = cls(self) self.layout.insertWidget(4, self.view) else: self.view = SelectCrosslinkersView(self) self.layout.insertWidget(2, self.view)
def set_view(self): if self.quantitative: cls = VIEWS[self.qt['crosslinker_view']] self.view = cls(self) self.layout.insertWidget(4, self.view) else: self.view = SelectCrosslinkersView(self) self.layout.insertWidget(2, self.view)<|docstring|>Sets the selection view<|endoftext|>
a785884318da6aa87fb2b51e4bc3228ef9b2adbe8f5033b52edd6c0bab4de7b4
def set_editbar(self): 'Adds a bar to edit/delete crosslinkers' self.edit_bar = widgets.Widget() layout = QtGui.QHBoxLayout() self.edit_bar.setLayout(layout) self.layout.addWidget(self.edit_bar) edit = widgets.StandardButton('Add/Edit Crosslinker') layout.addWidget(edit) delete = widgets.StandardButton('Delete Crosslinker') layout.addWidget(delete)
Adds a bar to edit/delete crosslinkers
xldlib/gui/views/discoverer/crosslinkers.py
set_editbar
Alexhuszagh/XLDiscoverer
0
python
def set_editbar(self): self.edit_bar = widgets.Widget() layout = QtGui.QHBoxLayout() self.edit_bar.setLayout(layout) self.layout.addWidget(self.edit_bar) edit = widgets.StandardButton('Add/Edit Crosslinker') layout.addWidget(edit) delete = widgets.StandardButton('Delete Crosslinker') layout.addWidget(delete)
def set_editbar(self): self.edit_bar = widgets.Widget() layout = QtGui.QHBoxLayout() self.edit_bar.setLayout(layout) self.layout.addWidget(self.edit_bar) edit = widgets.StandardButton('Add/Edit Crosslinker') layout.addWidget(edit) delete = widgets.StandardButton('Delete Crosslinker') layout.addWidget(delete)<|docstring|>Adds a bar to edit/delete crosslinkers<|endoftext|>
6d7bf4e5e6ec0305783a501c97b509ab91652d89570a0c3ed63a421a8ac75051
def set_divider(self): 'Adds a distinct divider to the layout' self.divider = widgets.SunkenDivider(self) self.layout.addWidget(self.divider)
Adds a distinct divider to the layout
xldlib/gui/views/discoverer/crosslinkers.py
set_divider
Alexhuszagh/XLDiscoverer
0
python
def set_divider(self): self.divider = widgets.SunkenDivider(self) self.layout.addWidget(self.divider)
def set_divider(self): self.divider = widgets.SunkenDivider(self) self.layout.addWidget(self.divider)<|docstring|>Adds a distinct divider to the layout<|endoftext|>
4f54fbbe7e2cd38a73bede81bb83841ab11ba72de576b78c8588b5c0a1ff4294
def set_savebar(self): 'Adds a return/save bar to the layout' layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) done_editing = widgets.ClickButton('Done Editing', self.close) layout.addWidget(done_editing) save = widgets.ClickButton('Save', self.save) layout.addWidget(save)
Adds a return/save bar to the layout
xldlib/gui/views/discoverer/crosslinkers.py
set_savebar
Alexhuszagh/XLDiscoverer
0
python
def set_savebar(self): layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) done_editing = widgets.ClickButton('Done Editing', self.close) layout.addWidget(done_editing) save = widgets.ClickButton('Save', self.save) layout.addWidget(save)
def set_savebar(self): layout = QtGui.QHBoxLayout() self.layout.addLayout(layout) done_editing = widgets.ClickButton('Done Editing', self.close) layout.addWidget(done_editing) save = widgets.ClickButton('Save', self.save) layout.addWidget(save)<|docstring|>Adds a return/save bar to the layout<|endoftext|>
5b7366e0af65b2d8eb110a11647f3928596c4788cbae58a8547e04531efbc9b5
def change_view(self): 'Changes the view after changing the view switch' self.view.hide() self.layout.removeWidget(self.view) self.view.deleteLater() del self.view if hasattr(self, 'edit_bar'): for attrname in ('edit_bar', 'divider'): attr = getattr(self, attrname) if self.crosslinker: attr.show() else: attr.hide() self.set_view()
Changes the view after changing the view switch
xldlib/gui/views/discoverer/crosslinkers.py
change_view
Alexhuszagh/XLDiscoverer
0
python
def change_view(self): self.view.hide() self.layout.removeWidget(self.view) self.view.deleteLater() del self.view if hasattr(self, 'edit_bar'): for attrname in ('edit_bar', 'divider'): attr = getattr(self, attrname) if self.crosslinker: attr.show() else: attr.hide() self.set_view()
def change_view(self): self.view.hide() self.layout.removeWidget(self.view) self.view.deleteLater() del self.view if hasattr(self, 'edit_bar'): for attrname in ('edit_bar', 'divider'): attr = getattr(self, attrname) if self.crosslinker: attr.show() else: attr.hide() self.set_view()<|docstring|>Changes the view after changing the view switch<|endoftext|>
45ee47cfb24d14431a223442653d00a1c9b984ee34e98c8370d90db3459fbb7f
def closeEvent(self, event): 'Shows the parent menu widget upon a close event' self.view.close() self.closed.emit(self) event.accept()
Shows the parent menu widget upon a close event
xldlib/gui/views/discoverer/crosslinkers.py
closeEvent
Alexhuszagh/XLDiscoverer
0
python
def closeEvent(self, event): self.view.close() self.closed.emit(self) event.accept()
def closeEvent(self, event): self.view.close() self.closed.emit(self) event.accept()<|docstring|>Shows the parent menu widget upon a close event<|endoftext|>
dc8dbe27700e7dc37c9d0bcdf110cbbe6adf6e7ac81b56572da387cd448c4fc7
def GetUserProfile(self, userId, **kwargs): 'Get user profile\n\n Args:\n userId, str: User GUID (required)\n \n Returns: UserInfoResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
Get user profile Args: userId, str: User GUID (required) Returns: UserInfoResponse
groupdocs/MgmtApi.py
GetUserProfile
groupdocs-legacy-sdk/python
0
python
def GetUserProfile(self, userId, **kwargs): 'Get user profile\n\n Args:\n userId, str: User GUID (required)\n \n Returns: UserInfoResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
def GetUserProfile(self, userId, **kwargs): 'Get user profile\n\n Args:\n userId, str: User GUID (required)\n \n Returns: UserInfoResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject<|docstring|>Get user profile Args: userId, str: User GUID (required) Returns: UserInfoResponse<|endoftext|>
02d4c9185aa0439046f0b1ab4a540f6a137b6677b6253cab27d8f28239b82639
def UpdateUserProfile(self, userId, body, **kwargs): 'Update user profile\n\n Args:\n userId, str: User GUID (required)\n body, UserInfo: Info (required)\n \n Returns: UpdateUserResponse\n ' if ((userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateUserResponse') return responseObject
Update user profile Args: userId, str: User GUID (required) body, UserInfo: Info (required) Returns: UpdateUserResponse
groupdocs/MgmtApi.py
UpdateUserProfile
groupdocs-legacy-sdk/python
0
python
def UpdateUserProfile(self, userId, body, **kwargs): 'Update user profile\n\n Args:\n userId, str: User GUID (required)\n body, UserInfo: Info (required)\n \n Returns: UpdateUserResponse\n ' if ((userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateUserResponse') return responseObject
def UpdateUserProfile(self, userId, body, **kwargs): 'Update user profile\n\n Args:\n userId, str: User GUID (required)\n body, UserInfo: Info (required)\n \n Returns: UpdateUserResponse\n ' if ((userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateUserResponse') return responseObject<|docstring|>Update user profile Args: userId, str: User GUID (required) body, UserInfo: Info (required) Returns: UpdateUserResponse<|endoftext|>
727e45a2b8abe3d547246656b24b18e5e4d23d3e9a231968ab8d2d2fc19dba87
def Revoke(self, userId, **kwargs): 'Revoke private key\n\n Args:\n userId, str: User GUID (required)\n \n Returns: RevokeResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method Revoke" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/revoke'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'RevokeResponse') return responseObject
Revoke private key Args: userId, str: User GUID (required) Returns: RevokeResponse
groupdocs/MgmtApi.py
Revoke
groupdocs-legacy-sdk/python
0
python
def Revoke(self, userId, **kwargs): 'Revoke private key\n\n Args:\n userId, str: User GUID (required)\n \n Returns: RevokeResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method Revoke" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/revoke'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'RevokeResponse') return responseObject
def Revoke(self, userId, **kwargs): 'Revoke private key\n\n Args:\n userId, str: User GUID (required)\n \n Returns: RevokeResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method Revoke" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/revoke'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'RevokeResponse') return responseObject<|docstring|>Revoke private key Args: userId, str: User GUID (required) Returns: RevokeResponse<|endoftext|>
eee9142509c45f0065e73afc595eef98446c74529ffac9db5a2e4bde73ce94d3
def ChangeUserPassword(self, userId, body, **kwargs): 'Change user password\n\n Args:\n userId, str: User GUID (required)\n body, UserPasswordInfo: Password (required)\n \n Returns: ChangePasswordResponse\n ' if ((userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ChangeUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile/password'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ChangePasswordResponse') return responseObject
Change user password Args: userId, str: User GUID (required) body, UserPasswordInfo: Password (required) Returns: ChangePasswordResponse
groupdocs/MgmtApi.py
ChangeUserPassword
groupdocs-legacy-sdk/python
0
python
def ChangeUserPassword(self, userId, body, **kwargs): 'Change user password\n\n Args:\n userId, str: User GUID (required)\n body, UserPasswordInfo: Password (required)\n \n Returns: ChangePasswordResponse\n ' if ((userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ChangeUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile/password'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ChangePasswordResponse') return responseObject
def ChangeUserPassword(self, userId, body, **kwargs): 'Change user password\n\n Args:\n userId, str: User GUID (required)\n body, UserPasswordInfo: Password (required)\n \n Returns: ChangePasswordResponse\n ' if ((userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ChangeUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/profile/password'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ChangePasswordResponse') return responseObject<|docstring|>Change user password Args: userId, str: User GUID (required) body, UserPasswordInfo: Password (required) Returns: ChangePasswordResponse<|endoftext|>
6782aef0f6aba179a270ac11dd875869345644732fad3c0b5f7fb0f527daa3ef
def GetUserProfileByResetToken(self, callerId, token, **kwargs): 'Get user profile by reset token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByResetToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/reset-tokens?token={token}'.replace('*', '') pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
Get user profile by reset token Args: callerId, str: Caller GUID (required) token, str: Token (required) Returns: UserInfoResponse
groupdocs/MgmtApi.py
GetUserProfileByResetToken
groupdocs-legacy-sdk/python
0
python
def GetUserProfileByResetToken(self, callerId, token, **kwargs): 'Get user profile by reset token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByResetToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/reset-tokens?token={token}'.replace('*', ) pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
def GetUserProfileByResetToken(self, callerId, token, **kwargs): 'Get user profile by reset token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByResetToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/reset-tokens?token={token}'.replace('*', ) pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject<|docstring|>Get user profile by reset token Args: callerId, str: Caller GUID (required) token, str: Token (required) Returns: UserInfoResponse<|endoftext|>
f4e41d1748ab3c225726a26cb0fc5142a3c4e06cfcdcbbdf679cc8d3d7ad4866
def GetUserProfileByVerifToken(self, callerId, token, **kwargs): 'Get user profile by verif token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByVerifToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/verif-tokens?token={token}'.replace('*', '') pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
Get user profile by verif token Args: callerId, str: Caller GUID (required) token, str: Token (required) Returns: UserInfoResponse
groupdocs/MgmtApi.py
GetUserProfileByVerifToken
groupdocs-legacy-sdk/python
0
python
def GetUserProfileByVerifToken(self, callerId, token, **kwargs): 'Get user profile by verif token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByVerifToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/verif-tokens?token={token}'.replace('*', ) pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
def GetUserProfileByVerifToken(self, callerId, token, **kwargs): 'Get user profile by verif token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByVerifToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/verif-tokens?token={token}'.replace('*', ) pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject<|docstring|>Get user profile by verif token Args: callerId, str: Caller GUID (required) token, str: Token (required) Returns: UserInfoResponse<|endoftext|>
68cf0cfaafb77497bb132409c78bf1df043c402d6fb6c019c05fdcacf7f377b2
def GetUserProfileByClaimedToken(self, callerId, token, **kwargs): 'Get user profile by claimed token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByClaimedToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/claimed-tokens?token={token}'.replace('*', '') pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
Get user profile by claimed token Args: callerId, str: Caller GUID (required) token, str: Token (required) Returns: UserInfoResponse
groupdocs/MgmtApi.py
GetUserProfileByClaimedToken
groupdocs-legacy-sdk/python
0
python
def GetUserProfileByClaimedToken(self, callerId, token, **kwargs): 'Get user profile by claimed token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByClaimedToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/claimed-tokens?token={token}'.replace('*', ) pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
def GetUserProfileByClaimedToken(self, callerId, token, **kwargs): 'Get user profile by claimed token\n\n Args:\n callerId, str: Caller GUID (required)\n token, str: Token (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (token == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'token'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserProfileByClaimedToken" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/claimed-tokens?token={token}'.replace('*', ) pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('token' in params): queryParams['token'] = self.apiClient.toPathValue(params['token']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject<|docstring|>Get user profile by claimed token Args: callerId, str: Caller GUID (required) token, str: Token (required) Returns: UserInfoResponse<|endoftext|>
fad44162e722d4886bdf3148c560be0a4f8678c6543681eb7986a526bc9cdcb2
def GetAlienUserProfile(self, callerId, userId, **kwargs): 'Get alien user profile\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAlienUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/profile'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
Get alien user profile Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) Returns: UserInfoResponse
groupdocs/MgmtApi.py
GetAlienUserProfile
groupdocs-legacy-sdk/python
0
python
def GetAlienUserProfile(self, callerId, userId, **kwargs): 'Get alien user profile\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAlienUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/profile'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
def GetAlienUserProfile(self, callerId, userId, **kwargs): 'Get alien user profile\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAlienUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/profile'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject<|docstring|>Get alien user profile Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) Returns: UserInfoResponse<|endoftext|>
ef801ef1c2d18c5737f05b0dd9001ea7b383bff722a9ea07e6d373d755fc772a
def UpdateAlienUserProfile(self, callerId, userId, body, **kwargs): 'Update alien user profile\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, UserInfo: Info (required)\n \n Returns: UpdateUserResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateAlienUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/profile'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateUserResponse') return responseObject
Update alien user profile Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) body, UserInfo: Info (required) Returns: UpdateUserResponse
groupdocs/MgmtApi.py
UpdateAlienUserProfile
groupdocs-legacy-sdk/python
0
python
def UpdateAlienUserProfile(self, callerId, userId, body, **kwargs): 'Update alien user profile\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, UserInfo: Info (required)\n \n Returns: UpdateUserResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateAlienUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/profile'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateUserResponse') return responseObject
def UpdateAlienUserProfile(self, callerId, userId, body, **kwargs): 'Update alien user profile\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, UserInfo: Info (required)\n \n Returns: UpdateUserResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateAlienUserProfile" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/profile'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateUserResponse') return responseObject<|docstring|>Update alien user profile Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) body, UserInfo: Info (required) Returns: UpdateUserResponse<|endoftext|>
c4fc8581f44b2c5e875d707bbf2c90e3b99010c488f398646f5b4f8010dad2cc
def CreateUser(self, callerId, body, **kwargs): 'Create user\n\n Args:\n callerId, str: Caller GUID (required)\n body, UserInfo: Payload (required)\n \n Returns: CreateUserResponse\n ' if ((callerId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method CreateUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'CreateUserResponse') return responseObject
Create user Args: callerId, str: Caller GUID (required) body, UserInfo: Payload (required) Returns: CreateUserResponse
groupdocs/MgmtApi.py
CreateUser
groupdocs-legacy-sdk/python
0
python
def CreateUser(self, callerId, body, **kwargs): 'Create user\n\n Args:\n callerId, str: Caller GUID (required)\n body, UserInfo: Payload (required)\n \n Returns: CreateUserResponse\n ' if ((callerId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method CreateUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'CreateUserResponse') return responseObject
def CreateUser(self, callerId, body, **kwargs): 'Create user\n\n Args:\n callerId, str: Caller GUID (required)\n body, UserInfo: Payload (required)\n \n Returns: CreateUserResponse\n ' if ((callerId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method CreateUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'CreateUserResponse') return responseObject<|docstring|>Create user Args: callerId, str: Caller GUID (required) body, UserInfo: Payload (required) Returns: CreateUserResponse<|endoftext|>
6a55bd1abfae603de96f0064a7da45e89beb78373158298ade7f6ac977ec0a87
def CreateUserLogin(self, callerId, userId, password, **kwargs): 'Create user login\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User name (required)\n password, str: Password (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (userId == None) or (password == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'password'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method CreateUserLogin" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/logins'.replace('*', '') pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('password' in params): queryParams['password'] = self.apiClient.toPathValue(params['password']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
Create user login Args: callerId, str: Caller GUID (required) userId, str: User name (required) password, str: Password (required) Returns: UserInfoResponse
groupdocs/MgmtApi.py
CreateUserLogin
groupdocs-legacy-sdk/python
0
python
def CreateUserLogin(self, callerId, userId, password, **kwargs): 'Create user login\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User name (required)\n password, str: Password (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (userId == None) or (password == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'password'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method CreateUserLogin" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/logins'.replace('*', ) pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('password' in params): queryParams['password'] = self.apiClient.toPathValue(params['password']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject
def CreateUserLogin(self, callerId, userId, password, **kwargs): 'Create user login\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User name (required)\n password, str: Password (required)\n \n Returns: UserInfoResponse\n ' if ((callerId == None) or (userId == None) or (password == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'password'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method CreateUserLogin" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/logins'.replace('*', ) pos = resourcePath.find('?') if (pos != (- 1)): resourcePath = resourcePath[0:pos] resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('password' in params): queryParams['password'] = self.apiClient.toPathValue(params['password']) if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UserInfoResponse') return responseObject<|docstring|>Create user login Args: callerId, str: Caller GUID (required) userId, str: User name (required) password, str: Password (required) Returns: UserInfoResponse<|endoftext|>
22b3efb7b66e840f9f91bb6bb0eb6bea983821a98e8a515a4a0357786bae3a05
def ChangeAlienUserPassword(self, callerId, userId, body, **kwargs): 'Change alien user password\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, UserPasswordInfo: Password (required)\n \n Returns: ChangePasswordResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ChangeAlienUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/password'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ChangePasswordResponse') return responseObject
Change alien user password Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) body, UserPasswordInfo: Password (required) Returns: ChangePasswordResponse
groupdocs/MgmtApi.py
ChangeAlienUserPassword
groupdocs-legacy-sdk/python
0
python
def ChangeAlienUserPassword(self, callerId, userId, body, **kwargs): 'Change alien user password\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, UserPasswordInfo: Password (required)\n \n Returns: ChangePasswordResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ChangeAlienUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/password'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ChangePasswordResponse') return responseObject
def ChangeAlienUserPassword(self, callerId, userId, body, **kwargs): 'Change alien user password\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, UserPasswordInfo: Password (required)\n \n Returns: ChangePasswordResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ChangeAlienUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/password'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ChangePasswordResponse') return responseObject<|docstring|>Change alien user password Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) body, UserPasswordInfo: Password (required) Returns: ChangePasswordResponse<|endoftext|>
1738308fded350fe6b2e1d560f5ba353542802a1d8f1087ab0f8c4262dd5c2ac
def ResetUserPassword(self, callerId, userId, **kwargs): 'Reset user password\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: ResetPasswordResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ResetUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/password'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ResetPasswordResponse') return responseObject
Reset user password Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) Returns: ResetPasswordResponse
groupdocs/MgmtApi.py
ResetUserPassword
groupdocs-legacy-sdk/python
0
python
def ResetUserPassword(self, callerId, userId, **kwargs): 'Reset user password\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: ResetPasswordResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ResetUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/password'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ResetPasswordResponse') return responseObject
def ResetUserPassword(self, callerId, userId, **kwargs): 'Reset user password\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: ResetPasswordResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method ResetUserPassword" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/password'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'ResetPasswordResponse') return responseObject<|docstring|>Reset user password Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) Returns: ResetPasswordResponse<|endoftext|>
d7682b7fe1774db1fa81d114bd154afc7e74c7f6d167d31a323edcda03987448
def GetStorageProviders(self, userId, **kwargs): "Returns user's storage providers.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetStorageProvidersResponse\n " if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetStorageProviders" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetStorageProvidersResponse') return responseObject
Returns user's storage providers. Args: userId, str: User GUID (required) Returns: GetStorageProvidersResponse
groupdocs/MgmtApi.py
GetStorageProviders
groupdocs-legacy-sdk/python
0
python
def GetStorageProviders(self, userId, **kwargs): "Returns user's storage providers.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetStorageProvidersResponse\n " if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetStorageProviders" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetStorageProvidersResponse') return responseObject
def GetStorageProviders(self, userId, **kwargs): "Returns user's storage providers.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetStorageProvidersResponse\n " if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetStorageProviders" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetStorageProvidersResponse') return responseObject<|docstring|>Returns user's storage providers. Args: userId, str: User GUID (required) Returns: GetStorageProvidersResponse<|endoftext|>
d9d2ae8944f954d28f5bc8e99ea33fb8fca187afe5c6c7cdc944f2f32e5d1a61
def AddStorageProvider(self, userId, provider, body, **kwargs): 'Adds a new storage provider configuration.\n\n Args:\n userId, str: User GUID (required)\n provider, str: Storage provider name (required)\n body, StorageProviderInfo: Storage provider configuration details (required)\n \n Returns: AddStorageProviderResponse\n ' if ((userId == None) or (provider == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'provider', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method AddStorageProvider" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages/{provider}'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('provider' in params): replacement = str(self.apiClient.toPathValue(params['provider'])) resourcePath = resourcePath.replace((('{' + 'provider') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'AddStorageProviderResponse') return responseObject
Adds a new storage provider configuration. Args: userId, str: User GUID (required) provider, str: Storage provider name (required) body, StorageProviderInfo: Storage provider configuration details (required) Returns: AddStorageProviderResponse
groupdocs/MgmtApi.py
AddStorageProvider
groupdocs-legacy-sdk/python
0
python
def AddStorageProvider(self, userId, provider, body, **kwargs): 'Adds a new storage provider configuration.\n\n Args:\n userId, str: User GUID (required)\n provider, str: Storage provider name (required)\n body, StorageProviderInfo: Storage provider configuration details (required)\n \n Returns: AddStorageProviderResponse\n ' if ((userId == None) or (provider == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'provider', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method AddStorageProvider" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages/{provider}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('provider' in params): replacement = str(self.apiClient.toPathValue(params['provider'])) resourcePath = resourcePath.replace((('{' + 'provider') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'AddStorageProviderResponse') return responseObject
def AddStorageProvider(self, userId, provider, body, **kwargs): 'Adds a new storage provider configuration.\n\n Args:\n userId, str: User GUID (required)\n provider, str: Storage provider name (required)\n body, StorageProviderInfo: Storage provider configuration details (required)\n \n Returns: AddStorageProviderResponse\n ' if ((userId == None) or (provider == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'provider', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method AddStorageProvider" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages/{provider}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'POST' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('provider' in params): replacement = str(self.apiClient.toPathValue(params['provider'])) resourcePath = resourcePath.replace((('{' + 'provider') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'AddStorageProviderResponse') return responseObject<|docstring|>Adds a new storage provider configuration. Args: userId, str: User GUID (required) provider, str: Storage provider name (required) body, StorageProviderInfo: Storage provider configuration details (required) Returns: AddStorageProviderResponse<|endoftext|>
2208fddcecdced4db2cb491e5a6b786737e831f98d00c7914953db18f457d189
def UpdateStorageProvider(self, userId, provider, body, **kwargs): "Updates user's storage provider configuration.\n\n Args:\n userId, str: User GUID (required)\n provider, str: Storage provider name (required)\n body, StorageProviderInfo: Storage provider configuration details (required)\n \n Returns: UpdateStorageProviderResponse\n " if ((userId == None) or (provider == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'provider', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateStorageProvider" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages/{provider}'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('provider' in params): replacement = str(self.apiClient.toPathValue(params['provider'])) resourcePath = resourcePath.replace((('{' + 'provider') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateStorageProviderResponse') return responseObject
Updates user's storage provider configuration. Args: userId, str: User GUID (required) provider, str: Storage provider name (required) body, StorageProviderInfo: Storage provider configuration details (required) Returns: UpdateStorageProviderResponse
groupdocs/MgmtApi.py
UpdateStorageProvider
groupdocs-legacy-sdk/python
0
python
def UpdateStorageProvider(self, userId, provider, body, **kwargs): "Updates user's storage provider configuration.\n\n Args:\n userId, str: User GUID (required)\n provider, str: Storage provider name (required)\n body, StorageProviderInfo: Storage provider configuration details (required)\n \n Returns: UpdateStorageProviderResponse\n " if ((userId == None) or (provider == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'provider', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateStorageProvider" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages/{provider}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('provider' in params): replacement = str(self.apiClient.toPathValue(params['provider'])) resourcePath = resourcePath.replace((('{' + 'provider') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateStorageProviderResponse') return responseObject
def UpdateStorageProvider(self, userId, provider, body, **kwargs): "Updates user's storage provider configuration.\n\n Args:\n userId, str: User GUID (required)\n provider, str: Storage provider name (required)\n body, StorageProviderInfo: Storage provider configuration details (required)\n \n Returns: UpdateStorageProviderResponse\n " if ((userId == None) or (provider == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'provider', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateStorageProvider" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/storages/{provider}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('provider' in params): replacement = str(self.apiClient.toPathValue(params['provider'])) resourcePath = resourcePath.replace((('{' + 'provider') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateStorageProviderResponse') return responseObject<|docstring|>Updates user's storage provider configuration. Args: userId, str: User GUID (required) provider, str: Storage provider name (required) body, StorageProviderInfo: Storage provider configuration details (required) Returns: UpdateStorageProviderResponse<|endoftext|>
33b0555a5e5662ca170488c6df1cae886cf8467eee0324ccfa39d437dce46414
def GetRoles(self, userId, **kwargs): 'Returns a list of user roles.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetRolesResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/roles'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetRolesResponse') return responseObject
Returns a list of user roles. Args: userId, str: User GUID (required) Returns: GetRolesResponse
groupdocs/MgmtApi.py
GetRoles
groupdocs-legacy-sdk/python
0
python
def GetRoles(self, userId, **kwargs): 'Returns a list of user roles.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetRolesResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/roles'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetRolesResponse') return responseObject
def GetRoles(self, userId, **kwargs): 'Returns a list of user roles.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetRolesResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/roles'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetRolesResponse') return responseObject<|docstring|>Returns a list of user roles. Args: userId, str: User GUID (required) Returns: GetRolesResponse<|endoftext|>
e480aaaf1e56294191721772cc484891dfbbde04cb066af8e6a2e477c9341ff3
def GetUserRoles(self, callerId, userId, **kwargs): 'Returns a list of user roles.\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: GetRolesResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/roles'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetRolesResponse') return responseObject
Returns a list of user roles. Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) Returns: GetRolesResponse
groupdocs/MgmtApi.py
GetUserRoles
groupdocs-legacy-sdk/python
0
python
def GetUserRoles(self, callerId, userId, **kwargs): 'Returns a list of user roles.\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: GetRolesResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/roles'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetRolesResponse') return responseObject
def GetUserRoles(self, callerId, userId, **kwargs): 'Returns a list of user roles.\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n \n Returns: GetRolesResponse\n ' if ((callerId == None) or (userId == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/roles'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetRolesResponse') return responseObject<|docstring|>Returns a list of user roles. Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) Returns: GetRolesResponse<|endoftext|>
f821a628d92e78f9e7d357109722868138987d0ec37a87ef3a989cb16cf9fae5
def SetUserRoles(self, callerId, userId, body, **kwargs): 'Set user roles.\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, List[RoleInfo]: A list of user roles (required)\n \n Returns: SetUserRolesResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method SetUserRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/roles'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'SetUserRolesResponse') return responseObject
Set user roles. Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) body, List[RoleInfo]: A list of user roles (required) Returns: SetUserRolesResponse
groupdocs/MgmtApi.py
SetUserRoles
groupdocs-legacy-sdk/python
0
python
def SetUserRoles(self, callerId, userId, body, **kwargs): 'Set user roles.\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, List[RoleInfo]: A list of user roles (required)\n \n Returns: SetUserRolesResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method SetUserRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/roles'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'SetUserRolesResponse') return responseObject
def SetUserRoles(self, callerId, userId, body, **kwargs): 'Set user roles.\n\n Args:\n callerId, str: Caller GUID (required)\n userId, str: User GUID (required)\n body, List[RoleInfo]: A list of user roles (required)\n \n Returns: SetUserRolesResponse\n ' if ((callerId == None) or (userId == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'userId', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method SetUserRoles" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/users/{userId}/roles'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'SetUserRolesResponse') return responseObject<|docstring|>Set user roles. Args: callerId, str: Caller GUID (required) userId, str: User GUID (required) body, List[RoleInfo]: A list of user roles (required) Returns: SetUserRolesResponse<|endoftext|>
091b3c89afbf724cecca3478b217987de408801078b325388337cf97e48fa7fb
def GetAccount(self, userId, **kwargs): 'Returns an account information.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetAccountResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAccount" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/account'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetAccountResponse') return responseObject
Returns an account information. Args: userId, str: User GUID (required) Returns: GetAccountResponse
groupdocs/MgmtApi.py
GetAccount
groupdocs-legacy-sdk/python
0
python
def GetAccount(self, userId, **kwargs): 'Returns an account information.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetAccountResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAccount" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/account'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetAccountResponse') return responseObject
def GetAccount(self, userId, **kwargs): 'Returns an account information.\n\n Args:\n userId, str: User GUID (required)\n \n Returns: GetAccountResponse\n ' if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAccount" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/account'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetAccountResponse') return responseObject<|docstring|>Returns an account information. Args: userId, str: User GUID (required) Returns: GetAccountResponse<|endoftext|>
c97763b113fbbd977da01fd350f4c0c5b856bc1f312674e883bd26fc39f55854
def DeleteAccount(self, userId, **kwargs): "Closes user's account.\n\n Args:\n userId, str: User global unique identifier (required)\n \n Returns: DeleteAccountResponse\n " if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method DeleteAccount" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/account'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'DeleteAccountResponse') return responseObject
Closes user's account. Args: userId, str: User global unique identifier (required) Returns: DeleteAccountResponse
groupdocs/MgmtApi.py
DeleteAccount
groupdocs-legacy-sdk/python
0
python
def DeleteAccount(self, userId, **kwargs): "Closes user's account.\n\n Args:\n userId, str: User global unique identifier (required)\n \n Returns: DeleteAccountResponse\n " if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method DeleteAccount" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/account'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'DeleteAccountResponse') return responseObject
def DeleteAccount(self, userId, **kwargs): "Closes user's account.\n\n Args:\n userId, str: User global unique identifier (required)\n \n Returns: DeleteAccountResponse\n " if (userId == None): raise ApiException(400, 'missing required parameters') allParams = ['userId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method DeleteAccount" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/account'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'DeleteAccountResponse') return responseObject<|docstring|>Closes user's account. Args: userId, str: User global unique identifier (required) Returns: DeleteAccountResponse<|endoftext|>
ca0bf2fe0da82110a3bf79493528139d12cb38503d7361eeb02d975beb09e205
def GetAccountUsers(self, adminId, **kwargs): 'Returns account user list.\n\n Args:\n adminId, str: Administrator GUID (required)\n \n Returns: GetAccountUsersResponse\n ' if (adminId == None): raise ApiException(400, 'missing required parameters') allParams = ['adminId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAccountUsers" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetAccountUsersResponse') return responseObject
Returns account user list. Args: adminId, str: Administrator GUID (required) Returns: GetAccountUsersResponse
groupdocs/MgmtApi.py
GetAccountUsers
groupdocs-legacy-sdk/python
0
python
def GetAccountUsers(self, adminId, **kwargs): 'Returns account user list.\n\n Args:\n adminId, str: Administrator GUID (required)\n \n Returns: GetAccountUsersResponse\n ' if (adminId == None): raise ApiException(400, 'missing required parameters') allParams = ['adminId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAccountUsers" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetAccountUsersResponse') return responseObject
def GetAccountUsers(self, adminId, **kwargs): 'Returns account user list.\n\n Args:\n adminId, str: Administrator GUID (required)\n \n Returns: GetAccountUsersResponse\n ' if (adminId == None): raise ApiException(400, 'missing required parameters') allParams = ['adminId'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetAccountUsers" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetAccountUsersResponse') return responseObject<|docstring|>Returns account user list. Args: adminId, str: Administrator GUID (required) Returns: GetAccountUsersResponse<|endoftext|>
736daba8efc9a8c2a3d81ab85cd6d5231a8ea2cc9d2a61ac2dd40519972a8614
def UpdateAccountUser(self, adminId, userName, body, **kwargs): 'Create or update account user.\n\n Args:\n adminId, str: Administrator GUID (required)\n userName, str: User name (required)\n body, UserInfo: User details (required)\n \n Returns: UpdateAccountUserResponse\n ' if ((adminId == None) or (userName == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['adminId', 'userName', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateAccountUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users/{userName}'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) if ('userName' in params): replacement = str(self.apiClient.toPathValue(params['userName'])) resourcePath = resourcePath.replace((('{' + 'userName') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateAccountUserResponse') return responseObject
Create or update account user. Args: adminId, str: Administrator GUID (required) userName, str: User name (required) body, UserInfo: User details (required) Returns: UpdateAccountUserResponse
groupdocs/MgmtApi.py
UpdateAccountUser
groupdocs-legacy-sdk/python
0
python
def UpdateAccountUser(self, adminId, userName, body, **kwargs): 'Create or update account user.\n\n Args:\n adminId, str: Administrator GUID (required)\n userName, str: User name (required)\n body, UserInfo: User details (required)\n \n Returns: UpdateAccountUserResponse\n ' if ((adminId == None) or (userName == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['adminId', 'userName', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateAccountUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users/{userName}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) if ('userName' in params): replacement = str(self.apiClient.toPathValue(params['userName'])) resourcePath = resourcePath.replace((('{' + 'userName') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateAccountUserResponse') return responseObject
def UpdateAccountUser(self, adminId, userName, body, **kwargs): 'Create or update account user.\n\n Args:\n adminId, str: Administrator GUID (required)\n userName, str: User name (required)\n body, UserInfo: User details (required)\n \n Returns: UpdateAccountUserResponse\n ' if ((adminId == None) or (userName == None) or (body == None)): raise ApiException(400, 'missing required parameters') allParams = ['adminId', 'userName', 'body'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method UpdateAccountUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users/{userName}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'PUT' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) if ('userName' in params): replacement = str(self.apiClient.toPathValue(params['userName'])) resourcePath = resourcePath.replace((('{' + 'userName') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'UpdateAccountUserResponse') return responseObject<|docstring|>Create or update account user. Args: adminId, str: Administrator GUID (required) userName, str: User name (required) body, UserInfo: User details (required) Returns: UpdateAccountUserResponse<|endoftext|>
4ff39687240b46a86670015541c220eb40764906eeb77a7b2e60d5e82a492df0
def DeleteAccountUser(self, adminId, userName, **kwargs): 'Delete account user.\n\n Args:\n adminId, str: Administrator GUID (required)\n userName, str: User name (required)\n \n Returns: DeleteAccountUserResponse\n ' if ((adminId == None) or (userName == None)): raise ApiException(400, 'missing required parameters') allParams = ['adminId', 'userName'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method DeleteAccountUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users/{userName}'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) if ('userName' in params): replacement = str(self.apiClient.toPathValue(params['userName'])) resourcePath = resourcePath.replace((('{' + 'userName') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'DeleteAccountUserResponse') return responseObject
Delete account user. Args: adminId, str: Administrator GUID (required) userName, str: User name (required) Returns: DeleteAccountUserResponse
groupdocs/MgmtApi.py
DeleteAccountUser
groupdocs-legacy-sdk/python
0
python
def DeleteAccountUser(self, adminId, userName, **kwargs): 'Delete account user.\n\n Args:\n adminId, str: Administrator GUID (required)\n userName, str: User name (required)\n \n Returns: DeleteAccountUserResponse\n ' if ((adminId == None) or (userName == None)): raise ApiException(400, 'missing required parameters') allParams = ['adminId', 'userName'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method DeleteAccountUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users/{userName}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) if ('userName' in params): replacement = str(self.apiClient.toPathValue(params['userName'])) resourcePath = resourcePath.replace((('{' + 'userName') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'DeleteAccountUserResponse') return responseObject
def DeleteAccountUser(self, adminId, userName, **kwargs): 'Delete account user.\n\n Args:\n adminId, str: Administrator GUID (required)\n userName, str: User name (required)\n \n Returns: DeleteAccountUserResponse\n ' if ((adminId == None) or (userName == None)): raise ApiException(400, 'missing required parameters') allParams = ['adminId', 'userName'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method DeleteAccountUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{adminId}/account/users/{userName}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'DELETE' queryParams = {} headerParams = {} if ('adminId' in params): replacement = str(self.apiClient.toPathValue(params['adminId'])) resourcePath = resourcePath.replace((('{' + 'adminId') + '}'), replacement) if ('userName' in params): replacement = str(self.apiClient.toPathValue(params['userName'])) resourcePath = resourcePath.replace((('{' + 'userName') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'DeleteAccountUserResponse') return responseObject<|docstring|>Delete account user. Args: adminId, str: Administrator GUID (required) userName, str: User name (required) Returns: DeleteAccountUserResponse<|endoftext|>
66505f7544998ae26dfab153e9dba83b8ced8fd324370c0c36be2c570d3706a2
def GetUserEmbedKey(self, userId, area, **kwargs): 'Returns active user embed key.\n\n Args:\n userId, str: User GUID (required)\n area, str: Application area where the key is (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((userId == None) or (area == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'area'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserEmbedKey" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/embedkey/{area}'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('area' in params): replacement = str(self.apiClient.toPathValue(params['area'])) resourcePath = resourcePath.replace((('{' + 'area') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject
Returns active user embed key. Args: userId, str: User GUID (required) area, str: Application area where the key is (required) Returns: GetUserEmbedKeyResponse
groupdocs/MgmtApi.py
GetUserEmbedKey
groupdocs-legacy-sdk/python
0
python
def GetUserEmbedKey(self, userId, area, **kwargs): 'Returns active user embed key.\n\n Args:\n userId, str: User GUID (required)\n area, str: Application area where the key is (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((userId == None) or (area == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'area'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserEmbedKey" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/embedkey/{area}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('area' in params): replacement = str(self.apiClient.toPathValue(params['area'])) resourcePath = resourcePath.replace((('{' + 'area') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject
def GetUserEmbedKey(self, userId, area, **kwargs): 'Returns active user embed key.\n\n Args:\n userId, str: User GUID (required)\n area, str: Application area where the key is (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((userId == None) or (area == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'area'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserEmbedKey" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/embedkey/{area}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('area' in params): replacement = str(self.apiClient.toPathValue(params['area'])) resourcePath = resourcePath.replace((('{' + 'area') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject<|docstring|>Returns active user embed key. Args: userId, str: User GUID (required) area, str: Application area where the key is (required) Returns: GetUserEmbedKeyResponse<|endoftext|>
44f285a5d17bfc8db42e02f7b70447abeaa312f30e1672729779ae41376d7544
def GetUserEmbedKeyFromGuid(self, callerId, guid, **kwargs): 'Returns embed key by GUID.\n\n Args:\n callerId, str: UserId invoked the service (required)\n guid, str: Key GUID (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((callerId == None) or (guid == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'guid'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserEmbedKeyFromGuid" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/embedkey/guid/{guid}'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('guid' in params): replacement = str(self.apiClient.toPathValue(params['guid'])) resourcePath = resourcePath.replace((('{' + 'guid') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject
Returns embed key by GUID. Args: callerId, str: UserId invoked the service (required) guid, str: Key GUID (required) Returns: GetUserEmbedKeyResponse
groupdocs/MgmtApi.py
GetUserEmbedKeyFromGuid
groupdocs-legacy-sdk/python
0
python
def GetUserEmbedKeyFromGuid(self, callerId, guid, **kwargs): 'Returns embed key by GUID.\n\n Args:\n callerId, str: UserId invoked the service (required)\n guid, str: Key GUID (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((callerId == None) or (guid == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'guid'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserEmbedKeyFromGuid" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/embedkey/guid/{guid}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('guid' in params): replacement = str(self.apiClient.toPathValue(params['guid'])) resourcePath = resourcePath.replace((('{' + 'guid') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject
def GetUserEmbedKeyFromGuid(self, callerId, guid, **kwargs): 'Returns embed key by GUID.\n\n Args:\n callerId, str: UserId invoked the service (required)\n guid, str: Key GUID (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((callerId == None) or (guid == None)): raise ApiException(400, 'missing required parameters') allParams = ['callerId', 'guid'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GetUserEmbedKeyFromGuid" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{callerId}/embedkey/guid/{guid}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('callerId' in params): replacement = str(self.apiClient.toPathValue(params['callerId'])) resourcePath = resourcePath.replace((('{' + 'callerId') + '}'), replacement) if ('guid' in params): replacement = str(self.apiClient.toPathValue(params['guid'])) resourcePath = resourcePath.replace((('{' + 'guid') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject<|docstring|>Returns embed key by GUID. Args: callerId, str: UserId invoked the service (required) guid, str: Key GUID (required) Returns: GetUserEmbedKeyResponse<|endoftext|>
aeb4b7304c7249276d9fff767f8d4662c9840d6b4b55663aaf426d30199fcaed
def GenerateKeyForUser(self, userId, area, **kwargs): 'Generates new active user embed key.\n\n Args:\n userId, str: User GUID (required)\n area, str: Application area where the key is (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((userId == None) or (area == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'area'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GenerateKeyForUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/embedkey/new/{area}'.replace('*', '') resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('area' in params): replacement = str(self.apiClient.toPathValue(params['area'])) resourcePath = resourcePath.replace((('{' + 'area') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject
Generates new active user embed key. Args: userId, str: User GUID (required) area, str: Application area where the key is (required) Returns: GetUserEmbedKeyResponse
groupdocs/MgmtApi.py
GenerateKeyForUser
groupdocs-legacy-sdk/python
0
python
def GenerateKeyForUser(self, userId, area, **kwargs): 'Generates new active user embed key.\n\n Args:\n userId, str: User GUID (required)\n area, str: Application area where the key is (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((userId == None) or (area == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'area'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GenerateKeyForUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/embedkey/new/{area}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('area' in params): replacement = str(self.apiClient.toPathValue(params['area'])) resourcePath = resourcePath.replace((('{' + 'area') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject
def GenerateKeyForUser(self, userId, area, **kwargs): 'Generates new active user embed key.\n\n Args:\n userId, str: User GUID (required)\n area, str: Application area where the key is (required)\n \n Returns: GetUserEmbedKeyResponse\n ' if ((userId == None) or (area == None)): raise ApiException(400, 'missing required parameters') allParams = ['userId', 'area'] params = locals() for (key, val) in params['kwargs'].iteritems(): if (key not in allParams): raise TypeError(("Got an unexpected keyword argument '%s' to method GenerateKeyForUser" % key)) params[key] = val del params['kwargs'] resourcePath = '/mgmt/{userId}/embedkey/new/{area}'.replace('*', ) resourcePath = resourcePath.replace('{format}', 'json') method = 'GET' queryParams = {} headerParams = {} if ('userId' in params): replacement = str(self.apiClient.toPathValue(params['userId'])) resourcePath = resourcePath.replace((('{' + 'userId') + '}'), replacement) if ('area' in params): replacement = str(self.apiClient.toPathValue(params['area'])) resourcePath = resourcePath.replace((('{' + 'area') + '}'), replacement) postData = (params['body'] if ('body' in params) else None) response = self.apiClient.callAPI(self.basePath, resourcePath, method, queryParams, postData, headerParams) if (not response): return None responseObject = self.apiClient.deserialize(response, 'GetUserEmbedKeyResponse') return responseObject<|docstring|>Generates new active user embed key. Args: userId, str: User GUID (required) area, str: Application area where the key is (required) Returns: GetUserEmbedKeyResponse<|endoftext|>
cdcc5e9687556654b82eb4fb238b81a1d334b0f2a56ea40449030b421b878a04
def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False, utc=None, format=None, exact=True, unit=None, infer_datetime_format=False, origin='unix', cache=True): 'Convert the arg to datetime format. If not Modin DataFrame, this falls\n back on pandas.\n\n Args:\n errors (\'raise\' or \'ignore\'): If \'ignore\', errors are silenced.\n Pandas blatantly ignores this argument so we will too.\n dayfirst (bool): Date format is passed in as day first.\n yearfirst (bool): Date format is passed in as year first.\n utc (bool): retuns a UTC DatetimeIndex if True.\n box (bool): If True, returns a DatetimeIndex.\n format (string): strftime to parse time, eg "%d/%m/%Y".\n exact (bool): If True, require an exact format match.\n unit (string, default \'ns\'): unit of the arg.\n infer_datetime_format (bool): Whether or not to infer the format.\n origin (string): Define the reference date.\n\n Returns:\n Type depends on input:\n\n - list-like: DatetimeIndex\n - Series: Series of datetime64 dtype\n - scalar: Timestamp\n ' if (not isinstance(arg, (DataFrame, Series))): return pandas.to_datetime(arg, errors=errors, dayfirst=dayfirst, yearfirst=yearfirst, utc=utc, format=format, exact=exact, unit=unit, infer_datetime_format=infer_datetime_format, origin=origin, cache=cache) return arg._default_to_pandas(pandas.to_datetime, errors=errors, dayfirst=dayfirst, yearfirst=yearfirst, utc=utc, format=format, exact=exact, unit=unit, infer_datetime_format=infer_datetime_format, origin=origin, cache=cache)
Convert the arg to datetime format. If not Modin DataFrame, this falls back on pandas. Args: errors ('raise' or 'ignore'): If 'ignore', errors are silenced. Pandas blatantly ignores this argument so we will too. dayfirst (bool): Date format is passed in as day first. yearfirst (bool): Date format is passed in as year first. utc (bool): retuns a UTC DatetimeIndex if True. box (bool): If True, returns a DatetimeIndex. format (string): strftime to parse time, eg "%d/%m/%Y". exact (bool): If True, require an exact format match. unit (string, default 'ns'): unit of the arg. infer_datetime_format (bool): Whether or not to infer the format. origin (string): Define the reference date. Returns: Type depends on input: - list-like: DatetimeIndex - Series: Series of datetime64 dtype - scalar: Timestamp
modin/pandas/datetimes.py
to_datetime
guor8lei/modin
1
python
def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False, utc=None, format=None, exact=True, unit=None, infer_datetime_format=False, origin='unix', cache=True): 'Convert the arg to datetime format. If not Modin DataFrame, this falls\n back on pandas.\n\n Args:\n errors (\'raise\' or \'ignore\'): If \'ignore\', errors are silenced.\n Pandas blatantly ignores this argument so we will too.\n dayfirst (bool): Date format is passed in as day first.\n yearfirst (bool): Date format is passed in as year first.\n utc (bool): retuns a UTC DatetimeIndex if True.\n box (bool): If True, returns a DatetimeIndex.\n format (string): strftime to parse time, eg "%d/%m/%Y".\n exact (bool): If True, require an exact format match.\n unit (string, default \'ns\'): unit of the arg.\n infer_datetime_format (bool): Whether or not to infer the format.\n origin (string): Define the reference date.\n\n Returns:\n Type depends on input:\n\n - list-like: DatetimeIndex\n - Series: Series of datetime64 dtype\n - scalar: Timestamp\n ' if (not isinstance(arg, (DataFrame, Series))): return pandas.to_datetime(arg, errors=errors, dayfirst=dayfirst, yearfirst=yearfirst, utc=utc, format=format, exact=exact, unit=unit, infer_datetime_format=infer_datetime_format, origin=origin, cache=cache) return arg._default_to_pandas(pandas.to_datetime, errors=errors, dayfirst=dayfirst, yearfirst=yearfirst, utc=utc, format=format, exact=exact, unit=unit, infer_datetime_format=infer_datetime_format, origin=origin, cache=cache)
def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False, utc=None, format=None, exact=True, unit=None, infer_datetime_format=False, origin='unix', cache=True): 'Convert the arg to datetime format. If not Modin DataFrame, this falls\n back on pandas.\n\n Args:\n errors (\'raise\' or \'ignore\'): If \'ignore\', errors are silenced.\n Pandas blatantly ignores this argument so we will too.\n dayfirst (bool): Date format is passed in as day first.\n yearfirst (bool): Date format is passed in as year first.\n utc (bool): retuns a UTC DatetimeIndex if True.\n box (bool): If True, returns a DatetimeIndex.\n format (string): strftime to parse time, eg "%d/%m/%Y".\n exact (bool): If True, require an exact format match.\n unit (string, default \'ns\'): unit of the arg.\n infer_datetime_format (bool): Whether or not to infer the format.\n origin (string): Define the reference date.\n\n Returns:\n Type depends on input:\n\n - list-like: DatetimeIndex\n - Series: Series of datetime64 dtype\n - scalar: Timestamp\n ' if (not isinstance(arg, (DataFrame, Series))): return pandas.to_datetime(arg, errors=errors, dayfirst=dayfirst, yearfirst=yearfirst, utc=utc, format=format, exact=exact, unit=unit, infer_datetime_format=infer_datetime_format, origin=origin, cache=cache) return arg._default_to_pandas(pandas.to_datetime, errors=errors, dayfirst=dayfirst, yearfirst=yearfirst, utc=utc, format=format, exact=exact, unit=unit, infer_datetime_format=infer_datetime_format, origin=origin, cache=cache)<|docstring|>Convert the arg to datetime format. If not Modin DataFrame, this falls back on pandas. Args: errors ('raise' or 'ignore'): If 'ignore', errors are silenced. Pandas blatantly ignores this argument so we will too. dayfirst (bool): Date format is passed in as day first. yearfirst (bool): Date format is passed in as year first. utc (bool): retuns a UTC DatetimeIndex if True. box (bool): If True, returns a DatetimeIndex. format (string): strftime to parse time, eg "%d/%m/%Y". exact (bool): If True, require an exact format match. unit (string, default 'ns'): unit of the arg. infer_datetime_format (bool): Whether or not to infer the format. origin (string): Define the reference date. Returns: Type depends on input: - list-like: DatetimeIndex - Series: Series of datetime64 dtype - scalar: Timestamp<|endoftext|>
47522274811a4e2116d799ef143c18b9a04dcb9d6a859815fe360f70507a7de0
def __repr__(self): 'Human readable text' return f"Sheet '{self.name}': {self.col_count}-{self.row_count}"
Human readable text
xlsxObject/SheetData.py
__repr__
sbaker-dev/xslxObject
0
python
def __repr__(self): return f"Sheet '{self.name}': {self.col_count}-{self.row_count}"
def __repr__(self): return f"Sheet '{self.name}': {self.col_count}-{self.row_count}"<|docstring|>Human readable text<|endoftext|>
1edd0ea8afa012a9e0f65fc8739c179b2efecc0b12cc51bbf0bbce0f3595ed99
def test_diagnostic_output_repr(mocker): 'Test `DiagnosticOutput.__repr__`.' tasks = [mocker.create_autospec(recipe_output.TaskOutput, instance=True), mocker.create_autospec(recipe_output.TaskOutput, instance=True)] for (i, task) in enumerate(tasks): task.__str__.return_value = f'Task-{i}' diagnostic = recipe_output.DiagnosticOutput(name='diagnostic_name', title='This is a diagnostic', description='With a description', task_output=tasks) text = textwrap.dedent('\n diagnostic_name:\n Task-0\n Task-1\n ').lstrip() assert (repr(diagnostic) == text) for task in tasks: task.__str__.assert_called_once()
Test `DiagnosticOutput.__repr__`.
tests/unit/experimental/test_recipe_output.py
test_diagnostic_output_repr
jvegasbsc/ESMValCore
26
python
def test_diagnostic_output_repr(mocker): tasks = [mocker.create_autospec(recipe_output.TaskOutput, instance=True), mocker.create_autospec(recipe_output.TaskOutput, instance=True)] for (i, task) in enumerate(tasks): task.__str__.return_value = f'Task-{i}' diagnostic = recipe_output.DiagnosticOutput(name='diagnostic_name', title='This is a diagnostic', description='With a description', task_output=tasks) text = textwrap.dedent('\n diagnostic_name:\n Task-0\n Task-1\n ').lstrip() assert (repr(diagnostic) == text) for task in tasks: task.__str__.assert_called_once()
def test_diagnostic_output_repr(mocker): tasks = [mocker.create_autospec(recipe_output.TaskOutput, instance=True), mocker.create_autospec(recipe_output.TaskOutput, instance=True)] for (i, task) in enumerate(tasks): task.__str__.return_value = f'Task-{i}' diagnostic = recipe_output.DiagnosticOutput(name='diagnostic_name', title='This is a diagnostic', description='With a description', task_output=tasks) text = textwrap.dedent('\n diagnostic_name:\n Task-0\n Task-1\n ').lstrip() assert (repr(diagnostic) == text) for task in tasks: task.__str__.assert_called_once()<|docstring|>Test `DiagnosticOutput.__repr__`.<|endoftext|>
3498d88555f0160cfb960fd2f82a4abfbc5cb4cf6cf5c3cba771104ff0fcca87
def prepare_build_environment(): 'Set environment variables used to build AFL-based fuzzers.' cflags = ['-O2', '-fno-omit-frame-pointer', '-gline-tables-only', '-fsanitize=address', '-fsanitize-coverage=trace-pc-guard'] utils.append_flags('CFLAGS', cflags) utils.append_flags('CXXFLAGS', cflags) os.environ['CC'] = 'clang' os.environ['CXX'] = 'clang++' os.environ['FUZZER_LIB'] = '/libAFL.a'
Set environment variables used to build AFL-based fuzzers.
fuzzers/afl/fuzzer.py
prepare_build_environment
srg-imperial/fuzzbench
0
python
def prepare_build_environment(): cflags = ['-O2', '-fno-omit-frame-pointer', '-gline-tables-only', '-fsanitize=address', '-fsanitize-coverage=trace-pc-guard'] utils.append_flags('CFLAGS', cflags) utils.append_flags('CXXFLAGS', cflags) os.environ['CC'] = 'clang' os.environ['CXX'] = 'clang++' os.environ['FUZZER_LIB'] = '/libAFL.a'
def prepare_build_environment(): cflags = ['-O2', '-fno-omit-frame-pointer', '-gline-tables-only', '-fsanitize=address', '-fsanitize-coverage=trace-pc-guard'] utils.append_flags('CFLAGS', cflags) utils.append_flags('CXXFLAGS', cflags) os.environ['CC'] = 'clang' os.environ['CXX'] = 'clang++' os.environ['FUZZER_LIB'] = '/libAFL.a'<|docstring|>Set environment variables used to build AFL-based fuzzers.<|endoftext|>
f857d6bdf42825fe3925c2942819c3235de571a32623f6d9dc691e9f2dd678f4
def build(): 'Build fuzzer.' prepare_build_environment() utils.build_benchmark() print('[post_build] Copying afl-fuzz to $OUT directory') shutil.copy('/afl/afl-fuzz', os.environ['OUT'])
Build fuzzer.
fuzzers/afl/fuzzer.py
build
srg-imperial/fuzzbench
0
python
def build(): prepare_build_environment() utils.build_benchmark() print('[post_build] Copying afl-fuzz to $OUT directory') shutil.copy('/afl/afl-fuzz', os.environ['OUT'])
def build(): prepare_build_environment() utils.build_benchmark() print('[post_build] Copying afl-fuzz to $OUT directory') shutil.copy('/afl/afl-fuzz', os.environ['OUT'])<|docstring|>Build fuzzer.<|endoftext|>
bdf642585461ffc6dfba1fba777724934014c42a83c4885d93b611ae7a962555
def prepare_fuzz_environment(input_corpus): 'Prepare to fuzz with AFL or another AFL-based fuzzer.' os.environ['AFL_NO_UI'] = '1' os.environ['AFL_SKIP_CPUFREQ'] = '1' os.environ['AFL_NO_AFFINITY'] = '1' os.environ['AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES'] = '1' if (len(os.listdir(input_corpus)) == 0): with open(os.path.join(input_corpus, 'default_seed'), 'w') as file_handle: file_handle.write('hi')
Prepare to fuzz with AFL or another AFL-based fuzzer.
fuzzers/afl/fuzzer.py
prepare_fuzz_environment
srg-imperial/fuzzbench
0
python
def prepare_fuzz_environment(input_corpus): os.environ['AFL_NO_UI'] = '1' os.environ['AFL_SKIP_CPUFREQ'] = '1' os.environ['AFL_NO_AFFINITY'] = '1' os.environ['AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES'] = '1' if (len(os.listdir(input_corpus)) == 0): with open(os.path.join(input_corpus, 'default_seed'), 'w') as file_handle: file_handle.write('hi')
def prepare_fuzz_environment(input_corpus): os.environ['AFL_NO_UI'] = '1' os.environ['AFL_SKIP_CPUFREQ'] = '1' os.environ['AFL_NO_AFFINITY'] = '1' os.environ['AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES'] = '1' if (len(os.listdir(input_corpus)) == 0): with open(os.path.join(input_corpus, 'default_seed'), 'w') as file_handle: file_handle.write('hi')<|docstring|>Prepare to fuzz with AFL or another AFL-based fuzzer.<|endoftext|>
8cec2ab3a4d23f8b4854a40dee2b197fd54cd90cf935c5e8726bf9e57f1fb80b
def run_afl_fuzz(input_corpus, output_corpus, target_binary, additional_flags=None, hide_output=False): 'Run afl-fuzz.' print('[run_fuzzer] Running target with afl-fuzz') command = ['./afl-fuzz', '-i', input_corpus, '-o', output_corpus, '-m', 'none'] if additional_flags: command.extend(additional_flags) command += ['--', target_binary, '2147483647'] output_stream = (subprocess.DEVNULL if hide_output else None) subprocess.call(command, stdout=output_stream, stderr=output_stream)
Run afl-fuzz.
fuzzers/afl/fuzzer.py
run_afl_fuzz
srg-imperial/fuzzbench
0
python
def run_afl_fuzz(input_corpus, output_corpus, target_binary, additional_flags=None, hide_output=False): print('[run_fuzzer] Running target with afl-fuzz') command = ['./afl-fuzz', '-i', input_corpus, '-o', output_corpus, '-m', 'none'] if additional_flags: command.extend(additional_flags) command += ['--', target_binary, '2147483647'] output_stream = (subprocess.DEVNULL if hide_output else None) subprocess.call(command, stdout=output_stream, stderr=output_stream)
def run_afl_fuzz(input_corpus, output_corpus, target_binary, additional_flags=None, hide_output=False): print('[run_fuzzer] Running target with afl-fuzz') command = ['./afl-fuzz', '-i', input_corpus, '-o', output_corpus, '-m', 'none'] if additional_flags: command.extend(additional_flags) command += ['--', target_binary, '2147483647'] output_stream = (subprocess.DEVNULL if hide_output else None) subprocess.call(command, stdout=output_stream, stderr=output_stream)<|docstring|>Run afl-fuzz.<|endoftext|>
419030fa52b5bad1db60251fdc6a8d198d02db281f46887f8e25ce6f3545f0fc
def fuzz(input_corpus, output_corpus, target_binary): 'Run afl-fuzz on target.' prepare_fuzz_environment(input_corpus) run_afl_fuzz(input_corpus, output_corpus, target_binary)
Run afl-fuzz on target.
fuzzers/afl/fuzzer.py
fuzz
srg-imperial/fuzzbench
0
python
def fuzz(input_corpus, output_corpus, target_binary): prepare_fuzz_environment(input_corpus) run_afl_fuzz(input_corpus, output_corpus, target_binary)
def fuzz(input_corpus, output_corpus, target_binary): prepare_fuzz_environment(input_corpus) run_afl_fuzz(input_corpus, output_corpus, target_binary)<|docstring|>Run afl-fuzz on target.<|endoftext|>
8696c8ba6e4e1e6d55d6af142dc57b59613af66865a0e94966d86f4e59f0bfd6
def __virtual__(): '\n Only work on POSIX-like systems\n ' if ((HAS_DBUS is False) and _uses_dbus()): return (False, 'Cannot load locale module: dbus python module unavailable') if salt.utils.is_windows(): return (False, 'Cannot load locale module: windows platforms are unsupported') return __virtualname__
Only work on POSIX-like systems
salt/modules/localemod.py
__virtual__
preoctopus/salt
1
python
def __virtual__(): '\n \n ' if ((HAS_DBUS is False) and _uses_dbus()): return (False, 'Cannot load locale module: dbus python module unavailable') if salt.utils.is_windows(): return (False, 'Cannot load locale module: windows platforms are unsupported') return __virtualname__
def __virtual__(): '\n \n ' if ((HAS_DBUS is False) and _uses_dbus()): return (False, 'Cannot load locale module: dbus python module unavailable') if salt.utils.is_windows(): return (False, 'Cannot load locale module: windows platforms are unsupported') return __virtualname__<|docstring|>Only work on POSIX-like systems<|endoftext|>
b871f7326a87ed00d1aca5d2ae4057bba3d9b65ed2336daa3585a4b7cb42959c
def _parse_dbus_locale(): "\n Get the 'System Locale' parameters from dbus\n " ret = {} bus = dbus.SystemBus() localed = bus.get_object('org.freedesktop.locale1', '/org/freedesktop/locale1') properties = dbus.Interface(localed, 'org.freedesktop.DBus.Properties') system_locale = properties.Get('org.freedesktop.locale1', 'Locale') try: (key, val) = re.match('^([A-Z_]+)=(.*)$', system_locale[0]).groups() except AttributeError: log.error('Odd locale parameter "{0}" detected in dbus locale output. This should not happen. You should probably investigate what caused this.'.format(system_locale[0])) else: ret[key] = val.replace('"', '') return ret
Get the 'System Locale' parameters from dbus
salt/modules/localemod.py
_parse_dbus_locale
preoctopus/salt
1
python
def _parse_dbus_locale(): "\n \n " ret = {} bus = dbus.SystemBus() localed = bus.get_object('org.freedesktop.locale1', '/org/freedesktop/locale1') properties = dbus.Interface(localed, 'org.freedesktop.DBus.Properties') system_locale = properties.Get('org.freedesktop.locale1', 'Locale') try: (key, val) = re.match('^([A-Z_]+)=(.*)$', system_locale[0]).groups() except AttributeError: log.error('Odd locale parameter "{0}" detected in dbus locale output. This should not happen. You should probably investigate what caused this.'.format(system_locale[0])) else: ret[key] = val.replace('"', ) return ret
def _parse_dbus_locale(): "\n \n " ret = {} bus = dbus.SystemBus() localed = bus.get_object('org.freedesktop.locale1', '/org/freedesktop/locale1') properties = dbus.Interface(localed, 'org.freedesktop.DBus.Properties') system_locale = properties.Get('org.freedesktop.locale1', 'Locale') try: (key, val) = re.match('^([A-Z_]+)=(.*)$', system_locale[0]).groups() except AttributeError: log.error('Odd locale parameter "{0}" detected in dbus locale output. This should not happen. You should probably investigate what caused this.'.format(system_locale[0])) else: ret[key] = val.replace('"', ) return ret<|docstring|>Get the 'System Locale' parameters from dbus<|endoftext|>
e593dbf16c499c3bacd3128fb085c5d990dd3b35f3ecf423fdcedbadf24b9e61
def _locale_get(): '\n Use dbus to get the current locale\n ' return _parse_dbus_locale().get('LANG', '')
Use dbus to get the current locale
salt/modules/localemod.py
_locale_get
preoctopus/salt
1
python
def _locale_get(): '\n \n ' return _parse_dbus_locale().get('LANG', )
def _locale_get(): '\n \n ' return _parse_dbus_locale().get('LANG', )<|docstring|>Use dbus to get the current locale<|endoftext|>
e451a0cddb7ab510b637e2612177b6b184d41978c6237ef1a3fd56f6700aaf15
def _localectl_set(locale=''): "\n Use systemd's localectl command to set the LANG locale parameter, making\n sure not to trample on other params that have been set.\n " locale_params = _parse_dbus_locale() locale_params['LANG'] = str(locale) args = ' '.join(['{0}="{1}"'.format(k, v) for (k, v) in six.iteritems(locale_params)]) cmd = 'localectl set-locale {0}'.format(args) return (__salt__['cmd.retcode'](cmd, python_shell=False) == 0)
Use systemd's localectl command to set the LANG locale parameter, making sure not to trample on other params that have been set.
salt/modules/localemod.py
_localectl_set
preoctopus/salt
1
python
def _localectl_set(locale=): "\n Use systemd's localectl command to set the LANG locale parameter, making\n sure not to trample on other params that have been set.\n " locale_params = _parse_dbus_locale() locale_params['LANG'] = str(locale) args = ' '.join(['{0}="{1}"'.format(k, v) for (k, v) in six.iteritems(locale_params)]) cmd = 'localectl set-locale {0}'.format(args) return (__salt__['cmd.retcode'](cmd, python_shell=False) == 0)
def _localectl_set(locale=): "\n Use systemd's localectl command to set the LANG locale parameter, making\n sure not to trample on other params that have been set.\n " locale_params = _parse_dbus_locale() locale_params['LANG'] = str(locale) args = ' '.join(['{0}="{1}"'.format(k, v) for (k, v) in six.iteritems(locale_params)]) cmd = 'localectl set-locale {0}'.format(args) return (__salt__['cmd.retcode'](cmd, python_shell=False) == 0)<|docstring|>Use systemd's localectl command to set the LANG locale parameter, making sure not to trample on other params that have been set.<|endoftext|>
13e1826eb21c40f83c9c23b944d93b90906e33536a0bf97924924253fbdafc01
def list_avail(): "\n Lists available (compiled) locales\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.list_avail\n " cmd = 'locale -a' out = __salt__['cmd.run'](cmd).split('\n') return out
Lists available (compiled) locales CLI Example: .. code-block:: bash salt '*' locale.list_avail
salt/modules/localemod.py
list_avail
preoctopus/salt
1
python
def list_avail(): "\n Lists available (compiled) locales\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.list_avail\n " cmd = 'locale -a' out = __salt__['cmd.run'](cmd).split('\n') return out
def list_avail(): "\n Lists available (compiled) locales\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.list_avail\n " cmd = 'locale -a' out = __salt__['cmd.run'](cmd).split('\n') return out<|docstring|>Lists available (compiled) locales CLI Example: .. code-block:: bash salt '*' locale.list_avail<|endoftext|>
74516362ebf0c3c1ab83bc533a60f0078f989a7d35100e987b056f2179fab07d
def get_locale(): "\n Get the current system locale\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.get_locale\n " cmd = '' if ('Arch' in __grains__['os_family']): return _locale_get() elif ('RedHat' in __grains__['os_family']): cmd = 'grep "^LANG=" /etc/sysconfig/i18n' elif ('Suse' in __grains__['os_family']): cmd = 'grep "^RC_LANG" /etc/sysconfig/language' elif ('Debian' in __grains__['os_family']): if salt.utils.which('localectl'): return _locale_get() cmd = 'grep "^LANG=" /etc/default/locale' elif ('Gentoo' in __grains__['os_family']): cmd = 'eselect --brief locale show' return __salt__['cmd.run'](cmd).strip() elif ('Solaris' in __grains__['os_family']): cmd = 'grep "^LANG=" /etc/default/init' else: raise CommandExecutionError('Error: Unsupported platform!') try: return __salt__['cmd.run'](cmd).split('=')[1].replace('"', '') except IndexError: return ''
Get the current system locale CLI Example: .. code-block:: bash salt '*' locale.get_locale
salt/modules/localemod.py
get_locale
preoctopus/salt
1
python
def get_locale(): "\n Get the current system locale\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.get_locale\n " cmd = if ('Arch' in __grains__['os_family']): return _locale_get() elif ('RedHat' in __grains__['os_family']): cmd = 'grep "^LANG=" /etc/sysconfig/i18n' elif ('Suse' in __grains__['os_family']): cmd = 'grep "^RC_LANG" /etc/sysconfig/language' elif ('Debian' in __grains__['os_family']): if salt.utils.which('localectl'): return _locale_get() cmd = 'grep "^LANG=" /etc/default/locale' elif ('Gentoo' in __grains__['os_family']): cmd = 'eselect --brief locale show' return __salt__['cmd.run'](cmd).strip() elif ('Solaris' in __grains__['os_family']): cmd = 'grep "^LANG=" /etc/default/init' else: raise CommandExecutionError('Error: Unsupported platform!') try: return __salt__['cmd.run'](cmd).split('=')[1].replace('"', ) except IndexError: return
def get_locale(): "\n Get the current system locale\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.get_locale\n " cmd = if ('Arch' in __grains__['os_family']): return _locale_get() elif ('RedHat' in __grains__['os_family']): cmd = 'grep "^LANG=" /etc/sysconfig/i18n' elif ('Suse' in __grains__['os_family']): cmd = 'grep "^RC_LANG" /etc/sysconfig/language' elif ('Debian' in __grains__['os_family']): if salt.utils.which('localectl'): return _locale_get() cmd = 'grep "^LANG=" /etc/default/locale' elif ('Gentoo' in __grains__['os_family']): cmd = 'eselect --brief locale show' return __salt__['cmd.run'](cmd).strip() elif ('Solaris' in __grains__['os_family']): cmd = 'grep "^LANG=" /etc/default/init' else: raise CommandExecutionError('Error: Unsupported platform!') try: return __salt__['cmd.run'](cmd).split('=')[1].replace('"', ) except IndexError: return <|docstring|>Get the current system locale CLI Example: .. code-block:: bash salt '*' locale.get_locale<|endoftext|>
0c16d964bd94c3795adbc60020b2f3527dc2b090ed68fe2d473c6d371d6f2406
def set_locale(locale): "\n Sets the current system locale\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.set_locale 'en_US.UTF-8'\n " if ('Arch' in __grains__['os_family']): return _localectl_set(locale) elif ('RedHat' in __grains__['os_family']): if (not __salt__['file.file_exists']('/etc/sysconfig/i18n')): __salt__['file.touch']('/etc/sysconfig/i18n') __salt__['file.replace']('/etc/sysconfig/i18n', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Suse' in __grains__['os_family']): if (not __salt__['file.file_exists']('/etc/sysconfig/language')): __salt__['file.touch']('/etc/sysconfig/language') __salt__['file.replace']('/etc/sysconfig/language', '^RC_LANG=.*', 'RC_LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Debian' in __grains__['os_family']): if salt.utils.which('localectl'): return _localectl_set(locale) update_locale = salt.utils.which('update-locale') if (update_locale is None): raise CommandExecutionError('Cannot set locale: "update-locale" was not found.') __salt__['cmd.run'](update_locale) __salt__['file.replace']('/etc/default/locale', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Gentoo' in __grains__['os_family']): cmd = 'eselect --brief locale set {0}'.format(locale) return (__salt__['cmd.retcode'](cmd, python_shell=False) == 0) elif ('Solaris' in __grains__['os_family']): if (locale not in __salt__['locale.list_avail']()): return False __salt__['file.replace']('/etc/default/init', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) else: raise CommandExecutionError('Error: Unsupported platform!') return True
Sets the current system locale CLI Example: .. code-block:: bash salt '*' locale.set_locale 'en_US.UTF-8'
salt/modules/localemod.py
set_locale
preoctopus/salt
1
python
def set_locale(locale): "\n Sets the current system locale\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.set_locale 'en_US.UTF-8'\n " if ('Arch' in __grains__['os_family']): return _localectl_set(locale) elif ('RedHat' in __grains__['os_family']): if (not __salt__['file.file_exists']('/etc/sysconfig/i18n')): __salt__['file.touch']('/etc/sysconfig/i18n') __salt__['file.replace']('/etc/sysconfig/i18n', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Suse' in __grains__['os_family']): if (not __salt__['file.file_exists']('/etc/sysconfig/language')): __salt__['file.touch']('/etc/sysconfig/language') __salt__['file.replace']('/etc/sysconfig/language', '^RC_LANG=.*', 'RC_LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Debian' in __grains__['os_family']): if salt.utils.which('localectl'): return _localectl_set(locale) update_locale = salt.utils.which('update-locale') if (update_locale is None): raise CommandExecutionError('Cannot set locale: "update-locale" was not found.') __salt__['cmd.run'](update_locale) __salt__['file.replace']('/etc/default/locale', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Gentoo' in __grains__['os_family']): cmd = 'eselect --brief locale set {0}'.format(locale) return (__salt__['cmd.retcode'](cmd, python_shell=False) == 0) elif ('Solaris' in __grains__['os_family']): if (locale not in __salt__['locale.list_avail']()): return False __salt__['file.replace']('/etc/default/init', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) else: raise CommandExecutionError('Error: Unsupported platform!') return True
def set_locale(locale): "\n Sets the current system locale\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.set_locale 'en_US.UTF-8'\n " if ('Arch' in __grains__['os_family']): return _localectl_set(locale) elif ('RedHat' in __grains__['os_family']): if (not __salt__['file.file_exists']('/etc/sysconfig/i18n')): __salt__['file.touch']('/etc/sysconfig/i18n') __salt__['file.replace']('/etc/sysconfig/i18n', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Suse' in __grains__['os_family']): if (not __salt__['file.file_exists']('/etc/sysconfig/language')): __salt__['file.touch']('/etc/sysconfig/language') __salt__['file.replace']('/etc/sysconfig/language', '^RC_LANG=.*', 'RC_LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Debian' in __grains__['os_family']): if salt.utils.which('localectl'): return _localectl_set(locale) update_locale = salt.utils.which('update-locale') if (update_locale is None): raise CommandExecutionError('Cannot set locale: "update-locale" was not found.') __salt__['cmd.run'](update_locale) __salt__['file.replace']('/etc/default/locale', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) elif ('Gentoo' in __grains__['os_family']): cmd = 'eselect --brief locale set {0}'.format(locale) return (__salt__['cmd.retcode'](cmd, python_shell=False) == 0) elif ('Solaris' in __grains__['os_family']): if (locale not in __salt__['locale.list_avail']()): return False __salt__['file.replace']('/etc/default/init', '^LANG=.*', 'LANG="{0}"'.format(locale), append_if_not_found=True) else: raise CommandExecutionError('Error: Unsupported platform!') return True<|docstring|>Sets the current system locale CLI Example: .. code-block:: bash salt '*' locale.set_locale 'en_US.UTF-8'<|endoftext|>
a9c3f2f24f4eba8a3c37513ad2612332b4a63067d52fc19e97628bf6ece3ac5a
def avail(locale): "\n Check if a locale is available.\n\n .. versionadded:: 2014.7.0\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.avail 'en_US.UTF-8'\n " try: normalized_locale = salt.utils.locales.normalize_locale(locale) except IndexError: log.error('Unable to validate locale "{0}"'.format(locale)) return False avail_locales = __salt__['locale.list_avail']() locale_exists = next((True for x in avail_locales if (salt.utils.locales.normalize_locale(x.strip()) == normalized_locale)), False) return locale_exists
Check if a locale is available. .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' locale.avail 'en_US.UTF-8'
salt/modules/localemod.py
avail
preoctopus/salt
1
python
def avail(locale): "\n Check if a locale is available.\n\n .. versionadded:: 2014.7.0\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.avail 'en_US.UTF-8'\n " try: normalized_locale = salt.utils.locales.normalize_locale(locale) except IndexError: log.error('Unable to validate locale "{0}"'.format(locale)) return False avail_locales = __salt__['locale.list_avail']() locale_exists = next((True for x in avail_locales if (salt.utils.locales.normalize_locale(x.strip()) == normalized_locale)), False) return locale_exists
def avail(locale): "\n Check if a locale is available.\n\n .. versionadded:: 2014.7.0\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.avail 'en_US.UTF-8'\n " try: normalized_locale = salt.utils.locales.normalize_locale(locale) except IndexError: log.error('Unable to validate locale "{0}"'.format(locale)) return False avail_locales = __salt__['locale.list_avail']() locale_exists = next((True for x in avail_locales if (salt.utils.locales.normalize_locale(x.strip()) == normalized_locale)), False) return locale_exists<|docstring|>Check if a locale is available. .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' locale.avail 'en_US.UTF-8'<|endoftext|>
2a3ac0acd0dfe8d641e3bb6633db5a7ce67fb65fa0f366612b871bbb87f8f51d
def gen_locale(locale, **kwargs): "\n Generate a locale. Options:\n\n .. versionadded:: 2014.7.0\n\n :param locale: Any locale listed in /usr/share/i18n/locales or\n /usr/share/i18n/SUPPORTED for Debian and Gentoo based distributions,\n which require the charmap to be specified as part of the locale\n when generating it.\n\n verbose\n Show extra warnings about errors that are normally ignored.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.gen_locale en_US.UTF-8\n salt '*' locale.gen_locale 'en_IE.UTF-8 UTF-8' # Debian/Gentoo only\n " on_debian = (__grains__.get('os') == 'Debian') on_ubuntu = (__grains__.get('os') == 'Ubuntu') on_gentoo = (__grains__.get('os_family') == 'Gentoo') on_suse = (__grains__.get('os_family') == 'Suse') on_solaris = (__grains__.get('os_family') == 'Solaris') if on_solaris: return (locale in __salt__['locale.list_avail']()) locale_info = salt.utils.locales.split_locale(locale) if ((not locale_info['charmap']) and (not on_ubuntu)): locale_info['charmap'] = locale_info['codeset'] locale = salt.utils.locales.join_locale(locale_info) if (on_debian or on_gentoo): search = '/usr/share/i18n/SUPPORTED' valid = __salt__['file.search'](search, '^{0}$'.format(locale), flags=re.MULTILINE) else: if on_suse: search = '/usr/share/locale' else: search = '/usr/share/i18n/locales' try: valid = ('{0}_{1}'.format(locale_info['language'], locale_info['territory']) in os.listdir(search)) except OSError as ex: log.error(ex) raise CommandExecutionError('Locale "{0}" is not available.'.format(locale)) if (not valid): log.error('The provided locale "{0}" is not found in {1}'.format(locale, search)) return False if os.path.exists('/etc/locale.gen'): __salt__['file.replace']('/etc/locale.gen', '^\\s*#\\s*{0}\\s*$'.format(locale), '{0}\n'.format(locale), append_if_not_found=True) elif on_ubuntu: __salt__['file.touch']('/var/lib/locales/supported.d/{0}'.format(locale_info['language'])) __salt__['file.replace']('/var/lib/locales/supported.d/{0}'.format(locale_info['language']), locale, locale, append_if_not_found=True) if (salt.utils.which('locale-gen') is not None): cmd = ['locale-gen'] if on_gentoo: cmd.append('--generate') if on_ubuntu: cmd.append(salt.utils.locales.normalize_locale(locale)) else: cmd.append(locale) elif (salt.utils.which('localedef') is not None): cmd = ['localedef', '--force', '-i', '{0}_{1}'.format(locale_info['language'], locale_info['territory']), '-f', locale_info['codeset'], '{0}_{1}.{2}'.format(locale_info['language'], locale_info['territory'], locale_info['codeset'])] cmd.append(((kwargs.get('verbose', False) and '--verbose') or '--quiet')) else: raise CommandExecutionError('Command "locale-gen" or "localedef" was not found on this system.') res = __salt__['cmd.run_all'](cmd) if res['retcode']: log.error(res['stderr']) if kwargs.get('verbose'): return res else: return (res['retcode'] == 0)
Generate a locale. Options: .. versionadded:: 2014.7.0 :param locale: Any locale listed in /usr/share/i18n/locales or /usr/share/i18n/SUPPORTED for Debian and Gentoo based distributions, which require the charmap to be specified as part of the locale when generating it. verbose Show extra warnings about errors that are normally ignored. CLI Example: .. code-block:: bash salt '*' locale.gen_locale en_US.UTF-8 salt '*' locale.gen_locale 'en_IE.UTF-8 UTF-8' # Debian/Gentoo only
salt/modules/localemod.py
gen_locale
preoctopus/salt
1
python
def gen_locale(locale, **kwargs): "\n Generate a locale. Options:\n\n .. versionadded:: 2014.7.0\n\n :param locale: Any locale listed in /usr/share/i18n/locales or\n /usr/share/i18n/SUPPORTED for Debian and Gentoo based distributions,\n which require the charmap to be specified as part of the locale\n when generating it.\n\n verbose\n Show extra warnings about errors that are normally ignored.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.gen_locale en_US.UTF-8\n salt '*' locale.gen_locale 'en_IE.UTF-8 UTF-8' # Debian/Gentoo only\n " on_debian = (__grains__.get('os') == 'Debian') on_ubuntu = (__grains__.get('os') == 'Ubuntu') on_gentoo = (__grains__.get('os_family') == 'Gentoo') on_suse = (__grains__.get('os_family') == 'Suse') on_solaris = (__grains__.get('os_family') == 'Solaris') if on_solaris: return (locale in __salt__['locale.list_avail']()) locale_info = salt.utils.locales.split_locale(locale) if ((not locale_info['charmap']) and (not on_ubuntu)): locale_info['charmap'] = locale_info['codeset'] locale = salt.utils.locales.join_locale(locale_info) if (on_debian or on_gentoo): search = '/usr/share/i18n/SUPPORTED' valid = __salt__['file.search'](search, '^{0}$'.format(locale), flags=re.MULTILINE) else: if on_suse: search = '/usr/share/locale' else: search = '/usr/share/i18n/locales' try: valid = ('{0}_{1}'.format(locale_info['language'], locale_info['territory']) in os.listdir(search)) except OSError as ex: log.error(ex) raise CommandExecutionError('Locale "{0}" is not available.'.format(locale)) if (not valid): log.error('The provided locale "{0}" is not found in {1}'.format(locale, search)) return False if os.path.exists('/etc/locale.gen'): __salt__['file.replace']('/etc/locale.gen', '^\\s*#\\s*{0}\\s*$'.format(locale), '{0}\n'.format(locale), append_if_not_found=True) elif on_ubuntu: __salt__['file.touch']('/var/lib/locales/supported.d/{0}'.format(locale_info['language'])) __salt__['file.replace']('/var/lib/locales/supported.d/{0}'.format(locale_info['language']), locale, locale, append_if_not_found=True) if (salt.utils.which('locale-gen') is not None): cmd = ['locale-gen'] if on_gentoo: cmd.append('--generate') if on_ubuntu: cmd.append(salt.utils.locales.normalize_locale(locale)) else: cmd.append(locale) elif (salt.utils.which('localedef') is not None): cmd = ['localedef', '--force', '-i', '{0}_{1}'.format(locale_info['language'], locale_info['territory']), '-f', locale_info['codeset'], '{0}_{1}.{2}'.format(locale_info['language'], locale_info['territory'], locale_info['codeset'])] cmd.append(((kwargs.get('verbose', False) and '--verbose') or '--quiet')) else: raise CommandExecutionError('Command "locale-gen" or "localedef" was not found on this system.') res = __salt__['cmd.run_all'](cmd) if res['retcode']: log.error(res['stderr']) if kwargs.get('verbose'): return res else: return (res['retcode'] == 0)
def gen_locale(locale, **kwargs): "\n Generate a locale. Options:\n\n .. versionadded:: 2014.7.0\n\n :param locale: Any locale listed in /usr/share/i18n/locales or\n /usr/share/i18n/SUPPORTED for Debian and Gentoo based distributions,\n which require the charmap to be specified as part of the locale\n when generating it.\n\n verbose\n Show extra warnings about errors that are normally ignored.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' locale.gen_locale en_US.UTF-8\n salt '*' locale.gen_locale 'en_IE.UTF-8 UTF-8' # Debian/Gentoo only\n " on_debian = (__grains__.get('os') == 'Debian') on_ubuntu = (__grains__.get('os') == 'Ubuntu') on_gentoo = (__grains__.get('os_family') == 'Gentoo') on_suse = (__grains__.get('os_family') == 'Suse') on_solaris = (__grains__.get('os_family') == 'Solaris') if on_solaris: return (locale in __salt__['locale.list_avail']()) locale_info = salt.utils.locales.split_locale(locale) if ((not locale_info['charmap']) and (not on_ubuntu)): locale_info['charmap'] = locale_info['codeset'] locale = salt.utils.locales.join_locale(locale_info) if (on_debian or on_gentoo): search = '/usr/share/i18n/SUPPORTED' valid = __salt__['file.search'](search, '^{0}$'.format(locale), flags=re.MULTILINE) else: if on_suse: search = '/usr/share/locale' else: search = '/usr/share/i18n/locales' try: valid = ('{0}_{1}'.format(locale_info['language'], locale_info['territory']) in os.listdir(search)) except OSError as ex: log.error(ex) raise CommandExecutionError('Locale "{0}" is not available.'.format(locale)) if (not valid): log.error('The provided locale "{0}" is not found in {1}'.format(locale, search)) return False if os.path.exists('/etc/locale.gen'): __salt__['file.replace']('/etc/locale.gen', '^\\s*#\\s*{0}\\s*$'.format(locale), '{0}\n'.format(locale), append_if_not_found=True) elif on_ubuntu: __salt__['file.touch']('/var/lib/locales/supported.d/{0}'.format(locale_info['language'])) __salt__['file.replace']('/var/lib/locales/supported.d/{0}'.format(locale_info['language']), locale, locale, append_if_not_found=True) if (salt.utils.which('locale-gen') is not None): cmd = ['locale-gen'] if on_gentoo: cmd.append('--generate') if on_ubuntu: cmd.append(salt.utils.locales.normalize_locale(locale)) else: cmd.append(locale) elif (salt.utils.which('localedef') is not None): cmd = ['localedef', '--force', '-i', '{0}_{1}'.format(locale_info['language'], locale_info['territory']), '-f', locale_info['codeset'], '{0}_{1}.{2}'.format(locale_info['language'], locale_info['territory'], locale_info['codeset'])] cmd.append(((kwargs.get('verbose', False) and '--verbose') or '--quiet')) else: raise CommandExecutionError('Command "locale-gen" or "localedef" was not found on this system.') res = __salt__['cmd.run_all'](cmd) if res['retcode']: log.error(res['stderr']) if kwargs.get('verbose'): return res else: return (res['retcode'] == 0)<|docstring|>Generate a locale. Options: .. versionadded:: 2014.7.0 :param locale: Any locale listed in /usr/share/i18n/locales or /usr/share/i18n/SUPPORTED for Debian and Gentoo based distributions, which require the charmap to be specified as part of the locale when generating it. verbose Show extra warnings about errors that are normally ignored. CLI Example: .. code-block:: bash salt '*' locale.gen_locale en_US.UTF-8 salt '*' locale.gen_locale 'en_IE.UTF-8 UTF-8' # Debian/Gentoo only<|endoftext|>
b245d0e468a25bba76fd62dba4ccaea01c3fbdd2f5c5531a02b7097716d574ce
@classmethod def matches_path(cls, path): '\n tests if the ioclient should be used for this type of path\n Matches any sqlite:\n ' return path.startswith('sqlite:')
tests if the ioclient should be used for this type of path Matches any sqlite:
vendor-local/lib/python/silme/io/sqlite.py
matches_path
Acidburn0zzz/pontoon
0
python
@classmethod def matches_path(cls, path): '\n tests if the ioclient should be used for this type of path\n Matches any sqlite:\n ' return path.startswith('sqlite:')
@classmethod def matches_path(cls, path): '\n tests if the ioclient should be used for this type of path\n Matches any sqlite:\n ' return path.startswith('sqlite:')<|docstring|>tests if the ioclient should be used for this type of path Matches any sqlite:<|endoftext|>
b6f9f4c07c91e4cdfae65e377b9092c2f1f229fa16406d099aa6dc83ddcd0975
def test_model_init(self): '\n\t\tTest that the __init__ call sets all the instance\n\t\tattributes properly.\n\t\t' model = self.get_model() self.assertEqual(model.num_classes, self.NUM_CLASSES) self.assertEqual(model.bert_dir, self.BERT_DIR) self.assertEqual(model.max_seq_length, self.MAX_SEQ_LENGTH) self.assertEqual(model.dense_size, self.DENSE_SIZE) self.assertEqual(model.dropout_rate, self.DROPOUT_RATE) self.assertEqual(model.num_dense_layers, self.NUM_DENSE_LAYERS)
Test that the __init__ call sets all the instance attributes properly.
smart_news_query_embeddings/tests/test_bert_keras_model.py
test_model_init
googleinterns/smart-news-query-embeddings
0
python
def test_model_init(self): '\n\t\tTest that the __init__ call sets all the instance\n\t\tattributes properly.\n\t\t' model = self.get_model() self.assertEqual(model.num_classes, self.NUM_CLASSES) self.assertEqual(model.bert_dir, self.BERT_DIR) self.assertEqual(model.max_seq_length, self.MAX_SEQ_LENGTH) self.assertEqual(model.dense_size, self.DENSE_SIZE) self.assertEqual(model.dropout_rate, self.DROPOUT_RATE) self.assertEqual(model.num_dense_layers, self.NUM_DENSE_LAYERS)
def test_model_init(self): '\n\t\tTest that the __init__ call sets all the instance\n\t\tattributes properly.\n\t\t' model = self.get_model() self.assertEqual(model.num_classes, self.NUM_CLASSES) self.assertEqual(model.bert_dir, self.BERT_DIR) self.assertEqual(model.max_seq_length, self.MAX_SEQ_LENGTH) self.assertEqual(model.dense_size, self.DENSE_SIZE) self.assertEqual(model.dropout_rate, self.DROPOUT_RATE) self.assertEqual(model.num_dense_layers, self.NUM_DENSE_LAYERS)<|docstring|>Test that the __init__ call sets all the instance attributes properly.<|endoftext|>
9476c343e186d436ca21dd6c005a8b9d96d02c34575038790a3ea4890ac9829e
def test_model_layers(self): '\n\t\tTest that the layers of the instantiated model are what we\n\t\tare expecting.\n\t\t' model = self.get_model() layers = model.layers self.assertIsInstance(layers[0], bert.model.BertModelLayer) self.assertIsInstance(layers[1], tf.keras.layers.Flatten) for i in range(2, (2 + (3 * self.NUM_DENSE_LAYERS)), 3): self.assertIsInstance(layers[i], tf.keras.layers.Dense) self.assertIsInstance(layers[(i + 1)], tf.keras.layers.LeakyReLU) self.assertIsInstance(layers[(i + 2)], tf.keras.layers.Dropout) self.assertIsInstance(layers[(- 1)], tf.keras.layers.Dense)
Test that the layers of the instantiated model are what we are expecting.
smart_news_query_embeddings/tests/test_bert_keras_model.py
test_model_layers
googleinterns/smart-news-query-embeddings
0
python
def test_model_layers(self): '\n\t\tTest that the layers of the instantiated model are what we\n\t\tare expecting.\n\t\t' model = self.get_model() layers = model.layers self.assertIsInstance(layers[0], bert.model.BertModelLayer) self.assertIsInstance(layers[1], tf.keras.layers.Flatten) for i in range(2, (2 + (3 * self.NUM_DENSE_LAYERS)), 3): self.assertIsInstance(layers[i], tf.keras.layers.Dense) self.assertIsInstance(layers[(i + 1)], tf.keras.layers.LeakyReLU) self.assertIsInstance(layers[(i + 2)], tf.keras.layers.Dropout) self.assertIsInstance(layers[(- 1)], tf.keras.layers.Dense)
def test_model_layers(self): '\n\t\tTest that the layers of the instantiated model are what we\n\t\tare expecting.\n\t\t' model = self.get_model() layers = model.layers self.assertIsInstance(layers[0], bert.model.BertModelLayer) self.assertIsInstance(layers[1], tf.keras.layers.Flatten) for i in range(2, (2 + (3 * self.NUM_DENSE_LAYERS)), 3): self.assertIsInstance(layers[i], tf.keras.layers.Dense) self.assertIsInstance(layers[(i + 1)], tf.keras.layers.LeakyReLU) self.assertIsInstance(layers[(i + 2)], tf.keras.layers.Dropout) self.assertIsInstance(layers[(- 1)], tf.keras.layers.Dense)<|docstring|>Test that the layers of the instantiated model are what we are expecting.<|endoftext|>
3fd7ac0680faa54f7e762578ad2e17769ae14ff59fffb87445cb8d98d8a893d5
def test_model_call(self): '\n\t\tTest that the forward pass of the model returns an output\n\t\twith exactly the number of classes we specify.\n\t\t' model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) output = model(x).numpy() self.assertEqual(output.shape, (1, self.NUM_CLASSES))
Test that the forward pass of the model returns an output with exactly the number of classes we specify.
smart_news_query_embeddings/tests/test_bert_keras_model.py
test_model_call
googleinterns/smart-news-query-embeddings
0
python
def test_model_call(self): '\n\t\tTest that the forward pass of the model returns an output\n\t\twith exactly the number of classes we specify.\n\t\t' model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) output = model(x).numpy() self.assertEqual(output.shape, (1, self.NUM_CLASSES))
def test_model_call(self): '\n\t\tTest that the forward pass of the model returns an output\n\t\twith exactly the number of classes we specify.\n\t\t' model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) output = model(x).numpy() self.assertEqual(output.shape, (1, self.NUM_CLASSES))<|docstring|>Test that the forward pass of the model returns an output with exactly the number of classes we specify.<|endoftext|>
a11b2637a111f63f52f4d964c0dd62aa4e3ad7e81300af23b7ec2d43b26b263a
def test_get_embedding(self): '\n\t\tTest that we are able to extract embeddings from an inner dense\n\t\tlayer with the correct shape.\n\t\t' model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) embedding = model.get_embedding(x).numpy() self.assertEqual(embedding.shape, (1, self.DENSE_SIZE))
Test that we are able to extract embeddings from an inner dense layer with the correct shape.
smart_news_query_embeddings/tests/test_bert_keras_model.py
test_get_embedding
googleinterns/smart-news-query-embeddings
0
python
def test_get_embedding(self): '\n\t\tTest that we are able to extract embeddings from an inner dense\n\t\tlayer with the correct shape.\n\t\t' model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) embedding = model.get_embedding(x).numpy() self.assertEqual(embedding.shape, (1, self.DENSE_SIZE))
def test_get_embedding(self): '\n\t\tTest that we are able to extract embeddings from an inner dense\n\t\tlayer with the correct shape.\n\t\t' model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) embedding = model.get_embedding(x).numpy() self.assertEqual(embedding.shape, (1, self.DENSE_SIZE))<|docstring|>Test that we are able to extract embeddings from an inner dense layer with the correct shape.<|endoftext|>
04ab9f87c7ce00b172e0a0975323025f43d0f21808e9709725b85ce8de456adc
def test_model_save(self): '\n\t\tTest that we can serialize the model and reload it, and still\n\t\tget embeddings from it. This is the primary use case of these\n\t\ttrained models for this project.\n\t\t' out_dir = tempfile.mkdtemp() model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) out = model.predict(x) model.save(out_dir) model = tf.keras.models.load_model(out_dir) embedding = model.get_embedding(x).numpy() self.assertEqual(embedding.shape, (1, self.DENSE_SIZE)) shutil.rmtree(out_dir)
Test that we can serialize the model and reload it, and still get embeddings from it. This is the primary use case of these trained models for this project.
smart_news_query_embeddings/tests/test_bert_keras_model.py
test_model_save
googleinterns/smart-news-query-embeddings
0
python
def test_model_save(self): '\n\t\tTest that we can serialize the model and reload it, and still\n\t\tget embeddings from it. This is the primary use case of these\n\t\ttrained models for this project.\n\t\t' out_dir = tempfile.mkdtemp() model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) out = model.predict(x) model.save(out_dir) model = tf.keras.models.load_model(out_dir) embedding = model.get_embedding(x).numpy() self.assertEqual(embedding.shape, (1, self.DENSE_SIZE)) shutil.rmtree(out_dir)
def test_model_save(self): '\n\t\tTest that we can serialize the model and reload it, and still\n\t\tget embeddings from it. This is the primary use case of these\n\t\ttrained models for this project.\n\t\t' out_dir = tempfile.mkdtemp() model = self.get_model() model.build(input_shape=(None, self.MAX_SEQ_LENGTH)) x = np.zeros((1, self.MAX_SEQ_LENGTH)) out = model.predict(x) model.save(out_dir) model = tf.keras.models.load_model(out_dir) embedding = model.get_embedding(x).numpy() self.assertEqual(embedding.shape, (1, self.DENSE_SIZE)) shutil.rmtree(out_dir)<|docstring|>Test that we can serialize the model and reload it, and still get embeddings from it. This is the primary use case of these trained models for this project.<|endoftext|>
bae0712e97cd35aeb3f954bfba2382e52560de320dd4b7e286abc49ab778e0b1
def _api_not_enabled(error): "Checks if the error is due to the API not being enabled for project.\n\n Args:\n error (Exception): The error to check.\n\n Returns:\n tuple: (bool, str) True, API not enabled reason if API is not enabled\n or False, '' if there is a different exception.\n " if isinstance(error, errors.HttpError): if ((error.resp.status == 403) and error.resp.get('content-type', '').startswith('application/json')): error_details = json.loads(error.content.decode('utf-8')) all_errors = error_details.get('error', {}).get('errors', []) api_disabled_errors = [err for err in all_errors if ((err.get('domain') == 'usageLimits') and (err.get('reason') == 'accessNotConfigured'))] if (api_disabled_errors and (len(api_disabled_errors) == len(all_errors))): return (True, api_disabled_errors[0].get('extendedHelp', '')) return (False, '')
Checks if the error is due to the API not being enabled for project. Args: error (Exception): The error to check. Returns: tuple: (bool, str) True, API not enabled reason if API is not enabled or False, '' if there is a different exception.
google/cloud/forseti/common/gcp_api/compute.py
_api_not_enabled
muralidkt/forseti-security
921
python
def _api_not_enabled(error): "Checks if the error is due to the API not being enabled for project.\n\n Args:\n error (Exception): The error to check.\n\n Returns:\n tuple: (bool, str) True, API not enabled reason if API is not enabled\n or False, if there is a different exception.\n " if isinstance(error, errors.HttpError): if ((error.resp.status == 403) and error.resp.get('content-type', ).startswith('application/json')): error_details = json.loads(error.content.decode('utf-8')) all_errors = error_details.get('error', {}).get('errors', []) api_disabled_errors = [err for err in all_errors if ((err.get('domain') == 'usageLimits') and (err.get('reason') == 'accessNotConfigured'))] if (api_disabled_errors and (len(api_disabled_errors) == len(all_errors))): return (True, api_disabled_errors[0].get('extendedHelp', )) return (False, )
def _api_not_enabled(error): "Checks if the error is due to the API not being enabled for project.\n\n Args:\n error (Exception): The error to check.\n\n Returns:\n tuple: (bool, str) True, API not enabled reason if API is not enabled\n or False, if there is a different exception.\n " if isinstance(error, errors.HttpError): if ((error.resp.status == 403) and error.resp.get('content-type', ).startswith('application/json')): error_details = json.loads(error.content.decode('utf-8')) all_errors = error_details.get('error', {}).get('errors', []) api_disabled_errors = [err for err in all_errors if ((err.get('domain') == 'usageLimits') and (err.get('reason') == 'accessNotConfigured'))] if (api_disabled_errors and (len(api_disabled_errors) == len(all_errors))): return (True, api_disabled_errors[0].get('extendedHelp', )) return (False, )<|docstring|>Checks if the error is due to the API not being enabled for project. Args: error (Exception): The error to check. Returns: tuple: (bool, str) True, API not enabled reason if API is not enabled or False, '' if there is a different exception.<|endoftext|>
84690bbfafef9a6bf9382fc09b630d2d76cc8449229912a5c21920fdddb4009e
def _flatten_aggregated_list_results(project_id, paged_results, item_key, sort_key='name'): 'Flatten results and handle exceptions.\n\n Args:\n project_id (str): The project id the results are for.\n paged_results (list): A list of paged API response objects.\n [{page 1 results}, {page 2 results}, {page 3 results}, ...]\n item_key (str): The name of the key within the inner "items" lists\n containing the objects of interest.\n sort_key (str): The name of the key to sort the results by before\n returning.\n\n Returns:\n list: A sorted list of items.\n\n Raises:\n ApiNotEnabledError: Raised if the API is not enabled for the project.\n ApiExecutionError: Raised if there is another error while calling the\n API method.\n ' try: return sorted(api_helpers.flatten_aggregated_list_results(paged_results, item_key), key=(lambda d: d.get(sort_key, ''))) except (errors.HttpError, HttpLib2Error) as e: (api_not_enabled, details) = _api_not_enabled(e) if api_not_enabled: raise api_errors.ApiNotEnabledError(details, e) raise api_errors.ApiExecutionError(project_id, e)
Flatten results and handle exceptions. Args: project_id (str): The project id the results are for. paged_results (list): A list of paged API response objects. [{page 1 results}, {page 2 results}, {page 3 results}, ...] item_key (str): The name of the key within the inner "items" lists containing the objects of interest. sort_key (str): The name of the key to sort the results by before returning. Returns: list: A sorted list of items. Raises: ApiNotEnabledError: Raised if the API is not enabled for the project. ApiExecutionError: Raised if there is another error while calling the API method.
google/cloud/forseti/common/gcp_api/compute.py
_flatten_aggregated_list_results
muralidkt/forseti-security
921
python
def _flatten_aggregated_list_results(project_id, paged_results, item_key, sort_key='name'): 'Flatten results and handle exceptions.\n\n Args:\n project_id (str): The project id the results are for.\n paged_results (list): A list of paged API response objects.\n [{page 1 results}, {page 2 results}, {page 3 results}, ...]\n item_key (str): The name of the key within the inner "items" lists\n containing the objects of interest.\n sort_key (str): The name of the key to sort the results by before\n returning.\n\n Returns:\n list: A sorted list of items.\n\n Raises:\n ApiNotEnabledError: Raised if the API is not enabled for the project.\n ApiExecutionError: Raised if there is another error while calling the\n API method.\n ' try: return sorted(api_helpers.flatten_aggregated_list_results(paged_results, item_key), key=(lambda d: d.get(sort_key, ))) except (errors.HttpError, HttpLib2Error) as e: (api_not_enabled, details) = _api_not_enabled(e) if api_not_enabled: raise api_errors.ApiNotEnabledError(details, e) raise api_errors.ApiExecutionError(project_id, e)
def _flatten_aggregated_list_results(project_id, paged_results, item_key, sort_key='name'): 'Flatten results and handle exceptions.\n\n Args:\n project_id (str): The project id the results are for.\n paged_results (list): A list of paged API response objects.\n [{page 1 results}, {page 2 results}, {page 3 results}, ...]\n item_key (str): The name of the key within the inner "items" lists\n containing the objects of interest.\n sort_key (str): The name of the key to sort the results by before\n returning.\n\n Returns:\n list: A sorted list of items.\n\n Raises:\n ApiNotEnabledError: Raised if the API is not enabled for the project.\n ApiExecutionError: Raised if there is another error while calling the\n API method.\n ' try: return sorted(api_helpers.flatten_aggregated_list_results(paged_results, item_key), key=(lambda d: d.get(sort_key, ))) except (errors.HttpError, HttpLib2Error) as e: (api_not_enabled, details) = _api_not_enabled(e) if api_not_enabled: raise api_errors.ApiNotEnabledError(details, e) raise api_errors.ApiExecutionError(project_id, e)<|docstring|>Flatten results and handle exceptions. Args: project_id (str): The project id the results are for. paged_results (list): A list of paged API response objects. [{page 1 results}, {page 2 results}, {page 3 results}, ...] item_key (str): The name of the key within the inner "items" lists containing the objects of interest. sort_key (str): The name of the key to sort the results by before returning. Returns: list: A sorted list of items. Raises: ApiNotEnabledError: Raised if the API is not enabled for the project. ApiExecutionError: Raised if there is another error while calling the API method.<|endoftext|>
bdfda0a6ae1247c4c1f6b1ef35ff8b264a8ba67e307ab4bfff1f304536b0bca9
def _flatten_list_results(project_id, paged_results, item_key): 'Flatten results and handle exceptions.\n\n Args:\n project_id (str): The project id the results are for.\n paged_results (list): A list of paged API response objects.\n [{page 1 results}, {page 2 results}, {page 3 results}, ...]\n item_key (str): The name of the key within the inner "items" lists\n containing the objects of interest.\n\n Returns:\n list: A list of items.\n\n Raises:\n ApiNotEnabledError: Raised if the API is not enabled for the project.\n ApiExecutionError: Raised if there is another error while calling the\n API method.\n ' try: return api_helpers.flatten_list_results(paged_results, item_key) except (errors.HttpError, HttpLib2Error) as e: (api_not_enabled, details) = _api_not_enabled(e) if api_not_enabled: raise api_errors.ApiNotEnabledError(details, e) raise api_errors.ApiExecutionError(project_id, e)
Flatten results and handle exceptions. Args: project_id (str): The project id the results are for. paged_results (list): A list of paged API response objects. [{page 1 results}, {page 2 results}, {page 3 results}, ...] item_key (str): The name of the key within the inner "items" lists containing the objects of interest. Returns: list: A list of items. Raises: ApiNotEnabledError: Raised if the API is not enabled for the project. ApiExecutionError: Raised if there is another error while calling the API method.
google/cloud/forseti/common/gcp_api/compute.py
_flatten_list_results
muralidkt/forseti-security
921
python
def _flatten_list_results(project_id, paged_results, item_key): 'Flatten results and handle exceptions.\n\n Args:\n project_id (str): The project id the results are for.\n paged_results (list): A list of paged API response objects.\n [{page 1 results}, {page 2 results}, {page 3 results}, ...]\n item_key (str): The name of the key within the inner "items" lists\n containing the objects of interest.\n\n Returns:\n list: A list of items.\n\n Raises:\n ApiNotEnabledError: Raised if the API is not enabled for the project.\n ApiExecutionError: Raised if there is another error while calling the\n API method.\n ' try: return api_helpers.flatten_list_results(paged_results, item_key) except (errors.HttpError, HttpLib2Error) as e: (api_not_enabled, details) = _api_not_enabled(e) if api_not_enabled: raise api_errors.ApiNotEnabledError(details, e) raise api_errors.ApiExecutionError(project_id, e)
def _flatten_list_results(project_id, paged_results, item_key): 'Flatten results and handle exceptions.\n\n Args:\n project_id (str): The project id the results are for.\n paged_results (list): A list of paged API response objects.\n [{page 1 results}, {page 2 results}, {page 3 results}, ...]\n item_key (str): The name of the key within the inner "items" lists\n containing the objects of interest.\n\n Returns:\n list: A list of items.\n\n Raises:\n ApiNotEnabledError: Raised if the API is not enabled for the project.\n ApiExecutionError: Raised if there is another error while calling the\n API method.\n ' try: return api_helpers.flatten_list_results(paged_results, item_key) except (errors.HttpError, HttpLib2Error) as e: (api_not_enabled, details) = _api_not_enabled(e) if api_not_enabled: raise api_errors.ApiNotEnabledError(details, e) raise api_errors.ApiExecutionError(project_id, e)<|docstring|>Flatten results and handle exceptions. Args: project_id (str): The project id the results are for. paged_results (list): A list of paged API response objects. [{page 1 results}, {page 2 results}, {page 3 results}, ...] item_key (str): The name of the key within the inner "items" lists containing the objects of interest. Returns: list: A list of items. Raises: ApiNotEnabledError: Raised if the API is not enabled for the project. ApiExecutionError: Raised if there is another error while calling the API method.<|endoftext|>
6a768951172b7f6fa79a4d9b897d8c87a971cb7cee3a9512d02361cc1b737be1
def _debug_operation_response_time(project_id, operation): 'Log timing details for a running operation if debug logs enabled.\n\n Args:\n project_id (str): The project id the operation was for.\n operation (dict): The last Operation resource returned from the\n API server.\n ' try: if (LOGGER.getEffectiveLevel() > logging.DEBUG): return except Exception as e: LOGGER.debug('DEBUG logging exception: %s', e) try: op_insert_timestamp = date_time.get_unix_timestamp_from_string(operation.get('insertTime', '')) op_start_timestamp = date_time.get_unix_timestamp_from_string(operation.get('startTime', '')) op_end_timestamp = date_time.get_unix_timestamp_from_string(operation.get('endTime', '')) except ValueError: op_insert_timestamp = op_start_timestamp = op_end_timestamp = 0 op_wait_time = (op_end_timestamp - op_insert_timestamp) op_exec_time = (op_end_timestamp - op_start_timestamp) LOGGER.debug('Operation %s completed for project %s. Operation type: %s, request time: %s, start time: %s, finished time: %s, req->end seconds: %i, start->end seconds: %i.', operation.get('name', ''), project_id, operation.get('operationType', ''), operation.get('insertTime', ''), operation.get('startTime', ''), operation.get('endTime', ''), op_wait_time, op_exec_time)
Log timing details for a running operation if debug logs enabled. Args: project_id (str): The project id the operation was for. operation (dict): The last Operation resource returned from the API server.
google/cloud/forseti/common/gcp_api/compute.py
_debug_operation_response_time
muralidkt/forseti-security
921
python
def _debug_operation_response_time(project_id, operation): 'Log timing details for a running operation if debug logs enabled.\n\n Args:\n project_id (str): The project id the operation was for.\n operation (dict): The last Operation resource returned from the\n API server.\n ' try: if (LOGGER.getEffectiveLevel() > logging.DEBUG): return except Exception as e: LOGGER.debug('DEBUG logging exception: %s', e) try: op_insert_timestamp = date_time.get_unix_timestamp_from_string(operation.get('insertTime', )) op_start_timestamp = date_time.get_unix_timestamp_from_string(operation.get('startTime', )) op_end_timestamp = date_time.get_unix_timestamp_from_string(operation.get('endTime', )) except ValueError: op_insert_timestamp = op_start_timestamp = op_end_timestamp = 0 op_wait_time = (op_end_timestamp - op_insert_timestamp) op_exec_time = (op_end_timestamp - op_start_timestamp) LOGGER.debug('Operation %s completed for project %s. Operation type: %s, request time: %s, start time: %s, finished time: %s, req->end seconds: %i, start->end seconds: %i.', operation.get('name', ), project_id, operation.get('operationType', ), operation.get('insertTime', ), operation.get('startTime', ), operation.get('endTime', ), op_wait_time, op_exec_time)
def _debug_operation_response_time(project_id, operation): 'Log timing details for a running operation if debug logs enabled.\n\n Args:\n project_id (str): The project id the operation was for.\n operation (dict): The last Operation resource returned from the\n API server.\n ' try: if (LOGGER.getEffectiveLevel() > logging.DEBUG): return except Exception as e: LOGGER.debug('DEBUG logging exception: %s', e) try: op_insert_timestamp = date_time.get_unix_timestamp_from_string(operation.get('insertTime', )) op_start_timestamp = date_time.get_unix_timestamp_from_string(operation.get('startTime', )) op_end_timestamp = date_time.get_unix_timestamp_from_string(operation.get('endTime', )) except ValueError: op_insert_timestamp = op_start_timestamp = op_end_timestamp = 0 op_wait_time = (op_end_timestamp - op_insert_timestamp) op_exec_time = (op_end_timestamp - op_start_timestamp) LOGGER.debug('Operation %s completed for project %s. Operation type: %s, request time: %s, start time: %s, finished time: %s, req->end seconds: %i, start->end seconds: %i.', operation.get('name', ), project_id, operation.get('operationType', ), operation.get('insertTime', ), operation.get('startTime', ), operation.get('endTime', ), op_wait_time, op_exec_time)<|docstring|>Log timing details for a running operation if debug logs enabled. Args: project_id (str): The project id the operation was for. operation (dict): The last Operation resource returned from the API server.<|endoftext|>
f0ae2d9bad320d581453c74662709da9f0409b6e5873b916cc1984a7309b4fa3
def __init__(self, quota_max_calls=None, quota_period=100.0, use_rate_limiter=True, read_only=False, cache_discovery=False, cache=None): 'Constructor.\n\n Args:\n quota_max_calls (int): Allowed requests per <quota_period> for the\n API.\n quota_period (float): The time period to track requests over.\n use_rate_limiter (bool): Set to false to disable the use of a rate\n limiter for this service.\n read_only (bool): When set to true, disables any API calls that\n would modify a resource within the repository.\n cache_discovery (bool): When set to true, googleapiclient will cache\n HTTP requests to API discovery endpoints.\n cache (googleapiclient.discovery_cache.base.Cache): instance of a\n class that can cache API discovery documents. If None,\n googleapiclient will attempt to choose a default.\n ' if (not quota_max_calls): use_rate_limiter = False self._backend_services = None self._disks = None self._firewalls = None self._forwarding_rules = None self._global_operations = None self._images = None self._instance_group_managers = None self._instance_groups = None self._instance_templates = None self._instances = None self._networks = None self._projects = None self._region_instance_groups = None self._snapshots = None self._subnetworks = None super(ComputeRepositoryClient, self).__init__(API_NAME, versions=['beta', 'v1'], quota_max_calls=quota_max_calls, quota_period=quota_period, use_rate_limiter=use_rate_limiter, read_only=read_only, cache_discovery=cache_discovery, cache=cache)
Constructor. Args: quota_max_calls (int): Allowed requests per <quota_period> for the API. quota_period (float): The time period to track requests over. use_rate_limiter (bool): Set to false to disable the use of a rate limiter for this service. read_only (bool): When set to true, disables any API calls that would modify a resource within the repository. cache_discovery (bool): When set to true, googleapiclient will cache HTTP requests to API discovery endpoints. cache (googleapiclient.discovery_cache.base.Cache): instance of a class that can cache API discovery documents. If None, googleapiclient will attempt to choose a default.
google/cloud/forseti/common/gcp_api/compute.py
__init__
muralidkt/forseti-security
921
python
def __init__(self, quota_max_calls=None, quota_period=100.0, use_rate_limiter=True, read_only=False, cache_discovery=False, cache=None): 'Constructor.\n\n Args:\n quota_max_calls (int): Allowed requests per <quota_period> for the\n API.\n quota_period (float): The time period to track requests over.\n use_rate_limiter (bool): Set to false to disable the use of a rate\n limiter for this service.\n read_only (bool): When set to true, disables any API calls that\n would modify a resource within the repository.\n cache_discovery (bool): When set to true, googleapiclient will cache\n HTTP requests to API discovery endpoints.\n cache (googleapiclient.discovery_cache.base.Cache): instance of a\n class that can cache API discovery documents. If None,\n googleapiclient will attempt to choose a default.\n ' if (not quota_max_calls): use_rate_limiter = False self._backend_services = None self._disks = None self._firewalls = None self._forwarding_rules = None self._global_operations = None self._images = None self._instance_group_managers = None self._instance_groups = None self._instance_templates = None self._instances = None self._networks = None self._projects = None self._region_instance_groups = None self._snapshots = None self._subnetworks = None super(ComputeRepositoryClient, self).__init__(API_NAME, versions=['beta', 'v1'], quota_max_calls=quota_max_calls, quota_period=quota_period, use_rate_limiter=use_rate_limiter, read_only=read_only, cache_discovery=cache_discovery, cache=cache)
def __init__(self, quota_max_calls=None, quota_period=100.0, use_rate_limiter=True, read_only=False, cache_discovery=False, cache=None): 'Constructor.\n\n Args:\n quota_max_calls (int): Allowed requests per <quota_period> for the\n API.\n quota_period (float): The time period to track requests over.\n use_rate_limiter (bool): Set to false to disable the use of a rate\n limiter for this service.\n read_only (bool): When set to true, disables any API calls that\n would modify a resource within the repository.\n cache_discovery (bool): When set to true, googleapiclient will cache\n HTTP requests to API discovery endpoints.\n cache (googleapiclient.discovery_cache.base.Cache): instance of a\n class that can cache API discovery documents. If None,\n googleapiclient will attempt to choose a default.\n ' if (not quota_max_calls): use_rate_limiter = False self._backend_services = None self._disks = None self._firewalls = None self._forwarding_rules = None self._global_operations = None self._images = None self._instance_group_managers = None self._instance_groups = None self._instance_templates = None self._instances = None self._networks = None self._projects = None self._region_instance_groups = None self._snapshots = None self._subnetworks = None super(ComputeRepositoryClient, self).__init__(API_NAME, versions=['beta', 'v1'], quota_max_calls=quota_max_calls, quota_period=quota_period, use_rate_limiter=use_rate_limiter, read_only=read_only, cache_discovery=cache_discovery, cache=cache)<|docstring|>Constructor. Args: quota_max_calls (int): Allowed requests per <quota_period> for the API. quota_period (float): The time period to track requests over. use_rate_limiter (bool): Set to false to disable the use of a rate limiter for this service. read_only (bool): When set to true, disables any API calls that would modify a resource within the repository. cache_discovery (bool): When set to true, googleapiclient will cache HTTP requests to API discovery endpoints. cache (googleapiclient.discovery_cache.base.Cache): instance of a class that can cache API discovery documents. If None, googleapiclient will attempt to choose a default.<|endoftext|>
8f32ec278b70f8bd11c72b275c34d0a371869b4f32a4843e3e57e6d46cf4a8c1
@property def backend_services(self): 'Returns a _ComputeBackendServicesRepository instance.' if (not self._backend_services): self._backend_services = self._init_repository(_ComputeBackendServicesRepository, version='beta') return self._backend_services
Returns a _ComputeBackendServicesRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
backend_services
muralidkt/forseti-security
921
python
@property def backend_services(self): if (not self._backend_services): self._backend_services = self._init_repository(_ComputeBackendServicesRepository, version='beta') return self._backend_services
@property def backend_services(self): if (not self._backend_services): self._backend_services = self._init_repository(_ComputeBackendServicesRepository, version='beta') return self._backend_services<|docstring|>Returns a _ComputeBackendServicesRepository instance.<|endoftext|>
ec6374808a99e99b5c7b6302ffbfe9140550a1e016aac7660ef84c245898c072
@property def disks(self): 'Returns a _ComputeDisksRepository instance.' if (not self._disks): self._disks = self._init_repository(_ComputeDisksRepository) return self._disks
Returns a _ComputeDisksRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
disks
muralidkt/forseti-security
921
python
@property def disks(self): if (not self._disks): self._disks = self._init_repository(_ComputeDisksRepository) return self._disks
@property def disks(self): if (not self._disks): self._disks = self._init_repository(_ComputeDisksRepository) return self._disks<|docstring|>Returns a _ComputeDisksRepository instance.<|endoftext|>
075095d6053c9cd00618e86208e5ef6a50fbd39d3c184a870b1385109bdf7ff5
@property def firewalls(self): 'Returns a _ComputeFirewallsRepository instance.' if (not self._firewalls): self._firewalls = self._init_repository(_ComputeFirewallsRepository) return self._firewalls
Returns a _ComputeFirewallsRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
firewalls
muralidkt/forseti-security
921
python
@property def firewalls(self): if (not self._firewalls): self._firewalls = self._init_repository(_ComputeFirewallsRepository) return self._firewalls
@property def firewalls(self): if (not self._firewalls): self._firewalls = self._init_repository(_ComputeFirewallsRepository) return self._firewalls<|docstring|>Returns a _ComputeFirewallsRepository instance.<|endoftext|>
a9a216bc37ddd9a6c9512a0b4397b2afad0f8a0a9fd9f8a7eede6d0df8f90317
@property def forwarding_rules(self): 'Returns a _ComputeForwardingRulesRepository instance.' if (not self._forwarding_rules): self._forwarding_rules = self._init_repository(_ComputeForwardingRulesRepository) return self._forwarding_rules
Returns a _ComputeForwardingRulesRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
forwarding_rules
muralidkt/forseti-security
921
python
@property def forwarding_rules(self): if (not self._forwarding_rules): self._forwarding_rules = self._init_repository(_ComputeForwardingRulesRepository) return self._forwarding_rules
@property def forwarding_rules(self): if (not self._forwarding_rules): self._forwarding_rules = self._init_repository(_ComputeForwardingRulesRepository) return self._forwarding_rules<|docstring|>Returns a _ComputeForwardingRulesRepository instance.<|endoftext|>
b86d61b57d40545189a2191f5f78d4dce0a348e2fb89817bf1d00d919407c467
@property def global_operations(self): 'Returns a _ComputeGlobalOperationsRepository instance.' if (not self._global_operations): self._global_operations = self._init_repository(_ComputeGlobalOperationsRepository) return self._global_operations
Returns a _ComputeGlobalOperationsRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
global_operations
muralidkt/forseti-security
921
python
@property def global_operations(self): if (not self._global_operations): self._global_operations = self._init_repository(_ComputeGlobalOperationsRepository) return self._global_operations
@property def global_operations(self): if (not self._global_operations): self._global_operations = self._init_repository(_ComputeGlobalOperationsRepository) return self._global_operations<|docstring|>Returns a _ComputeGlobalOperationsRepository instance.<|endoftext|>
9f8f52ca77be6c4b8f1d8f8c7e496ac9f890ef2cbc2c67ec376c87c009d163ed
@property def images(self): 'Returns a _ComputeImagesRepository instance.' if (not self._images): self._images = self._init_repository(_ComputeImagesRepository) return self._images
Returns a _ComputeImagesRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
images
muralidkt/forseti-security
921
python
@property def images(self): if (not self._images): self._images = self._init_repository(_ComputeImagesRepository) return self._images
@property def images(self): if (not self._images): self._images = self._init_repository(_ComputeImagesRepository) return self._images<|docstring|>Returns a _ComputeImagesRepository instance.<|endoftext|>
01003900e9128a194bba587ad09a6d4819ab0812115792a788cda72cee51d938
@property def instance_group_managers(self): 'Returns a _ComputeInstanceGroupManagersRepository instance.' if (not self._instance_group_managers): self._instance_group_managers = self._init_repository(_ComputeInstanceGroupManagersRepository) return self._instance_group_managers
Returns a _ComputeInstanceGroupManagersRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
instance_group_managers
muralidkt/forseti-security
921
python
@property def instance_group_managers(self): if (not self._instance_group_managers): self._instance_group_managers = self._init_repository(_ComputeInstanceGroupManagersRepository) return self._instance_group_managers
@property def instance_group_managers(self): if (not self._instance_group_managers): self._instance_group_managers = self._init_repository(_ComputeInstanceGroupManagersRepository) return self._instance_group_managers<|docstring|>Returns a _ComputeInstanceGroupManagersRepository instance.<|endoftext|>
b9d892c6334c2e4ad25389ee3d0fcaa3f2c11e605772d0bea862865deb33c799
@property def instance_groups(self): 'Returns a _ComputeInstanceGroupsRepository instance.' if (not self._instance_groups): self._instance_groups = self._init_repository(_ComputeInstanceGroupsRepository) return self._instance_groups
Returns a _ComputeInstanceGroupsRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
instance_groups
muralidkt/forseti-security
921
python
@property def instance_groups(self): if (not self._instance_groups): self._instance_groups = self._init_repository(_ComputeInstanceGroupsRepository) return self._instance_groups
@property def instance_groups(self): if (not self._instance_groups): self._instance_groups = self._init_repository(_ComputeInstanceGroupsRepository) return self._instance_groups<|docstring|>Returns a _ComputeInstanceGroupsRepository instance.<|endoftext|>
58e18098e03aeaba63731f955774ad13fb0bc3ee4a3da5f0350855248412cb69
@property def instance_templates(self): 'Returns a _ComputeInstanceTemplatesRepository instance.' if (not self._instance_templates): self._instance_templates = self._init_repository(_ComputeInstanceTemplatesRepository) return self._instance_templates
Returns a _ComputeInstanceTemplatesRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
instance_templates
muralidkt/forseti-security
921
python
@property def instance_templates(self): if (not self._instance_templates): self._instance_templates = self._init_repository(_ComputeInstanceTemplatesRepository) return self._instance_templates
@property def instance_templates(self): if (not self._instance_templates): self._instance_templates = self._init_repository(_ComputeInstanceTemplatesRepository) return self._instance_templates<|docstring|>Returns a _ComputeInstanceTemplatesRepository instance.<|endoftext|>
e0fbac814377ac1b14d1031802aee3815c74beaf58722e4e1bf6a98738ff6a1c
@property def instances(self): 'Returns a _ComputeInstancesRepository instance.' if (not self._instances): self._instances = self._init_repository(_ComputeInstancesRepository) return self._instances
Returns a _ComputeInstancesRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
instances
muralidkt/forseti-security
921
python
@property def instances(self): if (not self._instances): self._instances = self._init_repository(_ComputeInstancesRepository) return self._instances
@property def instances(self): if (not self._instances): self._instances = self._init_repository(_ComputeInstancesRepository) return self._instances<|docstring|>Returns a _ComputeInstancesRepository instance.<|endoftext|>
0d6ba395a5fbafd07a33e54720e0dd94aa7a584055ef52f4e24d3973ae63add9
@property def networks(self): 'Returns a _ComputeNetworksRepository instance.' if (not self._networks): self._networks = self._init_repository(_ComputeNetworksRepository) return self._networks
Returns a _ComputeNetworksRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
networks
muralidkt/forseti-security
921
python
@property def networks(self): if (not self._networks): self._networks = self._init_repository(_ComputeNetworksRepository) return self._networks
@property def networks(self): if (not self._networks): self._networks = self._init_repository(_ComputeNetworksRepository) return self._networks<|docstring|>Returns a _ComputeNetworksRepository instance.<|endoftext|>
d917885aed113e3eb635414699d1241c4843bced374fdf0df94a2baf820bcfd0
@property def projects(self): 'Returns a _ComputeProjectsRepository instance.' if (not self._projects): self._projects = self._init_repository(_ComputeProjectsRepository) return self._projects
Returns a _ComputeProjectsRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
projects
muralidkt/forseti-security
921
python
@property def projects(self): if (not self._projects): self._projects = self._init_repository(_ComputeProjectsRepository) return self._projects
@property def projects(self): if (not self._projects): self._projects = self._init_repository(_ComputeProjectsRepository) return self._projects<|docstring|>Returns a _ComputeProjectsRepository instance.<|endoftext|>
607509ba28ec18234485ce8368b1711acd8fbfdad41c70994fc27b6d905855c6
@property def region_instance_groups(self): 'Returns a _ComputeRegionInstanceGroupsRepository instance.' if (not self._region_instance_groups): self._region_instance_groups = self._init_repository(_ComputeRegionInstanceGroupsRepository) return self._region_instance_groups
Returns a _ComputeRegionInstanceGroupsRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
region_instance_groups
muralidkt/forseti-security
921
python
@property def region_instance_groups(self): if (not self._region_instance_groups): self._region_instance_groups = self._init_repository(_ComputeRegionInstanceGroupsRepository) return self._region_instance_groups
@property def region_instance_groups(self): if (not self._region_instance_groups): self._region_instance_groups = self._init_repository(_ComputeRegionInstanceGroupsRepository) return self._region_instance_groups<|docstring|>Returns a _ComputeRegionInstanceGroupsRepository instance.<|endoftext|>
9006e346dbad962bb3c091dc21804c100ea8e8d1c05756d00fb32abdcf011da0
@property def snapshots(self): 'Returns a _ComputeSnapshotsRepository instance.' if (not self._snapshots): self._snapshots = self._init_repository(_ComputeSnapshotsRepository) return self._snapshots
Returns a _ComputeSnapshotsRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
snapshots
muralidkt/forseti-security
921
python
@property def snapshots(self): if (not self._snapshots): self._snapshots = self._init_repository(_ComputeSnapshotsRepository) return self._snapshots
@property def snapshots(self): if (not self._snapshots): self._snapshots = self._init_repository(_ComputeSnapshotsRepository) return self._snapshots<|docstring|>Returns a _ComputeSnapshotsRepository instance.<|endoftext|>
491f547695da8658fb0ddebeea6cb9bf46a3fbf57fc54878271cdcb38088e004
@property def subnetworks(self): 'Returns a _ComputeSubnetworksRepository instance.' if (not self._subnetworks): self._subnetworks = self._init_repository(_ComputeSubnetworksRepository) return self._subnetworks
Returns a _ComputeSubnetworksRepository instance.
google/cloud/forseti/common/gcp_api/compute.py
subnetworks
muralidkt/forseti-security
921
python
@property def subnetworks(self): if (not self._subnetworks): self._subnetworks = self._init_repository(_ComputeSubnetworksRepository) return self._subnetworks
@property def subnetworks(self): if (not self._subnetworks): self._subnetworks = self._init_repository(_ComputeSubnetworksRepository) return self._subnetworks<|docstring|>Returns a _ComputeSubnetworksRepository instance.<|endoftext|>
36819d90990ea1ca6f7d41c71bef5263c9b33e3eda37bb97f50e3ca263a19424
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeBackendServicesRepository, self).__init__(component='backendServices', **kwargs)
Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()
google/cloud/forseti/common/gcp_api/compute.py
__init__
muralidkt/forseti-security
921
python
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeBackendServicesRepository, self).__init__(component='backendServices', **kwargs)
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeBackendServicesRepository, self).__init__(component='backendServices', **kwargs)<|docstring|>Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()<|endoftext|>
3cb576cd9c6e858ec75696278b6e4492fade254d871f2f1e6f5539feb7603a50
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeDisksRepository, self).__init__(component='disks', **kwargs)
Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()
google/cloud/forseti/common/gcp_api/compute.py
__init__
muralidkt/forseti-security
921
python
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeDisksRepository, self).__init__(component='disks', **kwargs)
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeDisksRepository, self).__init__(component='disks', **kwargs)<|docstring|>Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()<|endoftext|>
2c0d4d9b9242165ba0fe6d4c76804dbc709542769278248a6891c6e369a13cf6
def list(self, resource, zone, **kwargs): 'List disks by zone.\n\n Args:\n resource (str): The project to query resources for.\n zone (str): The zone of the instance group to query.\n **kwargs (dict): Additional args to pass through to the base method.\n\n Returns:\n iterator: An iterator over each page of results from the API.\n ' kwargs['zone'] = zone return repository_mixins.ListQueryMixin.list(self, resource, **kwargs)
List disks by zone. Args: resource (str): The project to query resources for. zone (str): The zone of the instance group to query. **kwargs (dict): Additional args to pass through to the base method. Returns: iterator: An iterator over each page of results from the API.
google/cloud/forseti/common/gcp_api/compute.py
list
muralidkt/forseti-security
921
python
def list(self, resource, zone, **kwargs): 'List disks by zone.\n\n Args:\n resource (str): The project to query resources for.\n zone (str): The zone of the instance group to query.\n **kwargs (dict): Additional args to pass through to the base method.\n\n Returns:\n iterator: An iterator over each page of results from the API.\n ' kwargs['zone'] = zone return repository_mixins.ListQueryMixin.list(self, resource, **kwargs)
def list(self, resource, zone, **kwargs): 'List disks by zone.\n\n Args:\n resource (str): The project to query resources for.\n zone (str): The zone of the instance group to query.\n **kwargs (dict): Additional args to pass through to the base method.\n\n Returns:\n iterator: An iterator over each page of results from the API.\n ' kwargs['zone'] = zone return repository_mixins.ListQueryMixin.list(self, resource, **kwargs)<|docstring|>List disks by zone. Args: resource (str): The project to query resources for. zone (str): The zone of the instance group to query. **kwargs (dict): Additional args to pass through to the base method. Returns: iterator: An iterator over each page of results from the API.<|endoftext|>
cbe39284bec51c92d55c9254d2de772c73f891325296c4dd2bfb0c08d404fa48
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeFirewallsRepository, self).__init__(component='firewalls', entity_field='firewall', resource_path_template='{project}/global/firewalls/{firewall}', **kwargs)
Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()
google/cloud/forseti/common/gcp_api/compute.py
__init__
muralidkt/forseti-security
921
python
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeFirewallsRepository, self).__init__(component='firewalls', entity_field='firewall', resource_path_template='{project}/global/firewalls/{firewall}', **kwargs)
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeFirewallsRepository, self).__init__(component='firewalls', entity_field='firewall', resource_path_template='{project}/global/firewalls/{firewall}', **kwargs)<|docstring|>Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()<|endoftext|>
186b494411bf3b81e538381a2db93a63bc60528a46da8fc11a40b7eccf1e11e4
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeForwardingRulesRepository, self).__init__(component='forwardingRules', **kwargs)
Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()
google/cloud/forseti/common/gcp_api/compute.py
__init__
muralidkt/forseti-security
921
python
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeForwardingRulesRepository, self).__init__(component='forwardingRules', **kwargs)
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeForwardingRulesRepository, self).__init__(component='forwardingRules', **kwargs)<|docstring|>Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()<|endoftext|>
219ad92bb1fadcaf0d5a141e168409526b11da96a43e50718a80cd1bb889f2c5
def list(self, resource, region, **kwargs): 'List instances by zone.\n\n Args:\n resource (str): The project to query resources for.\n region (str): The region of the forwarding rules to query.\n **kwargs (dict): Additional args to pass through to the base method.\n\n Returns:\n iterator: An iterator over each page of results from the API.\n ' kwargs['region'] = region return repository_mixins.ListQueryMixin.list(self, resource, **kwargs)
List instances by zone. Args: resource (str): The project to query resources for. region (str): The region of the forwarding rules to query. **kwargs (dict): Additional args to pass through to the base method. Returns: iterator: An iterator over each page of results from the API.
google/cloud/forseti/common/gcp_api/compute.py
list
muralidkt/forseti-security
921
python
def list(self, resource, region, **kwargs): 'List instances by zone.\n\n Args:\n resource (str): The project to query resources for.\n region (str): The region of the forwarding rules to query.\n **kwargs (dict): Additional args to pass through to the base method.\n\n Returns:\n iterator: An iterator over each page of results from the API.\n ' kwargs['region'] = region return repository_mixins.ListQueryMixin.list(self, resource, **kwargs)
def list(self, resource, region, **kwargs): 'List instances by zone.\n\n Args:\n resource (str): The project to query resources for.\n region (str): The region of the forwarding rules to query.\n **kwargs (dict): Additional args to pass through to the base method.\n\n Returns:\n iterator: An iterator over each page of results from the API.\n ' kwargs['region'] = region return repository_mixins.ListQueryMixin.list(self, resource, **kwargs)<|docstring|>List instances by zone. Args: resource (str): The project to query resources for. region (str): The region of the forwarding rules to query. **kwargs (dict): Additional args to pass through to the base method. Returns: iterator: An iterator over each page of results from the API.<|endoftext|>
24fdfd55a8395ced0ab69d4667f4bc39176eb5f845eb3116b5e3f0fbdcb3af9f
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeGlobalOperationsRepository, self).__init__(component='globalOperations', entity_field='operation', **kwargs)
Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()
google/cloud/forseti/common/gcp_api/compute.py
__init__
muralidkt/forseti-security
921
python
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeGlobalOperationsRepository, self).__init__(component='globalOperations', entity_field='operation', **kwargs)
def __init__(self, **kwargs): 'Constructor.\n\n Args:\n **kwargs (dict): The args to pass into GCPRepository.__init__()\n ' super(_ComputeGlobalOperationsRepository, self).__init__(component='globalOperations', entity_field='operation', **kwargs)<|docstring|>Constructor. Args: **kwargs (dict): The args to pass into GCPRepository.__init__()<|endoftext|>