Back compatible: get pre-existing target BEDs.
509723
def _get_original_targets(data):
    
    work_dir = os.path.join(_sv_workdir(data), "raw")
    batch = dd.get_batch(data) or dd.get_sample_name(data)
    return (glob.glob(os.path.join(work_dir, "*-%s.target.bed" % batch))[0],
            glob.glob(os.path.join(work_dir, "*-%s.antitarget.bed" % batch))[0])
641260
def targets_to_stage(self, source_targets, ps):
        """"""

        result = []

        # Traverse the dependencies, if needed.
        if ps.get('install-dependencies') == ['on']:
            source_targets = self.collect_targets(source_targets)

        # Filter the target types, if needed.
        included_types = ps.get('install-type')
        for r in source_targets:
            ty = r.type()
            if ty:
                # Do not stage searched libs.
                if ty != "SEARCHED_LIB":
                    if included_types:
                        if self.include_type(ty, included_types):
                            result.append(r)
                    else:
                        result.append(r)
            elif not included_types:
                # Don't install typeless target if there is an explicit list of
                # allowed types.
                result.append(r)

        return result
526661
private void afterBatch(BatchBackend backend) {
		IndexedTypeSet targetedTypes = searchFactoryImplementor.getIndexedTypesPolymorphic( rootIndexedTypes );
		if ( this.optimizeAtEnd ) {
			backend.optimize( targetedTypes );
		}
		backend.flush( targetedTypes );
	}
1142208
def get_presig(self, target, source, env):
        
        return b"".join([bytes(x.get_contents(target, source, env)) for x in self.list])
1098496
def calculate_include_paths(targets, is_thrift_target):
  

  basedirs = set()
  def collect_paths(target):
    basedirs.add(target.target_base)

  for target in targets:
    target.walk(collect_paths, predicate=is_thrift_target)
  return basedirs
217588
def bed(args):
    
    p = OptionParser(bed.__doc__)
    p.add_option("--switch", default=False, action="store_true",
                 help="Switch reference and aligned map elements [default: %default]")
    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    mapout, = args
    pf = mapout.split(".")[0]
    mapbed = pf + ".bed"
    bm = BinMap(mapout)
    bm.print_to_bed(mapbed, switch=opts.switch)

    return mapbed
806603
def get_only(self, product_type, target):
    
    product_mapping = self.get(product_type).get(target)
    if len(product_mapping) != 1:
      raise ProductError('{} directories in product mapping: requires exactly 1.'
                         .format(len(product_mapping)))

    for _, files in product_mapping.items():
      if len(files) != 1:
        raise ProductError('{} files in target directory: requires exactly 1.'
                           .format(len(files)))

      return files[0]
993552
def inset_sizes(cls, original_width, original_height, target_width, target_height):
        
        if target_width >= original_width and target_height >= original_height:
            target_width = float(original_width)
            target_height = original_height

        elif target_width <= original_width and target_height >= original_height:
            k = original_width / float(target_width)
            target_height = int(original_height / k)

        elif target_width >= original_width and target_height <= original_height:
            k = original_height / float(target_height)
            target_width = int(original_width / k)

        elif target_width < original_width and target_height < original_height:
            k = original_width / float(original_height)
            k_w = original_width / float(target_width)
            k_h = original_height / float(target_height)

            if k_w >= k_h:
                target_height = int(target_width / k)
            else:
                target_width = int(target_height * k)

        return target_width, target_height
1048677
def reindex(self):
        ''''''
        for i in range(self.count()):
            w = self.points[i]
            w.idx = i
            w.count = self.count()
            w.target_system = self.target_system
            w.target_component = self.target_component
        self.last_change = time.time()
625603
def regions_coverage(bed_file, target_name, data):
    
    ready_bed = tz.get_in(["depth", target_name, "regions"], data)
    if ready_bed:
        return ready_bed
    else:
        return run_mosdepth(data, target_name, bed_file).regions
741722
def res(self):
        """"""
        params = [dict(zip(self.keys, p)) for p in self.params]

        return [
            {"target": target, "params": param}
            for target, param in zip(self.target, params)
        ]
1165401
def get_target_service_state(self, service_id: str):
        """"""
        state = self._get_service_state(service_id)
        return state.target_state
966079
def _replace_bm(self):
        """"""
        self._block_matcher = cv2.StereoBM(preset=self._bm_preset,
                                          ndisparities=self._search_range,
                                          SADWindowSize=self._window_size)
1055402
def default_targets(self):
        """"""
        from dvc.stage import Stage

        msg = "assuming default target '{}'.".format(Stage.STAGE_FILE)
        logger.warning(msg)
        return [Stage.STAGE_FILE]
1029489
def get_vers_for_target(target):
    """"""
    target_info = get_target_info(target)
    if not target_info:
        return py2_vers + py3_vers
    elif len(target_info) == 1:
        if target_info == (2,):
            return py2_vers
        elif target_info == (3,):
            return py3_vers
        else:
            raise CoconutInternalException("invalid target info", target_info)
    elif target_info == (3, 3):
        return [(3, 3), (3, 4)]
    else:
        return [target_info[:2]]
293911
def get_prebuilt_targets(build_context):
    
    logger.info('Scanning for cached base images')
    # deps that are part of cached based images
    contained_deps = set()
    # deps that are needed by images that are going to be built,
    # but are not part of their base images
    required_deps = set()
    # mapping from target name to set of all its deps (descendants)
    cached_descendants = CachedDescendants(build_context.target_graph)

    for target_name, target in build_context.targets.items():
        if 'image_caching_behavior' not in target.props:
            continue
        image_name = get_image_name(target)
        image_tag = target.props.image_tag
        icb = ImageCachingBehavior(image_name, image_tag,
                                   target.props.image_caching_behavior)
        target.image_id = handle_build_cache(build_context.conf, image_name,
                                             image_tag, icb)
        if target.image_id:
            # mark deps of cached base image as "contained"
            image_deps = cached_descendants.get(target_name)
            contained_deps.update(image_deps)
            contained_deps.add(target.name)
        else:
            # mark deps of image that is going to be built
            # (and are not deps of its base image) as "required"
            image_deps = cached_descendants.get(target_name)
            base_image_deps = cached_descendants.get(target.props.base_image)
            required_deps.update(image_deps - base_image_deps)
    return contained_deps - required_deps
1357201
def _reverse_to_source(self, target, group1):
        
        new_group = []
        for dst in group1:
            new_group += target[dst]
        return set(new_group)