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
clarkperkins/click-shell
setup.py
1
1935
import io import os from setuptools import setup, find_packages def read(rel_path): here = os.path.abspath(os.path.dirname(__file__)) with io.open(os.path.join(here, rel_path), 'r') as fp: return fp.read() def get_version(rel_path): for line in read(rel_path).splitlines(): if line.start...
bsd-3-clause
2,017,556,178,663,941,400
28.769231
97
0.610853
false
3.932927
false
false
false
xin1195/smartSearch
home/handler/webSocketHandler.py
1
1486
#!/usr/bin/env python3 # UserSocket接口,用于浏览器通信 import json import tornado.websocket from home.handler.xiaoTianHandler import xiao_tian_answer from setting import logger def send_to_one_user(user_client, message): user_client.write_message(json.dumps(message)) def send_to_many_user(user_clients, message): ...
apache-2.0
-2,113,201,457,961,597,400
25.925926
70
0.610729
false
3.429245
false
false
false
PLUS-POSTECH/study.plus.or.kr
src/problem/signals.py
1
1112
from django.db.models.signals import post_save from django.dispatch import receiver from integration.helpers import discord from .models import ProblemInstance, ProblemQuestion, ProblemAuthLog # pylint: disable=W0613 @receiver(post_save, sender=ProblemInstance) def on_register_problem_handler(sender, instance, **kwa...
apache-2.0
-2,252,245,296,482,034,700
34.870968
133
0.735612
false
3.719064
false
false
false
avaris/aBibliophile
grouperproxy.py
1
11591
#!/usr/bin/env python # -.- coding: utf-8 -.- # Author : Deniz Turgut # Created : 09.02.2012 from collections import namedtuple from PyQt4 import QtGui, QtCore # each group item has a 'name' and a list of 'children' consisting # of each child's QPersistentModelIndex (pmi) groupItem = namedtuple('groupItem',['name', ...
gpl-3.0
-4,178,263,212,650,144,300
39.246528
100
0.588646
false
4.261397
false
false
false
HEPData/hepdata
tests/pyyaml_test.py
1
1683
# -*- coding: utf-8 -*- # # This file is part of HEPData. # Copyright (C) 2021 CERN. # # HEPData is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
-6,733,662,192,276,484,000
32.66
92
0.723708
false
3.715232
false
false
false
miniCruzer/postit-desktop
restclient.py
1
4123
import json import logging import os import requests from bs4 import BeautifulSoup from PyQt5.QtCore import QThread, pyqtSignal, QSettings from PyQt5.QtWidgets import QDialog, QMessageBox, QDialogButtonBox from ui.Ui_LoginDialog import Ui_LoginDialog def getLoginToken(address, email, password, timeout=15): """ a...
mit
4,215,635,340,765,329,400
27.047619
99
0.617512
false
3.975892
false
false
false
Svjard/presto-admin
prestoadmin/util/constants.py
1
1424
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
-661,595,847,563,454,200
31.363636
74
0.75
false
3.266055
true
false
false
rthill/django-ldapdb
ldapdb/models/base.py
1
6199
# -*- coding: utf-8 -*- # # django-ldapdb # Copyright (c) 2009-2011, Bolloré telecom # All rights reserved. # # See AUTHORS file for a full list of contributors. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # ...
bsd-3-clause
675,032,290,876,975,000
36.786585
133
0.597386
false
4.14238
false
false
false
facebook/redex
tools/python/symbolicator/symbol_files.py
1
2239
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function, unicode_literals import logging import os import re import subprocess ###...
mit
7,663,031,275,686,946,000
33.446154
83
0.570344
false
3.84048
false
false
false
sruizr/pysync_redmine
test/repositories/test_redmine.py
1
11220
import pytest from unittest.mock import Mock, patch from pysync_redmine.repositories.redmine import RedmineRepo from pysync_redmine.domain import ( Project, Task, Phase, Member, ...
mit
-1,539,851,799,964,469,500
31.903226
84
0.531462
false
3.925822
false
false
false
cwurld/django-phonegap
django_phonegap/data_port/views.py
1
1032
__author__ = 'Chuck Martin' from django.views.generic.edit import CreateView from django.views.generic import ListView from rest_framework import generics from rest_framework import permissions from serializers import MessageSerializer from models import Message from forms import MessageForm class CreateMessage(Cr...
bsd-3-clause
2,202,635,197,737,025,800
24.8
71
0.722868
false
4.229508
false
false
false
rafaels88/py2docx
py2docx/elements/image.py
1
5118
# coding: utf-8 import os from os.path import basename from PIL import Image as PILImage from py2docx.document import DOCUMENT_PATH from py2docx.util import Unit class Image(object): def __init__(self, image_path, document, align=None, width='100%', height='100%'): self.image = open(imag...
mit
-6,378,917,781,017,072,000
44.292035
145
0.388824
false
4.222772
false
false
false
Upward-Spiral-Science/claritycontrol
code/scripts/roi_analysis.py
1
2744
#!/usr/bin/python #-*- coding:utf-8 -*- __author__ = 'david' from __builtin__ import * import gc import numpy as np from skimage.feature import greycomatrix, greycoprops import matplotlib as mpl mpl.use('TkAgg') # Solve runtime issue import matplotlib.pyplot as plt ## Fake imge and label volumes to fast test funct...
apache-2.0
-5,778,710,156,627,409,000
32.463415
129
0.672376
false
2.735793
false
false
false
valbertovc/django_semantic_ui
polls/admin.py
1
2085
from django.contrib import admin from django.utils.safestring import mark_safe from .models import Choice, Question from polls.forms import QuestionForm, ChoiceForm from core.utils import SemanticIcons from django.utils.translation import ugettext_lazy as _ class ChoiceAdmin(admin.ModelAdmin): model = Choice ...
mit
2,115,875,492,208,643,800
33.75
98
0.671463
false
3.770344
false
false
false
mfcovington/djangocms-genome-browser
cms_genome_browser/models.py
1
12337
from django.db import models from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator, RegexValidator from filer.fields.file import FilerFileField from filer.fields.image import FilerImageField class Browser(models.Model): class Meta: ordering = ['name'] ...
bsd-3-clause
-1,954,305,381,308,600,800
31.295812
143
0.550539
false
3.956703
false
false
false
alephu5/Soundbyte
environment/lib/python3.3/site-packages/numpy/core/numeric.py
2
79518
from __future__ import division, absolute_import, print_function import sys import warnings import collections from . import multiarray from . import umath from .umath import * from . import numerictypes from .numerictypes import * if sys.version_info[0] >= 3: import pickle basestring = str else: import c...
gpl-3.0
-4,376,133,516,950,663,700
28.127473
90
0.571569
false
3.56551
false
false
false
kmiernik/Pyspectr
bin/spectrum_fitter.py
1
6663
#!/usr/bin/env python3 """ K. Miernik 2013 k.a.miernik@gmail.com GPL v3 Spectrum fitting code """ import argparse import math import numpy import os import sys import time import xml.etree.ElementTree as ET import matplotlib.pyplot as plt from lmfit import minimize, Parameters, report_errors from P...
gpl-3.0
-7,458,183,059,348,559,000
36.432584
80
0.47186
false
3.781498
false
false
false
cchannon/WhatIsThis
ComputerVision.py
1
4492
from __future__ import print_function import time import picamera from datetime import datetime import requests import operator import numpy as np import json import urllib2 def processRequest( json, data, headers, params, lcd ): lcd.set_color(1.0, 1.0, 0.0) lcd.clear() lcd.message('Uploading...') ret...
mit
3,266,545,874,019,211,000
32.281481
116
0.586153
false
3.634304
false
false
false
jucacrispim/toxicbuild
tests/webui/steps/build_steps.py
1
2858
# -*- coding: utf-8 -*- import time from behave import given, when, then from selenium.common.exceptions import StaleElementReferenceException from toxicbuild.ui import settings from tests.webui import take_screenshot from tests.webui.steps.base_steps import ( # noqa f811 given_logged_in_webui, then_sees_messag...
agpl-3.0
-5,854,433,497,256,047,000
23.016807
77
0.608118
false
3.73107
false
false
false
IrregularShed/newoldtv
appleII.py
1
8885
#!/usr/bin/env python # -*- coding: utf-8 -*- # AppleII (Colour) Image Filter - Apple II plugin for The GIMP. # Copyright (C) 2008, 2010 Paulo Silva <nitrofurano@gmail.com> # Copyright (C) 2008 Daniel Carvalho # Copyright (C) 2010 Dave Jeffery <kecskebak.blog@gmail.com> # # This program is free software: ...
gpl-3.0
8,907,679,847,010,967,000
31.075812
85
0.48475
false
3.135145
false
false
false
RicardoJohann/frappe
frappe/hooks.py
1
8537
from __future__ import unicode_literals from . import __version__ as app_version app_name = "frappe" app_title = "Frappe Framework" app_publisher = "Frappe Technologies" app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node" app_icon = "octicon octicon-circuit-board" app_color = "o...
mit
-6,504,451,987,586,173,000
36.279476
118
0.733162
false
2.895862
false
true
false
praekelt/mc2
mc2/organizations/tests/base.py
1
2289
from django.test import TransactionTestCase from django.db.models import Q from django.test.client import RequestFactory from django.utils.text import slugify from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, Permission from mc2.organizations.models import Organization, Organ...
bsd-2-clause
-7,064,009,165,907,239,000
34.215385
76
0.591525
false
4.327032
false
false
false
beeftornado/sentry
src/sentry/migrations/0127_backfill_platformexternalissue_project_id.py
1
2415
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-11-10 00:02 from __future__ import unicode_literals from django.db import migrations import django.db.models.deletion import sentry.db.models.fields.foreignkey from sentry.models.platformexternalissue import PlatformExternalIssue from sentry.utils.query imp...
bsd-3-clause
973,593,084,817,502,600
42.125
99
0.719255
false
4.163793
false
false
false
jeremiedecock/snippets
python/beautifulsoup/get_images_absolute_urls.py
1
2696
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.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 witho...
mit
2,120,359,385,086,357,000
36.416667
79
0.665924
false
4.262658
false
false
false
xlk521/cloudguantou
oauth2/libs/multipart.py
1
1462
import codecs import mimetypes from uuid import uuid4 from io import BytesIO CRLF = '\r\n' writer = codecs.lookup('utf-8')[3] def guess_type(filename): return mimetypes.guess_type(filename)[0] or 'application/sctet-stream' def iter_fields(fields): if isinstance(fields, dict): fields = fields.iteritem...
bsd-3-clause
-2,128,613,986,496,722,200
30.106383
78
0.582079
false
3.73913
false
false
false
linuxlewis/djorm-ext-pgfulltext
djorm_pgfulltext/models.py
1
13514
# -*- coding: utf-8 -*- from itertools import repeat import six from django.db import models, connections from django.db.models.query import QuerySet from django.utils.encoding import smart_text from djorm_pgfulltext.utils import adapt # Compatibility import and fixes section. try: from django.db.transaction im...
bsd-3-clause
-2,555,190,300,441,185,000
36.643454
117
0.60441
false
4.194289
true
false
false
MostlyOpen/odoo_addons
myo_animal/models/address.py
1
2969
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by #...
agpl-3.0
2,762,671,541,979,413,500
38.586667
112
0.634557
false
3.896325
false
false
false
malramsay64/MD-Molecules-Hoomd
test/dynamics_test.py
1
8955
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2017 Malcolm Ramsay <malramsay64@gmail.com> # # Distributed under terms of the MIT license. """Testing the dynamics module.""" import numpy as np import quaternion from hypothesis import HealthCheck, assume, given, settings from hypothesi...
mit
-6,883,469,322,326,091,000
37.102128
93
0.669868
false
3.285872
true
false
false
gpocentek/python-gitlab
gitlab/v4/objects/jobs.py
1
7109
from gitlab import cli, utils from gitlab import exceptions as exc from gitlab.base import RESTManager, RESTObject from gitlab.mixins import RefreshMixin, RetrieveMixin __all__ = [ "ProjectJob", "ProjectJobManager", ] class ProjectJob(RefreshMixin, RESTObject): @cli.register_custom_action("ProjectJob") ...
lgpl-3.0
-6,403,611,239,332,208,000
36.415789
85
0.617949
false
4.039205
false
false
false
jpurma/Kataja
kataja/syntax/BaseFeature.py
1
7442
# coding=utf-8 """ ConfigurableFeature aims to be general implementation for a (syntactic) Feature """ # ############################################################################ # # *** Kataja - Biolinguistic Visualization tool *** # # Copyright 2013 Jukka Purma # # This file is part of Kataja. # # Kataja is free s...
gpl-3.0
-1,221,267,077,624,129,500
35.253659
100
0.585441
false
4.052345
false
false
false
facebookexperimental/eden
eden/integration/lib/edenclient.py
1
23827
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import json import logging import os import pathlib import shlex import shutil import signal import subprocess import sys import ...
gpl-2.0
-8,283,212,565,230,958,000
32.990014
104
0.578713
false
3.940301
false
false
false
Vierkantor/RSwail
rswail/ast.py
1
4421
from rswail.bytecode import Instruction from rswail.closure import Closure from rswail.cons_list import cons_list, from_list, to_list from rswail.struct import Struct, StructInstance, construct from rswail.value import Integer, String, Value statement = Struct(u"statement", { u"declaration": [u"header", u"name", u"ar...
gpl-3.0
-4,315,598,364,805,932,500
36.466102
83
0.733092
false
3.231725
false
false
false
springload/madewithwagtail
core/snippets.py
1
4962
from django.db import models from django.utils.encoding import python_2_unicode_compatible from modelcluster.fields import ParentalKey from modelcluster.models import ClusterableModel from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel, MultiFieldPanel, PageChooserPanel from wagtail.wagtailcore.mode...
mit
5,090,397,503,307,461,000
27.033898
105
0.615881
false
4.037429
false
false
false
erp12/pyshgp
pyshgp/gp/evaluation.py
1
7737
"""The :mod:`evaluation` module defines classes to evaluate program CodeBlocks.""" from abc import ABC, abstractmethod from typing import Sequence, Union, Callable from collections import defaultdict import numpy as np import pandas as pd from pyshgp.push.interpreter import PushInterpreter, Program from pyshgp.tap imp...
mit
-1,309,455,749,332,372,500
31.783898
90
0.575158
false
4.36133
false
false
false
mypopydev/bluez
client/bt601.py
1
2013
# Using bt601 with Python import pexpect import time import socket import sys import os import syslog UNIX_SER="/tmp/ud_bluetooth_main" # function to transform hex string like "0a" into signed integer def hexStrToInt(hexstr): val = int(hexstr[0:2],16) val = (val * 6.0 - 20)/100.0 return val def sendMessa...
gpl-2.0
7,865,876,888,992,136,000
27.757143
100
0.641331
false
3.289216
false
false
false
FrodeSolheim/fs-uae-launcher
amitools/fs/block/FileHeaderBlock.py
1
3464
import time from .Block import Block from .EntryBlock import EntryBlock from .CommentBlock import CommentBlock from ..ProtectFlags import ProtectFlags from ..TimeStamp import * from ..FSString import FSString class FileHeaderBlock(EntryBlock): def __init__(self, blkdev, blk_num, is_longname): EntryBlock.__ini...
gpl-2.0
4,448,644,119,338,782,700
28.364407
122
0.618649
false
3.09839
false
false
false
timsavage/denim
denim/scaffold/__init__.py
1
1859
# -*- encoding:utf8 -*- try: from jinja2 import Environment, PackageLoader except ImportError: raise ImportError('Scaffolding support requires the Jinja 2 templating library to be installed.') template_environment = Environment(loader=PackageLoader('denim.scaffold')) def single(template_file, output_name, co...
bsd-2-clause
-3,425,635,520,187,386,400
26.338235
101
0.629909
false
3.411009
false
false
false
JanTkacik/nao-puzzle-solver
nao-module.py
1
2502
import sys from naoqi import ALProxy # To get the constants relative to the video. import vision_definitions import cv2 import numpy as np import imageresolve.puzzlesolver.solver as slv import imageextractor.imageextractor as ext import imageresolve.puzzlesolver.model.puzzle as pzl import imageresolve.puzzlesolver.mod...
mit
-8,515,521,001,751,319,000
31.921053
95
0.605116
false
3.371968
false
false
false
Ayase-252/waife-crawler
crawler/yandere/yandere.py
1
4275
""" Yandere Crawler """ from requests import ConnectTimeout, get from file_logger.file_logger import FileLogger from crawler.crawler import Crawler from crawler.selector import Selector from request.request_async import AsyncRequestScheduler from crawler.yandere.handler import QueryPageHandler from crawler.yandere.par...
mit
-1,782,669,152,618,254,800
33.756098
75
0.550175
false
4.471757
false
false
false
bit0001/chumme
database_manager/util.py
1
2568
import os from sqlite3 import IntegrityError from .friend_interest_manager import FriendInterestManager from .friend_manager import FriendManager from .friend_social_network_manager import FriendSocialNetworkManager from .interest_manager import InterestManager from .profile_photo_manager import ProfilePhotoManager fr...
apache-2.0
-3,149,871,718,848,437,000
30.317073
70
0.662773
false
4.082671
false
false
false
snbway/flask-rest-framework
rest_framework_flask/versioning.py
1
1485
# encoding: utf-8 from . import api_setting import exceptions class BaseVersioning(object): default_version = api_setting.DEFAULT_VERSION allowed_versions = api_setting.ALLOWED_VERSION version_param = api_setting.VERSION_PARAM def determine_version(self, request, *args, **kwargs): msg = '{cls...
apache-2.0
-8,468,332,575,219,012,000
34.357143
92
0.663973
false
4.159664
false
false
false
sergiocorreia/panflute-filters
setup.py
1
4210
"""Filters for panflute See: https://github.com/sergiocorreia/panflute https://github.com/sergiocorreia/panflute-filters """ 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 f...
bsd-3-clause
6,421,271,382,656,776,000
34.386555
94
0.657007
false
3.964218
false
false
false
ConstantinT/jAEk
crawler/crawler.py
1
58230
''' Copyright (C) 2015 Constantin Tschuertz 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 any later version. This program is distributed in the hope that it wil...
gpl-3.0
-2,113,222,505,680,327,400
59.910042
183
0.560124
false
4.237066
false
false
false
eviljeff/olympia
src/olympia/shelves/forms.py
1
2006
import requests from rest_framework.reverse import reverse as drf_reverse from django import forms from django.conf import settings from django.urls import NoReverseMatch from olympia.shelves.models import Shelf class ShelfForm(forms.ModelForm): class Meta: model = Shelf fields = ('title', 'end...
bsd-3-clause
-3,409,508,105,795,122,700
32.433333
77
0.548355
false
4.857143
false
false
false
bastibl/gnuradio
gr-fec/python/fec/bercurve_generator.py
1
3627
#!/usr/bin/env python # # Copyright 2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
8,351,089,192,773,113,000
34.213592
112
0.639096
false
3.49422
false
false
false
dvannoy/baxter
setup.py
1
1233
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # requirements = None # with open('requirements.txt', 'r') as f: # requirements = [ # ...
apache-2.0
-6,166,464,703,021,763,000
29.825
85
0.505272
false
4.251724
false
false
false
roebel/py_find_1st
setup.py
1
6624
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from setuptools import setup #from distutils.core import setup from distutils.extension import Extension from distutils.command.build_ext import build_ext from distutils.command.sdist import sdist import hashlib import io from pkg_r...
gpl-3.0
6,156,561,315,358,962,000
36.168539
136
0.5987
false
3.617277
false
false
false
zinic/netbox_api
netbox_api/model/rack.py
1
3137
from netbox_api.model.common import CustomFields from enum import Enum class RackWidthConstant(Enum): WIDTH_19_INCHES = 19 WIDTH_23_INCHES = 23 class RackTypeConstant(Enum): FRAME_2_POST = 100 FRAME_4_POST = 200 CABINET_4_POST = 300 FRAME_WALL_MOUNTED = 1000 CABINET_WALL_MOUNTED = 1100 ...
mit
2,123,164,056,186,972,000
23.507813
112
0.586548
false
3.694935
false
false
false
linuxmuster/linuxmuster-base7
share/firewall/opnsense/create-keytab.py
1
2968
#!/usr/bin/python3 # # create web proxy sso keytab # thomas@linuxmuster.net # 20200311 # import constants import getopt import os import sys from functions import datetime from functions import firewallApi from functions import getSetupValue from functions import printScript from functions import readTextfile # ch...
gpl-3.0
-4,581,221,292,962,990,000
25.738739
95
0.632075
false
3.606318
false
false
false
taolei87/rcnn
code/rationale/rationale.py
1
24504
import os, sys, gzip import time import math import json import cPickle as pickle import numpy as np import theano import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams from nn import create_optimization_updates, get_activation_by_name, sigmoid, linear from nn import EmbeddingLayer, Layer, L...
apache-2.0
-6,567,655,606,038,944,000
35.959276
98
0.461843
false
3.751952
false
false
false
UoK-Psychology/rmas-oe-adapter
rmas_oe_adapter/settings.py
1
2184
''' This is the main settings module for your adapter. It will be imported and available to your adapter package::: from rmas_adapter.conf import settings poll_interval = settings.POLL_INTERVAL You will need to have some code somehwere (usually in your runner.py) that sets ...
mit
-5,019,034,746,536,723,000
38.017857
127
0.712912
false
3.658291
false
false
false
kannon92/psi4
psi4/driver/util/filesystem.py
1
1284
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2016 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This program is free software; you can redistribute it and/or modify # it under the terms of ...
gpl-2.0
7,767,472,610,928,574,000
28.860465
73
0.720405
false
3.776471
false
false
false
calatre/epidemics_network
treat/excel_clipper.py
1
1352
# Universidade de Aveiro - Physics Department # 2016/2017 Project - Andre Calatre, 73207 # "Simulation of an epidemic" - 28/6/2017 # Selecting Data from an excel file to another #import numpy as np import pandas as pd from openpyxl import load_workbook #r = [0, 301, 302, 303, 304, 305, 306] #desired = ['S_Avg', 'I_Av...
apache-2.0
6,151,415,062,032,155,000
39.969697
70
0.54068
false
2.764826
false
false
false
d9pouces/StarterPyth
starterpyth/cliforms.py
1
8391
#coding=utf-8 import os import re from six import PY2 from starterpyth.log import display, RED from starterpyth.translation import ugettext as _ __author__ = 'flanker' # noinspection PyUnresolvedReferences input_ = raw_input if PY2 else input class InvalidValue(ValueError): def __init__(self, msg): ...
gpl-2.0
341,928,209,486,795,200
33.677686
116
0.563223
false
3.850849
false
false
false
develersrl/rooms
editor/roomeditor.py
1
10771
#!/usr/bin/env python import sys from PyQt4.QtGui import * from PyQt4.QtCore import * from structdata import g_project from structdata import Area from structdata import Event from utils import g_ptransform import os from arearesize import AreaResize class EditorButton(QToolButton): """ classe base per i...
mit
5,918,950,865,908,647,000
35.265993
85
0.593074
false
3.633941
false
false
false
sassoftware/conary
conary/repository/shimclient.py
1
10116
# # Copyright (c) SAS Institute 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 w...
apache-2.0
-142,238,687,992,929,890
38.98419
85
0.584618
false
4.262958
false
false
false
againer/supercda
clinics/models.py
1
3815
""" Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the Li...
apache-2.0
896,341,156,927,606,900
32.761062
75
0.640891
false
3.937049
false
false
false
bobbyrward/fr0st
scripts/random_flame.py
1
1374
from fr0stlib.functions import randrange2 from fr0stlib import Flame, Xform def GenRandomBatch(numrand,*a, **k): lst = [] if len(a)==0: raise ValueError, "number of xform config specs must be > 0" if 'numbasic' in k and k['numbasic']>0 and len(a)>1: print "more than one xform config ...
gpl-3.0
-4,427,127,534,052,115,000
24.444444
94
0.525473
false
3.013158
false
false
false
ugoertz/igelgrafik
resources/pygments-patch/javascript.py
1
47743
# -*- coding: utf-8 -*- """ pygments.lexers.javascript ~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for JavaScript and related languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, ...
bsd-3-clause
440,068,771,751,930,940
38.741667
93
0.450052
false
3.496334
false
false
false
JohnGriffiths/LabNotebook
site_source/pelicanconf.py
1
3500
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals import os AUTHOR = u'John D. Griffiths' SITENAME = u"JDG Lab Notebook" SITEURL = 'https://johngriffiths.github.io/LabNotebook' #SITESUBTITLE = u'Open Notebook Science.' TIMEZONE = 'US/Pacific' DEFAULT_LANG = u'en' # Feed genera...
gpl-2.0
3,857,400,785,375,380,500
27.688525
101
0.675143
false
2.968617
false
true
false
wesleybowman/karsten
project/rawADCPclass.py
1
4107
from __future__ import division import numpy as np import sys sys.path.append('/home/wesley/github/UTide/') from utide import ut_solv, ut_reconstr #from shortest_element_path import shortest_element_path #import matplotlib.pyplot as plt #import matplotlib.tri as Tri #import matplotlib.ticker as ticker #import seaborn i...
mit
7,166,734,428,525,729,000
31.338583
84
0.612126
false
3.168981
false
false
false
giometti/beaglebone_home_automation_blueprints
chapter_04/wfrog/bbb_habp.py
1
3558
## Copyright 2010 Rodolfo Giometti <giometti@hce-engineering.com> ## derived from ws23xx by Laurent Bovet ## ## This file is part of wfrog ## ## wfrog 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 F...
gpl-2.0
4,234,070,682,089,319,000
30.210526
75
0.513491
false
3.953333
false
false
false
openstack/rally
rally/cli/commands/task.py
1
37125
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
-3,849,538,224,684,864,500
43.301909
79
0.522478
false
4.332983
false
false
false
qbuat/rootpy
rootpy/stats/tests/test_plottable.py
1
2365
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from nose.plugins.skip import SkipTest from rootpy.utils.silence import silence_sout try: with silence_sout(): import ROOT from ROOT import (RooFit, RooRealVar, RooGaussian, RooArgusBG, ...
gpl-3.0
-3,899,456,638,177,250,000
33.779412
77
0.640169
false
3.407781
false
false
false
mrkurt/proxy-mixer
proxyjs/javascript.py
1
2093
import re import os import spidermonkey class Extractor: __mixer_js_lib = open(os.path.dirname(__file__) + '/../javascript/mixer.js', 'r').read() __js_block = re.compile(r"(<script.+?runat=\"proxy\".*?>)(.*?)(</script>)", re.S) __script_start = re.compile(r"<script.+?runat=\"proxy\".*?>") __script_src = re.compile...
mit
255,322,132,879,189,540
25.846154
89
0.609651
false
2.902913
false
false
false
trosa/forca
gluon/contrib/memdb.py
1
28147
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of web2py Web Framework (Copyrighted, 2007-2009). Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu> and Robin B <robi123@gmail.com>. License: GPL v2 """ __all__ = ['MEMDB', 'Field'] import re import sys import os import types import datetime ...
gpl-2.0
-1,616,034,788,288,685,800
30.033076
594
0.5251
false
3.951011
false
false
false
JianGoForIt/YellowFin_Pytorch
word_language_model/model.py
1
2562
import torch.nn as nn from torch.autograd import Variable class RNNModel(nn.Module): """Container module with an encoder, a recurrent module, and a decoder.""" def __init__(self, rnn_type, ntoken, ninp, nhid, nlayers, dropout=0.5, tie_weights=False): super(RNNModel, self).__init__() self.drop ...
apache-2.0
393,465,775,236,503,040
42.423729
110
0.599922
false
3.558333
false
false
false
couwbat/couwbatns3
ns-allinone-3.23/bake/bake/ModuleBuild.py
1
33519
############################################################################### # Copyright (c) 2013 INRIA # # 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 distr...
gpl-2.0
606,902,162,483,470,800
39.142515
129
0.535965
false
4.53327
true
false
false
talkincode/toughlib
toughlib/utils.py
1
10450
#!/usr/bin/env python #coding:utf-8 import decimal import datetime from Crypto.Cipher import AES from Crypto import Random import hashlib import binascii import hashlib import base64 import calendar import random import os import time import uuid import json import functools import logging import urlparse random_gener...
mit
374,508,963,388,416,800
25.984456
103
0.587462
false
3.112971
false
false
false
F5Networks/f5-common-python
f5/bigip/tm/sys/ntp.py
1
2225
# coding=utf-8 # # Copyright 2016 F5 Networks 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 ...
apache-2.0
849,571,690,387,145,700
31.188406
76
0.659163
false
3.677152
false
false
false
luboslenco/lowpolyfactory
populate.py
1
2844
import bpy import bmesh from random import seed, uniform import math import mathutils from mathutils import * from add_mesh_LowPolyFactory import LowPolyFactory from add_mesh_LowPolyFactory.createRockObject import * from add_mesh_LowPolyFactory.createTreeObject import * from add_mesh_LowPolyFactory.createBushObject imp...
gpl-2.0
7,375,870,862,560,782,000
29.913043
70
0.65225
false
3.149502
false
false
false
maas/maas
src/maasserver/migrations/maasserver/0008_use_new_arrayfield.py
1
2693
# -*- coding: utf-8 -*- import django.contrib.postgres.fields from django.db import migrations, models import maasserver.fields class Migration(migrations.Migration): dependencies = [("maasserver", "0007_create_node_proxy_models")] operations = [ migrations.AlterField( model_name="bloc...
agpl-3.0
-2,146,013,334,715,708,400
28.593407
68
0.47642
false
5.024254
false
false
false
lukacu/foldersync
foldersync/storage/ssh.py
1
3894
# -*- Mode: python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- """ Friendly Python SSH2 interface. Copied from http://media.commandline.org.uk//code/ssh.txt Modified by James Yoneda to include command-line arguments. """ import getopt import os import time import paramiko import sys import tempfile f...
gpl-3.0
-3,656,374,407,454,393,300
27.423358
78
0.628403
false
3.715649
false
false
false
bitonic/troppotardi
troppotardi/config/routing.py
1
1701
"""Routes configuration The more specific and detailed routes should be defined first so they may take precedent over the more generic routes. For more information refer to the routes manual at http://routes.groovie.org/docs/ """ from routes import Mapper def make_map(config): """Create, configure and return the ...
gpl-2.0
-996,590,310,799,494,400
42.615385
89
0.670194
false
3.992958
false
false
false
uclouvain/OSIS-Louvain
base/migrations/0046_scoresencoding.py
1
1993
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-05-02 15:06 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('base', '0045_update_justification_values'), ] operations = [ migrations.RunSQL( ...
agpl-3.0
1,676,644,467,102,433,000
38.078431
172
0.644757
false
3.862403
false
false
false
npp/npp-api
data/migrations/0029_auto__del_field_usaspendingassistanceraw_cfda_program__add_field_usasp.py
1
162121
# -*- coding: 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): # Deleting field 'UsaspendingAssistanceRaw.cfda_program' db.delete_column('data_usaspendingassistanceraw', '...
mit
735,446,432,755,450,200
79.738048
158
0.548886
false
3.579383
false
false
false
amlyj/pythonStudy
2.7/monitor/rrdtools/createrrds.py
1
3160
# -*- coding: utf-8 -*- # !/usr/bin/python import os import rrdtool import threading import time import fetchrrd import updaterrd rrd_db_base_path = os.path.dirname( os.path.dirname(os.path.dirname(__file__))) + '/render/static/rrd/' task_dick = {} ipaddr_list = [] bools = True def create_rrd(ip): if ip == ...
mit
403,738,827,919,875,300
26.241379
73
0.531329
false
2.923219
false
false
false
jreese/seinfeld
views/main.py
1
1344
# Copyright 2014 John Reese # Licensed under the MIT license from flask import abort from jinja2.filters import do_capitalize from core import app, context, get, template from models import Quote, Passage @get('/', 'Seinfeld Quote') @template('index.html') def index(): #passage = Passage(uid=37592) passage ...
mit
-254,260,297,995,363,300
22.578947
62
0.633185
false
3.428571
false
false
false
RyanSkraba/beam
sdks/python/apache_beam/runners/interactive/display/pipeline_graph_renderer.py
1
3987
# # 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 us...
apache-2.0
-1,365,545,391,829,221,000
26.881119
103
0.702533
false
4.076687
false
false
false
franklingu/leetcode-solutions
questions/utf-8-validation/Solution.py
1
2536
""" A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules: For 1-byte character, the first bit is a 0, followed by its unicode code. For n-bytes character, the first n-bits are all one's, the n+1 bit is 0, followed by n-1 bytes with most significant 2 bits being 10. This is how the UTF-...
mit
-9,106,393,001,833,455,000
31.230769
167
0.575315
false
4.025397
false
false
false
runt18/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/colors.py
1
31702
""" A module for converting numbers or color arguments to *RGB* or *RGBA* *RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the range 0-1. This module includes functions and classes for color specification conversions, and for mapping numbers to colors in a 1-D array of colors called a colormap. Color...
agpl-3.0
257,668,737,263,501,540
35.065984
95
0.518106
false
3.568438
false
false
false
insiderr/insiderr-app
app/widgets/items/comment.py
1
3202
from .placeholder import Placeholder from .template import TemplateItem, ItemCallback from widgets.layoutint import GridLayoutInt from kivy.properties import StringProperty, ObjectProperty, NumericProperty, AliasProperty, OptionProperty from utilities.formatting import get_formatted_when from kivy.logger import Logger ...
gpl-3.0
-1,765,818,321,988,416,800
32.705263
106
0.639913
false
3.78487
false
false
false
shobhitmishra/CodingProblems
LeetCode/Session3/SerializeDeserializeBST.py
1
1582
import sys class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Codec: def serialize(self, root): result = [] self.serializeHelper(root, result) result.reverse() return ",".join(result) def serializeHelper(self...
mit
1,336,546,976,220,845,000
25.383333
71
0.616941
false
3.53915
false
false
false
agoose77/hivesystem
manual/movingpanda/panda-11d.py
1
6687
import dragonfly import dragonfly.pandahive import bee from bee import connect import math, functools from panda3d.core import NodePath import dragonfly.scene.unbound, dragonfly.scene.bound import dragonfly.std import dragonfly.io import dragonfly.canvas import Spyder # ## random matrix generator from random impor...
bsd-2-clause
210,151,778,070,107,100
27.948052
109
0.649469
false
3.052031
false
false
false
Liuchang0812/COC_dashboard
src/app.py
1
1216
__author__ = 'liuchang' from tornado.web import RequestHandler, Application import tornado from tornado import gen from tornado.options import define import tornado.options import os from core import clan class IndexHandler(RequestHandler): def get(self, *args, **kwargs): return self.render('index.html'...
apache-2.0
-5,759,482,561,828,794,000
25.456522
81
0.603618
false
3.776398
false
false
false
awacha/cct
cct/processing/mainwindow/projectdialog/projectdialog.py
1
3004
import os import appdirs from PyQt5 import QtWidgets, QtCore, QtGui from .projectdialog_ui import Ui_Form class ProjectDialog(QtWidgets.QWidget, Ui_Form): projectSelected = QtCore.pyqtSignal(str) def __init__(self, mainwindow: QtWidgets.QWidget): self.mainwindow = mainwindow super().__init_...
bsd-3-clause
-4,091,614,986,864,855,600
33.930233
107
0.601198
false
4.032215
false
false
false
osamja/local_sockets
app/main.py
1
4410
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from Tkinter import * from tkFileDialog import askopenfilenames from ip import get_ip_addr import time from threading import Thread """ Display landing webpage at IP_ADDR:PORT and allow download of PATH file. """ class MyHandler(BaseHTTPRequestHandler): ...
mit
5,952,390,639,927,118,000
38.026549
91
0.582313
false
3.909574
false
false
false
josenavas/labman
labman/db/equipment.py
1
6002
# ---------------------------------------------------------------------------- # Copyright (c) 2017-, labman development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------------------...
bsd-3-clause
-6,006,356,591,627,091,000
32.909605
79
0.53099
false
4.725984
false
false
false
shinrisama/Jp
JP.py
1
262490
# coding: utf-8 import wx import dataset import xlsxwriter from xlsxwriter.workbook import Workbook import xlwt import tagtool import codecs import csv import csvkit from stuf import stuf # import the newly created GUI file import JukuPlanner import subprocess import os import sys import glob import funzioni import cal...
gpl-3.0
-7,033,408,689,322,820,000
54.919572
237
0.568567
false
3.201411
false
false
false
MaxTyutyunnikov/lino
obsolete/voc/makesql.py
1
3136
#coding: utf-8 ## Copyright 2008-2009 Luc Saffre. ## This file is part of the Lino project. ## Lino is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) a...
gpl-3.0
2,935,300,112,210,750,000
26.699115
91
0.601917
false
2.966825
false
false
false
jandom/rdkit
rdkit/Chem/Draw/qtCanvas.py
1
3513
# $Id$ # # Copyright (C) 2014 Seiji Matsuoka # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # from rdkit.Chem.Draw.canvasbase import CanvasBase f...
bsd-3-clause
2,263,329,650,974,698,000
35.59375
98
0.63877
false
2.783677
false
false
false
AlexPereverzyev/spidy
spidy/document/web_client.py
1
3066
''' High-level HTTP communication interface. ''' import re import codecs import httplib from spidy.common.errors import WebException WEB_URL_PATTERN = re.compile('''([a-z]{3,9}:\/\/|[a-z]{3,9}:\/\/www\.|www\.)([\w.-]+)((?:\/[\w\/:@\-_~.%!$&'()*+=,;]*)?(?:\?[\w\-\+=&;%@._]*)?(?:#[\w\/:?@\-_~.%!$&'()*+=,...
bsd-3-clause
-5,077,729,482,255,502,000
34.094118
184
0.468037
false
4.154472
false
false
false
Belgingur/WrfUtils
PointForecast/bilinear_interpolation.py
1
5510
#!/usr/bin/env python """ Functions to perform bilinear interpolation based only on the station lon/lat and wrfout file. """ import math import logging import netCDF4 import numpy as np LOG = logging.getLogger('belgingur.bilinear') EARTH_RADIUS_M = 6378168 class TargetOutsideGridError(ValueError): """ Rai...
lgpl-3.0
4,345,679,591,206,021,600
33.654088
115
0.592015
false
3.012575
false
false
false
weibohit/tools
unittest_serial.py
1
1764
from driver.serial_impl import SerialImpl from utility.log import InitLogging from utility.log import VLOG import optparse import time import sys def Init(): ser = SerialImpl() ser.LoopBackTest() ser.Close() def ContinueSend3(ser, seconds): timeout = time.time() + seconds while time.time() < timeout: ti...
mit
-8,875,937,484,170,843,000
25.727273
76
0.651361
false
3.291045
false
false
false
opencord/voltha
voltha/extensions/omci/omci_messages.py
1
18479
# # Copyright 2017 the original author or authors. # # 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...
apache-2.0
2,495,795,283,369,438,700
30.320339
104
0.616159
false
3.631165
true
false
false
askbow/cloaked-octo-ironman
google-python-exercises/hello.py
1
1089
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ """A tiny Python program to check that Python is working. Try running this program from t...
bsd-2-clause
-7,344,168,670,453,875,000
32
133
0.719927
false
3.60596
false
false
false
ericholscher/fabric
setup.py
1
2369
#!/usr/bin/env python import sys from setuptools import setup, find_packages from fabric.version import get_version readme = open('README').read() long_description = """ To find out what's new in this version of Fabric, please see `the changelog <http://docs.fabfile.org/changes/%s.html>`_. You can also install t...
bsd-2-clause
1,664,655,176,561,810,400
33.333333
198
0.62558
false
3.883607
false
false
false
p0cisk/Bookshelf
routings.py
1
4987
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import Blueprint, jsonify, render_template, redirect, request from models import Books, Authors, Stories, AuthorsStories from peewee import fn from decorators import count from playhouse.shortcuts import model_to_dict from collections import defaultdict mod_routing...
mit
1,332,563,994,120,331,300
29.975155
97
0.601765
false
3.470424
false
false
false
kawamuray/ganeti
lib/tools/burnin.py
1
42637
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option)...
gpl-2.0
-6,059,015,601,982,323,000
35.44188
80
0.594038
false
3.898775
false
false
false
aaaler/k9
k9d/mpu6050/examples/6axis_dmp.py
1
2719
# coding=utf-8 import math import smbus import mpu6050 from time import time # Sensor initialization mpu = mpu6050.MPU6050( address=mpu6050.MPU6050.MPU6050_DEFAULT_ADDRESS, bus=smbus.SMBus(1)) mpu.dmpInitialize() mpu.setDMPEnabled(True) # get expected DMP packet size for later comparison packetSize = mpu.dmpG...
lgpl-3.0
2,685,161,083,789,600,000
25.656863
77
0.545421
false
3.332108
false
false
false