def ingest(self, something, meta=None, overwrite=True):
        """ Import a given object into the package as a source. The
        object can be either a URL, a file or folder name, an open
        file handle or a HTTP returned object from urllib, urllib2 or
        requests. If ``overwrite`` is ``False``, the source file
        will be renamed until the name is not taken. """
        ingestors = list(Ingestor.analyze(something))

        if len(ingestors) != 1:
            raise ValueError("Can't ingest: %r" % something)
        ingestor = ingestors[0]

        try:
            meta = ingestor.generate_meta(meta)
            name = None
            for i in count(1):
                suffix = '-%s' % i if i > 1 else ''
                name = '%s%s.%s' % (meta['slug'], suffix, meta['extension'])
                if overwrite or not self.has(Source, name):
                    break

            source = Source(self, name)
            source.meta.update(meta)
            ingestor.store(source)
            self.save()
            return source
        finally:
            ingestor.dispose()
dataset/ETHPy150Open pudo/archivekit/archivekit/package.py/Package.ingest/original