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
ericholscher/django
tests/i18n/commands/extraction.py
1
23225
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import io import os import re import shutil from unittest import SkipTest import warnings from django.core import management from django.test import SimpleTestCase from django.utils.encoding import force_text from django.utils._os import upath from dja...
bsd-3-clause
-4,133,988,649,466,463,700
46.861856
194
0.629949
false
dchirikov/luna
contrib/ansible/modules/clustering/luna_bmcsetup.py
1
2793
#!/usr/bin/python from ansible.module_utils.basic import AnsibleModule from ansible.errors import AnsibleError try: import luna except ImportError: raise AnsibleError("luna is not installed") from luna_ansible.helpers import StreamStringLogger import logging if luna.__version__ != '1.2': raise AnsibleEr...
gpl-3.0
-39,312,346,139,698,100
26.653465
79
0.557465
false
NSLS-II-XPD/ipython_ophyd
archived/profile_collection-dan/startup/999-load.py
1
1271
import os from xpdacq.new_xpdacq.glbl import glbl from xpdacq.new_xpdacq.beamtimeSetup import (start_xpdacq, _start_beamtime, _end_beamtime) from xpdacq.new_xpdacq.beamtime import * if not glbl._is_simulation: glbl.area_det = pe1c glbl.shutter = shctl1 glbl.tem...
bsd-2-clause
-1,813,804,392,914,363,100
27.244444
75
0.714398
false
95subodh/Leetcode
376. Wiggle Subsequence.py
1
1580
#A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with fewer than two elements is trivially a wiggle sequence. # #For example, [1,7,4,9,2,5...
mit
877,606,916,788,035,800
46.909091
301
0.724684
false
a4a881d4/fs45g
fs45g/fs45gstat.py
1
1031
import fuse class fs45gStat(fuse.Stat): def __init__(self): self.st_mode = 0 self.st_ino = 0 self.st_dev = 0 self.st_nlink = 0 self.st_uid = 0 self.st_gid = 0 self.st_size = 0 self.st_atime = 0 self.st_mtime = 0 self.st_ctime = 0 class fs45gROStat(fs45gStat): def __init__(self, clone, uid, gid):...
apache-2.0
-6,573,624,865,860,555,000
31.21875
63
0.659554
false
dAck2cC2/m3e
build_legacy/tools/findleaves.py
1
3628
#!/usr/bin/env python # # Copyright (C) 2009 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...
apache-2.0
5,406,521,903,935,846,000
27.566929
82
0.595645
false
NicovincX2/Python-3.5
Statistiques/Estimation (statistique)/Régression/bay_ridge_OLS.py
1
2049
# -*- coding: utf-8 -*- import os import numpy as np import matplotlib.pyplot as plt from scipy import stats from sklearn.linear_model import BayesianRidge, LinearRegression ############################################################################### # Generating simulated data with Gaussian weigthts np.random.se...
gpl-3.0
3,795,073,158,633,134,000
31.52381
79
0.63348
false
variablehair/Eggplantato
discord/ext/commands/bot.py
1
26536
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2017 Rapptz 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 u...
mit
-222,379,513,342,976,670
32.17
123
0.599525
false
kevinpt/symbolator
symbolator_sphinx/symbolator_sphinx.py
1
11655
# -*- coding: utf-8 -*- """ symbolator_sphinx ~~~~~~~~~~~~~~~~~ Allow symbolator-formatted graphs to be included in Sphinx-generated documents inline. Derived from sphinx.ext.graphviz. :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE.Sphinx f...
mit
-7,638,436,865,975,615,000
35.083591
120
0.599399
false
DOAJ/doaj
doajtest/unit/test_upgrade.py
1
2252
import json import time import re from collections import OrderedDict from doajtest.helpers import DoajTestCase from portality import models from portality.upgrade import do_upgrade from portality.lib.paths import rel2abs def operation(journal): j = models.Journal.pull(journal.id) bj = j.bibjson() bj.titl...
apache-2.0
5,705,412,087,984,378,000
27.506329
85
0.567496
false
ESOedX/edx-platform
openedx/core/djangoapps/schedules/management/commands/tests/test_send_course_update.py
1
4396
""" Tests for send_course_update management command. """ from __future__ import absolute_import from unittest import skipUnless import ddt from django.conf import settings from edx_ace.utils.date import serialize from mock import patch from six.moves import range from openedx.core.djangoapps.schedules import resolve...
agpl-3.0
-5,302,609,191,891,175,000
42.96
126
0.734531
false
scriptnull/coala
coalib/parsing/DefaultArgParser.py
1
6420
import argparse from coalib.misc import Constants def default_arg_parser(formatter_class=None): formatter_class = formatter_class or argparse.RawDescriptionHelpFormatter arg_parser = argparse.ArgumentParser( formatter_class=formatter_class, prog="coala", description="coala is a simple...
agpl-3.0
3,654,604,630,600,306,000
44.211268
79
0.40405
false
zstackio/zstack-woodpecker
integrationtest/vm/multihosts/multiPrimaryStorage/test_one_ps_disabled.py
1
4290
''' @author: FangSun ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.primarystorage_operations as ps_ops import random _config_ = { 'timeout' : 3000, 'noparallel' : True ...
apache-2.0
197,871,456,999,399,580
41.475248
140
0.622378
false
PetroWu/AutoPortraitMatting
portrait.py
1
8570
import numpy as np import scipy.io as sio import os from PIL import Image class BatchDatset: imgs = [] max_batch = 0 batch_size = 0 cur_imgs = [] cur_labels = [] cur_batch = 0 # index of batch generated cur_ind = 0 # index of current image in imgs img_width = 600 img_height = 800 ...
apache-2.0
5,070,734,809,259,799,000
42.72449
149
0.502684
false
query/mt-submissions
hw2-decoding/decode.py
1
7691
#!/usr/bin/env python """A translation decoder.""" from collections import defaultdict, namedtuple import models Hypothesis = namedtuple('Hypothesis', ['logprob', 'future_cost', 'coverage', 'lm_state', 'predecessor', 'candidate']) def decode(tm, lm, source_sentence...
mit
-7,950,587,443,624,482,000
45.896341
76
0.52854
false
michaellaier/pymor
src/pymor/basic.py
1
3271
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) """This module imports some commonly used methods and classes. You can use ``from pymor.basic import *`` in inter...
bsd-2-clause
1,916,091,494,274,894,800
50.920635
118
0.819016
false
paolodoz/timesheet
embedded/modwsgi.py
1
1518
#!/usr/bin/env python import cherrypy, logging import sys, os # Suppose this file in installation_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) sys.path.insert(0, installation_path) from core.routes.routes import Routes from core.config import conf_server, conf_static, conf_logging def...
gpl-2.0
-6,801,214,810,711,781,000
35.142857
100
0.732543
false
dwaiter/django-filebrowser-old
filebrowser/views.py
1
19478
# coding: utf-8 # general imports import itertools, os, re from time import gmtime, strftime # django imports from django.shortcuts import render_to_response, HttpResponse from django.template import RequestContext as Context from django.http import HttpResponseRedirect from django.contrib.admin.views.decorators impo...
bsd-3-clause
-3,435,572,908,903,204,000
38.509128
186
0.599446
false
KSchopmeyer/smipyping
tests/test_logging.py
1
3914
#!/usr/bin/env python # (C) Copyright 2017 Inova Development Inc. # 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 # # ...
mit
7,747,978,183,615,586,000
31.616667
77
0.619315
false
SlashRoot/WHAT
what_apps/contact/migrations/0002_auto__add_field_phonenumber_spam.py
1
10616
# -*- coding: utf-8 -*- import 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 'PhoneNumber.spam' db.add_column(u'contact_phonenumber', 'spam', self.g...
mit
-4,250,237,107,527,121,400
70.255034
198
0.547287
false
onepercentclub/onepercentclub-site
apps/vouchers/models.py
1
4574
import random from django.conf import settings from django.db import models from django.utils.translation import ugettext as _ from django_extensions.db.fields import ModificationDateTimeField, CreationDateTimeField from djchoices import DjangoChoices, ChoiceItem from .mails import mail_new_voucher class VoucherStatu...
bsd-3-clause
1,365,753,965,112,462,600
46.645833
146
0.691517
false
Bobobol/nemubot-1
tools/web.py
1
5191
# coding=utf-8 # Nemubot is a modulable IRC bot, built around XML configuration files. # Copyright (C) 2012 Mercier Pierre-Olivier # # This program 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, eith...
agpl-3.0
6,018,492,426,457,182,000
29.535294
78
0.592949
false
ushatil/wellness-tracker
ws/wellspring/services/vest_service.py
1
1420
import logging from wellspring.models import VestSection, VestSubSection LOGGER = logging.getLogger(__name__) VEST_SECTIONS = { "EQUILIBRIUM" : ["SCHOOL", "SELF", "HOME", "WORK"], "SUPPORT" : ["PROFESSIONALS", "FAMILY", "FRIENDS", "COLLEAGUES"], "LIFESTYLE" ...
mit
4,386,219,538,674,025,000
35.435897
87
0.671831
false
frdwrd/bifocal
bifocal/models/transaction.py
1
3366
# Copyright (c) 2013-2015, Vehbi Sinan Tunalioglu <vst@vsthost.com> # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # noti...
agpl-3.0
6,468,546,355,782,887,000
32.326733
77
0.645276
false
ntim/g4sipm
sample/run/luigi/contrib/afterpulse.py
1
3367
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from ROOT import TH1, Double, ROOT, TF1 def prob_dist_1comp(x, par): dt = x[0] amp = par[0] pL = par[1] tauL = par[2] tauTh = par[3] T = np.exp(-dt / tauTh) L = np.exp(-dt / tauL) pTot = 0 pTot += T * (1. - pL) / tauTh...
gpl-3.0
-5,261,657,332,472,781,000
40.567901
153
0.610039
false
cedadev/cloudhands-burst
cloudhands/burst/agent.py
1
2328
#!/usr/bin/env python # encoding: UTF-8 import asyncio from collections import namedtuple try: from functools import singledispatch except ImportError: from singledispatch import singledispatch import logging import sqlite3 import warnings from cloudhands.common.connectors import initialise from cloudhands.c...
bsd-3-clause
-3,134,247,760,245,154,000
27.048193
75
0.60567
false
orlenko/bccf
src/django_cron/timezone.py
1
8256
"""Timezone helper functions. This module uses pytz when it's available and fallbacks when it isn't. """ from datetime import datetime, timedelta, tzinfo from threading import local import time as _time try: import pytz except ImportError: pytz = None from django.conf import settings __all__ = [ 'utc',...
unlicense
6,542,756,796,065,424,000
27.277397
81
0.645833
false
asphalt-framework/asphalt-web
asphalt/web/rpc/xmlrpc/serialization.py
1
4239
import math from base64 import b64encode, b64decode from collections import OrderedDict from collections.abc import Sequence, Mapping from datetime import date, datetime from typing import List, Dict, Any from xml.sax.saxutils import escape from asphalt.core.utils import qualified_name from lxml.etree import Element ...
apache-2.0
5,541,318,617,819,902,000
25.166667
94
0.671621
false
packagecontrol/st_package_reviewer
st_package_reviewer/check/file/check_redundant_files.py
2
1795
import logging from . import FileChecker l = logging.getLogger(__name__) class CheckPackageMetadata(FileChecker): def check(self): if self.sub_path("package-metadata.json").is_file(): self.fail("'package-metadata.json' is supposed to be automatically generated " "by Pa...
mit
7,026,769,167,104,673,000
27.492063
99
0.597214
false
HazyResearch/dd-genomics
archived/v1/code/gene_pheno_pairs.py
1
2378
import ddext from ddext import SD def init(): ddext.input('doc_id', 'text') ddext.input('sent_id_1', 'int') ddext.input('mention_id_1', 'text') ddext.input('wordidxs_1', 'int[]') ddext.input('words_1', 'text[]') ddext.input('entity_1', 'text') ddext.input('type_1', 'text') ddext.input('correct_1', 'bo...
apache-2.0
-2,130,952,374,785,913,000
29.101266
168
0.584945
false
dgouldin/djangocon-eu-2015
djapi/api/url_registry.py
2
2925
import types from collections import defaultdict from functools import wraps from urlparse import urljoin from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse, NoReverseMatch LIST_METHODS = ('POST',) DETAIL_METHODS = ('PUT', 'PATCH', 'DELETE',) ALL_METHODS = LIST_ME...
mit
-4,767,235,335,549,177,000
30.451613
88
0.681709
false
jarod-w/ocsetup
ocsetup/sshcmd.py
1
1977
#!/usr/bin/env python import pexpect import sys import gtk from ovirtnode.ovirtfunctions import log class PopupEntry(gtk.Dialog): def __init__(self, label="", title="", parent=None, flags=0, buttons=None): super(PopupEntry, self).__init__(title, parent, flags, buttons) self.hbox = gtk.HBox() ...
gpl-2.0
-8,240,140,385,106,602,000
28.954545
79
0.528073
false
PyBossa/pybossa
test/test_s3_client.py
1
5554
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 Scifabric LTD. # # PYBOSSA 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 License, or # (at your op...
agpl-3.0
-8,953,775,506,088,436,000
37.041096
105
0.620274
false
LastAvenger/labots
labots/config/config.py
1
3322
import logging import yaml from typing import Dict from labots.config import checker from labots.common import meta # Initialize logging logger = logging.getLogger(__name__) class AttrDict(dict): def __init__(self, *args, **kwargs): super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = ...
gpl-3.0
1,553,425,372,541,772,800
34.340426
70
0.491872
false
gemrb/iesh
infinity/formats/gam_v22.py
1
31222
# -*-python-*- # ie_shell.py - Simple shell for Infinity Engine-based game files # Copyright (C) 2004-2009 by Jaroslav Benkovsky, <edheldil@users.sf.net> # # 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 Fo...
gpl-2.0
2,371,619,244,215,804,400
28.877512
123
0.394818
false
jmcallister47/trailcam
night/motion-camera.py
1
1673
#!/usr/bin/env python '''Script that manages motion sensor, camera module and light When motion is detected, turn on infrared light, take and save picture, turn off light Maximum of one picture every 4 seconds''' from gpiozero import MotionSensor import subprocess from datetime import datetime from time import sl...
gpl-3.0
-4,917,927,044,453,764,000
31.803922
104
0.608488
false
kaochiuan/HsinchuCityWebsite
HsinchuCityWebsite/HsinchuCityWebsite/app/views.py
1
19767
""" Definition of views. """ from django.shortcuts import render from django.http import HttpResponse from django.http import HttpRequest from django.template import RequestContext from datetime import datetime from datetime import date from django.http.response import HttpResponse import urllib.request import json i...
mit
9,109,989,609,018,349,000
41.778022
173
0.602631
false
reinforceio/tensorforce
test/test_seed.py
1
5230
# Copyright 2020 Tensorforce Team. 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 applicable la...
apache-2.0
6,577,528,081,546,557,000
39.230769
92
0.585468
false
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py
1
2689
# 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 ...
mit
6,033,418,252,891,552,000
39.134328
78
0.612495
false
poondog/kangaroo-m7-mkv
scripts/gcc-wrapper.py
1
3884
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, Code Aurora Forum. 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 a...
gpl-2.0
3,073,904,154,896,566,300
32.482759
97
0.664779
false
alican/django-tus
django_tus/response.py
1
1169
from django.conf import settings from django.http import HttpResponse from django_tus import tus_api_version, tus_api_version_supported, tus_api_extensions class TusResponse(HttpResponse): _base_tus_headers = { 'Tus-Resumable': tus_api_version, 'Tus-Version': ",".join(tus_api_version_supported), ...
mit
-2,560,518,202,457,547,000
39.310345
122
0.655261
false
cemagg/sucem-fem
sandbox/flux_calc/plotty.py
1
1219
from __future__ import division import pylab import numpy as np import run_data reload(run_data) def get_unit_gradients(resdict, ind=0, op=lambda x: x): return dict((k, np.gradient(op(v[ind]))) for k,v in resdict.iteritems()) def get_gradients(resdict, op1=lambda x: x, op2=lambda x: x): retur...
gpl-3.0
247,746,161,481,558,900
32.861111
68
0.647252
false
astrilchuk/sd2xmltv
libschedulesdirect/common/servicecountry.py
1
1174
import logging class ServiceCountry(object): def __init__(self): self.full_name = None # type: unicode self.short_name = None # type: unicode self.postal_code_example = None # type: unicode self.postal_code_regex = None # type: unicode self.one_postal_code = False ...
mit
825,535,162,735,604,700
26.302326
94
0.580068
false
morrisonlevi/FrameworkBenchmarks
toolset/setup/linux/installer.py
1
25198
import subprocess import os import time import traceback import sys class Installer: ############################################################ # install_software ############################################################ def install_software(self): if self.benchmarker.install == 'all' or self.benchma...
bsd-3-clause
2,867,191,256,785,626,600
39.38141
575
0.567743
false
bdang2012/taiga-back-casting
tests/integration/test_userstorage_api.py
1
7073
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2015 Anler Hernández <hello@anler.me> # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
6,088,007,013,867,954,000
39.4
93
0.695757
false
glomex/gcdt-lookups
setup.py
1
1606
from setuptools import setup, find_packages from codecs import open import os here = os.path.abspath(os.path.dirname(__file__)) # Get the long description from the README file try: import pypandoc long_description = pypandoc.convert('README.md', format='md', to='rst') except(IOError, ImportError): with op...
mit
-4,124,764,179,536,673,000
31.12
87
0.627024
false
bdzimmer/handwriting
handwriting/verify.py
1
13242
# -*- coding: utf-8 -*- """ Interactively verify predictions from algorithms so they can be used as ground truth for evaluation or training. """ # Copyright (c) 2017 Ben Zimmer. All rights reserved. # New process that uses mutable tree of Samples. import os import sys import cv2 import numpy as np from handwrit...
bsd-3-clause
6,504,261,244,183,423,000
37.606414
100
0.576801
false
yw374cornell/e-mission-server
emission/tests/netTests/TestBuiltinUserCacheHandlerOutput.py
1
7090
# Standard imports import unittest import datetime as pydt import logging import json import uuid import attrdict as ad import time import geojson as gj import arrow # Our imports import emission.tests.common import emission.core.get_database as edb import emission.net.usercache.abstract_usercache as enua import emis...
bsd-3-clause
-6,776,570,745,570,059,000
48.236111
107
0.651058
false
heckj/redisco
redisco/models/attributes.py
1
15052
# -*- coding: utf-8 -*- """ Defines the fields that can be added to redisco models. """ import sys from datetime import datetime, date from dateutil.tz import tzutc, tzlocal from calendar import timegm from redisco.containers import List from exceptions import FieldValidationError, MissingID __all__ = ['Attribute', 'C...
mit
-8,004,247,094,733,032,000
30.48954
76
0.554411
false
mathi123/vertical-construction
__unported__/account_invoice_insulation/__openerp__.py
1
1644
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
-4,156,243,103,328,499,000
35.533333
92
0.599148
false
kayhayen/Nuitka
nuitka/nodes/NodeBases.py
1
35111
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
apache-2.0
8,789,145,488,713,669,000
28.308013
88
0.594856
false
ThomasBollmeier/GObjectCreator3
src/gobjcreator3/codegen/c_code_generator.py
1
29821
from gobjcreator3.codegen.code_generator import CodeGenerator from gobjcreator3.codegen.output import StdOut from gobjcreator3.codegen.name_creator import NameCreator from gobjcreator3.codegen.c_marshaller_generator import CMarshallerGenerator, CMarshallerNameCreator from gobjcreator3.model.type import Type from gobjcr...
apache-2.0
763,292,699,945,116,500
36.464824
127
0.539653
false
klahnakoski/MySQL-to-S3
mysql_to_s3/__init__.py
1
1965
# encoding: utf-8 # # # 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 http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __...
mpl-2.0
562,157,114,475,749,760
21.586207
75
0.553181
false
pprett/statsmodels
statsmodels/graphics/tests/test_functional.py
1
2742
import numpy as np from numpy.testing import dec, assert_equal, assert_almost_equal from statsmodels.graphics.functional import \ banddepth, fboxplot, rainbowplot try: import matplotlib.pyplot as plt have_matplotlib = True except: have_matplotlib = False def test_banddepth_BD2(): xx = n...
bsd-3-clause
247,066,859,032,231,900
29.466667
74
0.574398
false
gamnor/olhoneles
montanha/migrations/0007_auto__add_pernaturebyyear__add_pernature.py
1
10393
# -*- 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 model 'PerNatureByYear' db.create_table(u'montanha_pernaturebyye...
agpl-3.0
-336,951,130,467,373,200
68.293333
151
0.560185
false
alfredodeza/merfi
merfi/tests/test_iso.py
1
1951
import os import pytest import subprocess from merfi.iso import Iso from merfi.util import which class TestIso(object): def create_fake_iso(self, output_dir): """ Create a fake ISO file, without genisoimage """ iso = Iso([]) f = output_dir.join('test.iso') f.write('ISOCONTENTS') ...
mit
-8,617,623,521,715,342,000
38.02
114
0.644285
false
roccoma504/reddit_wallpaper
reddit_mac_wallpaper.py
1
1030
#!/usr/bin/python # This script changes the wallpaper of the current OSX desktop. It will change the wallpaper of the desktop on each screen but not each desktop. from AppKit import NSWorkspace, NSScreen from Foundation import NSURL import os import praw import urllib # Define the reddit object. r = praw.Reddit(user...
mit
7,633,890,986,158,433,000
33.366667
144
0.74466
false
gjhiggins/graphpath
setup.py
1
3436
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re def setup_python3(): # Taken from "distribute" setup.py from distutils.filelist import FileList from distutils import dir_util, file_util, util, log from os.path import join, exists tmp_src = join("build", "src") if exists(tmp...
gpl-2.0
8,497,947,675,394,319,000
32.686275
79
0.634459
false
xorpaul/shinken
setup.py
1
23086
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
agpl-3.0
2,659,924,417,819,032,600
33.978788
100
0.560643
false
popazerty/dvbapp2-gui
lib/python/Screens/AutoDiseqc.py
1
8796
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen from Components.ActionMap import ActionMap from Components.Sources.StaticText import StaticText from Components.config import config, configfile, getConfigListEntry from Components.NimManager import nimmanager, InitNimManager from Comp...
gpl-2.0
-2,929,560,875,584,802,300
31.338235
180
0.713847
false
mulkieran/pyblk
tests/test_utils.py
1
1744
# -*- coding: utf-8 -*- # Copyright (C) 2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in th...
gpl-2.0
-5,400,782,520,455,736,000
32.538462
77
0.706995
false
eljost/pysisyphus
deprecated/optimizers/BFGS.py
1
4901
#!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np from pysisyphus.helpers import fit_rigid, procrustes from pysisyphus.optimizers.BacktrackingOptimizer import BacktrackingOptimizer # [1] Nocedal, Wright - Numerical Optimization, 2006 class BFGS(BacktrackingOptimizer): def __init__(self,...
gpl-3.0
-1,036,933,543,861,177,100
39.504132
86
0.550296
false
ArcherSys/ArcherSys
Lib/genericpath.py
1
3883
""" Path operations common to more than one OS Do not use directly. The OS specific modules import the appropriate functions from this module themselves. """ import os import stat __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime', 'getsize', 'isdir', 'isfile', 'samefile', 'sameopenfi...
mit
-4,081,050,003,796,660,000
28.195489
78
0.661087
false
chill17/pycounter
pycounter/constants.py
1
6177
"""Constants used by pycounter.""" NS = { 'SOAP-ENV': "http://schemas.xmlsoap.org/soap/envelope/", 'sushi': "http://www.niso.org/schemas/sushi", 'sushicounter': "http://www.niso.org/schemas/sushi/counter", 'counter': "http://www.niso.org/schemas/counter", } METRICS = { u"JR1": u"FT Article Req...
mit
-3,423,670,937,387,437,600
32.754098
79
0.583293
false
smwahl/PlLayer
outline.py
1
8657
import numpy as np import scipy as sp import matplotlib.pyplot as plt import matplotlib from copy import deepcopy class planet ''' Represents a snapshot of an evoloving planet, with methods for comparing different snapshots and relating thermal evolution to time.''' def __init__(self, params=None, ...
mit
-6,883,647,413,842,892,000
32.296154
104
0.621116
false
slush0/epycyzm
morpavsolver/__init__.py
1
3468
# https://github.com/morpav/zceq_solver--bin from cffi import FFI import os.path import inspect ffi = None library = None library_header = """ typedef struct { char data[1344]; } Solution; typedef struct { unsigned int data[512]; } ExpandedSolution; typedef struct HeaderAndNonce { char data[140]; } HeaderAnd...
mit
957,639,449,207,624,700
28.896552
93
0.654268
false
adobe-type-tools/fontlab-scripts
TrueType/convertToTTF.py
1
28980
#FLM: Convert PFA/UFO/TXT to TTF/VFB # coding: utf-8 __copyright__ = __license__ = """ Copyright (c) 2015-2016 Adobe Systems Incorporated. All rights reserved. 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 ...
mit
-4,984,340,435,244,985,000
34.212637
131
0.621636
false
ujenmr/ansible
test/runner/lib/integration/__init__.py
1
7973
"""Ansible integration test infrastructure.""" from __future__ import absolute_import, print_function import contextlib import json import os import shutil import tempfile from lib.target import ( analyze_integration_target_dependencies, walk_integration_targets, ) from lib.config import ( NetworkIntegr...
gpl-3.0
6,827,618,228,914,543,000
30.892
156
0.654835
false
RetroView/hecl
blender/hecl/frme.py
3
21197
import bpy, struct, math from mathutils import Quaternion def draw(layout, context): if bpy.context.active_object: obj = bpy.context.active_object layout.label(text="Widget Settings:", icon='OBJECT_DATA') layout.prop_menu_enum(obj, 'retro_widget_type', text='Widget Type') #layout.pr...
mit
-7,502,796,951,139,289,000
53.212276
169
0.586168
false
lanacioncom/elecciones_2015_caba
backend/scripts/apitransforms.py
1
8671
# coding: utf-8 import logging # TODO Remove only for testing import json import io from utils import get_percentage, format_percentage, sort_results_by_percentage from config import JSON_EXAMPLE_PATH, SPECIAL_PARTIES, PASS_THRESHOLD from config import Paso2015 log = logging.getLogger('paso.%s' % (__name__)) PERC_KEYS...
mit
3,808,144,704,324,429,300
34.235772
79
0.524919
false
eaudeweb/lcc-toolkit
lcc/tests/answer.py
1
6176
import json from django.contrib.auth.models import User from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from lcc.models import ( Answer, Assessment, Country, Question ) from lcc.serializers import AnswerSerializer from lcc.tests.taxonomy import create_...
gpl-3.0
359,729,923,295,122,600
37.842767
78
0.628886
false
rwl/PyCIM
CIM14/IEC61970/Dynamics/PowerSystemStabilizers/PssIEEE2B.py
1
7134
# Copyright (C) 2010-2011 Richard Lincoln # # 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
-6,638,819,848,225,770,000
42.766871
448
0.614943
false
nathanielksmith/done
done/Tasks.py
1
2607
# who nate smith # when march 2010 # why the done tool # where midwest usa import sys from time import mktime, time from datetime import datetime import sqlite3 from termcolor import colored import sql_interp.sql_interp as si from Config import db_path class Task: def __init__(self, desc, due): self....
gpl-3.0
-1,143,508,511,663,373,800
23.59434
73
0.519371
false
T2DREAM/t2dream-portal
setup.py
1
3286
import os import sys from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.md')).read() CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() requires = [ 'snovault', 'Pillow', 'PyBrowserID', 'SQLAlchemy>=1.0.0b1', ...
mit
1,263,833,566,525,261,800
28.339286
79
0.650335
false
neil92/MiscScripts2
replace_every_xth_line.py
1
1281
#!/usr/local/miniconda3/bin/python def setupArguments(): """ This is the function that sets up the flags and the arguements you can pass to the script. :author: Neil A. Patel """ aParser = argparse.ArgumentParser("Setup the arguments.") aparser.add_argument('-f', '--file', action='store', dest='file_targe...
mit
-5,675,658,794,333,368,000
39.03125
105
0.674473
false
bertnotbob/django-property
config/settings/base.py
1
4530
import dj_database_url, os from django.core.exceptions import ImproperlyConfigured def get_env_variable(var_name): try: return os.environ[var_name] except: error_msg = 'Set the {} environment variable'.format(var_name) raise ImproperlyConfigured(error_msg) # Paths BASE_DIR = os.path...
mit
5,718,639,544,731,947,000
25.343023
99
0.641501
false
tombosc/dict_based_learning
tests/test_data.py
1
3193
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tempfile import base64 from fuel.datasets import IndexableDataset from fuel.streams import DataStream from dictlearn.data import ( LanguageModellingData, ExtractiveQAData, RandomSpanSchem...
mit
-2,698,814,175,180,520,400
34.876404
80
0.613216
false
pydata/xarray
xarray/tests/test_utils.py
1
10440
from datetime import datetime from typing import Hashable import numpy as np import pandas as pd import pytest from xarray.coding.cftimeindex import CFTimeIndex from xarray.core import duck_array_ops, utils from xarray.core.indexes import PandasIndex from xarray.core.utils import either_dict_or_kwargs, iterate_nested...
apache-2.0
7,916,387,651,723,424,000
30.164179
88
0.582759
false
tingcar/PSEP
src/PSEP/settings.py
1
3680
""" Django settings for PSEP project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
apache-2.0
-5,925,759,729,754,591,000
22.144654
110
0.701087
false
TakLee96/discriminant
train.py
1
2430
import numpy as np from os import path from scipy.io import loadmat from timer import timer from classifier import LDAClassifier, QDAClassifier """ TODO: choose either mnist or spam >>HERE<< """ which = "spam.mat" which = "mnist.mat" """ TODO: choose either mnist or spam >>HERE<< """ timer.start("reading", which, "...
mit
-644,527,991,301,725,700
33.714286
103
0.634979
false
marcoscrcamargo/ic
results.py
1
2191
import csv import time fieldnames = ['class', 'knn_hst', 'hst_pxl', 'mlp_hst', 'mlp_pxl', 'svm_hst', 'svm_pxl', 'ensemble_hst', 'ensemble_pxl', 'ensemble_all'] writer = None file = 'results_' + str(time.ctime()) +'.csv' def initializate(fname=file): global writer global file file = fname with open(fname, 'w') as...
gpl-3.0
6,560,752,996,770,302,000
41.980392
136
0.524418
false
lisogallo/odoo-it-infra
it_infrastructure/server_repository.py
1
2915
# -*- coding: utf-8 -*- from openerp import models, fields, api, _ from openerp.exceptions import except_orm from fabric.api import cd, sudo, settings from fabric.contrib.files import exists import os class server_repository(models.Model): """""" _name = 'it_infrastructure.server_repository' _descriptio...
agpl-3.0
-4,230,107,899,597,576,000
31.032967
74
0.50223
false
tdtrask/ansible
lib/ansible/modules/network/vyos/vyos_system.py
1
6315
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible 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 later version. ...
gpl-3.0
-1,098,957,829,033,216,400
28.787736
89
0.633096
false
greggian/TapdIn
django/db/backends/sqlite3/creation.py
1
3339
import os import sys from django.conf import settings from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # SQLite doesn't actually support most of these types, but it "does the right # thing" given more verbose field definitions, so leave them as i...
apache-2.0
-5,355,491,434,208,322,000
45.7
152
0.512429
false
FabianWe/csd-freiburg-forms
csd_freiburg_forms/donate_o_meter/donate_o_meter.py
1
2011
# Copyright (C) 2016 Fabian Wenzelmann # # This file is part of csd-freiburg-forms. # # csd-freiburg-forms 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
-3,033,785,776,946,643,500
33.672414
79
0.632521
false
maximilianofaccone/puppy-siberian
usr/share/bleachbit/Common.py
1
7633
# vim: ts=4:sw=4:expandtab # -*- coding: UTF-8 -*- # BleachBit # Copyright (C) 2014 Andrew Ziem # http://bleachbit.sourceforge.net # # 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 versi...
gpl-3.0
3,201,493,757,747,861,000
29.898785
91
0.666798
false
lucabaldini/rating02
dump_rating.py
1
7983
#!/usr/bin/env python # # Copyright (C) 2019, Luca Baldini. # # 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 later version. # # This p...
gpl-3.0
4,332,046,184,173,600,300
41.68984
80
0.591131
false
ademariag/kapitan
kapitan/refs/secrets/vaultkv.py
2
9041
# Copyright 2019 The Kapitan Authors # SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com> # # SPDX-License-Identifier: Apache-2.0 "hashicorp vault kv secrets module" import base64 import logging import os from binascii import Error as b_error from sys import exit from kapitan import c...
apache-2.0
3,772,391,026,941,438,000
38.480349
128
0.619843
false
Zowie/django-htmlmin
htmlmin/tests/test_minify.py
1
7473
# -*- coding: utf-8 -*- # Copyright 2013 django-htmlmin 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 six import codecs import unittest from htmlmin.minify import html_minify from os.path import abspath, dirname, join resou...
bsd-2-clause
-8,056,160,050,232,105,000
42.447674
106
0.655961
false
zenieldanaku/pygpj
func/core/viz.py
1
6108
# coding=UTF-8 # Viz.py import os from math import ceil from func.core.lang import t, probar_input def PrepPrint(lista): imp = '' lineas = [] for elemento in lista: imp += str(elemento)+', ' if len(imp) > 75: lineas.append(imp) imp = '' ...
mit
1,342,281,639,521,813,200
32.659091
103
0.430984
false
vivaxy/algorithms
python/problems/most_common_word.py
1
1131
""" https://leetcode.com/problems/most-common-word/ https://leetcode.com/submissions/detail/150204402/ """ class Solution: def mostCommonWord(self, paragraph, banned): """ :type paragraph: str :type banned: List[str] :rtype: str """ wordAcc = dict() for wor...
mit
-3,210,401,791,503,412,000
24.704545
152
0.505747
false
hanxi/pyfm
pyfm.py
1
2766
#!/usr/bin/python # coding: utf-8 import sys import os import threading import time import random import json import signal import gst # 基础类 class MusicBase: def __init__(self): self.app_name = 'console_fm' self.appPath = os.path.realpath(sys.path[0]) jsonStr = open(self.appPath+'/music2ty...
mit
7,971,246,647,054,509,000
25.02
67
0.577633
false
wittrup/crap
python/encoding.py
1
1363
N = 0 # character never appears in text A = 1 # character appears in plain ASCII text I = 2 # character appears in ISO-8859 text X = 3 # character appears in non-ISO extended ASCII (Mac, IBM PC) text_chars = [ # BEL BS HT LF VT FF CR N, N, N, N, N, N, N, A, A, A, A, A, A, A, N, N, # ...
mit
-1,026,429,806,372,490,800
44.466667
81
0.405723
false
dopplesoldner/algorithms
hash/two_sum.py
1
1919
"""The goal of this problem is to implement a variant of the 2-SUM algorithm (covered in the Week 6 lecture on hash table applications). The file contains 500,000 positive integers (there might be some repetitions!). This is your array of integers, with the ith row of the file specifying the ith entry of the array. Yo...
mit
1,159,057,494,985,307,000
28.090909
79
0.576342
false
elationfoundation/git_hooks
pre-commit/python/timestamp.py
1
1631
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import subprocess from datetime import datetime class TestSuite(): def __init__(self): self.stdout = 0 def run(self, files): for file_name in files: try: self.set_changed(file_name) except Excepti...
gpl-2.0
188,132,529,603,103,600
30.365385
118
0.505825
false
Weihonghao/ECM
find_emotion_word.py
1
1493
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer from tqdm import tqdm import mmap def whetherEmotion(word, threshold): analyzer = SentimentIntensityAnalyzer() sentiment_result = analyzer.polarity_scores(word) if abs(sentiment_result['compound']) > threshold: return True ret...
agpl-3.0
8,073,913,267,619,536,000
30.104167
73
0.653048
false
Kkevsterrr/backdoorme
backdoors/shell/netcat.py
1
1739
from backdoors.backdoor import * import time class Netcat(Backdoor): prompt = Fore.RED + "(nc) " + Fore.BLUE + ">> " + Fore.RESET def __init__(self, core): cmd.Cmd.__init__(self) self.intro = GOOD + "Using netcat backdoor..." self.core = core self.options = { ...
mit
8,729,828,714,688,870,000
44.763158
180
0.564117
false
j2ali/FlightScraper
Scraper.py
1
1950
from bs4 import BeautifulSoup import helper from datetime import datetime import click import time import calendar #Example values #START_DATE = datetime(2014, 05, 15) #END_DATE = datetime(2015, 05, 15) #DAY_DELTA = 7 #TIMEOUT_SECONDS = 30 #Example Command #python Scraper.py 2014/05/25 2015/05/15 4 0 YYZ POS @click....
bsd-3-clause
-3,644,755,502,807,923,000
31.516667
97
0.625128
false
sagarjauhari/BCIpy
process_series_files.py
1
3765
# /usr/bin/env python # Copyright 2013, 2014 Justis Grant Peters and Sagar Jauhari # This file is part of BCIpy. # # BCIpy 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
3,405,553,341,204,929,000
40.833333
108
0.655511
false
IngoBongo/rpg_texual_Rumbo_a
Rumbo_A_V0.0.1/rumbo.py
1
1682
# -*- coding: utf-8 -*- # sintaxis for Python 2.7 from random import randint import jugador from jugador import Jugador from criaturas import Enemigo comand = jugador.Comandos def main(): jug = Jugador() jug.nombre = raw_input("¿Cual es tu nombre viager@? : ") print "escribe: 'ayuda' para ver una list...
gpl-3.0
850,313,411,132,253,200
28.491228
120
0.650803
false