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
yordan-desta/QgisIns
tests/src/python/test_qgspallabeling_base.py
2
17646
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsPalLabeling: base suite setup From build dir, run: ctest -R PyQgsPalLabelingBase -V See <qgis-src-dir>/tests/testdata/labeling/README.rst for description. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU Gen...
gpl-2.0
-1,152,539,646,844,711,000
34.793103
80
0.620197
false
rljacobson/Guru
guru/WorksheetController.py
1
43950
#Needs to: # Manage the notebook/worksheet object. # Communicate to the javascript in the WebView object. # Open and save .sws files. # Delete the internal notebook object on disk when done. import os try: # simplejson is faster, so try to import it first import simplejson as json except ImportError: ...
mit
3,556,050,928,706,078,700
38.453321
221
0.574881
false
marguerite/susews-planet
libs/jinja/jinja2/ext.py
5
21054
# -*- coding: utf-8 -*- """ jinja2.ext ~~~~~~~~~~ Jinja extensions allow to add custom tags similar to the way django custom tags work. By default two example extensions exist: an i18n and a cache extension. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from collections impor...
gpl-2.0
-3,613,898,787,326,348,300
38.649718
80
0.61176
false
en0/Supybot_sasl
plugins/Owner/test.py
6
4002
### # Copyright (c) 2002-2005, Jeremiah Fincher # 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 co...
bsd-3-clause
-6,746,866,300,462,572,000
38.623762
79
0.710895
false
mirrorcoloured/slcypi
HAT_Python3/Adafruit_I2C.py
1
5520
#!/usr/bin/python import re import smbus # =========================================================================== # Adafruit_I2C Class # =========================================================================== class Adafruit_I2C(object): @staticmethod def getPiRevision(): "Gets the version number of ...
mit
-7,110,954,138,778,199,000
33.285714
94
0.608333
false
hsuchie4/TACTIC
src/pyasm/prod/command/code_update.py
6
4127
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
-4,961,217,542,410,323,000
26.885135
109
0.579355
false
mrquim/repository.mrquim
repo/plugin.video.salts/js2py/translators/jsregexps.py
7
6896
from salts_lib.pyjsparser.pyjsparserdata import * REGEXP_SPECIAL_SINGLE = {'\\', '^', '$', '*', '+', '?', '.'} NOT_PATTERN_CHARS = {'^', '$', '\\', '.', '*', '+', '?', '(', ')', '[', ']', '|'} # what about '{', '}', ??? CHAR_CLASS_ESCAPE = {'d', 'D', 's', 'S', 'w', 'W'} CONTROL_ESCAPE_CHARS = {'f', 'n', 'r', 't',...
gpl-2.0
643,782,974,549,146,200
30.493151
118
0.480133
false
Kunal57/MIT_6.00.1x
pset5/ps6.py
1
8731
import string ### DO NOT MODIFY THIS FUNCTION ### def load_words(file_name): ''' file_name (string): the name of the file containing the list of words to load Returns: a list of valid words. Words are strings of lowercase letters. Depending on the size of the word list, this function ma...
mit
1,933,617,698,280,548,400
32.113281
83
0.608178
false
pblottiere/QGIS
tests/src/python/test_qgsrastercolorrampshader.py
19
1826
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsColorRampShader. .. note:: 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. ""...
gpl-2.0
-2,245,814,860,994,307,600
34.803922
137
0.697152
false
anlar/prismriver
prismriver/cli.py
2
3443
import json from prismriver import util, main class SongJsonEncoder(json.JSONEncoder): def default(self, o): return o.__dict__ def format_output(songs, output_format, txt_template=None): if output_format == 'txt': formatted_songs = [] for song in songs: lyrics_txt = '' ...
mit
507,045,041,935,330,300
34.132653
116
0.540227
false
mir-group/flare
flare/mgp/map3b.py
1
11075
import numpy as np from numba import njit from math import floor, ceil from typing import List from flare.struc import Structure from flare.utils.element_coder import Z_to_element from flare.mgp.mapxb import MapXbody, SingleMapXbody from flare.mgp.grid_kernels import grid_kernel, self_kernel from flare.kernels.util...
mit
4,418,217,167,793,085,400
27.916449
88
0.469977
false
thaim/ansible
test/units/module_utils/facts/test_ansible_collector.py
9
18914
# -*- coding: utf-8 -*- # # # 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 distributed in the hope that it wi...
mit
-7,210,130,124,361,021,000
36.527778
101
0.626943
false
grandmasterchef/WhatManager2
home/migrations/0001_initial.py
4
6525
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import home.info_holder class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
mit
1,549,478,202,849,230,300
40.56051
94
0.479234
false
rec/echomesh
code/python/external/parsedatetime/tests/TestSimpleOffsets.py
1
7518
""" Test parsing of 'simple' offsets """ import unittest, time, datetime import parsedatetime as pdt # a special compare function is used to allow us to ignore the seconds as # the running of the test could cross a minute boundary def _compareResults(result, check): target, t_flag = result value, v_fla...
mit
-4,099,626,455,720,227,300
44.841463
111
0.61519
false
kobronson/cs-voltdb
tests/scripts/exp_test.py
1
22827
#!/usr/bin/env python2.6 # This file is part of VoltDB. # Copyright (C) 2008-2013 VoltDB 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 # without limit...
agpl-3.0
1,400,331,217,541,593,000
37.108514
202
0.596399
false
MarioVilas/secondlife-experiments
SecondLifeCamper.py
1
1408
from win32con import * from win32gui import * from time import sleep class SecondLifeCamper: "Second Life Camper class" hWnd = 0 # Second Life window handle def __init__(self): "Constructor" self.getWindowHandle() if self.hWnd == 0: ra...
gpl-2.0
8,501,252,513,469,108,000
23.6
65
0.547585
false
kalaspuff/tomodachi
tomodachi/watcher.py
1
6685
import asyncio import logging import os import sys import zlib from typing import Any, Callable, Dict, List, Optional def crc(file_path: str) -> str: prev = 0 for line in open(file_path, "rb"): prev = zlib.crc32(line, prev) return "%X" % (prev & 0xFFFFFFFF) class Watcher(object): def __init...
mit
4,378,000,183,308,738,600
44.47619
118
0.477337
false
leiferikb/bitpop
src/tools/memory_inspector/memory_inspector/data/file_storage_unittest.py
19
5178
# 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. """This unittest covers both file_storage and serialization modules.""" import os import tempfile import time import unittest from memory_inspector.core im...
gpl-3.0
6,880,012,481,837,985,000
36.528986
74
0.671881
false
foone/3dmmInternals
generate/find_classes.py
1
6460
import re,collections,itertools,json import pefile,ms3dmm,os,pdb,struct from build_func_list import lintJSON def parseFixed(line,*segments): i=0 for segment in segments: if segment<0: segment=-segment elif segment>0: yield line[i:i+segment] else: # ==0 yield line[i:] return i+=segment class EXE...
unlicense
5,159,623,017,111,422,000
25.588477
112
0.687307
false
zdenop/lector
lector/utils/__init__.py
1
4266
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Lector utils Copyright (C) 2011-2013 Davide Setti, Zdenko Podobný Website: http://code.google.com/p/lector This program is released under the GNU GPLv2 """ import sys import os from glob import glob from subprocess import Popen, PIPE from PyQt5.Qt...
gpl-2.0
-483,635,185,359,244,200
27.433333
127
0.609144
false
bobbymckinney/hot_press_monitor
program_hotpress/EnhancedStatusBar.py
12
10680
# --------------------------------------------------------------------------- # # ENHANCEDSTATUSBAR wxPython IMPLEMENTATION # Python Code By: # # Andrea Gavana, @ 31 May 2005 # Nitro, @ 21 September 2005 # Latest Revision: 21 September 2005, 19.57.20 GMT+2 # Latest Revision before Latest Revision: 21 September 2...
gpl-3.0
-77,100,964,562,159,200
41.591837
130
0.552809
false
arannasousa/pagseguro_xml
exemplos/testes_consultas.py
1
2403
# coding=utf-8 # --------------------------------------------------------------- # Desenvolvedor: Arannã Sousa Santos # Mês: 12 # Ano: 2015 # Projeto: pagseguro_xml # e-mail: asousas@live.com # --------------------------------------------------------------- import loggin...
gpl-2.0
-3,923,947,067,807,223,000
22.782178
94
0.601416
false
zhimin711/nova
nova/objects/compute_node.py
2
19033
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
-3,126,293,330,617,601,500
44.209026
79
0.612568
false
liangjisheng/Data-Struct
books/algorithmicGraphics/chapter7/01_dijkstras_algorithm.py
1
2301
#!/usr/bin/python3 # the graph graph = {} graph["start"] = {} graph["start"]["a"] = 6 graph["start"]["b"] = 2 graph["a"] = {} graph["a"]["fin"] = 1 graph["b"] = {} graph["b"]["a"] = 3 graph["b"]["fin"] = 5 graph["fin"] = {} # print(graph) # the costs table infinity = float("inf") costs = {} costs["a"] = 6 costs["...
gpl-2.0
-89,505,241,438,024,210
24.2125
79
0.599405
false
naparuba/kunai
data/global-configuration/packs/mongodb/collectors/pymongo/ismaster.py
19
4227
# Copyright 2014-2015 MongoDB, 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 or agreed to in writin...
mit
-7,159,681,268,196,811,000
27.952055
78
0.617932
false
fbradyirl/home-assistant
tests/components/homekit_controller/specific_devices/test_lennox_e30.py
4
1534
""" Regression tests for Aqara Gateway V3. https://github.com/home-assistant/home-assistant/issues/20885 """ from homeassistant.components.climate.const import SUPPORT_TARGET_TEMPERATURE from tests.components.homekit_controller.common import ( setup_accessories_from_file, setup_test_accessories, Helper, )...
apache-2.0
1,703,705,301,467,829,800
33.863636
77
0.715776
false
tudorbarascu/QGIS
python/plugins/processing/algs/grass7/ext/r_mask_vect.py
36
1842
# -*- coding: utf-8 -*- """ *************************************************************************** r_mask_vect.py -------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ******************************...
gpl-2.0
-3,413,943,310,125,184,500
42.714286
87
0.527233
false
winiceo/weibo
test/timer.py
4
1181
#!/usr/bin/env python # coding: utf-8 # Copyright(c) 2013 # Gmail:liuzheng712 # import sched import time import persion import loginweibo as Lwb import jiexi import file def write(session, who): page, who = Lwb.getPage(session, 'http://weibo.com/' + who) WB_text, WB_time, WB_comefrom, WB_like, WB_pinlun, WB_f...
apache-2.0
450,907,969,305,715,800
23.102041
94
0.638442
false
Naville/WTFJH
Tools/WTFJHAnalyzer/introspy/HTMLReportGenerator.py
4
2032
import shutil import os class HTMLReportGenerator: """ Generates an HTML report given an analyzed Introspy DB. """ TRACED_CALLS_FILE_NAME = 'tracedCalls.js' FINDINGS_FILE_NAME = 'findings.js' API_GROUPS_FILE_NAME = 'apiGroups.js' # TODO: merge the two templates and get rid of th...
gpl-3.0
4,387,454,301,732,937,000
34.034483
97
0.618602
false
vishnu-kumar/PeformanceFramework
rally/common/db/sqlalchemy/types.py
16
3020
# Copyright 2013: Mirantis 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
4,215,042,025,243,224,000
31.12766
78
0.683444
false
brunobergher/dotfiles
sublime/pygments/all/pygments/lexers/nimrod.py
45
5105
# -*- coding: utf-8 -*- """ pygments.lexers.nimrod ~~~~~~~~~~~~~~~~~~~~~~ Lexer for the Nimrod language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, default from pygments....
mit
-2,051,269,694,479,359,200
31.106918
80
0.408031
false
Uran198/coala
tests/processes/BearRunningTest.py
23
11649
import multiprocessing import queue import unittest from coalib.bears.GlobalBear import GlobalBear from coalib.bears.LocalBear import LocalBear from coalib.processes.BearRunning import ( LOG_LEVEL, LogMessage, run, send_msg, task_done) from coalib.processes.CONTROL_ELEMENT import CONTROL_ELEMENT from coalib.result...
agpl-3.0
1,091,570,157,490,676,900
34.515244
78
0.51704
false
shakamunyi/nova
nova/image/download/file.py
6
7286
# Copyright 2013 Red Hat, 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...
apache-2.0
7,571,600,141,632,877,000
41.115607
79
0.594702
false
andela-bojengwa/pleft
pleft/urls.py
6
1054
# Copyright 2010 Sander Dijkhuis <sander.dijkhuis@gmail.com> # # This file is part of Pleft. # # Pleft 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,214,239,488,321,774,000
30
67
0.721063
false
10clouds/django-tenant-schemas
tenant_schemas/models.py
1
4059
from django.conf import settings from django.db import models, connection, transaction from django.core.management import call_command from tenant_schemas.postgresql_backend.base import _check_identifier from tenant_schemas.signals import post_schema_sync from tenant_schemas.utils import schema_exists, django_is_in_tes...
mit
2,011,183,975,632,575,000
42.645161
117
0.603843
false
hlmnrmr/superdesk-core
superdesk/publish/publish_service.py
3
5719
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
agpl-3.0
-7,803,154,476,969,788,000
36.625
117
0.599056
false
ChristianFrisson/gaia
test/unittest/data/svm/regenerate_histories.py
3
2927
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Gaia # # Gaia 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 (FSF), either ve...
agpl-3.0
7,576,689,615,823,634,000
29.175258
86
0.583874
false
cheetrios/bopify
bopify.py
1
10142
""" __name__ = bopify.py __author__ = Cheetrios __description__ = Main application file for deployment """ import uuid import sqlite3 import requests import base64 import urllib import json import spotipy import spotipy.util as util from spotipy.oauth2 import SpotifyClientCredentials from flask import Flask, rende...
mit
-7,516,118,258,169,031,000
31.509615
113
0.68803
false
wubr2000/googleads-python-lib
examples/dfp/v201505/contact_service/update_contacts.py
4
2384
#!/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
-6,001,738,883,169,725,000
30.786667
77
0.696309
false
mpaf/pywinauto-64bit
pywinauto/unittests/test_HwndWrapper.py
2
17900
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # This library 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 2.1 # of the License, or (at your opti...
lgpl-2.1
-7,863,576,477,954,474,000
29.546075
87
0.641061
false
4Quant/tensorflow
tensorflow/python/client/graph_util_test.py
3
8970
# 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 by applicable law or a...
apache-2.0
3,647,947,949,996,753,000
41.91866
80
0.651839
false
timorieber/wagtail
wagtail/admin/api/views.py
7
2676
from collections import OrderedDict from rest_framework.authentication import SessionAuthentication from wagtail.api.v2.views import PagesAPIViewSet from wagtail.core.models import Page from .filters import ForExplorerFilter, HasChildrenFilter from .serializers import AdminPageSerializer class PagesAdminAPIViewSet...
bsd-3-clause
-4,839,773,944,795,496,000
27.774194
79
0.633034
false
DivineHime/seishirou
lib/youtube_dl/extractor/tvplay.py
26
15914
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, compat_urlparse, ) from ..utils import ( determine_ext, ExtractorError, int_or_none, parse_iso8601, qualities, try_get, updat...
gpl-3.0
3,830,792,828,342,559,000
36.013986
147
0.45028
false
abdoosh00/edraak
common/lib/xmodule/xmodule/tests/test_error_module.py
37
5977
""" Tests for ErrorModule and NonStaffErrorModule """ import unittest from xmodule.tests import get_test_system from xmodule.error_module import ErrorDescriptor, ErrorModule, NonStaffErrorDescriptor from xmodule.modulestore.xml import CourseLocationGenerator from opaque_keys.edx.locations import SlashSeparatedCourseKey...
agpl-3.0
-5,115,173,604,894,154,000
36.35625
96
0.666555
false
godiard/sugarlabs-calculate
rational.py
1
4226
# rational.py, rational number class Reinier Heeres <reinier@heeres.eu> # # 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...
gpl-2.0
2,628,252,699,635,604,000
28.971631
78
0.52035
false
codingcommando/tmtp
standalone/tests/P_spline_test.py
1
7787
#!/usr/bin/env python # # This is a test sample pattern distributed as part of the tmtp # open fashion design project. # # This pattern tests the code which finds Bezier control points # from points along a curve in order to implement a b-spline # from tmtpl.constants import * from tmtpl.pattern import * from tmtpl...
gpl-3.0
2,046,099,069,568,475,100
35.38785
142
0.577886
false
luser/socorro
socorro/unittest/external/postgresql/test_adi.py
2
6614
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import datetime from nose.tools import eq_, assert_raises from socorrolib.lib import MissingArgumentError from socorro...
mpl-2.0
7,301,276,852,277,945,000
31.421569
75
0.423193
false
sloria/osf.io
api/base/exceptions.py
13
10334
import httplib as http from django.utils.translation import ugettext_lazy as _ from rest_framework import status from rest_framework.exceptions import APIException, AuthenticationFailed def dict_error_formatting(errors, index=None): """ Formats all dictionary error messages for both single and bulk requests ...
apache-2.0
2,549,332,674,260,103,000
38.143939
200
0.68473
false
romain-dartigues/ansible
lib/ansible/modules/cloud/google/gcp_compute_router.py
7
16988
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
-4,769,275,863,563,409,000
33.044088
138
0.609783
false
cms-btv-pog/rootpy
rootpy/plotting/canvas.py
4
9920
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License """ This module implements python classes which inherit from and extend the functionality of the ROOT canvas classes. """ from __future__ import absolute_import import ROOT from .base import convert_color from ..bas...
gpl-3.0
-1,152,103,213,300,127,900
30.293375
78
0.538407
false
ErinCall/sync-engine
inbox/auth/gmail.py
3
10335
import requests from sqlalchemy.orm.exc import NoResultFound from imapclient import IMAPClient from inbox.models import Namespace from inbox.models.backends.gmail import GmailAccount from inbox.models.backends.gmail import GmailAuthCredentials from inbox.models.backends.gmail import g_token_manager from inbox.config ...
agpl-3.0
3,955,052,443,224,165,400
42.242678
79
0.619545
false
cneill/designate
designate/api/v2/controllers/rest.py
2
5787
# flake8: noqa # Copyright (c) <2011>, Jonathan LaCour # 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...
apache-2.0
2,190,192,917,001,468,000
37.324503
79
0.658891
false
t3dev/odoo
addons/payment/controllers/portal.py
1
11876
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from odoo import http, _ from odoo.http import request from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT from datetime import datetime, timedelta _logger = logging.getLogger(__name__) class Payment...
gpl-3.0
-7,932,493,856,523,600,000
41.113475
143
0.579909
false
tximikel/kuma
kuma/wiki/content.py
9
40715
# -*- coding: utf-8 -*- from collections import defaultdict import re import urllib from urllib import urlencode from urlparse import urlparse import html5lib from html5lib.filters._base import Filter as html5lib_Filter import newrelic.agent from lxml import etree from pyquery import PyQuery as pq from tower import u...
mpl-2.0
-3,269,024,955,448,995,000
37.998084
92
0.508695
false
ghyde/letsencrypt
letsencrypt/tests/crypto_util_test.py
20
8468
"""Tests for letsencrypt.crypto_util.""" import logging import shutil import tempfile import unittest import OpenSSL import mock import zope.component from letsencrypt import errors from letsencrypt import interfaces from letsencrypt.tests import test_util RSA256_KEY = test_util.load_vector('rsa256_key.pem') RSA512...
apache-2.0
-5,730,138,421,561,995,000
32.338583
89
0.650449
false
followthesheep/galpy
galpy/orbit_src/integrateFullOrbit.py
1
10899
import sys import sysconfig import warnings import numpy as nu import ctypes import ctypes.util from numpy.ctypeslib import ndpointer import os from galpy import potential from galpy.util import galpyWarning from galpy.orbit_src.integratePlanarOrbit import _parse_integrator, _parse_tol #Find and load the library _lib= ...
bsd-3-clause
3,197,401,538,208,799,000
40.128302
143
0.560143
false
mitchcapper/mythbox
resources/lib/tvrage/tvrage/exceptions.py
4
1937
#!/usr/bin/env python # Copyright (c) 2010, Christian Kreutzer # 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, # ...
gpl-2.0
-6,643,528,417,361,746,000
35.54717
79
0.757357
false
kit-cel/gr-lte
python/qa_pre_decoder_vcvc.py
3
5073
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2013 Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT) # # This 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...
gpl-3.0
-7,386,275,104,010,072,000
33.510204
97
0.599054
false
edx/edx-platform
openedx/features/enterprise_support/tasks.py
4
1447
""" Tasks for Enterprise. """ import logging from celery import shared_task from edx_django_utils.monitoring import set_code_owner_attribute from enterprise.models import EnterpriseCourseEnrollment from openedx.features.enterprise_support.utils import clear_data_consent_share_cache log = logging.getLogger('edx.cel...
agpl-3.0
-6,306,246,466,646,541,000
34.292683
113
0.725639
false
ericzundel/mvn2pants
test/python/squarepants_test/test_pom_utils.py
1
2314
# Tests for code in squarepants/src/main/python/squarepants/pom_utils.py # # Run with: # ./pants test squarepants/src/test/python/squarepants_test:pom_utils import logging import unittest2 as unittest from squarepants.pom_utils import PomUtils # TODO(Eric Ayers) Refactor PomUtils so we can point it at a dummy direc...
apache-2.0
-7,195,754,187,928,690,000
34.060606
89
0.735091
false
amyvmiwei/chromium
third_party/scons/scons-local/SCons/Node/Python.py
3
3966
"""scons.Node.Python Python nodes. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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...
bsd-3-clause
-8,590,415,794,620,605,000
32.327731
89
0.659355
false
gfreed/android_external_chromium-org
build/android/pylib/cmd_helper.py
23
3329
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A wrapper for subprocess to make calling shell commands easier.""" import os import logging import pipes import signal import subprocess import tempf...
bsd-3-clause
-8,354,268,949,655,893,000
29.263636
80
0.69991
false
sunjeammy/tornado
tornado/web.py
2
119945
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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,208,286,463,689,521,000
38.546653
98
0.599566
false
McDermott-Group/LabRAD
LabRAD/Measurements/IV/measureIV.py
1
19990
import matplotlib as mpl mpl.use('TkAgg') import pylab, numpy as np import Tkinter as tk import ttk import tkFileDialog from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg import os, sys import niPCI6221 as ni import threading # Check out: # https://pythonhosted.org/PyDAQmx/callbac...
gpl-2.0
-3,675,403,846,407,559,000
44.745995
118
0.601501
false
Cysu/Person-Reid
reid/optimization/sgd.py
1
10831
#!/usr/bin/python2 # -*- coding: utf-8 -*- import os import glob import time import cPickle import numpy import theano import theano.tensor as T def train(evaluator, datasets, learning_rate=1e-4, momentum=0.9, batch_size=10, n_epoch=100, improvement=1-1e-3, patience_incr=2.0, learning_rate_decr=0...
mit
-6,390,550,585,923,986,000
34.986711
92
0.559782
false
cisco-openstack/tempest
tempest/lib/services/compute/security_group_rules_client.py
3
1912
# 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
-9,056,867,639,184,239,000
41.488889
78
0.698222
false
iulian787/spack
var/spack/repos/builtin/packages/httping/package.py
2
1360
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Httping(AutotoolsPackage): """Httping is like 'ping' but for http-requests. Give it an url...
lgpl-2.1
-3,384,257,749,615,424,500
49.37037
95
0.754412
false
pep-dortmund/mindstorms
python-examples/tankbot/read_sensors.py
1
1270
# -*- ecoding: utf-8 -*- ''' This Program just shows the sensor values of robot It works for the TankBot configuration we used in the school ''' from __future__ import print_function, division, unicode_literals from ev3.ev3dev import Motor from ev3.lego import GyroSensor, UltrasonicSensor, ColorSensor from time import ...
mit
-8,042,733,166,512,992,000
29.95122
80
0.631994
false
nnmware/nnmware
core/constants.py
1
3845
# nnmware(c)2012-2020 from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ STATUS_UNKNOWN = 0 STATUS_DELETE = 1 STATUS_LOCKED = 2 STATUS_PUBLISHED = 3 STATUS_STICKY = 4 STATUS_MODERATION = 5 STATUS_DRAFT = 6 STATUS_CHOICES = ( (STATUS_UNKNOWN, _('Unknown')), (STAT...
gpl-3.0
6,167,032,613,762,811,000
22.588957
73
0.623147
false
lyx003288/python_test
youzai_test.py
1
5600
#!/usr/bin/python #-*- coding: UTF-8 -*- import sys import os import logging import time import datetime import ftplib import tarfile import httplib import json def generate_file_name(day_str): year = int(day_str[0:4]) month = int(day_str[5:7]) day = int(day_str[8:10]) cur_date = datetime.date(year, m...
mit
4,497,413,346,387,905,500
34.906667
129
0.588563
false
remvo/zstt-ros
src/gamecontroller_msgs/src/constants.py
1
1047
from enum import IntEnum # Socket info. DEFAULT_LISTENING_HOST = '0.0.0.0' GAMECONTROLLER_LISTEN_PORT = 3838 GAMECONTROLLER_ANSWER_PORT = 3939 # Game Controller message info. GAMECONTROLLER_STRUCT_HEADER = b'RGme' GAMECONTROLLER_STRUCT_VERSION = 12 GAMECONTROLLER_RESPONSE_VERSION = 2 class SPLTeamColor(IntEnum): ...
apache-2.0
3,075,480,213,569,100,300
20.8125
48
0.629417
false
faucetsdn/faucet
clib/mininet_test_topo.py
5
26614
#!/usr/bin/env python3 """Topology components for FAUCET Mininet unit tests.""" from collections import namedtuple import os import socket import string import shutil import subprocess import time import netifaces # pylint: disable=too-many-arguments from mininet.log import output, warn from mininet.topo import Top...
apache-2.0
3,959,059,830,026,162,700
39.632061
114
0.554257
false
rev2004/android2cloud.app-engine
google_appengine/google/appengine/api/blobstore/blobstore.py
7
8449
#!/usr/bin/env python # # Copyright 2007 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...
mit
4,746,732,319,896,020,000
29.392086
79
0.694875
false
contactless/wirenboard
contrib/deb/mosquitto/mosquitto-1.4.2/test/broker/04-retain-qos0-repeated.py
6
1985
#!/usr/bin/env python # Test whether a retained PUBLISH to a topic with QoS 0 is actually retained # and delivered when multiple sub/unsub operations are carried out. import subprocess import socket import time import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-fol...
mit
-3,811,859,383,711,886,300
32.644068
129
0.687154
false
kevinlee12/oppia
core/domain/calculation_registry_test.py
4
1483
# coding: utf-8 # # Copyright 2018 The Oppia 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 requi...
apache-2.0
-6,398,055,330,669,881,000
38.026316
78
0.718139
false
cmos3511/cmos_linux
python/pj/pj/bin/vplan_runner.py
1
19315
""" Author: Guanyu Yi @ CPU Verification Platform Group Email: yigy@cpu.com.cn Description: pj vplan sub cmd entrence and vplan flow class """ import os import re import datetime as dt import collections import requests import openpyxl from openpyxl.styles import Alignment, PatternFill import pcom import env_booter L...
gpl-3.0
2,155,645,069,527,077,400
48.780928
99
0.501424
false
QQuick/Transcrypt
transcrypt/demos/pysteroids_demo/org/theodox/__init__.py
1
2009
import math import itertools class Vector: """ Generic vector operations. """ def _apply(self,op, other): pairwise = None if type(other) is Vector: pairwise = zip(self.vals, other.vals) else: pairwise = zip(self.vals, [other for _ ...
apache-2.0
634,549,561,471,562,500
21.091954
65
0.526132
false
asadoughi/quark
quark/db/migration/alembic/versions/2e9cf60b0ef6_quota_reservations.py
6
1661
"""Implements reservations, resourcedeltas and quota usages from upstream Revision ID: 2e9cf60b0ef6 Revises: 341d2e702dc4 Create Date: 2015-09-13 13:46:03.888079 """ # revision identifiers, used by Alembic. revision = '2e9cf60b0ef6' down_revision = '341d2e702dc4' from alembic import op import sqlalchemy as sa from ...
apache-2.0
5,031,174,265,641,524,000
35.108696
74
0.624925
false
vdel/BMVC10
libs/colordescriptors/DescriptorIO.py
4
5420
import os, struct import numpy # you need to have NumPy installed def __pointsToMatrix(points): """Function to parse the point location part of the KOEN1 format""" t = [] for p in points: #assert p[0] == "<" and p[-1] == ">" parts = p[1:-1].split(" ") assert par...
gpl-2.0
7,716,768,943,040,394,000
32.967742
105
0.620295
false
samdoran/ansible
hacking/conf2yaml.py
15
3020
#!/usr/bin/env python import ast import yaml import os import sys from ansible.parsing.yaml.dumper import AnsibleDumper things = {} stuff = {} op_map = { ast.Add: '+', ast.Sub: '-', ast.Mult: '*', ast.Div: '/', } def get_values(values): if not isinstance(values, list): return get_value...
gpl-3.0
553,530,131,804,152,900
23.354839
67
0.513245
false
froyobin/horizon
openstack_dashboard/usage/quotas.py
2
12667
# 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
8,296,709,320,381,819,000
36.255882
79
0.605589
false
403JFW/akatsuki
tests/exporter.py
1
2449
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest from akatsuki import exporter class TestExporter(unittest.TestCase): def test_entry_html(self): entry_dict = { 'keyword': 'keyword1, keyword2', 'title': 'An amazing title', ...
mit
3,969,742,949,562,519,600
33.985714
75
0.469171
false
ioram7/keystone-federado-pgid2013
build/sqlalchemy/examples/declarative_reflection/__init__.py
1
1502
""" Illustrates how to mix table reflection with Declarative, such that the reflection process itself can take place **after** all classes are defined. Declarative classes can also override column definitions loaded from the database. At the core of this example is the ability to change how Declarative assigns mappin...
apache-2.0
6,828,502,744,824,415,000
30.957447
71
0.688415
false
shivajimedida/SU2
SU2_PY/SU2/io/data.py
2
16398
#!/usr/bin/env python ## \file data.py # \brief python package for data utility functions # \author T. Lukaczyk, F. Palacios # \version 4.0.0 "Cardinal" # # SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com). # Dr. Thomas D. Economon (economon@stanford.edu). # # SU2 ...
lgpl-2.1
-8,448,012,229,911,935,000
32.950311
109
0.496585
false
Techbikers/techbikers
server/riders/serializers.py
1
4229
import hashlib from django.contrib.auth.models import User from rest_framework import serializers from server.rides.models import RideRiders from server.fundraisers.serializers import FundraiserSerializer class RiderSerializer(serializers.ModelSerializer): name = serializers.CharField(source='get_full_name', rea...
mit
-6,279,959,711,486,975,000
48.752941
107
0.686687
false
egabancho/invenio
invenio/legacy/refextract/kbs.py
3
32307
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014 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 ...
gpl-2.0
1,831,684,262,560,901,400
40.207908
107
0.568081
false
eamigo86/graphene-django-extras
graphene_django_extras/filters/filter.py
1
1492
# -*- coding: utf-8 -*- from django_filters.filterset import BaseFilterSet, FilterSet from django_filters.filterset import FILTER_FOR_DBFIELD_DEFAULTS from graphene_django.filter.utils import replace_csv_filters def get_filterset_class(filterset_class, **meta): """ Get the class to be used as the FilterSet. ...
mit
-8,306,736,808,612,642,000
30.083333
76
0.676944
false
bdastur/notes
python/asyncio/testqueue2.py
1
1732
#!/usr/bin/env python # -*- coding: utf-8 -*- import asyncio import random import time async def worker(name, queue): print("Worker %s started" % name) while True: # Get a work item sleep_for = await queue.get() #await asyncio.sleep(sleep_for[1]) queue.task_done() pri...
apache-2.0
-265,001,707,688,438,660
27.393443
79
0.556005
false
kmaglione/olympia
apps/editors/forms.py
4
19914
import datetime import logging from datetime import timedelta from django import forms from django.core.validators import ValidationError from django.db.models import Q from django.forms import widgets from django.utils.translation import get_language import happyforms import jinja2 from tower import ugettext as _, u...
bsd-3-clause
-1,669,600,586,924,650,000
40.4875
79
0.56518
false
obestwalter/mau-mau
mau_mau/stats.py
1
1816
import logging import sys from statistics import mean from timeit import timeit import fire from mau_mau import constants, rules, play log = logging.getLogger() class Stats: def turns(self, players=3, reps=1000): """calculate mean turns for <reps> games of <players>""" games = self._simulate_ga...
mit
5,269,908,785,438,771,000
30.859649
77
0.589758
false
cespare/pastedown
vendor/pygments/pygments/lexers/web.py
9
126452
# -*- coding: utf-8 -*- """ pygments.lexers.web ~~~~~~~~~~~~~~~~~~~ Lexers for web-related languages and markup. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import copy from pygments.lexer import RegexLexer, ExtendedReg...
mit
-2,779,814,613,805,224,400
38.390654
99
0.488445
false
bank-netforce/netforce
netforce_ecom/netforce_ecom/controllers/ecom_wishlist.py
4
1820
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
mit
-930,645,928,053,855,200
38.565217
80
0.69011
false
Scan-o-Matic/scanomatic
scanomatic/models/factories/features_factory.py
1
1234
from __future__ import absolute_import import os from types import StringTypes from scanomatic.generics.abstract_model_factory import ( AbstractModelFactory, email_serializer ) import scanomatic.models.features_model as features_model class FeaturesFactory(AbstractModelFactory): MODEL = features_model.Feat...
gpl-3.0
2,029,703,341,801,107,200
29.85
73
0.694489
false
64studio/smart
smart/plugins/channelsync.py
4
8207
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
gpl-2.0
-2,205,787,779,533,312,000
39.830846
78
0.415621
false
openspending/ckanext-openspending_registry
setup.py
1
3135
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encoding='utf-8') as...
agpl-3.0
2,471,371,732,877,692,400
36.771084
98
0.681021
false
KnHuq/Dynamic-Tensorflow-Tutorial
GRU/GRU.py
2
6780
import tensorflow as tf from sklearn import datasets from sklearn.cross_validation import train_test_split import sys # # Vhanilla RNN class and functions class RNN_cell(object): """ RNN cell object which takes 3 arguments for initialization. input_size = Input Vector size hidden_layer_size = Hidden...
mit
5,840,347,899,413,291,000
28.350649
76
0.620059
false
sctigercat1/panda3d
direct/src/showutil/Rope.py
8
5750
from panda3d.core import * import types class Rope(NodePath): """ This class defines a NURBS curve whose control vertices are defined based on points relative to one or more nodes in space, so that the "rope" will animate as the nodes move around. It uses the C++ RopeNode class to achieve fancy re...
bsd-3-clause
3,706,250,605,326,841,000
39.20979
91
0.601565
false
cheery/pytci
character_stream.py
1
2684
""" The preprocessing tokens in C are particularly hard, and this character stream makes it slightly easier. """ class CharacterStream(object): def __init__(self, generator, line=1, filename=""): self.comments = True self.generator = discard_comments(self, logical_characters(self, generator...
mit
-5,332,401,609,422,961,000
26.387755
90
0.477273
false
abbot/geocaching-py
save-for-address.py
1
2065
#!/usr/bin/python # -*- encoding: utf-8 -*- import operator import optparse import sys from geocaching import Geo, tools def main(): geo = Geo() parser = optparse.OptionParser(usage="%prog radius address...", description="Download caches for the given address and radius in ...
bsd-3-clause
6,273,749,173,915,928,000
32.306452
104
0.539952
false
sftd/scons
scons-local/SCons/Tool/packaging/targz.py
8
1818
"""SCons.Tool.Packaging.targz The targz SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (t...
mit
-6,276,820,009,228,197,000
40.318182
119
0.749725
false