code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
from sys import stdin
def readLine():
return stdin.readline().strip()
def readInt():
return int(readLine())
def readInts():
return list(map(int, readLine().split()))
def main():
T = readInt()
for i in range(T):
pages = [{'url': None, 'v': 0} for j in range(10)]
for j in range(10):
pages[j]['url'], pag... | mikebsg01/Contests-Online | UVa/12015-GoogleisFeelingLucky.py | Python | mit | 604 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from views import HomeView, SimpleChainView, MultipleChainView, ModelChainView, EditCarView, DeleteCarView, \
AjaxChainedNames, AjaxChainedCountries, AjaxCh... | PragmaticMates/django-clever-selects | example/example/urls.py | Python | mit | 1,638 |
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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) ... | flaing/gemrb | gemrb/GUIScripts/iwd2/Start.py | Python | gpl-2.0 | 6,550 |
'''
StringUtils.py
Provides methods that ease complex python string operations
Copyright (C) 2013 Timothy Edmund Crosley
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; eit... | timothycrosley/WebBot | instant_templates/update_webbot_appengine/WebElements/StringUtils.py | Python | gpl-2.0 | 7,945 |
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2013 The Chromium OS Authors.
#
import multiprocessing
import os
import shutil
import subprocess
import sys
from buildman import board
from buildman import bsettings
from buildman import toolchain
from buildman.builder import Builder
from patman import command
from ... | Digilent/u-boot-digilent | tools/buildman/control.py | Python | gpl-2.0 | 14,941 |
MOCK_PREFIX = "Mock_"
FAKE_PREFIX = "Fake_"
FAKE_ND_PREFIX = "FakeND_"
VOODOO_CALL = "__voodooCall"
def mockClass( identifier ):
return MOCK_PREFIX + identifier
def fakeClass( identifier ):
return FAKE_PREFIX + identifier
def fakeNDClass( identifier ):
return FAKE_ND_PREFIX + identifier
def templateLine( templat... | smsisko/Voodoo-Mock | voodoo/voodoodefs.py | Python | gpl-2.0 | 538 |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2009 Team FoFiX ... | mecwerks/fofix | src/audio/Microphone.py | Python | gpl-2.0 | 8,551 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2013 CERN.
#
# 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 th... | CERNDocumentServer/invenio | modules/bibfield/lib/functions/check_field_existence.py | Python | gpl-2.0 | 4,158 |
#! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | simark/simulavr | regress/test_opcodes/test_SUB.py | Python | gpl-2.0 | 3,851 |
# Generated by Django 2.2.10 on 2020-02-06 04:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0024_auto_20191118_1612'),
]
operations = [
migrations.AlterField(
model_name='user',
name='source',
... | skyoo/jumpserver | apps/users/migrations/0025_auto_20200206_1216.py | Python | gpl-2.0 | 534 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | rkashapov/buildbot | master/buildbot/reporters/gerrit.py | Python | gpl-2.0 | 15,470 |
# Copyright (C) 2010 Oregon State University et al.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program i... | dmS0Zq/ganeti_webmgr | ganeti_webmgr/ganeti_web/views/importing.py | Python | gpl-2.0 | 7,249 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2016, F5 Networks Inc.
# 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',
... | veger/ansible | lib/ansible/modules/network/f5/bigip_routedomain.py | Python | gpl-3.0 | 22,327 |
# External Attribute Skeleton
#
# Input: Multi-trace, single attribute
# Output: Single attribute
#
import sys,os
import numpy as np
#
# Import the module with the I/O scaffolding of the External Attribute
#
sys.path.insert(0, os.path.join(sys.path[0], '..'))
import extattrib as xa
#
# The attribute parameters - keep ... | waynegm/OpendTect-Plugins | bin/python/wmpy/Skeletons/ex_multi_trace_single_attribute_input_single_output.py | Python | gpl-3.0 | 2,619 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'exp_std.ui'
#
# Created: Sat Apr 18 15:55:49 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attrib... | jithinbp/vLabtool-v0 | v0/templates/template_exp_standalone.py | Python | gpl-3.0 | 4,665 |
#!/usr/bin/python
# Copyright (c) 2016 Thomas Stringer, <tomstr@microsoft.com>
# 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',
... | caphrim007/ansible | lib/ansible/modules/cloud/azure/azure_rm_loadbalancer.py | Python | gpl-3.0 | 36,330 |
# coding=utf-8
"""Postprocessors."""
# noinspection PyUnresolvedReferences
from qgis.core import QgsFeatureRequest
from safe.definitions.minimum_needs import minimum_needs_parameter
from safe.gis.vector.tools import (
create_field_from_definition, SizeCalculator)
from safe.processors import (
field_input_ty... | Charlotte-Morgan/inasafe | safe/impact_function/postprocessors.py | Python | gpl-3.0 | 13,430 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class Partner(models.Model):
_inherit = 'res.partner'
team_id = fields.Many2one('crm.team', string='Sales Team', oldname='section_id')
opportunity_ids = fields.One2man... | t3dev/odoo | addons/crm/models/res_partner.py | Python | gpl-3.0 | 2,508 |
import unittest
from cvxpy import *
import numpy as np
from cvxpy.tests.base_test import *
import scipy.sparse as sp
class TestLinOps(BaseTest):
def assertDataEqual(self, original_data, canon_data):
for key in ['A', 'b', 'c', 'G', 'h']:
M1, M2 = original_data[key], canon_data[key]
... | SteveDiamond/cvxpy | cvxpy/cvxcore/tests/python/test_linops.py | Python | gpl-3.0 | 9,122 |
from __future__ import (absolute_import, division, print_function)
import unittest
import platform
import numpy as np
from mantid.simpleapi import VesuvioThickness
from mantid.api import ITableWorkspace
class VesuvioThicknessTest(unittest.TestCase):
#----------------------------------Algorithm tests----------------... | dymkowsk/mantid | Framework/PythonInterface/test/python/plugins/algorithms/VesuvioThicknessTest.py | Python | gpl-3.0 | 3,285 |
#!/usr/bin/env python
# by teknohog
# Python wrapper for Xilinx Serial Miner
# Host/user configuration is NOT USED in ltctestmode.py ...
# host = "localhost" # Stratum Proxy alternative
# user = "username.1" # Your worker goes here
# password = "password" # Worker password, NOT your account password
# http_port = "8... | ychaim/FPGA-Litecoin-Miner | experimental/LX150-EIGHT-B/ltcminer-test-dynclock.py | Python | gpl-3.0 | 8,949 |
"""
This file contains celery tasks related to course content gating.
"""
import logging
from celery import shared_task
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from edx_django_utils.monitoring import set_code_owner_attribute
from opaque_keys.edx.keys import Cou... | eduNEXT/edx-platform | lms/djangoapps/gating/tasks.py | Python | agpl-3.0 | 2,793 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 Pexego (<www.pexego.es>). All Rights Reserved
# $Omar Castiñeira Saavedra$
#
# This program is free software: you can redistribute it ... | Pexego/sale_commission | __unported__/full_stock_traceability/mrp_production.py | Python | agpl-3.0 | 4,398 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api, _
import ... | maljac/odoo-addons | account_voucher_withholding/models/account_voucher_withholding.py | Python | agpl-3.0 | 2,439 |
# -*- coding: utf-8 -*-
import time
from ..utils.purge import uniquify
class EventManager:
def __init__(self, core):
self.pyload = core
self._ = core._
self.clients = []
def new_client(self, uuid):
self.clients.append(Client(uuid))
def clean(self):
for n, client... | vuolter/pyload | src/pyload/core/managers/event_manager.py | Python | agpl-3.0 | 3,084 |
from decimal import Decimal
import re
import web
r_row = re.compile(r'<tr>(.*?)</tr>', re.S)
r_td = re.compile(r'<td v[^>]+>([^<]*)</td>')
r_member = re.compile(r'member=([^"]+)">([^<]+)<')
def fixdec(d):
d = d.strip()
return Decimal(d) and Decimal(d)/100
def parse_doc(d):
for row in r_row.findall(d):
... | aaronsw/watchdog | import/parse/punch.py | Python | agpl-3.0 | 1,090 |
# Copyright 2013-2020 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 RReprex(RPackage):
"""Convenience wrapper that uses the 'rmarkdown' package to render smal... | rspavel/spack | var/spack/repos/builtin/packages/r-reprex/package.py | Python | lgpl-2.1 | 1,861 |
# -*- coding: utf-8 -*-
"""Mapnik classes to assist in creating printable maps
basic usage is along the lines of
import mapnik
page = mapnik.printing.PDFPrinter()
m = mapnik.Map(100,100)
mapnik.load_map(m, "my_xml_map_description", True)
m.zoom_all()
page.render_map(m,"my_output_file.pdf")
see the documentation of... | garnertb/python-mapnik | mapnik/printing.py | Python | lgpl-2.1 | 46,084 |
# coding: utf-8
from __future__ import unicode_literals
import itertools
import re
from .common import (
InfoExtractor,
SearchInfoExtractor
)
from ..compat import (
compat_HTTPError,
compat_kwargs,
compat_str,
compat_urlparse,
)
from ..utils import (
error_to_compat_str,
ExtractorError... | Orochimarufan/youtube-dl | youtube_dl/extractor/soundcloud.py | Python | unlicense | 29,898 |
from django.utils.translation import ugettext
import accounts.payment_plans as plans
from . import query
from .constants import SOURCE_MAP
from .formatter import Format
from .util import country_code_map, restrict, specific_location_timeframe
from accounts.models import UserSettings
from pinecast.helpers import revers... | Pinecast/pinecast | analytics/views_podcast.py | Python | apache-2.0 | 6,182 |
#!/usr/bin/env python2
'''
Unit tests for yedit
'''
# To run
# python -m unittest yedit_test
#
# .............................
# ----------------------------------------------------------------------
# Ran 29 tests in 0.133s
# OK
import os
import sys
import unittest
# Removing invalid variable names for tests so tha... | tiwillia/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.5/roles/lib_utils/src/test/unit/yedit_test.py | Python | apache-2.0 | 10,224 |
from nose.tools import ok_
def fail(msg):
raise AssertionError(msg)
def assert_in(thing, seq, msg=None):
msg = msg or "'%s' not found in %s" % (thing, seq)
ok_(thing in seq, msg)
def assert_not_in(thing, seq, msg=None):
msg = msg or "unexpected '%s' found in %s" % (thing, seq)
ok_(thing not in... | rcbops/python-novaclient-buildpackage | tests/v1_1/utils.py | Python | apache-2.0 | 814 |
import os
import sys
d = os.path.dirname(os.getcwd())
sys.path.append(d)
from pychron.core.ui import set_toolkit
set_toolkit('qt4')
#e=ExportSpec(p='/Users/ross/Sandbox/aaaa_isotopes.h5')
#for iso,det in
#
#from pychron.core.ui.dialogs import myConfirmationDialog
#
#from traits.api import HasTraits, Button
#from... | USGSDenverPychron/pychron | sandbox/export_spec.py | Python | apache-2.0 | 732 |
# Copyright 2011 OpenStack LLC.
# 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 b... | superstack/nova | nova/api/openstack/users.py | Python | apache-2.0 | 3,531 |
# 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... | neilhan/tensorflow | tensorflow/python/framework/ops.py | Python | apache-2.0 | 150,185 |
# coding: utf-8
#
# Copyright 2017 The Oppia 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 requi... | himanshu-dixit/oppia | core/domain/question_services_test.py | Python | apache-2.0 | 4,658 |
#! /usr/bin/env python
#
# Copyright 2012 Vaibhav Bajpai <contact@vaibhavbajpai.com>
# Copyright 2009 Shikhar Bhushan <shikhar@schmizz.net>
#
# Create a new user to the running configuration using edit-config
# and the test-option provided by the :validate capability.
#
# $ ./nc04.py cook bob 42 42
import sys, os, war... | Kent1/ncclient | examples/nc04.py | Python | apache-2.0 | 3,827 |
import sys
sys.path.insert(1, "../../../")
import h2o
import numpy as np
def wide_dataset_large(ip,port):
print("Reading in Arcene training data for binomial modeling.")
trainDataResponse = np.genfromtxt(h2o.locate("smalldata/arcene/arcene_train_labels.labels"), delimiter=' ')
trainDataResponse ... | PawarPawan/h2o-v3 | h2o-py/tests/testdir_algos/glm/pyunit_wide_dataset_largeGLM.py | Python | apache-2.0 | 1,540 |
# 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... | snyderr/robotframework | src/robot/reporting/stringcache.py | Python | apache-2.0 | 1,574 |
#
# 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 us... | aokolnychyi/spark | python/pyspark/sql/context.py | Python | apache-2.0 | 24,880 |
"""Device tracker helpers."""
import asyncio
from typing import Dict, Any, Callable, Optional
from types import ModuleType
import attr
from homeassistant.core import callback
from homeassistant.setup import async_prepare_setup_platform
from homeassistant.helpers import config_per_platform
from homeassistant.exception... | joopert/home-assistant | homeassistant/components/device_tracker/setup.py | Python | apache-2.0 | 6,277 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='User',
... | WimpyAnalytics/django-andablog | demo/common/migrations/0001_initial.py | Python | bsd-2-clause | 2,365 |
"""Update models to avoid uniqueness errors
Revision ID: 4148c3cb14ad
Revises: 21e927fdf78c
Create Date: 2015-04-24 23:27:26.628208
"""
# revision identifiers, used by Alembic.
revision = '4148c3cb14ad'
down_revision = '21e927fdf78c'
import hashlib
from alembic import op
import sqlalchemy as sa
import sqlalchemy.sq... | go-lab/appcomposer | alembic/versions/4148c3cb14ad_update_models_to_avoid_uniqueness_errors.py | Python | bsd-2-clause | 1,977 |
#!/usr/bin/python
from appcomposer.translator.tasks import cel
import sys
cel.worker_main(sys.argv + ['--concurrency=1', '--queues=single-sync-tasks'])
| porduna/appcomposer | run_celery_single_queue.py | Python | bsd-2-clause | 153 |
from __future__ import absolute_import
from __future__ import division
from peachpy import *
from peachpy.x86_64 import *
from common import butterfly, sqrt2_over_2
from common import butterfly, sqrt2_over_2, cos_npi_over_8, interleave
def fft8_bitreverse(n):
return int(format(n, "03b")[::-1], 2)
def load_ym... | microblink/NNPACK | src/x86_64-fma/fft16x16.py | Python | bsd-2-clause | 23,581 |
from jsonschema.exceptions import ValidationError
import pytest
from bravado_core.validate import validate_array
from tests.validate.conftest import email_address_format
@pytest.fixture
def int_array_spec():
return {
'type': 'array',
'items': {
'type': 'integer',
}
}
def... | prat0318/bravado-core | tests/validate/validate_array_test.py | Python | bsd-3-clause | 3,505 |
import os
import sys
import glob
from os.path import join, basename
from numpy.distutils import log
from numscons import get_scons_build_dir
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.command.scons import get_scons_pkg... | efiring/numpy-work | numpy/core/setupscons.py | Python | bsd-3-clause | 4,414 |
# Delete entries for the dummy user
# This needs to be done every time we switch to a new database
from pymongo import MongoClient
from get_database import get_section_db
from uuid import UUID
# Users=get_user_db()
fakeUserUUIDQuery = {'user_id': UUID('{951779de-a10c-3373-b186-c1c9b14b5e38}')}
print "About to delete... | joshzarrabi/e-mission-server | bin/delete_test_user_sections.py | Python | bsd-3-clause | 428 |
import logging
import logging.handlers
import os
import sys
LOG_FORMAT = '[%(asctime)s] %(levelname)s: %(message)s'
MAX_LOG_SIZE = 1024 * 1024 * 10
LOG_BACKUP_COUNT = 5
LOG_PATH = log_path = os.path.join(os.path.expanduser('~'), '.tomviz', 'logs')
LOG_PATHS = {
'stderr': '%s/stderr.log' % LOG_PATH,
'stdout': ... | cryos/tomviz | acquisition/tomviz/__init__.py | Python | bsd-3-clause | 2,177 |
#
# Copyright (c) 2009-2015, Jack Poulson
# All rights reserved.
#
# This file is part of Elemental and is under the BSD 2-Clause License,
# which can be found in the LICENSE file in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause
#
import El, math, time
m = 10
cutoff = 1000
output = Tru... | justusc/Elemental | examples/interface/SOC.py | Python | bsd-3-clause | 4,486 |
from unittest import TestCase
import json
from test.utils import DIR_FIXTURES
from harvester.post_processing import dedupe_sourceresource
class DeduperTestCase(TestCase):
def setUp(self):
self.path_to_test_doc = DIR_FIXTURES+'/couchdb_doc_with_dups.json'
# reference to check against, as doc will b... | barbarahui/harvester | test/test_dedupe_sourceresource.py | Python | bsd-3-clause | 2,267 |
"""Breast Cancer Data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """???"""
TITLE = """Breast Cancer Data"""
SOURCE = """
This is the breast cancer data used in Owen's empirical likelihood. It is taken from
Rice, J.A. Mathematical Statistics and Data Analysis.
http://www.cengage.com/statistics/dis... | kiyoto/statsmodels | statsmodels/datasets/cancer/data.py | Python | bsd-3-clause | 1,743 |
from __future__ import absolute_import, unicode_literals
import pytest
from datetime import datetime
from case import Mock, patch
from kombu.asynchronous.timer import Entry, Timer, to_timestamp
from kombu.five import bytes_if_py2
class test_to_timestamp:
def test_timestamp(self):
assert to_timestamp(... | urbn/kombu | t/unit/asynchronous/test_timer.py | Python | bsd-3-clause | 4,311 |
import os
from .base import AnnotatedNineMLObject
from nineml.exceptions import NineMLUsageError
from nineml.base import DocumentLevelObject
class BaseReference(AnnotatedNineMLObject):
"""
Base class for references to model components that are defined in the
abstraction layer.
Parameters
-------... | INCF/lib9ML | nineml/reference.py | Python | bsd-3-clause | 4,678 |
# -*- coding: utf-8 -*-
"""
lantz.drivers.rgblasersystems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:company: RGB Lasersysteme GmbH.
:description: Lasers and Lasers Systems.
:website: http://www.rgb-laser.com/
----
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, se... | varses/awsch | lantz/drivers/rgblasersystems/__init__.py | Python | bsd-3-clause | 414 |
from django import forms
from django.conf import settings
from django.forms.models import inlineformset_factory
from django.utils.translation import ugettext_lazy as _
from oscar.apps.promotions.conf import PROMOTION_CLASSES
from oscar.forms.fields import ExtendedURLField
from oscar.core.loading import get_classes, ge... | DrOctogon/unwash_ecom | oscar/apps/dashboard/promotions/forms.py | Python | bsd-3-clause | 2,643 |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class WagtailTestsAppConfig(AppConfig):
name = 'wagtail.tests.modeladmintest'
label = 'modeladmintest'
verbose_name = _("Test Wagtail Model Admin")
| kaedroho/wagtail | wagtail/tests/modeladmintest/apps.py | Python | bsd-3-clause | 251 |
#!/usr/bin/env python3
# Copyright (c) 2012-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
PYTHONPATH=../../t... | bespike/litecoin | contrib/testgen/gen_key_io_test_vectors.py | Python | mit | 9,388 |
#Embedded file name: ACEStream\Utilities\LinuxSingleInstanceChecker.pyo
import sys
import commands
class LinuxSingleInstanceChecker:
def __init__(self, basename):
self.basename = basename
def IsAnotherRunning(self):
cmd = 'pgrep -fl "%s\\.py" | grep -v pgrep' % self.basename
progressI... | GrandPaRPi/p2ptv-pi | acestream/ACEStream/Utilities/LinuxSingleInstanceChecker.py | Python | mit | 516 |
from asposewords import Settings
from com.aspose.words import Document
from com.aspose.words import BreakType
from com.aspose.words import DocumentBuilder
from com.aspose.words import StyleIdentifier
class UpdateFields:
def __init__(self):
dataDir = Settings.dataDir + 'quickstart/'
# Demo... | aspose-words/Aspose.Words-for-Java | Plugins/Aspose_Words_Java_for_Jython/asposewords/quickstart/UpdateFields.py | Python | mit | 2,621 |
from unittest import TestCase
class GetCaCert(TestCase):
"""
tested in:
pcs_test.tier0.lib.commands.test_quorum.AddDeviceNetTest
"""
class ClientSetup(TestCase):
"""
tested in:
pcs_test.tier0.lib.commands.test_quorum.AddDeviceNetTest
"""
class SignCertificate(TestCase):
... | tomjelinek/pcs | pcs_test/tier0/lib/communication/test_qdevice_net.py | Python | gpl-2.0 | 690 |
import os
import random
import urllib
import time
import datetime
from gettext import ngettext
from urlparse import urljoin
from ubuntutweak.common.consts import install_ngettext
from ubuntutweak.utils.tar import TarFile
install_ngettext()
DEV_MODE = os.getenv('UT_DEV')
DATA_MIRRORS = (
'http://ubuntu-tweak.com... | frdb194/ubuntu-tweak | ubuntutweak/network/utdata.py | Python | gpl-2.0 | 2,772 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: lun mar 24 20:18:44 2014
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x07\xa9\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... | CristianCantoro/cartogram-plugin | resources.py | Python | gpl-2.0 | 15,867 |
from django.db.models import Q
from django.utils.html import escape
from django.contrib.auth.models import User
from ajax_select import LookupChannel
class BuyerLookup(LookupChannel):
"""
This class suggests user names (AJAX Effect) while filling client name for a purchase order
"""
model = User
... | jasvir99/LibreHatti | src/librehatti/catalog/lookups.py | Python | gpl-2.0 | 1,701 |
# -*- Mode: Python -*-
# GObject-Introspection - a framework for introspecting GObject libraries
# Copyright (C) 2012 Dieter Verfaillie <dieterv@optionexplicit.be>
#
# 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 S... | MathieuDuponchelle/gobject-introspection | tests/scanner/annotationparser/test_parser.py | Python | gpl-2.0 | 21,886 |
#!/usr/bin/env python3
import pefile, pathlib, shutil
dlls = set()
dllpath = pathlib.Path('/windows/mingw64/bin')
pe_modules = set([pefile.PE('wesnoth.exe')])
while pe_modules:
pe = pe_modules.pop()
for entry in pe.DIRECTORY_ENTRY_IMPORT:
path = dllpath / pathlib.Path(entry.dll.decode())
if p... | gfgtdf/wesnoth-old | utils/dockerbuilds/mingw/get_dlls.py | Python | gpl-2.0 | 470 |
#!/usr/bin/env python3
#
#
#
# This file is part of librix-thinclient.
#
# librix-thinclient 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 ver... | andrevmatos/Librix-ThinClient | src/ui/export/ssh_export/__init__.py | Python | gpl-2.0 | 739 |
import socket, struct
import binascii
from functools import partial
CMD_DYNLOAD_ACQUIRE = 1000
CMD_DYNLOAD_RELEASE = 1001
CMD_DYNLOAD_FINDEXPORT = 1002
CMD_READ_MEMORY = 2000
CMD_WRITE_MEMORY = 2001
CMD_CALL_FUNCTION = 2002
CMD_IOS_OPEN = 3000
CMD_IOS_CLOSE = 3001
CMD_IOS_IOCTL = 3002
CMD_IOS_IOCTLV = 3003
ARG_TYPE... | exjam/decaf-emu | tools/wiiu-rpc/client.py | Python | gpl-3.0 | 7,836 |
#!/usr/bin/python
#
# Copyright 2008 Dan Smith <dsmith@danplanet.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | coddingtonbear/d-rats | d_rats/reqobject.py | Python | gpl-3.0 | 1,990 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eith... | leohmoraes/weblate | weblate/trans/scripts.py | Python | gpl-3.0 | 2,637 |
import logging
from django import template
register = template.Library()
@register.tag(name="previous")
def do_previous(parser, token):
# previous in <list> from <object> as <previous_object>
bits = token.contents.split()
if len(bits) != 7:
raise template.TemplateSyntaxError, "%r takes six argum... | mbrondani/django-agenda | agenda/templatetags/next_previous.py | Python | gpl-3.0 | 2,732 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from decimal ... | akintolga/superdesk-aap | server/aap/macros/area_square_miles_to_metric.py | Python | agpl-3.0 | 1,790 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-07-06 07:23
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('timeline', '0004_auto_20150603_1312'),
]
operations = [... | xdevelsistemas/taiga-back-community | taiga/timeline/migrations/0005_auto_20160706_0723.py | Python | agpl-3.0 | 522 |
# -*- coding: utf-8 -*-
# Copyright 2015-2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import _, api, fields, models
from openerp.exceptions import ValidationError
class IrExports(models.Model):
_inherit = 'ir.exports'
name =... | be-cloud-be/horizon-addons | server-tools/base_export_manager/models/ir_exports.py | Python | agpl-3.0 | 2,147 |
from Compliant import types
import numpy as np
def createScene(node):
obj = node.createObject('MechanicalObject',
template = 'Rigid',
position = '0 0 0 0 0 0 1',
name = 'dofs')
# a rigid view on position vector
pos = np.... | Anatoscope/sofa | applications/plugins/Compliant/examples/using_types.py | Python | lgpl-2.1 | 485 |
# Copyright (c) 2010-2013 by Yaco Sistemas <goinnn@gmail.com> or <pmartin@yaco.es>
#
# This program 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 3 of the License, or
# (at your option)... | paridin/django-inplaceedit | testing/testing/example_extra_fields/urls.py | Python | lgpl-3.0 | 1,090 |
# 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 ... | rakeshmi/tempest | tempest/tests/services/compute/test_security_group_rules_client.py | Python | apache-2.0 | 2,571 |
#
# 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 us... | goldmedal/spark | sql/gen-sql-api-docs.py | Python | apache-2.0 | 5,943 |
#!/usr/bin/python
# Copyright 2014 Nervana Systems 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 req... | phvu/nervanagpu | benchmarks/minibatch_layout_diff.py | Python | apache-2.0 | 3,364 |
import collections
from queue import Queue
class OrderedSetQueue(Queue):
"""
A queue based on ordered set. This behaves just like a normal queue but does not allow the same item to be in the
queue more than once.
"""
def _init(self, maxsize):
self.queue = OrderedSet()
def _put(self, i... | nickzuber/ClusterRunner | app/util/ordered_set_queue.py | Python | apache-2.0 | 2,158 |
"""Constants for monitoring a Sense energy sensor."""
import asyncio
from sense_energy import SenseAPITimeoutException
DOMAIN = "sense"
DEFAULT_TIMEOUT = 10
ACTIVE_UPDATE_RATE = 60
DEFAULT_NAME = "Sense"
SENSE_DATA = "sense_data"
SENSE_DEVICE_UPDATE = "sense_devices_update"
SENSE_DEVICES_DATA = "sense_devices_data"
... | lukas-hetzenecker/home-assistant | homeassistant/components/sense/const.py | Python | apache-2.0 | 2,110 |
# Copyright (c) 2013 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | netscaler/neutron | neutron/tests/unit/openvswitch/test_agent_scheduler.py | Python | apache-2.0 | 59,767 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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.apac... | ntt-sic/neutron | neutron/plugins/common/constants.py | Python | apache-2.0 | 1,913 |
try:
try:
from _pydevd_frame_eval_ext import pydevd_frame_evaluator as mod
except ImportError:
from _pydevd_frame_eval import pydevd_frame_evaluator as mod
except ImportError:
try:
import sys
try:
is_64bits = sys.maxsize > 2 ** 32
except:
# I... | leafclick/intellij-community | python/helpers/pydev/_pydevd_frame_eval/pydevd_frame_eval_cython_wrapper.py | Python | apache-2.0 | 1,343 |
from troposphere import Join, Ref, Template
from troposphere.cloudformation import AWSCustomObject
class CustomPlacementGroup(AWSCustomObject):
resource_type = "Custom::PlacementGroup"
props = {
'ServiceToken': (basestring, True),
'PlacementGroupName': (basestring, True)
}
t = Template(... | horacio3/troposphere | examples/CustomResource.py | Python | bsd-2-clause | 928 |
from django.core import urlresolvers
from django.conf.urls import include, url
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailcore import hooks
from wagtail.wagtailadmin.menu import MenuItem
from wagtail.wagtailforms import urls
from wagtail.wagtailforms.models import get_forms_for_user
... | davecranwell/wagtail | wagtail/wagtailforms/wagtail_hooks.py | Python | bsd-3-clause | 953 |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | appleseedhq/gaffer | python/GafferCortexUI/CompoundPlugValueWidget.py | Python | bsd-3-clause | 11,940 |
from __future__ import division, absolute_import, print_function
import sys
import math
import numpy.core.numeric as _nx
from numpy.core.numeric import (
asarray, ScalarType, array, alltrue, cumprod, arange
)
from numpy.core.numerictypes import find_common_type
from . import function_base
import numpy.matrix... | mindw/numpy | numpy/lib/index_tricks.py | Python | bsd-3-clause | 26,049 |
from decimal import Decimal as D
from unittest import mock
from django.test import TestCase
from paypal.payflow import gateway
class TestAuthorizeFunction(TestCase):
def test_returns_a_txn_instance(self):
with mock.patch('paypal.gateway.post') as mock_post:
mock_post.return_value = {
... | lpakula/django-oscar-paypal | tests/unit/payflow/gateway_tests.py | Python | bsd-3-clause | 3,147 |
# coding: utf-8
"""
utils module to organize commom use utilities and functions
"""
| laborautonomo/opps | opps/utils/__init__.py | Python | mit | 84 |
import logging
from numpy import nan
from collections import Counter
from protmapper import uniprot_client, ProtMapper
from indra.statements import *
from indra.databases import hgnc_client
from indra.statements.validate import validate_id
logger = logging.getLogger(__name__)
# Map of HPRD PTM types to INDRA Statem... | sorgerlab/belpy | indra/sources/hprd/processor.py | Python | mit | 16,674 |
# A POST request using requests library
import requests
# Base URL being accessed
url = 'http://httpbin.org/post'
# Dictionary of query parameters (if any)
parms = {
'name1' : 'value1',
'name2' : 'value2'
}
# Extra headers
headers = {
'User-agent' : 'none/ofyourbusiness',
'Spam' : 'Eggs'
}
resp = req... | tuanavu/python-cookbook-3rd | src/11/interacting_with_http_services_as_a_client/example3.py | Python | mit | 467 |
# -*- coding: utf-8 -*-
from collections import Counter
from .design_pattern import singleton
@singleton()
class ListUtilsClass(object):
def most_common_inspect(self, list1):
new_list = []
for s1 in list1:
if not isinstance(s1, unicode):
s1 = str(s1).decode("UTF-8")
... | Luiti/etl_utils | etl_utils/list_utils.py | Python | mit | 1,250 |
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo 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 v... | lnielsen/zenodo | zenodo/modules/records/serializers/fields/persistentid.py | Python | gpl-2.0 | 2,380 |
# Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
from orthography import add_suffix
import unittest
class OrthographyTestCase(unittest.TestCase):
def test_add_suffix(self):
cases = (
('artistic', 'ly', 'artistically'),
('cosmetic', 'ly', 'cosmetically'),
... | blockbomb/plover | plover/test_orthography.py | Python | gpl-2.0 | 4,487 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004 Martin Hawlisch
# Copyright (C) 2005-2008 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2011 Michiel D. Nauta
#
# This program is free software; you can redistribut... | beernarrd/gramps | gramps/plugins/export/exportvcard.py | Python | gpl-2.0 | 12,904 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... | Jorge-Rodriguez/ansible | lib/ansible/modules/cloud/ovirt/ovirt_disk.py | Python | gpl-3.0 | 29,884 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
'accountlinker.thirdpartyaccount': {
... | norayr/unisubs | apps/auth/migrations/0032_remove_thumb_options.py | Python | agpl-3.0 | 21,604 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | aricchen/openHR | openerp/addons/mail/mail_thread.py | Python | agpl-3.0 | 73,103 |
# -*- encoding: 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 G... | shingonoide/odoo | addons/account_asset/account_asset.py | Python | agpl-3.0 | 29,332 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.