parameters: (s)
return_statement: return t("'%s'") % s.replace(t("'"), t("'\\''"))
docstring: Given a string, returns a version enclosed with single quotes for use
      in a shell command line.
  
      As a special case, if given an int, returns a string containing the int,
      not enclosed in quotes.
docstring_summary: Given a string, returns a version enclosed with single quotes for use
      in a shell command line.
docstring_tokens: Given a string returns a version enclosed with single quotes for use in a shell command line .
function: def shell_quote(s):
      '''Given a string, returns a version enclosed with single quotes for use
      in a shell command line.
  
      As a special case, if given an int, returns a string containing the int,
      not enclosed in quotes.
      '''
      if type(s) == int:
          return '%d' % s
      # Single quoted strings can contain any characters unescaped except the
      # single quote itself, which can't even be escaped, so the string needs to
      # be closed, an escaped single quote added, and reopened.
      t = type(s)
      return t("'%s'") % s.replace(t("'"), t("'\\''"))
function_tokens: def shell_quote ( s ) : if type ( s ) == int : return '%d' % s # Single quoted strings can contain any characters unescaped except the # single quote itself, which can't even be escaped, so the string needs to # be closed, an escaped single quote added, and reopened. t = type ( s ) return t ( "'%s'" ) % s . replace ( t ( "'" ) , t ( "'\\''" ) )