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 |
|---|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# © 2012-2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{'name': 'Switzerland - Payment Slip (BVR/ESR)',
'summary': 'Print ESR/BVR payment slip with your invoices',
'version': '10.0.2.1.1',
'author': "Camptocamp,Odoo Community Association (OCA)",
'category... | lem8r/cofair-addons | l10n_ch_payment_slip/__manifest__.py | Python | lgpl-3.0 | 847 | 0 |
info_system = 'http://webpac.lib.nthu.edu.tw/F/'
top_circulations = 'http://www.lib.nthu.edu.tw/guide/topcirculations/index.htm'
top_circulations_bc2007 = 'http://www.lib.nthu.edu.tw/guide/topcirculations/bc2007.htm'
rss_recent_books = 'http://webpac.lib.nthu.edu.tw:8080/nbr/reader/rbn_rss.jsp'
lost_found_url = 'http:/... | leVirve/NTHU-Library | nthu_library/static_urls.py | Python | gpl-2.0 | 363 | 0.002755 |
import pyglet
from pyglet.window import key
window = pyglet.window.Window()
@window.event
def on_key_press(symbol, modifiers):
print('A key was pressed')
if symbol == key.A:
print('The "A" key was pressed.')
elif symbol == key.LEFT:
print('The left arrow key was pressed.')
elif symbol... | davidam/python-examples | pyglet/keyboard.py | Python | gpl-3.0 | 446 | 0.006726 |
from . import load_fixture
from lintreview.config import load_config
from lintreview.diff import DiffCollection
from lintreview.review import Review, Problems, Comment
from lintreview.repo import GithubRepository, GithubPullRequest
from mock import Mock, call
from nose.tools import eq_
from github3.issues.comment impor... | zoidbergwill/lint-review | tests/test_review.py | Python | mit | 15,108 | 0 |
from typing import TypeVar, Dict, Iterable, Any
T = TypeVar("T")
def foo(values: Dict[T, Iterable[Any]]):
for e in []:
values.setdefault(e, undefined) | allotria/intellij-community | python/testData/inspections/PyTypeCheckerInspection/UnresolvedReceiverGeneric.py | Python | apache-2.0 | 165 | 0.006061 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Michael Hogg
# This file is part of bonemapy - See LICENSE.txt for information on usage and redistribution
import bonemapy
from distutils.core import setup
setup(
name = 'bonemapy',
version = bonemapy.__version__,
description = 'An ABAQUS plug-in to map bo... | mhogg/bonemapy | setup.py | Python | mit | 2,237 | 0.021904 |
import logbook
import show_off_web_app.infrastructure.static_cache as static_cache
import pyramid.httpexceptions as exc
from show_off_web_app.infrastructure.supressor import suppress
import show_off_web_app.infrastructure.cookie_auth as cookie_auth
from show_off_web_app.services.account_service import AccountService
... | mikeckennedy/cookiecutter-course | src/ch8_sharing_your_template/show_off_web_app/show_off_web_app/controllers/base_controller.py | Python | gpl-2.0 | 1,456 | 0.000687 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------
#-- Servo class
#-- Juan Gonzalez-Gomez (obijuan). May-2013
#-----------------------------------------------------------------
#-- Controlling the position of servos from the PC
#-- The Arduino / skymega or an... | Obijuan/protocoder-apps | servos/python-client/Servo.py | Python | gpl-2.0 | 1,675 | 0.027463 |
import zipfile
try:
import zlib
COMPRESSION = zipfile.ZIP_DEFLATED
except:
COMPRESSION = zipfile.ZIP_STORED
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core.files.uploadedfile import SimpleUploadedFile
class NotACompressedFile(Exception):
... | rosarior/rua | rua/apps/common/compressed_files.py | Python | gpl-3.0 | 2,263 | 0.001326 |
import frappe
def execute():
frappe.reload_doc("core", "doctype", "todo")
try:
frappe.db.sql("""update tabToDo set status = if(ifnull(checked,0)=0, 'Open', 'Closed')""")
except:
pass
| geo-poland/frappe | frappe/patches/v4_0/set_todo_checked_as_closed.py | Python | mit | 191 | 0.041885 |
__version__ = "2.0"
| sbidoul/pip | tests/data/src/simplewheel-2.0/simplewheel/__init__.py | Python | mit | 20 | 0 |
#!/usr/bin/env python
# Calder Phillips-Grafflin - WPI/ARC Lab
import rospy
import math
import tf
from tf.transformations import *
from visualization_msgs.msg import *
from geometry_msgs.msg import *
class RobotMarkerPublisher:
def __init__(self, root_frame, rate):
self.root_frame = root_frame
... | WPI-ARC/deformable_planners | deformable_astar/src/deformable_astar/robot_marker_debug_pub.py | Python | bsd-2-clause | 2,259 | 0.001771 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Summary',
'summary': 'Summary Module used by CLVsol Solutions.',
'version': '12.0.4.0',
'author': 'Carlos Eduardo Vercelino - CLVsol',
'ca... | CLVsol/clvsol_odoo_addons | clv_summary/__manifest__.py | Python | agpl-3.0 | 940 | 0 |
# coding=utf-8
# Copyright 2022 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 agreed ... | tensorflow/model-remediation | tensorflow_model_remediation/min_diff/keras/utils/input_utils.py | Python | apache-2.0 | 18,202 | 0.003846 |
# -*- coding: cp1252 -*-
from compiler import *
####################################################################################################################
# Each scene prop record contains the following fields:
# 1) Scene prop id: used for referencing scene props in other files. The prefix spr_ is automati... | Ikaguia/LWBR-WarForge | module_scene_props.py | Python | unlicense | 133,561 | 0.056558 |
import urwid
import logging
class UserInput(object):
def __init__(self):
self._viewMap = None
self._mainLoop = None
def setMap(self, ** viewMap):
self._viewMap = viewMap
def setLoop(self, loop):
self._mainLoop = loop
def __call__(self, keypress):
logging.debu... | kjniemi/scylla | tools/scyllatop/userinput.py | Python | agpl-3.0 | 648 | 0 |
#
# SVC (SVM Multi classifier)
#
# @ author becxer
# @ e-mail becxer87@gmail.com
#
import numpy as np
from pytrain.SVM import SVM
from pytrain.lib import convert
from pytrain.lib import ptmath
class SVC:
def __init__(self, mat_data, label_data):
self.x = np.mat(convert.list2npfloat(mat_data))
sel... | becxer/pytrain | pytrain/SVM/SVC.py | Python | mit | 1,018 | 0.007859 |
import numpy as np
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing.label import _check_numpy_unicode_bug
from sklearn.utils import column_or_1d
from ..base import SparkBroadcasterMixin, SparkTransformerMixin
class SparkLabelEncoder(LabelEncoder, SparkTransformerMixin,
... | lensacom/sparkit-learn | splearn/preprocessing/label.py | Python | apache-2.0 | 3,089 | 0 |
"""grace
Revision ID: 3d30c324ed4
Revises: 8c78a916f1
Create Date: 2015-09-07 08:51:46.375707
"""
# revision identifiers, used by Alembic.
revision = '3d30c324ed4'
down_revision = '8c78a916f1'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands aut... | huangtao-sh/grace | grace/alembic/versions/3d30c324ed4_grace.py | Python | gpl-2.0 | 531 | 0.011299 |
#!/usr/bin/env python
network_device = {
'ip_addr' : '81.1.1.3',
'username' : 'user1',
'passwd' : 'pass123',
'vendor' : 'cisco',
'model' : '3940',
}
for k,v in network_device.items():
print k,v
network_device['passwd']='newpass'
network_device['secret']='enable'
for k,v in network_device... | aniketpuranik/pynet_test | day2/ex15_exception.py | Python | apache-2.0 | 445 | 0.024719 |
from OpenGLCffi.GLES2 import params
@params(api='gles2', prms=['n', 'ids'])
def glGenQueriesEXT(n, ids):
pass
@params(api='gles2', prms=['n', 'ids'])
def glDeleteQueriesEXT(n, ids):
pass
@params(api='gles2', prms=['id'])
def glIsQueryEXT(id):
pass
@params(api='gles2', prms=['target', 'id'])
def glBeginQueryEXT... | cydenix/OpenGLCffi | OpenGLCffi/GLES2/EXT/EXT/occlusion_query_boolean.py | Python | mit | 616 | 0.01461 |
# Copyright 2016-2018 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | ARM-software/lisa | external/devlib/devlib/platform/gem5.py | Python | apache-2.0 | 12,624 | 0.00198 |
import pytest, sys, os
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../")
from unittest import TestCase
from pylogic.case import Case
class TestBaseOperand(TestCase):
def test_eq_case(self):
case1 = Case("parent", "homer", "bart")
case2 = Case("parent", "homer", "bart")
... | fran-bravo/pylogic-module | test/test_case_operands.py | Python | mit | 666 | 0.004505 |
import unittest
from prtgcli.cli import main
class TestQuery(unittest.TestCase):
def setUp(self):
pass
def test_list_devices(self):
pass
def test_list_sensors(self):
pass
def test_status(self):
pass
def test_update(self):
pass
| kevinschoon/prtgcli | test/test_cli.py | Python | apache-2.0 | 294 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-26 16:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pppcemr', '0122_auto_20160425_1327'),
]
operations = [
migrations.AddField(
... | sstebbins/pppcpro | pppcemr/migrations/0123_auto_20160426_1253.py | Python | agpl-3.0 | 663 | 0 |
# TempConv.py
# Celcius to Fahreinheit
def Fahreinheit(temp):
temp = float(temp)
temp = (temp*9/5)+32
return temp
# Fahreinheit to Celcius
def Celcius(temp):
temp = float(temp)
temp = (temp-32)*5/9
return temp
| megatharun/basic-python-for-researcher | TempConv.py | Python | artistic-2.0 | 243 | 0.012346 |
################################################################################
#
# Copyright (c) 2007 Christopher J. Stawarz
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restri... | zhouhan0126/SCREENTEST1 | tests/rtmplite/multitask.py | Python | gpl-2.0 | 41,396 | 0.002053 |
from lipd.lipd_io import lipd_read, lipd_write
from lipd.timeseries import extract, collapse, mode_ts, translate_expression, get_matches
from lipd.doi_main import doi_main
from lipd.csvs import get_csv_from_metadata
from lipd.excel import excel_main
from lipd.noaa import noaa_prompt, noaa_to_lpd, lpd_to_noaa, noaa_prom... | nickmckay/LiPD-utilities | Python/lipd/__init__.py | Python | gpl-2.0 | 38,558 | 0.002542 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Httpie(PythonPackage):
"""Modern, user-friendly command-line HTTP client for the API era."... | jakubroztocil/httpie | docs/packaging/spack/package.py | Python | bsd-3-clause | 1,904 | 0.003151 |
from vmware.models import VM, VMwareHost
from rest_framework import serializers
class VMSerializer(serializers.ModelSerializer):
class Meta:
model = VM
fields = ('name',
'moid',
'vcenter',
'host',
'instance_uuid',
... | colinleefish/theotherbarn | vmware/serializers.py | Python | mit | 786 | 0.003817 |
import os
import stat
import time
from inaugurator import sh
class TargetDevice:
_found = None
@classmethod
def device(cls, candidates):
if cls._found is None:
cls._found = cls._find(candidates)
return cls._found
pass
@classmethod
def _find(cls, candidates):
... | eliran-stratoscale/inaugurator | inaugurator/targetdevice.py | Python | apache-2.0 | 1,263 | 0.001584 |
from django.db import models
from jsonfield import JSONField
from collections import OrderedDict
class BaseObject(models.Model):
"""
The base model from which all apps inherit
"""
# Type represents the app that uses it. Assets, Persons, Orgs, etc
type = models.CharField(max_length=256)
# Rel... | jerynmathew/AssetManager | AssetManager/core/baseobject/models.py | Python | mit | 1,839 | 0.001631 |
"""
Default settings for the ``mezzanine.generic`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
... | orlenko/bccf | src/mezzanine/generic/defaults.py | Python | unlicense | 4,223 | 0.000947 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | bealdav/OpenUpgrade | addons/sale/report/sale_report.py | Python | agpl-3.0 | 5,204 | 0.002882 |
#!/usr/bin/env python3
"""
Lazy 'tox' to quickly check if branch is up to PR standards.
This is NOT a tox replacement, only a quick check during development.
"""
import os
import asyncio
import sys
import re
import shlex
from collections import namedtuple
try:
from colorlog.escape_codes import escape_codes
except... | fbradyirl/home-assistant | script/lazytox.py | Python | apache-2.0 | 7,111 | 0.000422 |
#!/usr/bin/env python
"""shuffle a dataset"""
import random
import sys
def sol_shuffle(filename, out_filename):
try:
file = open(filename, 'rb')
lines = file.readlines()
if len(lines) == 0:
print 'empty file'
file.close()
sys.exit()
if lines[-1][-... | matthew-Ng/sol | exp_sol/sol_shuffle.py | Python | gpl-3.0 | 626 | 0.003195 |
import abc
class RuleLearner:
"""2D 2-person board game rule learner base class
TODO
"""
def __init__(self, board_height, board_width):
"""Initialize the rule learner
Subclasses should call this constructor.
:type board_height: positive integer
:param board_height: ... | cmdunkers/DeeperMind | RuleLearner/RuleLearner.py | Python | bsd-3-clause | 974 | 0.002053 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
... | kdart/pycopia | core/pycopia/OS/Linux/proc/devices.py | Python | apache-2.0 | 1,668 | 0.002398 |
import glob
def handle(userToken, _):
# Get usertoken data
userID = userToken.userID
# Make sure the match exists
matchID = userToken.matchID
if matchID not in glob.matches.matches:
return
match = glob.matches.matches[matchID]
# Get our slotID and change ready status
slotID = match.getUserSlotID(userID)
i... | osuripple/ripple | c.ppy.sh/matchReadyEvent.py | Python | mit | 370 | 0.035135 |
###
#
# W A R N I N G
#
# This recipe is obsolete!
#
# When you are looking for copying and pickling functionality for generators
# implemented in pure Python download the
#
# generator_tools
#
# package at the cheeseshop or at www.fiber-space.de
#
###
import new
import copy
imp... | ActiveState/code | recipes/Python/528949_Copying_Generators/recipe-528949.py | Python | mit | 3,934 | 0.008897 |
# coding: utf-8
#
# Copyright © 2017 weirdgiraffe <giraffe@cyberzoo.xyz>
#
# Distributed under terms of the MIT license.
#
import sys
try: # real kodi
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
except ImportError: # mocked kodi
from mock_kodi import xbmc
from mock_kodi imp... | weirdgiraffe/plugin.video.giraffe.seasonvar | resources/site-packages/kodi/__init__.py | Python | mit | 3,703 | 0 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import copy, zipfile
from PyQt5.Qt import QAbstractItemModel, Qt, QColor, QFont, QI... | ashang/calibre | src/calibre/web/feeds/recipes/model.py | Python | gpl-3.0 | 14,130 | 0.002052 |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can re... | lercloud/shipping_api_usps | stock_packages.py | Python | gpl-3.0 | 3,338 | 0.004494 |
# -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
class InheritedDocs(type):
def __new__(mcs, class_name, bases, dict):
items_to_patch = [
(k, v) for k, v in dic... | bmcculley/splinter | splinter/meta.py | Python | bsd-3-clause | 954 | 0.001048 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr, flt, nowdate, comma_and, date_diff
from frappe import msgprint, _
from frappe.model.document import ... | bhupennewalkar1337/erpnext | erpnext/hr/doctype/leave_control_panel/leave_control_panel.py | Python | gpl-3.0 | 1,939 | 0.025271 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import latin_noun
import latin_pronoun
import latin_adj
import latin_conj
import latin_prep
import latin_verb_reg
import latin_verb_irreg
import util
class LatinDic:
dic = {}
auto_macron_mode = False
def flatten(text):
return text.replace(u'ā',u'a').replac... | naoyat/latin | latin/latindic.py | Python | mit | 1,985 | 0.010106 |
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from django.shortcuts import render, redirect
from django.contrib import messages
from django import forms as django_forms
from django.views.decorators.cache import cache_page
from django... | elweezy/django-skeleton | app/blog/views.py | Python | gpl-3.0 | 4,187 | 0.002627 |
__all__ = [
'fixed_value',
'coalesce',
]
try:
from itertools import ifilter as filter
except ImportError:
pass
class _FixedValue(object):
def __init__(self, value):
self._value = value
def __call__(self, *args, **kwargs):
return self._value
def fixed_value(value):
re... | calidae/python-aeat_sii | src/pyAEATsii/callback_utils.py | Python | apache-2.0 | 918 | 0 |
#MenuTitle: Set Preferred Names (Name IDs 16 and 17) for Width Variants
# -*- coding: utf-8 -*-
__doc__="""
Sets Preferred Names custom parameters (Name IDs 16 and 17) for all instances, so that width variants will appear in separate menus in Adobe apps.
"""
thisFont = Glyphs.font # frontmost font
widths = (
"Narrow"... | schriftgestalt/Mekka-Scripts | Font Info/Set Preferred Names (Name IDs 16 and 17).py | Python | apache-2.0 | 1,956 | 0.027607 |
import os
import yaml
DEFAULT_DIR = '../etc/'
class BaseConfig(object):
__config = {}
__default_dir = None
@classmethod
def load(cls, filename, default_path=DEFAULT_DIR):
"""
Setup configuration
"""
path = "%s/%s.yaml" % (default_path, filename)
cls.__default_... | smtpinc/sendapi-python | lib/smtpcom/config.py | Python | mit | 1,148 | 0.003484 |
# -*- coding: utf-8 -*-
# Copyright (c) 2004-2014 Alterra, Wageningen-UR
# Allard de Wit (allard.dewit@wur.nl), April 2014
from collections import namedtuple
from math import exp
from ..traitlets import Float, Int, Instance, AfgenTrait
from ..decorators import prepare_rates, prepare_states
from ..base_classes import P... | jajberni/pcse_web | main/pcse/crop/partitioning.py | Python | apache-2.0 | 12,949 | 0.005638 |
from temboo.Library.Amazon.SNS.AddPermission import AddPermission, AddPermissionInputSet, AddPermissionResultSet, AddPermissionChoreographyExecution
from temboo.Library.Amazon.SNS.ConfirmSubscription import ConfirmSubscription, ConfirmSubscriptionInputSet, ConfirmSubscriptionResultSet, ConfirmSubscriptionChoreographyEx... | jordanemedlock/psychtruths | temboo/core/Library/Amazon/SNS/__init__.py | Python | apache-2.0 | 2,012 | 0.006461 |
from channels import Group as channelsGroup
from channels.sessions import channel_session
import random
from .models import Group as OtreeGroup, Subsession as OtreeSubsession, Constants
import json
import channels
import logging
from otree import constants_internal
import django.test
from otree.common_internal import ... | anthropo-lab/XP | EPHEMER/EDHEC_Project/both_change_group_en/consumers.py | Python | gpl-3.0 | 13,913 | 0.004313 |
# i2c_esp.py Test program for asi2c.py
# Tests Responder on ESP8266
# The MIT License (MIT)
#
# Copyright (c) 2018 Peter Hinch
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | peterhinch/micropython-async | v2/i2c/i2c_esp.py | Python | mit | 2,245 | 0.001336 |
# Borrowed and modified from xbmcswift
import logging
import xbmc
from pulsar.addon import ADDON_ID
class XBMCHandler(logging.StreamHandler):
xbmc_levels = {
'DEBUG': 0,
'INFO': 2,
'WARNING': 3,
'ERROR': 4,
'LOGCRITICAL': 5,
}
def emit(self, record):
xbmc_le... | steeve/plugin.video.pulsar | resources/site-packages/pulsar/logger.py | Python | bsd-3-clause | 680 | 0.002941 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | blueboxgroup/ansible | lib/ansible/executor/playbook_executor.py | Python | gpl-3.0 | 11,134 | 0.004581 |
#!/usr/bin/python
from pisi.actionsapi import shelltools, get, cmaketools, pisitools
def setup():
cmaketools.configure()
def build():
cmaketools.make()
def install():
cmaketools.install()
pisitools.dodoc ("AUTHORS", "ChangeLog", "COPYING")
| richard-fisher/repository | desktop/util/tint2/actions.py | Python | gpl-2.0 | 263 | 0.019011 |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
'pyramid',
'pyramid_debugtoolbar',
'waitress',
]
setup(name='tilecost',... | Shopzilla-Ops/python-coding-challenge | cost-of-tile/mjones/tilecost/setup.py | Python | mit | 998 | 0 |
__author__ = 'mwagner'
from PyQt4.Qt import Qt
from PyQt4.QtGui import QDialog, QIcon
from ..view.Ui_VertexDialog import Ui_VertexDialog
from ..model.VertexToolsError import *
class VertexDialog(QDialog, Ui_VertexDialog):
def __init__(self, plugin, parent=None):
super(VertexDialog, self).__init__(pare... | allspatial/vertex-tools | controller/VertexDialog.py | Python | mit | 550 | 0.001818 |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | kanghtta/zerorpc-python | tests/test_client.py | Python | mit | 1,919 | 0.002606 |
import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champion_json['data']:
print champion
r = requests.get('http:... | dzhang55/riftwatch | static_images.py | Python | mit | 1,397 | 0.027917 |
# Standard
import os
import sys
# Third Party
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
import pyfilm as pf
from skimage.measure import label
from skimage import filters
plt.rcParams.update({'figure.autolayout': True})
mpl.rcParams['axes.unicode_mi... | ferdinandvwyk/gs2_analysis | structure_analysis.py | Python | gpl-2.0 | 4,637 | 0.009273 |
#!/usr/bin/env python
# This file mainly exists to allow python setup.py test to work.
#
# You can test all the variations of tests by running:
#
# ./manage.py test && python runtests.py && ./setup.py test && echo OK
#
import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
from django.core.managemen... | ciudadanointeligente/popit-django | runtests.py | Python | agpl-3.0 | 621 | 0.008052 |
# This file is part of CDS Invenio.
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
#
# CDS Invenio 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... | pombredanne/invenio-old | modules/bibclassify/lib/bibclassify_webinterface.py | Python | gpl-2.0 | 14,432 | 0.004088 |
#!/usr/bin/env python
import mredis
import time
ports = [6379, 6380]
servers = []
for port in ports:
servers.append({'host': 'localhost', 'port': port, 'db': 0})
mr = mredis.MRedis(servers)
# Destructive test of the database
#print mr.flushall()
#print mr.flushdb()
print mr.ping()
# Build a set of keys for op... | gmr/mredis | tests/general.py | Python | bsd-3-clause | 795 | 0.003774 |
#!/usr/bin/python3
import argparse, random, textwrap
from datetime import datetime
from urllib import request
from xml.etree import ElementTree
labels = {
"clouds": "%",
"humidity": "%",
"precipitation": "%",
"temp": "°F",
"wind-direction": "°",
"wind-speed": " mph",
}
parser = argparse.Argume... | ercas/scripts | weather.py | Python | apache-2.0 | 3,411 | 0.017014 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import errno
import hashlib
import os
from django.conf import settings
from django.core.files import File
from django.core.files.storage import FileSystemStorage
from django.utils.encoding import force_unicode
__all__ = ["HashedFileSystemStorage"]
__aut... | pmeier82/spike_gnode | base/storage.py | Python | bsd-3-clause | 2,381 | 0.00126 |
"""Extensions which provide a block segments."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
| kevinconway/rpmvenv | rpmvenv/extensions/blocks/__init__.py | Python | mit | 199 | 0 |
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from rest_framework import reverse
from druidapi.query.models import QueryModel
from models import Result
from forms import SearchForm
imp... | nalabelle/druid-django | frontend/views.py | Python | mit | 1,868 | 0.002677 |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
import unittest
from io import BytesIO, StringIO
from decimal import Decimal
import threading
from importlib import import_module
from ijson import common
from ijson.backends.python import basic_parse, Lexer
from ijson.compat import IS_PY2
JSON = b'''
{
... | catapult-project/catapult | third_party/ijson/tests.py | Python | bsd-3-clause | 8,608 | 0.002679 |
import os, random
rfilename=random.choice(os.listdir("/storage/pictures"))
rextension=os.path.splitext(rfilename)[1]
picturespath='/storage/pictures/'
#TODO Probably dont need a forloop can possibly do random*
#TODO What if the directory is empty?
for filename in os.listdir(picturespath):
if filename.startswith("ran... | shoaibali/kodi.background.rotator | randombackground.py | Python | gpl-3.0 | 713 | 0.026648 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-11-14 21:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('recipe', '0010_auto_20171114_1443'),
]
operations = [
migrations.RemoveField(
... | RyanNoelk/OpenEats | api/v1/recipe/migrations/0011_auto_20171114_1543.py | Python | mit | 466 | 0 |
from __future__ import division
from __future__ import print_function
import os
import sys
import functools
# Update path
root = os.path.join(os.getcwd().split('proj1')[0], 'proj1')
if root not in sys.path:
sys.path.append(root)
import numpy as np
import pandas as pd
import multiprocessing
from pdb import set_tra... | rahlk/CSC579__Computer_Performance_Modeling | simulation/proj1/tasks/task5.py | Python | mit | 2,063 | 0.010664 |
# Copyright (C) 2016 Intel Corporation
# Released under the MIT license (see COPYING.MIT)
from oeqa.core.exception import OEQAMissingVariable
from . import OETestDecorator, registerDecorator
def has_feature(td, feature):
"""
Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES.
"""
if (featur... | schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/meta/lib/oeqa/core/decorator/data.py | Python | gpl-2.0 | 2,959 | 0.004055 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... | vlegoff/tsunami | src/secondaires/navigation/equipage/signaux/__init__.py | Python | bsd-3-clause | 2,386 | 0 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | ruyang/ironic | ironic/tests/unit/drivers/modules/network/test_neutron.py | Python | apache-2.0 | 19,670 | 0 |
# Copyright 2013, Big Switch Networks, 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 applic... | Athrun29/horizon | openstack_dashboard/dashboards/project/firewalls/tables.py | Python | apache-2.0 | 15,142 | 0 |
import os
import numpy as np
from scipy.optimize import curve_fit
def gauss(x, A, mu, sigma):
return A * np.exp(-(x - mu)**2 / (2. * sigma**2))
scriptmode = True
SDM_name = 'test' # The prefix to use for all output files
# SDM_name = '13A-213.sb20685305.eb20706999.56398.113012800924'
# Set up some useful var... | e-koch/canfar_scripts | img_pipe/casanfar_image.py | Python | mit | 7,517 | 0.000133 |
# encoding: 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 'SPOptionsIdPPolicy.enabled'
db.add_column('saml_spoptionsidppolicy', 'enabled', self.gf('d... | incuna/authentic | authentic2/saml/migrations/0010_auto__add_field_spoptionsidppolicy_enabled.py | Python | agpl-3.0 | 22,083 | 0.007472 |
from django.apps import AppConfig
class DataimportConfig(AppConfig):
name = "intranet.apps.dataimport"
| tjcsl/ion | intranet/apps/dataimport/apps.py | Python | gpl-2.0 | 109 | 0 |
#!/usr/bin/env python
import numpy as np
from horton import *
# specify the even tempered basis set
alpha_low = 5e-3
alpha_high = 5e2
nbasis = 30
lnratio = (np.log(alpha_high) - np.log(alpha_low))/(nbasis-1)
# build a list of "contractions". These aren't real contractions as every
# contraction only contains one bas... | eustislab/horton | data/examples/hamiltonian/even_tempered_li.py | Python | gpl-3.0 | 725 | 0 |
"""SCons.Variables.PathVariable
This file defines an option type for SCons implementing path settings.
To be used whenever a a user-specified path override should be allowed.
Arguments to PathVariable are:
option-name = name of this option on the command line (e.g. "prefix")
option-help = help string for optio... | engineer0x47/SCONS | engine/SCons/Variables/PathVariable.py | Python | mit | 5,616 | 0.00089 |
# ----------------------------------------------------------------------------
# Copyright (c) 2008 Andrew D. Straw and Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistr... | bitcraft/pyglet | contrib/experimental/input/xinput.py | Python | bsd-3-clause | 9,260 | 0 |
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# License: Simplified BSD
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import metrics
from sklearn.cluster import KMeans, MiniBatchKMean... | clemsos/mitras | tests/examples/kmeans.py | Python | mit | 2,846 | 0.001054 |
# 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... | apache/incubator-superset | tests/unit_tests/fixtures/datasets.py | Python | apache-2.0 | 6,514 | 0 |
from celery.task import Task
import requests
class StracksFlushTask(Task):
def run(self, url, data):
requests.post(url + "/", data=data)
| Stracksapp/stracks_api | stracks_api/tasks.py | Python | bsd-2-clause | 152 | 0.013158 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# spaceClustering.py
#
# Copyright 2014 Carlos "casep" Sepulveda <carlos.sepulveda@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 Free Software Found... | creyesp/RF_Estimation | Clustering/clustering/spaceClustering.py | Python | gpl-2.0 | 4,653 | 0.041694 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# Copyright: (c) 2014, Ahti Kitsik <ak@ahtik.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolu... | jimi-c/ansible | lib/ansible/modules/files/lineinfile.py | Python | gpl-3.0 | 18,737 | 0.001868 |
import re
from django.conf import settings
from django.utils.html import escape
from django.utils.encoding import smart_str
from urlobject import URLObject
from urlobject.query_string import QueryString
from django.template import StringOrigin
from django.template.base import Lexer, Parser
from django.template.defaultt... | hzlf/openbroadcast.org | website/tools/spurl/templatetags/spurl.py | Python | gpl-3.0 | 12,763 | 0.00047 |
from sympy import AccumBounds, Symbol, floor, nan, oo, E, symbols, ceiling, pi, \
Rational, Float, I, sin, exp, log, factorial, frac
from sympy.utilities.pytest import XFAIL
x = Symbol('x')
i = Symbol('i', imaginary=True)
y = Symbol('y', real=True)
k, n = symbols('k,n', integer=True)
def test_floor():
a... | drufat/sympy | sympy/functions/elementary/tests/test_integers.py | Python | bsd-3-clause | 6,826 | 0.001025 |
# -*- coding: utf-8 -*-
#################################################################################################
import json
import xbmc
import xbmcgui
import clientinfo
import downloadutils
import embydb_functions as embydb
import playbackutils as pbutils
import utils
####################################... | angelblue05/Embytest.Kodi | resources/lib/kodimonitor.py | Python | gpl-2.0 | 8,856 | 0.0035 |
#
# core.py
#
# Copyright (C) 2014 dredkin <dmitry.redkin@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# Deluge is free software.
#
# Yo... | Mattie432/deluge-rbb | browsebutton/core.py | Python | gpl-2.0 | 5,012 | 0.003591 |
import random
from common import generalUtils
from common.log import logUtils as log
from constants import clientPackets
from constants import matchModModes
from constants import matchTeamTypes
from constants import matchTeams
from constants import slotStatuses
from objects import glob
def handle(userToken, packetDa... | osuripple/pep.py | events/changeMatchSettingsEvent.py | Python | agpl-3.0 | 2,905 | 0.027893 |
from ..rerequest import TemplateRequest
init_req = TemplateRequest(
re = r'(http://)?(www\.)?(?P<domain>ur(play)?)\.se/(?P<req_url>.+)',
encode_vars = lambda v: { 'req_url': 'http://%(domain)s.se/%(req_url)s' % v } )
hls = { 'title': 'UR-play', 'url': 'http://urplay.se/', 'feed_url': 'http://urplay.se/rss',... | jackuess/pirateplay.se | lib/pirateplay/lib/services/ur.py | Python | gpl-3.0 | 1,161 | 0.046512 |
# Copyright (C) 2010 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of Launch Control.
#
# Launch Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... | OSSystems/lava-server | dashboard_app/tests/models/attachment.py | Python | agpl-3.0 | 3,410 | 0 |
#!/usr/bin/env python3
import unittest
from tests import testfunctions
from dftintegrate.fourier import vaspdata
class TestExtractingVASPDataToDatFiles(unittest.TestCase,
testfunctions.TestFunctions):
def setUp(self):
print('Testing extracting VASP data to .dat fi... | mmb90/dftintegrate | tests/fourier/extractvaspdata/test_extractvaspdata.py | Python | mit | 1,597 | 0 |
"""Solve the Project Euler problems using functional Python.
https://projecteuler.net/archives
"""
from importlib import import_module
from os import listdir
from os.path import abspath, dirname
from re import match
SOLVED = set(
int(m.group(1))
for f in listdir(abspath(dirname(__file__)))
for m in (mat... | 2Cubed/ProjectEuler | euler/__init__.py | Python | mit | 584 | 0 |
import random
import pymel.core as pm
from impress import models, register
def randomTransform( translate=False, translateAmount=1.0, translateAxis=(False,False,False),
rotate=False, rotateAmount=1.0, rotateAxis=(False,False,False),
scale=False, scaleAmount=1.0, ... | kinetifex/maya-impress | examples/options_example.py | Python | bsd-3-clause | 2,324 | 0.027539 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | viraptor/cryptography | cryptography/hazmat/primitives/asymmetric/dsa.py | Python | apache-2.0 | 3,615 | 0 |
###############################################################################
# Copyright 2016 - Climate Research Division
# Environment and Climate Change Canada
#
# This file is part of the "EC-CAS diags" package.
#
# "EC-CAS diags" is free software: you can redistribute it and/or modify
# it under... | neishm/EC-CAS-diags | eccas_diags/diagnostics/movie_zonal.py | Python | lgpl-3.0 | 2,094 | 0.009551 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.