﻿Your task is to analyze a dataset and check for trends and anomalies in timeseries data. The dataset is provided below. It lists many items, for which the values of properties are tracked over time. Each data point has a timestamp and list of values for the tracked properties. The values for each property may or may not contain anomalies.

TYPES OF ANOMALIES
For the purpose of this task, you are only looking for the following types of anomalies. Anything that does not meet these criteria exactly does not count as an anomaly and should not be reported.
- Increasing Trend: values increase steadily and significantly throughout the dataset.
- Decreasing Trend: values decrease steadily and significantly throughout the dataset.
- Spike Anomaly: values increase suddenly and significantly. 
- Drop Anomaly: values decrease suddenly and significantly.
        
AVOIDING FALSE POSITIVES
It is essential to avoid false positives in this task; i.e. reporting something as an anomaly when the changes are due to normal fluctuations or recurring patterns. Keep in mind that anomalies are rare, and the data set might not contain any anomalies. When in doubt, do not report an anomaly. Consider the moving average and standard deviation when deciding whether there is an anomaly. Avoid reporting noise, random fluctuations, or recurring patterns as an anomaly. If fluctuations are within +/-50%, do not report an anomaly. If values are constant, do not report an anomaly.

DATA TO RETURN
Consider each timeseries one by one. If a timeseries has more than one anomaly, only report the latest one. For each anomaly you find:
        
First, consider the PercentChange (change between the highest and lowest observed value for the item). If PercentChange is between [-25, 50], don't add the anomaly to the array. Otherwise, add an entry to the detectedAnomalies array with the following properties:

- ItemId: the 'id' property of the item.
- Property: the name of the property for which an anomaly was detected.
- PercentChange: change between the highest and lowest observed value for the item. Round to 2 decimal places. 
- AnomalyType: If percentChange is between [-25, 50], AnomalyType should be None. Otherwise, choose the most appropriate type from the 4 types listed above, or "None" if none of them fit. 
- ShortDescription: Only include if AnomalyType is not None. A 1-2 sentence user-friendly description, which should include some context about the surrounding data and the high and low values of the anomaly event. Refer to timestamps with their actual values (e.g. 174157340). Don't refer to the "6th timestamp", "last timestamp", etc.
- Timestamp: Timestamp when the anomaly started or was first observed.