Checks that Dev Desktop is configured correctly.
519335
protected function checkDevDesktop() {
    if ($this->getInspector()->isDevDesktopInitialized()) {
      if (empty($_ENV['DEVDESKTOP_DRUPAL_SETTINGS_DIR'])) {
        $this->logProblem(__FUNCTION__, [
          "DevDesktop usage is enabled, but \$DEVDESKTOP_DRUPAL_SETTINGS_DIR is not set in your environmental variables.",
          "",
          "Add `export DEVDESKTOP_DRUPAL_SETTINGS_DIR=\"\$HOME/.acquia/DevDesktop/DrupalSettings\"` to ~/.bash_profile or equivalent for your system.`",
        ], 'error');
      }
      elseif (strstr($_ENV['DEVDESKTOP_DRUPAL_SETTINGS_DIR'], '~')) {
        $this->logProblem(__FUNCTION__, [
          "\$DEVDESKTOP_DRUPAL_SETTINGS_DIR contains a '~'. This does not always expand to your home directory.",
          "",
          "Add `export DEVDESKTOP_DRUPAL_SETTINGS_DIR=\"\$HOME/.acquia/DevDesktop/DrupalSettings\"` to ~/.bash_profile or equivalent for your system.`",
        ], 'error');
      }

      $variables_order = ini_get('variables_order');
      $php_ini_file = php_ini_loaded_file();
      if (!strstr($variables_order, 'E')) {
        $this->logProblem(__FUNCTION__, [
          "DevDesktop usage is enabled, but variables_order does support environmental variables.",
          "",
          "Define variables_order = \"EGPCS\" in $php_ini_file",
        ], 'error');
      }
    }
  }
736281
def _validate_install(self):

        '''  '''

        from subprocess import check_output, STDOUT
        sys_command = 'docker --help'
        try:
            check_output(sys_command, shell=True, stderr=STDOUT).decode('utf-8')
            # call(sys_command, stdout=open(devnull, 'wb'))
        except Exception as err:
            raise Exception('"docker" not installed. GoTo: https://www.docker.com')
    
        return True
1273621
def check(ctx):
    

    check_command = f"twine check {ctx.directory!s}/dist/*"
    report.info(ctx, "package.check", "checking package")
    ctx.run(check_command)
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
779311
function isInstalled(dep) {
    if (_.has(exceptions, dep)) return exceptions[dep];
    return installedDeps.has(dep);
}
158247
private static synchronized void initDEVTESTPROD() {
    if (IS_DEV != null)
      return;
    IS_DEV = false;
    IS_TEST = false;
    IS_PROD = false;
    final List<String> envs = singletonInstance.getSearchEnvironments();
    for (final String env : envs) {
      if (env.equalsIgnoreCase("DEV")) {
        IS_DEV = true;
      }
    }
    for (final String env : envs) {
      if (env.equalsIgnoreCase("TEST")) {
        IS_DEV = false;
        IS_TEST = true;
      }
    }
    for (final String env : envs) {
      if (env.equalsIgnoreCase("PROD")) {
        IS_DEV = false;
        IS_TEST = false;
        IS_PROD = true;
      }
    }

  }
1292329
protected boolean checkConfiguration(IProgressMonitor progress) {
		assert progress != null;
		progress.subTask(Messages.SarlBatchCompiler_55);
		final File output = getOutputPath();
		if (getLogger().isDebugEnabled()) {
			getLogger().debug(Messages.SarlBatchCompiler_35, output);
		}
		if (output == null) {
			reportInternalError(Messages.SarlBatchCompiler_36);
			return false;
		}
		progress.subTask(Messages.SarlBatchCompiler_56);
		for (final File sourcePath : getSourcePaths()) {
			if (progress.isCanceled()) {
				return false;
			}
			try {
				if (getLogger().isDebugEnabled()) {
					getLogger().debug(Messages.SarlBatchCompiler_37, sourcePath);
				}
				if (isContainedIn(output.getCanonicalFile(), sourcePath.getCanonicalFile())) {
					reportInternalError(Messages.SarlBatchCompiler_10, output, sourcePath);
					return false;
				}
			} catch (IOException e) {
				reportInternalError(Messages.SarlBatchCompiler_11, e);
			}
		}
		return true;
	}
492404
public function is_ready() {
        if (empty($this->pathtopython)) {
            $settingurl = new \moodle_url('/admin/settings.php', array('section' => 'systempaths'));
            return get_string('pythonpathnotdefined', 'mlbackend_python', $settingurl->out());
        }

        // Check the installed pip package version.
        $cmd = "{$this->pathtopython} -m moodlemlbackend.version";

        $output = null;
        $exitcode = null;
        // Execute it sending the standard error to $output.
        $result = exec($cmd . ' 2>&1', $output, $exitcode);

        $vercheck = self::check_pip_package_version($result);

        if ($vercheck === 0) {
            return true;
        }

        if ($exitcode != 0) {
            return get_string('pythonpackagenotinstalled', 'mlbackend_python', $cmd);
        }

        if ($result) {
            $a = [
                'installed' => $result,
                'required' => self::REQUIRED_PIP_PACKAGE_VERSION,
            ];

            if ($vercheck < 0) {
                return get_string('packageinstalledshouldbe', 'mlbackend_python', $a);

            } else if ($vercheck > 0) {
                return get_string('packageinstalledtoohigh', 'mlbackend_python', $a);
            }
        }

        return get_string('pythonpackagenotinstalled', 'mlbackend_python', $cmd);
    }
32737
protected function verifyConfiguration()
    {
        if (isset($this->options->filtered['configuration']) && !file_exists($this->options->filtered['configuration']->getPath())) {
            $this->printer->println(sprintf('Could not read "%s".', $this->options->filtered['configuration']));
            exit(1);
        }
    }
914442
def is_kde_desktop():
    """"""
    if sys.platform.startswith('linux'):
        xdg_desktop = os.environ.get('XDG_CURRENT_DESKTOP', '')
        if xdg_desktop:
            if 'KDE' in xdg_desktop:
                return True
            else:
                return False
        else:
            return False
    else:
        return False
669950
def check_build_layout(self):
        '''
        '''
        self.info('Ensure build layout')

        if not exists(self.specfilename):
            print('No {0} found in the current directory. Abandon.'.format(
                self.specfilename))
            exit(1)

        # create global dir
        self.mkdir(self.global_buildozer_dir)
        self.mkdir(self.global_cache_dir)

        # create local .buildozer/ dir
        self.mkdir(self.buildozer_dir)
        # create local bin/ dir
        self.mkdir(self.bin_dir)

        self.mkdir(self.applibs_dir)
        self.state = JsonStore(join(self.buildozer_dir, 'state.db'))

        target = self.targetname
        if target:
            self.mkdir(join(self.global_platform_dir, target, 'platform'))
            self.mkdir(join(self.buildozer_dir, target, 'platform'))
            self.mkdir(join(self.buildozer_dir, target, 'app'))
377938
def check_config(data):
    

    is_right = True

    if "title" not in data:
        logging.error("No 'title' in _config.yml")
        is_right = False

    return is_right
1287461
def get_desktop_env():
    """"""
    desktop = os.environ.get("XDG_CURRENT_DESKTOP")
    if desktop:
        return desktop

    desktop = os.environ.get("DESKTOP_SESSION")
    if desktop:
        return desktop

    desktop = os.environ.get("GNOME_DESKTOP_SESSION_ID")
    if desktop:
        return "GNOME"

    desktop = os.environ.get("MATE_DESKTOP_SESSION_ID")
    if desktop:
        return "MATE"

    desktop = os.environ.get("SWAYSOCK")
    if desktop:
        return "SWAY"

    desktop = os.environ.get("DESKTOP_STARTUP_ID")
    if desktop and "awesome" in desktop:
        return "AWESOME"

    return None
29205
public function isBehatConfigured() {

    // Verify that URIs required for Drupal and Behat are configured correctly.
    $local_behat_config = $this->getLocalBehatConfig();
    if ($this->getConfigValue('project.local.uri') != $local_behat_config->get('local.extensions.Behat\MinkExtension.base_url')) {
      $this->logger->warning('project.local.uri in blt.yml does not match local.extensions.Behat\MinkExtension.base_url in local.yml.');
      $this->logger->warning('project.local.uri = ' . $this->getConfigValue('project.local.uri'));
      $this->logger->warning('local.extensions.Behat\MinkExtension.base_url = ' . $local_behat_config->get('local.extensions.Behat\MinkExtension.base_url'));
      return FALSE;
    }

    // Verify that URIs required for an ad-hoc PHP internal server are
    // configured correctly.
    if ($this->getConfigValue('tests.run-server')) {
      if ($this->getConfigValue('tests.server.url') != $this->getConfigValue('project.local.uri')) {
        $this->logger->warning("tests.run-server is enabled, but the server URL does not match Drupal's base URL.");
        $this->logger->warning('project.local.uri = ' . $this->getConfigValue('project.local.uri'));
        $this->logger->warning('tests.server.url = ' . $this->getConfigValue('tests.server.url'));
        $this->logger->warning('local.extensions.Behat\MinkExtension.base_url = ' . $local_behat_config->get('local.extensions.Behat\MinkExtension.base_url'));

        return FALSE;
      }
    }

    // Verify that required Behat files are present.
    if (!$this->areBehatConfigFilesPresent()) {
      return FALSE;
    }

    return TRUE;
  }
95288
function isSetupRequired (program) {
  const config = dotfile.get() || {}
  const hasPublisher = (config.publisher || program.publisher)
  const hasDevCert = (config.devCert || program.devCert)
  const hasWindowsKit = (config.windowsKit || program.windowsKit)
  const hasBaseImage = (config.expandedBaseImage || program.expandedBaseImage)
  const hasConverterTools = (config.desktopConverter || program.desktopConverter)

  if (!program.containerVirtualization) {
    return (hasPublisher && hasDevCert && hasWindowsKit)
  } else {
    return (hasPublisher && hasDevCert && hasWindowsKit && hasBaseImage && hasConverterTools)
  }
}
173633
def check_settings!
      required_keys = %w(
        org
        project
      )

      required_keys.each do |key|
        unless Settings.send key
          error = "Config is missing required key '#{key}'. Please add it " \
            "to #{config_path} and try again."
          error += "\n\nFor more info, see https://github.com/jutonz/dctl_rb#required-keys"
          puts Rainbow(error).red
          exit 1
        end
      end
    end
205325
public function isDevServerActive()
    {
        // Using Development Environment?
        
        if (!Director::isDev()) {
            return false;
        }
        
        // Already Checked Server?
        
        if ($this->devServerTested) {
            return $this->devServerActive;
        }
        
        // Test Server Connection:
        
        return $this->testDevServer();
    }