def __init__(self, source=None, *, descriptor=None, resources=None, id=None, name=None, title=None, description=None, licenses=None, sources=None, profile=None, homepage=None, version=None, contributors=None, keywords=None, image=None, created=None, basepath='', detector=None, onerror='ignore', trusted=False, hashing=None):
    if (source is not None):
        if (descriptor is None):
            descriptor = source
            file = system.create_file(source, basepath=basepath)
            if file.multipart:
                descriptor = {'resources': []}
                for part in file.normpath:
                    descriptor['resources'].append({'path': part})
            elif ((file.type == 'table') and (not file.compression)):
                descriptor = {'resources': [{'path': file.normpath}]}
    if isinstance(descriptor, Path):
        descriptor = str(descriptor)
    if (descriptor is None):
        trusted = True
    if helpers.is_zip_descriptor(descriptor):
        descriptor = helpers.unzip_descriptor(descriptor, 'datapackage.json')
    self.setinitial('resources', resources)
    self.setinitial('name', name)
    self.setinitial('id', id)
    self.setinitial('licenses', licenses)
    self.setinitial('profile', profile)
    self.setinitial('title', title)
    self.setinitial('description', description)
    self.setinitial('homepage', homepage)
    self.setinitial('version', version)
    self.setinitial('sources', sources)
    self.setinitial('contributors', contributors)
    self.setinitial('keywords', keywords)
    self.setinitial('image', image)
    self.setinitial('created', created)
    self.__basepath = (basepath or helpers.parse_basepath(descriptor))
    self.__detector = (detector or Detector())
    self.__onerror = onerror
    self.__trusted = trusted
    self.__hashing = hashing
    super().__init__(descriptor)
def __init__(self, source=None, *, descriptor=None, resources=None, id=None, name=None, title=None, description=None, licenses=None, sources=None, profile=None, homepage=None, version=None, contributors=None, keywords=None, image=None, created=None, basepath=, detector=None, onerror='ignore', trusted=False, hashing=None):
    if (source is not None):
        if (descriptor is None):
            descriptor = source
            file = system.create_file(source, basepath=basepath)
            if file.multipart:
                descriptor = {'resources': []}
                for part in file.normpath:
                    descriptor['resources'].append({'path': part})
            elif ((file.type == 'table') and (not file.compression)):
                descriptor = {'resources': [{'path': file.normpath}]}
    if isinstance(descriptor, Path):
        descriptor = str(descriptor)
    if (descriptor is None):
        trusted = True
    if helpers.is_zip_descriptor(descriptor):
        descriptor = helpers.unzip_descriptor(descriptor, 'datapackage.json')
    self.setinitial('resources', resources)
    self.setinitial('name', name)
    self.setinitial('id', id)
    self.setinitial('licenses', licenses)
    self.setinitial('profile', profile)
    self.setinitial('title', title)
    self.setinitial('description', description)
    self.setinitial('homepage', homepage)
    self.setinitial('version', version)
    self.setinitial('sources', sources)
    self.setinitial('contributors', contributors)
    self.setinitial('keywords', keywords)
    self.setinitial('image', image)
    self.setinitial('created', created)
    self.__basepath = (basepath or helpers.parse_basepath(descriptor))
    self.__detector = (detector or Detector())
    self.__onerror = onerror
    self.__trusted = trusted
    self.__hashing = hashing
    super().__init__(descriptor)