# Path: glitter/utils/dtypes.py
# class Datatype(object):
#     def __init__(self, integer, signed, nptype, _gltype=None, charcode=None):
#     def from_numpy(cls, nptype):
#     def _from_gl(cls, _gltype):
#     def as_numpy(self):
#     def _as_gl(self):
#     def as_signed(self):
#     def as_unsigned(self):
#     def as_nbytes(self, nbytes):
#     def is_signed(self):
#     def is_unsigned(self):
#     def is_integer(self):
#     def is_float(self):
#     def is_boolean(self):
#     def charcode(self):
#     def nbytes(self):
#     def __str__(self):
#     def __repr__(self):
#     def coerced(self, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# def coerce_array(data, dtype=None, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# 
# Path: glitter/utils/objects.py
# def with_obj(obj, f):
#     """Create a wrapper that executes C{f} in a C{with obj:} block."""
#     @_wraps(f)
#     def wrapper(*args, **kwargs):
#         with obj:
#             return f(*args, **kwargs)
#     return wrapper


from inspect import getmembers as _getmembers
from glitter.utils.dtypes import coerce_array, int32
from glitter.utils.objects import with_obj
import types as _types
import numpy as _np
import glitter.raw as _gl
import collections
        self._setter = setter
        self._set_args = set_args
        self._dtype = dtype if dtype else int32
        self._shape = None if shape is None else tuple(shape) if hasattr(shape, "__iter__") and not isinstance(shape, str) else (shape,)
        self._enum = enum
        self._name = name

    def __get__(self, obj, cls):
        _value = _np.empty(self._shape, dtype=self._dtype.as_numpy())
        args = list(self._get_args) + [_gl.cast(_value.ctypes, self._getter.argtypes[-1])]
        with obj:
            self._getter(*args)
        value = _value.item() if _value.shape is () else _value
        if self._enum is not None:
            if hasattr(value, "__iter__") and not isinstance(value, str):
                value = [self._enum[x] for x in value]
            else:
                value = self._enum[value]
        return value

    def __set__(self, obj, value):
        if self._setter is None:
            raise AttributeError("can't set attribute")
        if self._enum is not None:
            if hasattr(value, "__iter__") and not isinstance(value, str):
                _value = [self._enum(x)._value for x in value]
            else:
                _value = self._enum(value)._value
        else:
            _value = value

# Path: glitter/utils/dtypes.py
# class Datatype(object):
#     def __init__(self, integer, signed, nptype, _gltype=None, charcode=None):
#     def from_numpy(cls, nptype):
#     def _from_gl(cls, _gltype):
#     def as_numpy(self):
#     def _as_gl(self):
#     def as_signed(self):
#     def as_unsigned(self):
#     def as_nbytes(self, nbytes):
#     def is_signed(self):
#     def is_unsigned(self):
#     def is_integer(self):
#     def is_float(self):
#     def is_boolean(self):
#     def charcode(self):
#     def nbytes(self):
#     def __str__(self):
#     def __repr__(self):
#     def coerced(self, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# def coerce_array(data, dtype=None, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# 
# Path: glitter/utils/objects.py
# def with_obj(obj, f):
#     """Create a wrapper that executes C{f} in a C{with obj:} block."""
#     @_wraps(f)
#     def wrapper(*args, **kwargs):
#         with obj:
#             return f(*args, **kwargs)
#     return wrapper


# Path: glitter/utils/proxy.py
from inspect import getmembers as _getmembers
from glitter.utils.dtypes import coerce_array, int32
from glitter.utils.objects import with_obj
import types as _types
import numpy as _np
import glitter.raw as _gl
import collections

        self._setter = setter
        self._set_args = set_args
        self._dtype = dtype if dtype else int32
        self._shape = None if shape is None else tuple(shape) if hasattr(shape, "__iter__") and not isinstance(shape, str) else (shape,)
        self._enum = enum
        self._name = name

    def __get__(self, obj, cls):
        _value = _np.empty(self._shape, dtype=self._dtype.as_numpy())
        args = list(self._get_args) + [_gl.cast(_value.ctypes, self._getter.argtypes[-1])]
        with obj:
            self._getter(*args)
        value = _value.item() if _value.shape is () else _value
        if self._enum is not None:
            if hasattr(value, "__iter__") and not isinstance(value, str):
                value = [self._enum[x] for x in value]
            else:
                value = self._enum[value]
        return value

    def __set__(self, obj, value):
        if self._setter is None:
            raise AttributeError("can't set attribute")
        if self._enum is not None:
            if hasattr(value, "__iter__") and not isinstance(value, str):
                _value = [self._enum(x)._value for x in value]
            else:
                _value = self._enum(value)._value
        else:
            _value = value

        _value = coerce_array(_value, dtype=self._dtype)