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
open-synergy/event
crm_lead_to_event_registration/tests/test_crm_lead_to_event_registration.py
1
1837
# -*- coding: utf-8 -*- # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import fields from openerp.tests import common class TestCrmLeadToEventRegistration(common.TransactionCase): def setUp(self): super(TestCrmLeadToEventR...
agpl-3.0
3,998,139,696,512,973,300
37.25
79
0.585512
false
google/google-ctf
third_party/edk2/BaseTools/Source/Python/CommonDataClass/CommonClass.py
1
4241
## @file # This file is used to define common items of class object # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. ...
apache-2.0
-8,464,301,721,770,162,000
41.721649
143
0.620844
false
VHAINNOVATIONS/DmD
scrubber/MIST_2_0_4/src/MAT/lib/mat/python/MAT/PropertyCache.py
1
6712
# Copyright (C) 2007 - 2009 The MITRE Corporation. See the toplevel # file LICENSE for license terms. # This is a file-based property cache which I was originally using in # the experiment engine, but now also in the workspaces. # # A property cache # # attrTriples is a sequence of triples <attr>, <readFunction>, <w...
apache-2.0
586,704,132,469,674,100
38.482353
111
0.476162
false
ajessup/appstart
appstart/sandbox/container_sandbox.py
1
23266
# Copyright 2015 Google 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 applicable law or a...
apache-2.0
8,048,079,043,332,018,000
41.072333
81
0.57887
false
RyanSkraba/beam
sdks/python/apache_beam/examples/wordcount.py
1
5161
# # 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 us...
apache-2.0
626,437,405,938,748,800
36.398551
79
0.679132
false
Spacecraft-Code/SPELL
src/spell/spell/utils/getch.py
1
3563
################################################################################### ## MODULE : spell.utils.getch ## DATE : Mar 18, 2011 ## PROJECT : SPELL ## DESCRIPTION: Getchar implementation ## -------------------------------------------------------------------------------- ## ## Copyright (C) 2008, ...
lgpl-3.0
2,679,316,217,137,369,000
28.213115
84
0.442885
false
gperciva/artifastring
research/mode-detect/short.py
1
2790
#!/usr/bin/env python import sys sys.path.append("../shared/") import os import harmonics_data import sys import mode_decays import published_constants import adjust_decays import tables # no clue why I need this. :( from harmonics_data import HarmonicsStats def process(dirname, basename, recalc=False, plot=Fa...
gpl-3.0
-686,684,109,385,111,900
26.352941
77
0.58638
false
ylam/DataScienceCoursera
frequency_2.py
1
1211
import sys import json def hw(): print 'Hello, world!' def lines(fp): print str(len(fp.readlines())) def main(): tweet_file = open(sys.argv[1]) #hw() #lines(sent_file) #lines(tweet_file) #save tweet files myData = {} #save tweet counts Result = {} #save frequency Freq...
gpl-2.0
8,787,856,851,238,190,000
21.425926
69
0.609414
false
edx/edxanalytics
src/edxanalytics/edxmodules/video_analytics/common.py
1
3765
""" Configuration for every video player / site. - Properties (prefix none): names of video properties (e.g., autoplay on?) - Events (prefix EVT): names of video events (e.g., video_play) To add a new target, simply copy an existing block, paste, and modify. - normal values: boolean or string or list with one item - d...
agpl-3.0
-8,471,714,969,963,333,000
30.638655
74
0.592563
false
tjps/bitcoin
test/functional/rpc_users.py
1
4247
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiple RPC users.""" from test_framework.test_framework import BitcoinTestFramework from test_f...
mit
5,873,558,166,899,214,000
38.635514
133
0.624853
false
ccauet/scikit-optimize
skopt/learning/gaussian_process/tests/test_gpr.py
1
3320
import numpy as np import pytest from scipy import optimize from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_array_almost_equal from...
bsd-3-clause
1,136,411,059,373,997,400
31.871287
78
0.697289
false
sarimak/generator
markdown_extensions.py
1
2173
#!/usr/bin/python3 # coding: utf-8 """ Register two Markdown extensions which replace <a href=""> and <img src=""> with {{ url_for('') }} and {{ resource('') }} placeholders which can be rewritten to absolute URLs and path to static resources. """ import markdown import markdown.inlinepatterns class UrlForEx...
gpl-2.0
-1,098,341,667,282,342,700
35.216667
80
0.649793
false
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/startup/nodeitems_builtins.py
1
19000
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
7,506,633,246,367,762,000
38.014374
98
0.667632
false
ska-sa/casperfpga
scripts/casperfpga_program.py
1
1087
#!/usr/bin/env python __author__ = 'paulp' import argparse from casperfpga.casperfpga import CasperFpga parser = argparse.ArgumentParser( description='Program an FPGA.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument(dest='hostname', type=str, action='store', ...
gpl-2.0
-8,250,994,456,271,240,000
31.939394
79
0.658694
false
chmarr/prequelprizes
prizes/migrations/0002_auto__add_field_winner_authentication_ip__add_field_winner_details_ip.py
1
2807
# -*- 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 field 'Winner.authentication_ip' db.add_column('prizes_winner', 'authentication_ip', ...
gpl-2.0
-1,932,945,504,593,230,000
53
135
0.566441
false
gpodder/gpodder
src/gpodder/minidb.py
1
7563
#!/usr/bin/python # -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder 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 versi...
gpl-3.0
1,007,703,415,363,267,500
32.317181
81
0.526907
false
neoden/lagring
test/test.py
1
6253
import os import pytest from flask import Flask from flask_sqlalchemy import SQLAlchemy INSTANCE_ROOT = '' app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://lagring:lagring@localhost:5432/lagring_test' app.config['ASSET_STORAGE_ROOT'] = os.path.join(os.getcwd(), 'test/var/assets') app.conf...
mit
1,610,468,995,106,834,400
23.715415
98
0.629778
false
brechtm/rinohtype
src/rinoh/font/opentype/truetype.py
1
1902
# This file is part of rinohtype, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. import struct from .parse import OpenTypeTable, MultiFo...
agpl-3.0
1,037,244,954,149,980,400
31.793103
80
0.593586
false
pablooliveira/tigergrader
tigergrader/tests/test_plagiarism.py
1
1342
import unittest import os import shutil from tigergrader.initdb import create_user from testhelper import TestHelper class PlagiarismTestCases(TestHelper): def setUp(self): TestHelper.setUp(self) create_user('admin', 'admin@example.com', 'admintiger') create_user('user1', 'user@example.com...
mit
8,271,417,888,378,298,000
32.55
71
0.622951
false
bjuvensjo/scripts
vang/maven/regroup.py
1
2765
#!/usr/bin/env python3 import argparse from os import walk, rename, makedirs, listdir, rmdir from os.path import join, sep from sys import argv from typing import Iterable, Callable from vang.pio.rsr import _replace_in_file, _in def file_content_replace_function(line: str, old: str, new: str) -> str: line = line...
apache-2.0
4,013,461,642,139,699,700
37.943662
118
0.600723
false
rjdp/Easynginedemoplugin
ee/cli/plugins/stack_migrate.py
1
5213
from cement.core.controller import CementBaseController, expose from cement.core import handler, hook from ee.core.mysql import EEMysql from ee.core.logging import Log from ee.core.variables import EEVariables from ee.core.aptget import EEAptGet from ee.core.shellexec import EEShellExec from ee.core.apt_repo import EER...
mit
3,222,771,789,004,413,400
41.040323
78
0.536735
false
FrodeSolheim/fs-uae-launcher
fswidgets/splitter.py
1
4453
import traceback import weakref from typing import List, Optional, cast from typing_extensions import Literal import fsui from fsbc.util import unused from fsui import Widget from fsui.common.layout import HorizontalLayout, Layout, VerticalLayout from fsui.qt.color import Color from fsui.qt.drawingcontext import Drawi...
gpl-2.0
-2,767,218,321,864,412,000
31.985185
77
0.608803
false
cezarfx/zorba
swig/python/tests/test04.py
1
1089
# Copyright 2006-2011 The FLWOR 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 law or agreed t...
apache-2.0
-5,153,413,378,839,610,000
24.928571
74
0.741965
false
EmanueleCannizzaro/scons
test/DVIPDF/makeindex.py
1
2303
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
mit
-5,945,060,233,082,140,000
26.416667
98
0.723404
false
varunarya10/ironic
ironic/objects/conductor.py
2
2328
# coding=utf-8 # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 # #...
apache-2.0
-5,147,548,087,885,553,000
33.235294
78
0.631014
false
ragibkl/blackhole
website/named/models.py
1
1529
from django.db import models from django.template import loader import requests class AdSource(models.Model): name = models.CharField(max_length=10) get_url = models.URLField() def fetch_ad_domains(self): url = self.get_url response = requests.get(url) if response.status_code == 2...
gpl-3.0
-9,100,672,480,641,761,000
31.531915
122
0.53172
false
open-craft/xblock-group-project-v2
tests/unit/test_stage_components.py
1
24794
import json import os from datetime import datetime from unittest import TestCase from xml.etree import ElementTree import ddt import mock import pytz from freezegun import freeze_time from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xblock.runtime import Runtime from xblock.validati...
agpl-3.0
-2,898,909,224,324,588,000
45.257463
120
0.64681
false
DemocracyClub/yournextrepresentative
ynr/apps/duplicates/tests/test_models.py
1
3194
from django.db import IntegrityError from django.test import TestCase from candidates.tests.auth import TestUserMixin from duplicates.models import DuplicateSuggestion from people.tests.factories import PersonFactory class TestDuplicateSuggestion(TestUserMixin, TestCase): def setUp(self): self.people = P...
agpl-3.0
-2,256,743,429,866,708,500
34.488889
79
0.622104
false
vlegoff/tsunami
src/primaires/scripting/fonctions/ent_alea.py
1
2666
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # ...
bsd-3-clause
-5,764,540,807,305,007,000
39.212121
79
0.717408
false
vladfi1/phillip
launch_many.py
1
3579
#!/usr/bin/env python import os import sys from argparse import ArgumentParser import subprocess from phillip import util import json from launch_lib import add_options, launch parser = ArgumentParser() parser.add_argument('path', type=str, help="path to enemies file") add_options(parser) args = parser.parse_args()...
gpl-3.0
3,765,404,798,221,629,400
22.546053
74
0.628667
false
angusmacdonald/gopro-organizer
organizerui/view.py
1
7376
import wx from os.path import expanduser import logging import threading from configobj import ConfigObj config = ConfigObj("default.conf", unrepr=True) lock = threading.Lock() class OrganizerView(wx.Frame): def __init__(self, parent, title): super(OrganizerView, self).__init__(parent, title=title, size=(4...
mit
2,095,757,634,949,805,800
28.626506
110
0.720445
false
luozhaoyu/leetcode
calcu.py
1
1777
class Symbol(object): def __init__(self, value, pre=None, succ=None): self.value = value self.pre = pre self.succ = succ class Solution: # @param {string} s # @return {integer} def calculate(self, s): s = s.replace(" ", "") head = Symbol(None) current = h...
mit
751,166,453,840,263,700
22.693333
56
0.396173
false
mvpossum/deep-learning
tp2/ej2ai.py
1
1839
'''Trains a simple deep NN on the MNIST dataset. Gets to 98.40% test accuracy after 20 epochs (there is *a lot* of margin for parameter tuning). 2 seconds per epoch on a K520 GPU. ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist...
mit
-2,993,582,487,547,231,700
28.190476
64
0.699293
false
oceanobservatories/mi-instrument
mi/dataset/driver/ctdpf_ckl/wfp/ctdpf_ckl_wfp_driver.py
1
2824
#!/usr/local/bin/python2.7 ## # OOIPLACEHOLDER # # Copyright 2020 Raytheon Co. ## import os from mi.core.versioning import version from mi.dataset.dataset_driver import SimpleDatasetDriver, ParticleDataHandler from mi.dataset.dataset_parser import DataSetDriverConfigKeys from mi.dataset.parser.ctdpf_ckl_wfp import Ct...
bsd-2-clause
-6,805,808,115,779,619,000
34.746835
98
0.686615
false
the-it/WS_THEbotIT
service/ws_re/register/register_types/volume.py
1
4464
import json from typing import Union, Optional, List from service.ws_re.register._base import Register, _REGISTER_PATH from service.ws_re.register._typing import LemmaDict from service.ws_re.register.authors import Authors from service.ws_re.register.lemma import Lemma from service.ws_re.volumes import Volume, Volumes...
mit
3,885,164,164,905,527,300
34.149606
113
0.58983
false
openstack/python-openstackclient
openstackclient/tests/unit/identity/v3/test_trust.py
1
8837
# 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 # distrib...
apache-2.0
-7,579,739,614,967,105,000
32.097378
79
0.595904
false
bluemellophone/ibeis_cnn
broken/old_batch.py
1
5867
#def create_sliced_iter_funcs_train2(model, X_unshared, y_unshared): # """ # WIP: NEW IMPLEMENTATION WITH PRELOADING GPU DATA # build the Theano functions (symbolic expressions) that will be used in the # optimization refer to this link for info on tensor types: # References: # http://deeplearni...
apache-2.0
2,204,840,963,682,259,000
37.097403
115
0.623317
false
LowResourceLanguages/hltdi-l3
l3xdg/node.py
1
24288
# Implementation of Extensible Dependency Grammar, as described in # Debusmann, R. (2007). Extensible Dependency Grammar: A modular # grammar formalism based on multigraph description. PhD Dissertation: # Universität des Saarlandes. # ######################################################################## # # ...
gpl-3.0
3,774,457,073,550,813,000
44.059369
117
0.537077
false
vmturbo/nova
nova/policies/volumes_attachments.py
1
2496
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
apache-2.0
6,217,302,918,994,485,000
28.714286
78
0.555288
false
nearlyfreeapps/python-googleadwords
tests/adspygoogle/adwords/geo_location_service_unittest.py
1
2974
#!/usr/bin/python # -*- coding: UTF-8 -*- # # Copyright 2010 Google 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...
apache-2.0
4,193,252,725,452,182,000
29.979167
94
0.640215
false
jfunez/scielo-manager
scielomanager/journalmanager/tests/tests_modelmanagers.py
1
36083
# coding: utf-8 from django.test import TestCase from django_factory_boy import auth from journalmanager import ( models, modelmanagers, ) from journalmanager.tests import modelfactories class JournalManagerTests(TestCase): def _make_user(self, *collection): user = auth.UserF(is_active=True) ...
bsd-2-clause
-2,289,931,664,152,842,800
33.862802
82
0.671092
false
jreback/pandas
pandas/tests/frame/methods/test_describe.py
1
12434
import numpy as np import pandas as pd from pandas import Categorical, DataFrame, Series, Timestamp, date_range import pandas._testing as tm class TestDataFrameDescribe: def test_describe_bool_in_mixed_frame(self): df = DataFrame( { "string_data": ["a", "b", "c", "d", "e"], ...
bsd-3-clause
5,314,292,373,838,665,000
33.348066
88
0.430835
false
MuhammadAlkarouri/hug
hug/exceptions.py
1
1675
"""hug/exceptions.py Defines the custom exceptions that are part of, and support Copyright (C) 2016 Timothy Edmund Crosley 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, i...
mit
-3,855,715,342,116,879,400
43.078947
112
0.77194
false
odedlaz/python-password-chameleon
run.py
1
2465
#!/bin/python from __future__ import print_function from binascii import hexlify import hashlib import base64 from getpass import getpass import sys import argparse charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" chameleon_charset = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz123456...
mit
-7,371,451,792,089,840,000
29.444444
117
0.658418
false
opoplawski/pytest-cov
src/pytest_cov/embed.py
1
1885
"""Activate coverage at python startup if appropriate. The python site initialisation will ensure that anything we import will be removed and not visible at the end of python startup. However we minimise all work by putting these init actions in this separate module and only importing what is needed when needed. For...
mit
5,013,430,591,248,774,000
28.920635
99
0.668435
false
cvpr17-id899/saliency
main.py
1
3662
from __future__ import division from keras.optimizers import RMSprop from keras.callbacks import EarlyStopping, ModelCheckpoint, LearningRateScheduler from keras.layers import Input from keras.models import Model import os, cv2, sys import numpy as np from config import * from utilities import preprocess_images...
mit
-5,354,162,971,434,637,000
39.636364
158
0.599126
false
ultrabug/uhashring
tests/benchmark.py
1
1073
# -*- coding: utf-8 -*- """This is not part of the test suite. """ try: import ketama except Exception: ketama = None from tempfile import NamedTemporaryFile from time import time from uhashring import HashRing num = 1000000 print("running {} key generation comparison".format(num)) # ketama C binding if ket...
bsd-3-clause
-8,145,472,118,921,416,000
24.547619
71
0.629077
false
takeyourmeds/takeyourmeds-web
takeyourmeds/utils/test.py
1
1913
from django.test import TestCase from django.shortcuts import resolve_url from django.contrib.auth import get_user_model User = get_user_model() class TestCase(TestCase): def setUp(self): self.user = self.create_user('testuser') def assertStatusCode(self, status_code, fn, urlconf, *args, **kwargs): ...
mit
-9,170,222,890,915,416,000
28.890625
77
0.58024
false
baldengineers/easytf2_mapper
prefabs/diag_wall_egypt.py
1
126557
import os import math def rotatePoint(centerPoint,point,angle): angle = math.radians(angle) temp_point = point[0]-centerPoint[0] , point[1]-centerPoint[1] temp_point = ( temp_point[0]*math.cos(angle)-temp_point[1]*math.sin(angle) , temp_point[0]*math.sin(angle)+temp_point[1]*math.cos(angle)) temp_point...
gpl-3.0
-5,276,287,045,558,843,000
66.641903
162
0.534795
false
PietroPasotti/MACH
utils/tests/preprocess_unittest.py
1
1094
import unittest from mach.utils import preprocess example = '/home/pietro/Perceptum/code/mach/mach/utils/twosentences.txt' shouldbe = {0: { 0: {'tags': set(), 'word': 'The'}, 1: {'tags': set(), 'word': 'great'}, 2: {'tags': set(), 'word': '...
agpl-3.0
3,418,362,564,199,355,400
33.1875
76
0.40585
false
gregorynicholas/shortuuid
shortuuid/tests.py
1
2948
import os import sys import unittest from uuid import UUID, uuid4 sys.path.insert(0, os.path.abspath(__file__ + "/../..")) from shortuuid.main import * class LegacyShortUUIDTest(unittest.TestCase): def test_generation(self): self.assertTrue(20 < len(uuid()), 24) self.assertTrue(20 < len(uuid("ht...
bsd-3-clause
-3,858,694,331,504,901,600
30.361702
74
0.61635
false
superdesk/superdesk-core
superdesk/places/places_autocomplete.py
1
2132
import superdesk from flask import current_app as app from superdesk.utils import ListCursor from superdesk.geonames import geonames_request, format_geoname_item class PlacesAutocompleteResource(superdesk.Resource): resource_methods = ["GET"] item_methods = [] schema = { "scheme": {"type": "stri...
agpl-3.0
-1,543,517,481,427,133,700
32.3125
84
0.532364
false
avian2/jsonmerge
tests/test_jsonvalue.py
1
2336
# vim:ts=4 sw=4 expandtab softtabstop=4 import unittest from jsonmerge.jsonvalue import JSONValue class TestJSONValue(unittest.TestCase): def test_get_attr(self): v = JSONValue({'a': 'b'}) va = v['a'] self.assertEqual('b', va.val) self.assertEqual('#/a', va.ref) def test_get_...
mit
-1,381,239,825,514,151,000
22.836735
62
0.538527
false
whitehorse-io/encarnia
Encarnia/world/ingame_time_original.py
1
2199
# in a file ingame_time.py in mygame/world/ from evennia.utils import gametime from typeclasses.rooms import Room # Sunrise! def at_sunrise(): """When the sun rises, display a message in every room.""" # Browse all rooms for room in Room.objects.all(): room.msg_contents("The sun rises fr...
mit
2,210,577,861,242,035,700
32.390625
108
0.650296
false
Maxime2/dpsearch-python
searchd-rest.py
1
1255
#!/usr/bin/python import json import urllib import urllib2 url = 'http://inet-sochi.ru:7003/' params = { # The category of the results, 09 - for australian sites 'c' : '09', # number of results per page, i.e. how many results will be returned 'ps': 10, # result page number, starting with 0 'np' : 0, # sy...
unlicense
5,561,589,539,934,972,000
25.702128
131
0.610359
false
tonygalmiche/is_plastigray
is_deb.py
1
16050
# -*- coding: utf-8 -*- from openerp import models,fields,api,SUPERUSER_ID from openerp.tools.translate import _ from openerp.exceptions import Warning import datetime import xmlrpclib #TODO : #- DEB importation #- Ajouter un bouton pour accèder aux lignes de la synthese quand la fiche est terminé class is_deb(mod...
mit
1,110,925,696,740,326,300
40.382429
170
0.446831
false
xuru/pyvisdk
pyvisdk/do/host_disk_partition_block_range.py
1
1172
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def HostDiskPartitionBlockRange(vim, *args, **kwargs): '''A BlockRange data object type d...
mit
-7,647,620,304,849,531,000
32.514286
124
0.616041
false
GunioRobot/feed2dent
f2dlibs/jfilters.py
1
1319
""" archbot library this package contains the following methods: tighturlify -- Method to turn a url into a bit.ly shortened url. mkdent -- Method to post data to identica. """ ### ### imports import sys import re import urllib import urllib2 import logging from jinja2 import Markup ### ### conditional import...
bsd-3-clause
2,463,794,963,521,435,000
23.886792
70
0.680061
false
debian-live/live-magic
DebianLive/elements/key_var.py
1
4537
# -*- coding: utf-8 -*- # # live-magic - GUI frontend to create Debian LiveCDs, etc. # Copyright (C) 2007-2010 Chris Lamb <lamby@debian.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Found...
gpl-3.0
-5,428,471,877,226,425,000
30.506944
94
0.486445
false
quozl/help-activity
helpactivity.py
1
7190
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
gpl-3.0
-5,766,782,719,864,932,000
32.915094
77
0.614604
false
Stibbons/guake
guake/menus.py
1
7649
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from locale import gettext as _ gi.require_version('Vte', '2.91') # vte-0.42 from gi.repository import Vte from guake.customcommands import CustomCommands import logging log = logging.getLogger(__name__) def mk_tab_context_menu(callback_object...
gpl-2.0
5,360,948,063,324,771,000
35.578947
93
0.649706
false
jetskijoe/SickGear
lib/tornado/iostream.py
1
65232
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
gpl-3.0
8,333,440,828,056,137,000
41.058027
128
0.589649
false
crowd-course/scholars
scholars/courses/models.py
1
19377
import os import pytz from datetime import tzinfo, timedelta, datetime from django.conf import settings from django.core.validators import MinValueValidator from django.db import models from django.db.models import F, Count, ExpressionWrapper, DateField, DateTimeField from django.db.models.signals import pre_delete, p...
mit
-8,950,352,779,626,918,000
35.838403
156
0.604944
false
Transkribus/TranskribusDU
TranskribusDU/graph/FeatureDefinition_Generic.py
1
6856
# -*- coding: utf-8 -*- """ Standard PageXml features: - not using the page information - using a QuantileTransformer for numerical features instead of a StandardScaler No link with DOm or JSON => named GENERIC Copyright Xerox(C) 2016, 2019 JL. Meunier Developed for the EU projec...
bsd-3-clause
-1,083,404,007,872,868,900
54.274194
156
0.47724
false
mikeberkelaar/controlleddos
Attack_Agent/attacks/syn2.py
1
4434
''' Syn flood program in python using raw sockets (Linux) Initial: Silver Moon (m00n.silv3r@gmail.com) ''' # some imports import socket, sys, random, time, Queue from struct import * class SYNFLOOD(): def __init__(self, Q, TARGET_IP, TARGET_PORT, RATE): #threading.Thread.__init__(self) # Re...
apache-2.0
-5,974,400,502,629,511,000
29.57931
118
0.62562
false
sambayless/monosat
tests/python/rnd_pb_opt.py
1
2332
from monosat import * import functools import math from monosat import * import os from random import shuffle import random import random import sys import itertools filename=None if __name__ == "__main__": seed = random.randint(1,100000) if len(sys.argv)>1: filename=sys.argv[1] if len(sys.argv)>2:...
mit
323,489,700,240,237,440
18.433333
65
0.639365
false
luzheqi1987/nova-annotation
nova/tests/unit/scheduler/filters/test_aggregate_instance_extra_specs_filters.py
1
3135
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
-5,408,682,348,444,999,000
42.541667
78
0.642743
false
drtuxwang/system-config
bin/flink.py
1
4916
#!/usr/bin/env python3 """ Recursively link all files. """ import argparse import glob import os import signal import sys from typing import List import file_mod class Options: """ Options class """ def __init__(self) -> None: self._args: argparse.Namespace = None self.parse(sys.arg...
gpl-2.0
8,102,982,425,260,739,000
27.091429
77
0.450976
false
iScienceLuvr/PPP-CAS
tests/testEvaluation.py
1
11865
from ppp_cas.evaluator import evaluate from unittest import TestCase from sympy import latex class TestEvaluation(TestCase): def procedure(self, testCases): for (expr, res) in testCases: string, latex = evaluate(expr) self.assertEqual(latex, res) def testNumeric(self): ...
mit
-2,678,843,502,815,292,400
60.796875
266
0.365023
false
kdart/pycopia
WWW/test.py
1
11133
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # 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 ...
apache-2.0
-7,756,537,204,763,291,000
36.611486
172
0.590317
false
belokop/indico_bare
indico/MaKaC/webinterface/rh/categoryMod.py
1
16874
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
-1,614,652,444,537,777,400
36.004386
167
0.627
false
funkyfuture/docker-compose
compose/parallel.py
1
10546
from __future__ import absolute_import from __future__ import unicode_literals import logging import operator import sys from threading import Lock from threading import Semaphore from threading import Thread from docker.errors import APIError from docker.errors import ImageNotFound from six.moves import _thread as t...
apache-2.0
-6,830,198,598,084,363,000
30.201183
103
0.626399
false
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/checkbox/plugins/remote_suite.py
1
1664
# # This file is part of Checkbox. # # Copyright 2008 Canonical Ltd. # # Checkbox is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # C...
gpl-3.0
1,768,032,259,811,580,400
33.666667
82
0.688702
false
Wireless-Innovation-Forum/Spectrum-Access-System
src/harness/reference_models/geo/refractivity.py
1
3789
# Copyright 2017 SAS Project 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 requ...
apache-2.0
-7,794,711,748,730,794,000
33.445455
89
0.666139
false
whoisever/vgg16_finetune_mutli_label
vgg19.py
1
4374
# -*- coding: utf-8 -*- from keras.models import Sequential from keras.optimizers import SGD from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, merge, Reshape, Activation from sklearn.metrics import log_loss from load_cifar10 import load_cifar10_dat...
mit
-7,142,099,060,226,937,000
34.274194
145
0.665066
false
dvida/UWO-PA-Python-Course
Lecture 6/Task 1/L6_T1_solution.py
1
1086
from __future__ import print_function import numpy as np import scipy.optimize import matplotlib.pyplot as plt from TextFileParser import parseTextFile def meteor_model(x, a, b, c, d): """ Time vs. meteor lag. """ return a*np.exp(b*x) + c*x + d if __name__ == "__main__": # File name of the data fil...
mit
550,034,698,031,318,200
18.763636
80
0.617864
false
cprogrammer1994/ModernGL
moderngl/program.py
1
7352
from typing import Tuple, Union, Generator from .program_members import (Attribute, Subroutine, Uniform, UniformBlock, Varying) __all__ = ['Program', 'detect_format'] class Program: ''' A Program object represents fully processed executable code in the OpenGL Shadin...
mit
-7,031,265,398,693,830,000
31.104803
96
0.575218
false
charanpald/sandbox
sandbox/kernel/PolyKernel.py
1
1730
import numpy from sandbox.kernel.AbstractKernel import AbstractKernel from sandbox.util.Parameter import Parameter class PolyKernel(AbstractKernel): """ A class to find polynomial kernel evaluations k(x, y) = (<x, y> + b)^degree """ def __init__(self, b=1.0, degree=2): """ Initialise ...
gpl-3.0
6,772,952,362,683,971,000
25.227273
97
0.574566
false
alphagov/backdrop
features/steps/read_api.py
1
8202
import datetime import os import re from behave import given, when, then, step_matcher from dateutil import parser from flask import json from hamcrest import assert_that, is_, is_not, matches_regexp, has_length, equal_to, \ has_item, has_entries, has_entry import pytz from features.support.api_common import ensu...
mit
3,936,186,195,960,056,000
32.477551
92
0.656059
false
GoogleCloudPlatform/datacatalog-connectors-rdbms
google-datacatalog-rdbms-connector/src/google/datacatalog_connectors/rdbms/scrape/sql_objects/sql_objects_metadata_scraper.py
1
2069
#!/usr/bin/python # # 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 ag...
apache-2.0
-1,006,289,879,503,530,100
37.314815
78
0.628806
false
antkillerfarm/antkillerfarm_crazy
python/ml/PIL/imageprocess.py
1
1619
import numpy as np import tensorflow as tf from PIL import Image def save_img(sess, tensor, name): tensor0 = tf.transpose(tensor, perm=[1, 2, 0]) res = sess.run(tensor0) tensor1 = tensor0.eval() im = Image.fromarray(tensor1.astype('uint8')) im.save(name) ''' im = Image.open("example_im...
gpl-3.0
-4,133,155,640,879,254,000
33.977778
82
0.617048
false
Saint-Joe/weewx
bin/weewx/drivers/Adafruit_ADS1x15/Adafruit_ADS1x15.py
1
32166
#!/usr/bin/python import time import smbus #from Adafruit_I2C import Adafruit_I2C # =========================================================================== # ADS1x15 Class # # Originally written by K. Townsend, Adafruit (https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_ADS1x15) #...
gpl-3.0
1,737,550,240,136,467,500
43.305785
138
0.650407
false
lugkhast/forever-alone-gae
core/privileges.py
1
3131
# forever-alone: A course and free time matching web app for college students # Copyright (C) 2011 Lawrence Patrick Calulo # # This file is part of forever-alone. # # forever-alone is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # t...
agpl-3.0
9,016,858,172,864,464,000
27.990741
81
0.75024
false
Signiant/alexa_signiant_status
alexa_signiant_status.py
1
11159
""" Return Signiant Platform Status """ import time import urllib.request, urllib.error, urllib.parse import json import os # Default Signiant Status Page URL SIGNIANT_STATUS_URL = 'https://1dmtgkjnl3y3.statuspage.io/api/v2/summary.json' STATUS_PAGE_API_KEY = None # We need this to be set as an env var - fail if it'...
mit
2,951,908,603,387,607,000
33.441358
145
0.631419
false
jflitton/serverless-image-resizing
asynchronous.py
1
2027
import boto3 import cStringIO import json from config import Config from PIL import Image from datetime import datetime from concurrent.futures import ThreadPoolExecutor sqs = boto3.resource('sqs') s3 = boto3.resource('s3') bucket = s3.Bucket(Config.s3Bucket) message_found = True images_resized = 0 start_time = datet...
mit
7,370,596,085,217,829,000
26.391892
109
0.706463
false
roaet/quark
quark/api/extensions/subnets_quark.py
1
1760
# Copyright (c) 2013 Rackspace Hosting 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 # # Unles...
apache-2.0
6,089,075,658,689,884,000
28.830508
78
0.634659
false
byplacebo/head-first-python
6th/class_coach2.py
1
1120
def sanitize(time_string): if "-" in time_string: splitter = "-" elif ":" in time_string: splitter = ":" else: return time_string (mins, secs) = time_string.split(splitter) return mins + "." + secs class Athlete: def __init__(self, a_name, a_dob=None, a_times=[]): ...
apache-2.0
-7,468,122,315,685,793,000
25.046512
64
0.570536
false
TheSchwa/dnd
char_sheet/fields/text.py
1
1184
from collections import OrderedDict from dnd.char_sheet.fields import Field ############################################################################### # Text class # - supports newlines via the 2 literal characters '\n' ############################################################################### class Text...
gpl-3.0
4,237,716,498,768,581,600
25.909091
79
0.511824
false
arteria/django-copywriting
copywriting/urls.py
1
1053
from compat import patterns, url urlpatterns = patterns('copywriting', url(r'^author/(?P<author>\w[^/]+)$', 'views.listArticlesByAuthor'), url(r'^author/(?P<author>\w[^/]+)/$', 'views.listArticlesByAuthor', name='copywriting_by_author'), url(r'^tag/(?P<in_tag>\w[^/]+)$', 'views.withTag'), url(r'^tag/(...
mit
4,051,932,310,077,401,000
42.875
120
0.605888
false
kushalbhola/MyStuff
Practice/PythonApplication/env/Lib/site-packages/pandas/core/series.py
1
150775
""" Data structure for 1-dimensional cross-sectional and time series data """ from collections import OrderedDict from io import StringIO from shutil import get_terminal_size from textwrap import dedent from typing import Any, Callable import warnings import numpy as np from pandas._config import get_option from pan...
apache-2.0
-3,893,275,183,218,865,000
29.795547
88
0.51797
false
birgander2/PyRAT
pyrat/load/FSAR.py
1
29089
import pyrat import glob, os import logging import copy import numpy as np from PyQt5 import QtCore, QtWidgets # from pyrat.load import RatFile from pyrat.lib.ste import RatFile, Xml2Py from pyrat.viewer.Dialogs import FlexFilesel from pyrat.viewer.Widgets import HLine, CropBoxWidget, BoolWidget, FileselWidget, Produc...
mpl-2.0
8,396,901,994,008,392,000
39.570432
128
0.493176
false
blowekamp/itkSuperPixel
doc/scripts/evaluation_ski.py
1
1526
#!/usr/bin/env python import SimpleITK as sitk import skimage as ski import skimage.segmentation import numpy as np import timeit def mask_label_contour(image, seg): """Combine an image and segmentation by masking the segmentation contour. For an input image (scalar or vector), and a multi-label segmentati...
apache-2.0
9,084,854,102,051,266,000
32.173913
123
0.773919
false
escolmebartlebooth/fsnd_blogs
main.py
1
21055
# imports start import os import jinja2 import webapp2 import re import bb_blogdb as bdb import logging # end imports # create jinja2 environment TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'templates') JINJA_ENV = jinja2.Environment(loader=jinja2.FileSystemLoader(TEMPLATE_DIR), ...
mit
4,515,155,355,139,144,700
32.634185
78
0.528616
false
lalitkumarj/NEXT-psych
ec2/next_ec2.py
1
52111
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file was forked from the Apache Spark project and modified. Many # thanks to those guys for a great time-saving file. # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed wit...
apache-2.0
4,556,336,449,640,496,600
42.680637
206
0.581528
false
tim-taylor/evobee
utils/plot-mp-distrib-violin.py
1
2936
#!/usr/bin/env python3 # # Script to generate a violin plot of the distribution of flower marker points # from a collection of runs of evobee # # Usage: plot-mp-distrib.py title mpcountmpfile [mpcountmpfile2 [mpcountmpfile3 ...]] # where each mpcountmpfile is a CSV format with layout: marker point, count # # Outputs:...
gpl-3.0
9,186,626,989,530,743,000
29.905263
109
0.623638
false
clearlinux/autospec
autospec/config.py
1
50757
#!/bin/true # # config.py - part of autospec # Copyright (C) 2015 Intel Corporation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
8,387,312,896,066,715,000
49.406561
139
0.570372
false
akehrer/Motome
Motome/Models/MotomeTextBrowser.py
1
13660
# Import the future from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import # Import standard library modules import cgi import datetime import logging import mimetypes import os import re import shutil # Import Qt modules from PySide import QtCore, QtGui ...
bsd-2-clause
8,148,224,664,488,367,000
36.53022
120
0.535359
false
destijl/grr
grr/lib/flow_runner.py
1
47503
#!/usr/bin/env python """This file contains a helper class for the flows. This flow context class provides all the methods for handling flows (i.e., calling clients, changing state, ...). Each flow must have a flow runner before it can be executed. The flow runner is responsible for queuing messages and maintaining s...
apache-2.0
-6,703,846,200,527,131,000
37.063301
80
0.667221
false
laz2/sc-core
bindings/python/sc_core/nsm.py
1
16628
 """ ----------------------------------------------------------------------------- This source file is part of OSTIS (Open Semantic Technology for Intelligent Systems) For the latest info, see http://www.ostis.net Copyright (c) 2010 OSTIS OSTIS is free software: you can redistribute it and/or modify it under the ter...
lgpl-3.0
4,471,898,048,388,171,000
51.608414
122
0.607998
false
alexlib/Qt-Python-Binding-Examples
common_widgets/menu/popup_menu_by_right_click.py
1
1959
#!/usr/bin/env python #-*- coding:utf-8 -*- """ popup menu by right click Tested environment: Mac OS X 10.6.8 http://developer.qt.nokia.com/doc/qt-4.8/qmenu.html#details http://diotavelli.net/PyQtWiki/Handling%20context%20menus """ import sys try: from PySide import QtCore, QtGui except ImportError: from...
bsd-3-clause
1,564,691,287,392,536,600
24.454545
62
0.617662
false