def generate_meta(self, meta):
        """ Set up some generic metadata for the resource, based on
        the available file name, HTTP headers etc. """
        meta = meta or {}
        for key, value in self.meta.items():
            if key not in meta:
                meta[key] = value
        if 'source_file' not in meta and self._file_name:
            meta['source_file'] = self._file_name

        if not meta.get('name'):
            if meta.get('source_url') and len(meta.get('source_url')):
                path = meta['source_url']
                try:
                    path = urlparse(path).path
                except:
                    pass
                meta['name'] = path
            elif meta.get('source_file') and len(meta.get('source_file')):
                meta['name'] = meta['source_file']
        name, slug, ext = make_secure_filename(meta.get('name'))
        meta['name'] = name
        if not meta.get('slug'):
            meta['slug'] = slug
        if not meta.get('extension'):
            meta['extension'] = ext
        if not meta.get('mime_type') and 'http_headers' in meta:
            mime_type = meta.get('http_headers').get('content_type')
            if ['application/octet-stream', 'text/plain'] not in mime_type:
                meta['mime_type'] = mime_type
                ext = mimetypes.guess_extension(mime_type)
                if ext is not None:
                    meta['extension'] = ext.strip('.')
        elif not meta.get('mime_type') and meta.get('name'):
            mime_type, encoding = mimetypes.guess_type(meta.get('name'))
            meta['mime_type'] = mime_type

        if meta.get('extension'):
            meta['extension'] = slugify(meta.get('extension'))
        return meta
dataset/ETHPy150Open pudo/archivekit/archivekit/ingest.py/Ingestor.generate_meta/swapped operands of `not in`