Advertisement
314ma

tge

Oct 31st, 2024
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1.     # Array of item = {
  2.     #   "time": datetime,
  3.     #   "price": float,
  4.     # }
  5.     # {'time': datetime.datetime(2023, 3, 6, 0, 0,
  6.     #          tzinfo=<DstTzInfo 'Europe/Stockholm' CET+1:00:00 STD>),
  7.     #  'price': 146.96}
  8.     if platform == PLATFORM_TGE:
  9.         if item["price"] is not None and isinstance(item["time"], datetime):
  10.             item_new = {}
  11.             item_new["value"] = item["price"]
  12.             item_new["start"] = item["time"]
  13.             item_new["end"] = item["time"] + timedelta(hours=1)
  14.             return item_new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement