repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
calinerd/AWS
LAMBDA/Lambda_AutoUpdate_SecurityGroup_to_Allow_inbound_All_CloudFront_IPs_443.py
1
6268
''' Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the "license" file accompanying this fil...
unlicense
4,925,142,042,631,168,000
34.619318
266
0.596522
false
3.755542
false
false
false
Xdynix/PixivPixie
bundle_cli.py
1
2691
import os import subprocess import sys from pixiv_pixie.cli import main as cli_main, NAME BINARY_PATH = 'lib' DATA_PATH = 'data' def is_packaged(): # Return true if executing from packaged file return hasattr(sys, 'frozen') def get_path(path, package_prefix=DATA_PATH): if os.path.isabs(path) or not is...
apache-2.0
-7,565,490,886,109,477,000
24.628571
78
0.531401
false
3.860832
false
false
false
tortugueta/multilayers
examples/radcenter_distribution.py
1
8087
# -*- coding: utf-8 -*- """ Name : radcenter_distribution Author : Joan Juvert <trust.no.one.51@gmail.com> Version : 1.0 Description : This script calculates the influence of the distribution of : radiative centers in the active layer on the observed : spectrum. Copyright 2012 J...
gpl-3.0
-2,529,649,230,264,011,300
36.967136
83
0.649808
false
3.451558
false
false
false
linaro-technologies/jobserv
jobserv/storage/local_storage.py
1
3989
# Copyright (C) 2017 Linaro Limited # Author: Andy Doan <andy.doan@linaro.org> import hmac import os import mimetypes import shutil from flask import Blueprint, request, send_file, url_for from jobserv.jsend import get_or_404 from jobserv.models import Build, Project, Run from jobserv.settings import INTERNAL_API_KE...
agpl-3.0
-3,963,570,515,246,286,300
33.094017
79
0.603159
false
3.426976
false
false
false
jadref/buffer_bci
python/echoClient/eventForwarder.py
1
2911
#!/usr/bin/env python3 bufferpath = "../../python/signalProc" fieldtripPath="../../dataAcq/buffer/python" import os, sys, random, math, time, socket, struct sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),bufferpath)) import bufhelp sys.path.append(os.path.join(os.path.dirname(os.path.abspath(_...
gpl-3.0
-8,554,221,728,104,355,000
34.938272
103
0.605634
false
3.602723
false
false
false
ozgurakgun/minion
mini-scripts/testallconstraints.py
1
3983
#!/usr/bin/python # Generate two minion input files, run them then compare dumptree outputs to # detect bugs in constraint propagators. import sys, os, getopt from constraint_test_common import * from multiprocessing import Pool, Manager import random #from sendemail import * import time (optargs, other)=getopt.gnu_...
gpl-2.0
-5,649,680,209,550,508,000
27.654676
152
0.651017
false
3.061491
true
false
false
rabramley/telomere
app/model/batch.py
1
2972
from app import db from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.sql import select, func from app.model.outstandingError import OutstandingError import numpy import decimal class Batch(db.Model): id = db.Column(db.Integer, primary_key=True) robot = db.Column(db.String(20)) temperature ...
mit
7,113,725,852,751,646,000
37.102564
124
0.664536
false
3.580723
false
false
false
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Lib/uu.py
1
6092
#! /usr/bin/env python # Copyright 1994 by Lance Ellinghouse # Cathedral City, California Republic, United States of America. # All Rights Reserved # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # ...
gpl-3.0
8,905,765,275,347,266,000
29.241026
72
0.559094
false
3.732843
false
false
false
jhogg41/gm-o-matic
gom_server/gom_server/urls.py
1
1187
"""gom_server URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
bsd-2-clause
-3,051,245,291,478,614,500
36.09375
83
0.708509
false
3.420749
false
false
false
kevin-coder/tensorflow-fork
tensorflow/python/keras/layers/normalization_test.py
1
22900
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
2,995,893,033,428,413,000
36.115073
80
0.650524
false
3.394101
true
false
false
meisamhe/GPLshared
Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/s2.py
1
1744
import time import threading # @include class SpellCheckService: w_last = closest_to_last_word = None lock = threading.Lock() @staticmethod def service(req, resp): w = req.extract_word_to_check_from_request() result = None with SpellCheckService.lock: if w == Spell...
gpl-3.0
-6,428,526,257,127,913,000
22.567568
76
0.575115
false
3.62578
false
false
false
gypsymauro/gestione-cantiere
build/lib.linux-x86_64-2.7/cantiere/admin.py
1
1533
from django.contrib import admin # Register your models here. from .models import Squadra from .models import StatoSegnalazione from .models import Segnalazione from .models import StatoIntervento from .models import Intervento from .models import Risorsa from .models import InterventoRisorsa from .models import Cost...
gpl-2.0
-2,517,305,136,308,949,000
32.326087
80
0.763862
false
3.200418
false
false
false
SembeiNorimaki/Bioinformatics
EulerianCycle.py
1
1903
# Test passed :) # TODO: split right here before the conditional. import sys def handle_input_output(): # handle input graph = {} while True: try: line = sys.stdin.readline().rstrip('\n') left, right = line.split(' -> ') if left in graph.keys(): ...
mit
-4,300,464,103,968,979,000
33
115
0.553337
false
4.541766
false
false
false
kittiu/account-payment
account_payment_return/models/payment_return.py
1
15028
# Copyright 2011-2012 7 i TRIA <http://www.7itria.cat> # Copyright 2011-2012 Avanzosc <http://www.avanzosc.com> # Copyright 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com> # Copyright 2014 Markus Schneider <markus.schneider@initos.com> # Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> # Copyright 2017 Luis M...
agpl-3.0
5,260,136,324,633,751,000
39.506739
79
0.544118
false
4.058331
false
false
false
dpshelio/sunpy
examples/units_and_coordinates/planet_locations.py
1
1252
""" =================================== Getting the location of the planets =================================== How to get the position of planetary bodies im the solar system using `astropy's solar system ephemeris <http://docs.astropy.org/en/stable/coordinates/solarsystem.html#solar-system-ephemerides>`__ informatio...
bsd-2-clause
-3,296,977,724,421,778,000
42.172414
149
0.615815
false
3.639535
false
false
false
Djimmer/obts
Fuzzer/function_scanner.py
1
6412
#!/usr/bin/python # -*- coding: utf-8 -*- import socket import time import binascii import os import sys from libmich.formats import * import gsm_um import smarter_fuzzer_function_def as fuzzer import itertools from random import randint from math import factorial import logging from pythonjsonlogger import jsonlogger...
agpl-3.0
7,928,618,940,592,154,000
29.980676
102
0.611822
false
3.385428
false
false
false
gyurisc/stackjobs
clean_data.py
1
1758
# Ad-hoc fixing of mongo database from datetime import datetime import pymongo client = pymongo.MongoClient('localhost', 27017) db = client['stackoverflow'] jobs = db['jobs'] # total jobs total_jobs = jobs.count() print "Total jobs: %s" % total_jobs print "=== Fixing Date Stamp ===" date_stamp = datetime(2016, 6, ...
mit
6,723,297,113,947,829,000
31.555556
93
0.610353
false
3.106007
false
false
false
rodo/ansible-tsung
ec2tool.py
1
5117
#!/usr/bin/env python import boto.ec2 import jinja2 import sys import json import yaml class Tsing(boto.ec2.instance.Instance): def shortname(self): return self.private_dns_name.split('.')[0] @property def private_short_name(self): return self.private_dns_name.split('.')[0] def get_spe...
gpl-3.0
6,011,133,720,753,712,000
24.713568
112
0.560876
false
3.737765
false
false
false
nemesisdesign/openwisp2
openwisp_controller/config/controller/views.py
1
14788
import json from ipaddress import ip_address from django.core.exceptions import FieldDoesNotExist, ValidationError from django.db import transaction from django.db.models import Q from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.generic.base im...
gpl-3.0
6,931,061,912,724,383,000
35.78607
88
0.61719
false
4.388131
true
false
false
pinax/pinax-blog
pinax/blog/admin.py
1
3056
from functools import partial as curry from django.contrib import admin from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from pinax.images.admin import ImageInline from pinax.images.models import ImageSet from .conf import settings from .forms import AdminPostForm from .model...
mit
7,357,990,425,241,163,000
29.56
97
0.659359
false
3.690821
false
false
false
roberthodgen/thought-jot
src/utilities.py
1
2732
""" The MIT License (MIT) Copyright (c) 2015 Robert Hodgen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge...
mit
7,328,222,909,209,888,000
34.025641
80
0.712299
false
3.91404
false
false
false
quokkaproject/quokka-classes
pipelines.py
1
2318
# coding: utf-8 from flask import request from quokka.modules.cart.pipelines.base import CartPipeline from quokka.utils import get_current_user from .models import CourseSubscription, Subscriber class SetSubscriber(CartPipeline): def process(self): name = request.form.get("name") email = request...
mit
7,357,983,847,842,146,000
33.088235
78
0.572045
false
4.23766
false
false
false
walshjon/openmc
openmc/region.py
1
18303
from abc import ABCMeta, abstractmethod from collections import OrderedDict from collections.abc import Iterable, MutableSequence from copy import deepcopy import numpy as np from openmc.checkvalue import check_type class Region(metaclass=ABCMeta): """Region of space that can be assigned to a cell. Region ...
mit
-4,142,554,628,031,096,300
30.233788
90
0.543845
false
4.538309
false
false
false
squilter/ardupilot
Tools/autotest/arduplane.py
1
85180
#!/usr/bin/env python # Fly ArduPlane in SITL from __future__ import print_function import math import os import time from pymavlink import quaternion from pymavlink import mavutil from common import AutoTest from common import AutoTestTimeoutException from common import NotAchievedException from common import Preco...
gpl-3.0
-238,449,084,716,790,980
38.840973
161
0.547441
false
3.816308
true
false
false
akinaru/ffmpeg-image-sequencer
ffmpeg-appender-test.py
1
3157
#!/usr/bin/python ##################################################################################### ##################################################################################### # # title : ffmpeg-appender-test.py # authors : Bertrand Martel # copyrights : Copyright (c) 2015 Bertrand Martel # li...
mit
-8,222,219,400,538,782,000
30.58
193
0.602471
false
3.095098
false
false
false
csangani/ReproducingSprout
extract_traces.py
1
1317
## Create a network trace from the saturator output import glob import os import sys INPUT_PATH = 'raw_traces' OUTPUT_PATH = 'cleaned_traces' def extract_trace(filePath, targetFilePath): with open(filePath) as f: with open(targetFilePath, 'w+') as wf: firstLine = True for line in ...
mit
-2,875,549,895,375,812,000
27.630435
89
0.535308
false
4.115625
false
false
false
meshulam/sly
deps/shapely/geos.py
1
25191
""" Proxies for the libgeos_c shared lib, GEOS-specific exceptions, and utilities """ import os import re import sys import atexit import logging import threading from ctypes import CDLL, cdll, pointer, c_void_p, c_size_t, c_char_p, string_at from ctypes.util import find_library from . import ftools from .ctypes_decl...
mit
9,089,816,898,955,361,000
32.277411
79
0.596403
false
3.756487
false
false
false
philipgian/pre-commit
tests/make_archives_test.py
1
1979
from __future__ import absolute_import from __future__ import unicode_literals import os.path import tarfile import mock import pytest from pre_commit import make_archives from pre_commit.util import cmd_output from pre_commit.util import cwd from testing.fixtures import git_dir from testing.util import get_head_sha...
mit
-4,190,765,153,830,089,700
29.921875
71
0.656897
false
3.417962
true
false
false
slimta/python-slimta
slimta/util/__init__.py
1
4971
# Copyright (c) 2016 Ian C. Good # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
mit
1,704,426,083,830,367,700
36.097015
79
0.662442
false
4.028363
false
false
false
Azure/azure-sdk-for-python
sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/aio/_configuration.py
1
3204
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-890,126,408,029,941,400
47.545455
134
0.682272
false
4.506329
true
false
false
jeromecc/doctoctocbot
src/crowdfunding/migrations/0013_tiers.py
1
1118
# Generated by Django 2.0.13 on 2019-02-25 05:21 from decimal import Decimal from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('crowdfunding', '0012_auto_20190224_0523'), ] operations = [ migrations.CreateM...
mpl-2.0
-3,936,454,583,790,252,500
38.928571
119
0.601073
false
4.007168
false
false
false
yanni4night/ursa-django
app/settings.py
1
2208
""" Django settings for ursa-django project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
mit
2,840,151,740,766,177,000
24.988235
84
0.717391
false
3.190751
false
false
false
iotaledger/iota.lib.py
iota/multisig/commands/prepare_multisig_transfer.py
1
5102
from typing import List, Optional import filters as f from iota import Address, ProposedTransaction from iota.commands import FilterCommand, RequestFilter from iota.commands.core import GetBalancesCommand from iota.exceptions import with_context from iota.filters import Trytes from iota.multisig.transaction import Pr...
mit
-2,375,090,809,166,574,000
35.971014
83
0.488828
false
5.232821
false
false
false
alexis-roche/nipy
nipy/testing/__init__.py
2
1369
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The testing directory contains a small set of imaging files to be used for doctests only. More thorough tests and example data will be stored in a nipy data packages that you can download separately. ....
bsd-3-clause
-6,188,143,799,394,715,000
26.38
73
0.723156
false
3.413965
true
false
false
openstack/mistral
mistral/api/controllers/v2/execution.py
1
17181
# Copyright 2013 - Mirantis, Inc. # Copyright 2015 - StackStorm, Inc. # Copyright 2015 Huawei Technologies Co., Ltd. # Copyright 2016 - Brocade Communications Systems, Inc. # Copyright 2018 - Extreme Networks, Inc. # Copyright 2019 - NetCracker Technology Corp. # # Licensed under the Apache License, Version 2.0 (the...
apache-2.0
-1,259,276,599,923,299,800
37.436242
79
0.569117
false
4.408776
false
false
false
kgullikson88/TS23-Scripts
CheckSyntheticTemperature.py
1
14868
import os import re from collections import defaultdict from operator import itemgetter import logging import pandas from scipy.interpolate import InterpolatedUnivariateSpline as spline from george import kernels import matplotlib.pyplot as plt import numpy as np import george import emcee import StarData import Spect...
gpl-3.0
-920,756,524,181,589,000
39.402174
120
0.625572
false
3.54
false
false
false
MattDevo/edk2
BaseTools/Source/Python/Workspace/MetaFileTable.py
1
16975
## @file # This file is used to create/update/query/erase a meta file table # # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribu...
bsd-2-clause
8,104,280,331,112,390,000
36.492063
155
0.544035
false
3.958722
false
false
false
ssharpjr/taskbuster-boilerplate
taskbuster/apps/taskmanager/models.py
1
2262
# -*- coding: utf-8 -*- from django.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.dispatch import receiver from django.db.models.signals import post_save from django.core.validators import RegexValidator from . import managers class Profile(mode...
mit
2,343,749,543,026,243,000
25
69
0.599912
false
4.097826
false
false
false
CitoEngine/cito_engine
app/cito_engine/actions/json_formatter.py
1
1266
"""Copyright 2014 Cyrus Dasadia Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distr...
apache-2.0
1,861,107,108,582,375,000
47.730769
120
0.756714
false
4.044728
false
false
false
quantumlib/Cirq
dev_tools/profiling/benchmark_serializers.py
1
4296
# Copyright 2020 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
1,166,759,302,246,157,000
33.368
98
0.64176
false
3.458937
false
false
false
Chetox/RCode
Cannon_Avanzado/client.py
1
2002
#!/usr/bin/python # -*- coding:utf-8; tab-width:4; mode:python -*- import sys import Ice Ice.loadSlice('-I {} cannon.ice'.format(Ice.getSliceDir())) import Cannon import time from matrix_utils import matrix_multiply def load_matrix_from_file(filename): with file(filename) as f: rows = f.readlines() ...
apache-2.0
-3,968,228,681,157,256,000
25.342105
82
0.586414
false
3.260586
false
false
false
bitcraze/crazyflie-lib-python
test/crtp/test_crtpstack.py
1
2875
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) Bitcraze AB # # Crazyfl...
gpl-2.0
3,989,698,133,982,647
26.644231
79
0.575652
false
3.394333
true
false
false
csixteen/HackerRank_Python
Algorithms/magic_square.py
1
1071
class Solution(object): MAGIC_SQUARES = [ [4, 9, 2, 3, 5, 7, 8, 1, 6], [2, 9, 4, 7, 5, 3, 6, 1, 8], [8, 3, 4, 1, 5, 9, 6, 7, 2], [4, 3, 8, 9, 5, 1, 2, 7, 6], [6, 1, 8, 7, 5, 3, 2, 9, 4], [8, 1, 6, 3, 5, 7, 4, 9, 2], [6, 7, 2, 1, 5, 9, 8, 3, 4], [2, 7, ...
mit
-3,675,657,614,335,557,600
32.46875
77
0.459384
false
2.428571
true
false
false
alexpap/exareme
exareme-tools/madis/src/functionslocal/aggregate/approximatedmedian.py
1
2110
import inspect import math import random import numpy from fractions import Fraction import sys import json from array import * class approximatedmedian: registered = True #Value to define db operator def __init__(self): self.n = 0 self.totalnums = 0 self.numberofcolumns = 5 ...
mit
-1,993,861,639,533,290,000
23.823529
123
0.572512
false
3.675958
false
false
false
fishtown-analytics/dbt
test/integration/041_presto_test/test_simple_presto_view.py
1
2230
from test.integration.base import DBTIntegrationTest, FakeArgs, use_profile import random import time class TestBasePrestoRun(DBTIntegrationTest): @property def schema(self): return "presto_test_41" @property def models(self): return "models" @property def project_config(sel...
apache-2.0
3,608,262,232,624,162,000
27.961039
77
0.583857
false
3.891798
true
false
false
nihlaeth/Nagios_check_slackpkg
check_slackpkg_nonpriv.py
1
1673
#!/usr/bin/env python """Nagios module for monitoring available updates via slackpkg.""" import subprocess import sys import os # pylint: disable=invalid-name # run check-updates to poll mirror for changes result = [] try: result = subprocess.check_output("myslackpkg check-updates", shell=True).split("\n") excep...
gpl-3.0
4,253,797,037,185,081,000
27.355932
88
0.654513
false
3.529536
false
false
false
haphaeu/yoshimi
sql/data_analysis/database.py
1
3122
from os import path from sqlalchemy import (create_engine, Column, String, Integer, Boolean, Table, ForeignKey) from sqlalchemy.orm import sessionmaker, relationship from sql...
lgpl-3.0
5,123,633,034,681,498,000
29.271845
95
0.626042
false
3.907268
false
false
false
EnceladOnline/interfaX
icon.py
1
1967
from tkinter import * from tkinter import ttk import func class Icon: def __init__(self, main, icon): # Affiche les icon sur le tab self.main = main self.master = self.main.cache["CurrentTabID"] self.icon = icon if self.icon[1][1] == None: self.icon_label() else: self.icon_image() ...
gpl-2.0
-8,296,808,383,988,564,000
22.987805
84
0.654629
false
2.788652
false
false
false
wilkinsg/piweb
watched.py
1
2615
#!/usr/bin/python import hash import os import config import video_info watched_cache = {} def prepwatched( conn ): global watched_cache result = conn.execute( "SELECT * FROM history" ) queueitem = result.fetchone() while( queueitem ): watched_cache[ queueitem[ 0 ] ] = True queueitem ...
mit
3,103,893,710,333,927,000
30.130952
109
0.559465
false
3.70922
false
false
false
yangl1996/libpagure
tests/test_api.py
1
12568
import pytest from libpagure import Pagure @pytest.fixture(scope='module') def simple_pg(): """ Create a simple Pagure object to be used in test """ pg = Pagure(pagure_repository="testrepo") return pg def test_pagure_object(): """ Test the pagure object creation """ pg = Pagure(pagure_...
gpl-2.0
1,007,721,609,211,840,800
38.898413
87
0.647279
false
3.289191
true
false
false
nixingyang/Kaggle-Competitions
TalkingData AdTracking Fraud Detection/perform_ensembling.py
1
2489
import os import glob import shutil import datetime import numpy as np import pandas as pd # Dataset PROJECT_NAME = "TalkingData AdTracking Fraud Detection" PROJECT_FOLDER_PATH = os.path.join(os.path.expanduser("~"), "Documents/Dataset", PROJECT_NAME) # Submission TEAM_NAME = "Auror...
mit
-8,510,683,944,066,425,000
36.712121
80
0.659703
false
3.409589
false
false
false
flennerhag/mlens
mlens/externals/sklearn/validation.py
1
27114
""" Scikit-learn utilities for input validation. """ # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD 3 clause import warnings import numbers import numpy as np import scipy.sparse as sp...
mit
4,532,605,231,950,397,000
39.050222
79
0.615328
false
4.181678
false
false
false
gregelin/python-ideascaleapi
setup.py
1
1086
from distutils.core import setup from ideascaleapi import __version__,__license__,__doc__ license_text = open('LICENSE').read() long_description = open('README.rst').read() setup(name="python-ideascaleapi", version=__version__, py_modules=["ideascaleapi"], description="Libraries for interacting with...
bsd-3-clause
1,815,907,163,226,902,500
39.222222
82
0.593923
false
4.414634
false
false
false
marekjm/diaspy
diaspy/models.py
1
23071
#!/usr/bin/env python3 """This module is only imported in other diaspy modules and MUST NOT import anything. """ import json import copy import re BS4_SUPPORT=False try: from bs4 import BeautifulSoup except ImportError: print("[diaspy] BeautifulSoup not found, falling back on regex.") else: BS4_SUPPORT=True fro...
mit
5,489,278,063,691,003,000
30.954294
146
0.653158
false
3.203416
false
false
false
matousc89/padasip
padasip/filters/nlmf.py
1
5444
""" .. versionadded:: 1.1.0 The least-mean-fourth (LMF) adaptive filter implemented according to the paper :cite:`zerguine2000convergence`. The NLMF is an extension of the LMF adaptive filter (:ref:`filter-lmf`). The NLMF filter can be created as follows >>> import padasip as pa >>> pa.filters.FilterNLMF(n) ...
mit
-1,379,382,755,198,736,400
28.586957
81
0.568883
false
3.55817
false
false
false
tachijuan/python
myscripts/imap.py
1
1470
import os, sys, imaplib, rfc822, re, StringIO import RPi.GPIO as GPIO import time server ='mail.xxx.us' username='juan@xxx.us' password='xxx' GPIO.setmode(GPIO.BOARD) GREEN_LED = 22 RED_LED = 7 GPIO.setup(GREEN_LED, GPIO.OUT) GPIO.setup(RED_LED, GPIO.OUT) M = imaplib.IMAP4_SSL(server) M.login(username, password)...
mit
-6,482,561,999,222,598,000
21.96875
65
0.535374
false
3.230769
false
false
false
LevinJ/Supply-demand-forecasting
implement/xgboostmodel.py
1
4070
import sys import os sys.path.insert(0, os.path.abspath('..')) from preprocess.preparedata import PrepareData import numpy as np from utility.runtype import RunType from utility.datafilepath import g_singletonDataFilePath from preprocess.splittrainvalidation import HoldoutSplitMethod import xgboost as xgb from evaluat...
mit
3,712,276,902,335,813,600
43.736264
187
0.629975
false
3.327882
false
false
false
Censio/filterpy
filterpy/common/tests/test_discretization.py
1
2566
# -*- coding: utf-8 -*- """Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for mor...
mit
-1,838,436,546,280,924,000
21.716814
75
0.464147
false
2.560878
false
false
false
boada/planckClusters
MOSAICpipe/bpz-1.99.3/prior_full.py
1
3446
from __future__ import print_function from __future__ import division from past.utils import old_div from useful import match_resol import numpy import sys # Hacked to use numpy and avoid import * commands # FM Float = numpy.float less = numpy.less def function(z, m, nt): """HDFN prior for the main six types of ...
mit
-3,085,104,049,551,145,000
31.819048
79
0.492455
false
2.732752
false
false
false
selboo/starl-mangle
webvirtmgr/dashboard/views.py
1
5187
from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.template import RequestContext from django.utils.datastructures import SortedDict from instance.models import Host from webvirtmgr.server import ConnServer from dashboard.forms import HostAddTcpForm, HostAddSshForm ...
apache-2.0
1,696,039,395,362,939,000
31.829114
113
0.508965
false
4.639535
false
false
false
anntzer/scikit-learn
sklearn/linear_model/_passive_aggressive.py
2
17363
# Authors: Rob Zinkov, Mathieu Blondel # License: BSD 3 clause from ..utils.validation import _deprecate_positional_args from ._stochastic_gradient import BaseSGDClassifier from ._stochastic_gradient import BaseSGDRegressor from ._stochastic_gradient import DEFAULT_EPSILON class PassiveAggressiveClassifier(BaseSGDCl...
bsd-3-clause
-4,979,293,226,387,037,000
35.942553
79
0.607153
false
4.177815
false
false
false
vit-/telegram-uz-bot
uz/tests/interface/telegram/test_bot.py
1
5489
import time from datetime import datetime import mock import pytest from uz.tests import Awaitable from uz.interface.telegram import bot from uz.scanner import UknkownScanID CHAT_ID = 'chat_id' def tg_message(text): return { 'chat': { 'id': CHAT_ID, 'type': 'private', ...
mit
5,860,053,250,814,065,000
33.522013
99
0.635817
false
3.4072
true
false
false
CityofPittsburgh/pittsburgh-purchasing-suite
migrations/versions/31d29fbffe44_add_passwords_for_users.py
1
1988
"""add passwords for users Revision ID: 31d29fbffe44 Revises: 48c578b852fa Create Date: 2016-01-20 23:33:36.893832 """ # revision identifiers, used by Alembic. revision = '31d29fbffe44' down_revision = '48c578b852fa' import random from flask_security.utils import encrypt_password from alembic import op import sqla...
bsd-3-clause
-1,728,439,714,103,357,000
36.509434
96
0.686117
false
3.23252
false
false
false
miracle2k/stgit
stgit/commands/delete.py
1
3073
__copyright__ = """ Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be...
gpl-2.0
-8,761,710,056,651,811,000
38.397436
76
0.664497
false
4.147099
false
false
false
FedoraScientific/salome-smesh
src/Tools/blocFissure/CasTests/fissure_Coude_4.py
1
3081
# -*- coding: utf-8 -*- from fissure_Coude import fissure_Coude class fissure_Coude_4(fissure_Coude): """ probleme de fissure du Coude : ASCOU09A adaptation maillage """ # --------------------------------------------------------------------------- def setParamGeometrieSaine(self): """ Paramètres g...
lgpl-2.1
-4,575,732,381,039,616,000
41.068493
102
0.370563
false
4.230028
false
false
false
davidwilson-85/easymap
graphic_output/Pillow-4.2.1/Tests/test_file_wmf.py
1
1215
from helper import unittest, PillowTestCase, hopper from PIL import Image class TestFileWmf(PillowTestCase): def test_load_raw(self): # Test basic EMF open and rendering im = Image.open('Tests/images/drawing.emf') if hasattr(Image.core, "drawwmf"): # Currently, support for WM...
gpl-3.0
-6,634,027,561,541,816,000
30.973684
66
0.584362
false
3.75
true
false
false
abrt/faf
src/pyfaf/storage/migrations/versions/a2b6d12819f9_drop_yum_type.py
1
2158
# Copyright (C) 2019 ABRT Team # Copyright (C) 2019 Red Hat, Inc. # # This file is part of faf. # # faf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) ...
gpl-3.0
894,444,310,800,265,600
30.735294
71
0.696015
false
3.284627
false
false
false
lucius-feng/tg2
tests/test_middlewares.py
2
3091
from webtest import TestApp from tg.support.middlewares import StatusCodeRedirect from tg.support.middlewares import DBSessionRemoverMiddleware from tg.support.middlewares import MingSessionRemoverMiddleware def FakeApp(environ, start_response): if environ['PATH_INFO'].startswith('/error'): start_response...
mit
-5,575,966,756,473,490,000
25.646552
91
0.619864
false
3.697368
true
false
false
cloud-fan/spark
python/pyspark/pandas/data_type_ops/base.py
1
12265
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
8,822,871,887,076,614,000
39.081699
100
0.658296
false
3.882558
false
false
false
MTK6580/walkie-talkie
ALPS.L1.MP6.V2_HEXING6580_WE_L/alps/build/tools/releasetools/img_from_target_files.py
1
4926
#!/usr/bin/env python # # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
gpl-3.0
3,824,091,379,033,798,000
29.407407
78
0.634592
false
3.603511
false
false
false
JKarathiya/Lean
Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py
1
5416
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Licen...
apache-2.0
1,143,300,330,185,993,500
45.299145
175
0.694978
false
4.069121
false
false
false
Johnzero/erp
openerp/addons/clivia_analysis/report/analysis_report.py
1
2399
# -*- encoding: utf-8 -*- import tools from osv import fields, osv class common_report(osv.osv): _name = "clivia_analysis.production_report" _description = "报表视图" _auto = False _rec_name = 'date' _columns = { 'year': fields.char('年份', size=4, readonly=True), 'month': fie...
agpl-3.0
-2,405,913,437,995,879,000
43.803922
96
0.570241
false
3.204769
false
false
false
CN-UPB/OpenBarista
components/decaf-masta/decaf_masta/components/database/datacenter.py
1
1976
## # Copyright 2016 DECaF Project Group, University of Paderborn # This file is part of the decaf orchestration framework # All Rights Reserved. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at htt...
mpl-2.0
-113,731,610,094,640,820
41.06383
97
0.695344
false
4.074227
false
false
false
airodactyl/qutebrowser
tests/helpers/stubs.py
1
16414
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
gpl-3.0
5,947,849,121,296,085,000
24.88959
79
0.61277
false
4.021068
false
false
false
googleapis/python-essential-contacts
google/cloud/essential_contacts_v1/services/essential_contacts_service/client.py
1
36542
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
6,529,256,094,567,324,000
41.540163
111
0.617946
false
4.636721
false
false
false
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/cc1/src/wi/views/user/user.py
1
7236
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
apache-2.0
6,534,912,669,814,899,000
35.913265
119
0.634969
false
3.942779
false
false
false
mahim97/zulip
zerver/webhooks/github_webhook/tests.py
5
21928
from typing import Dict, Optional, Text import ujson from mock import MagicMock, patch from zerver.lib.test_classes import WebhookTestCase from zerver.lib.webhooks.git import COMMITS_LIMIT from zerver.models import Message class GithubWebhookTest(WebhookTestCase): STREAM_NAME = 'github' URL_TEMPLATE = "/api/...
apache-2.0
8,828,503,967,933,125,000
78.162455
387
0.727107
false
3.066853
true
false
false
atztogo/spglib
python/test/test_collinear_spin.py
1
1335
import unittest import numpy as np from spglib import get_symmetry class TestGetSymmetry(unittest.TestCase): def setUp(self): lattice = [[4, 0, 0], [0, 4, 0], [0, 0, 4]] positions = [[0, 0, 0], [0.5, 0.5, 0.5]] numbers = [1, 1] magmoms = [0, 0] self._cell = (lattice, posit...
bsd-3-clause
1,407,334,135,078,816,500
30.046512
72
0.580524
false
3.186158
true
false
false
aalien/subtitle2spu
parsesrt.py
1
1661
# Copyright (C) 2008 Antti Laine <antti.a.laine@tut.fi> # # This file is part of subtitle2spu. # # subtitle2spu is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
mit
7,590,266,957,127,908,000
29.759259
73
0.584588
false
4.081081
false
false
false
soscpd/bee
root/tests/zguide/examples/Python/mdcliapi.py
1
3030
"""Majordomo Protocol Client API, Python version. Implements the MDP/Worker spec at http:#rfc.zeromq.org/spec:7. Author: Min RK <benjaminrk@gmail.com> Based on Java example by Arkadiusz Orzechowski """ import logging import zmq import MDP from zhelpers import dump class MajorDomoClient(object): """Majordomo P...
mit
8,947,509,223,582,141,000
28.705882
90
0.553465
false
4.297872
false
false
false
scholer/cadnano2.5
cadnano/strand/modscmd.py
2
1922
from cadnano.proxies.cnproxy import UndoCommand from cadnano.cntypes import ( DocT, StrandT ) class AddModsCommand(UndoCommand): def __init__(self, document: DocT, strand: StrandT, idx: int, mod_id: str): super(AddModsCommand, self).__init__() self._strand = strand self._id_num = st...
mit
6,883,323,475,434,581,000
28.121212
79
0.596254
false
3.469314
false
false
false
maxlikely/scikit-learn
sklearn/datasets/svmlight_format.py
1
13250
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
bsd-3-clause
8,683,822,834,947,362,000
37.184438
79
0.644604
false
3.855106
false
false
false
jorgenkg/python-neural-network
nimblenet/cost_functions.py
1
1632
import numpy as np import math def sum_squared_error( outputs, targets, derivative=False ): if derivative: return outputs - targets else: return 0.5 * np.mean(np.sum( np.power(outputs - targets,2), axis = 1 )) #end cost function def hellinger_distance( outputs, targets, derivative=False ): ...
bsd-2-clause
-7,239,579,203,085,241,000
30.403846
106
0.645221
false
3.602649
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/enums/types/negative_geo_target_type.py
1
1192
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-6,885,534,629,699,815,000
28.8
74
0.692953
false
4
false
false
false
mvaled/sentry
src/sentry/south_migrations/0326_auto__add_field_groupsnooze_count__add_field_groupsnooze_window__add_f.py
1
116733
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'GroupSnooze.count' db.add_column( 'sentry_grou...
bsd-3-clause
-7,866,482,563,248,466,000
35.812677
120
0.398756
false
4.709444
false
false
false
tazo90/lux
setup.py
1
1994
import os import json from setuptools import setup, find_packages package_name = 'lux' def read(name): root_dir = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(root_dir, name), 'r') as f: return f.read() def run(): install_requires = [] dependency_links = [] pkg = ...
bsd-3-clause
-8,769,033,512,469,859,000
31.16129
64
0.516048
false
4.573394
false
false
false
Robbie1977/TGscripts
plJHwarpToTemplate.py
1
8574
import os, re, shutil, subprocess, datetime, socket ba = '/groups/sciserv/flyolympiad/vnc_align/toolkit/JBA/brainaligner' cmtkdir = '/usr/local/cmtk/bin/' fiji = '/usr/local/Fiji/ImageJ-linux64' Rawconv = '~/script/raw2nrrdCrop.ijm' Nrrdconv = '~/script/nrrd2rawUncrop.ijm' Tfile = '~/template/flyVNCtemp...
mit
-6,054,312,207,964,567,000
52.265823
328
0.515512
false
3.831099
false
false
false
tartopum/Lactum
setup.py
1
1422
import os import sys from setuptools import setup from setuptools.command.test import test as TestCommand import lactum class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): ...
mit
268,804,563,701,314,200
24.392857
107
0.631505
false
3.618321
true
false
false
funkring/fdoo
addons-funkring/at_sale_layout_ext/sale.py
1
1573
# -*- coding: utf-8 -*- ############################################################################# # # Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
agpl-3.0
-4,435,612,682,991,795,700
37.365854
146
0.613477
false
3.893564
false
false
false
kmpf/uap
tools/segemehl_2017_reformatCigar.py
1
4801
#!/bin/bash "exec" "`dirname $0`/../python_env/bin/python" "$0" "$@" #"exec" "python" "$0" "$@" # ^^^ # the cmd above ensures that the correct python environment is # selected to execute this script. # The correct environment is the one belonging to uap, since all # neccessary python modules are installed there. # f...
gpl-3.0
6,380,944,447,513,988,000
27.076023
82
0.531764
false
3.762539
false
false
false
elewis33/doorstop
doorstop/server/utilities.py
1
1176
"""Shared functions for the `doorstop.server` package.""" from doorstop import common from doorstop import settings log = common.logger(__name__) class StripPathMiddleware(object): # pylint: disable=R0903 """WSGI middleware that strips trailing slashes from all URLs.""" def __init__(self, app): s...
lgpl-3.0
-7,028,435,530,194,350,000
27.682927
69
0.617347
false
3.78135
false
false
false
mtholder/taxalotl
taxalotl/parsing/col.py
1
5000
from __future__ import print_function import io import logging from peyutil import shorter_fp_form from taxalotl.resource_wrapper import TaxonomyWrapper from taxalotl.parsing.darwin_core import normalize_darwin_core_taxonomy _LOG = logging.getLogger(__name__) COL_PARTMAP = { 'Archaea': frozenset([52435722]), ...
bsd-2-clause
700,893,670,152,985,700
36.313433
99
0.61
false
3.531073
false
false
false
roglew/pappy-proxy
pappyproxy/interface/decode.py
1
10668
import html import base64 import datetime import gzip import shlex import string import urllib from ..util import hexdump, printable_data, copy_to_clipboard, clipboard_contents, encode_basic_auth, parse_basic_auth from ..console import CommandError from io import StringIO def print_maybe_bin(s): binary = False ...
mit
-4,319,996,795,967,323,600
31.723926
118
0.624953
false
3.587088
false
false
false
pycontw/pycontw2016
src/proposals/migrations/0038_add_new_conference.py
1
1404
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2019-07-10 07:36 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('proposals', '0037_auto_20180305_1339'), ] operations = [ migrations.AlterFi...
mit
-1,369,078,986,699,272,400
45.8
252
0.625356
false
3.572519
false
false
false
zzh8829/RevOctane
bstream.py
1
3007
import io import struct little_endian_types = { 'int8': 'b', 'uint8': 'B', 'int16': 'h', 'uint16': 'H', 'int32': 'i', 'uint32': 'I', 'int64': 'q', 'uint64': 'Q', 'float': 'f', 'float32': 'f', 'double': 'd', 'char': 'c', 'bool': '?', 'pad': 'x', 'void*': 'P', } big_endian_types = { k:">"+v for k,v in li...
mit
-8,549,833,761,040,858,000
21.954198
84
0.60858
false
2.628497
false
false
false
avedaee/DIRAC
DataManagementSystem/Client/ReplicaContainers.py
1
4513
# $HeadURL$ __RCSID__ = "$Id$" """ This module contains three classes associated to Replicas. The Replica class contains simply three member elements: SE, PFN and Status and provides access methods for each (inluding type checking). The CatalogReplica class inherits the Replica class. The PhysicalReplica...
gpl-3.0
2,198,887,395,661,303,000
31.007092
143
0.670286
false
3.484942
false
false
false
erikrose/oedipus
oedipus/results.py
1
4275
class SearchResults(object): """Results in the order in which they came out of Sphinx Since Sphinx stores no non-numerical attributes, we have to reach into the DB to pull them out. """ def __init__(self, type, ids, fields): self.type = type # Sphinx may return IDs of objects since...
bsd-3-clause
2,535,138,606,245,989
39.330189
99
0.629474
false
4.309476
false
false
false
arjunasuresh3/Mypykoans
python 2/koans/about_monkey_patching.py
1
1451
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Related to AboutOpenClasses in the Ruby Koans # from runner.koan import * class AboutMonkeyPatching(Koan): class Dog(object): def bark(self): return "WOOF" def test_as_defined_dogs_do_bark(self): fido = self.Dog() self...
mit
6,103,702,846,106,463,000
29.229167
92
0.500345
false
3.710997
false
false
false
tedlaz/pyted
misthodosia/m13a/fmy.py
1
2802
# -*- coding: utf-8 -*- ''' Created on 16 Ιαν 2013 @author: tedlaz ''' from utils import dec as d def f13(poso): poso = d(poso) ekp = d(0) if poso < d(21500): ekp = d(2100) elif poso < d(22500): ekp = d(2000) elif poso < d(23500): ekp = d(1900) el...
gpl-3.0
-9,046,916,456,819,823,000
21.389831
83
0.451414
false
2.532599
false
false
false
Sorsly/subtle
google-cloud-sdk/platform/gsutil/third_party/apitools/run_pylint.py
3
8173
# # Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
mit
-4,517,023,543,270,012,400
34.534783
78
0.650679
false
3.916148
true
false
false