partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
rename
Rename the given virtual folder. This operation is irreversible! You cannot change the vfolders that are shared by other users, and the new name must be unique among all your accessible vfolders including the shared ones. OLD_NAME: The current name of a virtual folder. NEW_NAME: The new name of a v...
src/ai/backend/client/cli/vfolder.py
def rename(old_name, new_name): '''Rename the given virtual folder. This operation is irreversible! You cannot change the vfolders that are shared by other users, and the new name must be unique among all your accessible vfolders including the shared ones. OLD_NAME: The current name of a virtual fo...
def rename(old_name, new_name): '''Rename the given virtual folder. This operation is irreversible! You cannot change the vfolders that are shared by other users, and the new name must be unique among all your accessible vfolders including the shared ones. OLD_NAME: The current name of a virtual fo...
[ "Rename", "the", "given", "virtual", "folder", ".", "This", "operation", "is", "irreversible!", "You", "cannot", "change", "the", "vfolders", "that", "are", "shared", "by", "other", "users", "and", "the", "new", "name", "must", "be", "unique", "among", "all"...
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/vfolder.py#L94-L109
[ "def", "rename", "(", "old_name", ",", "new_name", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "session", ".", "VFolder", "(", "old_name", ")", ".", "rename", "(", "new_name", ")", "print_done", "(", "'Renamed.'", ")", "exc...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
info
Show the information of the given virtual folder. NAME: Name of a virtual folder.
src/ai/backend/client/cli/vfolder.py
def info(name): '''Show the information of the given virtual folder. NAME: Name of a virtual folder. ''' with Session() as session: try: result = session.VFolder(name).info() print('Virtual folder "{0}" (ID: {1})' .format(result['name'], result['id'])) ...
def info(name): '''Show the information of the given virtual folder. NAME: Name of a virtual folder. ''' with Session() as session: try: result = session.VFolder(name).info() print('Virtual folder "{0}" (ID: {1})' .format(result['name'], result['id'])) ...
[ "Show", "the", "information", "of", "the", "given", "virtual", "folder", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/vfolder.py#L114-L129
[ "def", "info", "(", "name", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "result", "=", "session", ".", "VFolder", "(", "name", ")", ".", "info", "(", ")", "print", "(", "'Virtual folder \"{0}\" (ID: {1})'", ".", "format", "...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
download
Download a file from the virtual folder to the current working directory. The files with the same names will be overwirtten. \b NAME: Name of a virtual folder. FILENAMES: Paths of the files to be uploaded.
src/ai/backend/client/cli/vfolder.py
def download(name, filenames): ''' Download a file from the virtual folder to the current working directory. The files with the same names will be overwirtten. \b NAME: Name of a virtual folder. FILENAMES: Paths of the files to be uploaded. ''' with Session() as session: try: ...
def download(name, filenames): ''' Download a file from the virtual folder to the current working directory. The files with the same names will be overwirtten. \b NAME: Name of a virtual folder. FILENAMES: Paths of the files to be uploaded. ''' with Session() as session: try: ...
[ "Download", "a", "file", "from", "the", "virtual", "folder", "to", "the", "current", "working", "directory", ".", "The", "files", "with", "the", "same", "names", "will", "be", "overwirtten", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/vfolder.py#L156-L171
[ "def", "download", "(", "name", ",", "filenames", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "session", ".", "VFolder", "(", "name", ")", ".", "download", "(", "filenames", ",", "show_progress", "=", "True", ")", "print_do...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
mkdir
Create an empty directory in the virtual folder. \b NAME: Name of a virtual folder. PATH: The name or path of directory. Parent directories are created automatically if they do not exist.
src/ai/backend/client/cli/vfolder.py
def mkdir(name, path): '''Create an empty directory in the virtual folder. \b NAME: Name of a virtual folder. PATH: The name or path of directory. Parent directories are created automatically if they do not exist. ''' with Session() as session: try: session.VFolder...
def mkdir(name, path): '''Create an empty directory in the virtual folder. \b NAME: Name of a virtual folder. PATH: The name or path of directory. Parent directories are created automatically if they do not exist. ''' with Session() as session: try: session.VFolder...
[ "Create", "an", "empty", "directory", "in", "the", "virtual", "folder", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/vfolder.py#L190-L204
[ "def", "mkdir", "(", "name", ",", "path", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "session", ".", "VFolder", "(", "name", ")", ".", "mkdir", "(", "path", ")", "print_done", "(", "'Done.'", ")", "except", "Exception", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
rm
Delete files in a virtual folder. If one of the given paths is a directory and the recursive option is enabled, all its content and the directory itself are recursively deleted. This operation is irreversible! \b NAME: Name of a virtual folder. FILENAMES: Paths of the files to delete.
src/ai/backend/client/cli/vfolder.py
def rm(name, filenames, recursive): ''' Delete files in a virtual folder. If one of the given paths is a directory and the recursive option is enabled, all its content and the directory itself are recursively deleted. This operation is irreversible! \b NAME: Name of a virtual folder. F...
def rm(name, filenames, recursive): ''' Delete files in a virtual folder. If one of the given paths is a directory and the recursive option is enabled, all its content and the directory itself are recursively deleted. This operation is irreversible! \b NAME: Name of a virtual folder. F...
[ "Delete", "files", "in", "a", "virtual", "folder", ".", "If", "one", "of", "the", "given", "paths", "is", "a", "directory", "and", "the", "recursive", "option", "is", "enabled", "all", "its", "content", "and", "the", "directory", "itself", "are", "recursiv...
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/vfolder.py#L212-L233
[ "def", "rm", "(", "name", ",", "filenames", ",", "recursive", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "if", "input", "(", "\"> Are you sure? (y/n): \"", ")", ".", "lower", "(", ")", ".", "strip", "(", ")", "[", ":", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
ls
List files in a path of a virtual folder. \b NAME: Name of a virtual folder. PATH: Path inside vfolder.
src/ai/backend/client/cli/vfolder.py
def ls(name, path): """ List files in a path of a virtual folder. \b NAME: Name of a virtual folder. PATH: Path inside vfolder. """ with Session() as session: try: print_wait('Retrieving list of files in "{}"...'.format(path)) result = session.VFolder(name).l...
def ls(name, path): """ List files in a path of a virtual folder. \b NAME: Name of a virtual folder. PATH: Path inside vfolder. """ with Session() as session: try: print_wait('Retrieving list of files in "{}"...'.format(path)) result = session.VFolder(name).l...
[ "List", "files", "in", "a", "path", "of", "a", "virtual", "folder", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/vfolder.py#L239-L265
[ "def", "ls", "(", "name", ",", "path", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "print_wait", "(", "'Retrieving list of files in \"{}\"...'", ".", "format", "(", "path", ")", ")", "result", "=", "session", ".", "VFolder", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
invite
Invite other users to access the virtual folder. \b NAME: Name of a virtual folder. EMAIL: Emails to invite.
src/ai/backend/client/cli/vfolder.py
def invite(name, emails, perm): """Invite other users to access the virtual folder. \b NAME: Name of a virtual folder. EMAIL: Emails to invite. """ with Session() as session: try: assert perm in ['rw', 'ro'], \ 'Invalid permission: {}'.format(perm) ...
def invite(name, emails, perm): """Invite other users to access the virtual folder. \b NAME: Name of a virtual folder. EMAIL: Emails to invite. """ with Session() as session: try: assert perm in ['rw', 'ro'], \ 'Invalid permission: {}'.format(perm) ...
[ "Invite", "other", "users", "to", "access", "the", "virtual", "folder", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/vfolder.py#L273-L294
[ "def", "invite", "(", "name", ",", "emails", ",", "perm", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "assert", "perm", "in", "[", "'rw'", ",", "'ro'", "]", ",", "'Invalid permission: {}'", ".", "format", "(", "perm", ")"...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
invitations
List and manage received invitations.
src/ai/backend/client/cli/vfolder.py
def invitations(): """List and manage received invitations. """ with Session() as session: try: result = session.VFolder.invitations() invitations = result.get('invitations', []) if len(invitations) < 1: print('No invitations.') ret...
def invitations(): """List and manage received invitations. """ with Session() as session: try: result = session.VFolder.invitations() invitations = result.get('invitations', []) if len(invitations) < 1: print('No invitations.') ret...
[ "List", "and", "manage", "received", "invitations", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/vfolder.py#L298-L344
[ "def", "invitations", "(", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "result", "=", "session", ".", "VFolder", ".", "invitations", "(", ")", "invitations", "=", "result", ".", "get", "(", "'invitations'", ",", "[", "]", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
Dockerflow.init_check
Adds a given check callback with the provided object to the list of checks. Useful for built-ins but also advanced custom checks.
src/dockerflow/flask/app.py
def init_check(self, check, obj): """ Adds a given check callback with the provided object to the list of checks. Useful for built-ins but also advanced custom checks. """ self.logger.info('Adding extension check %s' % check.__name__) check = functools.wraps(check)(functo...
def init_check(self, check, obj): """ Adds a given check callback with the provided object to the list of checks. Useful for built-ins but also advanced custom checks. """ self.logger.info('Adding extension check %s' % check.__name__) check = functools.wraps(check)(functo...
[ "Adds", "a", "given", "check", "callback", "with", "the", "provided", "object", "to", "the", "list", "of", "checks", ".", "Useful", "for", "built", "-", "ins", "but", "also", "advanced", "custom", "checks", "." ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L135-L142
[ "def", "init_check", "(", "self", ",", "check", ",", "obj", ")", ":", "self", ".", "logger", ".", "info", "(", "'Adding extension check %s'", "%", "check", ".", "__name__", ")", "check", "=", "functools", ".", "wraps", "(", "check", ")", "(", "functools"...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow.init_app
Initializes the extension with the given app, registers the built-in views with an own blueprint and hooks up our signal callbacks.
src/dockerflow/flask/app.py
def init_app(self, app): """ Initializes the extension with the given app, registers the built-in views with an own blueprint and hooks up our signal callbacks. """ # If no version path was provided in the init of the Dockerflow # class we'll use the parent direct...
def init_app(self, app): """ Initializes the extension with the given app, registers the built-in views with an own blueprint and hooks up our signal callbacks. """ # If no version path was provided in the init of the Dockerflow # class we'll use the parent direct...
[ "Initializes", "the", "extension", "with", "the", "given", "app", "registers", "the", "built", "-", "in", "views", "with", "an", "own", "blueprint", "and", "hooks", "up", "our", "signal", "callbacks", "." ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L144-L169
[ "def", "init_app", "(", "self", ",", "app", ")", ":", "# If no version path was provided in the init of the Dockerflow", "# class we'll use the parent directory of the app root path.", "if", "self", ".", "version_path", "is", "None", ":", "self", ".", "version_path", "=", "...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow._before_request
The before_request callback.
src/dockerflow/flask/app.py
def _before_request(self): """ The before_request callback. """ g._request_id = str(uuid.uuid4()) g._start_timestamp = time.time()
def _before_request(self): """ The before_request callback. """ g._request_id = str(uuid.uuid4()) g._start_timestamp = time.time()
[ "The", "before_request", "callback", "." ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L178-L183
[ "def", "_before_request", "(", "self", ")", ":", "g", ".", "_request_id", "=", "str", "(", "uuid", ".", "uuid4", "(", ")", ")", "g", ".", "_start_timestamp", "=", "time", ".", "time", "(", ")" ]
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow._after_request
The signal handler for the request_finished signal.
src/dockerflow/flask/app.py
def _after_request(self, response): """ The signal handler for the request_finished signal. """ if not getattr(g, '_has_exception', False): extra = self.summary_extra() self.summary_logger.info('', extra=extra) return response
def _after_request(self, response): """ The signal handler for the request_finished signal. """ if not getattr(g, '_has_exception', False): extra = self.summary_extra() self.summary_logger.info('', extra=extra) return response
[ "The", "signal", "handler", "for", "the", "request_finished", "signal", "." ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L185-L192
[ "def", "_after_request", "(", "self", ",", "response", ")", ":", "if", "not", "getattr", "(", "g", ",", "'_has_exception'", ",", "False", ")", ":", "extra", "=", "self", ".", "summary_extra", "(", ")", "self", ".", "summary_logger", ".", "info", "(", "...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow._got_request_exception
The signal handler for the got_request_exception signal.
src/dockerflow/flask/app.py
def _got_request_exception(self, sender, exception, **extra): """ The signal handler for the got_request_exception signal. """ extra = self.summary_extra() extra['errno'] = 500 self.summary_logger.error(str(exception), extra=extra) g._has_exception = True
def _got_request_exception(self, sender, exception, **extra): """ The signal handler for the got_request_exception signal. """ extra = self.summary_extra() extra['errno'] = 500 self.summary_logger.error(str(exception), extra=extra) g._has_exception = True
[ "The", "signal", "handler", "for", "the", "got_request_exception", "signal", "." ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L194-L201
[ "def", "_got_request_exception", "(", "self", ",", "sender", ",", "exception", ",", "*", "*", "extra", ")", ":", "extra", "=", "self", ".", "summary_extra", "(", ")", "extra", "[", "'errno'", "]", "=", "500", "self", ".", "summary_logger", ".", "error", ...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow.user_id
Return the ID of the current request's user
src/dockerflow/flask/app.py
def user_id(self): """ Return the ID of the current request's user """ # This needs flask-login to be installed if not has_flask_login: return # and the actual login manager installed if not hasattr(current_app, 'login_manager'): return ...
def user_id(self): """ Return the ID of the current request's user """ # This needs flask-login to be installed if not has_flask_login: return # and the actual login manager installed if not hasattr(current_app, 'login_manager'): return ...
[ "Return", "the", "ID", "of", "the", "current", "request", "s", "user" ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L203-L230
[ "def", "user_id", "(", "self", ")", ":", "# This needs flask-login to be installed", "if", "not", "has_flask_login", ":", "return", "# and the actual login manager installed", "if", "not", "hasattr", "(", "current_app", ",", "'login_manager'", ")", ":", "return", "# fai...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow.summary_extra
Build the extra data for the summary logger.
src/dockerflow/flask/app.py
def summary_extra(self): """ Build the extra data for the summary logger. """ out = { 'errno': 0, 'agent': request.headers.get('User-Agent', ''), 'lang': request.headers.get('Accept-Language', ''), 'method': request.method, 'pat...
def summary_extra(self): """ Build the extra data for the summary logger. """ out = { 'errno': 0, 'agent': request.headers.get('User-Agent', ''), 'lang': request.headers.get('Accept-Language', ''), 'method': request.method, 'pat...
[ "Build", "the", "extra", "data", "for", "the", "summary", "logger", "." ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L232-L261
[ "def", "summary_extra", "(", "self", ")", ":", "out", "=", "{", "'errno'", ":", "0", ",", "'agent'", ":", "request", ".", "headers", ".", "get", "(", "'User-Agent'", ",", "''", ")", ",", "'lang'", ":", "request", ".", "headers", ".", "get", "(", "'...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow._version_view
View that returns the contents of version.json or a 404.
src/dockerflow/flask/app.py
def _version_view(self): """ View that returns the contents of version.json or a 404. """ version_json = self._version_callback(self.version_path) if version_json is None: return 'version.json not found', 404 else: return jsonify(version_json)
def _version_view(self): """ View that returns the contents of version.json or a 404. """ version_json = self._version_callback(self.version_path) if version_json is None: return 'version.json not found', 404 else: return jsonify(version_json)
[ "View", "that", "returns", "the", "contents", "of", "version", ".", "json", "or", "a", "404", "." ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L263-L271
[ "def", "_version_view", "(", "self", ")", ":", "version_json", "=", "self", ".", "_version_callback", "(", "self", ".", "version_path", ")", "if", "version_json", "is", "None", ":", "return", "'version.json not found'", ",", "404", "else", ":", "return", "json...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow._heartbeat_view
Runs all the registered checks and returns a JSON response with either a status code of 200 or 500 depending on the results of the checks. Any check that returns a warning or worse (error, critical) will return a 500 response.
src/dockerflow/flask/app.py
def _heartbeat_view(self): """ Runs all the registered checks and returns a JSON response with either a status code of 200 or 500 depending on the results of the checks. Any check that returns a warning or worse (error, critical) will return a 500 response. """ d...
def _heartbeat_view(self): """ Runs all the registered checks and returns a JSON response with either a status code of 200 or 500 depending on the results of the checks. Any check that returns a warning or worse (error, critical) will return a 500 response. """ d...
[ "Runs", "all", "the", "registered", "checks", "and", "returns", "a", "JSON", "response", "with", "either", "a", "status", "code", "of", "200", "or", "500", "depending", "on", "the", "results", "of", "the", "checks", "." ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L291-L326
[ "def", "_heartbeat_view", "(", "self", ")", ":", "details", "=", "{", "}", "statuses", "=", "{", "}", "level", "=", "0", "for", "name", ",", "check", "in", "self", ".", "checks", ".", "items", "(", ")", ":", "detail", "=", "self", ".", "_heartbeat_...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
Dockerflow.check
A decorator to register a new Dockerflow check to be run when the /__heartbeat__ endpoint is called., e.g.:: from dockerflow.flask import checks @dockerflow.check def storage_reachable(): try: acme.storage.ping() except Sl...
src/dockerflow/flask/app.py
def check(self, func=None, name=None): """ A decorator to register a new Dockerflow check to be run when the /__heartbeat__ endpoint is called., e.g.:: from dockerflow.flask import checks @dockerflow.check def storage_reachable(): try: ...
def check(self, func=None, name=None): """ A decorator to register a new Dockerflow check to be run when the /__heartbeat__ endpoint is called., e.g.:: from dockerflow.flask import checks @dockerflow.check def storage_reachable(): try: ...
[ "A", "decorator", "to", "register", "a", "new", "Dockerflow", "check", "to", "be", "run", "when", "the", "/", "__heartbeat__", "endpoint", "is", "called", ".", "e", ".", "g", ".", "::" ]
mozilla-services/python-dockerflow
python
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/app.py#L354-L391
[ "def", "check", "(", "self", ",", "func", "=", "None", ",", "name", "=", "None", ")", ":", "if", "func", "is", "None", ":", "return", "functools", ".", "partial", "(", "self", ".", "check", ",", "name", "=", "name", ")", "if", "name", "is", "None...
43703c5e8934ba6901b0a1520d6da4ed6457208c
train
drange
A simplified version of numpy.linspace with default options
src/ai/backend/client/cli/run.py
def drange(start: Decimal, stop: Decimal, num: int): ''' A simplified version of numpy.linspace with default options ''' delta = stop - start step = delta / (num - 1) yield from (start + step * Decimal(tick) for tick in range(0, num))
def drange(start: Decimal, stop: Decimal, num: int): ''' A simplified version of numpy.linspace with default options ''' delta = stop - start step = delta / (num - 1) yield from (start + step * Decimal(tick) for tick in range(0, num))
[ "A", "simplified", "version", "of", "numpy", ".", "linspace", "with", "default", "options" ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/run.py#L32-L38
[ "def", "drange", "(", "start", ":", "Decimal", ",", "stop", ":", "Decimal", ",", "num", ":", "int", ")", ":", "delta", "=", "stop", "-", "start", "step", "=", "delta", "/", "(", "num", "-", "1", ")", "yield", "from", "(", "start", "+", "step", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
range_expr
Accepts a range expression which generates a range of values for a variable. Linear space range: "linspace:1,2,10" (start, stop, num) as in numpy.linspace Pythonic range: "range:1,10,2" (start, stop[, step]) as in Python's range Case range: "case:a,b,c" (comma-separated strings)
src/ai/backend/client/cli/run.py
def range_expr(arg): ''' Accepts a range expression which generates a range of values for a variable. Linear space range: "linspace:1,2,10" (start, stop, num) as in numpy.linspace Pythonic range: "range:1,10,2" (start, stop[, step]) as in Python's range Case range: "case:a,b,c" (comma-separated str...
def range_expr(arg): ''' Accepts a range expression which generates a range of values for a variable. Linear space range: "linspace:1,2,10" (start, stop, num) as in numpy.linspace Pythonic range: "range:1,10,2" (start, stop[, step]) as in Python's range Case range: "case:a,b,c" (comma-separated str...
[ "Accepts", "a", "range", "expression", "which", "generates", "a", "range", "of", "values", "for", "a", "variable", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/run.py#L41-L63
[ "def", "range_expr", "(", "arg", ")", ":", "key", ",", "value", "=", "arg", ".", "split", "(", "'='", ",", "maxsplit", "=", "1", ")", "assert", "_rx_range_key", ".", "match", "(", "key", ")", ",", "'The key must be a valid slug string.'", "try", ":", "if...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
exec_loop
Fully streamed asynchronous version of the execute loop.
src/ai/backend/client/cli/run.py
async def exec_loop(stdout, stderr, kernel, mode, code, *, opts=None, vprint_done=print_done, is_multi=False): ''' Fully streamed asynchronous version of the execute loop. ''' async with kernel.stream_execute(code, mode=mode, opts=opts) as stream: async for result in stream: ...
async def exec_loop(stdout, stderr, kernel, mode, code, *, opts=None, vprint_done=print_done, is_multi=False): ''' Fully streamed asynchronous version of the execute loop. ''' async with kernel.stream_execute(code, mode=mode, opts=opts) as stream: async for result in stream: ...
[ "Fully", "streamed", "asynchronous", "version", "of", "the", "execute", "loop", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/run.py#L66-L121
[ "async", "def", "exec_loop", "(", "stdout", ",", "stderr", ",", "kernel", ",", "mode", ",", "code", ",", "*", ",", "opts", "=", "None", ",", "vprint_done", "=", "print_done", ",", "is_multi", "=", "False", ")", ":", "async", "with", "kernel", ".", "s...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
exec_loop_sync
Old synchronous polling version of the execute loop.
src/ai/backend/client/cli/run.py
def exec_loop_sync(stdout, stderr, kernel, mode, code, *, opts=None, vprint_done=print_done): ''' Old synchronous polling version of the execute loop. ''' opts = opts if opts else {} run_id = None # use server-assigned run ID while True: result = kernel.execute(run_id...
def exec_loop_sync(stdout, stderr, kernel, mode, code, *, opts=None, vprint_done=print_done): ''' Old synchronous polling version of the execute loop. ''' opts = opts if opts else {} run_id = None # use server-assigned run ID while True: result = kernel.execute(run_id...
[ "Old", "synchronous", "polling", "version", "of", "the", "execute", "loop", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/run.py#L124-L177
[ "def", "exec_loop_sync", "(", "stdout", ",", "stderr", ",", "kernel", ",", "mode", ",", "code", ",", "*", ",", "opts", "=", "None", ",", "vprint_done", "=", "print_done", ")", ":", "opts", "=", "opts", "if", "opts", "else", "{", "}", "run_id", "=", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
run
Run the given code snippet or files in a session. Depending on the session ID you give (default is random), it may reuse an existing session or create a new one. \b LANG: The name (and version/platform tags appended after a colon) of session runtime or programming language.') FILES: The c...
src/ai/backend/client/cli/run.py
def run(lang, files, session_id, cluster_size, code, clean, build, exec, terminal, basedir, rm, env, env_range, build_range, exec_range, max_parallel, mount, stats, tag, resources, quiet): ''' Run the given code snippet or files in a session. Depending on the session ID you give (default is ...
def run(lang, files, session_id, cluster_size, code, clean, build, exec, terminal, basedir, rm, env, env_range, build_range, exec_range, max_parallel, mount, stats, tag, resources, quiet): ''' Run the given code snippet or files in a session. Depending on the session ID you give (default is ...
[ "Run", "the", "given", "code", "snippet", "or", "files", "in", "a", "session", ".", "Depending", "on", "the", "session", "ID", "you", "give", "(", "default", "is", "random", ")", "it", "may", "reuse", "an", "existing", "session", "or", "create", "a", "...
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/run.py#L273-L584
[ "def", "run", "(", "lang", ",", "files", ",", "session_id", ",", "cluster_size", ",", "code", ",", "clean", ",", "build", ",", "exec", ",", "terminal", ",", "basedir", ",", "rm", ",", "env", ",", "env_range", ",", "build_range", ",", "exec_range", ",",...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
start
Prepare and start a single compute session without executing codes. You may use the created session to execute codes using the "run" command or connect to an application service provided by the session using the "app" command. \b LANG: The name (and version/platform tags appended after a colon) of...
src/ai/backend/client/cli/run.py
def start(lang, session_id, owner, env, mount, tag, resources, cluster_size): ''' Prepare and start a single compute session without executing codes. You may use the created session to execute codes using the "run" command or connect to an application service provided by the session using the "app" ...
def start(lang, session_id, owner, env, mount, tag, resources, cluster_size): ''' Prepare and start a single compute session without executing codes. You may use the created session to execute codes using the "run" command or connect to an application service provided by the session using the "app" ...
[ "Prepare", "and", "start", "a", "single", "compute", "session", "without", "executing", "codes", ".", "You", "may", "use", "the", "created", "session", "to", "execute", "codes", "using", "the", "run", "command", "or", "connect", "to", "an", "application", "s...
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/run.py#L607-L652
[ "def", "start", "(", "lang", ",", "session_id", ",", "owner", ",", "env", ",", "mount", ",", "tag", ",", "resources", ",", "cluster_size", ")", ":", "if", "session_id", "is", "None", ":", "session_id", "=", "token_hex", "(", "5", ")", "else", ":", "s...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
terminate
Terminate the given session. SESSID: session ID or its alias given when creating the session.
src/ai/backend/client/cli/run.py
def terminate(sess_id_or_alias, owner, stats): ''' Terminate the given session. SESSID: session ID or its alias given when creating the session. ''' print_wait('Terminating the session(s)...') with Session() as session: has_failure = False for sess in sess_id_or_alias: ...
def terminate(sess_id_or_alias, owner, stats): ''' Terminate the given session. SESSID: session ID or its alias given when creating the session. ''' print_wait('Terminating the session(s)...') with Session() as session: has_failure = False for sess in sess_id_or_alias: ...
[ "Terminate", "the", "given", "session", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/run.py#L661-L693
[ "def", "terminate", "(", "sess_id_or_alias", ",", "owner", ",", "stats", ")", ":", "print_wait", "(", "'Terminating the session(s)...'", ")", "with", "Session", "(", ")", "as", "session", ":", "has_failure", "=", "False", "for", "sess", "in", "sess_id_or_alias",...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
get_custom_view_details
function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
build/lib/pyhpeimc/plat/groups.py
def get_custom_view_details(name, auth, url): """ function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth obj...
def get_custom_view_details(name, auth, url): """ function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth obj...
[ "function", "requires", "no", "input", "and", "returns", "a", "list", "of", "dictionaries", "of", "custom", "views", "from", "an", "HPE", "IMC", ".", "Optional", "name", "argument", "will", "return", "only", "the", "specified", "view", ".", ":", "param", "...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/groups.py#L72-L114
[ "def", "get_custom_view_details", "(", "name", ",", "auth", ",", "url", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", "=", "name", ")", "[", "0", "]", "[", "'symbolId'", "]", "get_custom_view_details_url", "=", "'/imcr...
4fba31827573587e03a6233c7db60f188038c8e5
train
add_devs_custom_views
function takes a list of devIDs from devices discovered in the HPE IMC platform and and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param dev_list: list containing the devID of all devices to be contained in this custom view. :param auth: requests auth objec...
build/lib/pyhpeimc/plat/groups.py
def add_devs_custom_views(custom_view_name, dev_list, auth, url): """ function takes a list of devIDs from devices discovered in the HPE IMC platform and and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param dev_list: list containing the devID of all devi...
def add_devs_custom_views(custom_view_name, dev_list, auth, url): """ function takes a list of devIDs from devices discovered in the HPE IMC platform and and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param dev_list: list containing the devID of all devi...
[ "function", "takes", "a", "list", "of", "devIDs", "from", "devices", "discovered", "in", "the", "HPE", "IMC", "platform", "and", "and", "issues", "a", "RESTFUL", "call", "to", "add", "the", "list", "of", "devices", "to", "a", "specific", "custom", "views",...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/groups.py#L181-L213
[ "def", "add_devs_custom_views", "(", "custom_view_name", ",", "dev_list", ",", "auth", ",", "url", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", "=", "custom_view_name", ")", "[", "0", "]", "[", "'symbolId'", "]", "add...
4fba31827573587e03a6233c7db60f188038c8e5
train
delete_custom_view
function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS i...
build/lib/pyhpeimc/plat/groups.py
def delete_custom_view(auth, url, name): """ function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth pyhp...
def delete_custom_view(auth, url, name): """ function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth pyhp...
[ "function", "takes", "input", "of", "auth", "url", "and", "name", "and", "issues", "a", "RESTFUL", "call", "to", "delete", "a", "specific", "of", "custom", "views", "from", "HPE", "IMC", ".", ":", "param", "name", ":", "string", "containg", "the", "name"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/groups.py#L217-L260
[ "def", "delete_custom_view", "(", "auth", ",", "url", ",", "name", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", ")", "[", "0", "]", "[", "'symbolId'", "]", "delete_custom_view_url", "=", "'/imcrs/plat/res/view/custom/'", ...
4fba31827573587e03a6233c7db60f188038c8e5
train
multisplit
Like unicode.split, but accept several separators and regexes Args: string: the string to split. separators: strings you can split on. Each string can be a regex. maxsplit: max number of time you wish to split. default is 0, whic...
src/ww/tools/strings.py
def multisplit(string, # type: unicode *separators, # type: unicode **kwargs # type: Union[unicode, C[..., I[unicode]]] ): # type: (...) -> I """ Like unicode.split, but accept several separators and regexes Args: string: the string to split. ...
def multisplit(string, # type: unicode *separators, # type: unicode **kwargs # type: Union[unicode, C[..., I[unicode]]] ): # type: (...) -> I """ Like unicode.split, but accept several separators and regexes Args: string: the string to split. ...
[ "Like", "unicode", ".", "split", "but", "accept", "several", "separators", "and", "regexes" ]
Tygs/ww
python
https://github.com/Tygs/ww/blob/6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4/src/ww/tools/strings.py#L77-L163
[ "def", "multisplit", "(", "string", ",", "# type: unicode", "*", "separators", ",", "# type: unicode", "*", "*", "kwargs", "# type: Union[unicode, C[..., I[unicode]]]", ")", ":", "# type: (...) -> I", "cast", "=", "kwargs", ".", "pop", "(", "'cast'", ",", "list", ...
6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4
train
multireplace
Like unicode.replace() but accept several substitutions and regexes Args: string: the string to split on. patterns: a string, or an iterable of strings to be replaced. substitutions: a string or an iterable of string to use as a replacement. You ca...
src/ww/tools/strings.py
def multireplace(string, # type: unicode patterns, # type: str_or_str_iterable substitutions, # type: str_istr_icallable maxreplace=0, # type: int flags=0 # type: unicode ): # type: (...) -> bool """ Like unicode.replace() bu...
def multireplace(string, # type: unicode patterns, # type: str_or_str_iterable substitutions, # type: str_istr_icallable maxreplace=0, # type: int flags=0 # type: unicode ): # type: (...) -> bool """ Like unicode.replace() bu...
[ "Like", "unicode", ".", "replace", "()", "but", "accept", "several", "substitutions", "and", "regexes" ]
Tygs/ww
python
https://github.com/Tygs/ww/blob/6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4/src/ww/tools/strings.py#L214-L300
[ "def", "multireplace", "(", "string", ",", "# type: unicode", "patterns", ",", "# type: str_or_str_iterable", "substitutions", ",", "# type: str_istr_icallable", "maxreplace", "=", "0", ",", "# type: int", "flags", "=", "0", "# type: unicode", ")", ":", "# type: (...) -...
6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4
train
status
Show the manager's current status.
src/ai/backend/client/cli/manager.py
def status(): '''Show the manager's current status.''' with Session() as session: resp = session.Manager.status() print(tabulate([('Status', 'Active Sessions'), (resp['status'], resp['active_sessions'])], headers='firstrow'))
def status(): '''Show the manager's current status.''' with Session() as session: resp = session.Manager.status() print(tabulate([('Status', 'Active Sessions'), (resp['status'], resp['active_sessions'])], headers='firstrow'))
[ "Show", "the", "manager", "s", "current", "status", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/manager.py#L19-L25
[ "def", "status", "(", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "resp", "=", "session", ".", "Manager", ".", "status", "(", ")", "print", "(", "tabulate", "(", "[", "(", "'Status'", ",", "'Active Sessions'", ")", ",", "(", "resp", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
freeze
Freeze manager.
src/ai/backend/client/cli/manager.py
def freeze(wait, force_kill): '''Freeze manager.''' if wait and force_kill: print('You cannot use both --wait and --force-kill options ' 'at the same time.', file=sys.stderr) return with Session() as session: if wait: while True: resp = sess...
def freeze(wait, force_kill): '''Freeze manager.''' if wait and force_kill: print('You cannot use both --wait and --force-kill options ' 'at the same time.', file=sys.stderr) return with Session() as session: if wait: while True: resp = sess...
[ "Freeze", "manager", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/manager.py#L34-L61
[ "def", "freeze", "(", "wait", ",", "force_kill", ")", ":", "if", "wait", "and", "force_kill", ":", "print", "(", "'You cannot use both --wait and --force-kill options '", "'at the same time.'", ",", "file", "=", "sys", ".", "stderr", ")", "return", "with", "Sessio...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
get_dev_vlans
Function takes input of devID to issue RESTUL call to HP IMC :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param devid: str requires devId as the only input parameter :param...
pyhpeimc/plat/vlanm.py
def get_dev_vlans(auth, url, devid=None, devip=None): """Function takes input of devID to issue RESTUL call to HP IMC :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param devi...
def get_dev_vlans(auth, url, devid=None, devip=None): """Function takes input of devID to issue RESTUL call to HP IMC :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param devi...
[ "Function", "takes", "input", "of", "devID", "to", "issue", "RESTUL", "call", "to", "HP", "IMC" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L23-L64
[ "def", "get_dev_vlans", "(", "auth", ",", "url", ",", "devid", "=", "None", ",", "devip", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_dev_details", "(", "devip", ",", "auth", ",", "url", ")", "[", "'id'", "]",...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_trunk_interfaces
Function takes devId as input to RESTFULL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param devid: str requires devid of the target device :param d...
pyhpeimc/plat/vlanm.py
def get_trunk_interfaces(auth, url, devid=None, devip=None): """Function takes devId as input to RESTFULL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass ...
def get_trunk_interfaces(auth, url, devid=None, devip=None): """Function takes devId as input to RESTFULL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass ...
[ "Function", "takes", "devId", "as", "input", "to", "RESTFULL", "call", "to", "HP", "IMC", "platform" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L67-L123
[ "def", "get_trunk_interfaces", "(", "auth", ",", "url", ",", "devid", "=", "None", ",", "devip", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_dev_details", "(", "devip", ",", "auth", ",", "url", ")", "[", "'id'",...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_device_access_interfaces
Function takes devid pr devip as input to RESTFUL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param devid: str requires devid of the target device ...
pyhpeimc/plat/vlanm.py
def get_device_access_interfaces(auth, url, devid=None, devip=None): """ Function takes devid pr devip as input to RESTFUL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeim...
def get_device_access_interfaces(auth, url, devid=None, devip=None): """ Function takes devid pr devip as input to RESTFUL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeim...
[ "Function", "takes", "devid", "pr", "devip", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC", "platform" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L126-L178
[ "def", "get_device_access_interfaces", "(", "auth", ",", "url", ",", "devid", "=", "None", ",", "devip", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_dev_details", "(", "devip", ",", "auth", ",", "url", ")", "[", ...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_device_hybrid_interfaces
Function takes devId as input to RESTFUL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param devid: str requires devid of the target device :param de...
pyhpeimc/plat/vlanm.py
def get_device_hybrid_interfaces(auth, url, devid=None, devip=None): """ Function takes devId as input to RESTFUL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.au...
def get_device_hybrid_interfaces(auth, url, devid=None, devip=None): """ Function takes devId as input to RESTFUL call to HP IMC platform :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.au...
[ "Function", "takes", "devId", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC", "platform" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L184-L237
[ "def", "get_device_hybrid_interfaces", "(", "auth", ",", "url", ",", "devid", "=", "None", ",", "devip", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_dev_details", "(", "devip", ",", "auth", ",", "url", ")", "[", ...
4fba31827573587e03a6233c7db60f188038c8e5
train
add_hybrid_interface
Function takes ifindex, pvid, tagged vlans untagged vlans as input values to add a hybrid port to a HPE Comware based switch. These functions only apply to HPE Comware based devices. :param ifindex: str ifIndex value of target interface :param pvid: str 802.1q value (1-4094) of target VLAN :param tagged...
pyhpeimc/plat/vlanm.py
def add_hybrid_interface(ifindex, pvid, taggedvlans, untaggedvlans, auth, url, devip=None, devid=None): """ Function takes ifindex, pvid, tagged vlans untagged vlans as input values to add a hybrid port to a HPE Comware based switch. These functions only apply to HPE Comware based d...
def add_hybrid_interface(ifindex, pvid, taggedvlans, untaggedvlans, auth, url, devip=None, devid=None): """ Function takes ifindex, pvid, tagged vlans untagged vlans as input values to add a hybrid port to a HPE Comware based switch. These functions only apply to HPE Comware based d...
[ "Function", "takes", "ifindex", "pvid", "tagged", "vlans", "untagged", "vlans", "as", "input", "values", "to", "add", "a", "hybrid", "port", "to", "a", "HPE", "Comware", "based", "switch", ".", "These", "functions", "only", "apply", "to", "HPE", "Comware", ...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L240-L274
[ "def", "add_hybrid_interface", "(", "ifindex", ",", "pvid", ",", "taggedvlans", ",", "untaggedvlans", ",", "auth", ",", "url", ",", "devip", "=", "None", ",", "devid", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_d...
4fba31827573587e03a6233c7db60f188038c8e5
train
delete_hybrid_interface
Function takes devip ( ipv4 address ), ifIndex and pvid (vlanid) of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param ifindex: str value of ifIndex for a specific interface on the device :param auth: requests auth object #usually aut...
pyhpeimc/plat/vlanm.py
def delete_hybrid_interface(ifindex, auth, url, devip=None, devid=None): """ Function takes devip ( ipv4 address ), ifIndex and pvid (vlanid) of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param ifindex: str value of ifIndex for ...
def delete_hybrid_interface(ifindex, auth, url, devip=None, devid=None): """ Function takes devip ( ipv4 address ), ifIndex and pvid (vlanid) of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param ifindex: str value of ifIndex for ...
[ "Function", "takes", "devip", "(", "ipv4", "address", ")", "ifIndex", "and", "pvid", "(", "vlanid", ")", "of", "specific", "device", "and", "802", ".", "1q", "VLAN", "tag", "and", "issues", "a", "RESTFUL", "call", "to", "remove", "the", "specified", "VLA...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L313-L360
[ "def", "delete_hybrid_interface", "(", "ifindex", ",", "auth", ",", "url", ",", "devip", "=", "None", ",", "devid", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_dev_details", "(", "devip", ",", "auth", ",", "url", ...
4fba31827573587e03a6233c7db60f188038c8e5
train
set_access_interface_pvid
Function takes devip ( ipv4 address ), ifIndex and pvid (vlanid) of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param ifindex: str value of ifIndex for a specific interface on the device :param pvid: str value of dot1q VLAN desired t...
pyhpeimc/plat/vlanm.py
def set_access_interface_pvid(ifindex, pvid, auth, url, devip=None, devid=None): """ Function takes devip ( ipv4 address ), ifIndex and pvid (vlanid) of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param ifindex: str value of ifInde...
def set_access_interface_pvid(ifindex, pvid, auth, url, devip=None, devid=None): """ Function takes devip ( ipv4 address ), ifIndex and pvid (vlanid) of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param ifindex: str value of ifInde...
[ "Function", "takes", "devip", "(", "ipv4", "address", ")", "ifIndex", "and", "pvid", "(", "vlanid", ")", "of", "specific", "device", "and", "802", ".", "1q", "VLAN", "tag", "and", "issues", "a", "RESTFUL", "call", "to", "remove", "the", "specified", "VLA...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L365-L418
[ "def", "set_access_interface_pvid", "(", "ifindex", ",", "pvid", ",", "auth", ",", "url", ",", "devip", "=", "None", ",", "devid", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_dev_details", "(", "devip", ",", "auth...
4fba31827573587e03a6233c7db60f188038c8e5
train
create_dev_vlan
function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the specified VLAN from the target device. VLAN Name MUST be valid on target device. :param vlanid:int or str value of target 802.1q VLAN :param vlan_name: str value of the target 802.1q V...
pyhpeimc/plat/vlanm.py
def create_dev_vlan(vlanid, vlan_name, auth, url, devid=None, devip=None): """ function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the specified VLAN from the target device. VLAN Name MUST be valid on target device. :param vlanid:int or ...
def create_dev_vlan(vlanid, vlan_name, auth, url, devid=None, devip=None): """ function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the specified VLAN from the target device. VLAN Name MUST be valid on target device. :param vlanid:int or ...
[ "function", "takes", "devid", "and", "vlanid", "vlan_name", "of", "specific", "device", "and", "802", ".", "1q", "VLAN", "tag", "and", "issues", "a", "RESTFUL", "call", "to", "add", "the", "specified", "VLAN", "from", "the", "target", "device", ".", "VLAN"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L455-L502
[ "def", "create_dev_vlan", "(", "vlanid", ",", "vlan_name", ",", "auth", ",", "url", ",", "devid", "=", "None", ",", "devip", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_dev_details", "(", "devip", ",", "auth", "...
4fba31827573587e03a6233c7db60f188038c8e5
train
delete_dev_vlans
function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param vlanid:int or str value of target 802.1q VLAN :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: bas...
pyhpeimc/plat/vlanm.py
def delete_dev_vlans(vlanid, auth, url, devid=None, devip=None): """ function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param vlanid:int or str value of target 802.1q VLAN :param auth: requests auth ...
def delete_dev_vlans(vlanid, auth, url, devid=None, devip=None): """ function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param vlanid:int or str value of target 802.1q VLAN :param auth: requests auth ...
[ "function", "takes", "devid", "and", "vlanid", "of", "specific", "device", "and", "802", ".", "1q", "VLAN", "tag", "and", "issues", "a", "RESTFUL", "call", "to", "remove", "the", "specified", "VLAN", "from", "the", "target", "device", ".", ":", "param", ...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vlanm.py#L505-L545
[ "def", "delete_dev_vlans", "(", "vlanid", ",", "auth", ",", "url", ",", "devid", "=", "None", ",", "devip", "=", "None", ")", ":", "if", "devip", "is", "not", "None", ":", "devid", "=", "get_dev_details", "(", "devip", ",", "auth", ",", "url", ")", ...
4fba31827573587e03a6233c7db60f188038c8e5
train
_get_results_from_api
Use the HouseCanary API Python Client to access the API
housecanary/hc_api_export/hc_api_export.py
def _get_results_from_api(identifiers, endpoints, api_key, api_secret): """Use the HouseCanary API Python Client to access the API""" if api_key is not None and api_secret is not None: client = housecanary.ApiClient(api_key, api_secret) else: client = housecanary.ApiClient() wrapper = ...
def _get_results_from_api(identifiers, endpoints, api_key, api_secret): """Use the HouseCanary API Python Client to access the API""" if api_key is not None and api_secret is not None: client = housecanary.ApiClient(api_key, api_secret) else: client = housecanary.ApiClient() wrapper = ...
[ "Use", "the", "HouseCanary", "API", "Python", "Client", "to", "access", "the", "API" ]
housecanary/hc-api-python
python
https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/hc_api_export/hc_api_export.py#L154-L168
[ "def", "_get_results_from_api", "(", "identifiers", ",", "endpoints", ",", "api_key", ",", "api_secret", ")", ":", "if", "api_key", "is", "not", "None", "and", "api_secret", "is", "not", "None", ":", "client", "=", "housecanary", ".", "ApiClient", "(", "api_...
2bb9e2208b34e8617575de45934357ee33b8531c
train
images
Show the list of registered images in this cluster.
src/ai/backend/client/cli/admin/images.py
def images(): ''' Show the list of registered images in this cluster. ''' fields = [ ('Name', 'name'), ('Registry', 'registry'), ('Tag', 'tag'), ('Digest', 'digest'), ('Size', 'size_bytes'), ('Aliases', 'aliases'), ] with Session() as session: ...
def images(): ''' Show the list of registered images in this cluster. ''' fields = [ ('Name', 'name'), ('Registry', 'registry'), ('Tag', 'tag'), ('Digest', 'digest'), ('Size', 'size_bytes'), ('Aliases', 'aliases'), ] with Session() as session: ...
[ "Show", "the", "list", "of", "registered", "images", "in", "this", "cluster", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/images.py#L11-L34
[ "def", "images", "(", ")", ":", "fields", "=", "[", "(", "'Name'", ",", "'name'", ")", ",", "(", "'Registry'", ",", "'registry'", ")", ",", "(", "'Tag'", ",", "'tag'", ")", ",", "(", "'Digest'", ",", "'digest'", ")", ",", "(", "'Size'", ",", "'si...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
rescan_images
Update the kernel image metadata from all configured docker registries.
src/ai/backend/client/cli/admin/images.py
def rescan_images(registry): '''Update the kernel image metadata from all configured docker registries.''' with Session() as session: try: result = session.Image.rescanImages(registry) except Exception as e: print_error(e) sys.exit(1) if result['ok']: ...
def rescan_images(registry): '''Update the kernel image metadata from all configured docker registries.''' with Session() as session: try: result = session.Image.rescanImages(registry) except Exception as e: print_error(e) sys.exit(1) if result['ok']: ...
[ "Update", "the", "kernel", "image", "metadata", "from", "all", "configured", "docker", "registries", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/images.py#L40-L51
[ "def", "rescan_images", "(", "registry", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "result", "=", "session", ".", "Image", ".", "rescanImages", "(", "registry", ")", "except", "Exception", "as", "e", ":", "print_error", "("...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
alias_image
Add an image alias.
src/ai/backend/client/cli/admin/images.py
def alias_image(alias, target): '''Add an image alias.''' with Session() as session: try: result = session.Image.aliasImage(alias, target) except Exception as e: print_error(e) sys.exit(1) if result['ok']: print("alias {0} created for targe...
def alias_image(alias, target): '''Add an image alias.''' with Session() as session: try: result = session.Image.aliasImage(alias, target) except Exception as e: print_error(e) sys.exit(1) if result['ok']: print("alias {0} created for targe...
[ "Add", "an", "image", "alias", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/images.py#L56-L67
[ "def", "alias_image", "(", "alias", ",", "target", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "result", "=", "session", ".", "Image", ".", "aliasImage", "(", "alias", ",", "target", ")", "except", "Exception", "as", "e", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
dealias_image
Remove an image alias.
src/ai/backend/client/cli/admin/images.py
def dealias_image(alias): '''Remove an image alias.''' with Session() as session: try: result = session.Image.dealiasImage(alias) except Exception as e: print_error(e) sys.exit(1) if result['ok']: print("alias {0} removed.".format(alias)) ...
def dealias_image(alias): '''Remove an image alias.''' with Session() as session: try: result = session.Image.dealiasImage(alias) except Exception as e: print_error(e) sys.exit(1) if result['ok']: print("alias {0} removed.".format(alias)) ...
[ "Remove", "an", "image", "alias", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/images.py#L72-L83
[ "def", "dealias_image", "(", "alias", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "result", "=", "session", ".", "Image", ".", "dealiasImage", "(", "alias", ")", "except", "Exception", "as", "e", ":", "print_error", "(", "e...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
run_alias
Quick aliases for run command.
src/ai/backend/client/cli/__init__.py
def run_alias(): """ Quick aliases for run command. """ mode = Path(sys.argv[0]).stem help = True if len(sys.argv) <= 1 else False if mode == 'lcc': sys.argv.insert(1, 'c') elif mode == 'lpython': sys.argv.insert(1, 'python') sys.argv.insert(1, 'run') if help: ...
def run_alias(): """ Quick aliases for run command. """ mode = Path(sys.argv[0]).stem help = True if len(sys.argv) <= 1 else False if mode == 'lcc': sys.argv.insert(1, 'c') elif mode == 'lpython': sys.argv.insert(1, 'python') sys.argv.insert(1, 'run') if help: ...
[ "Quick", "aliases", "for", "run", "command", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/__init__.py#L99-L112
[ "def", "run_alias", "(", ")", ":", "mode", "=", "Path", "(", "sys", ".", "argv", "[", "0", "]", ")", ".", "stem", "help", "=", "True", "if", "len", "(", "sys", ".", "argv", ")", "<=", "1", "else", "False", "if", "mode", "==", "'lcc'", ":", "s...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
get_dev_asset_details
Takes in ipaddress as input to fetch device assett details from HP IMC RESTFUL API :param ipaddress: IP address of the device you wish to gather the asset details :return: object of type list containing the device asset details
archived/pyhpimc.py
def get_dev_asset_details(ipaddress): """Takes in ipaddress as input to fetch device assett details from HP IMC RESTFUL API :param ipaddress: IP address of the device you wish to gather the asset details :return: object of type list containing the device asset details """ # checks to see if the imc ...
def get_dev_asset_details(ipaddress): """Takes in ipaddress as input to fetch device assett details from HP IMC RESTFUL API :param ipaddress: IP address of the device you wish to gather the asset details :return: object of type list containing the device asset details """ # checks to see if the imc ...
[ "Takes", "in", "ipaddress", "as", "input", "to", "fetch", "device", "assett", "details", "from", "HP", "IMC", "RESTFUL", "API", ":", "param", "ipaddress", ":", "IP", "address", "of", "the", "device", "you", "wish", "to", "gather", "the", "asset", "details"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L150-L175
[ "def", "get_dev_asset_details", "(", "ipaddress", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_asset_url", "=", "\"/imcrs/netasset...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_serial_numbers
Helper function: Uses return of get_dev_asset_details function to evaluate to evaluate for multipe serial objects. :param assetList: output of get_dev_asset_details function :return: the serial_list object of list type which contains one or more dictionaries of the asset details
archived/pyhpimc.py
def get_serial_numbers(assetList): """ Helper function: Uses return of get_dev_asset_details function to evaluate to evaluate for multipe serial objects. :param assetList: output of get_dev_asset_details function :return: the serial_list object of list type which contains one or more dictionaries of the...
def get_serial_numbers(assetList): """ Helper function: Uses return of get_dev_asset_details function to evaluate to evaluate for multipe serial objects. :param assetList: output of get_dev_asset_details function :return: the serial_list object of list type which contains one or more dictionaries of the...
[ "Helper", "function", ":", "Uses", "return", "of", "get_dev_asset_details", "function", "to", "evaluate", "to", "evaluate", "for", "multipe", "serial", "objects", ".", ":", "param", "assetList", ":", "output", "of", "get_dev_asset_details", "function", ":", "retur...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L178-L189
[ "def", "get_serial_numbers", "(", "assetList", ")", ":", "serial_list", "=", "[", "]", "if", "type", "(", "assetList", ")", "==", "list", ":", "for", "i", "in", "assetList", ":", "if", "len", "(", "i", "[", "'serialNum'", "]", ")", ">", "0", ":", "...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_trunk_interfaces
Function takes devId as input to RESTFULL call to HP IMC platform :param devId: output of get_dev_details :return: list of dictionaries containing of interfaces configured as an 802.1q trunk
archived/pyhpimc.py
def get_trunk_interfaces(devId): """Function takes devId as input to RESTFULL call to HP IMC platform :param devId: output of get_dev_details :return: list of dictionaries containing of interfaces configured as an 802.1q trunk """ # checks to see if the imc credentials are already available if ...
def get_trunk_interfaces(devId): """Function takes devId as input to RESTFULL call to HP IMC platform :param devId: output of get_dev_details :return: list of dictionaries containing of interfaces configured as an 802.1q trunk """ # checks to see if the imc credentials are already available if ...
[ "Function", "takes", "devId", "as", "input", "to", "RESTFULL", "call", "to", "HP", "IMC", "platform", ":", "param", "devId", ":", "output", "of", "get_dev_details", ":", "return", ":", "list", "of", "dictionaries", "containing", "of", "interfaces", "configured...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L192-L214
[ "def", "get_trunk_interfaces", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_trunk_interfaces_url", "=", "\"/imcrs/vlan/t...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_device_access_interfaces
Function takes devId as input to RESTFUL call to HP IMC platform :param devId: requires deviceID as the only input parameter :return: list of dictionaries containing interfaces configured as access ports
archived/pyhpimc.py
def get_device_access_interfaces(devId): """Function takes devId as input to RESTFUL call to HP IMC platform :param devId: requires deviceID as the only input parameter :return: list of dictionaries containing interfaces configured as access ports """ # checks to see if the imc credentials are alrea...
def get_device_access_interfaces(devId): """Function takes devId as input to RESTFUL call to HP IMC platform :param devId: requires deviceID as the only input parameter :return: list of dictionaries containing interfaces configured as access ports """ # checks to see if the imc credentials are alrea...
[ "Function", "takes", "devId", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC", "platform", ":", "param", "devId", ":", "requires", "deviceID", "as", "the", "only", "input", "parameter", ":", "return", ":", "list", "of", "dictionaries", "containing"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L217-L240
[ "def", "get_device_access_interfaces", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_access_interface_vlan_url", "=", "\"...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_dev_details
Takes string input of IP address to issue RESTUL call to HP IMC :param ip_address: string object of dotted decimal notation of IPv4 address :return: dictionary of device details >>> get_dev_details('10.101.0.1') {'symbolLevel': '2', 'typeName': 'Cisco 2811', 'location': 'changed this too', 'status': '1...
archived/pyhpimc.py
def get_dev_details(ip_address): """Takes string input of IP address to issue RESTUL call to HP IMC :param ip_address: string object of dotted decimal notation of IPv4 address :return: dictionary of device details >>> get_dev_details('10.101.0.1') {'symbolLevel': '2', 'typeName': 'Cisco 2811', 'loc...
def get_dev_details(ip_address): """Takes string input of IP address to issue RESTUL call to HP IMC :param ip_address: string object of dotted decimal notation of IPv4 address :return: dictionary of device details >>> get_dev_details('10.101.0.1') {'symbolLevel': '2', 'typeName': 'Cisco 2811', 'loc...
[ "Takes", "string", "input", "of", "IP", "address", "to", "issue", "RESTUL", "call", "to", "HP", "IMC", ":", "param", "ip_address", ":", "string", "object", "of", "dotted", "decimal", "notation", "of", "IPv4", "address", ":", "return", ":", "dictionary", "o...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L269-L305
[ "def", "get_dev_details", "(", "ip_address", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_details_url", "=", "\"/imcrs/plat/res/de...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_dev_vlans
Function takes input of devID to issue RESTUL call to HP IMC :param devId: requires devId as the only input parameter :return: list dictionaries of existing vlans on the devices. Device must be supported in HP IMC platform VLAN manager module
archived/pyhpimc.py
def get_dev_vlans(devId): """Function takes input of devID to issue RESTUL call to HP IMC :param devId: requires devId as the only input parameter :return: list dictionaries of existing vlans on the devices. Device must be supported in HP IMC platform VLAN manager module """ # checks to see if the ...
def get_dev_vlans(devId): """Function takes input of devID to issue RESTUL call to HP IMC :param devId: requires devId as the only input parameter :return: list dictionaries of existing vlans on the devices. Device must be supported in HP IMC platform VLAN manager module """ # checks to see if the ...
[ "Function", "takes", "input", "of", "devID", "to", "issue", "RESTUL", "call", "to", "HP", "IMC", ":", "param", "devId", ":", "requires", "devId", "as", "the", "only", "input", "parameter", ":", "return", ":", "list", "dictionaries", "of", "existing", "vlan...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L308-L330
[ "def", "get_dev_vlans", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_vlans_url", "=", "\"/imcrs/vlan?devId=\"", "+...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_dev_interface
Function takes devid as input to RESTFUL call to HP IMC platform :param devid: requires devid as the only input :return: list object which contains a dictionary per interface
archived/pyhpimc.py
def get_dev_interface(devid): """ Function takes devid as input to RESTFUL call to HP IMC platform :param devid: requires devid as the only input :return: list object which contains a dictionary per interface """ # checks to see if the imc credentials are already available if auth is None or...
def get_dev_interface(devid): """ Function takes devid as input to RESTFUL call to HP IMC platform :param devid: requires devid as the only input :return: list object which contains a dictionary per interface """ # checks to see if the imc credentials are already available if auth is None or...
[ "Function", "takes", "devid", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC", "platform", ":", "param", "devid", ":", "requires", "devid", "as", "the", "only", "input", ":", "return", ":", "list", "object", "which", "contains", "a", "dictionary"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L333-L354
[ "def", "get_dev_interface", "(", "devid", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_interface_url", "=", "\"/imcrs/plat/res/dev...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_dev_run_config
function takes the devId of a specific device and issues a RESTFUL call to get the most current running config file as known by the HP IMC Base Platform ICC module for the target device. :param devId: int or str value of the target device :return: str which contains the entire content of the target device ...
archived/pyhpimc.py
def get_dev_run_config(devId): """ function takes the devId of a specific device and issues a RESTFUL call to get the most current running config file as known by the HP IMC Base Platform ICC module for the target device. :param devId: int or str value of the target device :return: str which contai...
def get_dev_run_config(devId): """ function takes the devId of a specific device and issues a RESTFUL call to get the most current running config file as known by the HP IMC Base Platform ICC module for the target device. :param devId: int or str value of the target device :return: str which contai...
[ "function", "takes", "the", "devId", "of", "a", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "most", "current", "running", "config", "file", "as", "known", "by", "the", "HP", "IMC", "Base", "Platform", "ICC", "module",...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L357-L384
[ "def", "get_dev_run_config", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_run_url", "=", "\"/imcrs/icc/deviceCfg/\""...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_dev_start_config
function takes the devId of a specific device and issues a RESTFUL call to get the most current startup config file as known by the HP IMC Base Platform ICC module for the target device. :param devId: int or str value of the target device :return: str which contains the entire content of the target device ...
archived/pyhpimc.py
def get_dev_start_config(devId): """ function takes the devId of a specific device and issues a RESTFUL call to get the most current startup config file as known by the HP IMC Base Platform ICC module for the target device. :param devId: int or str value of the target device :return: str which cont...
def get_dev_start_config(devId): """ function takes the devId of a specific device and issues a RESTFUL call to get the most current startup config file as known by the HP IMC Base Platform ICC module for the target device. :param devId: int or str value of the target device :return: str which cont...
[ "function", "takes", "the", "devId", "of", "a", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "most", "current", "startup", "config", "file", "as", "known", "by", "the", "HP", "IMC", "Base", "Platform", "ICC", "module",...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L387-L410
[ "def", "get_dev_start_config", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_run_url", "=", "\"/imcrs/icc/deviceCfg/\...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_dev_alarms
function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this device
archived/pyhpimc.py
def get_dev_alarms(devId): """ function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this device """ # checks to see i...
def get_dev_alarms(devId): """ function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this device """ # checks to see i...
[ "function", "takes", "the", "devId", "of", "a", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "current", "alarms", "for", "the", "target", "device", ".", ":", "param", "devId", ":", "int", "or", "str", "value", "of", ...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L413-L435
[ "def", "get_dev_alarms", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_alarm_url", "=", "\"/imcrs/fault/alarm?operato...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_real_time_locate
function takes the ipAddress of a specific host and issues a RESTFUL call to get the device and interface that the target host is currently connected to. :param ipAddress: str value valid IPv4 IP address :return: dictionary containing hostIp, devId, deviceIP, ifDesc, ifIndex
archived/pyhpimc.py
def get_real_time_locate(ipAddress): """ function takes the ipAddress of a specific host and issues a RESTFUL call to get the device and interface that the target host is currently connected to. :param ipAddress: str value valid IPv4 IP address :return: dictionary containing hostIp, devId, deviceIP,...
def get_real_time_locate(ipAddress): """ function takes the ipAddress of a specific host and issues a RESTFUL call to get the device and interface that the target host is currently connected to. :param ipAddress: str value valid IPv4 IP address :return: dictionary containing hostIp, devId, deviceIP,...
[ "function", "takes", "the", "ipAddress", "of", "a", "specific", "host", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "device", "and", "interface", "that", "the", "target", "host", "is", "currently", "connected", "to", ".", ":", "param", "ip...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L441-L458
[ "def", "get_real_time_locate", "(", "ipAddress", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "real_time_locate_url", "=", "\"/imcrs/res/access/realtimeLocate...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_ip_mac_arp_list
function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list from the target device. :param devId: int or str value of the target device. :return: list of dictionaries containing the IP/MAC/ARP list of the target device.
archived/pyhpimc.py
def get_ip_mac_arp_list(devId): """ function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list from the target device. :param devId: int or str value of the target device. :return: list of dictionaries containing the IP/MAC/ARP list of the target device. """ if ...
def get_ip_mac_arp_list(devId): """ function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list from the target device. :param devId: int or str value of the target device. :return: list of dictionaries containing the IP/MAC/ARP list of the target device. """ if ...
[ "function", "takes", "devid", "of", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "IP", "/", "MAC", "/", "ARP", "list", "from", "the", "target", "device", ".", ":", "param", "devId", ":", "int", "or", "str", "value"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L461-L481
[ "def", "get_ip_mac_arp_list", "(", "devId", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "ip_mac_arp_list_url", "=", "\"/imcrs/res/access/ipMacArp/\"", "+",...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_custom_views
function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input will return only the specified view. :param name: string containg the name of the desired custom view :return: list of dictionaries containing attributes of the custom views.
archived/pyhpimc.py
def get_custom_views(name=None): """ function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input will return only the specified view. :param name: string containg the name of the desired custom view :return: list of dictionaries containing attrib...
def get_custom_views(name=None): """ function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input will return only the specified view. :param name: string containg the name of the desired custom view :return: list of dictionaries containing attrib...
[ "function", "takes", "no", "input", "and", "issues", "a", "RESTFUL", "call", "to", "get", "a", "list", "of", "custom", "views", "from", "HPE", "IMC", ".", "Optioanl", "Name", "input", "will", "return", "only", "the", "specified", "view", ".", ":", "param...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L488-L512
[ "def", "get_custom_views", "(", "name", "=", "None", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "if", "name", "is", "None", ":", "get_custom_views...
4fba31827573587e03a6233c7db60f188038c8e5
train
create_custom_views
function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input will return only the specified view. :param name: string containg the name of the desired custom view :return: list of dictionaries containing attributes of the custom views.
archived/pyhpimc.py
def create_custom_views(name=None, upperview=None): """ function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input will return only the specified view. :param name: string containg the name of the desired custom view :return: list of dictionarie...
def create_custom_views(name=None, upperview=None): """ function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input will return only the specified view. :param name: string containg the name of the desired custom view :return: list of dictionarie...
[ "function", "takes", "no", "input", "and", "issues", "a", "RESTFUL", "call", "to", "get", "a", "list", "of", "custom", "views", "from", "HPE", "IMC", ".", "Optioanl", "Name", "input", "will", "return", "only", "the", "specified", "view", ".", ":", "param...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L514-L538
[ "def", "create_custom_views", "(", "name", "=", "None", ",", "upperview", "=", "None", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "create_custom_vie...
4fba31827573587e03a6233c7db60f188038c8e5
train
create_dev_vlan
function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the specified VLAN from the target device. VLAN Name MUST be valid on target device. :param devid: int or str value of the target device :param vlanid:int or str value of target 802.1q VLAN ...
archived/pyhpimc.py
def create_dev_vlan(devid, vlanid, vlan_name): """ function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the specified VLAN from the target device. VLAN Name MUST be valid on target device. :param devid: int or str value of the target device ...
def create_dev_vlan(devid, vlanid, vlan_name): """ function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the specified VLAN from the target device. VLAN Name MUST be valid on target device. :param devid: int or str value of the target device ...
[ "function", "takes", "devid", "and", "vlanid", "vlan_name", "of", "specific", "device", "and", "802", ".", "1q", "VLAN", "tag", "and", "issues", "a", "RESTFUL", "call", "to", "add", "the", "specified", "VLAN", "from", "the", "target", "device", ".", "VLAN"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L543-L566
[ "def", "create_dev_vlan", "(", "devid", ",", "vlanid", ",", "vlan_name", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "create_dev_vlan_url", "=", "\"/...
4fba31827573587e03a6233c7db60f188038c8e5
train
delete_dev_vlans
function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param devid: int or str value of the target device :param vlanid: :return:HTTP Status code of 204 with no values.
archived/pyhpimc.py
def delete_dev_vlans(devid, vlanid): """ function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param devid: int or str value of the target device :param vlanid: :return:HTTP Status code of 204 with n...
def delete_dev_vlans(devid, vlanid): """ function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param devid: int or str value of the target device :param vlanid: :return:HTTP Status code of 204 with n...
[ "function", "takes", "devid", "and", "vlanid", "of", "specific", "device", "and", "802", ".", "1q", "VLAN", "tag", "and", "issues", "a", "RESTFUL", "call", "to", "remove", "the", "specified", "VLAN", "from", "the", "target", "device", ".", ":", "param", ...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L569-L592
[ "def", "delete_dev_vlans", "(", "devid", ",", "vlanid", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "remove_dev_vlan_url", "=", "\"/imcrs/vlan/delvlan?de...
4fba31827573587e03a6233c7db60f188038c8e5
train
set_inteface_down
function takest devid and ifindex of specific device and interface and issues a RESTFUL call to " shut" the specifie d interface on the target device. :param devid: int or str value of the target device :param ifindex: int or str value of the target interface :return: HTTP status code 204 with no values...
archived/pyhpimc.py
def set_inteface_down(devid, ifindex): """ function takest devid and ifindex of specific device and interface and issues a RESTFUL call to " shut" the specifie d interface on the target device. :param devid: int or str value of the target device :param ifindex: int or str value of the target interfa...
def set_inteface_down(devid, ifindex): """ function takest devid and ifindex of specific device and interface and issues a RESTFUL call to " shut" the specifie d interface on the target device. :param devid: int or str value of the target device :param ifindex: int or str value of the target interfa...
[ "function", "takest", "devid", "and", "ifindex", "of", "specific", "device", "and", "interface", "and", "issues", "a", "RESTFUL", "call", "to", "shut", "the", "specifie", "d", "interface", "on", "the", "target", "device", ".", ":", "param", "devid", ":", "...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L598-L617
[ "def", "set_inteface_down", "(", "devid", ",", "ifindex", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "set_int_down_url", "=", "\"/imcrs/plat/res/device/...
4fba31827573587e03a6233c7db60f188038c8e5
train
set_inteface_up
function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec ified interface on the target device. :param devid: int or str value of the target device :param ifindex: int or str value of the target interface :return: HTTP status code 204 with no va...
archived/pyhpimc.py
def set_inteface_up(devid, ifindex): """ function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec ified interface on the target device. :param devid: int or str value of the target device :param ifindex: int or str value of the target inter...
def set_inteface_up(devid, ifindex): """ function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec ified interface on the target device. :param devid: int or str value of the target device :param ifindex: int or str value of the target inter...
[ "function", "takest", "devid", "and", "ifindex", "of", "specific", "device", "and", "interface", "and", "issues", "a", "RESTFUL", "call", "to", "undo", "shut", "the", "spec", "ified", "interface", "on", "the", "target", "device", ".", ":", "param", "devid", ...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L620-L639
[ "def", "set_inteface_up", "(", "devid", ",", "ifindex", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "set_int_up_url", "=", "\"/imcrs/plat/res/device/\"",...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_vm_host_info
function takes hostId as input to RESTFUL call to HP IMC :param hostId: int or string of HostId of Hypervisor host :return:list of dictionatires contraining the VM Host information for the target hypervisor
archived/pyhpimc.py
def get_vm_host_info(hostId): """ function takes hostId as input to RESTFUL call to HP IMC :param hostId: int or string of HostId of Hypervisor host :return:list of dictionatires contraining the VM Host information for the target hypervisor """ global r if auth is None or url is None: # che...
def get_vm_host_info(hostId): """ function takes hostId as input to RESTFUL call to HP IMC :param hostId: int or string of HostId of Hypervisor host :return:list of dictionatires contraining the VM Host information for the target hypervisor """ global r if auth is None or url is None: # che...
[ "function", "takes", "hostId", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC", ":", "param", "hostId", ":", "int", "or", "string", "of", "HostId", "of", "Hypervisor", "host", ":", "return", ":", "list", "of", "dictionatires", "contraining", "the...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L642-L664
[ "def", "get_vm_host_info", "(", "hostId", ")", ":", "global", "r", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "get_vm_host_info_url", "=", "\"/imcrs/vrm/host?host...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_trap_definitions
Takes in no param as input to fetch SNMP TRAP definitions from HP IMC RESTFUL API :param None :return: object of type list containing the device asset details
archived/pyhpimc.py
def get_trap_definitions(): """Takes in no param as input to fetch SNMP TRAP definitions from HP IMC RESTFUL API :param None :return: object of type list containing the device asset details """ # checks to see if the imc credentials are already available if auth is None or url is None: s...
def get_trap_definitions(): """Takes in no param as input to fetch SNMP TRAP definitions from HP IMC RESTFUL API :param None :return: object of type list containing the device asset details """ # checks to see if the imc credentials are already available if auth is None or url is None: s...
[ "Takes", "in", "no", "param", "as", "input", "to", "fetch", "SNMP", "TRAP", "definitions", "from", "HP", "IMC", "RESTFUL", "API", ":", "param", "None", ":", "return", ":", "object", "of", "type", "list", "containing", "the", "device", "asset", "details" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L741-L760
[ "def", "get_trap_definitions", "(", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_trap_def_url", "=", "\"/imcrs/fault/trapDefine/sync/que...
4fba31827573587e03a6233c7db60f188038c8e5
train
RateLimitException.rate_limits
Returns list of rate limit information from the response
housecanary/exceptions.py
def rate_limits(self): """Returns list of rate limit information from the response""" if not self._rate_limits: self._rate_limits = utilities.get_rate_limits(self._response) return self._rate_limits
def rate_limits(self): """Returns list of rate limit information from the response""" if not self._rate_limits: self._rate_limits = utilities.get_rate_limits(self._response) return self._rate_limits
[ "Returns", "list", "of", "rate", "limit", "information", "from", "the", "response" ]
housecanary/hc-api-python
python
https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/exceptions.py#L30-L34
[ "def", "rate_limits", "(", "self", ")", ":", "if", "not", "self", ".", "_rate_limits", ":", "self", ".", "_rate_limits", "=", "utilities", ".", "get_rate_limits", "(", "self", ".", "_response", ")", "return", "self", ".", "_rate_limits" ]
2bb9e2208b34e8617575de45934357ee33b8531c
train
get_custom_views
function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
pyhpeimc/plat/groups.py
def get_custom_views(auth, url, name=None): """ function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth objec...
def get_custom_views(auth, url, name=None): """ function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth objec...
[ "function", "requires", "no", "input", "and", "returns", "a", "list", "of", "dictionaries", "of", "custom", "views", "from", "an", "HPE", "IMC", ".", "Optional", "name", "argument", "will", "return", "only", "the", "specified", "view", ".", ":", "param", "...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L23-L77
[ "def", "get_custom_views", "(", "auth", ",", "url", ",", "name", "=", "None", ")", ":", "get_custom_view_url", "=", "None", "if", "name", "is", "None", ":", "get_custom_view_url", "=", "'/imcrs/plat/res/view/custom?resPrivilegeFilter=false&desc=false'", "'&total=false'"...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_custom_view_details
function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
pyhpeimc/plat/groups.py
def get_custom_view_details(name, auth, url): """ function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth obj...
def get_custom_view_details(name, auth, url): """ function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name argument will return only the specified view. :param name: str containing the name of the desired custom view :param auth: requests auth obj...
[ "function", "requires", "no", "input", "and", "returns", "a", "list", "of", "dictionaries", "of", "custom", "views", "from", "an", "HPE", "IMC", ".", "Optional", "name", "argument", "will", "return", "only", "the", "specified", "view", ".", ":", "param", "...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L80-L127
[ "def", "get_custom_view_details", "(", "name", ",", "auth", ",", "url", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", "=", "name", ")", "if", "view_id", "is", "None", ":", "return", "view_id", "view_id", "=", "get_cu...
4fba31827573587e03a6233c7db60f188038c8e5
train
create_custom_views
function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optional Name input will return only the specified view. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeim...
pyhpeimc/plat/groups.py
def create_custom_views(auth, url, name=None, upperview=None): """ function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optional Name input will return only the specified view. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
def create_custom_views(auth, url, name=None, upperview=None): """ function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optional Name input will return only the specified view. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
[ "function", "takes", "no", "input", "and", "issues", "a", "RESTFUL", "call", "to", "get", "a", "list", "of", "custom", "views", "from", "HPE", "IMC", ".", "Optional", "Name", "input", "will", "return", "only", "the", "specified", "view", "." ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L130-L195
[ "def", "create_custom_views", "(", "auth", ",", "url", ",", "name", "=", "None", ",", "upperview", "=", "None", ")", ":", "create_custom_views_url", "=", "'/imcrs/plat/res/view/custom?resPrivilegeFilter=false&desc=false'", "'&total=false'", "f_url", "=", "url", "+", "...
4fba31827573587e03a6233c7db60f188038c8e5
train
add_devs_custom_views
function takes a list of devIDs from devices discovered in the HPE IMC platform and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param custom_view_name: str of the target custom view name :param dev_list: list containing the devID of all devices to be containe...
pyhpeimc/plat/groups.py
def add_devs_custom_views(custom_view_name, dev_list, auth, url): """ function takes a list of devIDs from devices discovered in the HPE IMC platform and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param custom_view_name: str of the target custom view name...
def add_devs_custom_views(custom_view_name, dev_list, auth, url): """ function takes a list of devIDs from devices discovered in the HPE IMC platform and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param custom_view_name: str of the target custom view name...
[ "function", "takes", "a", "list", "of", "devIDs", "from", "devices", "discovered", "in", "the", "HPE", "IMC", "platform", "and", "issues", "a", "RESTFUL", "call", "to", "add", "the", "list", "of", "devices", "to", "a", "specific", "custom", "views", "from"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L200-L241
[ "def", "add_devs_custom_views", "(", "custom_view_name", ",", "dev_list", ",", "auth", ",", "url", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", "=", "custom_view_name", ")", "if", "view_id", "is", "None", ":", "print", ...
4fba31827573587e03a6233c7db60f188038c8e5
train
delete_custom_view
function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC ...
pyhpeimc/plat/groups.py
def delete_custom_view(auth, url, name): """ function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth ...
def delete_custom_view(auth, url, name): """ function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth ...
[ "function", "takes", "input", "of", "auth", "url", "and", "name", "and", "issues", "a", "RESTFUL", "call", "to", "delete", "a", "specific", "of", "custom", "views", "from", "HPE", "IMC", ".", ":", "param", "name", ":", "string", "containg", "the", "name"...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L244-L295
[ "def", "delete_custom_view", "(", "auth", ",", "url", ",", "name", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", ")", "if", "view_id", "is", "None", ":", "print", "(", "\"View \"", "+", "name", "+", "\" doesn't exist...
4fba31827573587e03a6233c7db60f188038c8e5
train
Translator._get_token
Get token for make request. The The data obtained herein are used in the variable header. Returns: To perform the request, receive in return a dictionary with several keys. With this method only return the token as it will use it for subseq...
BingTranslator/__init__.py
def _get_token(self): """ Get token for make request. The The data obtained herein are used in the variable header. Returns: To perform the request, receive in return a dictionary with several keys. With this method only return the tok...
def _get_token(self): """ Get token for make request. The The data obtained herein are used in the variable header. Returns: To perform the request, receive in return a dictionary with several keys. With this method only return the tok...
[ "Get", "token", "for", "make", "request", ".", "The", "The", "data", "obtained", "herein", "are", "used", "in", "the", "variable", "header", ".", "Returns", ":", "To", "perform", "the", "request", "receive", "in", "return", "a", "dictionary", "with", "seve...
wilfilho/BingTranslator
python
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L35-L49
[ "def", "_get_token", "(", "self", ")", ":", "informations", "=", "self", ".", "_set_format_oauth", "(", ")", "oauth_url", "=", "\"https://datamarket.accesscontrol.windows.net/v2/OAuth2-13\"", "token", "=", "requests", ".", "post", "(", "oauth_url", ",", "informations"...
6bada6fe1ac4177cc7dc62ff16dab561ba714534
train
Translator._set_format_oauth
Format and encode dict for make authentication on microsoft servers.
BingTranslator/__init__.py
def _set_format_oauth(self): """ Format and encode dict for make authentication on microsoft servers. """ format_oauth = urllib.parse.urlencode({ 'client_id': self._client_id, 'client_secret': self._client_secret, 'scope': self...
def _set_format_oauth(self): """ Format and encode dict for make authentication on microsoft servers. """ format_oauth = urllib.parse.urlencode({ 'client_id': self._client_id, 'client_secret': self._client_secret, 'scope': self...
[ "Format", "and", "encode", "dict", "for", "make", "authentication", "on", "microsoft", "servers", "." ]
wilfilho/BingTranslator
python
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L51-L62
[ "def", "_set_format_oauth", "(", "self", ")", ":", "format_oauth", "=", "urllib", ".", "parse", ".", "urlencode", "(", "{", "'client_id'", ":", "self", ".", "_client_id", ",", "'client_secret'", ":", "self", ".", "_client_secret", ",", "'scope'", ":", "self"...
6bada6fe1ac4177cc7dc62ff16dab561ba714534
train
Translator._make_request
This is the final step, where the request is made, the data is retrieved and returned.
BingTranslator/__init__.py
def _make_request(self, params, translation_url, headers): """ This is the final step, where the request is made, the data is retrieved and returned. """ resp = requests.get(translation_url, params=params, headers=headers) resp.encoding = "UTF-8-sig" ...
def _make_request(self, params, translation_url, headers): """ This is the final step, where the request is made, the data is retrieved and returned. """ resp = requests.get(translation_url, params=params, headers=headers) resp.encoding = "UTF-8-sig" ...
[ "This", "is", "the", "final", "step", "where", "the", "request", "is", "made", "the", "data", "is", "retrieved", "and", "returned", "." ]
wilfilho/BingTranslator
python
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L64-L72
[ "def", "_make_request", "(", "self", ",", "params", ",", "translation_url", ",", "headers", ")", ":", "resp", "=", "requests", ".", "get", "(", "translation_url", ",", "params", "=", "params", ",", "headers", "=", "headers", ")", "resp", ".", "encoding", ...
6bada6fe1ac4177cc7dc62ff16dab561ba714534
train
Translator._get_content
This method gets the token and makes the header variable that will be used in connection authentication. After that, calls the _make_request() method to return the desired data.
BingTranslator/__init__.py
def _get_content(self, params, mode_translate): """ This method gets the token and makes the header variable that will be used in connection authentication. After that, calls the _make_request() method to return the desired data. """ token = self._get_...
def _get_content(self, params, mode_translate): """ This method gets the token and makes the header variable that will be used in connection authentication. After that, calls the _make_request() method to return the desired data. """ token = self._get_...
[ "This", "method", "gets", "the", "token", "and", "makes", "the", "header", "variable", "that", "will", "be", "used", "in", "connection", "authentication", ".", "After", "that", "calls", "the", "_make_request", "()", "method", "to", "return", "the", "desired", ...
wilfilho/BingTranslator
python
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L74-L84
[ "def", "_get_content", "(", "self", ",", "params", ",", "mode_translate", ")", ":", "token", "=", "self", ".", "_get_token", "(", ")", "headers", "=", "{", "'Authorization'", ":", "'Bearer '", "+", "token", "}", "parameters", "=", "params", "translation_url"...
6bada6fe1ac4177cc7dc62ff16dab561ba714534
train
Translator.detect_language
Params: ::text = Text for identify language. Returns: Returns language present on text.
BingTranslator/__init__.py
def detect_language(self, text): """ Params: ::text = Text for identify language. Returns: Returns language present on text. """ infos_translate = TextDetectLanguageModel(text).to_dict() mode_translate = Transl...
def detect_language(self, text): """ Params: ::text = Text for identify language. Returns: Returns language present on text. """ infos_translate = TextDetectLanguageModel(text).to_dict() mode_translate = Transl...
[ "Params", ":", "::", "text", "=", "Text", "for", "identify", "language", ".", "Returns", ":", "Returns", "language", "present", "on", "text", "." ]
wilfilho/BingTranslator
python
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L100-L110
[ "def", "detect_language", "(", "self", ",", "text", ")", ":", "infos_translate", "=", "TextDetectLanguageModel", "(", "text", ")", ".", "to_dict", "(", ")", "mode_translate", "=", "TranslatorMode", ".", "Detect", ".", "value", "return", "self", ".", "_get_cont...
6bada6fe1ac4177cc7dc62ff16dab561ba714534
train
Translator.detect_languages
Params: ::texts = Array of texts for detect languages Returns: Returns language present on array of text.
BingTranslator/__init__.py
def detect_languages(self, texts): """ Params: ::texts = Array of texts for detect languages Returns: Returns language present on array of text. """ text_list = TextUtils.format_list_to_send(texts) infos_translate = TextDe...
def detect_languages(self, texts): """ Params: ::texts = Array of texts for detect languages Returns: Returns language present on array of text. """ text_list = TextUtils.format_list_to_send(texts) infos_translate = TextDe...
[ "Params", ":", "::", "texts", "=", "Array", "of", "texts", "for", "detect", "languages", "Returns", ":", "Returns", "language", "present", "on", "array", "of", "text", "." ]
wilfilho/BingTranslator
python
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L112-L125
[ "def", "detect_languages", "(", "self", ",", "texts", ")", ":", "text_list", "=", "TextUtils", ".", "format_list_to_send", "(", "texts", ")", "infos_translate", "=", "TextDetectLanguageModel", "(", "text_list", ")", ".", "to_dict", "(", ")", "texts_for_detect", ...
6bada6fe1ac4177cc7dc62ff16dab561ba714534
train
Translator.translate
This method takes as a parameter the desired text to be translated and the language to which should be translated. To find the code for each language just go to the library home page. The parameter ::from_lang:: is optional because the api microsoft recognizes the l...
BingTranslator/__init__.py
def translate(self, text, to_lang, from_lang=None, content_type="text/plain", category=None): """ This method takes as a parameter the desired text to be translated and the language to which should be translated. To find the code for each language just ...
def translate(self, text, to_lang, from_lang=None, content_type="text/plain", category=None): """ This method takes as a parameter the desired text to be translated and the language to which should be translated. To find the code for each language just ...
[ "This", "method", "takes", "as", "a", "parameter", "the", "desired", "text", "to", "be", "translated", "and", "the", "language", "to", "which", "should", "be", "translated", ".", "To", "find", "the", "code", "for", "each", "language", "just", "go", "to", ...
wilfilho/BingTranslator
python
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L127-L143
[ "def", "translate", "(", "self", ",", "text", ",", "to_lang", ",", "from_lang", "=", "None", ",", "content_type", "=", "\"text/plain\"", ",", "category", "=", "None", ")", ":", "infos_translate", "=", "TextModel", "(", "text", ",", "to_lang", ",", "from_la...
6bada6fe1ac4177cc7dc62ff16dab561ba714534
train
Translator.speak_phrase
This method is very similar to the above, the difference between them is that this method creates an object of class TranslateSpeak(having therefore different attributes) and use another url, as we see the presence of SpeakMode enumerator instead of Translate. ...
BingTranslator/__init__.py
def speak_phrase(self, text, language, format_audio=None, option=None): """ This method is very similar to the above, the difference between them is that this method creates an object of class TranslateSpeak(having therefore different attributes) and use a...
def speak_phrase(self, text, language, format_audio=None, option=None): """ This method is very similar to the above, the difference between them is that this method creates an object of class TranslateSpeak(having therefore different attributes) and use a...
[ "This", "method", "is", "very", "similar", "to", "the", "above", "the", "difference", "between", "them", "is", "that", "this", "method", "creates", "an", "object", "of", "class", "TranslateSpeak", "(", "having", "therefore", "different", "attributes", ")", "an...
wilfilho/BingTranslator
python
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L179-L201
[ "def", "speak_phrase", "(", "self", ",", "text", ",", "language", ",", "format_audio", "=", "None", ",", "option", "=", "None", ")", ":", "infos_speak_translate", "=", "SpeakModel", "(", "text", ",", "language", ",", "format_audio", ",", "option", ")", "."...
6bada6fe1ac4177cc7dc62ff16dab561ba714534
train
get_vm_host_info
function takes hostId as input to RESTFUL call to HP IMC :param hostip: int or string of hostip of Hypervisor host :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :return: Dict...
pyhpeimc/plat/vrm.py
def get_vm_host_info(hostip, auth, url): """ function takes hostId as input to RESTFUL call to HP IMC :param hostip: int or string of hostip of Hypervisor host :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually aut...
def get_vm_host_info(hostip, auth, url): """ function takes hostId as input to RESTFUL call to HP IMC :param hostip: int or string of hostip of Hypervisor host :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually aut...
[ "function", "takes", "hostId", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vrm.py#L21-L79
[ "def", "get_vm_host_info", "(", "hostip", ",", "auth", ",", "url", ")", ":", "hostid", "=", "get_dev_details", "(", "hostip", ",", "auth", ",", "url", ")", "[", "'id'", "]", "f_url", "=", "url", "+", "\"/imcrs/vrm/host?hostId=\"", "+", "str", "(", "hosti...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_plat_operator
Funtion takes no inputs and returns a list of dictionaties of all of the operators currently configured on the HPE IMC system :return: list of dictionaries
build/lib/pyhpimc/plat/operator.py
def get_plat_operator(auth, url,headers=HEADERS): ''' Funtion takes no inputs and returns a list of dictionaties of all of the operators currently configured on the HPE IMC system :return: list of dictionaries ''' get_operator_url = '/imcrs/plat/operator?start=0&size=1000&orderBy=id&desc=false&t...
def get_plat_operator(auth, url,headers=HEADERS): ''' Funtion takes no inputs and returns a list of dictionaties of all of the operators currently configured on the HPE IMC system :return: list of dictionaries ''' get_operator_url = '/imcrs/plat/operator?start=0&size=1000&orderBy=id&desc=false&t...
[ "Funtion", "takes", "no", "inputs", "and", "returns", "a", "list", "of", "dictionaties", "of", "all", "of", "the", "operators", "currently", "configured", "on", "the", "HPE", "IMC", "system", ":", "return", ":", "list", "of", "dictionaries" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/operator.py#L115-L129
[ "def", "get_plat_operator", "(", "auth", ",", "url", ",", "headers", "=", "HEADERS", ")", ":", "get_operator_url", "=", "'/imcrs/plat/operator?start=0&size=1000&orderBy=id&desc=false&total=false'", "f_url", "=", "url", "+", "get_operator_url", "try", ":", "r", "=", "r...
4fba31827573587e03a6233c7db60f188038c8e5
train
delete_plat_operator
Function to set the password of an existing operator :param operator: str Name of the operator account :param password: str New password :param url: str url of IMC server, see requests library docs for more info :param auth: str see requests library docs for more info :param headers: json formated s...
build/lib/pyhpimc/plat/operator.py
def delete_plat_operator(operator,auth, url, headers=HEADERS): """ Function to set the password of an existing operator :param operator: str Name of the operator account :param password: str New password :param url: str url of IMC server, see requests library docs for more info :param auth: str ...
def delete_plat_operator(operator,auth, url, headers=HEADERS): """ Function to set the password of an existing operator :param operator: str Name of the operator account :param password: str New password :param url: str url of IMC server, see requests library docs for more info :param auth: str ...
[ "Function", "to", "set", "the", "password", "of", "an", "existing", "operator", ":", "param", "operator", ":", "str", "Name", "of", "the", "operator", "account", ":", "param", "password", ":", "str", "New", "password", ":", "param", "url", ":", "str", "u...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/operator.py#L131-L158
[ "def", "delete_plat_operator", "(", "operator", ",", "auth", ",", "url", ",", "headers", "=", "HEADERS", ")", ":", "#oper_id = None", "plat_oper_list", "=", "get_plat_operator", "(", "auth", ",", "url", ")", "for", "i", "in", "plat_oper_list", ":", "if", "op...
4fba31827573587e03a6233c7db60f188038c8e5
train
TupleWrapper.index
Args: value: index Returns: index of the values Raises: ValueError: value is not in list
src/ww/wrappers/tuples.py
def index(self, value): """ Args: value: index Returns: index of the values Raises: ValueError: value is not in list """ for i, x in enumerate(self): if x == value: return i raise ValueError("{} is not in lis...
def index(self, value): """ Args: value: index Returns: index of the values Raises: ValueError: value is not in list """ for i, x in enumerate(self): if x == value: return i raise ValueError("{} is not in lis...
[ "Args", ":", "value", ":", "index" ]
Tygs/ww
python
https://github.com/Tygs/ww/blob/6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4/src/ww/wrappers/tuples.py#L33-L48
[ "def", "index", "(", "self", ",", "value", ")", ":", "for", "i", ",", "x", "in", "enumerate", "(", "self", ")", ":", "if", "x", "==", "value", ":", "return", "i", "raise", "ValueError", "(", "\"{} is not in list\"", ".", "format", "(", "value", ")", ...
6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4
train
TupleWrapper.to_d
Args: self Returns: a d that stems from self Raises: ValueError: dictionary update sequence element #index has length len(tuple); 2 is required TypeError: cannot convert dictionary update sequence element #index to a sequence
src/ww/wrappers/tuples.py
def to_d(self): """ Args: self Returns: a d that stems from self Raises: ValueError: dictionary update sequence element #index has length len(tuple); 2 is required TypeError: cannot convert dictionary update sequence element #index to a ...
def to_d(self): """ Args: self Returns: a d that stems from self Raises: ValueError: dictionary update sequence element #index has length len(tuple); 2 is required TypeError: cannot convert dictionary update sequence element #index to a ...
[ "Args", ":", "self" ]
Tygs/ww
python
https://github.com/Tygs/ww/blob/6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4/src/ww/wrappers/tuples.py#L59-L101
[ "def", "to_d", "(", "self", ")", ":", "try", ":", "return", "ww", ".", "d", "(", "self", ")", "except", "(", "TypeError", ",", "ValueError", ")", ":", "for", "i", ",", "element", "in", "enumerate", "(", "self", ")", ":", "try", ":", "iter", "(", ...
6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4
train
get_cfg_template
Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url fro...
build/lib/pyhpeimc/plat/icc.py
def get_cfg_template(auth, url, folder = None): ''' Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :p...
def get_cfg_template(auth, url, folder = None): ''' Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :p...
[ "Function", "takes", "no", "input", "and", "returns", "a", "list", "of", "dictionaries", "containing", "the", "configuration", "templates", "in", "the", "root", "folder", "of", "the", "icc", "configuration", "template", "library", "." ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L17-L67
[ "def", "get_cfg_template", "(", "auth", ",", "url", ",", "folder", "=", "None", ")", ":", "if", "folder", "==", "None", ":", "get_cfg_template_url", "=", "\"/imcrs/icc/confFile/list\"", "else", ":", "folder_id", "=", "get_folder_id", "(", "folder", ",", "auth"...
4fba31827573587e03a6233c7db60f188038c8e5
train
create_cfg_segment
Takes a str into var filecontent which represents the entire content of a configuration segment, or partial configuration file. Takes a str into var description which represents the description of the configuration segment :param filename: str containing the name of the configuration segment. :param fileco...
build/lib/pyhpeimc/plat/icc.py
def create_cfg_segment(filename, filecontent, description, auth, url): ''' Takes a str into var filecontent which represents the entire content of a configuration segment, or partial configuration file. Takes a str into var description which represents the description of the configuration segment :param...
def create_cfg_segment(filename, filecontent, description, auth, url): ''' Takes a str into var filecontent which represents the entire content of a configuration segment, or partial configuration file. Takes a str into var description which represents the description of the configuration segment :param...
[ "Takes", "a", "str", "into", "var", "filecontent", "which", "represents", "the", "entire", "content", "of", "a", "configuration", "segment", "or", "partial", "configuration", "file", ".", "Takes", "a", "str", "into", "var", "description", "which", "represents", ...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L71-L117
[ "def", "create_cfg_segment", "(", "filename", ",", "filecontent", ",", "description", ",", "auth", ",", "url", ")", ":", "payload", "=", "{", "\"confFileName\"", ":", "filename", ",", "\"confFileType\"", ":", "\"2\"", ",", "\"cfgFileParent\"", ":", "\"-1\"", "...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_template_id
Helper function takes str input of folder name and returns str numerical id of the folder. :param folder_name: str name of the folder :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass ...
build/lib/pyhpeimc/plat/icc.py
def get_template_id(template_name, auth, url): """ Helper function takes str input of folder name and returns str numerical id of the folder. :param folder_name: str name of the folder :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC R...
def get_template_id(template_name, auth, url): """ Helper function takes str input of folder name and returns str numerical id of the folder. :param folder_name: str name of the folder :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC R...
[ "Helper", "function", "takes", "str", "input", "of", "folder", "name", "and", "returns", "str", "numerical", "id", "of", "the", "folder", ".", ":", "param", "folder_name", ":", "str", "name", "of", "the", "folder" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L120-L148
[ "def", "get_template_id", "(", "template_name", ",", "auth", ",", "url", ")", ":", "object_list", "=", "get_cfg_template", "(", "auth", "=", "auth", ",", "url", "=", "url", ")", "for", "object", "in", "object_list", ":", "if", "object", "[", "'confFileName...
4fba31827573587e03a6233c7db60f188038c8e5
train
delete_cfg_template
Uses the get_template_id() funct to gather the template_id to craft a url which is sent to the IMC server using a Delete Method :param template_name: str containing the entire contents of the configuration segment :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :par...
build/lib/pyhpeimc/plat/icc.py
def delete_cfg_template(template_name, auth, url): '''Uses the get_template_id() funct to gather the template_id to craft a url which is sent to the IMC server using a Delete Method :param template_name: str containing the entire contents of the configuration segment :param auth: requests auth object #...
def delete_cfg_template(template_name, auth, url): '''Uses the get_template_id() funct to gather the template_id to craft a url which is sent to the IMC server using a Delete Method :param template_name: str containing the entire contents of the configuration segment :param auth: requests auth object #...
[ "Uses", "the", "get_template_id", "()", "funct", "to", "gather", "the", "template_id", "to", "craft", "a", "url", "which", "is", "sent", "to", "the", "IMC", "server", "using", "a", "Delete", "Method", ":", "param", "template_name", ":", "str", "containing", ...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L151-L187
[ "def", "delete_cfg_template", "(", "template_name", ",", "auth", ",", "url", ")", ":", "file_id", "=", "get_template_id", "(", "template_name", ",", "auth", ",", "url", ")", "delete_cfg_template_url", "=", "\"/imcrs/icc/confFile/\"", "+", "str", "(", "file_id", ...
4fba31827573587e03a6233c7db60f188038c8e5
train
get_folder_id
Helper function takes str input of folder name and returns str numerical id of the folder. :param folder_name: str name of the folder :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass ...
build/lib/pyhpeimc/plat/icc.py
def get_folder_id(folder_name, auth, url): """ Helper function takes str input of folder name and returns str numerical id of the folder. :param folder_name: str name of the folder :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS in...
def get_folder_id(folder_name, auth, url): """ Helper function takes str input of folder name and returns str numerical id of the folder. :param folder_name: str name of the folder :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS in...
[ "Helper", "function", "takes", "str", "input", "of", "folder", "name", "and", "returns", "str", "numerical", "id", "of", "the", "folder", ".", ":", "param", "folder_name", ":", "str", "name", "of", "the", "folder" ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L189-L217
[ "def", "get_folder_id", "(", "folder_name", ",", "auth", ",", "url", ")", ":", "object_list", "=", "get_cfg_template", "(", "auth", "=", "auth", ",", "url", "=", "url", ")", "for", "object", "in", "object_list", ":", "if", "object", "[", "'confFileName'", ...
4fba31827573587e03a6233c7db60f188038c8e5
train
bold
Wraps the given text with bold enable/disable ANSI sequences.
src/ai/backend/client/cli/pretty.py
def bold(text: str) -> str: ''' Wraps the given text with bold enable/disable ANSI sequences. ''' return (style(text, bold=True, reset=False) + style('', bold=False, reset=False))
def bold(text: str) -> str: ''' Wraps the given text with bold enable/disable ANSI sequences. ''' return (style(text, bold=True, reset=False) + style('', bold=False, reset=False))
[ "Wraps", "the", "given", "text", "with", "bold", "enable", "/", "disable", "ANSI", "sequences", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/pretty.py#L28-L33
[ "def", "bold", "(", "text", ":", "str", ")", "->", "str", ":", "return", "(", "style", "(", "text", ",", "bold", "=", "True", ",", "reset", "=", "False", ")", "+", "style", "(", "''", ",", "bold", "=", "False", ",", "reset", "=", "False", ")", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
Manager.status
Returns the current status of the configured API server.
src/ai/backend/client/manager.py
async def status(cls): ''' Returns the current status of the configured API server. ''' rqst = Request(cls.session, 'GET', '/manager/status') rqst.set_json({ 'status': 'running', }) async with rqst.fetch() as resp: return await resp.json()
async def status(cls): ''' Returns the current status of the configured API server. ''' rqst = Request(cls.session, 'GET', '/manager/status') rqst.set_json({ 'status': 'running', }) async with rqst.fetch() as resp: return await resp.json()
[ "Returns", "the", "current", "status", "of", "the", "configured", "API", "server", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/manager.py#L18-L27
[ "async", "def", "status", "(", "cls", ")", ":", "rqst", "=", "Request", "(", "cls", ".", "session", ",", "'GET'", ",", "'/manager/status'", ")", "rqst", ".", "set_json", "(", "{", "'status'", ":", "'running'", ",", "}", ")", "async", "with", "rqst", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
Manager.freeze
Freezes the configured API server. Any API clients will no longer be able to create new compute sessions nor create and modify vfolders/keypairs/etc. This is used to enter the maintenance mode of the server for unobtrusive manager and/or agent upgrades. :param force_kill: If set...
src/ai/backend/client/manager.py
async def freeze(cls, force_kill: bool = False): ''' Freezes the configured API server. Any API clients will no longer be able to create new compute sessions nor create and modify vfolders/keypairs/etc. This is used to enter the maintenance mode of the server for unobtrusive ...
async def freeze(cls, force_kill: bool = False): ''' Freezes the configured API server. Any API clients will no longer be able to create new compute sessions nor create and modify vfolders/keypairs/etc. This is used to enter the maintenance mode of the server for unobtrusive ...
[ "Freezes", "the", "configured", "API", "server", ".", "Any", "API", "clients", "will", "no", "longer", "be", "able", "to", "create", "new", "compute", "sessions", "nor", "create", "and", "modify", "vfolders", "/", "keypairs", "/", "etc", ".", "This", "is",...
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/manager.py#L31-L50
[ "async", "def", "freeze", "(", "cls", ",", "force_kill", ":", "bool", "=", "False", ")", ":", "rqst", "=", "Request", "(", "cls", ".", "session", ",", "'PUT'", ",", "'/manager/status'", ")", "rqst", ".", "set_json", "(", "{", "'status'", ":", "'frozen'...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
get_dev_alarms
function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this device
build/lib/pyhpimc/plat/alarms.py
def get_dev_alarms(devId, auth=auth.creds, url=auth.url): """ function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this devic...
def get_dev_alarms(devId, auth=auth.creds, url=auth.url): """ function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this devic...
[ "function", "takes", "the", "devId", "of", "a", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "current", "alarms", "for", "the", "target", "device", ".", ":", "param", "devId", ":", "int", "or", "str", "value", "of", ...
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/alarms.py#L43-L64
[ "def", "get_dev_alarms", "(", "devId", ",", "auth", "=", "auth", ".", "creds", ",", "url", "=", "auth", ".", "url", ")", ":", "# checks to see if the imc credentials are already available", "get_dev_alarm_url", "=", "\"/imcrs/fault/alarm?operatorName=admin&deviceId=\"", "...
4fba31827573587e03a6233c7db60f188038c8e5
train
upload
Upload files to user's home folder. \b SESSID: Session ID or its alias given when creating the session. FILES: Path to upload.
src/ai/backend/client/cli/files.py
def upload(sess_id_or_alias, files): """ Upload files to user's home folder. \b SESSID: Session ID or its alias given when creating the session. FILES: Path to upload. """ if len(files) < 1: return with Session() as session: try: print_wait('Uploading files.....
def upload(sess_id_or_alias, files): """ Upload files to user's home folder. \b SESSID: Session ID or its alias given when creating the session. FILES: Path to upload. """ if len(files) < 1: return with Session() as session: try: print_wait('Uploading files.....
[ "Upload", "files", "to", "user", "s", "home", "folder", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/files.py#L17-L35
[ "def", "upload", "(", "sess_id_or_alias", ",", "files", ")", ":", "if", "len", "(", "files", ")", "<", "1", ":", "return", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "print_wait", "(", "'Uploading files...'", ")", "kernel", "=", "se...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
download
Download files from a running container. \b SESSID: Session ID or its alias given when creating the session. FILES: Paths inside container.
src/ai/backend/client/cli/files.py
def download(sess_id_or_alias, files, dest): """ Download files from a running container. \b SESSID: Session ID or its alias given when creating the session. FILES: Paths inside container. """ if len(files) < 1: return with Session() as session: try: print_wa...
def download(sess_id_or_alias, files, dest): """ Download files from a running container. \b SESSID: Session ID or its alias given when creating the session. FILES: Paths inside container. """ if len(files) < 1: return with Session() as session: try: print_wa...
[ "Download", "files", "from", "a", "running", "container", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/files.py#L43-L62
[ "def", "download", "(", "sess_id_or_alias", ",", "files", ",", "dest", ")", ":", "if", "len", "(", "files", ")", "<", "1", ":", "return", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "print_wait", "(", "'Downloading file(s) from {}...'", ...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
ls
List files in a path of a running container. \b SESSID: Session ID or its alias given when creating the session. PATH: Path inside container.
src/ai/backend/client/cli/files.py
def ls(sess_id_or_alias, path): """ List files in a path of a running container. \b SESSID: Session ID or its alias given when creating the session. PATH: Path inside container. """ with Session() as session: try: print_wait('Retrieving list of files in "{}"...'.format(p...
def ls(sess_id_or_alias, path): """ List files in a path of a running container. \b SESSID: Session ID or its alias given when creating the session. PATH: Path inside container. """ with Session() as session: try: print_wait('Retrieving list of files in "{}"...'.format(p...
[ "List", "files", "in", "a", "path", "of", "a", "running", "container", "." ]
lablup/backend.ai-client-py
python
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/files.py#L68-L99
[ "def", "ls", "(", "sess_id_or_alias", ",", "path", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "print_wait", "(", "'Retrieving list of files in \"{}\"...'", ".", "format", "(", "path", ")", ")", "kernel", "=", "session", ".", "...
a063d774fea6f4350b89498c40d3c837ec3029a7
train
main
Main function. :return: None.
src/aoiklivereload/demo/sanic_demo.py
def main(): """ Main function. :return: None. """ try: # Get the `src` directory's absolute path src_path = os.path.dirname( # `aoiklivereload` directory's absolute path os.path.dirname( # `demo` directory's absolute path ...
def main(): """ Main function. :return: None. """ try: # Get the `src` directory's absolute path src_path = os.path.dirname( # `aoiklivereload` directory's absolute path os.path.dirname( # `demo` directory's absolute path ...
[ "Main", "function", "." ]
AoiKuiyuyou/AoikLiveReload
python
https://github.com/AoiKuiyuyou/AoikLiveReload/blob/0d5adb12118a33749e6690a8165fdb769cff7d5c/src/aoiklivereload/demo/sanic_demo.py#L16-L94
[ "def", "main", "(", ")", ":", "try", ":", "# Get the `src` directory's absolute path", "src_path", "=", "os", ".", "path", ".", "dirname", "(", "# `aoiklivereload` directory's absolute path", "os", ".", "path", ".", "dirname", "(", "# `demo` directory's absolute path", ...
0d5adb12118a33749e6690a8165fdb769cff7d5c
train
get_cfg_template
Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url fro...
pyhpeimc/plat/icc.py
def get_cfg_template(auth, url, folder=None): """ Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :par...
def get_cfg_template(auth, url, folder=None): """ Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :par...
[ "Function", "takes", "no", "input", "and", "returns", "a", "list", "of", "dictionaries", "containing", "the", "configuration", "templates", "in", "the", "root", "folder", "of", "the", "icc", "configuration", "template", "library", "." ]
HPENetworking/PYHPEIMC
python
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L19-L74
[ "def", "get_cfg_template", "(", "auth", ",", "url", ",", "folder", "=", "None", ")", ":", "if", "folder", "is", "None", ":", "get_cfg_template_url", "=", "\"/imcrs/icc/confFile/list\"", "else", ":", "folder_id", "=", "get_folder_id", "(", "folder", ",", "auth"...
4fba31827573587e03a6233c7db60f188038c8e5