repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
zmap/ztag
ztag/annotations/helix.py
1
1282
from ztag.annotation import * import re class Helix(Annotation): protocol = protocols.HTTP subprotocol = protocols.HTTP.GET port = None version_re = re.compile( "^Helix Mobile Server/(\d+(\.\d+)*)", re.IGNORECASE ) os_re = re.compile( "^Helix Mobile Server/(?:\...
apache-2.0
8,732,023,420,992,456,000
30.268293
65
0.556942
false
3.838323
false
false
false
ric2b/Vivaldi-browser
chromium/third_party/crashpad/crashpad/util/mach/mig_gen.py
3
2715
#!/usr/bin/env python # coding: utf-8 # Copyright 2019 The Crashpad 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/LICEN...
bsd-3-clause
-7,646,883,918,846,086,000
35.2
79
0.618785
false
3.934783
false
false
false
mirthbottle/ghg
targetsmosh.py
1
5662
import pandas as pd import numpy as np def get_targets(p, year): # years 2010 and 2011 and 2012 don't have ISIN, boooo pcols = p.columns.values ttypes_col = deets[year]["summary"]["ttypes"] targets = p[p["Organisation"].notnull()][["Organisation",pcols[ttypes_col]]] targets.rename(columns = {pcols[...
mit
-1,730,018,486,499,977,700
36.496689
111
0.481102
false
3.710354
false
false
false
tnemisteam/cdf-steps
teacher/views/teacher_loan_views.py
1
4138
from django.views.generic import ListView, DetailView, CreateView, \ DeleteView, UpdateView, \ ArchiveIndexView, DateDetailView, \ DayArchiveView, MonthArchiveView, \ TodayArchiveView, Wee...
mit
-2,688,472,835,296,899,600
27.937063
74
0.689705
false
3.738031
false
false
false
coin-or/oBB
obb/trsq.py
1
1608
from __future__ import division def trsq(Lg, delta, xc, f, g): # import necessary functions from numpy import dot, inf from numpy.linalg import norm # our own functions from newton import newton # Define function to minimise fun = lambda x: f + dot(x,g) + (Lg / 2) * norm(x) ** 2 # n.b...
lgpl-3.0
3,042,594,837,105,357,300
20.44
58
0.515547
false
2.96679
false
false
false
threerings/splatd
splat/helpers/opennms.py
1
25880
# opennms.py vi:ts=4:sw=4:expandtab: # # Support functions for plugins that deal with OpenNMS. # Author: Landon Fuller <landonf@threerings.net> # # Copyright (c) 2007 Three Rings Design, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
bsd-3-clause
7,778,300,007,850,750,000
34.599725
134
0.595479
false
4.231524
false
false
false
krishauser/Klampt
Python/klampt/plan/robotoptimize.py
1
34985
from ..model import ik,types,config from ..math import vectorops from ..robotsim import IKSolver,IKObjective from ..io import loader import time import random from ..math import optimize,symbolic,symbolic_klampt,so3,se3 import numpy as np class KlamptVariable: """ Attributes: name (str): the Klamp't it...
bsd-3-clause
630,887,699,771,616,300
45.215324
153
0.564985
false
4.472641
true
false
false
JKAD/Arch-Install-Scripts
bmu.py
1
3732
#!/usr/bin/env python2 #--Filename----------------------------------------------------------# # bmu.py # #--Info--------------------------------------------------------------# # BlackArch mirrorlist update script # # Updated:...
mit
-2,826,958,007,145,787,000
38.284211
80
0.459003
false
4.110132
false
false
false
tungvx/deploy
Django-0.90/django/contrib/comments/models/comments.py
1
11734
from django.core import meta from django.models import auth, core class Comment(meta.Model): user = meta.ForeignKey(auth.User, raw_id_admin=True) content_type = meta.ForeignKey(core.ContentType) object_id = meta.IntegerField('object ID') headline = meta.CharField(maxlength=255, blank=True) comment ...
apache-2.0
947,574,036,190,088,000
41.669091
164
0.607551
false
3.812216
false
false
false
fauskanger/Pretreat
app/libs/json_map.py
1
15076
# json-map, a tiled JSON map renderer for pyglet # Copyright (C) 2014 Juan J. Martinez <jjm@usebox.net> # # 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 withou...
gpl-2.0
5,152,356,281,729,806,000
32.651786
117
0.529981
false
4.049423
false
false
false
luileito/WKM
py/mathlib.py
1
1825
from __future__ import division import math def cumdist(samples): """ Computes the cummulated distance along a sequence of vectors. samples = [ [v11,...,v1N], ... [vn1,...,vnN] ] """ N, l, Ln = len(samples), [0.0], 0.0 for i in range(1,N): Li = math.sqrt( sqL2(samples[i], samples[i-1]) ) Ln += Li ...
mit
1,113,156,717,748,922,500
22.701299
74
0.56274
false
2.878549
false
false
false
denismakogon/pyvcloud
tests/connect_vapp_to_network.py
4
1721
import os from pyvcloud.vcloudair import VCA def print_vca(vca): if vca: print 'vca token: ', vca.token if vca.vcloud_session: print 'vcloud session token: ', vca.vcloud_session.token print 'org name: ', vca.vcloud_session.org print 'org ur...
apache-2.0
7,531,989,792,316,935,000
34.854167
132
0.685648
false
2.921902
false
false
false
heiher/libreoffice-core
writerfilter/source/ooxml/modelpreprocess.py
9
2912
#!/usr/bin/env python # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from __future__ import print_function from x...
gpl-3.0
4,567,539,681,103,047,000
31
89
0.632212
false
4.107193
false
false
false
jafletch/makeblock-serial
src/Python27/config.py
1
1392
import exceptions from types import * class validatable: @classmethod def validate(cls, item): for memberName in dir(cls): member = getattr(cls, memberName) if type(member) == IntType and item == member: return item raise ConfigError("Invalid...
gpl-3.0
7,782,678,110,567,276,000
17.333333
76
0.52518
false
3.333333
false
false
false
lcostantino/healing-os
healing/engine/alarms/alarm_base.py
1
6284
# -*- encoding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
-5,866,530,302,132,023,000
25.854701
76
0.62508
false
3.969678
false
false
false
klnusbaum/UDJ-Server
udjserver/udj/migrations/0018_add_default_algo.py
1
10265
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models from udj.trans_migration_constants import ADDED_DEFAULT_ALGO_NAME class Migration(DataMigration): def forwards(self, orm): totalAlgo = orm.SortingAlgorithm( name=ADDED_...
gpl-2.0
-3,212,786,209,966,275,000
67.433333
182
0.54301
false
3.659537
false
false
false
astrodroid/functionrefactor
tests/test_runs.py
1
1134
from functionrefactor.commands import launch_case from functionrefactor.formatter import Formatter from functionrefactor.settings import * from tests.common_functions import * import json class TestRuns(): def test_runs(self): with open("tests/cases/test_cases.json", "r") as tcf: test_launche...
mit
-1,969,767,511,287,521,000
35.580645
79
0.623457
false
3.78
true
false
false
levilucio/SyVOLT
mbeddr2C_MM/transformation_from_mps/Hlayer1rule1.py
1
3561
from core.himesis import Himesis import uuid class Hlayer1rule1(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule layer1rule1. """ # Flag this instance as compiled now self.is_compiled = True super(Hlayer1rule1, self).__init__(name='Hlayer1rule1', num_nodes=0, edg...
mit
-1,731,512,285,974,052,900
39.465909
131
0.711598
false
3.249088
false
false
false
rshelans/GeneRing
src/TraceModel.py
1
5221
import time import os.path import Trace import scipy __version__="01.00.00" __author__ ="Robert Shelansky" class TraceModel: """ A model/controller of data which knows how to do specific analysis and maintenance of settings etc. Can be used as a data dump for communication with the TraceView. """ def __init__(self...
mit
5,411,831,733,201,479,000
31.428571
155
0.64298
false
2.856127
false
false
false
OzFlux/OzFluxQC
OzFluxQC.py
1
51206
import ast import copy import datetime import logging import matplotlib matplotlib.use('TkAgg') #matplotlib.use('Qt4Agg') import numpy import ntpath import time import Tkinter as tk import tkMessageBox import os import sys # The Lindsay Trap: check the scripts directory is present if not os.path.exists("./scripts/"): ...
gpl-3.0
-7,339,864,531,312,118,000
51.25102
134
0.600184
false
3.711118
false
false
false
kbase/assembly
lib/assembly/pipe.py
4
3878
import itertools import re """ # parameter sweep input: ['trim_sort', 'kiki', '?k=29-30'] output: [['trim_sort', 'kiki', '?k=29], ['trim_sort', 'kiki', '?k=30]] # parameter sweep with multiple assemblers input: ['trim_sort', 'kiki ?k=29-30 velvet'] output: [['trim_sort', 'kiki', '?k=29], ['trim_sort', 'kiki', '?k=30]...
mit
8,232,373,787,818,876,000
32.145299
95
0.47344
false
3.306053
false
false
false
RaisingTheDerp/raisingthebar
root/devtools/AddFunctionPrologue.py
1
2929
# Assuming all functions begin with ')' followed by '{', just find the matching brace and # add a line with 'g_pVCR->SyncToken("<random string here>");' import dlexer import sys class BlankStruct: pass def MatchParensBack( list, iStart ): parenCount = -1 for i in range( 0, iStart ): if list[iStart-i].id == ...
gpl-3.0
-2,518,166,003,032,879,600
24.25
114
0.592352
false
2.712037
false
false
false
ThoriumGroup/thorium
thorium/__init__.py
1
8928
#!/usr/bin/env python """ Thorium ======= Thorium is a project that combines various python modules and tools originally sourced from Nukepedia. It provides a streamlined way of managing their versions and customizing the installation. While thorium ships as a complete package, individual submodules can be activated...
mit
-3,899,632,006,197,299,700
31.347826
108
0.621528
false
4.411067
false
false
false
kstrauser/schematics
schematics/types/compound.py
5
14905
# -*- coding: utf-8 -*- from __future__ import division from collections import Iterable import itertools from ..exceptions import ValidationError, ConversionError, ModelValidationError, StopValidation from ..models import Model from ..transforms import export_loop, EMPTY_LIST, EMPTY_DICT from .base import BaseType ...
bsd-3-clause
-8,087,686,044,882,606,000
34.236407
95
0.56424
false
4.509834
false
false
false
huyang1532/learn-python
xlrd-0.6.1/xlrd/sheet.py
1
56349
# -*- coding: cp1252 -*- ## # <p> Portions copyright © 2005-2006 Stephen John Machin, Lingfo Pty Ltd</p> # <p>This module is part of the xlrd package, which is released under a BSD-style licence.</p> ## # 2007-04-22 SJM Remove experimental "trimming" facility. from biffh import * from timemachine import * from struc...
mit
5,134,417,725,366,508,000
41.399549
134
0.507622
false
3.681016
false
false
false
almey/policycompass-services
apps/referencepool/models.py
1
2884
from django.db import models class PolicyDomain(models.Model): title = models.CharField(max_length=100, unique=True) description = models.TextField() class Meta: ordering = ['title'] verbose_name = "Policy Domain" verbose_name_plural = "Policy Domains" def __str__(self): ...
agpl-3.0
1,012,833,540,433,283,100
24.522124
89
0.650139
false
3.835106
false
false
false
nash-x/hws
neutron/plugins/ml2/drivers/cascading/cascaded_driver.py
1
10365
# Copyright (c) 2013 OpenStack Foundation. # 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...
apache-2.0
-9,135,588,512,233,614,000
36.554348
102
0.58466
false
4.279521
false
false
false
huji-nlp/tupa
tupa/states/state.py
2
20047
from collections import deque from semstr.constraints import Constraints, Direction from semstr.util.amr import LABEL_ATTRIB from semstr.validation import CONSTRAINTS from ucca import core, layer0, layer1 from ucca.layer0 import NodeTags from ucca.layer1 import EdgeTags from .edge import Edge from .node import Node f...
gpl-3.0
-3,374,840,468,821,454,300
51.616798
120
0.578042
false
4.033602
false
false
false
sugarsweetrobotics/wasanbon
wasanbon/core/plugins/mgr/rtc_plugin/__init__.py
1
16100
import os, sys, signal, time, traceback, threading import wasanbon from wasanbon.core.plugins import PluginFunction, manifest ev = threading.Event() endflag = False class Plugin(PluginFunction): """ Manage RT-Component in Package """ def __init__(self): #PluginFunction.__init__(self) super(Plu...
gpl-3.0
968,969,645,110,266,200
42.631436
195
0.56354
false
3.994046
false
false
false
zathras777/atavism
atavism/http11/range.py
1
2282
class Range(object): def __init__(self, tpl): self.start = int(tpl[0]) if tpl[0] is not None and tpl[0] != b'' else None self.end = int(tpl[1]) if tpl[1] is not None and tpl[1] != b'' else None if self.start is None and self.end is not None and self.end > 0: self.end *= -1 d...
unlicense
3,471,495,143,078,376,400
32.558824
82
0.501753
false
3.900855
false
false
false
NaohiroTamura/python-ironicclient
ironicclient/tests/functional/test_json_response.py
1
8400
# Copyright (c) 2016 Mirantis, 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 writin...
apache-2.0
7,119,508,323,768,416,000
39
76
0.498333
false
4.34333
true
false
false
jasoncorbett/slickqa.slick-python
slickqa/slickqa.py
1
15630
import logging import time from datetime import datetime import types from .micromodels.fields import ModelCollectionField from . import SlickConnection, SlickCommunicationError, Release, Build, BuildReference, Component, ComponentReference, \ Project, Testplan, Testrun, Testcase, RunStatus, Result, ResultStatus, ...
apache-2.0
-1,363,627,592,683,206,400
46.944785
148
0.618554
false
4.175795
true
false
false
paulross/cpip
src/cpip/util/XmlWrite.py
1
19169
#!/usr/bin/env python # CPIP is a C/C++ Preprocessor implemented in Python. # Copyright (C) 2008-2017 Paul Ross # # 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 L...
gpl-2.0
1,042,945,868,849,424,800
31.107081
169
0.501226
false
4.095065
false
false
false
costadorione/purestream
servers/rocvideo.py
1
2680
# -*- coding: utf-8 -*- #------------------------------------------------------------ # streamondemand - XBMC Plugin # Conector para rocvideo # http://www.mimediacenter.info/foro/viewforum.php?f=36 #------------------------------------------------------------ import re from core import jsunpack from core import logge...
gpl-3.0
6,527,898,725,564,416,000
36.180556
122
0.609638
false
3.225301
false
false
false
Pettythug/ForThisClass
Assignment 5/common.py
1
1698
from random import * from time import sleep ################### MODEL ############################# def collide_boxes(box1, box2): x1, y1, w1, h1 = box1 x2, y2, w2, h2 = box2 return x1 < x2 + w2 and y1 < y2 + h2 and x2 < x1 + w1 and y2 < y1 + h1 class Model(): cmd_directions = {'up': (0, -...
mit
2,167,591,220,567,360,500
32.313725
80
0.446996
false
3.362376
false
false
false
selam/python-vast-xml-generator
vast/ad.py
1
2544
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2015 Timu Eren <timu.eren@gmail.com> # # 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...
apache-2.0
-7,131,255,563,608,026,000
31.202532
94
0.666274
false
4.038095
false
false
false
jmchilton/galaxy-central
tools/filters/ucsc_gene_bed_to_exon_bed.py
1
4444
#!/usr/bin/env python2.3 """ Read a table dump in the UCSC gene table format and print a tab separated list of intervals corresponding to requested features of each gene. usage: ucsc_gene_table_to_intervals.py [options] options: -h, --help show this help message and exit -rREGION, --region=REGIO...
mit
-1,295,368,544,682,247,000
40.924528
103
0.534878
false
3.778912
false
false
false
kepstin/picard
picard/ui/ui_infostatus.py
1
4875
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/infostatus.ui' # # Created: Thu Jun 27 19:18:14 2013 # by: PyQt4 UI code generator 4.9.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except A...
gpl-2.0
1,008,436,030,703,050,100
47.267327
99
0.710769
false
3.869048
false
false
false
kimvais/cryptography
tests/hazmat/primitives/twofactor/test_totp.py
5
5284
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import pytest from cryptography.exceptions import _Reasons from cryptogr...
bsd-3-clause
8,574,700,208,480,949,000
34.463087
79
0.64383
false
3.47403
true
false
false
pantheon-systems/etl-framework
etl_framework/configs/tests/test_job.py
1
1196
""" test the environment config """ import os import unittest from etl_framework.configs.job import JobConfig class JobConfigTestCases(unittest.TestCase): """ class for test cases """ JOB_CONFIG_FILEPATH = os.path.join( os.path.dirname(__file__), 'fixtures/job.json' ) def setUp(se...
mit
-4,390,787,021,299,247,600
25
75
0.63796
false
4.271429
true
false
false
bocchan/DAalgorithm
matching.py
1
1405
import copy import numpy as np m_prefs=np.array([[4,0,1,2,3],[1,2,0,3,4],[3,1,0,2,4]]) f_prefs=np.array([[0,1,2,3],[1,0,3,2],[1,2,0,3],[0,3,2,1]]) def array_to_dict(array): dict = {} for x, y in enumerate(array): dict[x] = list(y) return dict def deferred_acceptance(m_prefs,f_prefs): m_pre...
gpl-3.0
8,446,696,807,165,299,000
28.914894
60
0.533808
false
2.983015
false
false
false
eliben/code-for-blog
2017/async-socket-server/simple-client.py
1
2990
# Simple client used to interact with concurrent servers. # # Launches N concurrent client connections, each executing a pre-set sequence of # sends to the server, and logs what was received back. # # Tested with Python 3.6 # # Eli Bendersky [http://eli.thegreenplace.net] # This code is in the public domain. import arg...
unlicense
-6,060,841,360,586,669,000
28.313725
80
0.616388
false
3.646341
false
false
false
nayarsystems/nxsugar-py
nxsugarpy/info.py
1
1118
# -*- coding: utf-8 -*- ############################################################################## # # nxsugarpy, a Python library for building nexus services with python # Copyright (C) 2016 by the nxsugarpy team # # This program is free software: you can redistribute it and/or modify # it under the te...
lgpl-3.0
5,863,487,593,986,522,000
38.964286
78
0.60644
false
4.050725
false
false
false
edx-solutions/edx-platform
common/djangoapps/util/tests/test_course.py
4
4770
""" Tests for course utils. """ import ddt import mock from django.conf import settings from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from util.course import get_link_for_about_page from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import...
agpl-3.0
-5,378,677,625,954,462,000
35.976744
117
0.63522
false
4.042373
true
false
false
rdmorganiser/rdmo
rdmo/projects/views/membership.py
1
4298
import logging from django.contrib.sites.models import Site from django.http import (HttpResponseBadRequest, HttpResponseForbidden, HttpResponseRedirect) from django.shortcuts import get_object_or_404 from django.template.loader import render_to_string from django.urls import reverse from djan...
apache-2.0
2,156,405,560,474,445,600
37.720721
129
0.66496
false
4.152657
false
false
false
jeroendierckx/Camelot
camelot/view/controls/formview.py
1
14400
# ============================================================================ # # Copyright (C) 2007-2012 Conceptive Engineering bvba. All rights reserved. # www.conceptive.be / project-camelot@conceptive.be # # This file is part of the Camelot Library. # # This file may be used under the terms of the GNU General...
gpl-2.0
6,573,367,326,368,849,000
38.130435
90
0.608542
false
4.194582
false
false
false
Kalimaha/pact-test
tests/config/config_builder.py
1
2382
import os from pact_test.config.config_builder import Config def test_default_consumer_tests_path(): config = Config() assert config.consumer_tests_path == 'tests/service_consumers' def test_default_provider_tests_path(): config = Config() assert config.provider_tests_path == 'tests/service_provider...
mit
5,298,987,564,133,576,000
33.521739
66
0.607893
false
3.860616
true
false
false
SinnerSchraderMobileMirrors/django-cms
cms/utils/plugins.py
5
6609
# -*- coding: utf-8 -*- from cms.exceptions import DuplicatePlaceholderWarning from cms.models import Page from cms.templatetags.cms_tags import Placeholder from cms.utils.placeholder import validate_placeholder_name from django.contrib.sites.models import Site, SITE_CACHE from django.shortcuts import get_object_or_404...
bsd-3-clause
5,894,394,954,680,752,000
40.566038
110
0.646845
false
4.423695
false
false
false
bowen0701/algorithms_data_structures
lc0389_find_the_difference.py
1
3185
"""Leetcode 389. Find the Difference Easy URL: https://leetcode.com/problems/find-the-difference/ Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that was added in t. Example: I...
bsd-2-clause
2,294,694,876,237,306,000
21.588652
66
0.540659
false
3.570628
false
false
false
caxap/python-optimage
optimage/utils.py
1
1263
#!/usr/bin/env python # -*- coding: utf-8 -*- import os __all__ = ['is_executable', 'find_executable_path', 'file_size'] def is_executable(path): return os.path.isfile(path) and os.access(path, os.X_OK) def find_executable_path(command, paths=None): path = os.environ.get('%s_PATH' % command.upper()) i...
mit
805,107,199,800,589,600
27.066667
72
0.564529
false
3.422764
false
false
false
cphyc/ScriptManager
mysite/scripts/migrations/0001_initial.py
1
1584
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Folderbla', fields=[ ('id', models.AutoField(ve...
unlicense
4,634,281,116,656,442,000
32
114
0.504419
false
4.728358
false
false
false
dgladkov/django-modelimport
modelimport/runners.py
1
2758
# -*- coding: utf-8 -*- import os from csv import excel from django.db import transaction from django.utils.translation import ugettext_lazy as _ from unicodecsv import DictReader class excel_semicolon(excel): delimiter = ';' class RegistryMixin(object): """ Registers targets to uninstanciated class ...
mit
8,766,955,446,528,260,000
25.266667
82
0.571791
false
4.236559
false
false
false
enjaz/enjaz
events/migrations/0009_booth_vote.py
2
1703
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('events', '0008_add_collection_method'), ...
agpl-3.0
-4,300,426,101,200,923,600
49.088235
226
0.623018
false
3.046512
false
false
false
MRtrix3/mrtrix3
lib/mrtrix3/run.py
1
26322
# Copyright (c) 2008-2021 the MRtrix3 contributors. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # Covered Software is provided under this License on an "as is" #...
mpl-2.0
4,200,728,413,799,274,500
41.454839
149
0.658803
false
3.850497
false
false
false
amozie/amozie
studzie/keras_rl_agent/dqn_test.py
1
2269
import numpy as np import matplotlib.pyplot as plt import gym import time import copy from keras.models import Sequential, Model from keras.layers import Dense, Activation, Flatten, Lambda, Input, Reshape, concatenate, Merge from keras.optimizers import Adam, RMSprop from keras.callbacks import History from keras imp...
apache-2.0
-1,884,155,499,636,017,700
30.971831
106
0.733363
false
2.962141
false
false
false
divio/django-cronjobs
cronjobs/migrations/0004_auto__add_field_cronlog_exception_message__add_field_cronlog_duration.py
1
2682
# 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 'CronLog.exception_message' db.add_column('cronjobs_cronlog', 'exception_message', self.gf(...
bsd-3-clause
2,534,393,390,478,528,500
48.666667
168
0.579418
false
3.634146
false
false
false
comicxmz001/LeetCode
Python/304 Range Sum Query 2D - Immutable.py
1
1254
class NumMatrix(object): def __init__(self, matrix): """ initialize your data structure here. :type matrix: List[List[int]] """ if len(matrix) == 0: return None self.m = [[0 for x in xrange(len(matrix[0])+1)] for x in xrange(len(matrix)+1)] for i i...
mit
-6,708,685,302,077,250,000
31.179487
104
0.464912
false
2.964539
false
false
false
AlekseyLM/Python
Game_1.py
1
1991
# Определяем начальные значения переменных min_max = [0, 1000] vvod = (min_max[0] + min_max[1]) / 2 v_text = {1:'нижний предел', 2:'верхний предел', 3:'отгадываемое число'} # Создаем функцию проверки ввода def prov_vvoda(vd_text): global vvod while True: sp = input('Введите ' + v_text[vd_text] + ' ...
gpl-2.0
-6,841,831,948,513,184,000
32.680851
143
0.576121
false
1.877817
false
false
false
ddanier/django_price
django_price/currency.py
1
1149
# coding: utf-8 from .currencies import CURRENCIES class Currency(object): CURRENCIES = dict([(c[0], c[1:]) for c in CURRENCIES]) def __init__(self, iso_code): if not iso_code in self.CURRENCIES: raise TypeError('unknown currency (%s)' % iso_code) self.iso_code = iso_code ...
bsd-3-clause
3,699,915,892,193,529,300
27.725
108
0.563098
false
3.779605
false
false
false
linyiqun/minos
supervisor/supervisor/medusa/thread/pi_module.py
5
1800
# -*- Mode: Python -*- # [reworking of the version in Python-1.5.1/Demo/scripts/pi.py] # Print digits of pi forever. # # The algorithm, using Python's 'long' integers ("bignums"), works # with continued fractions, and was conceived by Lambert Meertens. # # See also the ABC Programmer's Handbook, by Geurts, Meertens &...
apache-2.0
5,644,802,356,304,090,000
28.032258
74
0.546111
false
3.152364
false
false
false
nichollyn/libspark
extension_system/test/manual/pluginview/plugins/plugin1/plugin1.py
1
1337
__author__ = 'kevin' from PySide.QtCore import QObject from _plugin1__iplugin_test__dev_ import easy_import_ as ei if ei.initialized: from iplugin import IPlugin from pluginmanager import PluginManager class MyPlugin1(IPlugin): def __init__(self, manager): super(MyPlugin1, self).__init__(man...
gpl-2.0
5,226,707,147,472,492,000
26.854167
71
0.612565
false
4.178125
false
false
false
djtaylor/cloudscape-DEPRECATED
python/cloudscape/engine/api/app/agent/models.py
2
7921
import copy from collections import OrderedDict # Django Libraries from django.conf import settings from django.db import connections # CloudScape Libraries from cloudscape.common import logger from cloudscape.common import config from cloudscape.engine.api.app.host.models import DBHostDetails # Maximum Rows per Tab...
gpl-3.0
-944,699,862,993,960,000
33.745614
144
0.526322
false
4.373827
false
false
false
trep/opentrep
gui/django/webapps/opentrep/search/por_service.py
1
2628
# import math, re # def get_random_airport (openTrepLibrary, travelPB2): # OpenTREP result = openTrepLibrary.getRandom() # Protobuf place = travelPB2.Place() place.ParseFromString (result) return place # def get_lat_lon (place): return place.coord.latitude, place.coord.longitude # def get_lon_lat (plac...
lgpl-2.1
9,082,942,870,864,124,000
25.545455
80
0.6621
false
2.763407
false
false
false
laxect/scale
modules/bilibili_spider.py
1
2474
import re import json import gevent import requests from gevent.queue import Empty # my module from . import stand_task from modules import database class bilibili_spider(stand_task.task): 'a spider espeacially design for bilibili bangumi' def __init__(self, aim=None): 'aim in stand of which bangumi ...
mit
-6,638,228,883,525,679,000
27.651163
80
0.530438
false
3.5
false
false
false
rootsdev/python-gedcom-parser
gedcom.py
1
19905
# # Python GEDCOM Parser # # This is a basic parser for the GEDCOM 5.5 format. For documentation of # this format, see # # http://homepages.rootsweb.com/~pmcbride/gedcom/55gctoc.htm # Copyright (C) 2012 Daniel Zappala (daniel.zappala [at] gmail.com) # This program is free software: you can redistribute it and/or modi...
gpl-3.0
-3,179,788,084,274,490,000
32.341709
80
0.507059
false
4.384361
false
false
false
trojkat/doner
doner/project/access_control_views.py
1
2976
from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views.generic.base import View from django.shortcuts import render from .models import Project, Ticket, Log class LoginRequiredView(View): ''' This view can be visited only by authentica...
mit
-4,608,560,247,374,047,000
27.075472
96
0.650538
false
4.116183
false
false
false
forgeservicelab/forge.benchmark
cas_log_in_and_measure.py
1
4515
#!/usr/bin/env python # Script for measuring response time for redmine urls. # It attempts to authenticate via html form which is it given on first GET. # It should work generally for anything that forwards properly, and has # "username" and "password" fields in the form. # # I tested it for CASino login and standard ...
mit
3,756,557,213,109,138,000
28.129032
79
0.604651
false
3.552321
false
false
false
novafloss/bag8
bag8/tests/test_yaml.py
1
4636
from __future__ import absolute_import, division, print_function import os from bag8.project import Project from bag8.yaml import Yaml CURR_DIR = os.path.realpath('.') def test_data(): # normal project = Project('busybox') assert Yaml(project).data == { 'busybox': { 'dockerfile': ...
mit
437,238,647,660,886,600
27.617284
73
0.410915
false
3.982818
false
false
false
lmacken/leafy-miracle
leafymiracle/views.py
1
1661
# Copyright (C) 2011 Luke Macken <lmacken@redhat.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This ...
agpl-3.0
-1,192,856,243,058,274,600
35.108696
75
0.731487
false
3.749436
false
false
false
debugger06/MiroX
lib/test/widgetstateconstantstest.py
1
2572
from miro.test.framework import MiroTestCase from miro.frontends.widgets.widgetstatestore import WidgetStateStore from miro.frontends.widgets.itemlist import SORT_KEY_MAP class WidgetStateConstants(MiroTestCase): def setUp(self): MiroTestCase.setUp(self) self.display_types = set(WidgetStateStore.ge...
gpl-2.0
728,278,717,984,210,300
42.59322
77
0.657076
false
4.07607
true
false
false
hzlf/openbroadcast.org
website/apps/statistics/apiv2/views.py
2
1269
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime, date, datetime, timedelta from dateutil.relativedelta import relativedelta from django.apps import apps from django.core.exceptions import ObjectDoesNotExist from django.http import Http404 from rest_framework.response import...
gpl-3.0
-3,544,083,552,119,572,000
36.323529
90
0.693459
false
4.028571
false
false
false
Anaconda-Platform/anaconda-client
binstar_client/commands/channel.py
1
3490
""" Manage your Anaconda repository channels. """ from __future__ import unicode_literals, print_function from binstar_client.utils import get_server_api import functools import logging import argparse logger = logging.getLogger('binstar.channel') def main(args, name, deprecated=False): aserver_api = get_serve...
bsd-3-clause
7,761,409,914,497,489,000
32.238095
93
0.602865
false
3.852097
false
false
false
qpython-android/QPython3-core
pybuild/env.py
1
1550
import os target_arch = 'arm64' android_api_level = os.getenv('ANDROID_VER') # Python optional modules. # Available: # tinycc - Tiny cc compiler # bzip2 - enable the bz2 module and the bzip2 codec # xz - enable the lzma module and the lzma codec # openssl - enable the ssl module and SSL/TLS support for sockets # ...
apache-2.0
-740,139,808,360,140,300
43.285714
150
0.706452
false
2.958015
false
false
false
bdaroz/the-blue-alliance
database/team_query.py
3
4402
from google.appengine.ext import ndb from consts.district_type import DistrictType from database.dict_converters.district_converter import DistrictConverter from database.dict_converters.team_converter import TeamConverter from database.database_query import DatabaseQuery from models.district import District from mode...
mit
1,297,470,170,798,805,200
34.216
127
0.66697
false
3.253511
false
false
false
eniosp/google-python-exercises
copyspecial/copyspecial.py
1
2312
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Problem description: # https://developers.google.com/edu/python/exercises/copy-special im...
apache-2.0
8,945,271,836,969,937,000
21.891089
69
0.604239
false
3.430267
false
false
false
chrsbats/similarities
similarities/hashes/feature_hash.py
1
1632
import xxhash from similarities.distances.sparse_vector import cosine_sparse_vector class FeatureHash(object): def __init__(self, tokens, length=100000): """Calculates a Charikar simhash with appropriate bitlength. Input can be any iterable, but for strings it will automatically ...
mit
-4,595,390,786,045,579,300
28.142857
72
0.525735
false
4.184615
false
false
false
sujoykroy/motion-picture
editor/MotionPicture/time_line_boxes/prop_time_line_box.py
1
5800
from ..commons import OrderedDict from ..commons.draw_utils import * from .box import Box from .sizes import * from .time_slice_box import TimeSliceBox from .. import settings class PropTimeLineBox(Box): TOTAL_LABEL_WIDTH = PROP_NAME_LABEL_WIDTH + PROP_VALUE_LABEL_WIDTH + 6*PROP_NAME_LABEL_RIGHT_PADDING def _...
gpl-3.0
-3,127,707,642,595,551,000
40.428571
104
0.6
false
3.389831
false
false
false
atiro/nikola
nikola/plugins/task/py3_switch.py
2
3618
# -*- coding: utf-8 -*- # Copyright © 2012-2016 Roberto Alsina and others. # 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 t...
mit
1,485,140,476,722,904,300
34.07767
107
0.674509
false
3.736298
false
false
false
michalkurka/h2o-3
h2o-py/tests/testdir_misc/pyunit_upload_import.py
10
1083
import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def upload_import_small(): # Connect to a pre-existing cluster various_datasets = ["smalldata/iris/iris.csv", "smalldata/iris/iris_wheader.csv", "smalldata/prostate/prostate.csv", "smalldata/prosta...
apache-2.0
-7,980,365,775,883,682,000
30.852941
120
0.611265
false
3.516234
false
false
false
ray-project/ray
dashboard/modules/actor/actor_utils.py
1
2183
import time import re from collections import defaultdict PYCLASSNAME_RE = re.compile(r"(.+?)\(") def construct_actor_groups(actors): """actors is a dict from actor id to an actor or an actor creation task The shared fields currently are "actorClass", "actorId", and "state" """ actor_groups = _...
apache-2.0
-3,236,785,072,096,983,600
31.102941
71
0.607879
false
3.803136
false
false
false
variar/klogg
3rdparty/hyperscan/tools/hsbench/scripts/pcapCorpus.py
1
9875
#!/usr/bin/env python ''' Script to convert a pcap file containing UDP and TCP packets to a corpus file. ''' import sys, getopt, pprint, os from sqlite3 import dbapi2 as sqlite import pcap from optparse import OptionParser from socket import AF_INET, IPPROTO_UDP, IPPROTO_TCP, inet_ntop, ntohs, ntohl, inet_ntoa import...
gpl-3.0
7,155,665,015,608,640,000
30.854839
109
0.613873
false
3.462482
false
false
false
argonnexraydetector/detectorMPI
XPCS/immcheck.py
1
3549
""" #How to use #run ipython execfile('immcheck.py') iname = '/local/testa_00200-01199.imm' checkFile(iname) #to read headers of images fp = open(iname,'r') h = readHeader(fp) print h #call if you are skipping iamge data, and not reading iamge data. getNextHeaderPos(fp,h) h = readHeader(fp) print h getNextHeade...
gpl-2.0
4,197,411,314,741,586,000
14.773333
109
0.614258
false
2.674454
false
false
false
nuagenetworks/vspk-python
vspk/v5_0/nuautodiscoveredgateway.py
1
12767
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
4,147,512,493,940,058,600
28.487298
228
0.594658
false
4.509714
false
false
false
kolibre/libkolibre-clientcore
tests/fakesoapserver.py
1
6179
#!/usr/bin/python """ Copyright (C) 2012 Kolibre This file is part of kolibre-clientcore. Kolibre-clientcore 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 2.1 of the License, or (at your...
lgpl-2.1
-8,709,200,525,714,554,000
34.107955
391
0.611264
false
3.756231
false
false
false
osrf/opensplice
build/docs/GPBTutorial/source/conf.py
2
8778
# -*- coding: utf-8 -*- # # DDS_Cpp_GPB_Tutorial build configuration file, created by # ReST Editor on 27-Apr-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 # autogenerated file. # # All configuration values...
apache-2.0
1,067,068,664,074,144,000
30.57554
126
0.692755
false
3.600492
true
false
false
andreasbastian/pyControl
2d.py
1
4951
##### NEED TO FIX DIVISION OPERATOR!!!!! from __future__ import division #http://docs.python.org/release/2.2.3/whatsnew/node7.html #The most controversial change in Python 2.2 heralds the start of an effort to fix an old design flaw that's been in Python from the beginning. Currently Python's division operator, /,...
gpl-3.0
7,031,432,962,849,804,000
27.646707
625
0.633003
false
2.724821
false
false
false
blackye/luscan-devel
thirdparty_libs/shodan/export.py
7
2288
import sys from datetime import datetime from xml.sax import make_parser, handler # Type conversion helper functions def parse_date(args): return datetime.strptime(args, '%d.%m.%Y') class ExportSaxParser(handler.ContentHandler): """Parses Shodan's export XML file and executes the callback for each ...
gpl-2.0
6,024,183,163,331,204,000
24.298851
87
0.521416
false
4.292683
false
false
false
HIIT/hybra-core
hybra/wordcloud/module_wordclouds.py
1
1879
#!/usr/local/bin/python # -*- coding: utf-8 -*- import os import time from string import Template import random import re import helpers.urls as urls from IPython.core.display import HTML, display from collections import Counter path = os.path.dirname(os.path.abspath(__file__)) def create_wordcloud( data, plt, sto...
mit
-5,407,360,248,777,718,000
32.517857
159
0.609483
false
3.236207
false
false
false
InContextSolutions/flask-goat
setup.py
1
1244
""" Flask-Goat ------------- Flask-Goat is a plugin for security and user administration via GitHub OAuth2 & team structure within your organization. """ from setuptools import setup setup( name='Flask-Goat', version='0.2.1', url='http://incontextsolutions.github.io/flask-goat/', license='MIT', ...
mit
-8,015,692,140,014,328,000
26.043478
120
0.603698
false
4.216949
false
false
false
ak110/pytoolkit
pytoolkit/od_test.py
1
5662
import numpy as np import pytest import pytoolkit as tk def test_to_str(): class_names = ["class00", "class01", "class02"] y = tk.od.ObjectsAnnotation( "path/to/dummy.jpg", 100, 100, np.array([1, 2]), np.array([[0.900, 0.900, 1.000, 1.000], [0.000, 0.000, 0.200, 0.200]...
mit
-8,270,628,438,416,416,000
29.972376
88
0.430075
false
2.866053
true
false
false
WarrenWeckesser/scikits-image
doc/examples/plot_ssim.py
2
2340
""" =========================== Structural similarity index =========================== When comparing images, the mean squared error (MSE)--while simple to implement--is not highly indicative of perceived similarity. Structural similarity aims to address this shortcoming by taking texture into account [1]_, [2]_. T...
bsd-3-clause
6,255,014,518,788,584,000
30.2
135
0.669231
false
2.853659
false
false
false
Alwnikrotikz/stoqs
loaders/HABLoader.py
4
23608
#!/usr/bin/env python __author__ = "Danelle Cline" __copyright__ = "Copyright 2012, MBARI" __license__ = "GPL" __maintainer__ = "Danelle Cline" __email__ = "dcline at mbari.org" __status__ = "Development" __doc__ = ''' This loader loads water sample data from the Southern California Coastal Ocean Observing System (SC...
gpl-3.0
1,748,290,724,237,543,000
45.381139
187
0.543926
false
4.102172
false
false
false
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-personalizer/azure/cognitiveservices/personalizer/models/personalizer_error.py
1
2146
# 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 ...
mit
9,055,293,772,262,861,000
37.321429
78
0.610904
false
4.224409
false
false
false
levelrf/level_basestation
grextras/python/extras_pmt.py
1
2377
# Copyright 2011-2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. ...
gpl-3.0
6,004,448,685,671,345,000
37.33871
102
0.694994
false
3.381223
false
false
false
mikemcfarlane/Code_sprints
ThingSpeak/NAO_to_ThingSpeak.py
1
1254
""" A simple example to test if NAO can connect to thingspeak.com. """ from naoqi import ALProxy import httplib, urllib import time # NAO_IP = "mistcalf.local" NAO_IP = "192.168.0.13" tts = ALProxy("ALTextToSpeech", NAO_IP, 9559) def main(): tts.say("I'm going to connect to the internet now!") for i i...
gpl-2.0
467,417,381,829,688,060
32.026316
157
0.600478
false
3.645349
false
false
false
lengstrom/dotfiles
.emacs.d/elpa/anaconda-mode-20150626.441/anaconda_mode.py
1
4228
""" anaconda_mode ~~~~~~~~~~~~~ This is anaconda_mode autocompletion server. :copyright: (c) 2013-2015 by Artem Malyshev. :license: GPL3, see LICENSE for more details. """ from __future__ import ( absolute_import, unicode_literals, division, print_function) import sys from functools import w...
gpl-3.0
-1,771,323,944,087,753,500
25.425
75
0.609508
false
3.929368
false
false
false
varapp/varapp-backend-py
tests/samples/test_samples.py
2
2081
#!/usr/bin/env python3 import unittest from django.test.client import RequestFactory from varapp.samples.samples_factory import * from varapp.constants.tests import NSAMPLES from varapp.samples.samples_service import samples_selection_from_request class TestSample(unittest.TestCase): def test_sample(self): ...
gpl-3.0
-2,647,727,179,012,845,600
37.537037
106
0.649207
false
3.897004
true
false
false
ejyue/2.009PinkSpot
pysimpledmx.py
1
2325
# MAKE SURE THAT THIS IS IN SAME DIRECTORY AS MASTER PYTHON FILE import serial, sys START_VAL = 0x7E END_VAL = 0xE7 COM_BAUD = 57600 COM_TIMEOUT = 1 COM_PORT = 7 DMX_SIZE = 512 LABELS = { 'GET_WIDGET_PARAMETERS' :3, #unused 'SET_WIDGET_PARAMETERS' :4, #unused 'RX_DMX_PACK...
mit
132,626,769,375,859,730
26.678571
98
0.578065
false
3.202479
false
false
false
Serg09/socorro
socorro/external/postgresql/skiplist.py
8
3829
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import logging import psycopg2 from socorro.external import DatabaseError, MissingArgumentError from socorro.external.p...
mpl-2.0
-3,424,378,661,777,563,600
32.295652
78
0.583181
false
4.504706
false
false
false
z0rr0/eshop
shop/shop/cart.py
1
2967
from django.conf import settings from django.shortcuts import get_object_or_404 from sales.models import Product import logging LOGGER = logging.getLogger(__name__) class Cart(object): """Customers cart It uses cookie NAME. Cookie template is "product_id1::number1;product_id2::number2". """ NA...
mit
-8,872,298,837,236,488,000
26.220183
91
0.532861
false
4.389053
false
false
false