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
joosthoeks/jhBacktest
jhbacktest/strategy/strategy.py
1
22478
from jhbacktest.data import * import jhbacktest.stats as jhstats from tabulate import tabulate import termcolor as tc class Strategy(object): def __init__(self, df, slippage=0): self.__df = df __data = Data() self.__df_np = __data.df2numpy(self.__df) self.__df_index = -1 ...
gpl-3.0
-576,245,011,368,361,200
37.423932
282
0.533989
false
tosaka2/tacotron
models/tacotron.py
1
4014
from util import textinput from util.infolog import log import chainer from chainer import Variable import chainer.functions as F import chainer.links as L import numpy as np from .modules import get_encoder_cbhg, get_decoder_cbhg, PreNet, Attention from hparams import hparams as hp def sequence_embed(embed, xs): ...
mit
2,407,114,685,599,975,400
33.756522
94
0.616366
false
huntxu/neutron
neutron/tests/unit/common/test_rpc.py
1
19542
# Copyright 2015 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 req...
apache-2.0
6,218,864,329,141,855,000
38.162325
78
0.631
false
MaxIV-KitsControls/tango-facadedevice
facadedevice/device.py
1
12477
"""Provide the facade device class and metaclass.""" # Imports import time import collections # Graph imports from facadedevice.graph import triplet, Graph, INVALID # Exception imports from facadedevice.exception import to_dev_failed, context # Utils imports from facadedevice.utils import EnhancedDevice, aggregate_...
gpl-3.0
1,596,889,208,874,801,400
31.662304
76
0.59213
false
palrogg/foundations-homework
Data_and_databases/Homework6_api.py
1
1394
from flask import Flask, request, jsonify import pg8000, decimal import json app = Flask(__name__) def get_data(_type, _sort): conn = pg8000.connect(user="paul", database="mondial") cursor = conn.cursor() sort_result = '' if _sort == 'name': sort_result = 'ORDER BY name' elif _sort in ('a...
mit
-3,189,071,382,793,536,000
23.892857
91
0.558824
false
skelneko/-CuriousActorCritic
Environment.py
1
2876
from Config import Config import gym import PIL from collections import deque import numpy as np class Environment(object): def __init__(self, game="MsPacman-v0"): self.screen_h = Config.SCREEN_H self.screen_w = Config.SCREEN_W self.screen_shape = Config.SCREEN_SHAPE self.frame_pe...
gpl-3.0
434,799,176,446,478,660
27.196078
102
0.599096
false
shawnchin/checkfort
checkfort/files.py
1
2041
import os import re import sys from checkfort.exceptions import * from checkfort.logging import p_warn, p_verbose default_extensions = ("h", "f", "F", "f90", "F90", "f95", "F95", "f03", "F03", "f08", "F08", "h",) class InputFileReader(object): def __init__(self, input_...
bsd-3-clause
2,146,750,796,814,318,800
31.919355
79
0.55757
false
phgupta/Building-Analytics
building-analytics/TS_Util_Clean_Data.py
1
15125
# -*- coding: utf-8 -*- """ @author : Armando Casillas <armcasillas@ucdavis.edu> @author : Marco Pritoni <marco.pritoni@gmail.com> Created on Wed Jul 26 2017 Update Aug 08 2017 """ from __future__ import division import pandas as pd import os import sys import requests as req import json import numpy as np import dat...
mit
3,792,750,501,190,625,300
23.756137
141
0.484959
false
bharatmooc/configuration-1
util/vpc-tools/vpc-tools.py
1
4340
"""VPC Tools. Usage: vpc-tools.py ssh-config (vpc <vpc_id> | stack-name <stack_name>) identity-file <identity_file> user <user> [(config-file <config_file>)] [(strict-host-check <strict_host_check>)] vpc-tools.py (-h --help) vpc-tools.py (-v --version) Options: -h --help Show this screen. -v...
agpl-3.0
3,703,358,002,025,198,600
30.223022
182
0.571429
false
samnjugu/python-gmail
Tools.py
1
3354
#!/usr/bin/python import smtplib, imaplib, email, email.header # Utility class to handle IMAP and SMTP # IMAP is used to fetch emails while SMTP is used to send emails class Gmail(object): def __init__(self, email, password): self.server = 'smtp.gmail.com' self.port = 587 session = smtpli...
gpl-2.0
5,599,144,041,551,790,000
34.305263
91
0.59511
false
jantman/awslimitchecker
awslimitchecker/tests/test_connectable.py
1
13876
""" awslimitchecker/tests/test_connectable.py The latest version of this package is available at: <https://github.com/jantman/awslimitchecker> ################################################################################ Copyright 2015-2018 Jason Antman <jason@jasonantman.com> This file is part of awslimitche...
agpl-3.0
-885,974,330,035,529,600
35.806366
80
0.528106
false
cjaymes/pyscap
src/scap/model/oval_5/defs/windows/MetabaseObjectElement.py
1
1144
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
gpl-3.0
-1,829,821,459,543,834,000
37.133333
111
0.700175
false
osroom/osroom
apps/core/logger/logger_server.py
1
4431
#!/usr/bin/env python # -*-coding:utf-8-*- # @Time : 2017/11/1 ~ 2019/9/1 # @Author : Allen Woo import json import os import socket import time import logging from logging.handlers import TimedRotatingFileHandler from apps.configs.sys_config import LOG_PATH, SOCKET_PORT from apps.utils.osr_async.osr_async import async...
bsd-2-clause
-8,607,789,152,920,088,000
30.877698
92
0.541864
false
baoboa/pyqt5
examples/itemviews/frozencolumn/frozencolumn.py
1
7103
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2017 Hans-Peter Jansen <hpj@urpla.net> ## Copyright (C) 2016 The Qt Company Ltd. ## ## This file is part of the examples of the Qt Toolkit. ## ## $QT_BEGIN_LICENSE:BSD$ ## Commercial License Usage ##...
gpl-3.0
1,153,572,706,326,094,600
42.576687
84
0.669435
false
olhoneles/olhoneles
montanha/forms.py
1
1722
# -*- coding: utf-8 -*- # # Copyright (©) 2013 Marcelo Jorge Vieira <metal@alucinados.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at ...
agpl-3.0
3,365,229,986,152,435,700
32.745098
75
0.624637
false
jiteshjha/remote-screen-control
pyxhook.py
1
15967
#!/usr/bin/python # # pyxhook -- an extension to emulate some of the PyHook library on linux. # # Copyright (C) 2008 Tim Alexander <dragonfyre13@gmail.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 Fr...
mit
6,552,510,022,520,829,000
43.352778
346
0.591032
false
f4exb/zfs-mania
zfile.py
1
4902
#!/usr/bin/env python """ Find details about a directory or plain file in a ZFS dataset using zdb utility """ import sys, os, traceback import re from optparse import OptionParser # ====================================================================== class Error(Exception): """Base class for exceptions in this...
mit
-4,963,215,025,282,937,000
34.781022
165
0.509384
false
staticfloat/julia-buildbot
master/coverage.py
1
7918
############################################################################### # Define everything needed to do per-commit coverage testing on Linux ############################################################################### import os run_coverage_cmd = """ using Pkg Pkg.activate("CoverageBase") using CoverageBas...
mit
-6,598,851,599,382,044,000
37.813725
180
0.638292
false
fortnight/Grammar_Game
Grammar_Game.py
1
13707
#!/usr/bin/python import sys import pygame from Buttons import Buttons from GameButton import GameButton from MenuButton import MenuButton from gi.repository import Gtk class Grammar_Game: def __init__(self): # Set up a clock for managing the frame rate. self.clock = pygame.time.Clock() s...
gpl-3.0
-7,798,434,488,820,568,000
40.286145
113
0.571898
false
tensorflow/moonlight
moonlight/score/reader_test.py
1
19072
# Copyright 2018 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 agreed to in writing, ...
apache-2.0
5,633,878,991,176,298,000
40.641921
80
0.566328
false
psiwczak/openstack
nova/utils.py
1
53103
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
-3,467,027,477,747,099,000
31.439218
79
0.58718
false
michaelbrooks/twitter-feels
twitter_feels/settings/prod.py
1
1165
""" Production settings. Based on https://github.com/rdegges/django-skel/blob/master/project_name/settings/prod.py """ from os import environ from common import * # Below are things we might need to deal with later ########## EMAIL CONFIGURATION ########## DATABASE CONFIGURATION ########## CACHE CONFIGURATION ########...
mit
6,534,998,766,569,324,000
30.513514
105
0.706438
false
telminov/django-park-keeper
parkkeeper/forms.py
1
2880
# coding: utf-8 import json from django import forms from parkkeeper import models from croniter import croniter class BaseSchedule(forms.ModelForm): def clean_options_json(self): options_json = self.cleaned_data.get('options_json') if options_json: try: options = json...
mit
5,198,988,995,579,362,000
33.285714
113
0.601736
false
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/behave/runner.py
1
24139
# -*- coding: utf-8 -*- from __future__ import with_statement import contextlib import os.path import StringIO import sys import traceback import warnings import weakref from behave import matchers from behave.step_registry import setup_step_decorators from behave.formatter import formatters from behave.configuration...
bsd-3-clause
2,834,012,232,175,173,600
34.290936
80
0.577944
false
eyolfson/site-eyl
django_blog/hooks.py
1
1907
# Copyright 2014 Jon Eyolfson # # This file is distributed under the GPLv3 license import datetime import logging import markdown import os import pygit2 from django_blog.models import Post from django_gitolite.utils import home_dir logger = logging.getLogger('django_blog') def update_blog(push): repo_path = pu...
gpl-3.0
-1,440,978,568,700,513,800
33.672727
78
0.571054
false
AngelValera/bares-y-tapas-DAI
proyecto_DAI/urls.py
1
1515
"""proyecto_DAI URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
mit
-4,793,245,582,486,517,000
35.95122
105
0.691089
false
gschizas/praw
praw/models/reddit/wikipage.py
1
10000
"""Provide the WikiPage class.""" from typing import Any, Dict, Generator, Optional, TypeVar, Union from ...const import API_PATH from ...util.cache import cachedproperty from ..listing.generator import ListingGenerator from .base import RedditBase from .redditor import Redditor _WikiPage = TypeVar("_WikiPage") Reddi...
bsd-2-clause
416,485,246,232,412,200
33.482759
79
0.5675
false
tokenly/bitsplit-server
util/entity.py
1
1359
""" ENTITY """ class Entity(object): """ ENTITY A wrapped for a data dictionary. Allows interface with data, but also allows extending to allow methods to manipulate data. """ def __init__(self, collection, data=None): if not data: data = {} super(Entity, self).__...
gpl-2.0
-3,386,305,237,740,637,000
27.3125
76
0.555556
false
futurepr0n/Books-solutions
Python-For-Everyone-Horstmann/Chapter6-Lists/P6.30.py
1
1303
# Write a function # def mergeSorted(a, b) # that merges two sorted lists, producing a new sorted list. Keep an index into each list, # indicating how much of it has been processed already. Each time, append the small- # est unprocessed element from either list, then advance the index. For example, if a is # 1 ...
mit
-8,833,145,592,245,625,000
23.603774
90
0.558711
false
googleinterns/contextual-query-rewrites
utils/test_translate_utils.py
1
1527
import unittest import translate_utils import os import shutil class TestRawData(unittest.TestCase): def test_translate_text(self): file = open("dummy_file.txt", 'w') file.write(" Ram \n") file.close() translate_utils.translate_data("dummy_file.txt", "dummy_output.txt") d...
apache-2.0
2,116,747,818,563,910,000
28.019231
76
0.5222
false
yro/veda_worker
tests/test_intake.py
1
2088
import os import sys import unittest sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from veda_worker.__init__ import VedaWorker from veda_worker.abstractions import Video, Encode from veda_worker.config import WorkerSetup """ file intake test """ class TestIntake(unittest.TestCase): ...
gpl-3.0
4,976,633,350,473,498,000
23.857143
76
0.533525
false
russelldavies/envparse
tests/test_casts.py
1
4940
# -*- coding: utf-8 -*- import pytest from envparse import Env, env, ConfigurationError, urlparse env_vars = dict( BLANK='', STR='foo', INT='42', FLOAT='33.3', BOOL_TRUE='1', BOOL_FALSE='0', PROXIED='{{STR}}', LIST_STR='foo,bar', LIST_STR_WITH_SPACES=' foo, bar', LIST_INT='1,...
mit
3,754,972,878,410,318,300
30.069182
87
0.608097
false
Melnick/Cnake
core/functions.py
1
1074
import os import shutil from unicurses import * from appdirs import * SEPARATOR = (os.name in ['ce', 'nt', 'dos']) and '\\' or '/'; def add_vector(a, b): return (a[0] + b[0], a[1] + b[1]); def w_log( path, attr = "a+", string = '' ): dir_path = user_log_dir("cnake"); path = "{}{}{}".format(dir_path, SEPARATOR...
mit
7,789,643,010,407,323,000
18.545455
67
0.557728
false
kapy2010/treeherder
tests/seta/test_job_priorities.py
1
1445
import datetime import pytest from mock import patch from treeherder.seta.job_priorities import (SetaError, seta_job_scheduling) @pytest.mark.django_db() @patch('treeherder.seta.job_priorities.SETAJobPriorities._validate_request', return_value=None) @patch('treeherder.set...
mpl-2.0
-69,469,573,831,768,330
40.285714
97
0.649135
false
jgerigmeyer/jquery-django-superformset
demo/demo/settings.py
1
2111
""" Django settings for demo project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
bsd-3-clause
-306,492,205,986,182,200
23.264368
71
0.717196
false
xupingmao/xnote
handlers/fs/fs_tools.py
1
1725
# -*- coding:utf-8 -*- # @author xupingmao <578749341@qq.com> # @since 2020/12/08 01:46:35 # @modified 2021/07/04 17:09:54 # -*- coding:utf-8 -*- # @since 2018-11-22 00:46:26 import os import re import math import time import web import xconfig import xutils import xauth import xmanager import xtables import random fro...
gpl-3.0
5,460,477,757,280,500,000
21.905405
77
0.578171
false
fxia22/pointGAN
show_ae.py
1
1680
from __future__ import print_function from show3d_balls import * import argparse import os import random import numpy as np import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torc...
mit
-7,822,991,694,803,677,000
26.096774
144
0.727381
false
dguerri/git-upstream-old
git_upstream/tests/base.py
1
5187
# Copyright 2010-2011 OpenStack Foundation # Copyright (c) 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/licens...
apache-2.0
6,074,584,528,144,438,000
36.316547
78
0.685753
false
OTL/genrb
scripts/genmsg_rb.py
1
2011
#! /usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, Takashi Ogura # # based on # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditi...
bsd-3-clause
3,096,508,180,594,001,400
37.673077
86
0.761313
false
google-research/google-research
rl_repr/tests/train_eval_offline_test.py
1
1293
# 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,335,390,548,113,482,000
31.325
74
0.738592
false
mentionllc/django-invitation
invitation/urls.py
1
1346
from django.conf import settings from django.conf.urls import * from django.views.generic import TemplateView if getattr(settings, 'INVITATION_USE_ALLAUTH', False): from allauth.account.forms import BaseSignupForm as RegistrationFormTermsOfService reg_backend = 'allauth.account.auth_backends.AuthenticationBac...
bsd-3-clause
-9,210,309,487,171,473,000
37.457143
90
0.621842
false
eugeneai/DME
src/icc/dme/fd/Exploration2.py
1
1877
from Numeric import * from mutils import * from biomass import * from free import * from spelper import * from logging import * def open1(name, mode): f=open(name, mode) f.write("from mutils import *\nfrom Numeric import *\n") return f next_data={ "low":(0,"middle"), "middle":(0,"high"), "high":(1,"low"), } de...
gpl-3.0
-9,175,346,103,418,292,000
16.707547
89
0.664891
false
SoftwareKing/zstack-woodpecker
zstackwoodpecker/zstackwoodpecker/operations/tag_operations.py
1
1832
''' Tag related operations @author: Youyk ''' import apibinding.api_actions as api_actions import zstackwoodpecker.test_util as test_util import account_operations import apibinding.inventory as inventory def create_system_tag(resourceType, resourceUuid, tag, session_uuid=None): action = api_action...
apache-2.0
8,610,459,213,184,401,000
35.387755
78
0.694323
false
xiangke/pycopia
aid/pycopia/words.py
1
1795
#!/usr/bin/python2.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # # $Id$ # # Copyright (C) 1999-2006 Keith Dart <keith@kdart.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software...
lgpl-2.1
6,614,251,274,612,924,000
25.791045
71
0.627855
false
aleksandar-mitrevski/robot_simulation
localisation/scripts/motion_model.py
1
2619
from math import cos, sin, atan2, exp, sqrt, pi from random import uniform from copy import copy from pose import Pose from velocity import Velocity from filter_parameters import MotionModelNoiseParameters class MotionModel(object): '''Defines a utility for sampling a motion model. Author -- Aleksandar Mitre...
mit
7,306,093,108,900,116,000
45.767857
226
0.654066
false
TexasLAN/texaslan.org
texaslan/users/migrations/0007_auto_20170115_1721.py
1
1682
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-01-15 23:21 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0006_auto_20160822_0840'), ] operations = [ migrations.AddField( ...
mit
3,448,541,350,329,890,300
34.787234
119
0.483353
false
apdjustino/DRCOG_Urbansim
src/opus_gui/main/controllers/opus_gui_configuration.py
1
6695
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE import os from lxml.etree import ElementTree, SubElement from PyQt4.QtCore import Qt from PyQt4.QtGui import QSplashScreen, QPixmap from opus_core.misc i...
agpl-3.0
-3,937,016,562,168,257,000
42.474026
96
0.582823
false
ftl/dxpad
tests/test.py
1
8396
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os import unittest sys.path.insert(0, os.path.abspath('..')) import dxpad._location as _location import dxpad._grid as _grid import dxpad._notepad as _notepad import dxpad._callinfo as _callinfo class TestLatLon(unittest.TestCase): def test_neigh...
mit
-5,978,264,942,486,913,000
32.31746
77
0.54657
false
starkdee/courseware
userprofile/views.py
1
1274
from django.shortcuts import render, redirect from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.forms.models import model_to_dict from userprofile.models import UserProfile from userprofile.forms import EditUserForm, EditUserProfileForm @login_required ...
mit
7,111,900,879,933,584,000
37.636364
124
0.704082
false
AllYarnsAreBeautiful/knittingpattern
knittingpattern/test/test_dump_json.py
1
1049
from pytest import fixture from unittest.mock import MagicMock from knittingpattern.Dumper import JSONDumper import json from knittingpattern.ParsingSpecification import ParsingSpecification @fixture def obj(): return ["123", 123] @fixture def dumper(obj): def dump(): return obj return JSONDumpe...
lgpl-3.0
-1,891,693,397,049,427,200
20.408163
69
0.714967
false
orlenko/bccf
src/bccf/migrations/0020_auto__add_field_userprofile_membership_order_free.py
1
45167
# -*- 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 'UserProfile.membership_order_free' db.add_column(u'bccf_userprofile', 'membership_order_free...
unlicense
-3,563,531,983,299,049,000
92.709544
195
0.549251
false
aurelieladier/openturns
python/test/t_KrigingAlgorithm_std.py
1
2901
#! /usr/bin/env python from __future__ import print_function from openturns import * from openturns.testing import * TESTPREAMBLE() # Test 1 sampleSize = 6 dimension = 1 f = NumericalMathFunction(['x0'], ['y'], ['x0 * sin(x0)']) X = NumericalSample(sampleSize, dimension) X2 = NumericalSample(sampleSize, dimension...
lgpl-3.0
-6,366,065,284,722,497,000
25.372727
74
0.736987
false
bicephale/OctoPrint
src/octoprint/plugins/softwareupdate/version_checks/github_commit.py
1
1955
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" im...
agpl-3.0
-7,031,101,314,761,969,000
32.101695
133
0.725038
false
jantman/RPyMostat-sensor
rpymostat_sensor/version.py
1
1930
""" The latest version of this package is available at: <http://github.com/jantman/RPyMostat-sensor> ################################################################################## Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com> This file is part of RPyMostat-sensor, also known...
agpl-3.0
7,328,817,709,505,778,000
48.487179
82
0.635233
false
kreatorkodi/repository.torrentbr
plugin.video.youtube/resources/lib/youtube_plugin/youtube/client/__config__.py
1
10980
# -*- coding: utf-8 -*- from base64 import b64decode from hashlib import md5 from ...kodion.json_store import APIKeyStore, LoginTokenStore from ...kodion import Context as __Context from ... import key_sets DEFAULT_SWITCH = 1 __context = __Context(plugin_id='plugin.video.youtube') __settings = __context.get_settings...
gpl-2.0
1,809,156,470,379,663,000
47.157895
127
0.576321
false
ChameleonCloud/horizon
openstack_dashboard/test/unit/api/test_neutron.py
1
76571
# Copyright 2012 NEC Corporation # # 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
-2,582,173,321,856,126,000
44.094817
79
0.608755
false
awsdocs/aws-doc-sdk-examples
python/example_code/iotthingsgraph/ms.py
1
6258
# # Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # This file is licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # This file is...
apache-2.0
7,958,414,060,473,398,000
35.389535
137
0.721477
false
BU-PyCon/Meeting-2
Programs/PyPlot.py
1
18763
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.patches import * import pdb print(""" MatPlotLib Advanced Tutorial ---------------------------- This is a tutorial covering the features and usage of the matplotlib package in more detail. In truth, no...
mit
6,750,708,883,860,443,000
37.752119
102
0.65933
false
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractJingletranslationsWordpressCom.py
1
1391
def extractJingletranslationsWordpressCom(item): ''' Parser for 'jingletranslations.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Breaking Off the Engagement… Bring it on!', ...
bsd-3-clause
-4,616,527,478,748,570,000
52.230769
134
0.506869
false
oliora/couched
setup.py
1
1040
from setuptools import setup import sys if sys.version < "2.7": raise Exception("Couched needs Python 2.7 or above") LONG_DESCRIPTION = open('README.txt').read() CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Opera...
mit
2,050,784,413,894,405,000
23.209302
56
0.6
false
tmrowco/electricitymap
parsers/lib/validation.py
1
5884
#!/usr/bin/env python3 """Centralised validation function for all parsers.""" from logging import getLogger def has_value_for_key(datapoint, key, logger): """checks that the key exists in datapoint and that the corresponding value is not None""" if datapoint['production'].get(key, None) is None: ...
gpl-3.0
7,181,092,218,174,970,000
33.611765
79
0.533651
false
gurpinars/hash-generator
hashGenerator.py
1
3997
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'hashGenerator.ui' # # Created: Tue Dec 18 00:25:17 2012 # by: PyQt4 UI code generator 4.9.3 # # WARNING! All changes made in this file will be lost! # # Author:M. Sami GÜRPINAR # Email :sami.gurpinar@gmail.com # from PyQt4 import ...
gpl-3.0
-2,423,430,719,406,215,700
43.898876
122
0.676677
false
lipixun/pytest
rabbitmq/geventmultimsg/client.py
1
2058
#!/usr/bin/env python # encoding=utf8 # The gevent test client import sys reload(sys) sys.setdefaultencoding('utf8') import gevent from gevent import monkey monkey.patch_all() from haigha.connections.rabbit_connection import RabbitConnection from haigha.message import Message class Client(object): """The RPC Cl...
gpl-2.0
-590,878,538,824,319,700
28.826087
134
0.580661
false
RylanGotto/web-dash
websterton/settings.py
1
1382
# -*- coding: utf-8 -*- import os os_env = os.environ class Config(object): SECRET_KEY = os_env.get('WEBSTERTON_SECRET', 'secret-key') # TODO: Change me APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir)) BCRYPT_LOG_R...
bsd-3-clause
-2,148,368,910,370,387,200
31.139535
81
0.652677
false
google/capirca
tests/lib/paloaltofw_test.py
1
32418
# Copyright 2012 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
-7,762,802,518,295,838,000
28.768595
134
0.635511
false
Villoid/PynamoDB
pynamodb/tests/test_model.py
1
80527
""" Test model API """ import random import json import copy from datetime import datetime import six from botocore.client import ClientError from pynamodb.compat import CompatTestCase as TestCase from pynamodb.tests.deep_eq import deep_eq from pynamodb.throttle import Throttle from pynamodb.connection.util import py...
mit
284,875,441,389,348,600
35.013864
114
0.442237
false
cbertinato/pandas
pandas/tests/plotting/test_backend.py
1
1151
import pytest import pandas def test_matplotlib_backend_error(): msg = ('matplotlib is required for plotting when the default backend ' '"matplotlib" is selected.') try: import matplotlib # noqa except ImportError: with pytest.raises(ImportError, match=msg): pandas...
bsd-3-clause
529,602,287,782,063,040
33.878788
79
0.674196
false
jaalto/httping
plot-json.py
2
1581
#! /usr/bin/python import sys import json import os import math fin = sys.argv[1] print "Loading from %s" % (fin) fh = open(fin) json_data = json.load(fh) print "Number of rows: %d" % (len(json_data)) fdata = fin + ".dat" print "Writing data to %s" % (fdata) data_fh = open(fdata, "w") host='?' total=0 total_sd...
gpl-2.0
7,975,171,851,592,360,000
19.269231
87
0.611006
false
mediafactory/yats
modules/yats/__init__.py
1
1499
# -*- coding: utf-8 -*- from django.conf import settings from sys import version_info from yats.api import * def update_permissions_after_migration(app,**kwargs): """ Update app permission just after every migration. This is based on app django_extensions update_permissions management command. """ ...
mit
-2,771,371,696,905,066,500
29.591837
81
0.607071
false
L33tCh/afj-flask
manage.py
1
1644
# manage.py import os import unittest import coverage from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from project.server import app, db, models COV = coverage.coverage( branch=True, include='project/*', omit=[ 'project/tests/*', 'project/server/config...
mit
2,866,174,267,722,228,700
20.363636
79
0.628954
false
dek-odoo/python-samples
python exercises/dek_program017.py
1
1356
#!/user/bin/python # -*- coding: utf-8 -*- # Author : (DEK) Devendra Kavthekar # program# : Name # => # Write a program that computes the net amount of a bank account # based a transaction log from console input. The transaction log # format is shown as following: # D 100 # W 200 # �� # D means deposit while W means ...
apache-2.0
-1,340,673,859,671,175,200
24.509434
76
0.54068
false
srlobo/slutils
slutils/sqlalchemy/group_concat.py
1
1779
# -*- coding: utf-8 -*- # Añade la funcionalidad group_concat de mysql al sqlalchemy from sqlalchemy.ext import compiler from sqlalchemy.sql import ColumnElement from sqlalchemy.orm.attributes import InstrumentedAttribute class group_concat(ColumnElement): def __init__(self, col1, col2=None, separator=None): ...
gpl-2.0
-7,678,533,400,014,553,000
29.655172
68
0.610236
false
mosquito/lumper
lumper/modes/worker.py
1
1481
#!/usr/bin/env python # encoding: utf-8 from crew.worker import Listener, Context, NODE_UUID, UUID from pika import PlainCredentials from crew.worker import context import logging import docker import docker.tls import lumper.worker def run(args): log = logging.getLogger("main") if args.docker_tls: t...
lgpl-3.0
2,745,685,323,294,813,000
30.510638
123
0.607022
false
stormandco/aiohttp_debugtoolbar
aiohttp_debugtoolbar/main.py
1
3654
import os import jinja2 import aiohttp_jinja2 from . import views from . import panels from .middlewares import middleware from .utils import APP_KEY, TEMPLATE_KEY, STATIC_ROUTE_NAME, hexlify, \ ToolbarStorage, ExceptionHistory from .views import ExceptionDebugView default_panel_names = [ panels.HeaderDebugPa...
apache-2.0
-954,536,894,783,035,800
33.8
79
0.6341
false
jbd/treewatcher
setup.py
1
1411
#!/usr/bin/env python # check Python's version import sys if sys.version < '2.4': sys.stderr.write('This module requires at least Python 2.5\n') sys.exit(1) # import statements import platform from setuptools import setup, Command # debug DISTUTILS_DEBUG = False # check linux platform if not platform.system...
gpl-3.0
1,692,870,964,562,512,400
22.131148
70
0.628632
false
borg-project/cargo
src/python/cargo/random.py
1
1157
""" @author: Bryan Silverthorn <bcs@cargo-cult.org> """ from __future__ import absolute_import import numpy def get_random_random(random = numpy.random): """ Get a randomly-initialized PRNG. """ from numpy.random import RandomState return RandomState(random.randint(numpy.iinfo(int).max)) def r...
mit
-8,786,405,354,850,565,000
19.660714
70
0.633535
false
ADicksonLab/wepy
tasks/modules/docs.py
1
16705
from invoke import task # from ..config import () import os import os.path as osp from pathlib import Path import shutil as sh from warnings import warn ## Paths for the different things DOCS_TEST_DIR = "tests/test_docs/_tangled_docs" DOCS_EXAMPLES_DIR = "tests/test_docs/_examples" DOCS_TUTORIALS_DIR = "tests/test_...
mit
-2,381,575,786,931,566,600
25.728
97
0.607603
false
mandli/multilayer-examples
2d/plane_wave/setrun.py
1
15949
""" Module to set up run time parameters for Clawpack. The values set in the function setrun are then written out to data files that will be read in by the Fortran code. """ import numpy as numpy import clawpack.geoclaw.multilayer.data as multilayer import clawpack.geoclaw.surge.data as surge import clawpack.geocla...
mit
5,311,222,775,262,506,000
30.459566
92
0.589818
false
ovpn-to/oVPN.to-Client-Software
else/python/hooks.py
1
17289
# -*- coding: utf-8 -*- # # Hooks module for py2exe. # Inspired by cx_freeze's hooks.py, which is: # # Copyright © 2007-2013, Anthony Tuininga. # Copyright © 2001-2006, Computronix (Canada) Ltd., Edmonton, Alberta, Canada. # All rights reserved. # import os, sys # Exclude modules that the standard library imp...
gpl-2.0
4,706,690,525,302,096,000
34.79089
81
0.64939
false
mekkablue/ShowCrosshair
ShowCrosshair.glyphsReporter/Contents/Resources/plugin.py
1
11905
# encoding: utf-8 from __future__ import division, print_function, unicode_literals ####################################################################################### # # Reporter Plugin # # Read the docs: # https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Reporter # ####################...
apache-2.0
-7,762,868,965,284,269,000
32.369318
165
0.698876
false
coderum/crony
crony/crony.py
1
3147
import click from . import utils, views from . import parsers as p from .crontab import Crontab try: from StringIO import StringIO except ImportError: from io import StringIO @click.group() def crony(): pass @crony.command() @click.option('--limit', default=0, help="Number of crons to di...
gpl-3.0
-5,281,866,693,860,838,000
29.553398
78
0.593581
false
denismakogon/trove-guestagent
trove_guestagent/common/context.py
1
1865
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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.apach...
apache-2.0
-7,662,403,318,449,441,000
33.537037
78
0.680965
false
yishayv/lyacorr
extinction_correlation.py
1
10396
""" Computes the Lyman-alpha forest auto-correlation estimator. The work is split between MPI nodes based on the first QSO in each possible pair. Partial data is gathered and the correlation estimator file is saved after processing each sub-chunk. """ import cProfile import itertools import numpy as np fro...
mit
99,461,778,343,690,620
47.807512
118
0.649288
false
cb1234/pynet-test
learnpy/class7/ex1a_cdp_parsing.py
1
1528
#!/usr/bin/env python ''' Create a program that opens the 'r1_cdp.txt' file and using regular expressions extracts the remote hostname, remote IP address, model, vendor, and device_type. ''' import re from pprint import pprint def generic_cdp_parser(pattern, cdp): ''' Search for pattern in the cdp data ...
apache-2.0
-6,601,483,307,684,706,000
25.807018
93
0.604712
false
kaushik94/sympy
sympy/parsing/tests/test_maxima.py
2
1711
from sympy.parsing.maxima import parse_maxima from sympy import Rational, Abs, Symbol, sin, cos, E, oo, log, factorial from sympy.abc import x n = Symbol('n', integer=True) def test_parser(): assert Abs(parse_maxima('float(1/3)') - 0.333333333) < 10**(-5) assert parse_maxima('13^26') == 917333301932686166583...
bsd-3-clause
-5,753,884,372,647,215,000
37.022222
75
0.576856
false
epeli/subssh
tests/test_assert_function_args.py
1
6487
''' Created on Mar 26, 2010 @author: epeli ''' import unittest from subssh.tools import assert_args from subssh import InvalidArguments class TestRequireArgumensWithFunctions(unittest.TestCase): def test_require_zero(self): def f(): pass assert_args(f, []) args = [...
agpl-3.0
-7,018,316,184,167,904,000
21.681818
93
0.546323
false
colemanja91/PyEloqua-Examples
venv/lib/python3.4/site-packages/simple_salesforce/api.py
1
27063
"""Core classes and exceptions for Simple-Salesforce""" # has to be defined prior to login import DEFAULT_API_VERSION = '29.0' import requests import json try: from urlparse import urlparse except ImportError: # Python 3+ from urllib.parse import urlparse from simple_salesforce.login import SalesforceL...
gpl-2.0
-4,290,808,311,357,684,000
37.661429
106
0.595389
false
GiggleLiu/nrg_mapping
doc/source/conf.py
1
9702
# -*- coding: utf-8 -*- # # NRGMapping documentation build configuration file, created by # sphinx-quickstart on Mon Sep 7 00:20:20 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
mit
-6,485,356,685,220,344,000
31.232558
113
0.708101
false
elfxwt/SpiderOfPython
main_simple.py
1
3003
# -*- coding: utf-8 -*- import requests import bs4 import time import codecs class Tool: def __init__(self,cityName): self.rootUrl = 'http://www.anjuke.com/' self.baseUrl = self.rootUrl + cityName + '/cm/' self.checkHref = self.rootUrl + cityName + '/' self.blUrlModle = 'http://'+cityName+'.anjuke.com/commu...
apache-2.0
3,719,469,298,661,651,000
22.023077
108
0.659539
false
caglar10ur/anvio
anvio/ccollections.py
1
8504
# -*- coding: utf-8 """Implements the collections class (the file name has an extra 'c' to avoid masking the standard collections library). If the user have analyzed their metagenome using a metagenome binning software and identified draft genomes in their data (or by any other means binned their contigs based on any...
gpl-3.0
-115,297,844,322,236,850
35.033898
120
0.608302
false
clubcapra/Ibex
src/seagoatvision_ros/scripts/CapraVision/client/gtk/filters/implementation/WinMorphology.py
1
3720
#! /usr/bin/env python # Copyright (C) 2012 Club Capra - capra.etsmtl.ca # # This file is part of CapraVision. # # CapraVision 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 versio...
gpl-3.0
7,680,349,863,580,811,000
39.445652
90
0.676075
false
musteryu/Data-Mining
assignment-黄煜-3120100937/question_4.py
1
1258
from mylib import * import os,sys import numpy as np import matplotlib.pyplot as plt import math import random from time import time if __name__ == '__main__': DIR_PATH = sys.path[0] + '\\' # normal distribution vector file nvctr_file1 = DIR_PATH + 'normal_500_1.txt' nvctr_file2 = DIR_PATH + 'normal_500_2.txt' #...
gpl-2.0
-7,111,678,879,534,298,000
26.977778
97
0.705087
false
tipabu/swift
test/unit/common/middleware/s3api/test_s3api.py
1
61449
# Copyright (c) 2011-2014 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 law or agre...
apache-2.0
4,349,858,928,597,868,000
45.587566
79
0.553158
false
sibskull/synaptiks
scripts/try_keyboard_monitor.py
1
3711
#!/usr/bin/python2 # Copyright (c) 2010, 2011, Sebastian Wiesner <lunaryorn@googlemail.com> # 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 abov...
bsd-2-clause
7,346,558,691,500,575,000
39.336957
79
0.737807
false
riddlezyc/geolab
src/structure/Z.py
1
1474
# -*- coding: utf-8 -*- # from framesplit import trajectory # too slow using this module import matplotlib.pyplot as plt dirName = r"F:\simulations\asphaltenes\na-mont\TMBO-oil\water\373-continue/" xyzName = 'all.xyz' hetero = 'O' # 'oh' 'N' 'sp' 'O' 'Np' 'sp' with open(dirName + xyzName, 'r') as f...
gpl-3.0
1,018,782,703,266,797,700
24.8
76
0.580054
false
kylewm/oauth-dropins
twitter_auth.py
1
2312
"""Utility functions for generating Twitter OAuth headers and making API calls. """ import logging import urllib2 import appengine_config import handlers import requests import requests_oauthlib import tweepy def auth_header(url, token_key, token_secret, method='GET'): """Generates an Authorization header and ret...
unlicense
-1,618,857,978,968,227,300
29.025974
82
0.687284
false
carthach/essentia
src/python/essentia/translate.py
1
24729
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), either version 3 of the ...
agpl-3.0
8,897,953,070,991,686,000
41.271795
199
0.576206
false
alephdata/aleph
aleph/views/xref_api.py
1
3909
import logging from flask import Blueprint, request from pantomime.types import XLSX from aleph.search import XrefQuery from aleph.logic.profiles import pairwise_judgements from aleph.logic.export import create_export from aleph.views.serializers import XrefSerializer from aleph.queues import queue_task, OP_XREF, OP_E...
mit
-5,093,979,607,631,259,000
27.532847
88
0.589153
false
rbose85/bounce-cars
backend/bounce/settings/base.py
1
2389
import os from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """Return the value of an environment variable, or raise an exception.""" try: return os.environ[setting] except KeyError: error_msg = "Set the {} env variable".format(setting) raise Im...
mit
-924,595,611,643,535,000
22.194175
77
0.686898
false
andela-ooshodi/codango-debug
codango/account/migrations/0001_initial.py
1
1359
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import cloudinary.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
mit
-6,548,849,997,940,557,000
41.46875
162
0.608536
false