repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
calculuscowboy/cookiecutter-django
refs/heads/master
{{cookiecutter.project_slug}}/config/settings/local.py
2
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' %} - Use mailhog for emails {% else %} - Use console backend for emails {% endif %} - Add Django Debug Toolbar - Add django-extensions as app """ import socket import os from .common...
ray306/expy
refs/heads/master
test/show_text.py
1
# coding:utf-8 ##### package test ##### import sys sys.path = ['../../']+sys.path ################ from expy import * # Import the needed functions start() # Initiate the experiment environment '''General usage''' # Draw text on the canvas drawText('Hello world!') show(2) # Display current canvas '''''' # Draw te...
Sjors/bitcoin
refs/heads/master
test/functional/test_framework/siphash.py
91
#!/usr/bin/env python3 # Copyright (c) 2016-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Specialized SipHash-2-4 implementations. This implements SipHash-2-4 for 256-bit integers. """ def ro...
ds-hwang/chromium-crosswalk
refs/heads/master
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...
signed/intellij-community
refs/heads/master
python/testData/copyPaste/IndentTabIncrease.src.py
75
<selection>print "Line 2" </selection><caret> class Test: def __init__(self): print "Line 1"
chintak/scikit-image
refs/heads/placeholder
skimage/io/tests/test_colormixer.py
40
from numpy.testing import (assert_array_equal, assert_almost_equal, assert_equal, assert_array_almost_equal, ) import numpy as np import skimage.io._plugins._colormixer as cm class ColorMixerTest(object): ...
gracehyemin/is210-week-04-warmup
refs/heads/master
tests/test_task_04.py
28
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests Task 04.""" # Import Python libs import unittest import task_04 class Task04TestCase(unittest.TestCase): """Test cases for Task 04.""" testmap = { 'not_enough_litterboxes': [2, 1, True, True], 'plenty_of_litterboxes': [1, 2, True, False...
flotre/Sick-Beard
refs/heads/development
lib/requests/packages/urllib3/packages/ordered_dict.py
1093
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
Serg09/socorro
refs/heads/master
socorro/unittest/external/postgresql/test_skiplist.py
11
# 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/. from nose.plugins.attrib import attr from nose.tools import eq_, ok_, assert_raises from socorro.external import Missin...
thodoris/djangoPharma
refs/heads/master
djangoPharma/env/Lib/site-packages/django/contrib/flatpages/sitemaps.py
729
from django.apps import apps as django_apps from django.contrib.sitemaps import Sitemap from django.core.exceptions import ImproperlyConfigured class FlatPageSitemap(Sitemap): def items(self): if not django_apps.is_installed('django.contrib.sites'): raise ImproperlyConfigured("FlatPageSitemap ...
kingvuplus/ops
refs/heads/master
lib/python/Plugins/SystemPlugins/SatelliteEquipmentControl/plugin.py
34
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Plugins.Plugin import PluginDescriptor from Components.ConfigList import ConfigListScreen from Components.ActionMap import ActionMap from Components.config import config from Components.NimManager import nimmanager as nimmgr class SecPar...
whynoteasy/bosan
refs/heads/master
external/gtest/test/gtest_list_tests_unittest.py
1898
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
jjmleiro/hue
refs/heads/master
desktop/libs/libsaml/src/libsaml/views.py
36
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
6WIND/scapy
refs/heads/master
scapy/contrib/automotive/obd/mid/__init__.py
25
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Andreas Korb <[email protected]> # Copyright (C) Nils Weiss <[email protected]> # This program is published under a GPLv2 license # scapy.contrib.status = skip """ Package of contrib automotive obd specific...
amisrs/angular-flask
refs/heads/master
angular_flask/lib/python2.7/site-packages/setuptools/py26compat.py
320
""" Compatibility Support for Python 2.6 and earlier """ import sys try: from urllib.parse import splittag except ImportError: from urllib import splittag def strip_fragment(url): """ In `Python 8280 <http://bugs.python.org/issue8280>`_, Python 2.7 and later was patched to disregard the fragment...
shayanb/pycoin
refs/heads/master
tests/__init__.py
23
import unittest import doctest import pycoin.tx.script.microcode def load_tests(loader, tests, ignore): tests.addTests(doctest.DocTestSuite(pycoin.tx.script.microcode)) return tests
thefinn93/CouchPotatoServer
refs/heads/master
libs/jinja2/testsuite/core_tags.py
90
# -*- coding: utf-8 -*- """ jinja2.testsuite.core_tags ~~~~~~~~~~~~~~~~~~~~~~~~~~ Test the core tags like for and if. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment...
abhianand7/python_programs
refs/heads/master
pygame_assignment/pygame_02.py
1
import pygame import sys from pygame.locals import * pygame.init() white = (255,255,255) #defining colour in RGB black = (0,0,0) red = (255,0,0) green = (0,255,0) blue = (0,0,255) yellow = (255,255,0) cyan = (0,255,255) purpule = (255,0,255) setDisplay = pygame.display.set_mode((400,300)) singlePixel = pygam...
spawnedc/MeCanBlog
refs/heads/master
django/db/models/fields/related.py
82
from django.conf import settings from django.db import connection, router, transaction, connections from django.db.backends import util from django.db.models import signals, get_model from django.db.models.fields import (AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotEx...
lrowe/rdflib
refs/heads/master
rdflib/plugins/sparql/results/tsvresults.py
16
""" This implements the Tab Separated SPARQL Result Format It is implemented with pyparsing, reusing the elements from the SPARQL Parser """ import codecs from pyparsing import ( Optional, ZeroOrMore, Literal, ParserElement, ParseException, Suppress, FollowedBy, LineEnd) from rdflib.query import Result, Re...
mmuggli/doppelganger
refs/heads/master
utils/split_wikipedia.py
6
#! /usr/bin/env python # -*- coding: iso-8859-15 -*- import getopt, sys def main(): if len(sys.argv) < 4: return sequences = 0 in_sequence = False part_size = 1048576 * int(sys.argv[2]) current_file = 1 print "Part size:", part_size print if sys.argv[1] == "-": infile = sys.stdin else: ...
AntoineLee/spider163
refs/heads/master
spider163/utils/config.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import ConfigParser import os import re PATH = os.environ.get("HOME") + "/spider163" if os.environ.get("SPIDER163_PATH") is not None: PATH = os.environ.get("SPIDER163_PATH") if not os.path.exists(PATH): os.makedirs(PATH) if not os.path.exists(PATH + "/spider163...
ianmabie/uberpy
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/lockfile/symlinklockfile.py
487
from __future__ import absolute_import import time import os from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # s...
jorik041/Veil-Pillage
refs/heads/master
lib/delivery_methods.py
4
""" Payload-delivery methods. Includes: hostTrigger() - host an EXE and trigger it by UNC on a target uploadTrigger() - upload and trigger and EXE powershellTrigger() - trigger a download/execute of a powershell script from a particular powershell powershellHostTrigg...
lynndotconfig/server-tools
refs/heads/8.0
auditlog/models/rule.py
7
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 ABF OSIELL (<http://osiell.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
synweap15/pyload
refs/heads/stable
module/plugins/crypter/SexuriaCom.py
11
# -*- coding: utf-8 -*- import re from module.plugins.internal.Crypter import Crypter class SexuriaCom(Crypter): __name__ = "SexuriaCom" __type__ = "crypter" __version__ = "0.10" __status__ = "testing" __pattern__ = r'http://(?:www\.)?sexuria\.com/(v1/)?(Pornos_Kostenlos_.+?_(\d+)\.html|dl...
yangdw/PyRepo
refs/heads/master
src/repo/extension-lib/__init__.py
70
# coding:utf-8
godfreyhe/flink
refs/heads/master
flink-python/pyflink/fn_execution/table/window_context.py
9
################################################################################ # 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...
dbergan/AutobahnPython
refs/heads/master
examples/twisted/wamp/basic/rpc/decorators/__init__.py
561
############################################################################### ## ## Copyright (C) 2014 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 ## ## http:/...
poffuomo/spark
refs/heads/master
python/pyspark/streaming/kafka.py
36
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
thinkopensolutions/l10n-brazil
refs/heads/10.0
financial/models/financial_account.py
2
# -*- coding: utf-8 -*- # # Copyright 2017 KMEE INFORMATICA LTDA # Aristides Caldeira <[email protected]> # License AGPL-3 or later (http://www.gnu.org/licenses/agpl) # from __future__ import division, print_function, unicode_literals from odoo import api, fields, models class FinancialAccount(model...
blrm/openshift-tools
refs/heads/stg
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/openshift_logging/library/logging_patch.py
40
#!/usr/bin/python """ Ansible module to help with creating context patch file with whitelisting for logging """ import difflib import re from ansible.module_utils.basic import AnsibleModule DOCUMENTATION = ''' --- module: logging_patch short_description: This will create a context patch file while giving ability ...
idbedead/RNA-sequence-tools
refs/heads/master
Count_Parsing/sort_htseq_count.py
2
import fnmatch import os import pandas as pd import cPickle as pickle import subprocess import csv '''This program takes accepted_hits.bam files from tophat and turns them into counts and creates matrix file of cells/conditions and counts using htseq: http://www-huber.embl.de/HTSeq/doc/overview.html The files are sort...
Dino0631/RedRain-Bot
refs/heads/develop
lib/urllib3/contrib/_securetransport/low_level.py
136
""" Low-level helpers for the SecureTransport bindings. These are Python functions that are not directly related to the high-level APIs but are necessary to get them to work. They include a whole bunch of low-level CoreFoundation messing about and memory management. The concerns in this module are almost entirely abou...
luoxufeiyan/python
refs/heads/master
NKUCodingCat/0003/0003.py
40
#coding=utf-8 #并没有redis所以我只是抄官网的示例代码 import os,re,redis path = os.path.split(os.path.realpath(__file__))[0]+"/" f = open(path+"code.txt","r") A = f.read() arr = re.split("\s+",A) r = redis.Redis(host='localhost', port=6379, db=0) for i in range(len(arr)): if i: r.set(str(i),arr[i]) r.save()
fuselock/odoo
refs/heads/8.0
addons/account/wizard/account_reconcile_partner_process.py
385
# -*- 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...
MFoster/breeze
refs/heads/master
django/core/management/commands/sqlall.py
237
from __future__ import unicode_literals from optparse import make_option from django.core.management.base import AppCommand from django.core.management.sql import sql_all from django.db import connections, DEFAULT_DB_ALIAS class Command(AppCommand): help = "Prints the CREATE TABLE, custom SQL and CREATE INDEX S...
HybridF5/tempest_debug
refs/heads/master
tempest/tests/lib/services/compute/test_services_client.py
6
# Copyright 2015 NEC Corporation. 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 ...
udrg/crazyflie-clients-python
refs/heads/develop
lib/cfclient/ui/widgets/hexspinbox.py
7
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
mayblue9/scikit-learn
refs/heads/master
examples/neighbors/plot_digits_kde_sampling.py
251
""" ========================= Kernel Density Estimation ========================= This example shows how kernel density estimation (KDE), a powerful non-parametric density estimation technique, can be used to learn a generative model for a dataset. With this generative model in place, new samples can be drawn. These...
ravibhure/ansible
refs/heads/devel
lib/ansible/module_utils/facts/system/user.py
211
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
yvan-sraka/wprevents
refs/heads/master
vendor-local/lib/python/unidecode/x089.py
252
data = ( 'Ji ', # 0x00 'Zhi ', # 0x01 'Gua ', # 0x02 'Ken ', # 0x03 'Che ', # 0x04 'Ti ', # 0x05 'Ti ', # 0x06 'Fu ', # 0x07 'Chong ', # 0x08 'Xie ', # 0x09 'Bian ', # 0x0a 'Die ', # 0x0b 'Kun ', # 0x0c 'Duan ', # 0x0d 'Xiu ', # 0x0e 'Xiu ', # 0x0f 'He ', # 0x10 'Yuan ...
tinkerinestudio/Tinkerine-Suite
refs/heads/master
TinkerineSuite/pypy/lib-python/2.7/plat-mac/Carbon/AppleEvents.py
73
# Generated from 'AEDataModel.h' def FOUR_CHAR_CODE(x): return x typeApplicationBundleID = FOUR_CHAR_CODE('bund') typeBoolean = FOUR_CHAR_CODE('bool') typeChar = FOUR_CHAR_CODE('TEXT') typeSInt16 = FOUR_CHAR_CODE('shor') typeSInt32 = FOUR_CHAR_CODE('long') typeUInt32 = FOUR_CHAR_CODE('magn') typeSInt64 = FOUR_CHAR_COD...
Hazelsuko07/17WarmingUp
refs/heads/hy_try
py3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py
514
""" 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...
hilaskis/UAV_MissionPlanner
refs/heads/master
Lib/site-packages/scipy/setup.py
59
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('scipy',parent_package,top_path) config.add_subpackage('cluster') config.add_subpackage('constants') config.add_subpackage('fftpack') config.add_subpackage('integrate')...
vdmann/cse-360-image-hosting-website
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py
1729
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
banmoy/ns3
refs/heads/master
src/core/examples/sample-rng-plot.py
188
# -*- Mode:Python; -*- # /* # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRA...
boundarydevices/android_external_chromium_org
refs/heads/cm-12.0
tools/cr/cr/base/arch.py
113
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A module for the basic architectures supported by cr.""" import cr DEFAULT = cr.Config.From( CR_ENVSETUP_ARCH='{CR_ARCH}', ) class Arch(cr.Plugin,...
CodeCatz/litterbox
refs/heads/master
Natasa/Vaja_13.py
1
# Input method to pass variables to a script (py files) # Import - this is how you add features (MODULE) to your script from # Python feature (MODULE) set. # argv = "argument variable" - it holds arguments you pass when you run it from sys import argv # "unpacks" argv : Take whatever in ARGV, unpack it and assign it...
zturchan/CMPUT410-Lab4
refs/heads/master
env-lab4/lib/python2.7/ntpath.py
4
/usr/lib/python2.7/ntpath.py
uccgit/the-game
refs/heads/sandbox
src/Menu/__init__.py
7
__author__ = 'tootall'
pasqualguerrero/django
refs/heads/master
django/core/mail/backends/smtp.py
477
"""SMTP email backend class.""" import smtplib import ssl import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.message import sanitize_address from django.core.mail.utils import DNS_NAME class EmailBackend(BaseEmailBackend): """ A...
adhintz/password-alert
refs/heads/master
server/google_directory_service.py
2
# Copyright 2014 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 ...
huxianglin/pythonstudy
refs/heads/master
week06-胡湘林/选课系统/bin/admin.py
1
#!/usr/bin/env python # -*- coding:utf-8 -*- """ 用于为管理员用户提供相关操作,如:学校、课程、老师等相关操作 """ import os import sys BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASEDIR) from src.service import admin_service def execute(): admin_service.main() if __name__ == '__main__': exe...
gnip/support
refs/heads/master
Rules API/Python/AddRule.py
1
#!/usr/bin/env python import urllib2 import base64 import json import xml import sys def post(): # Expected Premium Stream URL Format: # https://api.gnip.com:443/accounts/<account>/publishers/<publisher>/streams/<stream>/<label>/rules.json url = 'ENTER_RULES_API_URL_HERE' UN = 'ENTER_USERNAME_HERE' PWD = 'EN...
csrgxtu/Google-Slave
refs/heads/master
src/GAE-Slave/lib/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:: {% ...
danalec/dotfiles
refs/heads/master
sublime/.config/sublime-text-3/Packages/SublimeLinter-contrib-lua-globals/linter.py
2
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Patrick Kish # Copyright (c) 2014 Patrick Kish # # License: MIT # """This module exports the LuaGlobals plugin class.""" from os.path import dirname, join, realpath FOLDER_PATH = dirname(realpath(__file__)) from Sub...
DouglasHeriot/pjproject
refs/heads/master
tests/pjsua/scripts-run/200_register.py
42
# $Id$ # from inc_cfg import * # Basic registration test_param = TestParam( "Basic registration", [ InstanceParam( "client", "--null-audio"+ " --id=\"<sip:[email protected]>\""+ " --registrar=sip:sip.pjsip.org" + " --username=test1" + " --password=test1" + " --realm=*", ur...
sassoftware/catalog-service
refs/heads/master
catalogService/libs/viclient_vendor/ZSI/twisted/WSsecurity.py
3
########################################################################### # Joshua R. Boverhof, LBNL # See Copyright for copyright notice! # $Id: WSsecurity.py 1134 2006-02-24 00:23:06Z boverhof $ ########################################################################### import sys, time, warnings import sha, base6...
SKA-ScienceDataProcessor/algorithm-reference-library
refs/heads/master
workflows/serial/simulation/simulation_serial.py
1
""" Pipelines expressed as dask components """ import logging import numpy from astropy import units as u from astropy.coordinates import SkyCoord from data_models.polarisation import PolarisationFrame from data_models.memory_data_models import Visibility, BlockVisibility from wrappers.serial.calibration.operatio...
yuvalt/xbmc
refs/heads/master
lib/libUPnP/Platinum/Build/Tools/Scripts/MakeAllVs.py
262
#! /usr/bin/env python import os import sys import getopt import subprocess configs = ['Debug', 'Release'] solutions = ['../../../Build/Targets/x86-microsoft-win32-vs2008/Platinum.sln'] try: opts, args = getopt.getopt(sys.argv[1:], "b:rc") except getopt.GetoptError, (msg, opt): print 'No build_config, defau...
codingjoe/viewflow
refs/heads/master
tests/examples/customnode/flows.py
3
from viewflow import flow, views as flow_views from viewflow.base import this, Flow from . import models, views from .nodes import DynamicSplit class DynamicSplitFlow(Flow): """ Dynamic split Depends on initial decision, several instances on make_decision task would be instantiated """ process_c...
dianshen/github
refs/heads/master
day15/app01/urls.py
1
"""day15 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
rue89-tech/edx-platform
refs/heads/master
lms/djangoapps/shoppingcart/migrations/0021_auto__add_field_orderitem_created__add_field_orderitem_modified.py
120
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'OrderItem.created' db.add_column('shoppingcart_orderitem', 'created', ...
htlcnn/pyrevitscripts
refs/heads/master
HTL.tab/Test.panel/Test.pushbutton/keyman/keyman/keyman/urls.py
1
"""keyman URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
lihui7115/ChromiumGStreamerBackend
refs/heads/master
build/android/gyp/pack_relocations.py
34
#!/usr/bin/env python # # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Pack relocations in a library (or copy unchanged). If --enable-packing and --configuration-name=='Release', invoke the relocation...
noam09/deluge-telegramer
refs/heads/master
telegramer/include/future/backports/test/pystone.py
80
#!/usr/bin/env python3 """ "PYSTONE" Benchmark Program Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes) Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013. Translated from ADA to C by Rick Richardson. Every method to preserve ADA-likeness h...
Endika/sale-workflow
refs/heads/8.0
sale_pricelist_discount/__init__.py
15
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
stevehof/CouchPotatoServer
refs/heads/master
libs/chardet/mbcsgroupprober.py
236
######################## 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...
julzhk/simple_api
refs/heads/master
test_api_using_numpy.py
1
import unittest import numpy as np import datetime COLUMN_LABELS = ['Name', 'Value', 'TimeStamp'] def str2datetime(s): return datetime.datetime.strptime(s[:19], "%Y-%m-%d %I:%M:%S") class TestAPIFunctions(unittest.TestCase): def setUp(self): self.df = np.loadtxt('test_dataset.csv', ...
kashif/scikit-learn
refs/heads/master
sklearn/decomposition/base.py
313
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <[email protected]> # Olivier Grisel <[email protected]> # Mathieu Blondel <[email protected]> # Denis A. Engemann <[email protected]> # Kyle Kastner <[email protected]> # # Licen...
zhakui/QMarkdowner
refs/heads/master
dpkt/mrt.py
15
# $Id: mrt.py 29 2007-01-26 02:29:07Z jon.oberheide $ """Multi-threaded Routing Toolkit.""" import dpkt import bgp # Multi-threaded Routing Toolkit # http://www.ietf.org/internet-drafts/draft-ietf-grow-mrt-03.txt # MRT Types NULL = 0 START = 1 DIE = 2 I_AM_DEAD = 3 PEER_DOWN = 4 BGP = 5 # Deprecated by BG...
denisff/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/docs/__init__.py
263
#!/usr/bin/python # # Copyright 2009 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 b...
davidzchen/tensorflow
refs/heads/master
tensorflow/python/estimator/canned/head.py
40
# 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...
potatolondon/django-nonrel-1-4
refs/heads/master
django/contrib/localflavor/ar/forms.py
87
# -*- coding: utf-8 -*- """ AR-specific Form helpers. """ from __future__ import absolute_import from django.contrib.localflavor.ar.ar_provinces import PROVINCE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, CharField, Selec...
nkgilley/home-assistant
refs/heads/dev
homeassistant/components/tesla/__init__.py
2
"""Support for Tesla cars.""" import asyncio from collections import defaultdict import logging from teslajsonpy import Controller as TeslaAPI, TeslaException import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( ATTR_BATTERY_CHARGING, ATTR_BATTERY_L...
mdanielwork/intellij-community
refs/heads/master
python/testData/quickFixes/PyAsyncCallQuickFixTest/addYieldFromBeforeCall_after.py
18
import asyncio @asyncio.coroutine def bar(): yield from asyncio.sleep(2) return "hey" @asyncio.coroutine def foo(): yield from bar() return True
ahaldane/numpy
refs/heads/master
numpy/distutils/fcompiler/ibm.py
8
from __future__ import division, absolute_import, print_function import os import re import sys import subprocess from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import find_executable from numpy.distutils.misc_util import make_temp_file from distutils import log compilers = ['IBMFC...
mattvenn/Arduino
refs/heads/esp8266
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/packages/ordered_dict.py
1093
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
xuxiao19910803/edx-platform
refs/heads/master
lms/djangoapps/django_comment_client/base/urls.py
102
from django.conf.urls.defaults import url, patterns urlpatterns = patterns( 'django_comment_client.base.views', url(r'upload$', 'upload', name='upload'), url(r'threads/(?P<thread_id>[\w\-]+)/update$', 'update_thread', name='update_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/reply$', 'create_comment...
BT-ojossen/odoo
refs/heads/8.0
addons/pos_discount/__openerp__.py
312
# -*- 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...
kevinmel2000/sl4a
refs/heads/master
python/src/Lib/test/crashers/infinite_loop_re.py
346
# This was taken from http://python.org/sf/1541697 # It's not technically a crasher. It may not even truly be infinite, # however, I haven't waited a long time to see the result. It takes # 100% of CPU while running this and should be fixed. import re starttag = re.compile(r'<[a-zA-Z][-_.:a-zA-Z0-9]*\s*(' r...
sagark123/coala
refs/heads/master
coalib/results/result_actions/PrintAspectAction.py
17
from coalib.results.Result import Result from coalib.results.result_actions.ResultAction import ResultAction from coala_utils.decorators import enforce_signature class PrintAspectAction(ResultAction): @staticmethod @enforce_signature def is_applicable(result: Result, original_file_dict, file_diff_dict):...
smira/aptly
refs/heads/master
system/t05_snapshot/__init__.py
3
""" Testing snapshot management """
ThinkboxSoftware/Deadline
refs/heads/master
Custom/events/SetJobLimit/SetJobLimit.py
1
############################################################### # Imports ############################################################### from Deadline.Events import * from Deadline.Scripting import * ############################################################### # This is the function called by Deadline t...
PLyczkowski/Sticky-Keymap
refs/heads/master
2.74/scripts/addons/add_mesh_BoltFactory/Boltfactory.py
3
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
hagifoo/gae-pomodoro
refs/heads/master
app/lib/requests/packages/urllib3/contrib/ntlmpool.py
714
# urllib3/contrib/ntlmpool.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
TridevGuha/django
refs/heads/master
tests/migrations/test_migrations_squashed_erroneous/1_auto.py
1155
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): operations = [ migrations.RunPython(migrations.RunPython.noop) ]
sotdjin/glibglab
refs/heads/master
venv/lib/python2.7/site-packages/jinja2/lexer.py
346
# -*- coding: utf-8 -*- """ jinja2.lexer ~~~~~~~~~~~~ This module implements a Jinja / Python combination lexer. The `Lexer` class provided by this module is used to do some preprocessing for Jinja. On the one hand it filters out invalid operators like the bitshift operators we don't allow...
hexlism/xx_net
refs/heads/master
python27/1.0/lib/darwin/gevent/greenlet.py
22
# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. import sys from gevent.hub import greenlet, getcurrent, get_hub, GreenletExit, Waiter, PY3, iwait, wait from gevent.timeout import Timeout from collections import deque __all__ = ['Greenlet', 'joinall', 'killall'] class Spawned...
qmarlats/pyquizz
refs/heads/master
env-3/lib/python3.5/site-packages/pygments/styles/algol.py
37
# -*- coding: utf-8 -*- """ pygments.styles.algol ~~~~~~~~~~~~~~~~~~~~~ Algol publication style. This style renders source code for publication of algorithms in scientific papers and academic texts, where its format is frequently used. It is based on the style of the revised Algol-60 language...
Innovahn/odoo.old
refs/heads/master
addons/product_visible_discount/product_visible_discount.py
28
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
KohlsTechnology/ansible
refs/heads/devel
lib/ansible/modules/utilities/logic/include_role.py
3
#!/usr/bin/python # -*- coding: utf-8 -*- # 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': [...
dyoung418/tensorflow
refs/heads/master
tensorflow/compiler/tests/conv2d_test.py
35
# 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...
rdmorganiser/rdmo
refs/heads/master
rdmo/conditions/migrations/0020_require_uri_prefix.py
1
# Generated by Django 2.2.6 on 2019-10-29 12:08 from django.conf import settings from django.db import migrations, models def run_data_migration(apps, schema_editor): for element in apps.get_model('conditions', 'Condition').objects.all(): element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PR...
salomon1184/bite-project
refs/heads/master
deps/mrtaskman/server/handlers/events.py
16
# 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 th...
jlegendary/youtube-dl
refs/heads/master
youtube_dl/extractor/netzkino.py
142
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( clean_html, int_or_none, js_to_json, parse_iso8601, ) class NetzkinoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?netzkino\.de/\#!/(?P<category>[^/]+)/(?P<id>[^/]+)' ...
CiscoSystems/nova
refs/heads/master
nova/virt/hyperv/vmutils.py
8
# Copyright (c) 2010 Cloud.com, Inc # Copyright 2012 Cloudbase Solutions Srl / Pedro Navarro Perez # 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 # # ...
Nowheresly/odoo
refs/heads/8.0
openerp/tools/test_reports.py
337
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
samuelcolvin/django-watson
refs/heads/master
src/watson/management/commands/installwatson.py
5
"""Creates the database indices needed by django-watson.""" from __future__ import unicode_literals from django.core.management.base import NoArgsCommand from watson.registration import get_backend class Command(NoArgsCommand): help = "Creates the database indices needed by django-watson." def handle...