Skip to content

Instantly share code, notes, and snippets.

View ghamarian's full-sized avatar

Amir Ghamarian ghamarian

View GitHub Profile
from pynput import keyboard
import pyperclip
import time
# Initialize
with open("your_file.txt", "r") as f:
lines = f.readlines()
# Remove newline characters
lines = [line.strip() for line in lines]

Torch objects used in learnpytorch.io website

name type
torch.Tensor <class 'torch._C._TensorMeta'>
torch.e <class 'float'>
torch.t <class 'builtin_function_or_method'>
torch.torch <class 'module'>
torch.eig <class 'function'>
torch.ne <class 'builtin_function_or_method'>
torch.nn
# Torch objects used in learnpytorch.io website
|name|type|
|----|----|
|torch.Tensor|<class 'torch._C._TensorMeta'>|
|torch.e|<class 'float'>|
|torch.t|<class 'builtin_function_or_method'>|
|torch.torch|<class 'module'>|
|torch.eig|<class 'function'>|
|torch.ne|<class 'builtin_function_or_method'>|
|torch.nn|<class 'module'>|
#include <algorithm>
#include <concepts>
#include <functional>
#include <iostream>
#include <memory>
#include <vector>
template <typename T>
concept Drawable = requires(T t) {
{ t.draw() } -> std::same_as<void>;
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
xs = []
ys = []
import operator
from itertools import cycle
from numbers import Number
import numpy as np
def broadcast(a, b, op):
if isinstance(a, Number) and isinstance(b, Number):
#include <Eigen/Dense>
#include <Eigen/IterativeLinearSolvers>
#include <algorithm>
#include <iostream>
#include <random>
#include <vector>
std::pair<Eigen::MatrixXf, Eigen::MatrixXf> GenerateData(size_t n) {
std::vector<float> x_data(n);
// rangesFilterTransform.cpp
#include <iostream>
//#include <ranges>
#include <range/v3/all.hpp>
#include <vector>
int main() {
std::vector<int> numbers = {1, 2, 3, 4, 5, 6};
{
"symbol": "ETHBTC",
"status": "TRADING",
"baseAsset": "ETH",
"baseAssetPrecision": 8,
"quoteAsset": "BTC",
"quotePrecision": 8,
"orderTypes": ["LIMIT", "MARKET"],
"icebergAllowed": false,
"filters": [
import itertools
import logging
import os
import os.path
import threading
from functools import partial
from typing import List, Sequence
import cv2
from math import log, pi