Extract the content length from an input line.
767531
def _content_length(line):
        """"""
        if line.startswith(b'Content-Length: '):
            _, value = line.split(b'Content-Length: ')
            value = value.strip()
            try:
                return int(value)
            except ValueError:
                raise ValueError("Invalid Content-Length header: {}".format(value))

        return None
1123155
public Object readLengthList(AbstractHessianInput in, int length)
        throws IOException
    {
        Object[] data = createArray(length);

        in.addRef(data);

        if (_componentType != null) {
            for (int i = 0; i < data.length; i++)
                data[i] = in.readObject(_componentType);
        }
        else {
            for (int i = 0; i < data.length; i++)
                data[i] = in.readObject();
        }

        return data;
    }
96786
def input_format(self, content_type):
        """"""
        return getattr(self, '_input_format', {}).get(content_type, hug.defaults.input_format.get(content_type, None))
38642
def get_text_length(*args):
    
    """
    txt = Image.new('RGBA', (16, 16), (255, 255, 255, 0))
    d = ImageDraw.Draw(txt)
    font = ImageFont.truetype("DejaVuSans", 11)
    result = ()
    for value in args:
        result = result + (d.textsize(value, font=font)[0], )
    return result
1144684
def _lengstr(obj):
    '''
    '''
    n = leng(obj)
    if n is None:  # no len
       r = ''
    elif n > _len(obj):  # extended
       r = ' leng %d!' % n
    else:
       r = ' leng %d' % n
    return r
1078439
def _ReadPartial(self, length):
    """"""
    chunk = self.offset // self.chunksize
    chunk_offset = self.offset % self.chunksize

    # If we're past the end of the file, we don't have a chunk to read from, so
    # we can't read anymore. We return the empty string here so we can read off
    # the end of a file without raising, and get as much data as is there.
    if chunk > self.last_chunk:
      return ""

    available_to_read = min(length, self.chunksize - chunk_offset)

    fd = self._GetChunkForReading(chunk)

    fd.seek(chunk_offset)

    result = fd.read(available_to_read)
    self.offset += len(result)

    return result
1061582
def read_len( f ):
    """"""
    mapping = dict()
    for line in f:
        fields = line.split()
        mapping[ fields[0] ] = int( fields[1] )
    return mapping
408810
def convertLengthList(self, svgAttr):
        """"""
        return [self.convertLength(a) for a in self.split_attr_list(svgAttr)]
1370818
def _get_example_length(example):
  """"""
  length = tf.maximum(tf.shape(example[0])[0], tf.shape(example[1])[0])
  return length
649271
def readline(self, size=-1):
        
        remainder = int(self.length) - self.__position
        if size < 0 or size > remainder:
            size = remainder

        if size == 0:
            return EMPTY

        received = 0
        data = StringIO()
        while received < size:
            chunk_data = self.readchunk()
            pos = chunk_data.find(NEWLN, 0, size)
            if pos != -1:
                size = received + pos + 1

            received += len(chunk_data)
            data.write(chunk_data)
            if pos != -1:
                break

        self.__position -= received - size

        # Return 'size' bytes and store the rest.
        data.seek(size)
        self.__buffer = data.read()
        data.seek(0)
        return data.read(size)
1229249
function getInputLine(n) {
    if (n===undefined) n=0;
    var startLine = termText.length-1;
    while (startLine>=0 && !(n==0 && termText[startLine].substr(0,1)==">")) {
      if (termText[startLine].substr(0,1)==">") n--;
      startLine--;
    }
    if (startLine<0) return undefined;
    var line = startLine;
    var text = termText[line++].substr(1);
    while (line < termText.length && termText[line].substr(0,1)==":")
      text += "\n"+termText[line++].substr(1);
    return { line : startLine, text : text };
  }
727270
def content_bytes(self):
        """"""
        get_message = \
            self._communication.needle_positions.get_line_configuration_message
        return get_message(self._line_number)
232560
def readline(self, size=None):
        """"""

# TODO: Add support for Unicode.
        (line, nl) = self.__buffer.read_until_nl(self.__retrieve_data)

        if self.__sf.access_type_has_universal_nl and nl is not None:
            self.__newlines[nl] = True

        return line
129236
private static int blockLength(int start, QrMode[] inputMode) {

        QrMode mode = inputMode[start];
        int count = 0;
        int i = start;

        do {
            count++;
        } while (((i + count) < inputMode.length) && (inputMode[i + count] == mode));

        return count;
    }
364258
def readline(self):
        """"""
        self.lineno += 1
        if self._buffer:
            return self._buffer.pop()
        else:
            return self.input.readline()
1229969
def content_length(self) -> Optional[int]:
        """"""
        content_length = self._headers.get(hdrs.CONTENT_LENGTH)  # type: ignore

        if content_length is not None:
            return int(content_length)
        else:
            return None
417686
def get_string_length(self):
        """"""
        try:
            return self.get_array_size()
        except:
            match = re.search(r"(?<=\.)\d+", self.get_address())
            try:
                return int(match.group(0))
            except Exception as ex:
                raise Exception('Could not get string size of {0} address {1}'
                                .format(
                                    self.name,
                                    self.get_address()),
                                ex)