def add_custom_arg(self, custom_arg):
if custom_arg.personalization is not None:<EOL><INDENT>try:<EOL><INDENT>personalization =self._personalizations[custom_arg.personalization]<EOL>has_internal_personalization = True<EOL><DEDENT>except IndexError:<EOL><INDENT>personalization = Personalization()<EOL>has_internal_personalization = False<EOL><DEDENT>if isinstance(custom_arg, dict):<EOL><INDENT>(k, v) = list(custom_arg.items())[<NUM_LIT:0>]<EOL>personalization.add_custom_arg(CustomArg(k, v))<EOL><DEDENT>else:<EOL><INDENT>personalization.add_custom_arg(custom_arg)<EOL><DEDENT>if not has_internal_personalization:<EOL><INDENT>self.add_personalization(<EOL>personalization, index=custom_arg.personalization)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if isinstance(custom_arg, dict):<EOL><INDENT>(k, v) = list(custom_arg.items())[<NUM_LIT:0>]<EOL>self._custom_args = self._ensure_append(<EOL>CustomArg(k, v), self._custom_args)<EOL><DEDENT>else:<EOL><INDENT>self._custom_args = self._ensure_append(<EOL>custom_arg, self._custom_args)<EOL><DEDENT><DEDENT>
Add custom args to the email globaly or to a specific Personalization

        :param value: A CustomArg object or a dict of custom arg key/values
        :type value: CustomArg, dict