repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ramcn/demo3 | refs/heads/master | venv/lib/python3.4/site-packages/django/contrib/messages/api.py | 512 | from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
from django.http import HttpRequest
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
'MessageFailure',
)
class MessageFailure(E... |
a25kk/eda | refs/heads/master | src/eda.sitecontent/eda/sitecontent/browser/__init__.py | 37 | # -*- coding: utf-8 -*-
"""Module providing browser views"""
|
endlessm/chromium-browser | refs/heads/master | third_party/catapult/third_party/WebOb/webob/dec.py | 24 | """
Decorators to wrap functions to make them WSGI applications.
The main decorator :class:`wsgify` turns a function into a WSGI
application (while also allowing normal calling of the method with an
instantiated request).
"""
from webob.compat import (
bytes_,
text_type,
)
from webob.request import Reque... |
shanethehat/sd-agent-plugins | refs/heads/master | ZooKeeper/ZooKeeper.py | 4 | """
Server Density Plugin
ZooKeeper
https://www.serverdensity.com/plugins/ZooKeeper/
https://github.com/serverdensity/sd-agent-plugins/
Version: 1.0.0
"""
import socket
class ZooKeeper(object):
"""Plugin class to manage extracting the data from ZooKeeper
for the sd-agent.
"""
def __init__(self... |
RealImpactAnalytics/airflow | refs/heads/master | airflow/lineage/backend/atlas/typedefs.py | 22 | # -*- coding: utf-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
#... |
Ecotrust/F2S-MOI | refs/heads/master | moi/sectors/migrations/0002_auto_20151229_2316.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-29 23:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0010_change... |
Distrotech/intellij-community | refs/heads/master | python/testData/refactoring/move/oldStyleRelativeImport/before/src/pkg/a.py | 76 | import b as alias
from subpkg import c as alias2
from .subpkg import c
print(alias, alias2, c)
|
ray-zhong/github_trend_spider | refs/heads/master | ENV/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py | 360 | from __future__ import absolute_import
import logging
import os
import warnings
from ..exceptions import (
HTTPError,
HTTPWarning,
MaxRetryError,
ProtocolError,
TimeoutError,
SSLError
)
from ..packages.six import BytesIO
from ..request import RequestMethods
from ..response import HTTPResponse
... |
charbeljc/OCB | refs/heads/8.0 | openerp/addons/base/res/res_partner.py | 4 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
olivierdalang/QGIS | refs/heads/master | tests/src/python/test_qgslayoutscalebar.py | 45 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutItemScaleBar.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.... |
JimCircadian/ansible | refs/heads/devel | lib/ansible/plugins/lookup/dig.py | 87 | # (c) 2015, Jan-Piet Mens <jpmens(at)gmail.com>
# (c) 2017 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
DOCUMENTATION = """
lookup: dig
author: Jan-Piet Mens (... |
kencochrane/docker-django-demo | refs/heads/master | dockerdemo/voting/models.py | 1 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published', auto_now_add=True)
last_update = models.DateTimeField('la... |
nishad89/newfies-dialer | refs/heads/master | addons/samples/namegen/__init__.py | 23 | import pkg_resources
pkg_resources.declare_namespace(__name__)
from .namegen import NameGenerator
namegen = NameGenerator()
|
dsm054/pandas | refs/heads/master | pandas/io/sas/sas7bdat.py | 1 | """
Read SAS7BDAT files
Based on code written by Jared Hobbs:
https://bitbucket.org/jaredhobbs/sas7bdat
See also:
https://github.com/BioStatMatt/sas7bdat
Partial documentation of the file format:
https://cran.r-project.org/web/packages/sas7bdat/vignettes/sas7bdat.pdf
Reference for binary data compression:
h... |
mSenyor/sl4a | refs/heads/master | python/gdata/tests/gdata_tests/calendar/service_test.py | 87 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... |
ga4gh/ga4gh-schemas | refs/heads/master | python/ga4gh/schemas/protocol.py | 4 | """
Definitions of the GA4GH protocol types.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import json
import inspect
import sys
import array
from _protocol_version import version # noqa
from ga4gh.common_pb2 import * # noqa
from ga... |
rolandovillca/python_introduction_basic | refs/heads/master | threads_and_multiprocess/threads/example02.py | 4 | import threading
import time
class ThreadingExample(object):
'''
Threading example class.
The run() method will be started and
it will run in the background until the application exits.
'''
def __init__(self, interval=1):
'''
Constructor
:type interval: int
:para... |
hpfem/cython | refs/heads/master | docs/sphinxext/ipython_console_highlighting.py | 13 | from pygments.lexer import Lexer, do_insertions
from pygments.lexers.agile import PythonConsoleLexer, PythonLexer, \
PythonTracebackLexer
from pygments.token import Comment, Generic
from sphinx import highlighting
import re
line_re = re.compile('.*?\n')
class IPythonConsoleLexer(Lexer):
"""
For IPython co... |
manveru0/FeaCore_Phoenix_S3 | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
jrversteegh/softsailor | refs/heads/master | softsailor/sol/sol_boat.py | 1 | """
Sol boat module
Contains a boat with sol performance
"""
__author__ = "J.R. Versteegh"
__copyright__ = "Copyright 2011, J.R. Versteegh"
__contact__ = "j.r.versteegh@gmail.com"
__version__ = "0.1"
__license__ = "GPLv3, No Warranty. See 'LICENSE'"
from softsailor.boat import SailBoat
from sol_performance import Per... |
sublime1809/django | refs/heads/master | tests/view_tests/models.py | 160 | """
Regression tests for Django built-in views.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
def get_absolute_ur... |
ashutrix03/inteygrate_flaskapp-master | refs/heads/master | build/lib/yowsup/common/__init__.py | 70 | from .constants import YowConstants |
oskar456/youtube-dl | refs/heads/master | youtube_dl/extractor/everyonesmixtape.py | 88 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,
)
class EveryonesMixtapeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?everyonesmixtape\.com/#/mix/(?P<id>[0-9a-zA-Z]+)(?:/(?P<songnr>[0-9]))?$'
_TESTS ... |
trhongbinwang/data_science_journey | refs/heads/master | deep_learning/tensorflow/tutorials/tutorial1/02_logistic_regression.py | 1 | #!/usr/bin/env python
import tensorflow as tf
import numpy as np
import input_data
def init_weights(shape):
return tf.Variable(tf.random_normal(shape, stddev=0.01))
def load_data():
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
trX, trY, teX, teY = mnist.train.images, mnist.train.... |
knewbie/crashshow | refs/heads/master | test.py | 1 | #!/usr/bin/env python
from hashlib import sha1
#from app.data_collect import Extract
from app.models import db_handler
#ext = Extract('2016-01-25', '/Users/kevin/study/python/flask/myproj')
#ext.run_extract()
user_dict = {
'admin':'admin',
'kevin':'kevinlee',
'lwn':'lwn1234',
'ff':'f... |
arenadata/ambari | refs/heads/branch-adh-1.6 | ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/package/scripts/hdfs_client.py | 1 | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... |
elba7r/lite-system | refs/heads/master | erpnext/patches/v7_1/update_missing_salary_component_type.py | 35 | from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
'''
Some components do not have type set, try and guess whether they turn up in
earnings or deductions in existing salary slips
'''
def execute():
frappe.reload_doc("accounts", "doctype", "salary_component_account")
for s in frap... |
KohlsTechnology/ansible | refs/heads/devel | lib/ansible/modules/network/dellos10/dellos10_command.py | 45 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2017 Dell 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_versio... |
havard024/prego | refs/heads/master | venv/lib/python2.7/site-packages/django/core/mail/backends/dummy.py | 634 | """
Dummy email backend that does nothing.
"""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(email_messages)
|
kaedroho/django | refs/heads/master | tests/foreign_object/models/person.py | 79 | import datetime
from django.db import models
class Country(models.Model):
# Table Column Fields
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class Person(models.Model):
# Table Column Fields
name = models.CharField(max_length=128)
person_country_id = m... |
mcanthony/cython | refs/heads/master | Cython/Debugger/DebugWriter.py | 13 | from __future__ import with_statement
import os
import sys
import errno
try:
from lxml import etree
have_lxml = True
except ImportError:
have_lxml = False
try:
# Python 2.5
from xml.etree import cElementTree as etree
except ImportError:
try:
# Python 2.5
... |
jamesblunt/sympy | refs/heads/master | sympy/physics/optics/waves.py | 14 | """
This module has all the classes and functions related to waves in optics.
**Contains**
* TWave
"""
from __future__ import print_function, division
__all__ = ['TWave']
from sympy import (sympify, pi, sin, cos, sqrt, simplify, Symbol, S, C, I,
symbols, Derivative, atan2)
from sympy.core.expr import Expr
from... |
taaviteska/django | refs/heads/master | django/db/migrations/__init__.py | 826 | from .migration import Migration, swappable_dependency # NOQA
from .operations import * # NOQA
|
sandymanu/manufooty_yu_lp | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
zangree/ryu | refs/heads/master | ryu/tests/integrated/test_vrrp_multi.py | 49 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... |
Slezhuk/ansible | refs/heads/devel | lib/ansible/modules/network/panos/panos_security_policy.py | 32 | #!/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... |
scylladb/scylla-cluster-tests | refs/heads/master | unit_tests/test_sct_events_monitors.py | 1 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... |
keisukefukuda/mpienv | refs/heads/master | mpienv/piplib.py | 1 | # coding: utf-8
import os
import pip
import re
from subprocess import check_call
from subprocess import check_output # NOQA
from subprocess import PIPE # NOQA
from subprocess import Popen # NOQA
import sys
# We support pip 10.x.x, 9.x.x and 1.5
_pip_ver = None
def _get_pip_ver():
global _pip_ver
ver = p... |
haozai309/hello_python | refs/heads/master | google-python-exercises/basic/solution/list1.py | 209 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic list exercises
# Fill in the code for the functions below. main() is already set ... |
glwu/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/idlelib/idle.py | 269 | import os.path
import sys
# If we are working on a development version of IDLE, we need to prepend the
# parent of this idlelib dir to sys.path. Otherwise, importing idlelib gets
# the version installed with the Python used to call this module:
idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))... |
MTK6580/walkie-talkie | refs/heads/master | ALPS.L1.MP6.V2_HEXING6580_WE_L/alps/cts/apps/CameraITS/tests/scene1/test_param_sensitivity.py | 3 | # Copyright 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
bzero/statsmodels | refs/heads/master | statsmodels/duration/hazard_regression.py | 9 | import numpy as np
from statsmodels.base import model
import statsmodels.base.model as base
from statsmodels.tools.decorators import cache_readonly
from scipy.optimize import brent
"""
Implementation of proportional hazards regression models for duration
data that may be censored ("Cox models").
References
----------... |
ashray/VTK-EVM | refs/heads/yiq | ThirdParty/Twisted/twisted/names/test/__init__.py | 139 | "Tests for twisted.names"
|
jesseklein406/data-structures | refs/heads/master | tests/test_stack.py | 2 | # -*- coding: utf-8 -*-
"""Test file for 'stack.py'
Run this file with pytest to test conditions
"""
from __future__ import unicode_literals
import pytest
import stack
value = [1, 2, 3, 4, 5]
foo = stack.Stack(value)
# init
def test_init_type():
"""Check instance is type 'stack'"""
assert type(foo) == sta... |
tristandeleu/switching-kalman-filter | refs/heads/master | test/test_switching_kalman_filter.py | 1 | import csv, time
import numpy as np
from utils.kalman import SwitchingKalmanState, SwitchingKalmanFilter, KalmanState
from utils.kalman.models import NDCWPA, NDBrownian
from utils.helpers import *
import matplotlib.pyplot as plt
# positions = load_trajectory(1080, 100)
# positions = load_trajectory(1462, 79)
positio... |
BlindHunter/django | refs/heads/master | tests/utils_tests/test_crypto.py | 447 | from __future__ import unicode_literals
import binascii
import hashlib
import unittest
from django.utils.crypto import constant_time_compare, pbkdf2
class TestUtilsCryptoMisc(unittest.TestCase):
def test_constant_time_compare(self):
# It's hard to test for constant time, just test the result.
s... |
sparkslabs/kamaelia_ | refs/heads/master | Sketches/JL/IRC/guitest.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... |
BigDataTrade/AlgorithmicTradingApiPython | refs/heads/master | setup.py | 2 | from setuptools import setup
setup(name='BigDataTradeAPIPy',
version='0.0.2',
description='BigDataTrade API in python',
url='https://github.com/bigdatatrade/AlgorithmicTradingApiPython',
author='Nacass Tommy',
author_email='tommy.nacass@gmail.com',
license='MIT',
packages=['bi... |
kkintaro/termite-data-server | refs/heads/master | web2py/gluon/storage.py | 16 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Provides:
- List; like list but returns None instead of IndexOutOfBounds
- Storage; like dictionary allowi... |
ssbarnea/ansible | refs/heads/devel | test/units/ansible_test/ci/test_shippable.py | 27 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from .util import common_auth_test
def test_auth():
# noinspection PyProtectedMember
from ansible_test._internal.ci.shippable import (
ShippableAuthHelper,
)
class TestShippableAuthHelper(ShippableAuthHel... |
suranap/qiime | refs/heads/master | tests/test_make_otu_heatmap.py | 15 | #!/usr/bin/env python
# file test_make_otu_heatmap.py
__author__ = "Dan Knights"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Dan Knights"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Dan Knights"
__email__ = "daniel.knights@colorado.edu"
from os import close
from os.path im... |
janusnic/cookiecutter | refs/heads/master | tests/test_generate_copy_without_render.py | 25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_generate_copy_without_render
---------------------------------
"""
from __future__ import unicode_literals
import os
import pytest
from cookiecutter import generate
from cookiecutter import utils
@pytest.fixture(scope='function')
def remove_test_dir(request):
... |
nasa/CrisisMappingToolkit | refs/heads/master | bin/detect_flood_modis.py | 1 | # -----------------------------------------------------------------------------
# Copyright * 2014, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The Crisis Mapping Toolkit (CMT) v1 platform is licensed under the Apache
#... |
paulmadore/Eric-IDE | refs/heads/master | 6-6.0.9/eric/Plugins/VcsPlugins/vcsMercurial/HgCommandDialog.py | 2 | # -*- coding: utf-8 -*-
# Copyright (c) 2010 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the Mercurial command dialog.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QDialog, QDialogButtonBox
from .Ui_HgCommandDialog import... |
DanielG/gr-osmosdr | refs/heads/master | docs/doxygen/doxyxml/generated/compound.py | 344 | #!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
import sys
import compoundsuper as supermod
from compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenType):
def __i... |
mpharrigan/mdtraj | refs/heads/master | mdtraj/tests/test_psf.py | 5 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Jason Swails
# Contributors: Robert McGibbon
#
# MDTraj is fre... |
poojavade/Genomics_Docker | refs/heads/master | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/poly.py | 1 | # Author : Pierre Schnizer
"""
Wrapper over the functions as described in Chaper 6 of the
reference manual.
There are routines for finding real and complex roots of quadratic and cubic
equations using analytic methods. An iterative polynomial solver is also
available for finding the roots of general polynomials... |
reviewboard/reviewboard | refs/heads/master | reviewboard/notifications/email/hooks.py | 2 | """Extension hooks for augmenting e-mail messages."""
from __future__ import unicode_literals
import warnings
from collections import defaultdict
from inspect import getargspec
from reviewboard.reviews.signals import (review_request_published,
review_published, reply_publishe... |
pumodi/Slimy_Snakes_the_Difficult_Path | refs/heads/master | Ex2/ex2.py | 7 | # A comment, this is so you can read your program later.
# Anything after the # is ignored by python.
print "I could have code like this." # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece of code:
# print "This won't run."
print "This will run." |
spottradingllc/zoom | refs/heads/master | server/zoom/www/cache/application_dependency_cache.py | 1 | import logging
import time
from xml.etree import ElementTree
from kazoo.exceptions import NoNodeError
from zoom.agent.predicate.time_window import TimeWindow
from zoom.agent.util.helpers import verify_attribute
from zoom.common.decorators import connected_with_return, TimeThis
from zoom.common.types import PredicateT... |
viveksh13/gymkhana | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/debug/repr.py | 280 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... |
alessandrolandim/liblightbase | refs/heads/master | liblightbase/lbmetaclass.py | 4 | # -*- coding: utf-8 -*-
from . import pytypes
class LBMetaClass(object):
""" This the metaclass, where all lightbase
classes will be generated from
"""
_structure = []
def __init__(self, *kwargs):
""" Create pytypes instances of all values in _structure
"""
for attr in ... |
mikel-egana-aranguren/SADI-Galaxy-Docker | refs/heads/master | galaxy-dist/lib/galaxy/model/migrate/versions/0025_user_info.py | 1 | """
This script adds a foreign key to the form_values table in the galaxy_user table
"""
from sqlalchemy import *
from sqlalchemy.orm import *
from migrate import *
from migrate.changeset import *
import datetime
now = datetime.datetime.utcnow
import sys, logging
# Need our custom types, but don't import anything else ... |
0verl0ad/pyJuanker | refs/heads/master | scripts/xssUrl.py | 1 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# by @aetsu
#
# Use: xssUrl.py url <payloads dictionary>
#
import requests
import urlparse
import sys
url = sys.argv[1]
if len(sys.argv) < 3:
payloads = ['<script>alert(1);</script>']
else:
filename = sys.argv[2]
payloads = [line.rstrip('\n') for line in op... |
mitsuhiko/sqlalchemy | refs/heads/master | test/orm/inheritance/test_selects.py | 3 | from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy import testing
from sqlalchemy.testing import fixtures
class InheritingSelectablesTest(fixtures.MappedTest):
@classmethod
def define_tables(cls, metadata):
global foo, bar, baz
foo = Table('foo', metadata,
... |
DreamerKing/LightweightHtmlWidgets | refs/heads/master | LightweightHtmlWidgets/bin/Release/Ipy.Lib/code.py | 256 | """Utilities needed to emulate Python's interactive interpreter.
"""
# Inspired by similar code by Jeff Epler and Fredrik Lundh.
import sys
import traceback
from codeop import CommandCompiler, compile_command
__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact",
"compile_command"]
def ... |
DarkPrince304/MozDef | refs/heads/master | alerts/sshbruteforce_bro_pyes.py | 7 | #!/usr/bin/env python
# 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/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
# Michal Purzynski michal@mozilla.com
... |
Etxea/gestioneide | refs/heads/master | gestioneide/migrations/0073_auto_20210618_1503.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-06-18 13:03
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gestioneide', '0072_centro_precio_matricula'),
]
operations = [
migrations.RemoveF... |
FusionSP/android_external_chromium_org | refs/heads/lp5.1 | tools/git/mffr.py | 167 | #!/usr/bin/env python
# Copyright (c) 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.
"""Usage: mffr.py [-d] [-g *.h] [-g *.cc] REGEXP REPLACEMENT
This tool performs a fast find-and-replace operation on files in
the ... |
andela-ifageyinbo/django | refs/heads/master | tests/utils_tests/test_crypto.py | 447 | from __future__ import unicode_literals
import binascii
import hashlib
import unittest
from django.utils.crypto import constant_time_compare, pbkdf2
class TestUtilsCryptoMisc(unittest.TestCase):
def test_constant_time_compare(self):
# It's hard to test for constant time, just test the result.
s... |
sungkim11/mhargadh | refs/heads/master | django/contrib/localflavor/cl/forms.py | 201 | """
Chile specific form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class CLRegionSelect(Select):
""... |
aomelchenko/python_koans | refs/heads/master | python2/koans/about_lists.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutArrays in the Ruby Koans
#
from runner.koan import *
class AboutLists(Koan):
def test_creating_lists(self):
empty_list = list()
self.assertEqual(list, type(empty_list))
self.assertEqual(0, len(empty_list))
def test_list... |
Universal-Model-Converter/UMC3.0a | refs/heads/master | data/Python/x86/Lib/site-packages/pygame/tests/cursors_test.py | 18 | #################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.... |
ttm/oscEmRede | refs/heads/master | venv/lib/python2.7/site-packages/networkx/linalg/attrmatrix.py | 78 | """
Functions for constructing matrix-like objects from graph attributes.
"""
__all__ = ['attr_matrix', 'attr_sparse_matrix']
import networkx as nx
def _node_value(G, node_attr):
"""Returns a function that returns a value from G.node[u].
We return a function expecting a node as its sole argument. Th... |
Communities-Communications/cc-odoo | refs/heads/master | addons/account/wizard/account_tax_chart.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... |
wfxiang08/green | refs/heads/master | green/cmdline.py | 1 | from __future__ import unicode_literals
import os
import sys
try: # pragma: no cover
import coverage
coverage_version = "Coverage {}".format(coverage.__version__)
except: # pragma: no cover
coverage = None
coverage_version = "Coverage Not Installed"
# Importing from green (other than config) is done a... |
andela-earinde/bellatrix-py | refs/heads/master | app/js/lib/lib/modules/greenlet.py | 2 | import sys
import _continuation
__version__ = "0.4.7"
# ____________________________________________________________
# Exceptions
class GreenletExit(BaseException):
"""This special exception does not propagate to the parent greenlet; it
can be used to kill a single greenlet."""
error = _continuation.error
# __... |
google/oauth2client | refs/heads/master | tests/test_file.py | 15 | # 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 ... |
GaetanCambier/CouchPotatoServer | refs/heads/develop | libs/requests/packages/chardet/compat.py | 2942 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versio... |
rjkerrison/ranking | refs/heads/master | classes/contest.py | 1 | import json
import hashlib
class Contest():
def __init__(self, *args, **kwargs):
self.contestants = []
self.outcome = ''
if len(args) >= 2:
self.contestants = frozenset(args[:2])
if len(args) >= 3:
self.outcome = args[2]
if 'contestants' in kwargs:
self.contestants = frozense... |
zsiciarz/django | refs/heads/master | tests/multiple_database/routers.py | 48 | from django.db import DEFAULT_DB_ALIAS
class TestRouter:
"""
Vaguely behave like primary/replica, but the databases aren't assumed to
propagate changes.
"""
def db_for_read(self, model, instance=None, **hints):
if instance:
return instance._state.db or 'other'
return '... |
Anlim/decode-Django | refs/heads/master | Django-1.5.1/django/core/mail/backends/console.py | 137 | """
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream', sys.stdout)
self._loc... |
aslamplr/shorts | refs/heads/master | lib/werkzeug/contrib/sessions.py | 315 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains some helper classes that help one to add session
support to a python WSGI application. For full client-side session
storage see :mod:`~werkzeug.contrib.securecookie` which implements a
secure,... |
iradul/phantomjs-clone | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/build.py | 119 | # Copyright (C) 2010 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 of conditions and th... |
naousse/odoo | refs/heads/8.0 | addons/crm/__init__.py | 329 | # -*- 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... |
marratj/ansible | refs/heads/devel | lib/ansible/modules/network/panos/panos_import.py | 29 | #!/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... |
kurli/blink-crosswalk | refs/heads/master | Tools/Scripts/webkitpy/tool/__init__.py | 6014 | # Required for Python to search this directory for module files
|
fgend31/SoCo | refs/heads/master | soco/__init__.py | 10 | # -*- coding: utf-8 -*-
"""SoCo (Sonos Controller) is a simple library to control Sonos speakers."""
# There is no need for all strings here to be unicode, and Py2 cannot import
# modules with unicode names so do not use from __future__ import
# unicode_literals
# https://github.com/SoCo/SoCo/issues/98
#
import logg... |
code4futuredotorg/reeborg_tw | refs/heads/master | src/libraries/Brython3.2.3/Lib/site-packages/reeborg_common_old.py | 2 | from browser import window
class ReeborgError(Exception):
def __init__(self, value):
self.reeborg_shouts = value
def __str__(self):
return repr(self.reeborg_shouts)
window['ReeborgError'] = ReeborgError
# simple help replacement as it is not working correctly imo
def Help(obj=None):
'''U... |
clumsy/intellij-community | refs/heads/master | python/testData/buildout/site.py | 83 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... |
arpitar/osf.io | refs/heads/develop | website/addons/dropbox/tests/test_webtests.py | 31 | # -*- coding: utf-8 -*-
from nose.tools import * # noqa (PEP8 asserts)
from website.util import api_url_for, web_url_for
from tests.base import OsfTestCase
from tests.factories import AuthUserFactory
class TestDropboxIntegration(OsfTestCase):
def setUp(self):
super(TestDropboxIntegration, self).setUp()... |
nbeaver/numpy | refs/heads/master | numpy/distutils/ccompiler.py | 22 | from __future__ import division, absolute_import, print_function
import os
import re
import sys
import types
from copy import copy
from distutils import ccompiler
from distutils.ccompiler import *
from distutils.errors import DistutilsExecError, DistutilsModuleError, \
DistutilsPlatformErr... |
venusource/python-neutronclient | refs/heads/master | neutronclient/tests/unit/test_cli20_port.py | 3 | # Copyright 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
aferr/LatticeMemCtl | refs/heads/master | tests/configs/simple-atomic.py | 19 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... |
gquirozbogner/contentbox-master | refs/heads/master | third_party/django/contrib/gis/geoip/tests.py | 76 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.conf import settings
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.geoip import HAS_GEOIP
from django.utils import unittest
from django.utils.unittest import skipUnless
from django.utils import six
if HAS_GEO... |
zhuhangyu/jumpserver | refs/heads/master | docs/__init__.py | 41 | __author__ = 'Hudie'
|
aerickson/ansible | refs/heads/devel | lib/ansible/modules/monitoring/pingdom.py | 77 | #!/usr/bin/python
# -*- 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.
... |
bacontext/mopidy | refs/heads/develop | mopidy/mpd/protocol/stickers.py | 19 | from __future__ import absolute_import, unicode_literals
from mopidy.mpd import exceptions, protocol
@protocol.commands.add('sticker', list_command=False)
def sticker(context, action, field, uri, name=None, value=None):
"""
*musicpd.org, sticker section:*
``sticker list {TYPE} {URI}``
Lists... |
andyfaff/scipy | refs/heads/master | scipy/sparse/linalg/isolve/tests/test_gcrotmk.py | 12 | #!/usr/bin/env python
"""Tests for the linalg.isolve.gcrotmk module
"""
from numpy.testing import (assert_, assert_allclose, assert_equal,
suppress_warnings)
import numpy as np
from numpy import zeros, array, allclose
from scipy.linalg import norm
from scipy.sparse import csr_matrix, eye, r... |
sebgoa/client-python | refs/heads/master | kubernetes/client/models/v1_node_condition.py | 2 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.