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
################################################################################ | |
### Proposed solution | |
################################################################################ | |
from types import FunctionType | |
from functools import wraps | |
from typing import Optional, Callable, Any | |
import copy | |
from functools import update_wrapper | |
class TracerState: |
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 random import choice | |
import cPickle as pickle | |
from scipy.weave import converters | |
from scipy import weave | |
import numpy | |
def ran_sub(S, k): | |
res = [] | |
len_res = 0 | |
while len_res < k: |
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 xlrd | |
from collections import namedtuple | |
def parse(filename): | |
book = xlrd.open_workbook(filename) | |
sheet = book.sheet_by_index(0) | |
cols = sheet.ncols | |
rows = sheet.nrows |
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
def _strip(g, base, orbs, stabs): | |
""" | |
Attempt to decompose a group element using a subgroup chain ``stabs``. | |
This is done by treating the subgroup chain ``stabs`` as a chain of | |
stabilizers with respect to the sequence ``base`` (even though the groups | |
in ``stabs`` might only be subgroups of the respective stabilizers), | |
and treat ``orbs`` as basic orbits. | |
This process is called "sifting". A sift is unsuccessful when a certain | |
orbit element is not found or when after the sift the decomposition |
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 Representation(object): | |
character = [] | |
name = None | |
def __init__(self, character, name = None): | |
self.character = character | |
self.name = name | |
def __add__(self, other): |
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 operator import add | |
from operator import mul | |
class Representation: | |
character = [] | |
name = None | |
def __init__(self, character, name = None): |