repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
iteloo/the_island
backend/zombie.py
1
2067
from backend import message from backend import helpers from backend import player import collections class Zombie(message.MessageDelegate): _currentId = 0 def __init__(self, *args, **kwargs): # call super super().__init__(*args, **kwargs) # general vars self.id = self._cur...
mit
-4,727,551,552,570,379,000
26.573333
87
0.61103
false
4.342437
false
false
false
feeilk1991/promenad
elections/2008/primary/states/super/makemini.py
6
6946
#!/usr/bin/env python # reader.py - vote reader for Super Tuesday import csv import os import re import time import urllib import states from template import * import private from candidates import candidates parties = { 'dem': { 'name':'Democrats' }, 'gop': { 'name':'Republicans' } } def fetchData(): urllib.ur...
apache-2.0
-4,240,004,164,748,181,000
25.310606
159
0.589116
false
2.776179
false
false
false
spacelis/tcrawl
tcrawl/api/pic_service_api.py
1
2164
#!python # -*- coding: utf-8 -*- """File: pic_service_api.py Description: Online picture services History: 0.1.2 support tweetpoto.com (plixi.com) 0.1.0 The first version. """ __version__ = '0.1.0' __author__ = 'SpaceLis' from tcrawl.api import api_call, urlsplit def get_twit_pic(**kargs): ...
mit
-8,709,013,480,889,322,000
29.362319
77
0.5878
false
3.201183
false
false
false
wavefrontHQ/python-client
wavefront_api_client/api/saved_search_api.py
1
24018
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ...
apache-2.0
7,068,327,250,175,143,000
37.73871
409
0.570947
false
4.109153
false
false
false
PaulPetring/FritzBox
FritzBox.py
1
9158
#!/usr/bin/env python # -*- coding: utf-8 -*- # @author Paul Petring from pprint import pprint from lxml import etree import hashlib import requests import json from lxml import html import datetime from datetime import datetime, timedelta import pytz class FritzBox: """ allows to interact with Fritzbox OS 6.30 ...
gpl-3.0
1,970,126,370,268,101,000
33.171642
158
0.672527
false
3.015476
false
false
false
healerkx/PySQLKits
mysqlvfk/mysqlvfk.py
1
7204
# import MySQLdb, os, re, json from functools import * from tableinfo import * from sys import argv from graph import * from extra import * from defines import * import readline from optparse import OptionParser usage = """ Usage: python3 relations.py --source=<database> [--options] <source> format: u...
mit
731,856,548,659,580,700
32.821596
122
0.585647
false
3.698152
false
false
false
jchmura/suchary-download
functions.py
1
1546
from datetime import datetime import json from os.path import isfile def output_json(obj): if isinstance(obj, datetime): if obj.utcoffset() is not None: obj = obj - obj.utcoffset() return obj.strftime('%Y-%m-%d %H:%M:%S') return str(obj) def input_json(obj): new_dic = {} ...
mit
7,406,977,418,833,609,000
21.75
80
0.529754
false
3.427938
false
false
false
XaF/rteval
rteval/sysinfo/services.py
2
5348
# -*- coding: utf-8 -*- # # Copyright 2009 - 2013 Clark Williams <williams@redhat.com> # Copyright 2009 - 2013 David Sommerseth <davids@redhat.com> # Copyright 2012 - 2013 Raphaël Beamonte <raphael.beamonte@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under th...
gpl-2.0
-1,912,815,886,614,964,500
38.316176
160
0.588928
false
3.690131
false
false
false
FIXFlyer/pyflyer
flyer/protocol.py
1
1618
#! /usr/bin/env python #----------------------------------------------------------------------- # COPYRIGHT_BEGIN # Copyright (C) 2017, FixFlyer, LLC. # All rights reserved. # COPYRIGHT_END #----------------------------------------------------------------------- """Flyer remote protocol definitions.""" # Carriage ret...
mit
7,762,679,507,206,626,000
25.52459
72
0.681088
false
2.714765
false
false
false
maestro-hybrid-cloud/heat
heat/engine/resources/aws/cfn/wait_condition_handle.py
8
2334
# # 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
4,689,049,030,397,421,000
32.826087
78
0.662811
false
4.094737
false
false
false
YevgeniyaK/python_training
test/test_modify_group.py
1
1640
from model.group import Group import random import pytest def test_modify_group_name(app, db, check_ui): if app.group.count() == 0: with pytest.allure.step("Create new group if group list is empty"): app.group.create(Group(name="Test")) with pytest.allure.step("Given a group list"): ...
apache-2.0
6,308,574,379,492,927,000
37.139535
91
0.606707
false
3.46723
true
false
false
Ziftr/counterpartyd
lib/util.py
1
37566
import time import decimal import sys import json import logging import apsw import collections import inspect import requests from datetime import datetime from dateutil.tz import tzlocal from operator import itemgetter import fractions import warnings import binascii import hashlib from . import (config, exceptions)...
mit
-1,116,486,481,562,769,000
41.676906
448
0.606536
false
3.9392
true
false
false
belangeo/cecilia4csound
Resources/Control.py
1
76089
# encoding: utf-8 """ Copyright 2015 iACT, universite de Montreal, Olivier Belanger, Jean Piche This file is part of Cecilia4Csound. Cecilia4Csound 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-3.0
-1,204,763,819,855,194,000
41.555369
238
0.583711
false
3.504468
false
false
false
qPCR4vir/orange3
Orange/widgets/visualize/owscatterplot.py
1
20625
import numpy as np from PyQt4.QtCore import Qt, QTimer from PyQt4 import QtGui from PyQt4.QtGui import QApplication from sklearn.neighbors import NearestNeighbors from sklearn.metrics import r2_score import Orange from Orange.data import Table, Domain, StringVariable, ContinuousVariable, \ DiscreteVariable from Or...
bsd-2-clause
-2,149,829,242,724,676,000
37.551402
120
0.592921
false
3.665363
false
false
false
ramusus/django-twitter-api
twitter_api/parser.py
1
1282
import json import re from bs4 import BeautifulSoup from oauth_tokens.models import AccessToken HEADERS = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0', 'Accept_Language': 'en' } IDS_RE = re.compile('data-tweet-id="(\d+)"') def get_replies(status): "Return all rep...
bsd-3-clause
4,366,527,782,937,351,000
30.268293
124
0.641186
false
3.455526
false
false
false
bomjacob/htxaarhuslan
main/admin/food.py
1
2598
from collections import Counter, OrderedDict from django.contrib import admin from django.http import HttpResponse from main.models import FoodOrder @admin.register(FoodOrder) class FoodOrderAdmin(admin.ModelAdmin): list_filter = ('time', 'paid', 'collected') list_display = ('pk', 'time', 'get_lan', 'order'...
mit
-1,193,600,915,261,688,600
32.688312
109
0.628373
false
3.737752
false
false
false
intel-hpdd/intel-manager-for-lustre
chroma_core/lib/storage_plugin/manager.py
1
14650
# Copyright (c) 2020 DDN. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. """This module defines StoragePluginManager which loads and provides access to StoragePlugins and their StorageResources""" import sys import traceback from django.conf...
mit
-6,246,934,484,721,304,000
39.027322
117
0.625188
false
4.379671
false
false
false
BeyondTheClouds/nova
nova/db/api.py
1
70629
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file...
apache-2.0
232,568,456,855,932,960
32.457603
79
0.656487
false
3.892906
false
false
false
pchaigno/grr
lib/queue_manager.py
2
31207
#!/usr/bin/env python """This is the manager for the various queues.""" import os import random import socket import time import logging from grr.lib import config_lib from grr.lib import data_store from grr.lib import rdfvalue from grr.lib import registry from grr.lib import stats from grr.lib import utils from g...
apache-2.0
-6,282,211,440,012,330,000
35.714118
80
0.673118
false
4.130642
false
false
false
OpServ-Monitoring/opserv-backend
test/gathering_tests/test_measuring.py
1
5682
import logging import sys import time import pytest from test_general import start_gather_thread, mock_db_open import misc.queue_manager as queue_manager from misc.constants import implemented_hardware, HARDWARE_DEFAULTS, SYSTEM_METRICS_TO_COMPS DATA_TEST_TIMEOUT = 5 log = logging.getLogger("opserv.test") log.setLe...
gpl-3.0
-4,369,075,741,567,289,000
35.423077
99
0.611228
false
4.135371
true
false
false
ananth95/ananth95.github.io-simQuad
sim/simquad.py
2
1069
import matplotlib.pyplot as plt import time import numpy as np import quadcopter from mpl_toolkits.mplot3d import Axes3D import matplotlib.animation as animation #don't try to understand these imports #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # NP.ARRAYS are NOT Matrices. # # Always print y...
gpl-2.0
-6,147,418,515,710,489,000
35.896552
84
0.638915
false
3.382911
false
false
false
Naeka/cmsplugin-dailymotion
cmsplugin_dailymotion/models.py
1
1767
import os import re import urllib from django.db import models from django.core.validators import RegexValidator from django.utils.translation import ugettext_lazy as _ from cms.models import CMSPlugin class DailymotionViewer(CMSPlugin): """ Plugin for embedding a Dailymotion video. """ video_src = ...
mit
-1,962,434,410,417,595,000
40.093023
161
0.642332
false
3.650826
false
false
false
Alwnikrotikz/opencamlib
scripts/ocl_stlsurf_polydata.py
8
1228
import ocl import camvtk import time if __name__ == "__main__": p = ocl.Point() p.x=7 p.y=8 p.z=-3 print p q = ocl.Point(1,2,3) r = p + q t = ocl.Triangle(p,q,r) print t s= ocl.STLSurf() print s s.addTriangle(t) s.addTriangle(t) print s print "end." ...
gpl-3.0
1,589,877,246,728,596,000
22.615385
77
0.594463
false
3.002445
false
false
false
Hack4Eugene/Hack4Cause2016
src/SERT/ParcadeArcade/game-element/gameElement.py
1
2182
# -*- coding: utf-8 -*- """ Created on Sun Feb 14 08:28:34 2016 @author: South Eugene Robotics Team ParcadeArcade gameElement This is intended to encapsulate the general case of a game element. """ import grovepi import lcd import requests import json import mote import socket import fcntl import struct from flask ...
mit
-7,986,441,928,178,751,000
22.223404
109
0.652154
false
3.199413
false
false
false
frgomes/copperhead
copperhead/compiler/__init__.py
5
1312
# # Copyright 2012 NVIDIA Corporation # # 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 ...
apache-2.0
-6,850,180,489,521,163,000
31
131
0.721037
false
3.526882
false
false
false
xpansa/pmis
purchase_stock_analytic/purchase.py
2
1448
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Eficent (<http://www.eficent.com/>) # Jordi Ballester Alomar <jordi.ballester@eficent.com> # # This program is free software: you can redistribute it and/or modify # it und...
agpl-3.0
6,970,221,989,417,657,000
42.878788
103
0.616713
false
4
false
false
false
jeromecc/doctoctocbot
src/display/migrations/0001_initial.py
1
1592
# Generated by Django 2.0.8 on 2018-12-18 07:24 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='WebTweet', fields=[ ('statusid', models.Big...
mpl-2.0
7,850,544,495,661,705,000
39.820513
101
0.547739
false
4.710059
false
false
false
lightbase/WSCServer
wscserver/model/Rede.py
1
6744
from pyramid_restler.model import SQLAlchemyORMContext from sqlalchemy import Table from sqlalchemy.orm import mapper from sqlalchemy.schema import Column from sqlalchemy.types import * from wscserver.model import Base, session from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.declarative import dec...
gpl-2.0
4,116,666,593,917,616,600
41.415094
90
0.604389
false
3.169173
false
false
false
enthought/uchicago-pyanno
pyanno/ui/main.py
1
1028
# Copyright (c) 2011, Enthought, Ltd. # Author: Pietro Berkes <pberkes@enthought.com> # License: Modified BSD license (2-clause) """Entry point for pyanno UI application. At present, the application is based on the wx backend of the traitsui library. It also supports 2 screen formats: * for large displays (larger th...
bsd-2-clause
-5,457,398,681,339,882,000
24.7
79
0.725681
false
3.484746
false
false
false
scemama/irpf90
src/init.py
1
2443
#!/usr/bin/env python2 # IRPF90 is a Fortran90 preprocessor written in Python for programming using # the Implicit Reference to Parameters (IRP) method. # Copyright (C) 2009 Anthony SCEMAMA # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public...
gpl-2.0
-3,043,614,512,485,690,000
26.449438
78
0.653704
false
3.520173
false
false
false
kamyu104/LeetCode
Python/network-delay-time.py
2
1728
# Time: O((|E| + |V|) * log|V|) = O(|E| * log|V|) by using binary heap, # if we can further to use Fibonacci heap, it would be O(|E| + |V| * log|V|) # Space: O(|E| + |V|) = O(|E|) # There are N network nodes, labelled 1 to N. # # Given times, a list of travel times as directed edges times[i] = (u, v, w), # whe...
mit
-489,586,891,004,168,770
33.56
92
0.539352
false
3.141818
false
false
false
jgardner1/JGRPGTools
jgrpg/model/Race.py
1
3479
from PyQt5.QtCore import QObject, pyqtSignal from .ObjectStore import ObjectStore, ObjectStoreObject from random import choice, uniform class Race(ObjectStoreObject): """A race is a type of creature.""" def update(self, *, id=None, name="", male_names=[], fema...
gpl-2.0
1,627,887,318,513,343,200
27.752066
68
0.510492
false
3.998851
false
false
false
nmmmnu/MessageQueue
protocols/redishandler.py
1
4643
# # Memcached protocol implementation # Nikolay Mihaylov nmmm@nmmm.nu # # For Memcached telnet protocol see: # http://blog.elijaa.org/?post/2010/05/21/Memcached-telnet-command-summary import asynchat import time try: from cStringIO import StringIO except ImportError: from StringIO import StringIO class Redis...
gpl-3.0
3,239,277,496,775,437,000
15.464539
74
0.60112
false
2.853719
false
false
false
whosken/destinate
destinate/facebook.py
1
1592
import requests HOST = 'https://graph.facebook.com/v2.5' USER_FIELDS = 'fields=id,first_name,email,tagged_places{place{name,place_type,place_topics,location{city}}},events{name,description},location' def get_user(token): data = get('me', USER_FIELDS, token) if 'error' in data: print data raise...
apache-2.0
-9,129,957,803,148,151,000
32.166667
142
0.592965
false
3.514349
false
false
false
predicthq/sdk-py
usecases/broadcasts/search_by_location.py
1
1561
from predicthq import Client # Please copy paste your access token here # or read our Quickstart documentation if you don't have a token yet # https://docs.predicthq.com/guides/quickstart/ ACCESS_TOKEN = 'abc123' phq = Client(access_token=ACCESS_TOKEN) # The events endpoint supports two types of search by location:...
mit
1,714,105,414,977,001,200
46.30303
104
0.771941
false
3.655738
false
false
false
momahajogami/Prime-Numbers
simple_factor.py
1
1913
from practical_sieve import primes_in_block primes_under_100 = [2,3,5,7]+primes_in_block([3,5,7],10,100,5) def next_ten_thousand_primes(primes): L = primes[-1]+1 R = L + 10000 B = 1000 return primes_in_block(primes[1:],L,R,B) def next_primes(primes): """ Square the size of your window. ...
mit
880,722,730,485,058,400
24.851351
62
0.592263
false
3.105519
false
false
false
leriomaggio/code-coherence-evaluation-tool
code_comments_coherence/source_code_analysis/code_analysis/kernels.py
1
4215
""" Author: Valerio Maggio (@leriomaggio) Mail: valeriomaggio@gmail.com """ from itertools import ifilter, product from functools import wraps from math import sqrt from numpy import sum as np_sum # -------------------------------------------------------------------------- # Node Similarities (Kernels on Nodes) # ---...
bsd-3-clause
6,587,368,949,784,121,000
32.728
93
0.594069
false
3.931903
false
false
false
yfdyh000/pontoon
pontoon/base/utils.py
1
12890
import json import logging import os import re import requests import traceback from datetime import datetime from django.conf import settings from django.contrib.auth.models import Permission from django.http import HttpResponse from django.utils import timezone from django.utils.translation import trans_real from t...
bsd-3-clause
1,437,675,914,982,552,000
33.190981
78
0.590225
false
4.240132
false
false
false
hack4impact/maps4all
app/utils.py
1
2163
import os, json, boto3 from flask import url_for from .models import EditableHTML, SiteAttribute from werkzeug.utils import secure_filename from uuid import uuid4 def register_template_utils(app): """Register Jinja 2 helpers (called from __init__.py).""" @app.template_test() def equalto(value, other): ...
mit
-8,044,579,873,987,158,000
26.379747
74
0.619972
false
3.672326
false
false
false
messente/messente-python
messente/api/sms/api/number_verification.py
1
5307
# -*- coding: utf-8 -*- # Copyright 2016 Messente Communications OÜ # # 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
1,170,721,060,193,383,200
31.552147
81
0.579721
false
3.956749
false
false
false
indexofire/django-muser
muser/extensions/__init__.py
1
3783
# -*- coding: utf-8 -*- import inspect from django.utils import six from django.contrib import admin from django.core.exceptions import ImproperlyConfigured from muser.utils import get_object class ExtensionsMixin(object): """Extension mixin class to include all content type extension. """ @classmethod de...
bsd-3-clause
2,942,409,199,333,107,700
33.081081
73
0.550621
false
5.010596
false
false
false
alvinwan/md2py
md2py/md2py.py
1
5548
from markdown import markdownFromFile, markdown from bs4 import BeautifulSoup class TreeOfContents: """Tree abstraction for markdown source""" source_type = BeautifulSoup valid_tags = ('a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'b...
apache-2.0
905,091,113,787,922,600
35.5
84
0.558219
false
3.882435
false
false
false
mcalmer/spacewalk
backend/server/handlers/config_mgmt/rhn_config_management.py
10
19913
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
4,206,492,181,144,334,000
36.714015
123
0.555868
false
3.926065
true
false
false
afeno/pymysensors
mysensors/const_14.py
1
6398
"""MySensors constants for version 1.4 of MySensors.""" from enum import IntEnum class MessageType(IntEnum): """MySensors message types.""" # pylint: disable=too-few-public-methods presentation = 0 # sent by a node when presenting attached sensors set = 1 # sent from/to sensor ...
mit
1,872,258,917,628,189,000
41.653333
79
0.573617
false
3.645584
false
false
false
SmingHub/Sming
Sming/Arch/Esp8266/Tools/decode-stacktrace.py
2
1381
#!/usr/bin/env python ######################################################## # # Stack Trace Decoder # Author: Slavey Karadzhov <slav@attachix.com> # ######################################################## import shlex import subprocess import sys import re def usage(): print("Usage: \n\t%s <file.elf> [<error...
lgpl-3.0
6,130,658,258,010,436,000
25.557692
83
0.503983
false
3.478589
false
false
false
bkerster/utilities
lnbin.py
1
1964
import numpy as np #x must be a np array def lnbin(x, BinNum): """ Logarithmically bins a numpy array, returns (midpoints, Freq) This function take the input of a data vector x, which is to be binned; it also takes in the amount bins one would like the data binned into. The output is two vectors,...
gpl-2.0
-1,842,046,911,617,157,000
30.693548
82
0.55499
false
3.162641
false
false
false
transifex/openformats
openformats/tests/formats/yaml/test_utils.py
1
4844
import unittest from collections import OrderedDict import six from mock import MagicMock from openformats.formats.yaml.utils import YamlGenerator from openformats.formats.yaml.yaml_representee_classes import (BlockList, FlowList, ...
gpl-3.0
-4,205,691,273,339,091,000
37.141732
85
0.528282
false
4.427788
true
false
false
dishbreak/bluesync
python/modules/types.py
1
1380
from collections import namedtuple Device = namedtuple('Device', 'addr_str addr last_heard') bluesync_uuid = [0x92, 0xb8, 0xb4, 0xf7, 0xd9, 0x96, 0xb3, 0xaf, 0x24, 0x48, 0x03, 0x20, 0x35, 0x74, 0x67, 0x86] timestamp_uuid = [0x6e, 0x16, 0x71, 0x8f, 0xb9, 0xde, 0x2b, 0x92, 0xa0, 0x4b, 0x9d, 0x...
bsd-2-clause
-5,105,000,262,508,354,000
23.660714
71
0.605072
false
1.963016
false
false
false
hiteshgarg14/openstates
scrapers/tx/events.py
2
4807
from utils import LXMLMixin import re import datetime as dt from openstates.scrape import Scraper, Event import pytz class TXEventScraper(Scraper, LXMLMixin): _tz = pytz.timezone("US/Central") def scrape(self, session=None, chamber=None): if not session: session = self.latest_session() ...
gpl-3.0
7,876,155,375,849,433,000
34.345588
87
0.52798
false
3.598054
false
false
false
messense/teambition-api
teambition/api/works.py
3
10083
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from optionaldict import optionaldict from teambition.api.base import TeambitionAPI class Works(TeambitionAPI): def get(self, id=None, parent_id=None, page=None, count=None, all=None): """ 获取文件信息 详情请参考 ...
mit
208,490,466,223,318,500
24.182584
79
0.51411
false
2.935494
false
false
false
ThomasZh/legend-club-wxpub
foo/wx/wx_order.py
1
3884
#!/usr/bin/env python # _*_ coding: utf-8_*_ # # Copyright 2016 planc2c.com # dev@tripc2c.com # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
apache-2.0
223,390,345,666,522,800
32.274336
84
0.657447
false
3.360143
false
false
false
jhesketh/zookeepr
zk/model/product.py
3
25319
"""The application's model objects""" import sqlalchemy as sa from meta import Base from meta import Session from ceiling import Ceiling from product_category import ProductCategory from product_ceiling_map import product_ceiling_map def setup(meta): category_ticket = ProductCategory.find_by_name('Ticket') ...
gpl-2.0
-1,276,178,584,637,553,400
49.638
301
0.69829
false
3.530749
false
false
false
openstack/python-designateclient
designateclient/v2/tsigkeys.py
1
1715
# Copyright 2017 SAP SE # # Author: Rudolf Vriend <rudolf.vriend@sap.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
5,331,771,878,661,510,000
33.3
75
0.670554
false
3.528807
false
false
false
wenli810620/python-django
django_cron/management/commands/runcrons.py
1
1651
import sys from optparse import make_option import traceback from django.core.management.base import BaseCommand from django.conf import settings from django_cron import CronJobManager, get_class from django.db import close_connection DEFAULT_LOCK_TIME = 24 * 60 * 60 # 24 hours class Command(BaseCommand): op...
mit
5,591,232,158,106,197,000
29.018182
99
0.623864
false
3.921615
false
false
false
Svolcano/python_exercise
dianhua/worker/crawler/china_mobile/jiangxi/des_js.py
1
23467
# -*- coding: utf-8 -*- import execjs import sys reload(sys) sys.setdefaultencoding("utf8") def des_encode(encode_data): des_js = execjs.compile(des_js_code) encoded_string = des_js.call("enString", str(encode_data)) return encoded_string des_js_code = """ function enString(data){ var key1 = "YHXWWLKJYXGS...
mit
-5,001,706,511,498,749,000
26.17695
123
0.514072
false
2.554158
false
false
false
matt-gardner/deep_qa
deep_qa/models/multiple_choice_qa/tuple_inference.py
1
17079
from typing import Dict, List import textwrap from keras.layers import Input from overrides import overrides import numpy from ...data.instances.multiple_choice_qa import TupleInferenceInstance from ...layers import NoisyOr from ...layers.attention import MaskedSoftmax from ...layers.backend import RepeatLike from .....
apache-2.0
-5,671,962,694,802,139,000
53.39172
115
0.619006
false
4.087841
false
false
false
mayfield/ecmcli
ecmcli/commands/wifi.py
1
3219
""" WiFi commands. """ import collections import shellish from . import base from .. import ui class AccessPoints(base.ECMCommand): """ List access points seen by site surveys. """ name = 'aps' def setup_args(self, parser): self.add_router_argument('idents', nargs='*') self.add_argument...
mit
-2,996,600,358,786,054,700
33.591398
78
0.508237
false
3.816133
false
false
false
mikhail-gorobets/chipsec
chipsec/modules/tools/vmm/virtio.py
1
4457
#CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2015, Intel Corporation # #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; Version 2. # #This program is distributed in the hope...
gpl-2.0
2,480,034,442,802,938,000
33.820313
103
0.578416
false
3.078039
false
false
false
shishkander/recipes-py
recipe_modules/time/api.py
1
1092
# 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. from recipe_engine import recipe_api import datetime import time class TimeApi(recipe_api.RecipeApi): def __init__(self, **kwargs): super(TimeApi, se...
bsd-3-clause
358,891,948,077,505,340
32.090909
76
0.671245
false
3.676768
false
false
false
UndeadMastodon/Loltris
Menus.py
1
17793
#!/usr/bin/python2 #-*- coding: utf-8 -*- ## ===================================================================== ## Menus for Loltris ## Copyright (C) 2014 Jonas Møller <jonasmo441@gmail.com> ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public Li...
gpl-3.0
-6,757,752,329,227,821,000
48.837535
166
0.536646
false
4.25239
false
false
false
JaDogg/__py_playground
reference/sketchbook/regex/nfa_failstoploops.py
1
2750
""" Regular-expression matching by the Thompson construction. Explained in C at http://swtch.com/~rsc/regexp/regexp1.html """ def match(re, s): return run(prepare(re), s) def run(states, s): for c in s: states = set.union(*[state(c) for state in states]) return accepting_state in states def accepting...
mit
6,375,176,381,203,522,000
26.5
106
0.609455
false
2.817623
false
false
false
RecursiveGreen/spradio-django
savepointradio/api/permissions.py
1
1401
from rest_framework import permissions class IsAdminOrOwner(permissions.BasePermission): message = 'Only an admin user or owner can access this.' def has_object_permission(self, request, view, obj): if request.user.is_authenticated(): return request.user.is_staff or request.user == obj.us...
mit
1,276,768,808,405,144,600
30.840909
76
0.653819
false
4.447619
false
false
false
glynjackson/ec2-deploy
ec2_deploy/utilities.py
1
3698
import time import os from fabric.api import * from fabric.contrib.files import upload_template from git import Repo from ec2_deploy.notifications import Notification def _run_task(task, start_message, finished_message): """ Tasks a task from tasks.py and runs through the commands on the server """ ...
mit
-393,535,179,141,996,800
22.1125
130
0.607896
false
3.921527
false
false
false
mleinart/launchpad2github
launchpad2github.py
1
3950
#!/usr/bin/env python import os import sys import time from getpass import getpass from optparse import OptionParser from termcolor import colored from launchpadlib.launchpad import Launchpad from github3 import login as github_login from github3 import GitHubError ACTIVE_STATUSES = [ "New", "Confirmed", "Tria...
mit
7,041,412,145,390,806,000
27.014184
100
0.654937
false
3.35599
false
false
false
powellc/findhistory
findhistory/apps/artifacts/riak_crud.py
1
3048
import riak import uuid # For regular HTTP... # client = riak.RiakClient() # For Protocol Buffers (go faster!) client = riak.RiakClient(port=10018, transport_class=riak.RiakPbcTransport) artifact_bucket = client.bucket('artifact') def create_artifact(artifact_dict): # ``artifact_dict`` should look something li...
bsd-3-clause
-8,908,347,754,971,077,000
26.718182
77
0.576772
false
3.356828
false
false
false
sohaibfarooqi/flask-stargate
stargate/exception.py
1
5899
"""Application exceptions. Base Exception class for this app is `StargateException`. All application exceptions are caught here and send back to client in a prescribed format. Exceptions are further grouped so that we can located the part of code causing a specific exception. Werkzeug exceptions are also mapped here...
agpl-3.0
-6,817,977,582,220,370,000
37.815789
141
0.596033
false
4.405527
false
false
false
astrofrog/vispy-multivol
medical_rgba.py
1
3214
# This file is an example of using the multivol code, and is derived from an # original example in vispy which is releaed under a BSD license included here: # # =========================================================================== # Vispy is licensed under the terms of the (new) BSD license: # # Copyright (c) 201...
bsd-2-clause
-5,038,781,253,724,071,000
37.261905
79
0.700373
false
3.933905
false
false
false
audiolabs/mdct
mdct/windows.py
1
1335
""" Module for windowing functions not found in SciPy """ from __future__ import division import numpy as np from scipy.signal import kaiser __all__ = [ 'kaiser_derived', ] def kaiser_derived(M, beta): """ Return a Kaiser-Bessel derived window. Parameters ---------- M : int Number of p...
mit
-1,062,535,999,254,185,200
20.190476
77
0.568539
false
3.541114
false
false
false
kanaka/spacewar
python/stars.py
1
2141
#player ship class import pygame from pygame.locals import * import var, gfx, math from random import randint import gameinit class Stars: def __init__(self): stars = [] scrwide, scrhigh = gfx.rect.size self.maxstars = 800 for x in range(self.maxstars): val = randint(1,...
lgpl-2.1
-2,821,837,309,235,326,500
32.984127
79
0.573097
false
3.298921
false
false
false
MrTrustworthy/game_of_life
gol/mtAntenna.py
1
1086
__author__ = 'MrTrustworthy' import inspect class Antenna: def __init__(self): self.listeners = {} def add_listener(self, channel, callback): if len(inspect.signature(callback).parameters) == 0: raise TypeError("Callback Function needs at least 1 parameter") if channel ...
mit
-2,694,550,715,857,001,000
29.166667
75
0.597606
false
4.487603
false
false
false
strummerTFIU/TFG-IsometricMaps
src/read_lidar.py
1
2782
from laspy.file import File import numpy as np import colorsys, random, math, os, load_info laszip = "../LAStools/bin/laszip" def generate_spheres(lidar_list, areas_list, c1, c2): """ Create a string with the definition of spheres which represents points of the LiDAR file included into de coordinates passed as par...
mit
5,776,592,121,527,576,000
27.387755
119
0.627965
false
2.798793
false
false
false
ader1990/cloudbase-init
cloudbaseinit/conf/azure.py
4
1594
# Copyright 2017 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
-1,838,495,556,245,789,400
36.069767
78
0.675659
false
4.403315
true
false
false
matthew-brett/draft-statsmodels
scikits/statsmodels/tests/results/results_discrete.py
1
11493
""" Test Results for discrete models from Stata """ import numpy as np #### Discrete Model Tests #### # Note that there is a slight refactor of the classes, so that one dataset # might be used for more than one model class Anes(): def __init__(self): """ Results are from Stata 11 (checked vs R nn...
bsd-3-clause
7,447,180,080,470,792,000
47.699153
79
0.591577
false
2.564257
false
false
false
MarcoVigelini/crashmanager
crashmanagergui.py
1
28284
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'crashmanager-gui.ui' # # Created: Tue Apr 22 07:51:21 2014 # by: pyside-uic 0.2.13 running on PySide 1.1.0 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_MainWindow(object): def ...
gpl-3.0
-8,960,481,038,980,291,000
78.898305
376
0.735151
false
3.825781
false
false
false
langkilde/epic
src/main/python/moveBatch.py
1
2766
#import pymongo import sys import os ##from pymongo import MongoClient from makeConllFromDBOutput import makeConll from getJustSentences import getJustSentences # python will convert \n to os.linesep def moveBatch(randomIds,noise): pathToEpic = os.getcwd() pathToEpic = pathToEpic[0:pathToEpic.rfind("epic")+4] retur...
apache-2.0
2,568,398,231,805,329,000
27.22449
106
0.702097
false
2.810976
false
false
false
arcivanov/pybuilder
src/unittest/python/plugins/python/pylint_plugin_tests.py
3
4800
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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/l...
apache-2.0
1,745,801,525,207,836,000
42.636364
119
0.652292
false
3.633611
true
false
false
brad999/nikita-client
client/conversation.py
2
2068
# -*- coding: utf-8-*- import logging from notifier import Notifier from brain import Brain class Conversation(object): def __init__(self, persona, mic, profile): self._logger = logging.getLogger(__name__) self.persona = persona self.mic = mic self.profile = profile self.b...
mit
-7,085,864,070,392,753,000
38.018868
80
0.554159
false
4.809302
false
false
false
openregister/country-data
bin/countries.py
1
1041
#!/usr/bin/env python3 """Import iso country codes""" import csv import io import sys column_to_field = [['The two-letter ISO 3166-1 code', 'country'], ['start-date', 'start-date'], ['end-date', 'end-date'], ['Country', 'name'], ['Official ...
mit
-4,535,095,615,233,608,000
34.896552
139
0.574448
false
3.481605
false
false
false
DosAmp/radiosteuerung
radiosteuerung.py
1
1498
#!/usr/bin/python3 import subprocess import bottle as b DEAD = 0 PLAYING = 1 PAUSED = 2 STOPPED = 3 UNKNOWN = 4 def _run_mocp(switch): p = subprocess.Popen(['mocp', switch], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) (output, dummy) = p.communicate() return (output, p.returncode) def get_state()...
mit
5,292,195,454,860,712,000
23.16129
93
0.578104
false
3.242424
false
false
false
colloquium/spacewalk
backend/server/rhnMapping.py
1
1548
# # Copyright (c) 2008--2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
8,066,852,062,321,704,000
28.769231
76
0.68863
false
3.650943
false
false
false
dreamhost/akanda-ceilometer
setup.py
1
1286
# Copyright 2014 DreamHost, LLC # # Author: DreamHost, 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 applicabl...
apache-2.0
-3,929,586,663,161,005,000
31.974359
75
0.700622
false
3.944785
false
false
false
ipapi/ipap
ipap/core/filter.py
1
1870
from math import sqrt, exp import numpy as np def distance(u, v, dft): return sqrt((u - (dft.shape[0] / 2))**2 + (v - (dft.shape[1] / 2))**2) def ideal(value, cutoff, ftype='lowpass', bwidth=1.0): if ftype == 'lowpass': return 1 if value <= cutoff else 0 elif ftype == 'highpass': return...
gpl-3.0
-8,124,891,274,376,917,000
33
79
0.532086
false
3.096026
false
false
false
zamattiac/SHARE
tests/share/models/test_rawdata.py
1
2632
import pytest import hashlib from django.core import exceptions from django.db.utils import IntegrityError from share.models import RawData @pytest.mark.django_db class TestRawData: def test_doesnt_mangle_data(self, share_source): rd = RawData(source=share_source, app_label='foo', data=b'This is just s...
apache-2.0
-1,687,409,344,621,288,400
40.777778
461
0.661474
false
3.340102
true
false
false
david-shu/lxml-mate
lxmlmate.py
1
14915
# -*- coding: utf-8 -*- ''' lxml mate. ''' __ver_major__ = 0 __ver_minor__ = 5 __ver_patch__ = 2 __ver_sub__ = "" __version__ = "%d.%d.%d%s" % (__ver_major__,__ver_minor__,__ver_patch__,__ver_sub__) from lxml import etree, objectify import types class ObjectifiedElementProxy( object ): u'''Proxy class for...
mit
-8,272,102,064,105,168,000
25.258803
147
0.4942
false
4.267525
false
false
false
swiftstack/swift
swift/common/bufferedhttp.py
2
12433
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
6,961,866,339,083,148,000
38.722045
79
0.609185
false
4.299101
false
false
false
leifj/PyKCS11
PyKCS11/__init__.py
1
33528
# Copyright (C) 2006-2010 Ludovic Rousseau (ludovic.rousseau@free.fr) # # This file 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
-1,112,641,178,927,531,400
29.958449
99
0.578263
false
3.593954
false
false
false
yunojuno/django-test
trello_webhooks/migrations/0001_initial.py
2
1837
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='CallbackEvent', fields=[ ...
mit
-2,390,449,551,675,246,000
38.085106
125
0.559608
false
4.405276
false
false
false
jamesacampbell/python-examples
multi-categorization-tweets-example.py
1
6583
# author: James Campbell # what: example three+ categorization of tweets using nltk # date created: November 23 2015 import nltk import sys from sys import exit pos_tweets = [('I love this car', 'positive'), ('This view is amazing', 'positive'), ('I feel great this morning', 'positive'), ...
mit
-4,959,251,909,662,075,000
48.863636
168
0.590702
false
3.666852
false
false
false
karel-murgas/Shootris
classes.py
1
9808
"""Defines classes for Shootris""" # Copyright (C) 2016 Karel "laird Odol" Murgas # karel.murgas@gmail.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
gpl-3.0
912,791,536,594,842,800
38.22
157
0.580681
false
3.49021
false
false
false
Ebag333/Pyfa
gui/crestFittings.py
1
15015
import time import webbrowser import json import wx import requests from service.port import Port from service.fit import Fit from eos.types import Cargo from eos.db import getItem from gui.display import Display import gui.globalEvents as GE if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.V...
gpl-3.0
6,150,813,481,155,787,000
34.75
119
0.622111
false
3.601583
false
false
false
ombt/analytics
books/programming_in_python_3/book_examples/py31eg/IndentedList.py
2
5068
#!/usr/bin/env python3 # Copyright (c) 2008-11 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) an...
mit
-7,855,108,976,740,129,000
32.562914
74
0.525257
false
3.632975
false
false
false
miguelotemagno/imagestion
imagestion_1.0/Imagen.py
1
14445
# +-----------------------------------------------------------------------+ # | IMAGESTION | # | | # | Copyright (C) 2010-Today, GNUCHILE.CL - Santiago de Chile | # | Licensed und...
gpl-2.0
3,082,745,213,248,005,000
34.666667
94
0.451506
false
3.453263
false
false
false
sdispater/orator
orator/dbal/platforms/postgres_platform.py
1
14126
# -*- coding: utf-8 -*- from .platform import Platform from .keywords.postgresql_keywords import PostgreSQLKeywords from ..table import Table from ..column import Column from ..identifier import Identifier class PostgresPlatform(Platform): INTERNAL_TYPE_MAPPING = { "smallint": "smallint", "int2"...
mit
5,858,059,935,755,748,000
31.548387
118
0.467719
false
4.289705
false
false
false
rdio/sentry
src/sentry/models/alert.py
1
3798
""" sentry.models.alert ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from datetime import timedelta from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from djan...
bsd-3-clause
34,375,455,835,411,132
31.741379
126
0.633755
false
4.07074
false
false
false
tomaszpiotro/ntr
dziekanat/dziekanat/settings.py
1
1315
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = '+k*kdcv4ut*bd99nb(ox$%j_9(1#8@_)!aa4oy2%iwsg&!tt15' DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = ['localhost', '127.0.0.1'] INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.cont...
mit
-8,697,183,733,747,685,000
22.070175
69
0.668441
false
3.207317
false
true
false
rcfduarte/nmsat
projects/examples/scripts/single_neuron_pattern_input.py
1
8325
__author__ = 'duarte' from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict from modules.input_architect import EncodingLayer, InputSignalSet, InputNoise, InputSignal from modules.net_architect import Network from modules.io import set_storage_locations from modules.signals import iterate_...
gpl-2.0
-234,421,545,666,139,140
53.058442
120
0.448529
false
5.154799
false
false
false
j-carpentier/nova
nova/objects/aggregate.py
29
7877
# 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 agree...
apache-2.0
-245,690,764,181,820,060
38.189055
78
0.563666
false
4.373681
false
false
false
poifra/Creamuspython2
test.py
1
1509
from Chordbook import transpose, durations from Sequencer import Sequence, Note from Synth import ClassicSynth, BassWalkSynth, PianoSynth from random import choice from itertools import cycle from pyo import * s = Server().boot() noteCount = 1 totalCount = 0 tempo = 70 chords = cycle( [ transpose(target='m7',key=...
mit
6,184,060,515,430,927,000
22.578125
70
0.700464
false
2.680284
false
false
false
agarwal-karan/mongo-connector
mongo_connector/doc_managers/elastic_doc_manager.py
1
9182
# Copyright 2013-2014 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...
apache-2.0
-7,876,939,161,302,815,000
37.742616
82
0.549771
false
4.485589
false
false
false
LA-Toth/sitegen
sitegen/siteloader/pages.py
1
3137
import os import markdown from sitegen.siteloader.base import FinalHtmlAction, FSDependencyObserver from sitegen.siteloader.dependency import Action class MarkdownObserver(FSDependencyObserver): def notify(self, directory: str, entry: str): is_md = entry.endswith('.md') is_html = entry.endswith(...
gpl-3.0
-8,737,573,106,826,761,000
34.247191
94
0.597386
false
3.66472
false
false
false