repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
caidongyun/pylearn2 | pylearn2/models/mlp.py | 12 | 165807 | """
Multilayer Perceptron
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2012-2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow", "David Warde-Farley"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import logging
import math
import operator
import sys
import warnings
import numpy ... | bsd-3-clause |
radicalbit/ambari | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py | 2 | 9988 | #!/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
"License")... | apache-2.0 |
quamilek/django | django/conf/locale/de/formats.py | 504 | 1100 | # -*- 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'
DATET... | bsd-3-clause |
Br3nda/calcalcal | pylib/cherrypy/tutorial/tut05_derived_objects.py | 36 | 2291 | """
Tutorial - Object inheritance
You are free to derive your request handler classes from any base
class you wish. In most real-world applications, you will probably
want to create a central base class used for all your pages, which takes
care of things like printing a common page header and footer.
"""
import cherr... | mit |
BOOTMGR/lge_victo_msm7x30-CM | tools/perf/scripts/python/check-perf-trace.py | 948 | 2501 | # perf trace event handlers, generated by perf trace -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. Ba... | gpl-2.0 |
jyogi/purvar-agent | checks.d/network.py | 5 | 26830 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
"""
Collects network metrics.
"""
# stdlib
import re
import socket
from collections import defaultdict
# project
from checks import AgentCheck
from utils.platform import Platform
from utils.subprocess_output impo... | bsd-3-clause |
tanmaythakur/django | tests/admin_docs/models.py | 83 | 1625 | """
Models for testing various aspects of the djang.contrib.admindocs app
"""
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=200)
class Group(models.Model):
name = models.CharField(max_length=200)
class Family(models.Model):
last_name = models.CharField(m... | bsd-3-clause |
gurneyalex/account-invoicing | account_invoice_force_number/__init__.py | 34 | 1047 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it a... | agpl-3.0 |
romankagan/DDBWorkbench | python/lib/Lib/site-packages/django/contrib/gis/maps/google/__init__.py | 603 | 2648 | """
This module houses the GoogleMap object, used for generating
the needed javascript to embed Google Maps in a Web page.
Google(R) is a registered trademark of Google, Inc. of Mountain View, California.
Example:
* In the view:
return render_to_response('template.html', {'google' : GoogleMap(key="... | apache-2.0 |
ndawe/goodruns | goodruns/sorteddict.py | 1 | 3468 | """
Copied from:
https://code.djangoproject.com/browser/django/
trunk/django/utils/datastructures.py#L99
BSD license
"""
import copy
from types import GeneratorType
import bisect
class SortedDict(dict):
"""
A dictionary that keeps its keys in the
order in which they're inserted.
"""
def _... | gpl-3.0 |
GoogleDeveloperExperts/experts-app-backend | models/activity_record.py | 1 | 9785 | from google.appengine.ext import ndb
from endpoints_proto_datastore.ndb import EndpointsModel
from endpoints_proto_datastore.ndb import EndpointsAliasProperty
from endpoints_proto_datastore.ndb import EndpointsVariantIntegerProperty
from endpoints_proto_datastore.ndb import EndpointsComputedProperty
from datetime impor... | apache-2.0 |
openthread/silk | silk/device/netns_base.py | 1 | 8483 | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
takeshineshiro/swift | test/unit/common/middleware/test_healthcheck.py | 35 | 2901 | # 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 |
huaweiswitch/neutron | neutron/plugins/vmware/plugins/service.py | 7 | 80699 | # Copyright 2013 VMware, 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 a... | apache-2.0 |
cpennington/edx-platform | lms/djangoapps/courseware/tests/test_credit_requirements.py | 4 | 6551 | """
Tests for credit requirement display on the progress page.
"""
import ddt
import six
from django.conf import settings
from django.urls import reverse
from mock import patch
from course_modes.models import CourseMode
from openedx.core.djangoapps.credit import api as credit_api
from openedx.core.djangoapps.credit.... | agpl-3.0 |
hardanimal/UFT_UPGEM | src/UFT/backend/configuration.py | 1 | 3635 | #!/usr/bin/env python
# encoding: utf-8
"""PGEM test configuration model.
Default connect to configuration.db which save the test items settings.
"""
__version__ = "0.1"
__author__ = "@fanmuzhi, @boqiling"
__all__ = ["PGEMConfig", "TestItem"]
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy imp... | gpl-3.0 |
CouchPotato/CouchPotatoServer | libs/synchronousdeluge/client.py | 151 | 5078 | import os
import platform
from collections import defaultdict
from itertools import imap
from synchronousdeluge.exceptions import DelugeRPCError
from synchronousdeluge.protocol import DelugeRPCRequest, DelugeRPCResponse
from synchronousdeluge.transfer import DelugeTransfer
__all__ = ["DelugeClient"]
RPC_RESPONSE =... | gpl-3.0 |
cloudera/recordservice | tests/hs2/test_fetch.py | 16 | 11507 | # Copyright (c) 2012 Cloudera, 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 o... | apache-2.0 |
rbarlow/pulp | server/test/unit/server/managers/schedule/test_consumer.py | 15 | 7585 | import unittest
import mock
from pulp.server.db.model.consumer import Consumer
from pulp.server.db.model.dispatch import ScheduledCall
from pulp.server.exceptions import MissingResource, MissingValue, InvalidValue
from pulp.server.managers.factory import initialize
from pulp.server.managers.schedule.consumer import (... | gpl-2.0 |
guewen/OpenUpgrade | addons/stock_account/wizard/stock_change_standard_price.py | 61 | 3467 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
zachcp/qiime | scripts/blast_wrapper.py | 15 | 2554 | #!/usr/bin/env python
# File created on 20 Dec 2009.
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Greg Caporaso", "Jesse Stombaugh"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcapora... | gpl-2.0 |
Shrhawk/edx-platform | lms/djangoapps/courseware/model_data.py | 9 | 35754 | """
Classes to provide the LMS runtime data storage to XBlocks.
:class:`DjangoKeyValueStore`: An XBlock :class:`~KeyValueStore` which
stores a subset of xblocks scopes as Django ORM objects. It wraps
:class:`~FieldDataCache` to provide an XBlock-friendly interface.
:class:`FieldDataCache`: A object which pro... | agpl-3.0 |
oandrew/home-assistant | tests/components/media_player/test_cast.py | 22 | 1338 | """The tests for the Cast Media player platform."""
# pylint: disable=protected-access
import unittest
from unittest.mock import patch
from homeassistant.components.media_player import cast
class FakeChromeCast(object):
"""A fake Chrome Cast."""
def __init__(self, host, port):
"""Initialize the fake... | mit |
gonboy/sl4a | python/src/Lib/test/test_time.py | 58 | 9341 | from test import test_support
import time
import unittest
class TimeTestCase(unittest.TestCase):
def setUp(self):
self.t = time.time()
def test_data_attributes(self):
time.altzone
time.daylight
time.timezone
time.tzname
def test_clock(self):
time.clock()
... | apache-2.0 |
wmjac/pygtsa | calc_energies.py | 1 | 3664 | # Copyright (C) 2014 William M. Jacobs
# 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 i... | gpl-3.0 |
Achint08/open-event-orga-server | migrations/versions/9913b58c2640_.py | 10 | 1112 | """empty message
Revision ID: 9913b58c2640
Revises: ddc941500bd2
Create Date: 2016-07-29 23:23:27.324000
"""
# revision identifiers, used by Alembic.
revision = '9913b58c2640'
down_revision = 'ddc941500bd2'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
### commands auto... | gpl-3.0 |
cnweibo/bootstrapgrunt | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py | 294 | 21436 | # Copyright (c) 2014 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 script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | mit |
AnishShah/tensorflow | tensorflow/contrib/model_pruning/python/layers/layers.py | 27 | 15357 | # 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 |
riklaunim/django-custom-multisite | django/dispatch/saferef.py | 86 | 10503 | """
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
import traceback
import weakref
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target... | bsd-3-clause |
scott1028/pyfpdf | tests/cover/test_simple.py | 18 | 1080 | # -*- coding: utf-8 -*-
"Basic example to test PyFPDF"
#PyFPDF-cover-test:format=PDF
#PyFPDF-cover-test:fn=simple.pdf
#PyFPDF-cover-test:hash=1fd821a42cb5029a51727a6107b623ec
#PyFPDF-cover-test:pil=yes
#PyFPDF-cover-test:res=../tutorial/logo.png
#PyFPDF-cover-test:res=flower2.jpg
#PyFPDF-cover-test:res=lena.gif
impo... | lgpl-3.0 |
mikebenfield/scikit-learn | examples/linear_model/plot_sgd_loss_functions.py | 86 | 1234 | """
==========================
SGD: convex loss functions
==========================
A plot that compares the various convex loss functions supported by
:class:`sklearn.linear_model.SGDClassifier` .
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def modified_huber_loss(y_true, y_pred):
z ... | bsd-3-clause |
OSVR/UIforETW | bin/StripChromeSymbols.py | 3 | 9618 | # Copyright 2015 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 ... | apache-2.0 |
Tesora/tesora-horizon | openstack_dashboard/dashboards/project/firewalls/workflows.py | 2 | 15955 | # Copyright 2013, Big Switch Networks, 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 applic... | apache-2.0 |
tanmaykm/edx-platform | lms/djangoapps/support/tests/test_views.py | 17 | 15131 | # coding: UTF-8
"""
Tests for support views.
"""
from datetime import datetime, timedelta
import itertools
import json
import re
import ddt
from django.core.urlresolvers import reverse
from nose.plugins.attrib import attr
from pytz import UTC
from course_modes.models import CourseMode
from course_modes.tests.factori... | agpl-3.0 |
salamer/jolla | example/app.py | 1 | 1317 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from jolla import server
from jolla import plugins
from jolla import session
from jolla import HTTP404Error
from jolla import SessionError
session = session()
def index(request):
return plugins.render('index.html')
def chinese(request):
try:
if reques... | apache-2.0 |
dou800/php-buildpack-legacy | builds/runtimes/python-2.7.6/lib/python2.7/sqlite3/dbapi2.py | 55 | 2644 | # -*- coding: iso-8859-1 -*-
# pysqlite2/dbapi2.py: the DB-API 2.0 interface
#
# Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# ari... | mit |
speksofdust/BeyondDreams | beyonddreams/screens/screen.py | 1 | 6125 | # ---------------------------------------------------------------------------- #
# #
# 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 ... | gpl-3.0 |
edensparkles/FIRSTAID | FIRST_AID/venv/Lib/site-packages/pip/utils/appdirs.py | 174 | 7896 | """
This code was taken from https://github.com/ActiveState/appdirs and modified
to suit our purposes.
"""
from __future__ import absolute_import
import os
import sys
from pip.compat import WINDOWS, expanduser
def user_cache_dir(appname):
r"""
Return full path to the user-specific cache dir for this applica... | mit |
cnsoft/kbengine-cocos2dx | kbe/res/scripts/common/Lib/importlib/test/abc.py | 86 | 2471 | import abc
import unittest
class FinderTests(unittest.TestCase, metaclass=abc.ABCMeta):
"""Basic tests for a finder to pass."""
@abc.abstractmethod
def test_module(self):
# Test importing a top-level module.
pass
@abc.abstractmethod
def test_package(self):
# Test importi... | lgpl-3.0 |
jicruz/heroku-bot | lib/youtube_dl/extractor/spike.py | 34 | 2296 | from __future__ import unicode_literals
import re
from .mtv import MTVServicesInfoExtractor
class SpikeIE(MTVServicesInfoExtractor):
_VALID_URL = r'https?://(?:[^/]+\.)?spike\.com/[^/]+/[\da-z]{6}(?:[/?#&]|$)'
_TESTS = [{
'url': 'http://www.spike.com/video-clips/lhtu8m/auction-hunters-can-allen-ride... | gpl-3.0 |
bslatkin/8-bits | appengine-mapreduce/python/test/mapreduce/handlers_test.py | 1 | 68704 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
xcbat/vnpy | vnpy/api/sgit/pyscript/generate_struct.py | 15 | 1494 | # encoding: UTF-8
__author__ = 'CHENXY'
from sgit_data_type import *
def main():
"""主函数"""
fcpp = open('SgitFtdcUserApiStruct.h', 'r')
fpy = open('sgit_struct.py', 'w')
fpy.write('# encoding: UTF-8\n')
fpy.write('\n')
fpy.write('structDict = {}\n')
fpy.write('\n')
for no, line in en... | mit |
hamogu/marxs | marxs/simulator/tests/test_simulator.py | 1 | 2812 | import numpy as np
from astropy.table import Table
import pytest
from ..simulator import KeepCol, Sequence, BaseContainer
from ...optics import FlatDetector
f1 = FlatDetector()
f2 = FlatDetector()
f3 = FlatDetector()
s_l2 = Sequence(elements=[f2, f3])
mission = Sequence(elements=[f1, s_l2])
def test_seach_all():
... | gpl-3.0 |
x111ong/django | tests/template_tests/filter_tests/test_truncatewords.py | 215 | 1705 | from django.template.defaultfilters import truncatewords
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class TruncatewordsTests(SimpleTestCase):
@setup({'truncatewords01':
'{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:"... | bsd-3-clause |
kirmani/hlpr_cadence | third_party/hlpr_manipulation/hlpr_manipulation_utils/src/hlpr_manipulation_utils/manipulator.py | 1 | 17522 | import roslib; roslib.load_manifest('hlpr_manipulation_utils')
from sensor_msgs.msg import JointState
from vector_msgs.msg import JacoCartesianVelocityCmd, LinearActuatorCmd, GripperCmd, GripperStat
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
from wpi_jaco_msgs.msg import AngularCommand, Carte... | mit |
sahiljain/catapult | third_party/mox3/mox3/tests/test_mox.py | 26 | 84855 | # Unit tests for Mox.
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | bsd-3-clause |
miguelparaiso/OdooAccessible | addons/stock/wizard/__init__.py | 323 | 1149 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
nckx/dstat | plugins/dstat_disk_svctm.py | 4 | 2496 | ### Author: David Nicklay <david-d$nicklay,com>
### Modified from disk-util: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
"""
The average service time (in milliseconds) for I/O requests that were
issued to the device.
Warning! Do not trust this field any more.
"""
def __init__(self)... | gpl-2.0 |
lampeh/FooPing | server/FooPingReceiver.py | 1 | 3008 | ##
# FooPing Demo Receiver
# Copyright 2014 Hauke Lampe
#
# 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 Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Thi... | agpl-3.0 |
52ai/django-ccsds | tests/m2m_through/tests.py | 1 | 15770 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from .models import (
CustomMembership, Employee, Event, Friendship, Group, Ingredient,
Invitation, Membership, Person, PersonSelfRefM2M, Recipe, RecipeIngredient,
Relati... | bsd-3-clause |
nokute78/fluent-bit | plugins/out_kafka/librdkafka-1.6.0/tests/performance_plot.py | 3 | 2902 | #!/usr/bin/env python3
#
import sys, json
import numpy as np
import matplotlib.pyplot as plt
from collections import defaultdict
def semver2int (semver):
if semver == 'trunk':
semver = '0.10.0.0'
vi = 0
i = 0
for v in reversed(semver.split('.')):
vi += int(v) * (i * 10)
i += 1... | apache-2.0 |
toshywoshy/ansible | test/units/utils/test_shlex.py | 197 | 1290 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 |
godfather1103/WeiboRobot | python27/1.0/lib/site-packages/pip/commands/list.py | 269 | 7251 | from __future__ import absolute_import
import logging
from pip._vendor import pkg_resources
from pip.basecommand import Command
from pip.exceptions import DistributionNotFound
from pip.index import FormatControl, fmt_ctl_formats, PackageFinder, Search
from pip.req import InstallRequirement
from pip.utils import get_... | gpl-3.0 |
MoisesTedeschi/python | Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/tokenize.py | 9 | 27030 | """Tokenization help for Python programs.
tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens. It decodes the bytes according to PEP-0263 for
determining source file encoding.
It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF). ... | gpl-3.0 |
sdmathis/LitecoinNEW | contrib/spendfrom/spendfrom.py | 792 | 10053 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | mit |
danielfrg/jupyterhub-kubernetes_spawner | kubernetes_spawner/kube.py | 1 | 6588 |
import os
from . import swagger_client as swagger
from .swagger_client.models.v1_pod import V1Pod
from .swagger_client.models.v1_pod_spec import V1PodSpec
from .swagger_client.models.v1_object_meta import V1ObjectMeta
from .swagger_client.models.v1_container import V1Container
from .swagger_client.models.v1_container... | apache-2.0 |
aio-libs/multidict | tests/test_abc.py | 1 | 3176 | from collections.abc import Mapping, MutableMapping
import pytest
from multidict import MultiMapping, MutableMultiMapping
from multidict._compat import USE_CYTHON
from multidict._multidict_py import CIMultiDict as PyCIMultiDict
from multidict._multidict_py import CIMultiDictProxy as PyCIMultiDictProxy
from multidict.... | apache-2.0 |
taedori81/gentlecoffee | saleor/registration/views.py | 13 | 5525 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login as auth_login, logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.contrib.... | bsd-3-clause |
obimod/taiga-back | tests/integration/test_custom_attributes_tasks.py | 20 | 7862 | # 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 |
dmilith/SublimeText3-dmilith | Package Storage/lsp_utils/node-runtime/12.20.2/node/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py | 11 | 1333 | # Copyright 2014 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.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structur... | mit |
Austin503/pyglet | contrib/layout/layout/gl/__init__.py | 29 | 6125 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from pyglet.gl import *
from pyglet.event import *
from layout.css import *
from layout.content import *
from layout.frame import *
from layout.locator import *
from layout.view import *
from layout.gl.device import *
from layout.... | bsd-3-clause |
wuhengzhi/chromium-crosswalk | tools/perf/benchmarks/media.py | 3 | 4626 | # 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 core import perf_benchmark
from telemetry import benchmark
from telemetry.page import legacy_page_test
from telemetry.value import list_of_scalar_value... | bsd-3-clause |
moolitayer/cockpit | test-avocado/libnetwork.py | 26 | 3621 | # -*- coding: utf-8 -*-
# This file is part of Cockpit.
#
# Copyright (C) 2015 Red Hat, Inc.
#
# Cockpit 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... | lgpl-2.1 |
cmvac/demagorgon.repository | plugin.audio.m80/jscrypto.py | 77 | 4201 | import hashlib
import json
import base64
import pyaes
from pkcs7 import PKCS7Encoder
import os, urllib2,urllib
import cookielib
def evpKDF(passwd, salt, key_size=8, iv_size=4, iterations=1, hash_algorithm="md5"):
target_key_size = key_size + iv_size
derived_bytes = ""
number_of_derived_words = 0
b... | gpl-2.0 |
lanbing510/GTDWeb | django/utils/six.py | 408 | 30194 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | gpl-2.0 |
xianian/qt-creator | share/qtcreator/debugger/boosttypes.py | 2 | 5200 | ############################################################################
#
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the comm... | lgpl-2.1 |
koharjidan/litecoin | contrib/seeds/makeseeds.py | 1 | 4297 | #!/usr/bin/env python
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 337600
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = set([
"130.211.129.106", "178.63.107.226",
"83.81.1... | mit |
bczmufrn/frequencia | frequencia/justificativas/rules.py | 1 | 1401 | import rules
from frequencia.accounts.rules import is_gestor, is_bolsista
from frequencia.vinculos.utils import get_setores
#Predicates
@rules.predicate
def is_justificativa_author(user, justificativa):
try:
return justificativa.vinculo in user.vinculos.all()
except:
return None
@rules.predicate
def is_justifi... | mit |
mlaitinen/odoo | addons/account_anglo_saxon/purchase.py | 427 | 2043 | # -*- encoding: 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 t... | agpl-3.0 |
pf4d/dolfin-adjoint | tests_dolfin/heat/heat.py | 1 | 1357 | import sys
from dolfin import *
from dolfin_adjoint import *
f = Expression("x[0]*(x[0]-1)*x[1]*(x[1]-1)")
mesh = UnitSquareMesh(4, 4)
V = FunctionSpace(mesh, "CG", 1)
def main(ic, annotate=True):
u = TrialFunction(V)
v = TestFunction(V)
u_0 = Function(V, name="Solution")
u_0.assign(ic, annotate=Fal... | lgpl-3.0 |
darkryder/django | django/core/management/utils.py | 67 | 3739 | from __future__ import unicode_literals
import os
import sys
from subprocess import PIPE, Popen
from django.apps import apps as installed_apps
from django.utils import six
from django.utils.crypto import get_random_string
from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text
from .base import Command... | bsd-3-clause |
lduarte1991/edx-platform | common/djangoapps/entitlements/api/v1/filters.py | 18 | 1215 | from django_filters import rest_framework as filters
from entitlements.models import CourseEntitlement
class CharListFilter(filters.CharFilter):
""" Filters a field via a comma-delimited list of values. """
def filter(self, qs, value): # pylint: disable=method-hidden
if value not in (None, ''):
... | agpl-3.0 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/nnvm/python/nnvm/compiler/param_dict.py | 2 | 2538 | # 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 |
64studio/pdk | pdk/xml_legacy/sax/expatreader.py | 11 | 15122 | """
SAX driver for the pyexpat C module. This driver works with
pyexpat.__version__ == '2.22'.
"""
version = "0.20"
from xml.sax._exceptions import *
from xml.sax.handler import feature_validation, feature_namespaces
from xml.sax.handler import feature_namespace_prefixes
from xml.sax.handler import feature_external_... | gpl-2.0 |
BassantMorsi/finderApp | lib/python2.7/site-packages/numpy/doc/structured_arrays.py | 56 | 11442 | """
=================
Structured Arrays
=================
Introduction
============
NumPy provides powerful capabilities to create arrays of structured datatype.
These arrays permit one to manipulate the data by named fields. A simple
example will show what is meant.: ::
>>> x = np.array([(1,2.,'Hello'), (2,3.,"Wo... | mit |
MikeAmy/django | tests/template_tests/test_custom.py | 116 | 19622 | from __future__ import unicode_literals
import os
from unittest import skipUnless
from django.template import Context, Engine, TemplateSyntaxError
from django.template.base import Node
from django.template.library import InvalidTemplateLibrary
from django.test import SimpleTestCase
from django.test.utils import exten... | bsd-3-clause |
Bridgewater/appetite | src/modules/conn_manager.py | 1 | 31814 | #!/usr/bin/env python
# pylint: disable=too-complex,relative-import,no-member,invalid-name,too-many-arguments,import-error,too-many-nested-blocks
"""Command Manger
Module to handle ssh communication. Commands are either dictated though
functions or restricted configuration files.
"""
import os
import json
import tim... | apache-2.0 |
bhenne/MoSP | mosp_examples/pause_wiggler.py | 1 | 1479 | #!/bin/env python
""" Pausing example: person is paused at every node
- random movement
- at every node the person stops for 20 ticks
- uses pause_movement and Simulation.person_alarm_clock for waking up
(could alternativly be implemented using a special Location at every node)
- output t... | gpl-3.0 |
Knotis/django-oauth-toolkit | oauth2_provider/tests/settings.py | 14 | 2859 | import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = ()
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'example.sqlite',
}
}
ALLOWED_HOSTS = []
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = Tr... | bsd-2-clause |
mouradmourafiq/django-calendar | calendars/models/cals.py | 1 | 20998 | # -*- coding: utf-8 -*-
'''
Created on Mar 20, 2011
@author: Mourad Mourafiq
@copyright: Copyright © 2011
other contributers:
'''
import os
import heapq
from django.db import models
from django.conf import settings
from django.template.defaultfilters import truncatewords
from django.contrib.auth.models import User
f... | bsd-2-clause |
ezralanglois/arachnid | arachnid/core/gui/property/ButtonDelegate.py | 1 | 10446 | ''' Defines a set of delegates to display widgets in a table/tree cell
.. Created on Dec 11, 2010
.. codeauthor:: Robert Langlois <rl2528@columbia.edu>
'''
#from ..dialogs.WorkflowDialog import Dialog as WorkflowDialog
from ..util.qt4_loader import QtGui,QtCore, qtSignal
import os, logging
_logger = logging.getLogger... | gpl-2.0 |
ZhangXinNan/tensorflow | tensorflow/contrib/boosted_trees/estimator_batch/trainer_hooks.py | 28 | 9303 | # 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 |
gvb/odoo | addons/point_of_sale/report/__init__.py | 381 | 1238 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
makinacorpus/django | django/core/files/locks.py | 114 | 1789 | """
Portable file locking utilities.
Based partially on example by Jonathan Feignberg <jdf@pobox.com> in the Python
Cookbook, licensed under the Python Software License.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
Example Usage::
>>> from django.core.files import locks
>>> with open('.... | bsd-3-clause |
ConstantineLignos/Codeswitchador | tools/filter_cs.py | 1 | 2151 | #!/usr/bin/env python
"""
Remove non-codeswitched tweets.
Constantine Lignos
February 2013
"""
# Copyright (c) 2013 Constantine Lignos
# 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. Red... | bsd-2-clause |
cgstudiomap/cgstudiomap | main/eggs/phonenumbers-7.1.1-py2.7.egg/phonenumbers/shortdata/region_AU.py | 11 | 1309 | """Auto-generated file, do not edit by hand. AU metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AU = PhoneMetadata(id='AU', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[027]\\d{2}|1\\d{2,7}', possible_number... | agpl-3.0 |
fritsvanveen/QGIS | python/ext-libs/requests/__init__.py | 149 | 2215 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
Requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('https://www.python.org')
>>> ... | gpl-2.0 |
WildGenie/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/generator-output/gyptest-subdir2-deep.py | 216 | 1034 | #!/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 building a target from a .gyp file a few subdirectories
deep when the --generator-output= option is used to put the build
confi... | gpl-3.0 |
jmesteve/asterisk | openerp/addons/analytic/analytic.py | 8 | 17640 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
arokem/nipype | nipype/algorithms/tests/test_overlap.py | 7 | 1388 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from shutil import rmtree
from tempfile import mkdtemp
from nipype.testing import (assert_equal, assert_raises,
assert_a... | bsd-3-clause |
Emercoin/emcweb | engine/emcweb/emcweb_webapi/views/wallet.py | 1 | 2709 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
import time
from pathlib import Path
from flask import current_app
from flask_login import current_user
from flask_restful import reqparse
from emcweb.emcweb_webapi.login_resource import LoginResource
from werkzeug.utils import secur... | gpl-3.0 |
velorientc/git_test7 | contrib/thgdebugtools/widgets.py | 1 | 6451 | # widgets.py - menu to find invisible widgets and gc issues
#
# Copyright 2013 Yuya Nishihara <yuya@tcha.org>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
import cgi, gc, pprint, re, weakref
from PyQt4.QtCore impo... | gpl-2.0 |
jonathan-beard/edx-platform | common/djangoapps/third_party_auth/models.py | 16 | 18301 | # -*- coding: utf-8 -*-
"""
Models used to implement SAML SSO support in third_party_auth
(inlcuding Shibboleth support)
"""
from config_models.models import ConfigurationModel, cache
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.utils impor... | agpl-3.0 |
jwalgran/otm-core | opentreemap/manage_treemap/tests/test_instance_invitations.py | 3 | 7088 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from registration.models import RegistrationProfile
from django.core import mail
from django.http import HttpRequest
from django.test import override_settings
from treemap.models impo... | gpl-3.0 |
framon/samba | python/samba/ndr.py | 45 | 1563 | # -*- coding: utf-8 -*-
# Unix SMB/CIFS implementation.
# Copyright © Jelmer Vernooij <jelmer@samba.org> 2008
#
# 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, ... | gpl-3.0 |
jbedorf/tensorflow | tensorflow/python/framework/proto_test.py | 178 | 1704 | # 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 |
yanchen036/tensorflow | tensorflow/contrib/labeled_tensor/python/ops/ops.py | 7 | 46402 | # 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 |
mfrlin/zemcounters | zemcounters/tailer.py | 1 | 3196 | import time
import bson
import bson.objectid
import bson.errors
import tornado.escape
from tornado.websocket import WebSocketHandler
from tornado.web import RequestHandler
from tornado.ioloop import IOLoop
from tornado import gen
class TailHandler(WebSocketHandler):
listeners = {}
def open(self, counter_id)... | mit |
jreback/pandas | pandas/tests/series/apply/test_series_apply.py | 1 | 29906 | from collections import Counter, defaultdict
from itertools import chain
import numpy as np
import pytest
from pandas.core.dtypes.common import is_number
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series, isna, timedelta_range
import pandas._testing as tm
from pandas.core.base import Specif... | bsd-3-clause |
gr33ndata/irlib | irlib/matrix.py | 1 | 17160 | '''
Informations Retrieval Library
==============================
Matrix is an index for documents, terms, and their classes.
'''
# Author: Tarek Amr <@gr33ndata>
import sys, math, random
from superlist import SuperList
from progress import Progress
class MatrixDocs(list):
def doc_fields(self):
retur... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.