Performs checks to see if we have everything needed to mount
        sshfs filesystems.
        :return: two-tuple (boolean checks_pass, list failure messages)
7238
def perform_preflight_check(self):
        
        failures = []
        if not os.access(self.mount_path_base, os.W_OK):
            msg = ("Mount path `{path}` doesn't exist or is not writable"
                   " by the current user.")
            failures.append(msg.format(
                path = self.mount_path_base
            ))
        if which('sshfs') is None:
            msg = ("SSHFS (http://fuse.sourceforge.net/sshfs.html)"
                   " does not seem to be installed.")
            failures.append(msg)

        return len(failures) == 0, failures
500155
def requirements_check():
    
    required_programs = [
        ('samtools',
         'http://samtools.sourceforge.net/'),
        ('bedtools',
         'http://bedtools.readthedocs.org/en/latest/'),
        ('bigWigToBedGraph',
         'http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/'),
        ('bedGraphToBigWig',
         'http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/'),
    ]
    for req, url in required_programs:
        try:
            p = subprocess.Popen(
                [req], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
            stdout, stderr = p.communicate()
        except OSError:
            raise ValueError("Please install %s (%s)" % (req, url))
838501
def check_errors(self):
        '''
        
        '''
        errors = ERROR_PATTTERN.findall(self.out)
        # "errors" is a list of tuples
        if errors:
            self.log.error('! Errors occurred:')

            self.log.error('\n'.join(
                [error.replace('\r', '').strip() for error
                 in chain(*errors) if error.strip()]
            ))

            self.log.error('! See "%s.log" for details.' % self.project_name)

            if self.opt.exit_on_error:
                self.log.error('! Exiting...')
                sys.exit(1)
1036702
def check_file_paths(self, *args):
        
        for path in enumerate(args):
            path = path[1]
            if path is not None:
                try:
                    self.check_file_path(path)
                except OSError as ex:
                    logger.warn(ex)
                    raise
        return args
789696
def IsHFS(self):
    
    tsk_fs_type = self.GetFsType()
    return tsk_fs_type in [
        pytsk3.TSK_FS_TYPE_HFS, pytsk3.TSK_FS_TYPE_HFS_DETECT]
707018
def _def_check(self):
        
        if self._def != dict():
            for key, val in iteritems_(self._def):
                if key not in list(TEXT_INDEX_ARGS.keys()):
                    raise CloudantArgumentError(127, key)
                if not isinstance(val, TEXT_INDEX_ARGS[key]):
                    raise CloudantArgumentError(128, key, TEXT_INDEX_ARGS[key])
1133446
def check(self):
        

        passed = True

        def check_type(attr, types):
            # checks whether the parameter has a certain type
            val = getattr(self, attr)
            if not isinstance(val, types):
                logger.error('Parameter "%s" = %s: invalid type ' +
                        '(should be %s).', attr, val, str(types))
                passed = False

        def check_file_exists(attr):
            # check whether the specified file exists
            path = getattr(self, attr)
            if not os.path.isfile(path):
                logger.error('Parameter "%s" = %s: file does not exist. ',
                        attr, path)
                passed = False

        def check_dir_exists(attr):
            # check whether the specified directory exists
            path = getattr(self, attr)
            if not os.path.isdir(path):
                logger.error('Parameter "%s" = %s: directory does not exist.',
                        attr, path)
                passed = False

        def check_dir_writable(attr):
            path = getattr(self, attr)
            if not misc.test_dir_writable(path):
                logger.error('Parameter "%s" = %s: directory is not writable',
                        attr, path)
                passed = False

        def check_file_writable(attr):
            # check whether the specified file is writable
            path = getattr(self, attr)
            if not misc.test_file_writable(path):
                logger.error('Parameter "%s" = %s: file not writable.',
                        attr, path)
                passed = False

        def check_range(attr, mn = None, mx = None,
                left_open = False, right_open = False):
            # checks if a GO-PCA parameter falls within a certain numeric range

            val = getattr(self, attr)
            in_range = True

            rel_op = {True: '<', False: '<='}

            if mn is not None:
                left_rel = '%s %s ' %(str(mn), rel_op[left_open])
                if left_open:
                    if not mn < val: in_range = False
                else:
                    if not mn <= val: in_range = False

            if mx is not None:
                right_rel = ' %s %s' %(rel_op[right_open], str(mx))
                if right_open:
                    if not val < mx: in_range = False
                else:
                    if not val <= mx: in_range = False

            if not in_range:
                logger.error('Parameter "%s" = %s: out of range ' +
                        '(should be %s %s %s).',
                        attr, val, left_rel, attr, right_rel)
                passed = False

        # check if input files are strings
        # specification of gene ontology file is optional
        check_type('data_dir', (str, unicode))
        check_dir_writable('data_dir')

        check_type('job_dir', (str, unicode))
        check_dir_writable('job_dir')

        if self.ssl_dir is not None:
            check_dir_exists('ssl_dir')
            if not os.path.isfile(ssl_dir + os.sep + 'gopca_server.cert'):
                logger.error('SSL certificate file not found!')
                passed = False
            if not os.path.isfile(ssl_dir + os.sep + 'gopca_server.key'):
                logger.error('SSL key file no found!')
                passed = False

        check_type('port', int)

        # TO-DO: check remaining parameters
        return passed
394913
def validateAllServers(self):
        
        url = self._url + "/servers/validate"
        params = {"f" : "json"}
        return self._get(url=url,
                         param_dict=params,
                         proxy_port=self._proxy_port,
                         proxy_url=self._proxy_ur)
181464
def verify(self):
        
        if self not in self._queue:
            return False
        valid = True
        for check in self.valid_list:
            valid = valid & check()
        return valid
771786
private void sanityCheck(List<Path> resources) {
    Set<String> fileNames = resources.stream()
        .map(p -> p.getFileName().toString())
        .collect(Collectors.toSet());
    for (String name : FILENAMES_MUST_EXIST) {
      if (!fileNames.contains(name)) {
        String msg = String.format("CLDR DATA MISSING! Can't find '%s'. "
            + " You may need to run 'git submodule update'", name);
        throw new RuntimeException(msg);
      }
    }
  }
397559
def check_args(args):
    
    if not os.path.exists(args.fd):
        print("Not a valid path", args.fd, file=ERROR_LOG)
        return [], [], False
    if args.fl is not None:
        # we already ensure the file can be opened and opened the file
        file_line = args.fl.readline()
        amr_ids = file_line.strip().split()
    elif args.f is None:
        print("No AMR ID was given", file=ERROR_LOG)
        return [], [], False
    else:
        amr_ids = args.f
    names = []
    check_name = True
    if args.p is None:
        names = get_names(args.fd, amr_ids)
        # no need to check names
        check_name = False
        if len(names) == 0:
            print("Cannot find any user who tagged these AMR", file=ERROR_LOG)
            return [], [], False
        else:
            names = args.p
    if len(names) == 0:
        print("No user was given", file=ERROR_LOG)
        return [], [], False
    if len(names) == 1:
        print("Only one user is given. Smatch calculation requires at least two users.", file=ERROR_LOG)
        return [], [], False
    if "consensus" in names:
        con_index = names.index("consensus")
        names.pop(con_index)
        names.append("consensus")
    # check if all the AMR_id and user combinations are valid
    if check_name:
        pop_name = []
        for i, name in enumerate(names):
            for amr in amr_ids:
                amr_path = args.fd + name + "/" + amr + ".txt"
                if not os.path.exists(amr_path):
                    print("User", name, "fails to tag AMR", amr, file=ERROR_LOG)
                    pop_name.append(i)
                    break
        if len(pop_name) != 0:
            pop_num = 0
            for p in pop_name:
                print("Deleting user", names[p - pop_num], "from the name list", file=ERROR_LOG)
                names.pop(p - pop_num)
                pop_num += 1
        if len(names) < 2:
            print("Not enough users to evaluate. Smatch requires >2 users who tag all the AMRs", file=ERROR_LOG)
            return "", "", False
    return amr_ids, names, True
844587
public function check()
    {
        $returnVar = 0;
        $output = [];
        $sshVersion = exec('ssh -V 2>&1', $output, $returnVar);

        $result = false;
        if ($returnVar === 0) {
            $result = true;
            $this->sshVersion = $sshVersion;
        }

        return $result;
    }
1209139
def passed(self):
        
        return [test for test in self.all() if not test.failed() and not test.skipped()]
63225
def verify_ws2p_head(self, head: Any) -> bool:
        
        signature = base64.b64decode(head.signature)
        inline = head.inline()
        prepended = signature + bytes(inline, 'ascii')

        try:
            self.verify(prepended)
            return True
        except ValueError:
            return False
1062252
def verify_ports(port_list):
    
    result = True  # empty list is ok
    for item in port_list:
        try:
            (port, protocol) = item.split(PORT_SEPARATOR)
            port_num = int(port)
        except ValueError:
            result = False
            break
        result &= protocol in ALLOWED_PROTOCOLS
        result &= port == str(port_num)
    return result
67332
def _check_requirements(self):
        

        path = self._vpcs_path()
        if not path:
            raise VPCSError("No path to a VPCS executable has been set")

        # This raise an error if ubridge is not available
        self.ubridge_path

        if not os.path.isfile(path):
            raise VPCSError("VPCS program '{}' is not accessible".format(path))

        if not os.access(path, os.X_OK):
            raise VPCSError("VPCS program '{}' is not executable".format(path))

        yield from self._check_vpcs_version()
1218993
def check_sp_certs(self):
        
        key = self.get_sp_key()
        cert = self.get_sp_cert()
        return key is not None and cert is not None