original_docstring: Return the number of bits needed to represent the integer n.
docstring: Return the number of bits needed to represent the integer n.
docstring_tokens: Return the number of bits needed to represent the integer n .
code: def numBits(n):
      "Return the number of bits needed to represent the integer n."
      if n==0:
          return 0
      s = "%x" % n
      return ((len(s)-1)*4) + \
      {'0':0, '1':1, '2':2, '3':2,
       '4':3, '5':3, '6':3, '7':3,
       '8':4, '9':4, 'a':4, 'b':4,
       'c':4, 'd':4, 'e':4, 'f':4,
       }[s[0]]
code_tokens: def numBits ( n ) : if n == 0 : return 0 s = "%x" % n return ( ( len ( s ) - 1 ) * 4 ) + { '0' : 0 , '1' : 1 , '2' : 2 , '3' : 2 , '4' : 3 , '5' : 3 , '6' : 3 , '7' : 3 , '8' : 4 , '9' : 4 , 'a' : 4 , 'b' : 4 , 'c' : 4 , 'd' : 4 , 'e' : 4 , 'f' : 4 , } [ s [ 0 ] ]
short_docstring: Return the number of bits needed to represent the integer n.
short_docstring_tokens: Return the number of bits needed to represent the integer n .
comment: "Return the number of bits needed to represent the integer n."