repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
EssaAlshammri/django-by-example | refs/heads/master | online-shop/myshop/coupons/views.py | 1 | from django.shortcuts import redirect, render
from django.utils import timezone
from django.views.decorators.http import require_POST
from .forms import CouponApplayForm
from .models import Coupon
@require_POST
def coupon_apply(request):
now = timezone.now()
form = CouponApplayForm(request.POST)
if form.... |
javierTerry/odoo | refs/heads/8.0 | addons/account/wizard/__init__.py | 362 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
kaiyou/docker-py | refs/heads/master | docker/tls.py | 12 | import os
import ssl
from . import errors
from .transport import SSLAdapter
class TLSConfig(object):
"""
TLS configuration.
Args:
client_cert (tuple of str): Path to client cert, path to client key.
ca_cert (str): Path to CA cert file.
verify (bool or str): This can be ``False`` ... |
musicpax/funcy | refs/heads/master | tests/test_funcs.py | 2 | from operator import __add__, __sub__
import pytest
from whatever import _
from funcy.cross import map
from funcy.funcs import *
def test_caller():
assert caller([1, 2])(sum) == 3
def test_constantly():
assert constantly(42)() == 42
assert constantly(42)('hi', 'there', volume='shout') == 42
def test_pa... |
MassStash/htc_m8_kernel_sense_5.0.1 | refs/heads/master | tools/perf/util/setup.py | 4998 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
OmarIthawi/edx-platform | refs/heads/master | common/djangoapps/embargo/admin.py | 55 | """
Django admin page for embargo models
"""
from django.contrib import admin
import textwrap
from config_models.admin import ConfigurationModelAdmin
from embargo.models import EmbargoedCourse, EmbargoedState, IPFilter
from embargo.forms import EmbargoedCourseForm, EmbargoedStateForm, IPFilterForm
class EmbargoedCou... |
leonjq/108 | refs/heads/master | Fileserver/manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fileserver.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
signed/intellij-community | refs/heads/master | python/testData/quickFixes/PyRenameElementQuickFixTest/renameAwaitVariableInPy36.py | 26 | <warning descr="'async' and 'await' are not recommended to be used as variable, class, function or module names. They will become proper keywords in Python 3.7.">await</warning> = 1 |
zubair-arbi/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_comp_theming.py | 10 | """Tests of comprehensive theming."""
import unittest
from django.conf import settings
from django.test import TestCase
from path import path # pylint: disable=no-name-in-module
from django.contrib import staticfiles
from openedx.core.djangoapps.theming.test_util import with_comp_theme
from openedx.core.li... |
olivierdalang/QGIS | refs/heads/master | python/plugins/processing/core/outputs.py | 16 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Output.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************************... |
modulexcite/PTVS | refs/heads/master | Python/Product/PythonTools/Templates/Projects/WebProjectBottle/app.py | 36 | """
This script runs the application using a development server.
It contains the definition of routes and views for the application.
"""
import os
import sys
from bottle import default_app, redirect, route, template
if '--debug' in sys.argv[1:] or 'SERVER_DEBUG' in os.environ:
# Debug mode will enable m... |
Osmose/mnotes | refs/heads/master | mnotes/base/context_processors.py | 1 | from django.conf import settings
def django_compressor_processor(request):
"""Adds settings from django_compressor."""
return {'COMPRESS_URL': settings.COMPRESS_URL}
|
facebookresearch/Detectron | refs/heads/master | detectron/roi_data/retinanet.py | 1 | # Copyright (c) 2017-present, Facebook, 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... |
krez13/scikit-learn | refs/heads/master | sklearn/linear_model/setup.py | 146 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linear_model', parent_package, top_path)
cblas_libs, blas_info = get_blas_info... |
CALlanoR/VirtShell | refs/heads/master | virtshell_agents/virtshell_provisioning_agent/virtshell_provisioning_agent/logger.py | 6 | import logging
import logging.handlers
from config import LOGGER
from config import LOG_FILE
def get_logger(LoggerName):
# Create logger
logger = logging.getLogger(LoggerName)
logger.setLevel(logging.INFO)
# Create handler
if LOGGER == "file":
handler = logging.FileHandler(LOG_FILE)
... |
40423237/2017springcd_hw | refs/heads/gh-pages | localhttp.py | 15 | import os
import subprocess
import threading
import http.server, ssl
def domake():
# build directory
#os.chdir("./../")
server_address = ('localhost', 7443)
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,
... |
shrimpboyho/git.js | refs/heads/master | emscript/python/2.7.5.1_32bit/Lib/test/test_queue.py | 84 | # Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
import Queue
import time
import unittest
from test import test_support
threading = test_support.import_module('threading')
QUEUE_SIZE = 5
# A thread to run a function that unclogs a blocked Queue.
class _TriggerT... |
allotria/intellij-community | refs/heads/master | python/testData/addImport/comment.after.py | 30 | from urllib import urlopen, urlencode, unquote_plus # this is a comment
|
leekchan/djangae | refs/heads/master | djangae/contrib/security/management/commands/dumpurls.py | 15 | import inspect
import functools
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.admindocs.views import simplify_regex
from djangae.contrib.security.commands_utils import (
extract_views_from_urlpatterns,
dis... |
prashantgo/Python-Scripts | refs/heads/master | bin/mi-community-bot.py | 2 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from s... |
AnnikaH/IncludeOS | refs/heads/master | test/hw/integration/serial/test.py | 4 | #!/usr/bin/env python3
from __future__ import print_function
import sys
import os
includeos_src = os.environ.get('INCLUDEOS_SRC',
os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))).split('/test')[0])
sys.path.insert(0,includeos_src)
from subprocess import call
from... |
noroutine/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_gtm_virtual_server.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# Copyright (c) 2015 Michael Perzel
# 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 = {'... |
dieface/erpnext | refs/heads/develop | erpnext/setup/doctype/sms_parameter/__init__.py | 37694 | from __future__ import unicode_literals
|
CopeX/odoo | refs/heads/8.0 | addons/account/wizard/account_automatic_reconcile.py | 340 | # -*- 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... |
mxOBS/wiringX | refs/heads/debian | python/examples/interrupt.py | 3 | #!/usr/bin/env python
#
# Copyright (c) 2016 CurlyMo <curlymoo1@gmail.com>
#
# 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 os
import sys
from time import ... |
ellipsis14/dolfin | refs/heads/master | test/unit/common/cpp/test_cpp_common.py | 2 | #!/usr/bin/env py.test
from dolfin_utils.test import cpp_tester
test_cpp_common = cpp_tester
|
bhgomes/spykeball | refs/heads/master | spykeball/model.py | 1 | """Statistics Modeling Module."""
__all__ = ['StatModel', 'DefaultStatModel']
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from . import io
from . import util
from .io import JSONKeyError
from .player import PlayerException
from .touch import TouchException
from .touch import Defense... |
avneesh91/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... |
backupchecker/backupchecker | refs/heads/master | backupchecker/checkbackups/checkzip.py | 1 | # -*- coding: utf-8 -*-
# Copyright © 2015-2017 Carl Chenet <chaica@backupcheckerproject.org>
# 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
# any later vers... |
bodi000/odoo | refs/heads/master | addons/email_template/wizard/__init__.py | 446 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... |
wnoc-drexel/gem5-stable | refs/heads/master | src/arch/x86/isa/insts/general_purpose/control_transfer/xreturn.py | 69 | # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... |
petricm/DIRAC | refs/heads/integration | Core/Utilities/File.py | 4 | """Collection of DIRAC useful file related modules.
.. warning::
By default on Error they return None.
"""
from __future__ import print_function
__RCSID__ = "$Id$"
import os
import hashlib
import random
import glob
import sys
import re
import errno
# Translation table of a given unit to Bytes
# I know, it should... |
ol-loginov/intellij-community | refs/heads/master | python/testData/quickFixes/PyMoveExceptQuickFixTest/simple_after.py | 80 |
def foo():
pass
try:
foo()
except UnboundLocalError:
pass
except NameError:
pass
|
dentaku65/pelisalacarta | refs/heads/master | python/version-plex/__init__.py | 2 | import re, datetime
# Passing log and config to an external library
# Credits to https://gist.github.com/mikew/5011984
import bridge
bridge.init(Log,Prefs,Locale)
import channelselector
from core.item import Item
###################################################################################################
PLU... |
mozilla/addons-server | refs/heads/master | src/olympia/addons/tests/test_models.py | 1 | # -*- coding: utf-8 -*-
import json
import os
from datetime import datetime, timedelta
from unittest.mock import Mock, patch
import pytest
from django import forms
from django.conf import settings
from django.core import mail
from django.utils import translation
from olympia import amo, core
from olympia.activity.mode... |
erickt/hue | refs/heads/master | desktop/core/ext-py/tablib-develop/tablib/packages/openpyxl/namedrange.py | 116 | # file openpyxl/namedrange.py
# Copyright (c) 2010 openpyxl
#
# 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, mod... |
sachinkum/Bal-Aveksha | refs/heads/master | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/rest_framework/viewsets.py | 11 | """
ViewSets are essentially just a type of class based view, that doesn't provide
any method handlers, such as `get()`, `post()`, etc... but instead has actions,
such as `list()`, `retrieve()`, `create()`, etc...
Actions are only bound to methods at the point of instantiating the views.
user_list = UserViewSet.a... |
thundernet8/WRGameVideos-API | refs/heads/master | venv/lib/python2.7/site-packages/dominate/dom_tag.py | 9 | __license__ = '''
This file is part of Dominate.
Dominate 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.
Dominate is distributed in... |
Asalle/coala | refs/heads/master | tests/test_bears/TestBear.py | 23 | from coalib.bears.LocalBear import LocalBear
class TestBear(LocalBear):
def run(self, filename, file, result=False, exception: bool = False):
if result is True:
if file:
for line in file:
yield line
yield True
elif result is not False:
... |
shazadan/monstera | refs/heads/master | monstera/__init__.py | 1 | import matplotlib.pyplot as plt
import numpy as np
def draw_confusion_matrix(cm, target, title='Confusion matrix', cmap=plt.cm.Blues):
"""
"""
plt.imshow(cm, interpolation='nearest', cmap=cmap)
plt.title(title)
plt.colorbar()
tick_marks = np.arange(len(target.unique()))
plt.xticks(tick_mark... |
alex/django-old | refs/heads/master | tests/regressiontests/admin_ordering/tests.py | 42 | from django.test import TestCase
from django.contrib.admin.options import ModelAdmin
from models import Band
class TestAdminOrdering(TestCase):
"""
Let's make sure that ModelAdmin.queryset uses the ordering we define in
ModelAdmin rather that ordering defined in the model's inner Meta
class.
"""
... |
leighpauls/k2cro4 | refs/heads/master | net/data/websocket/echo-with-no-extension_wsh.py | 166 | # Copyright (c) 2012 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.
_GOODBYE_MESSAGE = u'Goodbye'
def web_socket_do_extra_handshake(request):
request.ws_extension_processors = []
def web_socket_transfer_data(request... |
cosailer/caeproject | refs/heads/master | simulation_result/5/project3.py | 1 | # -*- coding: utf-8 -*-
"""
-------------------------------------
N A C S P Y T H O N S C R I P T
-------------------------------------
NACS version: 2.0.2745 - pre3
NACS architecture: CENTOS 5.11 (X86_64)
File generated at Tue Jan 20 16:55:05 2015
On host 'lse86' by 'cae42'
"""
from __future__ import division ... |
iamutkarshtiwari/kivy | refs/heads/master | kivy/loader.py | 32 | '''
Asynchronous data loader
========================
This is the Asynchronous Loader. You can use it to load an image
and use it, even if data are not yet available. You must specify a default
loading image when using the loader::
from kivy.loader import Loader
image = Loader.image('mysprite.png')
You can a... |
zhtsh/spam_email_classifier | refs/heads/master | script/train.py | 1 | #!/usr/bin/python
# coding=utf8
# author=zhtsh
import sys
import logging
from os import path
from optparse import OptionParser
sys.path.append(path.abspath(path.join(path.dirname(__file__), '../core')))
from context import SpamClassifierContext
from strategy import ClassifierStrategy
from strategy import SVMClassifie... |
ElXaxe/Barcelona-Dashboard | refs/heads/master | node_modules/generic-pool/fabfile.py | 926 | #
# dependencies:
# fabric (apt-get install fabric)
# node-jslint (http://github.com/reid/node-jslint)
# expresso (or replace with whatever node.js test tool you're using)
#
from fabric.api import local
import os, os.path
def test():
local('expresso -I lib test/*', capture=False)
def jslint():
... |
cschnei3/forseti-security | refs/heads/master | google/cloud/security/enforcer/batch_enforcer.py | 1 | # Copyright 2017 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, s... |
hn8841182/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/inspect.py | 637 | """Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the useful functions provided by this module:... |
JeyZeta/Dangerous | refs/heads/master | Dangerous/TheHarvester/lib/markup.py | 19 | # This code is in the public domain, it comes
# with absolutely no warranty and you can do
# absolutely whatever you want with it.
__date__ = '17 May 2007'
__version__ = '1.7'
__doc__ = """
This is markup.py - a Python module that attempts to
make it easier to generate HTML/XML from a Python program
in an intuitive, l... |
lolyzor/pushnotifications-server | refs/heads/master | models.py | 1 | from google.appengine.ext import db
class Phone(db.Model):
phone_id = db.StringProperty(required=True)
android_version = db.StringProperty(required=False)
class Post(db.Model):
title = db.StringProperty(required=True)
msg = db.StringProperty(required=True)
class Image(db.Model):
post_id = db.Ref... |
photoninger/ansible | refs/heads/devel | lib/ansible/modules/network/junos/junos_vlan.py | 3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
manageacloud/manageacloud-cli | refs/heads/master | maccli/facade/macfile.py | 1 | import time
import maccli
import pprint
from maccli.config import MACFILE_ON_FAILURE_DESTROY_OTHERS, MACFILE_ON_FAILURE_DESTROY_ALL
from maccli.view.view_generic import GREEN, RED
import maccli.service.instance
import maccli.view.view_generic
import maccli.view.view_instance
import maccli.view.view_infrastructure
impo... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/wearables/armor/assault_trooper/armor_assault_trooper_chest_plate_gcw.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/tatooine_npc/wilhalm_skrim.py | 85615 | import sys
def setup(core, object):
return |
cloudera/spark | refs/heads/master | python/pyspark/accumulators.py | 8 | #
# 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... |
drbild/boto | refs/heads/develop | boto/ec2/launchspecification.py | 170 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 wit... |
kouaw/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ku6.py | 9 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class Ku6IE(InfoExtractor):
_VALID_URL = r'http://v\.ku6\.com/show/(?P<id>[a-zA-Z0-9\-\_]+)(?:\.)*html'
_TEST = {
'url': 'http://v.ku6.com/show/JG-8yS14xzBr4bCn1pu0xw...html',
'md5': '01203549b9efbb45f4b87d55... |
quanvm009/codev7 | refs/heads/master | openerp/addons/portal/portal.py | 46 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
clairetang6/bokeh | refs/heads/master | examples/models/gauges.py | 6 | from __future__ import print_function
from math import pi, sin, cos
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.resources import INLINE
from bokeh.util.browser import view
from bokeh.models.glyphs import Circle, Arc, Ray, Text
from bokeh.models import ColumnDataSource, Range1d, P... |
zinic/pyrox | refs/heads/master | pyrox/server/proxyng.py | 1 | import socket
import tornado
import tornado.ioloop
import tornado.process
from .routing import RoundRobinRouter, PROTOCOL_HTTP, PROTOCOL_HTTPS
from pyrox.tstream.iostream import (SSLSocketIOHandler, SocketIOHandler,
StreamClosedError)
from pyrox.tstream.tcpserver import TCPServer
... |
johnservinis/node-gyp | refs/heads/master | gyp/pylib/gyp/generator/dump_dependency_json.py | 241 | # Copyright (c) 2012 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... |
SVoxel/R7800 | refs/heads/master | git_home/samba.git/third_party/pep8/testsuite/E30not.py | 59 | #: Okay
class X:
pass
#: Okay
def foo():
pass
#: Okay
# -*- coding: utf-8 -*-
class X:
pass
#: Okay
# -*- coding: utf-8 -*-
def foo():
pass
#: Okay
class X:
def a():
pass
# comment
def b():
pass
# This is a
# ... multi-line comment
def c():
pass
# T... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/skimage/measure/tests/test_simple_metrics.py | 2 | import numpy as np
import skimage.data
from skimage.measure import compare_psnr, compare_nrmse, compare_mse
from skimage._shared import testing
from skimage._shared.testing import assert_equal, assert_almost_equal
from skimage._shared._warnings import expected_warnings
np.random.seed(5)
cam = skimage.data.camera()
... |
imtapps/django-imt-fork | refs/heads/IMT | django/contrib/auth/tests/hashers.py | 15 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
from django.contrib.auth.hashers import (is_password_usable,
check_password, make_password, PBKDF2PasswordHasher, load_hashers,
PBKDF2SHA1PasswordHasher, get_hasher, ident... |
kkdd/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/json/encoder.py | 58 | """Implementation of JSONEncoder
"""
import re
import math
try:
from _json import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
__all__ = ['JSONEncoder']
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')... |
hosseinmh/Django_learning | refs/heads/master | djmod/.venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/heuristics.py | 490 | import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(c... |
simplegeo/sqlalchemy | refs/heads/master | lib/sqlalchemy/engine/__init__.py | 7 | # engine/__init__.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""SQL connections, SQL execution and high-level DB-API interface.
The engine... |
thodoris/djangoPharma | refs/heads/master | djangoPharma/env/Lib/site-packages/django/contrib/gis/geos/point.py | 47 | import warnings
from ctypes import c_uint
from django.contrib.gis import gdal
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.utils import six
from django.utils.deprecation import Remove... |
qwertyjune/BethSaidaBible | refs/heads/master | venv/lib/python2.7/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... |
crossroadchurch/paul | refs/heads/master | tests/functional/openlp_plugins/songs/test_mediaitem.py | 1 | # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... |
zamattiac/SHARE | refs/heads/develop | share/__init__.py | 1 | from share.harvest import Harvester # noqa
from share.normalize import Normalizer # noqa
from share.provider import ProviderAppConfig # noqa
|
reinhrst/panda | refs/heads/master | usr/lib/python2.7/dist-packages/dbus/proxies.py | 2 | ../../../../share/pyshared/dbus/proxies.py |
TedaLIEz/sentry | refs/heads/master | tests/sentry/models/test_organizationmember.py | 25 | # coding: utf-8
from __future__ import absolute_import
from django.core import mail
from sentry.models import OrganizationMember
from sentry.testutils import TestCase
class OrganizationMemberTest(TestCase):
def test_counter(self):
organization = self.create_organization(name='Foo')
user2 = sel... |
Patreon/cartographer | refs/heads/master | example/generic_social_network/app/controllers/follows_controller.py | 1 | #!flask/bin/python
from cartographer.serializers import JSONAPICollectionSerializer
from flask import jsonify, abort, request, Blueprint
from generic_social_network.app import db
from generic_social_network.app.models.query_builders.follows_dbm import FollowsDBM
from generic_social_network.app.models.query_builders.use... |
bsa11b/mtasa-blue | refs/heads/1.4.1 | vendor/google-breakpad/src/tools/gyp/test/actions/gyptest-errors.py | 351 | #!/usr/bin/env python
# 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.
"""
Verifies behavior for different action configuration errors:
exit status of 1, and the expected error message must be in stderr.
"""
im... |
iproduct/course-social-robotics | refs/heads/master | 11-dnn-keras/venv/Lib/site-packages/pip/_internal/commands/check.py | 6 | import logging
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.operations.check import (
check_package_set,
create_package_set_from_installed,
)
from pip._internal.utils.misc import write_output
from pip._internal.utils.typing impo... |
guoxiaoyong/simple-useful | refs/heads/master | learn/greenlet/simple.py | 1 | import greenlet
def test1():
print(12)
gr2.switch()
print(34)
print('test1', greenlet.getcurrent())
gr2.switch()
def test2():
print('test2', greenlet.getcurrent())
print(56)
gr1.switch()
print(78)
print('main', greenlet.getcurrent())
gr1 = greenlet.greenlet(test1)
gr2 = greenlet.greenlet(test2)
p... |
pior/moto | refs/heads/master | moto/redshift/models.py | 17 | from __future__ import unicode_literals
import boto.redshift
from moto.core import BaseBackend
from moto.ec2 import ec2_backends
from .exceptions import (
ClusterNotFoundError,
ClusterParameterGroupNotFoundError,
ClusterSecurityGroupNotFoundError,
ClusterSubnetGroupNotFoundError,
InvalidSubnetError... |
jicruz/heroku-bot | refs/heads/master | lib/youtube_dl/extractor/twentytwotracks.py | 178 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
# 22Tracks regularly replace the audio tracks that can be streamed on their
# site. The tracks usually expire after 1 months, so we can't add tests.
class TwentyTwoTracksIE(InfoExtractor):
_VALID... |
linvictor88/vse-lbaas-driver | refs/heads/master | quantum/api/v2/attributes.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation.
# 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.... |
simonwydooghe/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_monitor_gateway_icmp.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
supergarotinho/ambari-mongodb | refs/heads/master | package/test/integrated_sharded_cluster_test.py | 1 | import os
import sys
from time import sleep
# Ambari includes
from resource_management.core.exceptions import ComponentIsNotRunning
from resource_management.libraries.script import Script
# Custom service test classes includes
from integrated_base_test import IntegratedBaseTestCase
SCRIPT_DIR = os.path.dirname(os.pa... |
kingmotley/SickRage | refs/heads/master | lib/hachoir_core/field/static_field_set.py | 93 | from hachoir_core.field import FieldSet, ParserError
class StaticFieldSet(FieldSet):
"""
Static field set: format class attribute is a tuple of all fields
in syntax like:
format = (
(TYPE1, ARG1, ARG2, ...),
(TYPE2, ARG1, ARG2, ..., {KEY1=VALUE1, ...}),
...
)
... |
Slezhuk/ansible | refs/heads/devel | lib/ansible/modules/network/panos/panos_pg.py | 78 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... |
pshc/rust | refs/heads/master | src/etc/latest-unix-snaps.py | 53 | #!/usr/bin/env python
#
# Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice... |
jpf/Twilio-TFA | refs/heads/master | tests/test_totp.py | 2 | import sys
import StringIO
import datetime
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import Image
from totp_auth import TotpAuth
class TestTOTPAuth(unittest.TestCase):
def setUp(self):
self.test_token = 'AAAAAAAAAAAAAAAA'
def tearDown(self):
p... |
dan-passaro/django-cachalot | refs/heads/master | cachalot/panels.py | 2 | # coding: utf-8
from __future__ import unicode_literals
from collections import defaultdict
from datetime import datetime
from debug_toolbar.panels import Panel
from django.conf import settings
from django.core.cache import cache
from django.db.models.loading import get_models
from django.utils.translation import uge... |
akosel/servo | refs/heads/master | tests/wpt/css-tests/tools/wptserve/wptserve/server.py | 41 | import BaseHTTPServer
import errno
import os
import re
import socket
from SocketServer import ThreadingMixIn
import ssl
import sys
import threading
import time
import traceback
import types
import urlparse
import routes as default_routes
from logger import get_logger
from request import Server, Request
from response i... |
hbrunn/OCB | refs/heads/8.0 | addons/website_event_sale/models/sale_order.py | 26 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
# defined for access rules
class sale_order(osv.Model):
_inherit = "sale.order"
def _cart_find_product_line(self, cr, uid, ids, produ... |
kasioumis/invenio | refs/heads/master | invenio/ext/sqlalchemy/types/__init__.py | 13 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... |
alx-eu/django | refs/heads/stable/1.5.x | tests/regressiontests/model_permalink/urls.py | 176 | from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^guitarists/(\w{1,50})/$', 'unimplemented_view_placeholder', name='guitarist_detail'),
)
|
t-tran/libcloud | refs/heads/trunk | docs/examples/compute/cloudsigma/list_sizes_images_drives.py | 63 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls('username', 'password', region='zrh', api_version='2.0')
sizes = driver.list_sizes()
print(sizes)
images = driver.list_images()
print(images)
drives = driver.ex_list_libra... |
Eric-Zhong/odoo | refs/heads/8.0 | addons/account_payment/wizard/account_payment_populate_statement.py | 274 | # -*- 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... |
cmdunkers/DeeperMind | refs/heads/master | PythonEnv/lib/python2.7/site-packages/theano/tensor/nnet/tests/speed_test_conv.py | 7 | from __future__ import print_function
import sys, time, unittest
import numpy
import numpy as N
from six.moves import xrange
from theano.tests import unittest_tools as utt
from theano import function, Mode
import theano.tensor as T
from theano.tensor.nnet.conv import ConvOp
def flip(kern, kshp):
"flip the kern... |
ronik-design/haystack-rqueue | refs/heads/master | haystack_rq_test/haystack_rq_test/wsgi.py | 2 | """
WSGI config for haystack_rq_test project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLI... |
Cherry-project/primitiveWS | refs/heads/master | chatterbot/async_google.py | 1 | #!/usr/bin/python
# Copyright (C) 2016 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
from __future__ import divisi... |
nvoron23/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/IOBinding.py | 52 | # changes by dscherer@cmu.edu
# - IOBinding.open() replaces the current window with the opened file,
# if the current window is both unmodified and unnamed
# - IOBinding.loadfile() interprets Windows, UNIX, and Macintosh
# end-of-line conventions, instead of relying on the standard library,
# which will... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/lib/django-1.4/django/utils/unittest/__init__.py | 571 | """
unittest2
unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7. It is tested to run on Python 2.4 - 2.6.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 P... |
Ambuj-UF/ConCat-1.0 | refs/heads/master | src/Utils/Bio/GA/Mutation/Simple.py | 1 | # This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
import sys
# Add path to Bio
sys.path.append('../../..')
"""Perform Simple mutations on an organism's genome.
"""
# standard modules
import random
... |
divegeek/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Options/PathOption.py | 19 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.