original_docstring: Returns all edf filepaths in a DataFrame
  
      Returns:
          pd.DataFrame: filepaths
      
docstring: Returns all edf filepaths in a DataFrame
docstring_tokens: Returns all edf filepaths in a DataFrame
code: def listdir_edfs(directory='~/github/ids/tusz_1_5_2/edf/train/01_tcp_ar',
                   columns=('tcp_type', 'patient_group', 'patient',
                            'session', 'token')):
      """Returns all edf filepaths in a DataFrame
  
      Returns:
          pd.DataFrame: filepaths
      """
      filelist = glob.glob(os.path.join(directory, '**', '*.edf'), recursive=True)
      fparts = [re.split('/|[.]edf', filename)[:-1] for filename in filelist]
  
      if len(fparts[0]) > len(columns):
          columns = ['path'+str(i) for i in range(0, len(fparts[0])-len(columns))] + list(columns)
  
      df = pd.DataFrame({key: value for key, value in zip(tuple(columns), tuple(zip(*fparts)))})
  
      # A very complicated lambda function
      return df.assign(token_path=lambda x: eval(
          """eval("+'/'+".join(["x.""" + '","x.'.join(x.columns) + '"]))'))
code_tokens: def listdir_edfs ( directory = '~/github/ids/tusz_1_5_2/edf/train/01_tcp_ar' , columns = ( 'tcp_type' , 'patient_group' , 'patient' , 'session' , 'token' ) ) : filelist = glob . glob ( os . path . join ( directory , '**' , '*.edf' ) , recursive = True ) fparts = [ re . split ( '/|[.]edf' , filename ) [ : - 1 ] for filename in filelist ] if len ( fparts [ 0 ] ) > len ( columns ) : columns = [ 'path' + str ( i ) for i in range ( 0 , len ( fparts [ 0 ] ) - len ( columns ) ) ] + list ( columns ) df = pd . DataFrame ( { key : value for key , value in zip ( tuple ( columns ) , tuple ( zip ( * fparts ) ) ) } ) return df . assign ( token_path = lambda x : eval ( """eval("+'/'+".join(["x.""" + '","x.' . join ( x . columns ) + '"]))' ) )
short_docstring: Returns all edf filepaths in a DataFrame
short_docstring_tokens: Returns all edf filepaths in a DataFrame
comment: """Returns all edf filepaths in a DataFrame
  
      Returns:
          pd.DataFrame: filepaths
      """$SEP$# A very complicated lambda function