示例#1
0
文件: group.py 项目: ynadji/mashup
def allbpms(bpm, maxdiff=5, minbpm=60, maxbpm=190):
    doubles = poweroftwos(bpm)
    bpms = []
    for dbl in doubles:
        bpms.append([dbl - x for x in range(1, maxdiff + 1)])
        bpms.append([dbl])
        bpms.append([dbl + x for x in range(1, maxdiff + 1)])

    isgood = partial(goodbpm, minbpm=minbpm, maxbpm=maxbpm)
    return filter(isgood, flatten(bpms))
示例#2
0
文件: fayu.py 项目: ynadji/fayu
def components(c):
    """Get component characters of the 汉字 c. We ignore components that
    don't have standalone definitions.

    e.g.: 国 -> 囗玉"""
    return [x[0] for x in unique(flatten(cl.getDecompositionEntries(c))) if type(x) == tuple]
示例#3
0
文件: deltas.py 项目: ynadji/drop
def parsedelta(ipordns_gametype):
    try:
        x, y = zip(*[(x[0], x[1]) for x in unique(flatten(filter(None, ipordns_gametype)))])
        return (x, y)
    except ValueError: # Empty list
        return ([], [])