parameters: (self, num)
return_statement: return "".join(reversed(result))
docstring: :type num: str
          :rtype: str
docstring_summary: :type num: str
          :rtype: str
docstring_tokens: : type num : str : rtype : str
function: def toHexspeak(self, num):
          """
          :type num: str
          :rtype: str
          """
          lookup = {0:'O', 1:'I'}
          for i in xrange(6):
              lookup[10+i] = chr(ord('A')+i)
          result = []
          n = int(num)
          while n:
              n, r = divmod(n, 16)
              if r not in lookup:
                  return "ERROR"
              result.append(lookup[r])
          return "".join(reversed(result))
function_tokens: def toHexspeak ( self , num ) : lookup = { 0 : 'O' , 1 : 'I' } for i in xrange ( 6 ) : lookup [ 10 + i ] = chr ( ord ( 'A' ) + i ) result = [ ] n = int ( num ) while n : n , r = divmod ( n , 16 ) if r not in lookup : return "ERROR" result . append ( lookup [ r ] ) return "" . join ( reversed ( result ) )