reorder targets per the passed in list
        :param target_ids:
        :return:
961159
def set_target_order(self, target_ids):
        
        reordered_targets = []
        current_target_ids = [t['id'] for t in self.my_osid_object_form._my_map['targets']]
        if set(target_ids) != set(current_target_ids):
            raise IllegalState('target_ids do not match existing targets')

        for target_id in target_ids:
            for current_target in self.my_osid_object_form._my_map['targets']:
                if target_id == current_target['id']:
                    reordered_targets.append(current_target)
                    break

        self.my_osid_object_form._my_map['targets'] = reordered_targets
1069374
public void addTargets(final List<IndexTermTarget> targets) {
        int targetNum;

        if (targets == null) {
            return;
        }

        targetNum = targets.size();
        for (int i = 0; i < targetNum; i++) {
            addTarget(targets.get(i));
        }
    }
957919
def targets(*names, &block)
      if names.empty?
        UI.warning('Book#targets to get all targets is deprecated, use #all_targets instead', location: caller_locations.first)
        return all_targets
      end

      names.map { |name| target(name, &block) }
    end
378565
def target(self):
        
        return [
            os.path.basename(os.path.dirname(f)) for f in self.files
        ]
31778
function _assign(target, ...sources) {

    sources.forEach(source => {
        Object.keys(source || {}).forEach(
            key => target[key] = source[key]
        );
    });

    return target;
}
872305
def build(self, targets: Iterable[str]) -> Iterable[str]:
        
        return generate_source_directories(
            targets, build=self._build, prompt=self._prompt
        )
902950
def alter_targets(self):
        
        if self.is_derived():
            return [], None
        return self.fs.variant_dir_target_climb(self, self.dir, [self.name])
132148
def filter_by_ids(original_list, ids_to_filter):
    """"""
    if not ids_to_filter:
        return original_list

    return [i for i in original_list if i['id'] in ids_to_filter]
1287018
def compute_reverse_dependencies(
        self, targets: Iterable[BuildTarget]
    ) -> Mapping[str, Iterable[BuildTarget]]:
        
        result = defaultdict(list)
        for target in targets:
            for dependency in target.dependencies:
                result[dependency].append(target)
        return result
257228
def getalignedtarget(self, index):
        """"""
        targetindices = []
        target = None
        foundindex = -1
        for sourceindex, targetindex in self.alignment:
            if sourceindex == index:
                targetindices.append(targetindex)
        if len(targetindices) > 1:
            for i in range(1,len(targetindices)):
                if abs(targetindices[i] - targetindices[i-1]) != 1:
                    break  # not consecutive
            foundindex = (min(targetindices), max(targetindices))
            target = ' '.join(self.target[min(targetindices):max(targetindices)+1])
        elif targetindices:
            foundindex = targetindices[0]
            target = self.target[foundindex]

        return target, foundindex
811762
def list_subscriptions(self, target_id=None, ids=None, query_flags=None):
        
        query_parameters = {}
        if target_id is not None:
            query_parameters['targetId'] = self._serialize.query('target_id', target_id, 'str')
        if ids is not None:
            ids = ",".join(ids)
            query_parameters['ids'] = self._serialize.query('ids', ids, 'str')
        if query_flags is not None:
            query_parameters['queryFlags'] = self._serialize.query('query_flags', query_flags, 'str')
        response = self._send(http_method='GET',
                              location_id='70f911d6-abac-488c-85b3-a206bf57e165',
                              version='5.0-preview.1',
                              query_parameters=query_parameters)
        return self._deserialize('[NotificationSubscription]', self._unwrap_collection(response))
818145
def target_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/targets/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
16661
def reload_target!(options = {})
      old_options = @target_load_options || {}
      options = (@target_load_options || {}).merge(options)
      if options[:skip_first_time] && @target_load_count == 1
        @target_load_count += 1
      else
        load_target!(options.merge(reload: true))
      end
    end
1362533
def create_indexes(cls, target=None, recreate=False):
		
		
		# TODO: Nested indexes.
		
		results = []
		collection = cls.get_collection(target)
		
		if recreate:
			collection.drop_indexes()
		
		for index in cls.__indexes__.values():
			results.append(index.create(collection))
		
		return results
483235
def target_str_to_list(target_str):
    
    new_list = list()
    for target in target_str.split(','):
        target = target.strip()
        target_list = target_to_list(target)
        if target_list:
            new_list.extend(target_list)
        else:
            LOGGER.info("{0}: Invalid target value".format(target))
            return None
    return list(collections.OrderedDict.fromkeys(new_list))
76745
def get_targets(self):
        
        if not hasattr(self, "_targets"):
            targets = []
            for target_def in self.config.targets or []:
                target = Target(target_def)
                targets.append(target)
            self._targets = targets
        return self._targets
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])