write once, use everywhere
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
| #!/bin/bash | |
| # | |
| # Copyright 2017 Google Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # |
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 pyaudio | |
| import numpy as np | |
| from collections import namedtuple | |
| CHUNK = 1024 | |
| FORMAT = pyaudio.paInt16 | |
| CHANNELS = 1 | |
| RATE = 44100 | |
| Chunk = namedtuple('Chunk', 'data time') |
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
| #!/usr/bin/env python | |
| import pyaudio | |
| import socket | |
| class AudioStreamer(object): | |
| def __init__(self, host='0.0.0.0', port=50000, backlog=5, chunk=1024, | |
| channels=1, rate=16000, pa=None): | |
| self.rate = rate | |
| self.channels = channels |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| DEFAULT_VOLUME = 150 | |
| DEFAULT_AGGRESSIVENESS = 2 | |
| DEFAULT_MODEL_DIR = '/opt/kaldi/model/kaldi-generic-en-tdnn_250' | |
| DEFAULT_ACOUSTIC_SCALE = 1.0 | |
| DEFAULT_BEAM = 7.0 | |
| DEFAULT_FRAME_SUBSAMPLING_FACTOR = 3 |
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 time | |
| import glob | |
| import re | |
| import os | |
| import curses | |
| import socket | |
| refresh = 5 | |
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 lilacs.reasoning.extraction import LILACSextractor | |
| LILACS = LILACSextractor() | |
| test_text = """London is the capital and most populous city of England and the United Kingdom. | |
| Standing on the River Thames in the south east of the island of Great Britain, London has been a major settlement for 2 millennia. | |
| It was founded by the Romans, who named it Londinium. | |
| London's ancient core, the City of London, which covers an area of only 1.12 square miles (2.9 km2), largely retains its medieval boundaries. | |
| Since at least the 19th century, "London" has also referred to the metropolis around this core, historically split between Middlesex, Essex, Surrey, Kent and Hertfordshire, which today largely makes up Greater London, a region governed by the Mayor of London and the London Assembly.""" |
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 random | |
| from time import sleep | |
| from threading import Thread | |
| from datetime import datetime | |
| class VirtualPet(Thread): | |
| def __init__(self, name="VirtualPet", speed=1.0, lifespan=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 os | |
| import re | |
| import requests | |
| import sys | |
| import subprocess | |
| from os.path import join, expanduser, isdir | |
| from os import makedirs | |
| def set_wallpaper(file_loc, desktop_env = None): |
OlderNewer