Check whether Python C extension ``cew`` can be imported.

        Return ``True`` on failure and ``False`` on success.

        :rtype: bool
174179
def check_cew(cls):
        
        if gf.can_run_c_extension("cew"):
            gf.print_success(u"aeneas.cew     AVAILABLE")
            return False
        gf.print_warning(u"aeneas.cew     NOT AVAILABLE")
        gf.print_info(u"  You can still run aeneas but it will be a bit slower")
        gf.print_info(u"  Please refer to the installation documentation for details")
        return True
162056
def universal_import(imports, imp_from=None, target=""):
    """"""
    importmap = []  # [((imp | old_imp, imp, version_check), imp_as), ...]
    for imps in imports:
        if len(imps) == 1:
            imp, imp_as = imps[0], imps[0]
        else:
            imp, imp_as = imps
        if imp_from is not None:
            imp = imp_from + "./" + imp  # marker for from ... import ...
        old_imp = None
        path = imp.split(".")
        for i in reversed(range(1, len(path) + 1)):
            base, exts = ".".join(path[:i]), path[i:]
            clean_base = base.replace("/", "")
            if clean_base in py3_to_py2_stdlib:
                old_imp, version_check = py3_to_py2_stdlib[clean_base]
                if exts:
                    old_imp += "."
                    if "/" in base and "/" not in old_imp:
                        old_imp += "/"  # marker for from ... import ...
                    old_imp += ".".join(exts)
                break
        if old_imp is None:
            paths = (imp,)
        elif not target:  # universal compatibility
            paths = (old_imp, imp, version_check)
        elif get_target_info_len2(target) >= version_check:  # if lowest is above, we can safely use new
            paths = (imp,)
        elif target.startswith("2"):  # "2" and "27" can safely use old
            paths = (old_imp,)
        elif get_target_info(target) < version_check:  # "3" should be compatible with all 3+
            paths = (old_imp, imp, version_check)
        else:  # "35" and above can safely use new
            paths = (imp,)
        importmap.append((paths, imp_as))

    stmts = []
    for paths, imp_as in importmap:
        if len(paths) == 1:
            more_stmts = single_import(paths[0], imp_as)
            stmts.extend(more_stmts)
        else:
            first, second, version_check = paths
            stmts.append("if _coconut_sys.version_info < " + str(version_check) + ":")
            first_stmts = single_import(first, imp_as)
            first_stmts[0] = openindent + first_stmts[0]
            first_stmts[-1] += closeindent
            stmts.extend(first_stmts)
            stmts.append("else:")
            second_stmts = single_import(second, imp_as)
            second_stmts[0] = openindent + second_stmts[0]
            second_stmts[-1] += closeindent
            stmts.extend(second_stmts)
    return "\n".join(stmts)
1335484
def ispymodule(self):
        ''''''
        if self.isdir():
            return os.path.isfile(os.path.join(self, '__init__.py'))
        elif self.isfile():
            return self.endswith('.py')
172311
def available(self):
        

        for module_name in self.packages:
            if importlib.util.find_spec(module_name):
                return True
        return False
1167592
def check_import():
    
    try:
        import aeneas
        print_success(u"aeneas         OK")
        return False
    except ImportError:
        print_error(u"aeneas         ERROR")
        print_info(u"  Unable to load the aeneas Python package")
        print_info(u"  This error is probably caused by:")
        print_info(u"    A. you did not download/git-clone the aeneas package properly; or")
        print_info(u"    B. you did not install the required Python packages:")
        print_info(u"      1. BeautifulSoup4")
        print_info(u"      2. lxml")
        print_info(u"      3. numpy")
    except Exception as e:
        print_error(e)
    return True
703910
def is_artifact(self):
        # type: () -> bool
        
        from pipenv.patched.notpip._internal.vcs import vcs

        if self.scheme in vcs.all_schemes:
            return False

        return True
1155931
def extension_supported(request, extension_name):
    """"""
    for extension in list_extensions(request):
        if extension.name == extension_name:
            return True
    return False
1156973
def is_installable_file(path):
    """"""
    from .vendor.pip_shims.shims import is_installable_dir, is_archive_file
    from .patched.notpip._internal.utils.packaging import specifiers
    from ._compat import Path

    if hasattr(path, "keys") and any(
        key for key in path.keys() if key in ["file", "path"]
    ):
        path = urlparse(path["file"]).path if "file" in path else path["path"]
    if not isinstance(path, six.string_types) or path == "*":
        return False

    # If the string starts with a valid specifier operator, test if it is a valid
    # specifier set before making a path object (to avoid breaking windows)
    if any(path.startswith(spec) for spec in "!=<>~"):
        try:
            specifiers.SpecifierSet(path)
        # If this is not a valid specifier, just move on and try it as a path
        except specifiers.InvalidSpecifier:
            pass
        else:
            return False

    if not os.path.exists(os.path.abspath(path)):
        return False

    lookup_path = Path(path)
    absolute_path = "{0}".format(lookup_path.absolute())
    if lookup_path.is_dir() and is_installable_dir(absolute_path):
        return True

    elif lookup_path.is_file() and is_archive_file(absolute_path):
        return True

    return False
1367696
def __is_file_to_be_busted(self, filepath):
        
        if not self.extensions:
            return True
        return Path(filepath).suffix in self.extensions if filepath else False
52246
def is_appendable(self):
        """"""
        # TODO: check other formats
        return not (self.is_lsm or self.is_stk or self.is_imagej or
                    self.is_fluoview or self.is_micromanager)
1134846
def can_import(self, file_uris, current_doc=None):
        
        if len(file_uris) <= 0:
            return False
        for file_uri in file_uris:
            file_uri = self.fs.safe(file_uri)
            if not self.check_file_type(file_uri):
                return False
        return True
1362844
private boolean addNodeIfNotAlreadyIncluded(T thisImport,
      LinkedList<T> imports, Set<T> alreadyIncludedImports) {
    if (alreadyIncludedImports.contains(thisImport)) {
      return false;
    }
    imports.add(thisImport);
    alreadyIncludedImports.add(thisImport);
    return true;
  }
745656
def is_np_compat():
    
    curr = ctypes.c_bool()
    check_call(_LIB.MXIsNumpyCompatible(ctypes.byref(curr)))
    return curr.value
672467
def _compute_mfcc_c_extension(self):
        
        self.log(u"Computing MFCCs using C extension...")
        try:
            self.log(u"Importing cmfcc...")
            import aeneas.cmfcc.cmfcc
            self.log(u"Importing cmfcc... done")
            self.__mfcc = (aeneas.cmfcc.cmfcc.compute_from_data(
                self.audio_file.audio_samples,
                self.audio_file.audio_sample_rate,
                self.rconf[RuntimeConfiguration.MFCC_FILTERS],
                self.rconf[RuntimeConfiguration.MFCC_SIZE],
                self.rconf[RuntimeConfiguration.MFCC_FFT_ORDER],
                self.rconf[RuntimeConfiguration.MFCC_LOWER_FREQUENCY],
                self.rconf[RuntimeConfiguration.MFCC_UPPER_FREQUENCY],
                self.rconf[RuntimeConfiguration.MFCC_EMPHASIS_FACTOR],
                self.rconf[RuntimeConfiguration.MFCC_WINDOW_LENGTH],
                self.rconf[RuntimeConfiguration.MFCC_WINDOW_SHIFT]
            )[0]).transpose()
            self.log(u"Computing MFCCs using C extension... done")
            return (True, None)
        except Exception as exc:
            self.log_exc(u"An unexpected error occurred while running cmfcc", exc, False, None)
        return (False, None)
121860
def _is_allowed(attr, *args):
    
    for backend in _get_backends():
        try:
            if getattr(backend, attr)(*args):
                return True
        except AttributeError:
            raise NotImplementedError("%s.%s.%s() not implemented" % (
                backend.__class__.__module__, backend.__class__.__name__, attr)
            )
    return False
818088
def register_backend(mimetype, module, extensions=None):
    
    if mimetype in MIMETYPE_TO_BACKENDS:
        warn("overwriting %r mimetype which was already set" % mimetype)
    MIMETYPE_TO_BACKENDS[mimetype] = module
    if extensions is None:
        try:
            ext = _MIMETYPES_TO_EXT[mimetype]
        except KeyError:
            raise KeyError(
                "mimetypes module has no extension associated "
                "with %r mimetype; use 'extensions' arg yourself" % mimetype)
        assert ext, ext
        EXTS_TO_MIMETYPES[ext] = mimetype
    else:
        if not isinstance(extensions, (list, tuple, set, frozenset)):
            raise TypeError("invalid extensions type (got %r)" % extensions)
        for ext in set(extensions):
            ext = ext if ext.startswith('.') else '.' + ext
            assert ext, ext
            EXTS_TO_MIMETYPES[ext] = mimetype
91274
def make_non_magical_flask_import(flask_ext_name):
    ''''''
    match = re.match(r'flask\.ext\.(.*)', flask_ext_name)
    if match is None:
        raise LookupError("Module name `{}` doesn't match"
                          "`flask.ext` style import.")
    from_name = match.group(1)
    actual_module_name = 'flask_{}'.format(from_name)
    return actual_module_name