repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
icsi-berkeley/framework_code | src/main/nluas/app/core_solver.py | 2 | 7749 | """
Simple solver "core". Contains capabilities for unpacking
a JSON n-tuple, as well as routing this n-tuple based
on the predicate_type (command, query, assertion, etc.).
Other general capabilities can be added. The design
is general enough that the same "unpacking" and "routing"
method can be used, as long as a new ... | apache-2.0 |
kirisetsz/kisstudou | kisstudou.py | 1 | 7276 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import re
import httplib
import urllib
from pyquery import PyQuery as pq
parser = argparse.ArgumentParser(
description='Download video resource from tudou.com',
epilog="Parse the url to video address using flvcd.com")
parser.add_argument('-... | apache-2.0 |
jef-n/QGIS | tests/src/python/test_qgspallabeling_tests.py | 30 | 14051 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPalLabeling: base suite of render check tests
Class is meant to be inherited by classes that test different labeling outputs
See <qgis-src-dir>/tests/testdata/labeling/README.rst for description.
.. note:: This program is free software; you can redistribute it and/or... | gpl-2.0 |
gw0/myhdl | myhdl/_resize.py | 1 | 4719 | # This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2013 Christopher L. Felton
#
# The myhdl library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published ... | lgpl-2.1 |
TribeMedia/sky_engine | tools/sort_sources.py | 68 | 5062 | #!/usr/bin/env python
# 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.
"""Given a GYP/GN filename, sort C-ish source files in that file.
Shows a diff and prompts for confirmation before doing the deed.
Wor... | bsd-3-clause |
XiaJieCom/change | Demo/days07/day07.py | 1 | 4725 |
'''
class Aniaml:
count = 10
def __init__(self,name):
self.name = name
self.num = None
hobbie = 'meat'
@classmethod #类方法,不能访问实例变量
def talk(self):
print('%s is talking ...'%self.hobbie )
@staticmethod #静态方法,不能访问类变量及实例变量
def walk():
print('is walking ...')... | lgpl-2.1 |
sabi0/intellij-community | python/lib/Lib/site-packages/django/contrib/messages/tests/user_messages.py | 241 | 2619 | from django import http
from django.contrib.auth.models import User
from django.contrib.messages.storage.user_messages import UserMessagesStorage,\
LegacyFallbackStorage
from django.contrib.messages.tests.base import skipUnlessAuthIsInstalled
from django.contrib.messages.tests.cookie import set_cookie_data
from dja... | apache-2.0 |
mikhaelfelian/PROJECT-RESTO-TIGERA | assets/tinymce/filemanager/connectors/py/connector.py | 9 | 22350 | #!/usr/bin/env python
"""
FCKeditor - The text editor for internet
Copyright (C) 2003-2005 Frederico Caldeira Knabben
Licensed under the terms of the GNU Lesser General Public License:
http://www.opensource.org/licenses/lgpl-license.php
For further information visit:
http://www.fckeditor.net/
"Suppo... | gpl-2.0 |
gregbdunn/aws-ec2rescue-linux | tools/moduletests/unit/test_arpcache.py | 2 | 12661 | # Copyright 2016-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#
# or in the "license" f... | apache-2.0 |
sagarghuge/recurringtask | GTG/gtk/editor/notify_dialog.py | 1 | 2066 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | gpl-3.0 |
saltastro/polsalt | polsalt/specpolwollaston.py | 1 | 2770 |
"""
specpolsplit
Split O and E beams
"""
import numpy as np
from scipy.interpolate import interp1d
from scipy.ndimage.interpolation import shift
from specpolutils import rssmodelwave
def read_wollaston(hdu, wollaston_file):
""" Correct the O or E beam for distortion due to the beam splitter
Parameters... | bsd-3-clause |
Fritz449/SRLF | algos/a3c_discrete.py | 1 | 15229 | import tensorflow as tf
import numpy as np
import os
import sys
import random
import subprocess
from redis import Redis
import time
sys.path.append(os.path.realpath(".."))
import helpers.utils as hlp
from models.feed_forward import FFDiscrete
class A3CDiscreteTrainer(FFDiscrete):
def __init__(self, sess, args):... | apache-2.0 |
varunarya10/nova_test_latest | nova/virt/libvirt/guest.py | 4 | 13570 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# Copyright (c) 2013 Hewlett-Pa... | apache-2.0 |
HerlonNascimento/namebench | libnamebench/nameserver_test.py | 175 | 7015 | #!/usr/bin/env python
# Copyright 2009 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... | apache-2.0 |
munkiat/libcloud | docs/examples/compute/vmware_vcloud_1.5.py | 60 | 2076 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import libcloud.security
# Skip this step if you are launching nodes on an official vCloud
# provider. It is intended only for self signed SSL certs in
# vanilla vCloud Director v1.5 test deployments.
# Note: Code like this ... | apache-2.0 |
jjscarafia/odoo | openerp/tools/which.py | 456 | 6884 | #!/usr/bin/env python
""" Which - locate a command
* adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch
* see http://bugs.python.org/issue444582
* uses ``PATHEXT`` on Windows
* searches current directory before ``PATH`` on Windows,
but not before an explicitly passed ... | agpl-3.0 |
aarticianpc/greenpointtrees | src/paypal/pro/migrations/0001_initial.py | 12 | 2843 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | mit |
kmspriyatham/symath | scipy/scipy/sparse/construct.py | 2 | 19642 | """Functions to construct sparse matrices
"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum',
'hstack', 'vstack', 'bmat', 'rand', 'diags', 'block_diag']
from warnings import warn
import nu... | apache-2.0 |
nagyistoce/odoo-dev-odoo | addons/base_setup/res_config.py | 261 | 5089 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
psdh/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/whitespace.py | 1730 | 1142 | from __future__ import absolute_import, division, unicode_literals
import re
from . import _base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(_base.Filter):
spacePreserveElements = frozenset... | mpl-2.0 |
superdesk/superdesk-core | superdesk/io/feeding_services/file_service.py | 2 | 8059 | # -*- 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
import loggi... | agpl-3.0 |
ATIX-AG/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py | 8 | 79001 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
Qalthos/ansible | test/units/module_utils/test_hetzner.py | 31 | 7252 | # Copyright: (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import copy
import json
import pytest
from mock import MagicMock
from ansible.module_utils import hetzner
class ModuleFailException(Exception):
def __init__(self, msg, **kwargs):
... | gpl-3.0 |
fergalbyrne/nupic | examples/opf/experiments/multistep/hotgym/permutations.py | 38 | 3713 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | agpl-3.0 |
ncrocfer/weevely3 | testsuite/test_file_download.py | 14 | 4127 | from testsuite.base_test import BaseTest
from testfixtures import log_capture
from testsuite import config
from core.sessions import SessionURL
from core import modules
from core import messages
import subprocess
import tempfile
import datetime
import logging
import os
class FileDOwnload(BaseTest):
def setUp(self... | gpl-3.0 |
CERNDocumentServer/invenio | modules/bibformat/lib/elements/bfe_record_stats.py | 1 | 10296 | # This file is part of Invenio.
# Copyright (C) 2009, 2010, 2011 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 version.
#
# ... | gpl-2.0 |
Netflix/security_monkey | security_monkey/auditors/openstack/openstack_security_group.py | 1 | 1657 | # Copyright (c) 2017 AT&T Intellectual Property. 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
#
... | apache-2.0 |
dd00/commandergenius | project/jni/python/src/Lib/test/test_popen2.py | 51 | 3151 | #! /usr/bin/env python
"""Test script for popen2.py"""
import warnings
warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*",
DeprecationWarning)
warnings.filterwarnings("ignore", "os\.popen. is deprecated.*",
DeprecationWarning)
import os
import sys
impor... | lgpl-2.1 |
dudepare/django | django/middleware/gzip.py | 478 | 1831 | import re
from django.utils.cache import patch_vary_headers
from django.utils.text import compress_sequence, compress_string
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compression.
It sets the Vary header acco... | bsd-3-clause |
prculley/gramps | gramps/gui/widgets/selectionwidget.py | 3 | 31444 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2013 Artem Glebov <artem.glebov@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, ... | gpl-2.0 |
596acres/livinglots-philly | livinglotsphilly/survey/forms.py | 2 | 1197 | from django import forms
from django.contrib.contenttypes.models import ContentType
from forms_builder.forms.forms import FormForForm
from .models import SurveyFieldEntry, SurveyFormEntry
class SurveyFormForForm(FormForForm):
field_entry_model = SurveyFieldEntry
content_type = forms.ModelChoiceField(
... | gpl-3.0 |
stanlyxiang/incubator-hawq | depends/thirdparty/googletest/googletest/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | apache-2.0 |
Mistobaan/tensorflow | tensorflow/compiler/tests/xla_device_test.py | 76 | 1639 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
xiangel/hue | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_ipv6.py | 117 | 2847 | from __future__ import unicode_literals
from django.utils import unittest
from django.utils.ipv6 import is_valid_ipv6_address, clean_ipv6_address
class TestUtilsIPv6(unittest.TestCase):
def test_validates_correct_plain_address(self):
self.assertTrue(is_valid_ipv6_address('fe80::223:6cff:fe8a:2e8a'))
... | apache-2.0 |
nishigori/boto | boto/s3/bucketlogging.py | 153 | 3183 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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
# without limitation the rights to use, copy, modi... | mit |
jbfavre/exaproxy | lib/exaproxy/util/cache.py | 4 | 1214 | # encoding: utf-8
try:
from collections import OrderedDict
except ImportError:
# support installable ordereddict module in older python versions
from ordereddict import OrderedDict
from time import time
class TimeCache (dict):
__default = object()
def __init__ (self,timeout):
self.timeout = timeout
self.la... | bsd-2-clause |
SmartElect/SmartElect | civil_registry/migrations/0001_initial.py | 1 | 5409 | # Generated by Django 2.2 on 2019-05-03 14:05
import civil_registry.models
from django.db import migrations, models
import libya_elections.libya_bread
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Citizen',... | apache-2.0 |
nirmeshk/oh-mainline | vendor/packages/Django/django/conf/__init__.py | 95 | 9136 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import logging
import os
import sys
import time # Needed fo... | agpl-3.0 |
epssy/hue | desktop/core/ext-py/pysaml2-2.4.0/example/idp2_repoze/idp_user.py | 33 | 1617 | USERS = {
"haho0032": {
"sn": "Hoerberg",
"givenName": "Hans",
"eduPersonScopedAffiliation": "staff@example.com",
"eduPersonPrincipalName": "haho@example.com",
"uid": "haho",
"eduPersonTargetedID": "one!for!all",
"c": "SE",
"o": "Example Co.",
... | apache-2.0 |
moijes12/oh-mainline | vendor/packages/Django/django/middleware/common.py | 101 | 7433 | import hashlib
import logging
import re
from django.conf import settings
from django import http
from django.core.mail import mail_managers
from django.utils.http import urlquote
from django.utils import six
from django.core import urlresolvers
logger = logging.getLogger('django.request')
class CommonMiddleware(ob... | agpl-3.0 |
neumerance/deploy | .venv/lib/python2.7/site-packages/requests/structures.py | 67 | 3576 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import os
import collections
from itertools import islice
class IteratorProxy(object):
"""docstring for IteratorProxy"""
def __init__(self, i):
self.i = i
# self.i = chain.from_iter... | apache-2.0 |
xq262144/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/metadata.py | 31 | 24394 | #!/usr/bin/env python
from saml2.md import AttributeProfile
from saml2.sigver import security_context
from saml2.config import Config
from saml2.validate import valid_instance
from saml2.time_util import in_a_while
from saml2.extension import mdui
from saml2.extension import idpdisc
from saml2.extension import shibmd
f... | apache-2.0 |
mysz/versionner | versionner/config.py | 2 | 5820 | """Configuration-related classes for versionner"""
import codecs
import configparser
import pathlib
import re
import sys
from versionner import defaults
ENV_VERSIONNER_PROJECT_CONFIG_FILE = 'VERSIONNER_PROJECT_CONFIG_FILE'
# pylint: disable=too-many-instance-attributes,too-few-public-methods
class FileConfig:
... | mit |
jimmymunoz/jeuxdemots | public/package/node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | bsd-3-clause |
williamthegrey/swift | test/unit/proxy/controllers/test_account.py | 2 | 15815 | # Copyright (c) 2010-2012 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 agree... | apache-2.0 |
applicationdevm/XlsxWriter | xlsxwriter/test/comparison/test_chart_name04.py | 8 | 1935 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
nmearl/pyqtgraph | pyqtgraph/SRTTransform3D.py | 45 | 10879 | # -*- coding: utf-8 -*-
from .Qt import QtCore, QtGui
from .Vector import Vector
from .Transform3D import Transform3D
from .Vector import Vector
import numpy as np
class SRTTransform3D(Transform3D):
"""4x4 Transform matrix that can always be represented as a combination of 3 matrices: scale * rotate * translate
... | mit |
sander76/home-assistant | homeassistant/components/thethingsnetwork/sensor.py | 5 | 4925 | """Support for The Things Network's Data storage integration."""
import asyncio
import logging
import aiohttp
from aiohttp.hdrs import ACCEPT, AUTHORIZATION
import async_timeout
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
ATT... | apache-2.0 |
slowfranklin/samba | source4/heimdal/lib/wind/rfc3454.py | 88 | 2296 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id$
# Copyright (c) 2004 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | gpl-3.0 |
rockneurotiko/django | tests/field_deconstruction/tests.py | 189 | 18358 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.test import SimpleTestCase, override_settings
from django.test.utils import isolate_lru_cache
from django.utils import six
class FieldDeconstructionTests(SimpleTestCase):
"""
Tests the deconstruct() ... | bsd-3-clause |
aaigner/LIGGGHTS-PUBLIC | python/install.py | 2 | 2208 | #!/usr/bin/env python
# copy LIGGGHTS src/libliggghts.so and liggghts.py to system dirs
instructions = """
Syntax: python install.py [-h] [libdir] [pydir]
libdir = target dir for src/libliggghts.so, default = /usr/local/lib
pydir = target dir for liggghts.py, default = Python site-packages dir
"""
im... | gpl-2.0 |
turon/openthread | tests/scripts/thread-cert/Cert_5_1_10_RouterAttachLinkQuality.py | 1 | 6969 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... | bsd-3-clause |
kingland/runtime | deps/v8/tools/testrunner/server/main.py | 12 | 8953 | # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | apache-2.0 |
alikins/ansible | lib/ansible/module_utils/network/common/config.py | 38 | 13532 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
Thhhza/XlsxWriter | xlsxwriter/test/comparison/test_chart_title01.py | 8 | 1535 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
trbs/django-oauth-toolkit | oauth2_provider/ext/rest_framework/permissions.py | 11 | 1922 | import logging
from django.core.exceptions import ImproperlyConfigured
from rest_framework.permissions import BasePermission
from ...settings import oauth2_settings
log = logging.getLogger('oauth2_provider')
SAFE_HTTP_METHODS = ['GET', 'HEAD', 'OPTIONS']
class TokenHasScope(BasePermission):
"""
The requ... | bsd-2-clause |
saurabh6790/OFF-RISAPP | patches/april_2013/p05_update_file_data.py | 30 | 2406 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes, webnotes.utils, os
def execute():
webnotes.reload_doc("core", "doctype", "file_data")
webnotes.reset_perms("File Data")
singles = get_single_doctypes()
for doctype... | agpl-3.0 |
wyvernnot/learn_python_through_unittest | tests/ClassMagicTest.py | 1 | 2708 | import unittest
from unittest.mock import Mock
class ClassMagicTest(unittest.TestCase):
def test_new(self):
class A(object):
def __new__(cls, *args, **kwargs):
# 重载 __new__ 必须返回
return object.__new__(cls, *args, **kwargs)
def __init__(self):
... | mit |
kaushik94/boto | boto/ec2/reservedinstance.py | 17 | 12948 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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
# without limitation the rights to use, copy, modi... | mit |
bqbn/addons-server | src/olympia/git/tests/test_admin.py | 1 | 2320 | from django.contrib.admin.sites import AdminSite
from pyquery import PyQuery as pq
from olympia.amo.tests import TestCase, addon_factory, user_factory
from olympia.amo.urlresolvers import reverse
from olympia.git.admin import GitExtractionEntryAdmin
from olympia.git.models import GitExtractionEntry
class TestGitExt... | bsd-3-clause |
pranavtendolkr/horizon | openstack_dashboard/dashboards/admin/metadata_defs/urls.py | 62 | 1253 | # (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | apache-2.0 |
ghtmtt/QGIS | tests/src/python/test_layer_dependencies.py | 31 | 14442 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSnappingUtils (complement to C++-based tests)
.. 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 ... | gpl-2.0 |
topxiaoke/myedx | lms/djangoapps/certificates/migrations/0011_auto__del_field_generatedcertificate_certificate_id__add_field_generat.py | 188 | 5961 | # -*- 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):
# Deleting field 'GeneratedCertificate.certificate_id'
db.delete_column('certificates_generatedcertificate',... | agpl-3.0 |
JuliBakagianni/CEF-ELRC | lib/python2.7/site-packages/django/conf/locale/pt/formats.py | 232 | 1532 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \de F \de Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'j \de F \de Y à... | bsd-3-clause |
catlinman/input-dungeon | interface.py | 1 | 5859 |
# This interface module contains additional behavior for curses to make it more suited for
# the current aim of this project. It enables quick interaction between curses and the
# actual game while still attempting to be flexible and expendable at the same time.
# Developer note: It should be good practice to allow t... | mit |
robinro/ansible-modules-core | cloud/google/gce_pd.py | 51 | 9869 | #!/usr/bin/python
# Copyright 2013 Google 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 vers... | gpl-3.0 |
jhartford/pybo | tests/test_acquisitions.py | 1 | 1134 | """
Unit tests for different acquisition functions. This mainly tests that the
gradients of each acquisition function are computed correctly.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import numpy as np
import num... | bsd-2-clause |
egor-tensin/sorting_algorithms | algorithms/impl/heapsort.py | 2 | 1858 | # Copyright (c) 2015 Egor Tensin <Egor.Tensin@gmail.com>
# This file is part of the "Sorting algorithms" project.
# For details, see https://github.com/egor-tensin/sorting-algorithms.
# Distributed under the MIT License.
import sys
from ..algorithm import SortingAlgorithm
# Disclaimer: implemented in the most litera... | mit |
mlcommons/training | single_stage_detector/ssd/distributed.py | 1 | 3611 | import torch
from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
import torch.distributed as dist
from torch.nn.modules import Module
'''
This version of DistributedDataParallel is designed to be used in conjunction with the multiproc.py
launcher included with this example. It assumes that your r... | apache-2.0 |
amir-qayyum-khan/edx-platform | lms/djangoapps/courseware/tests/test_lti_integration.py | 10 | 9292 | """LTI integration tests"""
from collections import OrderedDict
import json
import mock
from nose.plugins.attrib import attr
import oauthlib
import urllib
from django.conf import settings
from django.core.urlresolvers import reverse
from courseware.tests import BaseTestXmodule
from courseware.views.views import get_... | agpl-3.0 |
Thhhza/XlsxWriter | xlsxwriter/test/worksheet/test_worksheet04.py | 8 | 2180 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
from ...format ... | bsd-2-clause |
bobobox/ansible | lib/ansible/module_utils/dellos6.py | 21 | 8111 |
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still ... | gpl-3.0 |
stxnext-csr/volontulo | apps/volontulo/models.py | 1 | 10920 | # -*- coding: utf-8 -*-
u"""
.. module:: models
"""
import logging
import os
# pylint: disable=unused-import
import uuid
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models import F
from django.utils import timezone
logger = logging.getLogg... | mit |
WendellDuncan/or-tools | examples/data/nonogram_regular/nonogram_p200.py | 74 | 1810 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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... | apache-2.0 |
pennersr/django-allauth | allauth/socialaccount/providers/draugiem/tests.py | 2 | 4796 | from hashlib import md5
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.urls import reverse
from django.utils.http import urlencode
from allauth.socialaccount import providers
from allauth.socialaccount.models import SocialApp, SocialToken
from allauth.tests import... | mit |
40223117cda/w16cdaa | static/Brython3.1.0-20150301-090019/Lib/multiprocessing/pool.py | 694 | 23263 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import time
from multiprocessing ... | gpl-3.0 |
peterbarker/MAVProxy | MAVProxy/modules/mavproxy_antenna.py | 16 | 2064 | #!/usr/bin/env python
'''
antenna pointing module
Andrew Tridgell
June 2012
'''
import sys, os, time
from cuav.lib import cuav_util
from MAVProxy.modules.lib import mp_module
class AntennaModule(mp_module.MPModule):
def __init__(self, mpstate):
super(AntennaModule, self).__init__(mpstate, "antenna", "ante... | gpl-3.0 |
garnaat/boto | boto/sns/__init__.py | 131 | 2117 | # Copyright (c) 2010-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
#
# 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, includin... | mit |
jbedorf/tensorflow | tensorflow/contrib/gan/python/eval/python/summaries_impl.py | 5 | 11802 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
jcoady9/youtube-dl | youtube_dl/extractor/beatportpro.py | 142 | 3423 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import int_or_none
class BeatportProIE(InfoExtractor):
_VALID_URL = r'https?://pro\.beatport\.com/track/(?P<display_id>[^/]+)/(?P<id>[0-9]+)'
_TESTS = [{
'... | unlicense |
nhuntwalker/astroML | examples/algorithms/plot_bayesian_blocks.py | 3 | 2706 | """
Bayesian Blocks for Histograms
------------------------------
.. currentmodule:: astroML
Bayesian Blocks is a dynamic histogramming method which optimizes one of
several possible fitness functions to determine an optimal binning for
data, where the bins are not necessarily uniform width. The astroML
implementatio... | bsd-2-clause |
jalavik/invenio-records | invenio_records/providers/recid.py | 4 | 1834 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 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... | gpl-2.0 |
cycotech/WAR-app | env/lib/python3.5/site-packages/django/conf/locale/fr/formats.py | 504 | 1454 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETI... | mit |
linjoahow/W16_test1 | static/Brython3.1.3-20150514-095342/Lib/VFS_import.py | 738 | 3059 | import os
from browser import doc
#_scripts=doc.createElement('script')
#_scripts.src="/src/py_VFS.js"
#_scripts.type="text/javascript"
#doc.get(tag='head')[0].appendChild(_scripts)
VFS=dict(JSObject(__BRYTHON__.py_VFS))
class VFSModuleFinder:
def __init__(self, path_entry):
print("in VFSModuleFinder")
... | gpl-3.0 |
antonve/s4-project-mooc | lms/djangoapps/instructor/access.py | 83 | 2634 | """
Access control operations for use by instructor APIs.
Does not include any access control, be sure to check access before calling.
TO DO sync instructor and staff flags
e.g. should these be possible?
{instructor: true, staff: false}
{instructor: true, staff: true}
"""
import logging
from djan... | agpl-3.0 |
guewen/odoo | openerp/report/render/rml2pdf/__init__.py | 381 | 1101 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
gechr/ansible-modules-extras | packaging/os/slackpkg.py | 131 | 6382 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kim Nørgaard
# Written by Kim Nørgaard <jasen@jasen.dk>
# Based on pkgng module written by bleader <bleader@ratonland.org>
# that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <htt... | gpl-3.0 |
KohlsTechnology/ansible | lib/ansible/modules/utilities/logic/async_status.py | 22 | 3006 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# 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... | gpl-3.0 |
bplancher/odoo | addons/account_tax_exigible/models/account_move.py | 12 | 1726 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import fields, models, api
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
tax_exigible = fields.Boolean(string='Appears in VAT report', default=True,
help="Technical fi... | agpl-3.0 |
TylerKirby/cltk | cltk/stem/akkadian/cv_pattern.py | 2 | 2145 | """
Return a CV patterned string based on the word.
"""
__author__ = ['M. Willis Monroe <willismonroe@gmail.com>']
__license__ = 'MIT License. See LICENSE.'
from cltk.stem.akkadian.syllabifier import AKKADIAN
class CVPattern(object):
"""Return a patterned string representing the consonants
and vowels of th... | mit |
ky822/scikit-learn | sklearn/utils/estimator_checks.py | 9 | 51912 | from __future__ import print_function
import types
import warnings
import sys
import traceback
import inspect
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash, Memory
from sklearn.ut... | bsd-3-clause |
Rav3nPL/doubloons-0.10 | qa/rpc-tests/mempool_coinbase_spends.py | 143 | 3850 | #!/usr/bin/env python2
# Copyright (c) 2014 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 re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly) coin... | mit |
kmggh/python-guess-number | guess_num_player.py | 1 | 1325 | #!/usr/bin/env python
# Fri 2013-05-03 23:49:55 -0400
# Copyright (c) 2013 by Ken Guyton. All Rights Reserved.
"""A game for guessing a number. Used as a Python class example.
A computer player plays the game.
"""
__author__ = 'Ken Guyton'
import argparse
import guess_num2
import player
MAX_DEFAULT = 100
MIN_DEF... | artistic-2.0 |
rpip/mpower-python | setup.py | 2 | 2405 | from setuptools import setup, Command
from unittest import TextTestRunner, TestLoader
from glob import glob
from os.path import splitext, basename, join as pjoin
try:
from os.path import walk
except ImportError:
from os import walk
import os
class TestCommand(Command):
user_options = []
def initializ... | mit |
diofant/diofant | diofant/core/power.py | 1 | 47841 | import math
from mpmath.libmp import sqrtrem as mpmath_sqrtrem
from ..logic import true
from ..utilities import sift
from .add import Add
from .cache import cacheit
from .compatibility import as_int
from .evalf import PrecisionExhausted
from .evaluate import global_evaluate
from .expr import Expr
from .function impor... | bsd-3-clause |
openaid-IATI/deprecated-version-OIPA-v2 | iati/data/migrations/0013_auto__add_field_country_dac_region_code__add_field_country_dac_region_.py | 1 | 19581 | # -*- 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):
# Adding field 'Country.dac_region_code'
db.add_column('data_country', 'dac_region_code',
... | agpl-3.0 |
axsauze/eventsfinder | django/db/backends/postgresql_psycopg2/creation.py | 107 | 4139 | import psycopg2.extensions
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can conta... | bsd-3-clause |
Exterminus/harpia | harpia/bpGUI/matchTem.py | 2 | 8161 | # -*- coding: utf-8 -*-
# [HARPIA PROJECT]
#
#
# S2i - Intelligent Industrial Systems
# DAS - Automation and Systems Department
# UFSC - Federal University of Santa Catarina
# Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org),
# Guilh... | gpl-2.0 |
pschella/scipy | scipy/_lib/tests/test__util.py | 25 | 2076 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_equal, assert_, assert_raises
from scipy._lib._util import _aligned_zeros, check_random_state
def test__aligned_zeros():
niter = 10
def check(shape, dtype, order, align):
err_msg = r... | bsd-3-clause |
seanli9jan/tensorflow | tensorflow/contrib/memory_stats/__init__.py | 53 | 1224 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.