repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
bearops/ebzl
ebzl/modules/ecs.py
1
4547
from .. lib import ( ecs, format as fmt, parameters ) from . import ( version ) import os import json import argparse def get_argument_parser(): parser = argparse.ArgumentParser("ebzl ecs") parameters.add_profile(parse, required=False) parameters.add_region(parser, required=False) ...
bsd-3-clause
-6,729,863,579,245,356,000
26.72561
74
0.607653
false
rjungbeck/rasterizer
mupdf12.py
1
2411
from mupdfbase import MuPdfBase, Matrix, Rect, BBox from ctypes import cdll,c_float, c_int, c_void_p, Structure, c_char_p,POINTER FZ_STORE_UNLIMITED=0 class MuPdf(MuPdfBase): def __init__(self): self.dll=cdll.libmupdf self.dll.fz_bound_page.argtypes=[c_void_p, c_void_p, POINTER(Rect)] self.dll...
agpl-3.0
-1,224,500,625,628,163,300
28.935897
94
0.68229
false
bsmedberg/socorro
socorro/webapi/servers.py
1
3703
# 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 web import os from socorro.webapi.classPartial import classWithPartialInit from configman import Namespace, Req...
mpl-2.0
-4,690,380,834,921,110,000
34.605769
79
0.47286
false
lgiordani/punch
punch/vcs_repositories/git_flow_repo.py
1
3464
from __future__ import print_function, absolute_import, division import subprocess import os import six from punch.vcs_repositories import git_repo as gr from punch.vcs_repositories.exceptions import ( RepositoryStatusError, RepositorySystemError ) class GitFlowRepo(gr.GitRepo): def __init__(self, work...
isc
-688,748,351,345,906,800
28.862069
78
0.556582
false
MaisamArif/NEST
backend/tmp_markov_framework/markov_script.py
1
1912
import numpy as np import random def normalize(arr): s = sum(arr) if s == 0: s = 1 arr[0] = 1 for i, val in enumerate(arr): arr[i] = val/s def generate(width, height): matrix = [] for i in range(height): matrix.append([]) for j in range(width): ...
gpl-3.0
-5,248,547,207,103,633,000
23.202532
103
0.544979
false
UCSD-AUVSI/Heimdall
Recognition/ColorClassifier/PythonColorClassifier/ColorClassifier/Python/main.py
1
3405
import cv2 import math import numpy as np import pickle import sys import os import platform def getColor(color, testCode): print "starting Get Color" try: PATH = "Recognition/ColorClassifier/PythonColorClassifier/ColorClassifier/Python/" color_db=pickle.load(open(PATH+"color_db.p","rb")) except : print "Exce...
gpl-3.0
-1,206,405,904,176,180,000
28.608696
139
0.679589
false
ewmoore/numpy
setup.py
1
7204
#!/usr/bin/env python """NumPy: array processing for numbers, strings, records, and objects. NumPy is a general-purpose array-processing package designed to efficiently manipulate large multi-dimensional arrays of arbitrary records without sacrificing too much speed for small multi-dimensional arrays. NumPy is built ...
bsd-3-clause
-3,140,936,165,528,526,000
32.663551
87
0.62271
false
tbjoern/adventofcode
One/script.py
1
1159
file = open("input.txt", "r") input = file.next() sequence = input.split(", ") class walker: def __init__(self): self.east = 0 self.south = 0 self.facing = 0 self.tiles = {} def turnL(self): if self.facing == 0: self.facing = 3 else: self.facing -= 1 def turnR(self): i...
mit
5,358,361,581,108,001,000
15.328358
42
0.559103
false
CLVsol/odoo_addons
clv_seedling/batch_history/clv_seedling_batch_history.py
1
2387
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
3,222,787,404,884,915,000
53.25
116
0.514872
false
what-studio/profiling
test/test_tracing.py
1
1802
# -*- coding: utf-8 -*- import sys import pytest from _utils import factorial, find_stats, foo from profiling.stats import RecordingStatistics from profiling.tracing import TracingProfiler def test_setprofile(): profiler = TracingProfiler() assert sys.getprofile() is None with profiler: assert s...
bsd-3-clause
2,869,637,923,411,800,600
30.614035
75
0.671476
false
AstroHuntsman/POCS
pocs/focuser/birger.py
1
16549
import io import re import serial import time import glob from pocs.focuser.focuser import AbstractFocuser # Birger adaptor serial numbers should be 5 digits serial_number_pattern = re.compile('^\d{5}$') # Error codes should be 'ERR' followed by 1-2 digits error_pattern = re.compile('(?<=ERR)\d{1,2}') error_message...
mit
46,177,568,672,669,770
40.580402
117
0.563236
false
queria/my-tempest
tempest/api/compute/servers/test_list_server_filters.py
1
13183
# Copyright 2012 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 requ...
apache-2.0
-4,528,039,094,660,842,500
43.090301
79
0.602974
false
linuxmidhun/0install
zeroinstall/cmd/remove_feed.py
1
1066
""" The B{0install remove-feed} command-line interface. """ # Copyright (C) 2011, Thomas Leonard # See the README file for details, or visit http://0install.net. syntax = "[INTERFACE] FEED" from zeroinstall import SafeException, _ from zeroinstall.injector import model, writer from zeroinstall.cmd import add_feed, U...
lgpl-2.1
7,947,182,784,579,347,000
30.352941
78
0.707317
false
catapult-project/catapult-csm
telemetry/telemetry/internal/browser/browser_unittest.py
1
11913
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import re import shutil import tempfile import unittest from telemetry.core import exceptions from telemetry import decorators from...
bsd-3-clause
-8,673,220,361,794,257,000
37.553398
80
0.732645
false
helixyte/TheLMA
thelma/repositories/rdb/mappers/experimentjob.py
1
1080
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Experiment job mapper. """ from sqlalchemy.orm import relationship from everest.repositories.rdb.utils import mapper from thelma.entities.experiment import ...
mit
-7,348,472,988,197,110,000
32.75
80
0.607407
false
SeanEstey/Bravo
app/notify/tasks.py
1
7873
'''app.notify.tasks''' import json, os, pytz from os import environ as env from datetime import datetime, date, time, timedelta from dateutil.parser import parse from bson import ObjectId as oid from flask import g, render_template from app import get_keys, celery #, smart_emit from app.lib.dt import to_local from app....
gpl-2.0
-6,240,724,140,937,675,000
32.7897
104
0.526737
false
tuxofil/Gps2Udp
misc/server/gps2udp.py
1
5891
#!/usr/bin/env python """ Receive Geo location data from the Gps2Udp Android application via UDP/IP and forward them to the stdout line by line. There is some requirements to a valid incoming packet: - it must be of form: TIMESTAMP LATITUDE LONGITUDE ACCURACY [other fields]; - TIMESTAMP is a Unix timestamp (seconds s...
bsd-2-clause
-6,502,868,409,911,242,000
31.016304
76
0.647938
false
Puppet-Finland/trac
files/spam-filter/tracspamfilter/captcha/keycaptcha.py
1
4322
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Dirk Stöcker <trac@dstoecker.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software...
bsd-2-clause
-6,845,159,761,740,019,000
37.580357
82
0.588753
false
thiagopena/PySIGNFe
pysignfe/nfse/bhiss/v10/SubstituicaoNfse.py
1
1459
# -*- coding: utf-8 -*- from pysignfe.xml_sped import * class InfSubstituicaoNfse(XMLNFe): def __init__(self): super(InfSubstituicaoNfse, self).__init__() self.Id = TagCaracter(nome=u'InfSubstituicaoNfse', propriedade=u'Id', raiz=u'/') self.NfseSubstituidora = TagInteiro(nome=u'NfseSubstit...
lgpl-2.1
7,768,406,906,340,372,000
31.444444
97
0.601782
false
panyam/libgraph
libgraph/graphs.py
1
2606
class Edge(object): def __init__(self, source, target, data = None): self._source, self._target, self.data = source, target, data def __repr__(self): return "Edge<%s <-> %s>" % (repr(self.source), repr(self.target)) @property def source(self): return self._source @property de...
apache-2.0
1,825,467,902,488,189,400
33.746667
96
0.608212
false
googleapis/googleapis-gen
google/cloud/billing/v1/billing-v1-py/google/cloud/billing_v1/types/__init__.py
1
1795
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-5,797,525,092,338,457,000
27.046875
74
0.734819
false
akarol/cfme_tests
cfme/tests/cloud_infra_common/test_html5_vm_console.py
1
8156
# -*- coding: utf-8 -*- """Test for HTML5 Remote Consoles of VMware/RHEV/RHOSP Providers.""" import pytest import imghdr import time import re from cfme.cloud.provider.openstack import OpenStackProvider from cfme.common.provider import CloudInfraProvider from cfme.infrastructure.provider.virtualcenter import VMwarePro...
gpl-2.0
-2,640,400,068,133,238,300
43.813187
100
0.643943
false
adsabs/citation_helper_service
citation_helper_service/citation_helper.py
1
1894
''' Created on Nov 1, 2014 @author: ehenneken ''' from __future__ import absolute_import # general module imports import sys import os import operator from itertools import groupby from flask import current_app from .utils import get_data from .utils import get_meta_data __all__ = ['get_suggestions'] def get_sugge...
mit
-4,987,392,031,141,406,000
33.436364
79
0.67265
false
fenimore/freeebot
freeebot.py
1
5664
#!/usr/bin/env python """Twitter Bot for posting craigslist postings of Free Stuff Currently set up for New York. Example usage: python tweetstuffs.py Attributes: - NO_IMAGE -- link for when there is no image found - FILE -- path to tmp file - PATH -- current directory - C_KEY, C_SECRET, A_TOKEN,...
mit
6,432,309,924,595,103,000
35.307692
103
0.570798
false
embray/numpy
numpy/lib/npyio.py
1
66490
from __future__ import division, absolute_import, print_function import sys import os import re import itertools import warnings import weakref from operator import itemgetter import numpy as np from . import format from ._datasource import DataSource from ._compiled_base import packbits, unpackbits from ._iotools im...
bsd-3-clause
-2,169,429,861,298,942,200
33.957939
89
0.559107
false
ramanala/PACE
pacersmexplorer.py
1
23886
#!/usr/bin/env python #Copyright (c) 2016 Ramnatthan Alagappan #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, copy, modif...
mit
-8,455,374,928,677,028,000
35.69278
134
0.70937
false
py-amigos/adengine
tests/views/test_user.py
1
2439
import json from adengine.model import User, Ad NOT_FOUND_ERROR = { "error": "Not found" } def build_api_url(id_=None): if id_ is not None: return "/api/users/{}".format(id_) return "/api/users" def _new_ad(user, text="ad-text"): ad = Ad(text=text, author_id=user.id) return ad def _n...
artistic-2.0
717,517,338,135,256,300
20.394737
63
0.603936
false
tartley/extending_unittest
src/all_dirs_runner.py
1
3508
''' A test runner that augments Django's standard one by finding subclasses of unittest.TestCase no matter where they are located in the project, even in directories which are not django apps. (the default test runner only looks in particular modules within each django app.) See also tests.utils.testrunner, which uses...
bsd-3-clause
-4,128,150,580,483,212,300
28.982906
77
0.609179
false
StudyBlue/sblibs
sblibs/display/general.py
1
1801
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright © Manoel Vilela 2016 # # @project: Decorating # @author: Manoel Vilela # @email: manoel_vilela@engineer.com # # pylint: disable=redefined-builtin # pylint: disable=invalid-name """ An collection of usefull decorators for debug and time...
bsd-2-clause
1,671,279,908,194,633,700
23
78
0.622222
false
Donkyhotay/MoonPy
zope/wfmc/adapter/integration.py
1
1606
############################################################################## # # Copyright (c) 2004 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
gpl-3.0
-3,358,966,468,289,544,700
34.688889
78
0.652553
false
microelly2/geodata
geodat/import_aster.py
1
5208
''' geodat import AST (gdal)''' # -*- coding: utf-8 -*- #------------------------------------------------- #-- geodat import AST (gdal) #-- #-- microelly 2016 v 0.1 #-- #-- GNU Lesser General Public License (LGPL) #------------------------------------------------- #http://geoinformaticstutorial.blogspot.de/2012/09/rea...
lgpl-3.0
-4,922,200,730,300,529,000
20.520661
256
0.679724
false
thombashi/pytablewriter
test/writer/text/test_html_writer.py
1
14391
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from textwrap import dedent import pytest import pytablewriter from pytablewriter.style import Style from ..._common import print_test_result from ...data import ( Data, headers, mix_header_list, mix_value_matrix, null_test_...
mit
-4,953,065,116,235,393,000
26.781853
112
0.468765
false
flavoso/gerencex
gerencex/core/tests/test_view_office_tickets.py
1
1342
import datetime from django.contrib.auth.models import User from django.shortcuts import resolve_url as r from django.test import TestCase from django.utils import timezone from gerencex.core.models import Restday, Office class OfficeTicketsViewTest(TestCase): def setUp(self): self.office = Office.objec...
gpl-3.0
6,811,396,555,601,649,000
30.952381
73
0.629657
false
Livefyre/flaubert
flaubert/preprocess.py
1
19265
import nltk import unicodedata import regex as re import sys import abc import logging import os import cPickle as pickle from pkg_resources import resource_filename from bs4 import BeautifulSoup from itertools import islice from functools import partial from nltk.corpus import stopwords from nltk.stem import wordnet, ...
mit
-4,700,687,090,115,815,000
33.649281
106
0.606956
false
sloede/modm
modfileparser.py
1
6189
#!/usr/bin/env python # Modm - Modules iMproved # Copyright (C) 2013-2014 Michael Schlottke # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your opt...
gpl-2.0
8,359,449,882,160,916,000
34.774566
80
0.604944
false
cp16net/trove
trove/tests/unittests/guestagent/test_dbaas.py
1
144181
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
275,580,507,818,071,580
42.310604
79
0.602201
false
omegachysis/arche-engine
arche/image.py
1
11087
_panda = False try: import pygame from pygame import locals except: _panda = True import logging log = logging.getLogger("R.Surface") def scaleImage(surface, width, height): """ Return surface scaled to fit width and height. """ #log.debug("scaled image %s" % repr(surface)) return pygame.tr...
apache-2.0
5,942,455,946,340,129,000
29.378082
93
0.590872
false
silly-wacky-3-town-toon/SOURCE-COD
toontown/battle/DistributedBattleFinal.py
1
7784
from panda3d.core import * from panda3d.direct import * from direct.interval.IntervalGlobal import * from BattleBase import * from direct.actor import Actor from toontown.distributed import DelayDelete from direct.directnotify import DirectNotifyGlobal import DistributedBattleBase import MovieUtil from toontown.suit im...
apache-2.0
-5,185,984,711,244,480,000
37.534653
223
0.656475
false
mkieszek/jobsplus
jobsplus_recruitment/wizard/jp_recruiter2deal.py
1
4127
# -*- coding: utf-8 -*- """ Created on Mon Aug 26 09:48:26 2013 @author: mbereda """ from openerp.osv import osv,fields from openerp.tools.translate import _ import pdb import datetime class jp_recruiter2deal(osv.Model): _name = 'jp.recruiter2deal' _columns = { 'deal_id': fields.many2one('jp...
agpl-3.0
-6,351,029,749,241,071,000
42.452632
162
0.53889
false
atmtools/typhon
doc/example_google.py
1
8646
# -*- coding: utf-8 -*- """Example Google style docstrings. This module demonstrates documentation as specified by the `Google Python Style Guide`_. Docstrings may extend over multiple lines. Sections are created with a section header and a colon followed by a block of indented text. Example: Examples can be give...
mit
-1,395,894,020,954,367,700
30.67033
79
0.64978
false
rjenc29/numerical
course/matplotlib/examples/fill_example.py
1
2229
""" Illustrate different ways of using the various fill functions. """ import numpy as np import matplotlib.pyplot as plt import example_utils def main(): fig, axes = example_utils.setup_axes() fill_example(axes[0]) fill_between_example(axes[1]) stackplot_example(axes[2]) example_utils.title(fig...
mit
-5,428,542,155,974,001,000
27.948052
76
0.623598
false
seninp/saxpy
saxpy/hotsax.py
1
4860
"""Implements HOT-SAX.""" import numpy as np from saxpy.znorm import znorm from saxpy.sax import sax_via_window from saxpy.distance import euclidean def find_discords_hotsax(series, win_size=100, num_discords=2, alphabet_size=3, paa_size=3, znorm_threshold=0.01, sax_type='unidim'): """HOT...
gpl-2.0
5,871,183,956,478,835,000
33.721429
121
0.531893
false
sighill/shade_app
apis/raw/017_raw/017_cleaner.py
1
1278
# -*- coding: utf-8 -*- # 017_cleaner.py # CODED TO BE EXECUTED SERVER SIDE : # cd /home/common/shade # python3 manage.py shell import sys from apis.voca import * ################################## # Init des paths et noms de fichiers AddLog('title' , 'Début du nettoyage du fichier') work_dir = '/home/com...
mit
-8,009,218,853,207,783,000
30.641026
112
0.605822
false
reprah/shy
shy.py
1
2992
#!/usr/bin/env python import sys, os, re, subprocess # begin loop: # - reading from stdin # - forking a child # - executing a new process in the child def main(): while True: sys.stdout.write(os.environ['PROMPT']) line = sys.stdin.readline() commands = split_on_pipes(line) placeholder_in = sys.stdin plac...
mit
7,146,024,717,470,157,000
22.559055
78
0.642714
false
csiro-rds/casda-samples
cutouts_by_proj.py
1
7634
############################################################################################# # # Python script to demonstrate interacting with CASDA's SODA implementation to # retrieve cutout images around a list of sources. # # This script creates a job to produce and download cutouts from the specified image at # t...
apache-2.0
4,055,497,068,719,523,000
44.712575
184
0.61344
false
tjhunter/phd-thesis-tjhunter
python/kdd/plot_network.py
1
1065
__author__ = 'tjhunter' import build import json import pylab as pl from matplotlib.collections import LineCollection # Draws the network as a pdf and SVG file. def draw_network(ax, fd, link_style): def decode_line(l): #print l dct = json.loads(l) lats = dct['lats'] lons = dct['lons'] return zi...
apache-2.0
-1,207,750,359,825,550,300
26.307692
68
0.656338
false
interalia/cmsplugin_availablejobs
availablejob/views.py
1
3330
from django.views.generic.simple import direct_to_template from django.views.generic.list_detail import object_detail from django.contrib.sites.models import Site from django.shortcuts import get_object_or_404 from django.contrib import messages from models import EnableOpening, Opening, Candidate from forms import Ap...
bsd-3-clause
7,716,668,419,080,434,000
30.415094
95
0.63033
false
calio/cflow2dot
cflow2dot.py
1
9602
#!/usr/bin/env python import os.path import sys import subprocess import re import argparse import json from sys import exit from os import system cflow_path = "/usr/local/bin/cflow" dot_path = "/usr/local/bin/dot" color = ["#eecc80", "#ccee80", "#80ccee", "#eecc80", "#80eecc"]; shape =["box", "ellipse", "octagon", ...
mit
-4,698,164,425,426,742,000
39.686441
204
0.613622
false
kokosowy/vuadek
vuadek.py
1
1180
#!/usr/bin/python3.4 import sys import os import subprocess zm_home = os.path.expanduser("~") zm_pth_workdir = zm_home+"/.vuadek/" if not os.path.exists(zm_pth_workdir): os.makedirs(zm_pth_workdir) zm_fl_remains = zm_pth_workdir+"remains" pathname = os.path.dirname(sys.argv[1]) if not os.path.isfile(zm_fl_rema...
gpl-2.0
-4,554,903,689,397,167,600
29.25641
170
0.65678
false
teamosceola/bitbake
lib/bb/ui/knotty.py
1
12691
# # BitBake (No)TTY UI Implementation # # Handling output to TTYs or files (no TTY) # # Copyright (C) 2006-2007 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # Thi...
gpl-2.0
-854,224,645,206,136,700
38.908805
175
0.532897
false
superdesk/eve
eve/tests/renders.py
1
11071
# -*- coding: utf-8 -*- from eve.tests import TestBase from eve.utils import api_prefix from eve.tests.test_settings import MONGO_DBNAME import simplejson as json class TestRenders(TestBase): def test_default_render(self): r = self.test_client.get('/') self.assertEqual(r.content_type, 'applicati...
bsd-3-clause
-1,690,569,143,142,862,800
44.937759
79
0.571583
false
MaxLinCode/tardy-HackIllinois-2017
alexa/lambda_function.py
1
6803
""" This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit. The Intent Schema, Built-in Slots, and Sample Utterances for this skill, as well as testing instructions are located at http://amzn.to/1LzFrj6 For additional samples, visit the Alexa Skills Kit Getting Started guide at http://amzn.to/1...
mit
3,407,677,043,786,212,400
32.850746
132
0.641482
false
quru/qis
src/imageserver/errors.py
1
2593
# # Quru Image Server # # Document: errors.py # Date started: 31 Mar 2011 # By: Matt Fozard # Purpose: Internal errors and exceptions # Requires: # Copyright: Quru Ltd (www.quru.com) # Licence: # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
6,222,362,547,311,885,000
22.36036
79
0.649055
false
lukas-bednar/python-rrmngmnt
rrmngmnt/ssh.py
1
10209
import os import time import socket import paramiko import contextlib import subprocess from rrmngmnt.executor import Executor AUTHORIZED_KEYS = os.path.join("%s", ".ssh/authorized_keys") KNOWN_HOSTS = os.path.join("%s", ".ssh/known_hosts") ID_RSA_PUB = os.path.join("%s", ".ssh/id_rsa.pub") ID_RSA_PRV = os.path.join("...
gpl-2.0
-7,273,027,268,052,574,000
33.962329
77
0.515526
false
lipro-yocto/git-repo
subcmds/cherry_pick.py
1
3421
# Copyright (C) 2010 The Android Open Source Project # # 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 ...
apache-2.0
5,867,796,251,983,264,000
28.747826
78
0.621163
false
CloudBoltSoftware/cloudbolt-forge
ui_extensions/multilevelapprovals/views.py
1
14185
from urllib.parse import urlparse from django.contrib import messages from django.http import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.template import loader from django.urls import reverse from django.utils.translation import ugettext as _, ungettext from accou...
apache-2.0
-6,349,238,309,283,162,000
38.298295
111
0.582023
false
LeandroRoberto/sapl
sapl/comissoes/views.py
1
3353
from django.core.urlresolvers import reverse from django.db.models import F from django.views.generic import ListView from sapl.crud.base import RP_DETAIL, RP_LIST, Crud, CrudAux, MasterDetailCrud from sapl.materia.models import MateriaLegislativa, Tramitacao from .models import (CargoComissao, Comissao, Composicao,...
gpl-3.0
4,696,481,446,960,925,000
32.53
78
0.638831
false
mdovgialo/steam-vr-wheel
steam_vr_wheel/pyvjoy/_wrapper.py
1
2789
import os import sys from ctypes import * dll_filename = "vJoyInterface.dll" dll_path = os.path.dirname(__file__) + os.sep + dll_filename try: _vj = cdll.LoadLibrary(dll_path) except OSError: sys.exit("Unable to load vJoy SDK DLL. Ensure that %s is present" % dll_filename) def vJoyEnabled(): """...
mit
8,956,066,866,461,069,000
21.241667
102
0.688777
false
mvaled/sentry
tests/sentry/attachments/test_redis.py
1
2148
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock import zlib from sentry.cache.redis import RedisClusterCache, RbCache from sentry.testutils import TestCase from sentry.utils.imports import import_string class FakeClient(object): def get(self, key): if key == "c:1:foo:a": ...
bsd-3-clause
-668,644,714,577,843,700
32.046154
98
0.637337
false
millken/simple-rtmp-server
trunk/research/community/server.py
1
4633
#!/usr/bin/python ''' The MIT License (MIT) Copyright (c) 2013-2014 winlin 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, cop...
mit
-3,654,521,204,986,091,500
31.398601
98
0.668465
false
golya/FuzzLabs
engine/tests/steps/modules.py
1
1961
from behave import * import os import sys import inspect ROOT_DIR = os.path.dirname( os.path.abspath( inspect.getfile(inspect.currentframe() ))) sys.path.append(ROOT_DIR + "/../../classes") from ConfigurationHandler import ConfigurationHandler from ModuleHandler imp...
gpl-2.0
9,094,677,830,503,925,000
29.640625
74
0.63743
false
digwanderlust/pants
tests/python/pants_test/tasks/test_cache_manager.py
1
4690
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import shutil import...
apache-2.0
-6,835,737,676,427,223,000
36.52
148
0.685501
false
amanzi/ats-dev
tools/utils/transect_data.py
2
7741
"""Loads and/or plots 2D, topologlically structured data on quadrilaterals using matplotlib. """ import sys,os import numpy as np import h5py import mesh import colors def fullname(varname): fullname = varname if not '.cell.' in fullname: fullname = fullname+'.cell.0' return fullname def transec...
bsd-3-clause
-6,002,022,548,617,249,000
35.687204
143
0.575119
false
gunan/tensorflow
tensorflow/python/keras/layers/preprocessing/benchmarks/categorical_encoding_benchmark.py
1
3177
# Copyright 2020 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
5,262,048,413,489,094,000
35.517241
80
0.652188
false
mommermi/callhorizons
callhorizons/callhorizons.py
1
60381
"""CALLHORIZONS - a Python interface to access JPL HORIZONS ephemerides and orbital elements. This module provides a convenient python interface to the JPL HORIZONS system by directly accessing and parsing the HORIZONS website. Ephemerides can be obtained through get_ephemerides, orbital elements through get_elements....
mit
2,673,770,013,249,938,400
44.952055
90
0.409781
false
JulyKikuAkita/PythonPrac
cs15211/SoupServings.py
1
5860
__source__ = 'https://leetcode.com/problems/soup-servings/' # Time: O(N^2) # Space: O(N^2) # # Description: Leetcode # 808. Soup Servings # # There are two types of soup: type A and type B. # Initially we have N ml of each type of soup. There are four kinds of operations: # # Serve 100 ml of soup A and 0 ml of sou...
apache-2.0
-7,564,282,484,889,298,000
31.197802
108
0.523038
false
torkelsson/meta-package-manager
meta_package_manager/managers/mas.py
1
5319
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2018 Kevin Deldycke <kevin@deldycke.com> # and contributors. # All Rights Reserved. # # This program is Free Software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software F...
gpl-2.0
-8,493,799,302,312,990,000
31.432927
79
0.536943
false
apuigsech/CryptoAPI
CryptoAPI/CryptoAPI.py
1
8197
#!/usr/bin/env python # CryptoAPI: Python Crypto API implementation # # Copyright (c) 2014 - Albert Puigsech Galicia (albert@puigsech.com) # # 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 w...
gpl-3.0
8,747,078,000,745,754,000
27.866197
127
0.654508
false
jbq/ufw
src/backend.py
1
24402
'''backend.py: interface for ufw backends''' # # Copyright 2008-2011 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. # # This program is distributed in th...
gpl-3.0
7,539,033,067,947,464,000
35.475336
93
0.489017
false
TUB-Control/PaPI
papi/plugin/io/UDP_Plugin/UDP_Plugin.py
1
26844
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Copyright (C) 2014 Technische Universität Berlin, Fakultät IV - Elektrotechnik und Informatik, Fachgebiet Regelungssysteme, Einsteinufer 17, D-10587 Berlin, Germany This file is part of PaPI. PaPI is free software: you can redistribute it and/or modify it under the term...
gpl-3.0
-5,428,349,017,113,714,000
33.814527
123
0.535914
false
craigderington/studentloan5
tests/engine.py
1
5088
from subprocess import call from os import path import hitchpostgres import hitchselenium import hitchpython import hitchserve import hitchredis import hitchtest import hitchsmtp # Get directory above this file PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..')) class ExecutionEngine(hitchtest...
bsd-3-clause
-3,658,331,897,922,075,600
33.378378
114
0.612225
false
equitania/myodoo-addons-v10
eq_project/models/__init__.py
1
1068
# -*- coding: utf-8 -*- ############################################################################## # # Odoo Addon, Open Source Management Solution # Copyright (C) 2014-now Equitania Software GmbH(<http://www.equitania.de>). # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
3,027,832,211,828,780,000
47.545455
79
0.620787
false
opnsense/core
src/opnsense/scripts/netflow/lib/flowparser.py
1
8475
""" Copyright (c) 2019 Ad Schellevis <ad@opnsense.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ...
bsd-2-clause
991,364,815,688,320,300
41.80303
125
0.520354
false
paulbersch/django-locus
locus/utils/location.py
1
1360
import math # add back later # import GeoIP nauticalMilePerLat = 60.00721 nauticalMilePerLongitude = 60.10793 rad = math.pi / 180.0 milesPerNauticalMile = 1.15078 def calcDistance(lat1, lon1, lat2, lon2): """ Caclulate distance between two lat lons in NM """ lat1 = float(lat1) lat2 = float(...
mit
4,176,555,150,693,318,000
28.565217
107
0.696324
false
MinoMino/minqlx
python/minqlx/_handlers.py
1
18535
# minqlx - Extends Quake Live's dedicated server with extra functionality and scripting. # Copyright (C) 2015 Mino <mino@minomino.org> # This file is part of minqlx. # minqlx is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softw...
gpl-3.0
3,269,673,672,761,068,500
35.201172
120
0.580523
false
lundjordan/services
src/codecoverage/bot/code_coverage_bot/codecov.py
1
7319
# -*- coding: utf-8 -*- import json import os import tempfile from datetime import datetime from datetime import timedelta import hglib import requests from cli_common.log import get_logger from cli_common.taskcluster import get_service from cli_common.utils import ThreadPoolExecutorResult from code_coverage_bot imp...
mpl-2.0
2,492,991,510,418,303,500
39.888268
126
0.609236
false
mediatum/mediatum
utils/hash.py
1
1599
""" mediatum - a multimedia content repository Copyright (C) 2007 Arne Seifert <seiferta@in.tum.de> Copyright (C) 2007 Matthias Kramm <kramm@in.tum.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foun...
gpl-3.0
-1,159,093,611,323,354,600
27.052632
76
0.676673
false
doismellburning/tox
tests/test_z_cmdline.py
1
20318
import tox import py import pytest from tox._pytestplugin import ReportExpectMock try: import json except ImportError: import simplejson as json pytest_plugins = "pytester" from tox._cmdline import Session from tox._config import parseconfig def test_report_protocol(newconfig): config = newconfig([], """...
mit
-8,756,750,694,607,493,000
28.661314
80
0.552466
false
baseclue/django-rest-test
tests/test_compare.py
1
15578
import unittest from rest_test import compare class DictTestCase(unittest.TestCase): def test_basic(self): data = dict( a=1, b='2' ) expected_data = dict( b='2', a=1 ) assert compare(data, expected_data) def test_basic_...
apache-2.0
7,426,249,069,602,658,000
18.399751
57
0.29991
false
apeyrard/sjtu-work
DIP/exercises/ex3/ex3.py
1
3652
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import sys from PIL import Image import numpy as np import math import argparse def getMatrix(image): data = list(image.getdata()) width, height = image.size matrix = np.array(data).reshape(height,width) return matrix def getData(matrix): data = lis...
mit
3,300,094,426,064,420,000
31.035088
89
0.589266
false
luk156/minimo
minimo/documento/migrations/0004_auto__add_unitamisura__add_field_riga_unita.py
1
10331
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UnitaMisura' db.create_table(u'documento_unitamisura', ( (u'id', self.gf('django...
gpl-2.0
823,570,124,755,032,000
74.416058
209
0.55106
false
fzimmermann89/pyload
module/plugins/hoster/FastixRu.py
1
1366
# -*- coding: utf-8 -*- import re import urllib from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo from module.plugins.internal.utils import json class FastixRu(MultiHoster): __name__ = "FastixRu" __type__ = "hoster" __version__ = "0.17" __status__ = "testing" __...
gpl-3.0
3,599,834,605,401,120,300
29.355556
90
0.533675
false
Purg/kwiver
vital/bindings/python/vital/types/landmark_map.py
1
4829
""" ckwg +31 Copyright 2016 by Kitware, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the ...
bsd-3-clause
-1,191,061,869,346,105,300
30.562092
88
0.61607
false
tectronics/openmalaria-git
util/compareOutput.py
1
7178
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of OpenMalaria. # # Copyright (C) 2005-2010 Swiss Tropical Institute and Liverpool School Of Tropical Medicine # # OpenMalaria is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by #...
gpl-2.0
-189,319,169,589,652,500
38.224044
165
0.617721
false
linyc74/CaMNIST
view.py
1
12377
import numpy as np import cv2, time, sys, threading, json, os from PyQt4 import QtCore, QtGui from controller import * class CamnistGUI(QtGui.QMainWindow): def __init__(self, controller_obj): super(CamnistGUI, self).__init__() self.controller = controller_obj pkg_dir = os.path.dirname(__...
mit
6,695,720,950,841,457,000
32.271505
95
0.586329
false
google-research/google-research
poem/core/keypoint_profiles.py
1
48752
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
7,232,078,692,394,039,000
41.027586
80
0.556059
false
stilobique/UE4-Tools
controllers/data_buffer.py
1
3448
import bpy import pyperclip from math import degrees class DataBuffer(bpy.types.Operator): """Export data Position, Rotation and Scale of all selected element""" bl_idname = "object.data_buffer" bl_label = "Paste information buffer" def execute(self, context): objs = context.selected_objects...
gpl-3.0
-6,769,097,919,469,354,000
37.322222
114
0.49739
false
posquit0/dotfiles
vim/.vim/ycm_extra_conf.py
1
6657
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
mit
-7,185,472,345,298,154,000
32.964286
107
0.705122
false
prefetchnta/questlab
bin/x64bin/python/37/Lib/ctypes/util.py
1
13437
import os import shutil import subprocess import sys # find_library(name) returns the pathname of a library, or None. if os.name == "nt": def _get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in ...
lgpl-2.1
6,956,310,689,996,022,000
35.53352
102
0.467143
false
AceSrc/datagon
datagon/generator/translator.py
1
3802
import parser import random result = '' symbol = {} cnt = 0 def Translator(ast): def PrintError(x): print(x) exit(1) def PrintMsg(x): print(x) def Output(x): global result result += str(x) + ' ' def GetRandomInt(interval): if isinstance(interval, str)...
mit
9,119,672,105,469,806,000
29.66129
111
0.553919
false
sesh/djver
djver/djver.py
1
6137
#!/usr/bin/env python """ djver. Usage: djver.py [<url>] [--static-path=<static-path>] [--find-diffs] [--verbose] Options: --static-path=<static-path> URL path to the site's static files [default: /static/]. --find-diffs Attempt to find differences between the known versions of Django ...
mit
6,160,630,217,541,258,000
31.994624
131
0.536093
false
marrow/mongo
test/trait/test_collection.py
1
3008
# encoding: utf-8 from __future__ import unicode_literals import pytest from pymongo.errors import WriteError from marrow.mongo import Field, Index from marrow.mongo.trait import Collection @pytest.fixture def db(request, connection): return connection.test @pytest.fixture def coll(request, db): return db.coll...
mit
8,838,251,156,425,727,000
23.258065
89
0.68617
false
ICTU/quality-time
components/server/src/initialization/report.py
1
2301
"""Report loaders.""" import json import logging import pathlib from pymongo.database import Database from database.reports import insert_new_report, insert_new_reports_overview, latest_reports_overview, report_exists def initialize_reports_overview(database: Database) -> None: """Initialize the reports overvi...
apache-2.0
7,523,116,976,913,807,000
51.295455
120
0.719687
false
pythonbyexample/PBE
dbe/classviews/edit_custom.py
1
5732
from django.forms import formsets from django.contrib import messages from django.db.models import Q from detail import * from edit import * from dbe.shared.utils import * class SearchFormViewMixin(BaseFormView): ignore_get_keys = ["page"] def get_form_kwargs(self): """ Returns the keyword arguments...
bsd-3-clause
-6,290,611,191,496,170,000
32.325581
112
0.629449
false
CINPLA/expipe-dev
expipe-templates-cinpla/get_templates.py
1
1153
import expipe import os.path as op import os import json overwrite = True base_dir = op.join(op.abspath(op.dirname(op.expanduser(__file__))), 'templates') templates = expipe.core.FirebaseBackend("/templates").get() for template, val in templates.items(): identifier = val.get('identifier') if identifier is No...
gpl-3.0
-6,103,008,432,294,853,000
33.939394
80
0.611448
false
prontodev/stillwithus
stillwithus/clientsites/tests.py
1
6014
from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase from .models import ClientSite from servers.models import Server class ClientSiteTest(TestCase): def test_create_new_clientsite(self): clientsite = ClientSite() clientsite.dom...
mit
-631,185,773,679,272,400
37.305732
78
0.618557
false
MMohan1/dwitter
dwitter_app/models.py
1
1342
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User import hashlib class Dweet(models.Model): content = models.CharField(max_length=140) user = models.ForeignKey(User) creation_date = models.DateTimeField(auto_now=True, ...
mit
5,100,131,809,558,829,000
28.822222
98
0.716095
false
opensemanticsearch/open-semantic-etl
src/opensemanticetl/enhance_extract_law.py
1
5028
#!/usr/bin/python # -*- coding: utf-8 -*- import re import etl_plugin_core # # get taxonomy for aggregated facets / filters # # example: '§ 153 Abs. 1 Satz 2' -> ['§ 153', '§ 153 Absatz 1', '§ 153 Absatz 1 Satz 2'] # todo: def get_taxonomy(law_clause, law_code = None): law_clauses = [law_clause] ret...
gpl-3.0
-8,537,179,740,462,621,000
32.657718
147
0.498504
false
irinabov/debian-qpid-dispatch
tests/system_test.py
1
46655
# # 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...
apache-2.0
-226,416,414,018,872,100
35.649647
129
0.584075
false
LeonidasAntoniou/dk-plus
test files/beacon.py
1
1799
""" A simple program that sends/listens broadcast packets through UDP socket Used to test the system if it is able to send/receive packets """ import time, math, sys, socket, threading, select, uuid from collections import namedtuple import cPickle as pickle from params import Params MAX_STAY = 5 #seconds until entry...
gpl-3.0
-9,053,915,557,494,988,000
25.850746
81
0.699277
false