This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sympy | |
| alpha, beta, x, y, A, B, s, mu = sympy.symbols('alpha beta x y A B s mu', real=True) | |
| A, B = sympy.symbols('A B', positive=True) | |
| sin_vec = [sympy.sin(alpha)+sympy.sin(alpha-beta), | |
| sympy.sin(beta)+sympy.sin(beta-alpha)] | |
| symmetric_component = sin_vec[0] + sin_vec[1] | |
| antisymmetric_component = sin_vec[0] - sin_vec[1] | |
| e1 = sympy.Matrix([1,1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import matplotlib.animation as animation | |
| import matplotlib | |
| from tqdm import tqdm | |
| matplotlib.rcParams.update({'font.size': 22}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import cache | |
| def play_left(board): | |
| return board[0], board[1:] | |
| def play_right(board): | |
| return board[-1], board[:-1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import igraph as ig | |
| def load_call_tree_from_tables(nodes, methods): | |
| method_id2method_name = methods.set_index('method_id')['method_name'].to_dict() | |
| vertices = list(map(str, nodes['node_id'].values)) | |
| children = list(map(str, nodes['node_id'].iloc[1:])) | |
| parents = list(map(str, nodes['parent_id'].iloc[1:])) | |
| g = ig.Graph(directed=True) | |
| g.add_vertices(vertices) | |
| g.add_edges(zip(parents, children)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from fake_typing import fake_typing | |
| class Dormammu: | |
| def __init__(self): | |
| self.name = 'Dormammu' | |
| self.counter = 0 | |
| def consider(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Naturals: | |
| def __init__(self): | |
| self.n = 1 | |
| def next(self): | |
| res = self.n | |
| self.n += 1 | |
| return res |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Simulate a go fish game | |
| """ | |
| import random | |
| def make_deck(n): | |
| """ | |
| Create and shuffle a deck of cards |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sympy | |
| from argparse import ArgumentParser | |
| def get_input(): | |
| parser = ArgumentParser(description='show output of void function') | |
| parser.add_argument('fname', | |
| type=str, | |
| help='name of function') | |
| args = parser.parse_args() |
NewerOlder