Skip to content

Instantly share code, notes, and snippets.

View Tony363's full-sized avatar
🎯
Focusing

Tony Siu Tony363

🎯
Focusing
View GitHub Profile
def load_embeddings(
embedding_list_train: list,
label_path: str,
mapping_path: str,
data_dir: str,
batch_size: int = 4,
) -> Tuple[np.ndarray, np.ndarray]:
encoding_filename_mapping = json.load(open(mapping_path, "r"))
raw_labels = json.load(open(label_path, "r"))
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Widget</title>
</head>
<body>
<form method='post' action="/form" >
<label for="params">Choose query params:</label>
import pandas as pd
def load_abcdef():
abc = pd.read_excel('mock_data_abcde.xlsx')
def_ = pd.read_excel('mock_data_def.xlsx')
return abc.merge(def_,how='inner',on=['d','e'] # where the merging happens
if __name__ == "__main__":
abcdef = load_abcdef()
int n_chars, offset = 0;
CBinTreeNode *_buildCBinTree(CBinTreeNode *root, const char *s)
{
char word[10];
if (sscanf(s + offset, "%s%n", word, &n_chars))
offset += n_chars;
else
return NULL;
if (word[0] == '@')
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "../includes/BstOfStrings.h"
StrBST *createStrBST()
{
StrBST *bst = (StrBST *)malloc(sizeof(StrBST));
bst->root = NULL;
return bst;
#include <stdio.h>
#include <ctype.h>
char *findPunct(char *s)
{
char *p = s;
while (*p != '\0')
{
if (ispunct(*p))
{
return p;
#include <stdio.h>
void proc(int a[], int n, int *min_p, int *max_p, double *avg_p)
{
int min, max, avg, sum = 0;
for (int i = 0; i < n; i++)
{
if (i == 0)
{
min = max = a[i];
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../includes/bstS.h"
TreeNodePtr createNode(char *input)
{
char *data = (char *)malloc(sizeof(char) * strlen(input));
TreeNode *new = (TreeNode *)malloc(sizeof(TreeNode));
data = input;
// printChildren <- takes in pointer to Child node
// check if first is null
// if null print "Children: []\n"
// return
// assign current node to first nodes next node
// print "Children: (first nodes id) ["
// while current node is not first node
//print current nodes id
//current node becomes current nodes next
//print new line
def graph_sim(values,fig):
plt.clf()
spec = gridspec.GridSpec(ncols=3, nrows=2, figure=fig)
ax_tl = fig.add_subplot(spec[0,0], projection='3d')
ax_br = fig.add_subplot(spec[1,0], projection='3d')
ax_tl_side = fig.add_subplot(spec[0,1], projection='3d')
ax_br_side = fig.add_subplot(spec[1,1], projection='3d')
ax_Y0 = fig.add_subplot(spec[0,2], projection='3d')
ax_Y1 = fig.add_subplot(spec[1,2], projection='3d')