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
anudr01d/anudr01d.github.io
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_asybuiltins.py
369
27319
# -*- coding: utf-8 -*- """ pygments.lexers._asybuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the asy-function names and asy-variable names of Asymptote. Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand. TODO: perl/python script in Asymptote SVN similar to asy-list.pl but onl...
mit
-7,109,296,885,919,176,000
15.607295
77
0.515722
false
jumpstarter-io/horizon
openstack_dashboard/dashboards/project/data_processing/jobs/tests.py
11
1751
# 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...
apache-2.0
-7,760,852,926,997,335,000
36.255319
75
0.695031
false
Weicong-Lin/pymo-global
android/pgs4a-0.9.6/python-install/lib/python2.7/encodings/cp858.py
416
34271
""" Python Character Mapping Codec for CP858, modified from cp850. """ import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): return codecs.charmap_decod...
mit
-644,729,594,935,440,800
48.098854
73
0.60077
false
rombie/contrail-controller
src/dns/scripts/del_virtual_dns.py
22
2658
#!/usr/bin/python # #Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import argparse import ConfigParser from provision_dns import DnsProvisioner from requests.exceptions import ConnectionError class DelVirtualDns(object): def __init__(self, args_str = None): self._args = None...
apache-2.0
-2,760,698,951,506,925,600
32.64557
96
0.59067
false
daenamkim/ansible
test/units/module_utils/network/nso/test_nso.py
2
6821
# Copyright (c) 2017 Cisco and/or its affiliates. # # 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 v...
gpl-3.0
-6,294,200,098,730,728,000
26.840816
129
0.539217
false
darkleons/BE
addons/mrp/stock.py
24
18483
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
1,518,941,751,383,555,300
57.67619
300
0.594492
false
hn8841182/20150623-test02
static/Brython3.1.0-20150301-090019/Lib/_strptime.py
518
21683
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
gpl-3.0
-7,604,141,210,089,282,000
41.432485
105
0.54831
false
BambooHR/rapid
rapid/master/controllers/api/upgrade_controller.py
1
1295
""" Copyright (c) 2015 Michael Bright and Bamboo HR LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
apache-2.0
6,371,753,827,477,354,000
37.088235
152
0.742085
false
leilihh/novaha
nova/keymgr/single_key_mgr.py
10
2555
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
3,408,993,021,928,366,000
34.486111
78
0.668493
false
DietPawel/playhistory
app/api.py
1
5417
from flask import Flask, jsonify, make_response, abort,request, send_from_directory, redirect, render_template, Response import db, datetime, csv from time import time from io import StringIO DEBUG = False #path to file to be displayed on index page INDEX = '/opt/index.html' app = Flask(__name__, static_url_path='') ...
gpl-3.0
-2,461,677,984,856,531,500
31.431138
176
0.613368
false
dannyperry571/theapprentice
plugin.video.youtube/resources/lib/kodion/utils/search_history.py
26
1063
import hashlib from storage import Storage from .methods import to_utf8 class SearchHistory(Storage): def __init__(self, filename, max_items=10): Storage.__init__(self, filename, max_item_count=max_items) pass def is_empty(self): return self._is_empty() def list(self): r...
gpl-2.0
7,318,096,972,539,202,000
21.166667
66
0.573848
false
SaturdayNeighborhoodHealthClinic/osler
appointment/migrations/0001_initial.py
2
4147
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2018-08-17 03:20 from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): in...
gpl-3.0
2,223,590,742,212,018,200
62.8
249
0.621413
false
IntelLabs/numba
numba/cuda/tests/cudapy/test_nondet.py
5
1378
import numpy as np from numba import cuda, float32, void from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B class TestCudaNonDet(CUDATestCase): def test_...
bsd-2-clause
1,490,630,722,710,402,300
27.122449
85
0.546444
false
lmtierney/selenium
py/test/unit/selenium/webdriver/edge/edge_options_tests.py
7
1807
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-4,814,514,105,816,652,000
31.267857
67
0.755396
false
gmr/helper
helper/setupext.py
2
2299
"""Add a setuptools command that runs a helper-based application.""" try: from setuptools import Command except ImportError: from distutils.core import Command try: from functools import reduce except ImportError: pass # use the builtin for py 2.x from . import parser from . import platform class R...
bsd-3-clause
-8,858,025,610,849,784,000
31.842857
74
0.645063
false
divya-csekar/flask-microblog-server
flask/Lib/site-packages/flask/config.py
781
6234
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
bsd-3-clause
6,417,184,727,938,708,000
36.107143
79
0.620629
false
smallyear/linuxLearn
salt/salt/states/keyboard.py
3
2081
# -*- coding: utf-8 -*- ''' Management of keyboard layouts ============================== The keyboard layout can be managed for the system: .. code-block:: yaml us: keyboard.system Or it can be managed for XOrg: .. code-block:: yaml us: keyboard.xorg ''' def __virtual__(): ''' Only ...
apache-2.0
7,694,156,515,442,815,000
23.77381
73
0.525709
false
newerthcom/savagerebirth
libs/python-2.72/Lib/plat-mac/Carbon/CarbonEvents.py
81
17904
# Generated from 'CarbonEvents.h' def FOUR_CHAR_CODE(x): return x def FOUR_CHAR_CODE(x): return x false = 0 true = 1 keyAEEventClass = FOUR_CHAR_CODE('evcl') keyAEEventID = FOUR_CHAR_CODE('evti') eventAlreadyPostedErr = -9860 eventTargetBusyErr = -9861 eventClassInvalidErr = -9862 eventClassIncorrectErr = -9864 eventH...
gpl-2.0
-8,961,275,274,261,275,000
38.698448
71
0.815628
false
angelapper/edx-platform
lms/djangoapps/survey/tests/test_utils.py
8
4057
""" Python tests for the Survey models """ from collections import OrderedDict from django.contrib.auth.models import User from django.test.client import Client from survey.models import SurveyForm from survey.utils import is_survey_required_for_course, is_survey_required_and_unanswered from xmodule.modulestore.test...
agpl-3.0
5,763,065,887,999,355,000
33.974138
96
0.649495
false
glovebx/zulip
zilencer/management/commands/populate_db.py
113
34944
from __future__ import absolute_import from django.core.management.base import BaseCommand from django.utils.timezone import now from django.contrib.sites.models import Site from zerver.models import Message, UserProfile, Stream, Recipient, Client, \ Subscription, Huddle, get_huddle, Realm, UserMessage, \ get...
apache-2.0
6,141,489,528,990,930,000
44.381818
124
0.589572
false
pratikmallya/hue
desktop/core/ext-py/Django-1.6.10/tests/test_client_regress/views.py
53
4346
import json from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.core.serializers.json import DjangoJSONEncoder from django.test.client import CONTENT_TYPE_RE fro...
apache-2.0
5,072,012,168,673,717,000
36.465517
99
0.710999
false
slozier/ironpython2
Src/StdLib/Lib/site-packages/win32/test/test_pywintypes.py
2
3632
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 ...
apache-2.0
-4,986,215,822,620,276,000
35.32
88
0.604075
false
JioCloud/nova
nova/api/openstack/compute/schemas/v3/admin_password.py
111
1078
# Copyright 2013 NEC Corporation. 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 ...
apache-2.0
1,453,528,010,883,358,000
32.6875
78
0.643785
false
ktnyt/chainer
chainer/distributions/gamma.py
2
2638
import chainer from chainer.backends import cuda from chainer import distribution from chainer.functions.array import broadcast from chainer.functions.array import where from chainer.functions.math import digamma from chainer.functions.math import exponential from chainer.functions.math import lgamma class Gamma(dist...
mit
-76,927,761,244,264,350
27.989011
79
0.60235
false
diegocortassa/TACTIC
src/context/client/tactic-api-python-4.0.api04/Tools/Scripts/ftpmirror.py
10
13254
#! /usr/bin/env python """Mirror a remote ftp subtree into a local directory tree. usage: ftpmirror [-v] [-q] [-i] [-m] [-n] [-r] [-s pat] [-l username [-p passwd [-a account]]] hostname[:port] [remotedir [localdir]] -v: verbose -q: quiet -i: interactive mode -m: macintosh ...
epl-1.0
-6,241,551,697,822,772,000
31.135
82
0.501886
false
jupyter/jupyterlab
conftest.py
4
1210
# -*- coding: utf-8 -*- # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import pytest pytest_plugins = [ "jupyter_server.pytest_plugin", "jupyterlab_server.pytest_plugin", "jupyterlab.pytest_plugin" ] def pytest_addoption(parser): """ Adds f...
bsd-3-clause
3,665,209,046,421,171,000
27.139535
72
0.62314
false
TEAM-Gummy/platform_external_chromium_org
third_party/closure_linter/closure_linter/common/matcher.py
284
2158
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
bsd-3-clause
2,526,134,208,970,661,000
34.966667
80
0.726599
false
PrasannaVenkadesh/portia
slyd/tests/test_repoman.py
14
9855
import unittest from tempfile import mkdtemp from os.path import join from shutil import rmtree from json import dumps, loads import copy from .settings import SPEC_DATA_DIR from slyd.gitstorage.repoman import Repoman def j(json): return dumps(json, sort_keys=True, indent=4) class RepomanTest(unittest.TestCas...
bsd-3-clause
2,509,798,241,879,947,000
44.206422
79
0.577981
false
StepicOrg/Stepic-API
examples/get_courses_by_params.py
1
2154
import json import requests def get_token(): client_id = "..." client_secret = "..." auth = requests.auth.HTTPBasicAuth(client_id, client_secret) resp = requests.post('https://stepik.org/oauth2/token/', data={'grant_type': 'client_credentials'}, ...
mit
-4,621,145,685,091,097,000
35.789474
107
0.572423
false
ajaali/django
django/core/handlers/base.py
234
13346
from __future__ import unicode_literals import logging import sys import types import warnings from django import http from django.conf import settings from django.core import signals, urlresolvers from django.core.exceptions import ( MiddlewareNotUsed, PermissionDenied, SuspiciousOperation, ) from django.db impo...
bsd-3-clause
6,913,302,826,365,807,000
42.614379
113
0.589915
false
hackendless/heekscnc
roughing_funcs.py
24
13251
import kurve import area from nc.nc import * import math # roughing_funcs.py- intended to be used for lathe roughing # adapted from area_funcs.py and turning.py # and possibly roughing a profile-approaching the part from the side # some globals, to save passing variables as parameters too much area_for_feed_po...
bsd-3-clause
1,588,618,612,903,993,000
29.326241
209
0.551958
false
alexforencich/python-ivi
ivi/agilent/agilentMSOX92004A.py
2
1692
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2017 Alex Forencich 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...
mit
6,651,070,387,465,703,000
37.454545
86
0.737589
false
DemocracyClub/yournextrepresentative
ynr/apps/cached_counts/views.py
1
3171
import json from django.db.models import Count from django.http import HttpResponse from django.views.generic import TemplateView from candidates.models import Ballot from elections.mixins import ElectionMixin from elections.models import Election from parties.models import Party from popolo.models import Membership ...
agpl-3.0
5,946,603,774,880,731,000
30.71
77
0.602334
false
olt/mapproxy
mapproxy/service/ows.py
13
1357
# This file is part of the MapProxy project. # Copyright (C) 2011 Omniscale <http://omniscale.de> # # 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...
apache-2.0
-2,442,527,379,156,336,600
34.710526
84
0.670597
false
rfleschenberg/djangocms-cascade
cmsplugin_cascade/migrations/0009_cascadepage.py
1
1447
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-07 22:03 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('cms', '0013_urlconfrevision'), ...
mit
-4,303,575,751,125,042,700
42.848485
199
0.624741
false
mszewczy/odoo
addons/account/wizard/account_open_closed_fiscalyear.py
237
2537
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
5,670,354,933,521,232,000
48.745098
202
0.632243
false
jendap/tensorflow
tensorflow/contrib/distributions/python/ops/moving_stats.py
42
10125
# 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
-3,260,370,201,121,433,600
40.158537
80
0.652642
false
apache/incubator-airflow
tests/www/test_security.py
3
19165
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
3,754,390,603,396,629,000
41.028509
110
0.625828
false
marratj/ansible
lib/ansible/plugins/connection/lxd.py
44
4475
# (c) 2016 Matt Clay <matt@mystile.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: Matt Clay <matt@mystile.com> conne...
gpl-3.0
-223,904,128,685,930,720
35.382114
103
0.629721
false
golharam/StarCluster
starcluster/sshutils.py
14
32130
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster 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 3 of the License, or (at your option) any # later ...
gpl-3.0
3,477,695,768,460,747,000
34.268935
79
0.566698
false
DARKPOP/external_chromium_org
build/android/avd.py
46
3735
#!/usr/bin/env python # Copyright (c) 2013 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. """Launches Android Virtual Devices with a set configuration for testing Chrome. The script will launch a specified number of Andr...
bsd-3-clause
9,026,403,345,575,977,000
37.90625
80
0.653012
false
jakdept/pythonbook
ch4/picture_grid_test.py
1
1147
#!/usr/bin/env python3.5 ''' Automate the Boring Stuff with Python generic testing for chapter 4 projects Jack Hayhurst ''' from io import StringIO import unittest from unittest.mock import patch import picture_grid class TestPictureGrid(unittest.TestCase): '''tests the picture_grid.py script''' def test_pi...
mit
4,971,555,962,770,355,000
24.511111
67
0.428945
false
myerpengine/odoo
addons/calendar/controllers/main.py
36
3503
import simplejson import openerp import openerp.addons.web.http as http from openerp.addons.web.http import request import openerp.addons.web.controllers.main as webmain import json class meeting_invitation(http.Controller): @http.route('/calendar/meeting/accept', type='http', auth="calendar") def accept(sel...
agpl-3.0
-2,846,991,591,677,144,000
48.338028
133
0.634599
false
s20121035/rk3288_android5.1_repo
external/mesa3d/scons/crossmingw.py
13
8201
"""SCons.Tool.gcc Tool-specific initialization for MinGW (http://www.mingw.org/) There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. See also http://www.scons.org/wiki/CrossCompilingMingw """ # # Copyright (c) 2001,...
gpl-3.0
3,247,736,349,826,968,000
34.197425
135
0.64041
false
eleonrk/SickRage
lib/pbr/tests/test_version.py
13
14100
# Copyright 2012 Red Hat, Inc. # Copyright 2012-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/licen...
gpl-3.0
-7,143,823,228,833,034,000
44.337621
79
0.618298
false
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/python2.7/idlelib/WidgetRedirector.py
143
4476
from Tkinter import * class WidgetRedirector: """Support for redirecting arbitrary widget subcommands. Some Tk operations don't normally pass through Tkinter. For example, if a character is inserted into a Text widget by pressing a key, a default Tk binding to the widget's 'insert' operation is acti...
gpl-2.0
-7,079,171,522,849,079,000
34.52381
79
0.62042
false
eusi/MissionPlanerHM
Lib/site-packages/scipy/constants/__init__.py
55
1121
""" Various useful constants and conversion formulae Modules ------- .. autosummary:: :toctree: generated/ codata - CODATA Recommended Values of Fundamental Physical Const (2006) constants - Collection of physical constants and conversion factors Functions --------- .. autosummary:: :toctree: generated...
gpl-3.0
-7,496,944,512,938,822,000
27.025
74
0.738626
false
indico/indico
indico/modules/rb/operations/rooms.py
4
9012
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from datetime import date, datetime, time from dateutil.relativedelta import relativedelta from flask imp...
mit
4,153,696,097,069,037,600
44.746193
119
0.618509
false
pschmitt/home-assistant
homeassistant/components/radarr/sensor.py
16
7642
"""Support for Radarr.""" from datetime import datetime, timedelta import logging import time from pytz import timezone import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_API_KEY, CONF_HOST, CONF_MONITORED_CONDITIONS,...
apache-2.0
-6,186,804,518,946,395,000
30.841667
87
0.570139
false
andyrooger/OAT
src/interactive/commandui.py
1
6086
""" Command based UI for the obfuscator. """ # OAT - Obfuscation and Analysis Tool # Copyright (C) 2011 Andy Gurden # # This file is part of OAT. # # OAT 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 Softwar...
gpl-3.0
1,715,927,257,871,010,300
29.43
125
0.581663
false
jeffrey4l/nova
nova/api/openstack/compute/contrib/used_limits.py
62
3281
# Copyright 2012 OpenStack Foundation # # 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
-1,310,063,815,344,694,300
34.27957
78
0.608961
false
jeffery9/mixprint_addons
project_long_term/wizard/project_compute_tasks.py
63
2545
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
7,048,233,546,083,763,000
38.765625
88
0.591749
false
kleientertainment/ds_mod_tools
pkg/win32/Python27/Lib/htmlentitydefs.py
65
18327
"""HTML character entity references.""" # maps the HTML entity name to the Unicode codepoint name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 'Acirc': 0x00c2, # latin...
mit
160,853,746,287,709,600
65.131868
110
0.640694
false
skevy/django
tests/regressiontests/utils/text.py
51
2200
import unittest from django.utils import text class TestUtilsText(unittest.TestCase): def test_truncate_words(self): self.assertEqual(u'The quick brown fox jumped over the lazy dog.', text.truncate_words(u'The quick brown fox jumped over the lazy dog.', 10)) self.assertEqual(u'The qui...
bsd-3-clause
-4,441,511,200,753,817,600
54
130
0.603636
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Tools/pynche/TypeinViewer.py
116
6102
"""TypeinViewer class. The TypeinViewer is what you see at the lower right of the main Pynche widget. It contains three text entry fields, one each for red, green, blue. Input into these windows is highly constrained; it only allows you to enter values that are legal for a color axis. This usually means 0-255 for de...
apache-2.0
-2,463,996,484,024,964,600
36.666667
78
0.543265
false
ThePletch/ansible
lib/ansible/modules/network/ipinfoio_facts.py
39
4067
#!/usr/bin/python # # (c) 2016, Aleksei Kostiuk <unitoff@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 o...
gpl-3.0
600,759,931,336,202,600
27.843972
77
0.622572
false
hiepthai/django-activity-stream
actstream/migrations/0001_initial.py
8
7969
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from actstream.compat import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Follow' db.create_table('actstream_follow', ( ...
bsd-3-clause
-14,829,090,282,516,132
68.295652
204
0.587903
false
jbaiter/spreads
spreadsplug/intervaltrigger.py
2
2100
# -*- coding: utf-8 -*- # Copyright (C) 2014 Johannes Baiter <johannes.baiter@gmail.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 # published by the Free Software Foundation, either version 3 of the # License, or (at your ...
agpl-3.0
-4,346,167,278,326,031,400
34
75
0.647619
false
kumar303/rockit
vendor-local/boto/ec2/instance.py
2
17445
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # 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 # w...
bsd-3-clause
-833,427,655,962,232,000
35.881607
80
0.596389
false
jsquare/hikeplanner
hikes/views.py
1
4162
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound from hikes.models import Hike from django.shortcuts import render_to_response, render from django.contrib.gis import forms from django.contrib import auth from django.contrib.auth.forms import UserCreationForm from django.core.urlresolvers...
gpl-2.0
-8,148,998,843,363,708,000
35.508772
143
0.689092
false
da-nrw/DNSCore
3rdParty/fido/fido/argparselocal.py
6
87524
# -*- coding: utf-8 -*- # Copyright © 2006-2009 Steven J. Bethard <steven.bethard@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...
gpl-3.0
-2,687,283,327,449,251,300
36.164756
96
0.560744
false
bdyetton/prettychart
website/addons/forward/tests/test_models.py
44
1805
# -*- coding: utf-8 -*- from nose.tools import * # PEP8 asserts from modularodm.exceptions import ValidationError from tests.base import OsfTestCase from website.addons.forward.tests.factories import ForwardSettingsFactory class TestSettingsValidation(OsfTestCase): def setUp(self): super(TestSettings...
apache-2.0
5,456,204,765,736,353,000
27.650794
73
0.629363
false
weitengchu/rt-thread
components/external/freetype/src/tools/docmaker/formatter.py
132
6019
# # formatter.py # # Convert parsed content blocks to a structured document (library file). # # Copyright 2002, 2004, 2007, 2008, 2014 by # David Turner. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.T...
gpl-2.0
-926,340,232,307,868,300
25.991031
76
0.537465
false
nccgroup/typofinder
howoldisdomain/whois.py
2
10182
# # Typofinder for domain typo discovery # # Released as open source by NCC Group Plc - http://www.nccgroup.com/ # # Simple whois query function # # Based on RFC3912 # # Developed by Matt Summers, matt dot summers at nccgroup dot com # and Stephen Tomkinson # # http://www.github.com/nccgroup/typofinder # #...
agpl-3.0
-4,323,212,683,029,507,000
31.429936
164
0.570909
false
r03ert0/ldsc
test/test_sumstats.py
3
16976
from __future__ import division import ldscore.sumstats as s import ldscore.parse as ps import unittest import numpy as np import pandas as pd from pandas.util.testing import assert_series_equal, assert_frame_equal from nose.tools import * from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_...
gpl-3.0
-525,288,307,735,595,800
33.858316
113
0.547184
false
PaulVanSchayck/irods
tests/pydevtest/test_resource_types.py
2
222736
import commands import getpass import os import re import shutil import subprocess import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest import configuration import lib from resource_suite import ResourceSuite, ResourceBase from test_chunkydevtest import ChunkyDevTest c...
bsd-3-clause
1,122,051,511,010,169,500
63.523754
173
0.615347
false
dreal/dreal
benchmarks/network/thermostat/thermostat-double-i-p.py
11
3580
from gen import * ########## # shared # ########## flow_var[0] = """ (declare-fun tau () Real) """ flow_dec[0] = """ (define-ode flow_1 ((= d/dt[tau] 1))) """ state_dec[0] = """ (declare-fun time_{0} () Real) (declare-fun tau_{0}_0 () Real) (declare-fun tau_{0}_t () Real) """ state_val[0] = """ (assert (<= 0 ...
gpl-2.0
-9,032,462,611,318,067,000
25.131387
86
0.439665
false
fingeronthebutton/robotframework
src/robot/variables/variables.py
20
2701
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
5,812,669,188,175,279,000
32.7625
77
0.694928
false
ashleyh/zoo
callgraph/clang/cindex.py
1
42680
#===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------------------------------...
gpl-3.0
3,310,479,464,577,405,400
31.730061
88
0.665745
false
blakfeld/ansible
lib/ansible/plugins/action/script.py
15
4083
# (c) 2012, Michael DeHaan <michael.dehaan@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 lat...
gpl-3.0
-7,500,735,715,795,243,000
41.978947
143
0.643644
false
Y3K/django
tests/prefetch_related/models.py
255
7972
import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible # Basic tests @python_2_unicode_compatible class Author(models....
bsd-3-clause
2,923,532,245,882,389,000
26.777003
102
0.673482
false
BryanCutler/spark
python/pyspark/tests/test_readwrite.py
23
14386
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
8,499,323,396,713,133,000
44.815287
100
0.616016
false
michaelconnor00/gbdxtools
gbdxtools/catalog_search_aoi.py
1
3959
""" GBDX Catalog Search Helper Functions. This set of functions is used for breaking up a large AOI into smaller AOIs to search, because the catalog API can only handle 2 square degrees at a time. """ from builtins import zip from builtins import range from pygeoif import geometry import json def point_in_poly(x,y...
mit
8,279,207,759,648,245,000
29.697674
150
0.579439
false
jjscarafia/odoo
addons/base_import/tests/test_cases.py
84
13383
# -*- encoding: utf-8 -*- import unittest2 from openerp.tests.common import TransactionCase from .. import models ID_FIELD = { 'id': 'id', 'name': 'id', 'string': "External ID", 'required': False, 'fields': [], } def make_field(name='value', string='unknown', required=False, fields=[]): retur...
agpl-3.0
6,780,955,096,681,731,000
36.354749
115
0.5126
false
shimpe/pyvectortween
vectortween/SequentialAnimation.py
1
2872
from copy import deepcopy import numpy as np from vectortween.Animation import Animation from vectortween.Mapping import Mapping from vectortween.Tween import Tween def normalize(x): return x / sum(x) class SequentialAnimation(Animation): def __init__(self, list_of_animations=None, timeweight=None, repeat...
mit
6,247,802,363,189,065,000
40.028571
130
0.619777
false
spaceof7/QGIS
python/plugins/MetaSearch/pavement.py
67
7402
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com) # # This source 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-2.0
5,971,240,272,225,238,000
31.182609
79
0.605917
false
trabucayre/periphondemand
periphondemand/toolchains/synthesis/vivado/vivado.py
2
26838
#! /usr/bin/python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Name: ise.py # Purpose: # Author: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com> # Created: 21/07/2015 # ---------------------------------------------------------------------...
lgpl-2.1
-1,396,601,286,510,807,600
41.46519
79
0.47906
false
omaciel/pylyglot
translations/views.py
1
2607
# -*- encoding: utf-8 -*- # vim: ts=4 sw=4 expandtab ai # # This file is part of Pylyglot. # # Pylyglot 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) an...
gpl-3.0
9,005,606,434,864,418,000
35.71831
76
0.613349
false
jim-thisplace/exercises-in-programming-style
33-restful/tf-33.py
17
3653
#!/usr/bin/env python import re, string, sys with open("../stop_words.txt") as f: stops = set(f.read().split(",")+list(string.ascii_lowercase)) # The "database" data = {} # Internal functions of the "server"-side application def error_state(): return "Something wrong", ["get", "default", None] # The "server"...
mit
-7,315,360,128,486,364,000
33.140187
116
0.582809
false
ivanmarcin/kubernetes
cluster/saltbase/salt/_states/container_bridge.py
96
5593
# Copyright 2014 Google 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 # # Unless required by applicable law or a...
apache-2.0
6,241,363,958,323,254,000
33.312883
79
0.55784
false
morreene/tradenews
venv/Lib/site-packages/flask/testsuite/reqctx.py
557
5960
# -*- coding: utf-8 -*- """ flask.testsuite.reqctx ~~~~~~~~~~~~~~~~~~~~~~ Tests the request context. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest try: from greenlet import greenlet except ImportError: greenlet = None...
bsd-3-clause
-2,546,403,071,072,841,700
31.216216
109
0.550503
false
lyoshenka/PyPagekite
pagekite/ui/basic.py
2
9580
""" This is the "basic" text-mode user interface class. """ ############################################################################# LICENSE = """\ This file is part of pagekite.py. Copyright 2010-2013, the Beanstalks Project ehf. and Bjarni Runar Einarsson This program is free software: you can redistribute it a...
agpl-3.0
-3,555,205,676,955,723,300
34.746269
80
0.568894
false
jhawkesworth/ansible
lib/ansible/modules/network/dellos10/dellos10_command.py
39
7311
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com> # Copyright: (c) 2017, Dell 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 ...
gpl-3.0
-7,767,602,693,540,514,000
30.649351
93
0.646834
false
2ndQuadrant/ansible
lib/ansible/modules/cloud/vmware/vmware_host_package_facts.py
47
4254
#!/usr/bin/python # -*- coding: utf-8 -*- # 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__ = type ANSIBLE_METADATA = { 'metadata...
gpl-3.0
-1,821,010,012,927,690,200
33.032
106
0.605783
false
anilmuthineni/tensorflow
tensorflow/python/saved_model/main_op.py
5
2262
# Copyright 2015 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
-411,151,667,317,544,640
36.081967
80
0.728559
false
npuichigo/ttsflow
third_party/tensorflow/tensorflow/python/kernel_tests/variables_test.py
18
23601
# Copyright 2015 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
3,985,162,514,220,124,700
35.819033
94
0.634761
false
sivatha/video-player-sample
source/core/js/libs/closure-library/closure/bin/build/depswriter.py
17
6206
#!/usr/bin/env python # # Copyright 2009 The Closure Library 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 ...
apache-2.0
4,009,221,084,929,332,000
29.126214
79
0.640509
false
WimpyAnalytics/django-andablog
demo/common/migrations/0002_auto_20150507_1708.py
1
1391
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django import VERSION as DJANGO_VERSION def get_operations(): """ This will break things if you upgrade Django to 1.8 having already applied this migration in 1.7. Since this is for a demo site i...
bsd-2-clause
3,429,777,446,212,096,000
33.8
256
0.647735
false
dfdx2/django
tests/httpwrappers/tests.py
14
30531
import copy import json import os import pickle import unittest import uuid from django.core.exceptions import DisallowedRedirect, SuspiciousOperation from django.core.serializers.json import DjangoJSONEncoder from django.core.signals import request_finished from django.db import close_old_connections from django.http...
bsd-3-clause
-8,008,414,834,805,939,000
38.356129
118
0.59939
false
Yuliang-Zou/Automatic_Group_Photography_Enhancement
lib/roi_pooling_layer/roi_pooling_op_grad.py
1
1375
import tensorflow as tf from tensorflow.python.framework import ops import roi_pooling_op import pdb @tf.RegisterShape("RoiPool") def _roi_pool_shape(op): """Shape function for the RoiPool op. """ dims_data = op.inputs[0].get_shape().as_list() channels = dims_data[3] dims_rois = op.inputs[1].get_shape().as...
mit
8,385,428,540,939,118,000
30.976744
112
0.694545
false
msdubov/AST-text-analysis
east/main.py
2
6145
# -*- coding: utf-8 -* import getopt import os import sys from east import applications from east import consts from east import formatting from east.synonyms import synonyms from east import relevance from east import utils def main(): args = sys.argv[1:] opts, args = getopt.getopt(args, "s:a:w:v:l:f:c:r:p...
mit
-563,512,355,871,391,040
38.391026
110
0.573149
false
reasonerjt/harbor
make/photon/prepare/commands/gencerts.py
3
1188
import os import sys import click import pathlib import logging from subprocess import Popen, PIPE, STDOUT, CalledProcessError from utils.cert import openssl_installed from utils.misc import get_realpath gen_tls_script = pathlib.Path(__file__).parent.parent.joinpath('scripts/gencert.sh').absolute() @click.command() ...
apache-2.0
-8,884,601,590,905,630,000
35
100
0.685185
false
kennedyshead/home-assistant
tests/components/mikrotik/test_init.py
8
3080
"""Test Mikrotik setup process.""" from unittest.mock import AsyncMock, Mock, patch from homeassistant.components import mikrotik from homeassistant.setup import async_setup_component from . import MOCK_DATA from tests.common import MockConfigEntry async def test_setup_with_no_config(hass): """Test that we do ...
apache-2.0
-6,798,248,406,447,578,000
32.478261
73
0.666558
false
julien-hadleyjack/genrss-py
src/genrss/podcast.py
1
5482
#!/usr/bin/env python # -*- coding: utf-8 -*- from future.standard_library import install_aliases install_aliases() import os import re from operator import attrgetter from urllib.request import urlretrieve from io import open from PIL import Image from jinja2 import Environment, FileSystemLoader, StrictUndefined f...
bsd-2-clause
-5,099,532,245,293,287,000
36.292517
109
0.592667
false
Spleen64/Sick-Beard
lib/subliminal/services/subswiki.py
35
5235
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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 3 of...
gpl-3.0
-6,734,466,089,612,795,000
51.29
165
0.629183
false
ClearCorp-dev/account-financial-reporting
account_move_line_report_xls/report/move_line_list_xls.py
25
17494
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
-8,339,705,667,250,862,000
45.900804
79
0.469189
false
t27/ol3
bin/check-whitespace.py
5
1582
import logging import re import sys logging.basicConfig(format='%(asctime)s %(name)s: %(message)s', level=logging.INFO) logger = logging.getLogger('check-whitespace') CR_RE = re.compile(r'\r') LEADING_WHITESPACE_RE = re.compile(r'\s+') TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z') NO_NEWLINE_RE...
bsd-2-clause
1,302,888,564,204,308,500
34.954545
79
0.554994
false
JayvicWen/Crawler
kaoyan/crawl_post.py
2
2301
#!/usr/bin/env python # encoding:utf-8 import os import sys import requests import MySQLdb from bs4 import BeautifulSoup from bs4 import SoupStrainer from config import * base_url = 'http://download.kaoyan.com' status = [] def get_soup(url, parse_only=None): content = requests.get(url).content return Beau...
mit
7,428,678,633,358,786,000
23.731183
88
0.584783
false
vnc-biz/pyzimbra
pyzimbra/z/admin.py
3
2605
# -*- coding: utf-8 -*- """ ################################################################################ # Copyright (c) 2010, Ilgar Mashayev # # E-mail: pyzimbra@lab.az # Website: http://github.com/ilgarm/pyzimbra ################################################################################ # This file is part...
lgpl-3.0
6,102,514,193,900,940,000
32.831169
80
0.547793
false
arummler/eudaq
legacy/producers/palpidess/scripts/slow_control/config_pALPIDE_driver.py
11
3952
#! /usr/bin/env python ## ## standard configuration of the FEC HLVDS for the use ## with the pALPIDE with the Padua Proximity board V1 ## import sys import os import SlowControl # slow control code import biasDAC # special code to setup up the voltage biases m = SlowControl.SlowControl(0) # HLVDS FEC (master) # w...
lgpl-3.0
-1,160,590,148,767,314,200
41.494624
99
0.577176
false