Skip to content

Instantly share code, notes, and snippets.

import pytest
from deepeval import assert_test
from typing import Dict, List, Union
from deepeval.metrics import AnswerRelevancyMetric
from deepeval.test_case import LLMTestCase
import zenetics
def get_context(input):
"""
@codeofzen
codeofzen / request.json
Last active May 6, 2020 14:14
API - Response
{
"maxResult": 10,
"sorting": [
{
"field":"price",
"order":"desc"
}
],
"location": ["ZA", "CPT"],
"tripStyle": ["xxx", "yyy"],
@codeofzen
codeofzen / query_uptimerobot_monitors.py
Last active September 20, 2019 12:40
Example script to query daily stats from UptimeRobot
from urllib import request, parse
import json
import datetime
import time
API_KEY = 'ur364580-157321bf29cadf16c9ab4c9f'
def get_all_monitors():
url_get_monitors = 'https://api.uptimerobot.com/v2/getMonitors?format=json'
@codeofzen
codeofzen / scan_itp_list.py
Created August 19, 2019 08:06
ITP Monitoring
from collections import Counter
import csv
import numpy as np
import random
import requests
import time
def read_itp_urls(filename, sample=0):
@codeofzen
codeofzen / simple_query.py
Created July 8, 2019 09:28
Simple Athena Query with Boto3
#!/usr/bin/env python3
import boto3
import time
#Athena configuration
s3_ouput = 's3://athena-results-tmp/'
database = 'behavioural_tracking'
table = 'bt_event_direct'
region = "eu-west-1"
@codeofzen
codeofzen / drift_frame.html
Last active April 24, 2019 10:57
Drift Integration
<!-- Drift Chat Integration -->
<script>
// identify user handler
var query = window.location.search.substring(1);
var vars = query.split("&");
//
@codeofzen
codeofzen / README.md
Created July 4, 2018 17:00
Fineway - JavaScript Coding Challenge

Task

Write a javascript function which takes the text in the html file and outputs a list with all words from the text and the count of their occurrences, ordered by the occurrences. The result should look like result.html.

Rules

  • Read the rules carefully and act according to them.
  • No external libararies.
  • Please use 2 spaces for indentation, no tabs.
  • Don't pollute the global namespace, don't leak any variables.
  • Send the result as a github gist like this file.
@codeofzen
codeofzen / 1 - Todo.md
Last active May 31, 2019 08:58
Fineway - Data Coding Challenge

Task

Write a Python function which takes the text from the file data.txt and outputs a list with all words from the text and the count of their occurrences, ordered by the occurrences. The result should look like result.txt.

Rules

  • Read the rules carefully and act according to them.
  • Please use 4 spaces for indentation, no tabs.
  • Send the result as a github gist like this file.
  • Stop immediately after 15 minutes - we don't need, want or honor a working solution, we are interested in your approach.
  • The code should work on a unix based system.