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 |
|---|---|---|---|---|---|
bazz-erp/erpnext | erpnext/setup/doctype/company/company.py | 1 | 15659 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, os
from frappe import _
from frappe.utils import cint, today, formatdate
import frappe.defaults
from frappe.model.document import Docu... | gpl-3.0 |
jedie/pypyjs-standalone | website/js/pypy.js-0.3.0/lib/modules/test/test_macpath.py | 100 | 2000 | import macpath
from test import test_support, test_genericpath
import unittest
class MacPathTestCase(unittest.TestCase):
def test_abspath(self):
self.assertEqual(macpath.abspath("xx:yy"), "xx:yy")
def test_isabs(self):
isabs = macpath.isabs
self.assertTrue(isabs("xx:yy"))
sel... | mit |
Kaftanov/Cchat | chat-client/client.py | 1 | 5334 | #!/usr/bin/env python3
"""
#############################
Server applycation
version python: python3
based on socket
#############################
"""
import select
import socket
import sys
import datetime
from PyQt5 import QtWidgets
from PyQt5.QtCore import QThread, QPoint
import userf... | gpl-3.0 |
mikewiebe-ansible/ansible | test/units/modules/network/iosxr/test_iosxr_user.py | 48 | 4023 | # (c) 2016 Red Hat 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.
#
# Ansible is dis... | gpl-3.0 |
saketkc/statsmodels | statsmodels/sandbox/distributions/tests/_est_fit.py | 31 | 2609 | # NOTE: contains only one test, _est_cont_fit, that is renamed so that
# nose doesn't run it
# I put this here for the record and for the case when someone wants to
# verify the quality of fit
# with current parameters: relatively small sample size, default starting values
# Ran 84 tests in 401.797s
# ... | bsd-3-clause |
nwjs/chromium.src | components/test/data/password_manager/form_classification_tests/signin_forms_test.py | 19 | 24192 | # Copyright 2016 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.
import unittest
from form_classification_test import FormClassificationTest
"""Unittest class for testing signin forms.
The test methods were generated by ... | bsd-3-clause |
Dexhub/MTX | src/arch/x86/isa/insts/simd64/integer/data_reordering/unpack_and_interleave.py | 91 | 4097 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
erikr/django | django/conf/locale/hu/formats.py | 504 | 1117 | # -*- 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 = 'Y. F j.'
TIME_FORMAT = 'G.i'
DATE... | bsd-3-clause |
AOSPA-L/android_external_skia | gm/rebaseline_server/compare_rendered_pictures_test.py | 67 | 4021 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Test compare_rendered_pictures.py
TODO(epoger): Create a command to update the expected results (in
self._output_dir_expected) when appropriate. For now, you should:
1.... | bsd-3-clause |
quarkonics/zstack-woodpecker | zstackwoodpecker/zstackwoodpecker/operations/deploy_operations.py | 1 | 47036 | '''
deploy operations for setup zstack database.
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import apibinding.api_actions as api_actions
import account_operations
import resource_operations as res_ops
import zstacklib.utils.sizeunit as sizeunit
import zstacklib.utils.jsonobject as ... | apache-2.0 |
nooperpudd/pulsar | examples/httpbin/manage.py | 5 | 12153 | '''Pulsar HTTP test application::
python manage.py
Implementation
======================
.. autoclass:: HttpBin
:members:
:member-order: bysource
Server Hooks
===================
This example shows how to use
:ref:`server hooks <setting-section-application-hooks>` to log each request
.. automodule:: exa... | bsd-3-clause |
s20121035/rk3288_android5.1_repo | external/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py | 2 | 3689 | """Test lldb reloads the inferior after it was changed during the session."""
import os, time
import unittest2
import lldb
from lldbtest import *
import lldbutil
class ChangedInferiorTestCase(TestBase):
mydir = os.path.join("functionalities", "inferior-changed")
@unittest2.skipUnless(sys.platform.startswith... | gpl-3.0 |
EliotBerriot/django | django/utils/inspect.py | 323 | 4195 | from __future__ import absolute_import
import inspect
from django.utils import six
def getargspec(func):
if six.PY2:
return inspect.getargspec(func)
sig = inspect.signature(func)
args = [
p.name for p in sig.parameters.values()
if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWOR... | bsd-3-clause |
fluxw42/youtube-dl | youtube_dl/extractor/laola1tv.py | 14 | 6314 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
urlencode_postdata,
xpath_element,
xpath_text,
urljoin,
update_url_query,
)
class Laola1TvEmbedIE(InfoExtractor):
IE_NAME = 'laola1tv:embed'... | unlicense |
maciekcc/tensorflow | tensorflow/python/estimator/export/export.py | 19 | 7374 | # 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 |
sridevikoushik31/openstack | nova/availability_zones.py | 3 | 3309 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
orekyuu/intellij-community | python/lib/Lib/site-packages/django/contrib/flatpages/admin.py | 250 | 1089 | from django import forms
from django.contrib import admin
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
help_text = _("Example: ... | apache-2.0 |
mohseniaref/adore-doris | gui/snaphuConfigEditor.py | 2 | 11609 | #!/usr/bin/env python
# example basictreeview.py
import pygtk
pygtk.require('2.0')
import gtk
import os
import dialogs
class SnaphuConfigEditor:
def snaphuParser(self, set=None, setFile=None):
if setFile is None:
setFile=self.setFile;
if set is None:
set=self.set;
... | gpl-2.0 |
ldtp/pyatom | atomac/ldtpd/text.py | 2 | 16670 | # Copyright (c) 2012 VMware, Inc. All Rights Reserved.
# This file is part of ATOMac.
#@author: Nagappan Alagappan <nagappan@gmail.com>
#@copyright: Copyright (c) 2009-12 Nagappan Alagappan
#http://ldtp.freedesktop.org
# ATOMac is free software; you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-2.0 |
initzx/aobot | commands/private/changepic.py | 1 | 1135 | import aiohttp
from registrar import AbstractCommand, bot_command
@bot_command
class Command(AbstractCommand):
""" Template for bot command classes. """
_name = 'changepic'
_aliases = ['changepic']
_enabled = True
tags = {'misc': ['private'], 'args': {'req': ['pic'], 'nreq': []}}
@staticmeth... | gpl-3.0 |
aimscare/angular-test | node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | mit |
TheTimmy/spack | var/spack/repos/builtin/packages/gflags/package.py | 3 | 1900 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
data-exp-lab/girder | girder/utility/search.py | 4 | 3228 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | apache-2.0 |
Manuel4131/youtube-dl | youtube_dl/extractor/onionstudios.py | 109 | 2787 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import determine_ext
class OnionStudiosIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?onionstudios\.com/(?:videos/[^/]+-|embed\?.*\bid=)(?P<id>\d+)(?!-)'
_TESTS = [{
'url': 'http:/... | unlicense |
Mashape/dd-agent | tests/core/test_histogram.py | 40 | 4851 | # stdlib
import unittest
# project
from aggregator import Histogram, MetricsAggregator
from config import get_histogram_aggregates, get_histogram_percentiles
class TestHistogram(unittest.TestCase):
def test_default(self):
stats = MetricsAggregator('myhost')
for i in xrange(20):
stats.... | bsd-3-clause |
lxwvictor/flask-ask | samples/session/session.py | 2 | 1928 | import logging
import os
from flask import Flask, json, render_template
from flask_ask import Ask, request, session, question, statement
app = Flask(__name__)
ask = Ask(app, "/")
logging.getLogger('flask_ask').setLevel(logging.DEBUG)
COLOR_KEY = "COLOR"
@ask.launch
def launch():
card_title = render_template(... | apache-2.0 |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/scipy/io/harwell_boeing/hb.py | 23 | 18482 | """
Implementation of Harwell-Boeing read/write.
At the moment not the full Harwell-Boeing format is supported. Supported
features are:
- assembled, non-symmetric, real matrices
- integer for pointer/indices
- exponential format for float values, and int format
"""
from __future__ import division, print_... | bsd-3-clause |
danielreed/python-hpOneView | hpOneView/resources/networking/logical_downlinks.py | 1 | 5419 | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP
#
# 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 limi... | mit |
sholloway/Jitterbug | ext/vendor/glm-0.9.2.3/util/gen_external_templates.py | 18 | 5678 |
__author__ = "eloraiby"
__date__ = "$5-Sep-2010 9:35:29 PM$"
atomic_types = ["unsigned char", "unsigned short", "unsigned int",
"signed char", "signed short", "signed int",
"float", "double"]
glsl_vector_types = ["tvec2", "tvec3", "tvec4"]
glsl_matrix_types = ["tmat2x2", "tmat2x3", "tmat2x4",
"... | mit |
googleapis/python-speech | setup.py | 1 | 2804 | # Copyright 2018 Google LLC
#
# 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 writing, s... | apache-2.0 |
asm-products/movie-database-service | ani/lib/python2.7/site-packages/django/db/models/sql/query.py | 13 | 84272 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | agpl-3.0 |
tectronics/py-lepton | lepton/pygame_renderer.py | 6 | 3955 | #############################################################################
#
# Copyright (c) 2008 by Casey Duncan and contributors
# All Rights Reserved.
#
# This software is subject to the provisions of the MIT License
# A copy of the license should accompany this distribution.
# THE SOFTWARE IS PROVIDED "AS IS", W... | mit |
takaaptech/sky_engine | build/linux/unbundle/replace_gyp_files.py | 40 | 2929 | #!/usr/bin/env python
# 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.
"""
Replaces gyp files in tree with files from here that
make the build use system libraries.
"""
import optparse
import os.path
impo... | bsd-3-clause |
fabiobrandespim/flat-earth | flat_earth.py | 1 | 4983 | """
Author: Fabio Brandespim
Email: bayareaservices@gmail.com
Location: Brazil - Goiania
Date: 09-19-2016
"""
#!C:/Python27_32/python.exe
import pygame
import math
import particle
import titulos
import email_py
#import time
from threading import Thread
from pygame.locals import *
img = pygame.image.load("te... | gpl-3.0 |
Karm/qpid-proton | proton-j/src/main/resources/cmessenger.py | 17 | 5177 | #
# 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-2.0 |
kumar303/zamboni | mkt/tags/tests/test_models.py | 17 | 2143 | from nose.tools import eq_, ok_
import mkt.site.tests
from mkt.site.utils import app_factory
from mkt.tags.models import attach_tags, Tag
from mkt.websites.utils import website_factory
class TestTagManager(mkt.site.tests.TestCase):
def test_not_blocked(self):
"""Make sure Tag Manager filters right for n... | bsd-3-clause |
pschmitt/home-assistant | homeassistant/components/keba/__init__.py | 16 | 8405 | """Support for KEBA charging stations."""
import asyncio
import logging
from keba_kecontact.connection import KebaKeContact
import voluptuous as vol
from homeassistant.const import CONF_HOST
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(_... | apache-2.0 |
ludmilamarian/invenio | invenio/base/setuptools/__init__.py | 21 | 1323 | # -*- 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... | gpl-2.0 |
elit3ge/SickRage | sickbeard/notifiers/synologynotifier.py | 12 | 2585 | # Author: Nyaran <nyayukko@gmail.com>
#
# 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, either version 3 of the License, or
# (at your option) any later version.
#... | gpl-3.0 |
AdrianoMaron/kWantera | argparse.py | 490 | 87791 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The... | gpl-2.0 |
aptrishu/coala-bears | tests/haskell/HaskellLintBearTest.py | 8 | 1995 | from queue import Queue
from bears.haskell.HaskellLintBear import HaskellLintBear
from coalib.testing.LocalBearTestHelper import LocalBearTestHelper
from coalib.testing.BearTestHelper import generate_skip_decorator
from coalib.settings.Section import Section
good_single_line_file = """
myconcat = (++)
""".splitlines... | agpl-3.0 |
salivatears/ansible | lib/ansible/plugins/cache/base.py | 124 | 1479 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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.
... | gpl-3.0 |
alxgu/ansible | lib/ansible/modules/identity/keycloak/keycloak_client.py | 27 | 32548 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Eike Frost <ei@kefro.st>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1... | gpl-3.0 |
fparrel/regepe | wamp-src/cgi-bin/mathutil.py | 2 | 13205 |
from math import sqrt,cos,sin,atan2,ceil,floor,log10,pi,atan,tan
from log import Warn
try:
from math import fsum
except ImportError:
from mymath import fsum
## MISC MATH FUNCTIONS ##
def Mean(numbers):
"Returns the arithmetic mean of a numeric list."
return fsum(numbers) / len(numbers)
def InBound... | gpl-3.0 |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/ctypes/test/test_values.py | 3 | 3597 | """
A testcase which accesses *values* in a dll.
"""
import unittest
from ctypes import *
import _ctypes_test
class ValuesTestCase(unittest.TestCase):
def test_an_integer(self):
# This test checks and changes an integer stored inside the
# _ctypes_test dll/shared lib.
ctdll... | gpl-2.0 |
beni55/networkx | examples/drawing/giant_component.py | 33 | 2084 | #!/usr/bin/env python
"""
This example illustrates the sudden appearance of a
giant connected component in a binomial random graph.
Requires pygraphviz and matplotlib to draw.
"""
# Copyright (C) 2006-2008
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov... | bsd-3-clause |
execuc/LCInterlocking | panel/hingeswidget.py | 1 | 5079 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2016 execuc *
# * ... | lgpl-2.1 |
junbochen/pylearn2 | pylearn2/gui/tangent_plot.py | 44 | 1730 | """
Code for plotting curves with tangent lines.
"""
__author__ = "Ian Goodfellow"
try:
from matplotlib import pyplot
except Exception:
pyplot = None
from theano.compat.six.moves import xrange
def tangent_plot(x, y, s):
"""
Plots a curve with tangent lines.
Parameters
----------
x : lis... | bsd-3-clause |
goFrendiAsgard/kokoropy | kokoropy/packages/sqlalchemy/dialects/sqlite/pysqlite.py | 23 | 14980 | # sqlite/pysqlite.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite+pysqlite
:name: pysqlite
:dbapi: sqlite3
:con... | mit |
AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/python/debug/wrappers/local_cli_wrapper_test.py | 20 | 13116 | # 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 |
mcreenan/eve | eve/logging.py | 17 | 1323 | from __future__ import absolute_import
import logging
from flask import request
# TODO right now we are only logging exceptions. We should probably
# add support for some INFO and maybe DEBUG level logging (like, log each time
# a endpoint is hit, etc.)
class RequestFilter(logging.Filter):
""" Adds Flask's requ... | bsd-3-clause |
vybstat/scikit-learn | examples/bicluster/plot_spectral_biclustering.py | 403 | 2011 | """
=============================================
A demo of the Spectral Biclustering algorithm
=============================================
This example demonstrates how to generate a checkerboard dataset and
bicluster it using the Spectral Biclustering algorithm.
The data is generated with the ``make_checkerboard`... | bsd-3-clause |
NickDaly/GemRB-MultipleConfigs | gemrb/GUIScripts/pst/Start.py | 2 | 3127 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) ... | gpl-2.0 |
sander76/home-assistant | homeassistant/components/iaqualink/switch.py | 12 | 1713 | """Support for Aqualink pool feature switches."""
from homeassistant.components.switch import DOMAIN, SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from . import AqualinkEntity, refresh_system
from .const import DOMAIN as AQUALINK_DOMAIN
P... | apache-2.0 |
lupien/pyHegel | pyHegel/instruments_base.py | 1 | 162990 | # -*- coding: utf-8 -*-
########################## Copyrights and license ############################
# #
# Copyright 2011-2015 Christian Lupien <christian.lupien@usherbrooke.ca> #
# ... | lgpl-3.0 |
nwjs/chromium.src | content/test/gpu/gpu_tests/gpu_integration_test_unittest.py | 2 | 16019 | # Copyright 2016 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.
import json
import os
import shutil
import tempfile
import unittest
import mock
import sys
import run_gpu_integration_test
import gpu_project_config
from gp... | bsd-3-clause |
gino3a/tm-boilerplate | tailbone/turn/__init__.py | 34 | 3644 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
markoshorro/gem5 | src/arch/x86/isa/insts/simd64/integer/exit_media_state.py | 72 | 2182 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
srvg/ansible | lib/ansible/utils/unicode.py | 158 | 1166 | # (c) 2012-2014, Toshio Kuratomi <a.badger@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... | gpl-3.0 |
rickerc/ceilometer_audit | tests/storage/test_get_engine.py | 3 | 1507 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.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
#
# ... | apache-2.0 |
tehguy/dndtools | dndtools/dnd/spells/urls.py | 3 | 2039 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns(
'dnd.spells.views',
# spells
url(
r'^$',
'spell_index',
name='spell_index',
),
# spells > rulebook
url(
r'^(?P<rulebook_slug>[^/]+)--(?P<rulebook_id>\d+)/$',
'sp... | mit |
thecaffiend/jupyternb_to_c_over_websockets | server_side/driverclient/client.py | 1 | 3402 | """
Adapted from: https://docs.python.org/3.4/howto/sockets.html
TODO: Get this based on tornado TCPClient class instead of this half baked
thing
TODO: Do co-routines *or* callbacks. This goes for the whole thing, not just
this class.
"""
import socket
from tornado import (
gen,
)
class DriverClient:... | mit |
Endi1/Penguin | penguin/tests/tests.py | 1 | 1539 | import unittest
import os
import shutil
from penguin.main import newSite, buildSite, publishPosts
from penguin.penguin import Penguin
class TestContentCreation(unittest.TestCase):
def test_build_project(self):
newSite('test_site')
os.chdir('test_site')
site = Penguin()
buildSite(s... | mit |
mrbean-bremen/pyfakefs | pyfakefs/extra_packages.py | 1 | 1253 | # 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 writing, software
# distributed under t... | apache-2.0 |
girving/tensorflow | tensorflow/python/keras/optimizer_v2/optimizer_v2.py | 1 | 55544 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
prasadtalasila/INET-Vagrant-Demos | Nonce_Demo/impacket-0.9.12/impacket/testcases/dot11/test_FrameManagementAssociationResponse.py | 6 | 7476 | #!/usr/bin/env python
# sorry, this is very ugly, but I'm in python 2.5
import sys
sys.path.insert(0,"../..")
from dot11 import Dot11, Dot11Types, Dot11ManagementFrame, Dot11ManagementAssociationResponse
from ImpactDecoder import RadioTapDecoder
from binascii import hexlify
import unittest
class TestDot11ManagementA... | gpl-2.0 |
bcl/anaconda | tests/glade/check_markup.py | 5 | 5424 | #!/usr/bin/python3
#
# Copyright (C) 2014 Red Hat, Inc.
#
# 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 2.1 of the License, or
# (at your option) any later version.
#
# ... | gpl-2.0 |
J861449197/edx-platform | common/djangoapps/embargo/tests/test_views.py | 136 | 3286 | """Tests for embargo app views. """
import unittest
from mock import patch
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from mako.exceptions import TopLevelLookupException
import ddt
from util.testing import UrlResetMixin
from embargo import messages
... | agpl-3.0 |
Titan-C/sympy | sympy/concrete/products.py | 4 | 15193 | from __future__ import print_function, division
from sympy.tensor.indexed import Idx
from sympy.core.mul import Mul
from sympy.core.singleton import S
from sympy.core.symbol import symbols
from sympy.concrete.expr_with_intlimits import ExprWithIntLimits
from sympy.functions.elementary.exponential import exp, log
from ... | bsd-3-clause |
sentinelleader/limbo | limbo/plugins/emojicodedict.py | 14 | 46328 | #
# This file is based on emoji (https://github.com/kyokomi/emoji).
#
# The MIT License (MIT)
#
# Copyright (c) 2014 kyokomi
#
# 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 restrict... | mit |
juneJuly/backfuzz | plugins/imap/imap.py | 3 | 1323 | from functions import *
"""IMAP Fuzzer"""
PROPERTY={}
PROPERTY['PROTOCOL']="IMAP"
PROPERTY['NAME']=": IMAP Fuzzer"
PROPERTY['DESC']="Fuzz an IMAP server"
PROPERTY['AUTHOR']='localh0t'
user_stage = ['. login']
pass_stage = ['. login anonymous@test.com']
stage_1 = ['. list ""','. lsub ""', '. status INBOX','. examine','... | gpl-3.0 |
tempbottle/kbengine | kbe/src/lib/python/Lib/idlelib/Percolator.py | 82 | 3244 | from idlelib.WidgetRedirector import WidgetRedirector
from idlelib.Delegator import Delegator
class Percolator:
def __init__(self, text):
# XXX would be nice to inherit from Delegator
self.text = text
self.redir = WidgetRedirector(text)
self.top = self.bottom = Delegator(text)
... | lgpl-3.0 |
jbobotek/elcano | Vision/OpticalMouse/ADNS3080ImageGrabber.py | 4 | 6354 |
import serial
import string
import math
import time
from Tkinter import *
from threading import Timer
comPort = '/dev/ttyACM0' #default com port
comPortBaud = 38400
class App:
grid_size = 15
num_pixels = 30
image_started = FALSE
image_current_row = 0;
ser = serial.Serial(comPort,... | mit |
remyroy/uwsgi | contrib/runuwsgi.py | 17 | 2577 | import django
from django.core.management.base import BaseCommand
from django.conf import settings
import os
import sys
class Command(BaseCommand):
help = "Runs this project as a uWSGI application. Requires the uwsgi binary in system path."
http_port = '8000'
socket_addr = None
def handle(self, *arg... | gpl-2.0 |
SimonSapin/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_compat.py | 30 | 2615 | from __future__ import absolute_import, division, print_function
import sys
import pytest
from _pytest.compat import is_generator, get_real_func, safe_getattr
from _pytest.outcomes import OutcomeException
def test_is_generator():
def zap():
yield
def foo():
pass
assert is_generator(zap... | mpl-2.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.2/django/contrib/gis/sitemaps/views.py | 45 | 4353 | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.contrib.gis.db.models.fields import GeometryField
from django.db import... | apache-2.0 |
hrashk/sympy | sympy/assumptions/refine.py | 7 | 6862 | from __future__ import print_function, division
from sympy.core import S, Add, Expr
from sympy.assumptions import Q, ask
from sympy.core.logic import fuzzy_not
def refine(expr, assumptions=True):
"""
Simplify an expression using assumptions.
Gives the form of expr that would be obtained if symbols
i... | bsd-3-clause |
bwrsandman/GitPython | git/test/test_commit.py | 12 | 12863 | # -*- coding: utf-8 -*-
# test_commit.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from __future__ import print_function
from git.test.lib import (
Tes... | bsd-3-clause |
shacker/django | tests/template_tests/filter_tests/test_striptags.py | 197 | 1632 | from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.functional import lazystr
from django.utils.safestring import mark_safe
from ..utils import setup
class StriptagsTests(SimpleTestCase):
@setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'})
... | bsd-3-clause |
xq262144/hue | desktop/core/ext-py/pysaml2-2.4.0/example/idp2_repoze/modules/login.mako.py | 31 | 2690 | # -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 6
_modified_time = 1367126126.936375
_template_filename='htdocs/login.mako'
_template_uri='login.mako'
_template_cache=cache.Cache(__name__, _modified_time)... | apache-2.0 |
chirilo/mozillians | vendor-local/lib/python/tablib/packages/odf/elementtypes.py | 83 | 10218 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008 Søren Roug, European Environment Agency
#
# This library 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 2.1 of the Licens... | bsd-3-clause |
huichen-cs/learnsorting | quick_sort_unittest.py | 1 | 1092 | import unittest
from quick_sort_concept import quick_sort
class QuickSortTest(unittest.TestCase):
def test_quick_sort_random_1(self):
data = [4, 1, 10, 4, 4, 3, 9, 4, 1, 9]
expected = [1, 1, 3, 4, 4, 4, 4, 9, 9, 10]
output = quick_sort(data)
self.assertEqual(expected, ... | gpl-3.0 |
OpenTrons/opentrons_sdk | api/src/opentrons/system/wifi.py | 3 | 6702 | import hashlib
import logging
import os
import shutil
from typing import Generator, Optional, Dict, Any
from dataclasses import dataclass
from opentrons.config import CONFIG
from opentrons.system import nmcli
log = logging.getLogger(__name__)
class ConfigureArgsError(Exception):
pass
EAP_CONFIG_SHAPE = {
... | apache-2.0 |
fitermay/intellij-community | python/lib/Lib/site-packages/django/contrib/syndication/views.py | 87 | 8404 | import datetime
from django.conf import settings
from django.contrib.sites.models import get_current_site
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import HttpResponse, Http404
from django.template import loader, Template, TemplateDoesNotExist, RequestContext
from djan... | apache-2.0 |
alienity/three.js | utils/exporters/blender/addons/io_three/exporter/api/mesh.py | 124 | 23228 | """
Blender API for querying mesh data. Animation data is also
handled here since Three.js associates the animation (skeletal,
morph targets) with the geometry nodes.
"""
import operator
from bpy import data, types, context
from . import material, texture, animation
from . import object as object_
from .. import const... | mit |
andersonvom/python_koans | python3/koans/about_classes.py | 22 | 4779 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutClasses(Koan):
class Dog:
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
# NOTE: The .__name__ attribute will convert the class
... | mit |
inspirehep/invenio | modules/bibcheck/lib/plugins/doi.py | 6 | 2215 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
otmaneJai/Zipline | zipline/utils/memoize.py | 7 | 2540 | """
Tools for memoization of function results.
"""
from functools import wraps
from six import iteritems
from weakref import WeakKeyDictionary
class lazyval(object):
"""
Decorator that marks that an attribute should not be computed until
needed, and that the value should be memoized.
Example
----... | apache-2.0 |
amousset/ansible | lib/ansible/template/safe_eval.py | 47 | 4154 | # (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... | gpl-3.0 |
comptech/atrex | Software/gaussfitter.py | 1 | 23761 | """
===========
gaussfitter
===========
.. codeauthor:: Adam Ginsburg <adam.g.ginsburg@gmail.com> 3/17/08
Latest version available at <http://code.google.com/p/agpy/source/browse/trunk/agpy/gaussfitter.py>
"""
import numpy
from numpy.ma import median
from numpy import pi
#from scipy import optimize,stats,pi
from scip... | lgpl-3.0 |
Mazecreator/tensorflow | tensorflow/contrib/timeseries/examples/predict.py | 69 | 5579 | # 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 |
krsjoseph/youtube-dl | youtube_dl/extractor/tinypic.py | 126 | 1893 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class TinyPicIE(InfoExtractor):
IE_NAME = 'tinypic'
IE_DESC = 'tinypic.com videos'
_VALID_URL = r'http://(?:.+?\.)?tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+'
_TESTS = [
... | unlicense |
qilicun/python | python2/diveintopythonzh-cn-5.4b/soundex/stage1/soundex1d.py | 4 | 2390 | """Soundex algorithm
This program is part of "Dive Into Python", a free Python book for
experienced programmers. Visit http://diveintopython.org/ for the
latest version.
"""
__author__ = "Mark Pilgrim (mark@diveintopython.org)"
__version__ = "$Revision: 1.2 $"
__date__ = "$Date: 2004/05/06 21:36:36 $"
__copyright__ ... | gpl-3.0 |
kizyle502/collegiatemasters | collegiatemasters/players/models.py | 1 | 1433 | from django.db import models
from django.core.urlresolvers import reverse
from autoslug import AutoSlugField
from model_utils.models import TimeStampedModel
from django_countries.fields import CountryField
class Player(TimeStampedModel):
GROUP_UNSPECIFIED = "unspecified"
GROUP_FIRST = "first"
GROUP_SECOND... | bsd-3-clause |
Kupoman/thor | src/appdirs.py | 1 | 22475 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# ... | apache-2.0 |
Weuxel/cjdns | node_build/dependencies/libuv/build/gyp/test/mac/gyptest-depend-on-bundle.py | 303 | 1186 | #!/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 that a dependency on a bundle causes the whole bundle to be built.
"""
import TestGyp
import sys
if sys.platform == 'darwin'... | gpl-3.0 |
jeremiahmarks/sl4a | python/src/Lib/multiprocessing/util.py | 59 | 7839 | #
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
import itertools
import weakref
import atexit
import threading # we want threading to install it's
# cleanup function before mult... | apache-2.0 |
uclaros/QGIS | tests/src/python/test_qgsmapcanvas.py | 25 | 23167 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMapCanvas
.. 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.
"""
__aut... | gpl-2.0 |
liqueur/tornado | tornado/test/process_test.py | 123 | 10569 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import logging
import os
import signal
import subprocess
import sys
from tornado.httpclient import HTTPClient, HTTPError
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.log i... | apache-2.0 |
spbguru/repo1 | tests/integration/py2/nupic/engine/network_testnode_interchangeability.py | 17 | 6158 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.