Returns a tuple of all connected devices matching query.

        :param query: regular expression used to match devices.
778303
def list_resources(self, session, query='?*::INSTR'):
        

        # For each session type, ask for the list of connected resources and merge them into a single list.

        resources = self.devices.list_resources()

        resources = rname.filter(resources, query)

        if resources:
            return resources

        raise errors.VisaIOError(errors.StatusCode.error_resource_not_found.value)
697954
def find_all(self, query):
        

        match = re.match(storage.BASE_BACKUP_REGEXP, query)

        if match is not None:
            for backup in iter(self):
                if backup.name == query:
                    yield backup
        elif query == 'LATEST':
            all_backups = list(iter(self))

            if not all_backups:
                return

            assert len(all_backups) > 0

            all_backups.sort(key=lambda bi: bi.last_modified)
            yield all_backups[-1]
        else:
            raise exception.UserException(
                msg='invalid backup query submitted',
                detail='The submitted query operator was "{0}."'
                .format(query))
789632
def split_query(query: str) -> List[str]:
    
    try:
        _query = query.strip()
    except (ValueError, AttributeError):
        raise QueryParserException('query is not valid, received instead {}'.format(query))

    expressions = _query.split(',')
    expressions = [exp.strip() for exp in expressions if exp.strip()]
    if not expressions:
        raise QueryParserException('Query is not valid: {}'.format(query))

    return expressions
932797
def query_fetch_all(self, query, values):
        
        self.cursor.execute(query, values)
        retval = self.cursor.fetchall()
        self.__close_db()
        return retval
1052291
public <T> List<T> search(org.beangle.commons.dao.query.Query<T> query) {
    if (query instanceof LimitQuery) {
      org.beangle.commons.dao.query.LimitQuery<T> limitQuery = (org.beangle.commons.dao.query.LimitQuery<T>) query;
      if (null == limitQuery.getLimit()) {
        return QuerySupport.find(limitQuery, getSession());
      } else {
        return new SinglePage<T>(limitQuery.getLimit().getPageIndex(), limitQuery.getLimit().getPageSize(),
            QuerySupport.count(limitQuery, getSession()), QuerySupport.find(query, getSession()));
      }
    } else {
      return QuerySupport.find(query, getSession());
    }
  }
1059856
def query(self, query, fetchall=False, **params):
        
        with self.get_connection() as conn:
            return conn.query(query, fetchall, **params)
147712
def matches_query(self, key, query):
        
        dumped = query.dump()
        dumped['className'] = query._query_class._class_name
        self._add_condition(key, '$inQuery', dumped)
        return self
49318
def devices(self):
        
        eax = self.attributes.get('devices')
        if eax is None:
            eax = self._all_devices
        if not isinstance(eax, list):
            eax = [eax]
        return [str(dev) for dev in eax]
249487
def devices(self):
        ''''''
        out = self.run_cmd('devices') #subprocess.check_output([self.adb_path(), 'devices']).decode("utf-8")
        if 'adb server is out of date' in out:
            out = self.run_cmd('devices')
        match = "List of devices attached"
        index = out.find(match)
        if index < 0:
            raise EnvironmentError("adb is not working.")
        return dict(re.findall(r'([^\s]+)\t(\w+)', out))
749806
def get_all_connected_devices(self):
        
        self.bbox_auth.set_access(BboxConstant.AUTHENTICATION_LEVEL_PUBLIC, BboxConstant.AUTHENTICATION_LEVEL_PRIVATE)
        self.bbox_url.set_api_name(BboxConstant.API_HOSTS, None)
        api = BboxApiCall(self.bbox_url, BboxConstant.HTTP_METHOD_GET, None,
                          self.bbox_auth)
        resp = api.execute_api_request()
        return resp.json()[0]["hosts"]["list"]
993186
def find(self, query):
        
        try:
            return self._finder(finditem, query)
        except StopIteration:
            raise CellNotFound(query)
1216104
def get_prefixes(self, query):
        
        try:
            res = Prefix.smart_search(query, {})
        except socket.error:
            print >> sys.stderr, "Connection refused, please check hostname & port"
            sys.exit(1)
        except xmlrpclib.ProtocolError:
            print >> sys.stderr, "Authentication failed, please check your username / password"
            sys.exit(1)

        for p in res['result']:
            p.prefix_ipy = IPy.IP(p.prefix)
            self.prefixes.append(p)
760158
def is_device_connected(self, ip):
        
        all_devices = self.get_all_connected_devices()
        for device in all_devices:
            if ip == device['ipaddress']:
                return device['active'] == 1
        return False
17026
def _match_registers(self, query):
        
        if query in self._status_registers:
            register = self._status_registers[query]
            response = register.value
            logger.debug('Found response in status register: %s',
                         repr(response))
            register.clear()

            return response
1165647
def search(query, count=10)
      return [] if query.length < 4
      response = @connection.get DOMESTIC_URL, params: { q: query.to_ascii, count: count }
      addresses = response.parsed['addresses'].each do |a|
        a['address_id'] = Integer(a['address_id'])
        a['dpid'] = Integer(a['dpid']) if a['dpid']
      end
      addresses.map {|address| OpenStruct.new(address)}
    end
594349
def count(self, query=None, indices=None, doc_types=None, **query_params):
        
        from .query import MatchAllQuery

        if query is None:
            query = MatchAllQuery()
        body = {"query": query.serialize()}
        path = self._make_path(indices, doc_types, "_count")
        return self._send_request('GET', path, body, params=query_params)
144119
def match(self, query):
        
        if not self.can_select:
            ch_id = self._device._properties['selected_channel'].get_value()
            if ch_id in self._ids:
                self._selected = ch_id
            else:
                return

            response = self._match_dialog(query,
                                          self._dialogues['__default__'])
            if response is not None:
                return response

            response = self._match_getters(query,
                                           self._getters['__default__'])
            if response is not None:
                return response

        else:
            for ch_id in self._ids:
                self._selected = ch_id
                response = self._match_dialog(query,
                                              self._dialogues[ch_id])
                if response is not None:
                    return response

                response = self._match_getters(query,
                                               self._getters[ch_id])

                if response is not None:
                    return response

        return self._match_setters(query)