Check for pindel installation on machine.
    :param config: (dict) information from yaml(items[0]['config'])
    :returns: (boolean) if pindel is installed
194473
def is_installed(config):
    
    try:
        config_utils.get_program("pindel2vcf", config)
        config_utils.get_program("pindel", config)
        return True
    except config_utils.CmdNotFound:
        return False
1202613
def is_installed(self, bot_name):
        
        self.check_bots_ready()
        return any(b.name == bot_name for b in self.bots.values())
407407
def is_registered_app(self, app):
        ''''''
        if app is None:
            return False
        if isinstance(app, AppConfig):
            app = app.name
        return app in self.registered_apps
654418
def detect_config(self):
        """"""
        default_files = ("config.json", "config.yml")
        for file_ in default_files:
            if os.path.exists(file_):
                return file_
953238
def _check_config(self):
        """"""
        required_data = ['creation_date',
                         'author',
                         'status',
                         'lang',
                         'tags',
                         'title',
                         'slug',
                         'theme',
                         'template',
                         'page_id']
        isok = True
        # exclude some statements from coverage analysis. I would need to
        # refactor how the config is loaded/handled etc. It's not worth
        # to do that now. Maybe when I change yaml for the markdwn extension.
        for e in self._config.keys():
            if not e in required_data: # pragma: no cover
                print "The configuration in page '" + \
                      self._slug + "' is corrupt."
                isok = False
            # check that the theme and template exist, even if they're default.
        (pthemedir, ptemplatefname) = self._theme_and_template_fp()
        if not os.path.isdir(pthemedir): # pragma: no cover
            print "Theme " + self._config['theme'][0] + \
                  " specified in page '" + \
                  self._slug + "' does not exist."
            isok = False
        if not os.path.isfile(ptemplatefname): # pragma: no cover
            print "Template " + self._config['template'][0] + \
                  " specified in page '" + self._slug + \
                  "' does not exist."
            isok = False
        return isok
143751
def is_canonical(version, loosedev=False):  # type: (str, bool) -> bool
    
    if loosedev:
        return loose440re.match(version) is not None
    return pep440re.match(version) is not None
761903
def check_config(config):
    ""
    shortnames = [count['shortname'] for count in config['count']]
    if len(shortnames) != len(set(shortnames)):
        logger.error("error: duplicate `shortname' in count configuration.")
        return False
    return True
53321
def is_python_binding_installed(self):
        
        is_installed = False
        is_install_error = False

        try:
            is_installed = self.is_python_binding_installed_on_pip()
        except InstallError:
            # Consider a case of pip is not installed in old Python (<= 2.6).
            is_install_error = True
        if not is_installed or is_install_error:
            for rpm_dir in self.python_lib_rpm_dirs:
                init_py = os.path.join(rpm_dir, '__init__.py')
                if os.path.isfile(init_py):
                    is_installed = True
                    break

        return is_installed
809057
def has_app(app_name):
    
    if DJANGO_VERSION >= (1, 7):
        from django.apps import apps
        return apps.is_installed(app_name)
    else:
        from django.conf import settings

        return app_name in settings.INSTALLED_APPS
823274
def _validate_config(self, config):
        
        required_keys = [
            self.KEY_IDP_CONFIG,
            self.KEY_ENDPOINTS,
        ]

        if not config:
            raise ValueError("No configuration given")

        for key in required_keys:
            try:
                _val = config[key]
            except KeyError as e:
                raise ValueError("Missing configuration key: %s" % key) from e
880316
function verifyConfig(config) {
  var i = 0;
  var required = ['logs', 'client_name', 'server_port'];
  var optional = {
    'server_host': '127.0.0.1'
  };

  for(i = 0; i < required.lenght; i++) {
    if(!config[required[i]]) {
      throw 'Config missing required: ' + required[i];
    }
  }

  for(i in optional) {
    if(optional.hasOwnProperty(i)) {
      if(!config[i]) {
        config[i] = optional[i];
      }
    }
  }

  return config;
}
1092329
def _check_file(self):
        
        if not os.path.exists(self.file_path):
            return False
        self._migrate()
        config = configparser.RawConfigParser()
        config.read(self.file_path)
        try:
            config.get(
                escape_for_ini('keyring-setting'),
                escape_for_ini('password reference'),
            )
        except (configparser.NoSectionError, configparser.NoOptionError):
            return False
        try:
            self._check_scheme(config)
        except AttributeError:
            # accept a missing scheme
            return True
        return self._check_version(config)
738675
def check_and_postprocess(args):
    
    with open(args.process_config) as in_handle:
        config = yaml.safe_load(in_handle)
    setup_local_logging(config)
    for dname in _find_unprocessed(config):
        lane_details = nglims.get_runinfo(config["galaxy_url"], config["galaxy_apikey"], dname,
                                          utils.get_in(config, ("process", "storedir")))
        if isinstance(lane_details, dict) and "error" in lane_details:
            print("Flowcell not found in Galaxy: %s" % lane_details)
        else:
            lane_details = _tweak_lane(lane_details, dname)
            fcid_ss = samplesheet.from_flowcell(dname, lane_details)
            _update_reported(config["msg_db"], dname)
            fastq_dir = demultiplex.run_bcl2fastq(dname, fcid_ss, config)
            bcbio_config, ready_fastq_dir = nglims.prep_samples_and_config(dname, lane_details, fastq_dir, config)
            transfer.copy_flowcell(dname, ready_fastq_dir, bcbio_config, config)
            _start_processing(dname, bcbio_config, config)
247059
def _chkconfig_is_enabled(name, runlevel=None):
    '''
    
    '''
    cmdline = '/sbin/chkconfig --list {0}'.format(name)
    result = __salt__['cmd.run_all'](cmdline, python_shell=False)

    if runlevel is None:
        runlevel = _runlevel()
    if result['retcode'] == 0:
        for row in result['stdout'].splitlines():
            if '{0}:on'.format(runlevel) in row:
                if row.split()[0] == name:
                    return True
            elif row.split() == [name, 'on']:
                return True
    return False
1140545
def _verify_config(self):
        '''
        
        '''
        if not self.config_dict:
            self._raise_config_exception('No config found')
        # Check for device conifg, if there isn't anything then just log, do not raise an exception
        for dev_os, dev_config in self.config_dict.items():
            if not dev_config:
                log.warning('No config found for %s', dev_os)
                continue
            # Compare the valid opts with the conifg
            self._verify_config_dict(CONFIG.VALID_CONFIG, dev_config, dev_os)
        log.debug('Read the config without error')
59424
def _get_install_config():
    
    try:
        data_dir = _get_data_dir()
    except ValueError:
        return None
    config_dir = utils.safe_makedir(os.path.join(data_dir, "config"))
    return os.path.join(config_dir, "install-params.yaml")
504078
def has_config(config_fname):
    '''
    
    '''
    config = RawConfigParser()
    try:
        config.readfp(open(config_fname))
        return True
    except IOError:
        return False