Did I find the right examples for you? yes no

All Samples(257)  |  Call(0)  |  Derive(0)  |  Import(257)
File type identification using libmagic.

The magic.Magic class provides a high level API to the libmagic library.

    >>> import magic
    >>> with magic.Magic() as m:
    ...     m.id_filename('setup.py')
    ...
    'ASCII text'
(more...)

src/b/i/binwalk-HEAD/src/C/file-5.18/python/example.py   binwalk(Download)
#! /usr/bin/python
 
import magic
 
ms = magic.open(magic.NONE)

src/w/e/webpy-example-HEAD/lib/wputil.py   webpy-example(Download)
import web
import json
import magic
import tempfile
 

src/m/a/malwarehouse-HEAD/malware_sample.py   malwarehouse(Download)
import utils
import os, pwd, shutil
import magic
import hashlib
import datetime

src/d/x/dx-toolkit-HEAD/src/python/dxpy/scripts/dx_gtf_to_genes.py   dx-toolkit(Download)
import sys
 
import magic
import subprocess
import argparse

src/d/x/dx-toolkit-HEAD/src/python/dxpy/scripts/dx_gff_to_genes.py   dx-toolkit(Download)
import subprocess
 
import magic
 
parser = argparse.ArgumentParser(description='Import a local GFF file as a Spans or Genes object.')

src/d/x/dx-toolkit-HEAD/src/python/dxpy/scripts/dx_fastq_to_reads.py   dx-toolkit(Download)
 
sys.path.append('/usr/local/lib/')
import magic
import dxpy
from dxpy.compat import USING_PYTHON2

src/d/x/dx-toolkit-HEAD/src/python/dxpy/scripts/dx_bed_to_spans.py   dx-toolkit(Download)
 
# to find the magic library
import magic
import subprocess
 

src/i/n/invenio-HEAD/modules/bibcheck/lib/plugins/files.py   invenio(Download)
 
try:
    import magic
    if hasattr(magic, "from_file"):
        HAS_MAGIC = 1

src/e/a/easy-transifex-HEAD/src/transifex/transifex/resources/formats/registry.py   easy-transifex(Download)
"""
 
import magic
from django.conf import settings
from transifex.txcommon import import_to_python

src/u/n/Unveillance-HEAD/scripts/py/InformaCamUtils/j3mlogger.py   Unveillance(Download)
import re, json, os, magic
from base64 import b64encode
 
from funcs import ShellThreader, getMimeTypeFromFile, hashString
from vars import mime_types, mime_type_map

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next