List Mimetypes that current object can export to
540870
def export_capacities(self):
        
        return [export for cls in getmro(type(self)) if hasattr(cls, "EXPORT_TO") for export in cls.EXPORT_TO]
85210
def _as_list(obj):
    """"""
    if obj is None:
        return None
    elif isinstance(obj, string_types):
        return [obj]
    elif isinstance(obj, tuple):
        return list(obj)
    elif not hasattr(obj, '__len__'):
        return [obj]
    else:
        return obj
837060
def get_exports(client, bucket, prefix, latest=True):
    
    keys = client.list_objects_v2(
        Bucket=bucket, Prefix=prefix, Delimiter='/').get('CommonPrefixes', [])
    found = []
    years = []
    for y in keys:
        part = y['Prefix'].rsplit('/', 2)[-2]
        if not part.isdigit():
            continue
        year = int(part)
        years.append(year)

    if not years:
        return []

    years.sort(reverse=True)
    if latest:
        years = [years[0]]

    for y in years:
        keys = client.list_objects_v2(
            Bucket=bucket, Prefix="%s/%d/" % (prefix.strip('/'), y),
            Delimiter='/').get('CommonPrefixes', [])
        months = []
        for m in keys:
            part = m['Prefix'].rsplit('/', 2)[-2]
            if not part.isdigit():
                continue
            month = int(part)
            date_key = (y, month)
            months.append(month)
        months.sort(reverse=True)
        if not months:
            continue
        if latest:
            months = [months[0]]
        for m in months:
            keys = client.list_objects_v2(
                Bucket=bucket, Prefix="%s/%d/%s/" % (
                    prefix.strip('/'), y, ('%d' % m).rjust(2, '0')),
                Delimiter='/').get('CommonPrefixes', [])
            for d in keys:
                part = d['Prefix'].rsplit('/', 2)[-2]
                if not part.isdigit():
                    continue
                day = int(part)
                date_key = (y, m, day)
                found.append(date_key)
    found.sort(reverse=True)
    if latest:
        found = [found[0]]
    return found
531213
def list_to_cells(lst):
    '''
    '''
    cells = '"cells": ['
    for cell in lst:
        to_add = '{"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["' + '\\n","'.join(cell) + '"]},'
        cells += to_add

    cells = cells[:-1] + '],'

    nb = '{' + cells + '"metadata": {"header": "HEADLESS", "kernelspec": {"display_name" : "python", "language": "", "name": "python"}, "language":"python"'

    return nbformat.writes(nbformat.reads(nb, as_version=4)).encode('utf-8')
1280924
def list_files(path, extension=".cpp", exclude="S.cpp"):
    """"""
    return ["%s/%s" % (path, f) for f in listdir(path) if f.endswith(extension) and (not f.endswith(exclude))]
273639
def filter_extant_exports(client, bucket, prefix, days, start, end=None):
    
    end = end or datetime.now()
    # days = [start + timedelta(i) for i in range((end-start).days)]
    try:
        tag_set = client.get_object_tagging(Bucket=bucket, Key=prefix).get('TagSet', [])
    except ClientError as e:
        if e.response['Error']['Code'] != 'NoSuchKey':
            raise
        tag_set = []
    tags = {t['Key']: t['Value'] for t in tag_set}

    if 'LastExport' not in tags:
        return sorted(days)
    last_export = parse(tags['LastExport'])
    if last_export.tzinfo is None:
        last_export = last_export.replace(tzinfo=tzutc())
    return [d for d in sorted(days) if d > last_export]
1174963
def types(self):
        
        data = clips.data.DataObject(self._env)

        lib.EnvSlotTypes(self._env, self._cls, self._name, data.byref)

        return tuple(data.value) if isinstance(data.value, list) else ()
487421
def dtypes(self):
        
        return [(str(f.name), f.dataType.simpleString()) for f in self.schema.fields]
604047
def _SerializeEntries(entries):
  """"""

  output = []
  for python_format, wire_format, type_descriptor in entries:

    if wire_format is None or (python_format and
                               type_descriptor.IsDirty(python_format)):
      wire_format = type_descriptor.ConvertToWireFormat(python_format)

    precondition.AssertIterableType(wire_format, bytes)
    output.extend(wire_format)

  return b"".join(output)
373910
def process_object(obj):
    ""
    invalid_options = OptsMagic.process_element(obj)
    if invalid_options: return invalid_options
    OutputMagic.info(obj)
680816
def get_export_table(self):
        """"""
        symbols = self.binary.DIRECTORY_ENTRY_EXPORT.symbols
        names = AttrsGetter(symbols, join=False).name
        return names
1037004
def export(self):
        
        data = {}
        for key in self._specification:
            data[key] = self[key]
        return data
210843
def _get_type_list(self, props):
        """"""
        type_list = []
        for k, v in list(props.items()):
            t = self._get_property_type(v)
            if t is not None:
                type_list.append(t)
        return sorted(type_list)
841695
def _generate_base_mimetypes(self):
        
        for t in self.type_instances:
            if t.custom_mime:
                continue

            yield t.mime, (t, None, None)
1189405
def globals(self):
        """"""
        try:
            return vars(__import__(self.module, fromlist=self.module.split('.')))
        except ImportError:
            if self.warn_import:
                warnings.warn(ImportWarning(
                    'Cannot import module {} for SerializableFunction. Restricting to builtins.'.format(self.module)
                ))
            return {'__builtins__': __builtins__}
650159
def get(self, objectType, *args, **coolArgs) :
		""""""
		
		ret = []
		for e in self._makeLoadQuery(objectType, *args, **coolArgs).iterRun() :
			if issubclass(objectType, pyGenoRabaObjectWrapper) :
				ret.append(objectType(wrapped_object_and_bag = (e, self.bagKey)))
			else :
				ret.append(e)

		return ret
1173068
def getManagedObjects(self, objectPath):
        
        d = {}

        for p in sorted(self.exports.keys()):
            if not p.startswith(objectPath) or p == objectPath:
                continue
            o = self.exports[p]
            i = {}
            d[p] = i
            for iface in o.getInterfaces():
                i[iface.name] = o.getAllProperties(iface.name)

        return d