repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
Catweazz/catweazz
lib/utils/beta/t0mm0/common/addon.py
17
26782
''' common XBMC Module Copyright (C) 2011 t0mm0 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. Th...
gpl-2.0
-8,805,340,701,887,177,000
32.901266
139
0.541222
false
AlanD88/website
web2py/gluon/contrib/simplejson/__init__.py
49
17565
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
mit
-8,748,644,540,293,178,000
38.920455
79
0.654369
false
jabesq/home-assistant
homeassistant/components/hitron_coda/device_tracker.py
7
4402
"""Support for the Hitron CODA-4582U, provided by Rogers.""" import logging from collections import namedtuple import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA, DeviceScanner) from homeassist...
apache-2.0
-2,895,728,927,335,845,400
30.219858
78
0.581327
false
riklaunim/django-custom-multisite
tests/regressiontests/views/models.py
144
1202
""" Regression tests for Django built-in views. """ from django.db import models class Author(models.Model): name = models.CharField(max_length=100) def __unicode__(self): return self.name def get_absolute_url(self): return '/views/authors/%s/' % self.id class BaseArticle(models.Model):...
bsd-3-clause
4,363,258,103,357,998,000
23.530612
78
0.663894
false
rdo-management/ironic
ironic/db/api.py
5
13180
# -*- encoding: utf-8 -*- # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 # # ...
apache-2.0
5,096,082,421,734,142,000
32.367089
77
0.558725
false
openfun/edx-platform
openedx/core/djangoapps/content/course_structures/api/v0/serializers.py
65
1313
""" API Serializers """ from rest_framework import serializers class GradingPolicySerializer(serializers.Serializer): """ Serializer for course grading policy. """ assignment_type = serializers.CharField(source='type') count = serializers.IntegerField(source='min_count') dropped = serializers.IntegerF...
agpl-3.0
1,932,488,784,707,289,900
32.666667
60
0.713633
false
florentchandelier/keras
keras/regularizers.py
81
1907
from __future__ import absolute_import import theano.tensor as T class Regularizer(object): def set_param(self, p): self.p = p def set_layer(self, layer): self.layer = layer def __call__(self, loss): return loss def get_config(self): return {"name": self.__class__.__...
mit
-8,499,708,186,915,620,000
21.702381
97
0.579969
false
ScreamingUdder/mantid
scripts/test/ISISPowderSampleDetailsTest.py
2
20166
from __future__ import (absolute_import, division, print_function) import mantid import io import six import sys import unittest from isis_powder.routines import sample_details from six_shim import assertRaisesRegex, assertRegex class ISISPowderSampleDetailsTest(unittest.TestCase): def test_constructor(self): ...
gpl-3.0
5,191,142,500,844,846,000
55.329609
119
0.648468
false
nitzmahone/ansible
lib/ansible/modules/cloud/digital_ocean/digital_ocean_region_facts.py
35
2897
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # 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__ = ty...
gpl-3.0
-3,009,310,885,114,765,000
23.760684
92
0.564032
false
proxysh/Safejumper-for-Desktop
buildmac/Resources/env/lib/python2.7/site-packages/twisted/news/database.py
10
33683
# -*- test-case-name: twisted.news.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ News server backend implementations. """ import getpass, pickle, time, socket import os import StringIO from hashlib import md5 from email.Message import Message from email.Generator import Generato...
gpl-2.0
-3,238,216,484,931,205,000
31.201721
122
0.567824
false
mvesper/invenio
modules/websearch/lib/websearch_external_collections_unit_tests.py
3
4111
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 CERN. # # Invenio 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
2,181,686,626,384,434,000
40.11
103
0.650207
false
Rogentos/rogentos-anaconda
booty/ia64.py
3
1456
from booty import BootyNoKernelWarning from bootloaderInfo import * class ia64BootloaderInfo(efiBootloaderInfo): def getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev): config = bootloaderInfo.getBootloaderConfig(self, instRoot, ...
gpl-2.0
-8,948,216,174,723,916,000
37.315789
78
0.563874
false
ZhenxingWu/luigi
luigi/server.py
24
10444
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
-7,603,285,075,401,870,000
34.04698
124
0.655209
false
doughgle/pomodoro_evolved
pomodoro_evolved/native_ui.py
1
4010
import Tkinter as tk import tkFont import tkMessageBox from pomodoro import Pomodoro from datetime import timedelta, datetime from Queue import Queue, Empty from rest_break import Break as ShortBreak from rest_break import Break as LongBreak from timer_log import TimerLog class NativeUI(tk.Tk): def __init__(s...
mit
184,384,905,558,211,940
37.190476
108
0.585037
false
openscriptures/Biblelator
Biblelator/Windows/TSVEditWindow.py
1
137680
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # TSVEditWindow.py # # The edit windows for Biblelator TSV table editing # # Copyright (C) 2020 Robert Hunt # Author: Robert Hunt <Freely.Given.org+Biblelator@gmail.com> # License: See gpl-3.0.txt # # This program is free software: you can redistribute it and/or modify...
gpl-3.0
7,333,720,687,736,168,000
53.519414
217
0.614576
false
nicholedwight/nichole-theme
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/parsers.py
363
25835
# -*- coding: utf-8 -*- """ pygments.lexers.parsers ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for parser generators. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, \ include...
mit
7,198,154,577,364,252,000
32.206941
86
0.471376
false
Varun-Teja/Projects
Encryption/Security.py
1
8006
'''Copyright (c) 2015 HG,DL,UTA Python program runs on local host, uploads, downloads, encrypts local files to google. Please use python 2.7.X, pycrypto 2.6.1 and Google Cloud python module ''' #import statements. import argparse import httplib2 import os import sys import json import time import datetime impor...
mit
6,996,717,929,977,679,000
35.724771
142
0.691731
false
toumorokoshi/yelo
yelo/views.py
1
3859
import json from django.contrib.auth.models import User, Group from django.http import JsonResponse from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from rest_framework import viewsets from yelo.lib.elo_utils import play_match from yelo.lib.http import api_error from yelo.models ...
mit
-4,609,199,720,337,028,600
25.251701
197
0.659238
false
munnerz/CouchPotatoServer
libs/caper/matcher.py
81
4952
# Copyright 2013 Dean Gardiner <gardiner91@gmail.com> # # 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...
gpl-3.0
-986,076,993,395,097,900
33.388889
110
0.529483
false
Talkdesk/graphite-web
webapp/graphite/whitelist/views.py
5
1960
"""Copyright 2008 Orbitz WorldWide 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...
apache-2.0
-3,348,802,905,693,838,300
31.666667
122
0.738776
false
petemounce/ansible
lib/ansible/modules/cloud/openstack/os_volume.py
11
5663
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # This module 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 late...
gpl-3.0
5,814,489,625,104,160,000
29.610811
88
0.638531
false
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/lib2to3/fixes/fix_exitfunc.py
291
2505
""" Convert use of sys.exitfunc to use the atexit module. """ # Author: Benjamin Peterson from lib2to3 import pytree, fixer_base from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms class FixExitfunc(fixer_base.BaseFix): keep_line_order = True BM_compatible = True PATTERN = """ ...
mit
6,303,735,552,013,008,000
33.791667
77
0.505788
false
andim/scipy
scipy/fftpack/tests/test_helper.py
63
1934
#!/usr/bin/env python # Created by Pearu Peterson, September 2002 from __future__ import division, print_function, absolute_import __usage__ = """ Build fftpack: python setup_fftpack.py build Run tests if scipy is installed: python -c 'import scipy;scipy.fftpack.test(<level>)' Run tests if fftpack is not installe...
bsd-3-clause
-5,894,163,388,006,270,000
27.865672
69
0.608066
false
Julioocz/SIMNAV
simnav/termodinamica/ideal.py
1
2516
"""Ecuaciones termodinamicas ideales para el calculo de propiedades termodinamicas del Manual del ingeniero quimico Perry""" from math import sinh, cosh from scipy import integrate import numpy as np def antoine(T, C1, C2, C3, C4, C5): """Ecuación para calculo de presión de vapor (Pa)""" return np.exp(C1 + ...
mit
-8,918,374,898,051,252,000
36.848485
91
0.66253
false
andref/Unnatural-Sublime-Package
events.py
1
1798
# encoding: utf-8 import sublime, sublime_plugin try: from . import util except ValueError: import util class PerformEventListener(sublime_plugin.EventListener): """Suggest subroutine completions for the perform statement.""" def on_query_completions(self, view, prefix, points): if not util....
mit
6,860,928,350,245,761,000
34.96
78
0.637375
false
vetalypp/e2openplugin-CrossEPG
scripts/lib/scriptlib.py
2
10585
#!/usr/bin/python # scriptlib.py by Ambrosa http://www.ambrosa.net # derived from E2_LOADEPG # 22-Dec-2011 __author__ = "ambrosa http://www.ambrosa.net" __copyright__ = "Copyright (C) 2008-2011 Alessandro Ambrosini" __license__ = "CreativeCommons by-nc-sa http://creativecommons.org/licenses/by-nc-sa/3.0/" import os...
lgpl-2.1
-3,256,832,973,433,502,000
25.933842
160
0.66188
false
jerem/Whoosh
src/whoosh/filedb/fileindex.py
1
19208
#=============================================================================== # Copyright 2009 Matt Chaput # # 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/li...
apache-2.0
-7,319,235,433,762,627,000
32.876543
94
0.580279
false
riveridea/gnuradio
gr-qtgui/apps/plot_spectrogram_form.py
11
7041
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
-6,556,016,359,553,895,000
41.932927
81
0.609999
false
iap-mutant/godot
doc/tools/makedocs.py
25
14752
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # makedocs.py: Generate documentation for Open Project Wiki # Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. # Contributor: Jorge Araya Navarro <elcorreo@deshackra.com> # # IMPORTANT NOTICE: # If you are going to modify anything from this file, please be sure to fol...
mit
5,324,479,633,711,656,000
37.617801
79
0.518913
false
Nitaco/ansible
lib/ansible/modules/storage/netapp/na_ontap_ucadapter.py
8
5936
#!/usr/bin/python # (c) 2018, NetApp, 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 ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_...
gpl-3.0
816,799,767,110,846,000
29.285714
108
0.602594
false
tekapo/fabric
tests/utils.py
30
6045
from __future__ import with_statement from contextlib import contextmanager from copy import deepcopy from fudge.patcher import with_patched_object from functools import partial from types import StringTypes import copy import getpass import os import re import shutil import sys import tempfile from fudge import Fake...
bsd-2-clause
-3,472,703,353,557,585,000
29.225
80
0.650455
false
derblub/pixelpi
screen/virtualscreen.py
1
1561
import pygame from abstractscreen import AbstractScreen from settings import * S = Settings() instance = None # Behaves like the actual LED screen, but shows the screen content on a computer screen class VirtualScreen(AbstractScreen): def __init__(self, width=int(S.get('screen', 'matrix_width'...
mit
-7,976,544,673,582,205,000
31.520833
168
0.600256
false
Valka7a/python-playground
python-the-hard-way/43-basic-object-oriented-analysis-and-design.py
1
13790
# Exercise 43: Basic Object-Oriented Analysis and Design # Process to build something to evolve problems # 1. Write or draw about the problem. # 2. Extract key concepts from 1 and research them. # 3. Create a class hierarchy and object map for the concepts. # 4. Code the classes and a test to run them. # 5. Repeat and...
mit
-5,858,277,276,409,420,000
35.194226
100
0.653372
false
hkariti/ansible
lib/ansible/utils/module_docs_fragments/fortios.py
85
2307
# # (c) 2017, Benjamin Jolivot <bjolivot@gmail.com> # # 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...
gpl-3.0
6,647,414,685,662,514,000
33.432836
130
0.706112
false
longmen21/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_export_all_courses.py
187
2065
""" Test for export all courses. """ import shutil from tempfile import mkdtemp from contentstore.management.commands.export_all_courses import export_courses_to_output_path from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils i...
agpl-3.0
4,427,176,803,893,358,000
40.3
119
0.682324
false
xifle/home-assistant
homeassistant/components/climate/mysensors.py
10
7483
""" mysensors platform that offers a Climate(MySensors-HVAC) component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/climate.mysensors """ import logging from homeassistant.components import mysensors from homeassistant.components.climate import ( ST...
mit
4,083,999,564,359,603,000
37.178571
79
0.609649
false
deer-hope/zulip
zerver/lib/tornado_ioloop_logging.py
115
2820
from __future__ import absolute_import import logging import time import select from tornado import ioloop from django.conf import settings try: # Tornado 2.4 orig_poll_impl = ioloop._poll def instrument_tornado_ioloop(): ioloop._poll = InstrumentedPoll except: # Tornado 3 from tornado.iol...
apache-2.0
-7,974,430,505,611,503,000
35.623377
93
0.640071
false
lekum/ansible
lib/ansible/plugins/action/set_fact.py
51
1392
# Copyright 2013 Dag Wieers <dag@wieers.com> # # 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 versio...
gpl-3.0
-8,768,609,485,725,840,000
37.666667
93
0.686782
false
PierreFaniel/openerp-7.0
sale_order_line/__init__.py
4
1106
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010-2013 Elico Corp. All Rights Reserved. # Author: LIN Yu <lin.yu@elico-corp.com> # # This program is free software: you can redistribute it a...
agpl-3.0
-2,355,321,621,985,765,400
41.538462
78
0.619349
false
piyush1911/git-cola
cola/widgets/browse.py
3
28400
from __future__ import division, absolute_import, unicode_literals from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtCore import Qt from PyQt4.QtCore import SIGNAL from cola import cmds from cola import core from cola import difftool from cola import gitcmds from cola import hotkeys from cola import icons...
gpl-2.0
-2,917,058,057,223,953,400
33.846626
80
0.599472
false
AnishShah/tensorflow
tensorflow/python/autograph/utils/type_check_test.py
11
1545
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
2,926,133,835,588,201,500
34.930233
80
0.699676
false
jank3/django
tests/migrate_signals/tests.py
324
3585
from django.apps import apps from django.core import management from django.db.models import signals from django.test import TestCase, override_settings from django.utils import six APP_CONFIG = apps.get_app_config('migrate_signals') PRE_MIGRATE_ARGS = ['app_config', 'verbosity', 'interactive', 'using'] MIGRATE_DATABA...
bsd-3-clause
3,835,067,185,756,962,300
36.736842
98
0.676987
false
Forage/Gramps
gramps/gen/svn_revision.py
1
1853
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2012 Doug Blank <doug.blank@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 Software Foundation; either version 2 of the License...
gpl-2.0
8,402,924,262,747,031,000
32.089286
76
0.635726
false
SebasSBM/django
tests/forms_tests/tests/tests.py
89
16458
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import ( CharField, FileField, Form, ModelChoiceField, ModelForm, ) from django.forms.models import ModelFormMetaclass from d...
bsd-3-clause
908,115,979,199,471,200
41.419689
118
0.644436
false
Rjtsahu/School-Bus-Tracking
BusTrack/repository/main.py
1
1036
from BusTrack.repository import Base from BusTrack.repository import engine # import all relevant db models here. from BusTrack.repository.models.Bus import Bus from BusTrack.repository.models.UserType import UserType from BusTrack.repository.models.User import User from BusTrack.repository.models.UserLogin import Use...
gpl-3.0
5,666,108,229,375,714,000
42.166667
81
0.771236
false
le9i0nx/ansible
lib/ansible/modules/network/nxos/nxos_ntp_auth.py
19
9675
#!/usr/bin/python # # 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. # # Ansible is distribut...
gpl-3.0
-7,630,103,874,026,654,000
28.677914
88
0.613437
false
n0trax/ansible
lib/ansible/modules/network/nxos/nxos_gir.py
15
12164
#!/usr/bin/python # # 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. # # Ansible is distribut...
gpl-3.0
5,995,460,433,216,344,000
36.894081
118
0.610161
false
ldoktor/avocado-vt
virttest/utils_libvirtd.py
6
10167
""" Module to control libvirtd service. """ import re import logging import aexpect from avocado.utils import path from avocado.utils import process from avocado.utils import wait from . import remote from . import utils_misc from .staging import service from .utils_gdb import GDB try: path.find_command("libvirt...
gpl-2.0
2,784,647,307,180,690,400
27.8017
79
0.581686
false
patricklaw/pip
pip/req/req_uninstall.py
87
7107
from __future__ import absolute_import import imp import logging import os import sys import tempfile from pip.compat import uses_pycache, WINDOWS from pip.exceptions import UninstallationError from pip.utils import (rmtree, ask, is_local, dist_is_local, renames, normalize_path) from pip.utils....
mit
8,186,446,328,479,379,000
33.5
79
0.534403
false
brandond/ansible
lib/ansible/modules/network/cnos/cnos_interface.py
52
18994
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # (c) 2017, Ansible by Red Hat, inc # 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, eith...
gpl-3.0
779,474,424,051,233,500
32.381371
117
0.60019
false
intlabs/cannyos-backend-dashboard
horizon-master/openstack_dashboard/dashboards/admin/volumes/volume_types/qos_specs/tables.py
14
2408
# 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 t...
mit
-1,510,159,262,955,596,500
32.915493
75
0.667774
false
lokirius/python-for-android
python3-alpha/python3-src/Lib/test/test_runpy.py
48
17205
# Test the runpy module import unittest import os import os.path import sys import re import tempfile import py_compile from test.support import forget, make_legacy_pyc, run_unittest, unload, verbose from test.script_helper import ( make_pkg, make_script, make_zip_pkg, make_zip_script, temp_dir) from runpy import...
apache-2.0
-9,069,237,712,438,265,000
39.198598
82
0.567277
false
rabid-inventor/ShiftOutPi
shiftout.py
1
2547
import RPi.GPIO as GPIO from time import sleep as sleep ''' Defining class to handle shifing data out to shift register OutPin = output pin ClkPin = clock Pin Len = length of data in bytes (default 1 Byte) Speed = delay between each bit (Default 0.01 sec) ''' # Keyword args, ie: def my_function(*args...
gpl-3.0
-7,423,147,379,888,868,000
23.747475
74
0.6117
false
moomou/heron
heron/common/tests/python/utils/outgoing_tuple_helper_unittest.py
10
1912
# Copyright 2016 Twitter. 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 law or agree...
apache-2.0
3,382,357,221,570,561,000
40.565217
94
0.752092
false
mogoweb/chromium-crosswalk
native_client_sdk/src/build_tools/build_updater.py
28
6330
#!/usr/bin/env python # Copyright (c) 2012 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. """Build script to generate a new sdk_tools bundle. This script packages the files necessary to generate the SDK updater -- the to...
bsd-3-clause
-7,819,188,117,623,175,000
31.96875
80
0.68673
false
jaymin-panchal/zang-python
tests/inboundxml/test_say.py
2
1404
import unittest from zang.inboundxml.elements.say import Say from zang.inboundxml.elements.base_node import BaseNode from zang.inboundxml.elements.enums.voice import Voice class TestSay(unittest.TestCase): def setUp(self): self.text = 'Hello from Zang' def test_init_with_required_values(self): ...
mit
3,075,624,933,936,477,000
30.909091
74
0.633191
false
underarmour/destalinator
tests/test_destalinator.py
1
28465
# pylint: disable=W0201 from datetime import date, datetime, timedelta import mock import os import unittest import destalinator import slacker import slackbot sample_slack_messages = [ { "type": "message", "channel": "C2147483705", "user": "U2147483697", "text": "Human human huma...
apache-2.0
-2,657,196,525,623,056,400
49.202822
126
0.671491
false
frascoweb/frasco
frasco/billing/eu_vat/data.py
1
5059
from frasco import current_app from frasco.ext import get_extension_state from suds.client import Client as SudsClient from suds import WebFault import xml.etree.ElementTree as ET import requests import datetime EU_COUNTRIES = { "AT": "EUR", # Austria "BE": "EUR", # Belgium "BG": "BGN", # Bulgaria "DE...
mit
-8,591,441,768,103,965,000
28.934911
105
0.606642
false
daoluan/decode-Django
Django-1.5.1/tests/regressiontests/introspection/tests.py
44
7272
from __future__ import absolute_import, unicode_literals from functools import update_wrapper from django.db import connection from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature from django.utils import six, unittest from .models import Reporter, Article if connection.vendor == 'oracle': exp...
gpl-2.0
-8,234,604,832,978,147,000
40.793103
108
0.662816
false
ondra-novak/chromium.src
tools/telemetry/telemetry/results/gtest_progress_reporter.py
6
4171
# 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 time from telemetry.results import progress_reporter from telemetry.value import failure from telemetry.value import skip class GTestProgressReport...
bsd-3-clause
5,689,955,201,699,375,000
40.71
79
0.653081
false
facebookexperimental/eden
eden/scm/edenscm/mercurial/pathutil.py
2
9984
# Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # Copyright 2013 Mercurial Contributors # # This software may be used and distributed according to the terms of the # GNU General Public Licens...
gpl-2.0
-2,456,141,092,788,613,600
35.305455
86
0.569812
false
piyush82/icclab-rcb-web
virtualenv/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py
17
7569
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import logging import sys from django.db.backends import * from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations from django.db.backends.postgresql_psycopg2.client import DatabaseClient fr...
apache-2.0
-4,526,406,333,802,927,600
35.742718
105
0.63258
false
XianliangJ/collections
Jellyfish/pox/pox/controllers/distributed_controller.py
7
5602
#!/usr/bin/env python # Nom nom nom nom # TODO: there is currently a dependency on the order of initialization of # client and server... . for example: # $ pox.py nom_client nom_server # blocks indefinitely # whereas # $ pox.py nom_server nom_client # works from pox.core import core, UpEvent from pox.lib.r...
gpl-3.0
-8,203,659,199,630,733,000
37.902778
100
0.627633
false
mlperf/training_results_v0.6
NVIDIA/benchmarks/gnmt/implementations/pytorch/seq2seq/train/trainer.py
1
18009
import logging import os import time from itertools import cycle import numpy as np import torch import torch.optim import torch.utils.data from apex.parallel import DistributedDataParallel as DDP from apex.optimizers import FusedAdam from apex import amp import mlperf_compliance from seq2seq.train.fp_optimizers impo...
apache-2.0
-9,120,327,704,195,580,000
39.198661
107
0.558165
false
nicobustillos/odoo
addons/im_chat/im_chat.py
28
21908
# -*- coding: utf-8 -*- import base64 import datetime import logging import time import uuid import random import simplejson import openerp from openerp.http import request from openerp.osv import osv, fields from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT from openerp.addons.bus.bus import TIMEOUT _lo...
agpl-3.0
-981,628,086,248,692,600
50.42723
156
0.583851
false
kerr-huang/SL4A
python/src/Lib/plat-mac/Carbon/Components.py
81
2301
# Generated from 'Components.h' def FOUR_CHAR_CODE(x): return x kAppleManufacturer = FOUR_CHAR_CODE('appl') kComponentResourceType = FOUR_CHAR_CODE('thng') kComponentAliasResourceType = FOUR_CHAR_CODE('thga') kAnyComponentType = 0 kAnyComponentSubType = 0 kAnyComponentManufacturer = 0 kAnyComponentFlagsMask = 0 cmpIsM...
apache-2.0
-7,788,544,574,805,501,000
36.112903
141
0.839635
false
ahnchan2/linux
scripts/gdb/linux/modules.py
774
2718
# # gdb helper commands and functions for Linux kernel debugging # # module tools # # Copyright (c) Siemens AG, 2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import cpus, utils module_type = utils.CachedType("str...
gpl-2.0
-3,085,436,158,820,715,000
27.3125
76
0.573584
false
amyliu345/zulip
tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py
16
2033
#!/usr/bin/env python from __future__ import print_function import os from posixpath import basename from six.moves.urllib.parse import urlparse from .common.spiders import BaseDocumentationSpider from typing import Any, List, Set def get_help_images_dir(help_images_path): # type: (str) -> str # Get index...
apache-2.0
3,013,637,018,780,172,300
38.862745
92
0.6424
false
sdx23/khal
khal/calendar_display.py
4
8355
# Copyright (c) 2013-2021 khal contributors # # 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, publi...
mit
-4,166,854,620,831,631,400
36.466368
99
0.595212
false
wildjan/Flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/werkzeug/contrib/sessions.py
295
12450
# -*- coding: utf-8 -*- r""" werkzeug.contrib.sessions ~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains some helper classes that help one to add session support to a python WSGI application. For full client-side session storage see :mod:`~werkzeug.contrib.securecookie` which implements a secure,...
apache-2.0
6,973,294,718,141,993,000
34.775862
78
0.60241
false
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/nltk/metrics/segmentation.py
5
7186
# Natural Language Toolkit: Text Segmentation Metrics # # Copyright (C) 2001-2017 NLTK Project # Author: Edward Loper <edloper@gmail.com> # Steven Bird <stevenbird1@gmail.com> # David Doukhan <david.doukhan@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Text Segme...
apache-2.0
-9,058,910,368,953,097,000
29.974138
95
0.620095
false
jruiperezv/ANALYSE
cms/djangoapps/contentstore/features/course-outline.py
13
4617
# pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step from common import * from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=E0611 from logging import getLogger logger = getLogger(__name__) @step(u'I have a course with no sections$') def have_a_course(step):...
agpl-3.0
9,080,054,733,163,461,000
33.714286
87
0.687459
false
franciscodominguezmateos/DeepLearningNanoDegree
transfer-learning/tensorflow_vgg/test_vgg19_trainable.py
152
1435
""" Simple tester for the vgg19_trainable """ import tensorflow as tf from tensoflow_vgg import vgg19_trainable as vgg19 from tensoflow_vgg import utils img1 = utils.load_image("./test_data/tiger.jpeg") img1_true_result = [1 if i == 292 else 0 for i in range(1000)] # 1-hot result for tiger batch1 = img1.reshape((1...
mit
-4,083,925,815,070,724,000
31.613636
95
0.673171
false
adaur/SickRage
lib/html5lib/treewalkers/lxmletree.py
618
6033
from __future__ import absolute_import, division, unicode_literals from six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isin...
gpl-3.0
-7,664,496,137,501,934,000
28.573529
92
0.539035
false
samueldotj/TeeRISC-Simulator
src/cpu/CheckerCPU.py
69
2022
# Copyright (c) 2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
-1,371,022,099,019,132,400
49.55
78
0.772502
false
ddico/odoo
addons/sale_stock/tests/test_anglo_saxon_valuation.py
1
45077
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests import Form, tagged from odoo.tests.common import SavepointCase from odoo.exceptions import UserError @tagged('post_install', '-at_install') class TestAngloSaxonValuation(SavepointCase): @classmetho...
agpl-3.0
-1,415,161,311,240,886,800
43.586548
136
0.607583
false
spotify/luigi
luigi/contrib/hadoop.py
4
37516
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
-2,069,982,263,213,537,000
34.763584
143
0.582152
false
foss-transportationmodeling/rettina-server
flask/local/lib/python2.7/site-packages/whoosh/idsets.py
52
19132
""" An implementation of an object that acts like a collection of on/off bits. """ import operator from array import array from bisect import bisect_left, bisect_right, insort from whoosh.compat import integer_types, izip, izip_longest, next, xrange from whoosh.util.numeric import bytes_for_bits # Number of '1' bit...
apache-2.0
-4,827,921,210,497,487,000
26.214794
79
0.51636
false
foss-transportationmodeling/rettina-server
.env/lib/python2.7/site-packages/whoosh/compat.py
72
5322
import array, sys # Run time aliasing of Python2/3 differences def htmlescape(s, quote=True): # this is html.escape reimplemented with cgi.escape, # so it works for python 2.x, 3.0 and 3.1 import cgi s = cgi.escape(s, quote) if quote: # python 3.2 also replaces the single quotes: ...
apache-2.0
1,724,472,848,347,294,500
24.834951
74
0.571214
false
vbocan/Voltcraft-Data-Analyzer
DataExport.py
1
12612
#!python3 """ Project: Voltcraft Data Analyzer Author: Valer Bocan, PhD <valer@bocan.ro> Last updated: September 14th, 2014 Module description: The VoltcraftDataFile module processes data files containing history of voltage, current and power factor, as generated by the Voltcraft Energy-Logge...
mit
2,816,603,179,501,903,400
62.69697
240
0.625119
false
systers/postorius
src/postorius/tests/test_urls.py
1
1544
# -*- coding: utf-8 -*- # Copyright (C) 2016-2018 by the Free Software Foundation, Inc. # # This file is part of Postorius. # # Postorius 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...
gpl-3.0
4,464,547,799,510,060,000
36.658537
78
0.63342
false
maweki/more-collections
setup.py
1
1949
from distutils.core import setup setup( name="more_collections", packages = ['more_collections'], version="0.3.0", author="Mario Wenzel", author_email="maweki@gmail.com", url="https://github.com/maweki/more-collections", description="more_collections is a Python library providing more colle...
mit
3,543,285,171,650,458,000
40.468085
144
0.73371
false
Fusion-Rom/android_external_chromium_org
tools/telemetry/telemetry/timeline/process.py
45
2957
# 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 telemetry.timeline.counter as tracing_counter import telemetry.timeline.event as event_module import telemetry.timeline.event_container as event_conta...
bsd-3-clause
-8,255,369,695,233,215,000
32.988506
79
0.697667
false
brianzelip/militarization
css/basscss/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/formatters/terminal.py
50
5401
# -*- coding: utf-8 -*- """ pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Format...
gpl-2.0
2,152,448,791,502,343,200
34.532895
79
0.532679
false
Dhivyap/ansible
lib/ansible/modules/network/panos/_panos_query_rules.py
41
18602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.com> # # 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 publish...
gpl-3.0
-3,505,487,504,969,472,000
36.504032
116
0.586496
false
jarrahwu/tornado
maint/vm/windows/bootstrap.py
99
3423
r"""Installs files needed for tornado testing on windows. These instructions are compatible with the VMs provided by http://modern.ie. The bootstrapping script works on the WinXP/IE6 and Win8/IE10 configurations, although tornado's tests do not pass on XP. 1) Install virtualbox guest additions (from the device menu i...
apache-2.0
-6,102,287,088,448,674,000
38.344828
91
0.663745
false
akintolga/superdesk-core
superdesk/macros/update_to_pass_validation.py
1
2481
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
agpl-3.0
5,516,815,769,271,626,000
42.526316
113
0.648932
false
wyom/sympy
sympy/utilities/pkgdata.py
109
1872
""" pkgdata is a simple, extensible way for a package to acquire data file resources. The getResource function is equivalent to the standard idioms, such as the following minimal implementation:: import sys, os def getResource(identifier, pkgname=__name__): pkgpath = os.path.dirname(sys.modules[pkgna...
bsd-3-clause
-2,534,928,508,028,932,600
31.275862
75
0.670406
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/mapping_tests.py
4
22268
# tests common to dict and UserDict import unittest import collections import sys class BasicTestMappingProtocol(unittest.TestCase): # This base class can be used to check that an object conforms to the # mapping protocol # Functions that can be useful to override to adapt to dictionary # semantics ...
apache-2.0
-5,418,922,687,310,411,000
32.435435
88
0.532244
false
Taapat/enigma2-openpli-fulan
lib/python/Components/HdmiCec.py
1
14921
import struct, os, time from config import config, ConfigSelection, ConfigYesNo, ConfigSubsection, ConfigText from enigma import eHdmiCEC, eActionMap from Components.VolumeControl import VolumeControl from Tools.StbHardware import getFPWasTimerWakeup from enigma import eTimer from Screens import Standby from Tools impo...
gpl-2.0
4,376,784,333,517,321,700
37.456186
151
0.709805
false
mercycorps/TolaActivity
workflow/migrations/0026_auto_20190116_1357.py
1
1071
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2019-01-16 21:57 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('workflow', '0025_merge_20190116_1357'), ] operations = [ migrations.AddFiel...
apache-2.0
-8,148,642,789,494,836,000
29.6
108
0.579832
false
heldergg/dre
lib/djapian/database.py
5
1773
import os import xapian from djapian.utils.decorators import reopen_if_modified class Database(object): def __init__(self, path): self._path = path def open(self, write=False): """ Opens database for manipulations """ if not os.path.exists(self._path): os.m...
gpl-3.0
-5,387,732,894,903,389,000
23.625
79
0.553299
false
mrjacobagilbert/gnuradio
gr-utils/modtool/core/info.py
6
5693
# # Copyright 2013, 2018 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Returns information about a module """ import os from ..tools import get_modname from .base import ModTool, ModToolException class ModToolInfo(ModTool): """ Return in...
gpl-3.0
-8,158,839,113,144,155,000
42.792308
121
0.553487
false
shrimpboyho/git.js
emscript/python/2.7.5.1_32bit/Lib/site-packages/win32/test/test_pywintypes.py
15
3756
import sys import unittest import pywintypes import time from pywin32_testutil import str2bytes, ob2memory import datetime import operator class TestCase(unittest.TestCase): def testPyTimeFormat(self): struct_current = time.localtime() pytime_current = pywintypes.Time(struct_current) # try ...
gpl-2.0
7,585,449,360,488,928,000
34.771429
88
0.603568
false
zhuyue1314/CodeXt-ugly
LoadingBinaries/simplessl.py
2
2342
#!/usr/bin/env python #https://docs.python.org/dev/library/ssl.html import socket, ssl def server(): bindsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) bindsocket.bind(('127.0.0.1', 10000)) bindsocket.listen(5) print "Listening for a connection" tls_serv = ssl.wrap_socket(bindsocket, ...
gpl-2.0
3,942,863,915,987,311,600
31.541667
133
0.654569
false
bbbenja/SickRage
lib/imdb/linguistics.py
76
9353
""" linguistics module (imdb package). This module provides functions and data to handle in a smart way languages and articles (in various languages) at the beginning of movie titles. Copyright 2009-2012 Davide Alberani <da@erlug.linux.it> 2012 Alberto Malagoli <albemala AT gmail.com> 2009 H. Turg...
gpl-3.0
-5,765,955,495,830,458,000
44.62439
532
0.623757
false
huzq/scikit-learn
sklearn/impute/tests/test_knn.py
15
17366
import numpy as np import pytest from sklearn import config_context from sklearn.impute import KNNImputer from sklearn.metrics.pairwise import nan_euclidean_distances from sklearn.metrics.pairwise import pairwise_distances from sklearn.neighbors import KNeighborsRegressor from sklearn.utils._testing import assert_allc...
bsd-3-clause
7,536,339,638,250,127,000
26.092044
78
0.512438
false
bobeirasa/virtualenvs
pygeckozabbix/lib/python2.7/site-packages/setuptools/command/build_ext.py
286
11854
from distutils.command.build_ext import build_ext as _du_build_ext try: # Attempt to use Pyrex for building extensions, if available from Pyrex.Distutils.build_ext import build_ext as _build_ext except ImportError: _build_ext = _du_build_ext import os, sys from distutils.file_util import copy_file from set...
mit
-8,419,557,658,791,669,000
38.778523
93
0.582251
false
habeanf/Open-Knesset
agendas/listeners.py
14
4868
#encoding: utf-8 import datetime from django.db.models.signals import post_save, pre_delete, post_delete from django.contrib.contenttypes.models import ContentType from planet.models import Feed, Post from actstream import action from actstream.models import Follow from knesset.utils import cannonize, disable_for_loadd...
bsd-3-clause
8,557,941,748,784,059,000
48.171717
93
0.635374
false
Chipe1/aima-python
tests/test_probabilistic_learning.py
2
1122
import random import pytest from learning import DataSet from probabilistic_learning import * random.seed("aima-python") def test_naive_bayes(): iris = DataSet(name='iris') # discrete nbd = NaiveBayesLearner(iris, continuous=False) assert nbd([5, 3, 1, 0.1]) == 'setosa' assert nbd([6, 3, 4, 1.1...
mit
-6,828,413,184,369,733,000
28.526316
81
0.569519
false