Get simon type from simon sample instance.

@param sample Simon sample
@return Type
974196
public static SimonType getValueFromInstance(Sample sample) {
		return sample == null ? null : getValueFromSampleType(sample.getClass());
	}
887059
private org.javasimon.jmx.StopwatchSample sampleStopwatch(Simon s) {
		return new StopwatchSample((org.javasimon.StopwatchSample) s.sample());
	}
650603
String _getTemplateOfType(Type type, IJsonMarshaller jsonMarshaller) {
		if (ParameterizedType.class.isAssignableFrom(type.getClass())) {
			return getTemplateOfParameterizedType((ParameterizedType) type, jsonMarshaller);
		}
		try {
			return jsonMarshaller.toJson(getInstanceOfClass((Class) type));
		} catch (JsonMarshallingException ex) {
		}
		return ((Class) type).getSimpleName().toLowerCase(Locale.ENGLISH);
	}
145378
public org.efaps.admin.ui.Table getType()
    {
        org.efaps.admin.ui.Table ret = null;
        try {
            ret =  org.efaps.admin.ui.Table.get(this.uuid);
        } catch (final CacheReloadException e) {
            CITable.LOG.error("Error on retrieving Type for CIType with uuid: {}", this.uuid);
        }
        return ret;
    }
1039858
public static Class normalizeType(Class type) {
		SimonType simonType = SimonTypeFactory.getValueFromType(type);
		Class normalizedType;
		if (simonType == null) {
			simonType = SimonTypeFactory.getValueFromSampleType(type);
			if (simonType == null) {
				normalizedType = type;
			} else {
				normalizedType = simonType.getSampleType();
			}
		} else {
			normalizedType = simonType.getType();
		}
		return normalizedType;
	}
1011635
@Override
    public double[] sample(long sampleSize) {
        if (sampleSize <= 0) {
            throw new NotStrictlyPositiveException(LocalizedFormats.NUMBER_OF_SAMPLES, sampleSize);
        }
        // FIXME: int cast
        double[] out = new double[(int) sampleSize];
        for (int i = 0; i < sampleSize; i++) {
            out[i] = sample();
        }
        return out;
    }
1018623
public static PactDslRootValue stringType(String example) {
    PactDslRootValue value = new PactDslRootValue();
    value.setValue(example);
    value.setMatcher(TypeMatcher.INSTANCE);
    return value;
  }
884861
private JSType getJSType(Node n) {
    JSType type = n.getJSType();
    if (type == null) {
      // TODO(bradfordcsmith): This branch indicates a compiler bug. It should throw an exception.
      return compiler.getTypeRegistry().getNativeType(JSTypeNative.UNKNOWN_TYPE);
    } else {
      return type;
    }
  }
1030316
public com.google.privacy.dlp.v2.CloudStorageOptions.SampleMethod getSampleMethod() {
    @SuppressWarnings("deprecation")
    com.google.privacy.dlp.v2.CloudStorageOptions.SampleMethod result =
        com.google.privacy.dlp.v2.CloudStorageOptions.SampleMethod.valueOf(sampleMethod_);
    return result == null
        ? com.google.privacy.dlp.v2.CloudStorageOptions.SampleMethod.UNRECOGNIZED
        : result;
  }
1348041
protected Sample createSampleObject(List<? extends ByteBuffer> nals) {
        byte[] sizeInfo = new byte[nals.size() * 4];
        ByteBuffer sizeBuf = ByteBuffer.wrap(sizeInfo);
        for (ByteBuffer b : nals) {
            sizeBuf.putInt(b.remaining());
        }

        ByteBuffer[] data = new ByteBuffer[nals.size() * 2];

        for (int i = 0; i < nals.size(); i++) {
            data[2 * i] = ByteBuffer.wrap(sizeInfo, i * 4, 4);
            data[2 * i + 1] = nals.get(i);
        }

        return new SampleImpl(data, getCurrentSampleEntry());
    }
775565
public Class<?> getJavaType() {
		if(javaType==null) {
			javaType=JKTypeMapping.getType(getCode()).getClass();
			if(javaType==null) {
				JK.error("JKType cannot by null, and code not avaiable %s",code);
			}
		}
		return javaType;
	}
681982
static Collection<Sample> samples(Collection<SampleDTO> samples) {
        return Collections2.transform(samples, DTO_TO_SAMPLE);
    }
1177609
public static String getExample(TypeDeclaration type) {
		if (type == null || type.example() == null) {
			return null;
		} else {
			return type.example().value();
		}
	}
1175785
@Override
    public DataSet sample(int numSamples, boolean withReplacement) {
        return sample(numSamples, Nd4j.getRandom(), withReplacement);
    }
903997
public static Types instance(Context context) {
        Types instance = context.get(typesKey);
        if (instance == null)
            instance = new Types(context);
        return instance;
    }
702229
def get_default_sample(self):
        
        if self.type not in Object.Types or self.type is Object.Types.type:
            return self.type_object.get_sample()
        else:
            return self.get_object().get_sample()
2889
public void selectExample(final ExampleData example) {
		try {
			StringBuilder exampleName = new StringBuilder();
			if (example.getExampleGroupName() != null && !example.getExampleGroupName().equals("")) {
				exampleName.append(example.getExampleGroupName()).append(" - ");
			}
			exampleName.append(example.getExampleName());
			selectExample(example.getExampleClass().newInstance(), exampleName.toString());
		} catch (Exception e) {
			WMessages.getInstance(this).error("Error selecting example \"" + example.
					getExampleName() + '"');
			selectExample(new ErrorComponent(e.getMessage(), e), "Error");
		}
	}