repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
ladybug-analysis-tools/honeybee-core
refs/heads/master
honeybee/radiance/analysispoint.py
1
# """Honeybee PointGroup and TestPointGroup.""" from __future__ import division from ..vectormath.euclid import Point3, Vector3 from ..schedule import Schedule from collections import defaultdict, OrderedDict try: from itertools import izip as zip except ImportError: # python 3 pass import types import copy...
allanlei/django-multischema
refs/heads/master
multischema/management/commands/renameschema.py
1
from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections, transaction from optparse import make_option from multischema import namespace class Command(BaseCommand): help = 'Create namespace' option_list = BaseCommand.option_list + ( make_o...
szha/mxnet
refs/heads/master
example/recommenders/movielens_data.py
13
# 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...
alphafoobar/intellij-community
refs/heads/master
python/testData/refactoring/changeSignature/nonDefaultAfterDefault.py
73
def foo(b): pass
GFZ-Centre-for-Early-Warning/caravan
refs/heads/master
qmlreceiver.py
1
#!/usr/bin/env python3 import sys import zlib from optparse import OptionParser from simpleclient import HMB VERSION = "0.1 (2015.288)" RETRY_WAIT = 10 def handleEvent(gdacs, data): print("{dateTime} M={magnitude} {location} -> {eventID}.xml".format(**gdacs)) with open(gdacs['eventID'] + '.xml', 'wb') as f...
kushalbhola/MyStuff
refs/heads/master
venv/Lib/site-packages/pip/_vendor/chardet/big5freq.py
342
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
google/upvote
refs/heads/master
upvote/monitoring/metrics.py
1
# Copyright 2017 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...
mixman/djangodev
refs/heads/master
django/core/management/commands/startproject.py
2
from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module import os import re from random import choice class Command(LabelCommand): help = "Creates a Django project directory structure for the given project name in the current directory." ...
tanty/gnome-ostree
refs/heads/master
src/ostbuild/pyostbuild/ostbuildlog.py
3
#!/usr/bin/python # # Copyright (C) 2011 Colin Walters <walters@verbum.org> # # This library 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 of the License, or (at your option) any la...
40423221/2017springcd_hw
refs/heads/gh-pages
plugin/summary/__init__.py
368
from .summary import *
socialsweethearts/django-allauth
refs/heads/master
allauth/socialaccount/providers/openid/south_migrations/0001_initial.py
82
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): depends_on = (('socialaccount', '0001_initial'),) def forwards(self, orm): # Adding model 'OpenIDAccount' db.create_table('openid_openidaccount', ( ('socialacco...
alistairlow/tensorflow
refs/heads/master
tensorflow/contrib/tensor_forest/hybrid/python/__init__.py
183
# 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...
27o/systemd
refs/heads/master
test/rule-syntax-check.py
4
#!/usr/bin/python3 # Simple udev rules syntax checker # # (C) 2010 Canonical Ltd. # Author: Martin Pitt <martin.pitt@ubuntu.com> # # systemd 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 versio...
JoelMaatkamp/netvenom
refs/heads/master
netvenom/utils/checks.py
1
#! /usr/bin/python3 # -*- coding: utf-8 -*- import os import re import sys from utils.printer import * PrinterThread().start() def check_root(): """ check for root/admin & exit if not """ if os.getuid() != 0: if sys.platform == "win32": print_error("you must be admin") else: print_error("you must be ...
riteshshrv/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'...
yaruno/SpyCity
refs/heads/master
web/assets/bower_components/leaflet-plugins/build/deps.py
69
#!/usr/bin/env python # vim: sts=4 sw=4 et import os, sys printed = set() def includes(f): d = os.path.dirname(f) for l in open(f): if l.startswith('//#include'): yield os.path.join(d, l.strip().split(None, 1)[1].strip(""""'""")) work = list(sys.argv[1:]) while work: f = work.pop(0)...
PyORBIT-Collaboration/py-orbit
refs/heads/master
py/orbit/py_linac/errors/__init__.py
2
## \namespace orbit::py_linac::errors ## \Classes and packages of ORBIT Linac. ## from ErrorNodesAndControllersLib import AccErrorNode from ErrorNodesAndControllersLib import ErrorCoordDisplacementNode from ErrorNodesAndControllersLib import BaseErrorController from ErrorNodesAndControllersLib import ErrorCntrlCoordD...
thispc/download-manager
refs/heads/master
module/plugins/hooks/DeleteFinished.py
8
# -*- coding: utf-8 -*- from module.database import style from ..internal.Addon import Addon class DeleteFinished(Addon): __name__ = "DeleteFinished" __type__ = "hook" __version__ = "1.19" __status__ = "testing" __config__ = [("activated", "bool", "Activated", False), ("interv...
Anonymous-X6/django
refs/heads/master
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...
trishume/MacRanger
refs/heads/master
doc/tools/print_colors.py
4
#!/usr/bin/env python """ You can use this tool to display all supported colors and their color number. It will exit after a keypress. """ import curses from curses import * @wrapper def main(win): def print_all_colors(attr): for c in range(-1, curses.COLORS): try: init_pair(c,...
40023154/Finalexam_0627
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/_testcapi.py
742
CHAR_MAX = 127 CHAR_MIN = -128 DBL_MAX = 1.7976931348623157e+308 DBL_MIN = 2.2250738585072014e-308 FLT_MAX = 3.4028234663852886e+38 FLT_MIN = 1.1754943508222875e-38 INT_MAX = 2147483647 INT_MIN = -2147483648 LLONG_MAX = 9223372036854775807 LLONG_MIN = -9223372036854775808 LONG_MAX = 2147483647 LONG_MIN = -2...
ssharm21/google-python-exercises
refs/heads/master
basic/string1.py
1
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
github-account-because-they-want-it/django
refs/heads/master
django/contrib/postgres/lookups.py
199
from django.db.models import Lookup, Transform class PostgresSimpleLookup(Lookup): def as_sql(self, qn, connection): lhs, lhs_params = self.process_lhs(qn, connection) rhs, rhs_params = self.process_rhs(qn, connection) params = lhs_params + rhs_params return '%s %s %s' % (lhs, self...
advancedtelematic/docker-launcher
refs/heads/master
tests/test_attach.py
2
# encoding: utf-8 # # Copyright © 2015 ATS Advanced Telematic Systems GmbH # # This file is part of Docker Launcher. # # Docker Launcher 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...
alash3al/rethinkdb
refs/heads/next
test/performance/util.py
50
from __future__ import print_function import os import random import time import uuid try: xrange except NameError: xrange = range def gen_doc(size_doc, i): if size_doc == "small": return { "field0": str(i // 1000), "field1": str(i), } elif size_doc == "big": ...
ozburo/youtube-dl
refs/heads/master
youtube_dl/extractor/malltv.py
6
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( clean_html, dict_get, float_or_none, int_or_none, merge_dicts, parse_duration, try_get, ) class MallTVIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www|sk)\.)?mall\.tv/(?...
osvalr/odoo
refs/heads/8.0
addons/crm_partner_assign/crm_lead.py
221
# -*- 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...
markkerzner/nn_kove
refs/heads/master
hadoop/src/contrib/hod/hodlib/Common/xmlrpc.py
182
#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 use thi...
ZiminGrigory/qreal
refs/heads/master
plugins/tools/visualInterpreter/examples/robotsCodeGeneration/reactionsStorage/InitialBlockGenerator.py
12
template = "#include \"kernel.h\"\n#include \"ecrobot_interface.h\"\n@@BALANCER@@\n@@VARIABLES@@\n\nvoid ecrobot_device_initialize(void)\n{\n@@INITHOOKS@@\n}\n\nvoid ecrobot_device_terminate(void)\n{\n@@TERMINATEHOOKS@@\n}\n\n/* nxtOSEK hook to be invoked from an ISR in category 2 */\nvoid user_1ms_isr_type2(void){ /* ...
Teamxrtc/webrtc-streaming-node
refs/heads/master
third_party/webrtc/src/chromium/src/third_party/pycoverage/coverage/__init__.py
208
"""Code coverage measurement for Python. Ned Batchelder http://nedbatchelder.com/code/coverage """ from coverage.version import __version__, __url__ from coverage.control import coverage, process_startup from coverage.data import CoverageData from coverage.cmdline import main, CoverageScript from coverage.misc impo...
seann1/portfolio5
refs/heads/master
.meteor/dev_bundle/python/Lib/distutils/command/bdist_dumb.py
151
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" __revision__ = "$Id$" import os from sysconfig import get_python_version from distutils.util import get_platform from distutil...
blademainer/intellij-community
refs/heads/master
python/testData/refactoring/move/moveNamespacePackage1/before/src/b.py
237
import nspkg.nssubpkg.a print(nspkg.nssubpkg.a.VAR)
ltilve/ChromiumGStreamerBackend
refs/heads/master
third_party/mojo/src/mojo/public/tools/gn/last_commit_timestamp.py
21
#!/usr/bin/env python # # Copyright 2015 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. """Outputs the timestamp of the last commit in a Git repository.""" import argparse import subprocess import sys def get_timestamp(...
crosswalk-project/chromium-crosswalk-efl
refs/heads/efl/crosswalk-10/39.0.2171.19
third_party/closure_linter/closure_linter/gjslint.py
95
#!/usr/bin/env python # Copyright 2007 The Closure Linter 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 # #...
partofthething/home-assistant
refs/heads/dev
homeassistant/components/home_connect/light.py
7
"""Provides a light for Home Connect.""" import logging from math import ceil from homeconnect.api import HomeConnectError from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, LightEntity, ) from homeassistant.const import CONF_ENTITIES im...
maxive/erp
refs/heads/master
addons/sms/models/res_partner.py
25
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models class ResPartner(models.Model): _inherit = 'res.partner' def _get_default_sms_recipients(self): """ Override of mail.thread method. SMS recipients on partners are th...
saurabh6790/omnitech-libs
refs/heads/master
webnotes/utils/file_lock.py
33
import os from time import time from webnotes.utils import get_site_path class LockTimeoutError(Exception): pass def create_lock(name): lock_path = get_lock_path(name) if not check_lock(lock_path): return touch_file(lock_path) else: return False def touch_file(path): with open(path, 'a'): os.utime(path...
jjmleiro/hue
refs/heads/master
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Random/__init__.py
126
# -*- coding: utf-8 -*- # # Random/__init__.py : PyCrypto random number generation # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to ...
elainenaomi/sciwonc-dataflow-examples
refs/heads/master
dissertation2017/Experiment 1B/instances/10_2_workflow_full_10files_secondary_wmj_3sh_3rs_with_annot_with_proj_3s_range_old/work/ubuntu/pegasus/example_workflow/20170106T133456+0000/ConfigDB_TaskEvent_6.py
11
HOST = "ip-172-31-29-102.us-west-2.compute.internal:27017,ip-172-31-29-103.us-west-2.compute.internal:27017,ip-172-31-29-104.us-west-2.compute.internal:27017,ip-172-31-29-105.us-west-2.compute.internal:27017,ip-172-31-29-101.us-west-2.compute.internal:27017,ip-172-31-29-106.us-west-2.compute.internal:27017,ip-172-31-29...
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pip-7.1.0/pip/_vendor/html5lib/filters/optionaltags.py
1727
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
jcchin/Hyperloop_v2
refs/heads/master
src/hyperloop/Python/tests/test_tube_power.py
4
from openmdao.api import Group, Problem, Component import numpy as np from hyperloop.Python.tube import tube_power def create_problem(component): root = Group() prob = Problem(root) prob.root.add('comp',component) return prob class TestTubePower(object): #Test for TubePower component ...
lmorchard/django
refs/heads/master
tests/max_lengths/models.py
438
from django.db import models class PersonWithDefaultMaxLengths(models.Model): email = models.EmailField() vcard = models.FileField(upload_to='/tmp') homepage = models.URLField() avatar = models.FilePathField() class PersonWithCustomMaxLengths(models.Model): email = models.EmailField(max_length=2...
mvsaha/blahb
refs/heads/master
blahb/test/test_timsort.py
1
import numpy as np from numpy.testing import assert_array_equal as AAE from ..timsort import timsort_ from .utils import N_TESTS def test_timsort_rand(): for i in range(N_TESTS * 5): n = np.random.randint(1, 1000) labels = np.random.randint(-10, 10, size=n) result = timsort_(labels.copy()...
fusionbox/django-shop
refs/heads/master
shop/views/__init__.py
15
# -*- coding: utf-8 -*- from django import VERSION as django_version from django.views.generic import (TemplateView, ListView, DetailView, View) from django.views.generic.base import TemplateResponseMixin class ShopTemplateView(TemplateView): """ A class-based view for use within the shop (this allows to keep...
sergei-maertens/django
refs/heads/master
django/db/models/__init__.py
9
from functools import wraps from django.core.exceptions import ObjectDoesNotExist # NOQA from django.db.models import signals # NOQA from django.db.models.aggregates import * # NOQA from django.db.models.deletion import ( # NOQA CASCADE, DO_NOTHING, PROTECT, SET, SET_DEFAULT, SET_NULL, ProtectedError, ) from d...
cosmopod/MIT_6001
refs/heads/master
QUIZ_PROBLEM8.py
1
# -*- coding: utf-8 -*- ''' Successive approximation is a general method in which on each iteration of an algorithm, we find a closer estimate of the answer for which we are seeking. One class of successive approximation algorithms uses the idea of a fixed point. If f(x) is a mathematical function, then finding the x s...
tima/ansible
refs/heads/devel
lib/ansible/playbook/attribute.py
39
# (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...
pombredanne/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...
phihag/adhocracy
refs/heads/develop
src/adhocracy/lib/sentry.py
4
from raven import Client from raven.conf import setup_logging from raven.handlers.logging import SentryHandler from raven.middleware import Sentry from adhocracy import config as aconfig from adhocracy.lib import version class SentryMiddleware(Sentry): """ As raven.middleware.Sentry doesn't really do what we...
suutari/shoop
refs/heads/master
shuup/admin/modules/service_providers/views/_delete.py
1
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django.core.urlresolvers import reverse_lazy from django.view...
matrixise/odoo
refs/heads/8.0
addons/account/account_bank.py
258
# -*- 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...
jaxkodex/odoo
refs/heads/8.0
addons/account_analytic_default/account_analytic_default.py
256
# -*- 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 GN...
SpheMakh/Stimela
refs/heads/master
stimela/dismissable.py
1
# -*- coding: future_fstrings -*- class dismissable: ''' Wrapper for optional parameters to stimela Initialize with val == None to force stimela to skip parsing parameter. ''' def __init__(self, val=None): self.__val = val def __call__(self): return self.__val
last-g/qoala
refs/heads/master
lib/qserver/quest/__init__.py
2
#!/usr/bin/env python2 from .quest import QuestDescriptor from .xmlquest import XMLQuestProvider from .scriptquest import ScriptQuestProvider
bklang/GO2
refs/heads/master
babel/messages/plurals.py
151
# -*- coding: utf-8 -*- """ babel.messages.plurals ~~~~~~~~~~~~~~~~~~~~~~ Plural form definitions. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ from babel.core import default_locale, Locale from operator import itemgetter # XXX: remove this file, dupl...
toshywoshy/ansible
refs/heads/devel
lib/ansible/modules/network/onyx/onyx_aaa.py
8
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
MechanisM/ajenti
refs/heads/master
plugins/nginx/main_single.py
17
from ajenti.api import * from ajenti.com import * from ajenti.utils import * from ajenti import apis import os import re import glob import sys class NginxSingleConfigBackend(Plugin): implements(IConfigurable) platform = ['freebsd', 'nginx', 'arch'] config_file = '' name = 'nginx' id = 'nginx' ...
vaginessa/yowlayer-store
refs/heads/master
yowsup_ext/layers/store/models/conversation.py
1
from yowsup_ext.layers.store import db import peewee import datetime from contact import Contact from group import Group from broadcast import Broadcast TYPE_CONTACT = "contact" TYPE_GROUP = "group" TYPE_BROADCAST = "broadcast" class Conversation(db.get_base_model()): contact = peewee.ForeignKeyField(Con...
XiaosongWei/crosswalk-test-suite
refs/heads/master
webapi/tct-csp-w3c-tests/csp-py/csp_default-src_self_script.py
25
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) response.headers.set( "Content-Security-Policy", "default-src 'self' 'unsafe-inli...
pieleric/dacontrol-a3
refs/heads/master
andorcam3.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 6 Mar 2012 @author: Éric Piel Copyright © 2012 Éric Piel, Delmic This file is part of Delmic Acquisition Software. Delmic Acquisition Software is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as ...
brandond/ansible
refs/heads/devel
lib/ansible/modules/cloud/ovirt/ovirt_template_facts.py
55
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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 #...
tensorflow/profiler
refs/heads/master
plugin/tensorboard_plugin_profile/convert/tf_data_stats_proto_to_gviz.py
1
# Copyright 2020 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...
budach/seqan
refs/heads/master
util/py_lib/seqan/dox/test/test_proc_doc.py
9
#!/usr/bin/env python """Tests for the proc_doc module.""" import sys import os.path import unittest import seqan.dox.lexer as lexer import seqan.dox.dox_tokens as dox_tokens import seqan.dox.dox_parser as dox_parser import seqan.dox.proc_doc as proc_doc import seqan.dox.raw_doc as raw_doc import seqan.dox.pure as pu...
cainmatt/django
refs/heads/master
tests/template_tests/syntax_tests/test_list_index.py
521
from django.test import SimpleTestCase from ..utils import setup class ListIndexTests(SimpleTestCase): @setup({'list-index01': '{{ var.1 }}'}) def test_list_index01(self): """ List-index syntax allows a template to access a certain item of a subscriptable object. """ ...
WhisperSystems/TextSecureKit
refs/heads/master
Utilities/precommit.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import subprocess import datetime import argparse import commands git_repo_path = os.path.abspath(subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).strip()) def splitall(path): allparts = [] while 1: parts = os.path....
toolmacher/micropython
refs/heads/master
tests/basics/for_break.py
117
# Testcase for break in a for [within bunch of other code] # https://github.com/micropython/micropython/issues/635 def foo(): seq = [1, 2, 3] v = 100 i = 5 while i > 0: print(i) for a in seq: if a == 2: break i -= 1 foo() # break from within nested ...
geekboxzone/mmallow_prebuilts_gcc_darwin-x86_x86_x86_64-linux-android-4.9
refs/heads/geekbox
share/gdb/python/gdb/command/prompt.py
120
# Extended prompt. # Copyright (C) 2011-2014 Free Software Foundation, Inc. # 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 vers...
jfunez/opac
refs/heads/master
opac/webapp/admin/custom_filters.py
3
# coding: utf-8 from flask_admin.contrib.mongoengine.filters import ( FilterEqual, FilterNotEqual, FilterLike, FilterNotLike, FilterEmpty, FilterInList, FilterNotInList, FilterConverter) from flask_admin.contrib.mongoengine.tools import parse_like_term from flask_admin.model import filters from flask_admin.con...
imsplitbit/nova
refs/heads/master
nova/tests/integrated/v3/test_keypairs.py
4
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, Inc. # 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...
kernevil/samba
refs/heads/master
source4/dsdb/tests/python/tombstone_reanimation.py
1
#!/usr/bin/env python3 # # Tombstone reanimation tests # # Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2014 # Copyright (C) Nadezhda Ivanova <nivanova@symas.com> 2014 # # 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 # ...
pwoodworth/intellij-community
refs/heads/master
python/testData/refactoring/extractsuperclass/importNotBroken.before.py
80
from shared import SharedClass class Source(SharedClass): pass
ojengwa/sympy
refs/heads/master
sympy/functions/special/tests/test_hyper.py
6
from sympy import (hyper, meijerg, S, Tuple, pi, I, exp, log, cos, sqrt, symbols, oo, Derivative, gamma, O) from sympy.series.limits import limit from sympy.abc import x, z, k from sympy.utilities.pytest import raises from sympy.utilities.randtest import ( random_complex_number as randcplx, t...
nolanliou/tensorflow
refs/heads/master
tensorflow/contrib/eager/python/examples/linear_regression/linear_regression_test.py
7
# 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...
tommo/gii
refs/heads/master
lib/mock/asset/PrefabAsset.py
1
import os.path import json from gii.core import * class PrefabAssetManager(AssetManager): def getName(self): return 'asset_manager.prefab' def acceptAssetFile( self, filePath ): if not os.path.isfile(filePath): return False name,ext = os.path.splitext(filePath) if not ext in ['.prefab']: return False re...
cyberphox/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/doc/performance.py
100
""" =========== Performance =========== Placeholder for Improving Performance documentation. """
TheProjecter/zedt
refs/heads/master
build.py
2
#!/usr/bin/env python # Parchment build script # # Copyright (c) 2008-2010 The Parchment Contributors # Licenced under the GPL v2 # http://code.google.com/p/parchment # Lists of files to combine together includes = ( ('.build/parchment.js', ( 'src/parchment/intro.js', 'src/lib/class.js', 'src/lib/iff.js', 's...
gauribhoite/personfinder
refs/heads/master
env/google_appengine/lib/django-1.5/django/core/cache/backends/dummy.py
209
"Dummy cache backend" from django.core.cache.backends.base import BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=None, version=None): key = self.make_key(key, version=version) ...
johnkeepmoving/oss-ftp
refs/heads/master
python27/unix/lib/urllib3/contrib/ntlmpool.py
199
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from nt...
HiroIshikawa/21playground
refs/heads/master
microblog/flask/lib/python3.5/site-packages/flask/testsuite/deprecations.py
563
# -*- coding: utf-8 -*- """ flask.testsuite.deprecations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests deprecation support. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase, catch_warnings class ...
aeby/brokenthings
refs/heads/master
bts/pipelines.py
1
# -*- coding: utf-8 -*- # Copyright (c) Reto Aebersold. # See LICENSE for details. from scrapy.exceptions import DropItem class FilterWordsPipeline(object): # put all words in lowercase words_to_filter = ['ohne defekt', 'nicht kaputt'] def process_item(self, item, spider): for word in self.wor...
acsone/Arelle
refs/heads/master
arelle/CntlrWinMain.py
2
''' Created on Oct 3, 2010 This module is Arelle's controller in windowing interactive UI mode @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. ''' from arelle import PythonUtil # define 2.x or 3.x string types import os, sys, subprocess, pickle, time, locale, re, fnmatc...
jt6562/XX-Net
refs/heads/master
python27/1.0/lib/code.py
62
"""Utilities needed to emulate Python's interactive interpreter. """ # Inspired by similar code by Jeff Epler and Fredrik Lundh. import sys import traceback from codeop import CommandCompiler, compile_command __all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_com...
ZeitOnline/zeit.content.cp
refs/heads/master
src/zeit/content/cp/browser/blocks/tests/test_podcast.py
1
import zeit.cms.testing import zeit.content.cp import zeit.content.cp.centerpage class TestPodcast(zeit.cms.testing.BrowserTestCase): layer = zeit.content.cp.testing.ZCML_LAYER def setUp(self): super(TestPodcast, self).setUp() self.centerpage = zeit.content.cp.centerpage.CenterPage() ...
aavanian/bokeh
refs/heads/master
examples/custom/font-awesome/font-awesome.py
13
from bokeh.plotting import show from bokeh.layouts import column from bokeh.models import CustomJS from bokeh.models.widgets import Button from fontawesome_icon import FontAwesomeIcon btn = Button(icon=FontAwesomeIcon(icon_name="thumbs-o-up", size=2), label="It works!", callback=CustomJS(code...
javier-ruiz-b/docker-rasppi-images
refs/heads/master
raspberry-google-home/env/lib/python3.7/site-packages/pip/_internal/wheel_builder.py
11
"""Orchestrator for building wheels from InstallRequirements. """ import logging import os.path import re import shutil from pip._internal.models.link import Link from pip._internal.operations.build.wheel import build_wheel_pep517 from pip._internal.operations.build.wheel_legacy import build_wheel_legacy from pip._in...
artefactual/archivematica-history
refs/heads/master
src/archivematicaCommon/lib/externals/pyes/tests/test_aliases.py
2
# -*- coding: utf-8 -*- from __future__ import absolute_import from .estestcase import ESTestCase import unittest from .. import exceptions class ErrorReportingTestCase(ESTestCase): def setUp(self): super(ErrorReportingTestCase, self).setUp() #self.conn.set_alias('test-alias', ['_river']) #...
v-iam/azure-sdk-for-python
refs/heads/master
azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network.py
2
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
40223137/2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/jqueryui/__init__.py
603
"""Wrapper around the jQuery UI library Exposes a single object, jq, to manipulate the widgets designed in the library This object supports : - subscription : js[elt_id] returns an object matching the element with the specified id - a method get(**kw). The only keyword currently supported is "selector". The metho...
Benniphx/server-tools
refs/heads/8.0
database_cleanup/model/purge_menus.py
32
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # 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 ...
Belgabor/django
refs/heads/master
tests/regressiontests/datatypes/models.py
11
""" This is a basic model to test saving and loading boolean and date-related types, which in the past were problematic for some database backends. """ from django.db import models, DEFAULT_DB_ALIAS from django.conf import settings class Donut(models.Model): name = models.CharField(max_length=100) is_frosted ...
erichuang1994/tornado
refs/heads/master
docs/conf.py
40
# Ensure we get the local copy of tornado instead of what's on the standard path import os import sys import time sys.path.insert(0, os.path.abspath("..")) import tornado master_doc = "index" project = "Tornado" copyright = "2009-%s, The Tornado Authors" % time.strftime("%Y") version = release = tornado.version ext...
oscar9/statistics_viewer
refs/heads/master
processmanager/processdirectory/stat5.py
1
# encoding: utf-8 import gvsig import addons.statistics_viewer.statisticprocess reload(addons.statistics_viewer.statisticprocess) from addons.statistics_viewer.statisticprocess.abstractprocess import AbstractStatisticProcess import os from org.apache.commons.math3.stat.correlation import PearsonsCorrelation class Stat...
crdoconnor/olympia
refs/heads/master
apps/amo/monitors.py
15
import os import socket import StringIO import traceback from django.conf import settings import commonware.log from PIL import Image import amo.search from amo.helpers import user_media_path from applications.management.commands import dump_apps monitor_log = commonware.log.getLogger('z.monitor') def memcache():...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/model_validation/tests.py
38
from django.core import management from django.core.checks import Error, run_checks from django.db.models.signals import post_init from django.test import TestCase from django.test.utils import override_settings from django.utils import six class OnPostInit(object): def __call__(self, **kwargs): pass de...
Edu-Glez/Bank_sentiment_analysis
refs/heads/master
env/lib/python3.6/site-packages/pygments/styles/xcode.py
31
# -*- coding: utf-8 -*- """ pygments.styles.xcode ~~~~~~~~~~~~~~~~~~~~~ Style similar to the `Xcode` default theme. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, N...
bcornwellmott/frappe
refs/heads/develop
frappe/utils/help.py
2
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals, print_function import frappe import hashlib from frappe.model.db_schema import DbManager from frappe.installer import get_root_connection from frappe...
cbeighley/peregrine
refs/heads/master
tests/test_iqgen_tcxo.py
2
# Copyright (C) 2016 Swift Navigation Inc. # # Contact: Valeri Atamaniouk <valeri@swiftnav.com> # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF A...
D-L/SimpleBookMarks
refs/heads/master
src/tornado/autoreload.py
45
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
wilhelmryan/Arduino
refs/heads/master
arduino-core/src/processing/app/i18n/python/requests/packages/charade/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
mj10777/QGIS
refs/heads/master
tests/src/python/test_qgsdatetimestatisticalsummary.py
45
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsDateTimeStatisticalSummary. .. 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 ...