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
ramrom/haus
gmail.py
1
2126
#!/usr/local/bin/python import httplib2 import os, pdb from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage try: import argparse flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args() except ImportError: flags...
mit
-8,412,286,651,052,823,000
28.943662
80
0.716369
false
ESOedX/edx-platform
common/test/acceptance/tests/lms/test_problem_types.py
1
72649
""" Bok choy acceptance and a11y tests for problem types in the LMS """ from __future__ import absolute_import import random import textwrap from abc import ABCMeta, abstractmethod import ddt import pytest import six from bok_choy.promise import BrokenPromise from selenium.webdriver import ActionChains from six.moves...
agpl-3.0
4,416,508,447,962,702,000
33.496201
119
0.638412
false
energicryptocurrency/energi
qa/rpc-tests/mempool_packages.py
1
11060
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Energi Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the...
mit
7,192,508,531,699,877,000
41.868217
127
0.61519
false
diegocortassa/TACTIC
src/tactic/ui/panel/custom_layout_wdg.py
1
51769
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
-1,024,281,543,555,688,800
30.318209
166
0.519075
false
scikit-learn-contrib/categorical-encoding
category_encoders/__init__.py
1
1448
""" .. module:: category_encoders :synopsis: :platform: """ from category_encoders.backward_difference import BackwardDifferenceEncoder from category_encoders.binary import BinaryEncoder from category_encoders.count import CountEncoder from category_encoders.hashing import HashingEncoder from category_encoders.h...
bsd-3-clause
-7,168,020,823,898,292,000
28.55102
75
0.785221
false
mouton5000/DiscreteEventApplicationEditor
game/Registeries/SpriteRegistery.py
1
2662
from pygame.rect import Rect __author__ = 'mouton' from pygame.sprite import Sprite import pygame from collections import defaultdict from copy import copy _rootDir = None _spritesList = defaultdict(pygame.sprite.OrderedUpdates) _rectsToUpdate = [] def init(rootDir): global _rootDir _rootDir = rootDir ...
mit
7,548,703,405,394,868,000
25.89899
108
0.614576
false
CVSoft/UTQuery
Demo_GSQuery.py
1
3672
from time import sleep import GSQuery # Let's pick a server. We'll use TeamRectifier as they're usually populated. gs = GSQuery.GSServer('31.186.250.42') # Let's get the basic server details with the GameSpy query protocol. # The query methods return dictionary types, so we can store them for later use # in...
gpl-3.0
-4,055,352,095,003,567,600
40.697674
80
0.668573
false
ray-project/ray
python/ray/util/collective/tests/single_node_cpu_tests/test_reducescatter.py
1
5148
"""Test the collective reducescatter API.""" import pytest import ray import numpy as np import torch from ray.util.collective.types import Backend from ray.util.collective.tests.cpu_util import create_collective_workers, \ init_tensors_for_gather_scatter @pytest.mark.parametrize("backend", [Backend.GLOO]) @pyt...
apache-2.0
-7,122,715,093,684,820,000
39.21875
79
0.583528
false
kinooo/Sick-Beard
sickbeard/notifiers/pushbullet.py
1
4935
# Author: Pedro Correia (http://github.com/pedrocorreia/) # Based on pushalot.py by Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-3.0
-8,564,425,933,284,914,000
43.0625
185
0.643364
false
otsaloma/gaupol
aeidon/pattern.py
1
1548
# -*- coding: utf-8 -*- # Copyright (C) 2007 Osmo Salomaa # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pr...
gpl-3.0
660,636,134,076,191,900
31.93617
76
0.677649
false
fernandog/Medusa
ext/sqlalchemy/engine/__init__.py
1
20438
# engine/__init__.py # Copyright (C) 2005-2018 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """SQL connections, SQL execution and high-level DB-API interface. The engine pa...
gpl-3.0
5,816,460,592,037,326,000
42.392781
137
0.683139
false
Workday/OpenFrame
tools/telemetry/catapult_base/dependency_manager/cloud_storage_info.py
1
3811
# Copyright 2015 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 stat from catapult_base import cloud_storage from catapult_base.dependency_manager import exceptions class CloudStorageInf...
bsd-3-clause
6,174,460,862,816,630,000
36.362745
80
0.674888
false
smallyear/linuxLearn
salt/salt/states/reg.py
1
13518
# -*- coding: utf-8 -*- r''' =========================== Manage the Windows registry =========================== Many python developers think of registry keys as if they were python keys in a dictionary which is not the case. The windows registry is broken down into the following components: ----- Hives ----- This is...
apache-2.0
7,227,832,016,917,860,000
31.731235
99
0.575159
false
Naakh/naakh-py
naakh/api_client.py
1
20321
# coding: utf-8 """ Copyright 2016 SmartBear Software 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...
mit
-4,780,376,884,226,708,000
33.915808
84
0.53954
false
rfaulkner/databayes
http/databayes_api/views.py
1
13088
""" Defines the routing endpoints of the RESTful API for databayes. Each method corresponds to an API action and returns the status of the action and the output. This layer handles communication to the databayes daemon. IMPORTANT NOTE! - Only one of these server instances should be running to avoid r...
apache-2.0
8,312,816,424,362,879,000
34.468835
103
0.575718
false
adharaengine/AdharaDB
test.py
1
9327
import unittest import tempfile from tempfile import NamedTemporaryFile from ZODB import DB, config from ZODB.FileStorage import FileStorage from db import Graph, Element, Edge, Node from backends import DictionaryBackend, ZODBBTreeBackend class TestGraph(unittest.TestCase): def setUp(self): self.g = G...
apache-2.0
717,199,211,216,425,300
29.184466
84
0.563525
false
brianjimenez/lightdock
lightdock/test/gso/test_coordinates.py
1
6927
"""Tests for Coordinates class""" from nose.tools import assert_almost_equals from nose.tools import raises import os from lightdock.gso.coordinates import Coordinates from lightdock.gso.coordinates import CoordinatesFileReader from lightdock.error.lightdock_errors import GSOCoordinatesError class TestCoordinates: ...
gpl-3.0
703,583,084,849,713,400
33.123153
121
0.630143
false
jkyeung/XlsxWriter
xlsxwriter/test/table/test_table01.py
1
1893
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...table import Table from ...worksheet impor...
bsd-2-clause
-5,498,686,703,020,115,000
32.210526
163
0.566297
false
purisc-group/purisc
compiler/class_def/conversions/arithmetic.py
1
29184
from helpers import next_subleq from helpers import subleq from helpers import clear import re def add(instr, assem): a = instr.args[0]; b = instr.args[1]; c = instr.result; t0 = assem.getNextTemp(); #check for literals if re.match("\d+",a): if a not in assem.dataMem: asse...
gpl-2.0
1,400,089,787,447,496,400
34.20386
136
0.601186
false
markmuetz/stormtracks
stormtracks/results.py
1
3180
import os from glob import glob import pandas as pd from load_settings import settings from utils.utils import compress_file, decompress_file RESULTS_TPL = '{0}.hdf' class ResultNotFound(Exception): '''Simple exception thrown if result cannot be found in results manager or on disk''' pass class Stormtrac...
mit
-2,510,691,410,342,341,000
31.783505
103
0.650629
false
guolivar/totus-niwa
service/thirdparty/featureserver/FeatureServer/DataSource/Flickr.py
1
4910
from FeatureServer.DataSource import DataSource from vectorformats.Feature import Feature from FeatureServer.Exceptions.NoGeometryException import NoGeometryException import md5 import urllib from lxml import etree from StringIO import StringIO class Flickr (DataSource): def __init__(self, name, api_key, api_se...
gpl-3.0
-8,789,628,092,533,478,000
31.959732
155
0.509776
false
rmsk2/Das-grosse-Quiz
client/playingfield.py
1
19375
################################################################################ # Copyright 2016 Martin Grap # # 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/li...
apache-2.0
3,814,428,693,370,683,400
45.130952
145
0.612284
false
tcstewar/embodied_benchmarks
control.py
1
3938
import numpy as np class Signal(object): def __init__(self, D, L, dt, max_freq, seed=None): rng = np.random.RandomState(seed=seed) steps = int(max_freq * L) self.w = 2 * np.pi * np.arange(steps) / L self.A = rng.randn(D, steps) + 1.0j * rng.randn(D, steps) power = np.sqrt(...
gpl-2.0
7,529,953,417,347,471,000
28.38806
90
0.550279
false
mariodebian/jclic-browser
python-examples/demo.py
1
3681
# This is an example for demonstrating use of the GtkTreeView widget. # The code in this example is not particularly good: it is written to # concentrate on widget usage demonstration, not for maintainability. import pygtk pygtk.require("2.0") import gtk import gobject view = None choose_parent_view = None dialog = N...
gpl-2.0
3,050,538,211,119,226,000
28.685484
79
0.646292
false
blckshrk/Weboob
contrib/windows-install/ez_setup.py
1
11838
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
agpl-3.0
-6,922,584,917,193,558,000
30.994595
87
0.622149
false
KingxBanana/zulip
zproject/settings.py
1
41223
from __future__ import absolute_import # Django settings for zulip project. ######################################################################## # Here's how settings for the Zulip project work: # # * settings.py contains non-site-specific and settings configuration # for the Zulip Django app. # * settings.py impor...
apache-2.0
-763,140,899,692,655,200
36.853994
128
0.555418
false
ecell/libmoleculizer
python-src/language_parser/moleculizer/moleculizerrules.py
1
21379
############################################################################### # Copyright (C) 2007, 2008, 2009 The Molecular Sciences Institute # Original Author: # Nathan Addy, Scientific Programmer Email: addy@molsci.org # The Molecular Sciences Institute # ##################################################...
gpl-2.0
-8,921,513,987,681,306,000
36.245645
189
0.658263
false
mdunker/usergrid
utils/usergrid-util-python/usergrid_tools/queue/dlq-iterator-checker.py
2
4809
# */ # * 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...
apache-2.0
4,807,315,767,958,435,000
28.685185
117
0.589728
false
nevermoreluo/privateoverseas
overseas/migrations/0001_initial.py
1
3314
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-05 02:47 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Create...
gpl-3.0
-9,114,533,386,148,599,000
44.39726
124
0.573929
false
zstackio/zstack-woodpecker
integrationtest/vm/mini/paths/path54.py
1
2373
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", path_list=[ [TestAction.add_image, 'image1', 'root', os.environ.get('isoForVmUrl')], [TestAction.create_vm_by_image, 'image1', 'iso', 'vm1'], [TestAction.create_v...
apache-2.0
-4,760,517,556,792,538,000
39.220339
104
0.686473
false
cournape/ensetuptools
setuptools/command/setopt.py
1
4977
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, local, global, or per-user co...
bsd-3-clause
6,925,647,793,835,101,000
34.297872
79
0.57183
false
v6ak/qubes-core-admin
core/storage/__init__.py
2
15124
#!/usr/bin/python2 # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2013 Marek Marczykowski <marmarek@invisiblethingslab.com> # # 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...
gpl-2.0
4,979,779,882,463,710,000
32.910314
91
0.583047
false
eloquence/unisubs
apps/teams/models.py
1
128528
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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 op...
agpl-3.0
-5,704,561,719,830,586,000
36.958653
232
0.608513
false
codedsk/hubcheck
hubcheck/pageobjects/po_time_overview_page.py
1
1349
from hubcheck.pageobjects.po_time_base_page import TimeBasePage from hubcheck.pageobjects.basepageelement import Link class TimeOverviewPage(TimeBasePage): """time overview page""" def __init__(self,browser,catalog,groupid=None): super(TimeOverviewPage,self).__init__(browser,catalog) self.path...
mit
2,818,290,263,119,417,000
28.977778
80
0.673091
false
madeso/prettygood
dotnet/Tagger/TagValidator.py
1
2567
using System; using System.Collections.Generic; using System.Linq; using System.Text; using MusicBrainz; using PrettyGood.Util; namespace Tagger { class TagValidator { public bool validate(IdTag tag) { Artist artist = null; if (string.IsNullOrEmpty(tag.Artist) == false)...
mit
-570,241,561,569,758,850
27.186813
96
0.475244
false
clasnake/recommender
similarity.py
1
6369
from __future__ import division from math import sqrt def sim_distance(prefs, item1, item2): #get the list of shared items si = {}; for item in prefs[item1]: if item in prefs[item2]: si[item] = 1; #if they have no shared items,return 0; if len(si) == 0: return 0; #Add the s...
mit
2,447,981,508,787,601,000
27.560538
107
0.566808
false
mercycorps/tola-activity
htdocs/indicators/test.py
1
2312
from django.test import TestCase from django.test import RequestFactory from django.test import Client from indicators.models import Indicator, IndicatorType, Objective, DisaggregationType, ReportingFrequency, CollectedData from activitydb.models import Program, Sector from django.contrib.auth.models import User clas...
gpl-2.0
8,561,288,061,247,046,000
51.545455
164
0.709775
false
fossdevil/Assignments
Machine Learning/Assignment3Final/ML4.py
1
3746
import numpy as np import scipy import matplotlib.pyplot as plt import random # N points in d dimensions def generatePoints(n,d): points = [] for i in range(0,n): point = np.random.normal(0,1,d); p = point**2; den = np.sqrt(sum(p)); point = list(point/den); points.append...
mit
5,465,868,872,613,046,000
26.544118
82
0.652429
false
santosfamilyfoundation/SantosGUI
application/utils/patch_multiprocess.py
1
1225
import os import sys import multiprocess.forking as forking def patch_multiprocess(): if sys.platform.startswith('win'): # First define a modified version of Popen. class _Popen(forking.Popen): def __init__(self, *args, **kw): if hasattr(sys, 'frozen'): ...
mit
-7,397,045,052,748,580,000
39.833333
81
0.484898
false
4383/street-workout-database
sport/web/commons/templatetags/common_tags.py
1
3392
__author__ = 'herve.beraud' from datetime import datetime, timedelta from django import template from django.core.exceptions import ObjectDoesNotExist from django.conf import settings from django.utils.timesince import timesince from community.models import InformationMessage from exercises.models import Category fr...
gpl-2.0
5,402,247,503,451,819,000
29.558559
120
0.680425
false
openprocurement/openprocurement.auctions.dgf
openprocurement/auctions/dgf/views/other/question.py
1
3280
# -*- coding: utf-8 -*- from openprocurement.auctions.core.utils import ( apply_patch, context_unpack, get_now, json_view, opresource, save_auction, ) from openprocurement.auctions.core.validation import ( validate_question_data, validate_patch_question_data, ) from openprocurement.aucti...
apache-2.0
-685,575,204,288,687,500
51.063492
141
0.651829
false
tommy-u/chaco
chaco/multi_line_plot.py
1
16640
""" Defines the MultiLinePlot class. """ from __future__ import with_statement # Standard library imports import warnings from math import ceil, floor # Major library imports import numpy as np from numpy import argsort, array, invert, isnan, take, transpose # Enthought library imports from enable.api import black_...
bsd-3-clause
-2,342,800,567,750,205,400
34.031579
134
0.534796
false
pylover/network-interfaces
network_interfaces/stanza.py
1
4473
# -*- coding: utf-8 -*- import re from .helpers import clean_list, list_hash __author__ = 'vahid' class Stanza(object): _type = None _filename = None _headers = None def __init__(self, filename, *headers): self._filename = filename self._headers = list(headers) def __repr__(sel...
gpl-3.0
-2,740,219,951,952,730,600
27.673077
84
0.521127
false
regardscitoyens/twitter-parlementaires
download_twitter.py
1
1413
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, json from twitter import Twitter, OAuth from twitterconfig import KEY, SECRET, OAUTH_TOKEN, OAUTH_SECRET if len(sys.argv) < 3: sys.stderr.write("Please input both Twitter list's owner_screen_name and slug\n") exit(1) LIST_USER, LIST_ID = sys.argv[...
agpl-3.0
-6,752,805,189,565,542,000
29.717391
134
0.602265
false
colin2328/asciiclass
labs/lab3/worldcup_wrangler.py
1
14912
from wrangler import dw import sys if(len(sys.argv) < 3): sys.exit('Error: Please include an input and output file. Example python script.py input.csv output.csv') w = dw.DataWrangler() # Split data repeatedly on newline into rows w.add(dw.Split(column=["data"], table=0, status="act...
mit
-7,326,252,831,971,630,000
26.206204
107
0.402267
false
andrmuel/gr-dab
python/qa/qa_ofdm_move_and_insert_zero.py
1
1294
#!/usr/bin/env python from gnuradio import gr, gr_unittest, blocks import grdab class qa_ofdm_move_and_insert_zero(gr_unittest.TestCase): """ @brief QA for the block that moves the signal to the middle of the band and inserts the zero carrier in the middle. This class implements a test bench to verify the corresp...
gpl-3.0
7,527,159,771,634,715,000
31.35
116
0.692427
false
senser/xmppBot
ZenPacks/community/xmppBot/Jabber/plugins/setjid.py
1
4107
"""Check if the sender is a valid zenoss admin. For access control""" from Jabber.Plugins import Plugin from Jabber.ZenAdapter import ZenAdapter from Jabber.Options import Options from optparse import OptionError import transaction class SetJid(Plugin): name = 'mapuser' capabilities = ['setjid', 'mapuser', ...
gpl-2.0
-3,075,416,412,988,753,400
45.146067
267
0.582177
false
shashisp/blumix-webpy
app/applications/welcome/controllers/default.py
1
1858
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a sample controller ## - index is the default action of any application ## - user is required for authentication and authorization...
mit
-1,518,025,967,072,586,500
30.491525
79
0.607643
false
lrowe/splinter
tests/test_webdriver_phantomjs.py
1
2438
import unittest from splinter import Browser from .fake_webapp import EXAMPLE_APP from .base import WebDriverTests class PhantomJSBrowserTest(WebDriverTests, unittest.TestCase): @classmethod def setUpClass(cls): cls.browser = Browser("phantomjs") @classmethod def tearDownClass(cls): ...
bsd-3-clause
176,557,959,462,295,600
31.506667
80
0.66653
false
daymer/xWIKI_Karma
CustomModules/mysql-connector-python-2.1.7/lib/cpy_distutils.py
1
24414
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
apache-2.0
-3,967,664,341,499,863,600
35.712782
84
0.560908
false
thorwhalen/ut
ml/skwrap/feature_extraction/dict_vectorizer.py
1
7588
__author__ = 'thor' from sklearn.feature_extraction import DictVectorizer from sklearn.externals import six import numpy as np from pandas import DataFrame from collections import Counter class IterDictVectorizer(DictVectorizer): """Transforms lists of feature-value mappings or rows of a dataframe to vectors...
mit
8,670,410,577,151,383,000
37.912821
123
0.599895
false
pebble/spacel-provision
src/test/provision/orbit/test_provider.py
1
1145
from mock import MagicMock from spacel.provision.orbit.provider import ProviderOrbitFactory from test import BaseSpaceAppTest, ORBIT_REGION TEST_PROVIDER = 'test' class TestProviderOrbitFactory(BaseSpaceAppTest): def setUp(self): super(TestProviderOrbitFactory, self).setUp() self.provider = Mag...
mit
3,872,497,890,873,925,000
34.78125
78
0.638428
false
thebenwaters/openclickio
core/urls.py
1
1643
from django.conf.urls import patterns, url from django.views.generic import TemplateView from .views import StudentListLectureView, InstructorListLectureView, RegisteredLectureCreateView, CreateLectureView, \ LectureDetailView, LectureListView, UserRegisteredLectureView, UserRegisteredLectureApproveView, \ CreateAtte...
mit
5,296,458,793,922,725,000
81.15
138
0.725502
false
tensorflow/addons
tensorflow_addons/image/dense_image_warp.py
1
10213
# Copyright 2019 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
6,193,261,979,639,195,000
41.202479
87
0.61784
false
Lana-B/Pheno4T
madanalysis/layout/histogram_core.py
1
2479
################################################################################ # # Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks # The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> # # This file is part of MadAnalysis 5. # Official website: <https://launchpad.net/madanalysis5> # # MadAnal...
gpl-3.0
4,464,193,754,576,342,000
27.494253
80
0.541751
false
Pandaaaa906/ChemErpSystem
ERP/templatetags/erp_extras.py
1
1616
# -*- coding: utf-8 -*- from django import template from django.db.models.query import QuerySet import datetime from django import template from django.contrib.auth.models import Group from django.contrib.auth.models import User from django.db.models import Q register = template.Library() @register.inclusion_tag('side...
apache-2.0
684,355,398,414,032,100
25.080645
66
0.667698
false
rplevka/robottelo
tests/upgrades/test_repository.py
1
9545
"""Test for Repository related Upgrade Scenarios :Requirement: Upgraded Satellite :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: Repositories :Assignee: tpapaioa :TestType: Functional :CaseImportance: High :Upstream: No """ import os from fabric.api import execute from fabric.api import run ...
gpl-3.0
6,445,310,977,398,865,000
35.996124
95
0.651545
false
geopython/QGIS
tests/src/python/test_provider_memory.py
1
27965
# -*- coding: utf-8 -*- """QGIS Unit tests for the memory layer provider. .. note:: 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 vers...
gpl-2.0
-186,420,792,356,683,260
40.989489
234
0.604613
false
YevgeniyaK/python_training
fixture/group.py
1
4957
from model.group import Group class GroupHelper: def __init__(self, app): self.app = app def open_group_page(self): wd = self.app.wd if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0): wd.find_element_by_link_text("groups").click() ...
apache-2.0
-8,982,111,332,978,443,000
26.114943
100
0.569097
false
patcorwin/fossil
pdil/tool/fossil/rigging/splineTwist.py
1
24347
from __future__ import absolute_import, division, print_function from collections import OrderedDict import math from pymel.core import curve, cluster, delete, dt, duplicate, expression, group, hide, ikHandle, insertKnotCurve, joint, move, orientConstraint, parent, parentConstraint, pointConstraint, xform from ....a...
bsd-3-clause
-3,334,268,302,058,666,000
37.341732
194
0.60759
false
TimothyZhang/ccc_helper
test.py
1
5100
# coding=utf-8 # Copyright 2014 Timothy Zhang(zt@live.cn). # # This file is part of Structer. # # Structer 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)...
gpl-3.0
-4,194,254,677,679,598,600
36.777778
113
0.638627
false
t00mas/datascience-python
classification/knearest.py
1
1554
import matplotlib import matplotlib.pyplot as pyplot import numpy from matplotlib.colors import ListedColormap from sklearn import neighbors, datasets def get_iris_dataset(): iris = datasets.load_iris() return iris.data[:, :2], iris.target def get_knn_classifier(X, y, n_neighbors=None): if not n_neighbo...
mit
2,858,620,498,153,865,000
28.320755
80
0.63964
false
ToontownUprising/src
toontown/ai/NewsManagerAI.py
1
2153
from direct.directnotify.DirectNotifyGlobal import directNotify from direct.distributed.DistributedObjectAI import DistributedObjectAI class NewsManagerAI(DistributedObjectAI): notify = directNotify.newCategory('NewsManagerAI') def announceGenerate(self): DistributedObjectAI.announceGenerate(self) ...
mit
2,677,477,682,247,874,600
21.904255
93
0.681375
false
arduino-org/s4t-iotronic
lib/test_pub.py
1
2229
wampAddress = 'ws://172.17.3.139:8181/ws' wampRealm = 's4t' #from threading import Thread from autobahn.twisted.wamp import ApplicationRunner from autobahn.twisted.wamp import ApplicationSession from twisted.internet.defer import inlineCallbacks #import per test from twisted.internet.defer import DeferredQueue from...
apache-2.0
-9,203,456,461,136,472,000
21.979381
77
0.746074
false
pitunti/alfaPitunti
plugin.video.alfa/channels/tupornotv.py
1
10715
# -*- coding: utf-8 -*- import re import urlparse from core import scrapertools from core.item import Item from platformcode import logger def mainlist(item): logger.info() itemlist = [] itemlist.append(Item(channel=item.channel, title="Pendientes de Votación", action="novedades", ...
gpl-3.0
8,343,848,909,474,973,000
39.549242
167
0.567865
false
designcc/django-ccbasket
ccbasket_testproject/shop/views.py
1
1061
# -*- coding: utf-8 -*- import logging from django.shortcuts import render_to_response from django.template import RequestContext from django.template.response import TemplateResponse from models import SimpleProduct, ComplexProduct logger = logging.getLogger('ccbasket') def home(request): return render_to_respon...
bsd-3-clause
-8,419,915,165,657,524,000
26.921053
76
0.71065
false
cea-hpc/shine
lib/Shine/Configuration/Configuration.py
1
8263
# Configuration.py -- Configuration container # Copyright (C) 2007-2014 CEA # # This file is part of shine # # 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...
gpl-2.0
-7,231,906,994,213,051,000
30.418251
79
0.57461
false
david-abel/simple_rl
simple_rl/tasks/maze_1d/Maze1DPOMDPClass.py
1
2420
# Python imports. from collections import defaultdict import random # Other imports. from simple_rl.pomdp.POMDPClass import POMDP from simple_rl.tasks.maze_1d.Maze1DStateClass import Maze1DState class Maze1DPOMDP(POMDP): ''' Class for a 1D Maze POMDP ''' ACTIONS = ['west', 'east'] OBSERVATIONS = ['nothin...
apache-2.0
2,584,774,365,799,531,000
35.666667
145
0.579752
false
tenable/Tenable.io-SDK-for-Python
tenable_io/api/plugins.py
1
1572
from tenable_io.api.base import BaseApi from tenable_io.api.models import PluginDetails, PluginFamilyDetails, PluginFamilyList class PluginsApi(BaseApi): def families(self, include_all=None): """Return list of plugin families. :param include_all: Whether or not to include all plugins. Defaults t...
mit
4,282,903,785,587,915,000
42.666667
104
0.67112
false
anarchivist/pyflag
src/plugins/Flash/AdvancedCommands.py
1
13927
""" These Flash commands allow more sophisticated operations, most of which may not be needed by most users. Some operations are specifically designed for testing and have little use in practice. """ import pyflag.pyflagsh as pyflagsh import pyflag.Registry as Registry import pyflag.DB as DB import fnmatch import pyfla...
gpl-2.0
-4,366,271,114,927,967,700
36.438172
178
0.575644
false
mobarski/sandbox
parallel/p7cat.py
1
1316
## p7cat.py - parallel concatenation ## (c) 2017 by mobarski (at) gmail (dot) com ## licence: MIT ## version: x1 from __future__ import print_function import sys import os from multiprocessing import Process from time import time def write_part(path_in, path_out, offset, blocksize=4096): fi = open(path_in,'rb') fo ...
mit
-6,190,227,077,822,655,000
20.933333
75
0.647416
false
stoq/stoqdrivers
docs/fiscal-driver-template.py
1
5263
# # Stoqdrivers template driver # # Copyright (C) 2007 Async Open Source <http://www.async.com.br> # 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 Foundation; either version 2 of the...
lgpl-2.1
-2,792,795,015,464,589,300
27.737705
78
0.610953
false
waheedahmed/edx-platform
openedx/core/djangoapps/api_admin/views.py
1
9646
"""Views for API management.""" import logging from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.urlresolvers import reverse_lazy, reverse from django.http.response import JsonResponse from django.shortcuts import redirect from django.utils.translation import...
agpl-3.0
-1,986,569,222,691,623,200
40.222222
98
0.651669
false
zhangsu/amphtml
validator/build.py
6
22339
#!/usr/bin/env python # # Copyright 2015 The AMP HTML 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 # # Unl...
apache-2.0
-8,134,788,603,869,757,000
34.45873
201
0.655625
false
chfoo/fogchamp
util/csv2json.py
1
4170
'''Convert CSV files into JSON files needed for the visualizer page.''' import argparse import json import os import functools from util.readers.addarash1 import AddarashReader from util.readers.bulbapedia import BulbapediaReader from util.readers.chfoo import ChfooReader from util.readers.editornotes import EditorNote...
mit
-2,807,500,552,308,781,000
35.26087
86
0.642206
false
vpelletier/neoppod
neo/lib/event.py
1
9556
# # Copyright (C) 2006-2016 Nexedi SA # # 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...
gpl-2.0
4,390,888,818,905,951,000
36.03876
80
0.57409
false
kpech21/Greek-Stemmer
tests/lemmatizers/test_verb.py
1
1883
# -*- coding: utf-8 -*- import pytest from greek_stemmer.lemmatizers.verb import stem class TestVerbStem: # rule-set 1: check irregular verbs verb_stem_ruleset1 = [ ('', 'VB', ''), ('ΕΙΜΑΙ', 'VB', 'ΕΙ'), ('ΕΙΜΑΣΤΕ', 'VBS', 'ΕΙ'), ('ΠΩ', 'VB', 'Π'), ('ΖΕΙΤΕ', 'VBS', '...
lgpl-3.0
-7,906,077,078,956,318,000
28.642857
70
0.533133
false
AndKyr/GETELEC
python/JFplot.py
1
1648
#! /usr/bin/python import numpy as np import getelec_mod as gt from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import matplotlib as mb font = 30 # mb.rcParams["font.family"] = "Serif" mb.rcParams["font.size"] = font mb.rcParams["axes.labelsize"] = font mb.rcParams["xtick.labelsize"] = font mb....
gpl-3.0
-1,551,624,963,708,100,600
20.402597
83
0.586772
false
goyal-sidd/BLT
website/models.py
1
10857
import os from urlparse import urlparse import requests import tweepy from PIL import Image from annoying.fields import AutoOneToOneField from colorthief import ColorThief from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.fi...
agpl-3.0
2,311,262,947,357,958,700
32.717391
112
0.634153
false
mark-r-g/hydrus
tests/test_rapidclus.py
1
1819
# Mark Gatheman <markrg@protonmail.com> # # This file is part of Hydrus. # # Hydrus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
-8,838,705,027,626,463,000
35.38
80
0.671798
false
googleapis/googleapis-gen
google/cloud/secrets/v1beta1/secretmanager-v1beta1-py/google/cloud/secretmanager/__init__.py
1
3026
# -*- 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
-1,846,891,807,528,377,000
48.606557
123
0.826504
false
labase/surdonews
src/surdonews/leao/main.py
1
5477
from jqueryui import jq from browser import document, html from superpython.virgem.main import Sala, Labirinto, Cena, INVENTARIO # importando do virgem STYLE = dict(position="absolute", width=300, left=0, top=0, background="blue") # mudar cor do background lá embaixo STYLE["min-height"] = "300px" IMAGEM = "http://s1...
gpl-3.0
-6,861,895,350,810,168,000
39.288889
182
0.633388
false
levilucio/SyVOLT
GM2AUTOSAR_MM/transformation/HMapPartition.py
1
3685
from core.himesis import Himesis import uuid class HMapPartition(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule MapPartition. """ # Flag this instance as compiled now self.is_compiled = True super(HMapPa...
mit
4,636,470,346,832,838,000
32.5
104
0.493623
false
benpetty/Code-Katas
katas/sort_cards/sort_cards.py
1
1347
"""Sort Cards. https://www.codewars.com/kata/56f399b59821793533000683 Write a function sort_cards() that sorts a shuffled list of cards, so that any given list of cards is sorted by rank, no matter the starting collection. All cards in the list are represented as strings, so that sorted list of cards looks like this...
mit
3,330,309,443,274,831,400
23.944444
76
0.513734
false
karlnapf/kameleon-mcmc
kameleon_mcmc/tools/Visualise.py
1
5656
""" This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Written (W) 2013 Heiko Strathmann Written (W) 2013 Dino Sejdinovic """ fro...
bsd-2-clause
31,964,555,859,623,480
33.072289
90
0.563296
false
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/add_newdocs.py
1
44163
from lib import add_newdoc add_newdoc('numpy.core','dtype', [('fields', "Fields of the data-type or None if no fields"), ('names', "Names of fields or None if no fields"), ('alignment', "Needed alignment for this data-type"), ('byteorder', "Little-endian (<),...
bsd-3-clause
-6,906,141,212,455,126,000
29.797071
83
0.613206
false
italomaia/turtle-linux
games/BubbleKing/lib/menu.py
1
13774
import os import pygame from pygame.locals import * from pgu import engine import data from cnst import * import levels class Menu(engine.State): def __init__(self,game): self.game = game def init(self): self.font = self.game.font self.bkgr = pygame.image.load(data.filepat...
gpl-3.0
2,693,359,161,638,019,000
29.074236
102
0.483665
false
mathiasertl/fabric
fabric/context_managers.py
1
20926
""" Context managers for use with the ``with`` statement. .. note:: If you are using multiple directly nested ``with`` statements, it can be convenient to use multiple context expressions in one single with statement. Instead of writing:: with cd('/path/to/app'): with prefix('workon myvenv...
bsd-2-clause
-7,542,093,378,251,034,000
33.760797
91
0.632132
false
LokiW/extendable-cards
extendable_cards/view/game_view.py
1
6424
from extendable_cards.view.graphics import Rectangle, Point, Text from tkinter import Button class GameOutline(object): def __init__(self, window, dx, dy, w, h): self.top_y = dy self.bottom_y = dy+h self.right_x = dx+w self.left_x = dx self.discard_end_x = dx + (w/6.0) ...
bsd-2-clause
7,205,527,144,953,349,000
30.960199
103
0.538294
false
google/tf-quant-finance
tf_quant_finance/experimental/pricing_platform/framework/market_data/rate_curve.py
1
13760
# Lint as: python3 # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
-6,346,764,848,289,983,000
44.114754
102
0.672456
false
Davasny/CCAS
ccas/models/exchanges/__init__.py
1
1783
from . import poloniex, btc_e, bittrex, bitfinex from ccas.models import database, coinmarketcap def get_balances(exchange, public_key, secret_key): if exchange == "poloniex": return poloniex.get_balances(public_key, secret_key) if exchange == "btc-e": return btc_e.get_balances(public_key, sec...
mit
4,158,025,492,351,887,000
33.960784
113
0.615816
false
veryhappythings/discord-gather
gather/discord_gather.py
1
2123
import asyncio import logging import discord from .gatherbot import GatherBot from .organiser import Organiser from . import commands logger = logging.getLogger(__name__) class DiscordGather: def __init__(self, token): self.token = token self.bot = None self.client = discord.Client() ...
mit
-7,811,874,497,295,730,000
33.803279
76
0.628356
false
GoogleCloudPlatform/cloudml-samples
chainer/containers/quickstart/mnist/trainer/mnist.py
1
6554
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the \"License\"); # you may not use this file except in compliance with the License.\n", # 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 writ...
apache-2.0
508,161,105,582,383,800
30.209524
80
0.652121
false
yasserglez/pytiger2c
packages/pytiger2c/ast/integerliteralexpressionnode.py
1
2204
# -*- coding: utf-8 -*- """ Clase C{IntegerLiteralExpressionNode} del árbol de sintáxis abstracta. """ from pytiger2c.ast.valuedexpressionnode import ValuedExpressionNode from pytiger2c.types.integertype import IntegerType class IntegerLiteralExpressionNode(ValuedExpressionNode): """ Clase C{IntegerLiteralE...
mit
7,899,778,051,832,931,000
33.587302
77
0.652134
false
jgmanzanas/CMNT_004_15
project-addons/sale_display_stock/report/sale_order_line_report.py
1
4447
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Comunitea All Rights Reserved # $Jesús Ventosinos Mayor <jesus@comunitea.com>$ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
516,351,656,280,464,100
47.326087
137
0.550157
false
gevannmullins/linux_server
add_items.py
1
4498
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from database_setup import Category, Base, Item, User engine = create_engine('postgresql://catalog:password@localhost/catalog') # engine = create_engine('sqlite:///catalog.db') # Bind the engine to the metadata of the Base class so that th...
mit
530,226,847,194,362,200
32.318519
174
0.765229
false
alphagov/backdrop
tests/read/test_parse_request_args.py
1
5035
from datetime import datetime import re import unittest from hamcrest import assert_that, is_, has_item import pytz from werkzeug.datastructures import MultiDict from backdrop.read.query import parse_request_args class Test_parse_request_args(unittest.TestCase): def test_start_at_is_parsed(self): reques...
mit
-5,928,915,904,435,119,000
29.70122
74
0.555511
false
imgrant/fit2tcx
fit2tcx.py
1
40690
#!/usr/bin/env python # # fit2tcx - convert a FIT file to a TCX file # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> [https://github.com/Tigge/FIT-to-TCX/] # Copyright (c) 2014-2016, Ian Grant <ian@iangrant.me> [https://github.com/imgrant/fit2tcx] # # Permission is hereby granted, free of charge, to any person...
mit
1,875,265,608,820,062,500
36.641073
131
0.541239
false
gkabbe/cMDLMC
mdlmc/IO/converters.py
1
1764
# coding=utf-8 import logging import os import pathlib import tables import h5py import daiquiri import fire import numpy as np from typing import Union, Iterable from ..atoms.numpy_atom import dtype_xyz from ..atoms import numpy_atom as npa from ..IO.trajectory_parser import XYZTrajectory logger = logging.getLogg...
gpl-3.0
-4,830,993,265,289,770,000
31.072727
97
0.652494
false
chromium2014/src
tools/perf/page_sets/intl_ko_th_vi.py
1
1913
# Copyright 2014 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. # pylint: disable=W0401,W0614 from telemetry.page.actions.all_page_actions import * from telemetry.page import page as page_module from telemetry.page import ...
bsd-3-clause
-6,543,040,283,645,747,000
31.423729
101
0.644015
false