repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
shermp/KoboPatchGUI
KoboPatchGUI-Qt.py
1
6014
from __future__ import absolute_import, division, print_function, unicode_literals import sys from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QMessageBox, QFileDialog, QGridLayout, QHBoxLayout, \ QVBoxLayout, QGroupBox, QCheckBox, QPushButton, QAction from PatchEdit impor...
mit
-5,367,440,613,728,030,000
39.362416
119
0.568507
false
uclouvain/OSIS-Louvain
features/steps/4_offer_create.py
1
4004
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business i...
agpl-3.0
1,447,403,276,842,002,000
33.66087
114
0.664325
false
bitmazk/django-good-practice-examples
setup.py
1
1406
import os from setuptools import setup, find_packages import good_practice_examples as app def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except IOError: return '' dependency_links = [ # needs this dev version for django 1.6 fixes 'https://gi...
mit
3,057,689,463,573,379,000
25.528302
113
0.630156
false
mikf/gallery-dl
gallery_dl/extractor/fuskator.py
1
3698
# -*- coding: utf-8 -*- # Copyright 2019 Mike Fährmann # # 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. """Extractors for https://fuskator.com/""" from .common import GalleryExtrac...
gpl-2.0
-1,757,798,254,109,801,000
32.609091
79
0.526102
false
th0mmeke/toyworld
evaluators/evaluator_summary.py
1
5124
""" Created on 6/05/2013 @author: thom """ import logging import string from rdkit.Chem import AllChem as Chem from evaluator import Evaluator from molecular_population import MolecularPopulation from molecule import Molecule class EvaluatorSummary(Evaluator): def get_result_titles(self): return ["N...
gpl-3.0
-1,521,660,417,054,161,000
52.375
187
0.667642
false
khchine5/opal
opal/tests/test_utils.py
1
2258
""" Unittests for opal.utils """ import sys from django.test import TestCase from django.db.models import ForeignKey, CharField from mock import patch from opal.core.test import OpalTestCase from opal import utils class StringportTestCase(TestCase): def test_import(self): import collections sel...
agpl-3.0
-6,125,883,704,473,643,000
26.536585
89
0.624004
false
google/pyaedj
toybox/server_py3/services.py
1
25101
"""Google Service API classes.""" __author__ = 'Pavel Simakov (psimakov@google.com)' import datetime import logging import time from dateutil import parser from googleapiclient import discovery from googleapiclient import errors import pytz from google.cloud import datastore RFC3339_FORMAT = '%Y-%m-%dT%H:%M:%SZ' ...
apache-2.0
2,540,605,812,666,808,000
28.811164
80
0.601888
false
nicko96/Chrome-Infra
appengine/sheriff_o_matic/alerts_test.py
1
12204
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import alerts import json import random import string import unittest import webtest from google.appengine.api import memcache from google.appengine.ext imp...
bsd-3-clause
-6,555,059,398,003,625,000
38.367742
75
0.657981
false
simone-campagna/invoice
tests/unittests/test_invoice_main_stats.py
1
21684
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # 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
-9,157,242,641,952,579,000
46.331878
145
0.580819
false
zasdfgbnm/qutip
qutip/testing.py
1
2011
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
bsd-3-clause
1,679,851,902,602,152,400
48.04878
79
0.702138
false
1tush/reviewboard
reviewboard/webapi/resources/original_file.py
1
1231
from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from djblets.webapi.errors import DOES_NOT_EXIST from reviewboard.webapi.resources import resources from reviewboard.webapi.resources.base_original_file import \ BaseOriginalFileResource class OriginalFileResource(Base...
mit
5,970,009,686,491,379,000
34.171429
78
0.665313
false
acsone/social
mail_notification_email_template/tests/test_mail_notification_email_template.py
1
1446
# -*- coding: utf-8 -*- # © 2016 Therp BV <http://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from mock import patch from openerp.tests.common import TransactionCase class TestMailNotificationEmailTemplate(TransactionCase): def test_mail_notification_email_template(self): ...
agpl-3.0
7,269,480,362,367,015,000
44.15625
74
0.629758
false
rgayon/plaso
tests/parsers/symantec.py
1
2461
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the Symantec AV Log parser.""" from __future__ import unicode_literals import unittest from plaso.parsers import symantec from tests.parsers import test_lib class SymantecAccessProtectionUnitTest(test_lib.ParserTestCase): """Tests for the Symantec AV L...
apache-2.0
9,222,442,156,667,044,000
31.813333
71
0.672085
false
md384/media-reminder
mediadownloader/subtitles/open_subtitles.py
1
3048
import io import os import struct import urllib.request import zipfile from xmlrpc.client import ServerProxy from mediadownloader.subtitles.base_subtitles import BaseSubtitles class OpenSubtitles(BaseSubtitles): OPENSUBTITLES_SERVER = 'http://api.opensubtitles.org/xml-rpc' USER_AGENT = 'OSTestUserAgentTemp'...
mit
172,992,296,251,005,380
34.858824
107
0.580052
false
USGSDenverPychron/pychron
pychron/experiment/tests/renumber_aliquot_test.py
1
1352
from pychron.experiment.utilities.aliquot_numbering import renumber_aliquots __author__ = 'ross' import unittest class MockRun(object): def __init__(self, l, uda, pos): self.labnumber = l self.user_defined_aliquot = uda self.position = pos class RenumberAliquotTestCase(unittest.TestCas...
apache-2.0
7,288,132,062,111,747,000
26.591837
76
0.485207
false
daler/trackhub
trackhub/base.py
1
4408
from __future__ import absolute_import import os import warnings import tempfile from collections import OrderedDict def deprecation_handler(source, filename, kwargs): if 'local_fn' in kwargs: warnings.warn( 'Please use the argument "source" instead of "local_fn"', DeprecationWarni...
mit
7,962,907,564,334,892,000
30.262411
79
0.568285
false
siggame/server
game_utils.py
1
7951
import random from functools import wraps from heapq import heappop, heappush from math import ceil from os import listdir from os.path import isfile, join class Grid(object): def __init__(self, game, type, dimensions = ('x', 'y')): self.game = game self.type = type self.grid = {} ...
bsd-3-clause
6,078,472,673,306,572,000
33.872807
85
0.468998
false
youdar/work
work/FAB/test2.py
1
5768
from __future__ import division from phenix.command_line import superpose_pdbs from iotbx import pdb from iotbx.pdb import fetch from libtbx import easy_run from libtbx.utils import Sorry import shutil import tempfile import os,sys def run(fn): ''' ''' # Test if FAB # Devide to pdb_hierarchy_var_H,pdb_hierarc...
mit
-7,703,617,748,333,629,000
35.506329
149
0.68568
false
ombre5733/weos
src/_cmsis_rtos/test/runAllTests.py
1
1953
# -*- coding: utf-8 -*- """ ******************************************************************************* WEOS - Wrapper for embedded operating systems Copyright (c) 2013, Manuel Freiberger All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted ...
bsd-2-clause
-2,725,079,041,552,203,000
41.456522
79
0.697901
false
shuquan/leetcode
medium/combination-sum-iii/python/combination_sum_iii.py
1
1638
class Solution(object): def combinationSum3(self, k, n): """ :type k: int :type n: int :rtype: List[List[int]] """ # Use recursion to resolve the problem # The algorithm complexity is high due to it has to iterate from one # for each call given k, n. ...
apache-2.0
2,558,911,960,818,213,400
38
76
0.446276
false
SLongofono/448_Project4
mutatorTest.py
1
3874
import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import Mutators def getUniquesTest(): print "Testing getUniques Function..." knownUniques = [0,99,8000] l1 = [1,2,3,4,5,6,7,8,9...
mit
-1,697,717,099,551,939,600
28.8
134
0.638358
false
glemaitre/UnbalancedDataset
imblearn/under_sampling/prototype_generation/cluster_centroids.py
2
7740
"""Class to perform under-sampling by generating centroids based on clustering.""" # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # Fernando Nogueira # Christos Aridas # License: MIT from __future__ import division, print_function import numpy as np from scipy import sparse from sklearn.cl...
mit
9,064,186,802,600,720,000
37.507463
79
0.599742
false
ericlyf/screenly-tools-schedulespreadsheet
src/model/Asset.py
1
1601
''' Created on 11May,2016 @author: linyufeng ''' from utils.TimeZoneConverter import TimeZoneConverter class Asset(object): ''' contain the values will be insert into table Asset ''' convert = TimeZoneConverter(); def __init__(self, startTime, endTime, directory, fileName, fileType, duration...
gpl-3.0
-2,764,153,759,451,504,000
27.589286
94
0.566521
false
HybridF5/jacket
jacket/api/compute/openstack/compute/lock_server.py
1
2432
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # # 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 requir...
apache-2.0
3,974,049,421,570,928,600
34.246377
79
0.687911
false
matteomattei/RemoteCommander
remotecommander.py
1
7055
#!/usr/bin/env python """ This program open a simple dialog that allows to issue a command to a remote server using SSH. It needs a configuration file called remotecommander.ini with the following structure: [GENERAL] Host = 127.0.0.1 Port = 22 User = root Password = xxxxx Command = shutdown -h now Comman...
mit
1,549,916,806,206,178,300
33.812183
142
0.592488
false
TheoChevalier/bedrock
bin/cron.py
1
3478
#!/usr/bin/env python from __future__ import print_function, unicode_literals import datetime import os import sys from subprocess import check_call import requests from apscheduler.schedulers.blocking import BlockingScheduler from decouple import config from pathlib2 import Path schedule = BlockingScheduler() DEA...
mpl-2.0
-7,531,384,743,081,774,000
26.385827
89
0.617884
false
ehwhydubya/pywords
words/words.py
1
9231
#! /usr/bin/env python import requests from pprint import pprint class Words(object): """A class that interfaces with the Words API at https://wordsapi.com""" pretty_print_error = ValueError('You must enter \'on\' or \'off\' to toggle the pretty print setting. Please enter a valid input.') detail_error ...
mit
-6,993,740,034,392,068,000
30.941176
135
0.559094
false
Raphux/passhport
passhportd/app/views_mod/target/target.py
1
26601
# -*-coding:Utf-8 -*- from flask import request from sqlalchemy import exc, and_ from sqlalchemy.orm import sessionmaker from app import app, db from app.models_mod import user, target, usergroup, exttargetaccess, passentry from . import api from subprocess import Popen, PIPE from datetime import datetime, timedelta im...
agpl-3.0
2,535,028,188,680,494,000
34.001316
80
0.573475
false
AaronLieberman/ArduinoTinkering
FFTTest/FFTTest2-pi.py
1
2594
import numpy as np import math import wave import struct import time import wave import alsaaudio as aa import decoder import signal import sys import curses stdscr = curses.initscr() curses.cbreak() curses.noecho() curses.curs_set(0) stdscr.keypad(1) height = 16 def drawData(data, x, y): for i in range(len(data...
mit
-4,627,479,090,193,242,000
25.469388
74
0.651118
false
quangounet/TOPP
src/python/Errors.py
1
1850
# -*- coding: utf-8 -*- # Copyright (C) 2013 Stéphane Caron <caron@ynl.t.u-tokyo.ac.jp> # # This file is part of the Time-Optimal Path Parameterization (TOPP) library. # TOPP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free ...
lgpl-3.0
1,485,569,672,585,128,200
34.557692
77
0.712818
false
PRX/Infrastructure
etc/serverless-s3-upload/lambdas/StaticWebsiteAuthorizerFunction/lambda_function.py
1
1077
# This function is triggered by API Gateway as an authorizer. It uses the HTTP # basic auth Authorization header to permit access to API Gateway methods by # returning a policy document when the credentials match those defined as stack # parameters. import os import base64 def lambda_handler(event, context): hea...
mit
4,682,470,524,389,034,000
27.342105
79
0.585887
false
txtbits/daw-python
pygame/starwars/StarWars[LUISMI]/game.py
1
3787
# -*- coding: utf-8 -*- ''' Clon de Space Invaders (Basado en un script original de Kevin Harris) A partir de un ejercicio de Fernando Salamero ''' import pygame from pygame.locals import * from starwarslib import * from random import randint random.seed() pygame.init() visor = pygame.display.set_mode( (ANCHO, ALT...
mit
2,936,759,941,103,175,700
24.761905
84
0.637084
false
bwhmather/python-linemode
linemode/drivers/command_list.py
1
1130
import sys from urllib.parse import urlparse from linemode.base import Printer def _compile_command(command): if isinstance(command, str): command_name, args = command, [] else: command_name, *args = command if len(args): return ( command_name + ": " + ", ...
bsd-3-clause
5,174,688,273,632,984,000
20.730769
57
0.607965
false
tquach/talent-curator
talent_curator/apps/google/drive.py
1
1780
import requests from talent_curator import app GOOGLE_DRIVE_API_URI = 'https://www.googleapis.com/drive/v2/files/' logger = app.logger HEADERS = { 'Authorization': "Bearer {access_token}", 'Content-type': "application/json", } class GoogleDriveAPI(object): def get_document(self, access_token, document_id...
bsd-3-clause
-8,056,841,742,785,234,000
35.326531
115
0.621348
false
SymbiFlow/symbiflow-robot
maintain-repos.py
1
2727
#!/usr/bin/env python3 import logging import os import re import sys import traceback from github3.exceptions import ForbiddenError from github3 import login from github3.repos.status import Status try: GITHUB_API_TOKEN = os.environ['GITHUB_API_TOKEN'] ORGANIZATION = os.environ['ORGANIZATION'] # PROJECT-...
mit
-3,350,253,328,084,040,700
31.855422
110
0.642098
false
qilicun/python
python2/PyMOTW-1.132/PyMOTW/shlex/shlex_split.py
1
1272
#!/usr/bin/env python # # Copyright 2007 Doug Hellmann. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and tha...
gpl-3.0
8,400,207,842,116,919,000
30.8
70
0.752358
false
fedallah/scrapieweb
scrapietest.py
1
1530
#!/usr/bin/env python import web import time import hashlib sha2 = hashlib.sha256() # db = web.database(dbn='postgres', db='scrapieweb', user='postgres', pw='fuddruckers') # def uservalidate(username): # usernum = db.query("SELECT COUNT(*) FROM auth WHERE username=$uid", vars="username") # return usernum[0] urls...
agpl-3.0
-4,956,164,975,863,520,000
23.285714
113
0.660131
false
xobb1t/ddash2013
apps/accounts/models.py
1
2197
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.db import models from django.db.models.signals import post_save from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from openid_provider.models import OpenID from .managers import UserManager, A...
mit
-1,641,083,381,059,320,800
30.385714
73
0.668639
false
inflrscns/django-wiki
wiki/plugins/notifications/views.py
1
2273
from __future__ import unicode_literals from __future__ import absolute_import from django.contrib import messages from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.utils.translation import ugettext as _ from ...
gpl-3.0
2,808,801,122,730,444,300
32.925373
86
0.601848
false
gperciva/artifastring
research/impulses/mere-lowpass.py
1
3842
#!/usr/bin/env python import wave import struct import glob import numpy import scipy.io.wavfile import scipy.signal import scipy.fftpack import pylab #MAX_SHRT = 32768.0 GAIN = 1.0 PLOT = True #PLOT = False #IMPULSES = True IMPULSES = False #if not IMPULSES: # GAIN = 400.0 HEADER_BEGIN = """/* This file was a...
gpl-3.0
-2,609,533,330,637,666,000
24.613333
77
0.563509
false
hovo1990/deviser
generator/util/generateLatex.py
1
3666
#!/usr/bin/env python # # @file generateLatex.py # @brief function for generating all latex files # @author Frank Bergmann # @author Sarah Keating # # <!-------------------------------------------------------------------------- # # Copyright (c) 2013-2015 by the California Institute of Technology # (California, ...
lgpl-2.1
-2,650,420,167,974,530,000
39.285714
78
0.663393
false
jiangyunfei/Michelangelo
libs/tesstool.py
1
5182
#!/usr/bin/python # -*- coding: utf-8 -*- """Library with tools related to tesseract """ __author__ = 'Jiang Yunfei' __version__ = '0.1' __date__ = '2015.04' import os import sys import ctypes from ctypes.util import find_library from itertools import count LIBPATH = '/usr/local/lib/' VERSION = '' # Define Page It...
apache-2.0
6,524,443,883,578,237,000
30.216867
79
0.600926
false
lerouxb/seymour
seymour/accounts/models.py
1
3824
import datetime from django.db import models, connection from seymour.feeds.models import Feed, Item, AccountFeed class Account(models.Model): openid = models.CharField('openid', max_length=255, null=True) firstname = models.CharField('first name', max_length=100, null=True) lastname = models.CharField('l...
mit
2,326,235,980,058,474,500
36.861386
131
0.594142
false
sssllliang/edx-analytics-pipeline
edx/analytics/tasks/database_imports.py
1
22573
""" Import data from external RDBMS databases into Hive. """ import datetime import logging import textwrap import luigi from luigi.hive import HiveQueryTask, HivePartitionTarget from edx.analytics.tasks.sqoop import SqoopImportFromMysql from edx.analytics.tasks.url import url_path_join from edx.analytics.tasks.util....
agpl-3.0
7,435,424,560,311,923,000
30.438719
118
0.578346
false
ussrunit-project/ussrunit
contrib/seeds/getseeds/getseeds.py
1
3021
#!/usr/bin/python3 ### ### Automatic seeding over HTTP ### (C) 2016 Alex D. ### ### http://www.gnu.org/licenses/agpl-3.0.en.html ### import os import sys import json import random import platform import urllib.request sources = ['http://dalexhz1.cloudapp.net', 'http://dalexhz2.cloudapp.net', 'http://dalexhz4.clou...
mit
3,070,426,035,498,193,400
29.826531
138
0.631579
false
StackStorm/mistral
mistral/tests/unit/api/v2/test_environment.py
1
10105
# Copyright 2015 - StackStorm, 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 ...
apache-2.0
4,977,302,105,676,617,000
32.240132
78
0.653241
false
guolivar/2spec-on-a-pi
logger_main.py
1
6723
#!/usr/bin/env python3 # Load the libraries #this is to test something import serial # Serial communications import time # Timing utilities import subprocess # Shell utilities ... compressing data files import os,sys # OS utils to keep working directory import json # To send JSON object to MQTT broker impor...
mit
-8,478,481,967,142,870,000
31.167464
92
0.665179
false
uhuramedia/django-dynamic-forms
dynamic_forms/formfields.py
1
7830
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import re from importlib import import_module from django import forms from django.utils import six from django.utils.decorators import classonlymethod from django.utils.encoding import python_2_unicode_compatible from django.utils.translatio...
bsd-3-clause
7,018,933,180,595,280,000
27.064516
78
0.613027
false
milkpku/BetaElephant
policy_experiment/policy.add-all/model.py
1
2810
#!/usr/bin/python3 #-*-coding:utf-8-*- #$File: model.py #$Date: Sat May 7 10:59:45 2016 #$Author: Like Ma <milkpku[at]gmail[dot]com> from config import Config import tensorflow as tf import functools from util.model import Model, conv2d def get_model(name): name = functools.partial('{}-{}'.format, name) s...
mit
-7,605,506,269,003,194,000
36.466667
131
0.646975
false
claudep/pootle
pootle/apps/accounts/utils.py
1
16481
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import functools import logging import sys ...
gpl-3.0
-7,586,842,018,523,908,000
36.542141
79
0.590498
false
pf-aics-riken/kmr
cmd/kmrfsplit.py
1
5999
#!/usr/bin/python # Copyright (C) 2012-2018 RIKEN R-CCS ## \file kmrfsplit.py KMR-Shell File Splitter. import sys import os import re from optparse import OptionParser ## Write part of the inputfile to outputfile. # @param ipath inputfile path. # @param opath outputfile path. # @startpos start position o...
bsd-2-clause
886,644,253,159,995,300
29.764103
98
0.545924
false
jmason-ebi/pdx
web/settings.py
1
3715
""" Django settings for web project. Generated by 'django-admin startproject' using Django 1.10. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # Bu...
apache-2.0
-1,538,406,159,952,758,300
25.347518
91
0.670525
false
timj/scons
test/packaging/msi/explicit-target.py
1
3151
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
mit
-7,541,994,647,145,852,000
31.484536
101
0.680736
false
NeCTAR-RC/nova
nova/tests/unit/virt/libvirt/test_imagebackend.py
1
76598
# Copyright 2012 Grid Dynamics # 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...
apache-2.0
8,619,255,624,108,068,000
41.507214
79
0.590472
false
alviano/wasp
tests/asp/cautious/test6.gus.gringo.cautious.asp.test.py
1
20192
input = """ 1 1 1 1 63 1 1 1 1 64 1 1 2 0 65 66 1 1 2 0 67 68 1 1 2 0 69 70 1 1 2 0 71 72 1 1 2 0 66 65 1 1 2 0 68 67 1 1 2 0 70 69 1 1 2 0 72 71 1 81 1 1 66 1 82 1 1 65 1 83 1 1 68 1 84 1 1 67 1 85 1 1 70 1 86 1 1 69 1 87 1 1 72 1 88 1 1 71 1 89 1 1 66 1 90 1 1 68 1 91 1 1 67 1 92 1 1 69 1 93 2 1 68 81 1 94 1 0 81 1 9...
apache-2.0
8,110,923,556,078,638,000
24.656925
90
0.654418
false
BillyLiggins/fitting
first.py
1
7031
import copy import echidna import echidna.output.plot as plot import echidna.core.spectra as spectra from echidna.output import store import matplotlib.pyplot as plt import argparse import glob import numpy as np import os def convertor(path): flist=np.array(glob.glob(path)) for ntuple in flist: os.sy...
mit
7,131,510,302,467,341,000
34.331658
208
0.594226
false
AirChen/MachineLearningDoc
collective_intelligence/chapter_7/treepredict.py
1
6590
#!/usr/bin/python from math import log from PIL import Image, ImageDraw my_data=[['slashdot','USA','yes',18,'None'], ['google','France','yes',23,'Premium'], ['digg','USA','yes',24,'Basic'], ['kiwitobes','France','yes',23,'Basic'], ['google','UK','no',21,'Premium'], ['(direct)','New Zealand','no',12,'None'], ['(...
mit
-6,750,698,513,289,226,000
23.685393
106
0.606222
false
audunv/andp
python/andp/view/web/remote.py
1
3288
# -*- coding: utf-8; -*- # Copyright (C) 2009 Østfold University College # # This file is part of ANDP. # # ANDP 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 2 of the License, or # (at you...
gpl-2.0
-2,934,864,935,421,723,000
30.912621
146
0.653179
false
neslihanturan/artge
app/signals.py
1
2014
from django.db.models.signals import post_save, pre_delete, pre_save from django.dispatch import receiver from app.forms import MenuForm from django import forms from app.models import * from django.core.exceptions import ObjectDoesNotExist #from django.db.models.base import ObjectDoesNotExist @receiver(post_save, sen...
gpl-3.0
-2,247,177,136,050,063,400
50.641026
142
0.705561
false
jobelenus/thegreco
ignore/tracegen.py
1
1364
#!/usr/bin/env python # vim:ts=4:sts=4:sw=4:et:wrap:ai:fileencoding=utf-8: import collections #import matplotlib.pyplot as plt factor = 1/4 class TraceGenerator(): def __init__(self): fname='/Users/jobelenus/work/thegreco/cpu.entries' self.fname = fname with open(self.fname) as ...
gpl-3.0
8,861,294,036,673,050,000
24.259259
65
0.597507
false
F5Networks/f5-ansible
ansible_collections/f5networks/f5_modules/plugins/modules/bigip_device_group.py
1
19251
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: bigip_device_group shor...
gpl-3.0
8,827,777,590,810,498,000
30.150485
102
0.590567
false
sbelharbi/structured-output-ae
sop_embed/experiments/lfpw_4l_out_unl.py
1
14984
from sop_embed.da import DenoisingAutoencoder from sop_embed.tools import NonLinearity from sop_embed.tools import CostType from sop_embed.tools import ModelMLP from sop_embed.tools import train_one_epoch_chuncks from sop_embed.tools import theano_fns from sop_embed.tools import sharedX_value from sop_embed.tools impor...
lgpl-3.0
-4,196,589,584,420,531,700
36.553885
79
0.507475
false
gavinhungry/hashbrowns
hashbrowns.py
1
3014
#!/usr/bin/env python2 # # Name: hashbrowns # Auth: Gavin Lloyd <gavinhungry@gmail.com> # Desc: Provides cryptographic hashes with a minimal UI # import os, sys import pygtk, gtk import hashlib import pango import re class Hashbrowns: def __init__(self, filename): self.hash_algs = ['md5', 'sha1', 'sha256', 'sh...
mit
-7,338,854,927,634,280,000
26.4
74
0.627074
false
brianjimenez/lightdock
lightdock/pdbutil/PDBIO.py
1
7384
"""Parses Atomic coordinates entries from PDB files""" import math from lightdock.error.lightdock_errors import PDBParsingError, PDBParsingWarning from lightdock.structure.atom import Atom, HetAtom from lightdock.structure.residue import Residue from lightdock.structure.chain import Chain from lightdock.util.logger im...
gpl-3.0
3,553,418,247,596,338,700
39.571429
112
0.492551
false
seckcoder/lang-learn
python/sklearn/sklearn/decomposition/tests/test_kernel_pca.py
1
7069
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_raises from sklearn.decomposition import PCA, KernelPCA from sklearn.datasets import make_circles from sklearn.linear_model i...
unlicense
-8,541,396,233,869,127,000
37.628415
77
0.618475
false
randyli/beauty-cpp
template/cgi-bin/menu.py
1
3251
#!/usr/bin/python # -*- coding:utf-8 -*- import cgi print "Content-Type: text/html\n\n" projects = [ ('/memcached/', 'memcached') ] form = cgi.FieldStorage() directory = '' if form.has_key('dir'): directory = form['dir'].value if directory == '/': print '<ul class="jqueryFileTree" style="display: none;">', p...
mit
-4,720,936,115,940,304,000
72.886364
141
0.650261
false
erikriver/eduIntelligent-cynin
src/eduintelligent.courses/eduintelligent/courses/content/coursecontent.py
1
1190
"""Definition of the Lessons content type. """ from zope.interface import implements from Products.Archetypes import atapi from Products.ATContentTypes.content import folder from Products.ATContentTypes.content.schemata import finalizeATCTSchema from eduintelligent.courses.interfaces import ICourseContent from edui...
gpl-3.0
-6,633,798,422,943,174,000
32.055556
77
0.811765
false
HELIO-HFC/SDOSS
lib/python/net/pycurl.py
1
1034
#! /usr/bin/env python import sys import subprocess import argparse def pycurl(url, *args, **kwargs): cmd = "curl" if (args): for arg in args: cmd += " "+arg if (kwargs): for k,v in kwargs.iteritems(): if (len(k) == 1): if (v): cmd += " -"+k+" "+v ...
mit
-1,120,644,544,877,389,600
21.977778
74
0.51354
false
rfhk/awo-custom
sale_line_quant_extended/models/stock_move.py
1
10584
# -*- coding: utf-8 -*- # Copyright 2015-2017 Quartile Limted # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api, _ class StockMove(models.Model): _inherit = "stock.move" pick_partner_id = fields.Many2one( related='picking_id.partner_id', ...
lgpl-3.0
7,031,241,485,843,623,000
43.470588
148
0.543651
false
isc-projects/forge
tests/dhcpv4/ddns/test_ddns_tsig_release.py
1
12902
"""DDNS without TSIG""" # pylint: disable=invalid-name,line-too-long import pytest import misc import srv_control import srv_msg @pytest.mark.v4 @pytest.mark.ddns @pytest.mark.tsig @pytest.mark.forward_reverse_remove def test_ddns4_tsig_sha1_forw_and_rev_release(): misc.test_setup() srv_control.config_srv...
isc
-8,482,253,383,423,939,000
37.513433
83
0.673074
false
paris-saclay-cds/ramp-workflow
rampwf/score_types/soft_accuracy.py
1
1665
"""A generalization of the classification accuracy with cross-class scores. Soften the accuracy score by giving scores through certain misclassifications defined by the score matrix. For example, in ordinal regression we may want not to penalize too much misclassifications to neighbor classes. The score also generaliz...
bsd-3-clause
-7,537,339,566,954,264,000
38.642857
79
0.693093
false
python-recsys/mrec
mrec/evaluation/metrics.py
1
5143
""" Metrics to evaluate recommendations: * with hit rate, following e.g. Karypis lab SLIM and FISM papers * with prec@k and MRR """ import numpy as np from collections import defaultdict # classes to access known items for each test user class get_known_items_from_dict(object): def __init__(self,data): ...
bsd-3-clause
5,941,773,935,980,116,000
30.746914
85
0.624538
false
effigies/mne-python
mne/minimum_norm/tests/test_psf_ctf.py
1
3160
import os.path as op import mne from mne.datasets import testing from mne import read_forward_solution, pick_types_forward from mne.minimum_norm import (read_inverse_operator, point_spread_function, cross_talk_function) from nose.tools import assert_true data_path = op.join(testing.data...
bsd-3-clause
-1,632,655,806,414,221,300
38.012346
79
0.521519
false
ischeinfeld/py_nlp
tests_deprecated/test.py
1
1056
"""Tests examples of the parameters q and e""" from preprocessing import import_wsj, replace_rarities from parameters import sx_counts, uvs_counts, uv_counts, s_counts, q, e sentences = import_wsj("train") #print(sentences[0]) new_sentences = replace_rarities(sentences) #print(new_sentences[0]) sx_counts = sx_count...
mit
-2,406,479,407,315,898,400
21.978261
78
0.619318
false
rifotu/ipv6_trials
gpsd/gpsd_src/gpscap.py
1
8725
""" gpscap - GPS/AIS capability dictionary class. This file is Copyright (c) 2010 by the GPSD project BSD terms apply: see the file COPYING in the distribution root for details. """ import ConfigParser class GPSDictionary(ConfigParser.RawConfigParser): def __init__(self, *files): "Initialize the capabili...
mit
4,811,126,590,012,107,000
50.023392
179
0.504298
false
yiwen-luo/LeetCode
Python/word-ladder.py
1
1785
# Time: O(n * d), n is length of string, d is size of dictionary # Space: O(d) # # Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: # # Only one letter can be changed at a time # Each intermediate word must exist in the dictionary # F...
mit
1,898,654,603,200,111,900
32.055556
134
0.556303
false
ntduong/ML
Twitter-Analysis/top_ten.py
1
1032
''' Created on May 6, 2013 @author: Administrator ''' import json import sys from collections import defaultdict def parseTweets(tweet_file='tweets.txt'): parsed_tweets = [] with open(tweet_file, 'r') as fin: for line in fin: tweet = json.loads(line) if 'text' in tweet: ...
mit
7,851,779,728,419,153,000
22.477273
62
0.579457
false
Reuben-Thorpe/Code.Eval
code.eval/01-hard/as_quick_as_a_flash/as.quick.as.a.flash.py
1
1235
# Reuben Thorpe (2016), CodeEval [As Quick As A Flash v1.0] from sys import argv def swap(seq, x, y): seq[x], seq[y] = seq[y], seq[x] def q_sort_pivots(seq, begin, end): """ Code Evals implimentation of the quick sort algorithm, returns the number of pivots enacted during a complete sort. ...
gpl-3.0
-339,455,370,179,563,800
24.729167
74
0.489069
false
migueldsw/TL-DA-TF
NETWORKS/vgg.py
1
10291
# from tflearn examples: https://github.com/tflearn/tflearn/blob/master/examples/images/vgg_network.py """ Very Deep Convolutional Networks for Large-Scale Visual Recognition. Applying VGG 11 and 16-layers convolutional network to MNIST and SVHN Dataset classification task. 28x28x3 shape References: Very Deep Conv...
apache-2.0
6,515,410,261,578,882,000
50.974747
114
0.639005
false
jeremiah-c-leary/vhdl-style-guide
vsg/tests/generate/test_rule_001.py
1
1243
import os import unittest from vsg.rules import generate from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_001_test_input.vhd')) dIndentMap = utils.read_indent_file() lExpected = [] lExpected.append('')...
gpl-3.0
-4,718,721,487,012,651,000
24.895833
106
0.679807
false
GoSecure/gophish-cli
modules/report.py
1
25755
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Reporting class to gather information from the campaign @author: Martin Dubé @organization: Gosecure inc. @license: MIT License @contact: mdube@gosecure.ca Copyright (c) 2018, Gosecure All rights reserved. Permission is hereby granted, free of charge, to any person...
mit
-7,928,273,222,694,129,000
49.007767
171
0.551992
false
heliopython/heliopy
doc/source/conf.py
1
11504
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # heliopy documentation build configuration file, created by # sphinx-quickstart # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
gpl-3.0
-2,292,222,765,677,599,500
28.649485
98
0.676895
false
rcosnita/fantastico
fantastico/mvc/tests/itest_model_facade.py
1
10388
''' Copyright 2013 Cosnita Radu Viorel 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, distribu...
mit
6,665,480,441,102,607,000
46.00905
126
0.674047
false
t3dev/odoo
addons/mrp/__manifest__.py
5
1731
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Manufacturing', 'version': '2.0', 'website': 'https://www.odoo.com/page/manufacturing', 'category': 'Manufacturing/Manufacturing', 'sequence': 16, 'summary': 'Manufacturing Orders & BO...
gpl-3.0
6,180,193,645,343,356,000
33.62
74
0.59792
false
tfwillems/STRValidator
pedigree_analysis.py
1
23183
import matplotlib as mpl mpl.use('Agg') import collections import sys import numpy import matplotlib.pyplot as plt import vcf from matplotlib.backends.backend_pdf import PdfPages from fractions import Fraction class TRIO: def __init__(self, child, mother, father): self.child = child self.mother =...
gpl-3.0
-1,392,284,342,982,536,000
47.398747
177
0.55187
false
DTOcean/dtocean-core
tests/test_data_definitions_xgrid2d.py
1
4013
import pytest import numpy as np import matplotlib.pyplot as plt from aneris.control.factory import InterfaceFactory from dtocean_core.core import (AutoFileInput, AutoFileOutput, AutoPlot, Core) from dtocean_core.data import ...
gpl-3.0
3,277,853,037,609,549,300
26.29932
68
0.474209
false
shengwangXX/deeplearning
pytorch/mnist_dist.py
1
4858
from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.autograd import Variable import torch.nn.parallel import torch.distributed as dist import torch.utils.data.distribu...
apache-2.0
2,263,699,519,529,820,700
40.521368
165
0.632977
false
0x0mar/king-phisher
king_phisher/client/client_rpc.py
1
5357
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/client_rpc.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice...
bsd-3-clause
-3,524,535,730,311,676,400
33.121019
101
0.725219
false
crepererum/analysis-preservation.cern.ch
invenio_data/base/bundles.py
1
1116
# -*- coding: utf-8 -*- # # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2014, 2015 CERN. # # CERN Analysis Preservation Framework 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; ...
gpl-2.0
5,599,749,186,645,517,000
31.823529
70
0.739247
false
ctb/pygr
pygr/nlmsa_utils.py
1
17639
import classutil, logger import os, types class NLMSASeqList(list): def __init__(self, nlmsaSeqDict): list.__init__(self) self.nlmsaSeqDict = nlmsaSeqDict def __getitem__(self, nlmsaID): 'return NLMSASequence for a given nlmsa_id' try: return list.__getitem__(self,n...
bsd-3-clause
7,531,787,476,518,567,000
37.5131
92
0.597426
false
tommy-u/chaco
examples/demo/advanced/asynchronous_updates.py
1
8087
""" Perform expensive calculations based on user interactions while keeping the GUI responsive. This makes use of asynchronous programming tools in the encore package. Move the slider to blur the image. Note the slider stays responsive even though the blurring may lag the slider. Uncheck "Asynchronous" and note that t...
bsd-3-clause
-7,469,744,734,406,055,000
36.439815
79
0.568814
false
akshayka/projection-methods
projection_methods/projectables/polyhedron.py
1
2281
from projection_methods.projectables.halfspace import Halfspace from projection_methods.projectables.hyperplane import Hyperplane from projection_methods.projectables.projectable import Projectable class Polyhedron(Projectable): """A projectable polyhedron Defines a polyhedron via a set of hyperplanes and ha...
gpl-3.0
-5,145,808,269,231,277,000
38.327586
79
0.647961
false
Pikecillo/genna
external/4Suite-XML-1.0.2/Ft/Xml/XPath/ParsedRelativeLocationPath.py
1
1412
######################################################################## # $Header: /var/local/cvsroot/4Suite/Ft/Xml/XPath/ParsedRelativeLocationPath.py,v 1.4 2005/02/09 11:10:54 mbrown Exp $ """ A parsed token that represents a relative location path in the parsed result tree. Copyright 2005 Fourthought, Inc. (...
gpl-2.0
-7,323,416,474,104,998,000
30.377778
118
0.55949
false
thp44/delphin_6_automation
data_process/2d_1d/archieve/temperature.py
1
18075
__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import matplotlib.pyplot as plt import numpy as np import os import datetime import matplotlib.dates as mdates import pan...
mit
7,053,188,227,556,436,000
44.762025
120
0.52
false
weechat/weechat.org
weechat/news/views.py
1
3923
# # Copyright (C) 2003-2021 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat.org. # # WeeChat.org 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 #...
gpl-3.0
6,434,592,163,771,946,000
31.683333
77
0.63845
false
pdinges/class-language
visitor/util.py
1
1477
# -*- coding: utf-8 -*- # Copyright (c) 2008--2012 Peter Dinges <pdinges@acm.org> # # This program 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) any l...
gpl-3.0
6,511,576,019,489,726,000
32.568182
75
0.682464
false
mkhutornenko/incubator-aurora
src/main/python/apache/aurora/executor/common/health_checker.py
1
4022
# # 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 # distributed under ...
apache-2.0
1,872,825,315,312,484,000
35.563636
100
0.704127
false
ESMG/ESMG-configs
CCS1/plot_vort.py
1
2295
import numpy as np import netCDF4 import os import sys import subprocess import pyroms from pyroms_toolbox import jday2date from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt from datetime import datetime # draw line around map projection limb. # color background of map projec...
gpl-3.0
-1,542,112,058,386,299,400
29.6
83
0.630065
false
coreboot/chrome-ec
util/flash_cr50.py
2
27330
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Flash Cr50 using gsctool or cr50-rescue. gsctool example: util/flash_cr50.py --image cr50.bin.prod util/...
bsd-3-clause
-6,824,272,800,519,585,000
34.447471
80
0.585145
false
wanghongjuan/crosswalk-test-suite
misc/sampleapp-android-tests/sampleapp/helloworld_pack.py
1
2182
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
993,854,383,971,541,500
39.407407
112
0.72044
false