code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*-coding: utf-8 -*-
from zope.interface import implementer
from ..interfaces import (
IResourceType,
)
from ..resources import (
ResourceTypeBase,
)
@implementer(IResourceType)
class TransfersResource(ResourceTypeBase):
__name__ = 'transfers'
@property
def allowed_assign(self):
retur... | mazvv/travelcrm | travelcrm/resources/transfers.py | Python | gpl-3.0 | 327 |
# proxy module
from __future__ import absolute_import
from graphcanvas.api import *
| enthought/etsproxy | enthought/graphcanvas/api.py | Python | bsd-3-clause | 84 |
# coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import os
import six
import tarfile
import tempfile
import unittest
import uuid
import fs.test
import fs.wrap
import fs.errors
import fs.memoryfs
import fs.archive.tarfs
from fs import ResourceType
from fs.path i... | althonos/fs.archive | tests/test_tarfs.py | Python | mit | 5,643 |
"""parses configuration and returns useful things"""
#pylint: disable=relative-import
from etl_framework.BaseConfig import BaseConfig
from etl_framework.config_mixins.JobMixin import JobMixin
class JobConfig(BaseConfig,
JobMixin
):
"""parses configuration files"""
@property
def job_name(self):
... | pantheon-systems/etl-framework | etl_framework/configs/job.py | Python | mit | 354 |
# Univesity of Chicago,
# Feb 2, 2008
# Eric Olson
# adapted from home version written by Eric.
import traceback
class Trigger:
def __init__(self, name="DefaultTriggerName"):
self.name = name
class Response:
def __init__(self, name="GenericResponse", callback = None, firstArgs = []):
self.na... | rpwagner/tiled-display | flapp/RuleSystem/ruleSystem.py | Python | apache-2.0 | 2,756 |
import base64
import datetime
import decimal
import wsme.tests.protocol
try:
import simplejson as json
except ImportError:
import json # noqa
from wsme.rest.json import fromjson, tojson, parse
from wsme.utils import parse_isodatetime, parse_isotime, parse_isodate
from wsme.types import isarray, isdict, isus... | stackforge/wsme | wsme/tests/test_restjson.py | Python | mit | 26,007 |
import os.path
import sys
# This is copied from mytardis.py in the project's root directory.
custom_settings = 'tardis.settings'
custom_settings_file = custom_settings.replace('.', '/') + '.py'
demo_settings = 'tardis.settings_changeme'
if os.path.isfile(custom_settings_file):
os.environ.setdefault("DJANGO_SETTI... | carlohamalainen/imagetrove | develop/djangosettings.py | Python | bsd-2-clause | 573 |
# Copyright (C) 2009 Kevin Ollivier 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 above copyright
# notice, this list of conditions and th... | danialbehzadi/Nokia-RM-1013-2.0.0.11 | webkit/Tools/wx/build/settings.py | Python | gpl-3.0 | 15,679 |
from .adjoint import (
AbstractAdjoint,
BacksolveAdjoint,
NoAdjoint,
RecursiveCheckpointAdjoint,
)
from .brownian import AbstractBrownianPath, UnsafeBrownianPath, VirtualBrownianTree
from .global_interpolation import (
AbstractGlobalInterpolation,
backward_hermite_coefficients,
CubicInterpol... | patrick-kidger/diffrax | diffrax/__init__.py | Python | apache-2.0 | 1,867 |
import mysql.connector
cnx = mysql.connector.connect(database='Tuber_DB_A')
cursor = cnx.cursor()
query = ("SELECT t_name FROM Tutor, Student "
"WHERE t_key = s_key AND t.loc<=s.loc")
tutor_loc = t.loc
student_loc = s.loc
cursor.execute(query, (tutor_loc, student_loc))
for (t_name) in cursor:
print("{} ... | oscartu2/tuber | Location.py | Python | mit | 425 |
from django.conf.urls.defaults import *
from lingcod.heatmap.views import *
urlpatterns = patterns('',
url(r'^collection/geotiff/(?P<collection_uids>(\w+,?)+)/$', overlap_geotiff_response, name='heatmap-collection-geotiff'),
url(r'^collection/kmz/(?P<collection_uids>(\w+,?)+)/$', overlap_kmz_response, name='... | Alwnikrotikz/marinemap | lingcod/heatmap/urls.py | Python | bsd-3-clause | 348 |
#!/usr/bin/python
import math
def outlierCleaner(predictions, ages, net_worths):
"""
Clean away the 10% of points that have the largest
residual errors (difference between the prediction
and the actual net worth).
Return a list of tuples named cleaned_data where
each tuple... | seansu4you87/kupo | projects/MOOCs/udacity/ud120-ml/projects/outliers/outlier_cleaner.py | Python | mit | 753 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-09 14:06
from __future__ import unicode_literals
import grouprise.core.models
from django.db import migrations, models
import django
import grouprise.core
def no_validator(arg):
pass
def validate_reservation(value):
if value in ['gestalt', 'st... | stadtgestalten/stadtgestalten | grouprise/features/tags/migrations/0004_auto_20170209_1506.py | Python | agpl-3.0 | 2,921 |
from reportlab.pdfbase.pdfmetrics import _py_stringWidth
from _rl_accel import stringWidthU
import time
testCp1252 = 'copyright %s trademark %s registered %s ReportLab! Ol%s!' % (chr(169), chr(153),chr(174), chr(0xe9))
enc='cp1252'
assert stringWidthU('ABCDEF','Times-Roman',12)==_py_stringWidth('ABCDEF','Times-Roman',1... | TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/thirdparty/src/rl_addons/rl_accel/tests/t2.py | Python | gpl-3.0 | 746 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Documentation string"""
__authors__ = ["Person1", "Person2"]
__email__ = "person@mail"
__copyright__ = "Ole Herman Schumacher Elgesem"
__credits__ = ["Person1", "Person2", "Person3"]
__version__ = "0.1"
__license__ = "MIT"
# This file is subject to th... | fui/fui-kk | fui_kk/file_funcs.py | Python | mit | 1,533 |
import numpy as np
import pandas as pd
from trtools.monkey import patch
@patch(pd.MultiIndex)
def to_frame(self):
"""
Change a MultiIndex to a DataFrame with get level values
corresponding to a column
I could just reset_index on the DataFrame, but I keep on forgetting...
"""
names = [name or ... | dalejung/trtools | trtools/core/indexing.py | Python | mit | 480 |
# Copyright 2016 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... | Sorsly/subtle | google-cloud-sdk/lib/surface/app/operations/list.py | Python | mit | 1,674 |
"""
WSGI config for Mantenimiento project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Mantenimiento.settings")
from d... | timh52280/GestorDeMantenimiento | Mantenimiento/wsgi.py | Python | gpl-2.0 | 401 |
#!python
# -*- coding: utf-8 -*-
"""File: writer.py
Description:
This module contains a set of classes for writing to file system
History:
0.1.0 The first version.
"""
__version__ = '0.1.0'
__author__ = 'SpaceLis'
import threading, re, os, gzip, json
_MULTISLASH = re.compile(r'/+')
def new_fil... | spacelis/tcrawl | tcrawl/writer.py | Python | mit | 6,047 |
# pylint: disable=g-bad-file-header
# Copyright 2016 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/LICENS... | wangyum/tensorflow | tensorflow/python/training/monitored_session_test.py | Python | apache-2.0 | 53,128 |
# -*- coding: utf-8 -*-
import curses, traceback, sys
from django.core.management.base import BaseCommand
from isg.libcache import cache_stats, coa_counter, get_bras_last_update
from isg.models import Bras, CoaQueue
from os import getloadavg
from time import time, sleep
from www.models import UserNotificationRecord
S... | k-vinogradov/isgtool | isg/management/commands/isgstats.py | Python | gpl-2.0 | 4,421 |
def step1(player1, player2):
dice_rolls = 0
next_roll = 1
players = [player1, player2]
scores = [0, 0]
while True:
for i in range(0, len(players)):
total = 0
for j in range(0, 3):
total += next_roll
dice_rolls += 1
next_... | plilja/adventofcode | 2021/day21/day21.py | Python | gpl-3.0 | 1,653 |
##################################################################
# Copyright 2016 OSGeo Foundation, #
# represented by PyWPS Project Steering Committee, #
# licensed under MIT, Please consult LICENSE.txt for details #
####################################################... | ldesousa/PyWPS | pywps/processing/basic.py | Python | mit | 1,216 |
# Copyright 2015 NEC Corporation. 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 ... | vedujoshi/tempest | tempest/tests/lib/services/compute/test_quotas_client.py | Python | apache-2.0 | 5,564 |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
... | ake-koomsin/mapnik_nvpr | scons/scons-local-2.2.0/SCons/compat/_scons_collections.py | Python | lgpl-2.1 | 1,905 |
#!python
#!/usr/bin/env python
from kivy.app import App
from kivy.clock import Clock
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from functools import partial
class Test(App):
def create_clock(self, widget, touch, *args):
callback... | ForAP/Advanc3d-Pr0graming | A5-Tree/A5-Updated/longtouch.py | Python | gpl-2.0 | 1,241 |
# Generated by Django 2.2.10 on 2020-04-06 01:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('order', '0017_auto_20200331_1000'),
]
operations = [
migrations.RenameField(
model_name='purchaseorder',
old_name='URL',
... | inventree/InvenTree | InvenTree/order/migrations/0018_auto_20200406_0151.py | Python | mit | 364 |
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
import os, sys
fileNodes = open("listNodes.txt", "r+")
fileAddr = open("addrList.txt", "w+")
nodesReq = fileNodes.read(); #Le todos os dados para separar os enderecos dos nos visiveis
#print nodesReq.split("|-", 8)
for line in nodesReq.split("|-"):
#print line
if li... | vitorcezli/IoT | Apresentacao/Python n Bash Scripts/addrNodeExtractor.py | Python | gpl-3.0 | 480 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example file to run initial checks on the csv files.
:copyright:
The PDART Development Team & Ceri Nunn
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
from __future__ import (absolute_import, division, ... | cerinunn/pdart | examples/run_csv_join_1975.py | Python | lgpl-3.0 | 1,740 |
import pytest
from app import app as testable_app
@pytest.fixture
def app():
return testable_app
@pytest.fixture
def client(app):
return app.test_client()
| jaapz/flask-boilerplate | tests/conftest.py | Python | mit | 168 |
# Copyright 2014 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 agre... | dhamaniasad/caniusepython3 | caniusepython3/test/test_check.py | Python | apache-2.0 | 2,344 |
import os
import unittest
from vsg.rules import type_definition
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_006_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path.join(sT... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/type_definition/test_rule_006.py | Python | gpl-3.0 | 1,173 |
from a10sdk.common.A10BaseClass import A10BaseClass
class Authentication(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param encrypted: {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password st... | amwelch/a10sdk-python | a10sdk/core/interface/interface_ethernet_bfd.py | Python | apache-2.0 | 3,740 |
#!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],... | direvus/ansible | lib/ansible/modules/network/sros/sros_config.py | Python | gpl-3.0 | 10,134 |
from django import http
from django.conf import settings
from django.shortcuts import get_object_or_404
import jingo
from tags.models import Tag
def top_cloud(request, num_tags=100):
"""Display 100 (or so) most used tags"""
"""TODO (skeen) Need to take request.APP.id into account, first
attempts to do... | wagnerand/zamboni | apps/tags/views.py | Python | bsd-3-clause | 621 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
# Standard Library Imports
from hashlib import sha1
import sqlite3
import time
import os
try:
# noinspection PyPep8Naming
import cPickle as pickle
except ImportError: # pragma: no cover
import pickle
# Package imports
from codequick.script i... | willforde/script.module.codequick | script.module.codequick/lib/codequick/storage.py | Python | gpl-2.0 | 10,495 |
# Copyright 2015 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... | karllessard/tensorflow | tensorflow/python/kernel_tests/embedding_ops_test.py | Python | apache-2.0 | 47,158 |
import argparse
import structlog
import logging
from pyramid.paster import get_app
from snovault.elasticsearch.create_mapping import run as run_create_mapping
from dcicutils.log_utils import set_logging
from dcicutils.deployment_utils import CreateMappingOnDeployManager
log = structlog.getLogger(__name__)
EPILOG = _... | hms-dbmi/fourfront | src/encoded/commands/create_mapping_on_deploy.py | Python | mit | 5,218 |
# -*- coding: utf-8 -*-
from django.utils.timezone import now
from datetime import date
from cl.people_db.models import Position
def process_date(year,month,day):
"""
return date object and accompanying granularity
"""
if year is None:
pdate = None
granularity = None
elif month is... | voutilad/courtlistener | cl/people_db/import_judges/add_chief_status.py | Python | agpl-3.0 | 1,914 |
# Tricky initialization problem involving multiple inheritance.
# Does NOT use super()
class Base:
def __init__(self):
print('Base.__init__')
class A(Base):
def __init__(self):
Base.__init__(self)
print('A.__init__')
class B(Base):
def __init__(self):
Base.__init__(self)
... | tuanavu/python-cookbook-3rd | src/8/calling_a_method_on_a_parent_class/example4.py | Python | mit | 554 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-14 17:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('feer', '0002_orderlist_name'),
]
operations = [
migrations.AlterField(
... | mKaloer/Feer-Club | feer_club/feer/migrations/0003_auto_20160114_1836.py | Python | apache-2.0 | 462 |
from nosuch.midiutil import *
from nosuch.midifile import *
if __name__ == '__main__':
if len(sys.argv) < 2:
print "Usage: midiprint {filename}"
sys.exit(1)
fname = sys.argv[1]
# Read the midifile
p = Phrase.fromMidiFile(fname)
# Schedule the notes of the midifile on the output
for n in p:
print n
| nosuchtim/VizBench | src/midiutil/midiprint.py | Python | mit | 316 |
# Copyright (C) 2010-2011 Hideo Hattori
# Copyright (C) 2011-2013 Hideo Hattori, Steven Myint
# Copyright (C) 2013-2014 Hideo Hattori, Steven Myint, Bill Wendling
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to... | youtube/cobalt | third_party/blink/Tools/Scripts/webkitpy/thirdparty/autopep8.py | Python | bsd-3-clause | 121,323 |
# properties.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""MapperProperty implementations.
This is a private module which defines the beha... | obeattie/sqlalchemy | lib/sqlalchemy/orm/properties.py | Python | mit | 53,292 |
#!/usr/bin/env python
'''
@author Luke Campbell <LCampbell@ASAScience.com>
@file pyon/ion/streamdef.py
@date Thu Jul 5 14:40:49 EDT 2012
@description Utility for managing stream definitions
'''
from lxml import etree
class StreamDef(object):
def __init__(self, xml_string):
self._element = etree.fromstri... | ooici/pyon | pyon/ion/streamdef.py | Python | bsd-2-clause | 876 |
"""empty message
Revision ID: 49b16673ebeb
Revises:
Create Date: 2018-03-05 23:44:08.620582
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '49b16673ebeb'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gener... | gems-uff/labsys | migrations/versions/2018-03-05_23:44:08__49b16673ebeb.py | Python | mit | 17,918 |
import discord
from discord.ext import commands
import traceback
import psycopg2
class PermManage:
def __init__(self, bot):
self.bot = bot
self.bot.get_permission = self.get_permission
self.bot.set_permission = self.set_permission
# Based on https://stackoverflow.com/a/18708605/328689... | aveao/AveBot | cogs/permissionmanage.py | Python | mit | 7,156 |
# Copyright 2018 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... | theflofly/tensorflow | tensorflow/python/keras/engine/training_utils.py | Python | apache-2.0 | 61,556 |
import binascii
import pytest
from stellar_sdk.asset import Asset
from stellar_sdk.exceptions import SignatureExistError
from stellar_sdk.keypair import Keypair
from stellar_sdk.memo import IdMemo
from stellar_sdk.network import Network
from stellar_sdk.operation import ManageData, Payment
from stellar_sdk.time_bound... | StellarCN/py-stellar-base | tests/test_transaction_envelope.py | Python | apache-2.0 | 4,632 |
from __future__ import print_function
import IMP
import IMP.test
import io
import random
class DummyRestraint(IMP.Restraint):
"""Dummy do-nothing restraint"""
def __init__(self, m, ps=[], cs=[], name="DummyRestraint %1%"):
IMP.Restraint.__init__(self, m, name)
self.ps = ps
self.cs = ... | shanot/imp | modules/kernel/test/test_model.py | Python | gpl-3.0 | 9,167 |
# -*- coding: utf-8 -*-
#
from users.models import User
class UserQuerysetMixin:
def get_queryset(self):
queryset = User.get_org_users()
return queryset
| jumpserver/jumpserver | apps/users/api/mixins.py | Python | gpl-3.0 | 175 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import flocsweb.mixins
class Migration(migrations.Migration):
dependencies = [
('tasks', '0005_toolbox'),
]
operations = [
migrations.CreateModel(
name='Level',
... | adaptive-learning/flocs-web | tasks/migrations/0006_level.py | Python | gpl-3.0 | 576 |
# =============================================================================
# Copyright [2013] [Kevin Carter]
# License Information :
# This software has no warranty, it is provided 'as is'. It is your
# responsibility to validate the behavior of the routines and its accuracy
# using the code provided. Consult the ... | cloudnull/tribble-api | tribble/engine/constructor.py | Python | gpl-3.0 | 13,205 |
from .. import config
from .. import util
from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver
from datetime import datetime, timedelta
import time
import tempfile
import os
import getpass
from random import random
from glob import glob
import shutil
import atexit
MODULE_NAME = __n... | bmccary/utd | utd/coursebook/__init__.py | Python | mit | 12,073 |
class XpathValidationError(Exception):
"""
When an error occurs in the process of xpath validation
(NOT when an xpath is invalid)
"""
pass
| qedsoftware/commcare-hq | corehq/apps/app_manager/xpath_validator/exceptions.py | Python | bsd-3-clause | 159 |
import asyncio
import configparser
import logging
import common.protocol as protocol
from common.service import AbstractService
from kspconn.kspconn import KSPConnection
class Commander(AbstractService):
def __init__(self, config):
self.kspconnection = KSPConnection(config, commander=self)
super(... | fayoh/KSP-Control | commander/commander.py | Python | mit | 1,668 |
# -*- coding: UTF-8 -*-
# by Mafarricos
# email: MafaStudios@gmail.com
# This program is free software: GNU General Public License
import xbmcplugin,xbmcgui,xbmc,xbmcaddon,os,threading,re,urllib,json,time
from BeautifulSoup import BeautifulSoup
from resources.libs import links,tmdb,imdb,trakt,rottentomatoes,youtube,b... | Mafarricos/Mafarricos-xbmc-addons | plugin.video.moviereleases/main.py | Python | gpl-2.0 | 19,311 |
"""
ACTIVE Plugin for Testing for HTTP Methods and XST (OWASP-CM-008)
"""
from framework.dependency_management.dependency_resolver import ServiceLocator
DESCRIPTION = "Active probing for HTTP methods"
def run(PluginInfo):
target = ServiceLocator.get_component("target")
URL = target.Get('top_url')
# TOD... | DarKnight24/owtf | plugins/web/active/HTTP_Methods_and_XST@OWTF-CM-008.py | Python | bsd-3-clause | 741 |
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | nagyistoce/netzob | test/src/test_netzob/test_Common/test_Type/test_Endianess.py | Python | gpl-3.0 | 2,233 |
from __future__ import division
import sys
import os
import matplotlib.pyplot as plt
import scipy
from scipy import special
mydir = os.path.expanduser("~/")
sys.path.append(mydir + "/GitHub/PeasantMath/Roots/code")
import functions as fxn
ks = [2, 3, 4, 5, 6, 7, 8, 9, 10, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5... | websterkgd/PeasantMath | Roots/code/Roots.py | Python | cc0-1.0 | 3,247 |
# -*- 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... | OSSESAC/odoopubarquiluz | addons/point_of_sale/point_of_sale.py | Python | agpl-3.0 | 67,967 |
from collections import defaultdict
from gi.repository import Gtk, GObject
POSITIONS_COUNT = 5
NORTH, EAST, SOUTH, WEST, CENTER = range(POSITIONS_COUNT)
reprPos = ("NORTH", "EAST", "SOUTH", "WEST", "CENTER")
class TabReceiver(Gtk.Alignment):
__instances = defaultdict(list)
def __init__(self, perspective):... | pychess/pychess | lib/pychess/widgets/pydock/__init__.py | Python | gpl-3.0 | 841 |
# -*- test-case-name: twisted.conch.test.test_userauth -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of the ssh-userauth service.
Currently implemented authentication types are public-key and password.
Maintainer: Paul Swartz
"""
import struct, warnings
from... | Donkyhotay/MoonPy | twisted/conch/ssh/userauth.py | Python | gpl-3.0 | 29,730 |
# -*- coding: utf-8 -*-
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# ... | taxpon/sverchok | sockets.py | Python | gpl-3.0 | 4,502 |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | calexil/FightstickDisplay | pyglet/font/freetype.py | Python | gpl-3.0 | 13,268 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | jacquerie/inspire-dojson | inspire_dojson/hep/rules/bd0xx.py | Python | gpl-3.0 | 12,752 |
# -*- coding: utf-8 -*-
from tasty import state, config
class blah(object):
pass
state.config = config.create_configuration(
host="::1",
port=8000,
security_level = "short",
asymmetric_security_parameter = 1024,
symmetric_security_parameter = 80,
protocol_dir = "",
)
import unittest
import c... | tastyproject/tasty | tasty/tests/unittests/types_tests.py | Python | gpl-3.0 | 24,411 |
"""
homeassistant.components.apcupsd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets up and provides access to the status output of APCUPSd via its Network
Information Server (NIS).
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/apcupsd/
"""
import logging
from d... | nnic/home-assistant | homeassistant/components/apcupsd.py | Python | mit | 2,231 |
"""The test for light device automation."""
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.light import DOMAIN
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON
from homeassistant.helpers import device_registry
from homeassistant.setup import async... | leppa/home-assistant | tests/components/light/test_device_action.py | Python | apache-2.0 | 4,502 |
# Copyright 2011 Grid Dynamics
# 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.apache.org/licenses... | badock/nova | nova/tests/api/openstack/compute/contrib/test_networks.py | Python | apache-2.0 | 25,942 |
# default values
DEFAULT_REQUEST_TIMEOUT = 60
JSON_RESPONSE_FORMAT = 'json'
DEFAULT_PHONE_LENGTH = 10
DEFAULT_PROFILE_ID_LENGTH = 30
MAX_PLATFORM_USERNAME_LENGTH = 200
DEFAULT_USER_AGENT = 'nextcaller/python/0.0.1'
JSON_CONTENT_TYPE = 'application/json; charset=utf-8'
# urls
DEFAULT_API_VERSION = '2'
BASE_URL = 'https... | trezorg/nextcaller-python-api | pynextcaller/constants.py | Python | mit | 657 |
# coding: utf-8
# python imports
from functools import wraps
# try to use json (2.6+) but stay compatible with 2.5.*
try:
import json
except ImportError:
from django.utils import simplejson as json
try:
from django.contrib.auth import get_user_model
User = get_user_model()
except ImportError:
fro... | dahool/vertaal | grappelli/templatetags/grp_tags.py | Python | gpl-3.0 | 5,887 |
#coding=utf-8
import tornado.web
import tornado.ioloop
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write('<html><body><form action= "/" method = "post">'
'<input type="text" name="message">'
'<input type="submit" value="submit">'
'</form></body></html>'
)
def post... | imyouxia/LearnTornado | UrlPath.py | Python | mit | 1,111 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
IMAGE -> MATRIX
Use imgmap.py with mapimg.py
Tested with trasparent, white, black "png" and "jpeg".
All images in folder with default color.
$ imgmap.py test.png | mapimg.py
Args.
$ imgmap.py test.png | mapimg.py 222,0,222,220
Stdin without imgmap.py.
echo '[[1,1,0... | schwarzbox/Tools-Python3 | mapimg.py | Python | mit | 3,929 |
# -*- coding: utf-8 -*-
"""
pybitcoin
~~~~~
:copyright: (c) 2016 by Halfmoon Labs, Inc.
:license: MIT, see LICENSE for more details.
"""
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from commontools import log, error_reply
from .. import SATOSHIS_PER_COIN
from .. import script_h... | blockstack/pybitcoin | pybitcoin/rpc/bitcoind_client.py | Python | mit | 4,394 |
# Copyright 2019 Nexenta by DDN, 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 requ... | openstack/manila | manila/tests/share/drivers/nexenta/ns5/test_nexenta_nas.py | Python | apache-2.0 | 22,295 |
from operator import itemgetter
from heapq import nlargest
from itertools import repeat, ifilter
class Counter(dict):
'''Dict subclass for counting hashable objects. Sometimes called a bag
or multiset. Elements are stored as dictionary keys and their counts
are stored as dictionary values.
>>> Coun... | andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/tornadoredis/backports.py | Python | gpl-2.0 | 6,201 |
import simplejson
from flask import request
from common import render
from app.api import api
from app.models.log import Log
@api.route('/logs', methods=['POST'])
def get_user():
data = simplejson.loads(request.data)
app_id = data.get('app_id', None)
level = data.get('level', None)
log_type = data.ge... | wemoo/wemoo-center | app/api/logs.py | Python | mit | 579 |
read("../d.nex")
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=1)
t.setPInvar(free=0, val=0.0)
m = Mcmc(t, nChains=1, runNum=0, sampleInterval=10, checkPointInterval=2000)
# Set up a strong prior on polytomi... | pgfoster/p4-phylogenetics | share/Examples/L_mcmc/D_withPolytomyPrior/sMcmc.py | Python | gpl-2.0 | 515 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | toomoresuch/pysonengine | parts/google_appengine/google/appengine/ext/mapreduce/main.py | Python | mit | 2,349 |
# coding: utf-8
"""
BuildconfigsetrecordsApi.py
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unl... | thauser/pnc-cli | pnc_cli/swagger_client/apis/buildconfigsetrecords_api.py | Python | apache-2.0 | 10,700 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from abc import ABC, abstractmethod
from pants.base.exceptions import TaskError
class Engine(ABC):
"""An engine for running a pants command line."""
def execute(self, context, ... | wisechengyi/pants | src/python/pants/engine/legacy_engine.py | Python | apache-2.0 | 1,345 |
import tempfile
from celery.schedules import crontab
class Config(object):
SECRET_KEY = '736670cb10a600b695a55839ca3a5aa54a7d7356cdef815d2ad6e19a2031182b'
RECAPTCHA_PUBLIC_KEY = "6LdKkQQTAAAAAEH0GFj7NLg5tGicaoOus7G9Q5Uw"
RECAPTCHA_PRIVATE_KEY = '6LdKkQQTAAAAAMYroksPTJ7pWhobYb88fTAcxcYn'
CELERYBEAT_SC... | nikitabrazhnik/flask2 | Module 3/Chapter12/chapter_12/webapp/config.py | Python | mit | 1,609 |
# Copyright (c) 2017 NEC Corporation. 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 requi... | noironetworks/neutron | neutron/tests/unit/extensions/test_data_plane_status.py | Python | apache-2.0 | 5,851 |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Top-level namespace for ants."""
# Registraiton programs
from .registration import ANTS, Registration
# Resampling Programs
from .resampling import (ApplyTransforms, ApplyTrans... | carolFrohlich/nipype | nipype/interfaces/ants/__init__.py | Python | bsd-3-clause | 852 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from .request import (
Request,
)
from .response import (
FileResponse,
HtmlResponse,
JsonResponse,
Response,
template_or_json_response,
TemplateResponse,
TerminatingResponse,
wrapped_template_... | CorverDevelopment/Poort | src/poort/__init__.py | Python | mit | 1,121 |
# 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... | GabrielBrascher/cloudstack | systemvm/test/TestCsDhcp.py | Python | apache-2.0 | 1,216 |
#!/usr/bin/env python
import logging
def get_notification_facts(issuewrapper, meta, botmeta=None):
'''Build facts about mentions/pings'''
iw = issuewrapper
nfacts = {
u'to_notify': [],
u'to_assign': []
}
if botmeta and not botmeta.get(u'notifications', False):
return nfa... | jctanner/ansibullbot | ansibullbot/triagers/plugins/notifications.py | Python | gpl-3.0 | 1,955 |
#***************************************************************************
#* *
#* Copyright (c) 2016 Juan Vanyo Cerda <juavacer@inf.upv.es> *
#* *
#* This pr... | juanvanyo/FreeCAD-GDT | datumFeature.py | Python | lgpl-2.1 | 4,011 |
#!/usr/bin/python
import json
import time
import urllib
import urllib2
def add_encode():
obj = {
'CreatedTimestamp': int(time.time()),
'LastUpdatedTimestamp': int(time.time()),
'Profile': 'FireTV',
'Priority': 1,
'Status': 'Pending',
'ShouldStop': False,
'Pe... | rickbassham/videoencode | test.py | Python | mit | 1,430 |
# 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.
DEPS = [
'chromium',
'chromium_android',
'file',
'gsutil',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/python',
... | eunchong/build | scripts/slave/recipe_modules/amp/__init__.py | Python | bsd-3-clause | 375 |
# Copyright 2010-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.apache.org/licenses/LICENSE-2.0
#
# Unless... | redhat-openstack/glance | glance/tests/utils.py | Python | apache-2.0 | 18,667 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "omnomer.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ImmaculateObsession/omnomer | src/omnomer/manage.py | Python | mit | 250 |
# Configuration file for ipython-notebook.
c = get_config()
#------------------------------------------------------------------------------
# NotebookApp configuration
#------------------------------------------------------------------------------
# NotebookApp will inherit config from: BaseIPythonApplication, Applic... | mlhenderson/narrative | kbase-extension/jupyter_notebook_config.py | Python | mit | 20,680 |
"""Generate an integration."""
from pathlib import Path
from .model import Info
TEMPLATE_DIR = Path(__file__).parent / "templates"
TEMPLATE_INTEGRATION = TEMPLATE_DIR / "integration"
TEMPLATE_TESTS = TEMPLATE_DIR / "tests"
def generate(template: str, info: Info) -> None:
"""Generate a template."""
print(f"S... | GenericStudent/home-assistant | script/scaffold/generate.py | Python | apache-2.0 | 6,276 |
from libsaas import http, parsers
from libsaas.services import base
from .resource import (
serialize_param, TrelloFieldMixin, TrelloFilterMixin,
TrelloResource, TrelloCollection,
TrelloReadonlyResource, TrelloReadonlyCollection)
class Actions(TrelloReadonlyCollection):
path = 'actions'
class Board... | ducksboard/libsaas | libsaas/services/trello/organizations.py | Python | mit | 2,483 |
"""Tests for Plex config flow."""
import copy
from http import HTTPStatus
import ssl
from unittest.mock import patch
import plexapi.exceptions
import pytest
import requests.exceptions
from homeassistant.components.plex import config_flow
from homeassistant.components.plex.const import (
AUTOMATIC_SETUP_STRING,
... | rohitranjan1991/home-assistant | tests/components/plex/test_config_flow.py | Python | mit | 28,132 |
from PyQt5.QtWidgets import (QWidget, QListWidget, QListView, QStackedLayout,
QTabWidget, QStackedWidget, QPushButton, QVBoxLayout,
QDialog, QHBoxLayout, QCheckBox, QListWidgetItem,
QShortcut, QMessageBox)
from PyQt5.QtCore import Q... | s0hvaperuna/music-player | src/gui/settings.py | Python | mit | 4,744 |
from django.contrib import admin
from .models import SEO
admin.site.register(SEO) | omerturner/manakinproducts | seo/admin.py | Python | mit | 83 |
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2012 Intel Corporation. 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 sou... | klim-iv/phantomjs-qt5 | src/webkit/Source/WebCore/inspector/CodeGeneratorInspector.py | Python | bsd-3-clause | 98,207 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.