Return a fully-qualified queue string.
436778
def queue_path(cls, project, location, queue):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/locations/{location}/queues/{queue}",
            project=project,
            location=location,
            queue=queue,
        )
506502
private static com.enioka.jqm.api.Queue getQueue(Queue queue)
    {
        com.enioka.jqm.api.Queue q = new com.enioka.jqm.api.Queue();

        q.setDescription(queue.getDescription());
        q.setId(queue.getId());
        q.setName(queue.getName());

        return q;
    }
491283
def fastq(self):
        '''
        
        '''
        if self.qual is None:
            self._fastq = None
        else:
            if self._fastq is None:
                self._fastq = '@{}\n{}\n+\n{}'.format(self.id, self.sequence, self.qual)
        return self._fastq
1125005
def ready(self):
        """"""
        if self.__timeout < time.time():
            self.cancel()
        return self.__queue.full() and not self.__queue.empty()
1157577
def queue(p_queue, host=None):
    ''''''
    if host is not None:
        return _path(_c.FSQ_QUEUE, root=_path(host, root=hosts(p_queue)))
    return _path(p_queue, _c.FSQ_QUEUE)
302162
public static String getQueueURL(String name) {
		try {
			return getClient().getQueueUrl(name).getQueueUrl();
		} catch (Exception e) {
			logger.info("Queue '{}' could not be found: {}", name, e.getMessage());
			return null;
		}
	}
651493
def _submit_to_queue(self, script_file):
        """"""
        if sys.version_info[0] < 3:
            process = Popen(['qsub', script_file], stdout=PIPE, stderr=PIPE)
        else:
            # need string not bytes so must use universal_newlines
            process = Popen(['qsub', script_file], stdout=PIPE, stderr=PIPE, universal_newlines=True)

        out, err = process.communicate()
        # grab the return code. PBS returns 0 if the job was successful
        queue_id = None
        if process.returncode == 0:
            try:
                # output should of the form '2561553.sdb' or '352353.jessup' - just grab the first part for job id
                queue_id = int(out.split('.')[0])
            except:
                # probably error parsing job code
                logger.critical("Could not parse job id following qsub...")
        return SubmitResults(qid=queue_id, out=out, err=err, process=process)
116057
def _get_queue(config):
    '''
    
    '''

    if 'watchdog.observer' not in __context__:
        queue = collections.deque()
        observer = Observer()
        for path in config.get('directories', {}):
            path_params = config.get('directories').get(path)
            masks = path_params.get('mask', DEFAULT_MASK)
            event_handler = Handler(queue, masks)
            observer.schedule(event_handler, path)

        observer.start()

        __context__['watchdog.observer'] = observer
        __context__['watchdog.queue'] = queue

    return __context__['watchdog.queue']
1265710
def queues(self, page=None, per_page=None, previous=None, prefix=None):
        
        options = {}
        if page is not None:
            raise Exception('page param is deprecated!')
        if per_page is not None:
            options['per_page'] = per_page
        if previous is not None:
            options['previous'] = previous
        if prefix is not None:
            options['prefix'] = prefix

        query = urlencode(options)
        url = 'queues'
        if query != '':
            url = "%s?%s" % (url, query)
        result = self.client.get(url)

        return [queue['name'] for queue in result['body']['queues']]
122807
def item(p_queue, queue_id, host=None):
    if host is not None:
        return os.path.join(_path(host, _c.FSQ_QUEUE, root=hosts(p_queue)),
                            valid_name(queue_id))
    ''''''
    return os.path.join(_path(p_queue, _c.FSQ_QUEUE), valid_name(queue_id))
358638
def enqueue(self, name, value, valueType=None, stamp=None):
    """"""
    # If queue is too large, refuse to log.
    if self.maxQueueSize and self.queue.qsize() > self.maxQueueSize:
      return
    # Stick arguments into the queue
    self.queue.put((name, value, valueType, stamp))
492802
def format(self, format):
    """"""

    job_id = "%d - %d" % (self.job.id, self.id)
    queue = self.job.queue_name if self.machine_name is None else self.machine_name
    status = "%s" % self.status + (" (%d)" % self.result if self.result is not None else "" )

    return format.format("", job_id, queue, status)
99650
def get_queue(self, queue_redis_key):
        
        try:
            queue_pk = int(queue_redis_key.split(':')[-2])
        except:
            raise DoesNotExist('Unable to get the queue from the key %s' % queue_redis_key)
        return self.queue_model.get(queue_pk)
47875
def get_active_queue(self):
        """"""

        # Get dict of active queues keyed by name
        queues = {q['jobQueueName']: q for q in self._client.describe_job_queues()['jobQueues']
                  if q['state'] == 'ENABLED' and q['status'] == 'VALID'}
        if not queues:
            raise Exception('No job queues with state=ENABLED and status=VALID')

        # Pick the first queue as default
        return list(queues.keys())[0]
710841
def get_queue_for_job(self, job):
        
        if self._queue is not None:
            return self._queue
        key = '{0}{1}'.format(self.queue_class.redis_queue_namespace_prefix,
                              job.origin)
        return self.queue_class.from_queue_key(
                key, connection=self.connection, job_class=self.job_class)
1315486
def info(self):
        
        url = "queues/%s" % (self.name,)
        result = self.client.get(url)

        return result['body']['queue']
263896
def get_queue(name='default', default_timeout=None, is_async=None,
              autocommit=None, connection=None, queue_class=None, job_class=None, **kwargs):
    
    from .settings import QUEUES

    if kwargs.get('async') is not None:
        is_async = kwargs['async']
        warnings.warn('The `async` keyword is deprecated. Use `is_async` instead', DeprecationWarning)

    # If is_async is provided, use it, otherwise, get it from the configuration
    if is_async is None:
        is_async = QUEUES[name].get('ASYNC', True)
    # same for job_class
    job_class = get_job_class(job_class)

    if default_timeout is None:
        default_timeout = QUEUES[name].get('DEFAULT_TIMEOUT')
    if connection is None:
        connection = get_connection(name)
    queue_class = get_queue_class(QUEUES[name], queue_class)
    return queue_class(name, default_timeout=default_timeout,
                       connection=connection, is_async=is_async,
                       job_class=job_class, autocommit=autocommit, **kwargs)