def create(self,<EOL>name,<EOL>query,<EOL>scope_count,<EOL>scope_unit,<EOL>increase_positive,<EOL>percentage_change,<EOL>trigger_config,<EOL>logs,<EOL>alert_reports):
change = '<STR_LIT>'.format(<EOL>pos='<STR_LIT:+>' if increase_positive else '<STR_LIT:->',<EOL>change=str(percentage_change)<EOL>)<EOL>query_response = self._create_scheduled_query(<EOL>query=query,<EOL>change=change,<EOL>scope_unit=scope_unit,<EOL>scope_count=scope_count,<EOL>)<EOL>scheduled_query_id = query_response.get('<STR_LIT>', {}).get('<STR_LIT:id>')<EOL>tag_data = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': [<EOL>alert_report.to_dict()<EOL>for alert_report<EOL>in alert_reports<EOL>],<EOL>'<STR_LIT:name>': name,<EOL>'<STR_LIT>': scheduled_query_id,<EOL>'<STR_LIT>': [<EOL>{'<STR_LIT:id>': log}<EOL>for log<EOL>in logs<EOL>],<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:type>': '<STR_LIT>'<EOL>}<EOL>}<EOL>tag_data['<STR_LIT>'].update(trigger_config.to_dict())<EOL>tag_url = '<STR_LIT>'.format(<EOL>account_id=self.account_id<EOL>)<EOL>return self._api_post(<EOL>url=tag_url,<EOL>data=json.dumps(tag_data, sort_keys=True),<EOL>)<EOL>
Create an anomaly alert. This call makes 2 requests, one to create a
"scheduled_query", and another to create the alert.

:param name: The name for the alert
:type name: str

:param query: The `LEQL`_ query to use for detecting anomalies. Must
    result in a numerical value, so it should look something like
    ``where(...) calculate(COUNT)``
:type query: str

:param scope_count: How many ``scope_unit`` s to inspect for detecting
    an anomaly
:type scope_count: int

:param scope_unit: How far to look back in detecting an anomaly. Must
    be one of "hour", "day", or "week"
:type scope_unit: str

:param increase_positive: Detect a positive increase for the anomaly. A
    value of ``False`` results in detecting a decrease for the anomaly.
:type increase_positive: bool

:param percentage_change: The percentage of change to detect. Must be a
    number between 0 and 100 (inclusive).
:type percentage_change: int

:param trigger_config: A AlertTriggerConfig describing how far back to
    look back to compare to the anomaly scope.
:type trigger_config: :class:`AlertTriggerConfig<logentries_api.special_alerts.AlertTriggerConfig>`

:param logs: A list of log UUID's. (The 'key' key of a log)
:type logs: list of str

:param alert_reports: A list of AlertReportConfig to send alerts to
:type alert_reports: list of
    :class:`AlertReportConfig<logentries_api.special_alerts.AlertReportConfig>`

:return: The API response of the alert creation
:rtype: dict

:raises: This will raise a
    :class:`ServerException <logentries_api.exceptions.ServerException>`
    if there is an error from Logentries

.. _Leql: https://blog.logentries.com/2015/06/introducing-leql/