repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
BehavioralInsightsTeam/edx-platform | common/lib/xmodule/xmodule/tests/test_word_cloud.py | 13 | 1806 | # -*- coding: utf-8 -*-
"""Test for Word cloud Xmodule functional logic."""
from webob.multidict import MultiDict
from xmodule.word_cloud_module import WordCloudDescriptor
from . import LogicTest
class WordCloudModuleTest(LogicTest):
"""Logic tests for Word Cloud Xmodule."""
shard = 1
descriptor_class = ... | agpl-3.0 |
rjschof/gem5 | configs/example/arm/devices.py | 3 | 9394 | # Copyright (c) 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
jonnatas/codeschool | old/cs_questions/migrations/old/0002_auto_20160501_1934.py | 3 | 1252 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-01 22:34
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import picklefield.fields
class Migration(migrations.Migration):
dependencies = [
('cs_core', '0001_initial'),
... | gpl-3.0 |
Pluto-tv/blink-crosswalk | Tools/Scripts/webkitpy/layout_tests/breakpad/dump_reader_win.py | 50 | 5429 | # Copyright (C) 2013 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 of conditions and the ... | bsd-3-clause |
pokowaka/xbmc | lib/gtest/test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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... | gpl-2.0 |
Beyond-Imagination/BlubBlub | RaspberryPI/django-env/lib/python3.4/site-packages/django/db/backends/base/creation.py | 44 | 12033 | import sys
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.db import router
from django.utils.six import StringIO
from django.utils.six.moves import input
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PRE... | gpl-3.0 |
bmihelac/django-shop | shop/migrations/0009_auto__chg_field_order_order_total__chg_field_order_order_subtotal__chg.py | 14 | 13276 | # -*- 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):
# Changing field 'Order.order_total'
db.alter_column('shop_order', 'order_total', self.gf('django.db.models... | bsd-3-clause |
Logicalmars/appengine-keeptrack | pytz/zoneinfo/PRC.py | 9 | 1090 | '''tzinfo timezone information for PRC.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class PRC(DstTzInfo):
'''PRC timezone definition. See datetime.tzinfo for details'''
zone = 'PRC'
_utc_transition_times = [
d(1,1,1,0,... | bsd-3-clause |
fduraffourg/servo | tests/wpt/web-platform-tests/tools/py/py/_process/cmdexec.py | 273 | 1814 | import sys
import subprocess
import py
from subprocess import Popen, PIPE
def cmdexec(cmd):
""" return unicode output of executing 'cmd' in a separate process.
raise cmdexec.Error exeception if the command failed.
the exception will provide an 'err' attribute containing
the error-output from the comma... | mpl-2.0 |
mancoast/CPythonPyc_test | cpython/274_test_threading_local.py | 95 | 6671 | import unittest
from doctest import DocTestSuite
from test import test_support
import weakref
import gc
# Modules under test
_thread = test_support.import_module('thread')
threading = test_support.import_module('threading')
import _threading_local
class Weak(object):
pass
def target(local, weaklist):
weak =... | gpl-3.0 |
xuld/dark | apps/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/make.py | 30 | 87831 | # 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... | bsd-3-clause |
UTSA-ICS/keystone-SID | keystone/token/backends/kvs.py | 5 | 14879 | # -*- coding: utf-8 -*-
# Copyright 2013 Metacloud, Inc.
# Copyright 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... | apache-2.0 |
CAST-Extend/com.castsoftware.uc.checkanalysiscompleteness | xlsxwriter/chart_area.py | 14 | 2710 | ###############################################################################
#
# ChartArea - A class for writing the Excel XLSX Area charts.
#
# Copyright 2013-2015, John McNamara, jmcnamara@cpan.org
#
from . import chart
class ChartArea(chart.Chart):
"""
A class for writing the Excel XLSX Area charts.
... | mit |
rrampage/rethinkdb | external/v8_3.30.33.16/build/gyp/pylib/gyp/win_tool.py | 58 | 11526 | #!/usr/bin/env python
# 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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | agpl-3.0 |
LLNL/spack | var/spack/repos/builtin/packages/r-yapsa/package.py | 5 | 2102 | # 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 RYapsa(RPackage):
"""Yet Another Package for Signature Analysis.
This package prov... | lgpl-2.1 |
miptliot/edx-platform | lms/djangoapps/shoppingcart/processors/tests/test_CyberSource2.py | 10 | 18446 | # -*- coding: utf-8 -*-
"""
Tests for the newer CyberSource API implementation.
"""
import ddt
from django.conf import settings
from django.test import TestCase
from mock import patch
from shoppingcart.models import Order, OrderItem
from shoppingcart.processors.CyberSource2 import (
_get_processor_exception_html,
... | agpl-3.0 |
stympy/ansible-modules-extras | system/filesystem.py | 38 | 8561 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@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 t... | gpl-3.0 |
rec/BiblioPixel | test/bibliopixel/control/address_test.py | 2 | 3376 | import unittest
from bibliopixel.control.address import Address
class AddressTest(unittest.TestCase):
def test_empty(self):
address = Address('')
self.assertFalse(address)
self.assertFalse(address.segments)
self.assertFalse(address.assignment)
self.assertEqual(address.get(... | mit |
adamcaudill/yawast | yawast/scanner/plugins/http/applications/wordpress.py | 1 | 7344 | # Copyright (c) 2013 - 2020 Adam Caudill and Contributors.
# This file is part of YAWAST which is released under the MIT license.
# See the LICENSE file or go to https://yawast.org/license/ for full license details.
import re
from typing import Tuple, Union, List, cast
from urllib.parse import urljoin
from packagi... | mit |
jmiserez/sts | tests/unit/sts/util/precompute_cache_test.py | 2 | 2034 | # Copyright 2011-2013 Colin Scott
# Copyright 2011-2013 Andreas Wundsam
#
# 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 |
xuru/pyvisdk | pyvisdk/do/cluster_power_on_vm_result.py | 1 | 1098 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ClusterPowerOnVmResult(vim, *args, **kwargs):
'''PowerOnVmResult is the base class of... | mit |
betoesquivel/fil2014 | build/django/build/lib.linux-x86_64-2.7/django/contrib/sessions/models.py | 173 | 1997 | from django.db import models
from django.utils.translation import ugettext_lazy as _
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
Returns the given session dictionary serialized and encoded as a string.
"""
return SessionStore().encode(session_dict)
... | mit |
romz-pl/romzdb | 3rdparty/googletest/googlemock/test/gmock_leak_test.py | 779 | 4384 | #!/usr/bin/env python
#
# Copyright 2009, 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... | gpl-3.0 |
CUCWD/edx-platform | common/test/acceptance/pages/lms/conditional.py | 47 | 1119 | """
Conditional Pages
"""
from bok_choy.page_object import PageObject
POLL_ANSWER = 'Yes, of course'
class ConditionalPage(PageObject):
"""
View of conditional page.
"""
url = None
def is_browser_on_page(self):
"""
Returns True if the browser is currently on the right page.
... | agpl-3.0 |
sergeykolychev/mxnet | tests/python/gpu/test_rtc.py | 61 | 1318 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
anpingli/openshift-ansible | roles/lib_openshift/src/lib/base.py | 2 | 21696 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-lines
# noqa: E301,E302,E303,T001
class OpenShiftCLIError(Exception):
'''Exception class for openshiftcli'''
pass
ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')]
def locate_oc_binary():
''' Find and return oc binar... | apache-2.0 |
IxLabs/lguest64 | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
HenrySeed/marvin | options.py | 2 | 1885 | import os.path
class Options():
def __init__(self):
scriptpath = os.path.dirname(__file__)
filename = os.path.join(scriptpath, 'options.txt')
lines = open(filename, 'r').read()
lines = lines.split('\n')
self.name, self.location = lines[0], lines[1]
self.public_key ... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/243_test_dircache.py | 17 | 2302 | """
Test cases for the dircache module
Nick Mathewson
"""
import unittest
from test.test_support import run_unittest, TESTFN
import dircache, os, time, sys, tempfile
class DircacheTests(unittest.TestCase):
def setUp(self):
self.tempdir = tempfile.mkdtemp()
def tearDown(self):
for fname i... | gpl-3.0 |
Lujeni/ansible | lib/ansible/modules/windows/win_eventlog_entry.py | 38 | 2212 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com>
# 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'],
'suppo... | gpl-3.0 |
cysuncn/python | spark/crm/PROC_M_R_RET_CUST_FLOW.py | 1 | 4734 | #coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_M_R_RET_CUST_FLOW').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.... | gpl-3.0 |
smourph/PGo-TrainerTools | pgoapi/protos/POGOProtos/Networking/Responses/DownloadItemTemplatesResponse_pb2.py | 10 | 18923 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Responses/DownloadItemTemplatesResponse.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _me... | gpl-3.0 |
thomastweets/PythonRSA | GUI_RSA.py | 1 | 15279 | ############################
### GUI for RS analysis ###
############################
import wx
import rsa
import os
import webbrowser
files_number = 0
class RSA_GUI(wx.Frame):
def __init__(self, parent, title):
super(RSA_GUI,self).__init__(parent, style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER, title =... | gpl-2.0 |
alanfgates/hive | service/lib/py/fb303_scripts/fb303_simple_mgmt.py | 171 | 5961 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
stevenbrichards/boto | tests/unit/cloudfront/test_invalidation_list.py | 114 | 4051 | #!/usr/bin/env python
import random
import string
from tests.compat import unittest, mock
import boto
RESPONSE_TEMPLATE = r"""
<InvalidationList>
<Marker/>
<NextMarker>%(next_marker)s</NextMarker>
<MaxItems>%(max_items)s</MaxItems>
<IsTruncated>%(is_truncated)s</IsTruncated>
%(inval_summaries)s
</Inva... | mit |
hojel/calibre | src/calibre/ebooks/oeb/polish/split.py | 11 | 18227 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import copy, os, re
from future_builtins import map
from urlparse import url... | gpl-3.0 |
pavelchristof/gomoku-ai | tensorflow/python/util/example_parser_configuration.py | 77 | 4715 | # 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... | apache-2.0 |
Vijfhoek/oyoyo | oyoyo/cmdhandler.py | 1 | 6875 | # Copyright (c) 2008 Duncan Fordyce
# 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, modify, merge, publish, distri... | mit |
nkgilley/home-assistant | tests/components/media_player/test_async_helpers.py | 14 | 8343 | """The tests for the Async Media player helper functions."""
import asyncio
import unittest
import homeassistant.components.media_player as mp
from homeassistant.const import (
STATE_IDLE,
STATE_OFF,
STATE_ON,
STATE_PAUSED,
STATE_PLAYING,
)
from tests.common import get_test_home_assistant
class ... | apache-2.0 |
benjaminjkraft/django | tests/gis_tests/gdal_tests/test_envelope.py | 335 | 3667 | import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.gdal import Envelope, GDALException
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
@skipUnless(HAS_GDAL, "GDAL is required")
class Env... | bsd-3-clause |
OpenNeuroLab/brainspell-neo | archive/sprite/brainsprite.py | 2 | 7440 | # Christian Dansereau 2016 Copyright
import os
import numpy as np
import nibabel as nib
from PIL import Image
import json
from nilearn.image import resample_img
import hashlib, time
import matplotlib.pyplot as plt
from shutil import copyfile
def _load_json_template():
data_file = """{
"canvas": "3Dviewer",
... | mit |
chosener/AITetris | cocos2d/download-deps.py | 30 | 12351 | #!/usr/bin/env python
#coding=utf-8
#
# ./download-deps.py
#
# Downloads Cocos2D-x 3rd party dependencies from github:
# https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin) and extracts the zip
# file
#
# Having the dependencies outside the official cocos2d-x repo helps prevent
# bloating the repo.
#
"""*********... | gpl-2.0 |
RIKSOF/scspell-jenkins | scspell_lib/_util.py | 1 | 1481 | ############################################################################
# scspell
# Copyright (C) 2009 Paul Pelzl
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation.
#
# This prog... | gpl-2.0 |
jordanemedlock/psychtruths | temboo/Library/Tumblr/Blog/RetrieveBlogFollowers.py | 5 | 5164 | # -*- coding: utf-8 -*-
###############################################################################
#
# RetrieveBlogFollowers
# Retrieves the count of followers for a specified Tumblr blog.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | apache-2.0 |
andresguisado/andresguisado.github.io | node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_scilab_builtins.py | 364 | 31261 | # -*- coding: utf-8 -*-
"""
pygments.lexers._scilab_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the ScilabLexer.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# These lists are generated automatically.
# Run the follo... | mit |
robotgear/robotgear | robotgear/settings.py | 1 | 3588 | """
Django settings for robotgear project.
Generated by 'django-admin startproject' using Django 1.11.7.
"""
import os
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.static... | mit |
sdklite/gyp | test/generator-output/gyptest-rules.py | 198 | 1768 | #!/usr/bin/env python
# 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.
"""
Verifies --generator-output= behavior when using rules.
"""
import TestGyp
# Android doesn't support --generator-output.
test = TestGy... | bsd-3-clause |
desertofunknown/Fallout-VaultOne | bot/NanoTrasenBot.py | 35 | 61351 | # -*- coding: utf-8 -*-
# This script is shared under the
# Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0)
# Added clause to Attribution:
# - You may not remove or hide the '<Bot_name> who created you?' functionality
# and you may not modify the name given in the response.
#CREDITS
# Author: Skibi... | agpl-3.0 |
djgagne/scikit-learn | examples/svm/plot_svm_anova.py | 250 | 2000 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature before running a SVC
(support vector classifier) to improve the classification scores.
"""
print(__doc__)
import... | bsd-3-clause |
nkgilley/home-assistant | tests/components/zwave/test_workaround.py | 24 | 2562 | """Test Z-Wave workarounds."""
from homeassistant.components.zwave import const, workaround
from tests.mock.zwave import MockNode, MockValue
def test_get_device_no_component_mapping():
"""Test that None is returned."""
node = MockNode(manufacturer_id=" ")
value = MockValue(data=0, node=node)
assert w... | apache-2.0 |
DEVSENSE/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/cp1256.py | 593 | 13070 | """ Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | apache-2.0 |
TheLady/audio-normalize | setup.py | 1 | 1535 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', '')
requirements = [
'docopt',
]
test_requirements = [
# '... | mit |
dstroppa/openstack-smartos-nova-grizzly | nova/netconf.py | 9 | 2142 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | apache-2.0 |
ShiYw/Sigil | 3rdparty/python/Lib/uu.py | 182 | 6755 | #! /usr/bin/env python3
# Copyright 1994 by Lance Ellinghouse
# Cathedral City, California Republic, United States of America.
# All Rights Reserved
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provid... | gpl-3.0 |
javierag/samba | third_party/dnspython/tests/resolver.py | 56 | 4279 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
alexmojaki/blaze | blaze/compute/utils.py | 14 | 2274 | from __future__ import absolute_import, division, print_function
from datetime import datetime
from decimal import Decimal
import sqlalchemy as sa
import sqlalchemy.orm
from toolz import curry
from datashape.predicates import isrecord
from ..expr import Field
from odo.backends.sql import dshape_to_alchemy
# This was... | bsd-3-clause |
commonsense/divisi | csc/divisi/flavors.py | 1 | 5345 | from csc.divisi.tensor import DictTensor
from csc.divisi.ordered_set import OrderedSet
from csc.divisi.labeled_view import LabeledView
def add_triple_to_matrix(matrix, triple, value=1.0):
'''
Adds a triple (left, relation, right) to the matrix in the 2D unfolded format.
This is the new add_assertion_tupl... | gpl-3.0 |
moyaproject/moya | moya/elements/registry.py | 1 | 4712 | from __future__ import unicode_literals
from .. import errors
from ..tools import extract_namespace
from .. import namespaces
from ..compat import itervalues
from collections import defaultdict
import inspect
class Meta(object):
logic_skip = False
virtual_tag = False
is_call = False
is_try = False
... | mit |
jjingrong/PONUS-1.2 | venv/build/django/django/contrib/gis/db/backends/postgis/introspection.py | 109 | 4592 | from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection
from django.contrib.gis.gdal import OGRGeomType
class GeoIntrospectionError(Exception):
pass
class PostGISIntrospection(DatabaseIntrospection):
# Reverse dictionary for PostGIS geometry types not populated until
# intro... | mit |
cmcqueen/simplerandom | python/python3/simplerandom/iterators/_iterators_py.py | 1 | 40947 |
from simplerandom._bitcolumnmatrix import BitColumnMatrix
__all__ = [
"Cong",
"SHR3",
"MWC1",
"MWC2",
"MWC64",
"KISS",
"KISS2",
"LFSR113",
"LFSR88",
"_traverse_iter",
]
def _traverse_iter(o, tree_types=(list, tuple)):
"""Iterate over nested containers and/or iterators.
... | mit |
obimod/taiga-back | settings/sr.py | 21 | 1178 | # Copyright (C) 2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2015 David Barragán <bameda@dbarragan.com>
# This program 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 F... | agpl-3.0 |
Ms2ger/presto-testo | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/demo/streaming/frame_based_client.py | 5 | 1983 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | bsd-3-clause |
marcore/edx-platform | openedx/core/djangolib/js_utils.py | 13 | 3536 | """
Utilities for dealing with Javascript and JSON.
"""
import json
from django.utils.html import escapejs
from mako.filters import decode
from markupsafe import escape
from xmodule.modulestore import EdxJSONEncoder
def _escape_json_for_js(json_dumps_string):
"""
Escape output of JSON dumps that is safe to ... | agpl-3.0 |
carljm/django | django/core/management/commands/sendtestemail.py | 126 | 1518 | import socket
from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = "Sends a test email to the email addresses specified as arguments."
missing_args_message = "You must specif... | bsd-3-clause |
rouault/Quantum-GIS | tests/src/python/test_qgsauthsystem.py | 21 | 35590 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for bindings to core authentication system classes
From build dir: LC_ALL=en_US.UTF-8 ctest -R PyQgsAuthenticationSystem -V
.. 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... | gpl-2.0 |
schlueter/ansible | test/units/modules/network/onyx/test_onyx_mlag_vip.py | 50 | 2942 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests.mock import patch
from ansible.modules.network.on... | gpl-3.0 |
CamAndPineapple/starrynight | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 240 | 99242 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | mit |
tchernomax/ansible | lib/ansible/modules/windows/win_domain_controller.py | 28 | 4039 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat, Inc.
# Copyright: (c) 2017, Ansible Project
# 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'],
... | gpl-3.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/sorl/thumbnail/management/commands/thumbnail.py | 7 | 2241 | # encoding=utf-8
from __future__ import unicode_literals, print_function
import sys
from django.core.management.base import BaseCommand, CommandError
from sorl.thumbnail import default
from sorl.thumbnail.images import delete_all_thumbnails
class Command(BaseCommand):
help = (
'Handles thumbnails and ... | bsd-3-clause |
TileHalo/servo | tests/wpt/web-platform-tests/cors/resources/preflight.py | 253 | 1238 | def main(request, response):
headers = [("Content-Type", "text/plain")]
if "check" in request.GET:
token = request.GET.first("token")
value = request.server.stash.take(token)
if value == None:
body = "0"
else:
if request.GET.first("check", None) == "keep"... | mpl-2.0 |
gbriones1/cloud-init | tests/unittests/test_handler/test_handler_seed_random.py | 7 | 7689 | # Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# Based on test_handler_set_hostname.py
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# ... | gpl-3.0 |
jelugbo/hebs_repo | common/djangoapps/student/tests/test_authz.py | 61 | 9217 | """
Tests authz.py
"""
import mock
from django.test import TestCase
from django.contrib.auth.models import User, AnonymousUser
from django.core.exceptions import PermissionDenied
from student.roles import CourseInstructorRole, CourseStaffRole, CourseCreatorRole
from student.tests.factories import AdminFactory
from st... | agpl-3.0 |
cloudbase/nova-virtualbox | nova/tests/unit/test_baserpc.py | 49 | 1619 | #
# Copyright 2013 - Red Hat, 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 ... | apache-2.0 |
wolverine2k/Secure-Deluge | deluge/ui/gtkui/createtorrentdialog.py | 2 | 16482 | #
# createtorrentdialog.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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... | gpl-3.0 |
dcosentino/edx-platform | lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py | 114 | 9808 | # -*- 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 model 'PaidCourseRegistrationAnnotation'
db.create_table('shoppingcart_paidcourseregistrationannota... | agpl-3.0 |
valtech-mooc/edx-platform | cms/djangoapps/contentstore/views/assets.py | 25 | 14681 | import logging
from functools import partial
import math
import json
from django.http import HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.http... | agpl-3.0 |
pombredanne/pythran | pythran/optimizations/gen_exp_to_imap.py | 3 | 2812 | """ GenExpToImap transforms generator expressions into iterators. """
from pythran.analyses import OptimizableComprehension
from pythran.passmanager import Transformation
from pythran.transformations import NormalizeTuples
import ast
class GenExpToImap(Transformation):
'''
Transforms generator expressions i... | bsd-3-clause |
Bysmyyr/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/rsa/tests/test_pkcs1.py | 34 | 2949 | '''Tests string operations.'''
import struct
import unittest2
import rsa
from rsa import pkcs1
from rsa._compat import byte, is_integer, b, is_bytes
class BinaryTest(unittest2.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(256)
def test_enc_dec(self):
message = struct.pack... | bsd-3-clause |
thnee/ansible | test/units/modules/network/fortios/test_fortios_application_rule_settings.py | 21 | 7349 | # Copyright 2019 Fortinet, Inc.
#
# 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.
#
# This program is distributed in the... | gpl-3.0 |
Mendeley/mrec | mrec/mf/wrmf.py | 3 | 3746 | """
Weighted Regularize Matrix Factorization by alternating least squares.
See:
Y. Hu, Y. Koren and C. Volinsky, Collaborative filtering for implicit feedback datasets, ICDM 2008.
http://research.yahoo.net/files/HuKorenVolinsky-ICDM08.pdf
R. Pan et al., One-class collaborative filtering, ICDM 2008.
http://www.hpl.hp.c... | bsd-3-clause |
Akrog/cinder | cinder/tests/api/contrib/test_hosts.py | 4 | 8123 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
bpshetty/erpnext | erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py | 32 | 6129 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import formatdate, getdate, flt, add_days
def execute(filters=None):
filters.day_before_from_date = add_d... | gpl-3.0 |
sominn/android_kernel_samsung_golden | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
fursund/EmguCV-Unity | opencv/tests/swig_python/highgui/size_test.py | 3 | 1361 | """
This script will test HighGUI's cvGetCaptureProperty functionality
for correct returnvalues of width and height information for different video formats
"""
# import the necessary things for OpenCV and comparson routine
import os
from cv import *
from highgui import *
#import python
#from python.highgui import *
... | gpl-3.0 |
fangxingli/hue | desktop/core/ext-py/Django-1.6.10/tests/lookup/models.py | 107 | 1557 | """
7. The lookup API
This demonstrates features of the database API.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
class... | apache-2.0 |
SUSE/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/stateless_service_description.py | 2 | 5839 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
jymannob/CouchPotatoServer | libs/pyutil/nummedobj.py | 106 | 2141 | # Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# mailto:zooko@zooko.com
# This file is part of pyutil; see README.rst for licensing terms.
import dictutil
class NummedObj(object):
"""
This is useful for nicer debug printouts. Instead of objects of the same class being
distinguished from one another by t... | gpl-3.0 |
JackDanger/sentry | tests/sentry/utils/http/tests.py | 3 | 10681 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from django.http import HttpRequest
from sentry import options
from sentry.models import Project
from sentry.testutils import TestCase
from sentry.utils.http import (
is_same_domain, is_valid_origin, get_origins,... | bsd-3-clause |
gizmag/django-mobile | django_mobile/conf.py | 7 | 1527 | # -*- coding: utf-8 -*-
from django.conf import settings as django_settings
CACHE_LOADER_NAME = 'django_mobile.loader.CachedLoader'
DJANGO_MOBILE_LOADER = 'django_mobile.loader.Loader'
class SettingsProxy(object):
def __init__(self, settings, defaults):
self.settings = settings
self.defaults = de... | bsd-3-clause |
massot/account-invoice-reporting | __unported__/account_invoice_delivery_address/__openerp__.py | 7 | 1709 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
Frenzie/youtube-dl | youtube_dl/extractor/quickvid.py | 113 | 1719 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
determine_ext,
int_or_none,
)
class QuickVidIE(InfoExtractor):
_VALID_URL = r'https?://(www\.)?quickvid\.org/watch\.php\?v=(?P<id>[a-zA-Z_0-9-]+)'
_... | unlicense |
Plain-Andy-legacy/android_external_chromium_org | tools/perf/page_sets/tough_animation_cases.py | 33 | 3532 | # 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class ToughAnimationCasesPage(page_module.Page):
de... | bsd-3-clause |
GNOME/gedit-plugins | plugins/commander/modules/align.py | 1 | 8900 | # -*- coding: utf-8 -*-
#
# align.py - align commander module
#
# Copyright (C) 2010 - Jesse van den Kieboom
#
# 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 Licens... | gpl-2.0 |
mtlchun/edx | common/lib/symmath/symmath/test_symmath_check.py | 166 | 2648 | from unittest import TestCase
from .symmath_check import symmath_check
class SymmathCheckTest(TestCase):
def test_symmath_check_integers(self):
number_list = [i for i in range(-100, 100)]
self._symmath_check_numbers(number_list)
def test_symmath_check_floats(self):
number_list = [i + ... | agpl-3.0 |
vmturbo/nova | nova/tests/unit/api/openstack/compute/test_attach_interfaces.py | 3 | 21862 | # Copyright 2012 SINA Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
Teagan42/home-assistant | homeassistant/components/google_assistant/const.py | 1 | 4660 | """Constants for Google Assistant."""
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
climate,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
)
DOMAIN = "google_assist... | apache-2.0 |
LoyolaCSDepartment/LDA-ICPC-2014 | topic-models/topic-count/xmlsplit.py | 1 | 1409 | #! /usr/bin/env /usr/bin/python3
import os
import sys
def ensure_dir(f):
d = os.path.dirname(f)
if not os.path.exists(d):
os.makedirs(d)
def xmlSplit(infile_name, dest_dir):
try:
# in_file = open('{0}{1}'.format(folder, filename), 'r', encoding='latin_1')
in_file = open(infile_name, 'r', encoding='... | mit |
glennmatthews/cot | COT/vm_description/ovf/hardware.py | 1 | 24156 | #!/usr/bin/env python
#
# hardware.py - OVFHardware class
#
# June 2016, Glenn F. Matthews
# Copyright (c) 2013-2016, 2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
# This file is pa... | mit |
kevalds51/sympy | sympy/matrices/expressions/hadamard.py | 91 | 2443 | from __future__ import print_function, division
from sympy.core import Mul, sympify
from sympy.strategies import unpack, flatten, condition, exhaust, do_one
from sympy.matrices.expressions.matexpr import MatrixExpr, ShapeError
def hadamard_product(*matrices):
"""
Return the elementwise (aka Hadamard) product... | bsd-3-clause |
vlegoff/tsunami | src/primaires/scripting/config.py | 1 | 2340 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.