def _rpc(self, *args, **kwargs):
		# prepare request
		if self._attr is 'call':
			blob =  ('__call__', args, kwargs)
		elif self._attr is 'get':
			blob = ('__getattribute__', [self._key], {})
		elif self._attr is 'set':
			blob = ('__set', [self._key, self._value], {})
		elif self._attr is 'del':
			blob = ('__del', [self._key], {})
		elif self._attr is 'dir':
			blob = ('__dir', [], {})
		elif self._attr is 'len':
			blob = ('__len', [], {})
		else:
			raise ValueError('Unknown value for attr: %s' % self.attr)

		self._parsed.append(blob)

		# make request
		if self._obj._sock is not None:
			reply = self._obj._send(self._parsed)
		else:
			with self._obj:
				reply = self._obj._send(self._parsed)

		# parse response
		if reply in 'error':
			return ReqError(reply['error'])
		elif 'proxy' in reply:
			self._str = '(proxy: %s)' % reply['proxy']
			return self
		elif 'result' in reply:
			return reply['result']
		else:
			raise ValueError('reply must be result, proxy or error')

		return result
dataset/ETHPy150Open alexcepoi/pyscale/pyscale/zmq/socket.py/ProxySocket._rpc/swapped operands of `in`