parameters: (packedfile, parent_path)
docstring: Unpacks packedfile into parent_path. Assumes .zip. Returns parent_path
docstring_summary: Unpacks packedfile into parent_path. Assumes .zip. Returns parent_path
docstring_tokens: Unpacks packedfile into parent_path . Assumes . zip . Returns parent_path
function: def unpack(packedfile, parent_path):
      """Unpacks packedfile into parent_path. Assumes .zip. Returns parent_path"""
      if zipfile.is_zipfile(packedfile):
          with contextlib.closing(zipfile.ZipFile(packedfile, 'r')) as icuzip:
              print ' Extracting zipfile: %s' % packedfile
              icuzip.extractall(parent_path)
              return parent_path
      elif tarfile.is_tarfile(packedfile):
          with tarfile.TarFile.open(packedfile, 'r') as icuzip:
              print ' Extracting tarfile: %s' % packedfile
              icuzip.extractall(parent_path)
              return parent_path
      else:
          packedsuffix = packedfile.lower().split('.')[-1]  # .zip, .tgz etc
          raise Exception('Error: Don\'t know how to unpack %s with extension %s' % (packedfile, packedsuffix))
function_tokens: def unpack ( packedfile , parent_path ) : if zipfile . is_zipfile ( packedfile ) : with contextlib . closing ( zipfile . ZipFile ( packedfile , 'r' ) ) as icuzip : print ' Extracting zipfile: %s' % packedfile icuzip . extractall ( parent_path ) return parent_path elif tarfile . is_tarfile ( packedfile ) : with tarfile . TarFile . open ( packedfile , 'r' ) as icuzip : print ' Extracting tarfile: %s' % packedfile icuzip . extractall ( parent_path ) return parent_path else : packedsuffix = packedfile . lower ( ) . split ( '.' ) [ - 1 ] # .zip, .tgz etc raise Exception ( 'Error: Don\'t know how to unpack %s with extension %s' % ( packedfile , packedsuffix ) )