Returns a list of input readers for the input spec.

    Args:
      mapper_spec: The MapperSpec for this InputReader.

    Returns:
      A list of InputReaders.
330624
def split_input(cls, mapper_spec):
    
    batch_size = int(_get_params(mapper_spec).get(
        cls.BATCH_SIZE_PARAM, cls._BATCH_SIZE))
    shard_count = mapper_spec.shard_count
    namespace_ranges = namespace_range.NamespaceRange.split(shard_count,
                                                            contiguous=True)
    return [NamespaceInputReader(ns_range, batch_size)
            for ns_range in namespace_ranges]
315792
def validate(cls, mapper_spec):
    
    if mapper_spec.input_reader_class() != cls:
      raise BadReaderParamsError("Mapper input reader class mismatch")
    params = _get_params(mapper_spec)
    if cls.BLOB_KEYS_PARAM not in params:
      raise BadReaderParamsError("Must specify 'blob_keys' for mapper input")
    blob_keys = params[cls.BLOB_KEYS_PARAM]
    if isinstance(blob_keys, basestring):
      # This is a mechanism to allow multiple blob keys (which do not contain
      # commas) in a single string. It may go away.
      blob_keys = blob_keys.split(",")
    if len(blob_keys) > cls._MAX_BLOB_KEYS_COUNT:
      raise BadReaderParamsError("Too many 'blob_keys' for mapper input")
    if not blob_keys:
      raise BadReaderParamsError("No 'blob_keys' specified for mapper input")
    for blob_key in blob_keys:
      blob_info = blobstore.BlobInfo.get(blobstore.BlobKey(blob_key))
      if not blob_info:
        raise BadReaderParamsError("Could not find blobinfo for key %s" %
                                   blob_key)
160356
public static List<Specification> parseInputSpecification(InputStream in) {
        List<Specification> monitorables = new ArrayList<>();
        try {
            ObjectMapper mapper = new ObjectMapper();
            JsonNode metrics = mapper.readTree(in).path("metrics");
            for (JsonNode node : metrics) {
                monitorables.add(specificationAdapter.fromJson(node));
            }
        } catch (Exception e) {
            logger.error(String.format("Unexpected JSON format%n%s", e.getMessage()));
        }
        return monitorables;
    }
775584
def validate(cls, mapper_spec):
    
    if mapper_spec.output_writer_class() != cls:
      raise errors.BadWriterParamsError("Output writer class mismatch")
    params = output_writers._get_params(mapper_spec)
    # Bucket Name is required
    if cls.BUCKET_NAME_PARAM not in params:
      raise errors.BadWriterParamsError(
          "%s is required for the _HashingGCSOutputWriter" %
          cls.BUCKET_NAME_PARAM)
224621
public ServiceCall<Classifiers> listClassifiers(ListClassifiersOptions listClassifiersOptions) {
    String[] pathSegments = { "v3/classifiers" };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments));
    builder.query("version", versionDate);
    Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("watson_vision_combined", "v3", "listClassifiers");
    for (Entry<String, String> header : sdkHeaders.entrySet()) {
      builder.header(header.getKey(), header.getValue());
    }
    builder.header("Accept", "application/json");
    if (listClassifiersOptions != null) {
      if (listClassifiersOptions.verbose() != null) {
        builder.query("verbose", String.valueOf(listClassifiersOptions.verbose()));
      }
    }
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Classifiers.class));
  }
865761
def getReadAlignments(self, reference, start=None, end=None):
        
        return self._getReadAlignments(reference, start, end, self, None)
233764
def load_lists(keys=[], values=[], name='NT'):
    
    mapping = dict(zip(keys, values))
    return mapper(mapping, _nt_name=name)
1071523
def _get_all_unmapped_reads(self, fout):
        ''''''
        sam_reader = pysam.Samfile(self.bam, "rb")
        for read in sam_reader.fetch(until_eof=True):
            if read.is_unmapped:
                print(mapping.aligned_read_to_read(read, ignore_quality=not self.fastq_out), file=fout)
565756
public static Reader reader(Format type, InputStream in, Map<String, ReadHandler<?, ?>> customHandlers) {
        return reader(type, in, customHandlers, null);
    }
363101
@Override
  public ArrayList<Read> getUnmappedMates(Read read) {
    if (read.getNumberReads() < 2 ||
        (read.hasNextMatePosition() && read.getNextMatePosition() != null) ||
        !read.hasAlignment() || read.getAlignment() == null ||
        !read.getAlignment().hasPosition() || read.getAlignment().getPosition() == null ||
        read.getAlignment().getPosition().getReferenceName() == null || read.getAlignment().getPosition().getReferenceName().isEmpty() ||
        read.getFragmentName() == null || read.getFragmentName().isEmpty()) {
      return null;
    }
    final String reference = read.getAlignment().getPosition().getReferenceName();
    final String key = getReadKey(read);
    
    Map<String, ArrayList<Read>> reads = unmappedReads.get(reference);
    if (reads != null) {
      final ArrayList<Read> mates = reads.get(key);
      if (mates != null && mates.size() > 1) {
        Collections.sort(mates, matesComparator);
      }
      return mates;
    }
    return null;
  }
856042
def all_dataset_ids(self, reader_name=None, composites=False):
        
        try:
            if reader_name:
                readers = [self.readers[reader_name]]
            else:
                readers = self.readers.values()
        except (AttributeError, KeyError):
            raise KeyError("No reader '%s' found in scene" % reader_name)

        all_datasets = [dataset_id
                        for reader in readers
                        for dataset_id in reader.all_dataset_ids]
        if composites:
            all_datasets += self.all_composite_ids()
        return all_datasets
103937
def _getReadAlignments(
            self, reference, start, end, readGroupSet, readGroup):
        
        # TODO If reference is None, return against all references,
        # including unmapped reads.
        samFile = self.getFileHandle(self._dataUrl)
        referenceName = reference.getLocalId().encode()
        # TODO deal with errors from htslib
        start, end = self.sanitizeAlignmentFileFetch(start, end)
        readAlignments = samFile.fetch(referenceName, start, end)
        for readAlignment in readAlignments:
            tags = dict(readAlignment.tags)
            if readGroup is None:
                if 'RG' in tags:
                    alignmentReadGroupLocalId = tags['RG']
                    readGroupCompoundId = datamodel.ReadGroupCompoundId(
                        readGroupSet.getCompoundId(),
                        str(alignmentReadGroupLocalId))
                yield self.convertReadAlignment(
                    readAlignment, readGroupSet, str(readGroupCompoundId))
            else:
                if self._filterReads:
                    if 'RG' in tags and tags['RG'] == self._localId:
                        yield self.convertReadAlignment(
                            readAlignment, readGroupSet,
                            str(readGroup.getCompoundId()))
                else:
                    yield self.convertReadAlignment(
                        readAlignment, readGroupSet,
                        str(readGroup.getCompoundId()))
942835
def get_reader_factory_for(self, name, *, format=None):
        
        return self.get_factory_for(READER, name, format=format)
143900
def create_sampler(self, inputs, targets, input_reader=None, target_reader=None, 
        input_transform=None, target_transform=None, co_transform=None,
        input_return_processor=None, target_return_processor=None, co_return_processor=None):
        
        pass
5012
public List<MapRow> readTable(TableReader reader) throws IOException
   {
      reader.read();
      return reader.getRows();
   }
1007550
public <T> T parse(Reader in, JsonReaderI<T> mapper) throws ParseException {
		this.base = mapper.base;
		//
		this.in = in;
		return super.parse(mapper);
	}
521895
public Collection<Task> scan(final Reader reader) throws IOException {
        try {
            if (isInvalidPattern) {
                throw new AbortException(errorMessage.toString());
            }
            LineIterator lineIterator = IOUtils.lineIterator(reader);
            List<Task> tasks = new ArrayList<Task>();
            for (int lineNumber = 1; lineIterator.hasNext(); lineNumber++) {
                String line = (String)lineIterator.next();

                for (Priority priority : Priority.values()) {
                    if (patterns.containsKey(priority)) {
                        Matcher matcher = patterns.get(priority).matcher(line);
                        if (matcher.matches() && matcher.groupCount() == 2) {
                            String message = matcher.group(2).trim();
                            tasks.add(new Task(priority, lineNumber, matcher.group(1), StringUtils.remove(message, ":").trim()));
                        }
                    }
                }
            }

            return tasks;
        }
        finally {
            reader.close();
        }
    }