text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'alena'
from model.group import Group
def test_modify_group_name(app):
if app.group.count() == 0:
app.group.create(Group(name="test"))
old_groups = app.group.get_group_list()
group = Group(name="New group")
group.id = old_groups[0].id
app.group.modify_first_group(group)
ne... | {
"repo_name": "alenasf/Pythontest",
"path": "test/test_modify_group.py",
"copies": "1",
"size": "1175",
"license": "apache-2.0",
"hash": -1599455714431597000,
"line_mean": 31.6388888889,
"line_max": 93,
"alpha_frac": 0.6357446809,
"autogenerated": false,
"ratio": 2.8658536585365852,
"config_tes... |
__author__ = "alena"
from sys import maxsize
class Contact:
def __init__(self,firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None, address=None, home=None,
mobile=None, work=None, fax=None, email=None, email2=None, email3=None, homepage=None, addr... | {
"repo_name": "alenasf/Pythontest",
"path": "model/contact.py",
"copies": "1",
"size": "1409",
"license": "apache-2.0",
"hash": 3447115992871491600,
"line_mean": 28.9787234043,
"line_max": 149,
"alpha_frac": 0.5748757984,
"autogenerated": false,
"ratio": 3.8602739726027395,
"config_test": false... |
__author__ = 'alena'
from model.contact import Contact
class ContactHelper:
def __init__(self, app):
self.app = app
def open_contact_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/edit.php") and len(wd.find_elements_by_name("Submit")) > 0):
wd.find_element... | {
"repo_name": "alenasf/Pythontest",
"path": "fixture/contact.py",
"copies": "1",
"size": "5084",
"license": "apache-2.0",
"hash": 49778657035755360,
"line_mean": 42.0847457627,
"line_max": 107,
"alpha_frac": 0.6174272227,
"autogenerated": false,
"ratio": 3.4561522773623388,
"config_test": false... |
__author__ = 'alena'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_lin... | {
"repo_name": "alenasf/Pythontest",
"path": "fixture/group.py",
"copies": "1",
"size": "2596",
"license": "apache-2.0",
"hash": -8587110011450003000,
"line_mean": 27.2173913043,
"line_max": 100,
"alpha_frac": 0.5866718028,
"autogenerated": false,
"ratio": 3.512855209742896,
"config_test": false... |
__author__ = 'alena'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_... | {
"repo_name": "alenasf/Pythontest",
"path": "fixture/session.py",
"copies": "1",
"size": "1344",
"license": "apache-2.0",
"hash": 4000602737178500600,
"line_mean": 26.4285714286,
"line_max": 87,
"alpha_frac": 0.5572916667,
"autogenerated": false,
"ratio": 3.3768844221105527,
"config_test": fals... |
__author__ = 'Alesandro.Esquiva'
import urllib.request
import urllib.parse
import json
class AARConnector:
def __init__(self,**kwargs):
self.url = kwargs.get("url","")
self.domain = kwargs.get("domain","http://automaticapirest.info/demo/")
self.table = kwargs.get("table","")
self.c... | {
"repo_name": "alejandroesquiva/AutomaticApiRest-PythonConnector",
"path": "build/lib/aarpy/AARConnector.py",
"copies": "1",
"size": "2091",
"license": "mit",
"hash": -226404345322028220,
"line_mean": 27.2567567568,
"line_max": 79,
"alpha_frac": 0.543758967,
"autogenerated": false,
"ratio": 3.611... |
__author__ = 'alesha'
from apiclient.discovery import build
from apiclient.errors import HttpError
import re
duration_reg = re.compile(u"PT((?P<hours>\d+)H)?((?P<minutes>\d+)M)?((?P<seconds>\d+)S)?")
DEVELOPER_KEY = "AIzaSyALPCgnpIM6KcJsilUsi1VxO5A7xgLujPQ"
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = ... | {
"repo_name": "AlexeyProskuryakov/rr",
"path": "wsgi/youtube.py",
"copies": "1",
"size": "2240",
"license": "mit",
"hash": -4695879740626117000,
"line_mean": 32.9393939394,
"line_max": 90,
"alpha_frac": 0.5977678571,
"autogenerated": false,
"ratio": 3.462132921174652,
"config_test": false,
"h... |
from Bio import pairwise2, Entrez, SeqIO
from Bio.SubsMat import MatrixInfo as matlist
from Bio.Blast.Applications import NcbiblastnCommandline
from Bio.Blast import NCBIXML
import tensorflow as tf
from urllib.request import urlopen
from urllib.parse import urlparse
from subprocess import call, check_output, run
... | {
"repo_name": "alec-djinn/alefuncs",
"path": "alefuncs.py",
"copies": "1",
"size": "136740",
"license": "mit",
"hash": -7891461489791813000,
"line_mean": 34.5818371064,
"line_max": 288,
"alpha_frac": 0.5649700161,
"autogenerated": false,
"ratio": 3.4436385614989424,
"config_test": false,
"has... |
from Bio import pairwise2, Entrez, SeqIO
from Bio.SubsMat import MatrixInfo as matlist
from Bio.Blast.Applications import NcbiblastnCommandline
from Bio.Blast import NCBIXML
import tensorflow as tf
from urllib.request import urlopen
from urllib.parse import urlparse
from subprocess import call, check_output, run
... | {
"repo_name": "25shmeckles/alefuncs",
"path": "alefuncs.py",
"copies": "1",
"size": "153788",
"license": "mit",
"hash": 2794238588809867300,
"line_mean": 30.5981097185,
"line_max": 289,
"alpha_frac": 0.5483587796,
"autogenerated": false,
"ratio": 3.434147648608816,
"config_test": false,
"has_... |
__author__ = 'Alessio Rocchi'
import argparse
from lxml import etree
class SoftHandLoader(object):
def __init__(self,filename):
self.handParameters = dict()
self.jointToLink = dict()
self.urdf = etree.fromstring(file(filename).read())
for transmission_el in self.urdf.iter('transm... | {
"repo_name": "lia2790/grasp_learning",
"path": "python/plugins/loaders/soft_hand_loader.py",
"copies": "2",
"size": "4871",
"license": "bsd-3-clause",
"hash": 7794803465480979000,
"line_mean": 45.3904761905,
"line_max": 143,
"alpha_frac": 0.5440361322,
"autogenerated": false,
"ratio": 4.08298407... |
__author__ = "Alexander [Amper] Marshalov"
__email__ = "alone.amper+cityhash@gmail.com"
__icq__ = "87-555-3"
__jabber__ = "alone.amper@gmail.com"
__twitter__ = "amper"
__url__ = "http://amper.github.com/cityhash"
from setuptools import setup
from setuptools.extension import Extension
from setuptools.dist i... | {
"repo_name": "escherba/python-cityhash",
"path": "setup.py",
"copies": "2",
"size": "3280",
"license": "mit",
"hash": -9014873458279009000,
"line_mean": 26.1074380165,
"line_max": 88,
"alpha_frac": 0.6176829268,
"autogenerated": false,
"ratio": 3.664804469273743,
"config_test": false,
"has_n... |
__author__ = 'Alexander Black'
import socket
import select
import sys
def prompt():
sys.stdout.write("> ")
sys.stdout.flush()
class Client(object):
def __init__(self):
self.host = sys.argv[1]
self.port = int(sys.argv[2])
self.sock = None
self.connect_to_server()
def ... | {
"repo_name": "alexwhb/simple-python-chat-server",
"path": "client.py",
"copies": "1",
"size": "1667",
"license": "mit",
"hash": -8102219238538165000,
"line_mean": 26.7833333333,
"line_max": 91,
"alpha_frac": 0.4949010198,
"autogenerated": false,
"ratio": 4.481182795698925,
"config_test": false... |
# This is the exact and Barnes-Hut t-SNE implementation. There are other
# modifications of the algorithm:
# * Fast Optimization for t-SNE:
# http://cseweb.ucsd.edu/~lvdmaaten/workshops/nips2010/papers/vandermaaten.pdf
# Includes a further addition of SemiSupervision via partial labelling of the data
import numpy a... | {
"repo_name": "lmcinnes/sstsne",
"path": "sstsne/ss_t_sne.py",
"copies": "1",
"size": "38282",
"license": "bsd-2-clause",
"hash": 2770489963970443300,
"line_mean": 38.7941787942,
"line_max": 82,
"alpha_frac": 0.6145708166,
"autogenerated": false,
"ratio": 3.9981201044386423,
"config_test": fals... |
# This is the exact and Barnes-Hut t-SNE implementation. There are other
# modifications of the algorithm:
# * Fast Optimization for t-SNE:
# https://cseweb.ucsd.edu/~lvdmaaten/workshops/nips2010/papers/vandermaaten.pdf
from time import time
import numpy as np
from scipy import linalg
from scipy.spatial.distance im... | {
"repo_name": "huzq/scikit-learn",
"path": "sklearn/manifold/_t_sne.py",
"copies": "1",
"size": "36870",
"license": "bsd-3-clause",
"hash": -4075654696369325000,
"line_mean": 39.4720087816,
"line_max": 81,
"alpha_frac": 0.6130458367,
"autogenerated": false,
"ratio": 4.050313083598813,
"config_t... |
# This is the standard t-SNE implementation. There are faster modifications of
# the algorithm:
# * Barnes-Hut-SNE: reduces the complexity of the gradient computation from
# N^2 to N log N (http://arxiv.org/abs/1301.3342)
# * Fast Optimization for t-SNE:
# http://cseweb.ucsd.edu/~lvdmaaten/workshops/nips2010/paper... | {
"repo_name": "Garrett-R/scikit-learn",
"path": "sklearn/manifold/t_sne.py",
"copies": "5",
"size": "19694",
"license": "bsd-3-clause",
"hash": 5105412433231380000,
"line_mean": 36.8730769231,
"line_max": 80,
"alpha_frac": 0.6161267391,
"autogenerated": false,
"ratio": 3.8828864353312302,
"conf... |
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.learning_curve import learning_curve, validation_curve
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_warns
from skle... | {
"repo_name": "Obus/scikit-learn",
"path": "sklearn/tests/test_learning_curve.py",
"copies": "225",
"size": "10791",
"license": "bsd-3-clause",
"hash": 5173862076298208000,
"line_mean": 41.3176470588,
"line_max": 75,
"alpha_frac": 0.6113427857,
"autogenerated": false,
"ratio": 3.452015355086372,
... |
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing imp... | {
"repo_name": "PatrickOReilly/scikit-learn",
"path": "sklearn/tests/test_learning_curve.py",
"copies": "59",
"size": "10869",
"license": "bsd-3-clause",
"hash": 6121548704753379000,
"line_mean": 40.9652509653,
"line_max": 75,
"alpha_frac": 0.6116478057,
"autogenerated": false,
"ratio": 3.45816099... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
from django.contrib.auth.models import User, Group
from django.contrib.auth import authenticate as django_auth
from django.db import transaction
from django.db.models import Q
from django.core.cache import cache
from xanderhorkunspider import dom... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/web/websites/domain.py",
"copies": "1",
"size": "4618",
"license": "apache-2.0",
"hash": 2990174486019816000,
"line_mean": 30.8551724138,
"line_max": 104,
"alpha_frac": 0.6307925509,
"autogenerated": false,
"ratio": 4.02615... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
from django import shortcuts
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import login_required
from xanderhorkunspider.web.websites.domain import users
from xanderhorkunspider.web.websites import forms
# Au... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/web/websites/views/auth.py",
"copies": "1",
"size": "3180",
"license": "apache-2.0",
"hash": -8798578542268508000,
"line_mean": 35.988372093,
"line_max": 108,
"alpha_frac": 0.6119496855,
"autogenerated": false,
"ratio": 4.3... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
from xanderhorkunspider import dao
class InMemoryPageDao(dao.PageDao):
"""
Just keeps Pages in array.
"""
__pages = {}
def find_by_url(self, url):
for pid, p in self.__pages.items():
if p.url == url:
... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/inmemory_dao.py",
"copies": "1",
"size": "1381",
"license": "apache-2.0",
"hash": -5496088601378433000,
"line_mean": 21.2903225806,
"line_max": 46,
"alpha_frac": 0.5488776249,
"autogenerated": false,
"ratio": 3.692513368983... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
from xanderhorkunspider import models
class Websites(object):
"""
Contains methods for spider to use to work with websites, pages and loadings.
"""
_page_dao = None
_website_dao = None
_loading_dao = None
def __init... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/domain.py",
"copies": "1",
"size": "3297",
"license": "apache-2.0",
"hash": 1563321288986279700,
"line_mean": 26.7142857143,
"line_max": 81,
"alpha_frac": 0.533515317,
"autogenerated": false,
"ratio": 3.8879716981132075,
... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
import json
import base64
from django import shortcuts
from django import http
from django.contrib.auth.decorators import permission_required
from xanderhorkunspider.web.websites import models
from xanderhorkunspider.web.websites import forms
fr... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/web/websites/views/websites.py",
"copies": "1",
"size": "8017",
"license": "apache-2.0",
"hash": 3547741031125777400,
"line_mean": 34.3215859031,
"line_max": 115,
"alpha_frac": 0.6466259199,
"autogenerated": false,
"ratio":... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
import json
from django.db import models
from xanderhorkunspider.models import Website
from xanderhorkunspider.models import Page
from xanderhorkunspider.models import Loading
from xanderhorkunspider.dao import WebsiteDao
from xanderhorkunspider... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/web/websites/models.py",
"copies": "1",
"size": "7561",
"license": "apache-2.0",
"hash": 7462365176562864000,
"line_mean": 29.0079365079,
"line_max": 115,
"alpha_frac": 0.6021690253,
"autogenerated": false,
"ratio": 4.00901... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
import requests
class LoadResult(object):
"""
Simply stores results of loading a page.
"""
url = ""
headers = {}
body = ""
def __init__(self, url, headers, body):
"""
Initialize object with informati... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/loader.py",
"copies": "1",
"size": "1398",
"license": "apache-2.0",
"hash": 8182295433516886000,
"line_mean": 22.3166666667,
"line_max": 83,
"alpha_frac": 0.5586552217,
"autogenerated": false,
"ratio": 4.275229357798165,
... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
import threading
import time
import datetime
from xanderhorkunspider import loader
from xanderhorkunspider import parser
from xanderhorkunspider import models
class LoadingEvaluator(object):
def evaluate_loading(self, loading):
"""
... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/spider.py",
"copies": "1",
"size": "8635",
"license": "apache-2.0",
"hash": -2719488578277907500,
"line_mean": 32.2153846154,
"line_max": 112,
"alpha_frac": 0.5790387956,
"autogenerated": false,
"ratio": 4.15743861338469,
... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
import unittest
import time
import httpretty
from xanderhorkunspider import loader
from xanderhorkunspider import models
from xanderhorkunspider import parser
from xanderhorkunspider import spider
from xanderhorkunspider import domain
from xande... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/tests.py",
"copies": "1",
"size": "5559",
"license": "apache-2.0",
"hash": -7925175582289580000,
"line_mean": 41.7692307692,
"line_max": 108,
"alpha_frac": 0.6037057025,
"autogenerated": false,
"ratio": 3.652431011826544,
... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
import urllib.parse
import re
class LinksParser(object):
"""
Gets links out of html. Checks if they belong to the website the loaded page does.
"""
def _validateurl(self, loading, url):
"""
Validates received url... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/parser.py",
"copies": "1",
"size": "1320",
"license": "apache-2.0",
"hash": 6960002280209434000,
"line_mean": 32.025,
"line_max": 90,
"alpha_frac": 0.5643939394,
"autogenerated": false,
"ratio": 3.8823529411764706,
"confi... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
class PageDao(object):
"""
Interface of Page entity's DAO.
"""
def persist(self, page):
"""
Persist new Page entity.
:param page: Page entity.
:return: nothing.
"""
raise NotImpleme... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/dao.py",
"copies": "1",
"size": "3537",
"license": "apache-2.0",
"hash": 225009541938311040,
"line_mean": 23.4,
"line_max": 72,
"alpha_frac": 0.5482046932,
"autogenerated": false,
"ratio": 4.482889733840304,
"config_test"... |
__author__ = 'Alexander Gorkun'
__email__ = 'mindkilleralexs@gmail.com'
class Website(object):
"""
Holds data about added websites to parse.
"""
id = 0
name = ""
pages = set()
host = ""
class Page(object):
"""
Holds info about loaded pages.
"""
id = 0
url = ""
web... | {
"repo_name": "AlexMaxHorkun/xanderh-spider",
"path": "xanderhorkunspider/models.py",
"copies": "1",
"size": "1431",
"license": "apache-2.0",
"hash": 2461449725393940500,
"line_mean": 20.3731343284,
"line_max": 82,
"alpha_frac": 0.535290007,
"autogenerated": false,
"ratio": 4.196480938416422,
"... |
__author__ = "Alexander Gorokhov"
__email__ = "sashgorokhov@gmail.com"
import urllib.request, urllib.parse, json, threading
__enable_requests__ = True
try:
import requests
except ImportError:
__enable_requests__ = False
class VKError(Exception):
def __init__(self, error):
super().__init__(error)
... | {
"repo_name": "sashgorokhov/VK-P-P-Music-Project",
"path": "modules/vk/api.py",
"copies": "1",
"size": "2356",
"license": "mit",
"hash": -5855609339441957000,
"line_mean": 31.7361111111,
"line_max": 96,
"alpha_frac": 0.5955008489,
"autogenerated": false,
"ratio": 3.824675324675325,
"config_test... |
__author__ = "Alexander Gorokhov"
__email__ = "sashgorokhov@gmail.com"
from PySide import QtCore, QtWebKit, QtGui
from urllib.parse import urlparse
DESCTIPTION = "VK Qt auth window"
class __QtAuthWindow(QtWebKit.QWebView):
def __init__(self, appId, scope):
super().__init__()
url = 'http://oauth.... | {
"repo_name": "sashgorokhov/VK-P-P-Music-Project",
"path": "modules/vk/qt/auth.py",
"copies": "1",
"size": "1476",
"license": "mit",
"hash": -8932796446229069000,
"line_mean": 31.8,
"line_max": 68,
"alpha_frac": 0.5616531165,
"autogenerated": false,
"ratio": 3.4976303317535544,
"config_test": f... |
__author__ = "Alexander Gorokhov"
__email__ = "sashgorokhov@gmail.com"
import http.cookiejar, urllib.request, urllib.parse, html.parser
from . import accesstokener
_noqt = False
try:
import PySide
except ImportError:
_noqt = True
def quickauth_qt(appid, permissions_scope=list()):
access_token = user_id =... | {
"repo_name": "sashgorokhov/VK-P-P-Music-Project",
"path": "modules/vk/__init__.py",
"copies": "1",
"size": "5071",
"license": "mit",
"hash": 8232950022209926000,
"line_mean": 33.4965986395,
"line_max": 115,
"alpha_frac": 0.601656478,
"autogenerated": false,
"ratio": 3.6221428571428573,
"config... |
__author__ = "Alexander Metzner"
import sys
from pyfix.testcollector import TestCollector
from pyfix.testrunner import TestRunner, TestRunListener
from pybuilder.errors import BuildFailedException
from pybuilder.utils import discover_modules_matching, render_report
def run_unit_tests(project, logger):
sys.pat... | {
"repo_name": "shakamunyi/pybuilder",
"path": "src/main/python/pybuilder/plugins/python/pyfix_plugin_impl.py",
"copies": "1",
"size": "3654",
"license": "apache-2.0",
"hash": 2699642763252847600,
"line_mean": 36.6701030928,
"line_max": 112,
"alpha_frac": 0.6830870279,
"autogenerated": false,
"rat... |
from msvcrt import getch
from clint.textui import colored
from math import ceil
from random import uniform
from time import sleep, clock
from os import system, name
from sys import exit
# Define values received when ord(getchar()) is used, i.e. ASCII values.
RIGHT_KEY = 77
LEFT_KEY = 75
SPECIAL_CHAR = 224
EXIT_CHAR =... | {
"repo_name": "Terpal47/misc-programs",
"path": "Games/Prev-color Game/game.py",
"copies": "1",
"size": "5193",
"license": "mit",
"hash": -6106615080087967000,
"line_mean": 31.8734177215,
"line_max": 78,
"alpha_frac": 0.6383593299,
"autogenerated": false,
"ratio": 3.6803685329553506,
"config_te... |
import csv
from math import ceil
# Used to help user in case they enter information incorrectly.
from window import status
# Define global macro values.
SINGLE_HARVEST_CROPS_CSV_FILE = "csv_files/single_harvest_crops.csv"
REGENERATIVE_CROPS_CSV_FILE = "csv_files/regenerative_crops.csv"
DAYS_IN_SEASON = 28
DEBUG = ... | {
"repo_name": "Terpal47/stardew-valley-assistant",
"path": "GUI Edition/functions.py",
"copies": "1",
"size": "10625",
"license": "mit",
"hash": -5949941528973469000,
"line_mean": 40.6705882353,
"line_max": 80,
"alpha_frac": 0.5702588235,
"autogenerated": false,
"ratio": 3.9794007490636703,
"co... |
import sublime, sublime_plugin
class FileOffsetCommand(sublime_plugin.TextCommand):
def run(self, edit):
positions = self._collect_positions()
offsets = self._calc_offsets(positions)
is_long = (len(offsets) > 1)
text = self._format_result(offsets, positions, is_long)
self._... | {
"repo_name": "AlexNk/Sublime-FileOffset",
"path": "FileOffset.py",
"copies": "1",
"size": "3335",
"license": "mit",
"hash": 2842456616398841300,
"line_mean": 37.3333333333,
"line_max": 80,
"alpha_frac": 0.4962518741,
"autogenerated": false,
"ratio": 3.477580813347237,
"config_test": false,
"... |
__author__ = 'Alexander'
from datawarehouse.models import LutInterventionItnCoveragesAdmin1, LutInterventionIrsCoveragesAdmin1
from django.core.management.base import BaseCommand
import csv
class Command(BaseCommand):
"""
This class defines the ETL command. The ETL command is used
to ingest data given an ... | {
"repo_name": "tph-thuering/vnetsource",
"path": "datawarehouse/management/commands/upload_irs_data.py",
"copies": "2",
"size": "2037",
"license": "mpl-2.0",
"hash": 2761300517046714000,
"line_mean": 34.7543859649,
"line_max": 101,
"alpha_frac": 0.5552282769,
"autogenerated": false,
"ratio": 4.38... |
__author__ = 'Alexander'
from datawarehouse.models import LutInterventionItnCoveragesAdmin1
from django.core.management.base import BaseCommand
import csv
class Command(BaseCommand):
"""
This class defines the ETL command. The ETL command is used
to ingest data given an input file and a mapping file. It i... | {
"repo_name": "tph-thuering/vnetsource",
"path": "datawarehouse/management/commands/upload_itn_data.py",
"copies": "2",
"size": "2432",
"license": "mpl-2.0",
"hash": -3366788097872826000,
"line_mean": 35.3134328358,
"line_max": 97,
"alpha_frac": 0.5337171053,
"autogenerated": false,
"ratio": 4.22... |
__author__ = 'Alexander Ponomarev'
from pyevolve import Util
from random import randint as rand_randint, gauss as rand_gauss
from pyevolve import Consts
def G1DListMutatorIntegerGaussian(genome, **args):
""" A gaussian mutator for G1DList of Integers
Accepts the *rangemin* and *rangemax* genome parameters, ... | {
"repo_name": "lamerman/gatool",
"path": "ev/Mutators.py",
"copies": "1",
"size": "1679",
"license": "bsd-3-clause",
"hash": -167220860815788700,
"line_mean": 32.6,
"line_max": 83,
"alpha_frac": 0.6301369863,
"autogenerated": false,
"ratio": 3.610752688172043,
"config_test": false,
"has_no_ke... |
from optparse import OptionParser
from importlib import import_module
from tests_common import setup_logger
from fnmatch import fnmatch
import traceback
import time
import sys
import os
logger = setup_logger("tests_runner")
def get_available_tests():
test_base = getattr(sys.modules["tests_common"], "TestBase")
... | {
"repo_name": "sirotin/at-a-glance-of-a-key",
"path": "simple-python-testing-framework/tests_runner.py",
"copies": "1",
"size": "3661",
"license": "mit",
"hash": -1280112956590273500,
"line_mean": 30.8347826087,
"line_max": 165,
"alpha_frac": 0.6121278339,
"autogenerated": false,
"ratio": 3.89468... |
from selenium import webdriver
import base64
def load_url_and_read_values(url, driver):
# Load wanted page
driver.get(url)
# Show cookie value as it shown in the webpage
webpage_value = driver.find_element_by_id("current_cookie").text
print("Current value (from webpage text): %s" % webpage_value)... | {
"repo_name": "sirotin/at-a-glance-of-a-key",
"path": "using-selenium-with-python-example/demo.py",
"copies": "1",
"size": "2102",
"license": "mit",
"hash": 1544020560031860700,
"line_mean": 32.3650793651,
"line_max": 93,
"alpha_frac": 0.6151284491,
"autogenerated": false,
"ratio": 3.713780918727... |
import logging
import paramiko
import time
logger = logging.getLogger("builder")
class SSHWrapper(object):
def __init__(self):
self.ssh = paramiko.SSHClient()
self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
self.connected = False
def __del__(self):
if self.connected:
self.disconnect()
... | {
"repo_name": "sirotin/at-a-glance-of-a-key",
"path": "compile-using-aws-spot-instance/ssh_helper.py",
"copies": "1",
"size": "1898",
"license": "mit",
"hash": 7030119807167040000,
"line_mean": 26.5072463768,
"line_max": 91,
"alpha_frac": 0.6975763962,
"autogenerated": false,
"ratio": 3.25,
"co... |
import pickledb
import logging
import base64
import json
from functools import wraps
from flask import Flask, request, redirect, abort
app = Flask(__name__)
logger = logging.getLogger()
hdlr = logging.FileHandler("redirections.log")
formatter = logging.Formatter("%(asctime)s %(levelname)s %(message)s")
hdlr.setForm... | {
"repo_name": "sirotin/at-a-glance-of-a-key",
"path": "simple-url-redirection-using-flask/app.py",
"copies": "1",
"size": "4432",
"license": "mit",
"hash": -1904149332818174700,
"line_mean": 30.2112676056,
"line_max": 113,
"alpha_frac": 0.6383122744,
"autogenerated": false,
"ratio": 3.88091068301... |
import time
import logging
import boto.ec2
from aws_helper import AwsHelper
from ssh_helper import SSHWrapper
logger = logging.getLogger("builder")
class AwsWrapper:
def __init__(self, settings):
self.settings = settings
self.ec2 = boto.ec2.connect_to_region(self.settings.Region,
... | {
"repo_name": "sirotin/at-a-glance-of-a-key",
"path": "compile-using-aws-spot-instance/aws_wrapper.py",
"copies": "1",
"size": "1885",
"license": "mit",
"hash": -6019239523778815000,
"line_mean": 34.5660377358,
"line_max": 106,
"alpha_frac": 0.6970822281,
"autogenerated": false,
"ratio": 3.354092... |
import time
import logging
import boto.ec2
logger = logging.getLogger("builder")
class AwsHelper:
def __init__(self, ec2, settings):
self.ec2 = ec2
self.settings = settings
def checkSpotRequestState(self, sir_id):
logger.debug("Checking spot request: %s" % sir_id)
active_requests = self.ec2.get_all_spot_... | {
"repo_name": "sirotin/at-a-glance-of-a-key",
"path": "compile-using-aws-spot-instance/aws_helper.py",
"copies": "1",
"size": "5550",
"license": "mit",
"hash": -2697873670567798300,
"line_mean": 33.0490797546,
"line_max": 144,
"alpha_frac": 0.6859459459,
"autogenerated": false,
"ratio": 3.2840236... |
__author__ = 'Alexander "Yukikaze" Putin'
__email__ = 'yukikaze (at) modxvm.com'
import struct
class Replay(object):
def __init__(self, raw_data):
self._raw_data = raw_data
self._blocks = []
self._magic, block_count = struct.unpack('II', raw_data[:8]) # unpack 2 uint
self._last_b... | {
"repo_name": "AlexYukikaze/wot-replay",
"path": "replay/__init__.py",
"copies": "1",
"size": "2081",
"license": "mit",
"hash": -6521766839666575000,
"line_mean": 24.3780487805,
"line_max": 85,
"alpha_frac": 0.5482940894,
"autogenerated": false,
"ratio": 3.6444833625218913,
"config_test": false... |
__author__ = 'Alexandre Cloquet'
from django.contrib.auth.models import User, Group
from django.db import models
from django.utils.translation import ugettext as _
from uuid import uuid4
from Portal.models import Category
class GuildSettings(models.Model):
'''
Handle all settings about guild and SuperPorta... | {
"repo_name": "elryndir/GuildPortal",
"path": "SuperPortal/models/settings.py",
"copies": "1",
"size": "2020",
"license": "mit",
"hash": 4257580109426372000,
"line_mean": 50.8205128205,
"line_max": 115,
"alpha_frac": 0.702970297,
"autogenerated": false,
"ratio": 3.733826247689464,
"config_test"... |
__author__ = 'Alexandre Cloquet'
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from django.db import models
class Game(models.Model):
name = models.CharField(max_length=128)
image = models.ImageField(upload_to='game/', blank=True)
url_api = models.URLFiel... | {
"repo_name": "elryndir/GuildPortal",
"path": "Portal/models/enrollment.py",
"copies": "1",
"size": "2250",
"license": "mit",
"hash": -5742032601725762000,
"line_mean": 27.1375,
"line_max": 124,
"alpha_frac": 0.6262222222,
"autogenerated": false,
"ratio": 3.6885245901639343,
"config_test": fals... |
from math import sqrt
import numpy as np
from scipy import linalg
from .mxne_debiasing import compute_bias
from ..utils import logger, verbose, sum_squared, warn, dgemm
from ..time_frequency._stft import stft_norm1, stft_norm2, stft, istft
def groups_norm2(A, n_orient):
"""Compute squared L2 norms of groups in... | {
"repo_name": "larsoner/mne-python",
"path": "mne/inverse_sparse/mxne_optim.py",
"copies": "6",
"size": "57847",
"license": "bsd-3-clause",
"hash": -3749142048177160700,
"line_mean": 35.030529595,
"line_max": 79,
"alpha_frac": 0.536927839,
"autogenerated": false,
"ratio": 3.2319342759738445,
"c... |
import functools
from math import sqrt
import numpy as np
from .mxne_debiasing import compute_bias
from ..utils import logger, verbose, sum_squared, warn, _get_blas_funcs
from ..time_frequency._stft import stft_norm1, stft_norm2, stft, istft
@functools.lru_cache(None)
def _get_dgemm():
return _get_blas_funcs(n... | {
"repo_name": "mne-tools/mne-python",
"path": "mne/inverse_sparse/mxne_optim.py",
"copies": "2",
"size": "60067",
"license": "bsd-3-clause",
"hash": -6502757440756734000,
"line_mean": 34.7967818832,
"line_max": 79,
"alpha_frac": 0.5312234671,
"autogenerated": false,
"ratio": 3.2664636467453367,
... |
import numpy as np
from scipy import linalg
from ..source_estimate import SourceEstimate, _BaseSourceEstimate, _make_stc
from ..minimum_norm.inverse import (combine_xyz, _prepare_forward,
_check_reference, _log_exp_var)
from ..forward import is_fixed_orient
from ..io.pick import pi... | {
"repo_name": "olafhauk/mne-python",
"path": "mne/inverse_sparse/mxne_inverse.py",
"copies": "4",
"size": "26416",
"license": "bsd-3-clause",
"hash": 3104678548255727000,
"line_mean": 36.2014084507,
"line_max": 79,
"alpha_frac": 0.5957293757,
"autogenerated": false,
"ratio": 3.379782469609725,
... |
import numpy as np
from ..source_estimate import SourceEstimate, _BaseSourceEstimate, _make_stc
from ..minimum_norm.inverse import (combine_xyz, _prepare_forward,
_check_reference, _log_exp_var)
from ..forward import is_fixed_orient
from ..io.pick import pick_channels_evoked
from .... | {
"repo_name": "kambysese/mne-python",
"path": "mne/inverse_sparse/mxne_inverse.py",
"copies": "6",
"size": "26013",
"license": "bsd-3-clause",
"hash": 1627604500459531000,
"line_mean": 36.0555555556,
"line_max": 79,
"alpha_frac": 0.5948948603,
"autogenerated": false,
"ratio": 3.3888744137571654,
... |
import pytest
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_allclose, assert_array_less)
from mne.inverse_sparse.mxne_optim import (mixed_norm_solver,
tf_mixed_norm_solver,
... | {
"repo_name": "kambysese/mne-python",
"path": "mne/inverse_sparse/tests/test_mxne_optim.py",
"copies": "6",
"size": "14142",
"license": "bsd-3-clause",
"hash": 7207271965778474000,
"line_mean": 40.7168141593,
"line_max": 77,
"alpha_frac": 0.587328525,
"autogenerated": false,
"ratio": 2.7594146341... |
import os.path as op
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_allclose
import pytest
import mne
from mne.datasets import testing
from mne.label import read_label
from mne import (read_cov, read_forward_solution, read_evokeds,
convert_forward_solution)
from mne.in... | {
"repo_name": "cjayb/mne-python",
"path": "mne/inverse_sparse/tests/test_mxne_inverse.py",
"copies": "2",
"size": "10276",
"license": "bsd-3-clause",
"hash": -1911820511172548900,
"line_mean": 43.2931034483,
"line_max": 79,
"alpha_frac": 0.5985792137,
"autogenerated": false,
"ratio": 3.1111111111... |
from copy import deepcopy
import os.path as op
import pickle
import numpy as np
from scipy import fftpack
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_array_equal, assert_allclose)
import pytest
from mne import (equalize_channels, pick_types, read_evokeds, wri... | {
"repo_name": "drammock/mne-python",
"path": "mne/tests/test_evoked.py",
"copies": "4",
"size": "32784",
"license": "bsd-3-clause",
"hash": 9215672245024772000,
"line_mean": 38.9756097561,
"line_max": 79,
"alpha_frac": 0.6488102502,
"autogenerated": false,
"ratio": 2.941757156959526,
"config_te... |
import os.path as op
import itertools as itt
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal, assert_allclose)
import pytest
import numpy as np
from scipy import linalg
from mne.cov import (regularize, whiten_evoked,
_auto_low_ran... | {
"repo_name": "bloyl/mne-python",
"path": "mne/tests/test_cov.py",
"copies": "4",
"size": "34609",
"license": "bsd-3-clause",
"hash": 7960692879079456000,
"line_mean": 41.9392059553,
"line_max": 79,
"alpha_frac": 0.6172671848,
"autogenerated": false,
"ratio": 3.2929590865842053,
"config_test": ... |
import pytest
import numpy as np
from scipy import sparse
from scipy import linalg
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import assert_allclose
from sklearn.... | {
"repo_name": "kevin-intel/scikit-learn",
"path": "sklearn/linear_model/tests/test_base.py",
"copies": "2",
"size": "26110",
"license": "bsd-3-clause",
"hash": 9191682616168708000,
"line_mean": 34.1886792453,
"line_max": 79,
"alpha_frac": 0.6164304864,
"autogenerated": false,
"ratio": 3.219879146... |
from math import log
import numpy as np
from scipy.linalg import pinvh
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_less
from sklearn.utils.testing import assert_raise_message
from sklearn.utils import... | {
"repo_name": "chrsrds/scikit-learn",
"path": "sklearn/linear_model/tests/test_bayes.py",
"copies": "1",
"size": "8265",
"license": "bsd-3-clause",
"hash": -8418597883932554000,
"line_mean": 34.625,
"line_max": 78,
"alpha_frac": 0.6318209316,
"autogenerated": false,
"ratio": 3.047566371681416,
... |
import numpy as np
from scipy import sparse
import warnings
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model.base import LinearRegression
from sklearn.linear_model.base import center_data, sparse_center_data
from sklearn.utils import... | {
"repo_name": "mehdidc/scikit-learn",
"path": "sklearn/linear_model/tests/test_base.py",
"copies": "7",
"size": "10479",
"license": "bsd-3-clause",
"hash": 4989755894596540000,
"line_mean": 37.1054545455,
"line_max": 79,
"alpha_frac": 0.6073098578,
"autogenerated": false,
"ratio": 3.1658610271903... |
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model.base import LinearRegression
from sklearn.linear_model.base import center_data, sparse_center_data
from sklearn.utils import check_random_st... | {
"repo_name": "smartscheduling/scikit-learn-categorical-tree",
"path": "sklearn/linear_model/tests/test_base.py",
"copies": "120",
"size": "10082",
"license": "bsd-3-clause",
"hash": -5016893403683557000,
"line_mean": 38.2295719844,
"line_max": 79,
"alpha_frac": 0.6092045229,
"autogenerated": false... |
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegression
from sklearn import datasets
from sklearn.utils.testing import assert_array_almost_equal
def test_bayesian_on_diabetes():
"""
... | {
"repo_name": "rseubert/scikit-learn",
"path": "sklearn/linear_model/tests/test_bayes.py",
"copies": "30",
"size": "1812",
"license": "bsd-3-clause",
"hash": 7597844669144402000,
"line_mean": 27.3125,
"line_max": 74,
"alpha_frac": 0.6534216336,
"autogenerated": false,
"ratio": 3.1845342706502637,... |
import sys
import warnings
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import sparse
from ..externals.six.moves import xrange
from . import cd_fast
from .base import LinearModel, _pre_fit
from .base import _preprocess_data
from ..base import RegressorMixin
from ..exceptions import Convergen... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/sklearn/linear_model/coordinate_descent.py",
"copies": "1",
"size": "81083",
"license": "mit",
"hash": 2159661821378754600,
"line_mean": 36.5037002775,
"line_max": 82,
"alpha_frac": 0.6067733064,
"autogenerated": fals... |
import sys
import warnings
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import sparse
from joblib import Parallel, delayed, effective_n_jobs
from .base import LinearModel, _pre_fit
from ..base import RegressorMixin, MultiOutputMixin
from .base import _preprocess_data
from ..utils import chec... | {
"repo_name": "chrsrds/scikit-learn",
"path": "sklearn/linear_model/coordinate_descent.py",
"copies": "2",
"size": "85449",
"license": "bsd-3-clause",
"hash": 5724805391785200000,
"line_mean": 36.7258278146,
"line_max": 81,
"alpha_frac": 0.6065723414,
"autogenerated": false,
"ratio": 4.0084908758... |
import sys
import warnings
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import sparse
from .base import LinearModel, _pre_fit
from ..base import RegressorMixin
from .base import center_data, sparse_center_data
from ..utils import array2d, atleast2d_or_csc
from ..cross_validation import _chec... | {
"repo_name": "chaluemwut/fbserver",
"path": "venv/lib/python2.7/site-packages/sklearn/linear_model/coordinate_descent.py",
"copies": "2",
"size": "67549",
"license": "apache-2.0",
"hash": -196371892571954530,
"line_mean": 35.1031533939,
"line_max": 79,
"alpha_frac": 0.5896904469,
"autogenerated": ... |
import sys
import warnings
import itertools
import operator
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import sparse
from .base import LinearModel, _pre_fit
from ..base import RegressorMixin
from .base import center_data
from ..utils import array2d, atleast2d_or_csc, deprecated
from ..cros... | {
"repo_name": "fspaolo/scikit-learn",
"path": "sklearn/linear_model/coordinate_descent.py",
"copies": "1",
"size": "54482",
"license": "bsd-3-clause",
"hash": -7032359904602488000,
"line_mean": 35.0569159497,
"line_max": 79,
"alpha_frac": 0.5900297346,
"autogenerated": false,
"ratio": 3.947398927... |
import sys
import warnings
import numbers
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import sparse
from joblib import Parallel, delayed, effective_n_jobs
from ._base import LinearModel, _pre_fit
from ..base import RegressorMixin, MultiOutputMixin
from ._base import _preprocess_data
from ..... | {
"repo_name": "bnaul/scikit-learn",
"path": "sklearn/linear_model/_coordinate_descent.py",
"copies": "2",
"size": "92547",
"license": "bsd-3-clause",
"hash": 7834911798739709000,
"line_mean": 36.6973523422,
"line_max": 81,
"alpha_frac": 0.6007109901,
"autogenerated": false,
"ratio": 3.98943874471... |
import sys
import warnings
import numbers
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import sparse
from joblib import Parallel, effective_n_jobs
from ._base import LinearModel, _pre_fit
from ..base import RegressorMixin, MultiOutputMixin
from ._base import _preprocess_data
from ..utils imp... | {
"repo_name": "kevin-intel/scikit-learn",
"path": "sklearn/linear_model/_coordinate_descent.py",
"copies": "2",
"size": "93685",
"license": "bsd-3-clause",
"hash": 502482693768072700,
"line_mean": 36.5040032026,
"line_max": 81,
"alpha_frac": 0.5997758446,
"autogenerated": false,
"ratio": 3.984052... |
import sys
import warnings
import itertools
import operator
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import sparse
from .base import LinearModel
from ..base import RegressorMixin
from .base import sparse_center_data, center_data
from ..utils import array2d, atleast2d_or_csc, deprecated
f... | {
"repo_name": "kmike/scikit-learn",
"path": "sklearn/linear_model/coordinate_descent.py",
"copies": "2",
"size": "47509",
"license": "bsd-3-clause",
"hash": -4343959595309814300,
"line_mean": 34.5872659176,
"line_max": 97,
"alpha_frac": 0.585741649,
"autogenerated": false,
"ratio": 3.901856110381... |
import sys
import warnings
import itertools
import operator
from abc import ABCMeta, abstractmethod
import numpy as np
import scipy.sparse as sp
from .base import LinearModel
from ..base import RegressorMixin
from .base import sparse_center_data
from ..utils import as_float_array
from ..cross_validation import check... | {
"repo_name": "sgenoud/scikit-learn",
"path": "sklearn/linear_model/coordinate_descent.py",
"copies": "1",
"size": "31607",
"license": "bsd-3-clause",
"hash": -4527553504032378000,
"line_mean": 33.0592672414,
"line_max": 79,
"alpha_frac": 0.5922738634,
"autogenerated": false,
"ratio": 4.057902169... |
import sys
import warnings
import numpy as np
from .base import LinearModel
from ..utils import as_float_array
from ..cross_validation import check_cv
from . import cd_fast
###############################################################################
# ElasticNet model
class ElasticNet(LinearModel):
"""Linea... | {
"repo_name": "cdegroc/scikit-learn",
"path": "sklearn/linear_model/coordinate_descent.py",
"copies": "1",
"size": "24053",
"license": "bsd-3-clause",
"hash": -8644280071132476000,
"line_mean": 32.0852819807,
"line_max": 79,
"alpha_frac": 0.5943541346,
"autogenerated": false,
"ratio": 4.123607063... |
import itertools
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raise_message
from sklearn.exceptions import NotFittedError
from sklearn impo... | {
"repo_name": "herilalaina/scikit-learn",
"path": "sklearn/covariance/tests/test_robust_covariance.py",
"copies": "9",
"size": "6059",
"license": "bsd-3-clause",
"hash": 1376543601366235600,
"line_mean": 37.3481012658,
"line_max": 79,
"alpha_frac": 0.6638059086,
"autogenerated": false,
"ratio": 3... |
import numpy as np
from sklearn import datasets
from sklearn.covariance import empirical_covariance, MinCovDet, \
EllipticEnvelope
from sklearn.covariance import fast_mcd
from sklearn.exceptions import NotFittedError
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_arr... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/sklearn/covariance/tests/test_robust_covariance.py",
"copies": "1",
"size": "3840",
"license": "mit",
"hash": 5247051714583605000,
"line_mean": 34.5555555556,
"line_max": 80,
"alpha_frac": 0.6614583333,
"autogenerated... |
import numpy as np
import pytest
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.utils._testing import assert_array_equal
from sklearn import datasets
from sklearn.covariance import empirical_covariance, EmpiricalCovariance, \
Shrun... | {
"repo_name": "kevin-intel/scikit-learn",
"path": "sklearn/covariance/tests/test_covariance.py",
"copies": "3",
"size": "12809",
"license": "bsd-3-clause",
"hash": -5066063345063005000,
"line_mean": 37.8151515152,
"line_max": 79,
"alpha_frac": 0.6588336326,
"autogenerated": false,
"ratio": 3.1990... |
import numpy as np
import warnings
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.covariance import empiric... | {
"repo_name": "B3AU/waveTree",
"path": "sklearn/covariance/tests/test_covariance.py",
"copies": "5",
"size": "10155",
"license": "bsd-3-clause",
"hash": 6598631652302148000,
"line_mean": 37.4659090909,
"line_max": 79,
"alpha_frac": 0.6629246677,
"autogenerated": false,
"ratio": 3.118857493857494,... |
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import ass... | {
"repo_name": "Vimos/scikit-learn",
"path": "sklearn/covariance/tests/test_covariance.py",
"copies": "59",
"size": "12193",
"license": "bsd-3-clause",
"hash": -8137810715484464000,
"line_mean": 38.8464052288,
"line_max": 79,
"alpha_frac": 0.6627573198,
"autogenerated": false,
"ratio": 3.186046511... |
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.validation import NotFittedError
from sklearn import datasets
from sklearn.covariance import empirical_covariance, Mi... | {
"repo_name": "mehdidc/scikit-learn",
"path": "sklearn/covariance/tests/test_robust_covariance.py",
"copies": "7",
"size": "3377",
"license": "bsd-3-clause",
"hash": 3132634646285445000,
"line_mean": 33.4591836735,
"line_max": 78,
"alpha_frac": 0.6633106307,
"autogenerated": false,
"ratio": 2.967... |
from numpy.testing import assert_almost_equal, assert_array_almost_equal
import numpy as np
from sklearn import datasets
from sklearn.covariance import empirical_covariance, EmpiricalCovariance, \
ShrunkCovariance, shrunk_covariance, LedoitWolf, ledoit_wolf, OAS, oas
X = datasets.load_iris().data
X_1d = X[:, 0]... | {
"repo_name": "sgenoud/scikit-learn",
"path": "sklearn/covariance/tests/test_covariance.py",
"copies": "3",
"size": "8673",
"license": "bsd-3-clause",
"hash": 7348934390458435000,
"line_mean": 38.7844036697,
"line_max": 79,
"alpha_frac": 0.6756600945,
"autogenerated": false,
"ratio": 3.0093684941... |
from numpy.testing import assert_almost_equal, assert_array_almost_equal
import numpy as np
from sklearn import datasets
from sklearn.covariance import empirical_covariance, MinCovDet, \
EllipticEnvelope
X = datasets.load_iris().data
X_1d = X[:, 0]
n_samples, n_features = X.shape
def test_mcd():
"""Tests ... | {
"repo_name": "sgenoud/scikit-learn",
"path": "sklearn/covariance/tests/test_robust_covariance.py",
"copies": "1",
"size": "2616",
"license": "bsd-3-clause",
"hash": -7775778065667585000,
"line_mean": 31.7,
"line_max": 72,
"alpha_frac": 0.6548165138,
"autogenerated": false,
"ratio": 2.90344062153... |
import numpy as np
import warnings
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.covariance import empiric... | {
"repo_name": "kmike/scikit-learn",
"path": "sklearn/covariance/tests/test_covariance.py",
"copies": "4",
"size": "10153",
"license": "bsd-3-clause",
"hash": 5667032455597067000,
"line_mean": 37.4583333333,
"line_max": 79,
"alpha_frac": 0.6628582685,
"autogenerated": false,
"ratio": 3.11824324324... |
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.covariance import empirical_covariance, MinCovDet, \
EllipticEnvelope
X = datasets.load_i... | {
"repo_name": "florian-f/sklearn",
"path": "sklearn/covariance/tests/test_robust_covariance.py",
"copies": "4",
"size": "3338",
"license": "bsd-3-clause",
"hash": -3109847551201528300,
"line_mean": 33.0612244898,
"line_max": 78,
"alpha_frac": 0.6587777112,
"autogenerated": false,
"ratio": 2.96184... |
import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
cblas_libs, blas_info = get_blas_info()
libraries = []
if os.name == 'posix':
cblas_libs.ap... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/sklearn/cluster/setup.py",
"copies": "1",
"size": "1450",
"license": "mit",
"hash": 4701870351377395000,
"line_mean": 28.5918367347,
"line_max": 67,
"alpha_frac": 0.5496551724,
"autogenerated": false,
"ratio": 4.119... |
import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
cblas_libs, blas_info = get_blas_info()
libraries = []
if os.name == 'posix':
cblas_libs.a... | {
"repo_name": "mjudsp/Tsallis",
"path": "sklearn/cluster/setup.py",
"copies": "5",
"size": "1654",
"license": "bsd-3-clause",
"hash": -727766178050549200,
"line_mean": 30.8076923077,
"line_max": 67,
"alpha_frac": 0.5374848851,
"autogenerated": false,
"ratio": 4.1767676767676765,
"config_test": ... |
import os
import numpy
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
libraries = []
if os.name == 'posix':
libraries.append('m')
config = Configuration('cluster', parent_package, top_path)
config.add_extension('_dbscan_inner',
... | {
"repo_name": "bnaul/scikit-learn",
"path": "sklearn/cluster/setup.py",
"copies": "12",
"size": "1616",
"license": "bsd-3-clause",
"hash": -4976089820001635000,
"line_mean": 31.32,
"line_max": 63,
"alpha_frac": 0.5198019802,
"autogenerated": false,
"ratio": 4.564971751412429,
"config_test": tru... |
import numpy as np
from ..utils import logger, verbose
@verbose
def is_equal(first, second, verbose=None):
"""Check if 2 python structures are the same.
Designed to handle dict, list, np.ndarray etc.
"""
all_equal = True
# Check all keys in first dict
if type(first) != type(second):
... | {
"repo_name": "wmvanvliet/mne-python",
"path": "mne/io/diff.py",
"copies": "14",
"size": "1219",
"license": "bsd-3-clause",
"hash": -7213742225305804000,
"line_mean": 29.475,
"line_max": 69,
"alpha_frac": 0.5578342904,
"autogenerated": false,
"ratio": 3.8454258675078865,
"config_test": false,
... |
"""Implementation of coordinate descent for the Elastic Net with sparse data.
"""
import warnings
import numpy as np
import scipy.sparse as sp
from ..base import LinearModel
from . import cd_fast_sparse
class ElasticNet(LinearModel):
"""Linear Model trained with L1 and L2 prior as regularizer
This implemen... | {
"repo_name": "ominux/scikit-learn",
"path": "sklearn/linear_model/sparse/coordinate_descent.py",
"copies": "2",
"size": "4827",
"license": "bsd-3-clause",
"hash": 4640861534838178000,
"line_mean": 33.2340425532,
"line_max": 78,
"alpha_frac": 0.6154961674,
"autogenerated": false,
"ratio": 4.05289... |
"""Implementation of coordinate descent for the Elastic Net with sparse data.
"""
import warnings
import numpy as np
import scipy.sparse as sp
from ...utils.extmath import safe_sparse_dot
from ..base import LinearModel
from . import cd_fast_sparse
class ElasticNet(LinearModel):
"""Linear Model trained with L1 a... | {
"repo_name": "cdegroc/scikit-learn",
"path": "sklearn/linear_model/sparse/coordinate_descent.py",
"copies": "1",
"size": "4941",
"license": "bsd-3-clause",
"hash": -6102850043187879000,
"line_mean": 33.7957746479,
"line_max": 78,
"alpha_frac": 0.6071645416,
"autogenerated": false,
"ratio": 4.059... |
from copy import deepcopy
import numpy as np
from scipy import linalg, signal
from ..source_estimate import SourceEstimate
from ..minimum_norm.inverse import combine_xyz, _prepare_forward
from ..minimum_norm.inverse import _check_reference
from ..forward import compute_orient_prior, is_fixed_orient, _to_fixed_ori
fro... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/inverse_sparse/mxne_inverse.py",
"copies": "1",
"size": "23868",
"license": "bsd-3-clause",
"hash": 1507655731444313000,
"line_mean": 35.8333333333,
"line_max": 79,
"alpha_frac": 0.6026059997,
"autogenerated": false,
"ratio": 3.4681778552746296,
... |
from math import sqrt
import numpy as np
from scipy import linalg
from .mxne_debiasing import compute_bias
from ..utils import logger, verbose, sum_squared, warn
from ..time_frequency.stft import stft_norm1, stft_norm2, stft, istft
def groups_norm2(A, n_orient):
"""Compute squared L2 norms of groups inplace.""... | {
"repo_name": "adykstra/mne-python",
"path": "mne/inverse_sparse/mxne_optim.py",
"copies": "1",
"size": "48338",
"license": "bsd-3-clause",
"hash": -5424002858027106000,
"line_mean": 34.4904552129,
"line_max": 93,
"alpha_frac": 0.5343208242,
"autogenerated": false,
"ratio": 3.224037884346028,
"... |
import numpy as np
from scipy import linalg, signal
from ..source_estimate import (SourceEstimate, VolSourceEstimate,
_BaseSourceEstimate)
from ..minimum_norm.inverse import (combine_xyz, _prepare_forward,
_check_reference, _check_loose_forward)
from ... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/inverse_sparse/mxne_inverse.py",
"copies": "3",
"size": "27459",
"license": "bsd-3-clause",
"hash": 7035603888333090000,
"line_mean": 37.0318559557,
"line_max": 79,
"alpha_frac": 0.6011872246,
"autogenerated": false,
"ratio": 3.470112473145457,
... |
import pytest
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_allclose, assert_array_less)
from mne.inverse_sparse.mxne_optim import (mixed_norm_solver,
tf_mixed_norm_solver,
... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/inverse_sparse/tests/test_mxne_optim.py",
"copies": "3",
"size": "11932",
"license": "bsd-3-clause",
"hash": -8632989572145968000,
"line_mean": 40.574912892,
"line_max": 77,
"alpha_frac": 0.583221589,
"autogenerated": false,
"ratio": 2.753750288... |
import os.path as op
import copy
import numpy as np
from numpy.testing import assert_array_almost_equal
from nose.tools import assert_true
from mne.datasets import sample
from mne.label import read_label
from mne import read_cov, read_forward_solution, read_evokeds
from mne.inverse_sparse import mixed_norm, tf_mixed_... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/inverse_sparse/tests/test_mxne_inverse.py",
"copies": "2",
"size": "3823",
"license": "bsd-2-clause",
"hash": 1998038223554223000,
"line_mean": 40.1075268817,
"line_max": 79,
"alpha_frac": 0.6269945069,
"autogenerated": false,
"ratio": 3.13617719442165... |
import os.path as op
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_allclose
from nose.tools import assert_true, assert_equal
from mne.datasets import testing
from mne.label import read_label
from mne import read_cov, read_forward_solution, read_evokeds
from mne.inverse_sparse import m... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/inverse_sparse/tests/test_mxne_inverse.py",
"copies": "1",
"size": "5797",
"license": "bsd-3-clause",
"hash": 6430297442701142000,
"line_mean": 42.9166666667,
"line_max": 79,
"alpha_frac": 0.6256684492,
"autogenerated": false,
"ratio": 3.072072072... |
from copy import deepcopy
import os.path as op
import pickle
import numpy as np
from scipy import fftpack
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_array_equal, assert_allclose)
import pytest
from mne import (equalize_channels, pick_types, read_evokeds, wri... | {
"repo_name": "adykstra/mne-python",
"path": "mne/tests/test_evoked.py",
"copies": "1",
"size": "25901",
"license": "bsd-3-clause",
"hash": 2639158505766476300,
"line_mean": 38.0075301205,
"line_max": 79,
"alpha_frac": 0.6448399676,
"autogenerated": false,
"ratio": 2.924683830171635,
"config_te... |
import os.path as op
from copy import deepcopy
import warnings
import numpy as np
from scipy import fftpack
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_array_equal, assert_allclose)
from nose.tools import assert_true, assert_raises, assert_not_equal
from mne ... | {
"repo_name": "wronk/mne-python",
"path": "mne/tests/test_evoked.py",
"copies": "2",
"size": "18919",
"license": "bsd-3-clause",
"hash": 662986066439100700,
"line_mean": 36.4633663366,
"line_max": 78,
"alpha_frac": 0.6428458164,
"autogenerated": false,
"ratio": 2.9083781706379708,
"config_test"... |
import os.path as op
from copy import deepcopy
import numpy as np
from scipy import fftpack
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_array_equal, assert_allclose)
import pytest
from mne import (equalize_channels, pick_types, read_evokeds, write_evokeds,
... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/tests/test_evoked.py",
"copies": "2",
"size": "23775",
"license": "bsd-3-clause",
"hash": 6466565471980801000,
"line_mean": 38.4933554817,
"line_max": 79,
"alpha_frac": 0.6449211356,
"autogenerated": false,
"ratio": 2.917535893974721,
"config_... |
from copy import deepcopy
from functools import partial
import glob
import itertools as itt
import os
import os.path as op
import warnings
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose, assert_equal)
from nose.tools import asser... | {
"repo_name": "jmontoyam/mne-python",
"path": "mne/io/fiff/tests/test_raw_fiff.py",
"copies": "2",
"size": "61567",
"license": "bsd-3-clause",
"hash": -8099600252995738000,
"line_mean": 41.0827067669,
"line_max": 79,
"alpha_frac": 0.6010525119,
"autogenerated": false,
"ratio": 3.1006748589846898,... |
from copy import deepcopy
from functools import partial
import itertools as itt
import os
import os.path as op
import warnings
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose, assert_equal)
from nose.tools import assert_true, asse... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/io/fiff/tests/test_raw_fiff.py",
"copies": "1",
"size": "57420",
"license": "bsd-3-clause",
"hash": -3511585142599957000,
"line_mean": 39.78125,
"line_max": 79,
"alpha_frac": 0.605276907,
"autogenerated": false,
"ratio": 3.100766821471001,
"conf... |
from copy import deepcopy
from functools import partial
import itertools as itt
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose, assert_equal)
import pytest
from mne.datasets import testing
from mne.filter im... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/io/fiff/tests/test_raw_fiff.py",
"copies": "2",
"size": "60041",
"license": "bsd-3-clause",
"hash": -7504805733982241000,
"line_mean": 40.152159013,
"line_max": 79,
"alpha_frac": 0.6053196982,
"autogenerated": false,
"ratio": 3.1112550523370297,... |
import os.path as op
from copy import deepcopy
from nose.tools import (assert_true, assert_equal, assert_raises,
assert_not_equal)
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_allclose)
import numpy as np
import copy as cp
import ... | {
"repo_name": "alexandrebarachant/mne-python",
"path": "mne/tests/test_epochs.py",
"copies": "1",
"size": "91689",
"license": "bsd-3-clause",
"hash": 6598657369602859000,
"line_mean": 41.8653576438,
"line_max": 79,
"alpha_frac": 0.5993630643,
"autogenerated": false,
"ratio": 3.285519762066865,
... |
import os.path as op
from nose.tools import assert_true
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from mne import Epochs, read_evokeds, pick_types
from mne.io.compensator import make_compensator, get_current_comp
from mne.io import Raw
from mne.utils import _TempDir, requires_mne, run... | {
"repo_name": "alexandrebarachant/mne-python",
"path": "mne/io/tests/test_compensator.py",
"copies": "2",
"size": "3682",
"license": "bsd-3-clause",
"hash": 5782539379675446000,
"line_mean": 38.170212766,
"line_max": 76,
"alpha_frac": 0.6265616513,
"autogenerated": false,
"ratio": 2.9741518578352... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.