text stringlengths 0 1.05M | meta dict |
|---|---|
""" Auction REST resources """
from flask import g
from flask_restful import Resource, fields, marshal, reqparse
from penelophant import app, auther, crud
from penelophant.helpers.invoice import get_invoice_by_id_or_abort
from penelophant.exceptions import InvoiceAlreadyPaid
import balanced
invoice_fields = {
'id':... | {
"repo_name": "kevinoconnor7/penelophant",
"path": "penelophant/api/invoice.py",
"copies": "1",
"size": "2333",
"license": "apache-2.0",
"hash": -8158018231018845000,
"line_mean": 25.5113636364,
"line_max": 73,
"alpha_frac": 0.6403771967,
"autogenerated": false,
"ratio": 3.5509893455098935,
"co... |
""" Auction REST resources """
from flask import g
from flask_restful import Resource, reqparse, abort, fields, marshal
from decimal import Decimal
from datetime import datetime, timedelta
from penelophant import crud, auther
from penelophant.database import db
from penelophant.helpers.auction import find_auction_type... | {
"repo_name": "kevinoconnor7/penelophant",
"path": "penelophant/api/auction.py",
"copies": "1",
"size": "7284",
"license": "apache-2.0",
"hash": 8037048691055955000,
"line_mean": 29.8644067797,
"line_max": 91,
"alpha_frac": 0.6722954421,
"autogenerated": false,
"ratio": 3.6166832174776564,
"con... |
"""Audience field models"""
from datetime import datetime
from emma import exceptions as ex
from emma.model import BaseApiModel, str_fields_to_datetime
class Field(BaseApiModel):
"""
Encapsulates operations for a :class:`Field`
:param account: The Account which owns this Field
:type account: :class:... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/model/field.py",
"copies": "1",
"size": "4482",
"license": "mit",
"hash": 8242425333227555000,
"line_mean": 28.4868421053,
"line_max": 80,
"alpha_frac": 0.5327978581,
"autogenerated": false,
"ratio": 3.6677577741407528,
"config_test": false,
"h... |
"""Audience group models"""
from datetime import datetime
from emma import exceptions as ex
from emma.model import BaseApiModel, str_fields_to_datetime
import emma.model.member
class Group(BaseApiModel):
"""
Encapsulates operations for a :class:`Group`
:param account: The Account which owns this Group
... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/model/group.py",
"copies": "1",
"size": "10120",
"license": "mit",
"hash": -5085210349442561000,
"line_mean": 31.2292993631,
"line_max": 84,
"alpha_frac": 0.5502964427,
"autogenerated": false,
"ratio": 3.706959706959707,
"config_test": false,
"... |
"""Audience import models"""
from emma import exceptions as ex
from emma.model import BaseApiModel, str_fields_to_datetime
from emma.model.member import Member
class MemberImport(BaseApiModel):
"""
Encapsulates operations for a :class:`MemberImport`
:param account: The Account which owns this import
... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/model/member_import.py",
"copies": "1",
"size": "2260",
"license": "mit",
"hash": 4459941538730640000,
"line_mean": 31.2857142857,
"line_max": 84,
"alpha_frac": 0.6097345133,
"autogenerated": false,
"ratio": 3.7293729372937294,
"config_test": fal... |
"""Audience mailing models"""
from datetime import datetime
from emma import exceptions as ex
from emma.enumerations import MailingStatus
from emma.model import BaseApiModel, str_fields_to_datetime
import emma.model.group
import emma.model.member
import emma.model.search
import emma.model.message
class Mailing(BaseA... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/model/mailing.py",
"copies": "1",
"size": "13207",
"license": "mit",
"hash": 7528211253292622000,
"line_mean": 32.2670025189,
"line_max": 90,
"alpha_frac": 0.5724994321,
"autogenerated": false,
"ratio": 3.736067892503536,
"config_test": true,
"... |
"""Audience member models"""
from datetime import datetime
from emma import exceptions as ex
from emma.enumerations import MemberStatus
from emma.model import BaseApiModel, str_fields_to_datetime
import emma.model.group
import emma.model.mailing
class Member(BaseApiModel):
"""
Encapsulates operations for a :... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/model/member.py",
"copies": "1",
"size": "13611",
"license": "mit",
"hash": 1704164264946743000,
"line_mean": 30.9507042254,
"line_max": 80,
"alpha_frac": 0.5400044082,
"autogenerated": false,
"ratio": 3.6393048128342245,
"config_test": false,
... |
# audience.py
import socket
import json
DEFAULT_SOCKET_PATH="/var/run/orchestra/conductor.sock"
class ServerError(Exception):
pass
def submit_job(score, scope, target, args=None, sockname=DEFAULT_SOCKET_PATH):
reqObj = {
'op': 'queue',
'score': score,
'scope': scope,
'players... | {
"repo_name": "anchor/Orchestra",
"path": "python/audience.py",
"copies": "1",
"size": "1264",
"license": "bsd-3-clause",
"hash": 81808291112471220,
"line_mean": 20.7931034483,
"line_max": 78,
"alpha_frac": 0.5490506329,
"autogenerated": false,
"ratio": 3.4162162162162164,
"config_test": false,... |
"""Audience search models"""
from datetime import datetime
from emma import exceptions as ex
from emma.model import BaseApiModel, str_fields_to_datetime
import emma.model.member
class Search(BaseApiModel):
"""
Encapsulates operations for a :class:`Search`
:param account: The Account which owns this Sear... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/model/search.py",
"copies": "1",
"size": "5247",
"license": "mit",
"hash": 4183900311628053000,
"line_mean": 29.1551724138,
"line_max": 80,
"alpha_frac": 0.5334476844,
"autogenerated": false,
"ratio": 3.6872803935347855,
"config_test": false,
"... |
"""Audience trigger models"""
from datetime import datetime
from emma import exceptions as ex
from emma.model import BaseApiModel, str_fields_to_datetime
import emma.model.mailing
class Trigger(BaseApiModel):
"""
Encapsulates operations for a :class:`Trigger`
:param account: The Account which owns this ... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/model/trigger.py",
"copies": "1",
"size": "5758",
"license": "mit",
"hash": 7322290880077317000,
"line_mean": 30.6373626374,
"line_max": 80,
"alpha_frac": 0.5375130254,
"autogenerated": false,
"ratio": 3.7292746113989637,
"config_test": false,
... |
"""Audience webhook models"""
from datetime import datetime
from emma import exceptions as ex
from emma.model import BaseApiModel, str_fields_to_datetime
class WebHook(BaseApiModel):
"""
Encapsulates operations for a :class:`WebHook`
:param account: The Account which owns this WebHook
:type account:... | {
"repo_name": "myemma/EmmaPython",
"path": "emma/model/webhook.py",
"copies": "1",
"size": "3296",
"license": "mit",
"hash": -9098683469810252000,
"line_mean": 29.2385321101,
"line_max": 80,
"alpha_frac": 0.5285194175,
"autogenerated": false,
"ratio": 3.6061269146608317,
"config_test": false,
... |
"""AudioAddict utility class."""
# pylint: disable=line-too-long, old-style-class, broad-except, too-many-instance-attributes
import urllib2
import json
import random
class AudioAddict:
"""AudioAddict utility class."""
def __init__(self):
"""Init. You know."""
self.listenkey = None
... | {
"repo_name": "phrawzty/AudioAddict.bundle",
"path": "Contents/Code/audioaddict.py",
"copies": "1",
"size": "8024",
"license": "apache-2.0",
"hash": 4047027420342683000,
"line_mean": 29.7432950192,
"line_max": 106,
"alpha_frac": 0.5493519442,
"autogenerated": false,
"ratio": 4.252252252252252,
... |
__version__ = '1.0'
__author__ = 'Michael A. Casey'
__copyright__ = "Copyright (C) 2010 Michael Casey, Dartmouth College, All Rights Reserved"
__license__ = "gpl 2.0 or higher"
__email__ = 'mcasey@dartmouth.edu'
import os
import os.path
import time
import glob
import tempfile
import shutil
import subprocess
import ... | {
"repo_name": "bregmanstudio/BregmanToolkit",
"path": "bregman/deprecated/audiocollection.py",
"copies": "1",
"size": "13816",
"license": "mit",
"hash": 4722630798900262000,
"line_mean": 34.6082474227,
"line_max": 134,
"alpha_frac": 0.5589171975,
"autogenerated": false,
"ratio": 3.965556831228473... |
AUDIO_ENABLED = True
HELP_ENABLED = True
try:
from PyQt5.QtCore import (QRectF, Qt, QModelIndex, QItemSelection,
pyqtSignal as Signal, pyqtSlot as Slot,
QThread,QAbstractTableModel,QAbstractListModel,
QSize, QSettings,QP... | {
"repo_name": "PhonologicalCorpusTools/CorpusTools",
"path": "corpustools/gui/imports.py",
"copies": "1",
"size": "2517",
"license": "bsd-3-clause",
"hash": -2895694287166294500,
"line_mean": 48.3529411765,
"line_max": 110,
"alpha_frac": 0.6046881208,
"autogenerated": false,
"ratio": 4.5269784172... |
# Audio Feature Extraction functions
import numpy as np
#import mir3.modules.features as feat
import mir3.modules.features.flatness as flatness
import mir3.modules.features.mfcc as mfcc
import mir3.modules.features.filterbank as fbank
import mir3.modules.tool.wav2spectrogram as wav2spec
import mir3.data.spectrogram ... | {
"repo_name": "pymir3/pymir3",
"path": "afe.py",
"copies": "1",
"size": "3477",
"license": "mit",
"hash": -2612570113952917500,
"line_mean": 29.5,
"line_max": 97,
"alpha_frac": 0.6404946793,
"autogenerated": false,
"ratio": 3.2586691658856606,
"config_test": false,
"has_no_keywords": false,
... |
''' Audio file info computed by soxi.
'''
import os
from numbers import Number
from pathlib import Path
from typing import List, Dict
from typing import Optional, Union
from .core import VALID_FORMATS
from .core import sox
from .core import soxi
from .log import logger
def bitdepth(input_filepath: Union[str, Path]) ... | {
"repo_name": "rabitt/pysox",
"path": "sox/file_info.py",
"copies": "1",
"size": "10952",
"license": "bsd-3-clause",
"hash": 1358571279818416000,
"line_mean": 24.00456621,
"line_max": 82,
"alpha_frac": 0.5945945946,
"autogenerated": false,
"ratio": 4.176964149504196,
"config_test": false,
"ha... |
"""Audio file I/O and audio data manipulation."""
import numpy as np
import scipy.io.wavfile
SND_DTYPES = {'int16': 16, np.int16: 16, 'int32': 32, np.int32: 32}
"""Data types that SciPy can import from ``.wav``"""
def snd_norm(snd, factor=None):
""" Scale elements of an array of (.wav) data from -1 to 1.
D... | {
"repo_name": "laporte-m/muser",
"path": "muser/audio.py",
"copies": "1",
"size": "2717",
"license": "mit",
"hash": 7838820722829125000,
"line_mean": 35.7162162162,
"line_max": 80,
"alpha_frac": 0.6245859404,
"autogenerated": false,
"ratio": 3.5516339869281044,
"config_test": false,
"has_no_k... |
# Audio Function Generator; "afg.py"...
# -------------------------------------
#
# A fun Python program to generate a Sine, Square, Triangle, Sawtooth,
# and Pulse waveforms using STANDARD Python at the earphone sockets.
# This is for (PC)Linux(OS), (ONLY?), and was done purely for fun.
# (It has now been tested on De... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/577592_Simple_1KHz_Audio_FunctiGenerator_Using/recipe-577592.py",
"copies": "1",
"size": "5147",
"license": "mit",
"hash": 3093338485334539000,
"line_mean": 34.0136054422,
"line_max": 76,
"alpha_frac": 0.693413639,
"autogenerated": false,
... |
"""Audio handling submodule."""
import collections
import time
import os
import logging
from array import array
import wave
import pyaudio
from snowboydetect import snowboydetect
logging.basicConfig()
_LOGGER = logging.getLogger("snowboy")
_LOGGER.setLevel(logging.INFO)
TOP_DIR = os.path.dirname(os.path.abspath(__fi... | {
"repo_name": "opsdroid/opsdroid-audio",
"path": "opsdroidaudio/audio.py",
"copies": "1",
"size": "8757",
"license": "apache-2.0",
"hash": -2750489212286487000,
"line_mean": 35.640167364,
"line_max": 78,
"alpha_frac": 0.5819344524,
"autogenerated": false,
"ratio": 4.232479458675689,
"config_tes... |
"""Audio Layers"""
__author__ = 'thor'
from numpy import hstack, vstack, zeros, shape, mean, random, linspace
from numpy import argmax, argmin, flipud, percentile, ndarray, ceil
import numpy as np
import os
import re
import librosa
import librosa.display
import soundfile as sf
import wave
import contextlib
from IPyth... | {
"repo_name": "thorwhalen/ut",
"path": "sound/util.py",
"copies": "1",
"size": "26365",
"license": "mit",
"hash": -8427761824746068000,
"line_mean": 38.766214178,
"line_max": 122,
"alpha_frac": 0.5789114356,
"autogenerated": false,
"ratio": 3.648629947412123,
"config_test": false,
"has_no_key... |
"""Audio module."""
import logging
import pygame
from .assets import AssetManager
from .modules import Module
from .locals import * # noqa
logger = logging.getLogger(__name__)
class AudioModule(Module):
"""
Audio module.
The audio manager is in charge of playing music and sound.
"""
def __... | {
"repo_name": "multatronic/akurra",
"path": "akurra/audio.py",
"copies": "1",
"size": "3596",
"license": "mit",
"hash": 7836698978463048000,
"line_mean": 30.8230088496,
"line_max": 93,
"alpha_frac": 0.5895439377,
"autogenerated": false,
"ratio": 3.83778014941302,
"config_test": false,
"has_no... |
'''Audio module
This module contains all audio related classes.
'''
import logging
import sdl2
from sdl2 import sdlmixer as mixer
from sdl2.ext.compat import byteify
from vulk.exception import SDL2Error, SoundError
logger = logging.getLogger()
class VulkAudio():
'''This class is only used in baseapp.
It ... | {
"repo_name": "realitix/vulk",
"path": "vulk/audio.py",
"copies": "1",
"size": "3938",
"license": "apache-2.0",
"hash": -2530578404915854300,
"line_mean": 26.1586206897,
"line_max": 77,
"alpha_frac": 0.5896394109,
"autogenerated": false,
"ratio": 3.819592628516004,
"config_test": false,
"has_... |
"""Audio module provides all the audio features (playing of sounds) for the media controller."""
import logging
from kivy.clock import Clock
from mpf.core.case_insensitive_dict import CaseInsensitiveDict
from mpf.core.utility_functions import Util
from mpfmc.core.audio.audio_interface import AudioInterface
from mpfmc.... | {
"repo_name": "missionpinball/mpf-mc",
"path": "mpfmc/core/audio/__init__.py",
"copies": "1",
"size": "9669",
"license": "mit",
"hash": 3346656535099191000,
"line_mean": 40.3205128205,
"line_max": 110,
"alpha_frac": 0.5717240666,
"autogenerated": false,
"ratio": 4.621892925430211,
"config_test"... |
from subprocess import Popen, PIPE
from scipy.io import wavfile
from scikits.talkbox.features.mfcc import mfcc
import os, tempfile, warnings
import numpy as np
def find_offset(file1, file2, fs=8000, trim=60*15, correl_nframes=1000):
tmp1 = convert_and_trim(file1, fs, trim)
tmp2 = convert_and_trim(file2, fs, t... | {
"repo_name": "bbcrd/audio-offset-finder",
"path": "audio_offset_finder/audio_offset_finder.py",
"copies": "1",
"size": "3035",
"license": "apache-2.0",
"hash": -2488187212178116000,
"line_mean": 36.4691358025,
"line_max": 82,
"alpha_frac": 0.6622734761,
"autogenerated": false,
"ratio": 2.9960513... |
# Audio parser.
# (c) Adrian deWynter, 2016
import speech_recognition as sr
import sys
import os
args = sys.argv
# For the moment, sphinx is the only interpreter (you can change it here.)
engine="sphinx"
key=""
usr,pwd="",""
writeMode = False
KEY=""
FILEPATH=""
OUTPUT=""
# For readability, all functions are containe... | {
"repo_name": "adewynter/Tools",
"path": "Docker/dltoolboxio/scripts/audioprocessor.py",
"copies": "1",
"size": "3828",
"license": "mit",
"hash": -4286851625964337700,
"line_mean": 26.7463768116,
"line_max": 99,
"alpha_frac": 0.6880877743,
"autogenerated": false,
"ratio": 2.985959438377535,
"co... |
# Audio Play
import pyaudio
import wave
import time
import sys
import pygame as pg
def play_audio(audio_file, volume=0.8):
'''
stream music with mixer.music module in a blocking manner
this will stream the sound from disk while playing
'''
# set up the mixer
freq = 44100 # audio CD quality... | {
"repo_name": "JosuVicente/facial_and_characteristics_recognition_with_speech_support",
"path": "src/audio_utils.py",
"copies": "1",
"size": "2676",
"license": "mit",
"hash": 7930898633438605000,
"line_mean": 24.2547169811,
"line_max": 77,
"alpha_frac": 0.5885650224,
"autogenerated": false,
"rati... |
"""audio_read reads in a whole audio file with resampling."""
# Equivalent to:
#import librosa
#def audio_read(filename, sr=11025, channels=1):
# """Read a soundfile, return (d, sr)."""
# d, sr = librosa.load(filename, sr=sr, mono=(channels == 1))
# return d, sr
# The code below is adapted from:
# https://gi... | {
"repo_name": "piotrwicijowski/whistler",
"path": "audio_read.py",
"copies": "1",
"size": "15179",
"license": "mit",
"hash": 503601591262938100,
"line_mean": 35.4004796163,
"line_max": 487,
"alpha_frac": 0.5476645365,
"autogenerated": false,
"ratio": 4.257784011220196,
"config_test": false,
"... |
"""audio recorder"""
import pyaudio
import wave
import time
from baseaudio import BaseAudio
class AudioRecorder(BaseAudio):
"""Tools to record audio data."""
def __init__(self, **kwargs):
"""Initializing for recording"""
super(AudioRecorder, self).__init__(**kwargs)
self.frames_perb... | {
"repo_name": "jfraj/soundeval",
"path": "recorder.py",
"copies": "1",
"size": "2248",
"license": "mit",
"hash": 3767249545451493000,
"line_mean": 34.6825396825,
"line_max": 79,
"alpha_frac": 0.5573843416,
"autogenerated": false,
"ratio": 3.9787610619469027,
"config_test": false,
"has_no_keyw... |
"""Audio source and audio processing compoenents
The two main base classes are :class:`AudioSource` which provides audio and
:class:`AudioProcessor` which act as a pipeline processor on another
:class:`AudioSource`.
"""
import asyncio
import audioop
import collections
import time
import wave
import janus
try:
i... | {
"repo_name": "ibm-dev/streamtotext",
"path": "streamtotext/audio.py",
"copies": "1",
"size": "19261",
"license": "apache-2.0",
"hash": 7737453575911213000,
"line_mean": 30.9950166113,
"line_max": 79,
"alpha_frac": 0.5940501532,
"autogenerated": false,
"ratio": 4.1359244148593515,
"config_test"... |
"""Audio sources that can provide raw PCM frames that pyatv can stream."""
from abc import ABC, abstractmethod, abstractproperty
import asyncio
from contextlib import suppress
from functools import partial
import io
import logging
from typing import Optional, Union
import miniaudio
from miniaudio import SampleFormat
... | {
"repo_name": "postlund/pyatv",
"path": "pyatv/raop/audio_source.py",
"copies": "1",
"size": "10119",
"license": "mit",
"hash": -7436319976929296000,
"line_mean": 32.2861842105,
"line_max": 88,
"alpha_frac": 0.6100405178,
"autogenerated": false,
"ratio": 4.244546979865772,
"config_test": false,... |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import os
import requests
from SocketServer import ThreadingMixIn
import subprocess
from threading import Thread
from galicaster.core import context
conf = context.get_conf()
dispatcher = context.get_dispatcher()
_http_host = conf.get('ddp', 'http_host')
_... | {
"repo_name": "SussexLearningSystems/peakaboo",
"path": "docs/capture_agent_plugins/examples/galicaster_2_manchester/audiostream.py",
"copies": "1",
"size": "4145",
"license": "mit",
"hash": 7981984166726927000,
"line_mean": 30.6488549618,
"line_max": 78,
"alpha_frac": 0.6364294331,
"autogenerated"... |
'''Audio System (aud)
This module provides access to the audaspace audio library.
'''
AUD_DEVICE_JACK = 3 #constant value
AUD_DEVICE_NULL = 0 #constant value
AUD_DEVICE_OPENAL = 1 #constant value
AUD_DEVICE_SDL = 2 #constant value
AUD_DISTANCE_MODEL_EXPONENT = 5 #constant value
AUD_DI... | {
"repo_name": "kabuku/blender-python",
"path": "blenderlib/aud.py",
"copies": "1",
"size": "16042",
"license": "mit",
"hash": 3885488376378045400,
"line_mean": 24.7366666667,
"line_max": 385,
"alpha_frac": 0.5864605411,
"autogenerated": false,
"ratio": 4.397478070175438,
"config_test": false,
... |
"""Audio time-scale modification and scrambling via synchronous overlap-add.
2015-01-18 Dan Ellis dpwe@ee.columbia.edu
"""
from __future__ import print_function
import argparse
import numpy as np
import scipy.io.wavfile
def Solafs(input_waveform, frame_size, overlap_size, max_shift,
input_point_from_o... | {
"repo_name": "dpwe/solafs",
"path": "solafs.py",
"copies": "1",
"size": "8344",
"license": "mit",
"hash": -518806669664955840,
"line_mean": 42.4583333333,
"line_max": 134,
"alpha_frac": 0.6427372963,
"autogenerated": false,
"ratio": 3.6871409633230225,
"config_test": false,
"has_no_keywords"... |
"""Audio tools and helpers
`segment` in function arguments stands for AudioSegment.
"""
import os.path
import random
import threading
from pydub.utils import make_chunks
from mutagen.easyid3 import EasyID3
import pyaudio
import pydub
SEGMENT_LENGTH_SECONDS = 35 # 35
MINIMUM_STARTING_POINT = 30 # skip at least 30 ... | {
"repo_name": "modrzew/ekoie",
"path": "audio.py",
"copies": "1",
"size": "5544",
"license": "mit",
"hash": -1015278968371964700,
"line_mean": 26.3103448276,
"line_max": 78,
"alpha_frac": 0.6383477633,
"autogenerated": false,
"ratio": 3.7868852459016393,
"config_test": false,
"has_no_keywords... |
"""Audio Utils"""
# Collected from various sources:
# License: BSD 3-clause
# Authors: Kyle Kastner
# LTSD routine from jfsantos (Joao Felipe Santos)
# Harvest, Cheaptrick, D4C, WORLD routines based on MATLAB code from M. Morise
# http://ml.cs.yamanashi.ac.jp/world/english/
# MGC code based on r9y9 (Ryuichi Yamamoto) ... | {
"repo_name": "thorwhalen/ut",
"path": "sound/others/audio_tools.py",
"copies": "1",
"size": "158402",
"license": "mit",
"hash": 463913261562416450,
"line_mean": 35.709617613,
"line_max": 185,
"alpha_frac": 0.5754094014,
"autogenerated": false,
"ratio": 3.06695322180917,
"config_test": false,
... |
import numpy
import numpy.fft
import scipy
def _bin_approx_search(lst, tg):
"""
Find the index of the element in lst which is closest to the number tg
"""
top = len(lst) - 1
bottom = 0
while top > bottom:
curri = (top - bottom)//2 + bottom
if lst[curri] < tg:
bottom ... | {
"repo_name": "twoodford/audiovisualizer",
"path": "audiovisualizer/movingfft.py",
"copies": "1",
"size": "5213",
"license": "apache-2.0",
"hash": -9000727107123308000,
"line_mean": 36.5035971223,
"line_max": 88,
"alpha_frac": 0.6840590831,
"autogenerated": false,
"ratio": 4.034829721362229,
"c... |
import numpy
from PIL import Image, ImageDraw
class Widget:
def _ampl_color(self, amplitude, frame):
"""
Get the appropriate color with alpha for the given amplitude
Args:
amplitude: The amplitude at the time
"""
color=(0,0,0)
for col in self._color:
... | {
"repo_name": "twoodford/audiovisualizer",
"path": "audiovisualizer/widgets.py",
"copies": "1",
"size": "5085",
"license": "apache-2.0",
"hash": -5245047185939257000,
"line_mean": 37.5227272727,
"line_max": 88,
"alpha_frac": 0.6098328417,
"autogenerated": false,
"ratio": 3.794776119402985,
"con... |
import PIL.Image
import PIL.ImageDraw
def make_frames(visualizers, numframes, outdimen, background=None):
"""
Returns an iterator over antialiased output images
Args:
visualizers: An iterable of visualizer widgets
numframes: The number of output frames to generate
outdimen: (width... | {
"repo_name": "twoodford/audiovisualizer",
"path": "audiovisualizer/animator.py",
"copies": "1",
"size": "1661",
"license": "apache-2.0",
"hash": -4686251224579488000,
"line_mean": 36.75,
"line_max": 84,
"alpha_frac": 0.7031908489,
"autogenerated": false,
"ratio": 3.9360189573459716,
"config_te... |
''' Audit Log Models '''
import json
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django import dispatch
from django.conf import settings
from .utils import serialize_data, data_has_changes
audit = dispat... | {
"repo_name": "analytehealth/chronicler",
"path": "chronicler/models.py",
"copies": "1",
"size": "1557",
"license": "bsd-2-clause",
"hash": -8220841440557252000,
"line_mean": 32.1276595745,
"line_max": 72,
"alpha_frac": 0.7026332691,
"autogenerated": false,
"ratio": 3.9417721518987343,
"config_... |
"""Audit log
Revision ID: cf0c99c08578
Revises:
Create Date: 2017-12-12 21:12:56.282095
"""
from datetime import datetime
from alembic import op
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy_continuum import version_class
from sqlalchemy_continuum import versioning_manager
from sqlalc... | {
"repo_name": "jelly/arch-security-tracker",
"path": "migrations/versions/cf0c99c08578_.py",
"copies": "2",
"size": "6476",
"license": "mit",
"hash": -3687643759786266600,
"line_mean": 33.2645502646,
"line_max": 73,
"alpha_frac": 0.6348054355,
"autogenerated": false,
"ratio": 3.818396226415094,
... |
"""Audit Logs API is a set of APIs for monitoring what’s happening in your Enterprise Grid organization.
Refer to https://slack.dev/python-slack-sdk/audit-logs/ for details.
"""
import json
import logging
from ssl import SSLContext
from typing import Any
from typing import Dict, Optional
import aiohttp
from aiohttp i... | {
"repo_name": "slackhq/python-slackclient",
"path": "slack_sdk/audit_logs/v1/async_client.py",
"copies": "1",
"size": "10030",
"license": "mit",
"hash": -4104228790683250000,
"line_mean": 35.3333333333,
"line_max": 112,
"alpha_frac": 0.5748903071,
"autogenerated": false,
"ratio": 4.37712789175032... |
"""Audit Module"""
from datetime import datetime
from enum import Enum
from dateutil import parser
from flask import current_app
from ..database import db
from .reference import Reference
def lookup_version():
return current_app.config.metadata['version']
class Context(Enum):
# only add new contexts to EN... | {
"repo_name": "uwcirg/true_nth_usa_portal",
"path": "portal/models/audit.py",
"copies": "1",
"size": "2974",
"license": "bsd-3-clause",
"hash": -1594743055922069000,
"line_mean": 33.183908046,
"line_max": 79,
"alpha_frac": 0.6375252186,
"autogenerated": false,
"ratio": 3.7455919395465993,
"conf... |
"""AUDIT module
Maintain a log exclusively used for recording auditable events.
Any action deemed an auditable event should make a call to
auditable_event()
Audit data is also persisted in the database *audit* table.
"""
import logging
import os
import sys
from flask import current_app
from .database import db
f... | {
"repo_name": "uwcirg/true_nth_usa_portal",
"path": "portal/audit.py",
"copies": "1",
"size": "2167",
"license": "bsd-3-clause",
"hash": 4630873641912835000,
"line_mean": 29.9571428571,
"line_max": 73,
"alpha_frac": 0.6940470697,
"autogenerated": false,
"ratio": 3.6359060402684564,
"config_test... |
#audit
import gspread
import datetime
from configuration import configuration
class audit:
def __init__(self):
config = configuration("config.ini")
self.googleUsername = config.getGoogleUsername()
self.googlePassword = config.getGooglePassword()
def save(self, language, synonym, netw... | {
"repo_name": "jameslawler/synonymly-standalone",
"path": "src/audit.py",
"copies": "1",
"size": "1253",
"license": "mit",
"hash": -5144037166942141000,
"line_mean": 40.8,
"line_max": 106,
"alpha_frac": 0.6855546688,
"autogenerated": false,
"ratio": 3.6637426900584797,
"config_test": true,
"h... |
# audit_orders.py
# Ronald L. Rivest
# July 10, 2017
# python3
"""
Routine to work with multi.py program for election audits.
Generates random audit orders from a ballot manifest
and an audit seed, for each paper ballot collection.
The overall algorithm is the "Fisher-Yates shuffle":
https://en.wikipedia.org/wi... | {
"repo_name": "ron-rivest/2017-bayes-audit",
"path": "2017-code/audit_orders.py",
"copies": "1",
"size": "3438",
"license": "mit",
"hash": -2236487544740560600,
"line_mean": 25.2442748092,
"line_max": 77,
"alpha_frac": 0.5596276905,
"autogenerated": false,
"ratio": 3.0614425645592163,
"config_t... |
import sys, datetime, time
import csv
import sys
import os
from datetime import datetime
from time import strptime
from optparse import OptionParser
from lxml import etree
### Global Variables ###
# Dictionary of XML elements to parse from each audit type
d = {}
d['FileItem'] = ['FileName', 'FullPath', 'FileAttribu... | {
"repo_name": "mandiant/AuditParser",
"path": "AuditParser.py",
"copies": "2",
"size": "22433",
"license": "apache-2.0",
"hash": 1484268054679490800,
"line_mean": 45.5435684647,
"line_max": 460,
"alpha_frac": 0.6904560246,
"autogenerated": false,
"ratio": 3.346710428166493,
"config_test": false... |
# audit_payload.py
#
# Writes logs of jobs starting and stopping based on ClassAd updates.
#
# This works automatically in a condor-ce if worker nodes have the environment
# variable CONDORCE_COLLECTOR_HOST set to point to their site's condor-ce
# server, if the jobs are run with condor glideins such as with Glidei... | {
"repo_name": "djw8605/htcondor-ce",
"path": "src/audit_payloads.py",
"copies": "4",
"size": "6954",
"license": "apache-2.0",
"hash": -6933556926483869000,
"line_mean": 35.4083769634,
"line_max": 80,
"alpha_frac": 0.6463905666,
"autogenerated": false,
"ratio": 3.665788086452293,
"config_test": ... |
# audit.py
# Code to implement Bayes post-election audit
# Ronald L. Rivest and Emily Shen
# June 23, 2012
"""
----------------------------------------------------------------------
This code available under "MIT License" (open source).
Copyright (C) 2012 Ronald L. Rivest and Emily Shen.
Permission is hereby granted, ... | {
"repo_name": "ron-rivest/2017-bayes-audit",
"path": "from-2012-bayes-audit/audit.py",
"copies": "1",
"size": "16272",
"license": "mit",
"hash": 4332667874857870300,
"line_mean": 35,
"line_max": 111,
"alpha_frac": 0.6198992134,
"autogenerated": false,
"ratio": 3.647612642905178,
"config_test": ... |
# audit.py
# Ronald L. Rivest (with Karim Husayn Karimi)
# July 18, 2017
# python3
"""
Routines to work with multi.py on post-election audits.
"""
import os
import time
import multi
import csv_readers
import ids
import outcomes
import planner
import risk_bayes
import saved_state
import utils
#####################... | {
"repo_name": "ron-rivest/2017-bayes-audit",
"path": "2017-code/audit.py",
"copies": "1",
"size": "21474",
"license": "mit",
"hash": 7597860329503809000,
"line_mean": 36.024137931,
"line_max": 97,
"alpha_frac": 0.5372543541,
"autogenerated": false,
"ratio": 3.5969849246231154,
"config_test": tr... |
"""Audit trails for graphs and graph hierarchies.
This module containes a collection of utils for audit trails that
provide version control for transformations of graphs and graph hierarchies:
* `Versioning`, abstract class for in-memory versioning of objects;
* `VersionedGraph`, wrapper around graph objects in ReGra... | {
"repo_name": "Kappa-Dev/ReGraph",
"path": "regraph/audit.py",
"copies": "1",
"size": "30208",
"license": "mit",
"hash": -7807191151811318000,
"line_mean": 35.884004884,
"line_max": 107,
"alpha_frac": 0.5367121292,
"autogenerated": false,
"ratio": 4.391335949992731,
"config_test": false,
"has... |
''' Audit utilities '''
def get_data_from_field(obj, field):
''' Takes an model obj and a field object, gets the value for the field
from the supplied object and returns the resulting data
'''
field_type = field.get_internal_type()
if field_type == 'ForeignKey':
return getattr(obj, field.at... | {
"repo_name": "analytehealth/chronicler",
"path": "chronicler/utils.py",
"copies": "1",
"size": "1623",
"license": "bsd-2-clause",
"hash": -3703949068793442300,
"line_mean": 35.8863636364,
"line_max": 76,
"alpha_frac": 0.6487985213,
"autogenerated": false,
"ratio": 4.2265625,
"config_test": fal... |
"""A UDP server class for gevent"""
# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details.
# Copyright (c) 2013 Russell Cloran
import sys
import errno
import traceback
from gevent import socket
from gevent import core
from gevent.baseserver import BaseServer
__all__ = ['DatagramServer']
class DatagramS... | {
"repo_name": "rcloran/SleepProxyServer",
"path": "sleepproxy/udp.py",
"copies": "1",
"size": "5306",
"license": "bsd-2-clause",
"hash": 1716105987697285600,
"line_mean": 33.9078947368,
"line_max": 103,
"alpha_frac": 0.6047870335,
"autogenerated": false,
"ratio": 3.9072164948453607,
"config_tes... |
audTemp ="""
<audio id="audElement" controls class="media-object">
<source src="./doc/%(fname)s" type="audio/mpeg" />
<em>Sorry, your browser doesn't support HTML5 audio.</em>
</audio>
"""
from bottle import Bottle,route, run, template, static_file,request,redirect
import os,sched,time
from multipr... | {
"repo_name": "vik1124/BottlePlayer",
"path": "tstbotplayer.py",
"copies": "1",
"size": "2614",
"license": "mit",
"hash": -4036349211193275000,
"line_mean": 23.9047619048,
"line_max": 155,
"alpha_frac": 0.6775057383,
"autogenerated": false,
"ratio": 2.8351409978308024,
"config_test": false,
"... |
## Aug 31 '11 at 4:58
## By Nick ODell
## Modified by Jared Haer
##
import math
class Turtle():
def __init__(self):
self.x, self.y, self.angle = 0.0, 0.0, 0.0
self.pointsVisited = []
self._visit()
def position(self):
return self.x, self.y
def xcor(self):
return se... | {
"repo_name": "J216/gimp_be",
"path": "gimp_be/draw/UndrawnTurtle.py",
"copies": "1",
"size": "1444",
"license": "mit",
"hash": -5425279381624666000,
"line_mean": 21.578125,
"line_max": 71,
"alpha_frac": 0.555401662,
"autogenerated": false,
"ratio": 3.6743002544529264,
"config_test": false,
"... |
# Auger legacy functions
'''TESTING
i=0 X=0 Y=0 elnum=0
[elem, order, peakind, lowind, highind, peakrange, lowrange, hirange, idealev, idealind,
idealnegpeak, integwidth, chargeshift, peakwidth, searchwidth]=Elemdata[i]
'''
def integmaps(specimage, backarray, Elemdata, shiftdi... | {
"repo_name": "tkcroat/Augerquant",
"path": "Development/Auger_legacy_functions.py",
"copies": "1",
"size": "116655",
"license": "mit",
"hash": -1386515949523438000,
"line_mean": 60.8190630048,
"line_max": 187,
"alpha_frac": 0.5640992671,
"autogenerated": false,
"ratio": 3.7376245554451955,
"co... |
"""Augmentation layers.
This module includes augmentation layers that can be applied to audio data and representations.
"""
import tensorflow as tf
from tensorflow.keras.layers import Layer
from tensorflow.keras import backend as K
from . import backend
from .backend import _CH_FIRST_STR, _CH_LAST_STR, _CH_DEFAULT_ST... | {
"repo_name": "keunwoochoi/kapre",
"path": "kapre/augmentation.py",
"copies": "1",
"size": "2970",
"license": "mit",
"hash": -8568890512612209000,
"line_mean": 27.8349514563,
"line_max": 95,
"alpha_frac": 0.530976431,
"autogenerated": false,
"ratio": 3.862158647594278,
"config_test": false,
"... |
""" Augment core.
Manager and Worker classes.
"""
import os
import multiprocessing as mp
from PIL import Image
class Manager(object):
def __init__(self, src, dest, transformations, num_workers=4):
self.src = src
self.dest = dest
self.num_workers = num_workers
self.queue = mp.... | {
"repo_name": "floringogianu/augment",
"path": "augment/core.py",
"copies": "1",
"size": "2700",
"license": "mit",
"hash": 3793789346854653000,
"line_mean": 29.6818181818,
"line_max": 78,
"alpha_frac": 0.5077777778,
"autogenerated": false,
"ratio": 3.896103896103896,
"config_test": false,
"ha... |
#Augment data by x8 times by making scalings and small rotations
from util import shear_image
from util import rotate_image
from util import image_rotated_cropped
import glob
import cv2
import uuid
import os
from shutil import copyfile
IMAGE_WIDTH = 32
IMAGE_HEIGHT = 32
input_folder = "../img/mouth_data"
output_fold... | {
"repo_name": "juanzdev/TeethClassifierCNN",
"path": "src/data_augmentation.py",
"copies": "1",
"size": "1833",
"license": "mit",
"hash": 6982811367499585000,
"line_mean": 34.25,
"line_max": 111,
"alpha_frac": 0.6186579378,
"autogenerated": false,
"ratio": 3.407063197026022,
"config_test": fals... |
"""Augmenters that are collections of other augmenters.
List of augmenters:
* :class:`RandAugment`
Added in 0.4.0.
"""
from __future__ import print_function, division, absolute_import
import numpy as np
from .. import parameters as iap
from .. import random as iarandom
from . import meta
from . import arithme... | {
"repo_name": "aleju/imgaug",
"path": "imgaug/augmenters/collections.py",
"copies": "2",
"size": "14361",
"license": "mit",
"hash": -3218769919617967600,
"line_mean": 41.1143695015,
"line_max": 173,
"alpha_frac": 0.6076874869,
"autogenerated": false,
"ratio": 3.8971506105834464,
"config_test": ... |
"""Augmenters that help with debugging.
List of augmenters:
* :class:`SaveDebugImageEveryNBatches`
Added in 0.4.0.
"""
from __future__ import print_function, division, absolute_import
from abc import ABCMeta, abstractmethod, abstractproperty
import os
import collections
import six
import numpy as np
import i... | {
"repo_name": "aleju/ImageAugmenter",
"path": "imgaug/augmenters/debug.py",
"copies": "2",
"size": "39118",
"license": "mit",
"hash": -1162588301609256000,
"line_mean": 29.5609375,
"line_max": 173,
"alpha_frac": 0.5741857968,
"autogenerated": false,
"ratio": 3.650429264650989,
"config_test": fa... |
#AugmentHaps.py
# Import necessary modules
import numpy as np
from argparse import ArgumentParser
from Modules.VCF_parser import *
from Modules.General import *
from Modules.IO import *
# Inputs:
parser = ArgumentParser()
parser.add_argument(
'-i','--inputHaps',
action="store",
dest="know... | {
"repo_name": "cruzan-lab/CallHap",
"path": "AugmentHaps.py",
"copies": "1",
"size": "2891",
"license": "mit",
"hash": 7183536166534940000,
"line_mean": 29.0860215054,
"line_max": 84,
"alpha_frac": 0.6727775856,
"autogenerated": false,
"ratio": 2.9804123711340207,
"config_test": false,
"has_n... |
# Augmenting Face Image Database via Transformations (Flip, Rotate, Crop & Scale)
# Jay Narhan
# UserID: JN721
#
# This class is designed to apply a series of image transformations to a set of images. A transformation is simply a
# function. It is a function that maps the image to another version of the image.
#
# G(x... | {
"repo_name": "muxspace/facial_expressions",
"path": "python/JN721.py",
"copies": "2",
"size": "5371",
"license": "apache-2.0",
"hash": -3925568868637191000,
"line_mean": 37.0921985816,
"line_max": 120,
"alpha_frac": 0.5440327686,
"autogenerated": false,
"ratio": 3.8640287769784174,
"config_tes... |
''' augment __init__() '''
def func3():
print "you are calling func3 from world module"
class MyClass(object):
def __init__(self, who, what, when):
self.who = who
self.what = what
self.when = when
def hello(self):
print "if you are good, {} will bring presents instead of... | {
"repo_name": "daveg999/automation_class",
"path": "class9/ex6/mytest/world.py",
"copies": "1",
"size": "1419",
"license": "apache-2.0",
"hash": -6353121979466090000,
"line_mean": 24.8,
"line_max": 126,
"alpha_frac": 0.5990133897,
"autogenerated": false,
"ratio": 3.3154205607476634,
"config_tes... |
""" A UI that allows the user to choose a view. """
# Enthought library imports.
from enthought.pyface.workbench.api import IView, WorkbenchWindow
from enthought.traits.api import Any, HasTraits, Instance, List, Str
from enthought.traits.api import TraitError, Undefined
from enthought.traits.ui.api import Item, TreeE... | {
"repo_name": "enthought/traitsgui",
"path": "enthought/pyface/workbench/action/view_chooser.py",
"copies": "1",
"size": "6433",
"license": "bsd-3-clause",
"hash": -2904724967289445000,
"line_mean": 31.3266331658,
"line_max": 79,
"alpha_frac": 0.4818902534,
"autogenerated": false,
"ratio": 5.0733... |
""" A UI that allows the user to choose a view. """
# Enthought library imports.
from pyface.workbench.api import IView, WorkbenchWindow
from traits.api import Any, HasTraits, Instance, List, Str
from traits.api import TraitError, Undefined
from traitsui.api import Item, TreeEditor, TreeNode, View
from traitsui.menu ... | {
"repo_name": "pankajp/pyface",
"path": "pyface/workbench/action/view_chooser.py",
"copies": "4",
"size": "6371",
"license": "bsd-3-clause",
"hash": 1669395251280931300,
"line_mean": 31.0150753769,
"line_max": 79,
"alpha_frac": 0.4781039083,
"autogenerated": false,
"ratio": 5.12962962962963,
"c... |
"""A UI used to manipulate blendshapes."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from functools import partial
import logging
import os
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from maya.app.general.mayaMixin import MayaQWidg... | {
"repo_name": "chadmv/cmt",
"path": "scripts/cmt/deform/shapesui.py",
"copies": "1",
"size": "6401",
"license": "mit",
"hash": 3626342756245635000,
"line_mean": 33.4139784946,
"line_max": 88,
"alpha_frac": 0.6255272614,
"autogenerated": false,
"ratio": 3.75425219941349,
"config_test": false,
... |
"""A unified interface for performing and debugging optimization problems."""
import abc
import numpy as np
import scipy.sparse as sps
import scipy.optimize as opt
from scipy.optimize import minimize
class Optimizer(object):
def __init__(self, fun, x0, args=(), method='L-BFGS-B', jac=None,
hes... | {
"repo_name": "FrancoisRheaultUS/dipy",
"path": "dipy/core/optimize.py",
"copies": "9",
"size": "11096",
"license": "bsd-3-clause",
"hash": 703478615690414500,
"line_mean": 31.2558139535,
"line_max": 79,
"alpha_frac": 0.5603821197,
"autogenerated": false,
"ratio": 4.239969430645778,
"config_tes... |
""" A unified interface for performing and debugging optimization problems.
Only L-BFGS-B and Powell is supported in this class for versions of
Scipy < 0.12. All optimizers are available for scipy >= 0.12.
"""
import abc
from distutils.version import LooseVersion
import numpy as np
import scipy
import scipy.sparse as ... | {
"repo_name": "Messaoud-Boudjada/dipy",
"path": "dipy/core/optimize.py",
"copies": "3",
"size": "15193",
"license": "bsd-3-clause",
"hash": 4531625914953720300,
"line_mean": 32.9129464286,
"line_max": 79,
"alpha_frac": 0.5189890081,
"autogenerated": false,
"ratio": 4.3683151236342725,
"config_t... |
# A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:
# 1/2 = 0.5
# 1/3 = 0.(3)
# 1/4 = 0.25
# 1/5 = 0.2
# 1/6 = 0.1(6)
# 1/7 = 0.(142857)
# 1/8 = 0.125
# 1/9 = 0.(1)
# 1/10 = 0.1
# Where 0.1(6) means 0.166666..., and ha... | {
"repo_name": "ledbutter/ProjectEulerPython",
"path": "Problem26.py",
"copies": "1",
"size": "1739",
"license": "mit",
"hash": -222720630692340540,
"line_mean": 23.9850746269,
"line_max": 132,
"alpha_frac": 0.5710178263,
"autogenerated": false,
"ratio": 2.466666666666667,
"config_test": false,
... |
# A unival tree (which stands for "universal value") is a tree where all nodes under it have the same value.
# Given the root to a binary tree, count the number of unival subtrees.
# For example, the following tree has 5 unival subtrees:
# 0
# / \
# 1 0
# / \
# 1 0
# / \
# 1 1
class Node:
... | {
"repo_name": "marianosimone/interviewed",
"path": "dailycodingproblem/problems/20180725.py",
"copies": "1",
"size": "1417",
"license": "unlicense",
"hash": -3586627749343494700,
"line_mean": 26.25,
"line_max": 108,
"alpha_frac": 0.5906845448,
"autogenerated": false,
"ratio": 2.9644351464435146,
... |
""" A universal module with functions / classes without dependencies. """
import functools
import re
import os
_sep = os.path.sep
if os.path.altsep is not None:
_sep += os.path.altsep
_path_re = re.compile(r'(?:\.[^{0}]+|[{0}]__init__\.py)$'.format(re.escape(_sep)))
del _sep
def to_list(func):
def wrapper(*... | {
"repo_name": "glenngillen/dotfiles",
"path": ".vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/jedilsp/jedi/inference/utils.py",
"copies": "3",
"size": "2706",
"license": "mit",
"hash": -8386216320932229000,
"line_mean": 29.0666666667,
"line_max": 82,
"alpha_frac": 0.6603843311,
... |
""" A universal module with functions / classes without dependencies. """
import sys
import contextlib
import functools
import re
from ast import literal_eval
from jedi._compatibility import unicode, next, reraise
from jedi import settings
class MultiLevelStopIteration(Exception):
"""
StopIteration's get cat... | {
"repo_name": "syseleven/vim-config",
"path": ".vim/bundle/jedi-vim/jedi/jedi/common.py",
"copies": "3",
"size": "4718",
"license": "apache-2.0",
"hash": -1022404644993503700,
"line_mean": 30.8783783784,
"line_max": 88,
"alpha_frac": 0.6456125477,
"autogenerated": false,
"ratio": 4.19005328596802... |
""" A universal module with functions / classes without dependencies. """
import sys
import contextlib
import functools
import re
from itertools import chain
from ast import literal_eval
from jedi._compatibility import unicode, reraise
from jedi import settings
class UncaughtAttributeError(Exception):
"""
Im... | {
"repo_name": "rfguri/vimfiles",
"path": "bundle/ycm/third_party/ycmd/third_party/JediHTTP/vendor/jedi/jedi/common.py",
"copies": "1",
"size": "5091",
"license": "mit",
"hash": -8839519003334778000,
"line_mean": 30.81875,
"line_max": 88,
"alpha_frac": 0.643095659,
"autogenerated": false,
"ratio":... |
""" A universal module with functions / classes without dependencies. """
import sys
import contextlib
import functools
import re
import os
from jedi._compatibility import reraise
_sep = os.path.sep
if os.path.altsep is not None:
_sep += os.path.altsep
_path_re = re.compile('(?:\.[^{0}]+|[{0}]__init__\.py)$'.for... | {
"repo_name": "edelvalle/SublimeJEDI",
"path": "dependencies/jedi/evaluate/utils.py",
"copies": "8",
"size": "4702",
"license": "mit",
"hash": -3999563322148045000,
"line_mean": 29.5324675325,
"line_max": 84,
"alpha_frac": 0.6314334326,
"autogenerated": false,
"ratio": 3.7980613893376414,
"conf... |
""" A universal module with functions / classes without dependencies. """
import sys
import contextlib
import functools
import tokenizer as tokenize
from jedi._compatibility import next, reraise
from jedi import settings
FLOWS = ['if', 'else', 'elif', 'while', 'with', 'try', 'except', 'finally']
class MultiLevelSto... | {
"repo_name": "stevenbaker/dotfiles",
"path": ".vim/bundle/jedi-vim/jedi/jedi/common.py",
"copies": "3",
"size": "7146",
"license": "mit",
"hash": -7334574756159066000,
"line_mean": 32.8672985782,
"line_max": 81,
"alpha_frac": 0.5856423174,
"autogenerated": false,
"ratio": 4.137811233352634,
"c... |
""" A universal module with functions / classes without dependencies. """
import sys
import contextlib
import functools
from jedi._compatibility import reraise
from jedi import settings
class UncaughtAttributeError(Exception):
"""
Important, because `__getattr__` and `hasattr` catch AttributeErrors
impli... | {
"repo_name": "NixaSoftware/CVis",
"path": "venv/lib/python2.7/site-packages/jedi/common.py",
"copies": "1",
"size": "3397",
"license": "apache-2.0",
"hash": -2103930164891915300,
"line_mean": 29.6036036036,
"line_max": 79,
"alpha_frac": 0.6555784516,
"autogenerated": false,
"ratio": 4.2729559748... |
""" A universal module with functions / classes without dependencies. """
import sys
import contextlib
import functools
from jedi._compatibility import reraise
def to_list(func):
def wrapper(*args, **kwargs):
return list(func(*args, **kwargs))
return wrapper
def unite(iterable):
"""Turns a two ... | {
"repo_name": "bazitur/brackets-python-tools",
"path": "pythonfiles/jedi/evaluate/utils.py",
"copies": "1",
"size": "3371",
"license": "mit",
"hash": 5764960438006678000,
"line_mean": 29.6454545455,
"line_max": 79,
"alpha_frac": 0.6541085731,
"autogenerated": false,
"ratio": 4.272496831432193,
... |
# A unix-oriented process dispatcher. Uses a single thread with select and
# waitpid to dispatch tasks. This avoids several deadlocks that are possible
# with fork/exec + threads + Python.
import errno, os, select
from datetime import datetime, timedelta
from results import TestOutput
class Task(object):
def __... | {
"repo_name": "kostaspl/SpiderMonkey38",
"path": "js/src/tests/lib/tasks_unix.py",
"copies": "1",
"size": "6038",
"license": "mpl-2.0",
"hash": -5857604089124803000,
"line_mean": 28.7438423645,
"line_max": 80,
"alpha_frac": 0.5944021199,
"autogenerated": false,
"ratio": 3.807061790668348,
"conf... |
"""A Unstructred Grid file reader object.
"""
# Author: R.Sreekanth <sreekanth [at] aero.iitb.ac.in>
# Suyog Dutt Jain <suyog.jain [at] aero.iitb.ac.in>
# Copyright (c) 2009-2015, Enthought, Inc.
# License: BSD Style.
from os.path import basename
# Enthought library imports.
from traits.api import Ins... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/sources/unstructured_grid_reader.py",
"copies": "1",
"size": "5172",
"license": "bsd-3-clause",
"hash": 7626250273214116000,
"line_mean": 34.9166666667,
"line_max": 74,
"alpha_frac": 0.5146945089,
"autogenerated": false,
"ratio": 4.3572030328559395,... |
"""A Unstructred Grid file reader object.
"""
# Author: R.Sreekanth <sreekanth [at] aero.iitb.ac.in>
# Suyog Dutt Jain <suyog.jain [at] aero.iitb.ac.in>
# Copyright (c) 2009, Enthought, Inc.
# License: BSD Style.
from os.path import basename
# Enthought library imports.
from traits.api import Instance... | {
"repo_name": "alexandreleroux/mayavi",
"path": "mayavi/sources/unstructured_grid_reader.py",
"copies": "2",
"size": "5178",
"license": "bsd-3-clause",
"hash": -1598316516054268200,
"line_mean": 34.9583333333,
"line_max": 74,
"alpha_frac": 0.5142912321,
"autogenerated": false,
"ratio": 4.35492010... |
"""Aurifere
Usage:
aurifere [-v] install <package>...
aurifere [-v] update
Options:
-h --help Show this screen.
-v --verbose
"""
from .vendor.docopt import docopt
from .vendor import colorama
from .install import Install
from .repository import default_repository
def comma_separated_package_list(pkgs):... | {
"repo_name": "madjar/aurifere",
"path": "aurifere/cli.py",
"copies": "1",
"size": "2773",
"license": "isc",
"hash": 1272272364031834000,
"line_mean": 24.9158878505,
"line_max": 79,
"alpha_frac": 0.6314460873,
"autogenerated": false,
"ratio": 3.90014064697609,
"config_test": false,
"has_no_ke... |
'''aurora core -- provides the main classes
This mostly implements the Articles class that does all of the iteration
on the articles. It also implements the individual Article class.
'''
import os
import re
class Articles:
'''Keeps track of all of the individual articles that exist.
'''
def __init__(se... | {
"repo_name": "zorkian/aurora",
"path": "aurora/core.py",
"copies": "1",
"size": "3657",
"license": "bsd-3-clause",
"hash": -2123723838344545800,
"line_mean": 30.2564102564,
"line_max": 88,
"alpha_frac": 0.4883784523,
"autogenerated": false,
"ratio": 3.693939393939394,
"config_test": false,
"... |
import requests
import json
from pprint import pprint
class Aurora:
def __init__(self, auth_token, address, port=16021):
self.auth_token = auth_token
self.address = address
self.port = port
self.uri_base = "http://%s:%d/api/v1/%s" % (address, port, auth_token)
def _get_json(... | {
"repo_name": "miriad/nanoleaf-aurora-python",
"path": "aurora.py",
"copies": "1",
"size": "3333",
"license": "apache-2.0",
"hash": 1019160575171354400,
"line_mean": 29.8611111111,
"line_max": 102,
"alpha_frac": 0.600060006,
"autogenerated": false,
"ratio": 3.5419766206163654,
"config_test": fa... |
"""aurpackager URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | {
"repo_name": "colajam93/aurpackager",
"path": "aurpackager/urls.py",
"copies": "1",
"size": "1068",
"license": "mit",
"hash": 3811500732494090000,
"line_mean": 33.4516129032,
"line_max": 94,
"alpha_frac": 0.6825842697,
"autogenerated": false,
"ratio": 3.6203389830508477,
"config_test": false,
... |
# aus2.py
# July 30, 2016
# python3
# part of https://github.com/ron-rivest/2016-aus-senate-audit
"""
Framework for AUS senate audit by Bayesian audit method.
This codes derives from aus.py, but modified to utilize api.py
for interfacing with dividebatur code.
It has also been modified to use gamma-variates to draw fr... | {
"repo_name": "ron-rivest/2016-aus-senate-audit",
"path": "rivest/aus2.py",
"copies": "1",
"size": "9416",
"license": "apache-2.0",
"hash": 8769722515381876000,
"line_mean": 38.3974895397,
"line_max": 92,
"alpha_frac": 0.5867672048,
"autogenerated": false,
"ratio": 4.060370849504096,
"config_te... |
"""A Usage vector implementation used in a DNC.
This Usage vector is implemented as defined in the DNC architecture in
DeepMind's Nature paper:
http://www.nature.com/nature/journal/vaop/ncurrent/full/nature20101.html
Author: Austin Derrow-Pinion
"""
import collections
import sonnet as snt
import tensorflo... | {
"repo_name": "derrowap/DNC-TensorFlow",
"path": "src/dnc/usage.py",
"copies": "1",
"size": "10813",
"license": "mit",
"hash": 579693369395257600,
"line_mean": 46.2723214286,
"line_max": 79,
"alpha_frac": 0.5988162397,
"autogenerated": false,
"ratio": 4.217238689547582,
"config_test": false,
... |
"""A USB vehicle interface data source."""
import logging
import usb.core
import usb.util
from .base import BytestreamDataSource, DataSourceError
LOG = logging.getLogger(__name__)
class UsbDataSource(BytestreamDataSource):
"""A source to receive data from an OpenXC vehicle interface via USB."""
DEFAULT_VE... | {
"repo_name": "openxc/openxc-python",
"path": "openxc/sources/usb.py",
"copies": "1",
"size": "3690",
"license": "bsd-3-clause",
"hash": -6111960586269614000,
"line_mean": 38.2553191489,
"line_max": 121,
"alpha_frac": 0.6344173442,
"autogenerated": false,
"ratio": 3.9891891891891893,
"config_te... |
#A useful class for dealing with 2-D arrays
import array
class Array2D:
def __init__(self, w, h, element_width):
self.width = w
self.height = h
self.element_width = element_width
def null_array(self):
self.data = array.array('B', (0,)*(self.width*self.height*self.element_w... | {
"repo_name": "barneygale/mcocr",
"path": "mcocr/array2d.py",
"copies": "1",
"size": "2038",
"license": "bsd-3-clause",
"hash": 4473067598729724400,
"line_mean": 32.9666666667,
"line_max": 147,
"alpha_frac": 0.5628066732,
"autogenerated": false,
"ratio": 3.48972602739726,
"config_test": false,
... |
# a/user/briefing.py
import json
import os
import records
from .mission import Mission
from f1.s.core.persistent import Persistent
# from f1.a.user.session import Session
class Briefing(Persistent):
me = None
def __init__(self, account, device_id, boot_config):
super().__init__(boot_config)
... | {
"repo_name": "filemakergarage/zeroclient",
"path": "f1/a/user/briefing.py",
"copies": "1",
"size": "1715",
"license": "mit",
"hash": -3683757618219622000,
"line_mean": 30.1818181818,
"line_max": 84,
"alpha_frac": 0.587755102,
"autogenerated": false,
"ratio": 3.712121212121212,
"config_test": f... |
# a user-created video game database that allows the user to add and remove games from the database, as well as search
# their database by a variety of parameters
#
# by Matthew Ridderikhoff, created 06/08/2016
import sqlite3
class Database:
def __init__(self, dbName, tableName, invalidResponse):
... | {
"repo_name": "MattRidderikhoff/My-Game-Database",
"path": "Database.py",
"copies": "1",
"size": "12860",
"license": "mit",
"hash": -2696803214163047000,
"line_mean": 35.7126099707,
"line_max": 122,
"alpha_frac": 0.5728615863,
"autogenerated": false,
"ratio": 4.404109589041096,
"config_test": f... |
"""A user-friendly Bash module for Python.
Built upon Alex Couper's `bash` package. (https://github.com/alexcouper/bash)
"""
# TODO-SDH It may be helpful to use psutil for pybasher.
# TODO-SDH Finish pybasher ASAP
# TODO-SDH Look at some examples for pybasher.
# TODO-SDH Update the README for pybasher
import platform
... | {
"repo_name": "datasnakes/Datasnakes-Scripts",
"path": "OrthoEvol/Tools/pybasher/bash.py",
"copies": "1",
"size": "3165",
"license": "mit",
"hash": -4535596205700652000,
"line_mean": 27.5135135135,
"line_max": 87,
"alpha_frac": 0.595892575,
"autogenerated": false,
"ratio": 4.0681233933161955,
"... |
"""A user interface for interacting with the network."""
from tkinter import Tk, Frame, Button, Label, Entry, Menu, messagebox, Toplevel
from tomography import Tomography
from Node import Node, Server, EndUser
from Connection import Connection
from Link import Link
class Display(Frame):
"""Provide the user with ... | {
"repo_name": "SamuelDoud/tomography",
"path": "tomography/src/Display.py",
"copies": "1",
"size": "7084",
"license": "mit",
"hash": -5042831739538164000,
"line_mean": 40.6647058824,
"line_max": 97,
"alpha_frac": 0.6183820415,
"autogenerated": false,
"ratio": 3.6267281105990783,
"config_test": ... |
"""A user profile shows the publically available information about a user."""
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
import datetime
class UserProfile(models.Model):
"""Public user profile."""
user = models.ForeignKey(User, rela... | {
"repo_name": "CornerstoneLabs/club-prototype",
"path": "app-server/userprofile/models.py",
"copies": "1",
"size": "1136",
"license": "mit",
"hash": 2055803166582848800,
"line_mean": 32.4117647059,
"line_max": 77,
"alpha_frac": 0.6698943662,
"autogenerated": false,
"ratio": 4.057142857142857,
"... |
# aus.py
# July 27, 2016
# python3
# code sketches for AUS senate audit by Bayesian audit method
import collections
import copy
import random
# random.seed(1) # make deterministic
class Election:
pass
class RealElection(Election):
def __init__(self):
self.candidates = []
self.prior_ballot... | {
"repo_name": "ron-rivest/2016-aus-senate-audit",
"path": "rivest/aus.py",
"copies": "1",
"size": "5250",
"license": "apache-2.0",
"hash": 65468940656693610,
"line_mean": 30.4371257485,
"line_max": 87,
"alpha_frac": 0.5622857143,
"autogenerated": false,
"ratio": 4.057187017001546,
"config_test"... |
a#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
import stocktime as st
import datetime as dt
from datetime import datetime
import time, requests, os, pickle, logging
__version__ = '0.0.1'
__license__ = 'MIT'
__author__ = 'Joshua Guo (1992gq@gmail... | {
"repo_name": "JoshuaMichaelKing/Stock-SentimentAnalysis",
"path": "stockindex.py",
"copies": "1",
"size": "3813",
"license": "mit",
"hash": -7323772930541230000,
"line_mean": 33.7798165138,
"line_max": 100,
"alpha_frac": 0.5489316803,
"autogenerated": false,
"ratio": 3.669893514036786,
"config... |
#a!/usr/bin/env python3
from lsh.model import LSHItem
import random
class LSHReader:
def __init__(self):
import pyximport; pyximport.install()
from lsh import bits
def process_file(self, filelike):
for line in filelike:
yield self.process_line(line.strip())
def proce... | {
"repo_name": "schwa-lab/lsh",
"path": "lsh/readers.py",
"copies": "1",
"size": "1163",
"license": "mit",
"hash": 6751838656523927000,
"line_mean": 23.7446808511,
"line_max": 101,
"alpha_frac": 0.5649183147,
"autogenerated": false,
"ratio": 3.668769716088328,
"config_test": false,
"has_no_key... |
"""Australian-specific Form helpers."""
from __future__ import unicode_literals
import re
from django.forms import ValidationError
from django.forms.fields import CharField, RegexField, Select
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from localflavor.compa... | {
"repo_name": "thor/django-localflavor",
"path": "localflavor/au/forms.py",
"copies": "2",
"size": "4295",
"license": "bsd-3-clause",
"hash": -8590122977940521000,
"line_mean": 30.3503649635,
"line_max": 116,
"alpha_frac": 0.6533178114,
"autogenerated": false,
"ratio": 3.936755270394134,
"confi... |
a = u"String"
# Python 3.6
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 3.5 does not support a 'F' prefix">f</warning></error>""
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 3.5 does not support a 'F' prefix">F... | {
"repo_name": "dahlstrom-g/intellij-community",
"path": "python/testData/inspections/PyCompatibilityInspection/stringLiteralExpression.py",
"copies": "10",
"size": "3240",
"license": "apache-2.0",
"hash": 8809982432956743000,
"line_mean": 56.875,
"line_max": 281,
"alpha_frac": 0.6561728395,
"autoge... |
# Autelis Pool Control wrapper class
# Designed to work with Jandy TCP Serial Port Firmwares v. 1.6.9
# and higher and Pentair TCP Serial Port Firmwares v. 1.6.7 and higher
import requests
import re
import socket
import xml.etree.ElementTree as xml
import logging
import sys
# Parameters for Pool Control H... | {
"repo_name": "Goose66/autelis-polyglot",
"path": "autelisapi.py",
"copies": "1",
"size": "9498",
"license": "mit",
"hash": -8552148698311785000,
"line_mean": 34.9571984436,
"line_max": 119,
"alpha_frac": 0.5727521583,
"autogenerated": false,
"ratio": 4.321201091901729,
"config_test": false,
... |
#Auteur: Rémi Pelletier
#Fichier: ForceBrute-RemiPelletier.py
#Problème: Force brute (Compétition informatique CEGInfo-CEGL 2016)
#Score: 45.45/50 (le dernier test échoue en raison d'un timeout)
import re
class Node:
value = 0
nNodes = 1
childs = []
def __init__(self):
... | {
"repo_name": "PolyAlgo/PolyAlgo",
"path": "Documentation/Compétion informatique CEGInfo 2016/Force brute (1)/ForceBrute-RemiPelletier.py",
"copies": "2",
"size": "1772",
"license": "apache-2.0",
"hash": -2317679348799182300,
"line_mean": 26.0634920635,
"line_max": 97,
"alpha_frac": 0.5701357466,
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.