text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#! /usr/bin/env python
# ==========================================================================
# This script performs the ctools science verification. It creates and
# analyses the pull distributions for a variety of spectral and spatial
# models. Test are generally done in unbinned mode, but also a stacked
# anal... | ctools/ctools | test/science_verification.py | Python | gpl-3.0 | 24,640 | 0.002476 |
from flask import render_template, request, jsonify, Blueprint
from .models import Recipe, Category
from .schemas import RecipeSchema, PaginationSchema
recipes = Blueprint("recipes", __name__)
DEFAULT_PER_PAGE = 10
MAX_PER_PAGE = 1000
@recipes.route('/api/v1/<int:id>')
def api_get_recipe(id):
recipe = Recipe.q... | spk/flask-recipes | app/views.py | Python | mit | 2,282 | 0 |
#!/usr/bin/env python
import logging
import sys
import os
import signal
import conf
import core
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol.TBinaryProtocol import TBinaryProtocolAcceleratedFactory
from thrift.server import TServer
from rpc import RndNodeApi
log... | chadmv/plow | lib/python/plow/rndaemon/server.py | Python | apache-2.0 | 2,191 | 0.003651 |
from graphics_module.objects import *
import numpy as np
def make_pixels_array_basic(amount):
return np.full(10,Pixel(), dtype=np.object)
def make_pixels_array_config_based(config):
if config.colorscheme == "b&w":
c = Color()
elif config.colorscheme == "light":
c = Color(r=245,g=235,b=234,... | sindresf/The-Playground | Python/Machine Learning/LSTM Music Visualizer/LSTM Music Visualizer/graphics_module/initialization.py | Python | mit | 576 | 0.026042 |
from django.utils.translation import ugettext_lazy as _
from oioioi.base.menu import MenuRegistry
navbar_links_registry = MenuRegistry(_("Navigation Bar Menu"))
| sio2project/oioioi | oioioi/problems/menu.py | Python | gpl-3.0 | 162 | 0 |
from casexml.apps.case.xform import get_case_ids_from_form
from corehq.apps.change_feed import topics
from corehq.apps.change_feed.producer import producer
from corehq.apps.change_feed import data_sources
from corehq.form_processor.interfaces.dbaccessors import FormAccessors, CaseAccessors
from corehq.form_processor.si... | qedsoftware/commcare-hq | corehq/form_processor/change_publishers.py | Python | bsd-3-clause | 4,539 | 0.001542 |
import math
import unittest
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product_dict(
[{'dtype': numpy.float16,
'forward... | okuta/chainer | tests/chainer_tests/functions_tests/loss_tests/test_contrastive.py | Python | mit | 6,422 | 0 |
""" Overrides for Docker-based devstack. """
from .devstack import * # pylint: disable=wildcard-import, unused-wildcard-import
# Docker does not support the syslog socket at /dev/log. Rely on the console.
LOGGING['handlers']['local'] = LOGGING['handlers']['tracking'] = {
'class': 'logging.NullHandler',
}
LOGGIN... | lduarte1991/edx-platform | lms/envs/devstack_docker.py | Python | agpl-3.0 | 2,419 | 0.000827 |
import supybot.callbacks as callbacks
import supybot.ircutils as ircutils
import supybot.ircmsgs as ircmsgs
from parthial.vals import LispSymbol, LispList, LispFunc, LispBuiltin
from parthial.errs import LimitationError
from parthial import built_ins
import re
import threading
parseMessage = re.compile('%s: (?P<conten... | benzrf/Lispnoria | parthial_ext.py | Python | gpl-3.0 | 3,208 | 0.003117 |
# setup for py.test
import os
import pytest
import easypost
TEST_API_KEY = os.environ["TEST_API_KEY"]
PROD_API_KEY = os.environ["PROD_API_KEY"]
def pytest_sessionstart(session):
# this is for local unit testing with google appengine, otherwise you get a
# 'No api proxy found for service "urlfetch"' respon... | dsanders11/easypost-python | tests/conftest.py | Python | mit | 1,864 | 0 |
#coding:utf-8
#################################
#Copyright(c) 2014 dtysky
#################################
import G2R,os
class MovieDefine(G2R.DefineSyntax):
def Creat(self,Flag,US,FS,DictHash):
DictHash=G2R.DefineSyntax.Creat(self,Flag,US,FS,DictHash)
if DictHash[Flag]==G2R.DHash(US.Args[Flag]):
return DictH... | dtysky/Gal2Renpy | Gal2Renpy/DefineSyntax/MovieDefine.py | Python | mit | 678 | 0.060472 |
# -*- coding: utf-8 -*-
import unittest
from pyparsing import ParseException
from tests.utils.grammar import get_record_grammar
"""
CWR Non-Roman Alphabet Agreement Party Name grammar tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
... | weso/CWR-DataApi | tests/grammar/factory/record/test_npa.py | Python | mit | 4,113 | 0.00073 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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... | fingeronthebutton/RIDE | src/robotide/lib/robot/running/arguments/argumentmapper.py | Python | apache-2.0 | 2,517 | 0.000397 |
from plugin import Projections
import pca
class Pca(Projections):
name = "Pca"
def Main(self,model):
self.model = model
pca_data = pca.pca(self.model.GetCurrentData()[:])
fields = ['Comp%02d' % c for c in range(1, pca_data.shape[1]+1)]
self.model.updateHDF('PCA', pca_data, field... | cliburn/flow | src/plugins/projections/Princomp/Main.py | Python | gpl-3.0 | 631 | 0.011094 |
from array import array
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.metrics import classification_report, roc_auc_score, roc_curve
from sklearn import tree
import cPickle
... | yuraic/koza4ok | skTMVA/sci_bdt_electron_DecisionTree.py | Python | mit | 1,980 | 0.004545 |
from keras.layers import Input
from keras.layers.core import Flatten, Dense, Dropout, Lambda
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.layers.normalization import BatchNormalization
from keras.models import Model
from keras import backend as K
from keras.optimizers imp... | ksu-mechatronics-research/deep-visual-odometry | models/hand_crafted/quat_rot_models/vggVO_0/model.py | Python | mit | 4,152 | 0.010116 |
'''
-----------------------------------------------------------------------------
WARNING: OUTDATED SCRIPT but might be of value for some (M.Haas 26.02.16)
Prepare input files for RRVS survey
-----------------------------------------------------------------------------
Created on 24.04.2015
Last modified on 24.04.... | GFZ-Centre-for-Early-Warning/REM_RRVS | scripts/prepareinput.py | Python | bsd-3-clause | 3,970 | 0.011089 |
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | nischu7/paramiko | tests/test_buffered_pipe.py | Python | lgpl-2.1 | 2,696 | 0.001113 |
#/*
# *
# * TuneIn Radio for XBMC.
# *
# * Copyright (C) 2013 Brian Hornsby
# *
# * 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... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/plugin.audio.tuneinradio.smallplayer/resources/lib/tunein.py | Python | gpl-2.0 | 37,835 | 0.002669 |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | karpelescoin/karpelescoin | contrib/bitrpc/bitrpc.py | Python | mit | 7,846 | 0.038109 |
# -*- coding: utf-8 -*-
import urllib2
from lxml import etree
class Scraper(object):
# subclass must override this property
url = None
def scrape(self):
stream = self.get_stream()
doc = self.get_document(stream)
return self.do_scrape(doc)
def get_document(self, stream):
... | csakatoku/uamobile | uamobile/scrapers/base.py | Python | mit | 543 | 0.003683 |
import random
import json
import os.path
class Response:
names = ["bolton", "qbot"]
def __init__(self, emoji, responses, added, removed):
self.emoji = emoji
self.responses = responses
self.added = added
self.removed = removed
def get_response(self, message, tokens, user)... | ianadmu/bolton_bot | bot/emoji_master.py | Python | mit | 3,263 | 0.000306 |
# -*- coding: utf-8 -*-
from resources.lib.parser import cParser
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.gui.gui import cGui
from resources.lib.util import cUtil
from resources.lib.handler.ParameterHandler import Parameter... | dbiesecke/plugin.video.xstream | sites/bundesliga_de.py | Python | gpl-3.0 | 7,292 | 0.006175 |
#!/usr/bin/python
#coding: utf-8
from django import forms
from models import deletelogapply
class deletelogform(forms.Form):
log_host = forms.CharField(label=u'日志主机',error_messages={'required':u'日志主机不可为空'},
widget = forms.TextInput(attrs={'class':'form-control','placeholder':'必填,不可为空(hostname or ip)'}))
... | xiaoxiangs/devops | pedevops/devops/form.py | Python | mpl-2.0 | 2,621 | 0.046055 |
# Copyright 2017 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 ag... | sharifelgamal/runtimes-common | ftl/php/builder.py | Python | apache-2.0 | 2,878 | 0 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 PolyBeacon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | gorocacher/payload | payload/api/controllers/v1/queue/__init__.py | Python | apache-2.0 | 3,397 | 0 |
# -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>
# Teon Brooks <teon.brooks@gmail.com>
#
# License: BSD (3-clause)
from copy import deepcopy
from math import sqrt
import numpy as np
from scipy import linalg
from ._eloret... | olafhauk/mne-python | mne/minimum_norm/inverse.py | Python | bsd-3-clause | 66,037 | 0 |
#!/usr/bin/env python3
# Copyright (c) 2017 The Sarielsaz Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
import time
from test_frame... | sarielsaz/sarielsaz | test/functional/net.py | Python | mit | 4,213 | 0.001899 |
# Generated by Django 2.0.13 on 2021-08-08 15:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("ddcz", "0102_letters_of_postal_service"),
]
operations = [
migrations.RenameField(
model_name="letters",
old_name="datum",
... | dracidoupe/graveyard | ddcz/migrations/0103_letters_col_rename.py | Python | mit | 800 | 0 |
from iminuit import Minuit
from probfit import UnbinnedLH, gaussian, Extended
from matplotlib import pyplot as plt
from numpy.random import randn
data = randn(1000)*2 + 1
ulh = UnbinnedLH(gaussian, data)
m = Minuit(ulh, mean=0., sigma=0.5)
plt.figure(figsize=(8, 6))
plt.subplot(221)
ulh.draw(m)
plt.title('Unextended... | mtresch/probfit | doc/pyplots/costfunc/ulh.py | Python | mit | 726 | 0.00551 |
import datetime
import pytest
from tests.test_utils import create_generic_job
from treeherder.model.models import Push
@pytest.fixture
def perf_push(test_repository):
return Push.objects.create(
repository=test_repository,
revision='1234abcd',
author='foo@bar.com',
time=datetime.... | KWierso/treeherder | tests/etl/conftest.py | Python | mpl-2.0 | 561 | 0 |
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.db.models import permalink
from django.contrib.auth.models import User
from tagging.fields import TagField
from src.basic.places import Place
class Event(models.Model):
"""Event model"""
title = m... | hittu123/ruhive | src/basic/events/models.py | Python | mit | 1,838 | 0.000544 |
import time
import urllib.parse
from dataclasses import dataclass
from typing import Dict, Iterable, Optional, Tuple, Union
import mitmproxy.net.http.url
from mitmproxy.coretypes import multidict
from mitmproxy.net.http import cookies, multipart
from mitmproxy.net.http import message
from mitmproxy.net.http.headers im... | vhaupert/mitmproxy | mitmproxy/net/http/request.py | Python | mit | 16,075 | 0.002115 |
from src.graphDb import *
db = 'db/test.db'
def test_text_format():
assert text_format("asdkjhaeih") == "asdkjhaeih"
assert text_format("as&dkj>hae<ih") == "as&dkj>hae<ih"
assert text_format("") == ""
def test_creatingGroups():
conn = sqlite3.connect(db)
conn.execute("INSERT INTO TW... | planaspa/Data-Mining | tests/test_graphDb.py | Python | mit | 4,201 | 0 |
import pytz
from django.conf import settings
from django.utils.dates import MONTHS, WEEKDAYS, WEEKDAYS_ABBR
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy
# Wagtail languages with >=90% coverage
# This list is manually maintained
WAGTAILADMIN_PROVIDED_LANGUAGES = ... | kaedroho/wagtail | wagtail/admin/localization.py | Python | bsd-3-clause | 3,698 | 0.000812 |
from kamo import Template
template = Template("""
%for x in range(1, N):
%if x % 15 == 0:
"fizzbuzz"
%elif x % 3 == 0:
"fizz"
%elif x % 5 == 0:
"buzz"
%else:
${x}
%endif
%endfor
""")
print(template.render(N=100))
| podhmo/kamo | demo/fizzbuzz.py | Python | mit | 224 | 0 |
# -*- coding: utf-8 -*-
import base64
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.controllers.main import Website
from openerp.addons.website_portal.controllers.main import website_account
from openerp.addons.website_sale.controllers.main import website_s... | tvtsoft/odoo8 | addons/website_sale_digital/controllers/main.py | Python | agpl-3.0 | 4,318 | 0.002547 |
from django.template.base import TemplateSyntaxError
from django.template.loader import get_template
from django.test import SimpleTestCase
from .utils import render, setup
class TemplateTagTests(SimpleTestCase):
@setup({'templatetag01': '{% templatetag openblock %}'})
def test_templatetag01(self):
... | andyzsf/django | tests/template_tests/syntax_tests/test_template_tag.py | Python | bsd-3-clause | 2,410 | 0.00083 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-29 22:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('almoxarifado', '0001_initial'),
]
operations = [
migrations.A... | rvmoura96/projeto-almoxarifado | almoxarifado/migrations/0002_auto_20170929_1929.py | Python | mit | 1,726 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generate-plugin.py - pluma plugin skeletton generator
# This file is part of pluma
#
# Copyright (C) 2006 - Steve Frécinaux
#
# pluma 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... | sc0w/pluma | tools/generate-plugin.py | Python | gpl-2.0 | 5,946 | 0.005383 |
"""
Siphon
config.py
Siphon app config
Author: Kenta Yamada
See configration options
Flask
https://flask.palletsprojects.com/en/1.1.x/config/#builtin-configuration-values
Flask-JWT-extended
https://flask-jwt-extended.readthedocs.io/en/latest/
"""
from os import environ
cla... | KentaYamada/Siphon | app/config.py | Python | mit | 1,835 | 0 |
# Copyright 2014 IBM Corp.
#
# 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... | eharney/nova | nova/tests/api/openstack/compute/contrib/test_extended_hypervisors.py | Python | apache-2.0 | 4,737 | 0 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
vector_selectbypoint
A QGIS plugin
Select vector features, point and click.
-------------------
begin : 2014-04-07
copy... | OregonWalks/qgis_vector_selectbypoint | vector_selectbypoint.py | Python | gpl-3.0 | 4,244 | 0.005184 |
# -*- coding: utf-8 -*-
import os
from turtle import*
def T(l):
if l > 4:
pensize(l / 6)
fd(l)
rt(33)
T(l * .7)
lt(66)
T(l * .7)
rt(33)
bk(l)
seth(90)
goto(0, -99)
T(99)
os.system("pause")
| NicovincX2/Python-3.5 | Géométrie/Fractales/arbre.py | Python | gpl-3.0 | 261 | 0.007663 |
"""
Django settings for web-application project.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import environ
# (chaosdorf-pizza/config/settings/base.py - 3 = ... | chaosdorf/chaospizza | src/config/settings/base.py | Python | mit | 5,807 | 0.001033 |
# -*- coding: utf-8 -*-
"""
The `Pipeline` class represents a pipeline which runs a sequence of tasks for analysing spectra. By defining new
descendents of the PipelineTask class, and appending them to a Pipeline, it is
possible to configure which 4GP classes it uses to perform each task within the
pipeline -- e.g. d... | dcf21/4most-4gp | src/pythonModules/fourgp_pipeline/fourgp_pipeline/pipeline.py | Python | mit | 6,115 | 0.003434 |
# Author: Ovidiu Predescu
# Date: July 2011
#
# 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 ... | Batterfii/tornado | tornado/platform/twisted.py | Python | apache-2.0 | 21,586 | 0.000278 |
from core.tests.test_ga import * | cartwheelweb/packaginator | apps/core/tests/__init__.py | Python | mit | 32 | 0.03125 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | do/core/makewavemovie.py | Python | agpl-3.0 | 2,769 | 0.005058 |
"""
WSGI config for asteria project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | tunegoon/asteria | asteria/wsgi.py | Python | mit | 1,136 | 0.00088 |
from django.db.models import fields, ForeignKey, ManyToOneRel, OneToOneRel
from .obj_types import clss
from .search_schema import schema as search_schema
def build_search_filters(cls):
"""Return list of dicts of options for a QueryBuilder filter.
See https://querybuilder.js.org/#filters for details.
""... | ebmdatalab/openprescribing | openprescribing/dmd/build_search_filters.py | Python | mit | 3,765 | 0.002125 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.db.models import Q
from machina.conf import settings as machina_settings
from machina.core.db.models import get_model
ForumPermission = get_model('forum_permission', 'ForumPermission')
GroupFor... | reinbach/django-machina | machina/apps/forum_permission/checker.py | Python | bsd-3-clause | 6,359 | 0.005032 |
#!/usr/bin/env python
"""Simple Tk example to manually test event loop integration.
This is meant to run tests manually in ipython as:
In [5]: %gui tk
In [6]: %run gui-tk.py
"""
from Tkinter import *
class MyApp:
def __init__(self, root):
frame = Frame(root)
frame.pack()
self.button =... | cloud9ers/gurumate | environment/share/doc/ipython/examples/lib/gui-tk.py | Python | lgpl-3.0 | 612 | 0.004902 |
# -*- coding: utf-8 -*-
"""Functions for video streaming."""
import cStringIO
import fcntl
import os
import signal
import struct
import subprocess
import sys
import time
import types
import json
from PIL import Image
import v4l2
VIDEO_DEVICE = None
VIDEO_STREAM_PROCESS = None
VIDEO_INITIALIZED = False
VIDEO_SIZE = "-... | meguiraun/mxcube3 | mxcube3/video/streaming.py | Python | gpl-2.0 | 7,123 | 0.001544 |
import websocket
import thread
import time
import cv2
from StringIO import StringIO
import base64
from PIL import Image
import numpy as np
import time
def on_message(ws, message):
img = base64.b64decode(message)
print img
def on_error(ws, error):
print error
def on_close(ws):
print "### closed ###"
... | TE-ToshiakiTanaka/stve | project/col/client.py | Python | mit | 829 | 0.018094 |
import struct
from common import *
from objects import ObjectAppType
from bcddevice import BCDDevice
# element types:
# X X ???? XX
# class format subtype
# class:
# 1 = Library
# 2 = Application
# 3 = Device
# format:
# 0 = Unknown
# 1 = Device
# 2 = String
# 3 = Object
# 4 = Object List
# 5 = Integer
# 6 = ... | kupiakos/pybcd | elements.py | Python | mit | 10,086 | 0.00694 |
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext
from django.utils import simplejson as json
from django.conf import settings
from StringIO import StringIO
from gitdb import IStream
from git import *
from git.exc import InvalidGitRepositoryError
from collections import defaultdict
from datetime ... | 9h37/pompadour-wiki | pompadour_wiki/pompadour_wiki/apps/utils/git_db.py | Python | mit | 10,263 | 0.001754 |
"""Test AdaNet ensemble single graph implementation.
Copyright 2018 The AdaNet 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
https://www.apache.org/licenses/LIC... | tensorflow/adanet | adanet/core/ensemble_builder_test.py | Python | apache-2.0 | 31,597 | 0.00557 |
import os
import githubloc.util as util
config_file = '.githubloc.ini'
home = os.path.expanduser('~')
config_file_with_path = os.path.join(home, config_file)
util.check_if_not_create(config_file_with_path, 'config/githubloc.ini')
config = util.parse_config(config_file_with_path)
conf = {
'token': os.path.expand... | z/github-loc | githubloc/config.py | Python | mit | 345 | 0 |
#!/usr/bin/python2.5
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the 'License')
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | dinomite/uaParser | uaParser/test/test_user_agent_parser.py | Python | apache-2.0 | 6,889 | 0.001887 |
from django.db import models
from django.contrib.sites.models import Site
# Create your models here.
class Link(models.Model):
url = models.URLField(max_length=512)
site = models.ForeignKey(Site, on_delete=models.SET_NULL, null=True)
request_times = models.PositiveIntegerField(default=0)
updated = mod... | typefj/django-miniurl | shortener/models.py | Python | mit | 702 | 0 |
# Copyright 2017 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... | manipopopo/tensorflow | tensorflow/contrib/gan/python/estimator/python/gan_estimator_impl.py | Python | apache-2.0 | 13,797 | 0.005074 |
# Copyright (c) 2019 PaddlePaddle 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 app... | PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_elementwise_nn_grad.py | Python | apache-2.0 | 12,057 | 0.001161 |
import sys
from codecs import StreamReader
from io import StringIO
from typing import Optional, TextIO, Union
stdout: Optional[Union[TextIO, StreamReader]] = None
class Test:
def setUp(self) -> None:
global stdout # pylint: disable=global-statement
self.real_stdout = sys.stdout
sys.stdou... | asciinema/asciinema | tests/test_helper.py | Python | gpl-3.0 | 415 | 0 |
# 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.
"""Provides fakes for several of Telemetry's internal objects.
These allow code like story_runner and Benchmark to be run and tested
without compiling or st... | benschmaus/catapult | telemetry/telemetry/testing/fakes/__init__.py | Python | bsd-3-clause | 15,827 | 0.011183 |
# -*- coding: utf-8 -*-
##################################################################################################
import sqlite3
import threading
from datetime import datetime, timedelta, time
import xbmc
import xbmcgui
import xbmcvfs
import api
import utils
import clientinfo
import downloadutils
import it... | angelblue05/Embytest.Kodi | resources/lib/librarysync.py | Python | gpl-2.0 | 55,974 | 0.003001 |
#!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test the 'symlink' rule.
import os
import BoostBuild
if os.name != 'posix':
print "The... | mxrrow/zaicoin | src/deps/boost/tools/build/v2/test/symlink.py | Python | mit | 845 | 0.001183 |
import functools
import os
import re
from collections import namedtuple
from datetime import datetime, time, timedelta
from flask import Flask, request, render_template, jsonify
from raven.contrib.flask.utils import get_data_from_request
from dateutil.parser import parse as parse_datetime
import requests
from pyqu... | wilsonssun/baseball-gamethread | app.py | Python | bsd-3-clause | 9,712 | 0.008237 |
from ..domain.symtable import SymbolTable
class YEPCToC:
def __init__(self, quadruples, symtable):
self.quadruples = quadruples
self.symtable = symtable
self.env = {}
def store_env(self, symbol_table):
# Push the environment from the symbol table
self.env[symbol_table.... | 1995parham/yepc | yepc/core/to_c.py | Python | gpl-3.0 | 5,989 | 0.002004 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache/incubator-airflow | airflow/migrations/versions/4446e08588_dagrun_start_end.py | Python | apache-2.0 | 1,372 | 0.001458 |
from django.utils.translation import ugettext as _
from django.db import models
from jmbo.models import ModelBase
class Superhero(ModelBase):
name = models.CharField(max_length=256, editable=False)
class Meta:
verbose_name_plural = _("Superheroes")
| praekelt/jmbo-superhero | superhero/models.py | Python | bsd-3-clause | 269 | 0 |
"""Conf format
The conf format is registered by default. It reads and writes settings
using :mod:`ConfigParser` at locations that are similar to typical Unix
configuration files---that is, in :file:`.conf` files specific to each
component scope under :file:`/etc/{organization}` for system-wide
settings and under :fil... | nisavid/spruce-settings | spruce/settings/_conf.py | Python | lgpl-3.0 | 3,013 | 0.000996 |
from wagtail.api.v2.filters import FieldsFilter, OrderingFilter, SearchFilter
from wagtail.api.v2.views import BaseAPIViewSet
from ... import get_image_model
from .serializers import ImageSerializer
class ImagesAPIViewSet(BaseAPIViewSet):
base_serializer_class = ImageSerializer
filter_backends = [FieldsFilte... | nimasmi/wagtail | wagtail/images/api/v2/views.py | Python | bsd-3-clause | 747 | 0.002677 |
"""
Helcio Macedo
Checksum Verifier v1.0
https://github.com/neomacedo/ScriptsUteis
-----------------------------------------------------------
Script used to compare if local file its the same as remote.
"""
import hashlib
import urllib2
import optparse
# Remote address to file
remote_url = 'https://raw.githubusercon... | neomacedo/ScriptsUteis | Python/checksum_comparator.py | Python | gpl-3.0 | 1,563 | 0.003839 |
import json
from decimal import Decimal
from unittest import skip
# from unittest.mock import patch
import unittest.mock as mock
from celery import current_app
from django.conf import settings
from django.test import TestCase
from ep.models import Site, ScheduleDeviceParameterGroup, DeviceParameter, StateChangeEvent
f... | dschien/energy-aggregator | ep/tests/test_celery.py | Python | mit | 3,630 | 0.003581 |
from morepath import compat
def test_text_type():
assert isinstance(u'foo', compat.text_type)
assert not isinstance(b'foo', compat.text_type)
def test_string_types():
assert isinstance('foo', compat.string_types)
assert isinstance(u'foo', compat.string_types)
if compat.PY3:
assert not is... | taschini/morepath | morepath/tests/test_compat.py | Python | bsd-3-clause | 799 | 0 |
import unittest
from elasticd.plugins import BasePlugin
from elasticd.plugins import ResourceLocator
from elasticd.plugins import Driver
from elasticd.plugins import Datastore
from elasticd.plugin_manager import PluginManager
import os
import ConfigParser
def get_test_plugin_manager():
config_file = os.path.dirnam... | SMxJrz/Elasticd | test/__init__.py | Python | apache-2.0 | 566 | 0.0053 |
from pysys.constants import *
from xpybuild.xpybuild_basetest import XpybuildBaseTest
class PySysTest(XpybuildBaseTest):
def execute(self):
self.xpybuild(args=['--depgraph', 'depgraph-output.dot'])
def validate(self):
self.assertDiff(file1='depgraph-output.dot', file2='ref-depgraph-output.dot')
| xpybuild/xpybuild | tests/correctness/framework/DepGraph/run.py | Python | apache-2.0 | 306 | 0.026144 |
###############################################################################
# Name: errdlg.py #
# Purpose: Error Reporter Dialog #
# Author: Cody Precord <cprecord@editra.org> #
... | ezequielpereira/Time-Line | libs/wx/tools/Editra/src/eclib/errdlg.py | Python | gpl-3.0 | 11,900 | 0.002353 |
import traceback
from datetime import datetime
from itertools import count
import zmq
def serve(procs, port=None, addr='tcp://*', context=None, debug=False):
"""Make some procedures available for remote calls via ØMQ."""
if context is None:
context = zmq.Context.instance()
with context.socket(zm... | doctaphred/phredutils | zmqrpc.py | Python | gpl-3.0 | 1,764 | 0 |
"""
--------------------------------------------------------------------------------------------
Extracted from skikit-learn to ensure basic compatibility
without creating an explicit dependency.
For the original code see
http://scikit-learn.org/
and
https://github.com/scikit-learn
----------------------------... | arokem/PyEMMA | pyemma/_ext/sklearn/parameter_search.py | Python | bsd-2-clause | 3,395 | 0.000589 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Title: logger
Author: David Leclerc
Version: 0.1
Date: 13.04.2018
License: GNU General Public License, Version 3
(http://www.gnu.org/licenses... | mm22dl/MeinKPS | logger.py | Python | gpl-3.0 | 3,955 | 0.005057 |
# Copyright 2022. ThingsBoard
# #
# 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 ... | thingsboard/thingsboard-gateway | thingsboard_gateway/gateway/grpc_service/tb_grpc_manager.py | Python | apache-2.0 | 11,720 | 0.00384 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Optimization algorithms used in `~astropy.modeling.fitting`.
"""
import warnings
import abc
import numpy as np
from ..utils.exceptions import AstropyUserWarning
__all__ = ["Optimization", "SLSQP", "Simplex"]
# Maximum number of iterations
DEFAULT_M... | funbaker/astropy | astropy/modeling/optimizers.py | Python | bsd-3-clause | 7,182 | 0.000139 |
###########################################################
#
# 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... | diegocortassa/TACTIC | src/pyasm/checkin/repo.py | Python | epl-1.0 | 6,768 | 0.008717 |
#----------------------------------------------------------------------------------
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
#
# Adham Lucas da Silva Oliveira 1715310059
# Alexandre Marques Uchôa 1715310028
# André Luís Laborda Neves ... | jucimarjr/IPC_2017-1 | lista04/lista04_lista02_questao11.py | Python | apache-2.0 | 1,164 | 0.013974 |
"""Subclass of IsClassMethods, which is generated by wxFormBuilder."""
from beatle import model
from beatle.lib import wxx
from beatle.activity.models.ui import ui as ui
from beatle.app.utils import cached_type
# Implementing IsClassMethods
class IsClassMethods(ui.IsClassMethods):
"""
This dialog allows to a... | melviso/phycpp | beatle/activity/models/ui/dlg/cc/IsClassMethods.py | Python | gpl-2.0 | 2,970 | 0.001684 |
# -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Analytic Warehouse",
"summary": "Add analytic in stock_warehouse",
"version": "9.0.1.0.0",
"category": "Accounting",
"website": "https://odoo-community.org/",
... | Gebesa-Dev/Addons-gebesa | stock_warehouse_analytic_id/__openerp__.py | Python | agpl-3.0 | 763 | 0 |
import re
from widgetastic_patternfly import Input, BootstrapSelect
from wrapanapi.hawkular import Hawkular
from cfme.common import TopologyMixin
from cfme.common.provider import DefaultEndpoint, DefaultEndpointForm
from cfme.utils.appliance import Navigatable
from cfme.utils.appliance.implementations.ui import navig... | jkandasa/integration_tests | cfme/middleware/provider/hawkular.py | Python | gpl-2.0 | 7,860 | 0.001781 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-21 00:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0001_initial'),
]
operations = [
migrations.AddField(
... | Neitsch/ASE4156 | authentication/migrations/0002_profile_has_bank_linked.py | Python | apache-2.0 | 462 | 0 |
from typing import Any, Collection, Dict, List, Optional, overload
from ..language import Node, OperationType
from ..pyutils import is_iterable
__all__ = ["ast_to_dict"]
@overload
def ast_to_dict(
node: Node, locations: bool = False, cache: Optional[Dict[Node, Any]] = None
) -> Dict:
...
@overload
def as... | graphql-python/graphql-core | src/graphql/utilities/ast_to_dict.py | Python | mit | 1,596 | 0.000627 |
# -*- coding: utf-8 -*-
import unittest
from cwr.parser.decoder.dictionary import WorkOriginDictionaryDecoder
from cwr.other import VISAN
"""
Dictionary to Message decoding tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
class Tes... | weso/CWR-DataApi | tests/parser/dictionary/decoder/record/test_work_origin.py | Python | mit | 1,959 | 0 |
# Datetime configuration spoke class
#
# Copyright (C) 2012-2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program i... | atodorov/anaconda | pyanaconda/ui/gui/spokes/datetime_spoke.py | Python | gpl-2.0 | 42,013 | 0.002428 |
from commentjson import dump
from commentjson import dumps
from commentjson import JSONLibraryException
from commentjson import load
from commentjson import loads
| ethifus/commentjson | commentjson/__init__.py | Python | mit | 163 | 0 |
#
# Copyright 2005,2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, filter
import math
import cmath
class fm_deemph(gr.hier_block2):
r"""
FM Deemphasis IIR filter
Args:
fs: sampling frequen... | trabucayre/gnuradio | gr-analog/python/analog/fm_emph.py | Python | gpl-3.0 | 9,632 | 0.006956 |
import os
from setuptools import setup, find_packages
from pip.req import parse_requirements
#REQUIREMENTS_FILE = os.path.join( os.path.dirname(__file__), 'requirements.openshift.txt')
PROJECT_NAME = '<your-project-name>'
AUTHOR_NAME = '<your-name>'
AUTHOR_EMAIL = '<your-email-address>'
PROJECT_URL = ''
DESCRIPTION =... | appsembler/symposion-openshift-quickstart | setup.py | Python | mit | 618 | 0.02589 |
# Created By: Virgil Dupras
# Created On: 2009-09-14
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licens... | hsoft/pdfmasher | qtlib/tree_model.py | Python | gpl-3.0 | 6,253 | 0.008316 |
#!/usr/bin/env python
# encoding: utf-8
# Copyright 2013 Steven Maude
# 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.
... | StevenMaude/sale_GOGgles | GOGgles.py | Python | gpl-3.0 | 2,999 | 0.000333 |
"""
Testing sampling
----------------
testing functions which helps in spatial sampling
"""
#import networkx as nx
#from scipy.sparse import coo_matrix
#from pySpatialTools.utils.artificial_data import\
# generate_random_relations_cutoffs
import numpy as np
from pySpatialTools.Sampling.sampling_from_space import ... | tgquintela/pySpatialTools | pySpatialTools/tests/test_sampling.py | Python | mit | 2,210 | 0.005882 |
# 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 u... | guanxi55nba/db-improvement | pylib/cqlshlib/helptopics.py | Python | apache-2.0 | 30,976 | 0.000839 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.