Converts the source model to an iterator of sources of :class:
        openquake.hazardlib.source.base.BaseSeismicSource
345370
def convert_to_oqhazardlib(
            self, tom, simple_mesh_spacing=1.0,
            complex_mesh_spacing=2.0, area_discretisation=10.0,
            use_defaults=False):
        
        oq_source_model = []
        for source in self.sources:
            if isinstance(source, mtkAreaSource):
                oq_source_model.append(source.create_oqhazardlib_source(
                    tom,
                    simple_mesh_spacing,
                    area_discretisation,
                    use_defaults))
            elif isinstance(source, mtkPointSource):
                oq_source_model.append(source.create_oqhazardlib_source(
                    tom,
                    simple_mesh_spacing,
                    use_defaults))
            elif isinstance(source, mtkSimpleFaultSource):
                oq_source_model.append(source.create_oqhazardlib_source(
                    tom,
                    simple_mesh_spacing,
                    use_defaults))
            elif isinstance(source, mtkComplexFaultSource):
                oq_source_model.append(source.create_oqhazardlib_source(
                    tom,
                    complex_mesh_spacing,
                    use_defaults))
            else:
                raise ValueError('Source type not recognised!')
        return oq_source_model
1233128
public static List<ResourceBuilder> builders(ClassLoader classLoader, ResourcesModel resourcesModel) {
        List<ResourceBuilder> builders = new ArrayList<ResourceBuilder>();
        if (resourcesModel != null) {
            for (ResourceModel resourceModel : resourcesModel.getResources()) {
                builders.add(new ResourceBuilder(classLoader, resourceModel));
            }
        }
        return builders;
    }
823753
def get_source_model(self, src_group_id):
        
        for smodel in self.source_models:
            for src_group in smodel.src_groups:
                if src_group.id == src_group_id:
                    return smodel
799059
def source_get(method_name):
    

    def source_get(_value, context, **_params):
        method = getattr(context["model"].source, method_name)
        return _get(method, context["key"], (), {})

    return source_get
1264012
def load(self):
        """"""
        self._list = self._source.load()
        self._list_iter = itertools.cycle(self._list)
150252
public static SourceMapGenerator fromSourceMap(SourceMapConsumer aSourceMapConsumer) {
        String sourceRoot = aSourceMapConsumer.sourceRoot;
        SourceMapGenerator generator = new SourceMapGenerator(aSourceMapConsumer.file, sourceRoot);
        aSourceMapConsumer.eachMapping().forEach(mapping -> {
            Mapping newMapping = new Mapping(mapping.generated);
            if (mapping.source != null) {
                newMapping.source = mapping.source;
                if (sourceRoot != null) {
                    newMapping.source = Util.relative(sourceRoot, newMapping.source);
                }
                newMapping.original = mapping.original;
                if (mapping.name != null) {
                    newMapping.name = mapping.name;
                }
            }
            generator.addMapping(newMapping);
        });
        aSourceMapConsumer.sources().stream().forEach(sourceFile -> {
            String content = aSourceMapConsumer.sourceContentFor(sourceFile, null);
            if (content != null) {
                generator.setSourceContent(sourceFile, content);
            }
        });
        return generator;
    }
709916
def get_source_attributes(source):
    
    attrs = {"id": source.source_id,
             "name": source.name,
             "tectonicRegion": source.tectonic_region_type}
    if isinstance(source, NonParametricSeismicSource):
        if source.data[0][0].weight is not None:
            weights = []
            for data in source.data:
                weights.append(data[0].weight)
            attrs['rup_weights'] = numpy.array(weights)
    print(attrs)
    return attrs
469817
def get_iterator(self, data, axis=0):
        
        splitter = self._get_splitter(data, axis=axis)
        keys = self._get_group_keys()
        for key, (i, group) in zip(keys, splitter):
            yield key, group
495246
def find_sources(*args)
      return to_enum(__method__, *args) unless block_given?

      if environment
        find(*args).each do |asset|
          yield asset.source
        end
      else
        args.each do |path|
          asset = assets[path]
          yield File.binread(File.join(dir, asset)) if asset
        end
      end
    end
422461
public function processResources()
    {
        // Fetching the sources iterator
        $errors = array();
        foreach($this->sourcesIterator as $source) {
            // Processing all resources associated to the current source object
            if ($source instanceof SourceInterface) {
                try {
                    $this->processResourcesBySource($source);
                } catch (Exception\PostParseException $e) {
                    array_push($errors, $e);
                } catch (Exception\ResourceProxyExceptionInterface $e) {
                    $msg = sprintf(
                        'General proxy error caught for the following source: \'%s\'. Error is: \'%s\'.',
                        $source->getName(),
                        $e->getMessage()
                    );
                    array_push($errors, $msg);
                } catch (\Exception $e) {
                    $msg = sprintf(
                        'General error caught for the following source: \'%s\'. Error is: \'%s\'.',
                        $source->getName(),
                        $e->getMessage()
                    );
                    array_push($errors, $msg);
                }
            }
        }

        // If errors, we throw a global process exception
        if (count($errors) > 0) {
            throw new Exception\GlobalProcessException(
                $errors,
                sprintf(
                    'Errors while processing the sources for the following proxy: \'%s\'.',
                    $this->getProxyName()
                )
            );
        }
    }
1077750
async def chain(*sources):
    
    for source in sources:
        async with streamcontext(source) as streamer:
            async for item in streamer:
                yield item
1148865
public static IterationBuilderOver over(Class<? extends WindupVertexFrame> sourceType, String source)
    {
        Iteration iterationImpl = new Iteration(new TypedNamedFramesSelector(sourceType, source));
        iterationImpl.setPayloadManager(new TypedNamedIterationPayloadManager(sourceType,
                    singleVariableIterationName(source)));
        return iterationImpl;
    }
1290860
public List<ResourceFileSource> getSources() {
		List<ResourceFileSource> sources = new ArrayList<ResourceFileSource>();
		sources.add(this);
		return sources;
	}
794991
def generator(self) -> Iterator[str]:
        
        stream = self.stream  # In case that ``self.stream`` is changed.
        stream.seek(0)
        for line in stream:
            yield line
940057
def sources= sources = []
      return unless sources.kind_of? Array
      @sources = sources.map{|source| Hashie::Mash.new source }
    end
710535
def iterSourceCode(paths):
    
    for path in paths:
        if os.path.isdir(path):
            for dirpath, dirnames, filenames in os.walk(path):
                for filename in filenames:
                    full_path = os.path.join(dirpath, filename)
                    if isPythonFile(full_path):
                        yield full_path
        else:
            yield path
777081
def convert_multiple_sources_to_consumable_types (self, project, prop_set, sources):
        
        if __debug__:
            from .targets import ProjectTarget

            assert isinstance(project, ProjectTarget)
            assert isinstance(prop_set, property_set.PropertySet)
            assert is_iterable_typed(sources, virtual_target.VirtualTarget)
        if not self.source_types_:
            return list(sources)

        acceptable_types = set()
        for t in self.source_types_:
            acceptable_types.update(type.all_derived(t))

        result = []
        for source in sources:
            if source.type() not in acceptable_types:
                transformed = construct_types(
                    project, None,self.source_types_, prop_set, [source])
                # construct_types returns [prop_set, [targets]]
                for t in transformed[1]:
                    if t.type() in self.source_types_:
                        result.append(t)
                if not transformed:
                    project.manager().logger().log(__name__, "  failed to convert ", source)
            else:
                result.append(source)

        result = sequence.unique(result, stable=True)
        return result