parameters: (code)
return_statement: return code
docstring: Unpacks JavascriptObfuscator.com packed code.
docstring_summary: Unpacks JavascriptObfuscator.com packed code.
docstring_tokens: Unpacks JavascriptObfuscator . com packed code .
function: def unpack(code):
      """Unpacks JavascriptObfuscator.com packed code."""
      if detect(code):
          matches = re.search(r'var (_0x[a-f\d]+) ?\= ?\[(.*?)\];', code)
          if matches:
              variable = matches.group(1)
              dictionary = smartsplit(matches.group(2))
              code = code[len(matches.group(0)):]
              for key, value in enumerate(dictionary):
                  code = code.replace(r'%s[%s]' % (variable, key), value)
      return code
function_tokens: def unpack ( code ) : if detect ( code ) : matches = re . search ( r'var (_0x[a-f\d]+) ?\= ?\[(.*?)\];' , code ) if matches : variable = matches . group ( 1 ) dictionary = smartsplit ( matches . group ( 2 ) ) code = code [ len ( matches . group ( 0 ) ) : ] for key , value in enumerate ( dictionary ) : code = code . replace ( r'%s[%s]' % ( variable , key ) , value ) return code