repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
donatello/minio-py | refs/heads/master | tests/unit/minio_mocks.py | 1 | # -*- coding: utf-8 -*-
# Minio Python Library for Amazon S3 Compatible Cloud Storage,
# (C) 2015,2016 Minio, 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.or... |
srvg/ansible | refs/heads/devel | lib/ansible/module_utils/common/_json_compat.py | 83 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import types
import json
# Detect the python-json library which... |
ushergod/column | refs/heads/master | column/api/common/utils.py | 1 | # Copyright (c) 2017 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: GPL-3.0
import json
from flask import request
import jsonschema
def validate_payload(schema, payload):
try:
jsonschema.validate(payload, schema)
except jsonschema.exceptions.ValidationError as e:
return False, ... |
tdtrask/ansible | refs/heads/devel | lib/ansible/plugins/netconf/junos.py | 5 | #
# (c) 2017 Red Hat Inc.
#
# 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 d... |
Lsquared13/nbproject | refs/heads/master | apps/img/views.py | 1 | # Create your views here.
from django.http import HttpResponse
from django.shortcuts import render_to_response
import os, sys, logging, string, random
from django.conf import settings
from django.views.static import serve
from django.http import Http404
from base import annotations
from base import utils_response as U... |
MungoRae/home-assistant | refs/heads/dev | tests/components/test_rfxtrx.py | 25 | """The tests for the Rfxtrx component."""
# pylint: disable=protected-access
import unittest
import pytest
from homeassistant.core import callback
from homeassistant.setup import setup_component
from homeassistant.components import rfxtrx as rfxtrx
from tests.common import get_test_home_assistant
@pytest.mark.skipi... |
ctaylo37/OTM2 | refs/heads/master | opentreemap/treemap/migrations/0024_auto__del_field_species_cultivar_name.py | 3 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Species.cultivar_name'
db.delete_column(u'treemap_species', 'cultivar_name')
def bac... |
ExceptionError/resultoon | refs/heads/master | lib/tyoshi.py | 1 | # -*- coding: utf-8 -*-
import cv2
import utils
class Tyoshi(object):
interval_time = 5
FRAME = cv2.imread('./templates/tyoshi/frame.png', cv2.IMREAD_GRAYSCALE)
FRAME_RECT = (314, 184, 68, 40)
NUM_RECT = (464, 200, 60, 16)
def __init__(self, config):
self.DEBUG = config.DEBUG
def m... |
nirmeshk/oh-mainline | refs/heads/master | vendor/packages/python-social-auth/social/backends/mineid.py | 72 | from social.backends.oauth import BaseOAuth2
class MineIDOAuth2(BaseOAuth2):
"""MineID OAuth2 authentication backend"""
name = 'mineid'
_AUTHORIZATION_URL = '%(scheme)s://%(host)s/oauth/authorize'
_ACCESS_TOKEN_URL = '%(scheme)s://%(host)s/oauth/access_token'
ACCESS_TOKEN_METHOD = 'POST'
SCOPE... |
ichuang/sympy | refs/heads/master | doc/ext/docscrape.py | 1 | """
Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from StringIO import StringIO
from warnings import warn
class Reader(object):
"""
A line-based string reader.
"""
def __init__(self, data):
"""
Parameters
-... |
jeasoft/odoo | refs/heads/marcos-8.0 | addons/hr_recruitment/res_config.py | 352 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-Today OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
akshara775/PerfKitBenchmarker-master-2 | refs/heads/master | perfkitbenchmarker/static_virtual_machine.py | 1 | # Copyright 2014 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
renjinghai/models | refs/heads/master | swivel/vecs.py | 20 | # Copyright 2016 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 a... |
Censio/ansible-dev | refs/heads/truemotion-master | lib/ansible/executor/play_iterator.py | 5 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 Foundation, either version 3 of the License, or
# (at your option) an... |
resmo/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_evc_mode.py | 31 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Michael Tipton <mike () ibeta.org>
# 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'... |
ichi23de5/ichi_Repo | refs/heads/master | aeroo_page_count/__init__.py | 1 | # -*- coding: utf-8 -*-
import report_xml
|
comaw/pars | refs/heads/master | vendor/bower-asset/bootstrap/test-infra/s3_cache.py | 2166 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... |
abaditsegay/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_glob.py | 58 | import unittest
from test.test_support import run_unittest, TESTFN
import glob
import os
import shutil
class GlobTests(unittest.TestCase):
def norm(self, *parts):
return os.path.normpath(os.path.join(self.tempdir, *parts))
def mktemp(self, *parts):
filename = self.norm(*parts)
base, f... |
goventurelab/djcelery-single-beat | refs/heads/master | djcelery_single_beat/management/commands/single_beat.py | 1 | from optparse import make_option
from django.core.management.base import BaseCommand
from djcelery_single_beat.process import Process
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--app'),
make_option('--pidfile'),
make_option('--schedule'),
)
... |
thimslugga/apistar | refs/heads/master | apistar/commands/__init__.py | 1 | from apistar.commands.create_tables import create_tables
from apistar.commands.new import new
from apistar.commands.run import run
from apistar.commands.schema import schema
from apistar.commands.test import test
__all__ = ['new', 'run', 'schema', 'test', 'create_tables']
|
Noviat/odoo | refs/heads/8.0 | addons/website_hr/__init__.py | 3964 | import controllers
import models
|
JamesLinEngineer/RKMC | refs/heads/Jarvis | addons/script.ftvguide/service.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Tommy Winther
# http://tommy.winther.nu
#
# Modified for FTV Guide (09/2014 onwards)
# by Thomas Geppert [bluezed] - bluezed.apps@gmail.com
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the G... |
atopuzov/nitro-python | refs/heads/master | nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationsamlpolicy.py | 3 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
ozak/geopandas | refs/heads/master | geopandas/geodataframe.py | 1 | import json
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
from shapely.geometry import mapping, shape
from shapely.geometry.base import BaseGeometry
from six import string_types, PY3
from geopandas.base import GeoPandasBase, _CoordinateIndexer
from geopandas.geoseries import GeoSeries
fr... |
UnrememberMe/pants | refs/heads/master | tests/python/pants_test/backend/codegen/antlr/python/test_antlr_py_gen.py | 7 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... |
refack/node-gyp | refs/heads/master | gyp/pylib/gyp/xcode_emulation.py | 2 | # 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.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
from __future__ import print_... |
davidharrigan/django | refs/heads/master | tests/context_processors/tests.py | 300 | """
Tests for Django's bundled context processors.
"""
from django.test import SimpleTestCase, TestCase, override_settings
@override_settings(
ROOT_URLCONF='context_processors.urls',
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS':... |
sahana/Turkey | refs/heads/master | tests/unit_tests/modules/s3/s3gis/GeoJSONLayer.py | 43 |
s3gis_tests = load_module("tests.unit_tests.modules.s3.s3gis")
def test_GeoJSONLayer():
s3gis_tests.layer_test(
db,
db.gis_layer_geojson,
dict(
name = "Test GeoJSON",
description = "Test GeoJSON layer",
enabled = True,
created_on = datetime.d... |
jank3/django | refs/heads/master | django/conf/locale/te/formats.py | 619 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'g:i A'
# DA... |
axbaretto/beam | refs/heads/master | sdks/python/.tox/docs/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2768 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
miquelramirez/aptk | refs/heads/master | toolkit/tools/lama-adl-compiler/pddl/pretty_print.py | 10 | #######################################################################
#
# Author: Malte Helmert (helmert@informatik.uni-freiburg.de)
# (C) Copyright 2003-2004 Malte Helmert
#
# This file is part of LAMA.
#
# LAMA is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Li... |
tlakshman26/cinder-https-changes | refs/heads/master | cinder/tests/unit/test_tintri.py | 8 | # Copyright (c) 2015 Tintri. 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 ap... |
jabibi/sale-workflow | refs/heads/8.0 | sale_order_type/models/stock_picking.py | 8 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import api, models
class StockPicking(mod... |
apache/incubator-allura | refs/heads/master | Allura/allura/tests/test_globals.py | 1 | # -*- 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 Apach... |
christer155/PTVS | refs/heads/master | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/string_escape.py | 93 | # -*- coding: iso-8859-1 -*-
""" Python 'escape' Codec
Written by Martin v. Löwis (martin@v.loewis.de).
"""
import codecs
class Codec(codecs.Codec):
encode = codecs.escape_encode
decode = codecs.escape_decode
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, f... |
okoye/json-grammer-nazi | refs/heads/master | examples/sample_override.py | 2 | #!/usr/bin/env python
#:coding=utf-8:
#:tabSize=2:indentSize=2:noTabs=true:
#:folding=explicit:collapseFolds=1:
import re, simplejson, types, jsonschema
from jsonschema.validator import JSONSchemaValidator
class FunctionValidator(JSONSchemaValidator):
'''FunctionValidator extends the JSONSchemaValidator to... |
theskumar-archive/gevent-socketio | refs/heads/dev | socketio/transports.py | 1 | import urllib
import urlparse
from gevent.queue import Empty
from geventwebsocket import WebSocketError
class BaseTransport(object):
"""Base class for all transports. Mostly wraps handler class functions."""
def __init__(self, handler, config, **kwargs):
"""Base transport class.
:param conf... |
amith01994/intellij-community | refs/heads/master | python/testData/psi/MissingParenInCall.py | 83 | def get_key():
if isinstance(self.instance,
def clean():
pass
|
Metaswitch/horizon | refs/heads/master | horizon/templatetags/parse_date.py | 75 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
mcking49/apache-flask | refs/heads/master | Python/Lib/site-packages/astroid/node_classes.py | 9 | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... |
ankkamies/mfwgallery-api | refs/heads/master | api/mfwgallery/settings-kapsi.py | 1 | """
Django settings for ankkabot project. For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see ... |
07151129/capstone | refs/heads/master | bindings/python/test_sparc.py | 33 | #!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
from capstone.sparc import *
from xprint import to_x, to_hex, to_x_32
SPARC_CODE = b"\x80\xa0\x40\x02\x85\xc2\x60\x08\x85\xe8\x20\x01\x81\xe8\x00\x00\x90\x10\x20\x01... |
thalamus/Flexget | refs/heads/develop | flexget/plugins/output/memusage.py | 15 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import options, plugin
from flexget.event import event
from flexget.logger import console
try:
from guppy import hpy
except ImportError:
# this will leave the plugin unloaded
raise plugin.DependencyError(issued_... |
idncom/odoo | refs/heads/8.0 | openerp/modules/db.py | 442 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
IMCG/iMapReduce | refs/heads/master | src/contrib/hive/serde/src/gen-py/org_apache_hadoop_hive_serde/ttypes.py | 22 | #
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
|
zerc/django | refs/heads/master | django/contrib/admin/apps.py | 459 | from django.apps import AppConfig
from django.contrib.admin.checks import check_admin_app
from django.core import checks
from django.utils.translation import ugettext_lazy as _
class SimpleAdminConfig(AppConfig):
"""Simple AppConfig which does not do automatic discovery."""
name = 'django.contrib.admin'
... |
nkhuyu/graphite-web | refs/heads/master | webapp/tests/test_util.py | 29 | from django.test import TestCase
from graphite import util
from graphite.wsgi import application # NOQA makes sure we have a working WSGI app
class UtilTest(TestCase):
def test_is_local_interface(self):
addresses = ['127.0.0.1', '127.0.0.1:8080', '8.8.8.8']
results = [ util.is_local_interface(a)... |
bankonme/aptly | refs/heads/master | system/t06_publish/swift.py | 12 | from swift_lib import SwiftTest
def strip_processor(output):
return "\n".join([l for l in output.split("\n") if not l.startswith(' ') and not l.startswith('Date:')])
class SwiftPublish1Test(SwiftTest):
"""
publish to Swift: from repo
"""
fixtureCmds = [
"aptly repo create -distribution=m... |
rahul67/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/core/management/commands/loaddata.py | 98 | from __future__ import unicode_literals
import glob
import gzip
import os
import zipfile
from optparse import make_option
import warnings
from django.conf import settings
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.core.management.color import no_s... |
rbaindourov/v8-inspector | refs/heads/master | Source/chrome/tools/perf/page_sets/tough_path_rendering_cases.py | 5 | # Copyright 2015 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class ToughPathRenderingCasesPage(page_module.Page):
... |
jhrozek/samba-ldb-mdb | refs/heads/master | third_party/dnspython/dns/rdtypes/ANY/RRSIG.py | 76 | # Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
drxaero/calibre | refs/heads/master | src/calibre/gui2/convert/comic_input.py | 14 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.convert.comic_input_ui import Ui_Form
from calibre.gui2.convert i... |
bcl/pykickstart | refs/heads/master | tests/commands/realm.py | 3 | import unittest
from tests.baseclass import CommandTest, CommandSequenceTest
from pykickstart.commands.realm import F19_Realm
from pykickstart.version import F19
class Realm_TestCase(unittest.TestCase):
def runTest(self):
cmd = F19_Realm()
# additional code coverage
self.assertEqual(cmd.__s... |
mscuthbert/abjad | refs/heads/master | abjad/tools/datastructuretools/TypedCollection.py | 2 | # -*- encoding: utf-8 -*-
import abc
from abjad.tools.abctools.AbjadObject import AbjadObject
class TypedCollection(AbjadObject):
r'''Abstract base class for typed collections.
'''
### CLASS VARIABLES ###
__slots__ = (
'_collection',
'_item_class',
)
### INITIALIZER ###
... |
mccxj/online-judge-code-example | refs/heads/master | projecteuler/p0005_test.py | 2 | import unittest
class Test0005(unittest.TestCase):
def test_problem(self):
s = 2 * 3 * 5 * 7 * 11 * 13 * 17 * 19
s *= 8 # for 12,16,20
s *= 3 # for 18
self.assertEqual(s, 232792560) |
HubSpot/kubernetes | refs/heads/v1.7.3-hubspot | cluster/juju/layers/kubernetes-worker/lib/charms/kubernetes/flagmanager.py | 290 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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... |
akash1808/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/contrib/test_used_limits.py | 26 | # 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... |
netvigator/myPyPacks | refs/heads/master | pyPacks/String/Dumpster.py | 2 | #!/usr/bin/pythonTest
# -*- coding: utf-8 -*-
#
# string functions Dumpster
#
# 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 ver... |
richese/i3pystatus | refs/heads/master | setup.py | 11 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name="i3pystatus",
version="3.35",
description="A complete replacement for i3status",
url="http://github.com/enkore/i3pystatus",
license="MIT",
classifiers=[
"Development Status :: 4 - Beta",
"Env... |
georgesterpu/pyVSR | refs/heads/master | pyVSR/ouluvs2/__init__.py | 1 | from . import files |
scemama/f77_zmq | refs/heads/master | create_f77_zmq_h.py | 2 | #!/usr/bin/env python
#
# f77_zmq : Fortran 77 bindings for the ZeroMQ library
# Copyright (C) 2014 Anthony Scemama
#
#
# 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; eith... |
kleskjr/scipy | refs/heads/master | scipy/linalg/tests/test_cython_lapack.py | 50 | from numpy.testing import TestCase, run_module_suite, assert_allclose
from scipy.linalg import cython_lapack as cython_lapack
from scipy.linalg import lapack
class test_lamch(TestCase):
def test_slamch(self):
for c in [b'e', b's', b'b', b'p', b'n', b'r', b'm', b'u', b'l', b'o']:
assert_allclo... |
raychorn/knowu | refs/heads/master | django/djangononrelsample2/django/db/backends/postgresql_psycopg2/creation.py | 107 | import psycopg2.extensions
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can conta... |
dobestan/fastblog | refs/heads/develop | fastblog/communications/admin/__init__.py | 276 | from .base import *
|
robe16/kiosk.grandparent-message-board | refs/heads/master | src/run.py | 1 | import os
import sys
from bottle import error, HTTPError, get, run, static_file, HTTPResponse
from web.web_create_error import create_error
from web.web_create_home import create_home
from log.log import log_general, log_error
from axiscare.url_process import start_url_updater
from axiscare.carer_info import carer_i... |
ifuding/Kaggle | refs/heads/master | TCCC/Code/nfold_train.py | 1 | from sklearn.model_selection import KFold
from lgb import lgbm_train
import xgboost as xgb
from functools import reduce
import numpy as np
from keras_train import keras_train
import gensim
from RCNN_Keras import get_word2vec, RCNN_Model
from RNN_Keras import RNN_Model
from CNN_Keras import CNN_Model, get_word2vec_embed... |
jigarkb/Programming | refs/heads/master | LeetCode/412-E-FizzBuzz.py | 2 | # coding=utf-8
# Write a program that outputs the string representation of numbers from 1 to n.
#
# But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.
# For numbers which are multiples of both three and five output “FizzBuzz”.
#
# Example:
#
# n = 15,
... |
piannucci/blurt | refs/heads/master | blurt_py_80211/streaming/blurt/audio/graph_adapter.py | 1 | # adapter from audio stream to asynchronous graph
import time
import warnings
import numpy as np
from typing import Tuple
import queue
from . import AudioHardware as AH
from ..graph import Port, Block, UnderrunWarning
from ..graph.typing import Array
from .stream import IOStream
class InStream_SourceBlock(IOStream, Bl... |
RickMohr/nyc-trees | refs/heads/develop | src/nyc_trees/apps/survey/urls/survey.py | 1 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.conf.urls import patterns, url
from apps.survey.routes import (survey, survey_from_event,
flag_survey, survey_detail,
... |
mzdaniel/oh-mainline | refs/heads/master | mysite/missions/migrations/0005_add_diffpatch_diffrecursive.py | 119 | # This file is part of OpenHatch.
# Copyright (C) 2010 John Stumpo
#
# 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 versi... |
cpwr/mediasite | refs/heads/master | app/admin/forms.py | 1 | from flask_wtf import Form
from flask_wtf.file import FileRequired
from flask_wtf.file import FileField
from wtforms.fields.simple import SubmitField
class PhotoForm(Form):
photo = FileField(
label='Upload your file here',
validators=[FileRequired()],
)
submit_button = SubmitField(
... |
iRGBit/python-instagram | refs/heads/master | instagram/client.py | 33 | from . import oauth2
from .bind import bind_method
from .models import MediaShortcode, Media, User, Location, Tag, Comment, Relationship
MEDIA_ACCEPT_PARAMETERS = ["count", "max_id"]
SEARCH_ACCEPT_PARAMETERS = ["q", "count"]
SUPPORTED_FORMATS = ['json']
class InstagramAPI(oauth2.OAuth2API):
host = "api.instagr... |
pandeyadarsh/sympy | refs/heads/master | sympy/core/symbol.py | 57 | from __future__ import print_function, division
from sympy.core.assumptions import StdFactKB
from sympy.core.compatibility import string_types, range
from .basic import Basic
from .sympify import sympify
from .singleton import S
from .expr import Expr, AtomicExpr
from .cache import cacheit
from .function import Functi... |
shakna-israel/rst2pdf | refs/heads/master | rst2pdf/config.py | 10 | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
"""Singleton config object"""
import ConfigParser
import os
from rst2pdf.rson import loads
cfdir = os.path.join(os.path.expanduser('~'), '.rst2pdf')
cfname = os.path.join(cfdir, 'config')
def getValue(section, key, default=None):
section = section.l... |
projectcalico/calico-nova | refs/heads/calico-readme | nova/tests/functional/v3/test_multiple_create.py | 13 | # Copyright 2012 Nebula, Inc.
# Copyright 2014 IBM Corp.
#
# 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... |
JGarcia-Panach/odoo | refs/heads/8.0 | addons/account/project/wizard/account_analytic_inverted_balance_report.py | 378 | # -*- 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... |
maellak/invenio | refs/heads/master | modules/miscutil/lib/invenio_connector.py | 16 | # -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2013 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 you... |
inercia/evy | refs/heads/develop | evy/web/websocket.py | 1 | #
# Evy - a concurrent networking library for Python
#
# Unless otherwise noted, the files in Evy are under the following MIT license:
#
# Copyright (c) 2012, Alvaro Saurin
# Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS)
# Copyright (c) 2007-2010, Linden Research, Inc.
# Copyright (c) 2005-2006, Bob Ippo... |
srinia6/RackHD | refs/heads/master | test/tests/rackhd20/test_rackhd20_api_config.py | 12 | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
from nose.plugins.attrib import attr
@attr(all=True, regression=True, smoke=True)
class rackhd20_api_config(fit_common.unittest.TestCase):
def test_api_20_co... |
dstufft/recliner | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from setuptools import setup, find_packages
__about__ = {}
with open("recliner/__about__.py") as fp:
exec(fp.read(), None, __about__)
setup(
name=__about__["__title__"],
version=__about__["__version__"],
description=__about__["__summary__"],
long_description=open("README.rs... |
TheSeanBrady/crtc.bcs.versa | refs/heads/master | asteriskSource/build_tools/post_process_documentation.py | 6 | #! /usr/bin/env python
# vin: sw=3 et:
'''
Copyright (C) 2012, Digium, Inc.
Matt Jordan <mjordan@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
'''
import sys
import os
import optparse
import xml.dom.minidom
from xml.dom.minidom import Element, par... |
mcclurmc/juju | refs/heads/master | juju/providers/local/tests/test_provider.py | 1 | import logging
import os
import pwd
from StringIO import StringIO
import zookeeper
from twisted.internet.defer import succeed, inlineCallbacks
from txzookeeper.tests.utils import deleteTree
from juju.errors import ProviderError, EnvironmentNotFound
from juju.lib.lxc import LXCContainer
from juju.lib.zk import Zookee... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/ctypes/test/test_macholib.py | 36 | import os
import sys
import unittest
# Bob Ippolito:
"""
Ok.. the code to find the filename for __getattr__ should look
something like:
import os
from macholib.dyld import dyld_find
def find_lib(name):
possible = ['lib'+name+'.dylib', name+'.dylib',
name+'.framework/'+name]
for dylib in possible:
... |
isandlaTech/cohorte-demos | refs/heads/dev | led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/sleekxmpp/plugins/xep_0016/privacy.py | 13 | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp import Iq
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins import BasePlugin
from s... |
ShawnPengxy/Flask-madeBlog | refs/heads/master | site-packages/requests/compat.py | 87 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import charade as chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.... |
GaloisInc/hacrypto | refs/heads/master | src/C/john-1.8.0-jumbo-1/run/sipdump2john.py | 2 | #!/usr/bin/env python
"""sipdump2john.py processes sipdump output files (dump files)
into a format suitable for use with JtR."""
import sys
def process_file(filename):
with open(filename, "r") as f:
for line in f.readlines():
line = line.rstrip().replace('"', '*').replace(':', '*')
... |
gyllstar/appleseed | refs/heads/debugger | pox/lib/packet/packet_utils.py | 8 | # Copyright 2011 James McCauley
# Copyright 2008 (C) Nicira, Inc.
#
# This file is part of POX.
#
# POX 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) an... |
gorjuce/odoo | refs/heads/8.0 | addons/hr_payroll/report/report_payslip.py | 377 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... |
nthiep/global-ssh-server | refs/heads/master | lib/python2.7/site-packages/django/contrib/gis/geometry/backend/geos.py | 315 | from django.contrib.gis.geos import (
GEOSGeometry as Geometry, GEOSException as GeometryException)
|
r-lyeh/scriptorium | refs/heads/master | python/micropython/tests/basics/continue.py | 118 | for i in range(4):
print('one', i)
if i > 2:
continue
print('two', i)
for i in range(4):
print('one', i)
if i < 2:
continue
print('two', i)
for i in [1, 2, 3, 4]:
if i == 3:
continue
print(i)
|
dominicrodger/millionmilestogether | refs/heads/master | tests/modeltests/test_user.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from django.contrib.auth import get_user_model
from django.core import mail
from millionmilestogether.models import Invitation, RegisteredUser
from millionmilestogether.models.account import InvitationException
def test_registered_in_tests... |
NickelMedia/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.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 the ... |
sve-odoo/odoo | refs/heads/master | addons/website_event/tests/__init__.py | 413 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 20123TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
johnbachman/indra | refs/heads/master | indra/sources/omnipath/processor.py | 4 | from __future__ import unicode_literals
import logging
from indra.statements.validate import validate_text_refs
from indra.ontology.standardize import standardize_agent_name
from indra.statements import modtype_to_modclass, Agent, Evidence, Complex, \
get_statement_by_name as stmt_by_name, BoundCondition
logger = ... |
gustnxodjs/Openwrt_Project | refs/heads/master | scripts/dl_cleanup.py | 202 | #!/usr/bin/env python
"""
# OpenWRT download directory cleanup utility.
# Delete all but the very last version of the program tarballs.
#
# Copyright (C) 2010 Michael Buesch <mb@bu3sch.de>
# Copyright (C) 2013 OpenWrt.org
"""
import sys
import os
import re
import getopt
# Commandline options
opt_dryrun = False
def ... |
quickresolve/accel.ai | refs/heads/master | flask-aws/lib/python2.7/site-packages/dateutil/_common.py | 48 | """
Common code used in multiple modules.
"""
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
def __call__(self, n):
if n == self.n:
return self
else:
return self.__class__(s... |
Justin-Yuan/Image2Music-Generator | refs/heads/master | library/jython2.5.3/Lib/test/zxjdbc/runner.py | 19 | # Jython Database Specification API 2.0
#
# Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com>
"""
To run the tests, simply invoke this script from the commandline:
jython runner.py <xml config file> [vendor, ...]
If no vendors are given, then all vendors will be tested. If a
vendor is given, then only that vend... |
crohling/streamparse | refs/heads/master | streamparse/util.py | 6 | from __future__ import absolute_import, print_function, unicode_literals
import os
import re
import shutil
import sys
from glob import glob
from random import shuffle
import requests
import simplejson as json
from fabric.api import env
from fabric.colors import red
from invoke import run
from pkg_resources import par... |
andrewgailey/robogen | refs/heads/master | robogen/rgkit/backup bots/stupid261.py | 1 | # stupid 2.6.1 by peterm
import random
import math
import rg
def around(l):
return rg.locs_around(l)
def diag(l1, l2):
if rg.wdist(l1, l2) == 2:
if abs(l1[0] - l2[0]) == 1:
return True
return False
def infront(l1, l2):
if rg.wdist(l1, l2) == 2:
if diag(l1, l2):
... |
PoundPay/wtforms | refs/heads/master | wtforms/ext/appengine/fields.py | 14 | import decimal
import operator
import warnings
from wtforms import fields, widgets
class ReferencePropertyField(fields.SelectFieldBase):
"""
A field for ``db.ReferenceProperty``. The list items are rendered in a
select.
:param reference_class:
A db.Model class which will be used to generate t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.