repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
ycaihua/redis-py
refs/heads/master
tests/test_pubsub.py
43
from __future__ import with_statement import pytest import time import redis from redis.exceptions import ConnectionError from redis._compat import basestring, u, unichr from .conftest import r as _redis_client def wait_for_message(pubsub, timeout=0.1, ignore_subscribe_messages=False): now = time.time() tim...
pythonbyexample/PBE
refs/heads/master
dbe/businesstest/migrations/0002_auto__del_x__add_entry__add_set__add_task.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): # Deleting model 'x' db.delete_table('businesstest_x') # Adding model 'Entry' db.create_t...
greyhwndz/rethinkdb
refs/heads/next
test/rql_test/connections/http_support/jinja2/__init__.py
256
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
Veek/Python
refs/heads/master
IRC/Hexchat/fake_ctcp.py
1
import re, random, hexchat from subprocess import Popen, PIPE __module_name__ = 'Fake CTCP' __module_version__ = '0.1' __module_description__ = 'Fakes unessential CTCP requests: VERSION PING TIME' FAKE_VERSION = 'pinoyChat v1.3.3.4 - Windows XP SP2,'\ ' @400MHz Celeron Mendocino, Administrator:passwor...
mlavin/django
refs/heads/master
tests/template_tests/filter_tests/test_yesno.py
430
from django.template.defaultfilters import yesno from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_true(self): self.assertEqual(yesno(True), 'yes') def test_false(self): self.assertEqual(yesno(False), 'no') def test_none(self): self.assertEqual...
robbi/pyload
refs/heads/stable
module/plugins/hoster/AndroidfilehostCom.py
4
# -*- coding: utf-8 -* # # Test links: # https://www.androidfilehost.com/?fid=95916177934518197 import re from ..internal.SimpleHoster import SimpleHoster class AndroidfilehostCom(SimpleHoster): __name__ = "AndroidfilehostCom" __type__ = "hoster" __version__ = "0.06" __status__ = "testing" __...
stevekuznetsov/tito
refs/heads/master
src/tito/tar.py
6
# Copyright (c) 2008-2009 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy...
virtualrobotix/MissionPlanner
refs/heads/master
ExtLibs/Mavlink/pymavlink/generator/lib/minixsv/__init__.py
82
# # minixsv, Release 0.9.0 # file: __init__.py # # minixsv package file # # history: # 2004-10-26 rl created # # Copyright (c) 2004-2008 by Roland Leuthe. All rights reserved. # # -------------------------------------------------------------------- # The minixsv XML schema validator is # # Copyright (c...
jkbrzt/httpie
refs/heads/master
tests/utils.py
1
# coding=utf-8 """Utilities for HTTPie test suite.""" import sys import time import json import tempfile from io import BytesIO from pathlib import Path from typing import Optional, Union from httpie.status import ExitStatus from httpie.config import Config from httpie.context import Environment from httpie.core impor...
ZHAW-INES/rioxo-uClinux-dist
refs/heads/rtsp
user/python/python-2.4.4/Lib/encodings/cp1257.py
15
""" Python Character Mapping Codec generated from 'CP1257.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,erro...
karyon/django
refs/heads/master
tests/generic_inline_admin/urls.py
407
from django.conf.urls import url from . import admin urlpatterns = [ url(r'^generic_inline_admin/admin/', admin.site.urls), ]
kljensen/viff
refs/heads/master
viff/test/bedoza/util.py
2
# Copyright 2010 VIFF Development Team. # # This file is part of VIFF, the Virtual Ideal Functionality Framework. # # VIFF is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License (LGPL) as # published by the Free Software Foundation, either version 3 of the ...
MakeHer/edx-platform
refs/heads/dashboard.2
lms/djangoapps/notes/migrations/0001_initial.py
50
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import xmodule_django.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
marmyshev/bug_1117098
refs/heads/master
openlp/plugins/songs/lib/__init__.py
1
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
printedheart/h2o-3
refs/heads/master
h2o-py/tests/testdir_algos/deeplearning/pyunit_checkpoint_new_category_in_predictorDL.py
4
import sys sys.path.insert(1,"../../../") import h2o, tests def checkpoint_new_category_in_predictor(): sv1 = h2o.upload_file(h2o.locate("smalldata/iris/setosa_versicolor.csv")) sv2 = h2o.upload_file(h2o.locate("smalldata/iris/setosa_versicolor.csv")) vir = h2o.upload_file(h2o.locate("smalldata/iris/virgi...
gnu-sandhi/sandhi
refs/heads/master
modules/gr36/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py
17
# # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version...
lihui7115/ChromiumGStreamerBackend
refs/heads/master
third_party/cython/src/Cython/Compiler/__init__.py
1472
# empty file
fandemonium/code
refs/heads/master
fix_index_fastqgz_names.py
2
##fixing index fastq.gz seq names to match RDP assembler's seq names### import sys import gzip from Bio import SeqIO if len(sys.argv) != 3: print "USAGE: python fix_index_fastqgz_names.py XXX_I.fastq.gz FIXED_I.fastq" sys.exit() f = gzip.open(sys.argv[1], 'rU') output = open(sys.argv[2], 'w') for records in SeqIO...
oinopion/pipeye
refs/heads/master
pipeye/views.py
3
from django.shortcuts import render def home(request): return render(request, 'home.html')
wathen/PhD
refs/heads/master
MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/SplitMatrix/TH/MHDmulti.py
5
import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc import MatrixOperations as MO import numpy as np class Matrix(object): def __init__(self): pass def create(self, mat): pass def destroy(self, mat): pass class P(Matrix): def __init__(self, Fspace,P,M...
jmgilbert2/energi
refs/heads/energi_v0_egihash_integration
qa/rpc-tests/forknotify.py
66
#!/usr/bin/env python2 # Copyright (c) 2014-2015 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 -alertnotify # from test_framework.test_framework import BitcoinTestFramework from test_framew...
stackforge/monasca-log-api
refs/heads/master
monasca_log_api/app/base/model.py
1
# Copyright 2016 FUJITSU LIMITED # # 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 writ...
shiblon/pytour
refs/heads/master
static/js/pypyjs/pypy-nojit.js-0.3.1/lib/modules/test/test_multibytecodec.py
8
# test_multibytecodec.py # Unit test for multibytecodec itself # from test import test_support from test.test_support import TESTFN import unittest, StringIO, codecs, sys, os import _multibytecodec ALL_CJKENCODINGS = [ # _codecs_cn 'gb2312', 'gbk', 'gb18030', 'hz', # _codecs_hk 'big5hkscs', # _codecs_jp ...
FlorianLudwig/odoo
refs/heads/8.0
addons/account/wizard/__init__.py
362
# -*- 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...
ultmaster/eoj3
refs/heads/master
eoj3/local_settings.example.py
42
DEBUG = True
jlebon/kubernetes
refs/heads/master
examples/celery-rabbitmq/celery-app-add/run_tasks.py
471
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
bramalingam/openmicroscopy
refs/heads/develop
examples/OmeroClients/constructors.py
20
#!/usr/bin/env python # -*- coding: utf-8 -*- import omero import omero.clients image = omero.model.ImageI() dataset = omero.model.DatasetI(long(1), False) image.linkDataset(dataset)
fivejjs/PTVS
refs/heads/master
Python/Tests/TestData/DjangoAnalysisTestApp/myapp/urls.py
18
from django.conf.urls import patterns, url from django.views.generic import DetailView, ListView from myapp.models import * urlpatterns = patterns('', url(r'^$', ListView.as_view( queryset=MyModel.objects.order_by('-pub_date')[:5], context_object_name='latest_poll_list', ...
badock/nova
refs/heads/master
nova/virt/netutils.py
18
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use th...
eerimoq/asn1tools
refs/heads/master
tests/files/3gpp/s1ap_14_4_0.py
1
EXPECTED = {'S1AP-CommonDataTypes': {'extensibility-implied': False, 'imports': {}, 'object-classes': {}, 'object-sets': {}, 'tags': 'AUTOMATIC', 'types': {'Criticality': {'type': 'ENUMERATE...
danielvdao/facebookMacBot
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py
2923
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
cosmoharrigan/opencog
refs/heads/master
opencog/python/blending/src/chooser/base_chooser.py
22
from abc import ABCMeta, abstractmethod from blending.util.blending_config import BlendConfig from blending.util.blending_error import blending_status __author__ = 'DongMin Kim' class BaseChooser(object): """Abstract class to provide 'atom_choose()' interface. The blender will call the method 'atom_choose(...
davidfather/TizenRT
refs/heads/master
external/iotivity/iotivity_1.2-rel/extlibs/gtest/gtest-1.7.0/test/gtest_shuffle_test.py
3023
#!/usr/bin/env python # # Copyright 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 list of...
tanmaykm/edx-platform
refs/heads/master
lms/djangoapps/lms_xblock/models.py
63
""" Models used by LMS XBlock infrastructure. Includes: XBlockAsidesConfig: A ConfigurationModel for managing how XBlockAsides are rendered in the LMS. """ from django.db.models import TextField from config_models.models import ConfigurationModel from xblock.core import XBlockAside class XBlockAsidesC...
TomWerner/AlumniMentoring
refs/heads/master
mentoring/models.py
1
import datetime from django.contrib.auth.models import User from django.db import models from mentoring.util import generate_confirmation_token genders = ( ('a', 'Agender'), ('c', 'Cisgender'), ('m', 'Male'), ('n', 'Non-binary'), ('t', 'Transgender'), ('f', 'Female'), ('l', 'Another gende...
patcon/open-cabinet
refs/heads/master
venv/lib/python2.7/site-packages/django/core/management/commands/dumpdata.py
305
from collections import OrderedDict from django.apps import apps from django.core import serializers from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, router class Command(BaseCommand): help = ("Output the contents of the database as a fixture of the given ...
humdings/IbPy
refs/heads/master
ib/opt/connection.py
9
#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Defines the Connection class to encapsulate a connection to IB TWS. # # Connection instances defer failed attribute lookup to their receiver # and sender member objects. This makes it easy to access the # receiver to register functions: # # >>> con = ibConnection() #...
liaorubei/depot_tools
refs/heads/master
third_party/pylint/checkers/imports.py
67
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
evlyapin/ansible-modules-core
refs/heads/devel
utilities/logic/set_fact.py
115
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Dag Wieers <dag@wieers.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 Lice...
Lucasgscruz/harpia
refs/heads/master
harpia/bpGUI/findColor.py
2
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
jasonwee/asus-rt-n14uhp-mrtg
refs/heads/master
src/lesson_runtime_features/resource_getrusage.py
1
import resource import time RESOURCES = [ ('ru_utime', 'User time'), ('ru_stime', 'System time'), ('ru_maxrss', 'Max. Resident Set Size'), ('ru_ixrss', 'Shared Memory Size'), ('ru_idrss', 'Unshared Memory Size'), ('ru_isrss', 'Stack Size'), ('ru_inblock', 'Block inputs'), ('ru_oublock',...
paulopperman/Hyperloop
refs/heads/master
src/hyperloop/tube_wall_temp.py
8
""" tubeModel.py - Determines the steady state temperature of the hyperloop tube. Calculates Q released/absorbed by hyperloop tube due to: Internal Convection, Tube Conduction, Ambient Natural Convection, Solar Flux In, Radiation Out -original calculations from Jeff Berton, por...
monetate/sqlalchemy
refs/heads/master
test/ext/mypy/files/cols_notype_on_fk_col.py
3
from typing import Optional from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy.orm import Mapped from sqlalchemy.orm import registry reg: registry = registry() @reg.mapped class User: __tablename__ = "user" id = Colum...
jasonzzz/ansible
refs/heads/devel
lib/ansible/utils/color.py
13
# (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...
dhp-denero/server-tools
refs/heads/8.0
base_suspend_security/tests/__init__.py
37
# -*- coding: utf-8 -*- ############################################################################## # # This module copyright (C) 2015 Therp BV <http://therp.nl>. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
ssteo/moviepy
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # MoviePy documentation build configuration file, created by # sphinx-quickstart on Sat Jul 13 14:47:48 2013. # # 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. # # All...
bukepo/openthread
refs/heads/master
tools/harness-automation/autothreadharness/exceptions.py
10
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
shurihell/testasia
refs/heads/test1
common/djangoapps/util/tests/test_keyword_sub_utils.py
130
""" Tests for keyword_substitution.py """ from student.tests.factories import UserFactory from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from ddt import ddt, file_data from mock import patch from util.date_utils import get_default_...
yoavfu/xbmc
refs/heads/master
lib/libUPnP/Platinum/Build/Tools/Scripts/XCodeMake.py
262
#! /usr/bin/env python """ XCode Build Script $Id: XCodeMake.py 655 2010-09-29 22:40:22Z soothe $ """ import os import sys import getopt import subprocess # ------------------------------------------------------------ # usage # ------------------------------------------------------------ def usage(errMsg): ...
ol-loginov/intellij-community
refs/heads/master
python/testData/copyPaste/singleLine/Indent41.after.py
747
class C: def foo(self): x = 1 y = 2
jhawkesworth/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_irule.py
38
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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', ...
aurix/lammps-induced-dipole-polarization-pair-style
refs/heads/master
tools/i-pi/ipi/inputs/thermostats.py
33
"""Deals with creating the thermostats class. Copyright (C) 2013, Joshua More and Michele Ceriotti 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...
ceph/swift
refs/heads/master
test/unit/common/middleware/test_healthcheck.py
5
# Copyright (c) 2010-2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
peterhinch/micropython-async
refs/heads/master
v2/gps/astests.py
1
#!/usr/bin/env python3.5 # -*- coding: utf-8 -*- # astests.py # Tests for AS_GPS module (asynchronous GPS device driver) # Based on tests for MicropyGPS by Michael Calvin McCoy # https://github.com/inmcm/micropyGPS # Copyright (c) 2018 Peter Hinch # Released under the MIT License (MIT) - see LICENSE file # Run under ...
kmoocdev/edx-platform
refs/heads/kmooc.rc0
common/djangoapps/terrain/stubs/xqueue.py
123
""" 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...
wunderlins/learning
refs/heads/master
python/zodb/lib/linux64/setuptools/command/develop.py
114
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError import os import glob import io from setuptools.extern import six from pkg_resources import Distribution, PathMetadata, normalize_path from setuptools.command.easy_install import easy_in...
aperigault/ansible
refs/heads/devel
lib/ansible/modules/messaging/rabbitmq/rabbitmq_user.py
24
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Chatham Financial <oss@chathamfinancial.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 = {'metada...
mesnardo/snake
refs/heads/master
examples/petibm/plotForceCoefficientsCompareOther.py
2
""" Post-processes the force coefficients from a PetIBM simulation and compare them to another simulation. This script reads the forces, computes the mean forces within a given range, computes the Strouhal number within a range, plots the force coefficients, saves the figure, and prints a data-frame that contains the ...
enkaskal/hello
refs/heads/master
gtest/test/gtest_shuffle_test.py
3023
#!/usr/bin/env python # # Copyright 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 list of...
stwunsch/gnuradio
refs/heads/master
gr-digital/python/digital/ofdm_packet_utils.py
27
# # Copyright 2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
peterayeni/libforensics
refs/heads/master
code/lf/apps/msoffice/word/metadata.py
13
# Copyright 2009 Michael Murr # # This file is part of LibForensics. # # LibForensics 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 3 of the License, or # (at your option) any later ver...
andybab/Impala
refs/heads/master
tests/util/hdfs_util.py
6
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
pkoutsias/SickRage
refs/heads/master
lib/dogpile/__init__.py
916
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: from pkgutil import extend_path __path__ = extend_path(__path__, __name__)
dlazz/ansible
refs/heads/devel
lib/ansible/modules/cloud/webfaction/webfaction_app.py
51
#!/usr/bin/python # # (c) Quentin Stafford-Fraser 2015, with contributions gratefully acknowledged from: # * Andy Baker # * Federico Tarantini # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # Create a Webfaction application using Ansible and the Webfaction API #...
nlholdem/icodoom
refs/heads/master
.venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
713
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
agripo/website
refs/heads/master
core/migrations/0031_auto_20151028_1744.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import ckeditor.fields class Migration(migrations.Migration): dependencies = [ ('core', '0030_auto_20151028_1731'), ] operations = [ migrations.AlterField( model_name='ne...
ujfjhz/storm
refs/heads/master
dev-tools/test-ns.py
23
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "Li...
MisterPup/Ceilometer-Juno-Extension
refs/heads/master
ceilometer/tests/storage/test_impl_sqlalchemy.py
4
# # Author: John Tran <jhtran@att.com> # Julien Danjou <julien@danjou.info> # # 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 # # Unl...
yw374cornell/e-mission-server
refs/heads/master
emission/tests/analysisTests/intakeTests/TestFilterAccuracy.py
1
# Standard imports import unittest import datetime as pydt import logging import pymongo import json import bson.json_util as bju import pandas as pd # Our imports import emission.analysis.intake.cleaning.filter_accuracy as eaicf import emission.storage.timeseries.abstract_timeseries as esta import emission.storage.pi...
ywcui1990/htmresearch
refs/heads/master
tests/frameworks/layers/l2l4_network_creation_test.py
3
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
RydrDojo/Ridr
refs/heads/master
pylotVenv/lib/python2.7/site-packages/requests/models.py
148
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
zachcp/bioconda-recipes
refs/heads/master
recipes/womtool/womtool.py
19
#!/usr/bin/env python # # Wrapper script for invoking the jar. # # This script is written for use with the Conda package manager and is ported # from a bash script that does the same thing, adapting the style in # the peptide-shaker wrapper # (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-sha...
rizumu/pinax-starter-app
refs/heads/master
pinax/app_name/tests/tests.py
29
from django.test import TestCase class Tests(TestCase): def setUp(self): pass
MoyTW/roguebasin_rpas
refs/heads/master
example.py
1
__author__ = 'Travis Moy' import random import rpas # Map generation parameters prob_is_obstructed = .1 map_size = 20 # False values are obstructed; True are unobstructed. map = [[(lambda: prob_is_obstructed < random.uniform(0.0, 1.0))() for _ in range(map_size)] for _ in range(map_size)] # Normally this would be...
joelpet/android-quill
refs/heads/master
jni/libhpdf-2.3.0RC2/if/python/demo/text_demo.py
32
### ## * << Haru Free PDF Library 2.0.0 >> -- text_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Vimos/scikit-learn
refs/heads/master
benchmarks/bench_tree.py
131
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
opengeogroep/inasafe
refs/heads/master
realtime/test/test_shake_data.py
1
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **Tests Shake Data functionality related to shakemaps.** Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public...
elpaso/QGIS
refs/heads/master
python/plugins/processing/algs/qgis/TopoColors.py
31
# -*- coding: utf-8 -*- """ *************************************************************************** TopoColors.py -------------- Date : February 2017 Copyright : (C) 2017 by Nyall Dawson Email : nyall dot dawson at gmail dot com ************************...
plowman/python-mcparseface
refs/heads/master
models/syntaxnet/tensorflow/tensorflow/python/ops/gradients.py
8
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
2014c2g2/teamwork
refs/heads/master
exts/w2/static/Brython2.0.0-20140209-164925/Lib/logging/handlers.py
736
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
longmen21/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/lti_module.py
16
""" Learning Tools Interoperability (LTI) module. Resources --------- Theoretical background and detailed specifications of LTI can be found on: http://www.imsglobal.org/LTI/v1p1p1/ltiIMGv1p1p1.html This module is based on the version 1.1.1 of the LTI specifications by the IMS Global authority. For authenticat...
sphereflow/space_combat
refs/heads/master
src/billboard_old.py
1
from texture import * import state_machine as StateMachine from math_3d import * from movement import * from bound_collidable import * class Billboard(BoundCollidable) : def __init__(self) : self.m = Movement() self.vbos = None self.list_index = -1 self.vao = None def copy(self) : ...
supergis/micropython
refs/heads/master
tests/basics/parser.py
62
# parser tests try: compile except NameError: print("SKIP") import sys sys.exit() # completely empty string # uPy and CPy differ for this case #try: # compile("", "stdin", "single") #except SyntaxError: # print("SyntaxError") try: compile("", "stdin", "eval") except SyntaxError: print("S...
EUDAT-B2SHARE/invenio-old
refs/heads/next
modules/bibformat/lib/elements/bfe_authority_institution.py
3
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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 ## ...
tpazderka/pysaml2
refs/heads/master
tests/idp_conf.py
1
from saml2 import BINDING_SOAP from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_HTTP_POST from saml2.saml import NAMEID_FORMAT_PERSISTENT from saml2.saml import NAME_FORMAT_URI from pathutils import full_path from pathutils import xmlsec_path BASE = "http://localhost:8088" CONFIG = { "entityid":...
tark-hidden/jinja2
refs/heads/master
examples/basic/inheritance.py
83
from jinja2 import Environment from jinja2.loaders import DictLoader env = Environment(loader=DictLoader({ 'a': '''[A[{% block body %}{% endblock %}]]''', 'b': '''{% extends 'a' %}{% block body %}[B]{% endblock %}''', 'c': '''{% extends 'b' %}{% block body %}###{{ super() }}###{% endblock %}''' })) print env.get_te...
ewollesen/AutobahnPython
refs/heads/master
examples/websocket/streaming/frame_based_client.py
15
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ## ht...
vgupta6/Project-2
refs/heads/master
modules/s3/pyvttbl/stats/jsci.py
16
#!/usr/bin/python """Basic statistics utility functions. The implementation of Student's t distribution inverse CDF was ported to Python from JSci. The parameters are set to only be accurate to approximately 5 decimal places. The JSci port comes frist. "New" code is near the bottom. JSci information: http://jsci.so...
quamilek/django
refs/heads/master
django/contrib/gis/db/backends/postgis/adapter.py
373
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from __future__ import unicode_literals from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom, geography=False): "Initializes on the geometry." ...
dkodnik/arp
refs/heads/master
openerp/addons/test_exceptions/models.py
46
# -*- coding: utf-8 -*- import openerp class m(openerp.osv.osv.Model): """ This model exposes a few methods that will raise the different exceptions that must be handled by the server (and its RPC layer) and the clients. """ _name = 'test.exceptions.model' def generate_except_osv(self,...
drnextgis/QGIS
refs/heads/master
tests/src/python/test_qgsserver_accesscontrol.py
4
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __autho...
sql-machine-learning/sqlflow
refs/heads/develop
python/runtime/pai/submitter_evaluate.py
1
# Copyright 2020 The SQLFlow 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 applicable law o...
tkerola/chainer
refs/heads/master
tests/chainer_tests/functions_tests/array_tests/test_get_item.py
8
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr _backend_params = ( # CPU tests testing.product({ 'use_cuda': [False], 'use_ideep': ['ne...
indirectlylit/kolibri
refs/heads/develop
kolibri/core/device/test/prefixed_locale_middleware_urls.py
4
from __future__ import unicode_literals from django.conf.urls import include from django.conf.urls import url from .locale_middleware_urls import patterns path_prefix = "test/" urlpatterns = [url(path_prefix, include(patterns))]
agimofcarmen/xen-api
refs/heads/master
scripts/mtcerrno-to-ocaml.py
34
#!/usr/bin/env python # Convert the MTC exit codes into a disjoint union type. Each line in the file looks like: # errdef, MTC_EXIT_SUCCESS, 0, 0, "", # Usage: # cat ../xha.hg/include/mtcerrno.def | ./scripts/mtcerrno-to-ocaml.py > ocaml/xapi/xha_errno.ml import sys def parse(file): all...
shixiaobo8/yjy_django_omsa
refs/heads/master
Myapp/aliyun/oss.py
1
#! /usr/bin/env python # -*- coding:utf8 -*- """ 阿里云sdk调用oss: 安装步骤请参见官方文档:https://develop.aliyun.com/sdk/python?spm=5176.doc25699.2.2.seCDuq """ from __future__ import print_function import oss2 import sys from oss2 import auth class oss(): def __init__(self): self.endpoint = 'o...
bloomreach/briefly
refs/heads/master
src/briefly/dag.py
1
# # Copyright 2013-2015 BloomReach, 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 ...
perGENIE/pergenie-web
refs/heads/master
pergenie/misc/apps/population/models.py
3
from lib.r.r import projection from django.conf import settings def project_new_person(scale, info): """Project new person onto PCA coordinate. args: str(scale) data_info: {'user_id': '', 'name': '', ...} retval: {'position': [x, y], 'label': '', 'map_label': ''} """ # TODO: currently ...
abdellatifkarroum/odoo
refs/heads/8.0
addons/account/project/__init__.py
427
# -*- 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...
shakamunyi/tensorflow
refs/heads/master
tensorflow/python/layers/convolutional.py
4
# 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...