parameters: (field, value)
return_statement: return CodecResult(value=result, complete=complete)
docstring: Encode the bytes in value as urlsafe base64.
docstring_summary: Encode the bytes in value as urlsafe base64.
docstring_tokens: Encode the bytes in value as urlsafe base64 .
function: def _SafeEncodeBytes(field, value):
      """Encode the bytes in value as urlsafe base64."""
      try:
          if field.repeated:
              result = [base64.urlsafe_b64encode(byte) for byte in value]
          else:
              result = base64.urlsafe_b64encode(value)
          complete = True
      except TypeError:
          result = value
          complete = False
      return CodecResult(value=result, complete=complete)
function_tokens: def _SafeEncodeBytes ( field , value ) : try : if field . repeated : result = [ base64 . urlsafe_b64encode ( byte ) for byte in value ] else : result = base64 . urlsafe_b64encode ( value ) complete = True except TypeError : result = value complete = False return CodecResult ( value = result , complete = complete )