repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
BartoszCichecki/onlinepython | onlinepython/pypy-2.4.0-win32/lib-python/2.7/ctypes/_endian.py | 124 | 2212 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys
from ctypes import *
_array_type = type(Array)
def _other_endian(typ):
"""Return the type ... | gpl-2.0 |
jeffaudi/osm-hybrid | imposm-mapping.py | 16 | 12008 | # Copyright 2011 Omniscale (http://omniscale.com)
#
# 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 o... | bsd-3-clause |
JonnyH/pyra-kernel | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
shekkizh/TensorflowProjects | ImageArt/ImageColoring.py | 1 | 7092 | __author__ = 'Charlie'
"""Image coloring by fully convolutional networks - incomplete """
import numpy as np
import tensorflow as tf
import os, sys, inspect
from datetime import datetime
import scipy.misc as misc
lib_path = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.curren... | mit |
fuselock/odoo | openerp/addons/base/tests/test_res_config.py | 398 | 3532 | import unittest2
import openerp
import openerp.tests.common as common
class test_res_config(common.TransactionCase):
def setUp(self):
super(test_res_config, self).setUp()
self.res_config = self.registry('res.config.settings')
# Define the test values
self.menu_xml_id = 'base.menu... | agpl-3.0 |
Mitchkoens/sympy | sympy/solvers/tests/test_solvers.py | 6 | 68458 | from sympy import (
Abs, And, Derivative, Dummy, Eq, Float, Function, Gt, I, Integral,
LambertW, Lt, Matrix, Or, Piecewise, Poly, Q, Rational, S, Symbol,
Wild, acos, asin, atan, atanh, cos, cosh, diff, erf, erfinv, erfc,
erfcinv, exp, im, log, pi, re, sec, sin,
sinh, solve, solve_linear, sqrt, sstr,... | bsd-3-clause |
sanket4373/keystone | keystone/tests/test_base64utils.py | 4 | 8436 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
marty331/jakesclock | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## 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 ... | gpl-2.0 |
mozilla/airmozilla | airmozilla/new/eventemails.py | 9 | 2096 | import sys
import datetime
import traceback
from django.conf import settings
from django.utils import timezone
from airmozilla.main.models import Event, EventEmail, get_profile_safely
from airmozilla.new import sending
def send_new_event_emails(verbose=False):
now = timezone.now()
yesterday = now - datetime... | bsd-3-clause |
eneabio/nova | nova/api/openstack/extensions.py | 5 | 12586 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2011 Justin Santa Barbara
# 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... | apache-2.0 |
tbabej/freeipa | ipalib/pkcs10.py | 1 | 9170 | # Authors:
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... | gpl-3.0 |
g-weatherill/oq-hazardlib | openquake/hazardlib/geo/surface/gridded.py | 4 | 6652 | # The Hazard Library
# Copyright (C) 2012-2015, GEM Foundation
#
# 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.
... | agpl-3.0 |
drglove/SickRage | lib/github/tests/Authentication.py | 39 | 3397 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
bob-the-hamster/commandergenius | project/jni/python/src/Tools/i18n/pygettext.py | 86 | 22104 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Originally written by Barry Warsaw <barry@zope.com>
#
# Minimally patched to make it even more xgettext compatible
# by Peter Funk <pf@artcom-gmbh.de>
#
# 2002-11-22 Jürgen Hermann <jh@web.de>
# Added checks that _() only contains string literals, and
# command line... | lgpl-2.1 |
julianjmaurer/kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 338 | 2122 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
nagyistoce/edx-platform | lms/djangoapps/shoppingcart/migrations/0001_initial.py | 182 | 12544 | # -*- 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):
# Adding model 'Order'
db.create_table('shoppingcart_order', (
('id', self.gf('django.db.models.... | agpl-3.0 |
iamutkarshtiwari/sympy | sympy/functions/elementary/tests/test_integers.py | 39 | 6533 | from sympy import Symbol, floor, nan, oo, E, symbols, ceiling, pi, Rational, \
Float, I, sin, exp, log, factorial, frac
from sympy.utilities.pytest import XFAIL
x = Symbol('x')
i = Symbol('i', imaginary=True)
y = Symbol('y', real=True)
k, n = symbols('k,n', integer=True)
def test_floor():
assert floor(nan) ... | bsd-3-clause |
vdmann/cse-360-image-hosting-website | lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/namedwizardtests/urls.py | 320 | 1039 | from django.conf.urls import patterns, url
from django.contrib.formtools.tests.wizard.namedwizardtests.forms import (
SessionContactWizard, CookieContactWizard, Page1, Page2, Page3, Page4)
def get_named_session_wizard():
return SessionContactWizard.as_view(
[('form1', Page1), ('form2', Page2), ('form3'... | mit |
wuhengzhi/chromium-crosswalk | tools/android/loading/cloud/backend/google_storage_accessor.py | 10 | 2533 | # Copyright 2016 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 gcloud.exceptions
import gcloud.storage
class GoogleStorageAccessor(object):
"""Utility class providing helpers for Google Cloud Storage.
"""
... | bsd-3-clause |
tshirtman/ultimate-smash-friends | usf/screens/configure.py | 1 | 2357 | ################################################################################
# copyright 2009 Gabriel Pettier <gabriel.pettier@gmail.com> #
# #
# This file is part of Ultimate Smash Friends. ... | gpl-3.0 |
NeCTAR-RC/cinder | cinder/tests/zonemanager/test_brcd_fc_zone_client_cli.py | 2 | 12213 | # (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 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
# a copy of the License at
#
# ... | apache-2.0 |
mitchrule/Miscellaneous | Django_Project/django/Lib/site-packages/pip/req/req_file.py | 17 | 9094 | """
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req_install import ... | mit |
nickmilon/mongoUtils | mongoUtils/importsExports.py | 1 | 8999 | """Classes used to import/export data to mongoDB
"""
from Hellas.Thebes import format_header
xlrd = None # reserved to import xlrd on demand
def _xlrd_on_demand():
global xlrd
if xlrd is None:
try:
import xlrd
except ImportError:
print ("this module requires xlrd lib... | apache-2.0 |
schwansee/kubernetes-deploy | vendor/github.com/ugorji/go/codec/test.py | 1138 | 3876 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
Leberwurscht/OfflineDict | buildindex.py | 1 | 1491 | #!/usr/bin/python
# -*- coding: utf8 -*-
import sys, re
filename = sys.argv[1]
tokensize = int(sys.argv[2])
numbersize = int(sys.argv[3])
numbersize2 = int(sys.argv[4])
def normalize(s):
r = s.lower()
r = r.replace(u'ä',u'a');
r = r.replace(u'ö',u'o');
r = r.replace(u'ü',u'u');
r = r.replace(u'Ä',u'A');
r... | mpl-2.0 |
doot/CouchPotatoServer | libs/chardet/chardistribution.py | 2755 | 9226 | ######################## 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... | gpl-3.0 |
vFense/vFenseAgent-nix | agent/deps/rpm/Python-2.7.5/lib/python2.7/test/test_mhlib.py | 126 | 11142 | """
Tests for the mhlib module
Nick Mathewson
"""
### BUG: This suite doesn't currently test the mime functionality of
### mhlib. It should.
import unittest
from test.test_support import run_unittest, TESTFN, import_module
import os, StringIO
import sys
mhlib = import_module('mhlib', deprecated=True)
if ... | lgpl-3.0 |
PhillipTaylor/ReactionBot | src/plugins/show_page_title.py | 2 | 1026 | #!/usr/bin/env python
# -*- coding: utf-8
import re
from zope.interface import implements
from twisted.web.client import getPage
from core.plugins.interface import IActionHandler
from core.plugins.manager import plugin_manager
class TitleFetcher(object):
implements(IActionHandler)
rx_url = re.compile(r'\... | mit |
isohybrid/dotfile | vim/bundle/git:--github.com-klen-python-mode/pylibs/logilab/astng/scoped_nodes.py | 1 | 34414 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# copyright 2003-2010 Sylvain Thenault, all rights reserved.
# contact mailto:thenault@gmail.com
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redi... | bsd-2-clause |
colemanbroad/ndtess | share/pybind11/tests/test_copy_move.py | 30 | 4555 | import pytest
from pybind11_tests import copy_move_policies as m
def test_lacking_copy_ctor():
with pytest.raises(RuntimeError) as excinfo:
m.lacking_copy_ctor.get_one()
assert "the object is non-copyable!" in str(excinfo.value)
def test_lacking_move_ctor():
with pytest.raises(RuntimeError) as e... | bsd-3-clause |
lobachevzky/NLP-Project | env/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py | 374 | 4053 | import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(c... | mit |
srivassumit/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/_stream_hybi.py | 628 | 31933 | # Copyright 2012, 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... | mpl-2.0 |
botswana-harvard/tshilo-dikotla | td_infant/models/infant_birth_data.py | 1 | 2659 | from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from edc_constants.choices import YES_NO, GENDER
from .infant_crf_model import InfantCrfModel
class InfantBirthData(InfantCrfModel):
""" A model completed by the user on the infant's birth exam. """
infant_... | gpl-2.0 |
EnriqueSoria/Series-my | series.py | 1 | 8682 | # -*- coding: utf-8 -*-
directorios = \
r'''
D:/Series
'''.split('\n')
'''
Traducción para algunos géneros
'''
gen = {
'Crime': u'Crimen',
'Action': u'Acción',
'Drama': u'Drama',
'Comedy': u'Comedia',
'Adventure': u'Aventuras',
'Thriller': u'Thriller'
}
... | mit |
xfournet/intellij-community | python/lib/Lib/site-packages/django/db/backends/dummy/base.py | 89 | 1515 | """
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import *
from django.db.back... | apache-2.0 |
beni55/django | django/contrib/contenttypes/views.py | 124 | 3575 | from __future__ import unicode_literals
from django import http
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.requests import RequestSite
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
def sh... | bsd-3-clause |
samehuman/gensim | docs/src/conf.py | 25 | 7178 | # -*- coding: utf-8 -*-
#
# gensim documentation build configuration file, created by
# sphinx-quickstart on Wed Mar 17 13:42:21 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | gpl-3.0 |
scipy/scipy | scipy/odr/models.py | 19 | 7660 | """ Collection of Model instances for use with the odrpack fitting package.
"""
import numpy as np
from scipy.odr.odrpack import Model
__all__ = ['Model', 'exponential', 'multilinear', 'unilinear', 'quadratic',
'polynomial']
def _lin_fcn(B, x):
a, b = B[0], B[1:]
b.shape = (b.shape[0], 1)
ret... | bsd-3-clause |
jeffzheng1/tensorflow | tensorflow/contrib/framework/python/ops/ops.py | 74 | 2164 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
pyload/pyload | src/pyload/plugins/decrypters/TusfilesNetFolder.py | 2 | 1586 | # -*- coding: utf-8 -*-
import math
import re
import urllib.parse
from ..base.xfs_decrypter import XFSDecrypter
class TusfilesNetFolder(XFSDecrypter):
__name__ = "TusfilesNetFolder"
__type__ = "decrypter"
__version__ = "0.17"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?tusfiles\.n... | agpl-3.0 |
psav/cfme_tests | cfme/utils/template/base.py | 2 | 8515 | from contextlib import closing
from threading import Lock
from urllib2 import urlopen, URLError
from fauxfactory import gen_alphanumeric
from cfme.utils import trackerbot
from cfme.utils.conf import cfme_data, credentials
from cfme.utils.log import logger
from cfme.utils.providers import get_mgmt
from cfme.utils.ssh ... | gpl-2.0 |
advisory/djangosaml2_tenant | setup.py | 1 | 1850 | # Copyright (C) 2015 Education Advisory Board
# Copyright (C) 2011-2012 Yaco Sistemas
#
# 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... | apache-2.0 |
pearsonlab/nipype | nipype/interfaces/afni/tests/test_auto_TCorrelate.py | 11 | 1334 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..preprocess import TCorrelate
def test_TCorrelate_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefaul... | bsd-3-clause |
rogerwang/chromium | tools/site_compare/command_line.py | 179 | 27397 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Parse a command line, retrieving a command and its arguments.
Supports the concept of command line commands, each with its own ... | bsd-3-clause |
Adamssss/projectEuler | Problem 001-150 Python/pb050.py | 1 | 1068 | import math
import time
t1 = time.time()
prime = [2,3,5]
primen = 2
while primen < 547:
b = prime[primen]
t = 1
while (t == 1):
b = b+2
i = 0
t = 0
while (prime[i]*prime[i] < b)and (t == 0):
i=i+1
if (b%prime[i] == 0):
t = 1
... | mit |
drawks/ansible | contrib/inventory/infoblox.py | 110 | 3600 | #!/usr/bin/env python
#
# (c) 2018, 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 v... | gpl-3.0 |
BiznetGIO/horizon | openstack_dashboard/dashboards/project/routers/extensions/extraroutes/tables.py | 56 | 2682 | # Copyright 2015, Thales Services SAS
# 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... | apache-2.0 |
mkasick/android_kernel_samsung_jfltevzw | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
jbzdak/edx-platform | common/lib/xmodule/xmodule/lti_2_util.py | 44 | 16145 | # pylint: disable=attribute-defined-outside-init
"""
A mixin class for LTI 2.0 functionality. This is really just done to refactor the code to
keep the LTIModule class from getting too big
"""
import json
import re
import mock
import urllib
import hashlib
import base64
import logging
from webob import Response
from x... | agpl-3.0 |
kuiwei/edx-platform | lms/djangoapps/course_wiki/plugins/markdownedx/mdx_image.py | 151 | 2077 | #!/usr/bin/env python
'''
Image Embedding Extension for Python-Markdown
======================================
Converts lone links to embedded images, provided the file extension is allowed.
Ex:
http://www.ericfehse.net/media/img/ef/blog/django-pony.jpg
becomes
<img src="http://www.ericfehse.net/media/img... | agpl-3.0 |
angadpc/Alexa-Project- | twilio/rest/api/v2010/account/available_phone_number/local.py | 1 | 16142 | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page i... | mit |
jmcarp/django | tests/gis_tests/gdal_tests/test_ds.py | 273 | 11450 | import os
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from ..test_data import TEST_DATA, TestDS, get_ds_file
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.... | bsd-3-clause |
rbian/avocado-vt | shared/scripts/multicast_guest.py | 26 | 1135 | #!/usr/bin/python
import socket
import struct
import os
import signal
import sys
# -*- coding: utf-8 -*-
"""
Script used to join machine into multicast groups.
:author Amos Kong <akong@redhat.com>
"""
if __name__ == "__main__":
if len(sys.argv) < 4:
print """%s [mgroup_count] [prefix] [suffix]
mg... | gpl-2.0 |
djkonro/client-python | kubernetes/client/models/v1beta1_replica_set_list.py | 2 | 6560 | # 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
... | apache-2.0 |
nerzhul/ansible | lib/ansible/vars/unsafe_proxy.py | 20 | 4691 | # PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
# --------------------------------------------
#
# 1. This LICENSE AGREEMENT is between the Python Software Foundation
# ("PSF"), and the Individual or Organization ("Licensee") accessing and
# otherwise using this software ("Python") in source or binary form and
# its ass... | gpl-3.0 |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/sre_constants.py | 54 | 7182 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | apache-2.0 |
Chive/django-poll-app | mysite/settings.py | 10 | 5485 | import os
# Django settings for mysite project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_p... | bsd-3-clause |
scripni/rethinkdb | external/v8_3.30.33.16/tools/run_perf.py | 36 | 16477 | #!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Performance runner for d8.
Call e.g. with tools/run-perf.py --arch ia32 some_suite.json
The suite json format is expected to be... | agpl-3.0 |
pshen/ansible | lib/ansible/plugins/terminal/sros.py | 43 | 1387 | #
# (c) 2016 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... | gpl-3.0 |
r8/scrapy-kinopoisk | kinopoisk/pipelines.py | 1 | 2920 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
import sys
import codecs
from slugify import slugify
from time import strptime, strftime
from html2text import html2... | gpl-3.0 |
Lujeni/ansible | lib/ansible/modules/network/nxos/nxos_lldp.py | 107 | 2969 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
charlescearl/VirtualMesos | src/webui/bottle-0.8.3/test/tools.py | 6 | 4511 | # -*- coding: utf-8 -*-
import bottle
import threading
import urllib
import urllib2
import sys
import time
import unittest
import wsgiref
import wsgiref.simple_server
import wsgiref.util
import wsgiref.validate
from StringIO import StringIO
try:
from io import BytesIO
except:
BytesIO = None
pass
import mim... | apache-2.0 |
asphalt-framework/asphalt-wamp | tests/test_client.py | 1 | 15009 | import asyncio
import logging
import os
import re
from typing import Dict, Any
import pytest
from autobahn.wamp import ApplicationError
from autobahn.wamp.types import Challenge, PublishOptions, CallOptions
from asphalt.core import executor, Context, qualified_name
from asphalt.exceptions import ExtrasProvider
from a... | apache-2.0 |
Yen-Chung-En/2015cdb_g1 | static/Brython3.1.3-20150514-095342/Lib/xml/dom/pulldom.py | 850 | 11761 | import xml.sax
import xml.sax.handler
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"
class PullDOM(... | agpl-3.0 |
datagutten/comics | comics/accounts/urls.py | 1 | 4857 | from django.conf import settings
from django.conf.urls import patterns, url
from django.contrib.auth import views as auth_views
from django.views.generic.base import TemplateView
from invitation import views as invitation_views
from registration import views as reg_views
from comics.accounts.forms import (
Authen... | agpl-3.0 |
yofukuda/Yoblg | node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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 easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
imoverclocked/ServoBot | apwm_home/controller/controller/wsgi.py | 1 | 1142 | """
WSGI config for controller project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | mit |
dstufft/sqlalchemy | test/dialect/postgresql/test_query.py | 20 | 35844 | # coding: utf-8
from sqlalchemy.testing import AssertsExecutionResults, eq_, \
assert_raises_message, AssertsCompiledSQL
from sqlalchemy import Table, Column, MetaData, Integer, String, bindparam, \
Sequence, ForeignKey, text, select, func, extract, literal_column, \
tuple_, DateTime, Time, literal, and_, ... | mit |
bsquidwrd/Squid-Bot | gaming/migrations/0007_auto_20161029_2354.py | 1 | 1089 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-30 06:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('gaming', '0006_auto_20161029_2347'),
]
operations = [
... | mit |
miaecle/deepchem | contrib/atomicconv/acnn/core/opt_random.py | 7 | 3457 | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "Joseph Gomes"
__copyright__ = "Copyright 2017, Stanford University"
__license__ = "MIT"
import os
import sys
import deepchem as dc
import numpy as np
import tensorflow as tf
sys.path.append("..... | mit |
ihmpdcc/cutlass | tests/test_serology.py | 2 | 11575 | #!/usr/bin/env python
""" A unittest script for the Serology module. """
import unittest
import json
import tempfile
from cutlass import Serology
from CutlassTestConfig import CutlassTestConfig
from CutlassTestUtil import CutlassTestUtil
# pylint: disable=W0703, C1801
class SerologyTest(unittest.TestCase):
""... | mit |
mikewiebe-ansible/ansible | lib/ansible/module_utils/network/nxos/argspec/lacp/lacp.py | 23 | 1926 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by ... | gpl-3.0 |
master2be1/pychess | lib/pychess/Players/CECPEngine.py | 20 | 41554 | from __future__ import absolute_import
from __future__ import print_function
from threading import RLock, Timer, Thread
import itertools
import re
import time
from gi.repository import Gtk
from gi.repository import GObject
from pychess.compat import Queue, Empty
from pychess.System import conf, fident
from pychess.Sy... | gpl-3.0 |
ghchinoy/tensorflow | tensorflow/python/ops/ragged/ragged_math_ops.py | 2 | 27592 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
hashbang/provisor | provisor/utils.py | 1 | 1845 | def drop_privileges(uid_name='nobody', gid_name='nogroup'):
import grp, pwd, os, resource
if os.getuid() != 0: # not root. #yolo
return
running_uid = pwd.getpwnam(uid_name).pw_uid
running_gid = grp.getgrnam(gid_name).gr_gid
os.setgroups([])
os.setgid(running_gid)
os.setuid(running... | mit |
dirn/Simon | tests/test_meta.py | 1 | 11888 | """Tests of the Meta class"""
try:
import unittest2 as unittest
except ImportError:
import unittest
from bson import ObjectId
import mock
import pymongo
from simon.meta import Meta
def skip_with_mongoclient(f):
if pymongo.version_tuple[:2] >= (2, 4):
return unittest.skip('`MongoClient` is suppo... | bsd-3-clause |
tersmitten/ansible | lib/ansible/modules/network/aci/aci_epg_to_contract.py | 27 | 9836 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... | gpl-3.0 |
dfang/odoo | addons/account/report/account_balance.py | 14 | 3373 | # -*- coding: utf-8 -*-
import time
from odoo import api, models
class ReportTrialBalance(models.AbstractModel):
_name = 'report.account.report_trialbalance'
def _get_accounts(self, accounts, display_account):
""" compute the balance, debit and credit for the provided accounts
:Arguments... | agpl-3.0 |
ptemplier/ansible | lib/ansible/modules/web_infrastructure/gunicorn.py | 10 | 6879 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Alejandro Gomez <alexgomez2202@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | gpl-3.0 |
wilvk/ansible | lib/ansible/modules/network/avi/avi_snmptrapprofile.py | 41 | 3536 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
huran2014/huran.github.io | wot_gateway/usr/lib/python2.7/distutils/ccompiler.py | 30 | 46533 | """distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
__revision__ = "$Id$"
import sys
import os
import re
from distutils.errors import (CompileError, LinkError, UnknownFileError,
DistutilsPlatformE... | gpl-2.0 |
qk4l/Flexget | flexget/plugins/sites/horriblesubs.py | 6 | 2970 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.cached_input import cached
from flexget.utils.... | mit |
jjconti/nikola | nikola/data/themes/base/messages/messages_nb.py | 6 | 1463 | # -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "%d min gjenstår å lese",
"(active)": "(aktiv)",
"Also available in:": "Også tilgjengelig på:",
"Archive": "Arkiv",
"Categories": "Kategorier",
"Comments": "Kommentarer",
"LANGUAGE": "n... | mit |
snnn/tensorflow | tensorflow/contrib/data/python/ops/unique.py | 19 | 1624 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
abhijeet-talaulikar/Automatic-Helmet-Detection | K-Fold/Logistic_Regression.py | 1 | 2663 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, auc
from sklearn.model_selection import KFold
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import *
from timeit import default_timer as timer
from random import randint
from sklearn.feature_selection im... | gpl-3.0 |
melissaihrig/namebench | nb_third_party/dns/exception.py | 250 | 1319 | # Copyright (C) 2003-2007, 2009, 2010 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 ... | apache-2.0 |
andriy-s/django-rest-framework | tests/test_permissions.py | 5 | 15831 | from __future__ import unicode_literals
from django.contrib.auth.models import User, Permission, Group
from django.db import models
from django.test import TestCase
from django.utils import unittest
from rest_framework import generics, serializers, status, permissions, authentication, HTTP_HEADER_ENCODING
from rest_fra... | bsd-2-clause |
titilambert/alignak | alignak/bin/__init__.py | 2 | 2386 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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, eit... | agpl-3.0 |
kisel/trex-core | scripts/external_libs/nose-1.3.4/python2/nose/plugins/base.py | 83 | 26056 | import os
import textwrap
from optparse import OptionConflictError
from warnings import warn
from nose.util import tolist
class Plugin(object):
"""Base class for nose plugins. It's recommended but not *necessary* to
subclass this class to create a plugin, but all plugins *must* implement
`options(self, par... | apache-2.0 |
Orav/kbengine | kbe/src/lib/python/Lib/urllib/parse.py | 2 | 36193 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter... | lgpl-3.0 |
miguelparaiso/OdooAccessible | addons/portal_claim/__openerp__.py | 432 | 1643 | # -*- 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... | agpl-3.0 |
romain-dartigues/ansible | lib/ansible/modules/network/aci/aci_interface_selector_to_switch_policy_leaf_profile.py | 15 | 7609 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_... | gpl-3.0 |
Gateworks/platform-external-chromium_org | build/landmine_utils.py | 24 | 2773 | # Copyright 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.
import functools
import logging
import os
import shlex
import sys
def memoize(default=None):
"""This decorator caches the return value of a parameterles... | bsd-3-clause |
svenstaro/ansible | lib/ansible/module_utils/cnos_devicerules.py | 77 | 45995 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by
# Ansible still belong to the author of the module, and may assign their
# own license to the complete wo... | gpl-3.0 |
beni55/edx-platform | lms/djangoapps/instructor_task/views.py | 128 | 11761 |
import json
import logging
from django.http import HttpResponse
from django.utils.translation import ugettext as _
from celery.states import FAILURE, REVOKED, READY_STATES
from instructor_task.api_helper import (get_status_from_instructor_task,
get_updated_instructor_task)
fr... | agpl-3.0 |
ewdurbin/ansible-modules-extras | notification/mail.py | 23 | 8338 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.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 Lice... | gpl-3.0 |
cristobaltapia/sajou | sajou/sections.py | 1 | 3525 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Define the classes and methods to work with sections.
"""
import numpy as np
class BeamSection(object):
"""Defines a beam section
Parameters
----------
name: str
name of the section
material: Material instance
material of the sect... | mit |
jimcunderwood/MissionPlanner | Lib/site-packages/numpy/lib/format.py | 53 | 19853 | """
Define a simple format for saving numpy arrays to disk with the full
information about them.
The ``.npy`` format is the standard binary file format in NumPy for
persisting a *single* arbitrary NumPy array on disk. The format stores all
of the shape and dtype information necessary to reconstruct the array
correctly... | gpl-3.0 |
blacktear23/django | django/contrib/gis/db/backends/oracle/introspection.py | 388 | 1777 | import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY,
# but it is the only o... | bsd-3-clause |
tanderegg/ansible-modules-core | files/lineinfile.py | 23 | 14416 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2014, Ahti Kitsik <ak@ahtik.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 S... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.