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 |
|---|---|---|---|---|---|
mitsuhiko/django | django/db/models/expressions.py | 103 | 4946 | import datetime
from django.utils import tree
class ExpressionNode(tree.Node):
"""
Base class for all query expressions.
"""
# Arithmetic connectors
ADD = '+'
SUB = '-'
MUL = '*'
DIV = '/'
MOD = '%%' # This is a quoted % operator - it is quoted
# because it can be u... | bsd-3-clause |
it-depends/CPSG-ML | books/PCI/Original/PCI_Code/chapter8/numpredict.py | 4 | 4802 | from random import random,randint
import math
def wineprice(rating,age):
peak_age=rating-50
# Calculate price based on rating
price=rating/2
if age>peak_age:
# Past its peak, goes bad in 10 years
price=price*(5-(age-peak_age)/2)
else:
# Increases to 5x original value as it
# approaches its... | mit |
xuxiao19910803/edx-platform | openedx/core/djangoapps/content/course_structures/models.py | 16 | 2011 | import json
import logging
from collections import OrderedDict
from model_utils.models import TimeStampedModel
from util.models import CompressedTextField
from xmodule_django.models import CourseKeyField
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
class CourseStructure(TimeStampedModel):
... | agpl-3.0 |
Zumium/boxes | boxes/handlers/link.py | 1 | 2685 | #Copyright (C) 2016 Zumium martin007323@gmail.com
#
#
#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 Lice... | apache-2.0 |
egoldchain/egoldchain-master | test/functional/signrawtransactions.py | 22 | 7190 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test transaction signing using the signrawtransaction RPC."""
from test_framework.test_framework impor... | mit |
wangyum/tensorflow | tensorflow/contrib/keras/python/keras/applications/vgg19.py | 30 | 9353 | # 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 |
Ichimonji10/robottelo | robottelo/ui/operatingsys.py | 4 | 8335 | # -*- encoding: utf-8 -*-
"""Implements Operating System UI."""
from robottelo.constants import FILTER
from robottelo.ui.base import Base, UIError
from robottelo.ui.locators import common_locators, locators, tab_locators
from robottelo.ui.navigator import Navigator
class OperatingSys(Base):
"""Manipulates Foreman... | gpl-3.0 |
jurcicek/blocks-testing | s2s/s2s.py | 1 | 8471 | #!/usr/bin/env python3
import numpy as np
import h5py
from theano import tensor
from blocks.bricks import Linear, Rectifier, Tanh, Logistic, Softmax, NDimensionalSoftmax, WithExtraDims, application, \
Brick
from blocks.bricks.cost import CategoricalCrossEntropy, MisclassificationRate, Cost
from blocks.bricks impor... | apache-2.0 |
dhutty/ansible | plugins/callbacks/osx_say.py | 72 | 3203 |
# (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 la... | gpl-3.0 |
wtsi-hgi/hgi-cookie-monster-setup | hgicookiemonster/rules/creation_observed_and_incorrect_human_reference_rule.py | 2 | 2388 | import re
from os.path import normpath, dirname, join, realpath
from cookiemonster.common.models import Cookie
from cookiemonster.processor.models import Rule
from hgicommon.data_source import register
from hgicookiemonster.context import HgiContext
from hgicookiemonster.rules.not_cram_rule import NOT_CRAM_RULE_PRIORI... | gpl-3.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/learn/python/learn/estimators/tensor_signature.py | 134 | 6730 | # 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... | mit |
dednal/chromium.src | third_party/protobuf/python/google/protobuf/text_format.py | 162 | 22004 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
jazkarta/edx-platform | cms/envs/dev_with_worker.py | 127 | 1180 | """
This config file follows the dev enviroment, but adds the
requirement of a celery worker running in the background to process
celery tasks.
The worker can be executed using:
django_admin.py celery worker
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from bas... | agpl-3.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.py | 56 | 4550 | from __future__ import absolute_import, division, unicode_literals
from collections import OrderedDict
import re
from pip._vendor.six import string_types
from . import base
from .._utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBuilder(ElementTreeImplementation):
Elemen... | gpl-3.0 |
Perferom/android_external_chromium_org | chrome/browser/nacl_host/test/debug_stub_browser_tests.py | 97 | 3312 | # Copyright (c) 2012 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 re
import sys
import xml.etree.ElementTree
import gdb_rsp
def GetTargetArch(connection):
"""Get the CPU architecture of the NaCl application.... | bsd-3-clause |
ccastell/Transfer-System | Website/env/lib/python3.5/site-packages/django/contrib/gis/gdal/raster/band.py | 108 | 8086 | from ctypes import byref, c_double, c_int, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis.shortcuts import numpy
from django.utils import six
from django.utils.encod... | apache-2.0 |
dannyboi104/SickRage | lib/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
dpendl00/headphones | lib/unidecode/x022.py | 165 | 4329 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'-', ... | gpl-3.0 |
Ashaba/rms | rmslocalenv/lib/python2.7/site-packages/django/db/models/fields/subclassing.py | 44 | 2031 | """
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the metaclass for your Field subclass, implement
to_python() and the other necessary methods and everything will work
seamlessly.
"""
import warnings
from django.utils.deprecation imp... | mit |
ishank08/scikit-learn | sklearn/__init__.py | 28 | 3073 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | bsd-3-clause |
atosorigin/ansible | lib/ansible/module_utils/six/__init__.py | 22 | 33552 | # This code is strewn with things that are not defined on Python3 (unicode,
# long, etc) but they are all shielded by version checks. This is also an
# upstream vendored file that we're not going to modify on our own
# pylint: disable=undefined-variable
# Copyright (c) 2010-2019 Benjamin Peterson
#
# Permission is he... | gpl-3.0 |
ksmit799/Toontown-Source | toontown/safezone/ButterflyGlobals.py | 1 | 7922 | from pandac.PandaModules import *
import random
OFF = 0
FLYING = 1
LANDED = 2
states = {OFF: 'off',
FLYING: 'Flying',
LANDED: 'Landed'}
NUM_BUTTERFLIES = (6, 36, 5)
NUM_BUTTERFLY_AREAS = (4, 1, 4)
BUTTERFLY_SPEED = 2.0
BUTTERFLY_HEIGHT = (2.2, 3.2, 2.2)
BUTTERFLY_TAKEOFF = (1.4, 1.8, 1.4)
BUTTERFLY_LANDING = (1.4, 1.... | mit |
kieferbonk/xbmc-finnish-tv | plugin.video.ruutu/bs4/__init__.py | 417 | 15401 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup uses a pluggable XML or HTML parser to parse a
(possibly invalid) document into a tree representation. Beautiful Soup
provides provides methods and Pythonic idioms that make it easy to
navigate... | gpl-3.0 |
cselis86/edx-platform | lms/djangoapps/survey/tests/test_views.py | 62 | 5051 | """
Python tests for the Survey views
"""
import json
from collections import OrderedDict
from django.test.client import Client
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from survey.models import SurveyForm
from xmodule.modulestore.tests.factories import CourseFactory
... | agpl-3.0 |
Microsoft/Tocino | src/sixlowpan/bindings/modulegen__gcc_ILP32.py | 38 | 320495 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
vasyarv/edx-ora2 | openassessment/assessment/migrations/0001_initial.py | 7 | 13026 | # -*- 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 'Rubric'
db.create_table('assessment_rubric', (
('id', self.gf('django.db.models.... | agpl-3.0 |
mnahm5/django-estore | Lib/site-packages/nose/plugins/__init__.py | 97 | 6291 | """
Writing Plugins
---------------
nose supports plugins for test collection, selection, observation and
reporting. There are two basic rules for plugins:
* Plugin classes should subclass :class:`nose.plugins.Plugin`.
* Plugins may implement any of the methods described in the class
:doc:`IPluginInterface <interf... | mit |
alsotoes/vsphere-examples | python/.venv/lib/python2.6/site-packages/setuptools/tests/test_packageindex.py | 377 | 7625 | """Package Index Tests
"""
import sys
import os
import unittest
import pkg_resources
from setuptools.compat import urllib2, httplib, HTTPError, unicode, pathname2url
import distutils.errors
import setuptools.package_index
from setuptools.tests.server import IndexServer
class TestPackageIndex(unittest.TestCase):
d... | gpl-3.0 |
alilotfi/django | django/template/library.py | 348 | 12752 | import functools
import warnings
from importlib import import_module
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.html import conditional_escape
from django.utils.inspect import getargspec
from django.utils.itercompat import is_iterable
from .base import... | bsd-3-clause |
jazkarta/edx-platform-for-isc | common/djangoapps/terrain/stubs/xqueue.py | 123 | 8708 | """
Stub implementation of XQueue for acceptance tests.
Configuration values:
"default" (dict): Default response to be sent to LMS as a grade for a submission
"<submission>" (dict): Grade response to return for submissions containing the text <submission>
"register_submission_url" (str): URL to send grader... | agpl-3.0 |
hn8841182/20150623-test02 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/pkgdata.py | 603 | 2146 | """pkgdata is a simple, extensible way for a package to acquire data file
resources.
The getResource function is equivalent to the standard idioms, such as
the following minimal implementation::
import sys, os
def getResource(identifier, pkgname=__name__):
pkgpath = os.path.dirname(sys.modules[p... | gpl-3.0 |
alphagov/backdrop | backdrop/core/storage/postgres.py | 1 | 6697 | from datetime import datetime
import dateutil.parser
import dateutil.tz
import psycopg2
import psycopg2.extras
import pytz
import logging
from uuid import uuid4
from sql_query_factory import (
create_sql_query,
create_data_set_exists_query,
create_delete_data_set_query,
create_get_last_updated_query,... | mit |
AaronGeist/Llama | main.py | 1 | 2976 | import sys
import time
from biz.pt.mteam import AdultAlert, UploadCheck, UserCrawl, CandidateVote, MessageReader, NormalAlert
from biz.ipnotifier import IpNotifier
from biz.life.weather import WeatherReport
from biz.miui import Miui
from biz.pt.putao import FreeFeedAlert, MagicPointChecker, UploadMonitor
from biz.pt.... | gpl-3.0 |
okolisny/integration_tests | cfme/cloud/provider/__init__.py | 1 | 8467 | """ A model of a Cloud Provider in CFME
"""
from functools import partial
from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic_manageiq import TimelinesView
from cfme.base.login import BaseLoggedInPage
from cfme.common import TagPageView
from cfme.common.provider_views import (CloudProviderA... | gpl-2.0 |
Exa-Networks/exaddos | lib/exaddos/application.py | 2 | 9124 | """
application.py
Created by Thomas Mangin on 2014-02-06.
Copyright (c) 2014-2014 Exa Networks. All rights reserved.
"""
import os
import sys
import pwd
import socket
import errno
import atexit
from log import log,err,silence
from exaddos import reactor
def __exit(memory,code):
if memory:
from exaddos.leak im... | bsd-3-clause |
dragondjf/tornado_nginx_supervisor | ptest/main.py | 1 | 1231 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | gpl-2.0 |
CentOS-PaaS-SIG/linch-pin | linchpin/fetch/fetch_git.py | 3 | 2306 | from __future__ import absolute_import
import os
import subprocess
import tempfile
from .fetch import Fetch
from linchpin.exceptions import LinchpinError
class FetchGit(Fetch):
def __init__(self, ctx, fetch_type, src, dest, cache_dir, root='',
root_ws='', ref=None):
super(FetchGit, self... | gpl-3.0 |
tersmitten/ansible | test/units/modules/network/netvisor/test_pn_admin_service.py | 15 | 2421 | # Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/python-dateutil-2.4.2/dateutil/parser.py | 102 | 44085 | # -*- coding:iso-8859-1 -*-
"""
This module offers a generic date/time string parser which is able to parse
most known formats to represent a date and/or time.
Additional resources about date/time string formats can be found below:
- `A summary of the international standard date and time notation
<http://www.cl.cam... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/ctypes/test/test_find.py | 9 | 2116 | import unittest
import os.path
import sys
from test import test_support
from ctypes import *
from ctypes.util import find_library
from ctypes.test import is_resource_enabled
if sys.platform == "win32":
lib_gl = find_library("OpenGL32")
lib_glu = find_library("Glu32")
lib_gle = None
elif sys.platform == "da... | gpl-3.0 |
mrphrazer/miasm | test/core/utils.py | 5 | 1161 | #! /usr/bin/env python2
#-*- coding:utf-8 -*-
from __future__ import print_function
from builtins import range
import unittest
class TestUtils(unittest.TestCase):
def test_boundedDict(self):
from miasm.core.utils import BoundedDict
# Use a callback
def logger(key):
print("D... | gpl-2.0 |
chb/indivo_server | indivo/tests/unit/models/audit.py | 4 | 1558 | from indivo.tests.internal_tests import InternalTests
from indivo.models import Audit
import datetime
class AuditModelUnitTests(InternalTests):
def setUp(self):
super(AuditModelUnitTests, self).setUp()
def tearDown(self):
super(AuditModelUnitTests, self).tearDown()
def test_construction(... | gpl-3.0 |
2014c2g4/2015cda0623 | static/Brython3.1.0-20150301-090019/Lib/tempfile.py | 728 | 22357 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | gpl-3.0 |
faywong/FFPlayer | project/jni/python/src/Lib/plat-mac/aepack.py | 31 | 12210 | """Tools for use in AppleEvent clients and servers:
conversion between AE types and python types
pack(x) converts a Python object to an AEDesc object
unpack(desc) does the reverse
coerce(x, wanted_sample) coerces a python object to another python object
"""
#
# This code was originally written by Guido, and modified/... | lgpl-2.1 |
bennymartinson/Oort | oort/abstract.py | 1 | 9782 | import schedule
import rtcmix_import as rtcmix
#from utilities import *
import dynamic_value
import errors
class OortObject(object):
"""Abstract base class for all Oort instruments and behaviors."""
def __getattribute__(self, *args, **kwargs):
"""When a dynamic value object is accessed, return its numb... | gpl-3.0 |
fitnr/censusname | censusname/censusname.py | 1 | 6235 | # -*- coding: utf-8 -*-
# Copyright 2014-5 Neil Freeman
# 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 ... | gpl-3.0 |
alshedivat/tensorflow | tensorflow/contrib/tpu/python/tpu/topology.py | 5 | 6403 | # 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 |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_3/tests/modeltests/proxy_model_inheritance/tests.py | 50 | 1253 | """
XX. Proxy model inheritance
Proxy model inheritance across apps can result in syncdb not creating the table
for the proxied model (as described in #12286). This test creates two dummy
apps and calls syncdb, then verifies that the table has been created.
"""
import os
import sys
from django.conf import settings,... | mit |
sgerhart/ansible | lib/ansible/modules/network/onyx/onyx_magp.py | 66 | 7830 | #!/usr/bin/python
#
# Copyright: Ansible Project
# 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',
'status': ['preview'],
... | mit |
eckucukoglu/arm-linux-gnueabihf | arm-linux-gnueabihf/libc/usr/lib/python2.7/test/test_file_eintr.py | 95 | 10480 | # Written to test interrupted system calls interfering with our many buffered
# IO implementations. http://bugs.python.org/issue12268
#
# This tests the '_io' module. Similar tests for Python 2.x's older
# default file I/O implementation exist within test_file2k.py.
#
# It was suggested that this code could be merged... | gpl-2.0 |
SDSG-Invenio/invenio | invenio/modules/submit/fixtures.py | 13 | 35463 | # -*- 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) any later... | gpl-2.0 |
gregcowell/BAM | btt/auth/views.py | 2 | 13985 | """Module that handles auth views."""
from flask import (
render_template, url_for, request, redirect, session, flash, Blueprint,
current_app)
from flask_login import login_required, login_user, logout_user, current_user
from werkzeug.urls import url_parse
from datetime import datetime
from sqlalchemy.orm.exc i... | apache-2.0 |
emonty/deb-vhd-util | tools/xm-test/lib/XmTestLib/network_utils.py | 42 | 1828 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Murillo F. Bernardes <mfb@br.ibm.com>
from XmTestLib import *
def count_eth(console):
try:
run = console.runCmd("ifconfig -a | grep eth")
except ConsoleError, e:
FAIL(str(e))
return len(run['output'].s... | gpl-2.0 |
twisted/mantissa | xmantissa/test/test_offering.py | 1 | 12563 | """
Tests for xmantissa.offering.
"""
from zope.interface import Interface, implements
from zope.interface.verify import verifyClass, verifyObject
from twisted.trial import unittest
from axiom.store import Store
from axiom import item, attributes, userbase
from axiom.plugins.mantissacmd import Mantissa
from axiom.... | mit |
Hikari-Kubota/sandbox-todo-ts-angular | node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | 1825 | 17014 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | mit |
danieljaouen/ansible | lib/ansible/modules/cloud/vmware/vmware_vmkernel_ip_config.py | 41 | 3638 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version'... | gpl-3.0 |
iver333/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py | 117 | 39195 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are... | bsd-3-clause |
x111ong/odoo | addons/account_analytic_plans/report/__init__.py | 445 | 1084 | # -*- 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... | agpl-3.0 |
mbohlool/client-python | kubernetes/client/models/v1beta1_daemon_set_list.py | 1 | 6557 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | apache-2.0 |
deniszgonjanin/ckanext-showcase | ckanext/showcase/tests/test_helpers.py | 1 | 2522 | from nose import tools as nosetools
from nose import SkipTest
from ckan.plugins import toolkit as tk
import ckan.new_tests.helpers as helpers
import ckan.new_tests.factories as factories
import ckanext.showcase.logic.helpers as showcase_helpers
class TestGetSiteStatistics(helpers.FunctionalTestBase):
def test_... | agpl-3.0 |
ChristopheVuillot/qiskit-sdk-py | qiskit/unroll/_unrollererror.py | 1 | 1078 | # -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. 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 requ... | apache-2.0 |
mattuuh7/incubator-airflow | tests/contrib/operators/test_emr_add_steps_operator.py | 56 | 1722 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
brandonium21/snowflake | snowflakeEnv/lib/python2.7/site-packages/jinja2/testsuite/core_tags.py | 412 | 11858 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.core_tags
~~~~~~~~~~~~~~~~~~~~~~~~~~
Test the core tags like for and if.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Environment... | bsd-2-clause |
invisiblek/python-for-android | python3-alpha/python3-src/Lib/tkinter/test/test_tkinter/test_text.py | 54 | 1136 | import unittest
import tkinter
from test.support import requires, run_unittest
from tkinter.ttk import setup_master
requires('gui')
class TextTest(unittest.TestCase):
def setUp(self):
self.root = setup_master()
self.text = tkinter.Text(self.root)
def tearDown(self):
self.text.destroy... | apache-2.0 |
PedroTrujilloV/nest-simulator | topology/doc/old_doc/plotting_tools/plot_connections.py | 6 | 3755 | # -*- coding: utf-8 -*-
#
# plot_connections.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 |
AnishShah/tensorflow | tensorflow/contrib/timeseries/python/timeseries/state_space_models/periodic.py | 92 | 24154 | # 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 |
tectronics/syncless | examples/demo_orig_webapp.py | 5 | 1089 | #! /usr/local/bin/stackless2.6
# Example invocation: PYTHONPATH="$HOME/prg/google_appengine/google/appengine/ext:$HOME/prg/google_appengine/lib/webob" ./examples/demo_orig_webapp.py
try:
from google.appengine.ext import webapp
except ImportError:
import webapp
class MainPage(webapp.RequestHandler):
def get(self... | apache-2.0 |
spunkmars/ProFTPD-Admin | src/proftpd/ftpadmin/templatetags/FtpTags.py | 1 | 6554 | #coding=utf-8
from django import template
from proftpd.ftpadmin.lib.common import initlog
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response, get_object_or_404
from proftpd.ftpadmin.models.ftpusers import Ftpuser
from proftpd.ftpadmin.models.ftpgroups import Ftpgro... | bsd-3-clause |
mims2707/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/atom/mock_service.py | 277 | 10350 | #!/usr/bin/python
#
# Copyright (C) 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 ... | apache-2.0 |
RichardLitt/wyrd-django-dev | tests/regressiontests/queryset_pickle/models.py | 65 | 1056 | from __future__ import absolute_import
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
def standalone_number(self):
return 1
class Numbers(object):
@staticmethod
def get_static_number(self):
return 2
@classmethod
def get_class_number... | bsd-3-clause |
sklnet/openatv-enigma2 | lib/python/Components/ConditionalWidget.py | 84 | 1700 | from GUIComponent import GUIComponent
from enigma import eTimer
class ConditionalWidget(GUIComponent):
def __init__(self, withTimer = True):
GUIComponent.__init__(self)
self.setConnect(None)
if withTimer:
self.conditionCheckTimer = eTimer()
self.conditionCheckTimer.callback.append(self.update)
self.c... | gpl-2.0 |
myFengo2015/volatility | volatility/plugins/mac/mac_yarascan.py | 44 | 3999 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
mvtuong/Yelp-Challenge | LIBSVM/tools/subset.py | 124 | 3202 | #!/usr/bin/env python
import os, sys, math, random
from collections import defaultdict
if sys.version_info[0] >= 3:
xrange = range
def exit_with_help(argv):
print("""\
Usage: {0} [options] dataset subset_size [output1] [output2]
This script randomly selects a subset of the dataset.
options:
-s method : method of... | apache-2.0 |
Avinash-Raj/appengine-django-skeleton | lib/django/templatetags/i18n.py | 219 | 19311 | from __future__ import unicode_literals
import sys
from django.conf import settings
from django.template import Library, Node, TemplateSyntaxError, Variable
from django.template.base import TOKEN_TEXT, TOKEN_VAR, render_value_in_context
from django.template.defaulttags import token_kwargs
from django.utils import six... | bsd-3-clause |
MrReN/django-oscar | sites/demo/apps/order/migrations/0001_initial.py | 16 | 48092 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
('catalogue', '0001_initial'),
('customer', '0001_initial'),
('partner', '0001_initial'),
('address', '0001_in... | bsd-3-clause |
bood/htc-magic-kernel | tools/perf/scripts/python/syscall-counts.py | 944 | 1429 | # 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 |
wangdkchina/vnpy | vn.strategy/strategyEngine.py | 46 | 23417 | # encoding: UTF-8
from datetime import datetime
from pymongo import Connection
from pymongo.errors import *
from eventEngine import *
# 常量定义
OFFSET_OPEN = '0' # 开仓
OFFSET_CLOSE = '1' # 平仓
DIRECTION_BUY = '0' # 买入
DIRECTION_SELL = '1' # 卖出
PRICETYPE_LIMIT = '2' # 限价
####... | mit |
Kazade/NeHe-Website | google_appengine/lib/django-1.3/tests/regressiontests/middleware_exceptions/tests.py | 48 | 39506 | import sys
from django.conf import settings
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.template import Template
from django.test import TestCase
class TestException(Exception):
pass
# A middleware ba... | bsd-3-clause |
nhaney90/developer-support | python/general-python/export-users-csv/accountHelper.py | 9 | 5538 | #-------------------------------------------------------------------------------
# Name: Account Helper with user and role dictionaries
# Purpose: Queries critical information from ArcGIS Online organization which
# can be used in other scripts
#
# Author: Kelly Gerrow kgerrow@esri.com
#
# ... | apache-2.0 |
ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/contrib/distributions/python/ops/test_util.py | 44 | 16499 | # 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... | mit |
frank10704/DF_GCS_W | MissionPlanner-master/packages/IronPython.StdLib.2.7.5-beta1/content/Lib/pstats.py | 50 | 27927 | """Class for printing reports on profiled python code."""
# Class for printing reports on profiled python code. rev 1.0 4/1/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# see profile.py for more info.
# Copyright 1994, by InfoSeek Corporati... | gpl-3.0 |
kunesj/io3d | tests/sample_data_test.py | 1 | 1948 | #! /usr/bin/python
# -*- coding: utf-8 -*-
# import funkcí z jiného adresáře
import os
import os.path
from nose.plugins.attrib import attr
path_to_script = os.path.dirname(os.path.abspath(__file__))
import unittest
import shutil
import numpy as np
import logging
logger = logging.getLogger(__name__)
# from imtools... | mit |
audihsu-qci/ONL | components/all/platform-config/powerpc-quanta-lb9a-r0/src/python/onlpc.py | 9 | 2801 | #!/usr/bin/python
############################################################
# <bsn.cl fy=2013 v=onl>
#
# Copyright 2013, 2014 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use this file except in compliance
# with the License. You ... | epl-1.0 |
josejpalacios/knowledge-management | Server/controllers/file_controller.py | 2 | 3328 | from Server import verboseFunc
from . import db, SOCKET_EOF
import os
import os
import pickle
from . import db, SUCCESS, FAILURE
@verboseFunc
def upload_file(connection, upload_info):
"""
upload a user's file to the database
:param connection: client connection
:type socket.socket:
:param upload_... | mit |
Kamik423/uni_plan | plan/plan/lib/python3.4/site-packages/pip/_vendor/__init__.py | 329 | 4670 | """
pip._vendor is for vendoring dependencies of pip to prevent needing pip to
depend on something external.
Files inside of pip._vendor should be considered immutable and should only be
updated to versions from upstream.
"""
from __future__ import absolute_import
import glob
import os.path
import sys
# Downstream r... | apache-2.0 |
bx5974/sikuli | sikuli-script/src/main/python/sikuli/Screen.py | 1 | 2876 | # Copyright 2010-2011, Sikuli.org
# Released under the MIT License.
from org.sikuli.script import Screen as JScreen
import inspect
import __main__
import __builtin__
import sys
from Region import *
from java.awt import Rectangle
DEBUG=False
class Screen(Region):
def __init__(self, id=None):
if id != None:
... | mit |
harterj/moose | python/chigger/tests/utils/test_animate.py | 8 | 1087 | #!/usr/bin/env python3
#pylint: disable=missing-docstring
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
... | lgpl-2.1 |
asmuelle/heekscnc | pycnc/wxOutputWindow.py | 25 | 1840 | import wx
import HeeksCNC
class OutputTextCtrl(wx.TextCtrl):
def __init__(self, parent):
wx.TextCtrl.__init__(self, parent, style = wx.TE_MULTILINE + wx.TE_DONTWRAP + wx.TE_RICH + wx.TE_RICH2)
self.painting = False
#self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouse)
#self.Bind(wx.EVT_PAIN... | bsd-3-clause |
sjlehtin/django | django/core/files/locks.py | 725 | 3516 | """
Portable file locking utilities.
Based partially on an example by Jonathan Feignberg in the Python
Cookbook [1] (licensed under the Python Software License) and a ctypes port by
Anatoly Techtonik for Roundup [2] (license [3]).
[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
[2] http://sourceforg... | bsd-3-clause |
hkawasaki/kawasaki-aio8-2 | cms/djangoapps/contentstore/views/tests/test_access.py | 16 | 2238 | """
Tests access.py
"""
from django.test import TestCase
from django.contrib.auth.models import User
from xmodule.modulestore import Location
from xmodule.modulestore.locator import CourseLocator
from student.roles import CourseInstructorRole, CourseStaffRole
from student.tests.factories import AdminFactory
from stude... | agpl-3.0 |
nvoron23/scikit-learn | sklearn/dummy.py | 208 | 17370 | # Author: Mathieu Blondel <mathieu@mblondel.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
import scipy.sparse as sp
from .base import BaseEstimator, ClassifierMixin... | bsd-3-clause |
danlurie/C-PAC | CPAC/qc/blue.py | 5 | 2048 | #007ffe
#007ffd
#007efc
#007efb
#007dfa
#007df9
#007cf8
#007cf7
#007bf6
#007bf5
#007af4
#007af3
#0079f2
#0079f1
#0078f0
#0078ef
#0077ee
#0077ed
#0076ec
#0076eb
#0075ea
#0075e9
#0074e8
#0074e7
#0073e6
#0073e5
#0072e4
#0072e3
#0071e2
#0071e1
#0070e0
#0070df
#006fde
#006fdd
#006edc
#006edb
#006dda
#006dd9
#006cd8
#006cd7
... | bsd-3-clause |
BigFatNoob-NCSU/x9115george2 | hw/code/6/models/kursawe.py | 1 | 1196 | from __future__ import print_function, division
__author__ = 'panzer'
from model import *
from math import sqrt, sin
class Kursawe(Model):
def __init__(self):
Model.__init__(self)
self.__name__ = Kursawe.__name__
self.decisions=[]
self.decisions.append(Decision("x1", -5, 5))
self.decisions.append... | mit |
chrwu/PyGithub | github/PullRequestPart.py | 74 | 3771 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
cxxgtxy/tensorflow | tensorflow/contrib/slim/python/slim/model_analyzer.py | 166 | 3509 | # 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 |
MartinHjelmare/home-assistant | homeassistant/components/mqtt/camera.py | 7 | 4190 | """Camera that loads a picture from an MQTT topic."""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components import camera, mqtt
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
from hom... | apache-2.0 |
gsehub/edx-platform | common/djangoapps/third_party_auth/api/tests/test_views.py | 9 | 12482 | # pylint: disable=no-member
"""
Tests for the Third Party Auth REST API
"""
import unittest
import ddt
from django.urls import reverse
from django.http import QueryDict
from mock import patch
from provider.constants import CONFIDENTIAL
from provider.oauth2.models import Client, AccessToken
from openedx.core.lib.api.pe... | agpl-3.0 |
JCBarahona/edX | common/djangoapps/third_party_auth/tests/specs/test_twitter.py | 86 | 1311 | """
Separate integration test for Twitter which is an OAuth1 provider.
"""
from mock import patch
from third_party_auth.tests.specs import base
class TwitterIntegrationTest(base.Oauth2IntegrationTest):
"""Integration tests for Twitter backend."""
def setUp(self):
super(TwitterIntegrationTest, self).... | agpl-3.0 |
ztemt/N939Sc_5.1_kenel | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
Grumpy-Mike/Mikes-Pi-Bakery | Physical Sequencer/videoSequencer.py | 1 | 5316 | #!/usr/bin/env python
# Video sequencer with track bars
# and multi pixel sampling
import time, pygame, pickle
import os, sys, math, copy
import cv2
pygame.init() # initialise pygame
pygame.mixer.quit()
pygame.mixer.init(frequency=22050, size=-16, channels=4, buffer=512)
pygame.event.set_allowed(Non... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.