repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
hltdi/semeval2013
src/wsd_problem.py
1
2767
#!/usr/bin/env python3 import nltk from nltk.stem import wordnet wnl = wordnet.WordNetLemmatizer() import stanford START = "QQQSTARTHEADQQQ" END = "QQQENDHEADQQQ" class WSDProblem: """Class where we'll stash all the information about a given WSD problem.""" ## XXX(alexr): We should lemmatize English with t...
gpl-3.0
-2,710,983,922,552,886,000
36.391892
80
0.593061
false
3.941595
false
false
false
pscholz/presto
python/ppdot_plane_plot.py
2
5101
import numpy as np import psr_utils as pu import pypsrcat as cat import matplotlib.pyplot as plt # Use color? usecolor = True # Find a list of the "good" pulsars: those not in GCs and with a measured pdot # Also identify which pulsars are "special" numgood = 0 numGC = 0 numpd0 = 0 ps = [] pds = [] rrats = [] radios ...
gpl-2.0
-7,935,937,603,286,430,000
31.081761
79
0.622623
false
2.539074
false
false
false
nicolasmartinelli/9gag-to-rss
addons/instagram/crawler.py
3
4030
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import logging import multiprocessing as mp from base.db import Article from base.crawler import CrawlerBase from bs4 import BeautifulSoup from mako.template import Template l = logging.getLogger(__name__) def _get_full_size_src_mp(url, http_session, root_...
mit
-5,625,885,263,044,232,000
35.306306
127
0.487097
false
4.314775
false
false
false
vakaras/nmadb-utils
src/nmadb_utils/models.py
1
1208
from django.db import models from django.utils.translation import ugettext_lazy as _ class DownloadSelection(models.Model): """ DownloadSelection for download as action in admin. """ AVAILABLE_WRITERS = ( (u'CSV', _(u'Comma separated values')), (u'ODS', _(u'Open document spreadshe...
lgpl-3.0
7,082,368,652,606,594,000
25.844444
68
0.528146
false
4.268551
false
false
false
terotic/digihel
digihel/settings.py
1
6952
""" Django settings for digihel project. Generated by 'django-admin startproject' using Django 1.9.6. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ # Build path...
mit
-4,042,650,990,098,023,400
25.738462
114
0.661968
false
3.389566
false
false
false
zebus3d/varios_blender
obtener_islas_de_un_objeto.py
1
2153
import bpy, bmesh from timeit import default_timer as timer bpy.app.debug = True ob = bpy.data.objects['Cube'] visited = [] # raw contains the information in one dimension raw = [] island = [] bpy.ops.object.mode_set(mode='EDIT') mesh=bmesh.from_edit_mesh(bpy.context.object.data) def detectByFaces(): bpy.ops.me...
gpl-3.0
-4,818,685,304,788,376,000
31.134328
67
0.55922
false
3.712069
false
false
false
ratt-ru/bullseye
misc/uv_parametric_equations.py
1
4870
#/usr/bin/python ''' Bullseye: An accelerated targeted facet imager Category: Radio Astronomy / Widefield synthesis imaging Authors: Benjamin Hugo, Oleg Smirnov, Cyril Tasse, James Gain Contact: hgxben001@myuct.ac.za Copyright (C) 2014-2015 Rhodes Centre for Radio Astronomy Techniques and Technologies Department of P...
gpl-2.0
-1,982,821,304,188,233,200
42.106195
127
0.710062
false
2.928443
false
false
false
looooo/pivy
pivy/quarter/SensorManager.py
1
4448
### # Copyright (c) 2002-2008 Kongsberg SIM # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS...
isc
5,737,549,959,100,771,000
35.760331
102
0.663894
false
4.23619
false
false
false
nischalsheth/contrail-controller
src/config/api-server/tests/test_quota.py
1
7557
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import gevent import os import sys import uuid import logging import coverage import testtools from testtools.matchers import Equals, MismatchError, Not, Contains from testtools import content, content_type, ExpectedException from vnc_api.vnc_api i...
apache-2.0
2,870,916,295,651,654,000
38.565445
98
0.598783
false
3.648962
true
false
false
raghavmittal101/moodle-fetch
main.py
1
3942
import mechanize import getpass import re import os.path from config import PATH # url for login page of NU moodle. NOTE: DO NOT CHANGE URL_login = 'https://moodle.niituniversity.in/moodle/login/index.php' # url for page where all current course corresponding to user is present. NOTE: DO NOT CHANGE URL_course_list_pa...
gpl-3.0
-6,957,518,923,073,520,000
32.134454
127
0.58346
false
4.136411
false
false
false
ehuelsmann/openipam
openIPAM/openipam/utilities/validation.py
1
1964
# Functions for validation that shouldn't even exist. import openipam.iptypes import re # useful regexes # * MAC address mac = "[0-9a-fA-F][0-9a-fA-F][:\-.]?[0-9a-fA-F][0-9a-fA-F][:\-.]?[0-9a-fA-F][0-9a-fA-F][:\-.]?[0-9a-fA-F][0-9a-fA-F][:\-.]?[0-9a-fA-F][0-9a-fA-F][:\-.]?[0-9a-fA-F][0-9a-fA-F]" # * FQDN fqdn = "([...
gpl-3.0
-4,129,550,929,150,875,000
25.186667
175
0.64002
false
2.517949
false
false
false
prarthitm/edxplatform
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
1
40231
# -*- coding: utf-8 -*- """ Test cases to cover Accounts-related behaviors of the User API application """ import datetime import ddt import hashlib import json import unittest from collections import OrderedDict from copy import deepcopy from mock import patch from nose.plugins.attrib import attr from pytz import UTC...
agpl-3.0
2,203,296,459,711,049,000
44.520951
120
0.642344
false
4.049874
true
false
false
pybrain/pybrain
pybrain/rl/environments/mazes/tasks/tiger.py
25
1400
__author__ = 'Tom Schaul, tom@idsia.ch' from random import choice, random from scipy import array from .pomdp import POMDPTask class TigerTask(POMDPTask): """ two doors, behind one is a tiger - we can listen or open. """ observations = 2 actions = 3 minReward = -100 discount = 0.75 # allow...
bsd-3-clause
-86,628,770,394,768,240
24
76
0.564286
false
3.693931
false
false
false
centrofermi/e3pipe
display/E3EventDisplay.py
1
7939
#!/usr/bin/env python # ********************************************************************* # * Copyright (C) 2015 Luca Baldini (luca.baldini@pi.infn.it) * # * * # * For the license terms see the file LICENCE, distributed * # * along ...
gpl-3.0
5,599,689,724,451,405,000
34.761261
80
0.551455
false
3.861381
false
false
false
wileykestner/minesweeper
minesweeper/create_minefield.py
1
3675
from abc import ABCMeta, abstractmethod from random import sample from typing import Callable, Sequence, AbstractSet, Any from uuid import UUID from minesweeper.common.persistence import TurnRepository, MinefieldRepository from minesweeper.common.values import Board, TurnAction, Coordinate, Turn, GameState class Min...
mit
-3,187,294,598,967,294,500
45.518987
118
0.603537
false
4.449153
false
false
false
nianyuguai/mysite
webblog/webblog/settings.py
1
2192
""" Django settings for webblog 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, ...) im...
mit
953,666,629,004,469,500
21.608247
71
0.710766
false
3.140401
false
false
false
caisq/tensorflow
tensorflow/python/training/checkpointable/tracking_test.py
2
6361
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
8,924,778,769,252,289,000
36.19883
80
0.682754
false
3.500826
true
false
false
Tietokilta/pykirjanpito
add_event.py
1
2292
# -*- coding: utf-8 -*- import argparse import datetime import tik import re import sys import database from decimal import Decimal from validate_email import validate_email from database import db from models import Event, Order event_name = raw_input("Tapahtuman nimi: ") keyword = raw_input("Keyword: ") regular_exp...
mit
-4,039,740,537,666,940,000
18.598291
82
0.531414
false
3.559006
false
false
false
nmoya/alvanista-exporter
app.py
1
1805
from bs4 import BeautifulSoup import urllib2 import json import sys def get_html_from_url(url): response = urllib2.urlopen(url) return response.read() def clean_plataform(plataform): plataform = plataform.replace("-", " ") if plataform == "ios": return "iOS" else: plataform = plataform.lower() tmp = [] ...
mit
-6,549,888,095,342,092,000
21.296296
82
0.634349
false
2.638889
false
false
false
rainwoodman/kdcount
kdcount/tests/test_correlate.py
1
3912
from kdcount import correlate import numpy from numpy.testing import assert_almost_equal, assert_allclose, assert_array_less, assert_equal def test_simple(): numpy.random.seed(1234) pos = numpy.random.uniform(size=(10, 3)) dataset = correlate.points(pos, boxsize=1.0) # use the python point point coun...
gpl-3.0
-5,076,549,380,068,091,000
35.560748
102
0.675613
false
2.836838
true
false
false
Pexego/alimentacion
product_cost_management/cost_structure_elements.py
2
3691
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved # $Marta Vázquez Rodríguez$ <marta@pexego.es> # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
-3,578,477,742,069,141,000
41.883721
78
0.495119
false
4.422062
false
false
false
xuru/pyvisdk
pyvisdk/mo/alarm.py
1
1435
from pyvisdk.base.managed_object_types import ManagedObjectTypes from pyvisdk.mo.extensible_managed_object import ExtensibleManagedObject import logging ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) class...
mit
-6,728,643,739,050,034,000
30.911111
90
0.639024
false
4.815436
false
false
false
mupi/tecsaladeaula
reports/serializer.py
1
2223
# -*- coding: utf-8 -*- from rest_framework import serializers, pagination from core.models import CourseStudent, Course from accounts.serializers import TimtecProfileSerializer class UserCourseStatsSerializer(serializers.ModelSerializer): user = TimtecProfileSerializer(required=False, read_only=True) cour...
agpl-3.0
2,404,577,588,839,340,500
31.217391
88
0.708502
false
4.071429
false
false
false
awemulya/fieldsight-kobocat
onadata/apps/fsforms/migrations/0034_finstance_instancestatuschanged.py
1
2072
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fieldsight', '0013_blueprints'), ('logger', '0005_remove_xform_site'), ('fsforms', '0033_remove_formgroup_shared_level'), ...
bsd-2-clause
-5,284,308,446,096,594,000
52.128205
148
0.589768
false
3.902072
false
false
false
shootstar/ctest
ceilometer/network/notifications.py
2
5655
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Author: Julien Danjou <julien@danjou.info> # # 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:...
apache-2.0
3,145,617,463,272,703,000
28.602094
77
0.562787
false
4.469565
false
false
false
rdugue/Shifty_aws
shifty_utils/__init__.py
1
4854
''' This file is for implementing API response method and database helper methods. ''' from __future__ import print_function # Python 2/3 compatibility import json import boto3 from botocore.exceptions import ClientError dynamo = boto3.resource('dynamodb') def respond(err, res=None): return { 'statusCode'...
apache-2.0
3,164,083,111,383,516,000
28.065868
90
0.493201
false
4.287986
false
false
false
lucasw/simple_sim_ros
bullet_server/scripts/load_urdf.py
1
3338
#!/usr/bin/env python # Lucas Walter 2016 import rospy from bullet_server.msg import Body, Constraint, Heightfield, Impulse from bullet_server.srv import * from urdf_parser_py.urdf import URDF class LoadUrdf: def __init__(self): # self.param_name = rospy.get_param('~robot_description', 'robot_descriptio...
gpl-3.0
-7,444,634,461,991,612,000
37.367816
98
0.563811
false
3.950296
false
false
false
deathglitch/metarigging
python/metautil/miscutil.py
1
14324
import pymel.core as pm import maya.cmds as cmds import metautil def import_into_namespace(path, ns): ns = metautil.get_unique_name(ns) cmds.file(path, i=1, type='mayaAscii', ns=ns, ra=1, options='v=0') return def get_project_data_dir(): if not pm.optionVar(q='metaRiggingProjectDataDir'): ...
mit
-785,884,205,269,578,100
33.939024
220
0.57833
false
3.380694
false
false
false
thiagof/treeio
treeio/events/migrations/0001_initial.py
4
1674
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('identities', '0001_initial'), ('core', '0001_initial'), ] operations = [ migrations...
mit
-7,521,546,649,596,424,000
37.930233
165
0.544803
false
4.292308
false
false
false
Przemek625/MyFitnessWeight
registration/migrations/0001_initial.py
1
2877
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-01-01 02:24 from __future__ import unicode_literals import django.contrib.auth.models from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0...
gpl-3.0
8,140,340,933,983,442,000
58.9375
266
0.625652
false
4.339367
false
false
false
davislidaqing/Mcoderadius
toughradius/console/admin/ticket.py
5
3062
#!/usr/bin/env python # coding:utf-8 from bottle import Bottle from bottle import request from bottle import response from bottle import redirect from bottle import static_file from bottle import mako_template as render from tablib import Dataset from toughradius.console.websock import websock from toughradius.console...
agpl-3.0
6,778,837,535,131,794,000
38.506494
99
0.657791
false
3.342857
false
false
false
aykut/django-oscar
oscar/apps/discount/tests.py
1
1988
from decimal import Decimal as D import datetime from django.utils import unittest from oscar.test.helpers import create_product from oscar.apps.discount.models import DiscountOffer, PERCENTAGE_DISCOUNT, ABSOLUTE_DISCOUNT, FINAL_PRICE class PercentageDiscountOfferTest(unittest.TestCase): def setUp(self): ...
bsd-3-clause
5,171,348,179,293,431,000
36.528302
106
0.639839
false
3.729831
true
false
false
asm-products/cloudroutes-service
src/web/reactionforms/saltstack-services/__init__.py
3
3309
###################################################################### # Cloud Routes Web Application # ------------------------------------------------------------------- # SaltStack Services Reaction - Forms Class ###################################################################### from wtforms import TextField, S...
agpl-3.0
315,252,112,902,490,900
38.86747
397
0.599577
false
4.48374
false
false
false
nabla-c0d3/nassl
tests/SSL_test.py
1
7476
import pytest from nassl import _nassl from nassl import _nassl_legacy from nassl.ssl_client import SslClient, OpenSslVersionEnum, OpenSslVerifyEnum @pytest.mark.parametrize("nassl_module", [_nassl, _nassl_legacy]) class TestCommonSSL: def test_new(self, nassl_module): nassl_module.SSL(nassl_module.SSL_C...
agpl-3.0
-3,261,639,906,900,851,000
43.766467
100
0.687266
false
3.007241
true
false
false
kgori/treeCl
treeCl/utils/math.py
1
1304
import numpy as np import scipy def _preprocess_inputs(x, weights): """ Coerce inputs into compatible format """ if weights is None: w_arr = np.ones(len(x)) else: w_arr = np.array(weights) x_arr = np.array(x) if x_arr.ndim == 2: if w_arr.ndim == 1: w_arr ...
mit
1,560,645,988,359,512,300
28.636364
87
0.618098
false
2.936937
false
false
false
toenuff/treadmill
lib/python/treadmill/rest/api/__init__.py
1
2087
"""Treadmill REST APIs""" from __future__ import absolute_import import os import logging import importlib import pkgutil import flask # E0611: Used when a name cannot be found in a module. # F0401: Used when PyLint has been unable to import a module. # # pylint: disable=E0611,F0401 import flask_restplus as restplus ...
apache-2.0
-8,736,509,351,489,170,000
27.589041
70
0.629612
false
3.661404
false
false
false
jamesmfriedman/django-primer
primer/push/pusher/__init__.py
2
5811
import httplib, time, sys, hmac try: import json # some old versions of json lib don't implement dumps() if not hasattr(json, "dumps"): raise ImportError except ImportError: import simplejson as json # 2.4 hashlib implementation: http://code.krypto.org/python/hashlib/ import hashlib import os ...
apache-2.0
5,412,780,897,541,637,000
34.650307
137
0.630872
false
3.578202
false
false
false
lodemo/CATANA
src/data_collection/youtubeAPICrawler/youtubeAPICrawler/spiders/sbladeNetwork.py
1
2682
# -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2017 Moritz Lode # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
mit
-2,528,161,540,335,857,700
34.773333
109
0.668531
false
4.197183
false
false
false
virtus80/python_training
test/test_phones.py
1
3797
from random import randrange from model.contact import Contact import re def test_phones_on_home_page(app): contact_from_home_page = app.contact.get_contact_list()[0] contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0) assert contact_from_home_page.all_phones_from_homepage == merge_pho...
apache-2.0
-8,637,680,376,341,558,000
61.245902
167
0.644193
false
3.538677
false
false
false
spiffcode/hostile-takeover
utilities/condition.py
1
3436
class QualifiedNumber: def __init__(self, txt): args = txt.split(',') self.txt = txt self.qualifier = int(args[0]) self.number = int(args[1]) def __repr__(self): d = ['AtLeast', 'AtMost', 'Exactly'] return '%s: %s %d' % (self.__class__.__name__, d[self.qualifier]...
bsd-2-clause
8,205,590,379,229,745,000
27.87395
86
0.589348
false
3.556936
false
false
false
tristan-hunt/UVaProblems
Strings/convert_c_comments.py
1
1497
# Call this program by: # > cat <old.c> | python3 convert_c_comments.py >| <new_file.c> # for use on linux, or # #> python convert_c_comments.py <old.c> > <new_file.c> # when using windows. # where <old.c> represents file with // style comments to be replaced by /* */ comments # Can we make it change for loops, as wel...
gpl-3.0
6,106,913,736,895,912,000
18.96
87
0.58183
false
2.608014
false
false
false
nsdown/zhihu-py3
zhihu/author.py
6
22725
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = '7sDream' import json import datetime from .common import * class Author: """用户类,请使用``ZhihuClient.answer``方法构造对象.""" @class_common_init(re_author_url, True) def __init__(self, url, name=None, motto=None, follower_num=None, q...
mit
-3,564,284,323,379,438,000
35.055184
79
0.486712
false
3.577402
false
false
false
kevin-zhaoshuai/zun
zun/db/sqlalchemy/alembic/versions/a9a92eebd9a8_create_table_zun_service.py
1
1718
# 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
8,381,220,129,995,975,000
34.791667
78
0.668801
false
3.632135
false
false
false
DoomHammer/ohWafHelpers
utilfuncs.py
1
21502
# FIXME more descriptive name (as valgrind only applicable to native code) def invoke_test(tsk): def print_vg_frame_component(frame, tag, prefix): o = frame.find(tag) if o != None: from xml.sax.saxutils import unescape print(' ' + prefix + ': ' + unescape(o.text)) # in...
bsd-2-clause
4,512,468,293,698,195,500
44.555085
164
0.57111
false
3.528389
true
false
false
cole/aiosmtplib
tests/test_commands.py
1
17893
""" Lower level SMTP command tests. """ import pytest from aiosmtplib import ( SMTPDataError, SMTPHeloError, SMTPNotSupported, SMTPResponseException, SMTPStatus, ) pytestmark = pytest.mark.asyncio() @pytest.fixture(scope="session") def bad_data_response_handler(request): async def bad_data_...
mit
-1,059,487,724,035,498,400
29.454855
88
0.68742
false
3.502547
true
false
false
ezequielpereira/Time-Line
timelinelib/wxgui/frames/helpbrowserframe/helpbrowserframe.py
2
8163
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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 th...
gpl-3.0
-174,582,379,653,521,440
36.791667
94
0.569521
false
3.741063
false
false
false
Mr-F/dotmailer
dotmailer/constants.py
1
2190
class ConstError(TypeError): pass class Constants(object): """ The constants object contains a list of constant values. These constant values have been predefined by DotMailer. """ def __init__(self): self.DEFAULT_ENDPOINT = 'https://r1-api.dotmailer.com' self.VISIBILITY...
mit
1,039,213,332,719,142,900
33.21875
86
0.651598
false
3.65
false
false
false
bitglue/shinysdr
shinysdr/plugins/import_hfcc.py
1
8938
# Copyright 2016 Kevin Reid <kpreid@switchb.org> # # This file is part of ShinySDR. # # ShinySDR 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...
gpl-3.0
-1,617,992,216,122,245,600
36.241667
253
0.559409
false
3.436371
false
false
false
crs4/vispa
galaxy/tools/demux.py
1
1586
# BEGIN_COPYRIGHT # # Copyright (C) 2013-2014 CRS4. # # This file is part of vispa. # # vispa 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 #...
gpl-3.0
6,522,037,114,521,898,000
26.824561
79
0.663304
false
3.324948
false
false
false
blitzmann/Pyfa
service/network.py
1
3859
# ============================================================================= # Copyright (C) 2014 Ryan Holmes # # This file is part of pyfa. # # pyfa 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 v...
gpl-3.0
5,322,914,120,367,207,000
32.850877
135
0.631511
false
4.23136
false
false
false
ElDeveloper/qiita
qiita_pet/test/test_public.py
3
2404
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
-7,088,165,026,072,212,000
35.424242
79
0.574043
false
4.331532
true
false
false
qualab/moody
songs/models.py
1
3557
# -*- coding: utf-8 -*- from django.db import models class Mood(models.Model): "Настроение пользователя" # поля данных name = models.CharField(max_length=64, unique=True, db_index=True) # краткое описание настроения image = models.ImageField(upload_to='moods', null=True) # строковое представлени...
mit
-5,741,884,456,102,094,000
30.088889
124
0.630093
false
2.23126
false
false
false
jleeothon/inquisition
inquisition/managers.py
1
2489
from functools import reduce from operator import and_ from operator import or_ from django.db import models from django.db.models import Q __all__ = [ 'LookupManager', 'LookupManagerMixin', 'OrderedSearchManager', 'OrderedSearchManagerMixin', 'SearchManager', 'SearchManagerMixin', ] class ...
mit
8,629,245,437,145,161,000
28.987952
78
0.650864
false
4.107261
false
false
false
mrnamingo/enigma2-test
lib/python/Screens/Menu.py
11
9359
from Screens.Screen import Screen from Screens.ParentalControlSetup import ProtectedScreen from Components.Sources.List import List from Components.ActionMap import NumberActionMap from Components.Sources.StaticText import StaticText from Components.config import configfile from Components.PluginComponent import plugin...
gpl-2.0
-5,369,029,922,418,398,000
27.975232
109
0.67379
false
3.163962
true
false
false
OldIronHorse/py-vigenere
vigenere.py
1
3092
#!/usr/bin/python3 from itertools import cycle,count import string import argparse import fileinput import sys def decryption_table(alphabet): return {k:{c:p for c,p in zip(alphabet[i:]+alphabet[:i],alphabet)} for i,k in zip(count(),alphabet)} def encryption_table(alphabet): return {k:{p:c for c,p in...
gpl-3.0
7,745,267,669,971,074,000
34.136364
79
0.626132
false
3.525656
false
false
false
SmartTeleMax/iktomi
iktomi/web/url.py
3
8239
# -*- coding: utf-8 -*- __all__ = ['URL'] import six if six.PY2: from urlparse import urlparse, parse_qs, unquote else:# pragma: no cover; we check coverage only in python2 part from urllib.parse import urlparse, parse_qs, unquote from webob.multidict import MultiDict from .url_templates import urlquote from ...
mit
9,093,898,058,234,089,000
34.978166
90
0.55832
false
4.048649
false
false
false
Intevation/ringo
ringo/scripts/modul.py
2
11203
import os import fnmatch import json import subprocess import uuid import transaction import pkg_resources from sqlalchemy import func from mako.lookup import TemplateLookup from ringo.lib.helpers import get_app_location, dynamic_import from ringo.scripts.db import ( get_session, create_new_revision ) from ringo.mo...
gpl-2.0
-3,691,877,340,169,492,500
30.469101
89
0.576185
false
3.605729
true
false
false
rspavel/spack
var/spack/repos/builtin/packages/interproscan/package.py
3
2898
# 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 Interproscan(Package): """InterProScan is the software package that allows sequences ...
lgpl-2.1
6,388,606,290,576,968,000
41.617647
104
0.638716
false
2.877855
false
false
false
Sutto/cloud-custodian
tools/c7n_azure/tests_azure/tests_resources/test_storage.py
1
25138
# Copyright 2015-2018 Capital One Services, 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 ...
apache-2.0
1,674,168,800,061,115,600
38.587402
100
0.53994
false
4.057134
true
false
false
hizni/vod-systems
vod_systems/vod/datatype_forms.py
1
3265
from django.forms import ModelForm from models import Datatype from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Field, Submit, HTML, Button from crispy_forms.bootstrap import FormActions from django.core.urlresolvers import reverse class DatatypeCreateUpdateForm(ModelForm): clas...
mit
-4,368,334,796,122,481,000
34.89011
98
0.54977
false
4.262402
false
false
false
rdezavalia/ansible
lib/ansible/playbook/role/definition.py
22
8278
# (c) 2014 Michael DeHaan, <michael@ansible.com> # # 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 ve...
gpl-3.0
3,214,734,355,607,982,000
38.798077
120
0.639164
false
4.182921
false
false
false
ThaWeatherman/scrapers
boardgamegeek/spider.py
1
1359
import re from bs4 import BeautifulSoup from scrapy.spiders import CrawlSpider from scrapy.item import Item, Field class Game(Item): id = Field() title = Field() geek_rate = Field() avg_rate = Field() num_votes = Field() class GameSpider(CrawlSpider): name = 'boardgamegeek_spider' allow...
mit
-7,615,587,536,834,520,000
32.146341
82
0.559971
false
3.449239
false
false
false
Arpapiemonte/openoise
tools/do_CreateReceiverPoints.py
1
8263
# -*- coding: utf-8 -*- """ /*************************************************************************** opeNoise Qgis Plugin to compute noise levels. ------------------- begin : March 2014 copyright : (C) 2014 by Arpa Piemonte email ...
gpl-2.0
6,714,454,561,379,317,000
38.161137
156
0.536609
false
4.224438
false
false
false
vmonaco/general-hough
src/GeneralHough.py
1
4517
''' Created on May 19, 2013 @author: vinnie ''' import os import numpy as np import matplotlib.pyplot as plt from collections import defaultdict from scipy.misc import imread from skimage.filter import canny from scipy.ndimage.filters import sobel # Good for the b/w test images used MIN_CANNY_THRESHOLD = 10 MAX_CANN...
mit
2,481,458,671,359,975,400
30.594406
85
0.640248
false
3.401355
true
false
false
KirillShaman/escalate_gspread
app/functions/views.py
1
7101
# The MIT License (MIT) # Escalate Copyright (c) [2014] [Chris Smith] # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, c...
mit
6,334,507,151,111,397,000
35.984375
130
0.716941
false
3.584553
false
false
false
Outernet-Project/librarian-core
tests/contrib/sessions/test_sessions.py
1
5036
import datetime import mock import pytest from librarian_core.contrib.sessions import sessions as mod def test_modifies(): instance = mock.Mock() instance.modified = False fn = mock.MagicMock() fn.__name__ = 'some_fn' fn.return_value = 'test' decorated = mod.modifies(fn) assert instance....
gpl-3.0
-6,095,786,289,934,080,000
30.672956
78
0.637212
false
3.388964
true
false
false
sebMathieu/dsima
simulator/src/xmlsolution.py
1
14858
##@package xmlsolution #@author Sebastien MATHIEU import time,re,zlib,zipfile,decimal from . import options ## Get the maximum value of an index. # @param vect Vector of elements. # @return value,index+1. def maxValueAndIndex(vect): val,index=max((abs(v), i) for i, v in enumerate(vect)) return vect[index...
bsd-3-clause
6,618,456,880,126,549,000
43.030303
165
0.650559
false
2.807634
false
false
false
davidgardenier/frbpoppy
frbpoppy/do_hist.py
1
2889
"""Bin up Pandas DataFrames into histograms ready for Bokeh plotting.""" import numpy as np import pandas as pd def histogram(dfs, n_bins=50, log=False, mc=False, cum=False): """ Quick function to 'histogram' each column of each dataframe. Args: dfs (list): List of dataframes n_bins (int)...
mit
6,823,513,293,529,142,000
25.027027
76
0.449637
false
3.562269
false
false
false
calfonso/python-citrination-client
citrination_client/search/pif/query/core/reference_query.py
1
7889
from citrination_client.search.pif.query.core.base_object_query import BaseObjectQuery from citrination_client.search.pif.query.core.field_operation import FieldOperation from citrination_client.search.pif.query.core.name_query import NameQuery from citrination_client.search.pif.query.core.pages_query import PagesQuery...
apache-2.0
6,672,685,153,202,742,000
28.996198
115
0.644315
false
4.060216
false
false
false
NaohiroTamura/python-ironicclient
ironicclient/v1/port_shell.py
1
7482
# Copyright 2013 Red Hat, 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 by...
apache-2.0
7,968,698,939,238,265,000
32.55157
78
0.618551
false
3.737263
false
false
false
ChrisTruncer/Just-Metadata
modules/intelgathering/get_bing.py
1
3424
''' This is a module that gathers hostnames from bing.com for the loaded IP addresses. ''' import json import re import time import urllib import urllib2 from common import helpers class IntelGather: def __init__(self): self.cli_name = "Bing_IP" self.description = "This module uses bing.com to s...
gpl-3.0
5,113,136,146,455,964,000
39.282353
142
0.529498
false
3.750274
false
false
false
mistercrunch/panoramix
tests/core_tests.py
1
59111
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-570,467,543,963,978,800
37.358858
103
0.57661
false
3.787953
true
false
false
Tooskich/python_core
blogs/migrations/0001_initial.py
1
1533
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Bloggers', fields=[ ('id', models.AutoField(ver...
apache-2.0
7,501,201,905,591,883,000
34.651163
114
0.519896
false
4.535503
false
false
false
mapbox/pygeobuf
geobuf/scripts/cli.py
1
2146
""" Pygeobuf's command line interface. `geobuf encode` and `geobuf decode` read and write to the standard IO streams. $ geobuf encode < foo.json > foo.pbf $ geobuf decode < foo.pbf > bar.json """ import json import logging import sys import click import geobuf logging.basicConfig(stream=sys.stderr, level=l...
isc
-3,168,712,139,862,465,000
26.512821
69
0.639795
false
3.719237
false
false
false
moneymaker365/plugin.video.ustvvod
resources/lib/stations/aetv.py
1
1699
#!/usr/bin/python # -*- coding: utf-8 -*- import common import main_aenetwork SITE = "aetv" NAME = "A&E" ALIAS = ["AETV"] DESCRIPTION = "A&E is Real Life. Drama. Now reaching more than 99 million homes, A&E is television that you can't turn away from; where unscripted shows are dramatic and scripted dramas are authen...
gpl-2.0
-41,977,454,920,680,920
57.586207
611
0.771042
false
2.753647
false
false
false
hamicornfury/storyscape.django-
src/medialibrary/views.py
1
8095
import datetime import os import commands, random, string from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from django.template.loader import render_to_string from django.core.paginator import Paginator from django.contrib.auth.decorators i...
mit
1,866,923,722,619,026,000
37.183962
144
0.5979
false
3.952637
false
false
false
LittleRichard/luxalert
nest/storage/luxalert/dao/ManagementCompanyDAO.py
1
1374
from nest.storage.luxalert import DatabaseConnector from nest.storage.luxalert.entity.ManagementCompany import ManagementCompany class ManagementCompanyDAO(object): @staticmethod def select_all(): session = DatabaseConnector.connect_to_database() return (x for x in session.query(ManagementCom...
gpl-3.0
8,116,238,424,803,379,000
28.869565
76
0.665939
false
4.564784
false
false
false
fredRos/pypmc
pypmc/mix_adapt/pmc_test.py
1
40779
'''Unit tests for the Population Monte Carlo. ''' from .pmc import * from .. import density import numpy as np import unittest from nose.plugins.attrib import attr class TestGaussianPMCNoOverlap(unittest.TestCase): # proposal density mu1 = np.array( [ 10., -1.0, 8.0] ) mu2 = np.array( [-10., 7.4, 0.5] )...
gpl-2.0
-8,957,621,581,364,993,000
51.550258
138
0.533216
false
3.059419
true
false
false
FibercorpLabs/FibercorpDevops
cisco/aci/createApplication.py
1
2268
from cobra.model.fv import Ap from createMo import * DEFAULT_QOS = 'unspecified' QOS_CHOICES = ['level1', 'level2', 'level3', 'unspecified'] def input_optional_args(*key): args = {} args['prio'], = input_options('Prio(QoS Class)', DEFAULT_QOS, QOS_CHOICES), return args def create_application(fv_tena...
gpl-3.0
-6,539,088,761,360,772,000
40.254545
259
0.683862
false
3.903614
false
false
false
DemocracyClub/EveryElection
every_election/apps/election_snooper/migrations/0004_auto_20170627_1405.py
1
1386
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-06-27 14:05 from __future__ import unicode_literals import datetime from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [("election_snooper", "0003_snoop...
bsd-3-clause
-3,837,196,011,326,248,400
29.130435
71
0.556277
false
4.428115
false
false
false
mburke13/usc-search-api
usc_search_api/search_request.py
1
1157
import re ALL_CAP_RE = re.compile('([a-z0-9])([A-Z])') FIRST_CAP_RE = re.compile('(.)([A-Z][a-z]+)') def conv_to_snake_case(camel_case): s = FIRST_CAP_RE.sub(r'\1_\2', camel_case) return ALL_CAP_RE.sub(r'\1_\2', s).lower() class SearchRequest(dict): SEARCH_TERMS = [ 'principalName', ...
mit
7,124,672,049,801,201,000
23.104167
53
0.518583
false
3.54908
false
false
false
tacksoo/excel2pdf
flask_app.py
1
4839
# Started based on this sample: # http://stackoverflow.com/questions/27628053/uploading-and-downloading-files-with-flask from flask import Flask, request, redirect, url_for, Response, session import openpyxl # using version 1.6.1 import docx # using python-docx 0.8.4 import os import zipstream import zipfile import tim...
mit
222,533,182,951,365,860
33.319149
103
0.60653
false
3.427054
false
false
false
motius/django-rest-recaptcha
setup.py
1
1275
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-rest-recaptcha',...
mit
8,095,294,864,346,051,000
34.444444
115
0.626667
false
3.828829
false
false
false
sujeet4github/MyLangUtils
LangPython/effectivePythonBook/01_11.py
1
1508
# https://raw.githubusercontent.com/bslatkin/effectivepython/master/example_code/item_11.py # # use ZIP to process iterators in parallel # import logging from pprint import pprint from sys import stdout as STDOUT # Example 1 names = ['Cecilia', 'Lise', 'Marie'] letters = [len(n) for n in names] print(letters) # E...
gpl-3.0
8,189,934,257,009,570,000
23.721311
91
0.693634
false
3.396396
false
false
false
python-uni/tutorial-django
tutorial/tutorial/settings.py
1
2574
""" Django settings for tutorial 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, ...) f...
mit
-3,129,757,448,429,297,000
23.75
71
0.720668
false
3.312741
false
false
false
ohio813/libforensics
code/lf/apps/msoffice/shared/ctypes.py
13
1341
# Copyright 2010 Michael Murr # # This file is part of LibForensics. # # LibForensics is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
gpl-3.0
8,023,798,916,185,578,000
36.25
77
0.766592
false
3.70442
false
false
false
HPPTECH/hpp_IOSTressTest
Refer/IOST_OLD_SRC/IOST_0.17/Libs/IOST_Config.py
1
11368
#!/usr/bin/python #====================================================================== # # Project : hpp_IOStressTest # File : IOST_Config.py # Date : Sep 21, 2016 # Author : HuuHoang Nguyen # Contact : hhnguyen@apm.com # : hoangnh.hpp@gmail.com # License : MIT License # Copyright : 2016 # Des...
mit
-1,993,495,900,995,368,700
35.553055
118
0.484694
false
3.604312
true
false
false
Saevon/Recipes
python/hostname.py
1
2837
import os import platform import socket def is_ipv4_address(address): ''' Whether this is a valid ipv4 address ''' try: socket.inet_pton(socket.AF_INET, address) except AttributeError: # inet_pton is not available on all platforms # (but its more accurate) try: ...
mit
7,755,346,240,417,689,000
23.885965
82
0.546352
false
4.605519
false
false
false
AnishShah/tensorflow
tensorflow/contrib/estimator/python/estimator/export.py
6
9460
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-2,163,381,448,625,918,000
41.421525
174
0.730338
false
3.941667
false
false
false
Groovy-Dragon/tcRIP
ML_BayesFeatReduc.py
1
4536
# -*- coding: utf-8 -*- """ Created on Sun Aug 13 16:54:22 2017 @author: lewismoffat This script implements the feature reduction technique from Cinelli et al. 2017 That uses a 1-dimensional Gaussian Naive Bayes to calculate the value of features. Based on https://academic.oup.com/bioinformatics/article/33/7/951/28...
mit
-1,835,341,989,748,593,400
26.161677
112
0.555115
false
3.438969
false
false
false
selahssea/ggrc-core
src/ggrc/converters/__init__.py
4
3234
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ This module is used for import and export of data with csv files """ from ggrc.extensions import get_extension_modules from ggrc.models import AccessGroup from ggrc.models import Assessment from ggrc.mo...
apache-2.0
4,514,398,832,821,991,000
26.176471
78
0.717378
false
3.708716
false
false
false
sanderroobol/spacetime
lib/spacetime/modules/generic/datasinks.py
2
1726
# This file is part of Spacetime. # # Copyright 2010-2014 Leiden University. # Written by Sander Roobol. # # Spacetime 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-2.0
-2,523,046,985,970,172,000
31.566038
90
0.725956
false
3.344961
false
false
false
winnerineast/Origae-6
origae/utils/__init__.py
1
4400
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import inspect from io import BlockingIOError import locale import math import os import pkg_resources import platform from random import uniform from urlparse import urlparse if not platform.system() == 'Windo...
gpl-3.0
7,553,112,284,017,030,000
25.347305
86
0.539545
false
3.822763
false
false
false
msikma/pytpl
setup.py
1
1214
#!/usr/bin/env python3 # # Copyright (C) 2016, Michiel Sikma # MIT licensed """ Installation script. To install for production, run: ./setup.py install When developing, replace 'install' with 'develop'. """ from setuptools import setup, find_packages setup( name='pytpl', version='1.0.2', description...
mit
-7,574,219,051,234,910,000
25.977778
73
0.629325
false
3.602374
false
false
false
catmaid/CATMAID
django/applications/catmaid/migrations/0016_import_meshes_as_volumes.py
2
4873
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-12-19 00:02 import os import logging import django.contrib.postgres.fields.jsonb from django.conf import settings from django.db import migrations, models from catmaid.apps import get_system_user from catmaid.control.volume import get_volume_instance from...
gpl-3.0
-5,614,056,251,893,985,000
33.076923
80
0.479581
false
4.512037
false
false
false
Sotera/newman
app/newman_es/es_query_utils.py
1
5815
from app import app import time from es_connection import es def get_graph_row_fields(): return ["id","tos","senders","ccs","bccs","datetime","subject","body","attachments.guid","starred","case_id","ingest_id","alt_ref_id","label"] def _map_emails(fields, score=1.0): ''' Map the fields to UI fields :...
apache-2.0
1,285,991,903,244,696,000
42.721805
164
0.585211
false
3.563113
false
false
false
schriftgestalt/robofab
setup.py
4
2182
#! /usr/bin/env python import os, sys from setuptools import setup, Extension try: # load py2exe distutils extension, if available import py2exe except ImportError: pass try: import numpy except ImportError: print "*** Warning: FontTools needs the numpy library for some operations, see:" print " http://...
bsd-3-clause
-1,033,544,198,263,656,200
28.093333
305
0.681027
false
3.117143
false
false
false
deepmind/bsuite
bsuite/experiments/cartpole_noise/sweep.py
1
1105
# python3 # pylint: disable=g-bad-file-header # Copyright 2019 DeepMind Technologies Limited. 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...
apache-2.0
-4,756,616,810,748,098,000
37.103448
78
0.688688
false
3.836806
false
false
false
GullyAPCBurns/bolinas
parser/vo_item.py
1
19272
from common.hgraph.hgraph import NonterminalLabel from common import log import itertools # Some general advice for reading this file: # # Every rule specifies some fragment of the object (graph, string or both) that # is being parsed, as well as a visit order on the individual elements of that # fragment (tokens or e...
mit
-385,126,980,389,550,000
32.284974
125
0.627906
false
3.398942
false
false
false
crustymonkey/pylibgal3
libg3/Requests.py
1
3112
# # Author: Jay Deiman # Email: admin@splitstreams.com # # This file is part of pylibgal3. # # pylibgal3 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
gpl-3.0
1,494,533,216,156,706,800
41.630137
73
0.614396
false
3.713604
false
false
false