repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
waxkinetic/fabcloudkit | refs/heads/master | fabcloudkit/tool/__init__.py | 1 | """
fabcloudkit
:copyright: (c) 2013 by Rick Bohrer.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from .git import *
from .gunicorn import *
from .keys import *
from .nginx import *
from .pip import *
from .pip_command import *
from .python import *
from .redis i... |
wastevensv/CSH_PMS | refs/heads/master | CSH_PMS/settings.py | 1 | """
Django settings for CSH_PMS project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
... |
vstoykov/django-cms | refs/heads/develop | cms/migrations/0067_auto__add_field_aliaspluginmodel_alias_placeholder__chg_field_aliasplu.py | 59 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'AliasPluginModel.alias_placeholder'
db.add_column(u'cms_a... |
ganeshnalawade/ansible | refs/heads/devel | lib/ansible/modules/ping.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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_... |
citassa1985/youtube-dl | refs/heads/master | youtube_dl/extractor/buzzfeed.py | 133 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
class BuzzFeedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?buzzfeed\.com/[^?#]*?/(?P<id>[^?#]+)'
_TESTS = [{
'url': 'http://www.buzzfeed.com/abagg/this-angry-ram-destroys-a-punchin... |
kencochrane/django-intercom | refs/heads/master | runtests.py | 29 | #!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
if __name__ == "__main__":
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings'
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner()
fai... |
CloudBoltSoftware/cloudbolt-forge | refs/heads/master | blueprints/aws_aurora_db_clusters/management/create_snapshot.py | 1 | """
Take snapshot action for AWS RDS DB Cluster.
"""
from resourcehandlers.aws.models import AWSHandler
from common.methods import set_progress
from infrastructure.models import CustomField, Environment
import boto3
import time
from django.db import IntegrityError
def run(job, resource, **kwargs):
region = resourc... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildmac/Resources/env/lib/python2.7/site-packages/twisted/python/test/deprecatedattributes.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A module that is deprecated, used by L{twisted.python.test.test_deprecate} for
testing purposes.
"""
from __future__ import division, absolute_import
from incremental import Version
from twisted.python.deprecate import deprecatedModuleAttrib... |
ChinaMassClouds/copenstack-server | refs/heads/master | openstack/src/horizon-2014.2/horizon/test/test_dashboards/cats/kittens/urls.py | 6 | from django.conf.urls import patterns
from django.conf.urls import url
from horizon.test.test_dashboards.cats.kittens.views import IndexView # noqa
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
)
|
ericzolf/ansible | refs/heads/devel | test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/modules/testmodule_bad_docfrags.py | 66 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
DOCUMENTATION = r'''
module: testmodule
description: for testing
extends_documentation_fragment:
- noncollbogusfrag
- noncollbogusfrag.bogusvar
- bogusns.testcoll.frag
- testns.boguscoll.frag
... |
lightbulb-framework/lightbulb-framework | refs/heads/master | lightbulb/data/regex/MODSECCURRENT/973309.py | 667 | META = {
'author': 'George Argyros, Ioannis Stais',
'description': 'Automatic transformed ruleset',
'type':'Regex',
'comments': []
} |
cloudera/Impala | refs/heads/cdh6.3.0 | tests/common/test_vector.py | 2 | # 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 u... |
JohnStarich/github-code-recommendations | refs/heads/master | data-scripts/mongo-client.py | 1 | #!/usr/bin/env python3
import pandas as pd
from pymongo import MongoClient
def _connect_mongo(host, port, username, password, db):
""" A util for making a connection to mongo """
if username and password:
mongo_uri = 'mongodb://%s:%s@%s:%s/%s' % (username, password, host, port, db)
conn = Mon... |
bhargavz/py-twitter-sentiment-analysis | refs/heads/master | data/db/base/baseDB.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# FILE: BaseDB.py
# DATE: April, 2012
# The base level DB class for tweet collection and analysis
#
# Copyright by Author. All rights reserved. Not for reuse without
# express permissions.
#
#
import os
from sqlalchemy.orm import clear_mappers
class BaseDB(object)... |
TitoAlehandro/calc | refs/heads/master | djangobb_forum/tests/__init__.py | 4 | from test_forum import *
from test_reputation import *
from test_profile import *
from test_utils import *
from test_templatetags import * |
ian-r-rose/mcplates | refs/heads/master | mcplates/data/continents/mkfrp.py | 1 | #!/usr/bin/env python
files=['aus','eur','mad','nwaf','col','grn','nam','par','eant','ind','neaf','sac','ib']
out=open('../frp.py','w')
out.write("def get_pole(continent,age):\n")
for file in files:
outstring=" if continent=="+repr(file)+":\n"
out.write(outstring)
if file!='ib':
f=open(file+'_saf... |
swegener/libsigrokdecode | refs/heads/master | decoders/ltc242x/pd.py | 4 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2020 Analog Devices Inc.
##
## 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
## ... |
vanatteveldt/xtas | refs/heads/master | xtas/tasks/es.py | 1 | """Elasticsearch stuff."""
from __future__ import absolute_import
from datetime import datetime
from six import iteritems
from chardet import detect as chardetect
from elasticsearch import Elasticsearch
from ..core import app, _config
def _es():
return Elasticsearch(hosts=_config['ELASTICSEARCH'])
_ES_DOC_F... |
garoa/pingo | refs/heads/master | pingo/__init__.py | 2 | # api
from board import ANALOG # noqa
from board import IN # noqa
from board import OUT # noqa
from board import PWM # noqa
from board import HIGH # noqa
from board import LOW # noqa
from board import ModeNotSuported # noqa
from board import WrongPinMode # noqa
from board import PwmOutputCapable # noqa
from bo... |
ltilve/ChromiumGStreamerBackend | refs/heads/master | tools/telemetry/telemetry/testing/__init__.py | 1201 | # 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.
|
MSOpenTech/edx-platform | refs/heads/master | lms/djangoapps/branding/views.py | 29 | from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import redirect
from django_future.csrf import ensure_csrf_cookie
import student.views
from student.models import CourseEnrollment
import courseware.views
from microsite_configuration i... |
netcriptus/Canivete | refs/heads/master | functions/pula_um.py | 1 | #!/usr/bin/env python
# encoding: utf-8
"""
pula-um.py
Created by Fernando Cezar on 2012-05-20.
Copyright (c) 2012 __MyCompanyName__. All rights reserved.
"""
from lib.IOHandler import *
def pula_um(arq_input, arq_path):
"""
Dado uma string, lê um caracter sim e um não.
"""
strings = read_input(arq_input, ... |
h3biomed/ansible-modules-extras | refs/heads/devel | cloud/misc/ovirt.py | 23 | #!/usr/bin/python
# (c) 2013, Vincent Van der Kussen <vincent at vanderkussen.org>
#
# 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,... |
segment-routing/openwrt | refs/heads/sr-ipv6-4.4-openwrt | tools/perf/scripts/python/check-perf-trace.py | 1997 | # 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. ... |
OrhanOdabasi/weirdbutreal | refs/heads/master | story/migrations/0024_auto_20170322_0029.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-03-22 00:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('story', '0023_auto_20170321_1329'),
]
operations = [
migrations.AlterField(... |
semonte/intellij-community | refs/heads/master | python/lib/Lib/encodings/mac_turkish.py | 593 | """ Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
jkshaver/virtualenv-1.8.2 | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/namedwizardtests/forms.py | 318 | import os
import tempfile
from django import forms
from django.core.files.storage import FileSystemStorage
from django.forms.formsets import formset_factory
from django.http import HttpResponse
from django.template import Template, Context
from django.contrib.auth.models import User
from django.contrib.formtools.wiz... |
tudorvio/nova | refs/heads/master | nova/api/openstack/compute/schemas/v3/availability_zone.py | 73 | # Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
jonathanunderwood/numpy | refs/heads/master | doc/newdtype_example/example.py | 136 | from __future__ import division, absolute_import, print_function
import floatint.floatint as ff
import numpy as np
# Setting using array is hard because
# The parser doesn't stop at tuples always
# So, the setitem code will be called with scalars on the
# wrong shaped array.
# But we can get a view as an ndarray o... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | addons/mrp/tests/__init__.py | 140 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
rocopartners/django-oscar | refs/heads/master | src/oscar/management/commands/oscar_import_catalogue_images.py | 51 | import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from oscar.core.loading import get_class
Importer = get_class('catalogue.utils', 'Importer')
logger = logging.getLogger('oscar.catalogue.import')
class Command(BaseCommand):
args = '/path/to/folde... |
sametmax/Django--an-app-at-a-time | refs/heads/master | ignore_this_directory/django/contrib/contenttypes/migrations/0001_initial.py | 113 | import django.contrib.contenttypes.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ContentType',
fields=[
('id', models.AutoField(verbose_name='ID', seri... |
suyashphadtare/sajil-frappe | refs/heads/develop | frappe/core/doctype/notification_count/notification_count.py | 23 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import MySQLdb
from frappe.model.document import Document
logger = frappe.get_logger()
class NotificationCoun... |
uahic/nest-simulator | refs/heads/master | examples/nest/plot_tsodyks_shortterm_bursts.py | 13 | # -*- coding: utf-8 -*-
#
# plot_tsodyks_shortterm_bursts.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 ... |
joeyjojo/django_offline | refs/heads/master | src/django/contrib/staticfiles/utils.py | 322 | import os
import fnmatch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patter... |
mgagne/nova | refs/heads/master | nova/tests/unit/console/test_console.py | 11 | # Copyright (c) 2010 OpenStack Foundation
# Administrator of the National Aeronautics and Space Administration.
# 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... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/gdata/samples/oauth/oauth_on_appengine/main_rsa.py | 126 | #!/usr/bin/python
#
# Copyright (C) 2009 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 appli... |
bhargav2408/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_marshal.py | 48 | #!/usr/bin/env python3
from test import support
import marshal
import sys
import unittest
import os
class HelperMixin:
def helper(self, sample, *extra):
new = marshal.loads(marshal.dumps(sample, *extra))
self.assertEqual(sample, new)
try:
with open(support.TESTFN, "wb") as f:
... |
onecloud/neutron | refs/heads/master | neutron/tests/unit/oneconvergence/test_nvsd_plugin.py | 6 | # Copyright 2014 OneConvergence, 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 requir... |
rolando-contrib/scrapy | refs/heads/master | scrapy/linkextractors/htmlparser.py | 17 | """
HTMLParser-based link extractor
"""
import warnings
import six
from six.moves.html_parser import HTMLParser
from six.moves.urllib.parse import urljoin
from w3lib.url import safe_url_string
from w3lib.html import strip_html5_whitespace
from scrapy.link import Link
from scrapy.utils.python import unique as unique_l... |
blueset/ehForwarderBot | refs/heads/master | docs/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# EH Forwarder Bot documentation build configuration file, created by
# sphinx-quickstart on Tue Feb 28 10:17:32 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in ... |
tsdmgz/ansible | refs/heads/devel | lib/ansible/plugins/connection/__init__.py | 7 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017, Peter Sprygada <psprygad@redhat.com>
# (c) 2017 Ansible Project
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import fcntl
import gettext
import os
import ... |
cybergarage/round-py | refs/heads/master | tests/unit/method_test.py | 1 | #################################################################
#
# Round for Python
#
# Copyright (C) Satoshi Konno 2016
#
# This is licensed under BSD-style license, see file COPYING.
#
##################################################################
import pytest
from round import Method
def test_bad_method()... |
damngamerz/coala | refs/heads/master | tests/collecting/collectors_test_dir/bears/bear1.py | 35 | import multiprocessing
from coalib.bears.Bear import Bear
from coalib.settings.Section import Section
class TestBear(Bear):
def __init__(self):
Bear.__init__(self, Section('settings'), multiprocessing.Queue())
@staticmethod
def kind():
return 'kind'
def origin(self):
return... |
leotada/PyNFe | refs/heads/master | pynfe/entidades/transportadora.py | 2 | # -*- coding: utf-8 -*-
from .base import Entidade
from pynfe.utils.flags import TIPOS_DOCUMENTO
class Transportadora(Entidade):
# Dados da Transportadora
# - Nome/Razão Social (obrigatorio)
razao_social = str()
# - Tipo de Documento (obrigatorio) - default CNPJ
tipo_documento = 'CNPJ'
# - N... |
avelis/django-plantains | refs/heads/master | plantains/__init__.py | 1 |
# -*- coding: utf-8 -*-
from django.conf import settings
default_settings = {
'MAILCHIMP_CLIENT_ID': None,
'MAILCHIMP_CLIENT_SECRET': None,
'MAILCHIMP_AUTHORIZATION_URL': 'https://login.mailchimp.com/oauth2/authorize',
'MAILCHIMP_ACCESS_TOKEN_URL': 'https://login.mailchimp.com/oauth2/token',
'MAI... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/or_lookups/tests.py | 150 | from __future__ import absolute_import
from datetime import datetime
from operator import attrgetter
from django.db.models import Q
from django.test import TestCase
from .models import Article
class OrLookupsTests(TestCase):
def setUp(self):
self.a1 = Article.objects.create(
headline='Hell... |
srkukarni/heron | refs/heads/master | third_party/pex/setup.py | 11 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'CHANGES.rst')) as fp:
LONG_DESCRIPTION = fp.read()
# This seems to be a fairly standard ver... |
mheap/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_vrf_af.py | 53 | #!/usr/bin/python
#
# 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 distribut... |
ntuaha/NewsInsight | refs/heads/master | src/extract/MYDB.py | 1 | # -*- coding: utf-8 -*-
import re
#處理掉unicode 和 str 在ascii上的問題
import sys
import os
import psycopg2
import datetime
#import calendar
#import csv
#import math
#from time import mktime as mktime
import cookielib, urllib2,urllib
from lxml import html,etree
import StringIO
reload(sys)
sys.setdefaultencoding('utf8')... |
datakurre/xhtml2pdf | refs/heads/master | demo/tgpisa/tgpisa/release.py | 169 | # Release information about tgpisa
version = "1.0"
# description = "Your plan to rule the world"
# long_description = "More description about your plan"
# author = "Your Name Here"
# email = "YourEmail@YourDomain"
# copyright = "Vintage 2006 - a good year indeed"
# if it's open source, you might want to specify thes... |
soindy/rabbitmq-c | refs/heads/master | .ycm_extra_conf.py | 9 | # This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... |
maxamillion/ansible | refs/heads/devel | test/lib/ansible_test/_internal/init.py | 68 | """Early initialization for ansible-test before most other imports have been performed."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import resource
from .constants import (
SOFT_RLIMIT_NOFILE,
)
CURRENT_RLIMIT_NOFILE = resource.getrlimit(resource.RLIMIT_NOFILE)
DESI... |
domob1812/bitcoin | refs/heads/master | contrib/linearize/linearize-data.py | 37 | #!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import struct
import re
impo... |
YingHsuan/termite_data_server | refs/heads/master | web2py/gluon/contrib/login_methods/motp_auth.py | 44 | #!/usr/bin/env python
import time
from hashlib import md5
from gluon.dal import DAL
def motp_auth(db=DAL('sqlite://storage.sqlite'),
time_offset=60):
"""
motp allows you to login with a one time password(OTP) generated on a motp client,
motp clients are available for practically all platfo... |
gangadharkadam/vervefrappe | refs/heads/v5.0 | frappe/workflow/__init__.py | 12133432 | |
abhiii5459/sympy | refs/heads/master | sympy/solvers/benchmarks/__init__.py | 12133432 | |
Ingenico-ePayments/connect-sdk-python2 | refs/heads/master | tests/integration/test_connection_pooling.py | 1 | import unittest
import threading
import timeit
import tests.integration.init_utils as init_utils
from tests.integration.init_utils import MERCHANT_ID
from ingenico.connect.sdk.merchant.services.convert_amount_params import ConvertAmountParams
from ingenico.connect.sdk.factory import Factory
class ConnectionPoolingTes... |
metashell/metashell | refs/heads/master | 3rd/templight/llvm/utils/lit/tests/Inputs/fake-externals/fake_external.py | 17 | import os
import sys
def execute(fileName):
sys.stderr.write("error: external '{}' command called unexpectedly\n"
.format(os.path.basename(fileName)));
sys.exit(1)
|
xiangke/pycopia | refs/heads/master | core/pycopia/OS/Linux/__init__.py | 1 | #!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# $Id$
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# 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... |
xin3liang/platform_external_chromium_org_third_party_WebKit | refs/heads/master | Tools/Scripts/webkitpy/common/system/filesystem_mock_unittest.py | 59 | # Copyright (C) 2011 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 the f... |
Paul-Ezell/cinder-1 | refs/heads/master | cinder/tests/unit/api/v2/test_limits.py | 18 | # Copyright 2011 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... |
caveman-dick/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/pulp_repo.py | 33 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Joe Adams <@sysadmind>
#
# 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',
... |
akampjes/p0rk-crackling | refs/heads/master | p0rk/porkweb/urls.py | 1 | from django.conf.urls import patterns, include, url
urlpatterns = patterns('porkweb.views',
url(r'^job/(?P<jobid>\d+)/$', 'front'),
url(r"^$", "front"),
)
|
OCA/bank-statement-reconcile | refs/heads/11.0 | account_reconcile_payment_order/__init__.py | 83 | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
decvalts/iris | refs/heads/master | lib/iris/tests/unit/analysis/geometry/__init__.py | 17 | # (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... |
tmuelle2/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_input.py | 125 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... |
mitar/django | refs/heads/master | django/template/loaders/app_directories.py | 5 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.u... |
cuboxi/android_external_chromium_org | refs/heads/kitkat | ppapi/native_client/tools/browser_tester/browser_tester.py | 69 | #!/usr/bin/python
# 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.
import glob
import optparse
import os.path
import socket
import sys
import thread
import time
import urllib
# Allow the import of thir... |
krousey/test-infra | refs/heads/master | gubernator/third_party/defusedxml/ElementTree.py | 53 | # defusedxml
#
# Copyright (c) 2013 by Christian Heimes <christian@python.org>
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
"""Defused xml.etree.ElementTree facade
"""
from __future__ import print_function, absolute_import
import sys
from .common impor... |
ZazieTheBeast/oscar | refs/heads/master | tests/unit/payment/model_tests.py | 49 | import datetime
from decimal import Decimal as D
from django.test import TestCase
from oscar.core.compat import get_user_model
from oscar.apps.payment.models import Bankcard, Source
class TestBankcard(TestCase):
def test_obfuscates_number_before_saving(self):
bankcard = Bankcard(number="100001110000000... |
kvar/ansible | refs/heads/seas_master_2.9.5 | lib/ansible/galaxy/token.py | 9 | ########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fo... |
ff94315/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/encodings/cp857.py | 593 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... |
chenokay/ripozo | refs/heads/master | ripozo/adapters/base.py | 2 | """
Module containing the base adapter.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from abc import ABCMeta, abstractproperty
from ripozo.utilities import join_url_parts
import json
import six
@six.add_meta... |
Murillo/Hackerrank-Algorithms | refs/heads/master | Algorithms/Implementation/lisa-workbook.py | 1 | # Lisa's Workbook
# Developer: Murillo Grubler
# Link: https://www.hackerrank.com/challenges/lisa-workbook/problem
# Time complexity: O(n³)
import math
def workbook(n, p, chapters):
special = 0
pages = 0
for i in range(n):
pages_chapt = math.ceil(chapters[i] / p)
total = chapters[i]
... |
space-kerala/lekha_OCR_1.0 | refs/heads/master | initial_temp.py | 1 | # -*- coding: utf-8 -*-
# from __future__ import division
import cv2
import numpy as np
import glob
import shutil
from random import shuffle
import os
import json
import re
import preprocess as pp
import training as train
#import myapp as app
def temp_fucn():
url='../samples/train_images/'
s_list=sorted(os.listdir(u... |
ndawe/rootpy | refs/heads/master | rootpy/plotting/tests/test_graph.py | 2 | from rootpy.plotting import Graph, Graph2D, Hist
import tempfile
from random import random
from nose.tools import assert_equal
def test_init():
g = Graph(10, name='test')
assert_equal(len(g), 10)
g2d = Graph2D(10, name='test2d')
def test_init_from_hist():
h = Hist(100, -10, 10)
h.FillRandom('gau... |
Tyulis/ALYTtool | refs/heads/master | txtree.py | 1 | # -*- coding:utf-8 -*-
from collections import OrderedDict
class ClsFunc(object):
'''A class which emulates a function. Useful to split big functions into small modules which share data'''
def __new__(cls,*args,**kwargs):
self=object.__new__(cls)
return self.main(*args,**kwargs)
class dump (ClsFunc):
def main(... |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | script.module.liveresolver/lib/liveresolver/modules/f4mproxy/utils/python_rsakey.py | 136 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Pure-Python RSA implementation."""
from .cryptomath import *
from .asn1parser import ASN1Parser
from .rsakey import *
from .pem import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=... |
followyourheart/airflow | refs/heads/master | airflow/bin/cli.py | 4 | #!/usr/bin/env python
from __future__ import print_function
from builtins import input
import argparse
import dateutil.parser
from datetime import datetime
import logging
import os
import subprocess
import sys
import airflow
from airflow import jobs, settings, utils
from airflow.configuration import conf
from airflow.... |
jmwright/cadquery-x | refs/heads/master | gui/libs/pygments/styles/rrt.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.styles.rrt
~~~~~~~~~~~~~~~~~~~
pygments "rrt" theme, based on Zap and Emacs defaults.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Com... |
shangwuhencc/scikit-learn | refs/heads/master | sklearn/preprocessing/label.py | 137 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Joel Nothman <joel.nothman@gmail.com>
# Hamzeh Alsalhi <ha258@cornell.edu>
# Licens... |
Neurosim-lab/netpyne | refs/heads/development | examples/asdOptim/cfg.py | 2 | from netpyne import specs
cfg = specs.SimConfig()
cfg.networkType = 'simple' # 'complex'
# --------------------------------------------------------
# Simple network
# --------------------------------------------------------
if cfg.networkType == 'simple':
# Simulation options
cfg.dt = 0.025
cfg.duration = 2*1e3
... |
linyiqun/minos | refs/heads/master | owl/quota/management/commands/quota_reportor.py | 5 | import collections
import datetime
import logging
import smtplib
import sys
import time
from optparse import make_option
from os import path
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
import owl_config
import monitor.dbutil
imp... |
nrc/rustc-perf | refs/heads/master | collector/benchmarks/script-servo/components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py | 51 | def firstArgType(method):
return method.signatures()[0][1][0].type
def WebIDLTest(parser, harness):
parser.parse("""
dictionary Dict {
};
callback interface Foo {
};
interface Bar {
// Bit of a pain to get things that have dictionary types
void passDict(optional Di... |
Godiyos/python-for-android | refs/heads/master | python3-alpha/python3-src/Doc/includes/sqlite3/execute_2.py | 47 | import sqlite3
con = sqlite3.connect("mydb")
cur = con.cursor()
who = "Yeltsin"
age = 72
cur.execute("select name_last, age from people where name_last=:who and age=:age",
{"who": who, "age": age})
print(cur.fetchone())
|
deanishe/alfred-fakeum | refs/heads/master | src/libs/faker/providers/person/es_MX/__init__.py | 2 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats = (
'{{first_name}} {{last_name}} {{last_name}}',
'{{first_name}} {{first_name}} {{last_name}}',
'{{first_name}} {{first_name}} {{last_name}} ... |
davidfraser/sqlalchemy | refs/heads/master | lib/sqlalchemy/dialects/mssql/zxjdbc.py | 59 | # mssql/zxjdbc.py
# Copyright (C) 2005-2015 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:: mssql+zxjdbc
:name: zxJDBC for Jython
:dbapi: zxjdbc
:c... |
ghber/My-Django-Nonrel | refs/heads/master | django/contrib/contenttypes/generic.py | 155 | """
Classes allowing "generic" relations through ContentType and object-id fields.
"""
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import signals
from django.db import models, router, DEFAULT_DB_ALIAS
from django.db.models.fields.related import RelatedFi... |
Arabidopsis-Information-Portal/PMR_API | refs/heads/master | services/boxplot_api/service.py | 1 | # PMR WebServices
# Copyright (C) 2016 Manhoi Hur, Belyaeva, Irina
# This file is part of PMR WebServices API.
#
# PMR API 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
... |
queenp/wakatime | refs/heads/master | wakatime/packages/requests/packages/chardet/euckrfreq.py | 3120 | ######################## 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... |
polyval/CNC | refs/heads/master | flask/Lib/encodings/uu_codec.py | 37 | """ Python 'uu_codec' Codec - UU content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ell... |
cognitiveclass/edx-platform | refs/heads/master | lms/djangoapps/teams/tests/test_views.py | 18 | # -*- coding: utf-8 -*-
"""Tests for the teams API at the HTTP request level."""
import json
from datetime import datetime
import pytz
from dateutil import parser
import ddt
from elasticsearch.exceptions import ConnectionError
from mock import patch
from search.search_engine_base import SearchEngine
from django.core.u... |
mhbu50/erpnext | refs/heads/develop | erpnext/stock/report/stock_ageing/__init__.py | 12133432 | |
crcresearch/osf.io | refs/heads/develop | addons/twofactor/migrations/__init__.py | 12133432 | |
cousteaulecommandant/youtube-dl | refs/heads/master | test/__init__.py | 12133432 | |
gogogo/gogogo-hk | refs/heads/master | gogogo/__init__.py | 12133432 | |
sgput/portfolio-wptheme | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | #!/usr/bin/env python
# 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.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... |
rickerc/nova_audit | refs/heads/cis-havana-staging | nova/virt/vmwareapi/network_util.py | 11 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# 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
# ... |
dfalt974/SickRage | refs/heads/master | lib/pbr/extra_files.py | 145 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.