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 |
|---|---|---|---|---|---|
bufferapp/buffer-django-nonrel | django/middleware/transaction.py | 447 | 1090 | from django.db import transaction
class TransactionMiddleware(object):
"""
Transaction middleware. If this is enabled, each view function will be run
with commit_on_response activated - that way a save() doesn't do a direct
commit, the commit is done when a successful response is created. If an
exc... | bsd-3-clause |
CyanogenMod/android_kernel_motorola_titan | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
apple/swift-lldb | packages/Python/lldbsuite/test/types/AbstractBase.py | 5 | 12194 | """
Abstract base class of basic types provides a generic type tester method.
"""
from __future__ import print_function
import os
import re
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
def Msg(var, val, using_frame_variable):
return "'%s %s' matches the output (fr... | apache-2.0 |
zhaorz/Touch-Calculator | dist/Touch Calculator.app/Contents/Resources/lib/python2.7/email/test/test_email_torture.py | 150 | 3669 | # Copyright (C) 2002-2004 Python Software Foundation
#
# A torture test of the email package. This should not be run as part of the
# standard Python test suite since it requires several meg of email messages
# collected in the wild. These source messages are not checked into the
# Python distro, but are available as... | mit |
petermalcolm/osf.io | tests/test_conferences.py | 20 | 19864 | # -*- coding: utf-8 -*-
import mock
from nose.tools import * # noqa (PEP8 asserts)
import hmac
import hashlib
from StringIO import StringIO
import furl
from modularodm import Q
from modularodm.exceptions import ValidationError
from framework.auth.core import Auth
from website import settings
from website.models i... | apache-2.0 |
larsmans/scikit-learn | benchmarks/bench_tree.py | 297 | 3617 | """
To run this, you'll need to have installed.
* scikit-learn
Does two benchmarks
First, we fix a training set, increase the number of
samples to classify and plot number of classified samples as a
function of time.
In the second benchmark, we increase the number of dimensions of the
training set, classify a sam... | bsd-3-clause |
alivecor/tensorflow | tensorflow/contrib/saved_model/python/saved_model/utils_test.py | 29 | 4516 | # 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 |
pombredanne/pants | contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_import_order.py | 18 | 5233 | # coding=utf-8
# Copyright 2015 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 ast
import te... | apache-2.0 |
rodrigoprimo/CVSAnalY | pycvsanaly2/extensions/Metrics.py | 4 | 35090 | # Copyright (C) 2008 LibreSoft
#
# 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 is distributed in the ... | gpl-2.0 |
GrimDerp/numpy | benchmarks/benchmarks/bench_linalg.py | 29 | 1927 | from __future__ import absolute_import, division, print_function
from .common import Benchmark, squares_, indexes_rand
import numpy as np
class Eindot(Benchmark):
def setup(self):
self.a = np.arange(60000.0).reshape(150, 400)
self.b = np.arange(240000.0).reshape(400, 600)
self.c = np.ara... | bsd-3-clause |
souravsingh/sympy | sympy/physics/unitsystems/simplifiers.py | 34 | 3386 | # -*- coding: utf-8 -*-
"""
Several methods to simplify expressions involving unit objects.
"""
from __future__ import division
from sympy import Add, Mul, Pow
from sympy.core.compatibility import reduce
from sympy.physics.unitsystems import Dimension, Unit, Quantity
def dim_simplify(expr):
"""
Simplify ex... | bsd-3-clause |
40223231/w16b_test | static/Brython3.1.1-20150328-091302/Lib/token.py | 743 | 3034 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... | agpl-3.0 |
OpenClovis/linux_tipc | 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 |
partofthething/home-assistant | homeassistant/components/proxmoxve/binary_sensor.py | 5 | 2824 | """Binary sensor to read Proxmox VE data."""
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from . import COORDINATOR, DOMAIN, ProxmoxEntity
async def async_setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up b... | mit |
aam-at/tensorflow | tensorflow/compiler/jit/ops/xla_ops_grad.py | 36 | 1207 | """Gradients for XLA ops."""
# 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
#... | apache-2.0 |
lijoantony/django-oscar | tests/unit/partner/tax_mixin_tests.py | 44 | 1814 | from decimal import Decimal as D
from django.test import TestCase
import mock
from oscar.apps.partner import strategy
class TestNoTaxMixin(TestCase):
def setUp(self):
self.mixin = strategy.NoTax()
self.product = mock.Mock()
self.stockrecord = mock.Mock()
self.stockrecord.price_e... | bsd-3-clause |
sometallgit/AutoUploader | Python27/Lib/idlelib/ParenMatch.py | 9 | 6714 | """ParenMatch -- An IDLE extension for parenthesis matching.
When you hit a right paren, the cursor should move briefly to the left
paren. Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
"""
from idlelib.HyperParser import HyperParser
from idlelib.configHandler... | mit |
aplanas/rally | rally/plugins/common/sla/max_average_duration.py | 13 | 1762 | # Copyright 2014: Mirantis 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 b... | apache-2.0 |
adrianmoisey/lint-review | tests/test_config.py | 2 | 2777 | from unittest import TestCase
from nose.tools import eq_
from lintreview.config import build_review_config, get_lintrc_defaults
from lintreview.config import load_config, ReviewConfig
sample_ini = """
[files]
ignore = test/CodeStandards/test/**
vendor/**
[tools]
linters = phpcs, pep8, jshint
[tool_jshint]
conf... | mit |
popazerty/test-gui | lib/python/Plugins/Satdreamgr/Manipulate/plugin.py | 4 | 18327 | from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.InfoBar import InfoBar
from Screens.Console import Console
from Screens.ChoiceBox import ChoiceBox
from Screens.MessageBox import MessageBox
from Screens.EventView import EventViewSimple
from Components.ActionMap import ActionMap... | gpl-2.0 |
sid88in/incubator-airflow | airflow/contrib/operators/emr_terminate_job_flow_operator.py | 9 | 2146 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
volpino/Yeps-EURAC | lib/galaxy/datatypes/converters/lped_to_fped_converter.py | 1 | 3684 | # for rgenetics - lped to fbat
# recode to numeric fbat version
# much slower so best to always
# use numeric alleles internally
import sys,os,time
prog = os.path.split(sys.argv[0])[-1]
myversion = 'Oct 10 2009'
galhtmlprefix = """<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DT... | mit |
mindnervestech/mnrp | addons/portal_project/project.py | 285 | 1809 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
jasonrleonard/colchestercoin | qa/rpc-tests/rest.py | 128 | 3258 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test REST interface
#
from test_framework import BitcoinTestFramework
from util import *
import json
try... | mit |
ARudiuk/mne-python | mne/tests/test_line_endings.py | 5 | 2386 | # Author: Eric Larson <larson.eric.d@gmail.com>
# Adapted from vispy
#
# License: BSD (3-clause)
import os
from nose.tools import assert_raises
from nose.plugins.skip import SkipTest
from os import path as op
import sys
from mne.utils import run_tests_if_main, _TempDir, _get_root_dir
skip_files = (
# kn... | bsd-3-clause |
GETLIMS/LIMS-Backend | lims/addressbook/views.py | 1 | 1209 | from rest_framework import viewsets
from rest_framework.serializers import ValidationError
from .models import Address
from .serializers import AddressSerializer
from lims.permissions.permissions import IsAddressOwner, IsAddressOwnerFilter
from lims.shared.mixins import AuditTrailViewMixin
class AddressViewSet(Audi... | mit |
01org/yoko-tool | yokolibs/_wt310.py | 1 | 10074 | #!/usr/bin/env python
#
# Copyright (C) 2013-2020 Intel Corporation
# SPDX-License-Identifier: GPL-2.0-only
#
# -*- coding: utf-8 -*-
# vim: ts=4 sw=4 tw=100 et ai si
#
# Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
"""
This module implements the Yokogawa WT310 power meter support. It also works for WT3... | gpl-2.0 |
tavisrudd/eventlet | eventlet/backdoor.py | 1 | 3271 | import socket
import sys
import errno
from code import InteractiveConsole
import eventlet
from eventlet import hubs
from eventlet.support import greenlets
try:
sys.ps1
except AttributeError:
sys.ps1 = '>>> '
try:
sys.ps2
except AttributeError:
sys.ps2 = '... '
class FileProxy(object):
def __init... | mit |
CogWorks/PyCogWorks | pycogworks.crypto/pycogworks/crypto/crypto.py | 1 | 1306 | # -*- coding: utf-8 -*-
#===============================================================================
# This file is part of PyCogWorks.
# Copyright (C) 2012 Ryan Hope <rmh3093@gmail.com>
#
# PyCogWorks is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | gpl-3.0 |
jerryz1982/neutron | neutron/plugins/vmware/extensions/advancedserviceproviders.py | 22 | 1637 | # Copyright 2015 VMware, 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 a... | apache-2.0 |
lemmingapex/ElementsOfComputingSystems | projects/project11/src/SymbolTable.py | 1 | 2106 | #!/usr/bin/python -O
############################
# Scott Wiedemann #
# Project11 SymbolTable.py #
############################
# libraries
import sys
######################
# SymbolTable Module #
######################
class SymbolTable:
Kind="kind"
Type="type"
Index="index"
Static="static"
Field="this"
... | mit |
foss-transportationmodeling/rettina-server | .env/local/lib/python2.7/site-packages/whoosh/formats.py | 74 | 16710 | # Copyright 2009 Matt Chaput. 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 of conditions and the... | apache-2.0 |
WPMedia/dd-agent | checks.d/http_check.py | 5 | 19039 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from datetime import datetime
import _strptime # noqa
import os.path
from os import environ
import re
import socket
import ssl
import time
import warnings
from urlparse import urlparse
# 3rd party
import... | bsd-3-clause |
kmoocdev2/edx-platform | common/djangoapps/edxmako/template.py | 18 | 4046 | # Copyright (c) 2008 Mikeal Rogers
#
# 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... | agpl-3.0 |
bayesimpact/bob-emploi | frontend/server/asynchronous/clean_users.py | 1 | 5992 | """Script to clean inactive and guest users from DB.
Guests accounts are deleted after 1 week without interacting.
While signed in users' accounts are deleted after 2 years of inactivity (mail or app).
Note that signed in users should have received a notification email at least
1 week before deletion.
... | gpl-3.0 |
sxlijin/tfs_updater | lib/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## 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 |
stevenewey/django | tests/admin_checks/tests.py | 76 | 22037 | from __future__ import unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericStackedInline
from django.core import checks
from django.test import SimpleTestCase, override_settings
from .models import Album, Book, City, Influence, Song, State, T... | bsd-3-clause |
koyuawsmbrtn/eclock | windows/Python27/Lib/site-packages/docutils/nodes.py | 104 | 77345 | # $Id: nodes.py 7595 2013-01-21 17:33:56Z milde $
# Author: David Goodger <goodger@python.org>
# Maintainer: docutils-develop@lists.sourceforge.net
# Copyright: This module has been placed in the public domain.
"""
Docutils document tree element class library.
Classes in CamelCase are abstract base classes or auxilia... | gpl-2.0 |
konstantint/matplotlib-venn | matplotlib_venn/__init__.py | 1 | 2781 | '''
Venn diagram plotting routines.
Copyright 2012, Konstantin Tretyakov.
http://kt.era.ee/
Licensed under MIT license.
This package contains routines for plotting area-weighted two- and three-circle venn diagrams.
There are four main functions here: :code:`venn2`, :code:`venn2_circles`, :code:`venn3`, :code:`venn3_... | mit |
rafacarrascosa/ssaa | tests/test_solver.py | 1 | 1943 | import unittest
from ssaa.solver import simplify_clauses
class TestUnitPropagateClauses(unittest.TestCase):
def test_simple_clauses(self):
clauses = [[1]]
simple, assign, free = simplify_clauses(clauses)
self.assertEqual(simple, [])
self.assertEqual(assign, set([1]))
self.a... | bsd-3-clause |
lancezlin/airflow | airflow/migrations/versions/e3a246e0dc1_current_schema.py | 33 | 11577 | """current schema
Revision ID: e3a246e0dc1
Revises:
Create Date: 2015-08-18 16:35:00.883495
"""
# revision identifiers, used by Alembic.
revision = 'e3a246e0dc1'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy import func
from sqlalchemy.eng... | apache-2.0 |
klim-iv/phantomjs-qt5 | src/qt/qtbase/src/3rdparty/freetype/src/tools/glnames.py | 259 | 103407 | #!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.... | bsd-3-clause |
anbasile/flask_sample | flask/lib/python2.7/site-packages/cffi/setuptools_ext.py | 49 | 6158 | import os
try:
basestring
except NameError:
# Python 3.x
basestring = str
def error(msg):
from distutils.errors import DistutilsSetupError
raise DistutilsSetupError(msg)
def execfile(filename, glob):
# We use execfile() (here rewritten for Python 3) instead of
# __import__() to load the ... | mit |
stanta/darfchain | darfchain_docker_images/tests/pipelines/test_block_creation.py | 3 | 7397 | import random
import time
from unittest.mock import patch
from multipipes import Pipe
import pytest
def test_filter_by_assignee(b, signed_create_tx):
from bigchaindb.pipelines.block import BlockPipeline
block_maker = BlockPipeline()
tx = signed_create_tx.to_dict()
tx.update({'assignee': b.me, 'assi... | gpl-3.0 |
Sir-Henry-Curtis/Ironworks | lib/sqlalchemy/orm/sync.py | 22 | 4874 | # orm/sync.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""private module containing functions used for copying data
between instances based on j... | mit |
paninski-lab/yass | src/yass/postprocess/mad.py | 1 | 6806 | import numpy as np
import os
import parmap
import scipy.signal
from yass.postprocess.util import run_deconv, partition_spike_time
def remove_high_mad(fname_templates,
fname_spike_train,
fname_weights,
reader,
neigh_channels,
... | apache-2.0 |
KirtoXX/Security_Camera | ssd_mobilenet/object_detection/box_coders/square_box_coder_test.py | 26 | 4305 | # 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 |
Inter-Actief/django-json-rpc | setup.py | 3 | 1610 | #!/usr/bin/env python
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
HERE = os.path.dirname(os.path.abspath(__file__))
setup(
name="django-json-rpc",
version="0.7.1",
description="A simple JSON-RPC implementation for Django",
long_description... | mit |
highway7/py_1 | populate_rango.py | 1 | 1836 | import os
import django
django.setup()
def populate():
python_cat = add_cat('Python')
add_page(cat=python_cat,
title="Official Python Tutorial",
url="http://docs.python.org/2/tutorial/")
add_page(cat=python_cat,
title="How to Think like a Computer Scientist",
url="http://... | apache-2.0 |
FranMachio/plugin.video.Machio.fran | servers/ultramegabit.py | 42 | 1290 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para ultramegabit
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core ... | gpl-2.0 |
nathanielvarona/airflow | airflow/contrib/hooks/discord_webhook_hook.py | 1 | 1180 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
maniteja123/scipy | scipy/special/tests/test_orthogonal.py | 5 | 28949 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import array, sqrt
from numpy.testing import (TestCase, assert_array_almost_equal,
assert_almost_equal, assert_allclose, assert_raises,
run_module_suite)
from scipy._lib... | bsd-3-clause |
geometalab/osmaxx | runtests.py | 2 | 2575 | #!/usr/bin/env python3
import pytest
import sys
import os
import subprocess
PYTEST_ARGS = {
'default': ['tests'],
'fast': ['tests', '-q'],
}
MODULES_TO_LINT = ['osmaxx', 'tests', 'setup.py', 'runtests.py', ]
FLAKE8_ARGS = MODULES_TO_LINT + ['--ignore=E501']
sys.path.append(os.path.dirname(__file__))
def e... | mit |
sonu283304/onos | tools/test/topos/attmpls.py | 19 | 9278 | #!/usr/bin/env python
"""
"""
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.node import Node
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.util i... | apache-2.0 |
noxora/flask-base | flask/lib/python3.4/site-packages/pip/commands/show.py | 344 | 5891 | from __future__ import absolute_import
from email.parser import FeedParser
import logging
import os
from pip.basecommand import Command
from pip.status_codes import SUCCESS, ERROR
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
logger = logging.getLogger(__name__)
c... | mit |
gregpuzzles1/Sandbox | jargnar-DodgeCars-7f02593/dodgecars.py | 1 | 9879 | ############################################################################################
### ###
### PyGame with three lanes of cars coming at you and you have to dodge them! Have fun! ###
### ... | gpl-3.0 |
nanolearningllc/edx-platform-cypress-2 | lms/djangoapps/lms_migration/management/commands/manage_course_groups.py | 250 | 2091 | #!/usr/bin/python
#
# File: manage_course_groups
#
# interactively list and edit membership in course staff and instructor groups
import re
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User, Group
#-----------------------------------------------------------------------... | agpl-3.0 |
danmar/cppcheck | addons/naming.py | 3 | 3490 | #!/usr/bin/env python3
#
# cppcheck addon for naming conventions
#
# Example usage (variable name must start with lowercase, function name must start with uppercase):
# $ cppcheck --dump path-to-src/
# $ python addons/naming.py --var='[a-z].*' --function='[A-Z].*' path-to-src/*.dump
#
import cppcheckdata
import sys
im... | gpl-3.0 |
msrb/samba | lib/tdb/python/tests/simple.py | 17 | 9204 | #!/usr/bin/env python
# Some simple tests for the Python bindings for TDB
# Note that this tests the interface of the Python bindings
# It does not test tdb itself.
#
# Copyright (C) 2007-2008 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU LGPLv3 or later
import sys
import os
import tempfile
from unittes... | gpl-3.0 |
qguv/config | weechat/plugins/python/bitlbee_completion.py | 5 | 3296 | # -*- coding: utf-8 -*-
# Add tab completion to bitlbee commands
# based on http://scripts.irssi.org/scripts/bitlbee_tab_completion.pl
#
# History:
#
# 2015-11-02, Mickaël Thomas <mickael9@gmail.com>:
# version 0.2: strip color attributes for topic detection
# 2015-03-22, Roger Duran <rogerduran@gmail.com>:
# v... | gpl-3.0 |
walac/build-mozharness | mozharness/base/diskutils.py | 7 | 5262 | """Disk utility module, no mixins here!
examples:
1) get disk size
from mozharness.base.diskutils import DiskInfo, DiskutilsError
...
try:
DiskSize().get_size(path='/', unit='Mb')
except DiskutilsError as e:
# manage the exception e.g: log.error(e)
pass
log.info("%s"... | mpl-2.0 |
dati91/servo | tests/wpt/web-platform-tests/tools/pywebsocket/test/test_handshake.py | 452 | 7134 | #!/usr/bin/env python
#
# 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... | mpl-2.0 |
isyippee/nova | nova/api/openstack/compute/legacy_v2/contrib/createserverext.py | 100 | 1156 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
dlstadther/luigi | test/task_status_message_test.py | 27 | 1223 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
hyperized/ansible | test/units/modules/network/f5/test_bigip_message_routing_transport_config.py | 22 | 6231 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
adeindie/shadowsocks | utils/autoban.py | 1033 | 2156 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# 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 u... | apache-2.0 |
Friday21/python_show_me_the_code | JiYouMCC/0002/0002.py | 24 | 1853 | # using sina app
# test page:http://mccatcivitas.sinaapp.com/showmecode2
import sae.const
import MySQLdb
import uuid
HOST = sae.const.MYSQL_HOST
USER = sae.const.MYSQL_USER
PASSWD = sae.const.MYSQL_PASS
PORT = int(sae.const.MYSQL_PORT)
CHARSET = 'utf8'
INIT_COMMAND = 'set names utf8'
def make_connection(host=HOST, u... | mit |
40023256/2015cdag1man | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/__init__.py | 603 | 6082 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | gpl-3.0 |
bokeh/bokeh | tests/integration/models/test_plot.py | 1 | 5112 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
SiCKRAGETV/SickRage | sickrage/libs/trakt/objects/video.py | 7 | 2996 | from __future__ import absolute_import, division, print_function
from trakt.core.helpers import from_iso8601_datetime
from trakt.objects.core.helpers import update_attributes
from trakt.objects.media import Media
class Video(Media):
def __init__(self, client, keys=None, index=None):
super(Video, self).__... | gpl-3.0 |
julianje/Bishop | build/lib/Bishop/AuxiliaryFunctions.py | 2 | 23931 | # -*- coding: utf-8 -*-
"""
Supporting functions for Bishop
"""
__author__ = "Julian Jara-Ettinger"
__license__ = "MIT"
import ConfigParser
import os
import pickle
import pkg_resources
import copy
import Observer
from PosteriorContainer import *
from Map import *
from Agent import *
def ProbabilityOfChange(ContA, ... | mit |
Intel-Corporation/tensorflow | tensorflow/python/autograph/pyct/anno.py | 24 | 5165 | # 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 |
tboyce1/home-assistant | tests/components/test_panel_custom.py | 9 | 2210 | """The tests for the panel_custom component."""
import asyncio
from unittest.mock import Mock, patch
import pytest
from homeassistant import setup
from homeassistant.components import frontend
from tests.common import mock_component
@pytest.fixture(autouse=True)
def mock_frontend_loaded(hass):
"""Mock frontend... | apache-2.0 |
bachelorwhc/Valkyrie | third_party/tbb/python/tbb/pool.py | 2 | 25163 | #!/usr/bin/env python
#
# Copyright (c) 2016-2017 Intel 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 a... | mit |
SaschaMester/delicium | media/tools/layout_tests/trend_graph_unittest.py | 175 | 1288 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import unittest
from trend_graph import TrendGraph
class TestTrendGraph(unittest.TestCase):
def testU... | bsd-3-clause |
satdreamgr/enigma2 | lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py | 51 | 8416 | from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Components.ActionMap import HelpableActionMap, ActionMap
from Components.Sources.List import List
from Components.Sou... | gpl-2.0 |
rubyinhell/brython | www/src/Lib/encodings/cp1255.py | 37 | 12773 | """ Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def d... | bsd-3-clause |
NixIPFS/nixipfs-scripts | nixipfs/src/mirror_tarballs.py | 1 | 8855 | import json
import urllib.request
import os
import queue
import tempfile
import subprocess
import threading
import shlex
import hashlib
import time
from pygit2 import clone_repository, GIT_RESET_HARD, Repository
from shutil import copyfile
from nixipfs.download_helpers import DownloadFailed
from nixipfs.nix_helpers im... | gpl-3.0 |
sencha/chromium-spacewalk | chrome/tools/webforms_aggregator.py | 185 | 28920 | #!/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.
"""Downloads web pages with fillable forms after parsing through a set of links.
Used for collecting web pages with forms. Used as... | bsd-3-clause |
timlinux/watchkeeper | django_project/event_mapper/migrations/0015_auto_20150511_0858.py | 5 | 2161 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
('event_mapper', '0014_auto_20150508_1133'),
]
operations ... | bsd-2-clause |
sposs/DIRAC | Core/scripts/dirac-setup-site.py | 10 | 1587 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-setup-site
# Author : Ricardo Graciani
########################################################################
"""
Initial installation and configuration of a new DIRAC server (DBs, Services, A... | gpl-3.0 |
IlyaSergeev/taxi_service | first_app/settings.py | 1 | 2501 | """
Django settings for first_app project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | mit |
commial/miasm | test/core/sembuilder.py | 3 | 1400 | from __future__ import print_function
import inspect
from pdb import pm
from miasm.core.sembuilder import SemBuilder
from miasm.core.locationdb import LocationDB
import miasm.expression.expression as m2_expr
# Test classes
class IR(object):
def __init__(self, loc_db):
self.loc_db = loc_db
IRDst = m... | gpl-2.0 |
endlessm/chromium-browser | ios/build/bots/scripts/xcodebuild_runner.py | 1 | 18930 | # Copyright 2018 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.
"""Test runner for running tests using xcodebuild."""
import collections
import distutils.version
import logging
from multiprocessing import pool
import os
... | bsd-3-clause |
alon/servo | tests/wpt/web-platform-tests/tools/py/py/_path/cacheutil.py | 278 | 3333 | """
This module contains multithread-safe cache implementations.
All Caches have
getorbuild(key, builder)
delentry(key)
methods and allow configuration when instantiating the cache class.
"""
from time import time as gettime
class BasicCache(object):
def __init__(self, maxentries=128):
self.maxe... | mpl-2.0 |
MERegistro/meregistro | meregistro/apps/postitulos/urls.py | 1 | 5748 | # -*- coding: UTF-8 -*-
from django.conf.urls.defaults import *
urlpatterns=patterns('',
# Carrera
url(r'^carrera/create$', 'apps.postitulos.views.carrera.create', name='carreraPostituloCreate'),
url(r'^carrera/([0-9]+)/editar$', 'apps.postitulos.views.carrera.edit', name='carreraPostituloEdit'),
url(... | bsd-3-clause |
marctc/django | tests/fixtures/models.py | 230 | 3335 | """
Fixtures.
Fixtures are a way of loading data into the database in bulk. Fixure data
can be stored in any serializable format (including JSON and XML). Fixtures
are identified by name, and are stored in either a directory named 'fixtures'
in the application directory, or in one of the directories named in the
``FIX... | bsd-3-clause |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/change_status_service/transports/grpc.py | 1 | 10133 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 |
shashisp/blumix-webpy | app/applications/admin/controllers/openshift.py | 34 | 2324 | import os
try:
from distutils import dir_util
except ImportError:
session.flash = T('requires distutils, but not installed')
redirect(URL('default', 'site'))
try:
from git import *
except ImportError:
session.flash = T('requires python-git, but not installed')
redirect(URL('default', 'site'))
f... | mit |
enoex/django-shop | shop/tests/order.py | 2 | 12607 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from decimal import Decimal
from django.contrib.auth.models import User
from django.test.testcases import TestCase
from shop.cart.modifiers_pool import cart_modifiers_pool
from shop.models.cartmodel import Cart, CartItem
from shop.addressmodel.models import ... | bsd-3-clause |
koson/MissionPlannerKMTI | Lib/SimpleHTTPServer.py | 152 | 7422 | """Simple HTTP Server.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
__version__ = "0.6"
__all__ = ["SimpleHTTPRequestHandler"]
import os
import posixpath
import BaseHTTPServer
import urllib
import cgi
import sys
import shutil
impor... | gpl-3.0 |
joanneko/goodbooks | goodbooks/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py | 484 | 10037 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
import errno
import warnings
try: # Test for SSL features
import ssl
from ssl import wrap_socket, CERT_NO... | bsd-3-clause |
thicklizard/GPEweepingangel | 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 |
BeATz-UnKNoWN/python-for-android | python3-alpha/extra_modules/gdata/calendar_resource/client.py | 48 | 7252 | #!/usr/bin/python
#
# Copyright 2009 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 ... | apache-2.0 |
nitinitprof/odoo | openerp/osv/osv.py | 337 | 1384 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
JSandusky/ATF | Test/FunctionalTests/TimelineEditorTestScripts/CreateReferencedDocumentInUnsavedTimeline.py | 10 | 1389 | #Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt.
import sys
sys.path.append("./CommonTestScripts")
import System
import Test
import TimelineEditorUtil
#Create a child document that will have 2 tracks
docChild = atfDocService.OpenNewDocument(editor)
group = editingContext.Insert[Group](Do... | apache-2.0 |
jhd/spunout | venv/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | gpl-3.0 |
markslwong/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator.py | 1 | 55289 | # Copyright 2016 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 |
verycumbersome/the-blue-alliance | helpers/event_team_status_helper.py | 3 | 18095 | import copy
import numpy as np
from google.appengine.ext import ndb
from google.appengine.ext.ndb.tasklets import Future
from helpers.match_helper import MatchHelper
from helpers.rankings_helper import RankingsHelper
from helpers.team_helper import TeamHelper
from models.event_details import EventDetails
from models.... | mit |
errx/django | tests/custom_pk/fields.py | 33 | 1629 | import random
import string
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class MyWrapper(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return "<%s: %s>" % (sel... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.