:returns: target instances for specs referenced by imported_target_specs.
    :rtype: list of Target
554096
def imported_targets(self):
    
    libs = []
    for spec in self.imported_target_specs(payload=self.payload):
      resolved_target = self._build_graph.get_target_from_spec(spec,
                                                               relative_to=self.address.spec_path)
      if not resolved_target:
        raise self.UnresolvedImportError(
          'Could not find target {spec} referenced from {relative_to}'
          .format(spec=spec, relative_to=self.address.spec))
      try:
        libs.append(self.expected_target_constraint.validate_satisfied_by(resolved_target))
      except TypeConstraintError as e:
        raise self.WrongTargetTypeError(
          'Wrong target type {spec} referenced from remote sources target {relative_to}: {err}'
          .format(spec=spec, relative_to=self.address.spec, err=str(e)),
          e)
    return libs
320020
def get_target_from_spec(self, spec, relative_to=''):
    
    return self.get_target(Address.parse(spec, relative_to=relative_to))
740513
def targets(self, module):
        

        if module not in self.module_targets:
            raise BuildError("Could not find module in targets()", module=module)

        return [self.find(x, module) for x in self.module_targets[module]]
22520
def get_targets(self, name=None):
        
        targets = []
        for section in self.get_sections():
            if section.endswith(u'Target'):
                targets += [value for value in self._sections[section]]

        if name is None:
            return targets

        if not isinstance(name, list):
            name = [name]

        return [target for target in targets if target.name in name]
1157664
def get_importer(self):
        
        try:
            importer_path = settings.TRACK_IMPORTER_CLASS
        except AttributeError:
            raise ImproperlyConfigured('No TRACK_IMPORTER_CLASS setting found.')
        try:
            dot = importer_path.rindex('.')
        except ValueError:
            raise ImproperlyConfigured('%s isn\'t a Track Importer module.' % importer_path)
        module, classname = importer_path[:dot], importer_path[dot+1:]
        try:
            mod = import_module(module)
        except ImportError, e:
            raise ImproperlyConfigured('Could not import Track Importer %s: "%s".' % (module, e))
        try:
            importer_class = getattr(mod, classname)
        except AttributeError:
            raise ImproperlyConfigured('Track Importer module "%s" does not define a "%s" class.' % (module, classname))
   
        importer_instance = importer_class()
        if not hasattr(importer_instance, 'run'):
            raise ImproperlyConfigured('Track Importer class "%s" does not define a run method. Implement the method to return a list of Track objects.' % classname)
        
        return importer_instance
925007
def targets(self):
        
        for sample in self.runmetadata:
            if sample.general.bestassemblyfile != 'NA':
                setattr(sample, self.analysistype, GenObject())
                sample[self.analysistype].runanalysis = True
                sample[self.analysistype].targetpath = self.targetpath
                baitpath = os.path.join(self.targetpath, 'bait')
                sample[self.analysistype].baitfile = glob(os.path.join(baitpath, '*.fa'))[0]
                try:
                    sample[self.analysistype].outputdir = os.path.join(sample.run.outputdirectory, self.analysistype)
                except AttributeError:
                    sample[self.analysistype].outputdir = \
                        os.path.join(sample.general.outputdirectory, self.analysistype)
                    sample.run.outputdirectory = sample.general.outputdirectory
                sample[self.analysistype].logout = os.path.join(sample[self.analysistype].outputdir, 'logout.txt')
                sample[self.analysistype].logerr = os.path.join(sample[self.analysistype].outputdir, 'logerr.txt')
                sample[self.analysistype].baitedfastq = os.path.join(sample[self.analysistype].outputdir,
                                                                     '{}_targetMatches.fastq'.format(self.analysistype))
                sample[self.analysistype].complete = False
697126
def factory_profiles(self):
        ''''''
        with self._mutex:
            if not self._factory_profiles:
                self._factory_profiles = []
                for fp in self._obj.get_factory_profiles():
                    self._factory_profiles.append(utils.nvlist_to_dict(fp.properties))
        return self._factory_profiles
426530
def get_curent_module_classes(module):
    
    classes = []
    for name, obj in inspect.getmembers(module):
        if inspect.isclass(obj):
            classes.append(obj)
    return classes
890799
def get_classes(self):
        
        instances = self._get_instances(ast.ClassDef)
        instances = [
            PyClass(instance, self.package)
            for instance in instances
        ]
        return instances
808894
def _import_classes(self, class_names):
        
        classes = []
        for name in class_names:
            classes.extend(self._import_class_or_module(name))
        return classes
1226741
def imported_classifiers(p: ecore.EPackage):
        """"""
        classes = {c for c in p.eClassifiers if isinstance(c, ecore.EClass)}

        supertypes = itertools.chain(*(c.eAllSuperTypes() for c in classes))
        imported = {c for c in supertypes if c.ePackage is not p}

        attributes = itertools.chain(*(c.eAttributes for c in classes))
        attributes_types = (a.eType for a in attributes)
        imported |= {t for t in attributes_types if t.ePackage not in {p, ecore.eClass, None}}

        imported_dict = {}
        for classifier in imported:
            imported_dict.setdefault(classifier.ePackage, set()).add(classifier)

        return imported_dict
660224
def find_spec(self, fullname, path, target=None):
        ''''''
        if not path:
            path = [os.getcwd()]
        if "." in fullname:
            name = fullname.split(".")[-1]
        else:
            name = fullname
        for entry in path:
            if os.path.isdir(os.path.join(entry, name)):
                # this module has child modules
                filename = os.path.join(entry, name, "__init__.py")
                submodule_locations = [os.path.join(entry, name)]
            else:
                filename = os.path.join(entry, name + ".py")
                submodule_locations = None
            if not os.path.exists(filename):
                continue

            return spec_from_file_location(fullname, filename,
                                           loader=MyLoader(filename),
                                           submodule_search_locations=submodule_locations)
        return None
721376
def specification(cls, *context_specs):
		
		import_data = []
		for name in context_specs:
			import_data.append((name, None))
		return cls.import_context(import_data)
464006
def get_all_targets(self):
        """"""
        result = []
        for batch in self.batches:
            result.extend(batch.targets)
        return result
1197322
def as_dict(self):
        
        return {"@module": self.__class__.__module__,
                "@class": self.__class__.__name__,
                "additional_condition": self._additional_condition,
                "max_nabundant": self.max_nabundant,
                "target_environments": self.target_environments,
                "target_penalty_type": self.target_penalty_type,
                "max_csm": self.max_csm}
55834
def compute_dependency_specs(cls, kwargs=None, payload=None):
    """"""
    for spec in super(ImportRemoteSourcesMixin, cls).compute_dependency_specs(kwargs, payload):
      yield spec

    imported_target_specs = cls.imported_target_specs(kwargs=kwargs, payload=payload)
    for spec in imported_target_specs:
      yield spec
452526
def getServices(self):
        
        tool = getToolByName(self, REFERENCE_CATALOG)
        services = []
        for spec in self.getReferenceResults():
            service = tool.lookupObject(spec['uid'])
            services.append(service)
        return services