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
Zavteq/fixofx
lib/ofx/document.py
1
3703
#coding: utf-8 # Copyright 2005-2010 Wesabe, 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 a...
apache-2.0
-1,877,798,710,501,073,700
38.393617
77
0.591142
false
rhyolight/nupic.son
app/melange/request/access.py
1
13682
# Copyright 2013 the Melange authors. # # 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 wr...
apache-2.0
930,231,751,972,041,200
34.172237
79
0.7371
false
papedaniel/oioioi
oioioi/questions/admin.py
1
6957
from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied from django.shortcuts import redirect, get_object_or_404 from django.template.response import TemplateResponse from django.utils.text import get_text_list from django.utils.translation import ugettext_lazy as _ from oioioi....
gpl-3.0
106,197,862,934,026,060
38.754286
79
0.625557
false
cgrima/rsr
rsr/fit.py
1
4401
""" Various tools for extracting signal components from a fit of the amplitude distribution """ from . import pdf from .Classdef import Statfit import numpy as np import time import random import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from lmfit import minimize, Parameters, report_fit def pa...
mit
-4,480,014,395,952,754,700
29.143836
81
0.452852
false
emitrom/integra-openstack-ui
schedules/tables.py
1
2134
from django.utils.translation import ugettext_lazy as _ from horizon import tables from openstack_dashboard.dashboards.integra.schedules import utils from django.utils.http import urlencode from django.core.urlresolvers import reverse class AddTableData(tables.LinkAction): name = "addSchedule" verbose_name =...
apache-2.0
7,110,622,473,895,393,000
28.232877
74
0.619963
false
jiceher/oneapi-python
test.py
1
5026
# -*- coding: utf-8 -*- import pdb import logging as mod_logging import unittest as mod_unittest import oneapi.object as mod_object import oneapi.models as mod_models class Tests(mod_unittest.TestCase): def test_json_deserialization(self): class Alias(mod_object.AbstractModel): name = mod_...
apache-2.0
-5,334,345,587,301,496,000
43.875
164
0.640669
false
fred49/linshare-cli
linsharecli/user/contactslistscontacts.py
1
7937
#! /usr/bin/env python # -*- coding: utf-8 -*- """TODO""" # This file is part of Linshare cli. # # LinShare cli 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 ...
gpl-3.0
-6,270,641,253,567,035,000
34.734234
88
0.636707
false
gordielachance/plugin.audio.subsonic
main.py
1
46940
#!/usr/bin/python # -*- coding: utf-8 -*- # Module: main # Author: G.Breant # Created on: 14 January 2017 # License: GPL v.3 https://www.gnu.org/copyleft/gpl.html import xbmcvfs import os import xbmcaddon import xbmcplugin import xbmcgui import json import shutil import dateutil.parser from datetime import datetime f...
mit
1,061,290,670,147,951,900
29.268734
151
0.568871
false
WilJoey/tn_ckan
ckan/lib/field_types.py
1
12439
import re import time import datetime import warnings with warnings.catch_warnings(): warnings.filterwarnings('ignore', '.*compile_mappers.*') import formalchemy from ckan.common import OrderedDict months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'No...
mit
-3,390,214,483,191,561,700
43.584229
139
0.51845
false
fergalmoran/dss
spa/migrations/0056_auto__add_field_label_object_created__add_field_label_object_updated__.py
1
38640
# -*- 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 'Label.object_created' db.add_column(u'spa_label', 'object...
bsd-2-clause
-8,021,846,938,036,338,000
71.361423
205
0.571429
false
sirMackk/ZeroNet
src/Site/SiteStorage.py
1
18469
import os import re import shutil import json import time import sys import sqlite3 import gevent.event from Db import Db from Debug import Debug from Config import config from util import helper from Plugin import PluginManager @PluginManager.acceptPlugins class SiteStorage(object): def __init__(self, site, al...
gpl-2.0
-8,272,034,263,457,734,000
41.263158
130
0.561427
false
denys-duchier/kivy
kivy/uix/label.py
1
25250
'''Label ===== The :class:`Label` widget is for rendering text. It supports ascii and unicode strings:: # hello world text l = Label(text='Hello world') # unicode text; can only display glyphs that are available in the font l = Label(text=u'Hello world ' + unichr(2764)) # multiline text l = ...
mit
-6,323,048,173,125,887,000
33.400545
83
0.617465
false
Weasyl/weasyl
weasyl/shout.py
1
4702
import arrow from libweasyl import staff from weasyl import define as d from weasyl import frienduser from weasyl import ignoreuser from weasyl import macro as m from weasyl import media from weasyl import welcome from weasyl.comment import thread from weasyl.error import WeasylError def select(userid, ownerid, lim...
apache-2.0
-7,151,868,114,302,378,000
32.112676
121
0.64866
false
alsmirn/adist
extinction/tabular.py
1
3610
""" Copyright (c) 2009, Alexey Smirnov All rights reserved. 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, this list of conditions and the f...
bsd-3-clause
-2,222,819,617,115,563,300
40.022727
80
0.667313
false
PedroMDuarte/thesis-hubbard-lda_evap
qmc.py
1
16230
""" This file provides a way to obtain thermodynamic quantities from an interpolation of available QMC solutions """ import numpy as np import matplotlib.pyplot as plt import matplotlib from matplotlib import rc rc('font', **{'family':'serif'}) rc('text', usetex=True) import glob import os import ldaconf base...
mit
-3,425,785,279,829,014,000
31.721774
83
0.463648
false
charityscience/csh-sms
tests/jobs/test_text_reminder_job.py
1
2487
import mock from mock import patch, call from freezegun import freeze_time from datetime import datetime from django.test import TestCase from tests.fixtures import contact_object from modules.text_reminder import TextReminder from jobs import text_reminder_job FAKE_NOW = datetime(2017, 7, 17, 0, 0) class TextRemind...
gpl-3.0
-2,241,891,620,633,596,700
44.218182
96
0.572577
false
hajicj/safire
scripts/text_preprocessing_explorer.py
1
5761
#!/usr/bin/env python import argparse from copy import deepcopy import itertools import logging import operator import os import random import webbrowser from safire.data.text_browser import TextBrowser import safire.utils from safire.data.image_browser import ImageBrowser from safire.data.loaders import MultimodalData...
gpl-3.0
-4,264,359,828,596,876,000
34.349693
82
0.559799
false
indexofire/cdc
cdc/contrib/cache/helpers.py
1
12245
# -*- coding: utf-8 -*- import types import hashlib import logging import cPickle as pickle from django.conf import settings from django.core.cache import cache from django.utils.encoding import smart_str from keyedcache.utils import is_string_like, is_list_or_tuple log = logging.getLogger('cdc_cache') # The debuggi...
mit
9,166,052,249,214,150,000
30.559278
173
0.596815
false
diplomacy/research
diplomacy_research/scripts/render.py
1
9835
#!/usr/bin/env python3 # ============================================================================== # Copyright 2019 - Philip Paquette # # NOTICE: 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 th...
mit
5,406,339,455,071,944,000
40.673729
116
0.604677
false
Shinao/SmartMirror
Motion/main.py
1
1803
import cv2 import time, os from motion import Motion from tornado import web, ioloop import threading import json import requests from config import config import logging # Send gesture to node server logging.getLogger("requests").setLevel(logging.WARNING) # get infos on error take_photo = False photo_filepath = "" de...
mit
3,999,531,328,340,736,000
26.738462
99
0.687188
false
iceslide/Lili
formatter.py
1
2383
# -*- coding: utf-8 -*- import constants __author__ = constants.__author__ __copyright__ = constants.__copyright__ __license__ = constants.__license__ def format(block): """ Apply formatting to a block. """ wideopeningchars = constants.WIDE_OPENING_CHARS text = block.gettext() newtext = [] ...
gpl-3.0
1,472,706,962,389,387,500
27.380952
75
0.535879
false
Castronova/EMIT
wrappers/odm2.py
1
2672
__author__ = 'tonycastronova' import wrappers import stdlib from wrappers import base from utilities import geometry from utilities.status import Status from api_old.ODM2.Core.services import readCore from api_old.ODM2.Results.services import readResults class wrapper(base.BaseWrapper): def __init__(self, args)...
gpl-2.0
3,811,784,181,105,661,000
29.022472
79
0.623503
false
ClearingHouse/clearinghoused
docs/conf.py
1
7820
# -*- coding: utf-8 -*- # # clearinghoused documentation build configuration file, created by # sphinx-quickstart on Mon Jan 20 15:45:40 2014. # # 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. ...
mit
9,053,527,023,928,959,000
31.31405
80
0.707033
false
garthg/petitions-dataverse
merge_doi_maps.py
1
2439
'''merge_doi_maps.py Copyright 2018 Garth Griffin Distributed under the GNU GPL v3. For full terms see the file LICENSE. This file is part of PetitionsDataverse. PetitionsDataverse 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 So...
gpl-3.0
7,386,181,290,347,419,000
32.410959
80
0.664207
false
k4ml/Marimorepy
mamopublic/common.py
1
2741
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2009, MARIMORE Inc Tokyo, Japan. # Contributed by # Iqbal Abdullah <iqbal@marimore.co.jp> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following condit...
bsd-3-clause
641,584,754,417,837,600
41.828125
85
0.69938
false
sympsi/sympsi
sympsi/commutator.py
1
7156
"""The commutator: [A,B] = A*B - B*A.""" from __future__ import print_function, division from sympy import S, Expr, Mul, Add from sympy.core.compatibility import u from sympy.integrals.integrals import Integral from sympy.printing.pretty.stringpict import prettyForm from sympsi.dagger import Dagger from sympsi.opera...
bsd-3-clause
-1,256,890,188,336,245,500
30.488987
83
0.504896
false
MangoMangoDevelopment/neptune
lib/ros_comm-1.12.0/tools/rosmaster/test/test_rosmaster_paramserver.py
2
37540
# Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # 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...
bsd-3-clause
-5,362,912,799,459,695,000
50.005435
144
0.588998
false
sveetch/boussole
tests/100_compiler/021_source_map.py
1
5369
# -*- coding: utf-8 -*- import os import io import json from boussole.conf.model import Settings def test_source_map_path_001(compiler, temp_builds_dir): """ Check about source map path from 'sourceMappingURL' with a simple path """ basic_settings = Settings(initial={ "SOURCES_PATH": ".", ...
mit
-2,243,959,979,003,704,000
26.963542
84
0.591917
false
google-research/ravens
ravens/tasks/align_box_corner.py
1
2653
# coding=utf-8 # Copyright 2021 The Ravens Authors. # # 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,962,212,802,293,448,000
35.847222
79
0.637015
false
FedoraScientific/salome-paravis
test/VisuPrs/Plot3D/F1.py
1
1486
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D # # This library 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 Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library ...
lgpl-2.1
9,133,120,207,264,019,000
37.102564
81
0.730821
false
jeblair/GitPython
git/test/test_docs.py
1
25308
# -*- coding: utf-8 -*- # test_git.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php import os from git.test.lib import TestBase from git.test.lib.helper import...
bsd-3-clause
-603,388,717,642,298,800
50.230769
196
0.607397
false
karies/root
tutorials/roofit/rf106_plotdecoration.py
6
2263
## \file ## \ingroup tutorial_roofit ## \notebook ## Basic functionality: adding boxes with parameters to RooPlots and decorating with arrows, etc... ## ## \macro_code ## ## \author Clemens Lange, Wouter Verkerke (C++ version) import ROOT # Set up model # --------------------- # Create observables x = ROOT.RooRealVa...
lgpl-2.1
-1,037,350,025,528,606,300
26.26506
99
0.615996
false
chenchiyuan/yajiong
applications/posts/management/commands/parse_weixin.py
1
1199
# -*- coding: utf-8 -*- # __author__ = chenchiyuan from __future__ import division, unicode_literals, print_function from django.core.management import BaseCommand import requests from bs4 import BeautifulSoup from applications.posts.models import Post import time headers = { "referer": "http://weixin.sogou.com...
bsd-3-clause
7,479,947,682,873,907,000
28.268293
141
0.614679
false
metaist/hebphonics
test/test_unicode.py
1
1048
#!/usr/bin/env python # coding: utf-8 """Unicode tests.""" # pkg from hebphonics import tokens as T def test_normalize(): """normalize unicode symbols""" want = T.LETTER_ALEF + T.POINT_DAGESH_OR_MAPIQ test = T.normalize(T.LETTER_ALEF_WITH_MAPIQ) assert test == want want = T.LETTER_AYIN test ...
mit
-3,226,109,340,321,127,400
22.044444
70
0.580521
false
Vaidyanath/tempest
tempest/scenario/utils.py
1
5983
# Copyright 2013 Hewlett-Packard, Ltd. # # 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...
apache-2.0
-6,174,245,329,511,433,000
33.988304
79
0.602206
false
laurentb/weboob
modules/ipapi/module.py
1
2091
# -*- coding: utf-8 -*- # Copyright(C) 2015 Julien Veyssier # # This file is part of a weboob module. # # This weboob module is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
lgpl-3.0
1,998,065,906,981,396,000
31.671875
77
0.636538
false
BdEINSALyon/adhesion
adhesion/settings.py
1
3232
""" Django settings for adhesion project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # ...
gpl-3.0
3,136,685,628,160,387,600
25.491803
91
0.690285
false
McStasMcXtrace/McCode
tools/Python/mcgui/viewclasses.py
1
42464
''' mcgui UI. ''' import sys import os import re from widgets import * from PyQt5 import Qsci, QtWidgets sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from mccodelib import mccode_config from mccodelib.utils import ComponentParser, ComponentParInfo ''' View class containing windows and dialogs as del...
gpl-2.0
-2,626,172,253,893,456,000
35.294017
160
0.57922
false
marmyshev/transitions
openlp/plugins/bibles/lib/biblestab.py
1
26262
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
gpl-2.0
-5,386,206,835,964,329,000
59.229358
116
0.700419
false
jerome-nexedi/dream
dream/simulation/CoreObject.py
1
47086
# =========================================================================== # Copyright 2013 University of Limerick # # This file is part of DREAM. # # DREAM 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 Software Founda...
gpl-3.0
-88,395,979,137,123,230
53.687573
217
0.514102
false
winhamwr/neckbeard
neckbeard/cloud_resource.py
1
19469
import logging import time import boto.exception import dateutil.parser import requests from boto.ec2 import elb from requests.exceptions import ( ConnectionError, Timeout, RequestException, ) from simpledb import models from neckbeard.output import fab_out_opts NODE_AWS_TYPES = ['ec2', 'rds', 'elb'] EC2...
bsd-3-clause
5,361,584,043,886,388,000
33.519504
79
0.538805
false
tjcsl/cslbot
cslbot/helpers/handler.py
1
28231
# -*- coding: utf-8 -*- # Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson # # 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 Softw...
gpl-2.0
8,572,865,770,078,463,000
40.516176
144
0.562715
false
frank-und-freunde/Lunchez
functions.py
1
1594
import math from datetime import datetime def weekDay(year, month, day): offset = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334] week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] afterFeb = 1 if month > 2: afterFeb = 0 aux = year - 1700 - aft...
mit
5,577,577,409,626,868,000
40.947368
151
0.557089
false
webrecorder/warcio
test/test_limitreader.py
1
1457
from warcio.limitreader import LimitReader from contextlib import closing from io import BytesIO class TestLimitReader(object): def test_limit_reader_1(self): assert b'abcdefghji' == LimitReader(BytesIO(b'abcdefghjiklmnopqrstuvwxyz'), 10).read(26) def test_limit_reader_2(self): assert b'abcde...
apache-2.0
2,581,903,342,736,774,000
36.358974
122
0.654084
false
saintdragon2/python-3-lecture-2015
homework_checker/civil_hw_personal_list/civil_hw_list.py
1
2177
from __future__ import print_function import glob import hw_sungyong_list import os # os.chdir("homework_01") list_a = [10, 30, 40, -20, 15] list_b = [-90, 20, 50, 2, 4] list_c = ['hello', 34, 0, 12] num_p = 3 num_q = 7 sy_a = hw_sungyong_list.square_of_list(list_a, num_p) sy_b = hw_sungyong_list.square_of_list(li...
mit
4,742,109,069,305,678,000
19.403846
82
0.573314
false
hschilling/CADRE-1
src/CADRE/test/test_assembly.py
1
9717
""" Run the CADRE model and make sure the value compare to the saved pickle.""" from __future__ import print_function import os import pickle import unittest import warnings import numpy as np from openmdao.core.problem import Problem from CADRE.CADRE_group import CADRE # Ignore the numerical warnings from perfor...
apache-2.0
-7,118,911,251,664,067,000
23.979434
79
0.571164
false
yostashiro/awo-custom
sale_line_quant_extended/wizard/stock_return_picking.py
1
1645
# -*- coding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2016 Rooms For (Hong Kong) Limited T/A OSCG # <https://www.odoo-asia.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publishe...
lgpl-3.0
-1,805,168,410,514,851,300
43.459459
77
0.642553
false
steelsoul/hide_to_tray
interface5.py
1
5039
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'interface.ui' # # Created by: PyQt5 UI code generator 5.14.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): Main...
gpl-3.0
8,543,905,054,595,443,000
50.418367
112
0.71919
false
alex3287/PyCharmProjects
project/parser_1.py
1
2603
# Парсер для сбора внешних ссылок с сайта from urllib.request import urlopen from urllib.error import HTTPError from bs4 import BeautifulSoup url = 'http://gymn11.ru' def get_html(url): '''Считывает страницу в html''' try: html = urlopen(url) except: print('нет сайта такого') re...
gpl-3.0
583,739,816,110,222,500
22.2
55
0.539025
false
cobbler/cobbler
tests/template_api_test.py
1
2372
import pytest from cobbler.template_api import CobblerTemplate class TestCobblerTemplate: def test_compile(self): # Arrange # Act compiled_template = CobblerTemplate(searchList=[{"autoinstall_snippets_dir": "/var/lib/cobbler/snippets"}]) \ .compile(source="$test") res...
gpl-2.0
8,403,558,537,794,590,000
29.805195
117
0.605396
false
TheLazyHase/dragon_dice_simulator
business/dice/face/save_with_special/counter.py
1
1773
# -*- coding: utf-8 *-* # Copyright (c) 2013 Tisserant Pierre # # This file is part of Dragon dice simulator. # # Dragon dice simulator 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 Software Foundation, either ve...
gpl-3.0
-6,605,072,641,197,626,000
33.764706
83
0.646926
false
jimstorch/tokp
tokp_lib/system_rules.py
1
1980
#------------------------------------------------------------------------------ # File: system_rules.py # Purpose: # Author: James Mynderse # Revised: # License: GPLv3 see LICENSE.TXT #------------------------------------------------------------------------------ import datetime ...
gpl-3.0
7,329,093,138,148,140,000
32.172414
79
0.554545
false
WaveBlocks/WaveBlocksND
WaveBlocksND/IOM_plugin_lincombwp.py
1
13903
"""The WaveBlocks Project IOM plugin providing functions for handling linear combinations of general wavepackets. @author: R. Bourquin @copyright: Copyright (C) 2013, 2016 R. Bourquin @license: Modified BSD License """ import numpy as np def add_lincombwp(self, parameters, timeslots=None, lincombsize=None, blockid...
bsd-3-clause
-8,754,087,416,531,690,000
36.474394
130
0.662519
false
Chaffleson/blupy
blupy/settings.py
1
4657
""" Django settings for blupy project. Generated by 'django-admin startproject' using Django 1.8.4. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
gpl-2.0
-8,794,081,472,193,870,000
29.84106
101
0.704316
false
sburnett/seattle
production_nat_new/test/ut_newnatdeployed_legacywithnormalclient.py
1
1401
""" One server connects to a deployed forwarder One legacy client connects to the server One new client connects to the server A few messages are exchanged """ #pragma repy restrictions.normal include NatForwardingShim.repy include NATLayer_rpc.repy def response(remote_ip,remote_port,sock,th,listenhandle): try...
mit
6,065,202,797,805,868,000
18.191781
60
0.670236
false
ikumen/project-euler
solutions/013.py
1
1047
#!/usr/bin/env python ''' 013.py: https://projecteuler.net/problem=13 Large Sum Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 ... 208496039801340017239306716668235552452528...
mit
-689,761,490,315,390,700
22.795455
87
0.723018
false
cokelaer/colormap
src/colormap/colors.py
1
32584
# -*- python -*- # -*- coding: utf-8 -*- # # This file is part of the colormap software # # Copyright (c) 2011-20134 # # File author(s): Thomas Cokelaer <cokelaer@gmail.com> # # Distributed under the GPLv3 License. # See accompanying file LICENSE.txt or copy at # http://www.gnu.org/licenses/gpl-3.0.html # # ...
bsd-3-clause
-6,709,208,497,947,145,000
31.879919
158
0.56049
false
UltronAI/Deep-Learning
Pattern-Recognition/hw2-Feature-Selection/skfeature/example/test_chi_square.py
1
1627
import scipy.io from sklearn.metrics import accuracy_score from sklearn import cross_validation from sklearn import svm from skfeature.function.statistical_based import chi_square def main(): # load data mat = scipy.io.loadmat('../data/BASEHOCK.mat') X = mat['X'] # data X = X.astype(floa...
mit
7,051,745,803,490,119,000
31.244898
89
0.635526
false
ekarlso/partizan
tests/functional/v1/test_category.py
1
2709
# -*- encoding: utf-8 -*- # # 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...
apache-2.0
-6,247,913,441,934,495,000
29.438202
78
0.58804
false
ngsxfem/ngsxfem
demos/fictdom.py
1
4669
""" In this example we solve a scalar *unfitted* PDE problem. As a discretisation method we use a level set based geometry description and a Cut (or Fictitious) Finite element method with a Nitsche formulation to impose boundary conditions. For stability we add a ghost penalty stabilization. Domain: ------- The domain...
lgpl-3.0
5,536,156,285,712,531,000
30.533784
79
0.674095
false
Esri/raster-functions
functions/PercentAboveThreshold.py
1
5988
import numpy as np from datetime import timedelta import datetime #import sys #import os #import pickle #debug_logs_directory = class PercentAboveThreshold(): def __init__(self): self.name = 'Percent Above or Below Threshold' self.description = 'Calculates the percentage of pixels that are above...
apache-2.0
2,665,880,069,612,288,500
38.92
119
0.559619
false
jarvisqi/nlp_learn
gensim/text.py
1
2054
import jieba import pandas as pd from gensim import corpora, models, similarities # 训练样本 raw_documents = [ '0无偿居间介绍买卖毒品的行为应如何定性', '1吸毒男动态持有大量毒品的行为该如何认定', '2如何区分是非法种植毒品原植物罪还是非法制造毒品罪', '3为毒贩贩卖毒品提供帮助构成贩卖毒品罪', '4将自己吸食的毒品原价转让给朋友吸食的行为该如何认定', '5为获报酬帮人购买毒品的行为该如何认定', '6毒贩出狱后再次够买毒品途中被抓的行为认定', '7虚...
mit
-1,880,925,002,496,043,800
27.755556
86
0.704791
false
FlemingResearch/Indra
pkg/eventsProcessor.py
1
4484
#!/usr/bin/env python # # developed by Sergey Markelov (2013) # import random import subprocess from config import Config, BingRewardsReportItem class EventsProcessor: """ Processes events declared in config.xml """ OK = 0 RETRY = 1 def __init__(self, config, reportItem): if conf...
mit
-6,217,829,494,796,182,000
32.969697
128
0.627342
false
frmdstryr/enamlx
enamlx/qt/qt_tree_view.py
1
8321
# -*- coding: utf-8 -*- """ Copyright (c) 2015, Jairus Martin. Distributed under the terms of the MIT License. The full license is in the file COPYING.txt, distributed with this software. Created on Aug 28, 2015 """ from atom.api import ( Typed, Instance, Property, Int ) from enamlx.qt.qt_abstract_item_view import ...
mit
-3,384,336,813,083,965,000
32.552419
79
0.592717
false
soarlab/FPTaylor
benchmarks/toplas/print_results.py
1
4016
#!/usr/bin/env python import sys import os import glob import decimal import argparse parser = argparse.ArgumentParser( description="Prints out results of FPTaylor experiments (from the log directory)") parser.add_argument('--prec', type=int, default=2, help="precision of printed results") p...
mit
-7,073,710,044,295,486,000
25.596026
97
0.525149
false
scrapinghub/dateparser
dateparser/data/date_translation_data/sg.py
1
2622
info = { "name": "sg", "date_order": "DMY", "january": [ "nye", "nyenye" ], "february": [ "ful", "fulundïgi" ], "march": [ "mbä", "mbängü" ], "april": [ "ngu", "ngubùe" ], "may": [ "bêl", "bêläwü"...
bsd-3-clause
7,045,914,109,901,481,000
14.242604
26
0.26514
false
dcramer/taskmaster
src/taskmaster/progressbar.py
1
1033
""" taskmaster.progressbar ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ from __future__ import absolute_import from progressbar import ProgressBar, UnknownLength, Counter, Timer from progressbar.widgets import Widget class Speed(Widget): 'W...
apache-2.0
8,523,526,974,073,646,000
21.955556
69
0.617619
false
Pyomo/PyomoGallery
test_notebooks.py
1
4863
# # Jupyter notebook testing logic adapted from # https://gist.github.com/lheagy/f216db7220713329eb3fc1c2cd3c7826 # # The MIT License (MIT) # # Copyright (c) 2016 Lindsey Heagy # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "...
bsd-2-clause
7,526,504,506,299,258,000
33.985612
146
0.660703
false
max291/RLScore
rlscore/measure/auc_measure.py
1
2659
import operator import numpy as np from rlscore.measure.measure_utilities import UndefinedPerformance from measure_utilities import multitask from rlscore.utilities import array_tools def auc_singletask(Y, P): #the implementation has n(log(n)) time complexity #P: predicted labels #Y: true labels, y_i \in ...
mit
-3,690,062,520,798,114,300
31.426829
79
0.618654
false
fahadkaleem/DataStructures
LinkedList/Problems/nthNodeFromEndOfLinkedList/Solution2.py
1
2551
""" Author: Mohammed Fahad Kaleem Problem: Find the nth node from the end of Linked List Method: Maintain two pointers 1. Reference pointer and main pointer. 2. Initialize both reference and main pointers to head. 3. First move reference pointer to n nodes from head. 4. Move both pointers one by one until reference ...
mit
3,686,608,701,181,479,400
28.321839
73
0.588397
false
pashango2/sphinx-explorer
sphinx_explorer/python_venv/tasks.py
1
3544
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import, unicode_literals from qtpy.QtCore import * # from qtpy.QtWidgets import * import re import logging from sphinx_explorer.util.commander import Commander logger = logging.getLogger(__name__) class PipInstallT...
mit
8,971,301,953,340,769,000
30.642857
105
0.582111
false
gratipay/gratipay.com
gratipay/elsewhere/__init__.py
1
12580
"""This subpackage contains functionality for working with accounts elsewhere. """ from __future__ import division, print_function, unicode_literals from collections import OrderedDict from datetime import datetime import hashlib import json import logging from urllib import quote from urlparse import urlparse, urlunp...
mit
8,522,709,110,932,166,000
36.440476
112
0.592289
false
jamesmcm/cryptopals
basic.py
1
9677
from math import sqrt from numpy import mean from Crypto.Cipher import AES import operator hexd={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"a":10,"b":11,"c":12,"d":13,"e":14,"f":15} b64d={0:"A",16:"Q",32:"g",48:"w",1:"B",17:"R",33:"h",49:"x",2:"C",18:"S",34:"i",50:"y",3:"D",19:"T",35:"j",51:"z",4:"E...
gpl-2.0
-7,439,320,829,853,359,000
27.461765
444
0.521959
false
gprakhar/scripts-biopython
hmmer-pipeline-DPM_Dicty.py
1
1173
#Script to rum Hmmer on Dicty Protiens #Run it keeping in mind that HMM(s) from a particular DPM human holmolog protien are all checked against every Protien from Dicty #Author : prakhar gaur #date : Wed 16 July IST 2015 import os import argparse import csv parser = argparse.ArgumentParser() parser.add_argument('-C',...
gpl-3.0
-1,187,990,765,733,363,000
38.1
178
0.736573
false
kindkaktus/CcPy
ccpy/ccpystate.py
1
4899
# # Andrei Korostelev <andrei at korostelev dot net> # # Before using this product in any way please read the license agreement. # If you do not agree to the terms in this agreement you are not allowed # to use this product or parts of it. You can read this license in the # file named LICENSE. # """ Ccpy state "...
bsd-3-clause
-6,498,245,015,245,778,000
40.168067
95
0.569708
false
ocelot-collab/ocelot
unit_tests/ebeam_test/dba_tracking/dba_tracking_conf.py
1
1026
"""Test parameters description""" import pytest from ocelot import * """lattice elements descripteion""" Q1 = Quadrupole(l=0.4, k1=-1.3, eid="Q1") Q2 = Quadrupole(l=0.8, k1=1.4, eid="Q2") Q3 = Quadrupole(l=0.4, k1=-1.7, eid="Q3") Q4 = Quadrupole(l=0.5, k1=1.19250444829, eid="Q4") B = Bend(l=2.7, k1=-.06, angle=2*p...
gpl-3.0
2,305,508,052,010,516,700
24.02439
116
0.61306
false
kepstin/picard
picard/util/tags.py
1
3767
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2007 Lukáš Lalinský # # 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 2 # of the License...
gpl-2.0
5,036,923,362,161,006,000
35.192308
80
0.591923
false
mjsauvinen/P4UL
pyLib/netcdfTools.py
1
11278
#!/usr/bin/env python3 import netCDF4 as nc import sys import argparse import numpy as np from utilities import partialMatchFromList debug = True # =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* def asciiEncode(uList, uStr): n = len(uList) if(n > 0): uList = list(uList) # This might be a tuple coming...
mit
-815,513,492,057,849,600
27.917949
124
0.561092
false
clemsos/mitras
tests/test_clustering.py
1
1207
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import numpy as np from test_helpers import TestHelpers helpers=TestHelpers() helpers.add_relative_path() from lib.api import Similarity_API from lib.clusters import get_linkage_matrix from time import time # from scipy.cluster.hierarchy import linkage,...
mit
-5,519,701,892,024,718,000
23.16
121
0.763877
false
tecnologiaenegocios/tn.plonehtmlimagecache
src/tn/plonehtmlimagecache/tests/test_behaviors.py
1
5640
from Products.CMFDefault.Document import Document from plone.behavior.interfaces import IBehavior from plone.behavior.interfaces import IBehaviorAssignable from plone.directives.form import IFormFieldProvider from tn.plonehtmlimagecache import behaviors from tn.plonehtmlimagecache import interfaces from tn.plonehtmlima...
bsd-3-clause
-311,616,254,257,620,030
36.350993
83
0.694326
false
nafitzgerald/allennlp
allennlp/modules/alternating_highway_lstm.py
1
13051
from typing import Tuple from overrides import overrides import torch from torch.autograd import Function, Variable from torch.nn import Parameter from torch.nn.utils.rnn import PackedSequence, pad_packed_sequence, pack_padded_sequence from allennlp.nn.initializers import block_orthogonal from allennlp.custom_extensi...
apache-2.0
-5,288,858,517,103,349,000
49.003831
109
0.534365
false
felgari/k2
report.py
1
10700
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2017 Felipe Gallego. All rights reserved. # # This 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 ...
gpl-3.0
-4,561,189,203,595,888,600
38.487085
96
0.38028
false
nvbn/coviolations_web
projects/forms.py
1
1067
from pymongo import DESCENDING from django import forms from tasks.models import Tasks from tasks.exceptions import TaskDoesNotExists from .models import Project class FindTaskForBadgeForm(forms.Form): """Find task for badge form""" project = forms.ModelChoiceField( Project.objects.all(), required=Tru...
mit
-7,728,021,554,287,230,000
31.333333
70
0.605436
false
aliceinwire/virt-manager
virtManager/inspection.py
1
9120
# # Copyright (C) 2011 Red Hat, Inc. # # 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 2 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-2.0
184,982,375,710,807,000
33.157303
79
0.539035
false
scikit-garden/scikit-garden
skgarden/quantile/tests/test_tree.py
1
2933
import numpy as np from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split from numpy.testing import assert_array_almost_equal from skgarden.quantile import DecisionTreeQuantileRegressor from skgarden.quantile import ExtraTreeQuantileRegressor from skgarden.quantile.utils import w...
bsd-3-clause
3,495,671,320,194,699,300
33.916667
74
0.595295
false
chunshen1987/superMC
scripts/generateEbeprofiles.py
1
11849
#! /usr/bin/env python import sys, shutil from numpy import * from os import path, makedirs import subprocess import re from glob import glob class color: """ define colors in the terminal """ purple = '\033[95m' cyan = '\033[96m' darkcyan = '\033[36m' blue = '\033[94m' green = '\033[9...
gpl-3.0
1,107,092,717,768,073,200
34.160237
85
0.545025
false
sonusz/PhasorToolBox
examples/freq_meter.py
1
1820
#!/usr/bin/env python3 """ This is an real-time frequency meter of two PMUs. This code connects to two PMUs, plot the frequency of the past 300 time-stamps and update the plot in real-time. """ from phasortoolbox import PDC,Client import matplotlib.pyplot as plt import numpy as np import gc import logging logging.bas...
mit
5,007,648,745,987,173,000
29.847458
112
0.606044
false
KenKundert/quantiphy
tests/test_extract.py
1
11090
# encoding: utf8 import math from math import pi from textwrap import dedent import pytest from quantiphy import Quantity, add_constant def test_workout(): Quantity.reset_prefs() qs = Quantity.extract( r""" Fclk = 50MHz -- clock frequency This is an arbitrary line of te...
gpl-3.0
5,471,605,463,591,412,000
28.830189
100
0.552905
false
Nexedi/neoppod
neo/master/handlers/client.py
1
6146
# # Copyright (C) 2006-2019 Nexedi SA # 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 2 # of the License, or (at your option) any later version. # # This program is distributed ...
gpl-2.0
2,060,158,760,011,242,200
39.701987
81
0.642857
false
silinternational/idp-pw-ui
selenium-test/tests/test_se.py
1
7262
from .base_test import * import time @on_platforms(browsers) class SeTest(BaseTest): def assertTextByTag(self, tag, text): max_attempts = 60 while (max_attempts > 0): try: name = self.driver.find_element_by_tag_name(tag) assert text in name.text ...
mit
-1,470,806,640,687,275,300
39.797753
86
0.626274
false
alex-dot/upwdchg
backend/UPwdChg/Util/__init__.py
2
1247
#!/usr/bin/env python # -*- mode:python; tab-width:4; c-basic-offset:4; intent-tabs-mode:nil; -*- # ex: filetype=python tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent smartindent # # Universal Password Changer (UPwdChg) # Copyright (C) 2014-2018 Cedric Dufour <http://cedric.dufour.name> # Author: Cedric Duf...
gpl-3.0
-1,586,562,051,378,027,300
39.225806
91
0.668805
false
Code4SA/municipal-data
bin/materialised_views.py
1
12424
""" A script to build a set files of materialised views of the data presented in municipality profiles on the Municipal Money website. Municipality-specific profile data is stored in municipality-specific files since producing them takes a lot of time with many queries against the API. By storing municipality-specific...
mit
7,838,789,445,039,154,000
38.44127
125
0.632325
false
damoxc/vmail
vmail/tests/test_core.py
1
6682
import time from nose.tools import raises from vmail.error import DomainNotFoundError from vmail.error import ForwardNotFoundError from vmail.error import UserNotFoundError from vmail.error import VmailCoreError from vmail.tests import test class TestCoreSMTP(test.DaemonUnitTest): def test_authenticate(self): ...
gpl-3.0
1,304,521,197,937,086,000
40
97
0.658186
false
jdsika/TUM_HOly
openrave/sandbox/debugik.py
1
53228
# 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 the...
mit
2,666,996,518,185,427,500
45.446771
328
0.525626
false
jezdez/hirefire
hirefire/procs/hotqueue.py
1
1845
from __future__ import absolute_import from hotqueue import HotQueue from . import ClientProc class HotQueueProc(ClientProc): """ A proc class for the `HotQueue <http://richardhenry.github.com/hotqueue/>`_ library. :param name: the name of the proc (required) :param queues: list of queue names ...
bsd-3-clause
-1,827,444,227,618,777,600
28.285714
72
0.598374
false
kootenpv/brightml
brightml/timer.py
1
1228
import time class ZmqTimerManager(object): def __init__(self): self.timers = [] self.next_call = 0 def add_timer(self, timer): self.timers.append(timer) def check(self): if time.time() > self.next_call: for timer in self.timers: timer.check() ...
mit
6,674,582,009,593,183,000
25.695652
59
0.517101
false
larrybradley/astropy-helpers
astropy_helpers/sphinx/ext/edit_on_github.py
1
5898
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This extension makes it easy to edit documentation on github. It adds links associated with each docstring that go to the corresponding view source page on Github. From there, the user can push the "Edit" button, edit the docstring, and submit a pull...
bsd-3-clause
-1,403,147,038,377,882,000
34.745455
77
0.603934
false
google/rekall
rekall-core/rekall/plugins/windows/pfn.py
1
19615
from __future__ import division # Rekall Memory Forensics # # Copyright 2013 Google Inc. All Rights Reserved. # # Authors: # Michael Cohen <scudette@gmail.com> # # 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 Softw...
gpl-2.0
-8,307,783,502,107,839,000
35.056985
95
0.582462
false
socialsensor/community-evolution-analysis
matlab/python_data_parsing/json_mention_multifile_noDialog_crawler.py
1
2244
#------------------------------------------------------------------------------- # Purpose: parsing data from the crawler's "rawmetadata.json.#" json files to a form: # author mentioned1,mentioned2,... unixTimestamp + text \n # creating as many txt files as there are json files. # T...
apache-2.0
3,282,412,746,953,365,500
43.88
145
0.559269
false
tyrylu/pyfmodex
pyfmodex/studio/event_description.py
1
1936
"""The description for an FMOD Studio Event.""" from ctypes import byref, c_int, c_void_p, create_string_buffer from .event_instance import EventInstance from .studio_object import StudioObject from .enums import LOADING_STATE class EventDescription(StudioObject): """The description for an FMOD Studio Event. ...
mit
-1,565,802,748,173,493,800
32.982456
78
0.657541
false