Use this method to create a MultiValue type from a specific GP Value
           type.
           
              >>> gpmultistr = arcrest.GPMultiValue.fromType(arcrest.GPString)
              >>> gpvalue = gpmultistr(["a", "b", "c"])
772058
def fromType(datatype):
        
        if issubclass(datatype, GPBaseType):
            return GPBaseType._get_type_by_name("GPMultiValue:%s" % 
                                                datatype.__name__)
        else:
            return GPBaseType._get_type_by_name("GPMultiValue:%s" % 
                                                str(datatype))
315746
public static <T> FieldValue<T> from(String name, Field<T> field, T defaultValue) {
        return new FieldValue<T>(name, field, defaultValue);
    }
121569
def _opt_call_from_base_type(self, value):
    
    if isinstance(value, _BaseValue):
      value = self._call_from_base_type(value.b_val)
    return value
1277463
public static Object fromPersistenceType(Object value, Class<?> parameterType) {
    if (!isTypeConversionRequired(parameterType)) {
      return value;
    }
    if (Map.class.isAssignableFrom(parameterType) && (value instanceof String[])) {
      String[] rows = (String[])value;
      Map<String, String> map = new LinkedHashMap<>();
      for (int i = 0; i < rows.length; i++) {
        String[] keyValue = ConversionStringUtils.splitPreserveAllTokens(rows[i], KEY_VALUE_DELIMITER.charAt(0));
        if (keyValue.length == 2 && StringUtils.isNotEmpty(keyValue[0])) {
          String entryKey = keyValue[0];
          String entryValue = StringUtils.isEmpty(keyValue[1]) ? null : keyValue[1];
          map.put(ConversionStringUtils.decodeString(entryKey), ConversionStringUtils.decodeString(entryValue));
        }
      }
      return map;
    }
    throw new IllegalArgumentException("Type conversion not supported: " + parameterType.getName());
  }
466618
public static DataValue derivedValue(DataValue from, TimestampsToReturn timestamps) {
        boolean includeSource = timestamps == TimestampsToReturn.Source || timestamps == TimestampsToReturn.Both;
        boolean includeServer = timestamps == TimestampsToReturn.Server || timestamps == TimestampsToReturn.Both;

        return new DataValue(
                from.value,
                from.status,
                includeSource ? from.sourceTime : null,
                includeServer ? from.serverTime : null
        );
    }
206329
public static Datatype.Builder from(Datatype value) {
    if (value instanceof Rebuildable) {
      return ((Rebuildable) value).toBuilder();
    } else {
      return new Datatype.Builder().mergeFrom(value);
    }
  }
1321537
function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
  if (field.resolvedType) {
    if (field.resolvedType instanceof Enum) {
      gen('switch(d%s){', prop);
      for (let values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {
        if (field.repeated && values[keys[i]] === field.typeDefault) gen('default:');
        gen('case%j:', keys[i])('case %i:', values[keys[i]])('m%s=%j', prop, values[keys[i]])('break');
      }
      gen('}');
    } else {
      gen('if(typeof d%s!=="object")', prop)('throw TypeError(%j)', field.fullName + ': object expected')('m%s=types[%i].fromObject(d%s)', prop, fieldIndex, prop);
    }
  } else {
    let isUnsigned = false;
    switch (field.type) {
      case 'double':
      case 'float':
        gen('m%s=Number(d%s)', prop, prop); // also catches "NaN", "Infinity"
        break;
      case 'uint32':
      case 'fixed32':
        gen('m%s=d%s>>>0', prop, prop);
        break;
      case 'int32':
      case 'sint32':
      case 'sfixed32':
        gen('m%s=d%s|0', prop, prop);
        break;
      case 'uint64':
        isUnsigned = true;
        // eslint-disable-line no-fallthrough
      case 'int64':
      case 'sint64':
      case 'fixed64':
      case 'sfixed64':
        gen('if(util.Long)')('(m%s=util.Long.fromValue(d%s)).unsigned=%j', prop, prop, isUnsigned)('else if(typeof d%s==="string")', prop)('m%s=parseInt(d%s,10)', prop, prop)('else if(typeof d%s==="number")', prop)('m%s=d%s', prop, prop)('else if(typeof d%s==="object")', prop)('m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)', prop, prop, prop, isUnsigned ? 'true' : '');
        break;
      case 'bytes':
        gen('if(typeof d%s==="string")', prop)('util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)', prop, prop, prop)('else if(d%s.length)', prop)('m%s=d%s', prop, prop);
        break;
      case 'string':
        gen('m%s=String(d%s)', prop, prop);
        break;
      case 'bool':
        gen('m%s=Boolean(d%s)', prop, prop);
        break;
      default:
        break;
        /* default: gen
            ("m%s=d%s", prop, prop);
            break; */
    }
  }
  return gen;
}
52297
private double fillInterpolatedValues(InterpolationType interpolationType) {
		double interpolatedValue = 0;
		if (shouldDoInterpolation(true)) {

			double y1 = values[indexToInterpolate];

			if (current == indexToInterpolate) {
				return y1;
			}

			long x = timestamps[current];
			long x1 = timestamps[indexToInterpolate];
			if (x == x1) {
				return y1;
			}
			int next = indexToInterpolate + iterators.length;
			double y2 = values[next];
			long x2 = timestamps[next];
			if (x == x2) {
				return y2;
			}

			switch(interpolationType){
			case LININT:
				interpolatedValue = (y2 - y1) / (x2 - x1) * (x - x1) + y1;
				break;
			case ZIMSUM:
				interpolatedValue = 0;
				break;
			default:
				throw new IllegalArgumentException("Invalid interpolation type specified");
			}
		}
		return interpolatedValue;
	}
296962
public static TransientPropertyData createPropertyData(NodeData parent, InternalQName name, int type,
      boolean multiValued)
   {
      QPath path = QPath.makeChildPath(parent.getQPath(), name);
      TransientPropertyData propData =
         new TransientPropertyData(path, IdGenerator.generate(), -1, type, parent.getIdentifier(), multiValued);

      return propData;
   }
54198
def fromDataset(datatype, value, metadata=None, tmap=None):
        
        if tmap is None:
            tmap = typemap
        return tmap[datatype.upper()].fromDataset(value, metadata=metadata)
958409
public static FilterParams fromValue(Object value) {
		if (value instanceof FilterParams)
			return (FilterParams) value;

		AnyValueMap map = AnyValueMap.fromValue(value);
		return new FilterParams(map);
	}
173077
def from_val(val_schema):
    """"""
    definition = getattr(val_schema, "definition", val_schema) if isinstance(
        val_schema, BaseSchema) else val_schema
    if isinstance(definition, dict):
        return _dict_to_teleport(definition)

    if isinstance(definition, list):
        # teleport only supports a single type by default
        if len(definition) == 1:
            return {"Array": from_val(definition[0])}

    if definition in VAL_PRIMITIVES:
        return VAL_PRIMITIVES[definition]

    raise SerializationError(
        "Serializing %r not (yet) supported." % definition)
1343108
public static MountStatus fromValue(int value) {
        MountStatus mountStatus = VALUES.get(value);
        if (mountStatus == null) {
            mountStatus = new MountStatus(value);
            VALUES.put(value, mountStatus);
        }
        return mountStatus;
    }
489693
public static Value.Builder makeValue(Value value1, Value value2, Value... rest) {
    ArrayValue.Builder arrayValue = ArrayValue.newBuilder();
    arrayValue.addValues(value1);
    arrayValue.addValues(value2);
    arrayValue.addAllValues(Arrays.asList(rest));
    return Value.newBuilder().setArrayValue(arrayValue);
  }
307983
public static JCalValue object(ListMultimap<String, Object> value) {
		Map<String, JsonValue> object = new LinkedHashMap<String, JsonValue>();
		for (Map.Entry<String, List<Object>> entry : value) {
			String key = entry.getKey();
			List<Object> list = entry.getValue();

			JsonValue v;
			if (list.size() == 1) {
				v = new JsonValue(list.get(0));
			} else {
				List<JsonValue> array = new ArrayList<JsonValue>(list.size());
				for (Object element : list) {
					array.add(new JsonValue(element));
				}
				v = new JsonValue(array);
			}
			object.put(key, v);
		}
		return new JCalValue(new JsonValue(object));
	}
883681
def p_set_type(self, p):
        ''''''
        p[0] = ast.SetType(value_type=p[3], annotations=p[5])
735838
def create_from(value):
        
        """
        def convert(val):
            if isinstance(val, tuple):
                return tuple(convert(v) for v in val)
            elif isinstance(val, list):
                return [convert(v) for v in val]
            elif isinstance(val, (dict, ElasticDict)):
                return ElasticDict({k: convert(v) for k, v in val.iteritems()})
            else:
                return val

        return convert(value)