returns sample data for a data type.
359806
public function sampleData($type)
    {
        switch (strtolower($type)) {
            case 'boolean':
                return 'false';
            case 'integer':
            case 'double':
            case 'int':
                return rand();
            case 'tinyint':
                return rand(0, 9);
            case 'string':
            case 'text':
            case 'varchar':
            case 'character varying':
            case 'tinytext':
            case 'longtext':
                return $this->quoteOrNot(sprintf("behat-test-string-%s", time()));
            case 'char':
                return "'f'";
            case 'timestamp':
            case 'timestamp with time zone':
                return 'NOW()';
            case 'null':
                return null;
            default:
                return $this->quoteOrNot(sprintf("behat-test-string-%s", time()));
        }
    }
757683
def restore_type(self, dtype, sample=None):
        

        # Pandas types
        if pdc.is_bool_dtype(dtype):
            return 'boolean'
        elif pdc.is_datetime64_any_dtype(dtype):
            return 'datetime'
        elif pdc.is_integer_dtype(dtype):
            return 'integer'
        elif pdc.is_numeric_dtype(dtype):
            return 'number'

        # Python types
        if sample is not None:
            if isinstance(sample, (list, tuple)):
                return 'array'
            elif isinstance(sample, datetime.date):
                return 'date'
            elif isinstance(sample, isodate.Duration):
                return 'duration'
            elif isinstance(sample, dict):
                return 'object'
            elif isinstance(sample, six.string_types):
                return 'string'
            elif isinstance(sample, datetime.time):
                return 'time'

        return 'string'
185360
def get_value(self, index):
        """"""
        if index.column() == 0:
            return self.keys[ index.row() ]
        elif index.column() == 1:
            return self.types[ index.row() ]
        elif index.column() == 2:
            return self.sizes[ index.row() ]
        else:
            return self._data[ self.keys[index.row()] ]
300529
private short getDataType(String value)
    {
        short ret = STRING_TYPE;

        if(value.equals("number"))
            ret = NUMBER_TYPE;
        else if(value.equals("integer"))
            ret = INTEGER_TYPE;
        else if(value.equals("decimal"))
            ret = DECIMAL_TYPE;
        else if(value.equals("seconds"))
            ret = SECONDS_TYPE;
        else if(value.equals("datetime"))
            ret = DATETIME_TYPE;
        else if(value.equals("boolean"))
            ret = BOOLEAN_TYPE;

        return ret;
    }
298946
def get_data (self, datakind, integnum):
        """"""

        if integnum < 0 or integnum >= self.n_integrations:
            raise ValueError ('illegal integration number %d' % integnum)

        size = self.sizeinfo.get (datakind)
        if size is None:
            raise ValueError ('unrecognized data kind "%s"' % datakind)

        dtype = _datatypes[datakind]
        offset = self.headsize + integnum * self.intsize
        dslice = self.mmdata[offset:offset+size]
        data = np.fromstring (dslice, dtype=dtype)

        if datakind == 'crossData.bin':
            data = data.reshape ((self.n_baselines, self.n_channels, len (self.crosspols)))
        elif datakind == 'autoData.bin':
            data = data.reshape ((self.n_antennas, self.n_channels, 2))
        elif datakind == 'flags.bin':
            data = data.reshape ((self.n_baselines + self.n_antennas, self.n_channels,
                                  len (self.crosspols)))

        return data
1197189
def RawData(self):
    """"""
    result = collections.OrderedDict()

    i = 0
    while True:
      try:
        name, value, value_type = winreg.EnumValue(self._AccessRootKey(), i)
        # Only support strings here.
        if value_type == winreg.REG_SZ:
          precondition.AssertType(value, Text)
          result[name] = value
      except OSError:
        break

      i += 1

    return result
827768
def get_sample_info(self, obj):
        
        info = self.get_base_info(obj)

        # sample type
        sample_type = obj.getSampleType()
        sample_type_uid = sample_type and sample_type.UID() or ""
        sample_type_title = sample_type and sample_type.Title() or ""

        # sample condition
        sample_condition = obj.getSampleCondition()
        sample_condition_uid = sample_condition \
            and sample_condition.UID() or ""
        sample_condition_title = sample_condition \
            and sample_condition.Title() or ""

        # storage location
        storage_location = obj.getStorageLocation()
        storage_location_uid = storage_location \
            and storage_location.UID() or ""
        storage_location_title = storage_location \
            and storage_location.Title() or ""

        # sample point
        sample_point = obj.getSamplePoint()
        sample_point_uid = sample_point and sample_point.UID() or ""
        sample_point_title = sample_point and sample_point.Title() or ""

        # container type
        container_type = sample_type and sample_type.getContainerType() or None
        container_type_uid = container_type and container_type.UID() or ""
        container_type_title = container_type and container_type.Title() or ""

        # Sampling deviation
        deviation = obj.getSamplingDeviation()
        deviation_uid = deviation and deviation.UID() or ""
        deviation_title = deviation and deviation.Title() or ""

        info.update({
            "sample_id": obj.getId(),
            "batch_uid": obj.getBatchUID() or None,
            "date_sampled": self.to_iso_date(obj.getDateSampled()),
            "sampling_date": self.to_iso_date(obj.getSamplingDate()),
            "sample_type_uid": sample_type_uid,
            "sample_type_title": sample_type_title,
            "container_type_uid": container_type_uid,
            "container_type_title": container_type_title,
            "sample_condition_uid": sample_condition_uid,
            "sample_condition_title": sample_condition_title,
            "storage_location_uid": storage_location_uid,
            "storage_location_title": storage_location_title,
            "sample_point_uid": sample_point_uid,
            "sample_point_title": sample_point_title,
            "environmental_conditions": obj.getEnvironmentalConditions(),
            "composite": obj.getComposite(),
            "client_uid": obj.getClientUID(),
            "client_title": obj.getClientTitle(),
            "contact": self.get_contact_info(obj.getContact()),
            "client_order_number": obj.getClientOrderNumber(),
            "client_sample_id": obj.getClientSampleID(),
            "client_reference": obj.getClientReference(),
            "sampling_deviation_uid": deviation_uid,
            "sampling_deviation_title": deviation_title,
            "sampling_workflow_enabled": obj.getSamplingWorkflowEnabled(),
            "remarks": obj.getRemarks(),
        })
        return info
246309
public <R> R getData(Class<R> dataType) {
        return GSON.fromJson(data, dataType);
    }
1293156
def get_type(data):
    
    import six
    from ..datageometry import DataGeometry

    if isinstance(data, list):
        if isinstance(data[0], (six.string_types, six.text_type, six.binary_type)):
            return 'list_str'
        elif isinstance(data[0], (int, float)):
            return 'list_num'
        elif isinstance(data[0], np.ndarray):
            return 'list_arr'
        else:
            raise TypeError('Unsupported data type passed. Supported types: '
                            'Numpy Array, Pandas DataFrame, String, List of strings'
                            ', List of numbers')
    elif isinstance(data, np.ndarray):
        if isinstance(data[0][0], (six.string_types, six.text_type, six.binary_type)):
            return 'arr_str'
        else:
            return 'arr_num'
    elif isinstance(data, pd.DataFrame):
        return 'df'
    elif isinstance(data, (six.string_types, six.text_type, six.binary_type)):
        return 'str'
    elif isinstance(data, DataGeometry):
        return 'geo'
    else:
        raise TypeError('Unsupported data type passed. Supported types: '
                        'Numpy Array, Pandas DataFrame, String, List of strings'
                        ', List of numbers')
974196
public static SimonType getValueFromInstance(Sample sample) {
		return sample == null ? null : getValueFromSampleType(sample.getClass());
	}
154346
def getdata(self, tree, location, force_string=False):
        """"""
        found = tree.xpath('%s/text()' % location)
        if not found:
            return None
        else:
            data = found[0]
        if force_string:
            return data
        if data == 'True':
            return True
        elif data == 'False':
            return False
        else:
            try:
                return int(data)
            except ValueError:
                try:
                    return float(data)
                except ValueError:
                    # It's a string
                    return data
58910
def _get_sample_select(samples, keep):
    """"""
    k = np.ones_like(samples, dtype=bool)
    if keep is not None:
        k = np.array([s in keep for s in samples], dtype=bool)
        if np.sum(k) == 0:
            logger.warning("No samples matched the keep list")
    return k
954150
def _sample_type(self, sample=None):
        
        data = {}
        sampletype = sample.getSampleType() if sample else None
        if sampletype:
            data = {'obj': sampletype,
                    'id': sampletype.id,
                    'title': sampletype.Title(),
                    'url': sampletype.absolute_url()}
        return data
119643
def get_datatype(self, table: str, column: str) -> str:
        """"""
        return self.flavour.get_datatype(self, table, column).upper()
640558
def get_type_data(self, name):
        """"""
        try:
            return {
                'authority': 'DLKIT.MIT.EDU',
                'namespace': 'NoneType',
                'identifier': name,
                'domain': 'Generic Types',
                'display_name': self.none_types[name] + ' Type',
                'display_label': self.none_types[name],
                'description': ('The ' + self.none_types[name] +
                                ' Type. This type indicates that no type is specified.')
            }
        except IndexError:
            raise NotFound('NoneType: ' + name)
611839
public <R> R getData(Class<R> type) {
        return GSON.fromJson(data, type);
    }
715924
@Override
   public final DATATYPE getData() {
      return (data != null) ? data : convert(getValue(DATA, String.class));
   }