original_docstring: Replace hierarchy separator character with another and return spec
      string. e.g. "." -> "_"
      Only replaces the character between name tokens, not between numbers.
docstring: Replace hierarchy separator character with another and return spec
  string.
docstring_tokens: Replace hierarchy separator character with another and return spec string .
code: def replaceSep(spec, sourcesep=NAMESEP, targetsep="_"):
      """Replace hierarchy separator character with another and return spec
      string. e.g. "." -> "_"
      Only replaces the character between name tokens, not between numbers."""
  
      try:
          assert all([alphanumeric_chars_RE.match(char) is None \
                      for char in sourcesep])
      except AssertionError:
          raise ValueError("Source separator must be non-alphanumeric")
      try:
          assert all([alphanumeric_chars_RE.match(char) is None \
                      for char in targetsep])
      except AssertionError:
          raise ValueError("Target separator must be non-alphanumeric")
      if isinstance(spec, str):
          return replaceSepStr(spec, sourcesep, targetsep)
      else:
          # safe way to get string definition from either Variable or QuantSpec
          return replaceSepStr(str(spec()), sourcesep, targetsep)
code_tokens: def replaceSep ( spec , sourcesep = NAMESEP , targetsep = "_" ) : try : assert all ( [ alphanumeric_chars_RE . match ( char ) is None for char in sourcesep ] ) except AssertionError : raise ValueError ( "Source separator must be non-alphanumeric" ) try : assert all ( [ alphanumeric_chars_RE . match ( char ) is None for char in targetsep ] ) except AssertionError : raise ValueError ( "Target separator must be non-alphanumeric" ) if isinstance ( spec , str ) : return replaceSepStr ( spec , sourcesep , targetsep ) else : return replaceSepStr ( str ( spec ( ) ) , sourcesep , targetsep )
short_docstring: Replace hierarchy separator character with another and return spec
  string.
short_docstring_tokens: Replace hierarchy separator character with another and return spec string .
comment: """Replace hierarchy separator character with another and return spec
      string. e.g. "." -> "_"
      Only replaces the character between name tokens, not between numbers."""$SEP$# safe way to get string definition from either Variable or QuantSpec