Returns the content length if available or `None` otherwise.
336082
def calculate_content_length(self):
        """"""
        try:
            self._ensure_sequence()
        except RuntimeError:
            return None
        return sum(len(x) for x in self.iter_encoded())
1186519
def encoded_length(self, num_bytes=16):
        
        factor = math.log(256) / math.log(self._alpha_len)
        return int(math.ceil(factor * num_bytes))
153310
def get_length(self, length, trim=0, offset=0):
        
        if trim and not self.has_space(offset + length):
            return self.string[self.pos + offset:]
        elif self.has_space(offset + length):
            return self.string[self.pos + offset:self.pos + offset + length]
        else:
            return ''
1177345
def length(self):
        
        span = self._stop - self._start
        length, modulo = divmod(span, self._step)
        if length < 0:
            return 0
        if modulo != 0:
            return length + 1
        return length
203682
public function getContentLength() {
        $contentLengthKey = OSSHeaders::CONTENT_LENGTH;
        if (isset($this->metadata[$contentLengthKey])) {
            return (int) $this->metadata[$contentLengthKey];
        }

        // mitmproxy's bug, return 'content-length' when head a request.
        $contentLengthKey = strtolower($contentLengthKey);
        if (isset($this->metadata[$contentLengthKey])) {
            return (int) $this->metadata[$contentLengthKey];
        }

        return (int) 0;
    }
226011
protected long calculateContentLength() {

        int result = 0;
        for (CmsFileInfo file : getFilesToUpload().values()) {
            result += file.getFileSize();
        }
        return new Long(result).longValue();
    }
1205614
def get_len(self, key):
        """"""
        data = self.model.get_data()
        return len(data[key])
1249905
def text_length(elem):
    

    if not elem:
        return 0

    value = elem.value()

    try:
        value = len(value)
    except:
        value = 0

    try:
        for a in elem.elements:
            value += len(a.value())
    except:
        pass

    return value
328626
def _chunk_length(self, data):
        """"""

        assert data[-2:] == "\r\n", "CRLF"

        length = data[:-2].split(';')[0] # cut off optional length paramters
        length = int(length.strip(), 16) # length is in hex

        if length:
            logger.debug('Got chunk length: %d', length)
            self.httpstream.read_bytes(length + 2, self._chunk_data)
        else:
            logger.debug('Got last chunk (size 0)')
            self.got_request = True
            # enable input write event so the handler can finish things up 
            # when it has written all pending data
            self.ioloop.update_handler(self.fd_stdin, self.ioloop.WRITE | self.ioloop.ERROR)
1370818
def _get_example_length(example):
  """"""
  length = tf.maximum(tf.shape(example[0])[0], tf.shape(example[1])[0])
  return length
960188
def fixed_length(cls, l, allow_empty=False):
        """"""
        return cls(l, l, allow_empty=allow_empty)
745240
public function getContentLength(): ?int
    {
        $result = $this->serverRequest->getHeader('Content-Length');
        return $result ? (int) $result[0] : null;
    }
649345
def getIndexedLength(self) :
		""""""
		if self.x1 != None and self.x2 != None:
			return self.x2 - self.x1
		else :
			if len(self.children) == 0 :
				return 0
			else :
				l = self.children[0].x2 - self.children[0].x1
				for i in range(1, len(self.children)) :
					l += self.children[i].x2 - self.children[i].x1 - max(0, self.children[i-1].x2 - self.children[i].x1)
				return l
354651
def get_remote_file_size(self, url):
        
        headers = requests.head(url).headers
        return int(headers['content-length'])
1122900
def excluded_length(self):
        """"""
        return sum([shot.length for shot in self.shots if Exclude.LENGTH in shot.flags or Exclude.TOTAL in shot.flags])
984432
def contents_size(self):
        '''
        
        '''
        count = 0
        if hasattr(self,'variables'): count += 1
        if hasattr(self,'types'): count += 1
        if hasattr(self,'modules'): count += 1
        if hasattr(self,'submodules'): count += 1
        if hasattr(self,'subroutines'): count += 1
        if hasattr(self,'modprocedures'): count += 1
        if hasattr(self,'functions'): count += 1
        if hasattr(self,'interfaces'): count += 1
        if hasattr(self,'absinterfaces'): count += 1
        if hasattr(self,'programs'): count += 1
        if hasattr(self,'boundprocs'): count += 1
        if hasattr(self,'finalprocs'): count += 1
        if hasattr(self,'enums'): count += 1
        if hasattr(self,'procedure'): count += 1
        if hasattr(self,'constructor'): count += 1
        if hasattr(self,'modfunctions'): count += 1
        if hasattr(self,'modsubroutines'): count += 1
        if hasattr(self,'modprocs'): count += 1
        if getattr(self,'src',None): count += 1
        return count
532029
def length(self):
        

        if not self.__length:
            self.__length = self.__get_length()

        return self.__length