repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
ringo-framework/ringo_news | ringo_news/__init__.py | 1 | 1241 | import logging
from pyramid.i18n import TranslationStringFactory
from ringo.resources import get_resource_factory
from ringo.lib.i18n import translators
from ringo.lib.extension import register_modul
from ringo.lib.helpers import get_action_routename
# Import models so that alembic is able to autogenerate migrations
#... | gpl-3.0 |
aleksandr-bakanov/astropy | astropy/units/format/generic.py | 3 | 18514 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module includes files automatically generated from ply (these end in
# _lextab.py and _parsetab.py). To generate these files, remove them from this
# folder, then build astropy and run the tests in-place:
#
# python setup.py build_ext --inplace
#... | bsd-3-clause |
victoredwardocallaghan/pygments-main | pygments/styles/xcode.py | 126 | 1501 | # -*- coding: utf-8 -*-
"""
pygments.styles.xcode
~~~~~~~~~~~~~~~~~~~~~
Style similar to the `Xcode` default theme.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, N... | bsd-2-clause |
geniusgordon/NTHUOJ_web | index/views.py | 4 | 5845 | '''
The MIT License (MIT)
Copyright (c) 2014 NTHUOJ team
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, ... | mit |
resmo/ansible | lib/ansible/modules/cloud/openstack/os_user.py | 24 | 10053 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
etzhou/edx-platform | lms/djangoapps/lti_provider/migrations/0002_create_lti_outcome_management.py | 84 | 8078 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self... | agpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/libs/liboozie/src/liboozie/types.py | 2 | 17663 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
t794104/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_block_storage.py | 44 | 9899 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
fpischedda/pywek20_tweet_feed | tweet_feed/producer.py | 1 | 1175 | import pika
import ujson
class Producer:
EXCHANGE_NAME = 'feed_source'
EXCHANGE_TYPE = 'fanout'
def __init__(self, amqp_url=None):
if amqp_url is not None:
self.connect(amqp_url)
else:
self.connection = None
self.properties = pika.BasicProperties('applic... | bsd-3-clause |
ArcherSys/ArcherSys | eclipse/plugins/org.python.pydev_4.5.5.201603221110/pysrc/pydevd_attach_to_process/winappdbg/util.py | 102 | 36223 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... | mit |
JCBarahona/edX | common/djangoapps/third_party_auth/tests/test_settings.py | 63 | 2412 | """Unit tests for settings.py."""
from third_party_auth import provider, settings
from third_party_auth.tests import testutil
import unittest
_ORIGINAL_AUTHENTICATION_BACKENDS = ('first_authentication_backend',)
_ORIGINAL_INSTALLED_APPS = ('first_installed_app',)
_ORIGINAL_MIDDLEWARE_CLASSES = ('first_middleware_cla... | agpl-3.0 |
JCBarahona/edX | openedx/core/djangoapps/credit/signals.py | 79 | 3915 | """
This file contains receivers of course publication signals.
"""
import logging
from django.dispatch import receiver
from django.utils import timezone
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.signals.signals import GRADES_UPDATED
from openedx.core.djangoapps.credit.verification_acce... | agpl-3.0 |
jshiv/turntable | test/lib/python2.7/site-packages/numpy/lib/tests/test_financial.py | 36 | 6390 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_almost_equal
)
class TestFinancial(TestCase):
def test_rate(self):
assert_almost_equal(np.rate(10, 0, -3500, 10000),
... | mit |
tpaviot/smesh | test/gtest-1.7.0/scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/usr/bin/env python
#
# Copyright 2006, 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... | lgpl-2.1 |
knehez/edx-platform | lms/djangoapps/courseware/tests/__init__.py | 101 | 4972 | """
integration tests for xmodule
Contains:
1. BaseTestXmodule class provides course and users
for testing Xmodules with mongo store.
"""
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.test.client import Client
from edxmako.shortcuts import render_to... | agpl-3.0 |
prefetchnta/questlab | bin/python/Lib/html/parser.py | 5 | 21381 | """A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDAT... | lgpl-2.1 |
JioEducation/edx-platform | cms/djangoapps/contentstore/management/commands/clean_cert_name.py | 37 | 7765 | """
A single-use management command that provides an interactive way to remove
erroneous certificate names.
"""
from collections import namedtuple
from django.core.management.base import BaseCommand
from xmodule.modulestore.django import modulestore
from xmodule.modulestore import ModuleStoreEnum
Result = namedtupl... | agpl-3.0 |
gbiggs/rtshell | rtshell/rtdel.py | 2 | 4009 | #!/usr/bin/env python2
# -*- Python -*-
# -*- coding: utf-8 -*-
'''rtshell
Copyright (C) 2009-2015
Geoffrey Biggs
RT-Synthesis Research Group
Intelligent Systems Research Institute,
National Institute of Advanced Industrial Science and Technology (AIST),
Japan
All rights reserved.
Licensed und... | lgpl-3.0 |
florian-f/sklearn | sklearn/manifold/locally_linear.py | 3 | 24871 | """Locally Linear Embedding"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD, (C) INRIA 2011
import numpy as np
from scipy.linalg import eigh, svd, qr, solve
from scipy.sparse import eye, csr_matrix
from ..base import BaseEstim... | bsd-3-clause |
haveal/googleads-dfa-reporting-samples | python/v2.1/get_reports.py | 3 | 2011 | #!/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 |
dbrgn/pygments-mirror | pygments/filter.py | 365 | 2071 | # -*- coding: utf-8 -*-
"""
pygments.filter
~~~~~~~~~~~~~~~
Module that implements the default filter.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
def apply_filters(stream, filters, lexer=None):
"""
Use this method to app... | bsd-2-clause |
hermaa02/cs330-final | db.py | 1 | 5927 | from flask.ext.sqlalchemy import SQLAlchemy
from flask import Flask
import os
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://jkrbnkekcosnxb:jOrPwurv94mnMu7acVpIX0W2sA@ec2-54-197-230-161.compute-1.amazonaws.com:5432/da79ahfav90021'
db = SQLAlchemy(app)
class Item(db.Model):
__tablenam... | apache-2.0 |
gfcapalbo/website | website_hr_contact/__openerp__.py | 3 | 1511 | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of website_hr_contact,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# website_hr_contact is free software:
# you can redistribute it and/or mod... | agpl-3.0 |
kamarush/android_kernel_sony_yuga_lp | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
imuse2012/grit-i18n | grit/gather/tr_html.py | 61 | 27320 | #!/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.
'''A gatherer for the TotalRecall brand of HTML templates with replaceable
portions. We wanted to reuse extern.tclib.api.handlers.... | bsd-2-clause |
HtmlUnit/selenium | py/test/selenium/webdriver/common/interactions_tests.py | 63 | 10376 | # 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 |
chamikaramj/incubator-beam | sdks/python/apache_beam/io/gcp/pubsub.py | 8 | 3406 | #
# 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 |
CPFL/gxen | tools/xm-test/lib/XmTestReport/ResultReport.py | 42 | 3981 | #!/usr/bin/python
"""
ResultReport.py - Handles the gathering and xml-formatting of xm-test
results
Copyright (C) International Business Machines Corp., 2005
Author: Dan Smith <danms@us.ibm.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU... | gpl-2.0 |
bright-sparks/chromium-spacewalk | tools/perf/measurements/media.py | 6 | 2658 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from metrics import cpu
from metrics import media
from metrics import system_memory
from metrics import power
from telemetry.page import page_test
class Me... | bsd-3-clause |
andrewklau/openshift-tools | openshift/installer/vendored/openshift-ansible-3.4.40/filter_plugins/openshift_node.py | 47 | 1796 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
'''
Custom filters for use in openshift-node
'''
from ansible import errors
class FilterModule(object):
''' Custom ansible filters for use by openshift_node role'''
@staticmethod
def get_dns_ip(openshift_dns_ip, hostvars):
... | apache-2.0 |
drnextgis/QGIS | tests/src/python/test_qgsdoccoverage.py | 6 | 4437 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for API documentation coverage.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later ver... | gpl-2.0 |
coiax/-tg-station | SQL/ban_conversion_2018-10-28.py | 51 | 9890 | #Python 3+ Script for converting ban table format as of 2018-10-28 made by Jordie0608
#
#Before starting ensure you have installed the mysqlclient package https://github.com/PyMySQL/mysqlclient-python
#It can be downloaded from command line with pip:
#pip install mysqlclient
#
#You will also have to create a new ban ta... | agpl-3.0 |
pief/python-netsnmpagent | examples/threading_agent.py | 1 | 7250 | #!/usr/bin/env python
#
# python-netsnmpagent example agent with threading
#
# Copyright (c) 2013-2019 Pieter Hollants <pieter@hollants.com>
# Licensed under the GNU Lesser Public License (LGPL) version 3
#
#
# simple_agent.py demonstrates registering the various SNMP object types quite
# nicely but uses an inferior c... | lgpl-3.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/notebook/auth/security.py | 6 | 2762 | """
Password generation for the Notebook.
"""
import getpass
import hashlib
import random
from ipython_genutils.py3compat import cast_bytes, str_to_bytes
# Length of the salt in nr of hex chars, which implies salt_len * 4
# bits of randomness.
salt_len = 12
def passwd(passphrase=None, algorithm='sha1'):
"""Gene... | mit |
faywong/FFPlayer | project/jni/python/src/Lib/sre_parse.py | 61 | 26878 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | lgpl-2.1 |
msmolens/VTK | ThirdParty/Twisted/twisted/protocols/pcp.py | 71 | 7090 | # -*- test-case-name: twisted.test.test_pcp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Producer-Consumer Proxy.
"""
from zope.interface import implements
from twisted.internet import interfaces
class BasicProducerConsumerProxy:
"""
I can act as a man in the middle betwe... | bsd-3-clause |
Pluto-tv/chromium-crosswalk | native_client_sdk/src/doc/doxygen/generate_docs.py | 22 | 9794 | #!/usr/bin/env python
# Copyright (c) 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.
"""Script to regenerate API docs using doxygen.
"""
import argparse
import collections
import json
import os
import shutil
import ... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/266_test_xml_etree.py | 2 | 9817 | # xml.etree test. This file contains enough tests to make sure that
# all included components work as they should. For a more extensive
# test suite, see the selftest script in the ElementTree distribution.
import doctest
import sys
from test import test_support
SAMPLE_XML = """
<body>
<tag>text</tag>
<tag />
... | gpl-3.0 |
rsteca/python-social-auth | social/apps/pyramid_app/models.py | 67 | 2119 | """Pyramid SQLAlchemy ORM models for Social Auth"""
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship, backref
from social.utils import setting_name, module_member
from social.storage.sqlalchemy_orm import SQLAlchemyUserMixin, \
... | bsd-3-clause |
joshuahoman/vivisect | vivisect/exc.py | 7 | 1234 |
"""
All the exception types raised by workspace APIs go here.
"""
class InvalidLocation(Exception):
def __init__(self, va, msg=None):
Exception.__init__(self, "Invalid Location 0x%.8x: %s" % (va,msg))
class DuplicateName(Exception):
def __init__(self, origva, newva, name):
Exception.__init__(... | apache-2.0 |
cntnboys/410Lab6 | v1/lib/python2.7/site-packages/django/db/backends/mysql/introspection.py | 43 | 8585 | import re
from .base import FIELD_TYPE
from django.utils.datastructures import OrderedSet
from django.db.backends import BaseDatabaseIntrospection, FieldInfo
from django.utils.encoding import force_text
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
... | apache-2.0 |
ningirsu/stepmania-server | test/test_listener/test_workers/test_chat.py | 1 | 4055 | """ Test Chat worker module """
import mock
from smserver import server
from smserver.listener.workers import chat
from smserver.smutils.smpacket import smpacket
from test import utils
from test.factories.room_factory import RoomFactory
from test.factories.connection_factory import ConnectionFactory
from test.factor... | mit |
HerlanAssis/Django-AulaOsvandoSantana | lib/python2.7/site-packages/pip/_vendor/html5lib/filters/optionaltags.py | 1727 | 10500 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2... | mit |
kobejean/tensorflow | tensorflow/python/keras/layers/core.py | 4 | 38236 | # 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 |
AutorestCI/azure-sdk-for-python | azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/vision/contentmoderator/models/ipa.py | 2 | 1175 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
mancoast/CPythonPyc_test | fail/342_test_fork1.py | 84 | 3783 | """This test checks for correct fork() behavior.
"""
import _imp as imp
import os
import signal
import sys
import time
from test.fork_wait import ForkWait
from test.support import (run_unittest, reap_children, get_attribute,
import_module, verbose)
threading = import_module('threading')
# ... | gpl-3.0 |
github-account-because-they-want-it/django | django/core/files/locks.py | 725 | 3516 | """
Portable file locking utilities.
Based partially on an example by Jonathan Feignberg in the Python
Cookbook [1] (licensed under the Python Software License) and a ctypes port by
Anatoly Techtonik for Roundup [2] (license [3]).
[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
[2] http://sourceforg... | bsd-3-clause |
eino-makitalo/odoo | addons/hr_timesheet_sheet/__openerp__.py | 259 | 2886 | # -*- 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 |
dendisuhubdy/tensorflow | tensorflow/contrib/linear_optimizer/python/sdca_estimator.py | 39 | 21783 | # 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 |
leki75/ansible | lib/ansible/plugins/connection/winrm.py | 14 | 25420 | # (c) 2014, Chris Church <chris@ninemoreminutes.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 lat... | gpl-3.0 |
kjb085/cmdvninja-sublime | requests/packages/charade/__init__.py | 122 | 1327 | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any late... | mit |
NINAnor/QGIS | python/plugins/processing/algs/qgis/ExportGeometryInfo.py | 1 | 4986 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ExportGeometryInfo.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... | gpl-2.0 |
nitin-cherian/LifeLongLearning | Web_Development_Python/RealPython/real-python-test/env/lib/python3.5/site-packages/setuptools/dist.py | 79 | 35704 | __all__ = ['Distribution']
import re
import os
import sys
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.core import Distribution as _Distribution
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
Distuti... | mit |
miloszz/DIRAC | FrameworkSystem/Agent/SystemLoggingDBCleaner.py | 7 | 1633 | # $HeadURL$
__RCSID__ = "$Id$"
""" SystemLoggingDBCleaner erases records whose messageTime column
contains a time older than 'RemoveDate' days, where 'RemoveDate'
is an entry in the Configuration Service section of the agent.
"""
from DIRAC.Core.Base.AgentModule import AgentModule
from DIRAC import S_OK
... | gpl-3.0 |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/alembic/templates/generic/env.py | 71 | 1995 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | mit |
abhishek-ch/hue | desktop/core/ext-py/pyopenssl/doc/tools/anno-api.py | 36 | 2186 | #! /usr/bin/env python
"""Add reference count annotations to the Python/C API Reference."""
__version__ = '$Revision: 1.1.1.1 $'
import getopt
import os
import sys
import refcounts
PREFIX_1 = r"\begin{cfuncdesc}{PyObject*}{"
PREFIX_2 = r"\begin{cfuncdesc}{PyVarObject*}{"
def main():
rcfile = os.path.join(os.p... | apache-2.0 |
illicitonion/buck | third-party/py/unittest2/unittest2/test/test_unittest2_with.py | 111 | 5018 | from __future__ import with_statement
import unittest2
from unittest2.test.support import OldTestResult, catch_warnings
import warnings
# needed to enable the deprecation warnings
warnings.simplefilter('default')
class TestWith(unittest2.TestCase):
"""Tests that use the with statement live in this
module so ... | apache-2.0 |
beni55/thefuck | tests/rules/test_tsuru_not_command.py | 17 | 2760 | import pytest
from tests.utils import Command
from thefuck.rules.tsuru_not_command import match, get_new_command
@pytest.mark.parametrize('command', [
Command('tsuru log', stderr=(
'tsuru: "tchururu" is not a tsuru command. See "tsuru help".\n'
'\nDid you mean?\n'
'\tapp-log\n'
'\... | mit |
yesho/MITMf | core/responder/fingerprint.py | 24 | 2201 | #!/usr/bin/env python
# This file is part of Responder
# Original work by Laurent Gaffie - Trustwave Holdings
#
# 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, o... | gpl-3.0 |
bewallyt/Classy | signup/combine_slots.py | 3 | 1958 | from posts.models import Post
from signup.models import SignUp, SignUpSlot, TimeBlock
from posts.serializers import PostSerializer
from signup.serializers import SignUpSheetSerializer,SignUpSlotSerializer, TimeBlockSerializer
from datetime import datetime
def combine(requester, post, signup, num_slots_to_combine):
... | mit |
ContinuumIO/pypi-conda-builds | classify_logs.py | 1 | 3161 | import re
import yaml
error_types = ["No recipe available",
"No packages found in current linux-64 channels",
"missing build dependency",
"test failure: missing dependency",
"test failure: other reasons",
"invalid syntax",
"uncla... | bsd-3-clause |
bsmr-misc-forks/letsencrypt | acme/acme/jose/util.py | 19 | 7418 | """JOSE utilities."""
import collections
from cryptography.hazmat.primitives.asymmetric import rsa
import OpenSSL
import six
class abstractclassmethod(classmethod):
# pylint: disable=invalid-name,too-few-public-methods
"""Descriptor for an abstract classmethod.
It augments the :mod:`abc` framework with ... | apache-2.0 |
mitchelljkotler/django | tests/template_tests/filter_tests/test_autoescape.py | 513 | 1342 | from django.test import SimpleTestCase
from ..utils import SafeClass, UnsafeClass, setup
class AutoescapeStringfilterTests(SimpleTestCase):
"""
Filters decorated with stringfilter still respect is_safe.
"""
@setup({'autoescape-stringfilter01': '{{ unsafe|capfirst }}'})
def test_autoescape_string... | bsd-3-clause |
lcrees/callchain | fabfile.py | 1 | 1179 | '''callchain fabfile'''
from fabric.api import prompt, local, settings, env
def _test(val):
truth = val in ['py26', 'py27', 'py32']
if truth is False:
raise KeyError(val)
return val
def tox():
'''test callchain'''
local('tox')
def tox_recreate():
'''recreate callchain test env'''
... | mit |
odoo-brazil/PySPED | pysped/relato_sped/base.py | 9 | 15634 | # -*- 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 |
TheMOOCAgency/edx-platform | lms/djangoapps/branding/tests/test_api.py | 10 | 4864 | # encoding: utf-8
"""Tests of Branding API """
from __future__ import unicode_literals
from django.test import TestCase
import mock
from branding.api import get_logo_url, get_footer
from django.test.utils import override_settings
class TestHeader(TestCase):
"""Test API end-point for retrieving the header. """
... | agpl-3.0 |
equialgo/scikit-learn | benchmarks/bench_plot_omp_lars.py | 72 | 4514 | """Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle
regression (:ref:`least_angle_regression`)
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
import gc
import sys
from time import time
import six
import numpy as np
from sklearn.linea... | bsd-3-clause |
hitsl/bouser | bouser/castiel/exceptions.py | 1 | 1163 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Exceptions generated by CAS
"""
from bouser.excs import SerializableBaseException
__author__ = 'viruzzz-kun'
__created__ = '08.02.2015'
class EExpiredToken(SerializableBaseException):
"""
Raised when authentication token is expired or was never taken
"""... | isc |
lzambella/Qyoutube-dl | youtube_dl/extractor/motorsport.py | 129 | 1797 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
class MotorsportIE(InfoExtractor):
IE_DESC = 'motorsport.com'
_VALID_URL = r'http://www\.motorsport\.com/[^/?#]+/video/(?:[^/?#]+/)(?P<id>[^/]+)/?(?:$|[?#])'
_TEST = {
... | gpl-3.0 |
ekwoodrich/nirha | nirhaweb/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py | 3133 | 34872 | ######################## 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... | apache-2.0 |
csrg-utfsm/acscb | LGPL/Kit/acs/src/acsSearchPath.py | 4 | 11874 | #! /usr/bin/env python
#*******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) European Southern Observatory, 2012.
# Copyright by ESO (in the framework of the ALMA collaboration).
# All rights reserved.
#
# This library is free software; you can r... | mit |
23maverick23/oaxmlapi | oaxmlapi/base.py | 1 | 1260 | # -*- coding: utf-8
"""The base class has helper methods for often used functions.
"""
from __future__ import absolute_import
from xml.dom import minidom
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
class _Base(object):
"""
A base class for defining... | mit |
DeMille/emailhooks | django_nonrel/django/contrib/databrowse/datastructures.py | 100 | 9090 | """
These classes are light wrappers around Django's database API that provide
convenience functionality and permalink functions for the databrowse app.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import formats
from django.utils.text import capfirst
from django.utils.enc... | mit |
skosukhin/spack | var/spack/repos/builtin/packages/r-rpostgresql/package.py | 1 | 2292 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
yufengg/tensorflow | tensorflow/contrib/boosted_trees/python/kernel_tests/prediction_ops_test.py | 4 | 57962 | # 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 |
splav/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/test_config.py | 21 | 11679 | import json
import logging
import pickle
from distutils.spawn import find_executable
from logging import handlers
import pytest
config = pytest.importorskip("wptserve.config")
def test_renamed_are_renamed():
assert len(set(config._renamed_props.keys()) & set(config.ConfigBuilder._default.keys())) == 0
def te... | mpl-2.0 |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim/configs/estimation_config_for_model_members.py | 2 | 2100 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.configs.base_configuration import AbstractUrbansimConfiguration
from urbansim.configs.estimation_base_config import EstimationBaseConfig
from urbansim.estimation.estimator import up... | gpl-2.0 |
mdhaman/superdesk-aap | server/aap/macros/reuters_derive_dateline_test.py | 2 | 8056 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superde... | agpl-3.0 |
doselect/django-tastypie | tastypie/fields.py | 4 | 34355 | from __future__ import unicode_literals
import datetime
from dateutil.parser import parse
import decimal
from decimal import Decimal
import importlib
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import models
try:
from django.db.models.fields.related import\
... | bsd-3-clause |
HolgerPeters/scikit-learn | doc/sphinxext/sphinx_gallery/backreferences.py | 23 | 6073 | # -*- coding: utf-8 -*-
# Author: Óscar Nájera
# License: 3-clause BSD
"""
========================
Backreferences Generator
========================
Reviews generated example files in order to keep track of used modules
"""
from __future__ import print_function
import ast
import os
# Try Python 2 first, otherwise ... | bsd-3-clause |
nrjcoin-project/p2pool | wstools/Namespaces.py | 292 | 9396 | # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISC... | gpl-3.0 |
imovedev/cf-php-build-pack-def | lib/build_pack_utils/hashes.py | 22 | 1511 | import hashlib
import logging
from functools import partial
from subprocess import Popen
from subprocess import PIPE
class HashUtil(object):
def __init__(self, config):
self._ctx = config
self._log = logging.getLogger('hashes')
def calculate_hash(self, checkFile):
if checkFile is Non... | apache-2.0 |
40223226/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py | 735 | 35170 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | gpl-3.0 |
beobal/python-driver | tests/integration/cqlengine/model/test_model_io.py | 7 | 16502 | # Copyright 2015 DataStax, 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 writing, s... | apache-2.0 |
sassoftware/rmake3 | rmake/multinode/workernode.py | 2 | 17206 | #
# Copyright (c) SAS Institute 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 w... | apache-2.0 |
Therp/odoo | addons/point_of_sale/controllers/main.py | 20 | 1525 | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import openerp
import time
import random
import werkzeug.utils
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import module_boot, login_redirect
_logger = logging.getLogger(__name__)
class PosContr... | agpl-3.0 |
windyuuy/opera | chromium/src/chrome/test/pyautolib/history_info.py | 69 | 2330 | # 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.
"""History: python representation for history.
Obtain one of these from PyUITestSuite::GetHistoryInfo() call.
Example:
class MyTest(pyauto.PyUITest):
... | bsd-3-clause |
mail-apps/translate | docs/_ext/translate_docs.py | 4 | 1084 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either... | gpl-2.0 |
timoschwarzer/blendworks | BlendWorks Server/python/Lib/platform.py | 5 | 49039 | #!/usr/bin/env python3
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
information concatenated as single string to stdout. The output
format is useable as pa... | gpl-2.0 |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Mac/Demo/imgbrowse/mac_image.py | 34 | 1777 | """mac_image - Helper routines (hacks) for images"""
import imgformat
from Carbon import Qd
import struct
import MacOS
_fmt_to_mac = {
imgformat.macrgb16 : (16, 16, 3, 5),
}
def mkpixmap(w, h, fmt, data):
"""kludge a pixmap together"""
fmtinfo = _fmt_to_mac[fmt]
rv = struct.pack("lHhhhhhhlllhhhhl... | gpl-3.0 |
leilihh/nova | nova/objects/quotas.py | 11 | 3927 | # Copyright 2013 Rackspace Hosting.
#
# 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 |
cit563emef2dasdme/jklasjdf12nfasfdkl | obtaning_pmc_oai.py | 1 | 22988 | from flask_script import Manager
from flask import Flask
import os
from lxml import etree
from app.models import db, Literature, Author
from app.models import AuthorLiterature, Cite, Citememe
from datetime import datetime
import re
import spacy
basedir = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)... | mit |
Onager/plaso | plaso/engine/engine.py | 1 | 15506 | # -*- coding: utf-8 -*-
"""The processing engine."""
import os
from artifacts import errors as artifacts_errors
from artifacts import reader as artifacts_reader
from artifacts import registry as artifacts_registry
from dfvfs.helpers import file_system_searcher
from dfvfs.lib import errors as dfvfs_errors
from dfvfs.... | apache-2.0 |
openstack/octavia | octavia/db/migration/alembic_migrations/versions/4fe8240425b4_update_vip_add_subnet_id.py | 1 | 1075 | # Copyright 2015 Rackspace
#
# 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 agree... | apache-2.0 |
ttsubo/ryu | ryu/lib/packet/igmp.py | 19 | 19270 | # Copyright (C) 2013 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 |
spiral-project/daybed | daybed/views/tokens.py | 1 | 1475 | from cornice import Service
from daybed.backends.exceptions import CredentialsAlreadyExist
from daybed.tokens import get_hawk_credentials, hmac_digest
from daybed.views.errors import forbidden_view
tokens = Service(name='tokens', path='/tokens', description='Tokens')
token = Service(name='token', path='/token', descr... | bsd-3-clause |
adalke/rdkit | rdkit/Chem/Crippen.py | 1 | 6023 | # $Id$
#
# Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" Atom-based calculat... | bsd-3-clause |
google-research/google-research | social_rl/multiagent_tfagents/multiagent_gym_env.py | 1 | 4230 | # 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 |
amousset/ansible | test/units/plugins/strategies/test_strategy_base.py | 81 | 14839 | # (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 |
OpusVL/odoo | addons/fleet/__openerp__.py | 53 | 2482 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.