Returns a boolean for is a parseable .coverage file can be found in the repository

        :return: bool
511663
def has_coverage(self):
        

        if os.path.exists(self.git_dir + os.sep + '.coverage'):
            try:
                with open(self.git_dir + os.sep + '.coverage', 'r') as f:
                    blob = f.read()
                    blob = blob.split('!')[2]
                    json.loads(blob)
                return True
            except Exception:
                return False
        else:
            return False
293171
def enabled_vuln_checks
      checks = REXML::XPath.first(@xml, '//VulnerabilityChecks/Enabled')
      checks ? checks.elements.to_a('Check').map { |c| c.attributes['id'] } : []
    end
1301792
static boolean parseOverallSuccess(SpoonSummary summary) {
    for (DeviceResult result : summary.getResults().values()) {
      if (result.getInstallFailed()) {
        return false; // App and/or test installation failed.
      }
      if (!result.getExceptions().isEmpty() || result.getTestResults().isEmpty()) {
        return false; // Top-level exception present, or no tests were run.
      }
      for (DeviceTestResult methodResult : result.getTestResults().values()) {
        if (methodResult.getStatus() == Status.FAIL) {
          return false; // Individual test failure.
        }
      }
    }
    return true;
  }
389632
def determine_coverage(cls, coverage_file):
        
        lines = []
        source_file = 'ERROR'
        for line in coverage_file:
            m = title_re.match(line)
            if m:
                if m.group(2) == '100':
                    return ('', [])
                source_file = m.group(1)
                continue
            m = source_re.match(line)
            if m:
                lines.append(int(m.group(1)))
                continue
            if end_re.match(line):
                break
        line_ranges = cls.make_ranges(lines)
        return (source_file, line_ranges)
1071666
def CheckForPresenceOf(self, reslist):
        ''''''
        if type(reslist) == type(""):
            reslist = [reslist]

        foundRes = {}
        for line in self.lines:
            resname = line[17:20]
            if line[0:4] == "ATOM":
                if resname in reslist:
                    foundRes[resname] = True

        return foundRes.keys()
338039
def show_coverage
      unless @project.nil?
        line = "## Code coverage\n"
        line << total_coverage_markdown
        line << modified_files_coverage_table
        line << '> Powered by [Slather](https://github.com/SlatherOrg/slather)'
        markdown line
      end
    end
133187
def is_supported(value, check_all=False, filters=None, iterate=False):
    """"""
    assert filters is not None
    if value is None:
        return True
    if not is_editable_type(value):
        return False
    elif not isinstance(value, filters):
        return False
    elif iterate:
        if isinstance(value, (list, tuple, set)):
            valid_count = 0
            for val in value:
                if is_supported(val, filters=filters, iterate=check_all):
                    valid_count += 1
                if not check_all:
                    break
            return valid_count > 0
        elif isinstance(value, dict):
            for key, val in list(value.items()):
                if not is_supported(key, filters=filters, iterate=check_all) \
                   or not is_supported(val, filters=filters,
                                       iterate=check_all):
                    return False
                if not check_all:
                    break
    return True
788455
def coverage(ctx, opts=""):
    
    return test(ctx, coverage=True, include_slow=True, opts=opts)
942521
def parse_coverage(self, f):
    
    # Get the sample name from the parent parent directory
    # Typical path: <sample name>/raw_data_qualimapReport/coverage_histogram.txt
    s_name = self.get_s_name(f)

    d = dict()
    for l in f['f']:
        if l.startswith('#'):
            continue
        coverage, count = l.split(None, 1)
        coverage = int(round(float(coverage)))
        count = float(count)
        d[coverage] = count

    if len(d) == 0:
        log.debug("Couldn't parse contents of coverage histogram file {}".format(f['fn']))
        return None

    # Find median without importing anything to do it for us
    num_counts = sum(d.values())
    cum_counts = 0
    median_coverage = None
    for thiscov, thiscount in d.items():
        cum_counts += thiscount
        if cum_counts >= num_counts/2:
            median_coverage = thiscov
            break
    self.general_stats_data[s_name]['median_coverage'] = median_coverage

    # Save results
    if s_name in self.qualimap_bamqc_coverage_hist:
        log.debug("Duplicate coverage histogram sample name found! Overwriting: {}".format(s_name))
    self.qualimap_bamqc_coverage_hist[s_name] = d
    self.add_data_source(f, s_name=s_name, section='coverage_histogram')
1180475
def individual_report(coverage_path, current_project_path)
      if File.exist? coverage_path
        committed_files = git.modified_files + git.added_files

        unless current_project_path.nil?
          committed_files = committed_files.map do |s|
            current_project_path + '/' + s
          end
        end

        covered_files = JSON.parse(File.read(coverage_path), symbolize_names: true)[:files]
                            .select { |f| committed_files.include?(f[:filename]) }

        unless current_project_path.nil?
          covered_files.each { |f| f[:filename].sub!(%r{^#{current_project_path}/?}, '') }
        end

        return if covered_files.nil? || covered_files.empty?
        markdown individual_coverage_message(covered_files)
      else
        fail('Code coverage data not found')
      end
    end
340733
def report(coverage_path, sticky: true)
      if File.exist? coverage_path
        coverage_json = JSON.parse(File.read(coverage_path), symbolize_names: true)
        metrics = coverage_json[:metrics]
        percentage = metrics[:covered_percent]
        lines = metrics[:covered_lines]
        total_lines = metrics[:total_lines]

        formatted_percentage = format('%.02f', percentage)
        message("Code coverage is now at #{formatted_percentage}% (#{lines}/#{total_lines} lines)", sticky: sticky)
      else
        fail('Code coverage data not found')
      end
    end
20821
def is_parseable (self):
        """"""
        if self.is_directory():
            return True
        if self.content_type in self.ContentMimetypes:
            return True
        log.debug(LOG_CHECK, "URL with content type %r is not parseable.", self.content_type)
        return False
834836
def is_visible(self):
        
        def is_visible_single(visible_if):
            # visible_if syntax: [ignore,these]qualifier:value


            if visible_if.lower() == 'false':
                return False

            # otherwise we need to find the parameter we're referencing and check its value
            if visible_if[0]=='[':
                remove_metawargs, visible_if = visible_if[1:].split(']')
                remove_metawargs = remove_metawargs.split(',')
            else:
                remove_metawargs = []

            qualifier, value = visible_if.split(':')

            if 'hierarchy.' in qualifier:
                # TODO: set specific syntax (hierarchy.get_meshables:2)
                # then this needs to do some logic on the hierarchy
                hier = self._bundle.hierarchy
                if not len(hier.get_value()):
                    # then hierarchy hasn't been set yet, so we can't do any
                    # of these tests
                    return True

                method = qualifier.split('.')[1]

                if value in ['true', 'True']:
                    value = True
                elif value in ['false', 'False']:
                    value = False

                return getattr(hier, method)(self.component) == value

            else:

                # the parameter needs to have all the same meta data except qualifier
                # TODO: switch this to use self.get_parent_ps ?
                metawargs = {k:v for k,v in self.get_meta(ignore=['twig', 'uniquetwig', 'uniqueid']+remove_metawargs).items() if v is not None}
                metawargs['qualifier'] = qualifier
                # metawargs['twig'] = None
                # metawargs['uniquetwig'] = None
                # metawargs['uniqueid'] = None
                # if metawargs.get('component', None) == '_default':
                    # metawargs['component'] = None

                try:
                    # this call is quite expensive and bloats every get_parameter(check_visible=True)
                    param = self._bundle.get_parameter(check_visible=False, check_default=False, **metawargs)
                except ValueError:
                    # let's not let this hold us up - sometimes this can happen when copying
                    # parameters (from copy_for) in order that the visible_if parameter
                    # happens later
                    logger.debug("parameter not found when trying to determine if visible, {}".format(metawargs))
                    return True

                #~ print "***", qualifier, param.qualifier, param.get_value(), value

                if isinstance(param, BoolParameter):
                    if value in ['true', 'True']:
                        value = True
                    elif value in ['false', 'False']:
                        value = False


                if isinstance(value, str) and value[0] in ['!', '~']:
                    return param.get_value() != value[1:]
                elif value=='<notempty>':
                    return len(param.get_value()) > 0
                else:
                    return param.get_value() == value


        if self.visible_if is None:
            return True

        if not self._bundle:
            # then we may not be able to do the check, for now let's just return True
            return True

        return np.all([is_visible_single(visible_if_i) for visible_if_i in self.visible_if.split(',')])
641907
def isvalid(self):
        

        gcontents = [gf.rstrip('\n') for gf in self.repo.bake('ls-files')()]
        fcontents = os.listdir(self.repopath)
        return all([sf in gcontents for sf in std_files]) and all([sf in fcontents for sf in std_files])
587729
def coverage(reportdir=None, extra=None):
    """"""

    import coverage as coverage_api
    cov = coverage_api.coverage()
    opts = {'directory': reportdir} if reportdir else {}

    cov.start()
    test(extra)
    cov.stop()
    cov.html_report(**opts)
390006
def data_matching(filename_re)
      raw_data = raw_data_relative
      update_script_lines__

      match = raw_data.keys.sort.grep(filename_re).first
      return nil unless match

      refine_coverage_info(@script_lines__[match], raw_data[match])
    end
538894
def check(self, spec, data):
        '''
        '''
        path_eval = self.path_eval
        for keypath, specvalue in spec.items():
            if keypath.startswith('$'):
                optext = keypath
                checkable = data
                args = (optext, specvalue, checkable)
                generator = self.dispatch_operator(*args)
            else:
                try:
                    checkable = path_eval(data, keypath)
                except self.InvalidPath:
                    # The spec referenced an item or attribute that
                    # doesn't exist. Fail!
                    return False
                generator = self.dispatch_literal(specvalue, checkable)
            for result in generator:
                if not result:
                    return False
        return True