Size of the queue for specified destination.

        @param destination: The queue destination (e.g. /queue/foo)
        @type destination: C{str}

        @return: The number of frames in specified queue.
        @rtype: C{int}
346973
def size(self, destination):
        
        if not destination in self.queue_metadata:
            return 0
        else:
            return len(self.queue_metadata[destination]['frames'])
956863
public int getConnectionsActive(SocketDestination destination) {
        if(destination == null) {
            return pool.getTotalResourceCount();
        } else {
            return pool.getTotalResourceCount(destination);
        }
    }
505718
def send(self, frame):
        
        dest = frame.headers.get('destination')
        if not dest:
            raise ProtocolError('Missing destination for SEND command.')

        if dest.startswith('/queue/'):
            self.engine.queue_manager.send(frame)
        else:
            self.engine.topic_manager.send(frame)
1332093
public String getDestinationName(Destination destination) {
        try {
            if (destination instanceof Queue) {
                return ((Queue) destination).getQueueName();
            } else if (destination instanceof Topic) {
                return ((Topic) destination).getTopicName();
            } else {
                return destination.toString();
            }
        } catch (JMSException e) {
            log.error("Unable to resolve destination name", e);
            return "";
        }
    }
987358
def Size(self):
        
        s = super(Block, self).Size() + GetVarSize(self.Transactions)
        return s
523317
@Monitor(name = "batcherQueueSize", type = DataSourceType.GAUGE)
    public int getSize() {
        if (queue != null) {
            return queue.size();
        } else {
            return 0;
        }
    }
788713
private long size(final Jedis jedis, final String queueName) {
        final String key = key(QUEUE, queueName);
        final long size;
        if (JedisUtils.isDelayedQueue(jedis, key)) { // If delayed queue, use ZCARD
            size = jedis.zcard(key);
        } else { // Else, use LLEN
            size = jedis.llen(key);
        }
        return size;
    }
555323
def read(self, size:int=None):
        
        if size:
            result = self._buffer[0:size]
            self._buffer = self._buffer[size:]
            return result
        else:
            result = self._buffer
            self._buffer = ''
            return result
436869
@Override
	public Destination getDestination(PeerDescriptor peer, DestinationReferenceDescriptor destinationReference,Session session) throws JMSException
	{
		String destinationType = destinationReference.getDestinationType();
		String destinationName = destinationReference.getDestinationName();
		
		if (destinationType.equalsIgnoreCase("queue"))
		{
			return session.createQueue(destinationName);
		}
		else
		if (destinationType.equalsIgnoreCase("topic"))
		{
			return session.createTopic(destinationName);
		}
		else
			throw new IllegalArgumentException("Invalid destination type : "+destinationType);
	}
837846
def calculate_size(timeout, durability, transaction_type, thread_id):
    
    data_size = 0
    data_size += LONG_SIZE_IN_BYTES
    data_size += INT_SIZE_IN_BYTES
    data_size += INT_SIZE_IN_BYTES
    data_size += LONG_SIZE_IN_BYTES
    return data_size
1136973
def size(self):
    
    if self._size is None:
      self._size = 0
      for csv_file in self.files:
        self._size += sum(1 if line else 0 for line in _util.open_local_or_gcs(csv_file, 'r'))

    return self._size
1293685
def length(self):
        
        if isinstance(self._value, int):
            return byte_len(self._value)
        if self._value is None:
            return 0
        return len(self._value)
1250044
def size(self):
        
        if hasattr(self._stream, 'len'):
            return len(self._stream)
        elif hasattr(self._stream, 'fileno'):
            return os.fstat(self._stream.fileno()).st_size
        else:
            cur_pos = self._stream.tell()
            size = self._stream.seek(0, os.SEEK_END)
            self._stream.seek(cur_pos)
            return size
629865
def interm_size(self)-> Sequence[Sequence[int]]:
        '''
        '''
        fluents = self.domain.intermediate_fluents
        ordering = self.domain.interm_fluent_ordering
        return self._fluent_size(fluents, ordering)
720835
def output_size(self):
    """"""
    if callable(self._output_size):
      self._output_size = self._output_size()
    return self._output_size
188019
@Override
    public int read(final ByteBuffer destination) throws IOException {

        // Precondition checks
        this.checkClosed();
        if (destination == null) {
            throw new IllegalArgumentException("Destination buffer must be supplied");
        }

        // Init
        final int spaceInBuffer = destination.remaining();
        final int numBytesRemainingInContent, numBytesToRead;

        // Sync up before getting at shared mutable state
        synchronized (this) {
            numBytesRemainingInContent = this.contents.length - this.position;

            // Set position was greater than the size? Just return.
            if (numBytesRemainingInContent <= 0) {
                return -1;
            }

            // We'll read in either the number of bytes remaining in content or the amount of space in the buffer,
            // whichever is smaller
            numBytesToRead = numBytesRemainingInContent >= spaceInBuffer ? spaceInBuffer : numBytesRemainingInContent;
            // Copy a sub-array of the bytes we'll put into the buffer
            destination.put(this.contents, this.position, numBytesToRead);

            // Set the new position
            this.position += numBytesToRead;
        }

        // Return the number of bytes read
        return numBytesToRead;
    }
937922
def get_frameshift_lengths(num_bins):
    
    fs_len = []
    i = 1
    tmp_bins = 0
    while(tmp_bins<num_bins):
        if i%3:
            fs_len.append(i)
            tmp_bins += 1
        i += 1
    return fs_len