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 |
|---|---|---|---|---|---|
Samuc/Proyecto-IV | lib/python2.7/site-packages/setuptools/tests/test_sdist.py | 332 | 17816 | # -*- coding: utf-8 -*-
"""sdist tests"""
import locale
import os
import shutil
import sys
import tempfile
import unittest
import unicodedata
import re
from setuptools.tests import environment, test_svn
from setuptools.tests.py26compat import skipIf
from setuptools.compat import StringIO, unicode
from setuptools.test... | gpl-2.0 |
wkh124/wkh124 | rna_seq_average_by_gene.py | 1 | 1793 | #!/usr/bin/env python
"""Average RNA-Seq data by unique genes usign a column with unique gene
identifiers from a tab separated file with the data of one sequence per line.
Usage:
./rna_seq_average_by_gene.py input_file id_column name_col data_column
id_column: Number of the column containing the identifiers o... | gpl-3.0 |
eunchong/build | third_party/buildbot_8_4p1/buildbot/test/fake/state.py | 8 | 1027 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | bsd-3-clause |
XXMrHyde/android_external_chromium_org | third_party/tlslite/tlslite/VerifierDB.py | 359 | 3104 | """Class for storing SRP password verifiers."""
from utils.cryptomath import *
from utils.compat import *
import mathtls
from BaseDB import BaseDB
class VerifierDB(BaseDB):
"""This class represent an in-memory or on-disk database of SRP
password verifiers.
A VerifierDB can be passed to a server handshake... | bsd-3-clause |
MikeAmy/django-webtest | django_webtest/middleware.py | 28 | 2546 | # -*- coding: utf-8 -*-
from django.contrib.auth.middleware import RemoteUserMiddleware
from django.core.exceptions import ImproperlyConfigured
from django.contrib import auth
class WebtestUserMiddleware(RemoteUserMiddleware):
"""
Middleware for utilizing django-webtest simplified auth
('user' arg for self... | mit |
cynngah/uofthacksIV | generate-jobs/lib/python2.7/site-packages/requests/_internal_utils.py | 414 | 1096 | # -*- coding: utf-8 -*-
"""
requests._internal_utils
~~~~~~~~~~~~~~
Provides utility functions that are consumed internally by Requests
which depend on extremely few external helpers (such as compat)
"""
from .compat import is_py2, builtin_str, str
def to_native_string(string, encoding='ascii'):
"""Given a str... | mit |
5hawnknight/selenium | py/test/selenium/webdriver/common/click_tests.py | 39 | 1423 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
doot/CouchPotatoServer | libs/guessit/hash_mpc.py | 150 | 1884 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
grzezlo/NVDARemote | addon/globalPlugins/remoteClient/server.py | 5 | 5723 | import json
import os
import select
import socket
import ssl
import sys
import time
class Server:
PING_TIME: int = 300
running: bool = False
port: int
password: str
def __init__(self, port, password, bind_host='', bind_host6='[::]'):
self.port = port
self.password = password
#Maps client... | gpl-2.0 |
CartoDB/crankshaft | release/python/0.8.1/crankshaft/test/test_clustering_getis.py | 11 | 2568 | import unittest
import numpy as np
from helper import fixture_file
from crankshaft.clustering import Getis
import crankshaft.pysal_utils as pu
from crankshaft import random_seeds
import json
from crankshaft.analysis_data_provider import AnalysisDataProvider
# Fixture files produced as follows
#
# import pysal as ps
... | bsd-3-clause |
tmpgit/intellij-community | python/testData/inspections/PyPropertyDefinitionInspection25/src/prop_test.py | 48 | 1700 | class A(object):
def __init__(self, bar):
self._x = 1 ; self._bar = bar
def __getX(self):
return self._x
def __setX(self, x):
self._x = x
def __delX(self):
pass
x1 = property(__getX, __setX, __delX, "doc of x1")
x2 = property(__setX) # should return
x3 = property(__getX, __getX) # shou... | apache-2.0 |
yongtang/tensorflow | tensorflow/python/keras/layers/kernelized_test.py | 6 | 16816 | # 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 |
icereval/osf.io | framework/flask/__init__.py | 19 | 2935 | # -*- coding: utf-8 -*-
from flask import (Flask, request, jsonify, render_template, # noqa
render_template_string, Blueprint, send_file, abort, make_response,
redirect as flask_redirect, url_for, send_from_directory, current_app
)
import furl
from website import settings
# Create app
app = Flask(
__name... | apache-2.0 |
ajdavis/tornado | tornado/test/http1connection_test.py | 29 | 1995 | from __future__ import absolute_import, division, print_function
import socket
from tornado.http1connection import HTTP1Connection
from tornado.httputil import HTTPMessageDelegate
from tornado.iostream import IOStream
from tornado.locks import Event
from tornado.netutil import add_accept_handler
from tornado.testing ... | apache-2.0 |
yewang15215/django | django/conf/locale/cy/formats.py | 504 | 1822 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '25 Hy... | bsd-3-clause |
bxshi/gem5 | src/mem/MemObject.py | 69 | 1734 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
dexterx17/nodoSocket | clients/Python-2.7.6/Lib/json/tests/test_pass1.py | 108 | 1841 | from json.tests import PyTest, CTest
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
... | mit |
morreene/tradenews | venv/Lib/encodings/iso8859_1.py | 266 | 13176 | """ Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | bsd-3-clause |
fedora-infra/fedimg | tests/test_uploader.py | 1 | 3280 | # This file is part of fedimg.
# Copyright (C) 2014-2018 Red Hat, Inc.
#
# fedimg 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 |
sabi0/intellij-community | python/helpers/py2only/docutils/parsers/rst/directives/__init__.py | 104 | 13607 | # $Id: __init__.py 7621 2013-03-04 13:20:49Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This package contains directive implementation modules.
"""
__docformat__ = 'reStructuredText'
import re
import codecs
import sys
from docutils import ... | apache-2.0 |
EricNeedham/assignment-1 | venv/lib/python2.7/site-packages/sqlalchemy/pool.py | 22 | 43867 | # sqlalchemy/pool.py
# Copyright (C) 2005-2014 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
"""Connection pooling for DB-API connections.
Provides a number of connection p... | mit |
surligas/cs436-gnuradio | gr-blocks/python/blocks/qa_message.py | 47 | 4794 | #!/usr/bin/env python
#
# Copyright 2004,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | gpl-3.0 |
switowski/invenio | invenio/ext/fixtures/__init__.py | 17 | 2454 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
AbdealiJK/coala | coalib/results/Diff.py | 6 | 8963 | import copy
import difflib
from coalib.results.LineDiff import LineDiff
from coalib.results.SourceRange import SourceRange
class ConflictError(Exception):
pass
class Diff:
"""
A Diff result represents a difference for one file.
"""
def __init__(self, file_list):
"""
Creates an ... | agpl-3.0 |
lowtalker/splunk-sdk-python | splunklib/binding.py | 1 | 54532 | # Copyright 2011-2014 Splunk, 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 agreed to in wri... | apache-2.0 |
seleniumbase/SeleniumBase | examples/swag_labs_suite.py | 1 | 3866 | from parameterized import parameterized
from seleniumbase import BaseCase
class SwagLabsTests(BaseCase):
def login_to_swag_labs(self, username="standard_user"):
""" Login to Swag Labs and verify success. """
url = "https://www.saucedemo.com"
self.open(url)
if username not in self.g... | mit |
ovnicraft/edx-platform | common/test/acceptance/pages/studio/settings_group_configurations.py | 51 | 10070 | """
Course Group Configurations page.
"""
from bok_choy.promise import EmptyPromise
from ..common.utils import confirm_prompt
from .course_page import CoursePage
class GroupConfigurationsPage(CoursePage):
"""
Course Group Configurations page.
"""
url_path = "group_configurations"
experiment_group... | agpl-3.0 |
namecoin/namecore | test/functional/name_pending.py | 4 | 3956 | #!/usr/bin/env python3
# Copyright (c) 2015-2019 Daniel Kraft
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# RPC test for name_pending call.
from test_framework.names import NameTestFramework
from test_framework.util impor... | mit |
onceuponatimeforever/oh-mainline | vendor/packages/sphinx/sphinx/ext/graphviz.py | 15 | 11017 | # -*- coding: utf-8 -*-
"""
sphinx.ext.graphviz
~~~~~~~~~~~~~~~~~~~
Allow graphviz-formatted graphs to be included in Sphinx-generated
documents inline.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import codecs
import ... | agpl-3.0 |
vagonbar/GNUnetwork | gwn/utils/libfsm/fsm.py | 2 | 14255 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of GNUWiNetwork,
# Copyright (C) 2014 by
# Pablo Belzarena, Gabriel Gomez Sena, Victor Gonzalez Barbone,
# Facultad de Ingenieria, Universidad de la Republica, Uruguay.
#
# GNUWiNetwork is free software: you can redistribute it ... | gpl-3.0 |
google-research/google-research | psycholab/examples/prisoners_dilemma.py | 1 | 3208 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
eltonsantos/django | django/contrib/auth/backends.py | 37 | 5066 | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
class ModelBackend(object):
"""
Authenticates against django.contrib.auth.models.User.
"""
def authenticate(self, username=None, password=None, **kwargs):
U... | bsd-3-clause |
mith1979/ansible_automation | applied_python/applied_python/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py | 172 | 6278 | from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
try: # Python 2.7+
from co... | apache-2.0 |
pbmanis/acq4 | acq4/pyqtgraph/reload.py | 3 | 19191 | # -*- coding: utf-8 -*-
"""
Magic Reload Library
Luke Campagnola 2010
Python reload function that actually works (the way you expect it to)
- No re-importing necessary
- Modules can be reloaded in any order
- Replaces functions and methods with their updated code
- Changes instances to use updated classes
- Aut... | mit |
chamikaramj/beam | sdks/python/apache_beam/utils/pipeline_options_validator_test.py | 9 | 11571 | #
# 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 us... | apache-2.0 |
Aristocles/CouchPotatoServer | libs/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-3.0 |
javier3407/Plugin.Video.eljavihay | resources/lib/chardet/mbcssm.py | 982 | 19608 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-3.0 |
servo/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/junitxml.py | 11 | 25760 | """Report test results in JUnit-XML format, for use with Jenkins and build
integration servers.
Based on initial code from Ross Lawley.
Output conforms to
https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
"""
import functools
import os
im... | mpl-2.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/host/lib/python2.7/test/test__locale.py | 111 | 5807 | from test.test_support import run_unittest
from _locale import (setlocale, LC_NUMERIC, localeconv, Error)
try:
from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
except ImportError:
nl_langinfo = None
import unittest
import sys
from platform import uname
if uname()[0] == "Darwin":
maj, min, mic = [int(... | gpl-2.0 |
zhouzhenghui/python-for-android | python3-alpha/extra_modules/gdata/test_data.py | 103 | 348233 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... | apache-2.0 |
KaiSzuttor/espresso | testsuite/python/actor.py | 1 | 3068 | #
# Copyright (C) 2018-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | gpl-3.0 |
neno1978/pelisalacarta | python/main-classic/servers/rapidvideo.py | 2 | 2476 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para rapidvideo
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
import urllib
from core import httptools
fro... | gpl-3.0 |
fastinetserver/portage-idfetch | pym/_emerge/BinpkgPrefetcher.py | 1 | 1186 | # 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 |
fernandog/Sick-Beard | cherrypy/lib/auth_basic.py | 35 | 3639 | # This file is part of CherryPy <http://www.cherrypy.org/>
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab:fileencoding=utf-8
__doc__ = """Module auth_basic.py provides a CherryPy 3.x tool which implements
the server-side of HTTP Basic Access Authentication, as described in RFC 2617.
Example usage, using the... | gpl-3.0 |
Puneeth-n/anna-molly | test/test_collector.py | 2 | 1172 | import sys
import os.path
from mock import Mock
ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(os.path.join(ROOT_DIR, 'bin')) # add bin dir to stub collector internals
import collector
from lib.modules.models import TimeSeriesTuple
class TestCollector(object):
@classmethod
def se... | mit |
thanhacun/odoo | addons/mail/tests/test_mail_features.py | 172 | 59265 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
miloszz/DIRAC | ResourceStatusSystem/Client/ResourceManagementClient.py | 6 | 41110 | # $HeadURL: $
""" ResourceManagementClient
Client to interact with the ResourceManagementDB.
"""
from DIRAC import gLogger, S_ERROR
from DIRAC.Core.DISET.RPCClient import RPCClient
__RCSID__ = '$Id: $'
class ResourceManagementClient( object ):
"""
The :class:`ResourceManagementClient`... | gpl-3.0 |
talon-one/talon_one.py | test/test_ledger_entry.py | 1 | 2766 | # coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | mit |
abhishek-ch/hue | desktop/core/ext-py/python-openid-2.2.5/openid/store/memstore.py | 165 | 3597 | """A simple store using only in-process memory."""
from openid.store import nonce
import copy
import time
class ServerAssocs(object):
def __init__(self):
self.assocs = {}
def set(self, assoc):
self.assocs[assoc.handle] = assoc
def get(self, handle):
return self.assocs.get(handle... | apache-2.0 |
lz1988/company-site | tests/regressiontests/admin_changelist/models.py | 51 | 2489 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(model... | bsd-3-clause |
Trust-Code/PySPED | pysped/cte/leiaute/conssitcte_104.py | 8 | 5910 | # -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Library General Public Lic... | lgpl-2.1 |
google/contentbox | third_party/social/strategies/cherrypy_strategy.py | 8 | 2039 | import six
import cherrypy
from social.strategies.base import BaseStrategy, BaseTemplateStrategy
class CherryPyJinja2TemplateStrategy(BaseTemplateStrategy):
def __init__(self, strategy):
self.strategy = strategy
self.env = cherrypy.tools.jinja2env
def render_template(self, tpl, context):
... | apache-2.0 |
NeCTAR-RC/neutron | neutron/db/migration/alembic_migrations/portsec_init_ops.py | 61 | 1452 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
luotao1/Paddle | python/paddle/fluid/tests/unittests/xpu/test_lamb_op_xpu.py | 2 | 3892 | # Copyright (c) 2020 PaddlePaddle 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 app... | apache-2.0 |
jdreaver/vispy | vispy/visuals/border.py | 17 | 6845 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | bsd-3-clause |
zadgroup/edx-platform | lms/djangoapps/licenses/management/commands/generate_serial_numbers.py | 106 | 1929 | from uuid import uuid4
from django.utils.html import escape
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.django import modulestore
from licenses.models import CourseSoftware, UserLicense
from opaque_keys.edx.locations import SlashSeparatedCourseKey
class Command(BaseCo... | agpl-3.0 |
jkramarz/zuombot | cloudbot/util/web.py | 19 | 4934 | """
web.py
Contains functions for interacting with web services.
Created by:
- Bjorn Neergaard <https://github.com/neersighted>
Maintainer:
- Luke Rogers <https://github.com/lukeroge>
License:
GPL v3
"""
import json
import requests
# Constants
DEFAULT_SHORTENER = 'is.gd'
DEFAULT_PASTEBIN = 'hastebin... | gpl-3.0 |
fish2000/h5dj | docs/conf.py | 1 | 7955 | # -*- coding: utf-8 -*-
#
# h5dj documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 25 06:03:15 2012.
#
# 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 co... | bsd-3-clause |
shlomif/patool | patoolib/programs/cpio.py | 1 | 2007 | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2012 Bastian Kleineidam
#
# 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
# (at your option) any later version.
#... | gpl-3.0 |
gabrielfalcao/lettuce | tests/integration/lib/Django-1.3/django/utils/cache.py | 96 | 9483 | """
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | gpl-3.0 |
tell-k/csquery | setup.py | 1 | 2233 | # -*- coding: utf-8 -*-
import sys
import os
import re
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
def initialize_options(self):
TestCommand.init... | mit |
tornadozou/tensorflow | tensorflow/contrib/learn/python/learn/graph_actions.py | 76 | 28682 | # 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 |
ErykB2000/home-assistant | homeassistant/helpers/state.py | 4 | 1685 | """
homeassistant.helpers.state
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Helpers that help with state related things.
"""
import logging
from homeassistant import State
import homeassistant.util.dt as dt_util
from homeassistant.const import (
STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID)
_LOGGER = l... | mit |
seanfisk/buzzword-bingo-server | django/contrib/gis/tests/geogapp/tests.py | 222 | 4080 | """
Tests for geography support in PostGIS 1.5+
"""
import os
from django.contrib.gis import gdal
from django.contrib.gis.measure import D
from django.test import TestCase
from models import City, County, Zipcode
class GeographyTest(TestCase):
def test01_fixture_load(self):
"Ensure geography features load... | bsd-3-clause |
bennylope/garland | setup.py | 1 | 1539 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("garland.py", "r") as module_file:
for line in module_file:
if line.startswith("__version__"):
version_string = line.spli... | bsd-3-clause |
yujinrobot/transitions | transitions/core.py | 1 | 20113 | try:
from builtins import object
except ImportError:
# python2
pass
from functools import partial
from collections import defaultdict, OrderedDict
from six import string_types
import logging
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
def listify(obj):
if obj is None... | mit |
Programmica/pygtk-tutorial | codebank/iconviewdual.py | 1 | 2745 | #!/usr/bin/env python
import gtk
class IconViewDual:
def item_dragged(self, iconview, context, selection, info, time):
model = iconview.get_model()
selected = iconview.get_selected_items()
files = []
for item in selected[0]:
location = model[item][1]
... | cc0-1.0 |
ccastell/Transfer-System | Website/env/lib/python3.5/site-packages/django/db/migrations/recorder.py | 478 | 2868 | from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
class MigrationRecor... | apache-2.0 |
loranbriggs/barberlist | build/psycopg2/build/lib.linux-x86_64-2.7/psycopg2/tests/test_dates.py | 8 | 22260 | #!/usr/bin/env python
# test_dates.py - unit test for dates handling
#
# Copyright (C) 2008-2011 James Henstridge <james@jamesh.id.au>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, eith... | mit |
Xeralux/tensorflow | tensorflow/python/debug/lib/source_utils_test.py | 89 | 13687 | # 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 |
nhynes/neon | examples/mnist_branch.py | 2 | 3877 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | apache-2.0 |
jhendrixMSFT/coreclr | src/scripts/genXplatEventing.py | 28 | 30394 | #
## Licensed to the .NET Foundation under one or more agreements.
## The .NET Foundation licenses this file to you under the MIT license.
## See the LICENSE file in the project root for more information.
#
#
#USAGE:
#Add Events: modify <root>src/vm/ClrEtwAll.man
#Look at the Code in <root>/src/scripts/genXplatLttng.... | mit |
ashishnitinpatil/django_appengine_project_template | django/utils/ipv6.py | 113 | 7965 | # This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/
# Licensed under the Apache License, Version 2.0 (the "License").
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.six.moves import xrang... | bsd-2-clause |
frenos/wireshark | tools/rdps.py | 42 | 4450 | #!/usr/bin/env python
#
# rdps.py
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# 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... | gpl-2.0 |
XiaodunServerGroup/xiaodun-platform | lms/djangoapps/instructor/management/commands/openended_stats.py | 20 | 5270 | """
Command to get statistics about open ended problems.
"""
import csv
import time
from django.core.management.base import BaseCommand
from optparse import make_option
from xmodule.modulestore import Location
from xmodule.modulestore.django import modulestore
from xmodule.open_ended_grading_classes.openendedchild im... | agpl-3.0 |
jaggu303619/asylum-v2.0 | openerp/addons/base/res/res_bank.py | 14 | 10539 | # -*- 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 |
hgrif/incubator-airflow | airflow/api/common/experimental/trigger_dag.py | 9 | 1706 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
popazerty/try | lib/python/Plugins/Extensions/IniEcasa/__init__.py | 4 | 1094 | #pragma mark - Config
from Components.config import config, ConfigSubsection, ConfigText, \
ConfigPassword, ConfigLocations, ConfigSet, ConfigNumber, \
ConfigSelection
from Tools.Directories import resolveFilename, SCOPE_HDD
config.plugins.ecasa = ConfigSubsection()
config.plugins.ecasa.google_username = ConfigTe... | gpl-2.0 |
dcjohnson1989/selenium | py/selenium/webdriver/safari/webdriver.py | 71 | 2802 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
elba7r/frameworking | frappe/www/desk.py | 2 | 2141 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
no_sitemap = 1
no_cache = 1
base_template_path = "templates/www/desk.html"
import os, re
import frappe
from frappe import _
import frappe.sessions
def get_context(context):
if... | mit |
OpenSciViz/cloudstack | openstack/src/python/nova-libvirt/host.py | 2 | 33050 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... | mit |
uzgit/ardupilot | Tools/ardupilotwaf/cmake.py | 42 | 13322 | #!/usr/bin/env python
# encoding: utf-8
# Copyright (C) 2015-2016 Intel Corporation. All rights reserved.
#
# This file 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-3.0 |
lavalamp-/ws-backend-community | lib/filesystem.py | 1 | 16528 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import errno
import json
from uuid import uuid4
import shutil
import math
import logging
from subprocess import check_output, CalledProcessError
from .config import ConfigManager
config = ConfigManager.instance()
logger = logging.getLogger(__n... | gpl-3.0 |
mefryar/epodx-dashboards | code/update_dashboard.py | 1 | 9234 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Program: Update Dashboard
Programmer: Michael Fryar, Research Fellow, EPoD
Date created: January 5, 2017
Purpose: Establish SSH tunnel to edX Analytics API, download learner
data, and write data to Google Sheets via Sheets API.
First time: Must run get_credentials.py ... | mit |
OpenWinCon/OpenWinNet | web-gui/myvenv/lib/python3.4/site-packages/rest_framework/decorators.py | 20 | 4560 | """
The most important decorator in this module is `@api_view`, which is used
for writing function-based views with REST framework.
There are also various decorators for setting the API policies on function
based views, as well as the `@detail_route` and `@list_route` decorators, which are
used to annotate methods on ... | apache-2.0 |
Jumpscale/jumpscale_core8 | lib/JumpScale/baselib/atyourservice81/tests/unit__test.py | 1 | 2343 | import unittest
from JumpScale import j
class AYSKey(unittest.TestCase):
def setUp(self):
self.test_table = [
{
'key': 'domain|name!instance@role',
'expect': {
'domain': 'domain',
'name': 'name',
'inst... | apache-2.0 |
ncos/lisa | src/lisa_drive/scripts/venv/lib/python3.5/site-packages/pip-10.0.1-py3.5.egg/pip/_vendor/colorama/ansitowin32.py | 5 | 9904 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinT... | mit |
duguyue100/telaugesa | scripts/mnist_convnet_test.py | 1 | 3733 | """ConvNet MNIST teset"""
import numpy as np;
import theano;
import theano.tensor as T;
import telaugesa.datasets as ds;
from telaugesa.fflayers import ReLULayer;
from telaugesa.fflayers import SoftmaxLayer;
from telaugesa.convnet import ReLUConvLayer;
from telaugesa.convnet import MaxPooling;
from telaugesa.convnet... | mit |
bregman-arie/ansible | test/units/module_utils/basic/test_run_command.py | 86 | 7863 | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division)
__metaclass__ = type
import errno
from itertools import product
from io import Byt... | gpl-3.0 |
PsycheDox/CalCoin | contrib/spendfrom/spendfrom.py | 792 | 10053 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | mit |
vanant/googleads-dfa-reporting-samples | python/v2.0/download_floodlight_tag.py | 1 | 2053 | #!/usr/bin/python
#
# Copyright 2014 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 b... | apache-2.0 |
yongtang/tensorflow | tensorflow/python/kernel_tests/segment_reduction_ops_test.py | 6 | 43677 | # 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 |
maxtors/suricata | qa/sock_to_gzip_file.py | 31 | 1995 | #!/usr/bin/python
#I love the python Power Glove. It's so bad!
#Usage: sudo -u suricata ./sock_to_gzip_file.py --output-file="http.log.gz" --listen-sock="http.log.sock"
import socket,os
import gzip
import sys
from optparse import OptionParser
if __name__ == "__main__":
parser = OptionParser()
#Path to the soc... | gpl-2.0 |
jaggu303619/asylum | openerp/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py | 52 | 2883 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
IV-GII/SocialCookies | ENV1/lib/python2.7/site-packages/django/middleware/transaction.py | 113 | 2641 | import warnings
from django.core.exceptions import MiddlewareNotUsed
from django.db import connection, 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
... | gpl-2.0 |
opentracing/opentracing-python | tests/mocktracer/test_propagation.py | 3 | 2742 | # Copyright (c) The OpenTracing Authors.
#
# 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, merge, publish,... | apache-2.0 |
nnethercote/servo | tests/wpt/web-platform-tests/tools/third_party/hpack/test/test_huffman.py | 36 | 1981 | # -*- coding: utf-8 -*-
from hpack.exceptions import HPACKDecodingError
from hpack.huffman_table import decode_huffman
from hpack.huffman import HuffmanEncoder
from hpack.huffman_constants import REQUEST_CODES, REQUEST_CODES_LENGTH
from hypothesis import given, example
from hypothesis.strategies import binary
class ... | mpl-2.0 |
bigdatauniversity/edx-platform | openedx/core/djangoapps/profile_images/tests/helpers.py | 117 | 1742 | """
Helper methods for use in profile image tests.
"""
from contextlib import contextmanager
import os
from tempfile import NamedTemporaryFile
from django.core.files.uploadedfile import UploadedFile
from PIL import Image
@contextmanager
def make_image_file(dimensions=(320, 240), extension=".jpeg", force_size=None):
... | agpl-3.0 |
kinooo/Sick-Beard | lib/requests/packages/oauthlib/oauth1/rfc5849/parameters.py | 186 | 4817 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
oauthlib.parameters
~~~~~~~~~~~~~~~~~~~
This module contains methods related to `section 3.5`_ of the OAuth 1.0a spec.
.. _`section 3.5`: http://tools.ietf.org/html/rfc5849#section-3.5
"""
from urlparse import urlparse, urlunparse
from . import util... | gpl-3.0 |
almet/whiskerboard | settings/base.py | 2 | 3218 | from unipath import FSPath as Path
PROJECT_DIR = Path(__file__).absolute().ancestor(2)
######################################
# Main
######################################
DEBUG = True
ROOT_URLCONF = 'urls'
SITE_ID = 1
######################################
# Apps
######################################
INSTALLED_AP... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.