repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
disqus/zumanji
src/zumanji/views.py
1
6969
from django.conf import settings from django.core.urlresolvers import reverse from django.db import transaction from django.http import HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import render, get_object_or_404 from django.utils import simplejson from django.views.decorators.csrf import csrf_pro...
apache-2.0
3,989,766,211,965,808,000
31.565421
126
0.627924
false
ZwEin27/phone-number-matcher
dig_phone_extractor.py
1
23737
# -*- coding: utf-8 -*- # @Author: ZwEin # @Date: 2016-06-21 12:36:47 # @Last Modified by: ZwEin # @Last Modified time: 2016-09-29 21:54:12 import os import re import sys import json import copy import types import string import collections import phonenumbers from datetime import datetime from crf_tokenizer imp...
apache-2.0
-8,800,745,410,716,933,000
34.694737
433
0.532376
false
kobejean/tensorflow
tensorflow/contrib/distribute/python/tpu_strategy.py
1
20404
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
6,564,893,554,403,699,000
40.897331
111
0.680259
false
ladybug-tools/honeybee
honeybee_plus/utilcol.py
1
1078
"""A collection of useful utilities for Honeybee""" import uuid import re def random_name(shorten=True): """Generate a random name as a string using uuid. Args: shorten: If True the name will be the first to segment of uuid. """ if shorten: return '-'.join(str(uuid.uuid4()).split('-')...
gpl-3.0
1,852,447,149,315,065,000
24.069767
71
0.56308
false
zjj/trac_hack
sample-plugins/HelloWorld.py
1
2140
"""Example macro.""" revision = "$Rev: 6326 $" url = "$URL: https://svn.edgewall.org/repos/trac/tags/trac-0.12.2/sample-plugins/HelloWorld.py $" # # The following shows the code for macro, old-style. # # The `execute` function serves no purpose other than to illustrate # the example, it will not be used anymore. # # ...
bsd-3-clause
5,799,304,578,152,899,000
31.923077
97
0.649533
false
OptimalPayments/Python_SDK
src/sample_application/DirectDebitACHpurchase.py
1
1780
#!/usr/bin/env python3 ''' Created on 1-June-2016 @author: Asawari.Vaidya ''' from PythonNetBanxSDK.CardPayments.BillingDetails import BillingDetails from PythonNetBanxSDK.CustomerVault.ACHBankAccount import ACHBankAccount from PythonNetBanxSDK.CustomerVault.Profile import Profile from PythonNetBanxSDK.DirectDebit.Pur...
mit
-7,959,770,049,315,562,000
31.962963
114
0.811798
false
rymate1234/rymate-blog
migrations/versions/413f129e8b07_.py
1
1535
"""empty message Revision ID: 413f129e8b07 Revises: None Create Date: 2014-05-02 08:09:09.906725 """ # revision identifiers, used by Alembic. revision = '413f129e8b07' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
bsd-3-clause
5,584,822,916,619,234,000
30.979167
65
0.663192
false
zdomjus60/astrometry
tools.py
1
10051
# -*- coding: utf-8 -*- """ helper functions for time management """ import math def sin(x): return math.sin(math.radians(x)) def cos(x): return math.cos(math.radians(x)) def atan2(y , x): return math.degrees(math.atan2(y, x)) def reduce360(x): return x % 360.0 def dms2ddd(hour, minute, second): """...
cc0-1.0
-7,099,347,639,674,084,000
34.641844
111
0.594369
false
stoeckli/iMatrixSpray
octoprint/printer.py
1
20362
# coding=utf-8 __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' import time import datetime import threading import copy import os #import logging, logging.config import octoprint.util.comm as comm import octoprint.util as util from ...
agpl-3.0
2,885,922,597,023,972,000
28.379509
189
0.712525
false
nimasmi/wagtail
wagtail/core/blocks/struct_block.py
1
8310
import collections from django import forms from django.core.exceptions import ValidationError from django.forms.utils import ErrorList from django.template.loader import render_to_string from django.utils.functional import cached_property from django.utils.html import format_html, format_html_join from django.utils.s...
bsd-3-clause
7,582,453,976,146,293,000
37.472222
107
0.622262
false
ypid/series60-remote
pc/devices/status_numbers.py
1
2071
# -*- coding: utf-8 -*- # Copyright (c) 2008 - 2010 Lukas Hetzenecker <LuHe@gmx.at> NUM_CONNECTED = 100 NUM_HELLO_REQUEST = 110 NUM_HELLO_REPLY = 111 NUM_QUIT = 120 NUM_PARTIAL_MESSAGE = 130 NUM_CONTACTS_REQUEST_HASH_ALL = 200 NUM_CONTACTS_REQUEST_HASH_SINGLE= 201 NUM_CONTACTS_REQUEST_CONTACT = 204 NUM_CONTACTS_REQU...
gpl-2.0
2,607,002,893,510,730,000
26.986486
59
0.759536
false
tspus/python-matchingPursuit
src/utils.py
1
5766
#!/usr/bin/env python #-*- coding: utf-8 -*- ''' # This file is part of Matching Pursuit Python program (python-MP). # # python-MP 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 ...
gpl-3.0
-267,186,999,534,640,670
36.441558
139
0.692508
false
ngmiller/mipsy
mipsy/encoder.py
1
8100
""" mipsy.encoder Instruction encoder. See README.md for usage and general information. """ # system imports import bitstring # application imports from mipsy.arch import MIPS from mipsy.util import LabelCache, ParseInfo class Encoder(object): """ Responsible for encoding individual instructions and qu...
mit
-3,993,751,590,257,310,700
38.512195
106
0.564691
false
Akson/RemoteConsolePlus3
RemoteConsolePlus3/RCP3/Backends/Processors/Graphs/Plot1D.py
1
2341
#Created by Dmytro Konobrytskyi, 2014 (github.com/Akson) import numpy as np import matplotlib import matplotlib.pyplot from RCP3.Infrastructure import TmpFilesStorage class Backend(object): def __init__(self, parentNode): self._parentNode = parentNode def Delete(self): """ This method ...
lgpl-3.0
-487,449,994,099,500,860
29.415584
88
0.5912
false
BarusXXX/K-Tree
TreeLogic.py
1
3884
import os from copy import deepcopy class RecursiveTree: def __init__(self, dir_name): self.dir_name = dir_name self.files = [] self.folders = [] #Tuple Absolute address, branch, level self.branches = [] self.children_n = [] self.currentlevel = 0 self.level=[...
mit
4,737,420,698,815,880,000
29.582677
156
0.511843
false
ndparker/wolfe
wolfe/scheduler/_job_queue.py
1
4458
# -*- coding: ascii -*- r""" :Copyright: Copyright 2014 - 2016 Andr\xe9 Malo or his licensors, as applicable :License: 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....
apache-2.0
-4,326,341,695,374,241,300
25.855422
77
0.580978
false
bvanrijn/debianpaste-clients
old-paste.py
1
7602
#!/usr/bin/python # Filename: paste # Purpose: XmlRpc interface client to paste.debian.net # Author: Copyright (C) 2007-2011 Michael Gebetsroither <michael@mgeb.org> # License: This file is licensed under the GPL v2+. Full license text in LICENSE # Modified original: No modificat...
gpl-2.0
4,928,760,378,934,636,000
35.373206
241
0.578269
false
wjakob/layerlab
recipes/coated-gold-with-scatmedium.py
1
2082
# Creates a rough gold layer with a rough dielectric coating containing an # anisotropic scattering medium import sys sys.path.append('.') from utils.materials import gold from utils.cie import get_rgb import layerlab as ll eta_top = 1.5 # This step integrates the spectral IOR against the CIE XYZ curves to obtain ...
bsd-2-clause
-3,367,170,747,667,034,600
29.617647
79
0.713737
false
plumer/codana
projectdata.py
1
5358
class VersionDataManager: """Manager of all the information of files and packages in a specific version Attributes: packages (list of str): List of packages name files (list of str): List of all the files in the project packagedict (dict): Map of packages(key) and filenames(value) ...
mit
-4,992,400,439,942,177,000
35.69863
102
0.601904
false
chutsu/robotics
prototype/models/two_wheel.py
1
3500
from math import cos from math import sin import numpy as np import sympy from sympy import pprint def two_wheel_2d_model(x, u, dt): """Two wheel 2D motion model Parameters ---------- x : np.array Two Wheel model state vector (x, y, theta) u : np.array Input dt : float ...
gpl-3.0
2,906,790,711,327,816,000
19.833333
76
0.483714
false
lingthio/Flask-User
flask_user/user_mixin.py
1
4450
"""This module implements the UserMixin class for Flask-User. This Mixin adds required methods to User data-model. """ from flask import current_app from flask_login import UserMixin as FlaskLoginUserMixin class UserMixin(FlaskLoginUserMixin): """ This class adds required methods to the User data-model. Exam...
mit
2,653,800,167,023,835,600
42.203883
106
0.602921
false
mathcamp/steward_web
steward_web/__init__.py
1
1965
""" Steward extension providing framework for web interface """ import re import pyramid.renderers from pyramid.request import Request from pyramid.settings import asbool def to_json(value): """ A json filter for jinja2 """ return pyramid.renderers.render('json', value) def do_index(request): """ Rende...
mit
7,871,287,402,392,848,000
29.230769
77
0.653944
false
abrt/faf
src/pyfaf/storage/migrations/versions/168c63b81f85_report_history_default_value.py
1
1945
# Copyright (C) 2014 ABRT Team # Copyright (C) 2014 Red Hat, Inc. # # This file is part of faf. # # faf 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) ...
gpl-3.0
7,853,489,964,225,810,000
37.137255
82
0.731105
false
sradevski/homeAutomate
scripts/laptop_on_network.py
1
1994
#!/usr/bin/python import remote_core as core import os import sys import nmap import datetime import time import re import go_to_sleep try: nm = nmap.PortScanner() # instance of nmap.PortScanner except nmap.PortScannerError: print('Nmap not found', sys.exc_info()[0]) sys.exit(0) exc...
mit
6,664,738,618,122,529,000
25.586667
110
0.61986
false
JordanReiter/django-notification
notification/views.py
1
6596
from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect, Http404 from django.template import RequestContext from django.contrib.auth.decorators import login_required try: from django.contrib.syndication.views impor...
mit
8,042,785,939,941,627,000
32.482234
89
0.622347
false
alexwaters/python-readability-api
readability/models.py
1
5472
# -*- coding: utf-8 -*- """ readability.models ~~~~~~~~~~~~~~~~~~ This module provides the core Readability API models. """ from .helpers import to_python, to_api class BaseResource(object): """A Base BaseResource object.""" def __init__(self): super(BaseResource, self).__init__() self._rd...
mit
-2,055,132,855,764,576,500
22.088608
140
0.524671
false
Wikidata/StrepHit
tests/test_classification.py
1
4013
# -*- encoding: utf-8 -*- import unittest from treetaggerwrapper import Tag from strephit.classification import feature_extractors class TestFactExtractorFeatureExtractor(unittest.TestCase): def setUp(self): self.gazetteer = { 'sentence': ['feature1', 'feature2'] } self.sent...
gpl-3.0
-8,885,127,340,239,638,000
40.802083
92
0.555943
false
kaphka/catconv
convert.py
1
1091
import argparse import signal from tqdm import tqdm import catconv.operations as co import catconv.stabi as sb exit = False def signal_handler(signal, frame): print('You pressed Ctrl+C!') exit = True parser = argparse.ArgumentParser() parser.add_argument("source") parser.add_argument("target") parser.add_a...
apache-2.0
5,971,109,955,525,650,000
24.372093
92
0.669111
false
alirizakeles/zato
code/zato-zmq/src/zato/zmq_/mdp/worker.py
1
9531
# -*- coding: utf-8 -*- """ Copyright (C) 2016 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import logging import time from datetime import datetime, timedelta # Z...
gpl-3.0
-5,260,113,745,436,168,000
37.587045
130
0.484
false
pcingola/server
ga4gh/cli.py
1
32399
""" Command line interface programs for the GA4GH reference implementation. TODO: document how to use these for development and simple deployment. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import logging import unittest import uni...
apache-2.0
6,806,398,057,844,227,000
30.212909
79
0.635112
false
antonygc/liblightbase
liblightbase/lbdoc/metaclass.py
1
6065
from liblightbase import lbutils from liblightbase.lbdoc.metadata import DocumentMetadata def generate_metaclass(struct, base=None): """ Generate document metaclass. The document metaclass is an abstraction of document model defined by base structures. @param struct: Field or Group object. @...
gpl-2.0
6,355,603,194,399,791,000
33.460227
76
0.588458
false
aio-libs/aiozmq
examples/core_dealer_router.py
1
1579
import asyncio import aiozmq import zmq class ZmqDealerProtocol(aiozmq.ZmqProtocol): transport = None def __init__(self, queue, on_close): self.queue = queue self.on_close = on_close def connection_made(self, transport): self.transport = transport def msg_received(self, msg...
bsd-2-clause
-5,655,556,457,899,408,000
21.239437
86
0.621279
false
pyfa-org/eos
eos/item/mixin/effect_stats/remote_repair.py
1
1829
# ============================================================================== # Copyright (C) 2011 Diego Duclos # Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publi...
lgpl-3.0
-2,539,301,026,785,657,300
37.914894
80
0.636413
false
bollu/polymage
sandbox/apps/python/img_proc/harris/init.py
1
1485
import sys import os.path from PIL import Image import numpy as np from arg_parser import parse_args from printer import print_header, print_usage, print_line def init_images(app_data): print("[init.py] : initializing images...") app_args = app_data['app_args'] # input image: img_path = app_args.im...
apache-2.0
-1,343,414,416,860,723,500
22.203125
66
0.630976
false
zhanrnl/ag
webapp/models/roomassignment.py
1
2751
from google.appengine.ext import ndb from models.grading import SITTING_ROOM_TYPES from models.team import ( Team, Contestant, ) from models.sitting import Sitting import random SINGLE_TEST_SITTING = { 'alg' : 'alg,at', 'at' : 'at,calc', 'calc' : 'calc,geo', 'geo' : 'at,geo', 'team' : 'pow...
mit
-7,670,656,687,545,846,000
27.957895
78
0.571429
false
google/tf-quant-finance
tf_quant_finance/experimental/pricing_platform/framework/market_data/market_data_test.py
1
5816
# Lint as: python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
2,786,026,955,294,573,600
39.388889
95
0.569464
false
Endika/mitmproxy
libmproxy/contentviews.py
1
16688
""" Mitmproxy Content Views ======================= mitmproxy includes a set of content views which can be used to format/decode/highlight data. While they are currently used for HTTP message bodies only, the may be used in other contexts in the future, e.g. to decode protobuf messages sent as WebSocket frames. Thus,...
mit
1,470,349,869,913,732,900
26.583471
98
0.54704
false
armando-migliaccio/tempest
tempest/api/compute/images/test_images_oneserver_negative.py
1
6602
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # 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 #...
apache-2.0
426,124,462,674,475,700
41.050955
79
0.63193
false
dropbox/changes
changes/listeners/mail.py
1
8772
from __future__ import absolute_import, print_function from itertools import imap import logging import toronado from email.utils import parseaddr from flask import current_app, render_template from flask_mail import Message, sanitize_address from jinja2 import Markup from typing import List # NOQA from changes.con...
apache-2.0
7,238,504,638,627,023,000
35.39834
102
0.614683
false
noiselabs/box-linux-sync
src/noiselabs/box/pms/apt.py
1
1248
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of box-linux-sync. # # Copyright (C) 2013 Vítor Brandão <noisebleed@noiselabs.org> # # box-linux-sync 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...
lgpl-3.0
4,470,295,722,904,715,000
31.789474
80
0.701445
false
pidydx/grr
grr/lib/flows/general/audit.py
1
2003
#!/usr/bin/env python """This implements the auditing system. How does it work? Noteworthy events within the GRR system (such as approval granting, flow execution etc) generate events to notify listeners about the event. The audit system consists of a group of event listeners which receive these events and act upon ...
apache-2.0
4,533,730,079,903,174,000
30.793651
80
0.736895
false
gatagat/lapjv
bench/overview_sparse.py
1
2203
from pytest import mark from joblib import Memory import numpy as np from lap import lapjv, lapmod from lap.lapmod import get_cost try: from lap_old import lapjv as lapjv_old except ImportError: print( '''If you get here, you do not have the old lapjv to compare to. git clone git@github...
bsd-2-clause
-4,014,113,899,185,928,000
26.886076
74
0.634135
false
montyly/manticore
tests/ethereum/EVM/test_EVMEXP.py
1
79538
import struct import unittest import json from manticore.platforms import evm from manticore.core import state from manticore.core.smtlib import Operators, ConstraintSet import os class EVMTest_EXP(unittest.TestCase): _multiprocess_can_split_ = True maxDiff = None def _execute(self, new_vm): last...
apache-2.0
-3,030,011,212,142,196,700
39.914609
100
0.646584
false
MicBrain/Tic_Tac_Toe
Tic_Tac_Toe.py
1
8653
################### ### DESCRIPTION ### ################### """ Tic-tac-toe (or Noughts and crosses, Xs and Os) is a game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game. ...
gpl-3.0
-7,830,777,343,375,921,000
37.620536
101
0.539475
false
jpetto/bedrock
bedrock/firefox/helpers.py
1
8778
from collections import OrderedDict from django.core.cache import cache from django.conf import settings import jingo import jinja2 from bedrock.firefox.models import FirefoxOSFeedLink from bedrock.firefox.firefox_details import firefox_desktop, firefox_android, firefox_ios from bedrock.base.urlresolvers import reve...
mpl-2.0
5,004,060,017,684,913,000
35.728033
89
0.583276
false
satish-avninetworks/murano
murano/dsl/murano_package.py
1
7758
# Copyright (c) 2014 Mirantis, 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...
apache-2.0
3,568,733,459,473,349,000
35.252336
78
0.59603
false
DevHugo/zds-site
zds/utils/tutorials.py
1
2669
# coding: utf-8 import os # Used for indexing tutorials, we need to parse each manifest to know which content have been published class GetPublished: published_part = [] published_chapter = [] published_extract = [] def __init__(self): pass @classmethod def get_published_content(cls...
gpl-3.0
-8,591,455,257,756,504,000
30.034884
103
0.59423
false
HPPTECH/hpp_IOSTressTest
Refer/IOST_OLD_SRC/IOST_0.18/IOST.py
1
8248
#!/usr/bin/env python #====================================================================== # # Project : hpp_IOStressTest # File : IOST.py # Date : Sep 21, 2016 # Author : HuuHoang Nguyen # Contact : hhnguyen@apm.com # : hoangnh.hpp@gmail.com # License : MIT License # Copyright : 2016 # Descri...
mit
3,273,504,206,182,492,700
37.90566
183
0.466537
false
Hubert51/AutoGrading
learning/number_recognization/test.py
1
1250
from pytesseract import image_to_string from PIL import Image import cv2 import numpy import sys if __name__ == '__main__': f = open("test1.txt") f = f.read() for element in f: str1 = element position = ((712, 571), (725, 587)) dh = position[1][1] - position[0][1] upper = position[0][...
mit
-715,447,482,893,040,000
26.777778
98
0.6064
false
bblais/Tech-SIE
Estimating_Proportion/Estimating_Proportion.py
1
4755
# coding: utf-8 # #Statistical Inference for Everyone: Technical Supplement # # # # This document is the technical supplement, for instructors, for [Statistical Inference for Everyone], the introductory statistical inference textbook from the perspective of "probability theory as logic". # # <img src="http://web...
mit
8,721,158,606,299,497,000
33.708029
206
0.578549
false
wylee/django-local-settings
src/local_settings/util.py
1
5070
import importlib import io import os import dotenv NO_DEFAULT = type( "NO_DEFAULT", (), { "__nonzero__": (lambda self: False), # Python 2 "__bool__": (lambda self: False), # Python 3 "__str__": (lambda self: self.__class__.__name__), "__repr__": (lambda self: str(self)),...
mit
-6,834,773,356,538,003,000
26.258065
82
0.622091
false
ngageoint/scale
scale/data/models.py
1
24039
"""Defines the database models for datasets""" from __future__ import absolute_import, unicode_literals import copy import logging from collections import namedtuple import django.contrib.postgres.fields from django.db import models, transaction from django.db.models import Q, Count from data.data import data_util f...
apache-2.0
391,126,229,335,592,260
39.745763
146
0.650193
false
redhat-openstack/rdo-infra
ci-scripts/dlrnapi_promoter/test_registries_client_unit.py
1
10398
import subprocess import yaml try: # Python3 imports from unittest import mock from unittest.mock import patch except ImportError: # Python2 imports from mock import patch import mock from common import PromotionError from dlrn_hash import DlrnCommitDistroHash, DlrnHash from test_unit_fixture...
apache-2.0
-4,558,805,724,767,408,000
41.790123
77
0.525293
false
alphatwirl/alphatwirl
alphatwirl/summary/Scan.py
1
1209
# Tai Sakuma <tai.sakuma@gmail.com> ##__________________________________________________________________|| import numpy as np import copy ##__________________________________________________________________|| class Scan: def __init__(self, val=None, weight=1, contents=None): if contents is not None: ...
bsd-3-clause
-5,268,649,975,022,638,000
28.487805
79
0.456576
false
oasis-open/cti-python-stix2
stix2/test/v20/test_kill_chain_phases.py
1
1652
"""Tests for stix.ExternalReference""" import pytest import stix2 LMCO_RECON = """{ "kill_chain_name": "lockheed-martin-cyber-kill-chain", "phase_name": "reconnaissance" }""" def test_lockheed_martin_cyber_kill_chain(): recon = stix2.v20.KillChainPhase( kill_chain_name="lockheed-martin-cyber-ki...
bsd-3-clause
84,364,463,680,078,540
26.081967
84
0.700969
false
absperf/wagtailapproval
wagtailapproval/menu.py
1
3637
from __future__ import (absolute_import, division, print_function, unicode_literals) import itertools from django.contrib.auth import get_user from django.core.urlresolvers import reverse, reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import...
bsd-2-clause
-1,745,352,902,436,354,300
35.009901
78
0.587022
false
lulivi/debate_bot
bot.py
1
5398
#!/usr/bin/python3 -u # -*- coding: utf-8 -*- import sys import time import telebot # Librería de la API del bot. from telebot import types # Tipos para la API del bot. from priv.__init__ import token as tk bot = telebot.TeleBot(tk()) # Creamos el objeto de nuestro bot. ###############################################...
gpl-2.0
6,137,335,804,472,736,000
31.083333
232
0.520779
false
chugunovyar/factoryForBuild
neuron/SaveClosedPossition.py
1
31069
# -*- coding: utf-8 -*- import logging from neuron.models import DataSet import dateutil.parser as DP loggermsg = logging.getLogger('django') def saveClosedPossition(jsondata): #loggermsg.info(len(jsondata)) # Проверяем есть ли такой ордер в БД ifExistOrdernum = DataSet.objects.filter(open_magicnum=j...
gpl-3.0
-1,601,113,315,527,009,800
49.413008
135
0.546768
false
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/core/checks/model_checks.py
1
2454
# -*- coding: utf-8 -*- from __future__ import unicode_literals import inspect import types from django.apps import apps from django.core.checks import Error, Tags, register @register(Tags.models) def check_all_models(app_configs=None, **kwargs): errors = [] for model in apps.get_models(): ...
mit
6,105,422,011,354,093,000
36.34375
99
0.467808
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/ipv4_external_reachability/prefixes/prefixes_/__init__.py
1
42200
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
-214,556,804,422,065,730
41.157842
402
0.593128
false
Thraxis/pymedusa
sickbeard/server/web/config/notifications.py
1
17493
# coding=utf-8 """ Configure notifications """ from __future__ import unicode_literals import os from tornado.routes import route import sickbeard from sickbeard import ( config, logger, ui, ) from sickrage.helper.common import try_int from sickrage.helper.encoding import ek from sickbeard.server.web.core import...
gpl-3.0
-4,339,851,400,314,656,300
64.02974
154
0.694449
false
poliastro/poliastro
tests/test_bodies.py
1
2126
import pytest from astropy import units as u from astropy.tests.helper import assert_quantity_allclose from poliastro.bodies import Body, Earth, Jupiter, Sun def test_body_has_k_given_in_constructor(): k = 3.98e5 * u.km ** 3 / u.s ** 2 earth = Body(None, k, "") assert earth.k == k def test_body_from_pa...
mit
3,506,300,801,196,985,300
26.61039
108
0.61571
false
lferr/charm
charm/test/schemes/dabenc_test.py
1
3191
from charm.schemes.dabe_aw11 import Dabe from charm.adapters.dabenc_adapt_hybrid import HybridABEncMA from charm.toolbox.pairinggroup import PairingGroup, GT import unittest debug = False class DabeTest(unittest.TestCase): def testDabe(self): groupObj = PairingGroup('SS512') dabe = Dabe(groupObj)...
lgpl-3.0
3,195,663,149,788,621,300
36.104651
88
0.587277
false
ahmetcemturan/SFACT
skeinforge_application/skeinforge_plugins/craft_plugins/limit.py
1
8282
#! /usr/bin/env python """ This page is in the table of contents. This plugin limits the feed rate of the tool head, so that the stepper motors are not driven too fast and skip steps. The limit manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Limit The maximum z feed rate is defined in speed...
agpl-3.0
246,727,834,341,910,940
40
180
0.781574
false
mfnch/pyrtist
old/web/in/examples/create_example.py
1
2754
import sys, os, os.path, commands, re usage = "USAGE: python create_example.py box.example" if len(sys.argv) != 2: raise "Expected one argument.\n" + usage example_file = sys.argv[1] print "Working on '%s'..." % example_file # Default values for variables which may be changed inside example_file in_directory = "....
lgpl-2.1
1,265,988,056,238,007,300
24.738318
86
0.649601
false
pelodelfuego/word2vec-toolbox
toolbox/cpLib/test/testConcept.py
1
2049
#!/usr/bin/env python # encoding: utf-8 import unittest import cpLib.concept as cp import cpLib.conceptDB as db import numpy as np class ConceptTest(unittest.TestCase): def setUp(self): self.d = db.DB('../data/voc/npy/googleNews_mini.npy') def test_transform(self): k = self.d.get('king') ...
gpl-3.0
1,787,303,736,457,299,700
26.32
75
0.561249
false
tkwon/dj-stripe
djstripe/migrations/0025_auto_20170322_0428.py
1
3906
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-22 04:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djstripe', '0024_auto_20170308_0757'), ] operations = [ migrations.AlterFie...
mit
8,493,379,797,407,598,000
30.248
58
0.536354
false
eqcorrscan/ci.testing
eqcorrscan/utils/stacking.py
1
6254
""" Utility module of the EQcorrscan package to allow for different methods of \ stacking of seismic signal in one place. :copyright: EQcorrscan developers. :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html) """ from __future__ import absolute_import from __f...
lgpl-3.0
6,233,989,075,923,252,000
35.573099
79
0.624081
false
gspilio/nova
nova/network/quantumv2/api.py
1
41934
# Copyright 2012 OpenStack Foundation # All Rights Reserved # Copyright (c) 2012 NEC 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/lic...
apache-2.0
8,649,179,692,638,891,000
43.374603
79
0.563147
false
Chealion/yycbike
archive/weatherLoad.py
1
6271
#! /usr/bin/python # :set tabstop=4 shiftwidth=4 expandtab # Downoads Environment Canada data and sends the data to Graphite. Additionally logs the data to a file we can use to import later import csv import time import graphitesend import urllib2 from datetime import date, timedelta import datetime graphitesend.ini...
mit
2,237,672,961,989,469,700
39.986928
346
0.635784
false
Ziqi-Li/bknqgis
bokeh/bokeh/server/server.py
1
10467
''' Provides a Server which instantiates Application instances as clients connect ''' from __future__ import absolute_import, print_function import atexit import logging log = logging.getLogger(__name__) import signal import tornado from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tor...
gpl-2.0
7,007,244,162,705,073,000
35.217993
129
0.572179
false
jelly/calibre
src/calibre/db/cli/cmd_catalog.py
2
3866
#!/usr/bin/env python2 # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net> from __future__ import absolute_import, division, print_function, unicode_literals import os from calibre.customize.ui import available_catalog_formats, plugin_for_catalog_format from calibre.db.cl...
gpl-3.0
3,301,390,566,288,786,000
28.51145
85
0.579152
false
geotagx/geotagx-pybossa-archive
pybossa/auth/task.py
1
1535
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa 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...
agpl-3.0
-5,745,328,043,428,878,000
29.098039
77
0.683388
false
MasterGowen/moonrain
moonrain/accounts/models.py
1
2939
from django.db import models from django.contrib.auth.models import BaseUserManager, AbstractBaseUser from ..projects.models import Project class UserManager(BaseUserManager): def create_user(self, email, username, password=None): if not email: raise ValueError('Необходимо ввести электронный а...
gpl-2.0
7,740,447,189,795,986,000
23.070796
93
0.573005
false
agaveapi/SC17-container-tutorial
content/images/jupyter/examples/setvars.py
1
2421
# Here we define some utility commands to simplify interaction with the shell. # You don't need to read or understand this, but it's here in case you want to. import re import os def repvar(v): """ repvar() is short for "Replace Variables." The idea is that this function looks for strings of the form $VAR o...
bsd-3-clause
6,554,591,777,941,709,000
31.28
80
0.523337
false
heromod/migrid
mig/shared/functionality/migadmin.py
1
14406
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # migadmin - admin control panel with daemon status monitor # Copyright (C) 2003-2015 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
gpl-2.0
4,921,689,031,362,691,000
38.253406
87
0.543801
false
Tilo15/PhotoFiddle2
PF2/Tools/HueEqualiser.py
1
5526
import cv2 import numpy import Tool class HueEqualiser(Tool.Tool): def on_init(self): self.id = "hueequaliser" self.name = "Hue Equaliser" self.icon_path = "ui/PF2_Icons/HueEqualiser.png" self.properties = [ Tool.Property("header", "Hue Equaliser", "Header", None, has_t...
gpl-3.0
7,938,162,124,587,179,000
35.361842
136
0.500181
false
OCA/sale-workflow
sale_product_set/wizard/product_set_add.py
1
3428
# Copyright 2015 Anybox S.A.S # Copyright 2016-2018 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, exceptions, _ import odoo.addons.decimal_precision as dp class ProductSetAdd(models.TransientModel): _name = 'product.set.add' _rec_name ...
agpl-3.0
4,705,311,278,881,153,000
34.340206
74
0.574096
false
wolfelee/luokr.com
www.luokr.com/app/ctrls/admin/posts.py
1
10035
#coding=utf-8 from admin import admin, AdminCtrl class Admin_PostsCtrl(AdminCtrl): @admin def get(self): pager = {} pager['qnty'] = min(int(self.input('qnty', 10)), 50) pager['page'] = max(int(self.input('page', 1)), 1) pager['list'] = 0; cur_posts = self.dbase('posts'...
bsd-3-clause
-2,849,066,017,734,671,000
38.519841
252
0.520835
false
Telestream/telestream-cloud-python-sdk
telestream_cloud_notifications_sdk/test/test_params.py
1
1740
# coding: utf-8 """ Notifications API Notifications # noqa: E501 The version of the OpenAPI document: 2.1.0 Contact: cloudsupport@telestream.net Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetime import telestream_cloud_not...
mit
7,053,314,102,232,006,000
25.769231
85
0.556322
false
ppqm/fitting
fitter/fit.py
1
9239
import sklearn import sklearn.model_selection import time import itertools import functools import multiprocessing as mp import os import subprocess import time import copy import json import numpy as np import pandas as pd from numpy.linalg import norm from scipy.optimize import minimize import rmsd import joblib ...
cc0-1.0
-4,809,500,087,798,806,000
22.997403
122
0.603312
false
advancedplotting/aplot
python/plotserv/api_annotations.py
1
8009
# Copyright (c) 2014-2015, Heliosphere Research LLC # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of c...
bsd-3-clause
3,550,723,003,300,049,000
25.611296
77
0.558122
false
henriquegemignani/randovania
randovania/gui/main_window.py
1
25113
import functools import json import logging import os import platform import subprocess from functools import partial from pathlib import Path from typing import Optional, List from PySide2 import QtCore, QtWidgets, QtGui from PySide2.QtCore import QUrl, Signal, Qt from qasync import asyncSlot from randovania import ...
gpl-3.0
-1,612,572,667,298,678,800
44.330325
118
0.669454
false
maltsev/LatexWebOffice
app/views/document.py
1
15983
# -*- coding: utf-8 -*- """ * Purpose : Dokument- und Projektverwaltung Schnittstelle * Creation Date : 19-11-2014 * Last Modified : Di 24 Feb 2015 15:46:51 CET * Author : mattis * Coauthors : christian, ingo, Kirill * Sprintnumber : 2, 5 * Backlog entry : TEK1, 3ED9, DOK8, DO14, KOL1 """ import os from djang...
gpl-3.0
953,337,725,685,583,200
42.63388
136
0.568503
false
psyonara/agonizomai
sermons/models.py
1
5153
from __future__ import unicode_literals from django.db import models from django.template.defaultfilters import slugify from bible.models import BibleBook from useraccounts.models import UserAccount class Author(models.Model): name = models.CharField(null=False, blank=False, max_length=50) name_slug = model...
mit
-3,994,879,931,140,667,400
39.896825
100
0.663497
false
funshine/rpidemo
mqtt_oled/oled_test_luma.py
1
1273
#!/usr/bin/python/ # coding: utf-8 import time import datetime from luma.core.interface.serial import i2c, spi from luma.core.render import canvas from luma.oled.device import ssd1306, ssd1325, ssd1331, sh1106 def do_nothing(obj): pass # rev.1 users set port=0 # substitute spi(device=0, port=0) below if using t...
mit
2,993,683,248,832,655,000
23.018868
70
0.671642
false
jantman/nagios-scripts
check_icinga_ido.py
1
6939
#!/usr/bin/env python """ Script to check last update of core programstatus and service checks in Icinga ido2db Postgres database """ # # The latest version of this script lives at: # <https://github.com/jantman/nagios-scripts/blob/master/check_puppetdb_agent_run.py> # # Please file bug/feature requests and submit pat...
gpl-3.0
4,422,069,438,603,399,000
41.833333
222
0.608157
false
3DLIRIOUS/BlendSCAD
examples/example014.scad.py
1
1763
# OpenSCAD example, ported by Michael Mlivoncic # a beautiful dice... # an interesting test case, to get the Boolean operations somehow fixed (TODO) #import sys #sys.path.append("O:/BlenderStuff") import blendscad #import imp #imp.reload(blendscad) #imp.reload(blendscad.core) #imp.reload(blendscad.primitives) ...
gpl-3.0
-6,193,139,217,817,806,000
26.546875
131
0.614861
false
stackunderflow-stackptr/stackptr_web
crossbarconnect/client.py
1
8527
############################################################################### ## ## Copyright (C) 2012-2014 Tavendo GmbH ## ## 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 ## #...
agpl-3.0
3,583,649,226,256,367,000
32.108
126
0.587194
false
VahidooX/DeepCCA
objectives.py
1
2281
import theano.tensor as T def cca_loss(outdim_size, use_all_singular_values): """ The main loss function (inner_cca_objective) is wrapped in this function due to the constraints imposed by Keras on objective functions """ def inner_cca_objective(y_true, y_pred): """ It is the loss ...
mit
6,360,399,072,148,163,000
34.640625
108
0.562034
false
openstack/ironic
ironic/common/release_mappings.py
1
12857
# Copyright 2016 Intel 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 agr...
apache-2.0
-6,038,370,052,262,682,000
30.435208
79
0.442327
false
childresslab/MicrocavityExp1
gui/manager/managergui.py
1
25022
# -*- coding: utf-8 -*- """ This module contains a GUI through which the Manager core class can be controlled. It can load and reload modules, show the configuration, and re-open closed windows. Qudi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publish...
gpl-3.0
-612,792,644,216,739,500
37.975078
127
0.622812
false
googleads/googleads-python-lib
examples/ad_manager/v202011/activity_group_service/get_active_activity_groups.py
1
1957
#!/usr/bin/env python # # Copyright 2016 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 requir...
apache-2.0
721,227,215,421,250,300
36.634615
74
0.709249
false
macioosch/dynamo-hard-spheres-sim
convergence-plot.py
1
6346
#!/usr/bin/env python2 # encoding=utf-8 from __future__ import division, print_function from glob import glob from itertools import izip from matplotlib import pyplot as plt import numpy as np input_files = glob("csv/convergence-256000-0.*.csv") #input_files = glob("csv/convergence-500000-0.*.csv") #input_files = glo...
gpl-3.0
1,205,206,185,801,680,600
39.941935
101
0.601954
false
amdouglas/OpenPNM
OpenPNM/Geometry/models/throat_misc.py
1
1124
r""" =============================================================================== throat_misc -- Miscillaneous and generic functions to apply to throats =============================================================================== """ import scipy as _sp def random(geometry, seed=None, num_range=[0, 1], **kwar...
mit
7,511,632,487,340,780,000
30.222222
79
0.536477
false
Digmaster/TicTacToe
Agent.py
1
2030
from random import randint from random import getrandbits from copy import deepcopy # Agent that will either be the human player or a secondary agent for the dual agent play class DumbAgent: #initialize the board for the first player def __init__(self, board): self.board = board def __str__(self): return "Hi, ...
apache-2.0
287,197,937,694,822,820
25.363636
132
0.666995
false
mfit/PdfTableAnnotator
script/csv-compare.py
1
8051
""" Copyright 2014 Matthias Frey 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 i...
apache-2.0
-7,229,538,163,487,513,000
29.044776
101
0.527264
false
3dfxmadscientist/odoo-infrastructure
addons/infrastructure/hostname.py
1
1468
# -*- coding: utf-8 -*- ############################################################################## # # Infrastructure # Copyright (C) 2014 Ingenieria ADHOC # No email # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License...
agpl-3.0
2,010,866,711,856,777,500
27.784314
115
0.608311
false
locke105/mclib
examples/wsgi.py
1
1781
import cgi import json from wsgiref import simple_server import falcon from mclib import mc_info class MCInfo(object): def on_get(self, req, resp): host = req.get_param('host', required=True) port = req.get_param_as_int('port', min=1024, max=65565) ...
apache-2.0
4,936,456,139,620,774,000
21.2625
77
0.521617
false
Meertecha/LearnPythonTheGame
pyGameEngine.py
1
3565
### Imports import pickle, os, platform, random ### Functions def main(): curPlayer = loadPlayer( 'Tory' ) curGame = loadGame( 'Python_Tutorial' ) startGame(curPlayer, curGame) def banner(): ''' if platform.system() == "Windows": clearCmd = "cls" elif platform.system() == "Linux": clearCmd = "clear" ...
mit
4,891,151,655,040,956,000
31.409091
133
0.615708
false