class_docstr: A wrapper for pandas dataframes that provides helpers for using them as a parameter
  space in Snakemake.
  
  This is heavily inspired by @soumitrakp work on JUDI (https://github.com/ncbi/JUDI).
  
  By default, a directory structure with on folder level per parameter is created
  (e.g. column1~{column1}/column2~{column2}/***).
  
  The exact behavior can be tweaked with four parameters:
  
    - ``filename_params`` takes a list of column names of the passed dataframe.
      These names are used to build the filename (separated by '_') in the order
      in which they are passed.
      All remaining parameters will be used to generate a directory structure.
      Example for a data frame with four columns named column1 to column4:
  
      | ``Paramspace(df, filename_params=["column3", "column2"])`` ->
      | column1~{value1}/column4~{value4}/column3~{value3}_column2~{value2}
  
      If ``filename_params="*"``, all columns of the dataframe are encoded into
      the filename instead of parent directories.
  
    - ``param_sep`` takes a string which is used to join the column name and
      column value in the generated paths (Default: '~'). Example:
  
      | ``Paramspace(df, param_sep=":")`` ->
      | column1:{value1}/column2:{value2}/column3:{value3}/column4:{value4}
  
    - ``filename_sep`` takes a string which is used to join the parameter
      entries listed in ``filename_params`` in the generated paths
      (Default: '_'). Example:
  
      | ``Paramspace(df, filename_params="*", filename_sep="-")`` ->
      | column1~{value1}-column2~{value2}-column3~{value3}-column4~{value4}
  
    - ``single_wildcard`` takes a string which is used to replace the
      default behavior of using a wildcard for each column in the dataframe
      with a single wildcard that is used to encode all column values.
      The given string is the name of that wildcard. The value of the wildcard
      for individual instances of the paramspace is still controlled by above
      other arguments. The single_wildcard mechanism can be handy if you want
      to define a rule that shall be used for multiple paramspaces with different
      columns.
class_docstr_tok: ["A","wrapper","for","pandas","dataframes","that","provides","helpers","for","using","them","as","a","parameter","space","in","Snakemake",".","This","is","heavily","inspired","by","@","soumitrakp","work","on","JUDI","(","https",":","\/\/github.com\/ncbi\/JUDI",")",".","By","default",",","a","directory","structure","with","on","folder","level","per","parameter","is","created","(","e.g",".","column1~","{","column1","}","\/column2~","{","column2","}","\/","*","*","*",")",".","The","exact","behavior","can","be","tweaked","with","four","parameters",":","-","``","filename_params","``","takes","a","list","of","column","names","of","the","passed","dataframe",".","These","names","are","used","to","build","the","filename","(","separated","by","'","_","'",")","in","the","order","in","which","they","are","passed",".","All","remaining","parameters","will","be","used","to","generate","a","directory","structure",".","Example","for","a","data","frame","with","four","columns","named","column1","to","column4",":","|","``","Paramspace","(","df",",","filename_params=","[","``","column3","''",",","``","column2","''","]",")","``","-",">","|","column1~","{","value1","}","\/column4~","{","value4","}","\/column3~","{","value3","}","_column2~","{","value2","}","If","``","filename_params=","''","*","''","``",",","all","columns","of","the","dataframe","are","encoded","into","the","filename","instead","of","parent","directories",".","-","``","param_sep","``","takes","a","string","which","is","used","to","join","the","column","name","and","column","value","in","the","generated","paths","(","Default",":","'~","'",")",".","Example",":","|","``","Paramspace","(","df",",","param_sep=","''",":","''",")","``","-",">","|","column1",":","{","value1","}","\/column2",":","{","value2","}","\/column3",":","{","value3","}","\/column4",":","{","value4","}","-","``","filename_sep","``","takes","a","string","which","is","used","to","join","the","parameter","entries","listed","in","``","filename_params","``","in","the","generated","paths","(","Default",":","'","_","'",")",".","Example",":","|","``","Paramspace","(","df",",","filename_params=","''","*","''",",","filename_sep=","''","-","''",")","``","-",">","|","column1~","{","value1","}","-column2~","{","value2","}","-column3~","{","value3","}","-column4~","{","value4","}","-","``","single_wildcard","``","takes","a","string","which","is","used","to","replace","the","default","behavior","of","using","a","wildcard","for","each","column","in","the","dataframe","with","a","single","wildcard","that","is","used","to","encode","all","column","values",".","The","given","string","is","the","name","of","that","wildcard",".","The","value","of","the","wildcard","for","individual","instances","of","the","paramspace","is","still","controlled","by","above","other","arguments",".","The","single_wildcard","mechanism","can","be","handy","if","you","want","to","define","a","rule","that","shall","be","used","for","multiple","paramspaces","with","different","columns","."]
code: def __getattr__(self, name):
      import pandas as pd
  
      ret = getattr(self.dataframe, name)
      if isinstance(ret, pd.DataFrame):
          return Paramspace(ret)
      return ret
  
imports: import os
  import json
  import re
  import inspect
  import textwrap
  from itertools import chain
  import collections
  import multiprocessing
  import string
  import shlex
  import sys
  from urllib.parse import urljoin
  from snakemake.io import Namedlist, Wildcards
  from snakemake.common.configfile import _load_configfile
  from snakemake.logging import logger
  from snakemake.common import ON_WINDOWS
  from snakemake.exceptions import WorkflowError
  from snakemake.io import regex_from_filepattern
label_desc: Use image node_id 5 for calling the Paramspace obj's underlying member method code with example usage: obj.__getattr__(name) and returns: ret, Paramspace