repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/setup.py
2
# Autodetecting setup.py script for building the Python extensions # __version__ = "$Revision$" import sys, os, imp, re, optparse from glob import glob from platform import machine as platform_machine import sysconfig from distutils import log from distutils import text_file from distutils.errors import * from distu...
uberamd/NGECore2
refs/heads/master
scripts/object/mobile/ep3/wookiee_spirit_healer_01.py
85615
import sys def setup(core, object): return
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/mobile/tatooine_npc/pfilbee_jhorn.py
85615
import sys def setup(core, object): return
Microsoft/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/multiprocessing/synchronize.py
5
# # Module implementing synchronization primitives # # multiprocessing/synchronize.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event' ] import threading import sys import tempfile impor...
aristanetworks/neutron
refs/heads/master
neutron/tests/retargetable/test_example.py
53
# Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You may # obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
mcaleavya/bcc
refs/heads/master
tools/biosnoop.py
1
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # biosnoop Trace block device I/O and print details including issuing PID. # For Linux, uses BCC, eBPF. # # This uses in-kernel eBPF maps to cache process details (PID and comm) by I/O # request, as well as a starting timestamp for calculating I/O ...
petr-devaikin/dancee
refs/heads/master
helpers/diagrams_for_report/venv/lib/python3.6/site-packages/setuptools/command/bdist_rpm.py
1049
import distutils.command.bdist_rpm as orig class bdist_rpm(orig.bdist_rpm): """ Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs...
40423209/2016fallcadp_bg9
refs/heads/gh-pages
plugin/render_math/__init__.py
371
from .math import *
rochacbruno/flask-mongoengine
refs/heads/master
tests/test_forms.py
2
import sys sys.path[0:0] = [""] import unittest import datetime import flask import wtforms import re from bson import ObjectId from werkzeug.datastructures import MultiDict from flask.ext.mongoengine import MongoEngine from flask.ext.mongoengine.wtf import model_form from mongoengine import queryset_manager from ....
mozilla-b2g/fxos-certsuite
refs/heads/master
mcts/webapi_tests/idle/test_idle_active.py
3
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import unittest from marionette_driver.wait import Wait from mcts.webapi_tests.semiauto import TestCase from mcts.webap...
m-lab/mlab-ns
refs/heads/master
server/mlabns/third_party/geoip2/chardet/version.py
240
""" This module exists only to simplify retrieving the version number of chardet from within setup.py and from chardet subpackages. :author: Dan Blanchard (dan.blanchard@gmail.com) """ __version__ = "3.0.4" VERSION = __version__.split('.')
franek/weboob
refs/heads/master
weboob/tools/browser/firefox_cookies.py
1
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob 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 of the License, or # (at your...
sprintingdev/CloudBot
refs/heads/master
plugins/suggest.py
36
import json import requests from cloudbot import hook from cloudbot.util import formatting @hook.command() def suggest(text): """suggest <phrase> -- Gets suggested phrases for a google search""" params = {'output': 'json', 'client': 'hp', 'q': text} try: request = requests.get('http://google...
hashworks/CouchPotatoServer
refs/heads/forkDev
couchpotato/core/plugins/browser_test.py
17
#import sys import os import mock import unittest from unittest import TestCase from couchpotato.core.plugins.browser import FileBrowser from couchpotato.core.softchroot import SoftChroot CHROOT_DIR = '/tmp/' # 'couchpotato.core.plugins.browser.Env', @mock.patch('couchpotato.core.plugins.browser.Env', name='EnvM...
keadyk/openmc_mg_prepush
refs/heads/master
python_and_shell_scripts/giant_implicit_2g_relaxed/change_xs.py
1
import sys import os import math cg_index = int(sys.argv[1])-1 #coarse grid index-- passed from bash script rf_index = int(sys.argv[2])-1 #relax fact index-- passed from bash script st1_index = int(sys.argv[3])-1 #sigmaT1 index-- passed from bash script st2_index = int(sys.argv[4])-1 #sigmaT2 index-- passed from bash ...
mancoast/CPythonPyc_test
refs/heads/master
cpython/300_sortperf.py
4
"""Sort performance test. See main() for command line syntax. See tabulate() for output format. """ import sys import time import random import marshal import tempfile import os td = tempfile.gettempdir() def randfloats(n): """Return a list of n random floats in [0, 1).""" # Generating floats is expensive,...
adlius/osf.io
refs/heads/develop
api/alerts/views.py
16
from django.db.models import Q from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import NotFound from framework.auth.oauth_scopes import CoreScopes from api.base.filters import ListFilterMixin from api.base import permissions as base_permissions from api.base.utils impo...
rawjam/django-allauth
refs/heads/master
allauth/socialaccount/providers/pivotaltracker/models.py
4209
# Create your models here.
alberto-fc/gg
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
tensorflow/tensorflow
refs/heads/master
tensorflow/python/distribute/shared_variable_creator_test.py
13
# Copyright 2018 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...
DougFirErickson/mavlink
refs/heads/master
pymavlink/tools/mavsearch.py
45
#!/usr/bin/env python ''' search a set of log files for a condition ''' import sys, time, os from pymavlink import mavutil from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--condition", default=None, help="conditional check on log") parser.add_argument("--types",...
bfontaine/web-pp
refs/heads/master
pp/unidecode/x093.py
252
data = ( 'Lun ', # 0x00 'Kua ', # 0x01 'Ling ', # 0x02 'Bei ', # 0x03 'Lu ', # 0x04 'Li ', # 0x05 'Qiang ', # 0x06 'Pou ', # 0x07 'Juan ', # 0x08 'Min ', # 0x09 'Zui ', # 0x0a 'Peng ', # 0x0b 'An ', # 0x0c 'Pi ', # 0x0d 'Xian ', # 0x0e 'Ya ', # 0x0f 'Zhui ', # 0x10 'Le...
gdgellatly/OCB1
refs/heads/7.0
addons/analytic_user_function/analytic_user_function.py
74
# -*- 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...
daniponi/django
refs/heads/master
tests/template_tests/syntax_tests/test_filter_tag.py
521
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class FilterTagTests(SimpleTestCase): @setup({'filter01': '{% filter upper %}{% endfilter %}'}) def test_filter01(self): output = self.engine.render_to_string('filter01') self.ass...
xrmx/django
refs/heads/master
tests/signals/tests.py
311
from __future__ import unicode_literals from django.db import models from django.db.models import signals from django.dispatch import receiver from django.test import TestCase from django.utils import six from .models import Author, Book, Car, Person class BaseSignalTest(TestCase): def setUp(self): # Sa...
mic4ael/indico
refs/heads/master
indico/testing/fixtures/person.py
1
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals import pytest from indico.modules.events.models.persons import E...
davidhrbac/spacewalk
refs/heads/master
backend/server/handlers/xmlrpc/up2date.py
4
# # Copyright (c) 2008--2015 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 c...
marckuz/django
refs/heads/master
django/contrib/gis/gdal/base.py
654
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _...
serviceagility/boto
refs/heads/develop
tests/unit/swf/test_layer1_decisions.py
114
from tests.unit import unittest import boto.swf.layer1_decisions class TestDecisions(unittest.TestCase): def setUp(self): self.decisions = boto.swf.layer1_decisions.Layer1Decisions() def assert_data(self, *data): self.assertEquals(self.decisions._data, list(data)) def test_continue_as_...
leaprovenzano/kutils
refs/heads/master
kutils/viz.py
1
import itertools import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix from sklearn.utils import compute_class_weight def get_confusion(model, x, y, labels, norm=False, batch_size=32): expected_labels = np.argmax(y, axis = 1) val_predictions = model.predict(x, verbo...
SpaceKatt/CSPLN
refs/heads/master
apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/scripts/manage.py
14
import os import glob import zipfile import urllib import tempfile import shutil def copytree(src, dst): names = os.listdir(src) ignored_names = set() errors = [] if not os.path.exists(dst): os.makedirs(dst) for name in names: srcname = os.path.join(src, name) dstname = os.p...
christiano/exemplos_mongodb
refs/heads/master
cadastra.py
1
#!/usr/bin/env python import pymongo import random import datetime cli = pymongo.MongoClient() db = cli['treinamento'] def gera_nome(): alphabet = "abcdefghijklmnopqrstuvwxyz" pw_length = 16 mypw = "" for i in range(pw_length): next_index = random.randrange(len(alphabet)) mypw = myp...
amarandon/smeuhsocial
refs/heads/master
apps/avatar/tests/test_views.py
1
from smeuhoverride.tests import BaseImageTest from avatar.models import Avatar class TestAvatar(BaseImageTest): def upload_avatar(self): return self.client.post('/avatar/change/', { 'avatar': open(self.testfile), }, follow=True) def test_upload_avatar(self): resp = self.u...
cojacoo/testcases_echoRD
refs/heads/master
column001.py
1
mcinif='mcini_g63' runname='columnA' mcpick='column.pick' pathdir='/beegfs/work/ka_oj4748/echoRD' wdir='/beegfs/work/ka_oj4748/gen_tests' colref=False prec2D=False import sys sys.path.append(pathdir) import run_echoRD as rE rE.echoRD_job(mcinif=mcinif,mcpick=mcpick,runname=runname,wdir=wdir,pathdir=pathdir,colref=col...
ludoo/django-autoslug
refs/heads/master
setup.py
1
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-autoslug', version='0.5', packages=['autoslug'], ...
NeCTAR-RC/nova
refs/heads/nectar/mitaka
nova/objects/__init__.py
5
# 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...
epiqc/ScaffCC
refs/heads/master
llvm/utils/prepare-code-coverage-artifact.py
37
#!/usr/bin/env python from __future__ import print_function '''Prepare a code coverage artifact. - Collate raw profiles into one indexed profile. - Generate html reports for the given binaries. Caution: The positional arguments to this script must be specified before any optional arguments, such as --restrict. '''...
devinbalkind/eden
refs/heads/master
modules/s3db/req.py
1
# -*- coding: utf-8 -*- """ Sahana Eden Request Model @copyright: 2009-2014 (c) Sahana Software Foundation @license: MIT 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 witho...
repotvsupertuga/repo
refs/heads/master
plugin.video.pancas/resources/lib/resolvers/watch1080p.py
23
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
klunwebale/odoo
refs/heads/8.0
addons/web_calendar/__openerp__.py
422
{ 'name': 'Web Calendar', 'category': 'Hidden', 'description':""" OpenERP Web Calendar view. ========================== """, 'author': 'OpenERP SA, Valentino Lab (Kalysto)', 'version': '2.0', 'depends': ['web'], 'data' : [ 'views/web_calendar.xml', ], 'qweb': [ 'stat...
berdario/Cython_python_backend
refs/heads/master
Cython/Compiler/Buffer.py
1
from Visitor import VisitorTransform, CythonTransform from ModuleNode import ModuleNode from Nodes import * from ExprNodes import * from StringEncoding import EncodedString from Errors import CompileError from Code import UtilityCode import Interpreter import PyrexTypes import Naming import Symtab try: set except ...
decebel/librosa
refs/heads/master
tests/test_core.py
2
#!/usr/bin/env python # CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu> # unit tests for librosa core (__init__.py) # # Run me as follows: # cd tests/ # nosetests -v --with-coverage --cover-package=librosa # from __future__ import print_function # Disable cache import os try: os.environ.pop(...
lud0/comp-bio-tools
refs/heads/master
reweight.py
1
#!/usr/bin/env python ######################################################## # # Python version of the Time-independent Free Energy # reconstruction script (a.k.a. reweight) based on the # algorithm proposed by Tiwary and Parrinello # JPCB 2014 doi:10.1021/jp504920s. # # The script is meant to be used as an ana...
netfirms/erpnext
refs/heads/develop
erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
22
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt from frappe.model.document import Document from erpnext.stock.doctype.serial_no.serial_no import...
retailos/node-red
refs/heads/develop
nodes/core/hardware/nrgpio.py
9
#!/usr/bin/python # # Copyright 2014,2016 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 agreed ...
jjingrong/PONUS-1.2
refs/heads/master
venv/build/django/django/contrib/comments/forms.py
218
import time from django import forms from django.forms.util import ErrorDict from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.comments.models import Comment from django.utils.crypto import salted_hmac, constant_time_compare from django.utils.encoding import...
pchaigno/grreat
refs/heads/master
lib/data_stores/fake_data_store_benchmark_test.py
16
#!/usr/bin/env python """The benchmark tests for the fake data store.""" from grr.lib import data_store_test from grr.lib import flags from grr.lib import test_lib class FakeDataStoreBenchmarks(data_store_test.DataStoreBenchmarks): """Benchmark the fake data store.""" def main(args): test_lib.main(args) if _...
havard024/prego
refs/heads/master
crm/lib/python2.7/site-packages/PIL/ImageFont.py
4
# # The Python Imaging Library. # $Id$ # # PIL raster font management # # History: # 1996-08-07 fl created (experimental) # 1997-08-25 fl minor adjustments to handle fonts from pilfont 0.3 # 1999-02-06 fl rewrote most font management stuff in C # 1999-03-17 fl take pth files into account in load_path (from Rich...
gptech/ansible
refs/heads/devel
test/units/plugins/action/test_action.py
34
# -*- coding: utf-8 -*- # (c) 2015, Florian Apolloner <florian@apolloner.eu> # # 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 # (...
dannyperry571/theapprentice
refs/heads/master
script.module.requests/lib/requests/packages/urllib3/connectionpool.py
64
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket from .exceptions import ( ClosedPoolError, ProtocolError, EmptyPoolError, HeaderParsingError, HostChangedError, Locatio...
vincent99/cattle
refs/heads/master
tests/integration-v1/cattletest/core/test_host_stats.py
5
from common import * # NOQA from test_docker import docker_client, TEST_IMAGE_UUID, if_docker import requests import jwt # work around flake8 issue docker_client @if_docker def test_stats_host(docker_client, context): host = docker_client.list_host()[0] sim_host = context.host assert 'stats' in host.l...
Cloud-Elasticity-Services/as-libcloud
refs/heads/trunk
docs/examples/compute/create_ibm_sce_windows_node.py
62
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver Driver = get_driver(Provider.IBM) conn = Driver("user@name.com", "ibm_sce_password") images = conn.list_images() image = [i for i in images if i.id == '20014110'][0] locations = conn.list_locations() location = [l for l in ...
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/boto/pyami/bootstrap.py
151
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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 rights to use, copy, modi...
allotria/intellij-community
refs/heads/master
python/testData/completion/assignedNearby.after.py
83
class Foo: pass def bar(): x = Foo() x.shazam = 1 print x.shazam
phisiart/peloton-p3
refs/heads/p3
script/formatting/formatter.py
4
#!/usr/bin/env python # encoding: utf-8 ## ============================================== ## GOAL : Format code, Add/Strip headers ## ============================================== import argparse import logging import os import re import sys ## ============================================== ## CONFIGURATION ## ====...
mbalasso/mynumpy
refs/heads/master
numpy/oldnumeric/typeconv.py
101
__all__ = ['oldtype2dtype', 'convtypecode', 'convtypecode2', 'oldtypecodes'] import numpy as np oldtype2dtype = {'1': np.dtype(np.byte), 's': np.dtype(np.short), # 'i': np.dtype(np.intc), # 'l': np.dtype(int), # 'b': np.dtype(np.ubyte), ...
valkjsaaa/sl4a
refs/heads/master
python-build/python-libs/gdata/src/gdata/apps/emailsettings/service.py
143
#!/usr/bin/python # # Copyright (C) 2008 Google, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
JioCloud/oslo.context
refs/heads/master
oslo_context/tests/test_fixture.py
2
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
tommy-u/chaco
refs/heads/master
chaco/data_view.py
3
""" Defines the DataView class, and associated property traits and property functions. """ from numpy import array, transpose from traits.api import Bool, Enum, Instance, Property from enable.colors import color_table from abstract_overlay import AbstractOverlay from axis import PlotAxis from base_1d_mapper import Ba...
jinnykoo/christmas
refs/heads/master
src/oscar/templatetags/purchase_info_tags.py
34
from django import template register = template.Library() @register.assignment_tag def purchase_info_for_product(request, product): if product.is_parent: return request.strategy.fetch_for_parent(product) return request.strategy.fetch_for_product(product) @register.assignment_tag def purchase_info...
pschmitt/home-assistant
refs/heads/dev
homeassistant/components/ubee/device_tracker.py
12
"""Support for Ubee router.""" import logging from pyubee import Ubee import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA, DeviceScanner, ) from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME import homeassistant.helpers.config_valida...
smiller171/ansible
refs/heads/devel
lib/ansible/plugins/lookup/hashi_vault.py
44
# (c) 2015, Jonathan Davila <jdavila(at)ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
anksp21/Community-Zenpacks
refs/heads/master
ZenPacks.community.NetApp/ZenPacks/community/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
sovietspy2/uzletiProject
refs/heads/master
samples-and-tests/i-am-a-developer/mock.py
424
# mock.py # Test tools for mocking and patching. # Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # mock 1.0 # http://www.voidspace.org.uk/python/mock/ # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml # Scripts m...
SymbiFlow/symbiflow-robot
refs/heads/master
robot_merge_if_green.py
1
#!python3 import logging import os import re import sys import traceback from github3 import login from github3.repos.status import Status try: GITHUB_API_TOKEN = os.environ['GITHUB_API_TOKEN'] ORGANIZATION = os.environ['ORGANIZATION'] # PROJECT-100, [project2-900], etc LABEL_EXTRACTING_REGEX = os.env...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.4.3/Lib/test/test_hash.py
34
# test the invariant that # iff a==b then hash(a)==hash(b) # import unittest from test import test_support class HashEqualityTestCase(unittest.TestCase): def same_hash(self, *objlist): # Hash each object given and fail if # the hash values are not all the same. hashed = map(hash, objli...
dhoffman34/django
refs/heads/master
tests/admin_scripts/management/commands/base_command.py
531
from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Test basic commands' requires_system_checks = False def add_arguments(self, parser): parser.add_argument('args', nargs='*') parser.add_argument('--option_a', '-a', default='1') parser.add_argum...
mrksbrd/android_kernel_lge_z
refs/heads/master
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
rouault/Quantum-GIS
refs/heads/master
scripts/qgis_fixes/fix_has_key.py
77
from lib2to3.fixes.fix_has_key import FixHasKey
bl4ckdu5t/registron
refs/heads/master
tests/libraries/test_pytz.py
7
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
diorcety/intellij-community
refs/heads/master
python/testData/highlighting/stringMixedSeparatorsOK.py
83
print "Hello"\ 'World' print 'Hello "World" ' """Foo "bar """ '''Here the ' is just another character'''
chhavi21/msan501
refs/heads/master
labs/code/graphs/test_graph.py
2
from graph import * # support code def chktargets(start, expecting): if adj[start] != expecting: print "error for", start, ": expecting", expecting, "found", adj[start] def checknodes(start, expecting): result = nodes(adj, start) if set(result) != set(expecting): print "error starting at", start, ": expecting...
notriddle/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/h2/test/test_closed_streams.py
25
# -*- coding: utf-8 -*- """ test_closed_streams ~~~~~~~~~~~~~~~~~~~ Tests that we handle closed streams correctly. """ import pytest import h2.config import h2.connection import h2.errors import h2.events import h2.exceptions class TestClosedStreams(object): example_request_headers = [ (':authority', 'e...
jrutila/django-shop
refs/heads/master
example/settings.py
15
# Django settings for example project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. '...
slozier/ironpython2
refs/heads/master
Src/StdLib/Lib/site-packages/pythonwin/pywin/framework/toolmenu.py
9
# toolmenu.py import win32ui import win32con import win32api import app import sys import string tools = {} idPos = 100 # The default items should no tools menu exist in the INI file. defaultToolMenuItems = [ ('Browser', 'win32ui.GetApp().OnViewBrowse(0,0)'), ('Browse PythonPath', 'from pywin.tools import browsePr...
himleyb85/django
refs/heads/master
django/conf/locale/gl/formats.py
619
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = '...
haudren/scipy
refs/heads/master
scipy/sparse/linalg/dsolve/linsolve.py
17
from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from numpy import asarray, empty, ravel, nonzero from scipy.sparse import (isspmatrix_csc, isspmatrix_csr, isspmatrix, SparseEfficiencyWarning, csc_matrix) from . import _superlu n...
codedbyjay/django-quickbooks
refs/heads/master
initialize.py
2
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "qwc.settings") import django django.setup() from django.contrib.auth.models import User from quickbooks.models import MessageQue from quickbooks import models from quickbooks.qbxml import QBXML from django.db.models import get_app, get_models class bcolors: ...
y-tsutsu/mondja
refs/heads/master
mondja/custom_pipeline.py
1
def set_superuser(user, *args, **kwargs): ''' ソーシャルログインで作成されたユーザをスーパーユーザに設定します. ''' user.is_superuser = True user.save()
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/testData/resolve/multiFile/fromPackageModuleImportElementNamedAsModule/FromPackageModuleImportElementNamedAsModule.py
166
from p1 import foo foo() #<ref>
ghostsquad/pycard
refs/heads/master
pycard.py
1
from jinja2 import Template import os from optparse import OptionParser import logging import csv import time import re from watchdog.observers import Observer from watchdog.events import LoggingEventHandler, FileSystemEventHandler from itertools import zip_longest from livereload import Server VERSION = '0.1.0' REN...
repotvsupertuga/tvsupertuga.repository
refs/heads/master
plugin.video.youtube/resources/lib/youtube_plugin/kodion/utils/datetime_parser.py
3
__author__ = 'bromix' import re from datetime import date, datetime, timedelta, time from ..exceptions import KodionException __RE_MATCH_TIME_ONLY__ = re.compile(r'^(?P<hour>[0-9]{2})([:]?(?P<minute>[0-9]{2})([:]?(?P<second>[0-9]{2}))?)?$') __RE_MATCH_DATE_ONLY__ = re.compile(r'^(?P<year>[0-9]{4})[-]?(?P<month>[0-9]...
shadyueh/pyranking
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py
436
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isinstance(s, text_type): ...
BassantMorsi/finderApp
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.py
1093
from __future__ import absolute_import from . import ssl_match_hostname __all__ = ('ssl_match_hostname', )
oascigil/inrpp
refs/heads/master
bindings/python/ns3modulegen_core_customizations.py
41
from __future__ import print_function import sys import re from pybindgen.typehandlers import base as typehandlers from pybindgen import ReturnValue, Parameter from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper from pybindgen.typehandlers.codesink import MemoryCodeSink from pybindgen.t...
keto/askbot-devel
refs/heads/master
askbot/migrations/0162_auto__add_field_post_language_code.py
14
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Post.language_code' db.add_column('askbot_post', 'language_code', self.gf('django.db.model...
weigj/django-multidb
refs/heads/master
django/contrib/gis/maps/google/__init__.py
7
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a webpage. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render_to_response('template.html', {'google' : GoogleMap(key="a...
fengbaicanhe/intellij-community
refs/heads/master
python/testData/addImport/parens.py
83
from urllib import (urlopen, urlencode)
xkcd1253/SocialNetworkforTwo
refs/heads/master
flask/lib/python2.7/site-packages/whoosh/sorting.py
6
# Copyright 2011 Matt Chaput. 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 notice, # this list of conditions a...
grundprinzip/Impala
refs/heads/cdh5-trunk
thirdparty/thrift-0.9.0/lib/py/setup.py
28
#!/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 # "L...
friebsch/example-code
refs/heads/master
09-pythonic-obj/vector2d_v2_fmt_snippet.py
7
""" A 2-dimensional vector class >>> v1 = Vector2d(3, 4) >>> x, y = v1 >>> x, y (3.0, 4.0) >>> v1 Vector2d(3.0, 4.0) >>> v1_clone = eval(repr(v1)) >>> v1 == v1_clone True >>> print(v1) (3.0, 4.0) >>> octets = bytes(v1) >>> octets b'\\x00\\x00\\x00\\x00\\x00\\x00\...
signed/intellij-community
refs/heads/master
python/testData/completion/className/qualified/mypackage/__init__.py
166
class Shazam: pass
Splawik/pytigon
refs/heads/master
pytigon/schserw/schsys/remotebackend.py
1
# -*- coding: utf-8 -*- # This program 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, or (at your option) any later # version. # # This program is distributed in the hope that it will...
dvliman/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.2/django/contrib/gis/gdal/prototypes/ds.py
311
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
chjw8016/GreenOdoo7-haibao
refs/heads/master
openerp/addons/hr_holidays/report/holidays_summary_report.py
13
# -*- 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...
Tatsh/youtube-dl
refs/heads/master
youtube_dl/extractor/plays.py
68
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class PlaysTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?plays\.tv/(?:video|embeds)/(?P<id>[0-9a-f]{18})' _TESTS = [{ 'url': 'https://plays.tv/video/56af17f56c...
KingxBanana/zulip
refs/heads/master
zerver/views/webhooks/trello/card_actions.py
15
from typing import Dict, Tuple, Any, Optional, MutableMapping, Mapping, Text from datetime import datetime from .exceptions import UnknownUpdateCardAction from .templates import TRELLO_SUBJECT_TEMPLATE, TRELLO_MESSAGE_TEMPLATE SUPPORTED_CARD_ACTIONS = [ u'updateCard', u'createCard', u'addLabelToCard', ...
google/tf-quant-finance
refs/heads/master
tf_quant_finance/math/pde/steppers/multidim_parabolic_equation_stepper.py
1
# Lint as: python3 # 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 agr...
philanthropy-u/edx-platform
refs/heads/master
cms/djangoapps/contentstore/management/commands/tests/test_git_export.py
19
""" Unittests for exporting to git via management command. """ import copy import os import shutil import StringIO import subprocess import unittest from uuid import uuid4 from django.conf import settings from django.core.management import call_command from django.core.management.base import CommandError from django....
jmagnusson/babel
refs/heads/master
tests/conftest.py
42
import os import pytest @pytest.fixture def os_environ(monkeypatch): mock_environ = dict(os.environ) monkeypatch.setattr(os, 'environ', mock_environ) return mock_environ