repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
petablox-project/petablox
refs/heads/master
scripts/convert.py
1
#!/usr/bin/env python from __future__ import print_function import sys import re import datetime from collections import OrderedDict import argparse def convert(dlog_path, logic_path=None, verbose=0): v = verbose >= 1; vv = verbose >= 2 if logic_path is None: logic_path = re.sub(r'\.dlog$', '.logic', ...
exequielrafaela/proton
refs/heads/master
modules/users_fab.py
1
# Import Fabric's API module# from fabric.api import sudo, settings, env from fabric.decorators import task from termcolor import colored @task def add_centos_sudo(usernamec): """ Add a user in RedHat/Centos based OS in wheel group (sudo) :param usernamec: "username" to add """ with settings(warn_only...
maxive/erp
refs/heads/master
addons/sale_stock/tests/test_sale_stock_lead_time.py
13
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import timedelta from odoo import fields from odoo.addons.stock.tests.common2 import TestStockCommon class TestSaleStockLeadTime(TestStockCommon): def setUp(self): super(TestSaleStockLeadTim...
smmribeiro/intellij-community
refs/heads/master
python/helpers/py3only/docutils/languages/sk.py
52
# $Id: sk.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Miroslav Vasko <zemiak@zoznam.sk> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated ...
aliyun/oss-ftp
refs/heads/master
python27/win32/tcl/tix8.4.3/pref/WmDefault.py
13
# -*- mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id: WmDefault.py,v 1.2 2001/12/09 05:03:09 idiscovery Exp $ # """One of the bad things about Tk/Tkinter is that it does not pick up the current color and font scheme from the prevailing CDE/KDE/GNOME/Windows window manager s...
tricoin/tricoin
refs/heads/master
contrib/testgen/base58.py
2139
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
shingonoide/odoo
refs/heads/deverp_8.0
addons/point_of_sale/__openerp__.py
261
# -*- 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...
kawamon/hue
refs/heads/master
desktop/core/ext-py/celery-4.2.1/celery/backends/rpc.py
2
# -*- coding: utf-8 -*- """The ``RPC`` result backend for AMQP brokers. RPC-style result backend, using reply-to and one queue per client. """ from __future__ import absolute_import, unicode_literals import time import kombu from kombu.common import maybe_declare from kombu.utils.compat import register_after_fork fr...
ppanczyk/ansible
refs/heads/devel
lib/ansible/modules/network/illumos/dladm_iptun.py
29
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
curryudon08/aoj
refs/heads/master
Lesson/ALDS1/ALDS1_1_D.py
2
""" 最大の利益 """ import sys def main(): n = int(sys.stdin.readline()) r = [int(sys.stdin.readline()) for _ in xrange(n)] m = r[0] result = -(10 ** 9) for i in xrange(1, n): m = min(m, r[i - 1]) d = r[i] - m if d > result: result = d print result if __name__ =...
regular/pyglet-avbin-optimizations
refs/heads/avbin-speedups
tools/epydoc/epydoc/docwriter/html_css.py
8
# # epydoc.css: default epydoc CSS stylesheets # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: html_css.py 1517 2007-02-16 06:13:56Z edloper $ # """ Predefined CSS stylesheets for the HTML outputter (L{epydoc.docwriter.html}). @type STYLESHEETS: C{dictionary} from C{string} to C{(string, string)} @var STYLESHEE...
minhphung171093/GreenERP
refs/heads/master
openerp/addons/payment_paypal/tests/__init__.py
67
# -*- coding: utf-8 -*- import test_paypal
ridfrustum/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/views/decorators/http.py
63
""" Decorators for views based on HTTP headers. """ try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from calendar import timegm from datetime import timedelta from email.Utils import formatdate from django.utils.decorators import decorato...
neiudemo1/django
refs/heads/master
tests/wsgi/urls.py
368
from django.conf.urls import url from django.http import FileResponse, HttpResponse def helloworld(request): return HttpResponse("Hello World!") urlpatterns = [ url("^$", helloworld), url(r'^file/$', lambda x: FileResponse(open(__file__, 'rb'))), ]
stephaneAG/PengPod700
refs/heads/master
QtEsrc/backup_qt/qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/MSVSProject.py
13
#!/usr/bin/python2.4 # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio project reader/writer.""" import common import xml.dom import xml_fix #---------------------------------------------------...
edevil/django
refs/heads/master
tests/admin_autodiscover/tests.py
526
from unittest import TestCase from django.contrib import admin class AdminAutoDiscoverTests(TestCase): """ Test for bug #8245 - don't raise an AlreadyRegistered exception when using autodiscover() and an admin.py module contains an error. """ def test_double_call_autodiscover(self): # The...
aduric/crossfit
refs/heads/master
nonrel/django/contrib/admin/filterspecs.py
148
""" FilterSpec encapsulates the logic for displaying filters in the Django admin. Filters are specified in models with the "list_filter" option. Each filter subclass knows how to display a filter for a field that passes a certain test -- e.g. being a DateField or ForeignKey. """ from django.db import models from djan...
apurvbhartia/gnuradio-routing
refs/heads/master
volk/gen/make_typedefs.py
7
from xml.dom import minidom import string from volk_regexp import * def make_typedefs(funclist, retlist, my_argtypelist) : tempstring = ""; tempstring = tempstring + '/*this file is auto generated by volk_register.py*/'; tempstring = tempstring + '/*this file is auto generated by volk_register.py*/'; ...
rspavel/spack
refs/heads/develop
var/spack/repos/builtin/packages/metaphysicl/package.py
5
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Metaphysicl(AutotoolsPackage): """Metaprogramming and operator-overloaded classes for ...
joelddiaz/openshift-tools
refs/heads/prod
openshift/installer/vendored/openshift-ansible-3.7.52-1/roles/lib_openshift/src/ansible/oc_scale.py
86
# pylint: skip-file # flake8: noqa def main(): ''' ansible oc module for scaling ''' module = AnsibleModule( argument_spec=dict( kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), state=dict(default='present', type='str', choices=['present', 'li...
Xeralux/tensorflow
refs/heads/master
tensorflow/python/keras/_impl/keras/preprocessing/image.py
4
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
openstack/vitrage
refs/heads/master
vitrage/evaluator/template_loading/equivalence_loader.py
1
# Copyright 2017 - ZTE Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
ViralLeadership/numpy
refs/heads/master
numpy/random/tests/test_regression.py
78
from __future__ import division, absolute_import, print_function import sys from numpy.testing import (TestCase, run_module_suite, assert_, assert_array_equal, assert_raises) from numpy import random from numpy.compat import long import numpy as np class TestRegression(TestCase): def ...
MounirMesselmeni/django
refs/heads/master
django/core/signals.py
684
from django.dispatch import Signal request_started = Signal(providing_args=["environ"]) request_finished = Signal() got_request_exception = Signal(providing_args=["request"]) setting_changed = Signal(providing_args=["setting", "value", "enter"])
novafloss/django-pimpmytheme
refs/heads/master
pimpmytheme/management/commands/create_folders.py
2
from django.core.management import call_command from django.core.management.base import BaseCommand from pimpmytheme.folder_management import create_folders from pimpmytheme.utils import get_lookup_class class Command(BaseCommand): def handle(self, *args, **options): objects = get_lookup_class().objects....
FlorianLudwig/odoo
refs/heads/8.0
openerp/workflow/service.py
378
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of...
kaichanvong/Python-Koans
refs/heads/master
python 2/runner/sensei.py
15
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import re import glob import helper from mockable_test_result import MockableTestResult from runner import path_to_enlightenment from libs.colorama import init, Fore, Style init() # init colorama class Sensei(MockableTestResult): def __init__(self, s...
gradel/mezzanine
refs/heads/master
mezzanine/core/apps.py
12
from __future__ import unicode_literals from django import VERSION as DJANGO_VERSION from django.apps import AppConfig from django.core.checks import register from .checks import check_template_settings class CoreConfig(AppConfig): name = 'mezzanine.core' def ready(self): register()(check_template...
pombredanne/https-git.fedorahosted.org-git-kobo
refs/heads/master
kobo/django/upload/urls.py
1
# -*- coding: utf-8 -*- from django.conf.urls.defaults import * urlpatterns = patterns("", url(r"^$", "kobo.django.upload.views.file_upload"), )
tgroh/beam
refs/heads/master
sdks/python/apache_beam/examples/complete/game/hourly_team_score_test.py
18
# # 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...
Vudentz/zephyr
refs/heads/master
boards/xtensa/intel_adsp_cavs15/tools/lib/registers.py
6
#!/usr/bin/env python3 # # Copyright (c) 2019 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # Registers ###################################### # High Definition Audio Memory Space # ###################################### # HDA Register Blocks HDA_GR_BASE = 0x0000 # HDA Global Register Block HDA_SD_B...
uberamd/NGECore2
refs/heads/master
scripts/object/ship/rebel_shuttle_tier1.py
85615
import sys def setup(core, object): return
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/loot/creature_loot/collections/meatlump_lint_08.py
85615
import sys def setup(core, object): return
chemelnucfin/tensorflow
refs/heads/master
tensorflow/contrib/compiler/xla.py
3
# 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...
bakhtout/odoo-educ
refs/heads/8.0
openerp/modules/db.py
442
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
kisel/trex-core
refs/heads/master
scripts/external_libs/nose-1.3.4/python3/nose/plugins/xunit.py
5
"""This plugin provides test results in the standard XUnit XML format. It's designed for the `Jenkins`_ (previously Hudson) continuous build system, but will probably work for anything else that understands an XUnit-formatted XML representation of test results. Add this shell command to your builder :: nosetests...
piotrmaslanka/satella
refs/heads/develop
satella/instrumentation/cpu_time/collector.py
1
import typing as tp import threading import multiprocessing import time import psutil from satella.coding import for_argument from satella.coding.structures import Singleton from satella.coding.transforms import percentile from satella.time import parse_time_string DEFAULT_REFRESH_EACH = '30m' DEFAULT_WINDOW_SECONDS...
ryfeus/lambda-packs
refs/heads/master
Keras_tensorflow_nightly/source2.7/google/protobuf/unittest_no_arena_pb2.py
2
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_no_arena.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.pro...
ykaneko/neutron
refs/heads/bug/1198917
neutron/plugins/nicira/common/config.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nicira, 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 # # ...
kalikaneko/bitmask-dev
refs/heads/master
tests/integration/mail/test_walk.py
2
""" Tests for leap.mail.walk module """ import os.path from email.parser import Parser from leap.bitmask.mail import walk CORPUS = { 'simple': 'rfc822.message', 'multimin': 'rfc822.multi-minimal.message', 'multisigned': 'rfc822.multi-signed.message', 'bounced': 'rfc822.bounce.message', } _here = os.p...
Philippe-Lawrence/pyBar
refs/heads/master
test-pyBar/test3.py
1
#!/usr/bin/env python # example treeviewdnd.py from gi.repository import Gtk, Gdk, Pango, GObject class TreeViewDnDExample: TARGETS = [ ('MY_TREE_MODEL_ROW', Gtk.TargetFlags.SAME_WIDGET, 0), ('text/plain', 0, 1), ('TEXT', 0, 2), ('STRING', 0, 3), ] # close the window ...
yongshengwang/builthue
refs/heads/master
desktop/core/ext-py/python-openid-2.2.5/openid/sreg.py
185
"""moved to L{openid.extensions.sreg}""" import warnings warnings.warn("openid.sreg has moved to openid.extensions.sreg", DeprecationWarning) from openid.extensions.sreg import *
ZdenekM/ar-table-itable
refs/heads/master
art_instructions/src/art_instructions/brain/dummy.py
6
from art_instructions.brain import BrainFSM, BrainInstruction from transitions import State import rospy class DummyFSM(BrainFSM): states = [ State(name='dummy', on_enter=[ 'state_update_program_item', 'state_dummy']), State(name='learning_dummy', on_enter=[ 'learning_load_...
mbrenig/SheetSync
refs/heads/master
sheetsync/version.py
1
# Single place version should be set. __version__ = '0.2.3'
bhargav2408/python-for-android
refs/heads/master
python-build/python-libs/ase/tests/bluetooth/device.py
86
import android import sys import threading import time droid = android.Android() droid.toggleBluetoothState(True) droid.bluetoothMakeDiscoverable() print 'Connecting...' result = droid.bluetoothAccept() if result.error is not None: print 'Connection failed!' time.sleep(1) sys.exit(1) def receiver(): while Tr...
Danceiny/HackGirlfriend
refs/heads/master
Spider/WeiboSpider/tasks/search.py
1
# coding:utf-8 from urllib import parse as url_parse from logger.log import crawler from tasks.workers import app from page_get.basic import get_page from config.conf import get_max_search_page from page_parse import search as parse_search from db.search_words import get_search_keywords from db.keywords_wbdata import i...
ProjectQ-Framework/ProjectQ
refs/heads/develop
examples/ibm.py
1
# -*- coding: utf-8 -*- # pylint: skip-file import matplotlib.pyplot as plt import getpass from projectq import MainEngine from projectq.backends import IBMBackend from projectq.libs.hist import histogram from projectq.ops import Measure, Entangle, All import projectq.setups.ibm def run_entangle(eng, num_qubits=3):...
tuanavu/python-cookbook-3rd
refs/heads/master
src/15/wrapping_existing_c_code_with_cython/example.py
5
import sample print(sample.gcd(42, 8)) print(sample.divide(42, 8)) p1 = sample.Point(2, 3) p2 = sample.Point(4, 5) print(p1) print(p2) print(sample.distance(p1, p2)) import array a = array.array('d', [1, 2, 3]) print(sample.avg(a))
GdZ/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_4/django/conf/urls/shortcut.py
205
from django.conf.urls import patterns urlpatterns = patterns('django.views', (r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'), )
tamlok/qemu
refs/heads/q35-iommu-v8
scripts/tracetool/format/d.py
69
#!/usr/bin/env python # -*- coding: utf-8 -*- """ trace/generated-tracers.dtrace (DTrace only). """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer_...
flyfei/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/tlslite/X509.py
279
"""Class representing an X.509 certificate.""" from utils.ASN1Parser import ASN1Parser from utils.cryptomath import * from utils.keyfactory import _createPublicRSAKey class X509: """This class represents an X.509 certificate. @type bytes: L{array.array} of unsigned bytes @ivar bytes: The DER-encoded ASN...
OpenDroneMap/OpenDroneMap
refs/heads/master
snap/local/usr/lib/python3.8/sitecustomize.py
1
import site import os snap_dir = os.getenv("SNAP") snapcraft_stage_dir = os.getenv("SNAPCRAFT_STAGE") snapcraft_part_install = os.getenv("SNAPCRAFT_PART_INSTALL") # Do not include snap_dir during builds as this will include # snapcraft's in-snap site directory. if snapcraft_stage_dir is not None and snapcraft_part_in...
colloquium/spacewalk
refs/heads/master
client/solaris/smartpm/sandbox/qtprogress.py
1
#!/usr/bin/python from smart.progress import Progress from qt import * import sys, os, time class QtProgressSubItem(QListViewItem): def __init__(self, listview, index): self.index = index self.progresspm = None self.subtopic = "" QListViewItem.__init__(self, listview) s...
marcsans/cnn-physics-perception
refs/heads/master
phy/lib/python2.7/site-packages/pip/utils/logging.py
516
from __future__ import absolute_import import contextlib import logging import logging.handlers import os try: import threading except ImportError: import dummy_threading as threading from pip.compat import WINDOWS from pip.utils import ensure_dir try: from pip._vendor import colorama # Lots of differen...
quarnster/boxeebox-xbmc
refs/heads/master
addons/service.xbmc.versioncheck/lib/common.py
7
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Team-XBMC # # 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 versio...
guschmue/tensorflow
refs/heads/master
tensorflow/contrib/estimator/python/estimator/logit_fns_test.py
40
# 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...
netjunki/pyresttest
refs/heads/master
pyresttest/contenthandling.py
3
import os import sys from . import parsing from .parsing import * # Python 2/3 switches PYTHON_MAJOR_VERSION = sys.version_info[0] if PYTHON_MAJOR_VERSION > 2: from past.builtins import basestring """ Encapsulates contend handling logic, for pulling file content into tests """ class ContentHandler: """ Ha...
knowmetools/km-api
refs/heads/master
km_api/account/admin.py
1
"""Admin configuration for the ``account`` module. """ from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from account import models @admin.register(models.User) class UserAdmin(admin.ModelAdmin): """ Admin for the ``User`` model. """ fieldsets = ( (_("...
UIKit0/friture
refs/heads/master
scripts/gprof2dot.py
2
#!/usr/bin/env python # # Copyright 2008-2009 Jose Fonseca # # 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 of the License, or # (at your option) any later version. # # ...
ns950/calibre
refs/heads/master
src/calibre/gui2/tweak_book/editor/smarts/css.py
14
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import re from PyQt5.Qt import Qt from calibre.gui2.tweak_book import curr...
rdowinton/scrapy
refs/heads/master
tests/test_urlparse_monkeypatches.py
155
from six.moves.urllib.parse import urlparse import unittest class UrlparseTestCase(unittest.TestCase): def test_s3_url(self): p = urlparse('s3://bucket/key/name?param=value') self.assertEquals(p.scheme, 's3') self.assertEquals(p.hostname, 'bucket') self.assertEquals(p.path, '/key/...
sertac/django
refs/heads/master
tests/introspection/tests.py
207
from __future__ import unicode_literals from unittest import skipUnless from django.db import connection from django.db.utils import DatabaseError from django.test import TransactionTestCase, mock, skipUnlessDBFeature from .models import Article, Reporter class IntrospectionTests(TransactionTestCase): availab...
ITPS/odoo-saas-tools
refs/heads/8.0
saas_sysadmin_backup_agent/__openerp__.py
4
{ 'name': 'SaaS Sysadmin Backup Agent', 'version': '1.0.0', 'author': 'Salton Massally<smassally@idtlabs.sl>', 'category': 'SaaS', 'website': 'http://idtlabs.sl', 'depends': ['saas_server'], 'installable': True, }
darktears/chromium-crosswalk
refs/heads/master
third_party/protobuf/python/google/protobuf/internal/message_factory_test.py
213
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
uberamd/NGECore2
refs/heads/master
scripts/object/mobile/dressed_story_loot_bestine.py
85615
import sys def setup(core, object): return
tipsi/tipsi_tools
refs/heads/master
django_tests/sampleproj/settings.py
1
""" Django settings for sampleproj project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os...
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
refs/heads/master
flask/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2cffi.py
55
# testing/engines.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: postgresql+psycopg2cffi :name: psycopg2cffi :dbapi: psyco...
mikeckennedy/python-for-entrepreneurs-course-demos
refs/heads/master
15-deployment/blue_yellow_app_deployment/blue_yellow_app/infrastructure/static_cache.py
16
""" Use this cache utility to compute the hash of files server as static resources on your website. As written, it must be in your '/' home folder, but you can adjust the computation of *fullname* to allow you to put it in subfolders. Set recompute_caches_every_request based on use case / deployment: recompute_ca...
mathspace/python-social-auth
refs/heads/master
social/backends/lastfm.py
70
import hashlib from social.utils import handle_http_errors from social.backends.base import BaseAuth class LastFmAuth(BaseAuth): """ Last.Fm authentication backend. Requires two settings: SOCIAL_AUTH_LASTFM_KEY SOCIAL_AUTH_LASTFM_SECRET Don't forget to set the Last.fm callback to somethi...
perfectfoolish/learn-python-the-hard-way-notes
refs/heads/master
ex12.py
2
age = raw_input("How old are you?") height = raw_input("How tall are you?") weight = raw_input("How much do you weigh?") print "So, you're %r old, %r tall and %r heavy." % (age, height, weight)
philippeowagner/xhtml2pdf
refs/heads/master
ez_setup.py
92
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
yigitguler/django
refs/heads/master
tests/migrations/test_migrations_squashed/0002_second.py
294
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("migrations", "0001_initial")] operations = [ migrations.DeleteModel("Tribble"), migrations.RemoveField("Author", "silly_field")...
araseyuta/Newsstand-analytics
refs/heads/master
appengine_django/auth/tests.py
64
# Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
wainersm/buildbot
refs/heads/master
master/buildbot/worker_transition.py
11
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
schatt/lightwave
refs/heads/master
vmca/tools/certificate-manager/certificateManagerUtils.py
5
#!/usr/bin/env python # Copyright 2015 VMware, Inc. All rights reserved. -- VMware Confidential """ Utility functions to support certificate-manager """ __author__ = 'Charudath Gopal (cgopal@vmware.com)' __copyright__ = 'Copyright 2015, VMware Inc.' __version__ = 1.0 import logging import os import sys import errno...
ibinti/intellij-community
refs/heads/master
python/testData/refactoring/introduceVariable/py995.after.py
83
class ConferenceTest(TestCase): def testSimple(self): a = Conference() c = a
aminmarashi/onezero-f2f
refs/heads/master
requests/packages/chardet/big5freq.py
3132
######################## 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...
zhujianjie1989/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
refs/heads/master
Chapter2_MorePyMC/separation_plot.py
86
# separation plot # Author: Cameron Davidson-Pilon,2013 # see http://mdwardlab.com/sites/default/files/GreenhillWardSacks.pdf import matplotlib.pyplot as plt import numpy as np def separation_plot( p, y, **kwargs ): """ This function creates a separation plot for logistic and probit classification. Se...
zengenti/ansible
refs/heads/devel
test/units/parsing/yaml/test_dumper.py
88
# coding: utf-8 # 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 i...
drcapulet/sentry
refs/heads/master
src/sentry/web/forms/add_project.py
13
from __future__ import absolute_import from django import forms from django.utils.translation import ugettext_lazy as _ from sentry.models import AuditLogEntry, AuditLogEntryEvent, Project from sentry.utils.samples import create_sample_event BLANK_CHOICE = [("", "")] class AddProjectForm(forms.ModelForm): nam...
MGXRace/website
refs/heads/master
racesow/tests.py
1
""" simple testcases, should be expanded for testing services.py Usage (debian) from the /website directory: python manage.py test racesow """ import sys import traceback from django.test import TestCase from .models import ( Map, Player, Race) from racesow.utils import millis_to_str, username_with_h...
kuiwei/kuiwei
refs/heads/master
lms/djangoapps/staticbook/models.py
4209
# Create your models here.
msebire/intellij-community
refs/heads/master
python/testData/inspections/PyTypeCheckerInspection/StructuralTypesForNestedCalls.py
79
def f(x): return x.foo + g(x) def g(x): return x.bar def test(): f(<warning descr="Type 'str' doesn't have expected attributes 'foo', 'bar'">'string'</warning>)
DutchDanny/kernel_kk443_sense_m8ace
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. ...
sienatime/python_koans
refs/heads/master
python3/koans/jims.py
145
#!/usr/bin/env python # -*- coding: utf-8 -*- class Dog: def identify(self): return "jims dog"
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/lair/corellian_slice_hound/lair_corellian_slice_hound.py
85615
import sys def setup(core, object): return
SU-ECE-17-7/ibeis
refs/heads/next
setup.py
1
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import six from utool import util_setup import setuptools setman = util_setup.SetupManager() CHMOD_PATTERNS = [ 'run_tests.sh', 'test_*.py', 'ingest_*.py', ] # python -m utool.util_dev --ex...
flavour/eden
refs/heads/master
modules/templates/historic/DRK/menus.py
5
# -*- coding: utf-8 -*- from gluon import current from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default # ============================================================================= class S3MainMenu(default.S3MainMenu): """ Custom Applica...
wpic/flask-appointment-calendar
refs/heads/master
fbone/appointment/__init__.py
1
# -*- coding: utf-8 -*- from .models import Appointment # NOQA from .views import appointment # NOQA
mohamed--abdel-maksoud/chromium.src
refs/heads/nw12
tools/telemetry/telemetry/util/__init__.py
36
# 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. """A library for bootstrapping Telemetry preformance testing."""
MjAbuz/graphviz
refs/heads/master
config/config_python.py
16
import sys from distutils import sysconfig if sys.argv[1] == "archlib": print sysconfig.get_python_lib(1,1) elif sys.argv[1] == "lib": print sysconfig.get_python_lib(0,1) elif sys.argv[1] == "archsitelib": print sysconfig.get_python_lib(1,0) elif sys.argv[1] == "sitelib": print sysconfig.get_python_lib...
jesramirez/odoo
refs/heads/8.0
addons/hr/__openerp__.py
260
# -*- 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...
erikdejonge/youtube-dl
refs/heads/master
youtube_dl/extractor/konserthusetplay.py
23
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( determine_ext, float_or_none, int_or_none, url_or_none, ) class KonserthusetPlayIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:konserthusetplay|rspoplay)\.se/\?.*\bm=(?P<id>[^&...
MathiasGarnier/Python-Test
refs/heads/master
Bank/Main.py
1
from Client import Client, ClientAccount, link import random def f(): i = random.randint(0, 1001) if i % 2 == 0: return 100 else: return -100 first = Client(12) second = Client(211) account0 = ClientAccount() account1 = ClientAccount() Russ = link(first, account0) Will...
jittat/adm2
refs/heads/master
scripts/send_email_by_nat_id.py
1
# -*- coding: utf-8 -*- from django.conf import settings from django_bootstrap import bootstrap bootstrap(__file__) import time from application.models import Applicant, PersonalInfo from commons.email import adm_send_mail def main(): print 'Sending mails...' while True: try: nat_id = ra...
vlachoudis/sl4a
refs/heads/master
python/gdata/src/gdata/Crypto/Util/RFC1751.py
228
#!/usr/local/bin/python # rfc1751.py : Converts between 128-bit strings and a human-readable # sequence of words, as defined in RFC1751: "A Convention for # Human-Readable 128-bit Keys", by Daniel L. McDonald. __revision__ = "$Id: RFC1751.py,v 1.6 2003/04/04 15:15:10 akuchling Exp $" import string, binascii binary=...
camilonova/django
refs/heads/master
tests/schema/fields.py
33
from django.db import models from django.db.models.fields.related import ( RECURSIVE_RELATIONSHIP_CONSTANT, ManyToManyDescriptor, ManyToManyField, ManyToManyRel, RelatedField, create_many_to_many_intermediary_model, ) from django.utils.functional import curry class CustomManyToManyField(RelatedField): """...
jimberlage/servo
refs/heads/master
python/servo/command_base.py
2
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
tejo-esperanto/pasportaservo
refs/heads/master
shop/migrations/0001_initial.py
4
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-16 14:43 from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields def create_product(apps, schema_ed...
FCP-INDI/nipype
refs/heads/master
nipype/caching/__init__.py
10
from .memory import Memory