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
jittat/cafe-grader-web
lib/assets/Lib/html/parser.py
13
20137
"""A parser for HTML and XHTML.""" # This file is based on sgmllib.py, but the API is slightly different. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are special) # a...
mit
-41,906,866,728,849,370
35.851504
80
0.473606
false
arifsetiawan/edx-platform
lms/djangoapps/instructor/management/commands/openended_stats.py
86
5361
""" Command to get statistics about open ended problems. """ import csv import time from django.core.management.base import BaseCommand from optparse import make_option from xmodule.modulestore.django import modulestore from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.open_ended_grading_clas...
agpl-3.0
-6,126,610,341,804,768,000
38.419118
119
0.643164
false
Zimmi48/coq
doc/tools/coqrst/regen_readme.py
8
2329
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Rebuild sphinx/README.rst from sphinx/README.template.rst.""" import re from os import sys, path SCRIPT_DIR = path.dirname(path.abspath(__file__)) if __name__ == "__main__" and __package__ is None: sys.path.append(path.dirname(SCRIPT_DIR)) SPHINX_DIR = path.join...
lgpl-2.1
-2,818,067,597,773,031,400
34.830769
92
0.61228
false
vprime/puuuu
env/lib/python2.7/site-packages/django/contrib/contenttypes/tests.py
113
11127
from __future__ import unicode_literals from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.views import shortcut from django.contrib.sites.models import Site, get_current_site from django.http import HttpRequest, Http404 from django.test import Test...
mit
-9,159,036,149,219,601,000
38.318021
90
0.618675
false
geektophe/shinken
libexec/notify_by_email.py
2
20418
#!/usr/bin/env python #-*-coding:utf-8-*- # Copyright (C) 2012: # Romain Forlot, rforlot@yahoo.com # # This file is part of Shinken. # # Shinken 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...
agpl-3.0
7,702,125,758,185,607,000
39.351779
440
0.601136
false
siggame/Joueur.py
games/spiders/game_object.py
1
2541
# GameObject: An object in the game. The most basic class that all game classes should inherit from automatically. # DO NOT MODIFY THIS FILE # Never try to directly create an instance of this class, or modify its member variables. # Instead, you should only be reading its variables and calling its functions. from typ...
mit
-4,944,504,103,100,531,000
41.35
207
0.669815
false
jaeilepp/mne-python
examples/realtime/plot_compute_rt_decoder.py
4
3942
""" ======================= Decoding real-time data ======================= Supervised machine learning applied to MEG data in sensor space. Here the classifier is updated every 5 trials and the decoding accuracy is plotted """ # Authors: Mainak Jas <mainak@neuro.hut.fi> # # License: BSD (3-clause) import numpy as np...
bsd-3-clause
2,535,595,226,465,696,300
31.04878
76
0.630898
false
mumrah/kafka-python
kafka/consumer/group.py
2
58768
from __future__ import absolute_import, division import copy import logging import socket import time from kafka.errors import KafkaConfigurationError, UnsupportedVersionError from kafka.vendor import six from kafka.client_async import KafkaClient, selectors from kafka.consumer.fetcher import Fetcher from kafka.con...
apache-2.0
7,595,392,789,288,191,000
47.13104
123
0.63829
false
MaxPowerWasTaken/MaxPowerWasTaken.github.io
jupyter_notebooks/mnist code scratch.py
1
2227
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 22 00:52:20 2017 @author: max """ import math import random import numpy as np import pandas as pd from sklearn.datasets import fetch_mldata from sklearn.cross_validation import train_test_split import matplotlib.pyplot as plt from sklearn.manifol...
gpl-3.0
1,504,929,915,313,414,400
25.511905
115
0.714863
false
dgoedkoop/QGIS
python/plugins/processing/algs/gdal/ClipVectorByExtent.py
7
4458
# -*- coding: utf-8 -*- """ *************************************************************************** ClipVectorByExtent.py --------------------- Date : November 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************...
gpl-2.0
2,991,459,414,214,714,400
39.162162
111
0.548901
false
ryanralph/DIY-Piper
Adafruit_Thermal.py
2
16561
#************************************************************************* # This is a Python library for the Adafruit Thermal Printer. # Pick one up at --> http://www.adafruit.com/products/597 # These printers use TTL serial to communicate, 2 pins are required. # IMPORTANT: On 3.3V systems (e.g. Raspberry Pi), use a 1...
mit
-6,512,341,798,548,976,000
27.902269
74
0.671095
false
fenglu-g/incubator-airflow
airflow/contrib/operators/vertica_operator.py
9
1925
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
-4,955,903,933,485,494,000
38.285714
80
0.710649
false
nicjhan/tango
grids/square2scrip.py
1
4754
#!/usr/bin/env python from __future__ import print_function import sys import argparse import numpy as np import netCDF4 as nc """ Create a NetCDF grid definition file in SCRIP format. The grid created is a uniform lat-lon grid. """ class LatLonGrid: """ """ def __init__(self, num_lon_points, num_lat_p...
gpl-2.0
-2,286,097,855,904,850,000
32.244755
78
0.528607
false
JioCloud/ironic
ironic/conductor/utils.py
2
5688
# coding=utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
6,016,335,664,235,756,000
38.227586
79
0.619023
false
sillydan1/WhatEverEngine
openglcsharp/Lib/lib2to3/fixes/fix_throw.py
327
1586
"""Fixer for generator.throw(E, V, T). g.throw(E) -> g.throw(E) g.throw(E, V) -> g.throw(E(V)) g.throw(E, V, T) -> g.throw(E(V).with_traceback(T)) g.throw("foo"[, V[, T]]) will warn about string exceptions.""" # Author: Collin Winter # Local imports from .. import pytree from ..pgen2 import token from .. im...
apache-2.0
2,414,562,447,690,147,000
27.321429
84
0.531526
false
mjbrewer/testindex
magnum/common/pythonk8sclient/client/models/V1beta3_PersistentVolumeSpec.py
15
2529
#!/usr/bin/env python """ Copyright 2015 Reverb Technologies, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless require...
apache-2.0
-6,956,628,929,350,197,000
30.222222
97
0.580862
false
pratapvardhan/scikit-learn
sklearn/externals/joblib/testing.py
45
2720
""" Helper for testing. """ import sys import warnings import os.path import re import subprocess import threading from sklearn.externals.joblib._compat import PY3_OR_LATER def warnings_to_stdout(): """ Redirect all warnings to stdout. """ showwarning_orig = warnings.showwarning def showwarning(msg...
bsd-3-clause
-2,723,090,828,233,680,000
31
78
0.570956
false
wavelets/silk
django_silky/silk/tests/test_dynamic_profiling.py
5
3232
from django.test import TestCase from mock import patch, Mock import six import silk from silk.profiling.dynamic import _get_module, _get_parent_module, profile_function_or_method class TestGetModule(TestCase): """test for _get_module""" def test_singular(self): module = _get_module('silk') ...
mit
-8,051,057,327,811,101,000
33.382979
120
0.598082
false
ct-23/home-assistant
homeassistant/components/sensor/mqtt_room.py
9
5270
""" Support for MQTT room presence detection. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.mqtt_room/ """ import asyncio import logging import json from datetime import timedelta import voluptuous as vol from homeassistant.core import callback...
apache-2.0
-724,804,633,647,109,400
30.939394
79
0.611006
false
michaelhush/M-LOOP
setup.py
1
3091
''' Setup script for M-LOOP using setuptools. See the documentation of setuptools for further details. ''' from __future__ import absolute_import, division, print_function import multiprocessing as mp import mloop as ml from setuptools import setup, find_packages from os import path def main(): long_description...
mit
5,739,476,499,942,767,000
41.342466
255
0.539631
false
FlorianLudwig/odoo
addons/claim_from_delivery/__openerp__.py
261
1517
############################################################################## # # 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 Affero General Public L...
agpl-3.0
8,668,112,751,774,423,000
36
78
0.578115
false
odoousers2014/LibrERP
purchase_requisition_extended/__init__.py
2
1378
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2013 Andrei Levin (andrei.levin at didotech.com) # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential ...
agpl-3.0
-8,741,860,629,122,866,000
43.451613
78
0.682874
false
LokiCoder/Sick-Beard
lib/enzyme/mp4.py
70
16088
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2007 Thomas Schueppel <stain@acm.org> # Copyright 2003-2007 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
gpl-3.0
-9,154,021,736,097,262,000
32.940928
96
0.431315
false
Cashiuus/metagoofil
hachoir_parser/misc/ole2.py
74
14203
""" Microsoft Office documents parser. OLE2 files are also used by many other programs to store data. Informations: * wordole.c of AntiWord program (v0.35) Copyright (C) 1998-2003 A.J. van Os Released under GNU GPL http://www.winfield.demon.nl/ * File gsf-infile-msole.c of libgsf library (v1.14.0) Copyright (C...
gpl-2.0
4,438,187,770,897,499,600
37.806011
114
0.569035
false
sergeneren/anima
anima/env/mayaEnv/pivot_switcher.py
1
9055
""" oyPivotSwitcher.py by Erkan Ozgur Yilmaz (c) 2009 v10.5.17 Description : ------------- A tool for easy animating of switching of pivots Version History : ----------------- v10.5.17 - modifications for Maya 2011 and PyMel 1.0.2 v9.12.25 - removed oyAxialCorrectionGroup script import - moved to new versioning sch...
bsd-2-clause
2,502,836,831,717,825,500
28.983444
79
0.581778
false
SoVictor/Lerna
dbtrash/models.py
3
1580
from django.db import models as md class ActiveAdminComments(md.Model): namespace = md.CharField(max_length=255) body = md.TextField() resource_id = md.CharField(max_length=255) resource_type = md.CharField(max_length=255) author_id = md.IntegerField() author_type = md.Cha...
gpl-2.0
-3,809,345,106,341,597,000
33.347826
75
0.65443
false
lnielsen/invenio
invenio/legacy/batchuploader/webinterface.py
3
15955
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 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, or (at yo...
gpl-2.0
-5,014,259,584,956,205,000
44.585714
188
0.516202
false
power12317/weblate
weblate/accounts/tests.py
1
2955
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
gpl-3.0
-3,978,701,985,504,772,000
30.741935
72
0.622967
false
wemanuel/smry
server-auth/ls/google-cloud-sdk/lib/protorpc/messages.py
11
59408
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
-8,511,588,950,179,843,000
30.38299
94
0.639745
false
allenp/odoo
addons/l10n_fr_hr_payroll/__openerp__.py
24
1219
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'French Payroll', 'category': 'Localization/Payroll', 'author': 'Yannick Buron (SYNERPGY)', 'depends': ['hr_payroll', 'l10n_fr'], 'version': '1.0', 'description': """ French Payroll Rul...
gpl-3.0
2,088,230,212,423,921,700
31.945946
82
0.650533
false
JoshRosen/spark
python/pyspark/mllib/stat/__init__.py
131
1197
# # 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
-3,098,200,608,965,518,300
41.75
77
0.778613
false
MehtapIsik/bayesian-itc
data/auto-iTC-200/053014/automation.py
3
5653
#============================================================================== # GLOBAL IMPORTS #============================================================================== import simtk.unit as units #============================================================================== # SOLVENT #=======================...
gpl-3.0
770,557,326,881,009,700
33.680982
153
0.511764
false
stone5495/NewsBlur
vendor/feedvalidator/content.py
16
6021
"""$Id: content.py 699 2006-09-25 02:01:18Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 699 $" __date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" from ...
mit
6,620,676,962,272,808,000
38.874172
121
0.645408
false
paiser/component-management
storm/sqlobject.py
1
17342
# # Copyright (c) 2006, 2007 Canonical # # Written by Gustavo Niemeyer <gustavo@niemeyer.net> # # This file is part of Storm Object Relational Mapper. # # Storm 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 Found...
gpl-2.0
7,639,595,177,904,136,000
31.536585
80
0.589263
false
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/third_party/prompt_toolkit/contrib/completers/base.py
23
2272
from __future__ import unicode_literals from six import string_types from prompt_toolkit.completion import Completer, Completion __all__ = ( 'WordCompleter', ) class WordCompleter(Completer): """ Simple autocompletion on a list of words. :param words: List of words. :param ignore_case: If True,...
apache-2.0
577,561,736,038,691,600
36.245902
88
0.62412
false
miaoski/stripTLD
notld.py
1
1279
# -*- coding: utf8 -*- import sys try: import cPickle as pickle except: import pickle with open('tld.pkl', 'rb') as f: TLD_LIST = pickle.loads(f.read()) def isIP(s): import re IP_RE = re.compile(r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$') retur...
mit
-2,147,809,541,879,080,000
18.676923
129
0.583268
false
cluckmaster/MissionPlanner
Lib/profile.py
50
24085
#! /usr/bin/env python # # Class for profiling python code. rev 1.0 6/2/94 # # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum """Class for profiling Python code.""" # Copyright 1994, by InfoSeek Corporation, all rights reserved. # Written by James Ro...
gpl-3.0
1,436,649,993,887,467,500
36.909532
80
0.580154
false
mverrilli/python_snippets
sql_functions.py
1
6181
import re def regexp_flags(regexp_modifier=None): flags = 0 set_unicode = True for c in regexp_modifier: if c == 'b': # Treat strings as binary octets rather than UTF-8 characters. set_unicode = False elif c == 'c': # Forces the match to be case sensitive...
mit
4,394,199,729,536,797,000
31.87766
121
0.582592
false
taaviteska/django
tests/annotations/models.py
90
2591
from django.db import models class Author(models.Model): name = models.CharField(max_length=100) age = models.IntegerField() friends = models.ManyToManyField('self', blank=True) def __str__(self): return self.name class Publisher(models.Model): name = models.CharField(max_length=255) ...
bsd-3-clause
-9,148,535,315,707,764,000
29.482353
88
0.673485
false
EmanueleCannizzaro/scons
test/LoadableModule.py
1
3712
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
mit
6,332,056,647,879,266,000
28.460317
96
0.658405
false
lmprice/ansible
lib/ansible/plugins/action/service.py
29
3802
# (c) 2015, Ansible 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, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
gpl-3.0
406,083,458,185,186,400
41.244444
156
0.600999
false
luminusnetworks/flask-restplus
examples/todo_blueprint.py
4
2559
from flask import Flask, Blueprint from flask.ext.restplus import Api, Resource, fields api_v1 = Blueprint('api', __name__, url_prefix='/api/1') api = Api(api_v1, version='1.0', title='Todo API', description='A simple TODO API extracted from the original flask-restful example', ) ns = api.namespace('todos', desc...
mit
-4,403,964,835,846,255,000
29.105882
94
0.606487
false
haveal/googleads-python-lib
examples/adwords/v201502/basic_operations/get_campaigns_with_awql.py
4
1943
#!/usr/bin/python # # Copyright 2015 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 b...
apache-2.0
414,876,973,457,115,500
28.892308
80
0.693773
false
hamonikr-root/system-config-printer-gnome
optionwidgets.py
1
9067
## system-config-printer ## Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc. ## Copyright (C) 2006 Florian Festi <ffesti@redhat.com> ## Copyright (C) 2007, 2008, 2009 Tim Waugh <twaugh@redhat.com> ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public...
gpl-2.0
4,659,019,230,265,594,000
36.622407
82
0.568214
false
titusfortner/selenium
third_party/py/googlestorage/publish_release.py
6
6743
"""Script for publishing new versions of Selenium to cloud storage. When you run this script, it will use OAuth 2.0 to authenticate with Google Cloud Storage before attempting to upload any files. This script will fail if the authenticated account does not have write access to the indicated bucket. By default, this s...
apache-2.0
-1,909,291,779,377,859,000
31.892683
98
0.648821
false
bikong2/scikit-learn
sklearn/utils/optimize.py
122
5674
""" Our own implementation of the Newton algorithm Unlike the scipy.optimize version, this version of the Newton conjugate gradient solver uses only one function call to retrieve the func value, the gradient value and a callable for the Hessian matvec product. If the function call is very expensive (e.g. for logistic ...
bsd-3-clause
-3,735,879,732,728,376,000
27.089109
78
0.578428
false
jelly/arch-security-tracker
test/test_todo.py
3
11364
from flask import url_for from tracker.advisory import advisory_get_label from tracker.model.cve import issue_types from tracker.model.enum import Publication from tracker.model.enum import Remote from tracker.model.enum import Severity from tracker.model.enum import Status from .conftest import DEFAULT_ADVISORY_ID f...
mit
914,584,506,567,478,700
41.721805
159
0.677842
false
jealousrobot/PlexArt
lib/mako/lexer.py
61
16495
# mako/lexer.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """provides the Lexer class for parsing template strings into parse trees.""" import re import code...
gpl-3.0
8,096,223,805,467,636,000
35.737194
79
0.473416
false
drawquest/drawquest-web
website/drawquest/apps/quests/migrations/0001_initial.py
2
9728
# encoding: 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 model 'ScheduledQuest' db.create_table('quests_scheduledquest', ( ('id', self.gf('dja...
bsd-3-clause
-1,430,381,048,518,053,400
76.824
195
0.557771
false
tmpgit/intellij-community
python/helpers/coverage/phystokens.py
160
7401
"""Better tokenizing for coverage.py.""" import codecs, keyword, re, sys, token, tokenize from coverage.backward import set # pylint: disable=W0622 from coverage.parser import generate_tokens def phys_tokens(toks): """Return all physical tokens, even line continuations. tokenize.genera...
apache-2.0
9,098,510,088,113,213,000
34.242857
79
0.541143
false
pratikmallya/pyrax
samples/cloud_dns/create_subdomain.py
13
1924
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, 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.ap...
apache-2.0
7,602,078,932,457,468,000
29.539683
84
0.672557
false
halberom/ansible-modules-extras
cloud/cloudstack/cs_affinitygroup.py
33
7824
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
-4,099,417,607,765,688,000
28.628788
88
0.62337
false
sacharya/nova
nova/utils.py
1
36217
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
-647,335,274,845,626,500
30.630568
79
0.59392
false
robforsythe/tune
tune/views.py
1
10964
from tune.models import User, Playlist, Artist, Album, Track, PlaylistSong from django.shortcuts import redirect, render, get_object_or_404 from django.contrib.auth import authenticate, login, logout from django.core.cache import cache from json import loads, dumps from urllib2 import urlopen # TODO @login_required de...
mit
2,369,749,736,706,074,600
27.852632
78
0.637176
false
aricchen/openHR
openerp/addons/account_report_company/account_report_company.py
7
2316
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero...
agpl-3.0
-5,481,166,483,647,441,000
44.411765
131
0.607081
false
Exploit-install/Veil-Ordnance
payloads/x86/rev_tcp_all_ports.py
3
5899
# This is the reverse_tcp payload, completely ported from the Metasploit # Framework. # https://github.com/rapid7/metasploit-framework/blob/master/modules/payloads/stagers/windows/reverse_tcp.rb import binascii import re import socket import sys class RevTCPAP: def __init__(self): self.name = "Reverse T...
gpl-3.0
-3,444,503,006,453,034,000
44.376923
151
0.579759
false
spandanb/horizon
openstack_dashboard/dashboards/project/routers/extensions/routerrules/tables.py
1
2774
# Copyright 2013, Big Switch Networks, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
5,103,891,340,351,686,000
34.564103
78
0.657534
false
aospx-kitkat/platform_external_chromium_org
third_party/tlslite/tlslite/Checker.py
359
6301
"""Class for post-handshake certificate checking.""" from utils.cryptomath import hashAndBase64 from X509 import X509 from X509CertChain import X509CertChain from errors import * class Checker: """This class is passed to a handshake function to check the other party's certificate chain. If a handshake f...
bsd-3-clause
-7,240,361,543,442,405,000
42.157534
80
0.607364
false
dessHub/bc-14-online-store-application
flask/lib/python2.7/site-packages/pip/utils/hashes.py
517
2866
from __future__ import absolute_import import hashlib from pip.exceptions import HashMismatch, HashMissing, InstallationError from pip.utils import read_chunks from pip._vendor.six import iteritems, iterkeys, itervalues # The recommended hash algo of the moment. Change this whenever the state of # the art changes; ...
gpl-3.0
-8,357,489,440,972,284,000
30.152174
78
0.633636
false
benesch/pip
tests/unit/test_req_file.py
6
22259
import os import subprocess import textwrap from mock import patch, Mock import pytest from pretend import stub import pip from pip.exceptions import (InstallationError, RequirementsFileParseError) from pip.download import PipSession from pip.index import PackageFinder from pip.req.req_install import InstallRequireme...
mit
-4,234,799,953,625,099,300
36.098333
79
0.578373
false
cisco-openstack/tempest
tempest/lib/services/compute/floating_ips_client.py
2
4648
# Copyright 2012 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,471,295,951,154,962,000
37.733333
89
0.651678
false
cluckmaster/MissionPlanner
LogAnalyzer/tests/TestCompass.py
140
6039
from LogAnalyzer import Test,TestResult import DataflashLog import math class TestCompass(Test): '''test for compass offsets and throttle interference''' def __init__(self): Test.__init__(self) self.name = "Compass" def run(self, logdata, verbose): self.result = TestResult() ...
gpl-3.0
4,377,976,242,740,105,700
47.701613
177
0.540818
false
catapult-project/catapult
telemetry/telemetry/util/image_util.py
3
4042
# 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. """Provides implementations of basic image processing functions. Implements basic image processing functions, such as reading/writing images, cropping, find...
bsd-3-clause
233,448,555,364,533,150
31.596774
80
0.731569
false
bjorand/influxdb-python
examples/tutorial.py
9
1778
import argparse from influxdb import InfluxDBClient def main(host='localhost', port=8086): user = 'root' password = 'root' dbname = 'example' dbuser = 'smly' dbuser_password = 'my_secret_password' query = 'select value from cpu_load_short;' json_body = [ { "measurement...
mit
5,222,577,073,908,988,000
26.353846
80
0.584364
false
famorted/scrapy
scrapy/contracts/default.py
153
2334
from scrapy.item import BaseItem from scrapy.http import Request from scrapy.exceptions import ContractFail from . import Contract # contracts class UrlContract(Contract): """ Contract to set the url of the request (mandatory) @url http://scrapy.org """ name = 'url' def adjust_request_args(...
bsd-3-clause
-1,810,044,110,188,266,500
25.224719
73
0.551842
false
rentongzhang/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/wptserve.py
515
1117
#!/usr/bin/env python import argparse import os import server def abs_path(path): return os.path.abspath(path) def parse_args(): parser = argparse.ArgumentParser(description="HTTP server designed for extreme flexibility " "required in testing situations.") parser.add...
mpl-2.0
-2,986,769,229,964,344,000
32.848485
96
0.551477
false
jose36/jmdl2
servers/uploadstation.py
44
1300
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para uploadstation # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core...
gpl-2.0
-3,870,472,534,074,393,000
31.475
91
0.585835
false
fbossy/SickRage
lib/feedparser/sgmllib.py
24
17770
"""A parser for SGML, using the derived class as a static DTD.""" # XXX This only supports those SGML features used by HTML. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are ...
gpl-3.0
1,222,162,499,745,721,600
31.486289
79
0.500957
false
danakj/chromium
chrome/test/kasko/hang_watcher_integration_test.py
9
1883
#!/usr/bin/env python # Copyright 2016 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. """A Windows-only end-to-end integration test for the Chrome hang watcher. This test ensures that the hang watcher is able to detect w...
bsd-3-clause
-7,120,659,004,781,491,000
28.421875
80
0.710568
false
gameduell/duell
bin/mac/python2.7.9/lib/python2.7/sched.py
175
5088
"""A generally useful event scheduler class. Each instance of this class manages its own queue. No multi-threading is implied; you are supposed to hack that yourself, or use a single instance per application. Each instance is parametrized with two functions, one that is supposed to return the current time, one that i...
bsd-2-clause
-1,071,363,266,307,424,500
36.970149
78
0.660967
false
alexlo03/ansible
lib/ansible/modules/files/xattr.py
30
6842
#!/usr/bin/python # Copyright: (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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['st...
gpl-3.0
-5,443,666,049,191,053,000
27.869198
114
0.604648
false
381426068/MissionPlanner
Lib/site-packages/numpy/lib/index_tricks.py
53
26635
__all__ = ['unravel_index', 'mgrid', 'ogrid', 'r_', 'c_', 's_', 'index_exp', 'ix_', 'ndenumerate','ndindex', 'fill_diagonal','diag_indices','diag_indices_from'] import sys import numpy.core.numeric as _nx from numpy.core.numeric import ( asarray, Scalar...
gpl-3.0
1,950,288,358,304,312,000
28.859865
80
0.532119
false
walteryang47/ovirt-engine
packaging/setup/plugins/ovirt-engine-common/ovirt-engine/core/fence_kdump_listener.py
8
2091
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2014-2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
apache-2.0
1,387,326,033,233,857,800
28.871429
78
0.682449
false
Distrotech/intellij-community
python/lib/Lib/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py
71
8207
import os import sys import shutil from optparse import make_option from django.conf import settings from django.core.files.storage import get_storage_class from django.core.management.base import CommandError, NoArgsCommand from django.contrib.staticfiles import finders class Command(NoArgsCommand): """ Com...
apache-2.0
6,504,239,548,199,868,000
42.887701
91
0.532472
false
snasoft/QtCreatorPluginsPack
Bin/3rdParty/vera/bin/lib/test/test_tcl.py
38
4483
#!/usr/bin/env python import unittest import os from test import test_support # Skip this test if the _tkinter module wasn't built. _tkinter = test_support.import_module('_tkinter') from Tkinter import Tcl from _tkinter import TclError class TkinterTest(unittest.TestCase): def testFlattenLen(self): # ...
lgpl-3.0
-3,032,309,144,586,328
27.01875
79
0.577738
false
timpalpant/calibre
src/calibre/ebooks/conversion/plugins/htmlz_input.py
15
4783
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL 3' __copyright__ = '2011, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import os from calibre import guess_type from calibre.customize.conversion import Inpu...
gpl-3.0
-7,059,445,286,748,259,000
35.792308
98
0.567635
false
freakynit/vertx-web
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/setuptools/tests/test_svn.py
300
7806
# -*- coding: utf-8 -*- """svn tests""" import io import os import subprocess import sys import unittest from setuptools.tests import environment from setuptools.compat import unicode, unichr from setuptools import svn_utils from setuptools.tests.py26compat import skipIf def _do_svn_check(): try: subpro...
apache-2.0
7,127,609,085,150,742,000
30.844898
77
0.553961
false
javier-ruiz-b/docker-rasppi-images
raspberry-google-home/env/lib/python3.7/site-packages/argparse.py
81
89214
# Author: Steven J. Bethard <steven.bethard@gmail.com>. # Maintainer: Thomas Waldmann <tw@waldmann-edv.de> """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages -...
apache-2.0
-3,143,284,072,112,534,500
36.296823
80
0.558511
false
cloud-ark/cloudark
server/server_plugins/aws/coe/ecs.py
1
50287
import ast import base64 import boto3 import json import os from os.path import expanduser import re import shutil import time import server.server_plugins.coe_base as coe_base from server.common import common_functions from server.common import constants from server.common import docker_lib from server.common import ...
apache-2.0
5,882,367,894,518,407,000
44.840474
182
0.537296
false
DingKe/nn_playground
xnornet/mnist_mlp.py
1
2693
'''Trains a simple xnor fully connected NN on the MNIST dataset. Modified from keras' examples/mnist_mlp.py Gets to 97.41% test accuracy after 20 epochs using tensorflow backend ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility import keras.backend as K from ker...
mit
4,832,821,136,439,274,000
29.954023
100
0.700706
false
henriquespedro/Autarquia-Livre
vendor/openlayers/closure-library/closure/bin/build/depstree_test.py
354
3692
#!/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 ...
gpl-2.0
1,946,794,232,838,591,200
28.070866
76
0.6487
false
cogeorg/black_rhino
examples/firesales_SA/networkx/algorithms/isomorphism/tests/test_vf2userfunc.py
97
6665
""" Tests for VF2 isomorphism algorithm for weighted graphs. """ from nose.tools import assert_true, assert_false from operator import eq import networkx as nx import networkx.algorithms.isomorphism as iso def test_simple(): # 16 simple tests w = 'weight' edges = [(0,0,1),(0,0,1.5),(0,1,2),(1,0,3)] ...
gpl-3.0
3,811,151,245,549,843,000
33.713542
130
0.543286
false
lmjohns3/cube-experiment
analysis/10-extract-jacobian-chunks.py
1
1827
import climate import gzip import io import joblib import lmj.cubes import logging import numpy as np import os TARGETS = '0123456789ab' def extract(trial, root, output, frames): fn = trial.root.replace(root, output).replace('.csv.gz', '') def save(df, targets, key): if not os.path.isdir(os.path.di...
mit
-3,322,780,951,137,465,300
27.546875
75
0.607006
false
ehashman/oh-mainline
vendor/packages/python-openid/openid/test/test_sreg.py
86
17151
from openid.extensions import sreg from openid.message import NamespaceMap, Message, registerNamespaceAlias from openid.server.server import OpenIDRequest, OpenIDResponse import unittest class SRegURITest(unittest.TestCase): def test_is11(self): self.failUnlessEqual(sreg.ns_uri_1_1, sreg.ns_uri) class Ch...
agpl-3.0
-1,093,982,752,824,966,900
34.43595
85
0.617107
false
vnsofthe/odoo-dev
addons/payment_buckaroo/tests/test_buckaroo.py
321
8132
# -*- coding: utf-8 -*- from lxml import objectify import urlparse import openerp from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_buckaroo.controllers.main import BuckarooController from opener...
agpl-3.0
7,144,740,298,661,731,000
44.685393
173
0.598254
false
hurricup/intellij-community
python/lib/Lib/stat.py
145
1667
"""Constants/functions for interpreting results of os.stat() and os.lstat(). Suggested usage: from stat import * """ # XXX Strictly spoken, this module may have to be adapted for each POSIX # implementation; in practice, however, the numeric constants used by # stat() are almost universal (even for stat() emulations ...
apache-2.0
1,461,354,789,341,361,200
18.383721
76
0.679664
false
aimejeux/enigma2
lib/python/Components/Network.py
2
24018
import os import re from socket import * from Components.Console import Console from Components.PluginComponent import plugins from Plugins.Plugin import PluginDescriptor from boxbranding import getBoxType class Network: def __init__(self): self.ifaces = {} self.configuredNetworkAdapters = [] self.NetworkState ...
gpl-2.0
-7,268,071,101,886,802,000
32.733146
167
0.689191
false
vaygr/ansible
lib/ansible/modules/network/nxos/nxos_rollback.py
50
3790
#!/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
3,784,496,117,420,673,000
27.496241
83
0.645383
false
kevinlondon/sentry
src/sentry/models/activity.py
5
6259
""" sentry.models.activity ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.conf import settings from django.core.urlresolvers import reverse from django.db import mode...
bsd-3-clause
-498,185,678,064,841,000
29.681373
87
0.563988
false
sunlightlabs/openstates
scrapers/il/_committees.py
3
47168
# In different sessions of the Illinois legislature, the same # committee can have different names appear on http://ilga.gov/ # Sometimes this is just spelling of typographic, ("Agriculture & # Conservation" vs "Agriculture and Conservation"). Sometimes the # difference is larger. The COMMITTEES dictionary can be used ...
gpl-3.0
7,685,332,094,647,559,000
54.95255
88
0.611495
false
CYBERBUGJR/Diamond
src/collectors/netapp/netapp.py
6
16305
# coding=utf-8 """ The NetAppCollector collects metric from a NetApp installation using the NetApp Manageability SDK. This allows access to many metrics not available via SNMP. For this to work you'll the SDK available on the system. This module has been developed using v5.0 of the SDK. As of writing the SDK can be f...
mit
-1,910,313,120,076,781,600
41.240933
79
0.536093
false
doismellburning/edx-platform
common/djangoapps/enrollment/serializers.py
6
3423
""" Serializers for all Course Enrollment related return objects. """ import logging from rest_framework import serializers from course_modes.models import CourseMode from student.models import CourseEnrollment log = logging.getLogger(__name__) class StringListField(serializers.CharField): """Custom Serialize...
agpl-3.0
-6,911,790,671,363,636,000
33.23
99
0.692083
false
akopytov/sysbench
third_party/cram/cram/_main.py
2
7967
"""Main entry point""" import optparse import os import shlex import shutil import sys import tempfile try: import configparser except ImportError: # pragma: nocover import ConfigParser as configparser from cram._cli import runcli from cram._encoding import b, fsencode, stderrb, stdoutb from cram._run import...
gpl-2.0
-913,820,979,841,668,100
36.055814
78
0.565458
false
SamuelMarks/edx-dl
edx_dl/common.py
4
1534
# -*- coding: utf-8 -*- """ Common type definitions and constants for edx-dl """ from collections import namedtuple # The next four named tuples represent the structure of courses in edX. The # structure is: # # * A Course contains Sections # * Each Section contains Subsections # * Each Subsection contains Units # ...
lgpl-3.0
-3,496,587,677,861,477,000
32.347826
78
0.673403
false
tobegit3hub/glance_docker
glance/common/scripts/utils.py
10
4580
# Copyright 2014 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
9,055,318,242,300,541,000
32.676471
78
0.655022
false
linuxdaemon/CloudBot
tests/core_tests/util_tests/test_textgen.py
3
1117
import re def test_textgenerator(): from cloudbot.util.textgen import TextGenerator generator = TextGenerator( [ '{thing} is {stuff}' ], { 'thing': ['a', 'b'], 'stuff': [ 'c', ('d', 2), ] } ) ...
gpl-3.0
-367,644,005,137,042,750
22.765957
65
0.45479
false
AkhilHector/Rex.Inc
.env/lib/python2.7/site-packages/pip/basecommand.py
181
10617
"""Base Command class, and related routines""" from __future__ import absolute_import import logging import os import sys import optparse import warnings from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.download import PipSession from pip.exceptions import (BadCommand, Installati...
mit
2,926,822,446,850,365,400
33.809836
79
0.517095
false
ThomasHabets/openvpn-debian
win/config_tap.py
5
1181
import os from wb import preprocess, home_fn, autogen, dict_def def main(config): preprocess(config, in_fn=home_fn('tap-win32/SOURCES.in'), out_fn=home_fn('tap-win32/SOURCES'), quote_begin='@@', quote_end='@@', head_comment='# %s\n...
gpl-2.0
3,241,087,863,137,425,000
31.742857
63
0.478408
false
blckshrk/Weboob
weboob/applications/flatboob/flatboob.py
1
6209
# -*- coding: utf-8 -*- # Copyright(C) 2012 Romain Bignon # # This file is part of weboob. # # weboob 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 opti...
agpl-3.0
6,207,470,197,526,688,000
33.681564
123
0.549774
false
kionetworks/openstack-dashboard-havana
openstack_dashboard/openstack/common/gettextutils.py
23
7462
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Red Hat, Inc. # All Rights Reserved. # Copyright 2013 IBM Corp. # # 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 # # ...
apache-2.0
3,755,001,478,429,518,000
32.017699
84
0.621817
false