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
town-hall-pinball/project-omega
tests/machine/test_playfield.py
1
2243
# Copyright (c) 2014 - 2016 townhallpinball.org # # 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, p...
mit
6,205,678,714,841,098,000
31.507246
77
0.670085
false
umlfri/umlfri2
umlfri2/qtgui/base/contextmenu.py
1
1680
from functools import partial from PyQt5.QtGui import QIcon, QKeySequence from PyQt5.QtWidgets import QMenu, QAction from umlfri2.application import Application from umlfri2.qtgui.base import image_loader class ContextMenu(QMenu): def _add_menu_item(self, icon, label, shortcut, action=None, sub_menu=None): ...
gpl-3.0
3,216,306,957,850,884,000
28.473684
93
0.591667
false
piotrmaslanka/satella
tests/test_coding/test_monitor.py
1
5062
import unittest from queue import Queue from threading import Thread from time import sleep from satella.coding import Monitor class MonitorTest(unittest.TestCase): def test_synchronize_on(self): class TestedMasterClass(Monitor): def __init__(self): self.value = 0 ...
bsd-3-clause
3,409,629,692,295,850,500
26.069519
56
0.467404
false
JJMinton/conferenceTimer
file_change_handler.py
1
2937
import path import asyncio from datetime import datetime, timedelta from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler from read_schedule import read_schedule import config from config import logging class FileChangeHandler(PatternMatchingEventHandler): def __init__(s...
gpl-3.0
-4,415,477,771,282,434,000
39.232877
217
0.688798
false
FNST-OpenStack/cloudkitty
cloudkitty/tenant_fetcher/__init__.py
1
1212
# -*- coding: utf-8 -*- # !/usr/bin/env python # Copyright 2015 Objectif Libre # # 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 ...
apache-2.0
2,087,861,238,708,588,500
27.833333
78
0.69199
false
HPI-SWA-Lab/RSqueak
rsqueakvm/test/test_socket_primitives.py
1
6424
import py import time from rsqueakvm import constants from rsqueakvm.model.compiled_methods import W_PreSpurCompiledMethod from rsqueakvm.model.variable import W_BytesObject from rsqueakvm.primitives import prim_table from rsqueakvm.primitives.constants import EXTERNAL_CALL from rsqueakvm.error import PrimitiveFailedE...
bsd-3-clause
-5,544,249,213,781,126,000
43.611111
108
0.669988
false
mlabru/ptracks
view/piloto/dlg_aproximacao_ui.py
1
2854
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './dlg_aproximacao.ui' # # Created: Tue Dec 6 11:23:22 2016 # by: PyQt4 UI code generator 4.11.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 exc...
gpl-3.0
-5,954,425,699,437,925,000
46.5
116
0.72386
false
matthieu-meaux/DLLM
examples/Wrapper_Multipoint/test_multipoint_analysis_AoA.py
1
2570
# -*-mode: python; py-indent-offset: 4; tab-width: 8; coding: iso-8859-1 -*- # DLLM (non-linear Differentiated Lifting Line Model, open source software) # # Copyright (C) 2013-2015 Airbus Group SAS # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Pub...
gpl-2.0
-4,441,377,056,161,138,000
34.694444
82
0.739689
false
sharad/calibre
src/calibre/gui2/dialogs/confirm_delete_location.py
1
1511
#!/usr/bin/env python __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' \ '2010, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' from functools import partial from calibre.gui2.dialogs.confirm_delete_location_ui import Ui_Dialog from PyQt5.Q...
gpl-3.0
-5,930,206,761,042,180,000
28.627451
74
0.606883
false
neiljdo/readysaster-icannhas-web
readysaster-icannhas-web/users/views.py
1
2241
# -*- coding: utf-8 -*- # Import the reverse lookup function from django.core.urlresolvers import reverse # view imports from django.views.generic import DetailView from django.views.generic import RedirectView from django.views.generic import UpdateView from django.views.generic import ListView # Only authenticated ...
bsd-3-clause
-6,875,853,870,313,985,000
28.103896
80
0.707274
false
SKIRT/PTS
magic/plot/imagegrid.py
1
106384
# -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ## \package pts.magic.pl...
agpl-3.0
52,418,295,662,389,330
28.47714
192
0.500916
false
glamp/coffe2py
main.py
1
1282
import sys from IPython.core.interactiveshell import InteractiveShell import pandasjson as json import StringIO if __name__=="__main__": mode = "ipython" line = sys.stdin.readline() shell = InteractiveShell() while line: # explicitly write to stdout sys.stdout.write(line) sys.st...
bsd-2-clause
5,789,231,768,680,157,000
30.292683
58
0.522621
false
capntransit/carfree-council
cfcensus2010.py
1
1828
import sys, os, json, time import pandas as pd BOROCODE = {'61' : '1', '05' : '2', '47': '3', '81' : '4', '85': '5'} if (len(sys.argv) < 2): print ("Usage: cfcensus.py census.csv districts.json") exit() censusfile = sys.argv[1] councilfile = sys.argv[2] TRACTCOL = 'BoroCT' # rename this for 2000 census ...
gpl-3.0
7,753,463,791,986,384,000
26.283582
98
0.555252
false
eharney/cinder
cinder/scheduler/filters/capacity_filter.py
1
8982
# Copyright (c) 2012 Intel # Copyright (c) 2012 OpenStack Foundation # Copyright (c) 2015 EMC Corporation # # 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
4,721,007,963,419,278,000
46.273684
79
0.560009
false
mganeva/mantid
Framework/PythonInterface/test/python/plugins/algorithms/GetNegMuMuonicXRDTest.py
1
7298
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
6,650,701,605,140,535,000
50.394366
111
0.65744
false
vorushin/FamilyFeed
sources/facebook.py
1
1748
from datetime import datetime import json from urllib2 import urlopen, HTTPError from django.db.models import Max from sources.models import FacebookPost def time(s): return datetime.strptime(s, '%Y-%m-%dT%H:%M:%S+0000') def post_text(item): return item.get('message', u'') + item.get('description', u'') de...
mit
-6,442,804,977,084,851,000
33.96
76
0.57151
false
bytedance/fedlearner
web_console_v2/api/test/fedlearner_webconsole/utils/file_manager_test.py
1
9062
# Copyright 2021 The FedLearner Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-8,069,600,054,312,134,000
36.446281
88
0.550541
false
Phixyn/ZoeyBot
modules/utils.py
1
1119
""" utils.py - Utilities module ZoeyBot - Python IRC Bot Copyright 2012-2014 (c) Phixyn This file is part of ZoeyBot. ZoeyBot 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 ...
gpl-3.0
1,913,154,595,719,887,000
25.023256
68
0.726542
false
doraemonext/DEOnlineJudge
lib/tools/validator.py
1
1501
# -*- coding: utf-8 -*- import re from django.core.validators import validate_email from django.core.exceptions import ValidationError class MinValue(object): """ 最小长度验证 """ def __init__(self, name, length): self.name = name self.length = length def __call__(self, value, *args, ...
mit
8,311,261,738,640,830,000
21.683333
77
0.563556
false
vhaupert/mitmproxy
mitmproxy/proxy/config.py
1
3244
import os import re import typing from OpenSSL import crypto from mitmproxy import certs from mitmproxy import exceptions from mitmproxy import options as moptions from mitmproxy.net import server_spec class HostMatcher: def __init__(self, handle, patterns=tuple()): self.handle = handle self.pat...
mit
2,039,066,290,307,979,000
35.044444
90
0.589704
false
jjo31/ATHAM-Fluidity
python/fluidity/microphysics/FortranMicrophysicsWrapper.py
1
4818
import os path=os.path.dirname(__file__) def MakeWrapperFiles(field_dict,call_str,pointwise): write_to_file(field_dict,call_str,pointwise) def allocate_str(field_dict): s=""" subroutine allocate_storage(number_of_tracers,n) integer :: n !f2py integer, intent(hide), depend(number_of_tracers) :: n=shape(n...
lgpl-2.1
37,133,814,416,774,880
32.458333
100
0.545247
false
CartoDB/cartoframes
cartoframes/io/managers/context_manager.py
1
22518
import time import pandas as pd from warnings import warn from carto.auth import APIKeyAuthClient from carto.datasets import DatasetManager from carto.exceptions import CartoException, CartoRateLimitException from carto.sql import SQLClient, BatchSQLClient, CopySQLClient from pyrestcli.exceptions import NotFoundExce...
bsd-3-clause
-1,297,629,793,458,669,800
39.282648
120
0.60445
false
hwjworld/xiaodun-platform
lms/djangoapps/wechat/views.py
1
47459
import logging import urllib from collections import defaultdict from lxml import html from django.conf import settings from django.core.context_processors import csrf from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.contrib.auth.models import User, Anonymo...
agpl-3.0
-126,619,783,822,553,040
38.616027
133
0.61276
false
google/deepvariant
deepvariant/make_examples_test.py
1
90136
# Copyright 2020 Google LLC. # # 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 conditions and the following disclaimer. # #...
bsd-3-clause
5,773,336,491,472,342,000
40.289968
84
0.63676
false
mancoast/CPythonPyc_test
cpython/223_test_descr.py
1
90901
# Test enhancements related to descriptors and new-style classes from test_support import verify, vereq, verbose, TestFailed, TESTFN, get_original_stdout from copy import deepcopy import warnings warnings.filterwarnings("ignore", r'complex divmod\(\), // and % are deprecated$', DeprecationWarning, r...
gpl-3.0
2,229,904,655,857,334,500
26.952337
88
0.503284
false
sthyme/ZFSchizophrenia
BehaviorAnalysis/Alternative_Analyses/Correlation_between_genes/correlations_DISTANCE_betweengenes.py
1
5605
import matplotlib matplotlib.use('Agg') import matplotlib.pylab as plt import matplotlib.colors as mat_col from matplotlib.colors import LinearSegmentedColormap import scipy import scipy.cluster.hierarchy as sch from scipy.cluster.hierarchy import set_link_color_palette import numpy as np import pandas as pd import glo...
mit
5,382,613,263,176,340,000
28.192708
97
0.693666
false
sillvan/hyperspy
hyperspy/drawing/_markers/horizontal_line_segment.py
1
3320
# -*- coding: utf-8 -*- # Copyright 2007-2011 The Hyperspy developers # # This file is part of Hyperspy. # # Hyperspy 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...
gpl-3.0
-754,029,751,437,374,500
33.947368
78
0.614157
false
giacomov/lclike
lclike/duration_computation.py
1
12141
__author__ = 'giacomov' # !/usr/bin/env python # add |^| to the top line to run the script without needing 'python' to run it at cmd # importing modules1 import numpy as np # cant use 'show' inside the farm import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib import gridspec imp...
bsd-3-clause
-413,746,837,952,500,500
35.459459
205
0.567581
false
alingse/jsoncsv
jsoncsv/dumptool.py
1
3539
# coding=utf-8 # author@alingse # 2015.10.09 import json import unicodecsv as csv import xlwt class Dump(object): def __init__(self, fin, fout, **kwargs): self.fin = fin self.fout = fout self.initialize(**kwargs) def initialize(self, **kwargs): pass def prepare(self): ...
apache-2.0
5,747,975,556,471,629,000
22.912162
71
0.552133
false
DailyActie/Surrogate-Model
01-codes/OpenMDAO-Framework-dev/examples/openmdao.examples.bar3simulation/openmdao/examples/bar3simulation/bar3_optimization.py
1
4444
""" bar3_optimization.py - Top level assembly for the example problem. """ # Optimize the bar3 design using the CONMIN optimizer. # pylint: disable-msg=E0611,F0401 from openmdao.lib.drivers.api import CONMINdriver from openmdao.main.api import Assembly from openmdao.main.datatypes.api import Float # from openmda...
mit
6,631,293,098,315,025,000
36.982906
87
0.560981
false
hall1467/wikidata_usage_tracking
python_analysis_scripts/edit_analyses/session_stats.py
1
2861
""" Selects number of distinct revisions. Usage: session_stats (-h|--help) session_stats <input> <output> [--debug] [--verbose] Options: -h, --help This help message is printed <input> Path to input file to process. <output> Where output will be writte...
mit
18,738,158,364,081,736
26.509615
79
0.606082
false
StevenCHowell/code_sas_modeling
sas_modeling/calc_i0.py
1
13051
#!/usr/bin/env python # coding:utf-8 ''' Author: Steven C. Howell --<steven.howell@nist.gov> Purpose: calculating the Guinier fit Created: 12/21/2016 00000000011111111112222222222333333333344444444445555555555666666666677777777778 123456789012345678901234567890123456789012345678901234567890123456789012345...
gpl-3.0
3,665,040,384,251,789,300
27.567982
81
0.555231
false
tijme/not-your-average-web-crawler
test/test_helpers_url_helper.py
1
5609
# -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2017 Tijme Gommers # # 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...
mit
-6,238,477,947,585,220,000
35.660131
95
0.573721
false
SeedScientific/polio
source_data/migrations/0053_auto__chg_field_sourcedatapoint_error_msg.py
1
71250
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'SourceDataPoint.error_msg' db.alter_column(u'source_da...
agpl-3.0
1,803,691,983,139,624,700
91.055556
195
0.568393
false
RandyMoore/mySiteDjango
my_site_django/weblog/models.py
1
3693
from django.db import models from django.db.models.fields import CharField from django.utils.safestring import mark_safe from markdown import markdown from pygments import highlight from pygments.formatters import get_formatter_by_name from pygments.lexers import get_lexer_by_name from wagtail.core import blocks fro...
gpl-3.0
-1,130,170,314,572,524,900
27.19084
151
0.629299
false
brianchoate/chef2ldif
setup.py
1
1553
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace('.. :changelog:', ...
bsd-3-clause
3,532,986,478,273,784,000
26.245614
82
0.618158
false
citrix-openstack-build/neutron-vpnaas
neutron_vpnaas/db/vpn/vpn_db.py
1
31697
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
1,094,159,555,559,583,400
46.23845
79
0.562482
false
LiveChains/Live-Coin
contrib/spendfrom/spendfrom.py
1
10087
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a livecoind or Li...
mit
6,781,185,291,713,153,000
36.779026
111
0.621096
false
Hiestaa/RLViz
src/problems/base.py
1
6050
# -*- coding: utf8 -*- from __future__ import unicode_literals import logging logger = logging.getLogger(__name__) import gym from parametizable import Parametizable from consts import ParamsTypes, Spaces class ProblemException(Exception): pass class BaseProblem(Parametizable): """ Mostly a wrapper a...
mit
-6,629,210,410,368,838,000
31.180851
80
0.629421
false
JNRowe/cupage
setup.py
1
2052
#! /usr/bin/env python3 """setup.py - Setuptools tasks and config for cupage.""" # Copyright © 2009-2014 James Rowe <jnrowe@gmail.com> # # SPDX-License-Identifier: GPL-3.0-or-later # # This program 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
-2,699,607,000,304,151,600
30.461538
78
0.669927
false
blabla1337/skf-flask
skf/rabbit_mq_workers/deletion-worker.py
1
3009
#!/usr/bin/env python import pika, time, random, yaml from os import path from skf import settings from kubernetes import client, config creds = pika.PlainCredentials('admin', 'admin-skf-secret') connection = pika.BlockingConnection(pika.ConnectionParameters(host=settings.RABBIT_MQ_CONN_STRING, credentials=creds)) cha...
agpl-3.0
8,975,749,133,928,293,000
34.833333
119
0.648721
false
google-research/social_cascades
news/graph_processing.py
1
1943
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-6,876,329,124,565,391,000
33.087719
76
0.705095
false
euroscipy/www.euroscipy.org
papercall_grabbing.py
1
4306
""" Functions to grab info from papercall.io """ import os import time import requests token = 'your_papercall_token' # ,<-- fill this in THIS_DIR = os.path.abspath(os.path.dirname(__file__)) des_template = """ Title: {title} URL: 2017/descriptions/{id}.html save_as: 2017/descriptions/{id}.html {description} """....
mit
2,127,778,262,498,097,200
33.448
94
0.571064
false
lmazuel/azure-sdk-for-python
azure-mgmt-batchai/azure/mgmt/batchai/operations/file_servers_operations.py
1
22642
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-3,045,874,100,569,090,000
47.072187
156
0.639122
false
GoogleChrome/chromium-dashboard
internals/processes_test.py
1
9385
from __future__ import division from __future__ import print_function # Copyright 2020 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/LICEN...
apache-2.0
7,072,356,655,839,198,000
37.946058
79
0.686841
false
roopeshsivam/certify
certificates/CreateCertView.py
1
5826
from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth import logout as django_logout from django.shortcuts import redirect, render, get_object_or_404 from django.contrib.auth.decorators import login_required from django.views import generic from django.utils.decorators import method_decora...
gpl-3.0
-462,516,706,902,927,000
44.170543
108
0.659286
false
diN0bot/ProcrasDonate
lib/html_emailer.py
1
1392
import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import settings def send_email(sender, recipient, subject, text, html): if settings.DJANGO_SERVER: print "="*60 print "FROM:", sender print "TO:", recipient print "SUBJECT:", subject...
agpl-3.0
2,829,949,119,464,530,000
35.631579
84
0.600575
false
JING-TIME/ustc-course
tests/resize_avatar.py
1
1146
#!/usr/bin/env python3 import sys sys.path.append('..') # fix import directory from app import app from app.models import User from PIL import Image from app.utils import rand_str ctx = app.test_request_context() ctx.push() users = User.query.all() for u in users: if u._avatar: with Image.open('../uploa...
agpl-3.0
-4,566,116,130,143,257,000
35.967742
102
0.576789
false
prechelt/pyth
pyth/__init__.py
1
1207
""" Pyth -- Python text markup and conversion """ from __future__ import absolute_import import os.path __version__ = '0.5.6' writerMap = { '.rtf': 'pyth.plugins.rtf15.writer.Rtf15Writer', '.html': 'pyth.plugins.xhtml.writer.XHTMLWriter', '.xhtml': 'pyth.plugins.xhtml.writer.XHTMLWriter', '.txt': 'py...
mit
-6,107,775,287,688,249,000
21.351852
60
0.624689
false
jonnyhtw/cylc
lib/cylc/batch_sys_manager.py
1
33030
#!/usr/bin/env python # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2018 NIWA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
gpl-3.0
4,543,488,674,901,808,600
42.232984
79
0.550893
false
jhseu/tensorflow
tensorflow/python/kernel_tests/random/stateless_random_ops_test.py
1
7104
# 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
-5,237,965,412,197,628,000
38.910112
80
0.642596
false
polysquare/polysquare-ci-scripts
setup.py
1
1485
# /setup.py # # Installation and setup script for polysquare-ci-scripts # # See /LICENCE.md for Copyright information """Installation and setup script for polysquare-ci-scripts.""" from setuptools import (find_packages, setup) setup(name="polysquare-ci-scripts", version="0.0.1", description="Polysquare Co...
mit
-5,243,586,838,271,640,000
38.078947
66
0.577778
false
aonotas/chainer
chainer/links/model/classifier.py
1
4579
from chainer.functions.evaluation import accuracy from chainer.functions.loss import softmax_cross_entropy from chainer import link from chainer import reporter class Classifier(link.Chain): """A simple classifier model. This is an example of chain that wraps another chain. It computes the loss and accu...
mit
4,334,894,875,054,640,600
37.158333
78
0.591832
false
voc/voctomix
vocto/composites.py
1
12816
#!/usr/bin/env python3 # for debug logging import logging # use Frame from vocto.frame import Frame, X, Y, L, T, R, B # for cloning objects import copy # for parsing configuration items import re log = logging.getLogger('Composites') class Composites: """ a namespace for composite related methods """ de...
mit
-1,553,340,667,530,149,400
33.920981
176
0.504448
false
mahmoud/wapiti
wapiti/operations/utils.py
1
12249
# -*- coding: utf-8 -*- import sys from heapq import heappush, heappop import itertools from functools import total_ordering def is_scalar(obj): return not hasattr(obj, '__iter__') or isinstance(obj, basestring) def prefixed(arg, prefix=None): if prefix and not arg.startswith(prefix): arg = prefix ...
bsd-3-clause
6,357,164,023,130,465,000
28.236277
79
0.5478
false
monuszko/django-anothercrm
anothercrm/models.py
1
5607
from django.db import models from django.utils.translation import ugettext_lazy as _ class Person(models.Model): SEX_CHOICES = ( ('M', 'Male'), ('F', 'Female'), ) #TODO: validators for name, mobile... firstname = models.CharField(max_length=30) lastname = models.Cha...
agpl-3.0
7,618,149,162,945,209,000
34.713376
79
0.588193
false
jaeilepp/eggie
mne/viz/_3d.py
1
24122
"""Functions to make 3D plots with M/EEG data """ from __future__ import print_function # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # ...
bsd-2-clause
3,978,885,979,952,764,000
36.053763
79
0.576652
false
jamespcole/home-assistant
homeassistant/components/arlo/alarm_control_panel.py
1
4381
"""Support for Arlo Alarm Control Panels.""" import logging import voluptuous as vol from homeassistant.components.alarm_control_panel import ( PLATFORM_SCHEMA, AlarmControlPanel) from homeassistant.const import ( ATTR_ATTRIBUTION, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, S...
apache-2.0
8,865,541,382,343,930,000
31.213235
78
0.640037
false
google/physical-web
web-service/handlers.py
1
3651
#!/usr/bin/env python # # Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
3,967,501,291,462,436,400
31.026316
107
0.539852
false
sacharya/nova
nova/virt/baremetal/base.py
1
2612
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011 University of Southern California / ISI # 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 obta...
apache-2.0
-3,919,610,494,057,842,000
29.372093
78
0.672282
false
bitmazk/django-user-tags
user_tags/tests/forms_tests.py
1
7599
"""Tests for the forms of the ``user_tags`` app.""" from django.test import TestCase from django.contrib.contenttypes.models import ContentType from django_libs.tests.factories import UserFactory from user_tags.tests.test_app.forms import DummyModelForm from user_tags.models import TaggedItem, UserTag, UserTagGroup ...
mit
2,542,328,559,561,466,000
35.185714
79
0.610607
false
Xonshiz/comic-dl
comic_dl/sites/readcomicOnlineli.py
1
7993
#!/usr/bin/env python # -*- coding: utf-8 -*- import globalFunctions import re import os import logging class ReadComicOnlineLi(object): def __init__(self, manga_url, download_directory, chapter_range, **kwargs): current_directory = kwargs.get("current_directory") conversion = kwargs.get("conver...
mit
6,136,911,422,190,837,000
47.150602
127
0.575378
false
zhiwehu/django-countries
countries/models.py
1
2033
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ class Country(models.Model): """ International Organization for Standardization (ISO) 3166-1 Country list * ``iso`` = ISO 3166-1 alpha-2 * ``name`` = Official country names used by...
bsd-3-clause
316,511,480,541,855,040
30.276923
80
0.689129
false
nils-wisiol/pypuf
pypuf/property_test/example.py
1
3649
"""This module is used to store some examples for the documentation""" from numpy import array, reshape from pypuf.simulation.arbiter_based.ltfarray import NoisyLTFArray from pypuf.property_test.base import PropertyTest from pypuf.tools import sample_inputs def main(): """This method is used to execute all exampl...
gpl-3.0
-5,675,355,466,002,031,000
33.752381
114
0.671691
false
LabAdvComp/dish
test/test_logging.py
1
2154
from IPython.parallel.error import CompositeError import os from nose.tools import assert_raises from .utils import assert_eventually_equal from .test_pipeline import PipelineTest class TestLogging(PipelineTest): def test_logging(self): """Test that logging information is propagated and stored ...
mit
5,790,359,276,004,510,000
42.08
85
0.577066
false
denverfoundation/storybase
apps/storybase_user/migrations/0006_auto__add_contact.py
1
14929
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Contact' db.create_table('storybase_user_contact', ( ('id', self.gf('django.db...
mit
-9,083,987,629,193,060,000
82.402235
268
0.557907
false
omaciel/mangonel
mangonel/system.py
1
2191
from common import * import datetime import json import sys import time try: from katello.client.api.system import SystemAPI except ImportError, e: print "Please install Katello CLI package." sys.exit(-1) class System(SystemAPI): def __init__(self): super(System, self).__init__() def c...
gpl-2.0
7,369,417,449,111,537,000
29.430556
134
0.591967
false
wujuguang/motor
test/tornado_tests/test_motor_web.py
1
9001
# Copyright 2012-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...
apache-2.0
-2,804,103,411,489,840,000
35.738776
79
0.631263
false
OmnesRes/pan_cancer
paper/figures/figure_1/bar_graphs/CESC.py
1
1883
##script for creating a histogram ## Load necessary modules import pylab as plt import numpy as np import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) f=open(os.path.join(BASE_DIR,'cox_regression','CESC','coeffs_normalized_pvalues_adjusted.txt')) data=[i.s...
mit
-5,518,581,456,476,088,000
29.868852
104
0.707913
false
jbzdarkid/HearthstonePro
Cards.py
1
13333
''' Special: "Anub'ar Ambusher" "Blood Warriors" "Burgly Bully" "Captain's Parrot" "Chromaggus" "Echo of Mediv" "Ethereal Peddler" "Flame Leviathan" "Getaway Kodo" "Gnomish Experimenter" "Headcrack" "Holy Wrath" "Ivory Knight" "Kazakus" "King's Elekk" "Krul the Unshackled" "Lock and Load" "Lorewalker Cho" "Sea Reaver" ...
apache-2.0
-6,323,426,377,481,312,000
48.199262
292
0.59769
false
lliendo/Radar
radar/network/monitor/select_monitor.py
1
1307
# -*- coding: utf-8 -*- """ This file is part of Radar. Radar 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 3 of the License, or (at your option) any later version. Radar is distributed ...
lgpl-3.0
4,419,965,365,318,617,000
32.512821
86
0.694721
false
WoLpH/dropbox
dropbox/util.py
1
1940
import os class AnalyzeFileObjBug(Exception): msg = ("\n" "Expected file object to have %d bytes, instead we read %d bytes.\n" "File size detection may have failed (see dropbox.util.AnalyzeFileObj)\n") def __init__(self, expected, actual): self.expected = expected self.a...
mit
5,704,691,118,987,827,000
33.642857
89
0.57732
false
asaolabs/python-lambda
aws_lambda/aws_lambda.py
1
25699
# -*- coding: utf-8 -*- from __future__ import print_function import hashlib import json import logging import os import sys import time from collections import defaultdict from imp import load_source from shutil import copy from shutil import copyfile from shutil import copystat from shutil import copytree from tempf...
isc
8,724,808,778,220,268,000
32.814474
120
0.613643
false
Rhoana/rh_aligner
old/filter_tiles.py
1
2329
# Takes a json file that contains many tiles with their bounding boxes (Tile-Spec format) # and a bounding box, and outputs a json file for each tile that is overlapping with the bounding box import sys import os import argparse import json from bounding_box import BoundingBox # common functions def load_tiles(ti...
mit
8,947,238,689,689,303,000
38.474576
149
0.660799
false
donovan-duplessis/pwnurl
docs/conf.py
1
8358
#!/usr/bin/env python # -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # au...
mit
6,714,855,766,473,701,000
31.15
80
0.707107
false
dunkhong/grr
grr/server/setup.py
1
7769
#!/usr/bin/env python """This is the setup.py file for the GRR client. This is just a meta-package which pulls in the minimal requirements to create a full grr server. """ from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import itertools import os import s...
apache-2.0
2,326,844,858,767,235,600
33.528889
80
0.65195
false
danijar/sets
sets/process/glove.py
1
1218
from zipfile import ZipFile import numpy as np from sets.core import Embedding class Glove(Embedding): """ The pretrained word embeddings from the Standford NLP group computed by the Glove model. From: http://nlp.stanford.edu/projects/glove/ """ URL = 'http://nlp.stanford.edu/data/glove.6B.zip' ...
mit
2,540,729,255,029,553,700
31.052632
79
0.591954
false
obnam-mirror/obnam
obnamlib/__init__.py
1
5952
# Copyright (C) 2009-2017 Lars Wirzenius # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distribu...
gpl-3.0
-1,614,306,495,632,513,000
25.690583
76
0.741263
false
sorenh/cc
nova/tests/network_unittest.py
1
5207
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
apache-2.0
-6,371,485,918,494,928,000
40.991935
83
0.620895
false
overfl0/Bulletproof-Arma-Launcher
src/utils/popupchain.py
1
2070
# Bulletproof Arma Launcher # Copyright (C) 2016 Lukasz Taczuk # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # b...
gpl-3.0
4,467,453,358,008,327,700
34.084746
80
0.643961
false
elffersj/cnfgen
cnfformula/families/graphisomorphism.py
1
4562
#!/usr/bin/env python # -*- coding:utf-8 -*- """Graph isomorphimsm/automorphism formulas """ from cnfformula.cnf import CNF from cnfformula.cmdline import SimpleGraphHelper from cnfformula.cmdline import register_cnfgen_subcommand from cnfformula.families import register_cnf_generator from cnfformula.graphs import ...
gpl-3.0
-2,192,167,595,266,328,300
25.994083
82
0.61815
false
lmb/Supermega
supermega/tests/test_session.py
1
2433
import unittest import hashlib import os import random from StringIO import StringIO from .. import Session, User, File, Directory from .. import errors USERNAME = os.environ.get('MEGA_USERNAME', None) PASSWORD = os.environ.get('MEGA_PASSWORD', None) def random_string(length): return (('%0'+str(length)+'x') % rando...
bsd-3-clause
-1,089,188,042,587,898,900
24.882979
91
0.731196
false
HRF92/myflask
foobar/app.py
1
1483
# -*- coding: utf-8 -*- '''The app module, containing the app factory function.''' from flask import Flask, render_template from foobar.settings import ProdConfig from foobar.assets import assets from foobar.extensions import ( bcrypt, cache, db, login_manager, migrate, debug_toolbar, ) from fo...
bsd-3-clause
4,648,757,970,010,366,000
25.482143
73
0.687795
false
veltzer/demos-python
src/examples/short/multi_processing/single_process.py
1
1245
#!/usr/bin/env python import fcntl import os import os.path import sys import time ''' This is an example of how to make sure only a single python process is running of a specific kind... References: - http://stackoverflow.com/questions/220525/ensure-a-single-instance-of-an-application-in-linux ''' do_fork = False ...
gpl-3.0
3,317,245,707,534,463,500
24.408163
95
0.648996
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/policy_forwarding/policies/policy/rules/rule/config/__init__.py
1
12349
# -*- 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
-7,797,545,819,435,877,000
37.114198
432
0.5662
false
tonysyu/deli
deli/layout/grid_layout.py
1
4491
""" Tick generator classes and helper functions for calculating axis tick-related values (i.e., bounds and intervals). """ import numpy as np from traits.api import (Array, HasStrictTraits, Instance, Property, cached_property) from .bounding_box import BoundingBox class BaseGridLayout(HasSt...
bsd-3-clause
4,950,409,187,474,593,000
32.266667
77
0.669784
false
dcneeme/droidcontroller
droidcontroller/uniscada.py
1
36234
# This Python file uses the following encoding: utf-8 # send and receive monitoring and control messages to from UniSCADA monitoring system # udp kuulamiseks thread? # neeme import time, datetime import sqlite3 import traceback from socket import * import sys import os import gzip import tarfile import requests impor...
gpl-3.0
1,857,257,954,211,608,300
41.280047
194
0.545951
false
exsodus3249/kite
src/back/tests/test_maildir.py
2
1429
import kite.maildir import unittest import types mockdata = {"from": {"address": "gerard", "name": ""}, "subject": "test", "contents": "empty", "to": "gerard", "date": "November 13, 2007"} class EmptyObject(object): """Empty class used by mocks. Required because python doesn't let us add attributes to an empt...
bsd-3-clause
-2,268,751,218,875,746,000
30.065217
139
0.614416
false
mauricioabreu/speakerfight
deck/models.py
1
12968
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.core.exceptions import ValidationError from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger fr...
mit
-5,524,374,505,757,374,000
32.683117
87
0.610117
false
thomas-bottesch/fcl
python/utils/create_pca_vectors_from_dataset.py
1
2284
from __future__ import print_function import fcl import os import time from os.path import abspath, join, dirname, isfile from fcl import kmeans from fcl.datasets import load_sector_dataset, load_usps_dataset from fcl.matrix.csr_matrix import get_csr_matrix_from_object, csr_matrix_to_libsvm_string from sklearn.decompos...
mit
1,100,592,844,665,426,300
45.612245
160
0.741243
false
credativUK/connector-magento
__unported__/magentoerpconnect/partner.py
1
25089
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
-4,476,961,058,515,787,300
37.539171
79
0.544781
false
luotao1/Paddle
python/paddle/static/io.py
1
30947
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
-2,991,404,676,168,279,000
36.602673
144
0.626587
false
Erotemic/hotspotter
hsgui/_frontend/EditPrefSkel.py
1
2626
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/joncrall/code/hotspotter/hsgui/_frontend/EditPrefSkel.ui' # # Created: Mon Feb 10 13:40:41 2014 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: ...
apache-2.0
-1,449,345,158,768,102,100
45.070175
161
0.739147
false
thomas-maurice/docker-minecraft-webapp
webapp/lib/mcrcon.py
1
1703
import socket import select import struct class MCRconException(Exception): pass class MCRcon: socket = None def connect(self, host, port): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.connect((host, port)) def disconnect(self): self.socket.close...
gpl-3.0
6,767,356,456,409,357,000
31.132075
93
0.571932
false
danidee10/Votr
api/api.py
1
3600
from os import getenv from models import db, Users, Polls, Topics, Options, UserPolls from flask import Blueprint, request, jsonify, session from datetime import datetime from config import SQLALCHEMY_DATABASE_URI if getenv('APP_MODE') == 'PRODUCTION': from production_settings import SQLALCHEMY_DATABASE_URI api...
gpl-3.0
-3,323,841,830,138,290,700
32.962264
127
0.648889
false
jamesmunns/wate_backend
prototyping/create_schema.py
1
1046
import psycopg2 import getpass username = getpass.getuser() password = getpass.getpass("Database password for {}: ".format(username)) database = "wate" def create_user_table(cursor): user_schema = """ CREATE TABLE users ( id serial PRIMARY KEY, name text NOT NULL, use...
mit
-8,867,129,375,044,253,000
27.27027
81
0.632887
false
Wilo/barcampMilagro2015
pushfeed/pushfeed/pipelines.py
1
1083
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import logging from scrapy.conf import settings from scrapy.exceptions import DropItem import rethinkdb as r #class Pushfeed...
mit
595,242,613,530,834,000
31.818182
83
0.649123
false
ask/kamqp
kamqp/client_0_8/__init__.py
1
1253
"""AMQP Client implementing the 0-8 spec.""" # Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org> # # 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...
lgpl-2.1
-5,888,403,056,893,450,000
42.206897
75
0.740623
false
hmpf/nav
python/nav/web/portadmin/urls.py
1
1470
# # Copyright (C) 2011, 2013-2015 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed ...
gpl-3.0
2,910,476,749,803,089,400
32.409091
79
0.667347
false
bmcage/centrifuge-1d
centrifuge1d/modules/direct_consolidation_saturated/options.py
1
7263
from __future__ import division, print_function import sys from ..shared.functions import lagrangian_derivative_coefs from numpy import linspace, power, empty, array, log from ..shared.consolidation import (create_CON, CON_SLURRY, CON_GOMPERTZ, CON_FREEFORM, CON_SLURRY_CC, CON_SLURR...
gpl-2.0
4,322,076,158,088,722,400
37.226316
101
0.514801
false