original_docstring: Try to replace a variable ${{}} by a matching input parameter
docstring: Try to replace a variable ${{}} by a matching input parameter
docstring_tokens: Try to replace a variable $ {{ }} by a matching input parameter
code: def replace_variable(self, parameter):
          '''Try to replace a variable ${{}} by a matching input parameter'''
          if not parameter:
              return parameter
          if not '$' in parameter:
              return parameter
          regexp = r"\$\{{1,2}([^}]+)\}{1,2}"
          subst="\\1"
          for var in self.variables:
              stripped_parameter=re.sub(regexp, subst,parameter,0)
              if stripped_parameter == var.name:
                  return "{{ inputs.parameters.%s }}" % (stripped_parameter)
code_tokens: def replace_variable ( self , parameter ) : if not parameter : return parameter if not '$' in parameter : return parameter regexp = r"\$\{{1,2}([^}]+)\}{1,2}" subst = "\\1" for var in self . variables : stripped_parameter = re . sub ( regexp , subst , parameter , 0 ) if stripped_parameter == var . name : return "{{ inputs.parameters.%s }}" % ( stripped_parameter )
short_docstring: Try to replace a variable ${{}} by a matching input parameter
short_docstring_tokens: Try to replace a variable $ {{ }} by a matching input parameter
comment: '''Try to replace a variable ${{}} by a matching input parameter'''