def create(self, *args, **kwargs):
if not args and not kwargs:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>attributes = args[<NUM_LIT:0>] if args else kwargs<EOL>attributes = dict((k, v) for k, v in attributes.iteritems() if k in self.OPTS_KEYS_TO_PERSIST)<EOL>_, _, task = self.http_client.post("<STR_LIT>", body=attributes)<EOL>return task<EOL>
Create a task

Creates a new task
You can create either a **floating** task or create a **related** task and associate it with one of the resource types below:
* [Leads](/docs/rest/reference/leads)
* [Contacts](/docs/rest/reference/contacts)
* [Deals](/docs/rest/reference/deals)

:calls: ``post /tasks``
:param tuple *args: (optional) Single object representing Task resource.
:param dict **kwargs: (optional) Task attributes.
:return: Dictionary that support attriubte-style access and represents newely created Task resource.
:rtype: dict