parameters: (target)
return_statement: return target
docstring: Percent-encodes a request target so that there are no invalid characters
docstring_summary: Percent-encodes a request target so that there are no invalid characters
docstring_tokens: Percent - encodes a request target so that there are no invalid characters
function: def _encode_target(target):
      """Percent-encodes a request target so that there are no invalid characters"""
      path, query = TARGET_RE.match(target).groups()
      target = _encode_invalid_chars(path, PATH_CHARS)
      query = _encode_invalid_chars(query, QUERY_CHARS)
      if query is not None:
          target += "?" + query
      return target
function_tokens: def _encode_target ( target ) : path , query = TARGET_RE . match ( target ) . groups ( ) target = _encode_invalid_chars ( path , PATH_CHARS ) query = _encode_invalid_chars ( query , QUERY_CHARS ) if query is not None : target += "?" + query return target