code
stringlengths
1
18.2k
def convert_numpy_type(cls, dtype): """Convert a numpy dtype into a Column datatype. Only handles common types. Implemented as a function to decouple from numpy """ m = { 'int64': cls.DATATYPE_INTEGER64, 'float64': cls.DATATYPE_FLOAT, 'object': cls.DATATYPE_TEXT # Hack. Pandas makes strings into object. } t = m.get(dty...
def dict(self): """A dict that holds key/values for all of the properties in the object. :return: """ d = {p.key: getattr(self, p.key) for p in self.__mapper__.attrs if p.key not in ('table', 'stats', '_codes', 'data')} if not d: raise Exception(self.__dict__) d['schema_type'] = self.schema_type if self.data: # Copy da...
def nonull_dict(self): """Like dict, but does not hold any null values. :return: """ return {k: v for k, v in six.iteritems(self.dict) if v and k != '_codes'}
def mangle_name(name): """Mangles a column name to a standard form, remoing illegal characters. :param name: :return: """ import re try: return re.sub('_+', '_', re.sub('[^\w_]', '_', name).lower()).rstrip('_') except TypeError: raise TypeError( 'Trying to mangle name with invalid type of: ' + str(type(name)))
def reverse_code_map(self): """Return a map from a code ( usually a string ) to the shorter numeric value""" return {c.value: (c.ikey if c.ikey else c.key) for c in self.codes}
def expanded_transform(self): """Expands the transform string into segments """ segments = self._expand_transform(self.transform) if segments: segments[0]['datatype'] = self.valuetype_class for s in segments: s['column'] = self else: segments = [self.make_xform_seg(datatype=self.valuetype_class, column=self)] # If we w...
def before_insert(mapper, conn, target): """event.listen method for Sqlalchemy to set the seqience_id for this object and create an ObjectNumber value for the id_""" # from identity import ObjectNumber # assert not target.fk_vid or not ObjectNumber.parse(target.fk_vid).revision if target.sequence_id is None: from ambry...
def before_update(mapper, conn, target): """Set the column id number based on the table number and the sequence id for the column.""" assert target.datatype or target.valuetype target.name = Column.mangle_name(target.name) Column.update_number(target)
def spawnProcess(processProtocol, executable, args=(), env={}, path=None, uid=None, gid=None, usePTY=0, packages=()): """Launch a process with a particular Python environment. All arguments as to reactor.spawnProcess(), except for the addition of an optional packages iterable. This should be of strings naming packages ...
def spawnPythonProcess(processProtocol, args=(), env={}, path=None, uid=None, gid=None, usePTY=0, packages=()): """Launch a Python process All arguments as to spawnProcess(), except the executable argument is omitted. """ return spawnProcess(processProtocol, sys.executable, args, env, path, uid, gid, usePTY, packages)
def _runable_for_event(f, tag, stage): """Loot at the event property for a function to see if it should be run at this stage. """ if not hasattr(f, '__ambry_event__'): return False f_tag, f_stage = f.__ambry_event__ if stage is None: stage = 0 if tag != f_tag or stage != f_stage: return False return True
def load_obj_from_path(import_path, prefix=None, ld=dict()): """ import a python object from an import path `import_path` - a python import path. For instance: mypackage.module.func or mypackage.module.class `prefix` (str) - a value to prepend to the import path if it isn't already there. For instance: load_obj_from_pa...
import path." " An example import path is something like: module.obj"), dict(import_path=import_path, **ld), InvalidImportPath) try: mod = importlib.import_module(path) except ImportError: newpath = path.replace(prefix, '', 1).lstrip('.') log.debug( "Could not load import path. Trying a different one", extra=dict(oldpa...
def artifact_quality(self, artifact_quality): """ Sets the artifact_quality of this ArtifactRest. :param artifact_quality: The artifact_quality of this ArtifactRest. :type: str """ allowed_values = ["NEW", "VERIFIED", "TESTED", "DEPRECATED", "BLACKLISTED", "DELETED", "TEMPORARY"] if artifact_quality not in allowed_valu...
def _get_sqlite_columns(connection, table): """ Returns list of tuple containg columns of the table. Args: connection: sqlalchemy connection to sqlite database. table (str): name of the table Returns: list of (name, datatype, position): where name is column name, datatype is python type of the column, position is ordin...
row[2] try: datatype = SQL_TO_PYTHON_TYPES[datatype] except KeyError: raise Exception( 'Do not know how to convert {} sql datatype to python data type.' .format(datatype)) ret.append((name, datatype, position)) return ret
def partition(self): """For partition urltypes, return the partition specified by the ref """ if self.urltype != 'partition': return None return self._bundle.library.partition(self.url)
def datafile(self): """Return an MPR datafile from the /ingest directory of the build filesystem""" from ambry_sources import MPRowsFile if self._datafile is None: if self.urltype == 'partition': self._datafile = self.partition.datafile else: self._datafile = MPRowsFile(self._bundle.build_ingest_fs, self.name) return s...
def spec(self): """Return a SourceSpec to describe this source""" from ambry_sources.sources import SourceSpec d = self.dict d['url'] = self.url # Will get the URL twice; once as ref and once as URL, but the ref is ignored return SourceSpec(**d)
def account(self): """Return an account record, based on the host in the url""" from ambry.util import parse_url_to_dict d = parse_url_to_dict(self.url) return self._bundle.library.account(d['netloc'])
def update_table(self, unknown_type='str'): """Update the source table from the datafile""" from ambry_sources.intuit import TypeIntuiter st = self.source_table if self.reftype == 'partition': for c in self.partition.table.columns: st.add_column(c.sequence_id, source_header=c.name, dest_header=c.name, datatype=c.dataty...
def update_spec(self): """Update the source specification with information from the row intuiter, but only if the spec values are not already set. """ if self.datafile.exists: with self.datafile.reader as r: self.header_lines = r.info['header_rows'] self.comment_lines = r.info['comment_rows'] self.start_line = r.info['...
def dict(self): """A dict that holds key/values for all of the properties in the object. :return: """ SKIP_KEYS = ('_source_table', '_dest_table', 'd_vid', 't_vid', 'st_id', 'dataset', 'hash', 'process_records') return OrderedDict([(k, getattr(self, k)) for k in self.properties if k not in SKIP_KEYS])
def get_runconfig(path=None, root=None, db=None): """Load the main configuration files and accounts file. Debprecated. Use load() """ return load(path, root=root, db=db)
def load(path=None, root=None, db=None, load_user=True): "Load all of the config files. " config = load_config(path, load_user=load_user) remotes = load_remotes(path, load_user=load_user) # The external file overwrites the main config if remotes: if not 'remotes' in config: config.remotes = AttrDict() for k, v in remot...
def find_config_file(file_name, extra_path=None, load_user=True): """ Find a configuration file in one of these directories, tried in this order: - A path provided as an argument - A path specified by the AMBRY_CONFIG environmenal variable - ambry in a path specified by the VIRTUAL_ENV environmental variable - ~/ambry ...
def load_accounts(extra_path=None, load_user=True): """Load the yaml account files :param load_user: :return: An `AttrDict` """ from os.path import getmtime try: accts_file = find_config_file(ACCOUNTS_FILE, extra_path=extra_path, load_user=load_user) except ConfigurationError: accts_file = None if accts_file is not Non...
def load_remotes(extra_path=None, load_user=True): """Load the YAML remotes file, which sort of combines the Accounts file with part of the remotes sections from the main config :return: An `AttrDict` """ from os.path import getmtime try: remotes_file = find_config_file(REMOTES_FILE, extra_path=extra_path, load_user=lo...
def load_config(path=None, load_user=True): """ Load configuration information from a config directory. Tries directories in this order: - A path provided as an argument - A path specified by the AMBRY_CONFIG environmenal variable - ambry in a path specified by the VIRTUAL_ENV environmental variable - /etc/ambry - ~/am...
def update_config(config, use_environ=True): """Update the configuration from environmental variables. Updates: - config.library.database from the AMBRY_DB environmental variable. - config.library.filesystem_root from the AMBRY_ROOT environmental variable. - config.accounts.password from the AMBRY_PASSWORD environmenta...
configured under the library to the remotes section try: for k, v in config.library.remotes.items(): config.remotes[k] = { 'url': v } del config.library['remotes'] except KeyError as e: pass # Then move any of the account entries that are linked to remotes into the remotes. try: for k, v in config.remotes.items(): if '...
in config.filesystem: config.filesystem[k] = v config.modtime = max(config.loaded[1], config.remotes.loaded[1], config.accounts.loaded[1])
def normalize_dsn_or_dict(d): """Clean up a database DSN, or dict version of a DSN, returning both the cleaned DSN and dict version""" if isinstance(d, dict): try: # Convert from an AttrDict to a real dict d = d.to_dict() except AttributeError: pass # Already a real dict config = d dsn = None elif isinstance(d, string_...
raise ConfigurationError("Sqlite DSNs with a path must have 3 or 4 slashes.") path = path[1:] config = dict( server=None, username=None, password=None, driver=driver, dbname=path ) else: d = parse_url_to_dict(dsn) config = dict( server=d['hostname'], dbname=d['path'].strip('/'), driver=d['scheme'], password=d.get('pass...
abs dir is 4 dsn = '{}://{}{}'.format(d['driver'], host_part, path_part) return config, dsn
def create_new_product_version(self, **kwargs): """ Create a new ProductVersion for a Product This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(resp...
def get_build_configuration_sets(self, id, **kwargs): """ Gets build configuration sets associated with a product version This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_functio...
def update_build_configuration_sets(self, id, **kwargs): """ This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.update...
def execute_command(cmd, execute, echo=True): """Execute a command in shell or just print it if execute is False""" if execute: if echo: print("Executing: " + cmd) return os.system(cmd) else: print(cmd) return 0
def set_log_level(level): """Sets the desired log level.""" lLevel = level.lower() unrecognized = False if (lLevel == 'debug-all'): loglevel = logging.DEBUG elif (lLevel == 'debug'): loglevel = logging.DEBUG elif (lLevel == 'info'): loglevel = logging.INFO elif (lLevel == 'warning'): loglevel = logging.WARNING elif (lL...
#TODO ref: use external log config fh = logging.FileHandler('builder.log') fh.setLevel(loglevel) fh.setFormatter(formatter) logging.getLogger('').addHandler(fh)
def parse_conf_args(argv): """Parse command line options into {section: (option, key)} which can be used for overlaying on top of config :param argv: list of argumets to be parsed :return: Dictionary in the following format: {section: (option, key)}""" args = {} for rarg in argv: if re.match("^--.*", rarg): arg = rarg....
def required(field): """Decorator that checks if return value is set, if not, raises exception. """ def wrap(f): def wrappedf(*args): result = f(*args) if result is None or result == "": raise Exception( "Config option '%s' is required." % field) else: return result return wrappedf return wrap
def split_unescape(s, delim, escape='\\', unescape=True): """ >>> split_unescape('foo,bar', ',') ['foo', 'bar'] >>> split_unescape('foo$,bar', ',', '$') ['foo,bar'] >>> split_unescape('foo$$,bar', ',', '$', unescape=True) ['foo$', 'bar'] >>> split_unescape('foo$$,bar', ',', '$', unescape=False) ['foo$$', 'bar'] >>> spl...
def render(self, template_name, variables=None): """ Render a template with the passed variables. """ if variables is None: variables = {} template = self._engine.get_template(template_name) return template.render(**variables)
def render_source(self, source, variables=None): """ Render a source with the passed variables. """ if variables is None: variables = {} template = self._engine.from_string(source) return template.render(**variables)
def construct_re(url_template, match_whole_str=False, converters=None, default_converter='string', anonymous=False): ''' url_template - str or unicode representing template Constructed pattern expects urlencoded string! returns (compiled re pattern, dict {url param name: [converter name, converter args (str)]}, list of...
for re chars in part result += re.escape(urlquote(part)) builder_params.append(part) continue is_converter = _converter_pattern.match(part) if is_converter: groups = is_converter.groupdict() converter_name = groups['converter'] or default_converter conv_object = init_converter(converters[converter_name], groups['args']...
def match(self, path, **kw): ''' path - str (urlencoded) ''' m = self._pattern.match(path) if m: kwargs = m.groupdict() # convert params for url_arg_name, value_urlencoded in kwargs.items(): conv_obj = self._url_params[url_arg_name] unicode_value = unquote(value_urlencoded) if isinstance(unicode_value, six.binary_type)...
def export(bundle, force=False, force_restricted=False): """ Exports bundle to ckan instance. Args: bundle (ambry.bundle.Bundle): force (bool, optional): if True, ignore existance error and continue to export. force_restricted (bool, optional): if True, then export restricted bundles as private (for debugging purposes)...
such access. raise UnpublishedAccessError( '{} dataset can not be published because of {} access.' .format(bundle.dataset.vid, bundle.dataset.config.metadata.about.access)) elif access == 'public': # The default permission of the CKAN allows to edit and create dataset without logging in. But # admin of the certain CKAN...
'logged_in', 'domain_object': bundle.dataset.vid.lower(), 'roles': []} ] organization_users = ckan.action.organization_show(id=CKAN_CONFIG.organization)['users'] for user in organization_users: user_roles.append({ 'user': user['id'], 'domain_object': bundle.dataset.vid.lower(), 'roles': ['editor']}), for role in user_r...
def is_exported(bundle): """ Returns True if dataset is already exported to CKAN. Otherwise returns False. """ if not ckan: raise EnvironmentError(MISSING_CREDENTIALS_MSG) params = {'q': 'name:{}'.format(bundle.dataset.vid.lower())} resp = ckan.action.package_search(**params) return len(resp['results']) > 0
def _convert_bundle(bundle): """ Converts ambry bundle to dict ready to send to CKAN API. Args: bundle (ambry.bundle.Bundle): bundle to convert. Returns: dict: dict to send to CKAN to create dataset. See http://docs.ckan.org/en/latest/api/#ckan.logic.action.create.package_create """ # shortcut for metadata meta = bundl...
def _convert_partition(partition): """ Converts partition to resource dict ready to save to CKAN. """ # http://docs.ckan.org/en/latest/api/#ckan.logic.action.create.resource_create # convert bundle to csv. csvfile = six.StringIO() writer = unicodecsv.writer(csvfile) headers = partition.datafile.headers if headers: writ...
def _convert_schema(bundle): """ Converts schema of the dataset to resource dict ready to save to CKAN. """ # http://docs.ckan.org/en/latest/api/#ckan.logic.action.create.resource_create schema_csv = None for f in bundle.dataset.files: if f.path.endswith('schema.csv'): contents = f.unpacked_contents if isinstance(conte...
def _convert_external(bundle, name, external): """ Converts external documentation to resource dict ready to save to CKAN. """ # http://docs.ckan.org/en/latest/api/#ckan.logic.action.create.resource_create ret = { 'package_id': bundle.dataset.vid.lower(), 'url': external.url, 'description': external.description, 'name'...
def create_build_configuration_process(repository, revision, **kwargs): """ Create a new BuildConfiguration. BuildConfigurations represent the settings and configuration required to run a build of a specific version of the associated Project's source code. If a ProductVersion ID is provided, the BuildConfiguration will...
def create_repository_configuration(repository, no_sync=False): """ Create a new RepositoryConfiguration. If the provided repository URL is for external repository, it is cloned into internal one. :return BPM Task ID of the new RepositoryConfiguration creation """ repo = create_repository_configuration_raw(repository, ...
def wait_for_repo_creation(task_id, retry=30): """ Using polling check if the task finished """ success_event_types = ("RC_CREATION_SUCCESS", ) error_event_types = ("RC_REPO_CREATION_ERROR", "RC_REPO_CLONE_ERROR", "RC_CREATION_ERROR") while retry > 0: bpm_task = get_bpm_task_by_id(task_id) if contains_event_type(bpm_ta...
def count(self): ''' A count based on `count_field` and `format_args`. ''' args = self.format_args if args is None or \ (isinstance(args, dict) and self.count_field not in args): raise TypeError("count is required") return args[self.count_field] if isinstance(args, dict) else args
def generate_sources_zip(milestone_id=None, output=None): """ Generate a sources archive for given milestone id. """ if not is_input_valid(milestone_id, output): logging.error("invalid input") return 1 create_work_dir(output) download_sources_artifacts(milestone_id, output) create_zip(output)
def get_repository_configuration(id): """ Retrieve a specific RepositoryConfiguration """ response = utils.checked_api_call(pnc_api.repositories, 'get_specific', id=id) if response: return response.content
def update_repository_configuration(id, external_repository=None, prebuild_sync=None): """ Update an existing RepositoryConfiguration with new information """ to_update_id = id rc_to_update = pnc_api.repositories.get_specific(id=to_update_id).content if external_repository is None: external_repository = rc_to_update.ex...
def list_repository_configurations(page_size=200, page_index=0, sort="", q=""): """ List all RepositoryConfigurations """ response = utils.checked_api_call(pnc_api.repositories, 'get_all', page_size=page_size, page_index=page_index, sort=sort, q=q) if response: return utils.format_json_list(response.content)
def search_repository_configuration(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url """ content = search_repository_configuration_raw(url, page_size, page_index, sort) if content: return utils.format_json_list(content)
def search_repository_configuration_raw(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url """ response = utils.checked_api_call(pnc_api.repositories, 'search', page_size=page_size, page_index=page_index, sort=sort, search=url) if response: return respo...
def match_repository_configuration(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url with exact match """ content = match_repository_configuration_raw(url, page_size, page_index, sort) if content: return utils.format_json_list(content)
def render(self): '''Proxy method to form's environment render method''' return self.env.template.render(self.template, form=self)
def accept(self, data): ''' Try to accpet MultiDict-like object and return if it is valid. ''' self.raw_data = MultiDict(data) self.errors = {} for field in self.fields: if field.writable: self.python_data.update(field.accept()) else: for name in field.field_names: # readonly field subfield = self.get_field(name) value...
def get_data(self, compact=True): ''' Returns data representing current state of the form. While Form.raw_data may contain alien fields and invalid data, this method returns only valid fields that belong to this form only. It's designed to pass somewhere current state of the form (as query string or by other means). ''...
def add_configuration(self, id, **kwargs): """ Adds a configuration to the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response)...
def build(self, id, **kwargs): """ Builds the Configurations for the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >...
defined dependencies has been update; IMPLICIT_DEPENDENCY_CHECK: check if any captured dependency has been updated; :return: BuildConfigSetRecordSingleton If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.build_with_htt...
def build_versioned(self, id, **kwargs): """ Builds the configurations for the Specified Set with an option to specify exact revision of a BC This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> ...
rebuild all the configurations in the set; EXPLICIT_DEPENDENCY_CHECK: check if any of user defined dependencies has been update; IMPLICIT_DEPENDENCY_CHECK: check if any captured dependency has been updated; :return: BuildConfigSetRecordSingleton If the method is called asynchronously, returns the request thread. """ kw...
def delete_specific(self, id, **kwargs): """ Removes a specific Build Configuration Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) ...
def get_all_build_config_set_records(self, id, **kwargs): """ Get all build config set execution records associated with this build config set, returns empty list if none are found This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be in...
data
def get_build_records(self, id, **kwargs): """ Gets all build records associated with the contained build configurations This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function...
def get_configurations(self, id, **kwargs): """ Gets the Configurations for the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(resp...
def remove_configuration(self, id, config_id, **kwargs): """ Removes a configuration from the specified config set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(respo...
def update_configurations(self, id, **kwargs): """ This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.update_configura...
def pluginPackagePaths(name): """ Return a list of additional directories which should be searched for modules to be included as part of the named plugin package. @type name: C{str} @param name: The fully-qualified Python name of a plugin package, eg C{'twisted.plugins'}. @rtype: C{list} of C{str} @return: The absolute...
you create a master plugin package which has some other kind of # __init__ (eg, __init__.pyc) it will be incorrectly treated as a # supplementary plugin directory. return [ os.path.abspath(os.path.join(x, *package)) for x in sys.path if not os.path.exists(os.path.join(x, *package + ['__init__.py']))]
def storage_method(func): '''Calls decorated method with VersionedStorage as self''' def wrap(self, *args, **kwargs): return func(self._root_storage, *args, **kwargs) return wrap
def render(self, template_name, **kw): 'Interface method called from `Template.render`' return self.env.get_template(template_name).render(**kw)
def cancel_all_builds_in_group(self, id, **kwargs): """ Cancel all builds running in the build group This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> ppri...
def get_all_for_bc(self, id, **kwargs): """ Gets running Build Records for a specific Build Configuration. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>...
if kwargs.get('callback'): return self.get_all_for_bc_with_http_info(id, **kwargs) else: (data) = self.get_all_for_bc_with_http_info(id, **kwargs) return data
def get_all_for_bc_set_record(self, id, **kwargs): """ Gets running Build Records for a specific Build Configuration Set Record. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_...
kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.get_all_for_bc_set_record_with_http_info(id, **kwargs) else: (data) = self.get_all_for_bc_set_record_with_http_info(id, **kwargs) return data
def dictmapper(typename, mapping): """ A factory to create `namedtuple`-like classes from a field-to-dict-path mapping:: Person = dictmapper({'person':('person','name')}) example_dict = {'person':{'name':'John'}} john = Person(example_dict) assert john.name == 'John' If a function is specified as a mapping value instea...
type(typename, tuple(), prop_mapping)
def ctor_args(self): """Return arguments for constructing a copy""" return dict( config=self._config, search=self._search, echo=self._echo, read_only=self.read_only )
def sync_config(self, force=False): """Sync the file config into the library proxy data in the root dataset """ from ambry.library.config import LibraryConfigSyncProxy lcsp = LibraryConfigSyncProxy(self) lcsp.sync(force=force)
def init_debug(self): """Initialize debugging features, such as a handler for USR2 to print a trace""" import signal def debug_trace(sig, frame): """Interrupt running process, and provide a python prompt for interactive debugging.""" self.log('Trace signal received') self.log(''.join(traceback.format_stack(frame))) sig...
def resolve_object_number(self, ref): """Resolve a variety of object numebrs to a dataset number""" if not isinstance(ref, ObjectNumber): on = ObjectNumber.parse(ref) else: on = ref ds_on = on.as_dataset return ds_on
def dataset(self, ref, load_all=False, exception=True): """Return all datasets""" return self.database.dataset(ref, load_all=load_all, exception=exception)
def new_bundle(self, assignment_class=None, **kwargs): """ Create a new bundle, with the same arguments as creating a new dataset :param assignment_class: String. assignment class to use for fetching a number, if one is not specified in kwargs :param kwargs: :return: """ if not ('id' in kwargs and bool(kwargs['id'])) o...