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
me4502/tandr
tandr.py
1
2132
import random import json from flask import Flask, render_template, url_for, request, redirect, session from flask_oauthlib.client import OAuth app = Flask(__name__) app.secret_key = "Ayy lmao" oauth_key="763519b5c8d1c478f44296c2b6c82dcb772dc4b0fbafa66b68d889cd41da4d71" oauth_secret="6ecb90487aaf53377f8a0e536c7a4a4b...
mit
6,138,273,881,019,834,000
29.028169
85
0.665572
false
3.063218
false
false
false
irgangla/pntools
pntools/partialorder_renderer.py
1
7581
#!/usr/bin/python3 # -*- coding_ utf-8 -*- """ This program implements a renderer for LPO files. """ from PIL import Image, ImageDraw, ImageFont, ImageFilter # Python image library (Pillow) from pntools import partialorder # LPO data structure import math import sys import os def calculate_size(lpo): """ This fu...
mit
-4,004,009,900,292,507,000
32.396476
112
0.593589
false
3.296087
false
false
false
gkc1000/pyscf
pyscf/mcscf/mc2step.py
1
6534
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
apache-2.0
3,943,637,371,586,924,000
32.167513
88
0.536425
false
2.905291
false
false
false
madaari/ti_summer_internship_BBB17
Smart door bell/lcd.py
1
1817
#!/usr/bin/python # Example using a character LCD connected to a Raspberry Pi or BeagleBone Black. import time import Adafruit_CharLCD as LCD # Raspberry Pi pin configuration: # lcd_rs = 27 # Note this might need to be changed to 21 for older revision Pi's. # lcd_en = 22 # lcd_d4 = 25 # lcd_d5 ...
gpl-3.0
1,803,859,612,244,337,000
20.891566
112
0.663731
false
2.566384
false
false
false
libretees/libreshop
libreshop/inventory/migrations/0020_auto_20161023_2045.py
1
1095
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-10-23 20:45 from __future__ import unicode_literals from decimal import Decimal import django.core.validators from django.db import migrations import django_measurement.models class Migration(migrations.Migration): dependencies = [ ('inventory', ...
gpl-3.0
-927,113,509,204,794,900
33.21875
211
0.647489
false
4.294118
false
false
false
bholmgren/pycligen
cligen.py
1
32802
# # PyCLIgen module # # Copyright (C) 2014-2015 Benny Holmgren # # This file is part of PyCLIgen. # # PyPyCLIgen 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 ...
gpl-3.0
8,613,711,472,700,645,000
22.247342
137
0.550546
false
3.812856
false
false
false
erigones/esdc-ce
pdns/validators.py
1
6625
import re from django.core.exceptions import ValidationError from django.core.validators import validate_ipv4_address, validate_ipv6_address, MaxLengthValidator from django.utils.translation import ugettext_lazy as _ from pdns.models import Record re_record_name_valid_chars = re.compile(r'^((([a-z\d_])|(\*\.))(-*[a-...
apache-2.0
-6,718,438,184,819,827,000
30.398104
115
0.640453
false
4.151003
false
false
false
pombredanne/anvil
anvil/actions/test.py
1
2048
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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.or...
apache-2.0
-9,080,190,932,409,066,000
34.929825
78
0.576172
false
4.4814
false
false
false
Nic30/hwtLib
hwtLib/peripheral/usb/usb2/utmi_agent_test.py
1
1608
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from hwt.interfaces.utils import addClkRstn from hwt.synthesizer.unit import Unit from hwtLib.peripheral.usb.usb2.ulpi_agent_test import UlpiAgentTC, \ UlpiUsbAgentTC from hwtLib.peripheral.usb.usb2.utmi import Utmi_8b from hwt.simulator.simTestCase import SimTestCase...
mit
-7,891,177,194,865,482,000
24.52381
85
0.669776
false
2.897297
true
false
false
linkinwong/word2vec
src/crf-paper-script/chunker12_ntancestor_sgd.py
1
1524
#!/usr/bin/env python """ A feature extractor for chunking. __author__ = linlin """ # Separator of field values. separator = ' ' # Field names of the input data. fields = 'y w pos token sem part pp p n nn nont' # Attribute templates. templates = ( (('w', -2), ), (('w', -1), ), (('w', 0), ), (('w', ...
apache-2.0
-3,359,384,484,029,679,000
22.8125
72
0.399606
false
2.848598
false
false
false
frol/django-thumbnail-works
src/thumbnail_works/images.py
1
7573
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: from PIL import Image, ImageFilter except ImportError: import Image import ImageFilter from cropresize2 import CM_AUTO, crop_resize from django.core.files.base import ContentFile from thumbnail_...
apache-2.0
2,111,310,946,451,512,800
32.50885
97
0.564902
false
4.339828
false
false
false
cscanlin/munger-builder
munger_builder/urls.py
1
1769
"""munger_builder URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='ho...
mit
-621,726,591,384,239,400
43.358974
78
0.651781
false
3.428295
false
false
false
n3wb13/OpenNfrGui-5.0-1
lib/python/Plugins/Extensions/NFR4XBoot/ubi_reader/ubifs/output.py
5
4034
import os import struct from ubifs.defines import * from ubifs.misc import decompress def dents(ubifs, inodes, dent_node, path = '', perms = False): inode = inodes[dent_node.inum] dent_path = os.path.join(path, dent_node.name) if dent_node.type == UBIFS_ITYPE_DIR: try: if not ...
gpl-2.0
2,170,450,015,451,508,500
33.716814
85
0.49182
false
3.480587
false
false
false
karimbahgat/PyAgg
__private__/temp_dev/rendererclass.py
1
8714
# Check dependencies try: import PIL, PIL.Image, PIL.ImageTk except ImportError: raise Exception("The renderer requires PIL or Pillow but could not find it") try: import aggdraw except ImportError: raise Exception("The renderer requires aggdraw but could not find it") import itertools def grouper(i...
mit
6,361,390,834,902,520,000
33.995984
138
0.56415
false
3.649079
false
false
false
jefftc/changlab
Betsy/Betsy/modules/annotate_probes.py
1
3787
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, in_data, out_attributes, user_options, num_cores, outfile): import StringIO import arrayio from genomicode import arrayplatf...
mit
-6,616,411,264,953,687,000
35.76699
77
0.552416
false
4.063305
false
false
false
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py
1
35493
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
2,431,537,871,508,831,000
50.588663
225
0.647564
false
4.321563
true
false
false
SymbiFlow/prjxray
fuzzers/015-clb-nffmux/top.py
1
9314
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import os, random random.seed(0) from...
isc
-5,168,153,440,399,580,000
24.587912
95
0.476916
false
2.57435
false
false
false
m87/pyEM
offline.py
1
5995
import utils as uts import numpy as np from scipy.misc import logsumexp from config import * from thirdparty import log_mvnpdf, log_mvnpdf_diag from scipy.stats import multivariate_normal EPS = np.finfo(float).eps class BatchGauss(object): def __init__(self, param): self.n = param[CLUSTERS] self.th...
mit
-7,289,077,316,482,555,000
33.454023
109
0.541118
false
3.04624
false
false
false
r3vl1s/collagen
collagen/collagen.py
1
1496
''' Collagen is a commandline utility that creates a collage using image segmentation. ''' import os import os.path from collagen import segments from collagen import collage import sys from collagen import utils COLLAGEN_DIR = os.path.abspath(__file__ + "/../../") def segment_images(source_image_folder,segment_path...
mit
-5,582,000,089,645,530,000
30.166667
100
0.673128
false
3.376975
true
false
false
wdbm/abstraction
toywv-4.py
1
7646
#!/usr/bin/env python """ ################################################################################ # # # toywv-4 # # ...
gpl-3.0
4,299,325,012,864,996,400
36.116505
83
0.511771
false
5.13499
false
false
false
drcraig/concorde
concorde/__init__.py
1
3678
# coding: utf-8 from __future__ import with_statement import os import codecs from operator import itemgetter from datetime import datetime from urlparse import urljoin try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from markdown import Markdown import dateutil.parse...
mit
-4,614,828,912,946,080,000
34.028571
99
0.630778
false
3.700201
false
false
false
gumpu/TSP_Animation
anim.py
1
19264
#!/usr/bin/python2 # This only runs under Python2 import math import time import random import datetime from node import Node from node import length from node import total_length from node import dump import matplotlib.pyplot as plt import numpy l_min = None pic = 0 # v = [-100,4100,-100,2100] def framec( solution...
gpl-3.0
-2,581,411,592,816,155,600
31.053245
112
0.524917
false
3.470991
false
false
false
charettes/django-dynamic-choices
tests/test_models.py
1
2717
from __future__ import unicode_literals from django.core.exceptions import FieldError, ValidationError from django.db.models import Model from django.test import SimpleTestCase, TestCase from dynamic_choices.db.models import DynamicChoicesForeignKey from .models import ALIGNMENT_EVIL, ALIGNMENT_GOOD, Enemy, Master, ...
mit
2,345,321,175,337,379,000
37.267606
118
0.686051
false
3.784123
true
false
false
znick/anytask
anytask/anyrb/views.py
1
1098
# -*- coding: utf-8 -*- from django.contrib.auth.models import User from django.conf import settings from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext as _ from issues.models import Issue...
mit
-44,139,875,798,322,490
38.214286
103
0.631148
false
3.635762
false
false
false
hjfreyer/pledgeservice
backend/model.py
1
28312
import datetime import json import logging import os import random from rauth import OAuth2Service from collections import namedtuple from google.appengine.ext import db import cache class Error(Exception): pass # Used to indicate which data objects were created in which version of # the app, in case we need to sp...
agpl-3.0
6,659,446,111,206,480,000
33.568987
93
0.662157
false
3.682143
true
false
false
tvtsoft/odoo8
addons/hr/hr.py
1
18501
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from openerp import SUPERUSER_ID from openerp import tools from openerp.modules.module import get_module_resource from openerp.osv import fields, osv from openerp.tools.translate import _ _logger = loggi...
agpl-3.0
5,865,851,376,304,998,000
47.686842
170
0.591914
false
3.765724
false
false
false
jat255/hyperspyUI
hyperspyui/signalwrapper.py
1
10542
# -*- coding: utf-8 -*- # Copyright 2014-2016 The HyperSpyUI developers # # This file is part of HyperSpyUI. # # HyperSpyUI 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
7,307,429,685,893,864,000
35.86014
82
0.580725
false
3.905891
false
false
false
kenb123/Basic-Expression-Lexicon-Variation-Algorithms-BELVA
plugins/policies/mutate/policy_multiply_word_by_4.py
1
2407
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #-------------------------------------------------------------------------------------------------- # pyOwaspBELVA - Contextual custom dictionary builder with character and word variations for pen-testers # Copyright (C) 2016 OWASP Foundation / Kenneth F. Belva # ...
gpl-3.0
-7,133,153,777,334,881,000
30.684211
108
0.560449
false
4.305903
false
false
false
neuroailab/tfutils
tfutils/tests/mnist_data.py
1
4588
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
mit
2,490,599,746,435,539,000
33.757576
80
0.66456
false
3.562112
true
false
false
AsymmetricVentures/asym-fields
setup.py
1
1826
# -*- coding: utf-8 -*- # Asymmetric Base Framework :: Fields # Copyright (C) 2013-2014 Asymmetric Ventures 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; version 2 of th...
gpl-2.0
9,190,243,004,921,041,000
32.814815
76
0.710296
false
3.644711
false
false
false
mpi-sws-rse/thingflow-python
examples/kalman_model.py
1
4244
import asyncio import numpy as np from sklearn import linear_model # For Kalman filtering from filterpy.kalman import KalmanFilter from filterpy.common import Q_discrete_white_noise from thingflow.base import OutputThing, InputThing, from_iterable, Scheduler class SGDLinearRegressionModel(OutputThing, InputThing): ...
apache-2.0
-5,613,145,215,875,922,000
31.396947
128
0.602733
false
3.368254
false
false
false
louargantb/onectl
onectl/sources/includes/xmlparser.py
1
8015
from includes import xmltodic import re import xml.etree.ElementTree as ET # INI XML paths XML_INFO = '/plugins/plugin[name={0}]/info' XML_PLUGIN_FILE = '/plugins/file' XML_PLUGIN_FILE_TYPE = '/plugins/file_type' # INI XML PATHS XML_INI_KEY = '/plugins/plugin[name={0}]/key' XML_INI_SECTION = '/plugins/plugin[name={0...
gpl-2.0
3,797,542,777,021,214,700
29.945946
177
0.655646
false
2.996262
false
false
false
ktan2020/legacy-automation
win/Lib/site-packages/wx-3.0-msw/wx/lib/pubsub/core/kwargs/listenerimpl.py
1
3654
""" :copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved. :license: BSD, see LICENSE_BSD_Simple.txt for details. """ from .listenerbase import ListenerBase, ValidatorBase from .callables import ListenerMismatchError class Listener(ListenerBase): """ Wraps a callable so it...
mit
1,942,347,132,885,969,200
37.290323
81
0.617953
false
4.47246
false
false
false
efiop/dvc
dvc/compare.py
1
8887
from collections import abc from itertools import chain, repeat, zip_longest from operator import itemgetter from typing import ( TYPE_CHECKING, Any, Dict, ItemsView, Iterable, Iterator, List, Mapping, MutableSequence, Sequence, Tuple, Union, overload, ) from funcy i...
apache-2.0
1,916,319,566,862,563,300
26.685358
79
0.554518
false
3.686022
false
false
false
arth-co/saleor
saleor/api/views.py
1
3143
from django.shortcuts import render # Create your views here. from rest_framework import viewsets, permissions from rest_framework.authentication import TokenAuthentication, SessionAuthentication, BasicAuthentication from rest_framework.response import Response import django_filters from rest_framework import parsers,...
bsd-3-clause
-7,556,553,129,753,698,000
35.976471
105
0.757875
false
4.401961
false
false
false
zacernst/bayes_tensorflow
bayes_tensorflow.py
1
35543
""" Work in progress. Bayes network classes that will convert a network specification into a set of TensorFlow ops and a computation graph. The main work of the classes is to move from a directed graph to a set of formulas expressing what's known about the probability distribution of the events represented in the gra...
mit
-2,955,960,630,564,812,300
31.370674
109
0.584306
false
4.219755
false
false
false
roberzguerra/scout
registration/admin.py
1
3065
# -*- coding:utf-8 -*- from django.contrib import admin from django.contrib.sites.models import RequestSite from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.model...
gpl-2.0
8,738,751,509,169,948,000
35.488095
135
0.669713
false
3.989583
false
false
false
genius1611/Keystone
keystone/logic/service.py
1
49844
# Copyright (c) 2010-2011 OpenStack, 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 ...
apache-2.0
5,189,367,561,954,876,000
39.589577
79
0.597905
false
3.985607
false
false
false
phetsims/phet-info
ide/sublime-text/phet-plugin/phet.py
1
28099
# Copyright 2020, University of Colorado Boulder # # @author Jonathan Olson <jonathan.olson@colorado.edu> import sublime, sublime_plugin, os, re, subprocess, webbrowser, json, threading from functools import reduce # Useful URLs: # https://www.sublimetext.com/docs/3/api_reference.html # http://www.sublimetext.com/do...
mit
378,586,369,329,201,000
37.810773
887
0.65892
false
3.256722
false
false
false
gt-ros-pkg/rcommander-core
nodebox_qt/src/nodebox/graphics/bezier.py
1
15081
# Bezier - last updated for NodeBox 1.8.3 # Author: Tom De Smedt <tomdesmedt@trapdoor.be> # Manual: http://nodebox.net/code/index.php/Bezier # Copyright (c) 2007 by Tom De Smedt. # Refer to the "Use" section on http://nodebox.net/code # Thanks to Dr. Florimond De Smedt at the Free University of Brussels for the math ro...
bsd-3-clause
3,797,539,096,768,064,000
30.885835
151
0.560573
false
3.118486
false
false
false
fbuitron/FBMusic_ML_be
INTERACTIVE/Security.py
1
1170
import config import base64 from Networking import Networking import json #Security API is the class in charge of the managing tokens and refresh the access token that expires every 3600 seconds. client_id = config.CLIENT_ID client_secret = config.CLIENT_SECRET refresh_token = config.REFRESH_TOKEN access_token = conf...
apache-2.0
3,210,954,485,428,886,500
29.789474
121
0.741026
false
3.362069
false
false
false
cislaa/prophy
prophyc/generators/python.py
1
4264
import os from prophyc import model libname = "prophy" primitive_types = {x + y : "%s.%s" % (libname, x + y) for x in "uir" for y in ["8", "16", "32", "64"]} primitive_types['byte'] = '%s.u8' % libname def _generate_include(include): return "from %s import *" % include.name.split("/")[-1] def _generate_constant...
mit
5,934,226,107,916,349,000
36.734513
106
0.567542
false
3.589226
false
false
false
siemens/django-mantis-authoring
mantis_authoring/cybox_object_transformers/__object_base__.py
1
4799
import cybox.objects, importlib, os, hashlib from cybox.common import Hash, String, Time, ToolInformation, ToolInformationList, ObjectProperties, DateTime, StructuredText, AnyURI, PositiveInteger import cybox.utils # Import all cybox object classes cybox_objects = [fname[:-3] for fname in os.listdir(cybox.objects.__pa...
gpl-2.0
6,495,189,054,172,415,000
40.730435
150
0.604709
false
3.870161
false
false
false
chantera/biaffineparser
src/utils/training/trainer.py
1
10446
import dataclasses from typing import Any, Dict, Optional import torch class Trainer: @dataclasses.dataclass class Config: epochs: int = 1 max_steps: Optional[int] = None eval_interval: Optional[int] = None max_grad_norm: Optional[float] = None def __init__(self, model, o...
apache-2.0
-8,177,321,728,918,069,000
29.278261
95
0.561555
false
3.915292
true
false
false
fintech-circle/edx-platform
lms/djangoapps/grades/tests/utils.py
1
2564
""" Utilities for grades related tests """ from contextlib import contextmanager from datetime import datetime from mock import patch from courseware.module_render import get_module from courseware.model_data import FieldDataCache from xmodule.graders import ProblemScore @contextmanager def mock_passing_grade(grade_p...
agpl-3.0
7,092,016,170,101,558,000
32.298701
112
0.665367
false
3.884848
false
false
false
digitalocean/netbox
netbox/dcim/models/cables.py
1
18458
from collections import defaultdict from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.db.models import Sum from django.urls import re...
apache-2.0
-3,967,838,516,724,215,300
35.768924
120
0.602991
false
4.201684
false
false
false
grnet/synnefo
snf-pithos-app/setup.py
1
2528
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010-2016 GRNET S.A. # # 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
135,030,978,470,197,870
27.088889
79
0.681566
false
3.313237
false
false
false
jkvoorhis/cheeseburger_backpack_bot
plugins/plugin_word_respond.py
1
8734
from __future__ import unicode_literals from threading import Timer from datetime import datetime from rtmbot.core import Plugin from utils import word_checking as wc_utils from utils.db import update_user_counts, get_user_counts from utils.utils import load_json, write_json, add_plurals import threading OPT_IN_FIL...
apache-2.0
3,961,227,543,493,192,700
35.852321
93
0.520838
false
4.006422
false
false
false
sebpiq/pychedelic
pychedelic/core/files.py
1
1785
from tempfile import NamedTemporaryFile import os import math import numpy as np import subprocess import types def guess_fileformat(filename): """ Guess the format of a sound file. """ try: return filename.split('.')[-1] except IndexError: raise ValueError('unknown file format') ...
mit
8,240,382,351,137,312,000
29.254237
100
0.597759
false
4.260143
false
false
false
saurabh6790/-aimobilize-lib
webnotes/utils/email_lib/smtp.py
1
10323
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Sends email via outgoing server specified in "Control Panel" Allows easy adding of Attachments of "File" objects """ import webnotes from webnotes import conf from webno...
mit
5,517,245,642,176,861,000
30.3769
103
0.688269
false
3.269876
false
false
false
solus-project/evolve-sc
xng/plugins/ldm/plugin.py
2
3883
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of solus-sc # # Copyright © 2017-2018 Ikey Doherty <ikey@solus-project.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Founda...
gpl-2.0
207,767,716,740,498,270
32.756522
78
0.637043
false
4.16971
false
false
false
cpchrispye/PyCIP
PyCIP/DataTypesModule/BaseDataTypes.py
1
4051
from PyCIP.DataTypesModule.BaseDataParsers import BaseData, BaseStructure, VirtualBaseStructure class BOOL(BaseData): _byte_size = 1 _signed = 0 class SINT(BaseData): _byte_size = 1 _signed = 1 class INT(BaseData): _byte_size = 2 _signed = 1 class DINT(BaseData): _byte_size = 4 _sign...
mit
-7,002,085,352,309,567,000
22.829412
95
0.543076
false
3.578622
false
false
false
nborkowska/kpir
kpir/kpir/settings.py
1
2454
""" Django settings for kpir project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
gpl-3.0
4,649,813,688,392,579,000
24.298969
71
0.708639
false
3.237467
false
false
false
ganiserb/d20stats-server
d20s/d20s/urls.py
1
1058
"""d20s URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based ...
gpl-2.0
-3,594,430,110,453,119,000
33.129032
77
0.712665
false
3.30625
false
false
false
Igglyboo/Project-Euler
100-199/180-189/Problem187.py
1
1434
from time import clock from math import sqrt #19340598 def timer(function): def wrapper(*args, **kwargs): start = clock() print(function(*args, **kwargs)) print("Solution took: %f seconds." % (clock() - start)) return wrapper @timer def find_answer(): total = 0 maximum = 10 *...
unlicense
-5,999,651,840,125,171,000
21.761905
63
0.511158
false
3.304147
false
false
false
iwschris/ezodf2
ezodf2/observer.py
1
4064
#!/usr/bin/env python #coding:utf-8 # Purpose: observer pattern # Created: 22.01.2011 # Copyright (C) 2011, Manfred Moitzi # License: MIT from __future__ import unicode_literals, print_function, division __author__ = "mozman <mozman@gmx.at>" from weakref import WeakSet class Observer(object): """ Simp...
mit
7,418,845,801,425,112,000
32.735043
89
0.611959
false
4.490608
false
false
false
phracek/rebase-helper
rebasehelper/helpers/git_helper.py
1
2279
# -*- coding: utf-8 -*- # # This tool helps you to rebase package to the latest version # Copyright (C) 2013-2014 Red Hat, 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...
gpl-2.0
-5,531,562,877,172,148,000
34.061538
101
0.681878
false
3.856176
false
false
false
wy4515/gesture-crawl
test-gesture.py
1
4587
from os import listdir from os.path import isfile, join import cv2 import numpy as np import math import time from consine_simi import consine_similarity from classify import classify from MotionDetector import directionCalculate cap = cv2.VideoCapture(0) def setbg(): retval, im = cap.read() avg1 = np.float...
gpl-2.0
-7,529,820,911,149,940,000
27.490683
93
0.605407
false
2.963178
false
false
false
Rhizomatica/rccn
rccn/modules/subscription.py
1
5437
############################################################################ # # Copyright (C) 2014 tele <tele@rhizomatica.org> # # Subscription module # This file is part of RCCN # # RCCN is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Public License as published by # th...
agpl-3.0
3,367,383,859,288,691,700
37.835714
106
0.583594
false
4.274371
false
false
false
googleapis/googleapis-gen
google/cloud/bigquery/reservation/v1/bigquery-reservation-v1-py/google/cloud/bigquery_reservation_v1/types/reservation.py
1
26647
# -*- coding: utf-8 -*- # 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...
apache-2.0
-4,479,214,397,840,925,700
29.007883
132
0.635381
false
4.327217
false
false
false
kacf/integration
backend-tests/tests/test_deployments.py
1
76642
# Copyright 2020 Northern.tech AS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
5,258,339,374,784,063,000
36.078858
105
0.502427
false
4.178953
true
false
false
dhhagan/py-smps
smps/fit.py
1
19179
"""Functions to support fitting multi-modal distributions. """ import numpy as np from scipy.optimize import curve_fit from statsmodels.iolib.table import SimpleTable from .utils import Table def dndlogdp(dp, n, gm, gsd): """ Discrete PDF for a lognormal particle size distribution. :param dp: Particle...
mit
4,224,885,219,388,461,600
32.706503
71
0.617342
false
3.798574
false
false
false
solarwinds/orionsdk-python
orionsdk/swisclient.py
1
2130
import requests import json from datetime import datetime def _json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, datetime): serial = obj.isoformat() return serial class SwisClient: def __init__(self, hostname, username, password,...
apache-2.0
9,061,071,517,631,515,000
30.791045
81
0.550235
false
4.26
false
false
false
loafbaker/django_ecommerce1
products/migrations/0005_auto__add_variation.py
1
4052
# -*- 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): # Adding model 'Variation' db.create_table(u'products_variation', ( ...
mit
-3,598,373,054,870,785,000
62.328125
150
0.576259
false
3.683636
false
false
false
bootphon/h5features
docs/conf.py
1
9735
#!/usr/bin/env python # -*- coding: utf-8 -*- # # h5features documentation build configuration file, created by # sphinx-quickstart on Mon Nov 2 16:02:53 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # ...
gpl-3.0
5,442,678,067,770,696,000
31.558528
79
0.699743
false
3.702929
true
false
false
baloo/sflvault-server
sflvault/migrate/06-to-07.py
1
4576
# -=- encoding: utf-8 -=- # Script to migrate data from version 0.6 to version 0.7 # # Execute from the root of the project as: # # paster shell # # In [1]: %run sflvault/migrate/06-to-07.py # # So that all the model and everything is available and initialized. # ### WARN: make sure you have created the new fields: ...
gpl-3.0
2,790,503,613,210,688,000
34.426357
114
0.676805
false
3.402829
false
false
false
felgari/clavel
csvdata.py
1
16732
#! /usr/bin/env python # Copyright (c) 2012 Felipe Gallego. All rights reserved. # # 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 lat...
gpl-3.0
8,212,424,135,853,744,000
39.515738
156
0.480337
false
5.050407
false
false
false
hotator/python-clustering
cluster/base/Cluster.py
1
3165
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- """ multiple clustering algorithms """ import numpy as np import matplotlib.pyplot as plt from .HelperFunctions import get_colors from mpl_toolkits.mplot3d import Axes3D from random import shuffle class Cluster: def __init__(self, points): # Attributes ...
gpl-2.0
1,342,501,685,348,504,600
29.728155
94
0.49763
false
3.693116
false
false
false
jeonghoonkang/BerePi
apps/lcd_berepi/lib/lcd.py
1
5635
#!/usr/bin/python # Author : ipmstyle, https://github.com/ipmstyle # : jeonghoonkang, https://github.com/jeonghoonkang # for the detail of HW connection, see lcd_connect.py import RPi.GPIO as GPIO import time, os from subprocess import * from lcd_connect import * # Define some device constants LCD_WIDTH = 16...
bsd-2-clause
8,807,742,185,404,786,000
23.823789
75
0.657498
false
2.671882
false
false
false
NSLS-II/analysisstore
analysisstore/server/utils.py
1
2641
from __future__ import (absolute_import, division, print_function, unicode_literals) import tornado.web from pkg_resources import resource_filename as rs_fn import ujson import pymongo.cursor SCHEMA_PATH = 'schemas' SCHEMA_NAMES = {'analysis_header': 'analysis_header.json', 'an...
bsd-3-clause
4,314,629,055,209,691,000
33.763158
181
0.563802
false
4.537801
false
false
false
badp/ganeti
test/py/ganeti.rapi.rlib2_unittest.py
1
59830
#!/usr/bin/python # # Copyright (C) 2010, 2012, 2013 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) any later version. # # ...
gpl-2.0
-4,302,235,891,176,903,700
32.183583
80
0.635267
false
3.558768
true
false
false
CroissanceCommune/autonomie
autonomie/models/project/types.py
1
10029
# -*- coding: utf-8 -*- # * Authors: # * TJEBBES Gaston <g.t@majerti.fr> # * Arezki Feth <f.a@majerti.fr>; # * Miotte Julien <j.m@majerti.fr>; """ Project Type management """ from sqlalchemy import ( Table, Column, Integer, String, Boolean, ForeignKey, not_, ) from sqlalche...
gpl-3.0
-8,130,695,059,802,727,000
29.154079
78
0.578299
false
3.813909
false
false
false
github-borat/cinder
cinder/volume/drivers/san/solaris.py
1
10453
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
5,011,371,372,434,922,000
35.548951
79
0.583565
false
3.79144
true
false
false
iamgreaser/pycubed
feature_server/commands.py
1
31419
# Copyright (c) Mathias Kaerlev 2011-2012. # This file is part of pyspades. # pyspades is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version...
gpl-3.0
1,210,131,710,178,273,800
27.984317
103
0.710175
false
3.110484
false
false
false
diegocepedaw/oncall
src/oncall/api/v0/bonus_events.py
1
5371
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license. # See LICENSE in the project root for license information. import json import time from .events import on_get as get_events from collections import defaultdict import requests from ujson import dumps as json_dumps from f...
bsd-2-clause
-2,004,072,089,176,623,000
38.492647
151
0.544033
false
4.424217
true
false
false
iulian787/spack
var/spack/repos/builtin/packages/raxml-ng/package.py
1
1201
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RaxmlNg(CMakePackage): """RAxML-NG is a phylogenetic tree inference tool which uses ma...
lgpl-2.1
2,821,107,388,622,675,000
34.323529
74
0.698585
false
3.354749
false
false
false
Stanford-Legal-Tech-Design/legaltech-rapidpro
temba/temba_email.py
2
1327
from email.mime.image import MIMEImage from django.core.mail import EmailMultiAlternatives from django.template import loader, Context from django.conf import settings def send_temba_email(to_email, subject, template, context, branding): """ Utility method that sends a pretty email, attaching our logo to ...
agpl-3.0
-1,482,308,337,939,322,000
35.861111
102
0.711379
false
3.926036
false
false
false
mikalstill/nova
nova/virt/powervm/driver.py
1
28419
# Copyright 2014, 2018 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
5,391,761,707,680,621,000
40.670088
79
0.626201
false
4.257528
false
false
false
innodatalabs/lxmlx
lxmlx/xml_writer.py
1
5216
import lxml.etree as et import re import itertools import contextlib from lxmlx.event import ENTER, EXIT, TEXT, COMMENT, PI from lxmlx.validate import validate_xml_text, validate_xml_name, \ validate_pi_text, validate_comment_text, xml_escape_text, \ xml_escape_attr _QUAL_NAME = re.compile(r'{(.*?)}(.*)$') cl...
mit
-8,746,266,260,802,268,000
29.325581
94
0.486771
false
3.948524
false
false
false
convexopt/gpkit
gpkit/repr_conventions.py
1
1150
"Repository for representation standards" import sys from .small_classes import Quantity try: sys.stdout.write(u"\u200b") DEFAULT_UNIT_PRINTING = [":P~"] except UnicodeEncodeError: DEFAULT_UNIT_PRINTING = [":~"] def _repr(self): "Returns namespaced string." return "gpkit.%s(%s)" % (self.__class__...
mit
3,538,152,550,209,359,000
29.263158
74
0.658261
false
3.59375
false
false
false
hkarl/instinf
stellenplan/migrations/0001_initial.py
1
13483
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Besetzung', fields=[ ('id', models.AutoField(ve...
gpl-2.0
-8,337,424,858,809,630,000
69.591623
230
0.630943
false
3.202613
false
false
false
sligodave/django-keyvalue
keyvalue/managers.py
1
4805
from django.db import models from django.contrib.contenttypes.models import ContentType from django.conf import settings class KeyValueManager(models.Manager): def __dynamic_key(self, name): """ If the setting to create Key instances that don't exist is set to True, then we create a Key in...
mit
7,640,454,864,164,794,000
40.068376
79
0.555879
false
4.290179
false
false
false
bstroebl/QGIS
python/plugins/sextante/algs/AutoincrementalField.py
1
3138
# -*- coding: utf-8 -*- """ *************************************************************************** AutoincrementalField.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************...
gpl-2.0
1,964,033,838,678,590,700
40.84
102
0.537285
false
4.614706
false
false
false
ngvozdiev/ctr-base
python/selenium_trace.py
1
3246
from selenium import webdriver from selenium.webdriver.common.keys import Keys import time import subprocess import os import signal PAGES = ['http://www.google.co.uk', 'http://www.youtube.com', 'http://www.google.com', 'http://www.facebook.com', 'http://www.reddit.com', 'http://www.amazon.co.uk', ...
mit
1,250,767,354,171,962,600
37.188235
84
0.639864
false
3.169922
false
false
false
jlongever/redfish-client-python
on_http_redfish_1_0/models/virtual_media_collection_virtual_media_collection.py
1
9796
# coding: utf-8 """ Copyright 2015 SmartBear Software 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
-2,838,958,111,394,093,600
30.197452
131
0.636484
false
4.678128
false
false
false
ricarkol/agentless-system-crawler
crawler/plugins/cloudsight_environment.py
1
1583
#!/usr/bin/python # -*- coding: utf-8 -*- import os import json import logging import copy try: from crawler.runtime_environment import IRuntimeEnvironment except ImportError: from runtime_environment import IRuntimeEnvironment logger = logging.getLogger('crawlutils') class CloudsightEnvironment(IRuntimeEn...
apache-2.0
5,212,655,439,946,783,000
33.413043
78
0.633607
false
3.918317
false
false
false
johnshiver/vote_location
voter_location/districts/management/commands/scrape_office_phone_number.py
1
2641
import re from bs4 import BeautifulSoup import requests from django.core.management.base import BaseCommand, CommandError from districts.models import DistrictDetail class Command(BaseCommand): def handle(self, *args, **options): import ipdb;ipdb.set_trace() test_run = options['test_run'] ...
mit
-1,858,732,759,573,506,800
32.43038
131
0.552064
false
3.805476
false
false
false
jeffzhengye/pylearn
theano/embedding_retrofit_theano.py
1
3172
# -*- coding: utf-8 -*- import argparse import sys import logging import numpy import numpy as np sys.path.append("../") import itertools import theano import theano.tensor as T from copy import deepcopy class Rotrofit(object): def __init__(self, q_old, alpha, gazs): self.q_old = q_old self.q_n...
unlicense
7,170,954,801,338,071,000
28.64486
88
0.618537
false
3.026718
false
false
false
newnone/Jotto-Web
JottoWebApp/migrations/0001_initial.py
1
1429
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-10 21:37 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
mit
6,448,089,284,340,051,000
32.232558
116
0.56613
false
4.190616
false
false
false
chubin/cheat.sh
lib/adapter/upstream.py
1
2247
""" Adapter for an external cheat sheets service (i.e. for cheat.sh) Configuration parameters: upstream.url upstream.timeout """ # pylint: disable=relative-import import textwrap import requests from config import CONFIG from .adapter import Adapter def _are_you_offline(): return textwrap.dedent( ...
mit
-7,306,154,134,185,144,000
32.537313
91
0.548732
false
4.07804
true
false
false
DreamSourceLab/DSView
libsigrokdecode4DSL/decoders/swd/pd.py
1
12085
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2014 Angus Gratton <gus@projectgus.com> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the ...
gpl-3.0
8,924,034,292,300,031,000
33.528571
102
0.527431
false
3.58499
false
false
false
ekcs/congress
congress/datasources/heatv1_driver.py
1
6238
# 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 # d...
apache-2.0
-5,850,265,480,855,743,000
42.02069
79
0.633216
false
3.988491
false
false
false
Csega/PythonCAD3
Interface/evaluator.py
1
2245
# # Copyright (c) ,2010 Matteo Boscolo # # This file is part of PythonCAD. # # PythonCAD is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version...
gpl-2.0
-8,695,108,343,644,689,000
29.337838
125
0.588419
false
4.196262
false
false
false
endlessm/chromium-browser
third_party/angle/third_party/VK-GL-CTS/src/external/vulkancts/scripts/verify_submission.py
3
3044
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # Vulkan CTS # ---------- # # Copyright (c) 2016 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 ...
bsd-3-clause
-4,718,679,115,992,807,000
28.553398
124
0.685283
false
3.506912
true
false
false
monolithed/dotfiles
init.d/fest.py
1
4804
# -*- coding: utf-8; indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- """ - fest process helper - - fest.py [ --test ] | [ --stop ] | [ --start ] | [ --reload ] | [ --state ] | [ --version ] | - --path | --name - _ - fest.py --path='/usr/local/etc/fest/fest.yaml' --name='example.com' --test ...
mit
424,039,221,655,765,100
21.767773
95
0.51353
false
3.561156
true
false
false
mbuesch/pyprofibus
pyprofibus/phy.py
1
3595
# -*- coding: utf-8 -*- # # PROFIBUS DP - Communication Processor PHY access library # # Copyright (c) 2013-2016 Michael Buesch <m@bues.ch> # # Licensed under the terms of the GNU General Public License version 2, # or (at your option) any later version. # from __future__ import division, absolute_import, print_functi...
gpl-2.0
5,126,169,871,866,106,000
22.807947
82
0.680389
false
2.885233
false
false
false
nueverest/BlowDryCSS
blowdrycss/blowdry.py
1
9136
# python 2 from __future__ import absolute_import, print_function, unicode_literals from builtins import bytes, str # builtins import logging import cssutils from os import path # custom from blowdrycss import log from blowdrycss.filehandler import FileFinder, CSSFile, GenericFile from blowdrycss.classparser import Cla...
mit
6,964,231,962,907,550,000
40.716895
127
0.667032
false
3.987778
false
false
false
magician333/nutshell
nutshell.py
1
1218
# code : utf-8 # Author : PurpleFire # Nutshsll(坚果壳) import binascii import os picture = input("请输入图片路径:") if os.path.exists(picture): # 判断文件是否存在 try: pic_hex = binascii.hexlify( open(picture, "rb").read()).decode("utf-8") # 将其转化为十六进制 except Exception as e: # 没有图片 print("文件无法打...
gpl-2.0
8,886,764,258,952,478,000
26.393939
90
0.649336
false
1.702448
false
true
false
qxf2/qxf2-page-object-model
utils/Wrapit.py
1
2782
""" Class to hold miscellaneous but useful decorators for our framework """ from inspect import getfullargspec class Wrapit(): "Wrapit class to hold decorator functions" def _exceptionHandler(f): "Decorator to handle exceptions" def inner(*args,**kwargs): try: ret...
mit
-5,775,573,600,700,322,000
36.093333
178
0.555715
false
4.46549
false
false
false
brson/gyp
pylib/gyp/generator/ninja.py
1
87030
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import hashlib import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common import gyp.msvs_...
bsd-3-clause
781,828,721,127,299,200
40.541766
80
0.623383
false
3.86611
true
false
false