Get sample value from an arraybuffer depending on the sample format. Internal use only.
177793
function (geoTiffData, byteOffset, numOfBytes, sampleFormat, isLittleEndian) {
                var res;

                switch (sampleFormat) {
                    case TiffConstants.SampleFormat.UNSIGNED:
                        res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, false);
                        break;
                    case TiffConstants.SampleFormat.SIGNED:
                        res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, true);
                        break;
                    case TiffConstants.SampleFormat.IEEE_FLOAT:
                        if (numOfBytes == 3) {
                            res = geoTiffData.getFloat32(byteOffset, isLittleEndian) >>> 8;
                        } else if (numOfBytes == 4) {
                            res = geoTiffData.getFloat32(byteOffset, isLittleEndian);
                        } else if (numOfBytes == 8) {
                            res = geoTiffData.getFloat64(byteOffset, isLittleEndian);
                        }
                        else {
                            Logger.log(Logger.LEVEL_WARNING, "Do not attempt to parse the data  not handled: " +
                                numOfBytes);
                        }
                        break;
                    case TiffConstants.SampleFormat.UNDEFINED:
                    default:
                        res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, false);
                        break;
                }

                return res;
            }
1246949
public static Sample readSample(String filename) {
        InputStream is = readResource(filename);
        return new Sample(is);
    }
835100
@Nullable
    public static String sampledToString(@Nullable Boolean sampled) {
        return sampled == null ? null : (sampled ? DO_SAMPLE_VALUE : DO_NOT_SAMPLE_VALUE);
    }
533174
public static Sample readSample(final URL url) throws IOException {
        checkNotNull(url);
        try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
            return readSample(reader);
        }
    }
112490
def sample_string(self, individual=-1):
        """"""
        base = str(self)
        extra = self.get_sample_info(individual=individual)
        extra = [':'.join([str(j) for j in i]) for i in zip(*extra.values())]
        return '\t'.join([base, '\t'.join(extra)])
272216
public SampleFormat[] getSupportedSampleFormats() {
		IntPointer sampleFormatsPointer = avCodec.sample_fmts();

		if (getType() != MediaType.AUDIO || sampleFormatsPointer == null)
			return null;

		List<SampleFormat> sampleFormats = new ArrayList<SampleFormat>();

		int format;
		int index = 0;
		while ((format = sampleFormatsPointer.get(index++)) != -1)
			sampleFormats.add(SampleFormat.byId(format));

		return sampleFormats.toArray(new SampleFormat[0]);
	}
736875
def get_in_samples(samples, fn):
    
    for sample in samples:
        sample = to_single_data(sample)
        if fn(sample, None):
            return fn(sample)
    return None
1125880
def _get_sample(self, mode, encoding):
        
        self._open_file(mode, encoding)
        self._sample = self._file.read(UniversalCsvReader.sample_size)
        self._file.close()
1023434
public boolean sendSample(SampleMessage sampleMessage) {
    if (!this.canSendSamples) {
      log.warn("Cannot send samples.");
      return false;
    }

    if (this.session.getScheduledWriteMessages() > this.maxOutstandingSamples) {
      log.warn("Buffer full, cannot send sample.");
      return false;
    }
    this.session.write(sampleMessage);
    return true;
  }
78380
def sample(self, hash, limit=None, offset=None):
        ''''''

        uri = self._uris['sample'].format(hash)
        params = {'limit': limit, 'offset': offset}

        return self.get_parse(uri, params)
1138683
function getMean(sample) {
      return (_.reduce(sample, function(sum, x) {
        return sum + x;
      }) / sample.length) || 0;
    }
800222
public static final Timecode getInstance(SampleCount samples, boolean dropFrame)
	{
		return TimecodeBuilder.fromSamples(samples, dropFrame).build();
	}
1111737
def _get_sampleset(model):
    """"""
    if isinstance(model, Model):
        if hasattr(model, 'sampleset'):
            w = model.sampleset()
        else:
            w = None
    else:
        w = model  # Already a sampleset
    return w
1274000
public static Sample readSample(final InputStream inputStream) throws IOException {
        checkNotNull(inputStream);
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
            return readSample(reader);
        }
    }
659644
@Override
  public final void sample()
  {
    long totalCount = _totalCount.get();
    long lastTotal = _lastTotal;
    _lastTotal = totalCount;

    _value = totalCount - lastTotal;
  }
229234
Result getSamplesAsArrays() {
    if ((r_ + h_) == 0) {
      return null;
    }

    final int validIndex = (h_ == 0 ? 1 : 0);
    final Class<?> clazz = data_.get(validIndex).getClass();
    return getSamplesAsArrays(clazz);
  }
704303
private static function sampleRow(array $sample): string
    {
        $row = [];
        foreach ($sample as $index => $feature) {
            $row[] = sprintf('%s:%s', $index + 1, $feature);
        }

        return implode(' ', $row);
    }