repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
JaDogg/__py_playground | refs/heads/master | reference/parsley/ometa/tube.py | 3 | from ometa.interp import TrampolinedGrammarInterpreter, _feed_me
class TrampolinedParser:
"""
A parser that incrementally parses incoming data.
"""
def __init__(self, grammar, receiver, bindings):
"""
Initializes the parser.
@param grammar: The grammar used to parse the incomin... |
marmarek/pykickstart | refs/heads/master | pykickstart/handlers/rhel7.py | 5 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2012, 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will b... |
40223141/0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/token.py | 743 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... |
xiangke/pycopia | refs/heads/master | mibs/pycopia/mibs/FR_MFR_MIB_OID.py | 1 | # python
# This file is generated by a program (mib2py).
import FR_MFR_MIB
OIDMAP = {
'1.3.6.1.2.1.10.47': FR_MFR_MIB.mfrMib,
'1.3.6.1.2.1.10.47.1': FR_MFR_MIB.mfrMibScalarObjects,
'1.3.6.1.2.1.10.47.2': FR_MFR_MIB.mfrMibBundleObjects,
'1.3.6.1.2.1.10.47.3': FR_MFR_MIB.mfrMibBundleLinkObjects,
'1.3.6.1.2.1.10.47.4':... |
paluby/Exercicios | refs/heads/master | backend/appengine/routes/login/passwordless.py | 67 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaecookie.decorator import no_csrf
from gaepermission import facade
from gaepermission.decorator import login_not_required, permissions
from permission_app.model import ADMIN
from tekton import router
from config.template_middleware i... |
endlessm/chromium-browser | refs/heads/master | third_party/angle/third_party/VK-GL-CTS/src/scripts/testset.py | 6 | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
Stanford-Online/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_annotatable_module.py | 13 | """Module annotatable tests"""
import unittest
from lxml import etree
from mock import Mock
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.annotatable_module import AnnotatableModule
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from . import get_t... |
Cyan4973/zstd | refs/heads/master | build/meson/tests/valgrindTest.py | 6 | #!/usr/bin/env python3
# #############################################################################
# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
# All rights reserved.
#
# This source code is licensed under both the BSD-style license (found in the
# LICENSE file in the root directory of this source t... |
denys-duchier/django | refs/heads/master | tests/migrations/routers.py | 102 | class EmptyRouter:
pass
class TestRouter:
def allow_migrate(self, db, app_label, model_name=None, **hints):
"""
The Tribble model should be the only one to appear in the 'other' db.
"""
if model_name == 'tribble':
return db == 'other'
elif db == 'other':
... |
VasuAgrawal/tartanHacks2015 | refs/heads/master | site/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 2039 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... |
ajslater/picopt | refs/heads/develop | picopt/rc/settings_base.py | 1 | """Settings class for picopt."""
from abc import ABC
from argparse import Namespace
from pathlib import Path
from typing import Optional
from ruamel.yaml import YAML
class SettingsBase(Namespace, ABC):
"""Global settings base class."""
_YAML = YAML()
@property
@classmethod
def _RC_NAME(cls): #... |
strint/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/summary_audio_op_test.py | 134 | # 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... |
nitin-cherian/LifeLongLearning | refs/heads/master | Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/nbformat/v2/tests/test_nbpy.py | 28 | from unittest import TestCase
from ..nbbase import (
NotebookNode,
new_code_cell, new_text_cell, new_worksheet, new_notebook
)
from ..nbpy import reads, writes
from .nbexamples import nb0, nb0_py
class TestPy(TestCase):
def test_write(self):
s = writes(nb0)
self.assertEqual(s,nb0_py)
|
vladmm/intellij-community | refs/heads/master | python/testData/inspections/PyUnboundLocalVariableInspection/DefaultArgument.py | 83 | def f():
z = 2
def g(z=z): #pass
return z
return g
|
ghutchis/cclib | refs/heads/master | test/test_parser.py | 5 | # This file is part of cclib (http://cclib.github.io), a library for parsing
# and interpreting the results of computational chemistry packages.
#
# Copyright (C) 2015, the cclib development team
#
# The library is free software, distributed under the terms of
# the GNU Lesser General Public version 2.1 or later. You s... |
yencarnacion/jaikuengine | refs/heads/master | common/profile.py | 33 | # Copyright 2009 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 or agreed to in writing, ... |
40223236/2015examQ1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/_test_warnings.py | 858 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... |
andmaj/rrr-size | refs/heads/master | sdsl-lite/lib/src/sdsl-lite/external/gtest-1.6.0/test/gtest_env_var_test.py | 2408 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
linkitspa/l10n-italy | refs/heads/10.0 | l10n_it_vat_registries_split_payment/models/account_tax.py | 1 | # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class AccountTax(models.Model):
_inherit = 'account.tax'
def _compute_totals_tax(self, data):
res = super(AccountTax, self)._compute_totals_tax(data)
if self.is_split_payment:
... |
MichaelDrogalis/ansible | refs/heads/devel | lib/ansible/executor/__init__.py | 7690 | # (c) 2012-2014, 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) an... |
rusthon/Rusthon | refs/heads/master | regtests/loop/for_loop.py | 3 | from runtime import *
'''
for loop tests
'''
def main():
a = [1,2,3]
y = 0
for x in a:
y += x
assert( y==6 )
z = ''
arr = ['a', 'b', 'c']
for v in arr:
z += v
assert( z == 'abc' )
b = False
if 'a' in arr:
b = True
assert( b == True )
s = 'hello world'
z = ''
for char in iter(s):
z += char
as... |
qzxx-syzz/ernst | refs/heads/master | Lobby/Lobby/settings.py | 1 | """
Django settings for Lobby project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ... |
chris-chris/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/datasets/base_test.py | 136 | # 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... |
htranx/KivyMD | refs/heads/master | kivymd/ripplebehavior.py | 1 | # -*- coding: utf-8 -*-
from kivy.properties import ListProperty, NumericProperty, StringProperty, \
BooleanProperty
from kivy.animation import Animation
from kivy.graphics import Color, Ellipse, StencilPush, StencilPop, \
StencilUse, StencilUnUse, Rectangle
class CommonRipple(object):
ripple_rad = NumericProperty... |
nevercast/home-assistant | refs/heads/dev | homeassistant/remote.py | 6 | """
homeassistant.remote
~~~~~~~~~~~~~~~~~~~~
A module containing drop in replacements for core parts that will interface
with a remote instance of Home Assistant.
If a connection error occurs while communicating with the API a
HomeAssistantError will be raised.
For more details about the Python API, please refer to ... |
lauosi/coworkok | refs/heads/master | cowork/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
consulo/consulo-python | refs/heads/master | plugin/src/main/dist/helpers/pydev/pydevd.py | 1 | '''
Entry point module (keep at root):
This module starts the debugger.
'''
from __future__ import nested_scopes # Jython 2.1 support
import atexit
import os
import sys
import traceback
from _pydevd_bundle.pydevd_constants import IS_JYTH_LESS25, IS_PY3K, IS_PY34_OLDER, get_thread_id, dict_keys, dict_pop, dict_conta... |
miguelpalacio/python-for-android | refs/heads/master | python-modules/twisted/twisted/protocols/memcache.py | 60 | # -*- test-case-name: twisted.test.test_memcache -*-
# Copyright (c) 2007-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Memcache client protocol. Memcached is a caching server, storing data in the
form of pairs key/value, and memcache is the protocol to talk with it.
To connect to a server, create ... |
hydroshare/hydroshare | refs/heads/develop | hs_core/tests/api/native/test_utils.py | 1 | from django.contrib.auth.models import Group
from django.contrib.sites.models import Site
from django.test import TestCase
from mezzanine.conf import settings
from hs_core.hydroshare import utils
from hs_core.models import GenericResource, BaseResource
from hs_core import hydroshare
from hs_core.testing import MockIR... |
hurrinico/sale-workflow | refs/heads/8.0 | sale_multi_picking/__init__.py | 74 | # -*- coding: utf-8 -*-
#
#
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense srl (<http://www.domsense.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 publis... |
Stanford-Online/edx-platform | refs/heads/master | openedx/core/djangoapps/content/block_structure/tests/test_block_structure.py | 10 | """
Tests for block_structure.py
"""
from datetime import datetime
# pylint: disable=protected-access
from collections import namedtuple
from copy import deepcopy
import ddt
import itertools
from nose.plugins.attrib import attr
from unittest import TestCase
from openedx.core.lib.graph_traversals import traverse_post_o... |
nathanross/amiens | refs/heads/master | src/amiens/core/asserts.py | 1 | #!/usr/bin/python3
# Copyright 2015 Nathan Ross
#
# 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... |
Microvellum/Fluid-Designer | refs/heads/master | win64-vc/2.78/python/lib/test/test_socketserver.py | 4 | """
Test suite for socketserver.
"""
import contextlib
import os
import select
import signal
import socket
import select
import errno
import tempfile
import unittest
import socketserver
import test.support
from test.support import reap_children, reap_threads, verbose
try:
import threading
except ImportError:
... |
mwobensmith/tls-canary | refs/heads/master | tlscanary/modes/sourceupdate.py | 1 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import csv
import datetime
import logging
import os
import sys
import zipfile
from basemode import BaseMode
from tlscan... |
pleaseproject/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/Crypto/PublicKey/__init__.py | 273 | """Public-key encryption and signature algorithms.
Public-key encryption uses two different keys, one for encryption and
one for decryption. The encryption key can be made public, and the
decryption key is kept private. Many public-key algorithms can also
be used to sign messages, and some can *only* be used for sig... |
luisgg/iteexe | refs/heads/master | exe/webui/reflectionfpdmodifblock.py | 2 | # ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
#
# 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 versio... |
PokemonGoF/PokemonGo-Bot-Desktop | refs/heads/development | build/pywin/Lib/distutils/command/build_ext.py | 8 | """distutils.command.build_ext
Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import sys, os, string, re
from types import *
fr... |
xindus40223115/2015cda_g1 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/xml/etree/__init__.py | 1200 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... |
satterly/alerta5 | refs/heads/master | alerta/app/webhooks/newrelic.py | 1 |
from flask import request, g, jsonify
from flask_cors import cross_origin
from alerta.app.auth.utils import permission
from alerta.app.models.alert import Alert
from alerta.app.utils.api import process_alert, add_remote_ip
from alerta.app.exceptions import ApiError, RejectException
from . import webhooks
def parse... |
bonitadecker77/python-for-android | refs/heads/master | python-modules/twisted/twisted/internet/test/test_address.py | 56 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
import re
from twisted.trial import unittest
from twisted.internet.address import IPv4Address, UNIXAddress
class AddressTestCaseMixin(object):
def test_addressComparison(self):
"""
Test that two different address in... |
leafclick/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_0/_pkg0_0_0/_pkg0_0_0_1/_pkg0_0_0_1_0/_mod0_0_0_1_0_4.py | 30 | name0_0_0_1_0_4_0 = None
name0_0_0_1_0_4_1 = None
name0_0_0_1_0_4_2 = None
name0_0_0_1_0_4_3 = None
name0_0_0_1_0_4_4 = None |
ceramos/micropython | refs/heads/master | py/makeversionhdr.py | 7 | """
Generate header file with macros defining MicroPython version info.
This script works with Python 2.6, 2.7, 3.3 and 3.4.
"""
from __future__ import print_function
import sys
import os
import datetime
import subprocess
def get_version_info_from_git():
# Python 2.6 doesn't have check_output, so check for that... |
rafafigueroa/edison-quad | refs/heads/master | keyboard_test.py | 1 | #!/usr/bin/python
import curses
import shelve
from Adafruit_PWM_Servo_Driver import PWM
import time
import numpy as np
# Initialise the PWM device using the default address
pwm = PWM(0x40, debug=False)
pulseMin = 1735 # Min pulse length out of 4096
pulseLow = 2500
pulseMax = 3047
pulseStop = 0
motorChannel = 0
pw... |
mycodeday/crm-platform | refs/heads/master | stock/stock.py | 2 | # -*- 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... |
thnee/ansible | refs/heads/devel | test/units/template/test_templar.py | 55 | # (c) 2012-2014, 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) an... |
glouppe/scikit-learn | refs/heads/master | examples/linear_model/plot_lasso_lars.py | 363 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... |
hkariti/ansible | refs/heads/devel | lib/ansible/modules/network/ios/ios_banner.py | 18 | #!/usr/bin/python
#
# 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 distribut... |
ianatpn/nupictest | refs/heads/master | tests/unit/py2/nupic/encoders/sdrcategory_test.py | 7 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
miic-sw/miic | refs/heads/master | miic.core/src/miic/core/wt_fun.py | 1 | """
@author:
Eraldo Pomponi
@copyright:
The MIIC Development Team (eraldo.pomponi@uni-leipzig.de)
@license:
GNU Lesser General Public License, Version 3
(http://www.gnu.org/copyleft/lesser.html)
Created on -- Mar 22, 2011 --
"""
# PyWavelets import
import pywt
from scipy import median, diff, sqrt, log, power
from n... |
maxis1314/pyutils | refs/heads/master | Remember/app/apis.py | 1 | '''
all the REST api implementations
'''
import os
import uuid
import json
import werkzeug
from flask import abort, make_response, send_from_directory
from flask_restful import Api, Resource, reqparse, fields, marshal
from app import app, models
from app.models import db
api = Api(app) # pylint: disable=C0103
@... |
nouiz/pylearn2 | refs/heads/master | pylearn2/utils/utlc.py | 49 | """Several utilities for experimenting upon utlc datasets"""
# Standard library imports
import logging
import os
import inspect
import zipfile
from tempfile import TemporaryFile
# Third-party imports
import numpy
import theano
from pylearn2.datasets.utlc import load_ndarray_dataset, load_sparse_dataset
from pylearn2.u... |
3manuek/Data-Science-45min-Intros | refs/heads/master | python_multiprocessing/run_2.py | 25 | #!/usr/bin/env python
from multiprocessing import Process
from run_1 import bad_ass_function
if __name__ == "__main__":
n = 5
# Process takes keyword args: target=function_name, args=function_args_tuple
p = Process(target=bad_ass_function,args=(n,))
# runs "target" locally
#p.run()
#... |
BigJMoney/WarrensMUD | refs/heads/master | server/conf/portal_services_plugins.py | 31 | """
Start plugin services
This plugin module can define user-created services for the Portal to
start.
This module must handle all imports and setups required to start
twisted services (see examples in evennia.server.portal.portal). It
must also contain a function start_plugin_services(application).
Evennia will call... |
birsoyo/conan | refs/heads/develop | conans/test/util/detect_test.py | 2 | import platform
import subprocess
import unittest
from conans import tools
from conans.client.conf.detect import detect_defaults_settings
from conans.test.utils.tools import TestBufferConanOutput
class DetectTest(unittest.TestCase):
def detect_default_compilers_test(self):
platform_default_compilers = {... |
KonstantinRitt/qmqtt | refs/heads/master | tests/gtest/gtest/googletest/googletest/test/gtest_xml_output_unittest.py | 1815 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
vladmm/intellij-community | refs/heads/master | python/testData/completion/overrideParamNameInRestDocstring.py | 53 | def f(param1, param2):
"""
:param par<caret>am1: description
""" |
s34rching/python_classes | refs/heads/master | tests/test_delete_contact.py | 1 | # -*- coding: utf-8 -*-
from models.contact import Contact
import random
import pytest
def test_delete_contact(app, orm, check_ui):
with pytest.allure.step('Given a non-empty contact list'):
if app.contact.count() == 0:
app.contact.create(Contact(firstname="Test", lastname="Test", address="some... |
aktech/sympy | refs/heads/master | sympy/physics/units.py | 18 | """
Physical units and dimensions.
The base class is Unit, where all here defined units (~200) inherit from.
The find_unit function can help you find units for a given quantity:
>>> import sympy.physics.units as u
>>> u.find_unit('coul')
['coulomb', 'coulombs']
>>> u.find_unit(u.charge)
['C', 'ch... |
olasitarska/django | refs/heads/master | tests/many_to_many/models.py | 38 | """
5. Many-to-many relationships
To define a many-to-many relationship, use ``ManyToManyField()``.
In this example, an ``Article`` can be published in multiple ``Publication``
objects, and a ``Publication`` has multiple ``Article`` objects.
"""
from __future__ import unicode_literals
from django.db import models
fr... |
nberliner/SRVis | refs/heads/master | SRVis.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 dis... |
belleandindygames/league | refs/heads/master | config/wsgi.py | 1 | """
WSGI config for cookiecutter project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... |
frankinit/ThinkStats2 | refs/heads/master | code/chap14soln.py | 68 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import numpy as np
import random
import first
import normal
import th... |
okuta/chainer | refs/heads/master | tests/chainerx_tests/math_utils.py | 3 | import unittest
import numpy
import chainerx
from chainerx_tests import array_utils
from chainerx_tests import dtype_utils
class IgnoreNumpyFloatingPointError(object):
def __enter__(self):
self.old_settings = numpy.seterr(all='ignore')
def __exit__(self, *args):
numpy.seterr(**self.old_se... |
praekelt/molo-ndoh-yep | refs/heads/develop | surveys/models.py | 1 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailcore.models import Page
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailsearch import index
class Survey(Page):
survey_text = models.CharField(max_length=200)
pub_date = model... |
NathanW2/QGIS | refs/heads/master | python/plugins/db_manager/db_plugins/oracle/plugin.py | 5 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS (Oracle)
Date : Aug 27, 2014
copyright : (C) 2014 by Médéric RIBREUX
email : meder... |
hidekb/espressopp | refs/heads/master | src/tools/povwrite.py | 7 | # Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.5/tests/modeltests/m2m_through/__init__.py | 45382 | |
jstitch/MambuPy | refs/heads/master | MambuPy/rest/mambuuser.py | 1 | # coding: utf-8
"""Mambu Users objects.
.. autosummary::
:nosignatures:
:toctree: _autosummary
MambuUser
MambuUsers
MambuUser holds a user.
MambuUsers holds a list of users.
Uses mambuutil.getuserurl as default urlfunc
"""
from ..mambuutil import getusercustominformationurl, getuserurl
from .mambustr... |
SEJeff/home-assistant | refs/heads/dev | homeassistant/components/light/demo.py | 12 | """
homeassistant.components.light.demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo platform that implements lights.
"""
import random
from homeassistant.components.light import (
Light, ATTR_BRIGHTNESS, ATTR_XY_COLOR)
LIGHT_COLORS = [
[0.368, 0.180],
[0.460, 0.470],
]
def setup_platform(hass, config, a... |
ljdursi/hadoop-for-hpcers-tutorial | refs/heads/master | examples/matmult/map.py | 2 | #!/usr/bin/env python
import sys
maxrows=100
for line in sys.stdin:
line = line.strip()
matrix, row, col, val = line.split()
row = int(row)
col = int(col)
val = int(val)
if matrix == 'A':
value = matrix+'-'+str(col)+'-'+str(val)
for j in xrange(maxrows):
key = st... |
razvanphp/arangodb | refs/heads/devel | 3rdParty/V8-3.31.74.1/build/gyp/test/win/gyptest-lib-ltcg.py | 269 | #!/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.
"""
Make sure LTCG setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(form... |
allenp/odoo | refs/heads/9.0 | openerp/addons/test_inherit/tests/__init__.py | 121 | # -*- coding: utf-8 -*-
from . import test_inherit
|
nud3l/smart-contract-analysis | refs/heads/master | data/adjustIndex.py | 1 | import csv
start = 690
newcsv = []
with open('70_percent_cheaters2.csv', 'rb') as csvfile:
experiment50 = csv.DictReader(csvfile)
for row in experiment50:
row['Run'] = int(row['Run']) + start
newcsv.append(row)
with open('changed.csv', 'wb') as newfile:
fieldnames = ["Run","Time","Statu... |
shadowmint/nwidget | refs/heads/master | src/nwidget/assets.py | 1 | # Copyright 2013 Douglas Linder
# 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... |
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-0.96/django/middleware/doc.py | 73 | from django.conf import settings
from django import http
class XViewMiddleware(object):
"""
Adds an X-View header to internal HEAD requests -- used by the documentation system.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
"""
If the request method is HEAD and ... |
xuther/nyc-taxi-data | refs/heads/master | pre-proc/s.py | 1 | tracts = []
for i in blocks.records():
if (i[2] not in tracts):
print i[2]
tracts.append(i[2])
print len(tracts)
countiesInTract = []
for tractIndex in countiesToTracts['061']:
print str(tractIndex) + " -> " + tracts.record(tractIndex)[2]
if(tracts.record(tractIndex)[2] == '003001'):
... |
Omegaphora/external_chromium_org | refs/heads/lp5.1 | components/policy/tools/syntax_check_policy_template_json.py | 34 | #!/usr/bin/env python
# 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.
'''
Checks a policy_templates.json file for conformity to its syntax specification.
'''
import json
import optparse
import os
impo... |
cobalys/django | refs/heads/master | tests/modeltests/m2o_recursive/models.py | 43 | """
11. Relating an object to itself, many-to-one
To define a many-to-one relationship between a model and itself, use
``ForeignKey('self')``.
In this example, a ``Category`` is related to itself. That is, each
``Category`` has a parent ``Category``.
Set ``related_name`` to designate what the reverse relationship is... |
TangHao1987/intellij-community | refs/heads/master | python/testData/refactoring/rename/renameUpdatesImportReferences/after/bar.py | 83 | import baz
from baz import f
|
sullome/rollingdice | refs/heads/master | fudge.py | 1 | #!/usr/bin/python
from random import choice
FUDGE_LEVELS = (
'None',
'совсем-совсем ужасно-',
'совсем-совсем ужасно',
'совсем ужасно',
'ужасно',
'плохо',
'посредственно',
'нормально',
'хорошо',
'отлично',
'супер',
'легендарно',
'легендарно+',
'легендарно++',
... |
orangeduck/PyAutoC | refs/heads/master | Python27/Lib/CGIHTTPServer.py | 108 | """CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Py... |
sourcepole/kadas-albireo | refs/heads/master | python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py | 6 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SinglePartsToMultiparts.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... |
phretor/django-academic | refs/heads/master | academic/apps/people/migrations/0004_auto__add_field_person_alumni.py | 1 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Person.alumni'
db.add_column('people_person', 'alumni', self.gf('django.db.models.fields.B... |
2013Commons/HUE-SHARK | refs/heads/master | desktop/core/ext-py/Django-1.2.3/build/lib.linux-i686-2.7/django/bin/compile-messages.py | 186 | #!/usr/bin/env python
if __name__ == "__main__":
import sys
name = sys.argv[0]
args = ' '.join(sys.argv[1:])
print >> sys.stderr, "%s has been moved into django-admin.py" % name
print >> sys.stderr, 'Please run "django-admin.py compilemessages %s" instead.'% args
print >> sys.stderr
sys.exi... |
brain-tec/server-tools | refs/heads/11.0 | html_image_url_extractor/tests/__init__.py | 8 | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import test_extractor
|
ifduyue/django | refs/heads/master | django/contrib/auth/views.py | 5 | import warnings
from urllib.parse import urlparse, urlunparse
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib.auth import (
REDIRECT_FIELD_NAME, get_user_model, login as auth_login,
logout as auth_logout, update_session_auth_hash,
)
from django.contr... |
jsoref/django | refs/heads/master | django/utils/jslex.py | 335 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
import re
class Tok(object):
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1... |
jhunufernandes/ArduWatchRaspSerial | refs/heads/master | virtualenv/lib/python3.4/site-packages/pip/_vendor/colorama/winterm.py | 578 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL ... |
shaistaansari/django | refs/heads/master | tests/staticfiles_tests/test_storage.py | 147 | from __future__ import unicode_literals
import os
import sys
import unittest
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.contrib.staticfiles.management.commands import collectstatic
from django.contrib.staticfiles.management.commands.collectstatic import \
... |
russel1237/scikit-learn | refs/heads/master | sklearn/utils/validation.py | 2 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals i... |
avanov/django | refs/heads/master | django/contrib/auth/migrations/0002_alter_permission_name_max_length.py | 586 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='permission',
name='name'... |
adamcandy/QGIS-Meshing | refs/heads/master | extras/old_release_versions/rastercalc/standardModules.py | 12 | import numpy as np
##########################################################################
#
# QGIS-meshing plugins.
#
# Copyright (C) 2012-2013 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a
# full list of copyright holders.
#
# Dr Adam S. Candy,... |
zhaochl/python-utils | refs/heads/master | verify_code/Imaging-1.1.7/PIL/MpegImagePlugin.py | 40 | #
# The Python Imaging Library.
# $Id$
#
# MPEG file handling
#
# History:
# 95-09-09 fl Created
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1995.
#
# See the README file for information on usage and redistribution.
#
__version__ = "0.1"
import Image, ImageFile
#
# Bitstream parser... |
crakensio/django_training | refs/heads/master | lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_http.py | 109 | from __future__ import unicode_literals
import os
from datetime import date
from django.conf import settings
from django.contrib.sitemaps import Sitemap, GenericSitemap
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings
... |
openilabs/falconlab | refs/heads/master | env/lib/python2.7/locale.py | 4 | /usr/lib/python2.7/locale.py |
TridevGuha/django | refs/heads/master | tests/inspectdb/tests.py | 108 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from unittest import skipUnless
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.utils.six import PY3, StringIO
from .models import ColumnTypes... |
uthcode/learntosolveit | refs/heads/version1 | languages/python/design_atexit_1.py | 7 | import atexit
def foo():
print "foo"
class SomeClass(object):
def __init__(self):
self.a = 10
self.b = 20
atexit.register(foo)
obj = SomeClass()
print obj.a
print obj.b
|
ArchipelProject/Archipel | refs/heads/master | ArchipelAgent/archipel-agent-hypervisor-network/archipelagenthypervisornetwork/network.py | 1 | # -*- coding: utf-8 -*-
#
# network.py
#
# Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu>
# Copyright, 2011 - Franck Villaume <franck.villaume@trivialdev.com>
# This file is part of ArchipelProject
# http://archipelproject.org
#
# This program is free software: you can redistribute it and/or modif... |
mkoistinen/django-filer | refs/heads/develop | docs/conf.py | 27 | # -*- coding: utf-8 -*-
#
# django-filer documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 16 22:05:55 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... |
gdooper/scipy | refs/heads/master | tools/cythonize.py | 67 | #!/usr/bin/env python
""" cythonize
Cythonize pyx files into C files as needed.
Usage: cythonize [root_dir]
Default [root_dir] is 'scipy'.
Checks pyx files to see if they have been changed relative to their
corresponding C files. If they have, then runs cython on these files to
recreate the C files.
The script th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.