text stringlengths 0 1.05M | meta dict |
|---|---|
import numpy as np
import pyopencl as cl
mf = cl.mem_flags
PROFILING = 0
_cache = {}
def julia_cpu_prepare(cr, ci, N, bound, lim, cutoff):
ctx = cl.create_some_context()
if PROFILING:
queue = cl.CommandQueue(
ctx,
properties=cl.command_queue_properties.PROFILING_ENABLE)
... | {
"repo_name": "numfocus/python-benchmarks",
"path": "julia/julia_pyopencl.py",
"copies": "1",
"size": "1777",
"license": "mit",
"hash": -3583116640439684600,
"line_mean": 24.0281690141,
"line_max": 76,
"alpha_frac": 0.5132245357,
"autogenerated": false,
"ratio": 2.8894308943089433,
"config_test... |
import numpy as np
import time
import pyopencl as cl
import numpy
mf = cl.mem_flags
PROFILING = 0
ctx = cl.create_some_context()
if PROFILING:
queue = cl.CommandQueue(
ctx,
properties=cl.command_queue_properties.PROFILING_ENABLE)
else:
queue = cl.CommandQueue(ctx)
_cache = {}
def pairwise_... | {
"repo_name": "numfocus/python-benchmarks",
"path": "pairwise/pairwise_pyopencl.py",
"copies": "1",
"size": "3169",
"license": "mit",
"hash": 8759656178958074000,
"line_mean": 29.180952381,
"line_max": 82,
"alpha_frac": 0.4856421584,
"autogenerated": false,
"ratio": 3.0152235965746907,
"config_... |
"""Connect to and interact with a REST server and its objects."""
import re
import sys
from string import Template
import six
from six.moves import urllib, range
from pyactiveresource import connection
from pyactiveresource import element_containers
from pyactiveresource import formats
from pyactiveresource import u... | {
"repo_name": "varesa/pyactiveresource",
"path": "pyactiveresource/activeresource.py",
"copies": "1",
"size": "38723",
"license": "mit",
"hash": -2331050754080628700,
"line_mean": 32.8192139738,
"line_max": 84,
"alpha_frac": 0.5588409989,
"autogenerated": false,
"ratio": 4.602757636990372,
"con... |
import numpy as np
import copy
from .base import _set_cv
from ..io.pick import _pick_data_channels
from ..viz.decoding import plot_gat_matrix, plot_gat_times
from ..parallel import parallel_func, check_n_jobs
from ..utils import warn, check_version, deprecated
class _DecodingTime(dict):
"""Dictionary to configu... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/decoding/time_gen.py",
"copies": "1",
"size": "65704",
"license": "bsd-3-clause",
"hash": 5716041858651801000,
"line_mean": 40.7698664971,
"line_max": 117,
"alpha_frac": 0.5677736515,
"autogenerated": false,
"ratio": 4.236234687298517,
"config_t... |
import numpy as np
import copy
from ..io.pick import pick_types
from ..viz.decoding import plot_gat_matrix, plot_gat_times
from ..parallel import parallel_func, check_n_jobs
class _DecodingTime(dict):
"""A dictionary to configure the training times that has the following keys:
'slices' : ndarray, shape (n_... | {
"repo_name": "trachelr/mne-python",
"path": "mne/decoding/time_gen.py",
"copies": "2",
"size": "49656",
"license": "bsd-3-clause",
"hash": -818002649892494000,
"line_mean": 38.8843373494,
"line_max": 113,
"alpha_frac": 0.5645440632,
"autogenerated": false,
"ratio": 4.265979381443299,
"config_t... |
"""Generates 10 random 3D coordinates, rotate and translate them, and show how
the displacement can be fitted and predicted with `ModelDisplacement`.
"""
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from ecoggui import ModelDisplacement
# Make a random flat grid. Note th... | {
"repo_name": "kingjr/ecoggui",
"path": "examples/model_displacement.py",
"copies": "1",
"size": "1689",
"license": "bsd-2-clause",
"hash": -1115479524550659200,
"line_mean": 28.6315789474,
"line_max": 78,
"alpha_frac": 0.648312611,
"autogenerated": false,
"ratio": 2.715434083601286,
"config_te... |
import semver
import logging
import os
import os.path
import platform
import argparse
import json
import jsonschema
import datetime
import re
import dateutil
import ssl
import dateutil.parser
import ast
from urllib import urlopen
from subprocess import Popen, PIPE
first_write = dict()
index_index = 0
#Dictionary to ... | {
"repo_name": "BD2KGenomics/dcc-storage-schemas",
"path": "metadata_indexer.py",
"copies": "1",
"size": "53653",
"license": "apache-2.0",
"hash": 6270652349861014000,
"line_mean": 53.3046558704,
"line_max": 267,
"alpha_frac": 0.5757739549,
"autogenerated": false,
"ratio": 4.047755563938137,
"co... |
from collections import OrderedDict
import csv
import os.path as op
import numpy as np
from functools import partial
import xml.etree.ElementTree as ElementTree
from .montage import make_dig_montage
from ..transforms import _sph_to_cart
from ..utils import warn, _pl
from . import __file__ as _CHANNELS_INIT_FILE
MON... | {
"repo_name": "pravsripad/mne-python",
"path": "mne/channels/_standard_montage_utils.py",
"copies": "3",
"size": "13779",
"license": "bsd-3-clause",
"hash": 3533691485984623000,
"line_mean": 35.549071618,
"line_max": 79,
"alpha_frac": 0.5898831555,
"autogenerated": false,
"ratio": 3.0633614939973... |
from collections import OrderedDict
import os.path as op
import numpy as np
from functools import partial
import xml.etree.ElementTree as ElementTree
from .montage import make_dig_montage
from ..transforms import _sph_to_cart
from ..utils import warn, _pl
from . import __file__ as _CHANNELS_INIT_FILE
MONTAGE_PATH = ... | {
"repo_name": "larsoner/mne-python",
"path": "mne/channels/_standard_montage_utils.py",
"copies": "6",
"size": "12460",
"license": "bsd-3-clause",
"hash": 7561789319883642000,
"line_mean": 36.0833333333,
"line_max": 79,
"alpha_frac": 0.5922150883,
"autogenerated": false,
"ratio": 3.01330108827085... |
########################
# MySQL Settings #
########################
# Change this to a user/schema with INSERT permissions and the correct fields.
# For simplicity sake, the same user is used for all the databases.
databaseSettings = dict(
# IP/Hostname of MySQL server
HOST='127.0.0.1', # 127.0.0.1
... | {
"repo_name": "J0bbie/AdverseEffectsPredictor",
"path": "writeData2DB/settings.py",
"copies": "1",
"size": "1176",
"license": "apache-2.0",
"hash": -6908566840626184000,
"line_mean": 33.5882352941,
"line_max": 110,
"alpha_frac": 0.6615646259,
"autogenerated": false,
"ratio": 3.389048991354467,
... |
# Import user specified settings
import writeData2DB.settings as s
# Import MySQL functions
import pymysql
############################
# dbConnection Class #
############################
class dbConnection:
def __init__(self):
self.connection
self.cursor
# On death of object, sti... | {
"repo_name": "J0bbie/AdverseEffectsPredictor",
"path": "writeData2DB/dbSetup.py",
"copies": "1",
"size": "4060",
"license": "apache-2.0",
"hash": 7103431402349938000,
"line_mean": 40.0202020202,
"line_max": 192,
"alpha_frac": 0.6066502463,
"autogenerated": false,
"ratio": 4.337606837606837,
"c... |
__authors__ = ['Joel Wright', 'Andrew Taylor']
import logging
import pygame
import pygame.time
import random
from pygame.locals import *
from DDRPi import FloorCanvas
from GamePlugin import GamePlugin
class TetrisGamePlugin(GamePlugin):
# Static maps to define the shape and rotation of tetrominos
__tetromin... | {
"repo_name": "fraz3alpha/DDRPi",
"path": "software/controller/game_plugins/tetris.py",
"copies": "2",
"size": "30327",
"license": "mit",
"hash": 7371439070877727000,
"line_mean": 39.5441176471,
"line_max": 117,
"alpha_frac": 0.51241468,
"autogenerated": false,
"ratio": 3.4798623063683305,
"con... |
__authors__ = ['Joel Wright','Mark McArdle','Andrew Taylor']
import importlib
import os
import logging
import pygame
import sys
import yaml
import signal
from lib.comms import ComboComms
from lib.layout import DisplayLayout
from lib.utils import ColourUtils
from lib.plugins_base import DDRPiPlugin, PluginRegistry
from... | {
"repo_name": "joel-wright/DDRPi",
"path": "DDRPi.py",
"copies": "1",
"size": "12800",
"license": "mit",
"hash": -784667964667944800,
"line_mean": 30.6831683168,
"line_max": 120,
"alpha_frac": 0.66671875,
"autogenerated": false,
"ratio": 3.15893385982231,
"config_test": true,
"has_no_keywords... |
__authors__ = ['Joel Wright']
import io
import os
import pygame
import sys
import time
import yaml
import signal
lib_path = os.path.abspath('lib')
sys.path.append(lib_path)
from layout import DisplayLayout
config_file = "config.yaml"
class FloorSimulator(object):
def __init__(self, config_file):
f = o... | {
"repo_name": "fraz3alpha/DDRPi",
"path": "software/controller/FloorSimulator.py",
"copies": "2",
"size": "3461",
"license": "mit",
"hash": -3820865573047586300,
"line_mean": 27.8416666667,
"line_max": 78,
"alpha_frac": 0.5287489165,
"autogenerated": false,
"ratio": 3.8285398230088497,
"config_... |
__authors__ = ['Joel Wright']
import logging
import pygame
import pygame.time
import random
from DDRPi import DDRPiPlugin
from pygame.locals import *
class PongPlugin(DDRPiPlugin):
# Static map from joypad to player name
__player__ = {
0: 'player1',
1: 'player2'
}
__numbers__ = {
0: lambda (x,y): [(x,y),(... | {
"repo_name": "joel-wright/DDRPi",
"path": "plugins/pong.py",
"copies": "1",
"size": "15592",
"license": "mit",
"hash": 4827851382131166000,
"line_mean": 31.756302521,
"line_max": 135,
"alpha_frac": 0.6266675218,
"autogenerated": false,
"ratio": 2.5418976198239323,
"config_test": false,
"has_... |
__authors__ = ['Joel Wright']
import logging
import pygame
import pygame.time
import random
from DDRPi import DDRPiPlugin
from pygame.locals import *
class TetrisPlugin(DDRPiPlugin):
# Static maps to define the shape and rotation of tetrominos
__tetrominos__ = {
'L': lambda o,x,y: TetrisPlugin.__L__[o](x,y),
... | {
"repo_name": "joel-wright/DDRPi",
"path": "plugins/tetris.py",
"copies": "1",
"size": "24330",
"license": "mit",
"hash": 4199435052654223000,
"line_mean": 32.1020408163,
"line_max": 117,
"alpha_frac": 0.6289765721,
"autogenerated": false,
"ratio": 2.6416938110749184,
"config_test": false,
"h... |
__authors__ = ['Joel Wright']
import logging
import pygame
"""
We need a way to abstract the controllers so that we can use lots of different
inputs. For example, a physical controller is just as good as keyboard input
"""
class ControllerInput(object):
logger = logging.getLogger(__name__)
BUTTON_NONE = 0... | {
"repo_name": "fraz3alpha/led-disco-dancefloor",
"path": "software/controller/lib/controllers.py",
"copies": "2",
"size": "5483",
"license": "mit",
"hash": -3337348544626968000,
"line_mean": 38.731884058,
"line_max": 119,
"alpha_frac": 0.6144446471,
"autogenerated": false,
"ratio": 3.374153846153... |
__authors__ = ['Joel Wright']
import random
import time
import pygame
from DDRPi import DDRPiPlugin
class SimplePlugin(DDRPiPlugin):
def configure(self, config, image_surface):
"""
This is an example of an end user module - need to make sure we can get
the main image surface and config to write to them both... | {
"repo_name": "joel-wright/DDRPi",
"path": "tests/plugins/simple_plugin.py",
"copies": "1",
"size": "1464",
"license": "mit",
"hash": 5240873396433751000,
"line_mean": 20.5294117647,
"line_max": 75,
"alpha_frac": 0.6714480874,
"autogenerated": false,
"ratio": 3.082105263157895,
"config_test": f... |
from micropython import const
from ustruct import unpack, unpack_from
from utime import sleep_ms
# BME280 default address
BME280_I2C_ADDR_PRIM = const(0x76)
BME280_I2C_ADDR_SEC = const(0x77)
# Sensor Power Mode Options
BME280_SLEEP_MODE = const(0x00)
BME280_FOR... | {
"repo_name": "abruno06/IoT",
"path": "ESP8266/bme280_i2c.py",
"copies": "1",
"size": "21585",
"license": "apache-2.0",
"hash": -6131068342621584000,
"line_mean": 37.5160714286,
"line_max": 125,
"alpha_frac": 0.5737864528,
"autogenerated": false,
"ratio": 3.1565930045368065,
"config_test": true... |
import os
import os.path as op
import shutil
import zipfile
from sys import stdout
import numpy as np
from ...channels import make_standard_montage
from ...epochs import EpochsArray
from ...io.meas_info import create_info
from ...utils import _fetch_file, _check_pandas_installed, verbose
from ..utils import _get_pat... | {
"repo_name": "wmvanvliet/mne-python",
"path": "mne/datasets/limo/limo.py",
"copies": "1",
"size": "8817",
"license": "bsd-3-clause",
"hash": 389447892106559040,
"line_mean": 35.5767634855,
"line_max": 91,
"alpha_frac": 0.622234827,
"autogenerated": false,
"ratio": 3.3619374523264685,
"config_t... |
import numpy as np
def _ecdf(x):
"""No frills empirical cdf used in fdrcorrection."""
nobs = len(x)
return np.arange(1, nobs + 1) / float(nobs)
def fdr_correction(pvals, alpha=0.05, method='indep'):
"""P-value correction with False Discovery Rate (FDR).
Correction for multiple comparison using... | {
"repo_name": "olafhauk/mne-python",
"path": "mne/stats/multi_comp.py",
"copies": "7",
"size": "3140",
"license": "bsd-3-clause",
"hash": -2454328598249897500,
"line_mean": 30.0891089109,
"line_max": 79,
"alpha_frac": 0.6468152866,
"autogenerated": false,
"ratio": 3.431693989071038,
"config_tes... |
import numpy as np
def _ecdf(x):
'''no frills empirical cdf used in fdrcorrection
'''
nobs = len(x)
return np.arange(1, nobs + 1) / float(nobs)
def fdr_correction(pvals, alpha=0.05, method='indep'):
"""P-value correction with False Discovery Rate (FDR)
Correction for multiple comparison us... | {
"repo_name": "effigies/mne-python",
"path": "mne/stats/multi_comp.py",
"copies": "3",
"size": "3026",
"license": "bsd-3-clause",
"hash": 1708602731474784500,
"line_mean": 28.6666666667,
"line_max": 79,
"alpha_frac": 0.6526768011,
"autogenerated": false,
"ratio": 3.454337899543379,
"config_test... |
import numpy as np
def _ecdf(x):
"""No frills empirical cdf used in fdrcorrection."""
nobs = len(x)
return np.arange(1, nobs + 1) / float(nobs)
def fdr_correction(pvals, alpha=0.05, method='indep'):
"""P-value correction with False Discovery Rate (FDR).
Correction for multiple comparison using... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/stats/multi_comp.py",
"copies": "10",
"size": "3033",
"license": "bsd-3-clause",
"hash": 1493878877110343700,
"line_mean": 29.0297029703,
"line_max": 79,
"alpha_frac": 0.6538081108,
"autogenerated": false,
"ratio": 3.4544419134396356,
"config_te... |
import os
import urllib2
number=1
nextLink="http://9gag.com/"
pageNumber=1
class Parser9GAG(object):
def FindLinks(self): #required for getting page source of base page that is then passed to FindLinks2
os.system("echo Start|cat>>log")
base_link="http://9gag.com/"
base_contents=urllib2.urlopen(base_link).rea... | {
"repo_name": "guillemhs/9gag-email-digest-sender",
"path": "Parser9GAG.py",
"copies": "1",
"size": "5039",
"license": "apache-2.0",
"hash": -833543825190212500,
"line_mean": 33.9930555556,
"line_max": 132,
"alpha_frac": 0.680095257,
"autogenerated": false,
"ratio": 2.8436794582392775,
"config_... |
import math
import numpy as np
from ..fixes import _get_logsumexp
def _compute_normalized_phase(data):
"""Compute normalized phase angles.
Parameters
----------
data : ndarray, shape (n_epochs, n_sources, n_times)
The data to compute the phase angles for.
Returns
-------
phase_an... | {
"repo_name": "adykstra/mne-python",
"path": "mne/preprocessing/ctps_.py",
"copies": "2",
"size": "5193",
"license": "bsd-3-clause",
"hash": -2802558054100323300,
"line_mean": 30.0958083832,
"line_max": 77,
"alpha_frac": 0.6146735991,
"autogenerated": false,
"ratio": 3.326713645099295,
"config_... |
import math
import numpy as np
def _compute_normalized_phase(data):
"""Compute normalized phase angles.
Parameters
----------
data : ndarray, shape (n_epochs, n_sources, n_times)
The data to compute the phase angles for.
Returns
-------
phase_angles : ndarray, shape (n_epochs, n_... | {
"repo_name": "drammock/mne-python",
"path": "mne/preprocessing/ctps_.py",
"copies": "14",
"size": "5133",
"license": "bsd-3-clause",
"hash": -8136107975908135000,
"line_mean": 29.921686747,
"line_max": 77,
"alpha_frac": 0.6134813949,
"autogenerated": false,
"ratio": 3.3309539260220635,
"config... |
import math
import numpy as np
from scipy.signal import hilbert
def _compute_normalized_phase(data):
"""Compute normalized phase angles
Parameters
----------
data : ndarray, shape (n_epochs, n_sources, n_times)
The data to compute the phase angles for.
Returns
-------
phase_angl... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/preprocessing/ctps_.py",
"copies": "4",
"size": "5195",
"license": "bsd-2-clause",
"hash": -6092715019067572000,
"line_mean": 29.7396449704,
"line_max": 77,
"alpha_frac": 0.610587103,
"autogenerated": false,
"ratio": 3.2900569981000634,
"config_test"... |
import math
import numpy as np
def _compute_normalized_phase(data):
"""Compute normalized phase angles
Parameters
----------
data : ndarray, shape (n_epochs, n_sources, n_times)
The data to compute the phase angles for.
Returns
-------
phase_angles : ndarray, shape (n_epochs, n_... | {
"repo_name": "dgwakeman/mne-python",
"path": "mne/preprocessing/ctps_.py",
"copies": "24",
"size": "5199",
"license": "bsd-3-clause",
"hash": 346358685472955200,
"line_mean": 29.7633136095,
"line_max": 77,
"alpha_frac": 0.6101173303,
"autogenerated": false,
"ratio": 3.2925902469917667,
"config... |
import math
import numpy as np
def _compute_normalized_phase(data):
"""Compute normalized phase angles.
Parameters
----------
data : ndarray, shape (n_epochs, n_sources, n_times)
The data to compute the phase angles for.
Returns
-------
phase_angles : ndarray, shape (n_epochs, n... | {
"repo_name": "nicproulx/mne-python",
"path": "mne/preprocessing/ctps_.py",
"copies": "4",
"size": "5214",
"license": "bsd-3-clause",
"hash": 7745616910350440000,
"line_mean": 29.8520710059,
"line_max": 77,
"alpha_frac": 0.6098964327,
"autogenerated": false,
"ratio": 3.2854442344045367,
"config... |
__author__ = 'skaper'
# -*- coding: utf-8 -*-
from PyQt4 import QtGui, QtCore
import os
version = 1.0
class Data(QtCore.QThread):
#arrayImg = QtCore.pyqtSignal(QtCore.QImage)#np.ndarray)
def __init__(self, sock):
QtCore.QThread.__init__(self)
self.sock = sock
def __del__(self):
sel... | {
"repo_name": "Skaper/RMCStudio",
"path": "module/eye.py",
"copies": "1",
"size": "2349",
"license": "apache-2.0",
"hash": -8139587640546313000,
"line_mean": 29.9078947368,
"line_max": 133,
"alpha_frac": 0.527884206,
"autogenerated": false,
"ratio": 4.121052631578947,
"config_test": false,
"h... |
class Cell:
def __init__(self, node1, node2, node3, node4, node5, \
node6, node7, node8, i, j, k):
self.NearLeftBottom = node1
self.NearRightBottom = node2
self.FarLeftBottom = node3
self.FarRightBottom = node4
self.NearLeftTop = node5
self.NearRightT... | {
"repo_name": "evanl/vesa_tough_comparison",
"path": "vesa/vesa_v02_13/eclipse_cells.py",
"copies": "4",
"size": "4765",
"license": "mit",
"hash": -5025943140538751000,
"line_mean": 34.8270676692,
"line_max": 76,
"alpha_frac": 0.5716684155,
"autogenerated": false,
"ratio": 3.145214521452145,
"c... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import eclipse_cells as ec
def read_eclipse():
print "reading Eclipse Files for Sleipner"
# Sets up the list of cell objects.
inp = open('M9X1.grdecl', 'r')
newline = inp.readline()
while newline != 'SPECGRID\n':
... | {
"repo_name": "evanl/comparison_scripts",
"path": "read_eclipse.py",
"copies": "4",
"size": "5945",
"license": "mit",
"hash": 1958968603641514800,
"line_mean": 27.7198067633,
"line_max": 82,
"alpha_frac": 0.5172413793,
"autogenerated": false,
"ratio": 3.669753086419753,
"config_test": false,
... |
__author__ = 'skar.Wei'
import serial
import threading
import struct
import time
import os
IDLE = 0
READ = 1
WRITE = 2
READ_ADDR = 3
WRITE_ADDR = 4
READ_DATA = 5
WRITE_DATA = 6
BLOCKSIZE = 512
f = open('../../../PentiumX/Software/VirtualDisk.vhd', 'rb+')
# Diskdata = f.read()
class Disk(threading.Thread):
def... | {
"repo_name": "everskar2013/PentiumX",
"path": "Software/sourceCode_on_Board/vDisk.py",
"copies": "1",
"size": "3289",
"license": "mit",
"hash": -8416916489586894000,
"line_mean": 26.6386554622,
"line_max": 86,
"alpha_frac": 0.4353906963,
"autogenerated": false,
"ratio": 4.168567807351077,
"con... |
__author__ = 'skippylovesmalorie, Gareth'
# Found: http://skippylovesmalorie.wordpress.com/2010/02/12
# /how-to-generate-a-self-signed-certificate-using-pyopenssl/
from OpenSSL import crypto
from socket import gethostname
from os.path import join
CERT_FILE = "ssl.crt"
KEY_FILE = "ssl.key"
def create_... | {
"repo_name": "UltrosBot/Ultros-repos",
"path": "control/system/ssl.py",
"copies": "1",
"size": "1282",
"license": "artistic-2.0",
"hash": -1561267139386511000,
"line_mean": 32.7368421053,
"line_max": 75,
"alpha_frac": 0.6622464899,
"autogenerated": false,
"ratio": 2.9813953488372094,
"config_t... |
__author__ = 'skird'
from os import path
import readline
from hb_res.explanation_source import sources_registry
SEPARATOR = '\t'
DIR_PATH = path.dirname(path.abspath(__file__))
SELECTED_FILE = 'Selected.asset'
GOOD_WORDS_FILE = 'goodwords.dat'
ALL_SOURCES = sources_registry.sources_registered()
def explain_list(w... | {
"repo_name": "hatbot-team/hatbot_resources",
"path": "preparation/selection/select_explanations.py",
"copies": "1",
"size": "2009",
"license": "mit",
"hash": -9052449340161382000,
"line_mean": 29.2769230769,
"line_max": 79,
"alpha_frac": 0.5802845528,
"autogenerated": false,
"ratio": 3.324324324... |
__author__ = 'skuli'
from twython import Twython, TwythonError
from check_spelling import spell_checker
import logging
from users import put_users_in_table, sort_users
from authentication import auth
from statuses import statuses
# set up logging to file - see previous section for more details
logging.basicConfig(leve... | {
"repo_name": "skulifh/betterbet",
"path": "better/__init__.py",
"copies": "1",
"size": "1371",
"license": "apache-2.0",
"hash": -3528060668662156300,
"line_mean": 27,
"line_max": 81,
"alpha_frac": 0.7140773158,
"autogenerated": false,
"ratio": 3.675603217158177,
"config_test": false,
"has_no... |
import numpy as np
def kernel(zr, zi, cr, ci, lim, cutoff):
''' Computes the number of iterations `n` such that
|z_n| > `lim`, where `z_n = z_{n-1}**2 + c`.
'''
count = 0
while ((zr*zr + zi*zi) < (lim*lim)) and count < cutoff:
zr, zi = zr * zr - zi * zi + cr, 2 * zr * zi + ci
... | {
"repo_name": "numfocus/python-benchmarks",
"path": "julia/julia_python.py",
"copies": "1",
"size": "1684",
"license": "mit",
"hash": 8919316856078698000,
"line_mean": 31.3846153846,
"line_max": 76,
"alpha_frac": 0.5771971496,
"autogenerated": false,
"ratio": 2.7880794701986753,
"config_test": ... |
from __future__ import print_function
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
try:
import Queue
except ImportError:
import queue as Queue
try:
import urllib.request as urllib # for backwards compatibility
except ImportError:
import urllib2 as urllib
try:
... | {
"repo_name": "kastnerkyle/dagbldr",
"path": "dagbldr/core/core.py",
"copies": "2",
"size": "75621",
"license": "bsd-3-clause",
"hash": -324882204346505860,
"line_mean": 38.2225103734,
"line_max": 127,
"alpha_frac": 0.5724071356,
"autogenerated": false,
"ratio": 3.871844759612923,
"config_test"... |
import theano.tensor as T
import numpy as np
import theano
class rmsprop(object):
"""
RMSProp with nesterov momentum and gradient rescaling
"""
def __init__(self, params):
self.running_square_ = [theano.shared(np.zeros_like(p.get_value()))
for p in params]
... | {
"repo_name": "kastnerkyle/minet",
"path": "minet/optimizers.py",
"copies": "2",
"size": "2966",
"license": "bsd-3-clause",
"hash": 4317119683577313000,
"line_mean": 38.0263157895,
"line_max": 75,
"alpha_frac": 0.5529332434,
"autogenerated": false,
"ratio": 3.7735368956743,
"config_test": false... |
import re as re
import numpy as np
from ..base import BaseRaw
from ..meas_info import create_info
from ..utils import _mult_cal_one
from ...utils import logger, verbose, fill_doc, _check_fname
from ...annotations import Annotations
@fill_doc
def read_raw_boxy(fname, preload=False, verbose=None):
"""Reader for ... | {
"repo_name": "rkmaddox/mne-python",
"path": "mne/io/boxy/boxy.py",
"copies": "7",
"size": "11044",
"license": "bsd-3-clause",
"hash": 483299436115243900,
"line_mean": 40.9923954373,
"line_max": 79,
"alpha_frac": 0.4918507787,
"autogenerated": false,
"ratio": 3.9826902271907683,
"config_test": ... |
import re as re
import numpy as np
from ..base import BaseRaw
from ..meas_info import create_info
from ..utils import _mult_cal_one
from ...utils import logger, verbose, fill_doc
from ...annotations import Annotations
@fill_doc
def read_raw_boxy(fname, preload=False, verbose=None):
"""Reader for an optical ima... | {
"repo_name": "olafhauk/mne-python",
"path": "mne/io/boxy/boxy.py",
"copies": "4",
"size": "10971",
"license": "bsd-3-clause",
"hash": -3619653233909534700,
"line_mean": 40.8740458015,
"line_max": 79,
"alpha_frac": 0.4912040835,
"autogenerated": false,
"ratio": 3.9894545454545454,
"config_test"... |
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from sklearn.utils.testing import (assert_equal, assert_in,
assert_false, assert_true)
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_sele... | {
"repo_name": "vigilv/scikit-learn",
"path": "sklearn/feature_extraction/tests/test_dict_vectorizer.py",
"copies": "276",
"size": "3790",
"license": "bsd-3-clause",
"hash": -8568621151681017000,
"line_mean": 32.5398230088,
"line_max": 79,
"alpha_frac": 0.534828496,
"autogenerated": false,
"ratio"... |
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_selection import SelectKBest, chi2
from sklearn.utils.testing import (assert_equal, assert_in,
... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/sklearn/feature_extraction/tests/test_dict_vectorizer.py",
"copies": "1",
"size": "3789",
"license": "mit",
"hash": 6110928881496761000,
"line_mean": 32.8303571429,
"line_max": 79,
"alpha_frac": 0.534969649,
"autogene... |
from array import array
from collections.abc import Mapping, Iterable
from operator import itemgetter
from numbers import Number
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..utils import check_array, tosequence
from ..utils.validation import _deprecate_positi... | {
"repo_name": "ndingwall/scikit-learn",
"path": "sklearn/feature_extraction/_dict_vectorizer.py",
"copies": "8",
"size": "15210",
"license": "bsd-3-clause",
"hash": -2552885043418471000,
"line_mean": 34.7042253521,
"line_max": 79,
"alpha_frac": 0.5506903353,
"autogenerated": false,
"ratio": 4.509... |
from array import array
from collections.abc import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..utils import check_array, tosequence
from ..utils.validation import _deprecate_positional_args
def _tosequence(X):
"... | {
"repo_name": "bnaul/scikit-learn",
"path": "sklearn/feature_extraction/_dict_vectorizer.py",
"copies": "2",
"size": "12363",
"license": "bsd-3-clause",
"hash": 1230436746799658500,
"line_mean": 32.9642857143,
"line_max": 79,
"alpha_frac": 0.5623230607,
"autogenerated": false,
"ratio": 4.35470235... |
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..externals.six.moves import xrange
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..utils import check_array, tosequence
from ..utils.fixes i... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/sklearn/feature_extraction/dict_vectorizer.py",
"copies": "1",
"size": "12559",
"license": "mit",
"hash": -5431071844071422000,
"line_mean": 33.3142076503,
"line_max": 85,
"alpha_frac": 0.5646946413,
"autogenerated": ... |
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..externals.six.moves import xrange
from ..utils import check_array, tosequence
from ..utils.fixes i... | {
"repo_name": "uglyboxer/linear_neuron",
"path": "net-p3/lib/python3.5/site-packages/sklearn/feature_extraction/dict_vectorizer.py",
"copies": "5",
"size": "11439",
"license": "mit",
"hash": -725385563295046500,
"line_mean": 32.943620178,
"line_max": 85,
"alpha_frac": 0.5623743334,
"autogenerated":... |
from array import array
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..externals.six.moves import xrange
from ..utils import check_array, tosequence
from ..utils.fixes import _Mapping as Mapping
def ... | {
"repo_name": "vortex-ape/scikit-learn",
"path": "sklearn/feature_extraction/dict_vectorizer.py",
"copies": "8",
"size": "12539",
"license": "bsd-3-clause",
"hash": 5377485553601593000,
"line_mean": 33.3534246575,
"line_max": 85,
"alpha_frac": 0.5650370843,
"autogenerated": false,
"ratio": 4.3583... |
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
import pytest
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_selection import SelectKBest, chi2
@pytest.mark.parametrize('sparse', (True, False))
@pytest.mark.parametrize(... | {
"repo_name": "ndingwall/scikit-learn",
"path": "sklearn/feature_extraction/tests/test_dict_vectorizer.py",
"copies": "9",
"size": "5243",
"license": "bsd-3-clause",
"hash": 4899407287039330000,
"line_mean": 30.3952095808,
"line_max": 77,
"alpha_frac": 0.5575052451,
"autogenerated": false,
"ratio... |
__authors__ = ["Laurent Dinh", "Vincent Dumoulin"]
import numpy as np
import theano
import theano.tensor as T
from pylearn2.utils import serial
from theano.compat.python2x import OrderedDict
import matplotlib
matplotlib.use('Agg')
from matplotlib import animation
import matplotlib.pyplot as plt
from pylearn2.utils imp... | {
"repo_name": "laurent-dinh/nice",
"path": "pylearn2/scripts/reconstruct_tfd_gif.py",
"copies": "1",
"size": "4316",
"license": "bsd-3-clause",
"hash": -8718822510394200000,
"line_mean": 31.4511278195,
"line_max": 95,
"alpha_frac": 0.6475903614,
"autogenerated": false,
"ratio": 2.8869565217391306... |
__author__ = 'sleibman'
from PIL import Image
import os
class LargeImage(object):
def __init__(self):
self._full_image = None
@classmethod
def import_file(cls, filename):
"""
Takes a filename (png or jpg), reads in the image, and creates a LargeImage object.
"""
l... | {
"repo_name": "sleibman/python-colossus",
"path": "colossus/api/image.py",
"copies": "1",
"size": "3697",
"license": "mit",
"hash": 4479825006535729000,
"line_mean": 35.2549019608,
"line_max": 120,
"alpha_frac": 0.5647822559,
"autogenerated": false,
"ratio": 3.7343434343434345,
"config_test": f... |
__author__ = 'slevy_local'
import sys
import numpy
import nibabel
path_sct = os.environ.get("SCT_DIR", os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
# append path that contains scripts, to be able to load modules
sys.path.append(os.path.join(path_sct, "scripts"))
import sct_extract_m... | {
"repo_name": "neuropoly/spinalcordtoolbox",
"path": "dev/atlas/validate_atlas/compute_fractional_volume_per_label.py",
"copies": "1",
"size": "1093",
"license": "mit",
"hash": 2932224231145581000,
"line_mean": 25.6585365854,
"line_max": 123,
"alpha_frac": 0.703568161,
"autogenerated": false,
"ra... |
__author__ = 'slevy_local'
import sys
path_sct = '/Users/slevy_local/spinalcordtoolbox' #'C:/cygwin64/home/Simon_2/spinalcordtoolbox'
# Append path that contains scripts, to be able to load modules
sys.path.append(path_sct + '/scripts')
import sct_extract_metric
import numpy
import nibabel
def compute_fract_vol_per_l... | {
"repo_name": "3324fr/spinalcordtoolbox",
"path": "dev/atlas/validate_atlas/compute_fractional_volume_per_label.py",
"copies": "1",
"size": "1046",
"license": "mit",
"hash": -2665962566433722000,
"line_mean": 26.5263157895,
"line_max": 110,
"alpha_frac": 0.7103250478,
"autogenerated": false,
"rat... |
__author__ = 'slic'
from autobahn.twisted.websocket import WebSocketClientProtocol, \
WebSocketClientFactory
class WebSocketEchoProtocol(WebSocketClientProtocol):
def onConnect(self, response):
print("Server connected: {0}".format(response.peer))
def onOpen(self):
print("WebSocket conne... | {
"repo_name": "sanketn26/Slic",
"path": "client/async/loadtest/EchoClient.py",
"copies": "1",
"size": "1275",
"license": "apache-2.0",
"hash": 1687176757424168400,
"line_mean": 26.7173913043,
"line_max": 81,
"alpha_frac": 0.6478431373,
"autogenerated": false,
"ratio": 4.207920792079208,
"config... |
authors_link = 'http://ieeexplore.ieee.org/xpl/abstractAuthors.jsp?arnumber='
all_papers = []
import urllib2
from bs4 import BeautifulSoup
def get_authors(id):
link = authors_link + str(id)
print "[INFO] Fetching authors from link " + str(link)
authors = []
try:
page = urllib2.urlopen(link... | {
"repo_name": "sujithvm/internationality-journals",
"path": "src/scrap.py",
"copies": "3",
"size": "1645",
"license": "mit",
"hash": 7510776221190011000,
"line_mean": 21.2297297297,
"line_max": 81,
"alpha_frac": 0.5726443769,
"autogenerated": false,
"ratio": 3.2768924302788847,
"config_test": f... |
__author__ = '@Slober3'
__version__ = '0.1'
'''
Hello Welcome to this simple low interactinghoneypot
This honepot will only log
And will not interact with the hacker at this point in time!
'''
import sys
sys.path.append('../')
import argparse
import socket
from modules.PotHeadMain import CrlogDir,prPhaseOne,prStanda... | {
"repo_name": "Slober3/PotHead",
"path": "PotHead.py",
"copies": "1",
"size": "3372",
"license": "mit",
"hash": 8681635235720369000,
"line_mean": 33.7628865979,
"line_max": 141,
"alpha_frac": 0.6826809015,
"autogenerated": false,
"ratio": 3.335311572700297,
"config_test": false,
"has_no_keywo... |
__author__ = 'SL_RU'
# -*- coding: utf-8 -*-
#Проигрыватель музыкальных файлов
import vlc
#import time
#import sys
from queue import Queue
def log(msg):
#print(msg)
pass
class Aplayer(object):
def __init__(self, output_device):
"""Initializing Aplayer.
output_device can be:
... | {
"repo_name": "SL-RU/RaspiBluePlayer",
"path": "aplayer.py",
"copies": "1",
"size": "3966",
"license": "mit",
"hash": 52813002124373200,
"line_mean": 28.5939849624,
"line_max": 108,
"alpha_frac": 0.5553861789,
"autogenerated": false,
"ratio": 3.464788732394366,
"config_test": false,
"has_no_k... |
__author__ = 'sl_ru'
import os, time
localDir = os.path.dirname(__file__)
absDir = os.path.join(os.getcwd(), localDir)
import cherrypy, json
from mako.template import Template
from mako.lookup import TemplateLookup
lookup = TemplateLookup(directories=['html'])
class MusicPlayerWeb(object):
def __init__(self, mu... | {
"repo_name": "SL-RU/RaspiBluePlayer",
"path": "web.py",
"copies": "1",
"size": "3440",
"license": "mit",
"hash": 7803808649002981000,
"line_mean": 29.7142857143,
"line_max": 82,
"alpha_frac": 0.6183139535,
"autogenerated": false,
"ratio": 3.671291355389541,
"config_test": false,
"has_no_keyw... |
__author__ = 'SL_RU'
import RPi.GPIO as GPIO
import time
from threading import Thread
##Взаимодействие с gpio, блютус и прочим хардваре
IS_GPIO = True
def Init():
global thread
if(IS_GPIO):
GPIO.setmode(GPIO.BOARD)
thread = Thread(target=Update)
thread.setDaemon(True)
thread.start()
def E... | {
"repo_name": "SL-RU/RaspiBluePlayer",
"path": "hardware.py",
"copies": "2",
"size": "2799",
"license": "mit",
"hash": -5162088287408660000,
"line_mean": 24.3486238532,
"line_max": 69,
"alpha_frac": 0.5124864278,
"autogenerated": false,
"ratio": 3.5697674418604652,
"config_test": false,
"has_... |
__author__ = 'SL_RU'
### Логика музыкального плеера
import os
import aplayer
import random
import json
import aplayer
import musicplaylist
import audiobook
import time
def log(s):
print("BOOKS_PLAYER:" + s)
class BooksPlayer(object):
aplayer = None
books = list()
cur_book = None
path = ""
c... | {
"repo_name": "SL-RU/RaspiBluePlayer",
"path": "booksplayer.py",
"copies": "1",
"size": "3337",
"license": "mit",
"hash": 639894184059665800,
"line_mean": 25.504,
"line_max": 130,
"alpha_frac": 0.5550860248,
"autogenerated": false,
"ratio": 3.336354481369587,
"config_test": false,
"has_no_key... |
__author__ = 'SL_RU'
### Логика музыкального плеера
import os
import aplayer
import random
import json
import aplayer
import musicplaylist
def log(s):
try:
print("MUSIC_PLAYER:" + s)
except:
pass
class MusicPlayer(object):
aplayer = None
songs = list()
cur_song = ""
path = ""... | {
"repo_name": "SL-RU/RaspiBluePlayer",
"path": "musicplayer.py",
"copies": "1",
"size": "4033",
"license": "mit",
"hash": -7743417608075363000,
"line_mean": 26.4657534247,
"line_max": 104,
"alpha_frac": 0.5410326765,
"autogenerated": false,
"ratio": 3.4090136054421767,
"config_test": false,
"... |
import numpy
try:
import jpype
except:
print "Please install jpype if you want to read microscopy formats images like LIF."
import os
def reader(fileName=None):
""" Function to read LIF (Leica Image Format) files. The function expects a filenames a returns a list of 5D data objects
on item for e... | {
"repo_name": "ilastik/ilastik-0.5",
"path": "ilastik/core/LOCIwrapper.py",
"copies": "1",
"size": "3984",
"license": "bsd-2-clause",
"hash": -5913108959696560000,
"line_mean": 30.3700787402,
"line_max": 132,
"alpha_frac": 0.5569779116,
"autogenerated": false,
"ratio": 3.4022203245089666,
"conf... |
import math
import logging
import numpy as np
logger = logging.getLogger('mne') # one selection here used across mne-python
logger.propagate = False # don't propagate (in case of multiple imports)
def random_permutation(n_samples, random_state=None):
"""Helper to emulate the randperm matlab function.
It r... | {
"repo_name": "PhilippeTillet/DSHF-ICA",
"path": "python/examples/infomax_.py",
"copies": "2",
"size": "14364",
"license": "mit",
"hash": -9035385017390951000,
"line_mean": 37.7169811321,
"line_max": 101,
"alpha_frac": 0.5634920635,
"autogenerated": false,
"ratio": 4.026913372582002,
"config_te... |
import math
import numpy as np
from scipy.stats import kurtosis
from ..utils import check_random_state
# this class replaces mne.utils.logger
class logger(object):
@staticmethod
def info(*args, **kwargs):
pass
def infomax(data, weights=None, l_rate=None, block=None, w_change=1e-12,
an... | {
"repo_name": "scot-dev/scot",
"path": "scot/external/infomax_.py",
"copies": "4",
"size": "10119",
"license": "mit",
"hash": 1322662499783477000,
"line_mean": 35.0106761566,
"line_max": 79,
"alpha_frac": 0.5263365945,
"autogenerated": false,
"ratio": 3.9651253918495297,
"config_test": false,
... |
import math
import numpy as np
from scipy.stats import kurtosis
from ..utils import logger, verbose, check_random_state
@verbose
def infomax(data, weights=None, l_rate=None, block=None, w_change=1e-12,
anneal_deg=60., anneal_step=0.9, extended=False, n_subgauss=1,
kurt_size=6000, ext_blocks... | {
"repo_name": "effigies/mne-python",
"path": "mne/preprocessing/infomax_.py",
"copies": "4",
"size": "10096",
"license": "bsd-3-clause",
"hash": 345484037281272900,
"line_mean": 35.5797101449,
"line_max": 79,
"alpha_frac": 0.5263470681,
"autogenerated": false,
"ratio": 3.9654359780047135,
"conf... |
import math
import numpy as np
from ..utils import logger, verbose, check_random_state
@verbose
def infomax(data, weights=None, l_rate=None, block=None, w_change=1e-12,
anneal_deg=60., anneal_step=0.9, extended=False, n_subgauss=1,
kurt_size=6000, ext_blocks=1, max_iter=200,
ran... | {
"repo_name": "matthew-tucker/mne-python",
"path": "mne/preprocessing/infomax_.py",
"copies": "5",
"size": "10024",
"license": "bsd-3-clause",
"hash": -710323877874445400,
"line_mean": 35.4509090909,
"line_max": 79,
"alpha_frac": 0.5252394254,
"autogenerated": false,
"ratio": 3.9651898734177213,
... |
import math
import numpy as np
from ..utils import logger, verbose, check_random_state, random_permutation
@verbose
def infomax(data, weights=None, l_rate=None, block=None, w_change=1e-12,
anneal_deg=60., anneal_step=0.9, extended=False, n_subgauss=1,
kurt_size=6000, ext_blocks=1, max_iter=... | {
"repo_name": "andyh616/mne-python",
"path": "mne/preprocessing/infomax_.py",
"copies": "8",
"size": "11623",
"license": "bsd-3-clause",
"hash": 2299618760671340300,
"line_mean": 35.8984126984,
"line_max": 79,
"alpha_frac": 0.5364363762,
"autogenerated": false,
"ratio": 4.088287020752726,
"conf... |
'''
Created on 31.03.2015
@author: lbreuer
'''
#######################################################
# #
# import necessary modules #
# #
##############################################... | {
"repo_name": "fboers/jumeg",
"path": "jumeg/decompose/complex_ica.py",
"copies": "3",
"size": "15245",
"license": "bsd-3-clause",
"hash": -1429094034013640400,
"line_mean": 34.1267281106,
"line_max": 109,
"alpha_frac": 0.51597245,
"autogenerated": false,
"ratio": 3.825595984943538,
"config_tes... |
"""
----------------------------------------------------------------------
--- jumeg.decompose.fourier_ica --------------------------------------
----------------------------------------------------------------------
author : Lukas Breuer
email : l.breuer@fz-juelich.de
last update: 09.11.2016
version :... | {
"repo_name": "fboers/jumeg",
"path": "jumeg/decompose/icasso.py",
"copies": "1",
"size": "70510",
"license": "bsd-3-clause",
"hash": -1208401368544258300,
"line_mean": 39.4300458716,
"line_max": 113,
"alpha_frac": 0.4549425613,
"autogenerated": false,
"ratio": 4.39205182509032,
"config_test": ... |
"""
----------------------------------------------------------------------
--- jumeg.decompose.fourier_ica_plot ---------------------------------
----------------------------------------------------------------------
autor : Lukas Breuer
email : l.breuer@fz-juelich.de
last update: 17.11.2016
version :... | {
"repo_name": "fboers/jumeg",
"path": "jumeg/decompose/fourier_ica_plot.py",
"copies": "3",
"size": "71131",
"license": "bsd-3-clause",
"hash": -6470671933289256000,
"line_mean": 38.6272980501,
"line_max": 132,
"alpha_frac": 0.4870590882,
"autogenerated": false,
"ratio": 4.288099831203279,
"con... |
"""
----------------------------------------------------------------------
--- jumeg.decompose.group_ica.py -------------------------------------
----------------------------------------------------------------------
author : Lukas Breuer
email : l.breuer@fz-juelich.de
last update: 09.11.2016
version :... | {
"repo_name": "fboers/jumeg",
"path": "jumeg/decompose/group_ica.py",
"copies": "3",
"size": "31205",
"license": "bsd-3-clause",
"hash": 9049738425273756000,
"line_mean": 40.7179144385,
"line_max": 107,
"alpha_frac": 0.4861400417,
"autogenerated": false,
"ratio": 4.526399767914128,
"config_test... |
"""
----------------------------------------------------------------------
--- jumeg.decompose.ocarta -------------------------------------------
----------------------------------------------------------------------
author : Lukas Breuer
email : l.breuer@fz-juelich.de
last update: 14.06.2016
version :... | {
"repo_name": "fboers/jumeg",
"path": "jumeg/decompose/ocarta.py",
"copies": "3",
"size": "78394",
"license": "bsd-3-clause",
"hash": 685737506680050300,
"line_mean": 41.3293736501,
"line_max": 141,
"alpha_frac": 0.4911727938,
"autogenerated": false,
"ratio": 3.690518783542039,
"config_test": f... |
'''
Created on 27.11.2015
@author: lbreuer
'''
#######################################################
# #
# import necessary modules #
# #
###################################... | {
"repo_name": "fboers/jumeg",
"path": "jumeg/decompose/ica.py",
"copies": "1",
"size": "24050",
"license": "bsd-3-clause",
"hash": -1116675005386381200,
"line_mean": 36.0537974684,
"line_max": 102,
"alpha_frac": 0.4849480249,
"autogenerated": false,
"ratio": 4.5029020782624976,
"config_test": f... |
import os.path as op
import numpy as np
from ..utils import (_read_segments_file, _find_channels,
_synthesize_stim_channel)
from ..constants import FIFF, Bunch
from ..meas_info import _empty_info, create_info
from ..base import BaseRaw, _check_update_montage
from ...utils import logger, verbose,... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/io/eeglab/eeglab.py",
"copies": "2",
"size": "34752",
"license": "bsd-3-clause",
"hash": 5573945719763336000,
"line_mean": 42.9898734177,
"line_max": 79,
"alpha_frac": 0.5993611878,
"autogenerated": false,
"ratio": 3.8378796245168414,
"config_... |
import os.path as op
import numpy as np
from ..utils import (_read_segments_file, _find_channels,
_synthesize_stim_channel)
from ..constants import FIFF
from ..meas_info import _empty_info, create_info
from ..base import _BaseRaw, _check_update_montage
from ...utils import logger, verbose, check... | {
"repo_name": "alexandrebarachant/mne-python",
"path": "mne/io/eeglab/eeglab.py",
"copies": "2",
"size": "25139",
"license": "bsd-3-clause",
"hash": -3688994077163905500,
"line_mean": 42.2685025818,
"line_max": 79,
"alpha_frac": 0.5888062373,
"autogenerated": false,
"ratio": 3.830996647363609,
... |
import os.path as op
import numpy as np
from ..utils import _read_segments_file, _find_channels
from ..constants import FIFF
from ..meas_info import create_info
from ..base import BaseRaw
from ...utils import logger, verbose, warn, fill_doc, Bunch, _check_fname
from ...channels import make_dig_montage
from ...epochs... | {
"repo_name": "rkmaddox/mne-python",
"path": "mne/io/eeglab/eeglab.py",
"copies": "6",
"size": "25091",
"license": "bsd-3-clause",
"hash": 5659720932784026000,
"line_mean": 38.763866878,
"line_max": 79,
"alpha_frac": 0.5906101789,
"autogenerated": false,
"ratio": 3.7232527081169313,
"config_tes... |
import os.path as op
import numpy as np
from ..utils import _read_segments_file, _find_channels
from ..constants import FIFF
from ..meas_info import _empty_info, create_info
from ..base import BaseRaw, _check_update_montage
from ...utils import logger, verbose, warn, fill_doc, Bunch
from ...channels.montage import M... | {
"repo_name": "adykstra/mne-python",
"path": "mne/io/eeglab/eeglab.py",
"copies": "1",
"size": "24800",
"license": "bsd-3-clause",
"hash": 2680037932614802000,
"line_mean": 40.2645590682,
"line_max": 79,
"alpha_frac": 0.5965322581,
"autogenerated": false,
"ratio": 3.8001838798651546,
"config_te... |
from functools import partial
import os.path as op
from ...utils import verbose
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc)
has_brainstorm_data = partial(has_dataset, name='brainstorm')
_description = u"""
URL: http://neuroimage.usc.edu/brainstorm/D... | {
"repo_name": "jniediek/mne-python",
"path": "mne/datasets/brainstorm/bst_raw.py",
"copies": "3",
"size": "2087",
"license": "bsd-3-clause",
"hash": -1833747460790570000,
"line_mean": 33.7833333333,
"line_max": 79,
"alpha_frac": 0.6367992333,
"autogenerated": false,
"ratio": 3.616984402079723,
... |
from functools import partial
from ...utils import verbose, get_config
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc_accept)
has_brainstorm_data = partial(has_dataset, name='brainstorm.bst_raw')
_description = u"""
URL: http://neuroimage.usc.edu/brains... | {
"repo_name": "kambysese/mne-python",
"path": "mne/datasets/brainstorm/bst_raw.py",
"copies": "12",
"size": "2366",
"license": "bsd-3-clause",
"hash": -2288852092964437200,
"line_mean": 33.7941176471,
"line_max": 79,
"alpha_frac": 0.6538461538,
"autogenerated": false,
"ratio": 3.5,
"config_test... |
from functools import partial
from ...utils import verbose, get_config
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc)
has_brainstorm_data = partial(has_dataset, name='brainstorm.bst_raw')
_description = u"""
URL: http://neuroimage.usc.edu/brainstorm/Da... | {
"repo_name": "cjayb/mne-python",
"path": "mne/datasets/brainstorm/bst_raw.py",
"copies": "2",
"size": "2379",
"license": "bsd-3-clause",
"hash": 2202182763743563000,
"line_mean": 33.9852941176,
"line_max": 79,
"alpha_frac": 0.6355611602,
"autogenerated": false,
"ratio": 3.5828313253012047,
"co... |
from functools import partial
from ...utils import verbose
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc_accept)
has_brainstorm_data = partial(has_dataset, name='brainstorm.bst_auditory')
_description = u"""
URL: http://neuroimage.usc.edu/brainstorm/D... | {
"repo_name": "larsoner/mne-python",
"path": "mne/datasets/brainstorm/bst_auditory.py",
"copies": "12",
"size": "1933",
"license": "bsd-3-clause",
"hash": -2785847851593611000,
"line_mean": 33.5178571429,
"line_max": 78,
"alpha_frac": 0.6642524573,
"autogenerated": false,
"ratio": 3.3793706293706... |
from functools import partial
from ...utils import verbose
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc)
has_brainstorm_data = partial(has_dataset, name='brainstorm.bst_auditory')
_description = u"""
URL: http://neuroimage.usc.edu/brainstorm/DatasetA... | {
"repo_name": "adykstra/mne-python",
"path": "mne/datasets/brainstorm/bst_auditory.py",
"copies": "5",
"size": "1946",
"license": "bsd-3-clause",
"hash": 3651575288975567000,
"line_mean": 33.75,
"line_max": 78,
"alpha_frac": 0.6418293936,
"autogenerated": false,
"ratio": 3.475,
"config_test": f... |
import os.path as op
from ...utils import verbose
from ...fixes import partial
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc)
has_brainstorm_data = partial(has_dataset, name='brainstorm')
_description = u"""
URL: http://neuroimage.usc.edu/brainstorm/Dat... | {
"repo_name": "rajul/mne-python",
"path": "mne/datasets/brainstorm/bst_raw.py",
"copies": "9",
"size": "2086",
"license": "bsd-3-clause",
"hash": 8494888302998207000,
"line_mean": 34.3559322034,
"line_max": 79,
"alpha_frac": 0.6356663471,
"autogenerated": false,
"ratio": 3.6089965397923875,
"co... |
import itertools
import numpy as np
from sklearn.cluster import MiniBatchKMeans
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from .utils import check_random_state
from .other.kmc2 import custom_distances
from .update_d_multi import prox_uv, prox_d
from .utils.dictionary import get_uv, get_... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/init_dict.py",
"copies": "1",
"size": "13120",
"license": "bsd-3-clause",
"hash": -8168577831762694000,
"line_mean": 34.3638814016,
"line_max": 79,
"alpha_frac": 0.5863567073,
"autogenerated": false,
"ratio": 3.436354112100576,
"config_test":... |
import time
import numpy as np
from scipy import optimize
from joblib import Parallel, delayed
from . import cython_code
from .utils.optim import fista
from .utils import check_random_state
from .loss_and_gradient import gradient_zi
from .utils.lil import is_list_of_lil, is_lil
from .utils.coordinate_descent import ... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/update_z_multi.py",
"copies": "1",
"size": "9215",
"license": "bsd-3-clause",
"hash": -701839882915357200,
"line_mean": 35.4229249012,
"line_max": 79,
"alpha_frac": 0.5791644059,
"autogenerated": false,
"ratio": 3.3076094759511845,
"config_te... |
from __future__ import print_function
import time
import sys
import numpy as np
from .utils import lil
from .utils import check_dimension
from .utils import check_random_state
from .utils.convolution import sort_atoms_by_explained_variances
from .utils.dictionary import get_lambda_max
from .utils.whitening import wh... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/learn_d_z_multi.py",
"copies": "1",
"size": "21187",
"license": "bsd-3-clause",
"hash": -263791262481368450,
"line_mean": 40.5431372549,
"line_max": 79,
"alpha_frac": 0.5570868929,
"autogenerated": false,
"ratio": 3.6093696763202727,
"config_... |
from sklearn.base import TransformerMixin
from sklearn.exceptions import NotFittedError
from .update_z_multi import update_z_multi
from .utils.dictionary import get_D, get_uv
from .learn_d_z_multi import learn_d_z_multi
from .loss_and_gradient import construct_X_multi
DOC_FMT = """{short_desc}
{desc}
Para... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/convolutional_dictionary_learning.py",
"copies": "1",
"size": "14401",
"license": "bsd-3-clause",
"hash": -587814229997566800,
"line_mean": 36.5026041667,
"line_max": 85,
"alpha_frac": 0.5848899382,
"autogenerated": false,
"ratio": 3.5885870919... |
import numpy as np
from . import cython_code
from .utils.lil import get_z_shape, is_list_of_lil
from .utils.optim import fista, power_iteration
from .utils.convolution import numpy_convolve_uv
from .utils.compute_constants import compute_ztz, compute_ztX
from .utils.dictionary import tukey_window
from .loss_and_grad... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/update_d_multi.py",
"copies": "1",
"size": "14716",
"license": "bsd-3-clause",
"hash": -743560678753820400,
"line_mean": 35.4257425743,
"line_max": 79,
"alpha_frac": 0.5335689046,
"autogenerated": false,
"ratio": 3.483076923076923,
"config_te... |
import numpy as np
from .utils.convolution import numpy_convolve_uv
from .utils.convolution import tensordot_convolve
from .utils.convolution import _choose_convolve_multi
from .utils.whitening import apply_whitening
from .utils.lil import scale_z_by_atom, safe_sum, get_z_shape, is_list_of_lil
from .utils import cons... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/loss_and_gradient.py",
"copies": "1",
"size": "19653",
"license": "bsd-3-clause",
"hash": -1111285276293924400,
"line_mean": 33.1791304348,
"line_max": 82,
"alpha_frac": 0.5713631507,
"autogenerated": false,
"ratio": 3.3417786090800883,
"conf... |
import time
import numpy as np
from scipy import linalg
from scipy import optimize, signal
from joblib import Parallel, delayed
from .utils.convolution import _choose_convolve
from .utils.optim import power_iteration
from .utils import check_consistent_shape
def update_z(X, ds, reg, z0=None, debug=False, parallel=N... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/update_z.py",
"copies": "1",
"size": "11453",
"license": "bsd-3-clause",
"hash": -8164936654427458000,
"line_mean": 32.5865102639,
"line_max": 79,
"alpha_frac": 0.5319130359,
"autogenerated": false,
"ratio": 3.524,
"config_test": false,
"ha... |
from __future__ import print_function
import time
import numpy as np
from scipy import linalg
from joblib import Parallel
from .init_dict import init_dictionary
from .utils import construct_X, check_random_state, check_dimension
from .utils.dictionary import get_lambda_max
from .update_z import update_z
from .update... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/learn_d_z.py",
"copies": "1",
"size": "7936",
"license": "bsd-3-clause",
"hash": -3881129494389009000,
"line_mean": 37.5242718447,
"line_max": 78,
"alpha_frac": 0.5599798387,
"autogenerated": false,
"ratio": 3.6537753222836096,
"config_test":... |
import numpy as np
from scipy import linalg, optimize
from .utils import construct_X, check_consistent_shape
def update_d(X, Z, n_times_atom, lambd0=None, ds_init=None, debug=False,
solver_kwargs=dict(), sample_weights=None, verbose=0):
"""Learn d's in time domain.
Parameters
----------
... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/update_d.py",
"copies": "1",
"size": "9907",
"license": "bsd-3-clause",
"hash": 8852576488799315000,
"line_mean": 33.1620689655,
"line_max": 79,
"alpha_frac": 0.540224084,
"autogenerated": false,
"ratio": 3.18655516243165,
"config_test": fals... |
import numpy as np
from scipy.stats import levy_stable
from .utils import check_random_state
def estimate_phi_mh(X, Xhat, alpha, Phi, n_iter_mcmc, n_burnin_mcmc,
random_state, return_loglk=False, verbose=10):
"""Estimate the expectation of 1/phi by Metropolis-Hastings"""
if n_iter_mcmc ... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/update_w.py",
"copies": "1",
"size": "1772",
"license": "bsd-3-clause",
"hash": -6799728785363263000,
"line_mean": 33.0769230769,
"line_max": 78,
"alpha_frac": 0.565462754,
"autogenerated": false,
"ratio": 2.7601246105919004,
"config_test": f... |
import numpy as np
from .utils import check_random_state, construct_X
def simulate_data(n_trials, n_times, n_times_atom, n_atoms, random_state=42,
constant_amplitude=False):
"""Simulate the data.
Parameters
----------
n_trials : int
Number of samples / trials.
n_times ... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/simulate.py",
"copies": "1",
"size": "3584",
"license": "bsd-3-clause",
"hash": 2236501825229238300,
"line_mean": 30.7168141593,
"line_max": 77,
"alpha_frac": 0.5549665179,
"autogenerated": false,
"ratio": 3.191451469278718,
"config_test": fa... |
import numpy as np
from .utils import construct_X
from .utils import check_dimension
from .utils import check_random_state
from .learn_d_z import learn_d_z
from .update_d import update_d_block
from .update_w import estimate_phi_mh
def learn_d_z_weighted(
X, n_atoms, n_times_atom, func_d=update_d_block, reg... | {
"repo_name": "alphacsc/alphacsc",
"path": "alphacsc/learn_d_z_mcem.py",
"copies": "1",
"size": "5206",
"license": "bsd-3-clause",
"hash": 5437791693937104000,
"line_mean": 39.3565891473,
"line_max": 79,
"alpha_frac": 0.6244717633,
"autogenerated": false,
"ratio": 3.395955642530985,
"config_tes... |
import numpy as np
from .mixin import TransformerMixin
from .. import pick_types
from ..filter import (low_pass_filter, high_pass_filter, band_pass_filter,
band_stop_filter)
from ..time_frequency import multitaper_psd
from ..externals import six
from ..utils import _check_type_picks
class Sca... | {
"repo_name": "aestrivex/mne-python",
"path": "mne/decoding/classifier.py",
"copies": "5",
"size": "16857",
"license": "bsd-3-clause",
"hash": 7188700500113991000,
"line_mean": 36.0483516484,
"line_max": 79,
"alpha_frac": 0.5321231536,
"autogenerated": false,
"ratio": 4.220580871306961,
"config... |
import numpy as np
from .mixin import TransformerMixin
from .base import BaseEstimator
from .. import pick_types
from ..filter import (low_pass_filter, high_pass_filter, band_pass_filter,
band_stop_filter, filter_data, _triage_filter_params)
from ..time_frequency.psd import _psd_multitaper
from... | {
"repo_name": "jniediek/mne-python",
"path": "mne/decoding/transformer.py",
"copies": "2",
"size": "32555",
"license": "bsd-3-clause",
"hash": -2294333766382816000,
"line_mean": 36.2909507446,
"line_max": 97,
"alpha_frac": 0.5477806789,
"autogenerated": false,
"ratio": 4.196854454041511,
"confi... |
import numpy as np
from .mixin import TransformerMixin
from .. import pick_types
from ..filter import (low_pass_filter, high_pass_filter, band_pass_filter,
band_stop_filter)
from ..time_frequency import multitaper_psd
from ..externals import six
from ..utils import _check_type_picks, deprecated... | {
"repo_name": "rajul/mne-python",
"path": "mne/decoding/transformer.py",
"copies": "1",
"size": "20038",
"license": "bsd-3-clause",
"hash": 9031508797727597000,
"line_mean": 36.1762523191,
"line_max": 82,
"alpha_frac": 0.5391256612,
"autogenerated": false,
"ratio": 4.21586366505365,
"config_tes... |
import copy
import numpy as np
from ..event import find_events
class MockRtClient(object):
"""Mock Realtime Client
Attributes
----------
raw : instance of Raw object
The raw object which simulates the RtClient
info : dict
Measurement info.
verbose : bool, str, int, or None
... | {
"repo_name": "effigies/mne-python",
"path": "mne/realtime/mockclient.py",
"copies": "3",
"size": "5969",
"license": "bsd-3-clause",
"hash": 8899598229994224000,
"line_mean": 33.1085714286,
"line_max": 77,
"alpha_frac": 0.5732953594,
"autogenerated": false,
"ratio": 4.174125874125874,
"config_t... |
import copy
import numpy as np
from ..event import find_events
class MockRtClient(object):
"""Mock Realtime Client.
Parameters
----------
raw : instance of Raw object
The raw object which simulates the RtClient
verbose : bool, str, int, or None
If not None, override default verbo... | {
"repo_name": "nicproulx/mne-python",
"path": "mne/realtime/mockclient.py",
"copies": "4",
"size": "6263",
"license": "bsd-3-clause",
"hash": -7020894665853381000,
"line_mean": 31.7905759162,
"line_max": 77,
"alpha_frac": 0.5634679866,
"autogenerated": false,
"ratio": 4.234617985125085,
"config... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.