def find_dest_path_comp_key(files, src_path=None):
 src = files['src']
 dest = files['dest']
 src_type = src['type']
 dest_type = dest['type']
 if (src_path is None):
  src_path = src['path']
 sep_table = {'s3': '/', 'local': os.sep}
 if files['dir_op']:
  rel_path = src_path[len(src['path']):]
 else:
  rel_path = src_path.split(sep_table[src_type])[(-1)]
 compare_key = rel_path.replace(sep_table[src_type], '/')
 if files['use_src_name']:
  dest_path = dest['path']
  dest_path += rel_path.replace(sep_table[src_type], sep_table[dest_type])
 else:
  dest_path = dest['path']
 return (dest_path, compare_key)

def find_dest_path_comp_key ( files , src_path = None ) : src = files [ 'src' ] dest = files [ 'dest' ] src_type = src [ 'type' ] dest_type = dest [ 'type' ] if ( src_path is None ) : src_path = src [ 'path' ] sep_table = { 's3' : '/' , 'local' : os . sep } if files [ 'dir_op' ] : rel_path = src_path [ len ( src [ 'path' ] ) : ] else : rel_path = src_path . split ( sep_table [ src_type ] ) [ ( - 1 ) ] compare_key = rel_path . replace ( sep_table [ src_type ] , '/' ) if files [ 'use_src_name' ] : dest_path = dest [ 'path' ] dest_path += rel_path . replace ( sep_table [ src_type ] , sep_table [ dest_type ] ) else : dest_path = dest [ 'path' ] return ( dest_path , compare_key )
this is a helper function that determines the destination path and compare key given parameters received from the fileformat class .