Skip to content

Instantly share code, notes, and snippets.

@thsunkid
thsunkid / gwnet.py
Last active September 5, 2021 15:11
XLA compilation error for TPU sample code
import os
import math
import time
import random
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
@thsunkid
thsunkid / cx_crawler.py
Created October 10, 2021 11:11
a selenium-based script to label data using Dialogflow CX console (dev environment)
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
import time
path_to_data = "vi_hvac_train.txt"
path_to_save = "vi_hvac_train_res.txt"
email = "thesunkid19@gmail.com"
password = ""
@thsunkid
thsunkid / slack_archiver.py
Last active June 4, 2023 11:26
Slack Channel Archiver Script
import datetime
from slack_sdk import WebClient
"""Get the SLACK_API_TOKEN:
1. To get a token for this script, create an app at https://api.slack.com/apps (Choose 'From scratch')
2. Go to 'OAuth & Permissions' > 'Scopes' section > 'User Token Scopes' > Add these permissions:
# admin.conversations:write
# admin.conversations:read
# channels:read
# channels:history