Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from omegaml.client.docoptparser import CommandBase
from omegaml.client.userconf import save_userconfig_from_apikey
from omegaml.client.util import get_omega
from omegaml.defaults import update_from_config
class CloudCommandBase(CommandBase):
"""
Usage:
om cloud login [] [] [options]
om cloud config [options]
Options:
--userid=USERID the userid at hub.omegaml.io (see account profile)
--apikey=APIKEY the apikey at hub.omegaml.io (see account profile)
--apiurl=URL the cloud URL [default: https://hub.omegaml.io]
"""
command = 'cloud'
def login(self):
userid = self.args.get('') or self.args.get('--userid')
apikey = self.args.get('') or self.args.get('--apikey')
api_url = self.args.get('--apiurl')
import imghdr
import pandas as pd
from omegaml.client.docoptparser import CommandBase
from omegaml.client.util import get_omega
class DatasetsCommandBase(CommandBase):
"""
Usage:
om datasets list [
from omegaml.client.docoptparser import CommandBase
from omegaml.client.util import get_omega
class ShellCommandBase(CommandBase):
"""
Usage:
om shell [options]
"""
command = 'shell'
def shell(self):
om = get_omega(self.args)
use_ipython = False
try:
import IPython
except:
self.logger.warn("you should pip install ipython for convenience")
else:
use_ipython = True
# ipython
from omegaml.client.docoptparser import CommandBase
from omegaml.client.util import get_omega
class RuntimeCommandBase(CommandBase):
"""
Usage:
om runtime model [] [] [--result=] [--param=]... [options]
om runtime script [] [...] [--async] [options]
om runtime job [] [] [--async] [options]
om runtime result [options]
om runtime ping [options]
Options:
--async don't wait for results, will print taskid
Description:
can be any valid model action like fit, predict, score,
transform, decision_function etc.
import datetime
import nbformat
from cron_descriptor import get_description
from omegaml.client.docoptparser import CommandBase
from omegaml.client.util import get_omega
class JobsCommandBase(CommandBase):
"""
Usage:
om jobs list [
from importlib import import_module
from omegaml.client.docoptparser import CommandBase
from omegaml.client.util import get_omega
class ModelsCommandBase(CommandBase):
"""
Usage:
om models put
om models list [
from omegaml.client.docoptparser import CommandBase
class CatchallCommandBase(CommandBase):
command = "catchall"
def __call__(self):
if self.args.get('--copyright'):
logger = self.logger
logger.info("(c) omega|ml by one2seven GmbH, Zurich, Switzerland, https://omegaml.io")
logger.info("third party components (c) by their respective copyright holders")
logger.info("see LICENSE and THIRDPARTY-LICENSES at https://github.com/omegaml/omegaml/")
return
self.parser.help()
import os
from omegaml.client.docoptparser import CommandBase
from omegaml.client.util import get_omega
class ScriptsCommandBase(CommandBase):
"""
Usage:
om scripts list [