parameters: (self, member, targetpath, pwd)
return_statement: return targetpath
docstring: Extract the ZipInfo object 'member' to a physical
             file on the path targetpath.
docstring_summary: Extract the ZipInfo object 'member' to a physical
             file on the path targetpath.
docstring_tokens: Extract the ZipInfo object member to a physical file on the path targetpath .
function: def _extract_member(self, member, targetpath, pwd):
          """Extract the ZipInfo object 'member' to a physical
             file on the path targetpath.
          """
          # build the destination pathname, replacing
          # forward slashes to platform specific separators.
          arcname = member.filename.replace('/', os.path.sep)
  
          if os.path.altsep:
              arcname = arcname.replace(os.path.altsep, os.path.sep)
          # interpret absolute pathname as relative, remove drive letter or
          # UNC path, redundant separators, "." and ".." components.
          arcname = os.path.splitdrive(arcname)[1]
          arcname = os.path.sep.join(x for x in arcname.split(os.path.sep)
                      if x not in ('', os.path.curdir, os.path.pardir))
          if os.path.sep == '\\':
              # filter illegal characters on Windows
              illegal = ':<>|"?*'
              if isinstance(arcname, unicode):
                  table = {ord(c): ord('_') for c in illegal}
              else:
                  table = string.maketrans(illegal, '_' * len(illegal))
              arcname = arcname.translate(table)
              # remove trailing dots
              arcname = (x.rstrip('.') for x in arcname.split(os.path.sep))
              arcname = os.path.sep.join(x for x in arcname if x)
  
          targetpath = os.path.join(targetpath, arcname)
          targetpath = os.path.normpath(targetpath)
  
          # Create all upper directories if necessary.
          upperdirs = os.path.dirname(targetpath)
          if upperdirs and not os.path.exists(upperdirs):
              os.makedirs(upperdirs)
  
          if member.filename[-1] == '/':
              if not os.path.isdir(targetpath):
                  os.mkdir(targetpath)
              return targetpath
  
          with self.open(member, pwd=pwd) as source, \
               file(targetpath, "wb") as target:
              shutil.copyfileobj(source, target)
  
          return targetpath
function_tokens: def _extract_member ( self , member , targetpath , pwd ) : # build the destination pathname, replacing # forward slashes to platform specific separators. arcname = member . filename . replace ( '/' , os . path . sep ) if os . path . altsep : arcname = arcname . replace ( os . path . altsep , os . path . sep ) # interpret absolute pathname as relative, remove drive letter or # UNC path, redundant separators, "." and ".." components. arcname = os . path . splitdrive ( arcname ) [ 1 ] arcname = os . path . sep . join ( x for x in arcname . split ( os . path . sep ) if x not in ( '' , os . path . curdir , os . path . pardir ) ) if os . path . sep == '\\' : # filter illegal characters on Windows illegal = ':<>|"?*' if isinstance ( arcname , unicode ) : table = { ord ( c ) : ord ( '_' ) for c in illegal } else : table = string . maketrans ( illegal , '_' * len ( illegal ) ) arcname = arcname . translate ( table ) # remove trailing dots arcname = ( x . rstrip ( '.' ) for x in arcname . split ( os . path . sep ) ) arcname = os . path . sep . join ( x for x in arcname if x ) targetpath = os . path . join ( targetpath , arcname ) targetpath = os . path . normpath ( targetpath ) # Create all upper directories if necessary. upperdirs = os . path . dirname ( targetpath ) if upperdirs and not os . path . exists ( upperdirs ) : os . makedirs ( upperdirs ) if member . filename [ - 1 ] == '/' : if not os . path . isdir ( targetpath ) : os . mkdir ( targetpath ) return targetpath with self . open ( member , pwd = pwd ) as source , file ( targetpath , "wb" ) as target : shutil . copyfileobj ( source , target ) return targetpath