repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
progamer001/Testchat | auth.py | 1 | 9013 | # coding=UTF-8
# Tornado modules.
import tornado.web
import tornado.escape
# Import application modules.
from base import BaseHandler
# General modules.
import logging
class LoginHandler(BaseHandler, tornado.auth.GoogleMixin):
"""
Handler for logins with Google Open ID / OAuth
http://www.tornadoweb.org... | mit |
kbrebanov/ansible | contrib/inventory/nsot.py | 117 | 9825 | #!/usr/bin/env python
'''
nsot
====
Ansible Dynamic Inventory to pull hosts from NSoT, a flexible CMDB by Dropbox
Features
--------
* Define host groups in form of NSoT device attribute criteria
* All parameters defined by the spec as of 2015-09-05 are supported.
+ ``--list``: Returns JSON hash of host groups -... | gpl-3.0 |
Andrew-McNab-UK/DIRAC | docs/source/conf.py | 4 | 9724 | # -*- coding: utf-8 -*-
#
# DiracDocs documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 25 17:34:37 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.
#
# A... | gpl-3.0 |
ganeti/ganeti | lib/hooksmaster.py | 1 | 10785 | #
#
# Copyright (C) 2006, 2007, 2011, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | bsd-2-clause |
ChanChiChoi/scikit-learn | sklearn/covariance/tests/test_covariance.py | 142 | 11068 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
rupak0577/ginga | ginga/web/pgw/Plot.py | 3 | 4306 | #
# Plot.py -- Plotting widget canvas wrapper.
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from io import BytesIO
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from ... | bsd-3-clause |
arifsetiawan/edx-platform | lms/djangoapps/courseware/tests/test_navigation.py | 28 | 11973 | """
This test file will run through some LMS test scenarios regarding access and navigation of the LMS
"""
import time
from mock import patch
from nose.plugins.attrib import attr
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from coursewa... | agpl-3.0 |
pangweishen/rt-thread | tools/keil.py | 20 | 13161 | #
# File : keil.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# 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... | gpl-2.0 |
Scarygami/gae-gcs-push2deploy-secrets | lib/werkzeug/testsuite/urls.py | 83 | 14595 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.urls
~~~~~~~~~~~~~~~~~~~~~~~
URL helper tests.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.datastructures import OrderedMultiD... | apache-2.0 |
bohdan-shramko/learning-python | source/sublime-packages/Packages/mdpopups/st3/mdpopups/mdx/superfences.py | 2 | 21280 | """
Superfences.
pymdownx.superfences
Neseted Fenced Code Blocks
This is a modification of the original Fenced Code Extension.
Algorithm has been rewritten to allow for fenced blocks in blockquotes,
lists, etc. And also , allow for special UML fences like 'flow' for flowcharts
and `sequence` for sequence diagrams.
... | mit |
dneiter/exabgp | lib/exabgp/reactor/api/command/text.py | 2 | 15907 | # encoding: utf-8
"""
command.py
Created by Thomas Mangin on 2015-12-15.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
from exabgp.version import version as _version
class Text (object):
callback = {}
def __new__ (cls,name):
def register (function):
cls.callback[name] = function
return f... | bsd-3-clause |
redhat-openstack/django | django/contrib/contenttypes/views.py | 115 | 3383 | from __future__ import unicode_literals
from django import http
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site, get_current_site
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
def shortcut(request, conte... | bsd-3-clause |
bdang2012/taiga-back | taiga/projects/attachments/api.py | 5 | 3684 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | agpl-3.0 |
bhatfield/titanium_mobile | support/common/markdown/inlinepatterns.py | 107 | 12185 | """
INLINE PATTERNS
=============================================================================
Inline patterns such as *emphasis* are handled by means of auxiliary
objects, one per pattern. Pattern objects must be instances of classes
that extend markdown.Pattern. Each pattern object uses a single regular
express... | apache-2.0 |
lochiiconnectivity/boto | boto/sdb/db/blob.py | 57 | 2398 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... | mit |
richardcs/ansible | lib/ansible/modules/network/cloudengine/ce_switchport.py | 7 | 27424 | #!/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... | gpl-3.0 |
bguillot/OpenUpgrade | addons/account/report/account_partner_ledger.py | 81 | 13063 | # -*- 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 |
bradwoo8621/Swift-Study | Instagram/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/lib/TestCommon.py | 307 | 21397 | """
TestCommon.py: a testing framework for commands and scripts
with commonly useful error handling
The TestCommon module provides a simple, high-level interface for writing
tests of executable commands and scripts, especially commands and scripts
that interact with the file system. All methods throw... | mit |
ogenstad/ansible | lib/ansible/modules/cloud/amazon/s3_sync.py | 44 | 19602 | #!/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 distributed... | gpl-3.0 |
yangleo/cloud-github | openstack_dashboard/dashboards/admin/hypervisors/compute/tabs.py | 57 | 1309 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | apache-2.0 |
dashpay/electrum-dash | plugins/greenaddress_instant/qt.py | 12 | 3985 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... | mit |
endorphinl/horizon-fork | openstack_dashboard/enabled/_1000_project.py | 21 | 1201 | # Copyright 2015, 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 applicable... | apache-2.0 |
mattesno1/CouchPotatoServer | libs/rtorrent/common.py | 88 | 4050 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | gpl-3.0 |
zuck/scribee | scribee.py | 1 | 2854 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""This file is part of the Scribee project.
"""
__author__ = 'Emanuele Bertoldi <emanuele.bertoldi@gmail.com>'
__copyright__ = 'Copyright (c) 2011 Emanuele Bertoldi'
__version__ = '0.0.1'
import sys
import os
import fileinput
import settings
class Scribox(object):
def ... | mit |
danieldresser/cortex | python/IECoreHoudini/FnParameterisedHolder.py | 12 | 8982 | ##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... | bsd-3-clause |
mateor/pants | tests/python/pants_test/backend/jvm/tasks/test_check_published_deps.py | 10 | 3985 | # 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)
import os
from textw... | apache-2.0 |
reachedu14/traininginstitute | coursebuilder/tests/suite.py | 4 | 10911 | # Copyright 2013 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 ... | apache-2.0 |
HiSPARC/station-software | user/python/Lib/site-packages/win32/Demos/service/serviceEvents.py | 40 | 4127 | # A Demo of a service that takes advantage of the additional notifications
# available in later Windows versions.
# Note that all output is written as event log entries - so you must install
# and start the service, then look at the event log for messages as events
# are generated.
# Events are generated for USB devi... | gpl-3.0 |
jpshort/odoo | addons/pad/py_etherpad/__init__.py | 505 | 7804 | """Module to talk to EtherpadLite API."""
import json
import urllib
import urllib2
class EtherpadLiteClient:
"""Client to talk to EtherpadLite API."""
API_VERSION = 1 # TODO probably 1.1 sometime soon
CODE_OK = 0
CODE_INVALID_PARAMETERS = 1
CODE_INTERNAL_ERROR = 2
CODE_INVALID_FUNCTION = 3
... | agpl-3.0 |
martynovp/edx-platform | lms/djangoapps/shoppingcart/migrations/0023_auto__add_field_coupon_expiration_date.py | 110 | 18437 | # -*- 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 field 'Coupon.expiration_date'
db.add_column('shoppingcart_coupon', 'expiration_date',
... | agpl-3.0 |
synicalsyntax/zulip | zerver/webhooks/statuspage/view.py | 4 | 2145 | # Webhooks for external integrations.
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, api_key_only_webhook_view, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
from ze... | apache-2.0 |
ntts-clo/mld-ryu | ryu/tests/mininet/l3/ip_ttl/test_ip_ttl.py | 63 | 2976 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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... | apache-2.0 |
kybriainfotech/iSocioCRM | addons/website_forum/models/res_users.py | 281 | 5198 | # -*- coding: utf-8 -*-
from datetime import datetime
from urllib import urlencode
import hashlib
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
class Users(osv.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
init_res = super(Users, self).__init__(pool, cr)
... | agpl-3.0 |
tekapo/fabric | tests/test_network.py | 3 | 24848 | from __future__ import with_statement
from datetime import datetime
import copy
import getpass
import sys
from nose.tools import with_setup, ok_, raises
from fudge import (Fake, clear_calls, clear_expectations, patch_object, verify,
with_patched_object, patched_context, with_fakes)
from fabric.context_managers i... | bsd-2-clause |
Philippe12/external_chromium_org | ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py | 48 | 13105 | #!/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.
"""This script lays out the PNaCl translator files for a
normal Chrome installer, for one platform. Once run num-of-arches times,
... | bsd-3-clause |
beatle/node-gyp | gyp/buildbot/buildbot_run.py | 270 | 8338 | #!/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.
"""Argument-less script to select what to run on the buildbots."""
import filecmp
import os
import shutil
import subprocess
import sys
i... | mit |
maciejkula/glove-python | setup.py | 1 | 4688 | import glob
import os
import platform
import subprocess
import sys
from setuptools import Command, Extension, setup, find_packages
from setuptools.command.test import test as TestCommand
def define_extensions(cythonize=False):
compile_args = ['-fopenmp',
'-ffast-math']
# There are probl... | apache-2.0 |
xhat/micropython | tests/basics/for_range.py | 19 | 1116 | # test for+range, mostly to check optimisation of this pair
# apply args using *
for x in range(*(1, 3)):
print(x)
for x in range(1, *(6, 2)):
print(x)
# apply args using **
try:
for x in range(**{'end':1}):
print(x)
except TypeError:
print('TypeError')
try:
for x in range(0, **{'end':1}):... | mit |
bennyrowland/pyflo-suspect | tests/test_processing.py | 1 | 5347 | from unittest.mock import Mock
import numpy
import pytest
import pyflo_suspect.processing as p
import pyflo.ports
import suspect
@pytest.fixture
def simple_data():
source_array = numpy.ones((4, 128), 'complex')
source_array[1, :] *= 2
source_array[2, :] *= 4
source_array[3, :] *= 8
data = suspec... | mit |
40223234/40223234 | static/Brython3.1.1-20150328-091302/Lib/getopt.py | 845 | 7488 | """Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by GNU software
may be used as ... | gpl-3.0 |
bgris/ODL_bgris | lib/python3.5/site-packages/docutils/__init__.py | 1 | 7559 | # $Id: __init__.py 7984 2016-12-09 09:48:27Z grubert $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This is the Docutils (Python Documentation Utilities) package.
Package Structure
=================
Modules:
- __init__.py: Contains component base cl... | gpl-3.0 |
Jet-Streaming/googletest | googlemock/scripts/generator/cpp/ast.py | 384 | 62773 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 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... | bsd-3-clause |
norbertspiess/google-python-exercises | basic/solution/list1.py | 209 | 3656 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic list exercises
# Fill in the code for the functions below. main() is already set ... | apache-2.0 |
ZhangXinNan/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/mvn_full_covariance_test.py | 14 | 7349 | # 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 |
CodeWingX/yowsup | yowsup/layers/axolotl/protocolentities/receipt_outgoing_retry.py | 35 | 2457 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from yowsup.layers.protocol_receipts.protocolentities import OutgoingReceiptProtocolEntity
from yowsup.layers.axolotl.protocolentities.iq_keys_get_result import ResultGetKeysIqProtocolEntity
class RetryOutgoingReceiptProtocolEntity(OutgoingReceiptProtocolEntit... | gpl-3.0 |
jspan/Open-Knesset | accounts/migrations/0002_add_valid_email_group.py | 11 | 4805 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.contrib.auth.models import User,Group,Permission
class Migration(DataMigration):
def forwards(self, orm):
(g,created) = Group.objects.get_or_create(name='Valid Email')
... | bsd-3-clause |
vyvojer/ploev | tests/test_calc.py | 1 | 3140 | import unittest
from ploev import calc
from ploev.calc import Calc, GameCalc
from ploev.ppt import OddsOracle
class CalcModuleTest(unittest.TestCase):
def test_close_parenthesis(self):
self.assertEqual(calc.close_parenthesis('77,KK'), '(77,KK)')
self.assertEqual(calc.close_parenthesis('(77,KK)')... | gpl-3.0 |
SoftwareDefinedBuildings/smap | python/smap/drivers/labjack/labjackpython/u6.py | 6 | 83591 | """
Name: u6.py
Desc: Defines the U6 class, which makes working with a U6 much easier. All of
the low-level functions for the U6 are implemented as functions of the U6
class. There are also a handful additional functions which improve upon
the interface provided by the low-level functions.
To learn a... | bsd-2-clause |
vivekpabani/projecteuler | python/058/problem_058.py | 1 | 1812 | #!/usr/bin/env python
# coding=utf-8
"""
Problem Definition :
Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed.
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 ... | apache-2.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/action/ce_config.py | 89 | 4192 | #
# Copyright 2015 Peter Sprygada <psprygada@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 Foundation, either version 3 of the License, or
# (at your option) any... | bsd-3-clause |
firstjob/python-social-auth | social/tests/test_utils.py | 73 | 5018 | import sys
import unittest2 as unittest
from mock import Mock
from social.utils import sanitize_redirect, user_is_authenticated, \
user_is_active, slugify, build_absolute_uri, \
partial_pipeline_data
PY3 = sys.version_info[0] == 3
class SanitizeRedirectTest(unitte... | bsd-3-clause |
ptmr3/GalaxyNote3-Kernel-kk- | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
aospan/linux-next-bcm4708-edgecore-ecw7220-l | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
ds-hwang/chromium-crosswalk | tools/perf/benchmarks/gpu_times.py | 8 | 2505 | # 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 core import perf_benchmark
from benchmarks import silk_flags
from telemetry import benchmark
from telemetry.timeline import tracing_category_filter
fr... | bsd-3-clause |
bqbn/addons-server | src/olympia/files/utils.py | 1 | 52387 | import collections
import contextlib
import errno
import hashlib
import json
import os
import io
import re
import shutil
import signal
import stat
import struct
import tarfile
import tempfile
import zipfile
import fcntl
from datetime import datetime
from django import forms
from django.conf import settings
from djang... | bsd-3-clause |
jtara1/RedditImageGrab | redditdownload/plugins/parse_subreddit_list.py | 1 | 2749 | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 30 15:26:13 2016
@author: jtara1
General syntax for subreddits.txt:
: (colon character) denotes folder name
subreddit url or word denotes subreddit
For more examples see https://github.com/jtara1/RedditImageGrab/commit/8e4787ef9ac43ca694fc663be026f69a568bb622
Example o... | gpl-3.0 |
ibethune/lammps | tools/i-pi/ipi/inputs/normalmodes.py | 41 | 3951 | """Deals with creating the normal mode representation arrays.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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... | gpl-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/ctypes/test/test_errno.py | 115 | 2330 | import unittest, os, errno
from ctypes import *
from ctypes.util import find_library
from test import test_support
try:
import threading
except ImportError:
threading = None
class Test(unittest.TestCase):
def test_open(self):
libc_name = find_library("c")
if libc_name is None:
r... | mit |
jamslevy/gsoc | thirdparty/google_appengine/google/appengine/tools/appcfg.py | 1 | 74994 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
olea/PyConES-2016 | pycones/schedule/migrations/0007_auto_20150930_1149.py | 2 | 4593 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import markupfield.fields
class Migration(migrations.Migration):
dependencies = [
('schedule', '0006_slotkind_plenary'),
]
operations = [
migrations.AlterField(
model_nam... | mit |
jyotikamboj/container | django/contrib/gis/tests/geoapp/test_sitemaps.py | 8 | 3286 | from __future__ import unicode_literals
from io import BytesIO
from xml.dom import minidom
import zipfile
from django.conf import settings
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.sites.models import Site
from django.test import (
TestCase, ignore_warnings, modify_settings, override_settin... | mit |
jhonnyam123/hangoutsbot | hangupsbot/plugins/xkcd.py | 3 | 1350 | import aiohttp, asyncio, io, logging, os, re, urllib.request, urllib.error
from bs4 import BeautifulSoup
import plugins
logger = logging.getLogger(__name__)
def _initialise(bot):
plugins.register_handler(_watch_xkcd_link, type="message")
@asyncio.coroutine
def _watch_xkcd_link(bot, event, command):
if event.user.... | agpl-3.0 |
PySCeS/PyscesToolbox | psctb/analyse/_symca/ccobjects.py | 1 | 18252 | from __future__ import division, print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
from numpy import array, nanmin, nanmax
from sympy import Symbol
from pysces import ModelMap, Scanner, ParScanner
from numpy import NaN, abs
from ...utils.model_graph impor... | bsd-3-clause |
alexsmx/djangoAppengineSrcTemplate | django/db/backends/postgresql_psycopg2/base.py | 239 | 8346 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql.operations import DatabaseOperations as Postgresq... | bsd-3-clause |
xiandiancloud/edxplaltfom-xusong | common/lib/extract_tar.py | 40 | 2149 | """
Safe version of tarfile.extractall which does not extract any files that would
be, or symlink to a file that is, outside of the directory extracted in.
Adapted from:
http://stackoverflow.com/questions/10060069/safely-extract-zip-or-tar-using-python
"""
from os.path import abspath, realpath, dirname, join as joinpa... | agpl-3.0 |
voussoir/praw | tests/unit/models/reddit/test_subreddit.py | 2 | 3857 | import pickle
import pytest
from praw.models import Subreddit, WikiPage
from ... import UnitTest
class TestSubreddit(UnitTest):
def test_equality(self):
subreddit1 = Subreddit(self.reddit,
_data={'display_name': 'dummy1', 'n': 1})
subreddit2 = Subreddit(self.reddit... | gpl-3.0 |
CXQERP/ODOOERP | openerp/report/render/rml2txt/__init__.py | 381 | 1351 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
gmt/portage | pym/_emerge/BinpkgPrefetcher.py | 8 | 1240 | # Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.BinpkgFetcher import BinpkgFetcher
from _emerge.CompositeTask import CompositeTask
from _emerge.BinpkgVerifier import BinpkgVerifier
from portage import os
class BinpkgPrefetcher(CompositeTask):
_... | gpl-2.0 |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/lib-tk/test/test_ttk/test_widgets.py | 13 | 57791 | import unittest
import Tkinter as tkinter
from Tkinter import TclError
import ttk
from test.test_support import requires, run_unittest
import sys
from test_functions import MockTclObj
from support import (AbstractTkTest, tcl_version, get_tk_patchlevel,
simulate_mouse_click)
from widget_tests impor... | gpl-2.0 |
codesparkle/youtube-dl | youtube_dl/extractor/addanime.py | 29 | 3281 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urllib_parse_urlencode,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
qualities,
)
class AddAnimeIE(InfoExtractor):
_VAL... | unlicense |
irees/emdash | emdash/ui/Ui_Wizard.py | 1 | 1634 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Ui_Wizard.ui'
#
# Created: Tue Jul 31 04:19:55 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attri... | bsd-3-clause |
str4d/i2p-tools | netdb/tests/test_netdb.py | 2 | 1894 | # test_netdb.py - Test netdb.py
# Author: Chris Barry <chris@barry.im>
# License: MIT
# Note: this uses py.test.
import netdb,os,random
'''
def test_inspect():
netdb.inspect()
'''
def test_sha256():
assert('d2f4e10adac32aeb600c2f57ba2bac1019a5c76baa65042714ed2678844320d0' == netdb.netdb.sha256('i2p is cool', raw=... | mit |
kmarius/qutebrowser | tests/unit/utils/test_error.py | 4 | 3334 | # Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# This file is part of qutebrowser.
#
# qutebrowser 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 Sof... | gpl-3.0 |
deepmind/acme | acme/agents/tf/bcq/discrete_learning.py | 1 | 9377 | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | apache-2.0 |
gorjuce/odoo | addons/l10n_in_hr_payroll/wizard/__init__.py | 430 | 1110 | # -*- 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 |
MarioGranada/bitgraytest | bower_components/bootstrap/test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | mit |
sbuss/voteswap | lib/networkx/linalg/spectrum.py | 42 | 2793 | """
Eigenvalue spectrum of graphs.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = "\n".join(['Aric Hagberg <aric.hagberg@gmail.com>',
... | mit |
jumpojoy/neutron | neutron/tests/common/base.py | 34 | 3238 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
pkainz/pylearn2 | pylearn2/linear/tests/test_conv2d.py | 45 | 5497 | import theano
from theano import tensor
import numpy
from pylearn2.linear.conv2d import Conv2D, make_random_conv2D
from pylearn2.space import Conv2DSpace
from pylearn2.utils import sharedX
import unittest
try:
scipy_available = True
import scipy.ndimage
except ImportError:
scipy_available = False
class Te... | bsd-3-clause |
robynbergeron/ansible-modules-extras | cloud/cloudstack/cs_affinitygroup.py | 24 | 7542 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 |
erjohnso/ansible | test/units/modules/packaging/os/test_apk.py | 137 | 1157 | from ansible.compat.tests import mock
from ansible.compat.tests import unittest
from ansible.modules.packaging.os import apk
class TestApkQueryLatest(unittest.TestCase):
def setUp(self):
self.module_names = [
'bash',
'g++',
]
@mock.patch('ansible.modules.packaging.os... | gpl-3.0 |
Javier-Acosta/meran | dev-plugins/node/lib/node/wafadmin/Logs.py | 4 | 4722 | #!/usr/bin/env python
# Meran - MERAN UNLP is a ILS (Integrated Library System) wich provides Catalog,
# Circulation and User's Management. It's written in Perl, and uses Apache2
# Web-Server, MySQL database and Sphinx 2 indexing.
# Copyright (C) 2009-2013 Grupo de desarrollo de Meran CeSPI-UNLP
#
# This file is part ... | gpl-3.0 |
amir343/ansible | test/units/parsing/test_data_loader.py | 99 | 3256 | # (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... | gpl-3.0 |
fujunwei/chromium-crosswalk | chrome/test/ispy/server/rebaseline_handler.py | 100 | 1208 | # 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.
"""Request Handler that updates the Expectation version."""
import webapp2
import ispy_api
from common import constants
import gs_bucket
class Rebaselin... | bsd-3-clause |
persandstrom/home-assistant | homeassistant/components/switch/orvibo.py | 8 | 3041 | """
Support for Orvibo S20 Wifi Smart Switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.orvibo/
"""
import logging
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.con... | apache-2.0 |
bluesabre/melodius | melodius/PreferencesMelodiusDialog.py | 1 | 8596 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2012 Sean Davis <smd.seandavis@gmail.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Sof... | gpl-3.0 |
corvorepack/REPOIVAN | plugin.video.tv.astra.vip/resources/regex/dinozap.py | 3 | 4487 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# TV Ultra 7K Regex de Dinozap
# Version 0.1 (17.10.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plugintools de Jesús (www.mimedi... | gpl-2.0 |
agentfog/qiime | tests/test_pick_rep_set.py | 15 | 20044 | #!/usr/bin/env python
"""Tests of code for representative set picking"""
__author__ = "Rob Knight"
__copyright__ = "Copyright 2011, The QIIME Project"
# remember to add yourself if you make changes
__credits__ = ["Rob Knight", "Kyle Bittinger", "Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintain... | gpl-2.0 |
TheoChevalier/bedrock | bedrock/privacy/views.py | 5 | 3689 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import re
from django.views.decorators.cache import cache_page
from commonware.response.decorators import xframe_allow
... | mpl-2.0 |
yatinkumbhare/openstack-nova | nova/tests/unit/matchers.py | 14 | 19003 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2012 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 L... | apache-2.0 |
snamstorm/rockstor-core | src/rockstor/smart_manager/views/samba_service.py | 2 | 3041 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
HWal/paparazzi | sw/supervision/python/lib/environment.py | 33 | 2810 | # Paparazzi center utilities
#
# Copyright (C) 2016 ENAC, Florian BITARD (intern student)
#
# This file is part of paparazzi.
#
# paparazzi 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, or ... | gpl-2.0 |
0Chencc/CTFCrackTools | Lib/test/test_linecache.py | 96 | 4079 | """ Tests for the linecache module """
import linecache
import unittest
import os.path
from test import test_support as support
FILENAME = linecache.__file__
INVALID_NAME = '!@$)(!@#_1'
EMPTY = ''
TESTS = 'inspect_fodder inspect_fodder2 mapping_tests'
TESTS = TESTS.split()
TEST_PATH = os.path.dirname(support.__file_... | gpl-3.0 |
ulule/django-linguist | linguist/mixins.py | 1 | 14692 | # -*- coding: utf-8 -*-
import copy
from contextlib import contextmanager
import django
from django.db.models import Q
from django.db import models
from django.utils.functional import cached_property
from . import utils
from .cache import CachedTranslation
from .helpers import prefetch_translations
if django.VERSI... | mit |
LoHChina/nova | nova/tests/unit/virt/xenapi/image/test_bittorrent.py | 51 | 4959 | # Copyright 2013 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... | apache-2.0 |
PRIMEDesigner15/PRIMEDesigner15 | Test_files/dependencies/Lib/site-packages/pygame/pkgdata.py | 603 | 2146 | """pkgdata is a simple, extensible way for a package to acquire data file
resources.
The getResource function is equivalent to the standard idioms, such as
the following minimal implementation::
import sys, os
def getResource(identifier, pkgname=__name__):
pkgpath = os.path.dirname(sys.modules[p... | bsd-3-clause |
julian-seward1/servo | tests/wpt/web-platform-tests/css/tools/w3ctestlib/Indexer.py | 26 | 9812 | #!/usr/bin/python
# CSS Test Suite Manipulation Library
# Initial code by fantasai, joint copyright 2010 W3C and Microsoft
# Licensed under BSD 3-Clause: <http://www.w3.org/Consortium/Legal/2008/03-bsd-license>
# Define contains vmethod for Template Toolkit
from template.stash import list_op
@list_op("contains")
def l... | mpl-2.0 |
karwa/swift | utils/split_file.py | 65 | 1410 | #!/usr/bin/env python
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIB... | apache-2.0 |
chidea/GoPythonDLLWrapper | bin/lib/tkinter/test/test_ttk/test_functions.py | 79 | 17143 | # -*- encoding: utf-8 -*-
import unittest
import tkinter
from tkinter import ttk
class MockTkApp:
def splitlist(self, arg):
if isinstance(arg, tuple):
return arg
return arg.split(':')
def wantobjects(self):
return True
class MockTclObj(object):
typename = 'test'
... | mit |
timou/volatility | volatility/plugins/mac/route.py | 44 | 3443 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.