repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
iliavolyova/evo-clustering
src/stats.py
1
5952
from __future__ import division import os from functools import partial import log as logger import core import gui_graphs from PyQt4.QtGui import * defaultParams = { 'Dataset' : 'Iris', 'Number of generations' : 100, 'Population size': 20, 'Max clusters' : 5, ...
mit
8,746,288,657,055,795,000
34.434524
132
0.541835
false
3.890196
false
false
false
ool2016-seclab/quarantineSystem
api.py
1
3438
import json import logging import ryutest from webob import Response from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.app.wsgi import ControllerBase, WSGIApplication, route from ryu.lib import dpid as dpid_lib simple_switc...
mit
627,949,269,274,732,800
36.380435
94
0.630308
false
3.745098
false
false
false
lerker/cupydle
cupydle/dnn/viejo/Neurons.py
1
3537
import numpy as np __author__ = "Nelson Ponzoni" __copyright__ = "Copyright 2015-2016, Proyecto Final de Carrera" __credits__ = ["Nelson Ponzoni"] __license__ = "GPL" __version__ = "20160101" __maintainer__ = "Nelson Ponzoni" __email__ = "npcuadra@gmail.com" __status__ = "Production" """ Neurons class, this is abstra...
apache-2.0
-3,702,147,777,341,866,000
30.026316
109
0.599943
false
3.544088
false
false
false
hesseltuinhof/mxnet
python/mxnet/gluon/model_zoo/vision/__init__.py
1
3746
# coding: utf-8 # pylint: disable=wildcard-import, arguments-differ r"""Module for pre-defined neural network models. This module contains definitions for the following model architectures: - `AlexNet`_ - `DenseNet`_ - `Inception V3`_ - `ResNet V1`_ - `ResNet V2`_ - `SqueezeNet`_ - `VGG`_ You can construct a mod...
apache-2.0
-176,548,373,229,067,420
33.366972
82
0.60331
false
3.254561
false
false
false
MPIBGC-TEE/CompartmentalSystems
notebooks/ELM_dask.py
1
1730
#from dask.distributed import Client import xarray as xr import numpy as np import pandas as pd import importlib import ELMlib importlib.reload(ELMlib) #client = Client(n_workers=2, threads_per_worker=2, memory_limit='1GB') #client #ds = xr.open_dataset('../Data/14C_spinup_holger_fire.2x2_small.nc') from netCDF4 imp...
mit
2,440,978,287,868,239,400
23.366197
113
0.636416
false
2.585949
false
false
false
gusgollings/scbdo
scbdo/tod.py
1
16340
# SCBdo : DISC Track Racing Management Software # Copyright (C) 2010 Nathan Fraser # # 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 ...
gpl-3.0
5,077,695,465,656,237,000
32.970894
92
0.567993
false
3.510204
false
false
false
piotroxp/scibibscan
scib/lib/python3.5/site-packages/astropy/coordinates/baseframe.py
1
45786
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Framework and base classes for coordinate frames/"low-level" coordinate classes. """ from __future__ import (absolute_import, unicode_literals, division, print_function) # Standard library import inspec...
mit
-3,056,814,761,154,917,000
36.591133
88
0.58151
false
4.778833
false
false
false
atilag/qiskit-sdk-py
qiskit/_jobprocessor.py
1
4559
# -*- coding: utf-8 -*- # Copyright 2017 IBM RESEARCH. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
5,967,503,450,596,751,000
36.368852
85
0.606054
false
4.225209
false
false
false
morta-code/YAX
setup.py
1
1245
from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( ...
gpl-3.0
6,089,661,871,399,462,000
35.529412
94
0.662641
false
3.857143
false
true
false
lutianming/leetcode
reorder_list.py
1
1288
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: # @param head, a ListNode # @return nothing def reorderList(self, head): if not head or not head.next: return head fast = head s...
mit
3,573,646,055,956,980,700
21.596491
41
0.534938
false
3.95092
false
false
false
magyarm/periphondemand-code
src/bin/code/intercon.py
1
5000
#! /usr/bin/python # -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Name: Intercon.py # Purpose: # Author: Fabien Marteau <fabien.marteau@armadeus.com> # Created: 13/05/2008 #----------------------------------------------------------------------------- # C...
lgpl-2.1
8,862,320,480,658,115,000
35.764706
78
0.5792
false
4.608295
false
false
false
zdrjson/DDKit
python/iMacFirstPythonPragrammer/FindSameNameImage.py
1
1755
import os, sys, re, shutil if __name__ == '__main__': used_map = {} resPath = "./MagnetPF/Res/" depDir = "Deprecated" skipDir = ["message"] for root, dirs, files in os.walk("./"): for file in files: if file.endswith(".m"): filepath = os.path.join(root,...
mit
-5,205,550,570,592,033,000
30.927273
76
0.406268
false
4.488491
false
false
false
owlabs/incubator-airflow
airflow/contrib/operators/snowflake_operator.py
1
3034
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
-7,577,476,445,885,619,000
38.402597
78
0.677983
false
4.156164
false
false
false
thefinn93/orgsms
orgsms/api.py
1
3675
from flask import Blueprint, abort, jsonify, request, current_app, Response import datetime from sqlalchemy import desc from .provider import providers from .socketio import socketio from . import models, exceptions app = Blueprint('api', __name__) @app.route('/inbound/<provider>', methods=["POST"]) def inbound(pro...
gpl-3.0
5,098,620,182,597,977,000
36.5
98
0.667483
false
4.007634
false
false
false
bolkedebruin/airflow
airflow/executors/executor_loader.py
1
3573
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-3,511,072,061,836,489,000
41.035294
109
0.683459
false
4.378676
false
false
false
pdelsante/thug
thug/DOM/History.py
1
3513
#!/usr/bin/env python # # History.py # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; w...
gpl-2.0
2,978,125,687,368,465,400
26.661417
95
0.609735
false
3.877483
false
false
false
DLR-SC/DataFinder
src/datafinder/gui/user/common/widget/property/editors/list_editor.py
1
14838
# # $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. # # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions are #met: ...
bsd-3-clause
1,791,342,349,966,951,400
38.540984
119
0.638765
false
4.466586
false
false
false
chripell/pyasicam
view.py
1
8948
#!/usr/bin/python3 import datetime import os import pyasicam as pc import sys import numpy as np import cairo import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GdkPixbuf, GLib, Gdk, Gio, GObject def gamma_stretch(im, gamma): if im.dtype != np.float: im = im.astype(np.float) i...
gpl-3.0
199,139,717,233,901,900
29.026846
72
0.533862
false
3.307948
false
false
false
livioferrante/my-final-project
.mywaflib/waflib/extras/boost.py
1
13891
#!/usr/bin/env python # encoding: utf-8 # # partially based on boost.py written by Gernot Vormayr # written by Ruediger Sonderfeld <ruediger@c-plusplus.de>, 2008 # modified by Bjoern Michaelsen, 2008 # modified by Luca Fossati, 2008 # rewritten for waf 1.5.1, Thomas Nagy, 2008 # rewritten for waf 1.6.2, Sylvain Rouquet...
bsd-3-clause
-5,572,335,086,933,527,000
32.798054
136
0.653373
false
2.867671
true
false
false
Arkapravo/morse-0.6
src/morse/actuators/destination.py
1
3226
import logging; logger = logging.getLogger("morse." + __name__) import morse.core.actuator from morse.helpers.components import add_data, add_property class DestinationActuatorClass(morse.core.actuator.MorseActuatorClass): """ Destination motion controller This controller will receive a destination point and ...
bsd-3-clause
6,813,234,703,560,069,000
37.86747
108
0.619653
false
3.845054
false
false
false
cpcloud/ibis
ibis/pandas/execution/tests/test_structs.py
1
2175
from collections import OrderedDict import pandas as pd import pandas.util.testing as tm import pytest import ibis import ibis.expr.datatypes as dt @pytest.fixture(scope="module") def value(): return OrderedDict([("fruit", "pear"), ("weight", 0)]) @pytest.fixture(scope="module") def struct_client(value): ...
apache-2.0
-4,332,289,009,526,960,600
25.204819
79
0.585287
false
3.48
true
false
false
radinformatics/whatisit
whatisit/apps/wordfish/storage.py
1
2207
from django.core.files.storage import FileSystemStorage from django.core.files.move import file_move_safe from django.contrib.auth.models import User from django.apps import apps from fnmatch import fnmatch from whatisit.settings import ( MEDIA_ROOT, MEDIA_URL ) import errno import itertools import os import...
mit
-5,028,986,313,260,818,000
33.484375
89
0.580879
false
4.117537
false
false
false
chriha/GistTerminal
helpers.py
1
2293
#!/usr/bin/python # -*- coding: utf-8 -*- from contextlib import contextmanager import os import re import sys import tempfile # see http://en.wikipedia.org/wiki/ANSI_escape_code for more ANSI escape codes class textColors( object ): grey = '37m' white = '97m' cyan = '36m' lightcy...
mit
7,451,939,604,386,966,000
31.757143
233
0.523768
false
3.571651
false
false
false
lucasa/landell_gst-gengui
sltv/gstmanager/sbinmanager.py
2
1441
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging logger = logging.getLogger('sbinmanager') class SBinManager(object): def __init__(self): self.pipeline_desc = "" self.check_for_compat = True def add_sbin(self, element): if self.check_for_compat and element.type.find("sourc...
gpl-2.0
537,184,325,939,206,140
35.025
120
0.539903
false
3.832447
false
false
false
andrewyoung1991/abjad
abjad/tools/abctools/AbjadObject.py
1
3350
# -*- encoding: utf-8 -*- import abc AbstractBase = abc.ABCMeta( 'AbstractBase', (), { '__metaclass__': abc.ABCMeta, '__module__': __name__, '__slots__': (), }, ) class AbjadObject(AbstractBase): '''Abstract base class from which many custom classes inherit. '...
gpl-3.0
3,573,645,687,400,127,000
24.580153
76
0.541791
false
4.361979
false
false
false
ISN-LYSTCHA17/glowing-invention
personnalize.py
1
2940
# import drawing lib import pygame # pygame constants as events' constants from pygame.locals import * # game constants from constants import * from buttonwimage import ButtonWImage import glob import os import textentry from button import Button import shutil class Personnalize: def __init__(self,...
gpl-3.0
-7,840,768,914,036,989,000
32.186047
144
0.483333
false
3.79845
false
false
false
eteamin/spell_checker_web_api
scwapi/model/__init__.py
1
2402
# -*- coding: utf-8 -*- """The application's model objects""" from zope.sqlalchemy import ZopeTransactionExtension from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base # Global session manager: DBSession() returns the Thread-local # session object appropriate...
gpl-3.0
3,821,758,990,012,186,000
37.741935
78
0.735637
false
4.085034
false
false
false
cysuncn/python
spark/crm/PROC_M_MID_PER_ASSETS.py
1
3335
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_M_MID_PER_ASSETS').setMaster(sys.argv[2]) sc = SparkContext(conf = conf) sc.s...
gpl-3.0
-6,297,165,228,514,295,000
35.123596
170
0.621462
false
2.346715
false
true
false
evanthebouncy/nnhmm
uai_sushi/script_test_sort.py
1
1245
from model import * from draw import * from naive_baseline import * from quicksort import * # ------------- helpers -------------- def get_id_map(start_sort, truth): ret = dict(zip(start_sort, truth)) return ret def pred_acc(preds, qry): num_cor = 0 ...
mit
8,447,393,334,369,140,000
22.490566
87
0.533333
false
2.79148
false
false
false
cGVuaXM/botcnt
PYodbcutils.py
1
2151
#https://github.com/mkleehammer/pyodbc/wiki/ import os import re import logging import pyodbc from openpyxl import Workbook from openpyxl.styles import Font class SQLserver: def __init__(self, params, autocommit=False, searchescape=None, timeout=None): params_str = r'DRIVER={ODBC Driver 11 for SQL Server};' para...
mit
3,703,125,957,708,237,000
25.231707
146
0.67457
false
2.868
false
false
false
edwatt/REU2014
usrp_info_and_test.py
1
2853
#!/usr/bin/env python """ Retrieve operating parameters of connected USRP and loop through the operating spectrum trasmitting a constant wave signal """ from gnuradio import gr from gnuradio import analog from gnuradio import uhd from time import sleep MAX_RATE = 1000e6 class build_block(gr.top_block): def __init__...
gpl-3.0
8,491,993,155,991,852,000
23.177966
122
0.654399
false
2.610247
false
false
false
paxos1977/QuickFixLogFixup
QuickFixLogViewer.py
1
52083
import sublime, sublime_plugin import re def multiple_replace(dict, text): pattern = re.compile("^(%s)\=" % "|".join(map(re.escape, dict.keys()))) lines = text.split("\x01") newLines = [] for line in lines: new_line = pattern.sub(lambda match: dict[match.string[match.start():match.end()-1]] + "=", line) new...
bsd-3-clause
1,577,408,565,323,987,200
29.983343
99
0.624138
false
2.380284
false
false
false
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.0-py2.5.egg/sqlalchemy/databases/access.py
1
15034
# access.py # Copyright (C) 2007 Paul Johnston, paj@pajhome.org.uk # Portions derived from jet2sql.py by Matt Keranen, mksql@yahoo.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import random from sqlalchemy import sql, schema, type...
bsd-3-clause
4,976,746,506,832,466,000
35.052758
115
0.581016
false
4.258924
false
false
false
a-rank/cassandra-tools
cassandra_tools/ui.py
1
3032
# Copyright 2016 Allan Rank # # 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, s...
apache-2.0
-2,171,579,964,705,164,800
32.318681
92
0.652045
false
3.618138
false
false
false
Grumpy-Mike/Mikes-Pi-Bakery
CurveBall/curvedBall.py
1
3415
# Curved Ball - a game for the Pi Glow board # By Mike Cook - March 2015 import time, random, sys from smbus import SMBus import wiringpi2 as io # command register addresses for the SN3218 IC used in PiGlow CMD_ENABLE_OUTPUT = 0x00 CMD_ENABLE_LEDS = 0x13 CMD_SET_PWM_VALUES = 0x01 CMD_UPDATE = 0x16 SN3218 = 0x54 # i2c ...
gpl-2.0
4,215,678,575,726,886,400
30.330275
74
0.622255
false
3.096102
false
false
false
gamajr/EZNCoder
engine/generator.py
1
3020
# -*- coding: utf-8 -*- import string from infoparser import MInfo class MEGenerator(): """Classe que gera linhas de comando para o MEncoder.""" def __init__(self): self._cut_cmd = string.Template("") self.info = MInfo() self._supported_ops = ['sub','wmv2avi','avixvid'] de...
gpl-3.0
5,803,673,885,986,638,000
38.75
114
0.568543
false
3.25431
false
false
false
indico/indico
indico/modules/events/sessions/operations.py
1
6547
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import session from indico.core import signals from indico.core.db import db from indico.modul...
mit
4,079,880,723,672,840,700
45.764286
119
0.691462
false
3.88546
false
false
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
4.07767
false
false
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
4.113445
false
false
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
3.444504
true
false
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
3.097826
false
false
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
3.387892
false
false
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
4.119485
false
false
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
4.390411
false
false
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
2.563815
false
false
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
4.742344
false
false
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
3.093684
true
false
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
3.981777
false
false
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
3.655506
true
false
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
3.57508
false
false
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
2.84728
false
false
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
4.14304
false
false
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
2.793043
false
false
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
3.875731
false
false
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
4.192491
false
false
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
3.656388
false
false
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
3.026171
false
false
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
3.817691
false
false
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
3.524187
false
false
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
3.774406
false
false
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
2.894889
false
false
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
3.419891
false
false
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
3.988121
false
false
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
4.16682
false
false
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
4.481481
false
false
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
3.954008
true
false
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
3.47585
false
false
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
3.582363
false
false
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
4.001374
false
false
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
4.269939
false
false
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
4.006993
false
false
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
3.235925
false
false
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
3.855492
false
false
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
4.486405
false
false
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
4.344402
false
false
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
3.758515
true
false
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
4.215789
false
false
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
3.727708
false
false
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
3.593929
false
false
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
4.382953
false
false
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
4.317355
false
false
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
3.865087
false
false
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
3.377076
false
false
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
3.712106
true
false
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
3.681628
false
false
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
3.823735
false
false
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
2.806259
false
false
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
3.316667
false
false
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
3.919192
false
false
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
3.947458
false
false
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
3.497974
true
false
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
3.702128
false
false
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
4.142403
true
false
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
3.679032
false
false
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
2.90681
true
false
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
3.217054
false
false
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
3.733167
false
false
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
4.105836
false
false
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
3.814118
false
false
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
3.286331
false
false
false