repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tutorgen/HPIT-python-client | refs/heads/master | tests/hpitclient/test_message_sender_mixin.py | 1 | import sure
import httpretty
import json
import pytest
from mock import *
from hpitclient.message_sender_mixin import MessageSenderMixin
from hpitclient.exceptions import InvalidMessageNameException
from hpitclient.exceptions import ResponseDispatchError
from hpitclient.exceptions import InvalidParametersError
def se... |
jtrobec/pants | refs/heads/master | tests/python/pants_test/base/test_fingerprint_strategy.py | 33 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.fing... |
ferabra/edx-platform | refs/heads/master | common/lib/calc/calc/functions.py | 279 | """
Provide the mathematical functions that numpy doesn't.
Specifically, the secant/cosecant/cotangents and their inverses and
hyperbolic counterparts
"""
import numpy
# Normal Trig
def sec(arg):
"""
Secant
"""
return 1 / numpy.cos(arg)
def csc(arg):
"""
Cosecant
"""
return 1 / nump... |
vladmm/intellij-community | refs/heads/master | python/testData/codeInsight/smartEnter/py891_after.py | 83 | class Foo:
def __init__(self):
<caret> |
erinspace/rivannastreamwatch_api | refs/heads/master | reports/admin.py | 469 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
# Register your models here.
|
amyvmiwei/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_codecmaps_cn.py | 16 | #
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
#
from test import support
from test import multibytecodec_support
import unittest
class TestGB2312Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'gb2312'
mapfileurl = 'http://people.freebsd.org/... |
agentr13/python-phonenumbers | refs/heads/dev | python/phonenumbers/data/region_PT.py | 6 | """Auto-generated file, do not edit by hand. PT metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_PT = PhoneMetadata(id='PT', country_code=351, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-46-9]\\d{8}', possible_number_pattern... |
fredg02/crazyflie-clients-python | refs/heads/develop | src/cfclient/ui/dialogs/logconfigdialogue.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
gaste/dwasp | refs/heads/master | tests/asp/weakConstraints/2-still_live-3-1.asp.gringo.test.py | 4 | input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
2 17 3 0 3 18 19 20
1 21 1 0 17
1 1 2 1 22 21
2 23 3 0 3 18 22 20
1 24 1 0 23
1 1 2 1 19 24
2 25 3 0 3 18 22 19
1 26 1 0 25
1 1 2 1 20 26
2 27 3 0 3 22 19 20
1 28 1 0 27
1 1 2 1 18 ... |
Arc-Team/android_kernel_htc_msm8660 | refs/heads/cm-11.0 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
whoflungpoop/badbot | refs/heads/master | plugins/tag.py | 2 | # -*- coding: utf-8 -*-
import math
import random
import re
import threading
from util import hook
def sanitize(s):
return re.sub(r'[\x00-\x1f]', '', s)
# @hook.command
# def munge(inp, munge_count=0):
# reps = 0
# for n in xrange(len(inp)):
# rep = character_replacements.get(inp[n])
# ... |
klusark/android_external_chromium_org | refs/heads/cm-11.0 | tools/perf/metrics/memory.py | 23 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from metrics import Metric
class MemoryMetric(Metric):
"""MemoryMetric gathers memory statistics from the browser object."""
def __init__(se... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/Crypto/Hash/RIPEMD.py | 124 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... |
harshilasu/GraphicMelon | refs/heads/master | y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/datapipeline/test_layer1.py | 136 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... |
iemejia/incubator-beam | refs/heads/master | sdks/python/setup.py | 1 | #
# 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 us... |
PyAngel/Sudoku | refs/heads/master | gui.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter
import sudoku
from copy import deepcopy
class App():
def __init__(self, difficulty = 50, cheats = True):
self.resolution = (600, 600)
self.globalFont = ("Times", 30)
self.numberConf = {"font" : self.globalFont, "fg" : "black", "b... |
dmsuehir/spark-tk | refs/heads/master | python/sparktk/models/timeseries/arimax.py | 14 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... |
yamila-moreno/django | refs/heads/master | django/core/management/commands/inspectdb.py | 86 | from __future__ import unicode_literals
import keyword
import re
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = "Introspects the database tables in the given database and... |
chris-ch/coinarb | refs/heads/master | bf-arb-pylab/scripts/testbitfinex.py | 1 | import json
import asyncio
import websockets
WSS_BITFINEX_2 = 'wss://api2.bitfinex.com:3000/ws'
async def consumer_handler(pair):
async with websockets.connect(WSS_BITFINEX_2) as websocket:
subscription = json.dumps({
'event': 'subscribe',
'channel': 'book',
'symbol': ... |
smartdj/chrome-sync-server | refs/heads/master | google/protobuf/python/google/protobuf/descriptor_database.py | 230 | # 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... |
rdeheele/odoo | refs/heads/master | addons/purchase_double_validation/__openerp__.py | 52 | # -*- 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... |
tomhenderson/ns-3-dev-testing | refs/heads/master | src/nix-vector-routing/bindings/modulegen__gcc_ILP32.py | 28 | 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))
... |
paulproteus/django | refs/heads/master | tests/regressiontests/admin_scripts/simple_app/models.py | 153 | from __future__ import absolute_import
from ..complex_app.models.bar import Bar
|
btabibian/scikit-learn | refs/heads/master | examples/cluster/plot_mini_batch_kmeans.py | 86 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... |
chronicwaffle/PokemonGo-DesktopMap | refs/heads/master | app/pywin/Lib/idlelib/idle_test/test_warning.py | 49 | '''Test warnings replacement in PyShell.py and run.py.
This file could be expanded to include traceback overrides
(in same two modules). If so, change name.
Revise if output destination changes (http://bugs.python.org/issue18318).
Make sure warnings module is left unaltered (http://bugs.python.org/issue18081).
'''
im... |
nazeehshoura/crawler | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 1229 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... |
mne-tools/mne-python | refs/heads/main | examples/connectivity/mne_inverse_connectivity_spectrum.py | 6 | """
==============================================================
Compute full spectrum source space connectivity between labels
==============================================================
The connectivity is computed between 4 labels across the spectrum
between 7.5 Hz and 40 Hz.
"""
# Authors: Alexandre Gramfort... |
dsprenkels/servo | refs/heads/master | tests/wpt/web-platform-tests/XMLHttpRequest/resources/conditional.py | 205 | def main(request, response):
tag = request.GET.first("tag", None)
match = request.headers.get("If-None-Match", None)
date = request.GET.first("date", "")
modified = request.headers.get("If-Modified-Since", None)
if tag:
response.headers.set("ETag", '"%s"' % tag)
elif date:
respon... |
wandec/grr | refs/heads/master | server/data_server/master.py | 4 | #!/usr/bin/env python
"""Data master specific classes."""
import socket
import threading
import urlparse
import urllib3
from urllib3 import connectionpool
import logging
from grr.lib import config_lib
from grr.lib import rdfvalue
from grr.lib import utils
from grr.server.data_server import constants
from grr.ser... |
luckasfb/android_kernel_iocean_x7 | refs/heads/master | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
bsmrstu-warriors/Moytri--The-Drone-Aider | refs/heads/master | ExtLibs/Mavlink/pymavlink/generator/mavtemplate.py | 68 | #!/usr/bin/env python
'''
simple templating system for mavlink generator
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
from .mavparse import MAVParseError
class MAVTemplate(object):
'''simple templating system'''
def __init__(self,
start_var_token="${",
... |
mcltn/ansible-modules-extras | refs/heads/devel | cloud/amazon/ec2_vpc_nacl.py | 33 | #!/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 distributed... |
mmnelemane/nova | refs/heads/master | nova/objects/migration.py | 12 | # Copyright 2013 IBM Corp.
#
# 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... |
ThirdProject/android_external_chromium_org | refs/heads/cm-11.0 | third_party/protobuf/python/stubout.py | 670 | #!/usr/bin/python2.4
#
# 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 o... |
bbansalWolfPack/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/handlers/handshake_protocol_wsh.py | 215 | #!/usr/bin/python
from mod_pywebsocket import common, msgutil, util
from mod_pywebsocket.handshake import hybi
def web_socket_do_extra_handshake(request):
request.connection.write('HTTP/1.1 101 Switching Protocols:\x0D\x0AConnection: Upgrade\x0D\x0AUpgrade: WebSocket\x0D\x0ASec-WebSocket-Protocol: foobar\x0D\x0AS... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/Django-1.11.29/tests/migrations/test_migrations_squashed_complex/3_squashed_5.py | 770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("migrations", "3_auto"),
("migrations", "4_auto"),
("migrations", "5_auto"),
]
dependencies = [("migrations", "2_auto")]
ope... |
keyru/hdl-make | refs/heads/develop | tests/counter/syn/brevia2_dk_diamond/verilog/Manifest.py | 2 | target = "lattice"
action = "synthesis"
syn_device = "lfxp2-5e"
syn_grade = "-6"
syn_package = "tn144c"
syn_top = "brevia2_top"
syn_project = "demo"
syn_tool = "diamond"
modules = {
"local" : [ "../../../top/brevia2_dk/verilog" ],
}
|
MotorolaMobilityLLC/external-chromium_org | refs/heads/kitkat-mr1-release-falcon-gpe | tools/json_schema_compiler/schema_util_test.py | 169 | #!/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.
from schema_util import JsFunctionNameToClassName
from schema_util import StripNamespace
import unittest
class SchemaUtilTest(unit... |
jiangzhuo/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/unittest/runner.py | 195 | """Running tests"""
import sys
import time
import warnings
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __ge... |
harry-7/addons-server | refs/heads/master | src/olympia/api/parsers.py | 16 | from rest_framework.parsers import DataAndFiles, MultiPartParser
class MultiPartParser(MultiPartParser):
"""
Parser for multipart form data, which may include file data.
Lifted from https://github.com/tomchristie/django-rest-framework/pull/4026/
to work around request.data being empty when multipart/... |
lxn2/mxnet | refs/heads/master | example/speech-demo/io_func/convert2kaldi.py | 15 | # Copyright 2013 Yajie Miao Carnegie Mellon University
# 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
#
# THIS CODE IS PROVIDED *AS IS* ... |
alexus37/AugmentedRealityChess | refs/heads/master | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/raw/WGL/NV/multisample_coverage.py | 8 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.WGL import _types as _cs
# End users want this...
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant import Constant as _C
import ctype... |
google-research/augmix | refs/heads/master | augmentations.py | 1 | # 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, ... |
ResidentMario/py-events | refs/heads/master | backend.py | 2 | """backend.py
This library defines the backend used by the application webservice, `app.py`.
The Watson/Core methods contained here are wrappers of `event_insight_lib.py` methods."""
# Redistributables.
import json
import os
import random
import itertools
import requests
# My own libraries.
import event_insight_lib... |
rec/echomesh | refs/heads/master | lib/darwin/PIL/ImageSequence.py | 15 | #
# The Python Imaging Library.
# $Id$
#
# sequence support classes
#
# history:
# 1997-02-20 fl Created
#
# Copyright (c) 1997 by Secret Labs AB.
# Copyright (c) 1997 by Fredrik Lundh.
#
# See the README file for information on usage and redistribution.
#
##
class Iterator:
"""
This class implements an i... |
gamechanger/dusty | refs/heads/master | tests/unit/warnings_test.py | 1 | from ..testcases import DustyTestCase
from dusty.warnings import Warnings
class TestWarnings(DustyTestCase):
def setUp(self):
super(TestWarnings, self).setUp()
self.warnings = Warnings()
def test_warn(self):
message_1 = 'Something is wrong, yo'
message_2 = 'Yo this thing is al... |
Jaccorot/django-cms | refs/heads/develop | cms/tests/test_i18n.py | 22 | try:
from importlib import import_module
except ImportError:
# Python < 2.7
from django.utils.importlib import import_module
from django.conf import settings
from django.test.utils import override_settings
from cms import api
from cms.test_utils.testcases import CMSTestCase
from cms.utils import i18n
from... |
frreiss/tensorflow-fred | refs/heads/master | tensorflow/python/ops/signal/mel_ops.py | 5 | # 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... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/medicine/crafted/shared_medpack_wound_action_d.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/medicine/crafted/shared_medpack_wound_action_d.iff"
result.attribut... |
levilucio/SyVOLT | refs/heads/master | UMLRT2Kiltera_MM/Properties/positive/Himesis/HExitpoint2procdefparTrueNOATTR_IsolatedLHS.py | 1 |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import cPickle as pickle
from uuid import UUID
class HExitpoint2procdefparTrueNOATTR_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HExitpoint2procdefparTrue... |
bhargav2408/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/Crypto/PublicKey/RSA.py | 45 | #
# RSA.py : RSA encryption/decryption
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use or... |
wazeerzulfikar/scikit-learn | refs/heads/master | examples/feature_selection/plot_f_test_vs_mi.py | 82 | """
===========================================
Comparison of F-test and mutual information
===========================================
This example illustrates the differences between univariate F-test statistics
and mutual information.
We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the
targ... |
jtrobec/pants | refs/heads/master | contrib/node/src/python/pants/contrib/node/register.py | 10 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.build_gra... |
moandcompany/luigi | refs/heads/master | test/contrib/test_ssh.py | 5 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
blzr/enigma2 | refs/heads/develop | lib/python/Screens/PictureInPicture.py | 3 | from Screens.Screen import Screen
from Screens.Dish import Dishpip
from enigma import ePoint, eSize, eRect, eServiceCenter, getBestPlayableServiceReference, eServiceReference, eTimer
from Components.SystemInfo import SystemInfo
from Components.VideoWindow import VideoWindow
from Components.Sources.StreamService import ... |
glebysg/GC_server | refs/heads/master | vacs/migrations/0008_auto_20170710_0107.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-10 01:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vacs', '0007_experiment_owner'),
]
operations = [
migrations.AlterField(
... |
MihaZelnik/Django-Unchained | refs/heads/master | src/project/manage.py | 1 | #!/usr/bin/env python
import os
import sys
def run():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
recognai/spaCy | refs/heads/master | spacy/lang/fa/lemmatizer/_nouns.py | 1 | # coding: utf8
from __future__ import unicode_literals
NOUNS = set("""
آ
آئیننامه
آب
آبادان
آبادانی
آبادی
آبانماه
آبدارخانه
آبرسانی
آبرنگ
آبرو
آبروی
آبزی
آبلمان
آبلمن
آبله
آبلیمو
آبیاری
آبانبار
آبخوری
آبشکن
آبفشان
آبمیوه
آبنبات
آبنباتی
آتالا
آتراو
آتش
آتشفشان
آتشبازی
آتشبیار
آتشسوزی
آتشنشانی
آتن
آتنی
آتیه... |
PySide/Shiboken | refs/heads/master | tests/samplebinding/modifiedvirtualmethods_test.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms... |
GdZ/scriptfile | refs/heads/master | software/googleAppEngine/lib/python-gflags/tests/flags_modules_for_testing/module_baz.py | 139 | #!/usr/bin/env python
# Copyright (c) 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... |
Khanguy/ygo-ftk | refs/heads/master | script/c56673480.py | 1 | """Contract with Don Thousand"""
from script.card import Card
class c56673480(Card):
#TODO untested
def canActivate(self,game):
return not game.hasActivated(self)
def activate(self,game):
game.burn(1000)
def eff(self,game):
game.draw() |
itmard/pfont.ir | refs/heads/master | app/utilis/decorators.py | 3 | from functools import wraps
from flask import g, request, abort
def title(text):
def decorator_arg(f):
@wraps(f)
def decorator(*args, **kwargs):
g.title = text
return f(*args, **kwargs)
return decorator
return decorator_arg
def ajax_view(f):
"""
Respon... |
jmerkow/VTK | refs/heads/master | ThirdParty/ZopeInterface/zope/interface/common/__init__.py | 438 | #
# This file is necessary to make this directory a package.
|
fanhero/thumbor | refs/heads/master | thumbor/filters/rotate.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from thumbor.filters import BaseFilter, filter_method
class Filter... |
Milad-Rakhsha/chrono | refs/heads/develop | src/demos/python/core/demo_CH_functions.py | 4 | #------------------------------------------------------------------------------
# Name: using the ChFunction objects for specifying functions y=f(x)
# Purpose:
#
# Author: Radu Serban
#
# Created: 6/27/2020
# Copyright: (c) ProjectChrono 2019
#----------------------------------------------------------... |
wreckJ/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/template/response.py | 71 | from django.http import HttpResponse
from django.template import loader, Context, RequestContext
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
def __init__(self, template, context=None, mimetype=None, status=None,
content_type=None):
# It would... |
MagicSolutions/django-form-designer | refs/heads/master | form_designer/contrib/exporters/__init__.py | 10 | from form_designer import settings
from form_designer.templatetags.friendly import friendly
from django.db.models import Count
from django.utils.translation import ugettext as _
from django.utils.encoding import smart_str
class ExporterBase(object):
def __init__(self, model):
self.model = model
... |
williamvitorino3/pox-mesh | refs/heads/angler | pox/messenger/messenger_example.py | 1 | # Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... |
aleksandra-tarkowska/django | refs/heads/master | django/contrib/sites/tests.py | 19 | from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.http import HttpRequest
from django.test import TestCase, modify_settings, override_settings
from .middleware import CurrentSiteMiddleware
from .models import Sit... |
LCfP/abm | refs/heads/dev | comparablemodels/GHW2008/ghwmodel.py | 2 | import numpy as np
import random
def ghw_model(seed, simulation_time, init_backward_simulated_time, chaos, risk_av_variance, dividends,
discount_rate, intensity_of_choice, fundamentalist_adaptive_parameter, chartist_adaptive_parameter,
bubble_sensitivity, fitness_memory_strenght, risk_adjus... |
knowledgecommonsdc/kcdc3 | refs/heads/master | kcdc3/apps/squirrel/migrations/0001_initial.py | 1 | # -*- 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 'Meeting'
db.create_table(u'squirrel_meeting', (
(u'id', self.gf('django.db.model... |
GuillaumeDerval/INGInious | refs/heads/master | frontend/plugins/task_file_managers/json_manager.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2014-2015 Université Catholique de Louvain.
#
# This file is part of INGInious.
#
# INGInious 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 o... |
springdeveloper/roflcopters | refs/heads/master | src/webapp/fckeditor/editor/filemanager/connectors/py/connector.py | 92 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... |
enkripsi/gyp | refs/heads/master | test/make_global_settings/env-wrapper/gyptest-wrapper.py | 229 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies *_wrapper in environment.
"""
import os
import sys
import TestGyp
test_format = ['ninja']
os.environ['CC_wrapper'] = 'distcc... |
andrewwong97/path-hero | refs/heads/master | pathhero/main/forms.py | 1 | from __future__ import unicode_literals
from django import forms
from .models import Building
class LocationForm(forms.Form):
start = forms.ModelChoiceField(queryset=Building.objects.order_by('name'), label='Start')
end = forms.ModelChoiceField(queryset=Building.objects.order_by('name'), label='End')
class Midpoi... |
xianjunzhengbackup/Cloud-Native-Python | refs/heads/master | env/lib/python3.6/site-packages/werkzeug/contrib/fixers.py | 104 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... |
zstackio/zstack-woodpecker | refs/heads/master | integrationtest/vm/multihosts/volumes/paths/path89.py | 2 | import zstackwoodpecker.test_state as ts_header
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template2",\
path_list=[[TestAction.create_volume, "volume1", "=scsi,shareable"], \
[TestAction.attach_volume, "vm1", "volume1"], \
[TestAction.create_volume, "volume2", "... |
RichardLitt/wyrd-django-dev | refs/heads/master | django/db/backends/oracle/client.py | 645 | import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'sqlplus'
def runshell(self):
conn_string = self.connection._connect_string()
args = [self.executable_name, "-L", conn_string]
if os.name == 'nt':
... |
cryptostorm/namecoin | refs/heads/namecoinq | client/jsonrpc/__init__.py | 67 |
"""
Copyright (c) 2007 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later... |
nhippenmeyer/django | refs/heads/master | django/db/models/aggregates.py | 161 | """
Classes to represent the definitions of aggregate functions.
"""
from django.core.exceptions import FieldError
from django.db.models.expressions import Func, Value
from django.db.models.fields import FloatField, IntegerField
__all__ = [
'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance',
]
... |
openstack/glance | refs/heads/master | glance/common/exception.py | 1 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
thekingofkings/urban-flow-analysis | refs/heads/master | python/FeatureUtils.py | 2 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 04 21:37:44 2015
@author: Hongjian
Package name: featureUtil
various functions for generating feature matrices/vectors
"""
from Crime import Tract
import numpy as np
import csv
from openpyxl import load_workbook
import heapq
import pickle
import os
here = os.path.d... |
FRidh/Sea | refs/heads/master | Sea/adapter/base/__init__.py | 2 |
from Base import Base
from ViewProviderBase import ViewProviderBase |
puneetgkaur/backup_sugar_shell_for_cordova | refs/heads/master | src/jarabe/journal/listview.py | 1 | # Copyright (C) 2009, Tomeu Vizoso
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in ... |
waliens/sldc | refs/heads/master | test/util.py | 1 | import numpy as np
from PIL.Image import fromarray
from PIL.ImageDraw import ImageDraw
from shapely.geometry import Point, Polygon, box
from sldc import Image
def mk_img(w, h, level=0):
return np.ones((w, h)).astype("uint8") * level
def circularity(polygon):
return 4 * np.pi * polygon.area / (polygon.lengt... |
bettermirror/wget | refs/heads/master | testenv/Test-pinnedpubkey-hash-no-check-fail-https.py | 2 | #!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import os
"""
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
exit (SKIP_TEST)
############# ... |
MarcosCommunity/odoo | refs/heads/marcos-8.0 | addons/account_payment/wizard/account_payment_populate_statement.py | 274 | # -*- 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... |
devopservices/ansible | refs/heads/devel | test/units/TestUtilsStringFunctions.py | 146 | # -*- coding: utf-8 -*-
import unittest
import os
import os.path
import tempfile
import yaml
import passlib.hash
import string
import StringIO
import copy
from nose.plugins.skip import SkipTest
from ansible.utils import string_functions
import ansible.errors
import ansible.constants as C
import ansible.utils.templat... |
EricForgy/JuliaBox | refs/heads/master | engine/src/juliabox/plugins/db_sqlite3/__init__.py | 8 | __author__ = 'tan'
from impl_sqlite3 import JBoxSQLite3 |
ndardenne/pymatgen | refs/heads/master | pymatgen/analysis/chemenv/utils/chemenv_config.py | 3 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
This module contains the classes for configuration of the chemenv package.
"""
__author__ = "David Waroquiers"
__copyright__ = "Copyright 2012, The Materi... |
reminisce/mxnet | refs/heads/master | python/mxnet/image/__init__.py | 61 | # 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... |
sgraham/nope | refs/heads/master | tools/memory_inspector/memory_inspector/core/backends.py | 89 | # 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.
_backends = {} # Maps a string (backend name) to a |Backend| instance.
def Register(backend):
"""Called by each backend module to register upon initiali... |
lcgong/alchemy | refs/heads/master | appserv/t.py | 2 | # function hash (str) {
# return crypto
# .createHash('sha1')
# .update(str, 'ascii')
# .digest('base64')
# .replace(PLUS_GLOBAL_REGEXP, '-')
# .replace(SLASH_GLOBAL_REGEXP, '_')
# .replace(EQUAL_GLOBAL_REGEXP, '')
# # }
# salt + '-' + hash(salt + '-' + secret)
secure = 'DjwennlKciQiTlxKmYtWq... |
supriyantomaftuh/roboto | refs/heads/master | scripts/lib/fontbuild/curveFitPen.py | 4 | #! /opt/local/bin/pythonw2.7
#
# 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 ... |
pepeportela/edx-platform | refs/heads/master | common/lib/capa/capa/inputtypes.py | 8 | #
# File: courseware/capa/inputtypes.py
#
"""
Module containing the problem elements which render into input objects
- textline
- textbox (aka codeinput)
- schematic
- choicegroup (aka radiogroup, checkboxgroup)
- imageinput (for clickable image)
- optioninput (for option list)
- filesubmission (upload a file)
- c... |
varunkamra/kuma | refs/heads/master | vendor/packages/pygments/lexers/scripting.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.scripting
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for scripting and embedded languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, byg... |
HuygensING/bioport-tools | refs/heads/master | gerbrandyutils/tests/__init__.py | 17 | ##########################################################################
# Copyright (C) 2009 - 2014 Huygens ING & Gerbrandy S.R.L.
#
# This file is part of bioport.
#
# bioport 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 ... |
yoer/hue | refs/heads/master | apps/spark/src/spark/tests.py | 1198 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
mincoin-project/mincoin | refs/heads/master | contrib/devtools/security-check.py | 120 | #!/usr/bin/env python
# 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.
'''
Perform basic ELF security checks on a series of executables.
Exit status will be 0 if successful, and ... |
junhuac/MQUIC | refs/heads/master | depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/tests/integration/kinesis/test_kinesis.py | 99 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.