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 jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:7950")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) | oracul/bullycoin | contrib/wallettools/walletunlock.py | Python | mit | 157 |
# -*- encoding: utf-8 -*-
# This file is part of IRIS: Infrastructure and Release Information System
#
# Copyright (C) 2013-2015 Intel Corporation
#
# IRIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2.0 as published by the Free Software Found... | sunshine027/iris-panel | iris/etl/scm.py | Python | gpl-2.0 | 8,948 |
# (c) 2012, 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) any lat... | dlundquist/ansible | lib/ansible/utils/template.py | Python | gpl-3.0 | 13,049 |
#!/usr/bin/env python
########################################################################
# $HeadURL$
########################################################################
__RCSID__ = "$Id$"
from DIRAC import exit as DIRACExit
from DIRAC.Core.Base import Script
Script.setUsageMessage( """
Get the gi... | vmendez/DIRAC | DataManagementSystem/scripts/dirac-dms-replica-metadata.py | Python | gpl-3.0 | 1,519 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache/incubator-airflow | tests/providers/google/cloud/transfers/test_oracle_to_gcs.py | Python | apache-2.0 | 6,070 |
# 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... | jcshen007/cloudstack | test/integration/smoke/misc/test_escalations_templates.py | Python | apache-2.0 | 8,699 |
from osf.models.base import BaseModel
from django.db import models
class Brand(BaseModel):
"""
This model holds data custom styled assets for providers
"""
class Meta:
# Custom permissions for use in the OSF Admin App
permissions = (
('view_brand', 'Can view brand details'... | mfraezz/osf.io | osf/models/brand.py | Python | apache-2.0 | 684 |
#!/usr/bin/env python
# Copyright 2011 Google Inc. All Rights Reserved.
"""This is the GRR client for thread pools."""
import pickle
import threading
import time
import logging
from grr.client import client
# pylint: disable=unused-import
# Make sure we load the client plugins
from grr.client import client_plugi... | ojengwa/grr | client/poolclient.py | Python | apache-2.0 | 4,657 |
# -*- coding: utf-8 -*-
from datetime import datetime
from pandas.compat import range, lrange
import operator
import nose
import numpy as np
from pandas.types.common import is_float_dtype
from pandas import Series, Index, isnull, notnull
from pandas.core.panel import Panel
from pandas.core.panel4d import Panel4D
from... | andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/tests/test_panel4d.py | Python | apache-2.0 | 35,347 |
from . import unittest, numpy, test_int_types
from .test_multi import MultiGeometryTestCase
from shapely.geos import lgeos
from shapely.geometry import LineString, MultiLineString, asMultiLineString
from shapely.geometry.base import dump_coords
class MultiLineStringTestCase(MultiGeometryTestCase):
def test_multi... | jdmcbr/Shapely | tests/test_multilinestring.py | Python | bsd-3-clause | 3,200 |
#!/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... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/api_server.py | Python | bsd-3-clause | 33,071 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | david-ragazzi/nupic | examples/opf/simple_server/model_params.py | Python | gpl-3.0 | 9,288 |
# (c) 2014, Chris Church <chris@ninemoreminutes.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) any lat... | gentledevil/ansible | lib/ansible/plugins/shell/sh.py | Python | gpl-3.0 | 6,399 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | TRex22/Sick-Beard | sickbeard/notifiers/growl.py | Python | gpl-3.0 | 5,949 |
# -*- 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... | Johnzero/erp | openerp/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py | Python | agpl-3.0 | 8,655 |
from mock import *
from .gp_unittest import *
from gpconfig_modules.compare_segment_guc import MultiValueGuc
from gpconfig_modules.database_segment_guc import DatabaseSegmentGuc
from gpconfig_modules.file_segment_guc import FileSegmentGuc
class CompareSegmentGucTest(GpTestCase):
def setUp(self):
row = ['c... | 50wu/gpdb | gpMgmt/bin/gppylib/test/unit/test_unit_compare_segment_guc.py | Python | apache-2.0 | 8,167 |
"""
Base classes for test cases
Tests will usually inherit from one of these classes to have the controller
and/or dataplane automatically set up.
"""
import os
import logging
import unittest
import ptf
from ptf.base_tests import BaseTest
from ptf import config
import ptf.dataplane as dataplane
###################... | lmingcsce/p4factory | targets/sai_p4/tests/ptf-tests/sai_thrift/sai_base_test.py | Python | apache-2.0 | 1,788 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | linearregression/luigi | luigi/parameter.py | Python | apache-2.0 | 20,682 |
from mpi4py import MPI
import mpiunittest as unittest
class BaseTestCommAttr(object):
keyval = MPI.KEYVAL_INVALID
def tearDown(self):
self.comm.Free()
if self.keyval != MPI.KEYVAL_INVALID:
self.keyval = MPI.Comm.Free_keyval(self.keyval)
self.assertEqual(self.keyval, MP... | pressel/mpi4py | test/test_attributes.py | Python | bsd-2-clause | 6,481 |
"""FunctionInterval module: contains the FunctionInterval class"""
__all__ = ['FunctionInterval', 'EventInterval', 'AcceptInterval', 'IgnoreInterval', 'ParentInterval', 'WrtParentInterval', 'PosInterval', 'HprInterval', 'ScaleInterval', 'PosHprInterval', 'HprScaleInterval', 'PosHprScaleInterval', 'Func', 'Wait']
from... | hj3938/panda3d | direct/src/interval/FunctionInterval.py | Python | bsd-3-clause | 15,597 |
import wx
import wx.html
from wx.lib.filebrowsebutton import FileBrowseButton
import wx.lib.agw.pycollapsiblepane as PCP
import xml.dom.minidom
from xml.dom.minidom import Node, Document, Element
import time
import sys
import os
import subprocess
ID_CHOOSEPANDA = wx.NewId()
ID_CLEAROUTPUT = wx.NewId()
ID_LOADPREFS = w... | jjkoletar/panda3d | contrib/src/panda3dtoolsgui/Panda3DToolsGUI.py | Python | bsd-3-clause | 166,069 |
# coding: utf-8
from __future__ import absolute_import
import pytest
from datetime import timedelta
from django.core import mail
from django.core.urlresolvers import reverse
from django.db import connection
from django.utils import timezone
from exam import fixture
from sentry.db.models.fields.node import NodeData,... | Kryz/sentry | tests/sentry/models/tests.py | Python | bsd-3-clause | 5,760 |
# Copyright 2013 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.
from telemetry import test
from telemetry.page import page
from telemetry.page import page_set
from telemetry.page import page_test
# pylint: disable=W0401,W0... | TeamEOS/external_chromium_org | content/test/gpu/gpu_tests/webgl_robustness.py | Python | bsd-3-clause | 2,603 |
from flask import _app_ctx_stack
from flask import current_app as app
from flask import Flask, request, session, url_for, redirect, \
render_template, abort, g, flash, _app_ctx_stack
from sqlite3 import dbapi2 as sqlite3
from hashlib import md5
from datetime import datetime
def get_db():
"""Opens a new databa... | bridgetnoelleee/project2 | helpers/functions.py | Python | bsd-3-clause | 2,064 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.model import no_value_fields
from frappe.utils.password import rename_password_field
def rename_field(doctype, old_fieldname, new_fieldname... | indautgrp/frappe | frappe/model/utils/rename_field.py | Python | mit | 4,528 |
# Test behaviour of inf and nan in basic float operations
inf = float("inf")
nan = float("nan")
values = (-2, -1, 0, 1, 2, inf, nan)
for x in values:
for y in values:
print(x, y)
print(" + - *", x + y, x - y, x * y)
try:
print(" /", x / y)
except ZeroDivisionError:
... | bvernoux/micropython | tests/float/inf_nan_arith.py | Python | mit | 587 |
'''tzinfo timezone information for Africa/Lagos.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Lagos(DstTzInfo):
'''Africa/Lagos timezone definition. See datetime.tzinfo for details'''
zone = 'Africa/Lagos'
_utc_tr... | newvem/pytz | pytz/zoneinfo/Africa/Lagos.py | Python | mit | 475 |
"""Test case implementation"""
import sys
import functools
import difflib
import logging
import pprint
import re
import warnings
import collections
import contextlib
import traceback
from . import result
from .util import (strclass, safe_repr, _count_diff_all_purpose,
_count_diff_hashable, _common_... | michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/unittest/case.py | Python | gpl-2.0 | 55,456 |
#!/usr/bin/env python3
# DepGen.py - produce a make dependencies file for Scintilla
# Copyright 2019 by Neil Hodgson <neilh@scintilla.org>
# The License.txt file describes the conditions under which this software may be distributed.
# Requires Python 3.6 or later
import sys
sys.path.append("..")
from scripts import ... | martinrotter/textilosaurus | src/libtextosaurus/3rd-party/scintilla/gtk/DepGen.py | Python | gpl-3.0 | 752 |
from __future__ import absolute_import
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from six import text_type
from typing import Set
from zerver.decorator import authenticated_js... | calvinleenyc/zulip | zerver/views/invite.py | Python | apache-2.0 | 3,991 |
#!/usr/bin/env python3
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeError
else: BadListError = ValueError
# Add the distutils... | charris/numpy | tools/swig/test/testFarray.py | Python | bsd-3-clause | 5,103 |
#!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... | ChristianFrisson/essentia | test/src/unittest/tonal/test_chordsdetection_streaming.py | Python | agpl-3.0 | 8,334 |
#! python
# -*- coding: utf-8 -*-
# (c) 2006 Werner Mayer LGPL
#
# FreeCAD RevInfo script to get the revision information from Subversion.
#
# Under Linux the Subversion tool SubWCRev shipped with TortoiseSVN isn't
# available which is provided by this script.
# 2011/02/05: The script was extended to support ... | bblacey/FreeCAD-MacOS-CI | src/Tools/SubWCRev.py | Python | lgpl-2.1 | 14,815 |
"""check unused import
"""
__revision__ = 1
import os
import sys
class NonRegr:
"""???"""
def __init__(self):
print 'initialized'
def sys(self):
"""should not get sys from there..."""
print self, sys
def dummy(self, truc):
"""yo"""
return self, truc
de... | dbbhattacharya/kitsune | vendor/packages/pylint/test/input/func_w0611.py | Python | bsd-3-clause | 378 |
# Copyright 2014 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.
# pylint: disable=C0301
# Based on/taken from
# http://code.activestate.com/recipes/578231-probably-the-fastest-memoization-decorator-in-the-/
# (with cos... | zhangxq5012/sky_engine | mojo/tools/mopy/memoize.py | Python | bsd-3-clause | 578 |
from chainer import cuda
from chainer import function
from chainer import utils
from chainer.utils import type_check
import numpy
class ClippedReLU(function.Function):
"""Clipped Rectifier Unit function.
Clipped ReLU is written as :math:`ClippedReLU(x, z) = \min(\max(0, x), z)`,
where :math:`z(>0)` is a... | 1986ks/chainer | chainer/functions/activation/clipped_relu.py | Python | mit | 1,839 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.tv
# Git: https://github.com/SiCKRAGETV/SickRage
#
# This file is part of SickRage.
#
# SickRage 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, ei... | SerialShadow/SickRage | sickbeard/sab.py | Python | gpl-3.0 | 8,550 |
"""Nello.io lock platform."""
from itertools import filterfalse
import logging
from pynello.private import Nello
import voluptuous as vol
from homeassistant.components.lock import PLATFORM_SCHEMA, LockEntity
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as... | tchellomello/home-assistant | homeassistant/components/nello/lock.py | Python | apache-2.0 | 2,961 |
"""
Tests for whether the standard library hooks in ``future`` are compatible with
the ``requests`` package.
"""
from __future__ import absolute_import, unicode_literals, print_function
from future import standard_library
from future.tests.base import unittest, CodeHandler
import textwrap
import sys
import os
import i... | hughperkins/kgsgo-dataset-preprocessor | thirdparty/future/tests/test_future/test_requests.py | Python | mpl-2.0 | 3,385 |
"""
Test helper functions and base classes.
"""
import inspect
import json
import unittest
import functools
import operator
import pprint
import requests
import os
import urlparse
from contextlib import contextmanager
from datetime import datetime
from path import Path as path
from bok_choy.javascript import js_defined... | shashank971/edx-platform | common/test/acceptance/tests/helpers.py | Python | agpl-3.0 | 24,524 |
##########################################################################
#
# Copyright (c) 2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | lento/cortex | test/IECore/ops/mayaUserData/mayaUserData-1.py | Python | bsd-3-clause | 2,775 |
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
from Exporter import Exporter
from settings import *
import utils
#===========... | alexa-infra/negine | thirdparty/boost-python/libs/python/pyste/src/Pyste/EnumExporter.py | Python | mit | 2,214 |
# (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... | wehkamp/ansible | lib/ansible/plugins/action/fetch.py | Python | gpl-3.0 | 7,278 |
var1 = bool(input())
var2 = bool(input())
if var1:
print(var2)
elif v<caret> | siosio/intellij-community | python/testData/codeInsight/mlcompletion/isInConditionSimpleElif.py | Python | apache-2.0 | 78 |
# 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... | tebeka/arrow | python/examples/plasma/sorting/sort_df.py | Python | apache-2.0 | 6,843 |
from django.contrib.auth.models import User
from base import BaseTest
from xadmin.views import BaseAdminView, BaseAdminPlugin, ModelAdminView, ListAdminView
from models import ModelA, ModelB
from adminx import site, ModelAAdmin, TestBaseView, TestCommView, TestAView, OptionA
class BaseAdminTest(BaseTest):
def ... | hochanh/django-xadmin | tests/xtests/view_base/tests.py | Python | bsd-3-clause | 2,162 |
__version__ = '0.7.0'
| ceholden/yatsm | yatsm/version.py | Python | mit | 22 |
"""
WSGI config for superlists 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.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | xueyaodeai/DjangoWebsite | superlists/wsgi.py | Python | mit | 398 |
#!/usr/bin/env python
import sys
import re
from helpers import *
PROGRAM_USAGE = """
SeqAn invalid identifiers detection script.
USAGE: invalid_identifiers.py BASE_PATH
BASE_PATH is the root path of all the folders to be searched.
This script generates a list of invalid identifiers found in the code base,
paired wi... | bkahlert/seqan-research | raw/workshop13/workshop2013-data-20130926/trunk/misc/renaming/invalid_identifiers.py | Python | mit | 5,253 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2018, Yanis Guenane <yanis+ansible@guenane.org>
# (c) 2019, René Moser <mail@renemoser.net>
# 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__ = ... | roadmapper/ansible | lib/ansible/modules/cloud/vultr/vultr_ssh_key_info.py | Python | gpl-3.0 | 3,509 |
"""Show information about the test environment."""
from __future__ import absolute_import, print_function
import datetime
import json
import os
import platform
import re
import sys
from lib.config import (
CommonConfig,
)
from lib.util import (
display,
find_executable,
raw_command,
SubprocessEr... | valentin-krasontovitsch/ansible | test/runner/lib/env.py | Python | gpl-3.0 | 6,627 |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | ekasitk/sahara | sahara/service/validations/edp/job_binary_internal.py | Python | apache-2.0 | 1,066 |
# coding=utf-8
from __future__ import unicode_literals
from .. import Provider as AddressProvider
class Provider(AddressProvider):
city_formats = ('{{city_name}}', )
street_name_formats = ('{{street_name}}', )
street_address_formats = ('{{street_name}} {{building_number}}', )
address_formats = ('{{s... | yiliaofan/faker | faker/providers/address/sl_SI/__init__.py | Python | mit | 34,150 |
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.DependencyArg import DependencyArg
from _emerge.Package import Package
import portage
from portage._sets.base import InternalPackageSet
from portage.dep import _repo_separator
class PackageArg(Depen... | dol-sen/portage | pym/_emerge/PackageArg.py | Python | gpl-2.0 | 689 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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 the
# License, or (at your option) any later... | zenodo/invenio | invenio/base/views.py | Python | gpl-2.0 | 947 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.tools import html2plaintext
class Stage(models.Model):
_name = "note.stage"
_description = "Note Stage"
_order = 'sequence'
name = fields.Char('Stage ... | chienlieu2017/it_management | odoo/addons/note/models/note.py | Python | gpl-3.0 | 6,066 |
# -*- encoding: utf8 -*-
"""Tests for distutils.command.check."""
import unittest
from test.test_support import run_unittest
from distutils.command.check import check, HAS_DOCUTILS
from distutils.tests import support
from distutils.errors import DistutilsSetupError
class CheckTestCase(support.LoggingSilencer,
... | sdlBasic/sdlbrt | win32/mingw/opt/lib/python2.7/distutils/tests/test_check.py | Python | lgpl-2.1 | 4,034 |
# 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 ... | kalrey/swift | test/unit/common/middleware/helpers.py | Python | apache-2.0 | 4,791 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, pointless-statement, missing-docstring, unneeded-not
import pytest
import six
from ..match import Match, Matches
from ..pattern import StringPattern, RePattern
from ..formatters import formatters
class TestMatchClass(object):
def test_... | bbsan2k/nzbToMedia | libs/rebulk/test/test_match.py | Python | gpl-3.0 | 20,081 |
# -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import account_journal
from . import account_move
| ygol/odoo | addons/l10n_fi/models/__init__.py | Python | agpl-3.0 | 156 |
#!/usr/bin/python
# -*- coding: latin-1 -*-
# 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, or (at your option) any later
# version.
#
# This program is distributed in t... | pronexo-odoo/odoo-argentina | l10n_ar_pyafipws/pyafipws/formato_cot.py | Python | agpl-3.0 | 3,236 |
# 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/LICENSE-2.0
#
# Unless required by applica... | xuleiboy1234/autoTitle | tensorflow/tensorflow/contrib/factorization/__init__.py | Python | mit | 1,602 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Martz <matt@sivel.net>
#
# 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, ... | grimmjow8/ansible | lib/ansible/modules/commands/expect.py | Python | gpl-3.0 | 7,744 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | chen0031/nupic | tests/unit/nupic/encoders/random_distributed_scalar_test.py | Python | agpl-3.0 | 19,698 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-5, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and condition... | metaml/nupic.core | ci/travis/deploy-wheel-to-s3.py | Python | agpl-3.0 | 1,831 |
# 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/LICENSE-2.0
#
# Unless required by applica... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/keras/python/keras/layers/noise_test.py | Python | apache-2.0 | 1,668 |
from __future__ import print_function
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
class ImageMenu(Gtk.EventBox):
def __init__ (self, image, child):
GObject.GObject.__init__(self)
self.add(image)
self.subwindow = Gtk.Window()... | rajrakeshdr/pychess | lib/pychess/widgets/ImageMenu.py | Python | gpl-3.0 | 4,643 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Akretion
# (<http://www.akretion.com>).
#
# This program is free software: you can redistribute it and/or modify
# it unde... | bealdav/OpenUpgrade | addons/analytic/migrations/8.0.1.1/pre-migration.py | Python | agpl-3.0 | 1,314 |
# -*- coding: utf-'8' "-*-"
import base64
import json
from hashlib import sha1
import hmac
import logging
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_adyen.controllers.main import AdyenController
from openerp.osv import osv, fields
from opener... | minhphung171093/GreenERP | openerp/addons/payment_adyen/models/adyen.py | Python | gpl-3.0 | 7,511 |
from __future__ import unicode_literals
import itertools
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
js_to_json,
orderedSet,
parse_duration,
sanitized_Request,
str_to_int,
)
class XTubeIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:... | Tithen-Firion/youtube-dl | youtube_dl/extractor/xtube.py | Python | unlicense | 5,972 |
# Copyright: (c) 2018, Pluribus Networks
# 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
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_pim_... | thaim/ansible | test/units/modules/network/netvisor/test_pn_vrouter_pim_config.py | Python | mit | 2,463 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-31 14:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0032_add_bulk_delete_page_permission'),
]
operations = [
migrations.AlterField(
model_nam... | zerolab/wagtail | wagtail/core/migrations/0033_remove_golive_expiry_help_text.py | Python | bsd-3-clause | 674 |
__version__ = '0.0.1'
| jgrillo/zoonomia | zoonomia/_version.py | Python | mit | 22 |
"""Expand target names in an aggregated coverage file."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from .... import types as t
from ....io import (
SortedSetEncoder,
write_json_file,
)
from . import (
CoverageAnalyzeTargetsConfig,
expand_indexes,
for... | azaghal/ansible | test/lib/ansible_test/_internal/coverage/analyze/targets/expand.py | Python | gpl-3.0 | 1,272 |
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from photologue.models import PhotoSize, ImageModel
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--reset', '-r', action='store_true', dest='reset', help='Reset phot... | zhaobin19918183/zhaobinCode | zhaobin/mysite/photologue/management/commands/plcache.py | Python | gpl-3.0 | 1,406 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_generate_file
------------------
Tests formerly known from a unittest residing in test_generate.py named
TestGenerateFile.test_generate_file
TestGenerateFile.test_generate_file_verbose_template_syntax_error
"""
from __future__ import unicode_literals
import os
i... | sp1rs/cookiecutter | tests/test_generate_file.py | Python | bsd-3-clause | 2,271 |
# -*- coding: utf-8 -*-
# 第 0003 题:将 0001 题生成的 200 个激活码(或者优惠券)保存到 Redis 非关系型数据库中。
# fail to install redis, skip it | fairyzoro/python | JiYouMCC/0003/0003.py | Python | mit | 176 |
#
# The Python Imaging Library
# $Id$
#
# simple postscript graphics interface
#
# History:
# 1996-04-20 fl Created
# 1999-01-10 fl Added gsave/grestore to image method
# 2005-05-04 fl Fixed floating point issue in image (from Eric Etheridge)
#
# Copyright (c) 1997-2005 by Secret Labs AB. All rights reserved.
# ... | whitehorse-io/encarnia | pyenv/lib/python2.7/site-packages/PIL/PSDraw.py | Python | mit | 6,841 |
__author__ = 'cns_dasi'
| OpenNingia/l5r-character-manager-3 | l5r/tools/__init__.py | Python | gpl-3.0 | 24 |
import modshogun as sg
import data
# load data
feature_matrix = data.swissroll()
# create features instance
features = sg.RealFeatures(feature_matrix)
# create Linear Local Tangent Space Alignment converter instance
converter = sg.LinearLocalTangentSpaceAlignment()
# set target dimensionality
converter.set_target_di... | AzamYahya/shogun | applications/tapkee/samples/lltsa.py | Python | gpl-3.0 | 611 |
#!/usr/bin/python
import sys
import os
import subprocess
import random
import time
import sqlite3
import threading
import hashlib
import gzip
import json
import datetime
import re
if sys.version_info[0] >= 3:
from socketserver import ThreadingTCPServer
from urllib.request import urlopen, URLError
from urllib.parse... | aagallag/nexmon | utilities/aircrack-ng/scripts/dcrack.py | Python | gpl-3.0 | 17,795 |
self.description = "Install a group from a sync db"
sp1 = pmpkg("pkg1")
sp1.groups = ["grp"]
sp2 = pmpkg("pkg2")
sp2.groups = ["grp"]
sp3 = pmpkg("pkg3")
sp3.groups = ["grp"]
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p);
self.args = "-S %s" % "grp"
self.addrule("PACMAN_RETCODE=0")
for p in sp1, sp2, sp3:
s... | kylon/pacman-fakeroot | test/pacman/tests/sync020.py | Python | gpl-2.0 | 357 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
fro... | btcgroup2/bitcoin | test/functional/txn_clone.py | Python | mit | 7,658 |
# 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/LICENSE-2.0
#
# Unless required by applica... | eadgarchen/tensorflow | tensorflow/contrib/slim/python/slim/nets/resnet_v2.py | Python | apache-2.0 | 14,548 |
from unittest import TestCase
from scrapy.http import Response, Request
from scrapy.spider import Spider
from scrapy.contrib.spidermiddleware.referer import RefererMiddleware
class TestRefererMiddleware(TestCase):
def setUp(self):
self.spider = Spider('foo')
self.mw = RefererMiddleware()
de... | hy-2013/scrapy | tests/test_spidermiddleware_referer.py | Python | bsd-3-clause | 639 |
# test attrtuple
# we can't test this type directly so we use sys.implementation object
import sys
t = sys.implementation
# It can be just a normal tuple on small ports
try:
t.name
except AttributeError:
print("SKIP")
raise SystemExit
# test printing of attrtuple
print(str(t).find("version=") > 0)
# te... | MrSurly/micropython-esp32 | tests/basics/attrtuple1.py | Python | mit | 364 |
from ._compat import PY2, filename_to_ui, get_text_stderr
from .utils import echo
class ClickException(Exception):
"""An exception that Click can handle and show to the user."""
#: The exit code for this exception
exit_code = 1
def __init__(self, message):
if PY2:
if message is n... | sourlows/rating-cruncher | src/lib/click/exceptions.py | Python | apache-2.0 | 6,390 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | cngo-github/nupic | tests/unit/nupic/algorithms/anomaly_test.py | Python | agpl-3.0 | 5,644 |
#._cv_part guppy.heapy.Part
class Format(object):
__slots__ = 'impl', 'mod'
def __init__(self, impl):
self.impl = impl
self.mod = impl.mod
def get_formatted_row(self, row):
fr = self.get_stat_data(row)
rows = []
rs = row.name.split('\n')
subsequent_indent = len(fr)*' '
rows.extend(self.mod.wrap(
... | vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Part.py | Python | gpl-2.0 | 19,486 |
# -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and HTML, but it does not rewrite the
XML or HTML to reflect a new encoding; th... | burzillibus/RobHome | venv/lib/python2.7/site-packages/bs4/dammit.py | Python | mit | 29,930 |
from django.test import TestCase
from .models.default_related_name import Author, Editor, Book
class DefaultRelatedNameTests(TestCase):
def setUp(self):
self.author = Author.objects.create(first_name="Dave", last_name="Loper")
self.editor = Editor.objects.create(name="Test Editions",
... | diegoguimaraes/django | tests/model_options/test_default_related_name.py | Python | bsd-3-clause | 1,645 |
"""The folder component."""
| aronsky/home-assistant | homeassistant/components/folder/__init__.py | Python | apache-2.0 | 28 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutManager.
.. note:: 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.
"""
... | SrNetoChan/QGIS | tests/src/python/test_qgslayoutmanager.py | Python | gpl-2.0 | 10,513 |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Set up paths for Fast R-CNN."""
import os.path as osp
import sys
d... | yxliang/fast-rcnn | tools/_init_paths.py | Python | mit | 637 |
#! /usr/bin/env python3
#
# Class for profiling python code. rev 1.0 6/2/94
#
# Written by James Roskind
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
"""Class for profiling Python code."""
# Copyright Disney Enterprises, Inc. All Rights Reserved.
# Licens... | dya2/python-for-android | python3-alpha/python3-src/Lib/profile.py | Python | apache-2.0 | 22,537 |
import unittest
from test import test_support
import UserDict, random, string
import gc, weakref
class DictTest(unittest.TestCase):
def test_constructor(self):
# calling built-in types without argument must return empty
self.assertEqual(dict(), {})
self.assert_(dict() is not {})
def ... | leighpauls/k2cro4 | third_party/python_26/Lib/test/test_dict.py | Python | bsd-3-clause | 17,651 |
#
# (c) 2018 Extreme Networks Inc.
#
# 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) any later version.
#
# Ans... | alexlo03/ansible | lib/ansible/plugins/action/voss_config.py | Python | gpl-3.0 | 4,227 |
from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, binary_type
from pip._vendor.six.moves import http_client, urllib
import codecs
import re
from pip._vendor import webencodings
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .con... | BitWriters/Zenith_project | zango/lib/python3.5/site-packages/pip/_vendor/html5lib/_inputstream.py | Python | mit | 32,532 |
"""A multiline string
"""
function('aeozrijz\
earzer', hop)
# XXX write test
x = [i for i in range(5)
if i % 4]
fonction(1,
2,
3,
4)
def definition(a,
b,
c):
return a + b + c
class debile(dict,
object):
pass
if aaaa: pass
else:
... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/astroid/tests/testdata/python3/data/format.py | Python | mit | 421 |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from tweepy.models import ModelFactory
from tweepy.utils import import_simplejson
from tweepy.error import TweepError
class Parser(object):
def parse(self, method, payload):
"""
Parse the response payload and return the r... | canwe/NewsBlur | vendor/tweepy/parsers.py | Python | mit | 2,622 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.