repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
idegtiarov/gnocchi-rep
gnocchi/ceilometer/utils.py
1
1259
# # Copyright 2015 eNovance # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-8,211,332,044,180,262,000
39.612903
75
0.746624
false
mshunshin/SegNetCMR
pydicom/charset.py
1
5681
# charset.py """Handle alternate character sets for character strings.""" # # Copyright (c) 2008-2012 Darcy Mason # This file is part of pydicom, released under a modified MIT license. # See the file license.txt included with this distribution, also # available at https://github.com/darcymason/pydicom # from pyd...
mit
4,459,642,833,566,833,000
36.375
101
0.607816
false
Krigu/python_fun
Heidi/FileParser.py
1
1629
TORCH_START_VALUE = 15 THING_START_VALUE = 20 INVISIBLE_START_VALUE = 21 FANTASTIC_START_VALUE = 3 class Story: heros = ["Heidi", "Fantastic", "Tourch", "Thing", "Invisible"] heidi = 0 fantastic = FANTASTIC_START_VALUE torch = TORCH_START_VALUE thing = THING_START_VALUE invisible = INVISIBLE_...
gpl-3.0
7,884,140,570,094,559,000
23.313433
66
0.54205
false
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/utility/techsupport_args.py
1
1326
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
4,549,954,713,833,272,300
28.466667
142
0.706637
false
cheapjack/MemoryCraft
MemoryCloud1.py
1
1993
#!/usr/bin/python #Install the modules we need #from pyfirmata import Arduino, util, INPUT from mcpi import minecraft from mcpi import minecraftstuff from time import sleep import server import serial # Set up a connection to the Arduino/Shrimp if we need it #PORT = "/dev/tty.SLAB_USBtoUART" #ser = serial.Serial(PORT...
mit
4,954,500,081,771,976,000
35.907407
197
0.707978
false
Bobox214/ZemkaBot
tools/kbHit.py
1
1619
import sys import termios import atexit from select import select class KBHit(object): def __init__(self): '''Creates a KBHit object that you can call to do various keyboard things. ''' # Save the terminal settings self.fd = sys.stdin.fileno() self.new_term = termios.tcgetattr(self.fd) self.old_term = te...
mit
9,086,489,840,359,184,000
22.128571
76
0.650401
false
clay584/IOS-to-HTML
iostohtml.py
1
3208
#!/usr/bin/env python from ciscoconfparse import CiscoConfParse import re def read_in_file(filename): return CiscoConfParse(filename) def find_acls(parsed_config): acl_names = [] # Get standard ACL numbers/names standard_acls = parsed_config.find_objects('^access-list') for acl in standard_ac...
gpl-2.0
6,242,614,476,191,175,000
20.972603
75
0.532107
false
axce1/PyProjects
Graphics/watermark.py
1
1104
import Image, ImageEnhance def add_watermark(image, watermark, opacity=1, wm_interval=None): assert opacity >= 0 and opacity <= 1 if opacity < 1: if watermark.mode != 'RGBA': watermark = watermark.convert('RGBA') else: watermark = watermark.copy() alpha = waterm...
gpl-2.0
2,413,271,779,597,631,000
33.5
76
0.601449
false
codingenesis/ansible_mysql_rds_playbook
hack/rds.py
1
44216
#!/usr/bin/python # This file is part of Ansible # # Ansible 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. # # Ansible is distributed...
gpl-3.0
3,260,466,123,463,195,600
39.087035
322
0.635811
false
jnimmo/pyenvisalink
pyenvisalink/honeywell_client.py
1
10341
import logging import json import re import asyncio from pyenvisalink import EnvisalinkClient from pyenvisalink.honeywell_envisalinkdefs import * _LOGGER = logging.getLogger(__name__) class HoneywellClient(EnvisalinkClient): """Represents a honeywell alarm client.""" @asyncio.coroutine def keep_a...
mit
-3,805,397,457,246,989,300
50.447761
198
0.582922
false
gregorymfoster/honeypot
honeypot/honeypot/www/models.py
1
9081
import random import string import logging import datetime from dateutil.relativedelta import relativedelta # An abstracted data model for fetching data from honeypot_logs class HoneypotLogTable(object): # Create model for a specific airflow database def __init__(self, table_name, sql_conn_id='airflow_db'): ...
apache-2.0
1,176,233,732,038,446,800
35.765182
80
0.49565
false
Banbury/cartwheel-3d
Python/GLUtilsTest.py
1
10680
from App.UtilFuncs import fancify print fancify( """Character( root = ArticulatedRigidBody( name = "pelvis", meshes = [ (path.join(meshDir, "pelvis_2_b.obj"), colourDark), (path.join(meshDir, "pelvis_2_s.obj"), colourLight) ], mass = 12...
apache-2.0
-380,019,581,576,461,760
34.20339
79
0.408614
false
caladrel/trueskill_kicker
league/migrations/0001_initial.py
1
3950
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Match', fields=[ ...
apache-2.0
6,388,180,689,287,207,000
43.382022
225
0.533418
false
zcbenz/cefode-chromium
tools/telemetry/telemetry/core/chrome/browser_backend.py
1
7145
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import urllib2 import httplib import socket import json import re import sys from telemetry.core import util from telemetry.core import exceptions from ...
bsd-3-clause
-2,395,234,556,662,840,000
32.70283
80
0.684955
false
Cadasta/cadasta-platform
cadasta/xforms/tests/test_utils.py
1
3134
import pytest from django.test import TestCase from ..utils import InvalidODKGeometryError, odk_geom_to_wkt class TestODKGeomToWKT(TestCase): def setUp(self): self.geoshape = ('45.56342779158167 -122.67650283873081 0.0 0.0;' '45.56176327330353 -122.67669159919024 0.0 0.0;' ...
agpl-3.0
-5,008,687,416,031,206,000
36.309524
79
0.585514
false
google/struct2tensor
struct2tensor/expression_impl/slice_expression_test.py
1
7170
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
1,086,534,423,020,961,500
35.030151
95
0.539191
false
KazDragon/munin
conanfile.py
1
2093
from conans import ConanFile, CMake, tools class MuninConan(ConanFile): name = "munin" license = "MIT" author = "KazDragon" url = "https://github.com/KazDragon/munin" description = "A text-based gui component library build on Terminal++" topics = ("ansi-escape-codes", "text-ui") settings =...
mit
1,457,283,711,952,135,400
39.25
99
0.584329
false
Zanzibar82/streamondemand.test
channels/cinestreaming01.py
1
4463
# -*- coding: utf-8 -*- #------------------------------------------------------------ # streamondemand.- XBMC Plugin # Canal para cinestreaming01.com # http://blog.tvalacarta.info/plugin-xbmc/streamondemand. #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys ...
gpl-3.0
-8,911,400,560,965,957,000
43.62
299
0.6645
false
serge-sans-paille/pythran
pythran/tests/cases/stone.py
1
5387
#pythran export whetstone(int) #runas whetstone(2*10**2) #bench whetstone(1500) """ /* * C Converted Whetstone Double Precision Benchmark * Version 1.2 22 March 1998 * * (c) Copyright 1998 Painter Engineering, Inc. * All Rights Reserved. * * Permission is granted to use, duplicate, and...
bsd-3-clause
8,200,889,701,506,693,000
24.899038
97
0.484685
false
randombit/botan
src/scripts/ci_check_install.py
1
2918
#!/usr/bin/env python # coding=utf8 """ Botan CI check installation script This script is used to validate the results of `make install` (C) 2020 Jack Lloyd, René Meusel, Hannes Rantzsch Botan is released under the Simplified BSD License (see license.txt) """ import os import sys import json import re def verify_l...
bsd-2-clause
-1,211,456,448,052,397,800
27.048077
93
0.622557
false
Socialsquare/RunningCause
challenges/tasks.py
1
1414
# coding: utf8 from __future__ import absolute_import import datetime from celery import shared_task from celery.utils.log import get_task_logger from django.utils.translation import ugettext as _ from django.core.mail import send_mail from django.contrib.auth import get_user_model from django.conf import settings f...
mit
-5,044,719,315,472,939,000
25.679245
66
0.683876
false
JTarball/tetherbox
docker/app/app/backend/apps/services/migrations/0001_initial.py
1
3463
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import taggit.managers class Migration(migrations.Migration): dependencies = [ ('taggit', '0002_auto_20150616_2121'), migrations.swappable_dependency(settings...
isc
-504,606,766,729,863,940
42.2875
182
0.556743
false
david-martin/atomic-reactor
tests/test_inner.py
1
20378
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import json import os from atomic_reactor.build import InsideBuilder from atomic_reactor.util impor...
bsd-3-clause
-4,677,298,146,013,047,000
30.159021
97
0.48464
false
migasfree/migasfree-backend
migasfree/client/models/error.py
1
4593
# -*- coding: utf-8 -*- # Copyright (c) 2015-2021 Jose Antonio Chavarría <jachavar@gmail.com> # Copyright (c) 2015-2021 Alberto Gacías <alberto@migasfree.org> # # 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 Softw...
gpl-3.0
349,263,582,367,790,340
27.515528
101
0.597691
false
stscieisenhamer/glue
glue/utils/tests/test_matplotlib.py
2
5186
from __future__ import absolute_import, division, print_function import pytest import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Circle from matplotlib.artist import Artist from numpy.testing import assert_allclose from matplotlib.backends.backend_agg import FigureCanvasAgg from glue...
bsd-3-clause
2,965,087,516,347,311,000
28.299435
103
0.604126
false
wooey/Wooey
wooey/migrations/0018_userfile.py
1
1037
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wooey.models.mixins class Migration(migrations.Migration): dependencies = [ ('wooey', '0017_wooeyfile_generate_checksums'), ] operations = [ migrations.CreateModel( ...
bsd-3-clause
1,396,863,322,107,834,600
33.566667
127
0.594986
false
jfalkner/report_data
report_data/check.py
1
3654
from datetime import datetime from datetime import timedelta from datetime import date class SanityChecker: """Validate input from URL arguments. This helps keep code that needs to check input succinct and consistent across the various reports. The main purpose for encapsulating these methods is so t...
mit
3,428,162,843,007,612,000
40.05618
78
0.574165
false
CMacKinnon101/pokemon-python-api-adapter
get_cards_from_sets.py
1
3637
#Modules import configparser from pokemontcgsdk import Set from pokemontcgsdk import Card from pymongo import MongoClient #Config Config = configparser.ConfigParser() Config.read("settings.ini") host = Config.get("db", "host") port = Config.get("db", "port") user = Config.get("db", "user") password = Config.get("db", ...
mit
3,130,499,382,758,920,000
35.38
110
0.606819
false
michaldz44/pyG-Attract
golem.py
1
3778
import math import pdb class Golem(object): def __init__(self, x, y, args, attractors,golem_number): self.attractors=attractors self.args=args self.position=complex(x,y) self.velocity=complex(0,0) #self.acceleration_previous=self.attractors.get_force(self.position,self.veloc...
gpl-2.0
6,252,138,201,953,294,000
35.679612
153
0.618052
false
KnowledgeLinks/rdfframework
rdfframework/utilities/valuecalculator.py
1
1389
import datetime import pytz # try: # from rdfframework.utilities import iri, uri # except ImportError: # # Try Local Import # from . import iri, uri # def calculate_default_value(field): # '''calculates the default value based on the field default input''' # _calculation_string = field.get("kds_de...
mit
-6,869,284,743,283,799,000
39.852941
91
0.572354
false
aliunsal/blog
Blogs/models.py
1
1247
from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.generic import GenericForeignKey, GenericRelation class Comment(models.Model): content = models.TextField(null=False) date = models.DateTimeField...
gpl-2.0
1,953,466,976,391,067,100
31.842105
82
0.705694
false
botswana-harvard/edc-visit-tracking
edc_visit_tracking/form_validators/visit_form_validator.py
1
4772
from django import forms from edc_constants.constants import OTHER, ALIVE, DEAD, YES, UNKNOWN from edc_constants.constants import PARTICIPANT, NO from edc_form_validators import FormValidator from edc_form_validators.base_form_validator import REQUIRED_ERROR,\ INVALID_ERROR from ..constants import MISSED_VISIT, LO...
gpl-2.0
4,630,544,670,171,520,000
38.438017
81
0.582775
false
pyload/pyload
src/pyload/plugins/downloaders/ZDF.py
1
2269
# -*- coding: utf-8 -*- import re import json import os from pyload.core.network.request_factory import get_url import xml.etree.ElementTree as etree import pycurl from ..base.downloader import BaseDownloader # Based on zdfm by Roland Beermann (http://github.com/enkore/zdfm/) class ZDF(BaseDownloader): __name__...
agpl-3.0
-6,561,568,899,936,143,000
32.865672
88
0.527545
false
seleniumbase/SeleniumBase
seleniumbase/core/download_helper.py
1
2057
import os import shutil import time from seleniumbase.config import settings from seleniumbase.fixtures import constants # The "downloads_folder" is a folder for saving downloaded files. # Works for downloads initiated by Chromium and Firefox WebDriver clicks. # Browser type doesn't matter if using self.download_file(...
mit
-4,152,373,432,248,076,000
36.4
79
0.674283
false
CountZer0/PipelineConstructionSet
python/maya/site-packages/pymel-1.0.5/pymel/core/nodetypes.py
1
123778
""" Contains classes corresponding to the Maya type hierarchy, including `DependNode`, `Transform`, `Mesh`, and `Camera`. """ import sys, os, re import inspect, itertools, math import pymel.util as _util import pymel.internal.pmcmds as cmds #@UnresolvedImport import pymel.internal.factories as _factories import pymel....
bsd-3-clause
638,128,032,992,870,800
36.748704
531
0.560318
false
google-research/google-research
optimizing_interpretability/imagenet/utils.py
1
6411
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
4,932,138,354,840,355,000
33.842391
80
0.676182
false
lorddex/linux_tools
virtual_testbeds/add_hosts.py
1
2360
#!/usr/bin/python # script that adds a VM who requests an IP address using the dhcpd to local hosts file import sys import subprocess import string import time debug_file="/var/log/add_hosts.log" def debug(message): message = time.strftime("%d %b %Y %H:%M:%S") + " " + message print message fd = open(debug_file, "...
mit
8,233,084,119,662,574,000
20.454545
86
0.642373
false
nioo-knaw/hydra
conf.py
1
7810
import logging import multiprocessing import re import os import tempfile import yaml import sys from collections import OrderedDict import click import urllib # Adapted from: https://github.com/pnnl/atlas/blob/master/atlas/conf.py logging.basicConfig(level=logging.INFO, datefmt="%Y-%m-%d %H:%M", format="[%(asctime)s...
mit
9,045,070,109,480,767,000
43.628571
259
0.61831
false
jromang/retina
gui/workspace.py
1
1423
# Copyright (C) 2013-2016 Jean-Francois Romang (jromang@posteo.de) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # #...
gpl-3.0
-2,353,139,725,358,365,700
33.707317
71
0.735067
false
Hao-Liu/avocado
selftests/unit/test_xunit.py
1
1945
import argparse import unittest import os import sys from xml.dom import minidom import tempfile import shutil from avocado import Test from avocado.core.plugins import xunit from avocado.core import job class ParseXMLError(Exception): pass class _Stream(object): def start_file_logging(self, param1, param...
gpl-2.0
-2,193,562,886,374,426,000
23.3125
95
0.62108
false
reneetrei/agile-bayou-76491
snipts/urls.py
1
2076
from django.conf.urls import * from snipts import views urlpatterns = \ patterns('', url(r'^s/(?P<snipt_key>[^/]+)/(?P<lexer>[^\?]+)?$', views.redirect_snipt, name='redirect-snipt'), url(r'^(?P<username>[^/]+)/feed/$', views.redirect_user_feed, ...
mit
-6,723,413,863,394,528,000
40.52
82
0.406069
false
frac/celery
celery/signals.py
1
6128
""" ============== celery.signals ============== Signals allows decoupled applications to receive notifications when certain actions occur elsewhere in the application. :copyright: (c) 2009 - 2011 by Ask Solem. :license: BSD, see LICENSE for more details. .. contents:: :local: .. _signal-basics: Basics ====== ...
bsd-3-clause
-1,422,268,699,349,315,800
19.426667
75
0.6578
false
fullmetalfelix/ML-CSC-tutorial
data/descriptor_codes/charge.mbtr.py
1
2490
from __future__ import print_function from describe.descriptors import LMBTR from describe.core import System from describe.data.element_data import numbers_to_symbols import numpy as np from scipy.sparse import lil_matrix, save_npz from read_binary import * data = read_b('../binary/database-mulliken-ccsd-spd.bin') d...
gpl-3.0
3,026,851,773,269,828,600
29.740741
107
0.538554
false
ideal/drummer
drummer/common.py
1
1045
# # Copyright (C) 2016 Shang Yuanchun <idealities@gmail.com> # # You may 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. # # drummer is distributed in the hope ...
gpl-3.0
-9,059,040,297,306,448,000
26.5
67
0.712919
false
arnau-prat/My-Raspersonal-assistant
assets/brain.py
1
1572
#!/usr/bin/python # -*- coding: utf-8 -*- import cv2 import threading import time import subprocess import os import signal from datetime import datetime from modules import tracker, calendar, alarm, wolfram, music class Brain: def __init__(self): self.tracker = tracker.Tracker() self.alarm = alarm....
mit
-7,316,954,540,866,034,000
25.2
62
0.583333
false
leosartaj/autosign
tests/test_removeSign.py
1
1228
#!/usr/bin/env python2 ## # autosign # https://github.com/leosartaj/autosign.git # # copyright (c) 2014 sartaj singh # licensed under the mit license. ## import unittest import os, shutil import helper from autosign.main import removeSign, isSign from autosign.exce import UnsignedError class TestremoveSign(unittest...
mit
1,194,473,589,334,884,000
29.7
84
0.69544
false
tomadasocial/tomada-social
tomadasocial/settings.py
1
3965
""" Django settings for tomadasocial project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, .....
gpl-2.0
-515,293,318,295,498,900
28.819549
123
0.735183
false
zostera/django-bootstrap4
tests/test_settings.py
1
2426
from django.test import TestCase, override_settings from bootstrap4.bootstrap import get_bootstrap_setting, include_jquery, jquery_slim_url, jquery_url class SettingsTest(TestCase): def test_get_bootstrap_setting(self): self.assertIsNone(get_bootstrap_setting("SETTING_DOES_NOT_EXIST")) self.asser...
bsd-3-clause
1,537,482,120,237,771,500
38.129032
103
0.576257
false
tmaiwald/OSIM
OSIM/Optimizations/OptimizationComponents/Optimizable.py
1
1217
class Optimizable(object): def __init__(self,comp_names_list,paramname,valfrom,valto,**kwargs): self.names = comp_names_list self.paramname = paramname self.minStep = 2 #default self.vFrom = valfrom self.vTo = valto self.val = 0 for name, value in kwargs.it...
bsd-2-clause
6,869,095,868,445,226,000
22.862745
72
0.557108
false
pymedusa/SickRage
medusa/init/logconfig.py
1
2929
# coding=utf-8 """Monkey-patch logger functions to accept enhanced format styles.""" from __future__ import unicode_literals import logging from builtins import object try: from inspect import getfullargspec except ImportError: from inspect import getargspec as getfullargspec from six import text_type clas...
gpl-3.0
4,170,883,745,947,611,000
26.632075
120
0.613861
false
zagl/led-tool
ui_main.py
1
27811
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui_main.ui' # # Created: Sun Apr 3 16:50:44 2016 # by: PyQt4 UI code generator 4.11.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attrib...
gpl-3.0
8,376,805,521,591,974,000
64.893365
190
0.706405
false
syucream/mrubook
conf.py
1
9757
# -*- coding: utf-8 -*- # # mrubook documentation build configuration file, created by # sphinx-quickstart on Sat Dec 3 14:17:42 2016. # # 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 # autogenerated file. # # A...
mit
-4,150,921,000,730,676,000
27.866864
80
0.691196
false
ukch/refugeedata
refugeedata/distribution/decorators.py
1
2228
import datetime import functools from pyratemp import TemplateSyntaxError, TemplateRenderError from django.contrib.auth import PermissionDenied from django.shortcuts import get_object_or_404, redirect, render from refugeedata.models import Distribution, Template from .forms import DistributionHashForm def standar...
mit
-3,910,878,151,373,112,300
35.52459
79
0.584829
false
mvo5/snapcraft
tests/unit/sources/test_mercurial.py
1
9010
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
gpl-3.0
7,427,885,006,021,944,000
32.87218
85
0.602442
false
Distrotech/reportlab
src/reportlab/platypus/flowables.py
1
72939
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/flowables.py __version__=''' $Id$ ''' __doc__=""" A flowable is a "floating element" in a document whose exact position is determined by the o...
bsd-3-clause
4,462,128,863,631,193,600
35.542585
152
0.5512
false
blendit/crowd
GUI_crowd_MapPanel.py
1
6603
import bpy from bpy.types import Menu, Panel from bpy.props import * import os import sys import subprocess import ast script_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(script_dir) # Get system's python path proc = subprocess.Popen('python3 -c "import sys; prin...
gpl-3.0
137,303,051,667,729,950
25.625
103
0.593518
false
stefantkeller/VECSELsetup
exp/eval/light_light.py
1
8684
#! /usr/bin/python2.7 # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import errorvalues as ev # github.com/stefantkeller/errorvalues from VECSELsetup.eval.varycolor import varycolor from VECSELsetup.eval.gen_functions import load, extract, plotinstructions_write, plotinstructions_read, lu...
mit
7,744,530,179,776,189,000
37.767857
206
0.551474
false
metamx/Diamond
src/collectors/rabbitmq/rabbitmq.py
1
5518
# coding=utf-8 """ Collects data from RabbitMQ through the admin interface #### Notes ** With added support for breaking down queue metrics by vhost, we have attempted to keep results generated by existing configurations from changing. This means that the old behaviour of clobbering queue metrics whe...
mit
3,951,124,300,809,999,000
35.065359
80
0.531171
false
jenisys/behave
examples/async_step/features/environment.py
2
1530
# -*- coding: UTF-8 -*- from behave.tag_matcher import ActiveTagMatcher, setup_active_tag_values from behave.api.runtime_constraint import require_min_python_version from behave import python_feature # ----------------------------------------------------------------------------- # REQUIRE: python >= 3.4 # ----------...
bsd-2-clause
-7,307,714,831,485,707,000
38.230769
79
0.515033
false
EDUlib/edx-platform
common/lib/xmodule/xmodule/modulestore/exceptions.py
1
3789
""" Exceptions thrown by KeyStore objects """ class ItemNotFoundError(Exception): pass class ItemWriteConflictError(Exception): pass class MultipleCourseBlocksFound(Exception): """ Raise this exception when Iterating over the course blocks return multiple course blocks. """ pass # lint-am...
agpl-3.0
3,610,771,503,910,648,300
29.071429
166
0.663236
false
stormi/tsunami
src/primaires/scripting/parser/nombre.py
1
3620
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
bsd-3-clause
-257,016,107,874,898,900
33.692308
79
0.660754
false
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_3_0_0/models/relatedperson_tests.py
1
7168
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 3.0.0.11832 on 2017-03-22. # 2017, SMART Health IT. import io import json import os import unittest from . import relatedperson from .fhirdate import FHIRDate class RelatedPersonTests(unittest.TestCase): def instantiate_from(self, filename...
bsd-3-clause
8,045,643,496,570,569,000
47.734694
95
0.664294
false
peterayeni/django-smsgateway
smsgateway/south_migrations/0006_auto__add_field_queuedsms_using.py
1
2515
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'QueuedSMS.using' db.add_column('smsgateway_queuedsms', 'using', self.gf('django.db.models....
bsd-3-clause
799,461,428,937,790,200
51.395833
160
0.561829
false
Zokol/The-Great-Dalmuti
dalmut.py
1
8497
import random """ THE GREAT DALMUTI Heikki "Zokol" Juva 2015 - heikki@juva.lu """ ## Exception raised when all players have skipped the round class SkipException(Exception): pass class RestartRound(Exception): pass class Card: def __init__(self, value): self.value = value def __repr__(self): return "Card:...
mit
-4,180,557,527,489,499,000
26.237179
120
0.645993
false
hpd/MitsubaForMaya
plug-ins/mitsuba/volumes/volume.py
1
2498
import sys import maya.OpenMaya as OpenMaya import maya.OpenMayaMPx as OpenMayaMPx kPluginNodeName = "MitsubaVolume" kPluginNodeClassify = "shader/volume" kPluginNodeId = OpenMaya.MTypeId(0x87033) class volume(OpenMayaMPx.MPxNode): def __init__(self): OpenMayaMPx.MPxNode.__init__(self) mSourcefile...
mit
-3,909,570,042,202,730,500
29.463415
96
0.658927
false
awwong1/CMPUT404LAB9_W2016
iguana/iguana/urls.py
1
1469
"""iguana 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-base...
mit
7,628,134,095,978,440,000
38.702703
83
0.724983
false
dborzov/practicin
67-binary-heap/solution.py
1
1403
class Heap: def __init__(self): self.bh = [] def pop(self): if len(self.bh)==0: raise StandardError('No more elements in the heap') if len(self.bh)==1: return self.bh.pop() return_value, self.bh[0] = self.bh[0], self.bh[-1] self.bh = self.bh[:len(self.bh)-1] ...
mit
-2,426,201,212,558,269,400
30.177778
85
0.570207
false
NeCTAR-RC/cinder
cinder/tests/test_netapp_nfs.py
1
47792
# Copyright (c) 2012 NetApp, 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 require...
apache-2.0
4,882,235,889,434,253,000
38.926483
79
0.579951
false
sajuptpm/neutron-ipam
neutron/tests/unit/bigswitch/test_capabilities.py
1
2608
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 Big Switch Networks, 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/lice...
apache-2.0
-2,216,588,186,026,200,800
39.123077
79
0.61273
false
fastavro/fastavro
fastavro/_write_py.py
1
22640
# cython: auto_cpdef=True """Python code for writing AVRO files""" # This code is a modified version of the code at # http://svn.apache.org/viewvc/avro/trunk/lang/py/src/avro/ which is under # Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0) import json from io import BytesIO from os import urandom, S...
mit
5,944,205,814,396,213,000
31.906977
88
0.60371
false
songmonit/CTTMSONLINE_V8
openerp/release.py
1
2596
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
7,346,447,488,891,795,000
45.357143
117
0.645223
false
orcmkit/ORCmKit
Python27/ORCSim/LiquidReceiver.py
1
4981
from __future__ import division from CoolProp.CoolProp import PropsSI import pylab from ACHPTools import Write2CSV from matplotlib.pyplot import plot, show, figure, semilogy, xlim, ylim, title, xlabel, ylabel, legend from math import pi,exp,log,sqrt,tan,cos,sin from scipy.optimize import brentq from scipy.constants i...
mit
3,989,023,316,795,235,300
37.323077
116
0.598474
false
jar3k/django-model-options
model_options/mixins.py
1
1737
from django.contrib.contenttypes.fields import GenericRelation from django.core.cache import cache from django.db import models, IntegrityError, transaction from .utils import detect_type from .models import Option class OptionsMixin(models.Model): options = GenericRelation(Option) class Meta: abst...
mit
-4,955,214,051,976,959,000
27.016129
74
0.633851
false
ericholscher/djangoembed
oembed/views.py
1
4618
import re from django.contrib.sites.models import Site from django.core.urlresolvers import reverse, get_resolver from django.http import HttpResponse, HttpResponseBadRequest, Http404 from django.template import defaultfilters from django.utils import simplejson from django.utils.encoding import smart_str import oemb...
mit
-8,876,648,113,996,773,000
31.293706
87
0.64097
false
schreiberx/sweet
benchmarks_sphere/report_konwihr_rexi_nl/compare_wt_dt_vs_accuracy_galewsky_new_rexi/rexi_benchmarks.py
1
8037
#! /usr/bin/env python3 import os import sys import math from itertools import product # REXI from mule_local.rexi.REXICoefficients import * from mule_local.rexi.pcirexi.BeanREXI import BeanREXI from mule_local.rexi.pcirexi.LRREXI import LRREXI from mule_local.rexi.trexi.TREXI import * from mule_local.rexi.cirexi.CI...
mit
-5,738,522,908,586,182,000
32.348548
126
0.520717
false
apdjustino/DRCOG_Urbansim
src/opus_gui/results_manager/run/indicator_framework/visualizer/visualizers/mapnik_animated_map.py
1
7430
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE import os from opus_core.logger import logger from opus_core.store.attribute_cache import AttributeCache from opus_core.simulation_state import Simulatio...
agpl-3.0
8,432,913,646,352,047,000
46.025316
166
0.517766
false
won0089/oppia
core/domain/skins_services.py
1
3513
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
-8,853,533,049,173,117,000
30.648649
77
0.619129
false
georgebv/coastlib
coastlib/stats/extreme.py
1
165750
# coastlib, a coastal engineering Python library # Copyright (C), 2019 Georgii Bocharov # # 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) a...
gpl-3.0
-9,124,196,757,702,102,000
45.572071
120
0.527463
false
harikishen/addons-server
src/olympia/editors/tests/test_sql_model.py
1
10512
# -*- coding: utf-8 -*- """Tests for SQL Model. Currently these tests are coupled tighly with MySQL """ from datetime import datetime from django.db import connection, models from django.db.models import Q import pytest from olympia.amo.tests import BaseTestCase from olympia.editors.sql_model import RawSQLModel d...
bsd-3-clause
-8,566,747,079,214,111,000
35.430556
78
0.551754
false
takmid/inasafe
safe_qgis/impact_functions_doc_base.py
1
9760
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'impact_functions_doc_base.ui' # # Created: Fri Sep 14 14:43:14 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromU...
gpl-3.0
9,172,954,171,871,963,000
57.795181
167
0.727254
false
jeffmkw/DAT210x-Lab
Module6/test.py
1
2927
import pandas as pd # https://archive.ics.uci.edu/ml/machine-learning-databases/mushroom/agaricus-lepiota.names # # TODO: Load up the mushroom dataset into dataframe 'X' # Verify you did it properly. # Indices shouldn't be doubled. # Header information is on the dataset's website at the UCI ML Repo # Check NA Encodi...
mit
-1,792,554,009,541,030,100
29.821053
113
0.65152
false
robertnishihara/ray
python/ray/tune/examples/ax_example.py
1
2352
"""This test checks that AxSearch is functional. It also checks that it is usable with a separate scheduler. """ import numpy as np import time import ray from ray import tune from ray.tune.schedulers import AsyncHyperBandScheduler from ray.tune.suggest.ax import AxSearch def hartmann6(x): alpha = np.array([1.0...
apache-2.0
-7,999,556,598,531,771,000
26.670588
79
0.517857
false
wesm/ibis
ibis/expr/datatypes.py
1
19843
# Copyright 2014 Cloudera 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 writing, so...
apache-2.0
-6,465,158,278,819,873,000
23.407134
79
0.545835
false
Mariaanisimova/pythonintask
IVTp/2014/Shcherbakov_R_A/task_09_22.py
1
1636
# Задача 9. Вариант 22. # Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен # его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток # узнать, есть ли какая-либо буква в слове, причем программа может отвечать только # "Да" и "Нет". Вслед за тем игрок должен попробо...
apache-2.0
3,770,639,365,246,442,000
31.571429
85
0.67807
false
dsonbill/DMPHive
xmlrsa.py
1
3988
import rsa import base64 import math import xml.etree.ElementTree as ET # Utility functions def bytes_to_int(byte_data): return int.from_bytes(byte_data, 'big') def bytes_from_int(integer): byte_length = math.ceil(integer.bit_length() / 8) return integer.to_bytes(byte_length, 'big') class RSA(): d...
cc0-1.0
-5,861,631,085,719,822,000
40.978947
113
0.650201
false
mice-software/maus
bin/scifi/GenerateMomentumCorrections.py
1
2173
#!/usr/bin/env python """ Generate an MC data file and calculate the required Pattern Recognition momentum corrections required for the track reconstruction. This will simulate MICE spills through the entirety of MICE using Geant4, then digitize and reconstruct tracker hits to space points. Finally a reducer is used...
gpl-3.0
8,634,506,744,995,396,000
34.622951
80
0.716521
false
AhmedFat7y/configure-c--projects-for-ssi
main.py
1
7785
import xml.etree.ElementTree as ET from os.path import isfile, join, abspath, dirname, lexists from os import listdir from sys import argv import argparse import pdb, getopt class ProjectConfigurator: #SSI_PLUGIN_SOURCE_DIRECTORY = "build\\%s" def __init__(self, argv): self.XML_TAG_SUFFIX = "%s" self.INPUT...
gpl-2.0
-5,115,269,590,821,743,000
48.278481
202
0.669878
false
Savvysherpa/provenance
provenance/migrations/env.py
1
2032
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from provenance import models # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # add your model's MetaData object here # for ...
mit
-6,248,009,298,735,235,000
28.449275
69
0.692913
false
novapost/python-pussycache
setup.py
1
2924
# -*- coding: utf-8 -*- """Python packaging.""" from os.path import abspath, dirname, join from setuptools import setup def read_relative_file(filename): """Returns contents of the given file, which path is supposed relative to this module.""" with open(join(dirname(abspath(__file__)), filename)) as f: ...
mit
-3,581,475,447,714,496,500
29.778947
78
0.588577
false
jokey2k/pyClanSphere
pyClanSphere/plugins/bulletin_board/database.py
1
3321
# -*- coding: utf-8 -*- """ pyClanSphere.plugins.bulletin_board.database ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Our needed tables are declared here (now) :copyright: (c) 2009 - 2010 by the pyClanSphere Team, see AUTHORS for more details. :license: BSD, see LICENSE for more de...
bsd-3-clause
-5,117,481,362,407,669,000
37.616279
113
0.662752
false
wrohdewald/Gpxity
gpxity/accounts.py
1
12247
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019 Wolfgang Rohdewald <wolfgang@rohdewald.de> # See LICENSE for details. # The source in this file is inspired by and partially identical with paramiko.config """Configuration file for accounts in Backends.""" import os import re import copy import te...
gpl-2.0
-6,233,281,037,619,963,000
30.16285
100
0.570344
false
mahim97/zulip
zerver/tests/test_outgoing_webhook_interfaces.py
8
4682
# -*- coding: utf-8 -*- from typing import Any import mock import json from requests.models import Response from zerver.lib.outgoing_webhook import GenericOutgoingWebhookService, \ SlackOutgoingWebhookService from zerver.lib.test_classes import ZulipTestCase from zerver.models import Service class TestGenericOut...
apache-2.0
5,945,918,141,294,065,000
44.456311
93
0.590773
false
franek/weboob
weboob/capabilities/gauge.py
1
3325
# -*- coding: utf-8 -*- # Copyright(C) 2010-2012 Romain Bignon, Florent Fourcot # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
agpl-3.0
1,626,210,802,505,838,600
27.663793
95
0.623459
false
Centurion89/ModLogin
modules/Square.py
1
2724
import requests import json from lxml import html from BaseModule import BaseModule class Square(BaseModule): def login(self, username, password, useragent): useragent = BaseModule().define_user_agent(useragent) headers = {'user-agent': useragent} session = requests.Session() logi...
mit
6,636,884,052,703,252,000
35.810811
75
0.517254
false
discos/basie
src/configobj/configobj.py
1
87684
# configobj.py # A config file reader/writer that supports nested sections in config files. # Copyright (C) 2005-2014: # (name) : (email) # Michael Foord: fuzzyman AT voidspace DOT org DOT uk # Nicola Larosa: nico AT tekNico DOT net # Rob Dennis: rdennis AT gmail DOT com # Eli Courtwright: eli AT courtwright DOT org #...
bsd-3-clause
-3,679,440,947,610,029,600
34.399273
114
0.527565
false
gjost/django-linkpile
runtests.py
1
1091
import sys try: from django.conf import settings settings.configure( DEBUG=True, USE_TZ=True, DATABASES={ "default": { "ENGINE": "django.db.backends.sqlite3", } }, ROOT_URLCONF="linkpile.urls", INSTALLED_APPS=[ ...
bsd-3-clause
8,139,445,616,342,015,000
20
85
0.549954
false
procool/mygw
web/apps/cabinet/views.py
1
2966
import logging import datetime from sqlalchemy import func, and_, or_, not_ from flask import url_for, session from misc.mixins import myTemplateView, JSONView from utils.arp_list import get_mac_by_ip from models.all_models import InetEther, ARPCache from models.session import session from utils.server.http_client...
bsd-2-clause
-5,029,251,846,019,144,000
34.73494
113
0.633176
false
rdegges/django-twilio
setup.py
1
3277
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from os.path import abspath, dirname, join, normpath from setuptools import find_packages, setup import sys INSTALL_PYTHON_REQUIRES = [] # We are intending to keep up to date with the supported Django versions. # For the official suppor...
unlicense
6,593,338,256,977,965,000
37.552941
223
0.646628
false
sclc/NAEF
exp_scripts/worker_exp_160531.py
1
13711
""" Experiment Diary 2016-05-31 """ import sys import math import matplotlib.pyplot as plt from scipy import io import numpy as np from scipy.sparse.linalg import * sys.path.append("../src/") from worker import Worker from native_conjugate_gradient import NativeConjugateGradient from native_conjugate_gradient import ...
gpl-3.0
3,732,410,133,351,646,000
44.703333
138
0.594924
false
xjchensz/LSFS
LSFS/LSFS_TEST.py
1
1803
#!usr/bin/python # -*- coding:utf-8 -*- import pandas as pd import numpy as np import scipy as sp import os import random import time import sys def append_module_path(): import sys paths = [ \ "../gen_data", "../evaluate", "../read_data" ] for path in paths: if pa...
gpl-3.0
-6,408,282,040,506,266,000
21
104
0.533555
false