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
dysseus88/virtuelium
Doc/sphinx/external/breathe/parser/doxygen/compoundsuper.py
1
237694
#!/usr/bin/env python # # Generated Thu Jun 11 18:44:25 2009 by generateDS.py. # import sys import getopt from string import lower as str_lower from xml.dom import minidom from xml.dom import Node # # User methods # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these metho...
gpl-2.0
-4,843,051,465,328,793,000
39.995861
641
0.594584
false
unixfreaxjp/pyew
plugins/easygui.py
17
84753
""" @version: 0.93(2009-07-07) @note: EasyGui provides an easy-to-use interface for simple GUI interaction with a user. It does not require the programmer to know anything about tkinter, frames, widgets, callbacks or lambda. All GUI interactions are invoked by simple function calls that return results. @no...
gpl-2.0
-590,173,044,459,968,600
34.019125
209
0.532559
false
ashang/calibre
src/calibre/ebooks/pdb/plucker/reader.py
20
27486
# -*- coding: utf-8 -*- #from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '20011, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import os import struct import zlib from collections import OrderedDict from cal...
gpl-3.0
-6,113,474,084,129,347,000
36.193505
248
0.480317
false
marcli/sos
sos/plugins/megacli.py
12
1513
# megacli.py # Copyright (C) 2007-2014 Red Hat, Inc., Jon Magrini <jmagrini@redhat.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, or # (at your option) an...
gpl-2.0
-4,342,386,518,803,302,400
31.891304
74
0.678123
false
ryszard/python-flaker
flaker/__init__.py
1
14250
# -*- coding: utf-8 -*- """ >>> flak = Flaker() >>> flak.show(9) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE Flak(...) >>> flak.query(tag="python", limit=1, sort='asc') # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE [Flak(...)] >>> flak.friends(login="szopa") # doctest: +ELLIPSIS, +NOR...
mit
-6,163,866,534,295,484,000
31.758621
139
0.563579
false
saikanth88/femus
applications/OptimalControl/boundary_control_inequality/neumann/neumann_lifting_intrnl/input/square_parametric.py
4
5255
#!/usr/bin/env python ### ### This file is generated automatically by SALOME v9.3.0 with dump python functionality ### import sys import salome salome.salome_init() import salome_notebook notebook = salome_notebook.NoteBook() sys.path.insert(0, r'/home/gbornia/software/femus/applications/OptimalControl/boundary_cont...
lgpl-2.1
313,409,032,075,351,600
36.535714
142
0.675547
false
rancher/rancher
tests/validation/tests/v3_api/test_bkp_restore_s3_with_creds.py
4
2332
import pytest from .common import * # NOQA from .test_rke_cluster_provisioning import rke_config, validate_rke_dm_host_2,\ node_template_linode namespace = {"p_client": None, "ns": None, "cluster": None, "project": None, "nodes": []} backup_info = {"backupname": None, "backup_id": None, "workload": N...
apache-2.0
-5,560,757,561,194,600,000
33.80597
79
0.617496
false
zeromq/malamute
bindings/python_cffi/setup.py
1
1062
################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Read the zproject/README.md for information about making permanent changes. # #############################################################################...
mpl-2.0
4,593,233,751,906,505,700
45.173913
80
0.473635
false
philippjfr/bokeh
bokeh/tests/test_resources.py
6
10959
from __future__ import absolute_import import unittest import os import bokeh.resources as resources from bokeh.models import Model from bokeh.resources import _get_cdn_urls # if BOKEH_RESOURCES is set many tests in this file fail if os.environ.get("BOKEH_RESOURCES"): raise RuntimeError("Cannot run the unit tes...
bsd-3-clause
-6,637,732,347,927,666,000
37.861702
156
0.591934
false
ncss-tech/geo-pit
SSURGO_DownloadTools_2015/SSURGO_gSSURGO_byState.py
1
20847
# SSURGO_gSSURGO_byState.py # # ArcGIS 10.1 # # Steve Peaslee, August 02, 2011 # # Revising code to work with ArcGIS 10.1 and new SSURGO Download tools # Designed to drive "SSURGO_MergeSoilShapefilesbyAreasymbol_GDB.py" # # SDM Access query for getting overlap areas (that have spatial data) by state: # SELECT...
gpl-2.0
4,254,420,431,685,354,000
38.956778
203
0.547657
false
kapilt/cloud-custodian
tools/c7n_gcp/tests/test_dataflow.py
4
2156
# Copyright 2019 Capital One Services, 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 to in...
apache-2.0
-4,105,013,917,104,693,000
41.27451
74
0.602505
false
google-research/falken
service/generated_flatbuffers/tflite/UnpackOptions.py
1
3022
# Copyright 2021 Google 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 to in writing, ...
apache-2.0
2,746,548,766,809,255,400
31.494624
114
0.683322
false
xifle/home-assistant
tests/components/test_google.py
13
3425
"""The tests for the Google Calendar component.""" import logging import unittest from unittest.mock import patch import homeassistant.components.google as google from homeassistant.bootstrap import setup_component from tests.common import get_test_home_assistant _LOGGER = logging.getLogger(__name__) class TestGoog...
mit
7,199,500,013,132,097,000
35.43617
78
0.552701
false
zzacharo/inspire-next
inspirehep/modules/literaturesuggest/normalizers.py
1
4267
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
8,571,805,405,501,490,000
30.607407
94
0.661589
false
danking/hail
hail/python/hail/experimental/expressions.py
2
1892
import hail as hl from hail.expr.expressions import expr_any, analyze from hail.typecheck import typecheck @typecheck(expr=expr_any, path=str, overwrite=bool) def write_expression(expr, path, overwrite=False): """Write an Expression. In the same vein as Python's pickle, write out an expression that does no...
mit
2,016,482,495,368,652,500
28.107692
102
0.650634
false
spektom/incubator-airflow
airflow/providers/google/cloud/example_dags/example_natural_language.py
5
5120
# # 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
8,528,548,654,798,477,000
45.126126
106
0.757227
false
DaivdZhang/tinyControl
tcontrol/tests/test_transferfunction.py
1
2573
from unittest import TestCase from tcontrol.transferfunction import TransferFunction, tf, zpk from ..exception import * import numpy as np class TestTransferFunction(TestCase): def setUp(self): self.s1 = TransferFunction([1, 1], [1, 0, 1]) self.s2 = TransferFunction([1, 0, 1], [1, 0, 0, 1]) ...
bsd-3-clause
3,573,576,839,636,185,000
35.757143
90
0.547998
false
HacktheCampus/my
staff/models.py
1
2681
from django.db import models from django.contrib.auth.models import User from django.utils.crypto import get_random_string from django.dispatch import receiver from django.db.models.signals import post_save, post_delete from django.core.exceptions import ObjectDoesNotExist from django.conf import settings # Create your...
agpl-3.0
-3,852,968,801,402,205,700
28.461538
123
0.666169
false
forkbong/qutebrowser
tests/unit/misc/test_pastebin.py
1
3668
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2021 Florian Bruhin (The-Compiler) <me@the-compiler.org> # Copyright 2016-2018 Anna Kobak (avk) <awerk@onet.eu>: # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the ...
gpl-3.0
-4,054,301,454,544,694,000
29.31405
78
0.64831
false
jasimpson/gnuradio-jasimpson
gnuradio-core/src/python/gnuradio/gr/qa_delay.py
10
1990
#!/usr/bin/env python # # Copyright 2004,2007,2010 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 you...
gpl-3.0
6,335,960,633,072,230,000
29.615385
70
0.630653
false
tyll/fas
plugins/fas-plugin-dummy/setup.py
11
1062
# Dummy Plugin for FAS2 __requires__='TurboGears >= 1.0.4' from setuptools import setup, find_packages from turbogears.finddata import find_package_data, standard_exclude, \ standard_exclude_directories import os, glob excludeFiles = ['*.cfg.in'] excludeFiles.extend(standard_exclude) excludeDataDirs = [''] ex...
gpl-2.0
-4,649,599,810,502,107,000
30.235294
125
0.648776
false
ville-k/tensorflow
tensorflow/python/util/deprecation.py
30
15749
# Copyright 2016 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
8,608,136,013,447,366,000
38.870886
80
0.665376
false
davidszotten/redeer
redeer/feeds/migrations/0002_auto__add_field_group_owner.py
1
5436
# -*- 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 'Group.user' db.add_column(u'feeds_group', 'user', self.gf('django.db.m...
mit
-4,568,585,499,924,758,000
60.772727
187
0.540655
false
affansyed/bcc
tools/trace.py
1
29938
#!/usr/bin/env python # # trace Trace a function and print a trace message based on its # parameters, with an optional filter. # # usage: trace [-h] [-p PID] [-t TID] [-v] [-Z STRING_SIZE] [-S] # [-M MAX_EVENTS] [-o] [-K] [-U] [-I header] # probe [probe ...] # # Licensed ...
apache-2.0
6,398,460,095,067,535,000
43.286982
79
0.450063
false
enjaz/enjaz
studentguide/utils.py
2
2711
from studentguide.models import GuideProfile from clubs.models import Club import accounts.utils import clubs.utils def is_studentguide_member(user): user_clubs = user.memberships.current_year() return user_clubs.filter(english_name='Student Guide').exists() def is_studentguide_coordinator_or_deputy(user): ...
agpl-3.0
-3,614,012,308,838,713,000
36.136986
94
0.668757
false
felliott/osf.io
api_tests/institutions/views/test_institution_user_metric_list.py
6
9613
import pytest import datetime import csv from io import StringIO from random import random import time from api.base.settings.defaults import API_BASE, DEFAULT_ES_NULL_VALUE from osf_tests.factories import ( InstitutionFactory, AuthUserFactory, ) from osf.metrics import UserInstitutionProjectCounts from api.b...
apache-2.0
3,551,752,523,520,104,400
35.003745
133
0.531884
false
ToonTownInfiniteRepo/ToontownInfinite
toontown/coghq/CashbotMintLavaRoom_Action00.py
7
3518
from toontown.coghq.SpecImports import * GlobalEntities = {1000: {'type': 'levelMgr', 'name': 'LevelMgr', 'comment': '', 'parentEntId': 0, 'cogLevel': 0, 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE19a', 'wantDoors': 1}, 1001: {'type...
mit
-1,105,349,047,207,158,500
31.574074
72
0.48465
false
bregman-arie/ansible
lib/ansible/modules/network/cnos/cnos_vlan.py
13
11458
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, 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 Licens...
gpl-3.0
-4,432,821,892,451,292,000
38.510345
142
0.68354
false
jamesgk/robofab
Lib/robofab/test/test_dialogs.py
10
6768
import robofab.interface.all.dialogs reload(robofab.interface.all.dialogs) from robofab.interface.all.dialogs import * import unittest __all__ = [ "AskString", #x "AskYesNoCancel", #x "FindGlyph", "GetFile", #x "GetFolder", #x "GetFileOrFolder", #...
bsd-3-clause
-7,889,509,384,820,705,000
30.045872
86
0.490691
false
roac-monitoring/roac-agent
run.py
1
1384
#!/usr/bin/env python # vim: set fileencoding=utf-8 : from __future__ import print_function import pprint import logging from roac import Roac, matchers, logs from roac.extra.http_poster import HTTPPoster app = Roac() app.config.from_file('run.json') logs.log_to_stderr() # Log to stderr even outside debug mode @a...
bsd-3-clause
8,502,039,709,368,771,000
21.688525
78
0.581647
false
MAndelkovic/pybinding
docs/tutorial/shape_symmetry_example.py
1
1478
"""Model an infinite nanoribbon consisting of graphene rings""" import pybinding as pb import numpy as np import matplotlib.pyplot as plt from pybinding.repository import graphene from math import pi pb.pltutils.use_style() def ring(inner_radius, outer_radius): """A simple ring shape""" def contains(x, y, z)...
bsd-2-clause
8,490,779,276,540,925,000
26.37037
81
0.697564
false
theoryno3/pylearn2
pylearn2/train_extensions/wmape_channel.py
32
4221
""" TrainExtension subclass for calculating Weighted Mean Average Percentage Error scores for regression models on monitoring dataset(s), reported via monitor channels. :math:`WMAPE = \frac{\sum_i|R_i - P_i|}{\sum_i |R_i|}` """ __author__ = "Junbo chen" __copyright__ = "Copyright 2015, Alibaba Group" __license__ = "3-...
bsd-3-clause
6,866,612,485,132,221,000
33.317073
78
0.557451
false
remb0/CouchPotatoServer
libs/sqlalchemy/engine/reflection.py
17
17104
# engine/reflection.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Provides an abstraction for obtaining database schema information. Usage Note...
gpl-3.0
3,840,575,702,126,818,000
35.469083
97
0.567236
false
sio2project/oioioi
oioioi/quizzes/problem_sources.py
1
3103
from django.contrib import messages from django.db import transaction from django.template.response import TemplateResponse from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from oioioi.base.utils import generate_key from oioioi.base.utils.redirect import safe_redirect from oioioi....
gpl-3.0
-4,196,499,993,690,970,600
39.298701
88
0.614889
false
RNAer/Calour
calour/tests/test_training.py
1
12274
# ---------------------------------------------------------------------------- # Copyright (c) 2016--, Calour development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # -----------------------------------------------...
bsd-3-clause
331,705,996,268,066,300
42.524823
129
0.545625
false
Mlieou/oj_solutions
leetcode/python/ex_742.py
3
1437
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def findClosestLeaf(self, root, k): """ :type root: TreeNode :type k: int :rtype: int ...
mit
4,234,977,517,099,463,000
29.595745
54
0.450939
false
ghedsouza/django
django/db/migrations/topological_sort.py
36
1141
def topological_sort_as_sets(dependency_graph): """ Variation of Kahn's algorithm (1962) that returns sets. Take a dependency graph as a dictionary of node => dependencies. Yield sets of items in topological order, where the first set contains all nodes without dependencies, and each following set...
bsd-3-clause
-4,349,617,725,205,325,300
34.65625
75
0.640666
false
ligovirgo/seismon
seismon/NLNM.py
2
2139
#!/usr/bin/python import math import numpy as np __author__ = "Michael Coughlin <michael.coughlin@ligo.org>" __date__ = "2012/8/26" __version__ = "0.1" # ============================================================================= # # DEFINITIONS # # ===================================...
gpl-3.0
8,798,308,476,038,876,000
32.952381
87
0.460028
false
dqnykamp/sympy
sympy/ntheory/bbp_pi.py
25
3767
''' This implementation is a heavily modified fixed point implementation of BBP_formula for calculating the nth position of pi. The original hosted at: http://en.literateprograms.org/Pi_with_the_BBP_formula_(Python) # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and a...
bsd-3-clause
1,042,325,452,391,567,500
33.559633
84
0.687284
false
igraph/python-igraph
tests/test_atlas.py
1
5873
import warnings import unittest from igraph import * class AtlasTestBase(object): def testPageRank(self): for idx, g in enumerate(self.__class__.graphs): try: pr = g.pagerank() except Exception as ex: self.assertTrue( False, ...
gpl-2.0
-8,047,344,878,775,552,000
31.447514
92
0.439469
false
uwosh/uwosh.pfg_search
uwosh/pfg_search/tests.py
1
1472
import unittest from zope.testing import doctestunit from zope.component import testing from Testing import ZopeTestCase as ztc from Products.Five import zcml from Products.Five import fiveconfigure from Products.PloneTestCase import PloneTestCase as ptc from Products.PloneTestCase.layer import PloneSite ptc.setupPlo...
gpl-2.0
-3,551,224,941,817,998,000
26.259259
61
0.638587
false
karibou/sosreport
sos/plugins/openvswitch.py
1
2212
# Copyright (C) 2014 Adam Stokes <adam.stokes@ubuntu.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, or # (at your option) any later version. # This progr...
gpl-2.0
7,820,503,994,875,489,000
33.030769
75
0.633363
false
jimmysong/bitcoin
test/functional/p2p-segwit.py
1
92579
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test segwit transactions and blocks on P2P network.""" from test_framework.mininode import * from test_fram...
mit
-4,962,845,928,776,290,000
44.718025
143
0.634377
false
netmanchris/PYHPEIMC
setup.py
3
3727
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
apache-2.0
2,229,043,839,112,453,400
32.890909
94
0.665951
false
V155/qutebrowser
scripts/dictcli.py
2
9205
#!/usr/bin/env python3 # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2017-2018 Michal Siedlaczek <michal.siedlaczek@gmail.com> # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
gpl-3.0
-5,094,920,246,151,439,000
31.526502
95
0.641391
false
shoopio/shoop
shuup/campaigns/apps.py
1
5883
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from shuup.apps import AppConfig class CampaignAppConfig(AppConf...
agpl-3.0
4,270,243,786,951,672,000
44.253846
99
0.662757
false
voutilad/courtlistener
cl/lib/argparse_types.py
1
1652
import argparse import csv import os from dateutil import parser from django.utils.timezone import is_naive, make_aware, utc from cl.audio.models import Audio from cl.people_db.models import Person from cl.search.models import Opinion, RECAPDocument def valid_date(s): try: return parser.parse(s).date() ...
agpl-3.0
2,288,918,847,582,466,300
26.081967
77
0.625303
false
starlightme/My-Solutions-For-Show-Me-the-Code
Jimmy66/0016/0016.py
2
1060
#!/bin/env python # -*- coding: utf-8 -*- #导入模块 import simplejson as json import xlwt #从文件(JSON形式)中读取数据返回列表 def read_file(filename): with open(filename,'r') as fp: content = fp.read() l = json.JSONDecoder().decode(content) return l #生成对应的xls文件 def gen_xls(l,filename): fp = xlwt.Workbook()...
mpl-2.0
-4,816,601,758,847,500,000
23
119
0.639706
false
SUSE/azure-sdk-for-python
azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py
1
1207
# 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
7,905,225,589,942,106,000
42.107143
87
0.711682
false
pwwang/bioprocs
bioprocs/utils/tsvio2.py
1
9564
import types, tempfile class TsvRecord(object): __slots__ = ('__keys', '__vals') def __init__(self, vals = None, keys = None): """ r = TsvRecord([1,2,3,4,5]) r.__vals == [1,2,3,4,5] r.__keys == None """ self.__vals = vals or [] if keys: self.__keys = dict(zip(keys, range(len(keys)))) if len(self...
mit
-2,356,532,746,544,604,000
25.566667
131
0.635404
false
wronk/mne-python
tutorials/plot_python_intro.py
13
1866
""" .. _tut_intro_pyton: Introduction to Python ====================== """ ############################################################################### # Python is a modern, general-purpose, object-oriented, high-level programming # language. First make sure you have a working python environment and # dependencies...
bsd-3-clause
2,824,253,577,443,046,400
39.565217
109
0.624866
false
ArmstrongJ/robotadventure
lib/gamecmd.py
1
7792
# Murder in the Park - A Robotic Mystery # Copyright (C) 2008 Jeffrey Armstrong (a.k.a. PrintStar) # http://jeff.rainbow-100.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 versio...
gpl-3.0
3,227,654,331,399,505,400
27.334545
77
0.515144
false
ceache/treadmill
lib/python/treadmill/cli/discovery.py
2
2761
"""Treadmill discovery CLI. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import socket import sys import click from treadmill import cli from treadmill import context from treadmill.websocket i...
apache-2.0
2,716,016,064,739,481,000
29.01087
76
0.517566
false
leighpauls/k2cro4
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py
6
7811
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
4,198,280,695,951,234,000
33.561947
79
0.668672
false
khosrow/metpx
pxStats/lib/DetailedStatsParameters.py
1
2325
#!/usr/bin/env python2 """ ############################################################################################# # # # @name: DetailedStatsParameters.py # # @author: Nicholas Lemay # # @since : 2007-05-27, last updated on 2008-03-19 # # @license: MetPX Copyright (C) 2004-2006 Environment Canada # M...
gpl-2.0
-7,318,917,168,443,234,000
34.242424
93
0.587527
false
benzkji/django-cms
cms/tests/test_extensions.py
4
28741
from copy import deepcopy from cms.extensions.toolbar import ExtensionToolbar from cms.toolbar_pool import toolbar_pool from cms.utils.urlutils import admin_reverse from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.contrib.sites.models import Site from cms.api...
bsd-3-clause
-3,563,786,612,519,227,000
49.95922
163
0.624509
false
matz-e/lobster
lobster/core/source.py
1
23810
import datetime import glob import json import logging import os import re import shutil import socket import subprocess import sys import work_queue as wq from collections import defaultdict, Counter from hashlib import sha1 from lobster import fs, util from lobster.cmssw import dash from lobster.core import unit fr...
mit
-4,035,609,993,286,833,000
39.910653
120
0.552499
false
pshchelo/heat
heat/common/context.py
2
10226
# # 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,523,924,282,344,929,000
36.874074
79
0.558283
false
abhinavp13/IITBX-edx-platform-dev
common/lib/xmodule/xmodule/randomize_module.py
6
3605
import logging import random from xmodule.x_module import XModule from xmodule.seq_module import SequenceDescriptor from lxml import etree from xblock.core import Scope, Integer log = logging.getLogger('mitx.' + __name__) class RandomizeFields(object): choice = Integer(help="Which random child was chosen", sc...
agpl-3.0
2,170,732,332,457,395,700
31.477477
90
0.625243
false
jamesthechamp/HitchHike-1
HitchHike/User/models.py
1
3417
import os import couchdb from datetime import datetime from couchdb.mapping import Document, TextField, DateTimeField, ListField, FloatField, IntegerField, BooleanField from werkzeug.security import generate_password_hash, check_password_hash from flask import g from HitchHike.database import DataBase # from HitchHike...
mit
-1,065,133,254,536,078,500
21.486842
113
0.555751
false
pschmitt/home-assistant
tests/components/input_number/test_init.py
13
16174
"""The tests for the Input number component.""" import pytest import voluptuous as vol from homeassistant.components.input_number import ( ATTR_VALUE, DOMAIN, SERVICE_DECREMENT, SERVICE_INCREMENT, SERVICE_RELOAD, SERVICE_SET_VALUE, ) from homeassistant.const import ( ATTR_EDITABLE, ATTR...
apache-2.0
6,093,910,598,997,993,000
27.728242
87
0.575739
false
imsparsh/NearPy
nearpy/experiments/distanceratioexperiment.py
7
9346
# -*- coding: utf-8 -*- # Copyright (c) 2013 Ole Krause-Sparmann # 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,...
mit
2,481,850,318,309,942,300
41.099099
87
0.623582
false
vjFaLk/frappe
frappe/integrations/oauth2_logins.py
10
1068
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.utils from frappe.utils.oauth import login_via_oauth2, login_via_oauth2_id_token import json @frappe.whitelist(allow_guest=True) def login_via_google(...
mit
8,347,869,656,304,631,000
32.375
74
0.764045
false
nekrut/tools-iuc
tools/ebi_tools/ebeye_urllib.py
23
9900
#!/usr/bin/env python # ====================================================================== # Script derived from the EB-eye (REST) Python client available at # http://www.ebi.ac.uk/Tools/webservices/services/eb-eye_rest # and distributed under the Apache License # ===================================================...
mit
-3,853,163,188,142,281,700
30.832797
84
0.596061
false
NanoSim/Porto
foreign/python/test/softpy/softpy-test-factory.py
1
2816
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os import softpy import numpy as np thisdir = os.path.abspath(os.path.dirname(__file__)) metadata = """ { "name": "Structure", "version": "0.1", "namespace": "http://sintef.no/meta/soft", "description": "Inco...
gpl-3.0
-120,973,746,690,016,050
23.486957
77
0.538707
false
raphiz/statikus
example/api.py
1
1284
from statikus import Statikus, render_page, raw_page import json import os # Temporary workaround.. os.chdir('example/') db = {'people': [{'name': 'Jack Jackson'}, {'name': 'Peter Peterson'}]} app = Statikus(db=db, some_parameter='...') # app.add_asset_handler('scripts', js_minify) app.add_asset('scripts', ['script1...
mit
4,490,594,425,844,643,300
27.533333
95
0.634735
false
xkmato/yowsup
yowsup/layers/protocol_media/protocolentities/iq_requestupload.py
48
3146
from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity from yowsup.structs import ProtocolTreeNode import hashlib import base64 import os from yowsup.common.tools import WATools class RequestUploadIqProtocolEntity(IqProtocolEntity): ''' <iq to="s.whatsapp.net" type="set" xmlns="w:m"> <m...
gpl-3.0
-4,396,231,118,631,624,700
38.3375
141
0.640814
false
sboily/xivo-webi-plugins
xivo_webi_plugins/meetme/plugin.py
1
1283
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Avencall # # 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 progr...
gpl-3.0
-2,566,772,020,527,372,300
35.657143
85
0.728761
false
bubeck/SkyDrop
skydrop/utils/airspace/convert.py
2
18075
#!/usr/bin/env python3 # -*- mode: python-mode; python-indent-offset: 4 -*- #***************************************************************************** # dnf install python3-shapely python3-gdal python3-matplotlib # # This program is used to read a "Open-Airspace-file" containing a number of # airspaces and then com...
gpl-2.0
-388,371,822,477,786,240
28.973466
142
0.476928
false
AOSPU/external_chromium_org
build/config/linux/pkg-config.py
28
5586
# 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. import json import os import subprocess import sys import re from optparse import OptionParser # This script runs pkg-config, optionally filtering out s...
bsd-3-clause
5,093,006,644,406,671,000
32.449102
79
0.696921
false
MikeFair/www.gittip.com
gittip/authentication.py
1
2000
"""Defines website authentication helpers. """ import datetime import rfc822 import time import pytz from aspen import Response from gittip.orm import db from gittip.models import User BEGINNING_OF_EPOCH = rfc822.formatdate(0) TIMEOUT = 60 * 60 * 24 * 7 # one week def inbound(request): """Authenticate from a coo...
cc0-1.0
8,999,418,887,693,086,000
33.5
79
0.6205
false
czcorpus/kontext
lib/plugins/abstract/subcmixer.py
1
1474
# Copyright (c) 2016 Charles University in Prague, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2016 Tomas Machalek <tomas.machalek@gmail.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License #...
gpl-2.0
2,750,887,069,739,338,000
36.794872
84
0.68521
false
barnsnake351/nova
nova/tests/unit/api/openstack/compute/test_images.py
4
19000
# Copyright 2010 OpenStack Foundation # 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 requ...
apache-2.0
-3,585,610,370,762,453,500
44.454545
79
0.543789
false
dietsche/letsencrypt
certbot/renewal.py
3
16098
"""Functionality for autorenewal and associated juggling of configurations""" from __future__ import print_function import copy import glob import logging import os import traceback import six import zope.component import OpenSSL from certbot import configuration from certbot import cli from certbot import constants...
apache-2.0
-2,366,074,609,156,082,700
43.592798
95
0.65095
false
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pandas/tests/dtypes/test_common.py
4
19314
# -*- coding: utf-8 -*- import pytest import numpy as np import pandas as pd from pandas.core.dtypes.dtypes import (DatetimeTZDtype, PeriodDtype, CategoricalDtype, IntervalDtype) import pandas.core.dtypes.common as com import pandas.util.testing as tm class TestPandasDtype(ob...
agpl-3.0
6,395,860,247,538,136,000
35.858779
79
0.655638
false
codeforamerica/pittsburgh-purchasing-suite
docs/source/conf.py
2
9844
# -*- coding: utf-8 -*- # # Pittsburgh Purchasing Suite documentation build configuration file, created by # sphinx-quickstart on Thu Oct 29 16:11:53 2015. import sys import os # allow rtd to find the custom fulltoc, our app overapp sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(0, os.path.abspath(__fi...
bsd-3-clause
9,135,607,833,776,238,000
31.923077
119
0.704592
false
mschmidt87/nest-simulator
extras/ConnPlotter/examples/simple.py
15
4038
# -*- coding: utf-8 -*- # # simple.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (a...
gpl-2.0
-1,229,859,616,736,772,600
36.045872
71
0.417286
false
cjld/adventures_in_opencl
python/part2/vector.py
22
2764
#Vector class #Author - Ian Johnson | enjalot@gmail.com #http://docs.scipy.org/doc/numpy/user/basics.subclassing.html#slightly-more-realistic-example-attribute-added-to-existing-array import numpy as np import math class Vec(np.ndarray): props = ['x', 'y', 'z', 'w'] def __new__(cls, input_array): #...
mit
6,508,891,940,074,814,000
26.919192
127
0.540159
false
maropu/spark
python/pyspark/pandas/tests/test_indexops_spark.py
15
2952
# # 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
-2,298,774,680,410,474,200
37.842105
89
0.675136
false
altair-viz/altair
altair/utils/server.py
1
4091
""" A Simple server used to show altair graphics from a prompt or script. This is adapted from the mpld3 package; see https://github.com/mpld3/mpld3/blob/master/mpld3/_server.py """ import sys import threading import webbrowser import socket from http import server from io import BytesIO as IO import itertools import ...
bsd-3-clause
7,258,432,393,558,762,000
26.641892
78
0.602298
false
rwatson/chromium-capsicum
tools/grit/grit/tool/count.py
7
1024
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. '''Count number of occurrences of a given message ID ''' import getopt import os import types from grit.tool import interface...
bsd-3-clause
-8,674,209,983,419,137,000
22.272727
72
0.694336
false
AlexanderMatveenko/omim
3party/protobuf/python/google/protobuf/internal/message_test.py
73
29550
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
apache-2.0
4,221,105,240,295,436,300
42.39207
80
0.722944
false
shivanshu21/docker-volume-vsphere
esx_service/utils/kvESX.py
2
12088
# Copyright 2016 VMware, 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
-4,475,749,572,309,837,000
30.978836
94
0.57313
false
ifduyue/sentry
src/sentry/south_migrations/0381_auto__del_field_deletedproject_team_name__del_field_deletedproject_tea.py
2
96914
# -*- 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): # Flag to indicate if this migration is too risky # to run online and needs to be coordinated for offline ...
bsd-3-clause
-3,903,497,696,487,709,700
89.999061
233
0.579049
false
HalcyonChimera/osf.io
osf/management/commands/create_fake_preprint_actions.py
10
1899
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import random import logging from faker import Faker from django.core.management.base import BaseCommand from osf.models import ReviewAction, PreprintService, OSFUser from osf.utils.workflows import DefaultStates, DefaultTriggers ...
apache-2.0
3,928,405,452,941,170,000
31.186441
100
0.578726
false
mhugent/Quantum-GIS
python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/__init__.py
5
12788
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : TopoViewer plugin for DB Manager Description : Create a project to display topology schema on QGis Date : Sep 23, 2011 copyright : (C) 2011 by Giuseppe Suc...
gpl-2.0
5,609,988,051,591,706,000
45.501818
145
0.547701
false
daboross/cardapio
src/OptionsWindow.py
1
17527
# # Copyright (C) 2010 Cardapio Team (tvst@hotmail.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 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
2,565,396,369,031,642,000
37.948889
120
0.623438
false
robl-25/pythonix
bin/rm/rm.py
1
2652
# rm: simple program to delete files and directories # TODO: Remove use of 'os' module import sys import os import argparse def remove(files, force=False, interactive=False, recursive=False): if recursive and interactive: for i in files: if os.path.isdir(i) and not i.endswith('/'): ...
mit
-773,181,010,741,514,200
34.36
78
0.505279
false
Zac-HD/home-assistant
tests/components/sensor/test_moon.py
5
1676
"""The test for the moon sensor platform.""" import unittest from datetime import datetime from unittest.mock import patch import homeassistant.util.dt as dt_util from homeassistant.bootstrap import setup_component from tests.common import get_test_home_assistant DAY1 = datetime(2017, 1, 1, 1, tzinfo=dt_util.UTC) DA...
apache-2.0
3,308,142,752,755,652,000
28.928571
65
0.601432
false
wschoenell/chimera_imported_googlecode
src/chimera/__init__.py
1
1317
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # chimera - observatory automation system # Copyright (C) 2006-2007 P. Henrique Silva <henrique@astro.ufsc.br> # 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 S...
gpl-2.0
-5,398,834,640,931,103,000
27.630435
81
0.728929
false
sergiohr/NeuroDB
neurodb/utils.py
2
2897
''' Created on Dec 21, 2013 @author: Sergio Hinojosa ''' from neo import io import numpy as np import os import re import pickle import ConfigParser import quantities CONFIG_FILE = 'neurodb.conf' def save_data(conf_name, conf_value): conf = None try: f = open(CONFIG_FILE, 'r') conf = pickle...
gpl-3.0
-6,819,531,514,677,409,000
26.330189
129
0.5699
false
arthurlogilab/taurus
tests/modules/test_consolidatingAggregator.py
2
3441
from bzt.modules.aggregator import ConsolidatingAggregator, DataPoint, KPISet from tests import BZTestCase, r from tests.mocks import MockReader class TestConsolidatingAggregator(BZTestCase): def test_mock(self): # check mock reader reader = self.get_reader() first = [x for x in reader.da...
apache-2.0
-7,452,907,812,775,035,000
43.701299
84
0.571927
false
soarlab/FPTuner
src/tft_get_first_derivations.py
1
6026
import os import sys from fractions import Fraction import tft_expr import tft_utils import subprocess as subp # ======== # global variables # ======== FNAME_FPT_QUERY = "__fpt_query" # please set this flag carefully... # by setting this flag as true, function "ResetGetFirstDerivations" must be called somewh...
mit
4,627,079,087,561,637,000
28.111111
161
0.544308
false
MediaKraken/MediaKraken_Deployment
source/database/db_base_collection.py
1
7201
""" Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful...
gpl-3.0
5,104,066,989,928,605,000
44.160256
98
0.51479
false
dongjoon-hyun/tensorflow
tensorflow/python/kernel_tests/parsing_ops_test.py
8
62195
# 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
-6,549,780,040,274,049,000
34.297957
80
0.51845
false
chandler14362/panda3d
direct/src/wxwidgets/WxPandaWindow.py
13
13871
""" This module implements a Panda3D window that can be embedded within a wx.Frame. The window itself is either an embedded window, which is a wx.Window with the Panda window attached to it, or it is a wxgl.GLCanvas, with Panda directed to draw into it, depending on the platform. In either case, you may simply embed ...
bsd-3-clause
-1,979,205,501,738,838,300
37.423823
122
0.552592
false
danieljaouen/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_cancel.py
22
2499
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.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_version': '1.1...
gpl-3.0
2,259,940,537,918,083,800
23.99
107
0.635854
false
frreiss/tensorflow-fred
tensorflow/python/summary/writer/event_file_writer.py
12
10594
# 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
5,248,312,922,346,597,000
33.848684
93
0.66245
false
hughdbrown/QSTK-nohist
Bin/report.py
1
40865
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on Jan 1, 2011 @author:Drew Bratcher @contact: dbratcher@gatech.edu @summary: Contains tutorial for...
bsd-3-clause
3,670,733,960,588,964,000
40.172343
306
0.596647
false
erinspace/osf.io
addons/base/utils.py
5
2446
import markupsafe from os.path import basename from website import settings def serialize_addon_config(config, user): lookup = config.template_lookup user_addon = user.get_addon(config.short_name) ret = { 'addon_short_name': config.short_name, 'addon_full_name': config.full_name, ...
apache-2.0
-1,537,505,923,279,188,700
49.958333
167
0.616517
false