Read the specified property of the object, with the optional array index,
    and cast the result into an Any object.
765838
def read_property_to_any(obj, propertyIdentifier, propertyArrayIndex=None):
    """"""
    if _debug: read_property_to_any._debug("read_property_to_any %s %r %r", obj, propertyIdentifier, propertyArrayIndex)

    # get the datatype
    datatype = obj.get_datatype(propertyIdentifier)
    if _debug: read_property_to_any._debug("    - datatype: %r", datatype)
    if datatype is None:
        raise ExecutionError(errorClass='property', errorCode='datatypeNotSupported')

    # get the value
    value = obj.ReadProperty(propertyIdentifier, propertyArrayIndex)
    if _debug: read_property_to_any._debug("    - value: %r", value)
    if value is None:
        raise ExecutionError(errorClass='property', errorCode='unknownProperty')

    # change atomic values into something encodeable
    if issubclass(datatype, Atomic):
        value = datatype(value)
    elif issubclass(datatype, Array) and (propertyArrayIndex is not None):
        if propertyArrayIndex == 0:
            value = Unsigned(value)
        elif issubclass(datatype.subtype, Atomic):
            value = datatype.subtype(value)
        elif not isinstance(value, datatype.subtype):
            raise TypeError("invalid result datatype, expecting %s and got %s" \
                % (datatype.subtype.__name__, type(value).__name__))
    elif not isinstance(value, datatype):
        raise TypeError("invalid result datatype, expecting %s and got %s" \
            % (datatype.__name__, type(value).__name__))
    if _debug: read_property_to_any._debug("    - encodeable value: %r", value)

    # encode the value
    result = Any()
    result.cast_in(value)
    if _debug: read_property_to_any._debug("    - result: %r", result)

    # return the object
    return result
757476
public final int getReadIndex(String property) {
    MethodInfo method = propertyReadMethods.get(property);
    return (null == method) ? -1 : method.index;
  }
108797
public byte[] readProperty(Destination dst, int objIndex, int propID, int start,
		int elements) throws KNXTimeoutException, KNXRemoteException,
		KNXDisconnectException, KNXLinkClosedException
	{
		if (objIndex < 0 || objIndex > 255 || propID < 0 || propID > 255 || start < 0
			|| start > 0xFFF || elements < 0 || elements > 15)
			throw new KNXIllegalArgumentException("argument value out of range");
		final byte[] asdu = new byte[4];
		asdu[0] = (byte) objIndex;
		asdu[1] = (byte) propID;
		asdu[2] = (byte) ((elements << 4) | ((start >>> 8) & 0xF));
		asdu[3] = (byte) start;

		final byte[] apdu = sendWait2(dst, priority, DataUnitBuilder.createAPDU(
			PROPERTY_READ, asdu), PROPERTY_RESPONSE, 4, 14);
		// check if number of elements is 0, indicates access problem
		final int number = (apdu[4] & 0xFF) >>> 4;
		if (number == 0)
			throw new KNXRemoteException("property access failed/forbidden");
		if (number != elements)
			throw new KNXInvalidResponseException("number of elements differ");
		final byte[] prop = new byte[apdu.length - 6];
		for (int i = 0; i < prop.length; ++i)
			prop[i] = apdu[i + 6];
		return prop;
	}
1237483
def read_dict_from_properties(desired_type: Type[dict], file_object: TextIOBase,
                              logger: Logger, conversion_finder: ConversionFinder, **kwargs) -> Dict[str, Any]:
    

    # right now jprops relies on a byte stream. So we convert back our nicely decoded Text stream to a unicode
    # byte stream ! (urgh)
    class Unicoder:
        def __init__(self, file_object):
            self.f = file_object

        def __iter__(self):
            return self

        def __next__(self):
            line = self.f.__next__()
            return line.encode(encoding='utf-8')

    res = jprops.load_properties(Unicoder(file_object))

    # first automatic conversion of strings > numbers
    res = {key: try_parse_num_and_booleans(val) for key, val in res.items()}

    # further convert if required
    return ConversionFinder.convert_collection_values_according_to_pep(res, desired_type, conversion_finder, logger, 
                                                                       **kwargs)
839456
function _setObjectProperty (object, index, replacement) {
  if (index.size().length !== 1) {
    throw new DimensionError(index.size(), 1)
  }

  const key = index.dimension(0)
  if (typeof key !== 'string') {
    throw new TypeError('String expected as index to retrieve an object property')
  }

  // clone the object, and apply the property to the clone
  const updated = clone(object)
  setSafeProperty(updated, key, replacement)

  return updated
}
492221
function (value, array) {
            if (util.isFn(array.indexOf)) {
                return array.indexOf(value);
            } else {
                return $.inArray(value, array);
            }
        }
335037
public static Properties readProperties(InputStream is, Properties props) throws IOException{
        if(props==null)
            props = new Properties();
        try{
            props.load(is);
        }finally{
            is.close();
        }
        return props;
    }
1366868
private Object readValue(Type t) throws IOException {
		switch (t) {
		case START_OBJECT:
			return parseObjectInternal();
		
		case START_ARRAY:
			return parseArrayInternal();
		
		case STRING:
			return lexer.readString();
		
		case NUMBER:
			return lexer.readNumber();
		
		case TRUE:
			return true;
		
		case FALSE:
			return false;
		
		case NULL:
			return null;
			
		default:
			throw new IOException("Unexpected token: " + t);
		}
	}
757311
private static String readArrayProperty(String ref, TypeDef source, Property property) {
        TypeRef typeRef = property.getTypeRef();
        if (typeRef instanceof ClassRef) {
            //TODO: This needs further breakdown, to cover edge cases.
            return readObjectArrayProperty(ref, source, property);
        }

        if (typeRef instanceof PrimitiveRef) {
            return readPrimitiveArrayProperty(ref, source, property);
        }
        throw new IllegalStateException("Property should be either an object or a primitive.");
    }
1138002
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        ObjectInputStream.GetField fields = in.readFields();
        String language = (String)fields.get("language", "");
        String script = (String)fields.get("script", "");
        String country = (String)fields.get("country", "");
        String variant = (String)fields.get("variant", "");
        String extStr = (String)fields.get("extensions", "");
        baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), script, country, variant);
        if (extStr != null && extStr.length() > 0) {
            try {
                InternalLocaleBuilder bldr = new InternalLocaleBuilder();
                bldr.setExtensions(extStr);
                localeExtensions = bldr.getLocaleExtensions();
            } catch (LocaleSyntaxException e) {
                throw new IllformedLocaleException(e.getMessage());
            }
        } else {
            localeExtensions = null;
        }
    }
376441
@SuppressWarnings({"unchecked", "SuspiciousSystemArraycopy"})
    private static void setIndexedValue(Object obj, Property property, int index, Object value, ObjectWrapper options) {
        if (property == null) {
            throw new IllegalArgumentException("Cannot set a new indexed value to a 'null' property.");
        }

        Object propertyValue = property.get(obj);

        if (propertyValue == null) {
            if (options.isAutoInstancing) {
                Class<?> propertyType = property.getType();

                if (propertyType.isAssignableFrom(List.class)) {
                    propertyValue = new ArrayList();
                    property.set(obj, propertyValue);
                } else if (propertyType.isArray()) {
                    propertyValue = Array.newInstance(property.getActualType(), index + 1);
                    property.set(obj, propertyValue);
                } else {
                    throw new IllegalArgumentException("The indexed " + property + " in object "
                                                               + obj.getClass().getSimpleName() + " has value 'null'. Only List and array types can be " +
                                                               "auto instantiated, but " + propertyType.getSimpleName() + " found.");
                }
            } else {
                throw new NullPointerException("Invalid 'null' value found for the indexed '" + property + "' in "
                                                       + obj.getClass().getName() + " object.");
            }
        }

        if (propertyValue instanceof List) {
            List list = (List) propertyValue;
            int size = list.size();

            if (index >= size && options.isAutoGrowing) {
                for (int i = size; i < index; i++) {
                    try {
                        list.add(null);
                    } catch (NullPointerException ex) {
                        throw new NullPointerException("The indexed " + property + " has size lower than the requested '"
                                                               + index + "' index. An attempt to autogrowing it, filling with 'null' values, was made, " +
                                                               " but the List implementation seems to do not accept 'null' values. " + ex.getMessage());
                    }
                }

                list.add(index, value);
            } else {
                try {
                    list.set(index, value);
                } catch (IndexOutOfBoundsException e) {
                    throw new IndexOutOfBoundsException("Cannot set a new value to the indexed list " + property + " in "
                                                                + obj.getClass().getSimpleName() + " as the requested '" + index + "' index is unbound.");
                }
            }
        } else if (propertyValue.getClass().isArray()) {
            int length = Array.getLength(propertyValue);

            if (index >= length && options.isAutoGrowing) {
                Object biggerArray = Array.newInstance(property.getActualType(), index + 1);
                System.arraycopy(propertyValue, 0, biggerArray, 0, length);
                property.set(obj, biggerArray);
                propertyValue = biggerArray;
            }

            try {
                Array.set(propertyValue, index, value);
            } catch (ArrayIndexOutOfBoundsException e) {
                throw new IndexOutOfBoundsException("Cannot set a new value to the indexed array " + property
                                                            + " in " + obj.getClass().getSimpleName() + " as the requested '" + index + "' index is unbound.");
            }
        } else {
            throw new IllegalArgumentException("Cannot set a new value to a not indexed " + property + ". Only List and array " +
                                                       "types are supported, but " + propertyValue.getClass().getName() + " found.");
        }
    }
930027
public LazyObject getJSONObject(int index) throws LazyException{
		LazyNode token=getValueToken(index);
		if(token.type!=LazyNode.OBJECT)throw new LazyException("Requested value is not an object",token);
		LazyObject obj= new LazyObject(token);
		obj.parent=this;
		return obj;
	}
106166
private double[] readListProperty(final ListProperty property)
            throws IOException {
        int valueCount = (int) stream.read(property.getCountType());
        double[] values = new double[valueCount];
        for (int i = 0; i < values.length; i++) {
            values[i] = stream.read(property.getType());
        }
        return values;
    }
261588
private void readObject(java.io.ObjectInputStream s)
        throws java.io.IOException, ClassNotFoundException {
        // Note: This must be changed if any additional fields are defined
        Object a = s.readFields().get("array", null);
        if (a == null || !a.getClass().isArray())
            throw new java.io.InvalidObjectException("Not array type");
        if (a.getClass() != Object[].class)
            a = Arrays.copyOf((Object[])a, Array.getLength(a), Object[].class);
        U.putObjectVolatile(this, ARRAY, a);
    }
1320349
public JSONArray optJSONArray(int index) {
		Object object = opt(index);
		return object instanceof JSONArray ? (JSONArray) object : null;
	}
865425
private static Object getValue(Object obj, String propertyPattern, ObjectWrapper options) {
        if (propertyPattern == null) {
            throw new IllegalArgumentException("Cannot get the value from a property with a 'null' propertyPattern.");
        }

        if (obj == null) {
            // NullPointerException as it is throwed only when traversing a null object (ex: "foo.null.bar")
            throw new NullPointerException("Cannot get the value of '" + propertyPattern + "' from a 'null' object.");
        }

        // '.' position if positive, '[' inverse position if negative
        int position = indexOfDotOrSquare(propertyPattern);

        // (propertyPattern.contains("."))
        if (position > 0) {
            String leftPattern = propertyPattern.substring(0, position);
            String rightPattern = propertyPattern.substring(position + 1, propertyPattern.length());
            Object leftValue = getValue(obj, leftPattern, options);

            return getValue(leftValue, rightPattern, options);
            // if (propertyPattern.contains("["))
        } else if (position < 0) {
            int squarePosition = -position;

            String leftPattern = propertyPattern.substring(0, squarePosition);
            String indexOrKey = propertyPattern.substring(squarePosition + 1, propertyPattern.length() - 1);// removes ']'
            Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);

            if (Map.class.isAssignableFrom(leftProperty.getType())) {
                return getMappedValue(obj, leftProperty, indexOrKey);
            } else {
                try {
                    return getIndexedValue(obj, leftProperty, Integer.parseInt(indexOrKey), options);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("The pattern '" + indexOrKey + "' for the indexed "
                                                               + leftProperty + " is invalid. Cannot parse the string to a valid integer index.");
                }
            }
        }

        return getSimpleValue(obj, getPropertyOrThrow(Bean.forClass(obj.getClass()), propertyPattern));
    }
1038049
@Override
    public Array getArray(int index) {
        check(index);
        final Object obj = fleeceValueToObject(index);
        return obj instanceof Array ? (Array) obj : null;
    }