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 |
|---|---|---|---|---|---|
khalim19/gimp-plugin-export-layers | export_layers/pygimplib/_lib/future/future/backports/email/parser.py | 82 | 5312 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
__all__ = ['Par... | gpl-3.0 |
manipopopo/tensorflow | tensorflow/contrib/autograph/pyct/ast_util_test.py | 4 | 6879 | # 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 |
phalax4/CarnotKE | jyhton/lib-python/2.7/test/test_netrc.py | 69 | 3715 | import netrc, os, unittest, sys, textwrap
from test import test_support
temp_filename = test_support.TESTFN
class NetrcTestCase(unittest.TestCase):
def tearDown(self):
os.unlink(temp_filename)
def make_nrc(self, test_data):
test_data = textwrap.dedent(test_data)
mode = 'w'
if... | apache-2.0 |
gclenaghan/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 234 | 12267 | # Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..ext... | bsd-3-clause |
leansoft/edx-platform | lms/djangoapps/oauth2_handler/handlers.py | 76 | 8398 | """ Handlers for OpenID Connect provider. """
from django.conf import settings
from django.core.cache import cache
from xmodule.modulestore.django import modulestore
from courseware.access import has_access
from openedx.core.djangoapps.user_api.models import UserPreference
from student.models import anonymous_id_for_... | agpl-3.0 |
blurrymoi/bashlex | bashlex/subst.py | 2 | 13183 | import copy
from bashlex import ast, flags, tokenizer, errors
def _recursiveparse(parserobj, base, sindex, tokenizerargs=None):
# TODO: fix this hack that prevents mutual import
from bashlex import parser
tok = parserobj.tok
if tokenizerargs is None:
tokenizerargs = {'parserstate' : copy.cop... | gpl-3.0 |
AnthonyDiGirolamo/algorithms-in-python | arrays_and_strings_test.py | 1 | 9003 | #!/usr/bin/env python
import pytest
import pdb
import pprint
pp = pprint.PrettyPrinter(indent=4).pprint
def contains_only_unique_chars(chars, max_count=1):
"""Check a string for unique charachters
Arguments:
chars: the string to be checked
max_count: the number of allowed duplicates
... | mit |
ya7lelkom/googleads-python-lib | examples/dfp/v201502/creative_wrapper_service/get_active_creative_wrappers.py | 3 | 2368 | #!/usr/bin/python
#
# Copyright 2015 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 |
pprett/scikit-learn | sklearn/utils/validation.py | 8 | 26078 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals... | bsd-3-clause |
living180/git-cola | cola/git.py | 1 | 13925 | from __future__ import division, absolute_import, unicode_literals
from functools import partial
import errno
import os
from os.path import join
import subprocess
import threading
from . import core
from .compat import int_types
from .compat import ustr
from .compat import WIN32
from .decorators import memoize
from .i... | gpl-2.0 |
Southpaw-TACTIC/TACTIC | src/tactic/ui/app/db_resource_wdg.py | 1 | 5403 | ###########################################################
#
# Copyright (c) 2012, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
SlimRemix/android_external_chromium_org | third_party/markdown/__main__.py | 109 | 5106 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
MissCatLady/AlarmEZ | ENV/lib/python2.7/site-packages/setuptools/tests/test_egg_info.py | 73 | 1060 | import os
import tempfile
import shutil
import unittest
import pkg_resources
from setuptools.command import egg_info
ENTRIES_V10 = pkg_resources.resource_string(__name__, 'entries-v10')
"An entries file generated with svn 1.6.17 against the legacy Setuptools repo"
class TestEggInfo(unittest.TestCase):
def setUp... | mit |
dhp-denero/LibrERP | office_automation/oa_crm/__openerp__.py | 3 | 1510 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2012 Elico Corp. All Rights Reserved.
# Author: Yannick Gouin <yannick.gouin@elico-corp.com>
#
# This program is free software: you can red... | agpl-3.0 |
rimistri/mediatek | mt6732/kernel/tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
mistercrunch/airflow | tests/models/test_renderedtifields.py | 5 | 11609 | #
# 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 |
pombredanne/http-repo.gem5.org-gem5- | util/minorview/__init__.py | 55 | 2097 | # Copyright (c) 2013 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality o... | bsd-3-clause |
lalanza808/lalanza808.github.io | vendor/bundle/ruby/2.3.0/gems/pygments.rb-0.6.3/vendor/pygments-main/external/rst-directive.py | 42 | 2595 | # -*- coding: utf-8 -*-
"""
The Pygments reStructuredText directive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Docutils_ 0.5 directive that renders source code
(to HTML only, currently) via Pygments.
To use it, adjust the options below and copy the code into a module
that you i... | mit |
ArcEye/machinekit-testing | src/emc/usr_intf/gscreen/gscreen.py | 13 | 157699 | #!/usr/bin/python2.4
# Gscreen a GUI for linuxcnc cnc controller
# Chris Morley copyright 2012
#
# 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,... | lgpl-2.1 |
operasoftware/presto-testo | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/lib/python/autobahn/case/case5_20.py | 14 | 1221 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | bsd-3-clause |
piotrmaslanka/satella | satella/coding/overloading.py | 1 | 3142 | import inspect
import typing as tp
from inspect import Parameter
def extract_type_signature_from(fun: tp.Callable) -> tp.Tuple[type, ...]:
sign = []
params = inspect.signature(fun).parameters
for parameter in params.values():
if parameter.kind in (Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR... | bsd-3-clause |
brianwoo/django-tutorial | build/Django/django/utils/version.py | 104 | 2459 | from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... | gpl-3.0 |
veltri/DLV2 | tests/parser/bug.69_working.test.py | 1 | 1691 | input = """
% Simplified version of a program by Michael Fink, which segfaults
% with the Jun 11 2001 Release.
object(o1,4).
object(o2,5).
object(o3,17).
bid(1,14).
bid(2,34).
bid(3,14).
contains(1,o1,2).
contains(1,o2,4).
contains(1,o3,2).
contains(2,o3,10).
contains(3,o2,5).
%#maxint=62.
selec... | apache-2.0 |
luogangyi/Ceilometer-oVirt | build/lib/ceilometer/compute/virt/ovirtga/guestagent.py | 2 | 18455 | __author__ = 'luogangyi'
#
# Copyright 2011-2014 Red Hat, Inc.
#
# 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.
#
# Thi... | apache-2.0 |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32com/test/errorSemantics.py | 6 | 5838 | # errorSemantics.py
# Test the Python error handling semantics. Specifically:
#
# * When a Python COM object is called via IDispatch, the nominated
# scode is placed in the exception tuple, and the HRESULT is
# DISP_E_EXCEPTION
# * When the same interface is called via IWhatever, the
# nominated scode is retur... | apache-2.0 |
shurihell/testasia | lms/djangoapps/instructor/tests/test_tools.py | 44 | 11516 | """
Tests for views/tools.py.
"""
import datetime
import mock
import json
import unittest
from django.utils.timezone import utc
from django.test.utils import override_settings
from nose.plugins.attrib import attr
from courseware.field_overrides import OverrideFieldData
from lms.djangoapps.ccx.tests.test_overrides im... | agpl-3.0 |
rstudio/reticulate | inst/python/rpytools/signals.py | 1 | 2216 |
# We register a custom Python signal handler here for the following reasons.
#
# 1. We are running R and Python together within the same process.
# Interrupts should be handled by whichever process appears to
# be at the foreground.
#
# 2. To facilitate this, we need to register a SIGINT handler at
# the... | apache-2.0 |
DDEFISHER/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/etree.py | 658 | 4613 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import gettext
_ = gettext.gettext
import re
from six import text_type
from . im... | mpl-2.0 |
zouyapeng/horizon_change | openstack_dashboard/dashboards/project/volumes/tabs.py | 12 | 4720 | # Copyright 2013 Nebula, 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 agree... | apache-2.0 |
risicle/django | tests/m2m_regress/tests.py | 273 | 4695 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import (
Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild,
SelfReferChildSibling, Tag, TagCollection, Worksheet,
)
class M2MRegre... | bsd-3-clause |
jcowles/OpenSubdiv-Extra | regression/far_regression/example_createMesh.py | 15 | 4070 | #!/usr/bin/env python
#
# Copyright 2013 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and rep... | apache-2.0 |
jjhelmus/adventofcode | day14.py | 1 | 1226 | import re
class Reindeer(object):
def __init__(self, name, speed, flight_time, rest_time):
self.name = name
self.speed = int(speed)
self.flight_time = int(flight_time)
self.rest_time = int(rest_time)
def dist(self, time):
cycle_time = self.flight_time + self.rest_time... | mit |
xpansa/odoomrp-wip | quality_control_between_dates/models/qc_inspection.py | 29 | 1106 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class QcInspectio... | agpl-3.0 |
hyqneuron/pylearn2-maxsom | pylearn2/scripts/pkl_inspector.py | 44 | 6329 | #!/usr/bin/env python
"""
Determines the contribution of different subcomponents of a file to its file size, serialization time,
and deserialization time.
"""
from __future__ import print_function
import sys
from pylearn2.utils import serial
try:
import cPickle
except ImportError:
import pickle as cPickle
impo... | bsd-3-clause |
igorcoding/rsys | rsys-python/py_tests/db.py | 1 | 10722 | import ConfigParser
from contextlib import closing
import json
from pprint import pprint
import MySQLdb
from MySQLdb.cursors import DictCursor
def safe_db_call(f):
def wrapper(self, *args, **kwargs):
try:
return f(self, *args, **kwargs)
finally:
self.disconnect()
retur... | gpl-3.0 |
BhallaLab/moose | moose-examples/tutorials/Rdesigneur/ex8.0_multiscale_KA_phosph.py | 2 | 2316 | ########################################################################
# This example demonstrates a multiscale bistable model.
# In the low state there is no spiking, no Ca entry, and the KA channel
# is unophosporylated and hence active. This keeps the potential low.
# In the high state, there is sustained spikin... | gpl-3.0 |
DARKPOP/external_chromium_org | tools/json_schema_compiler/idl_schema.py | 43 | 17296 | #! /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 itertools
import json
import os.path
import re
import sys
from json_parse import OrderedDict
# This file is a peer to jso... | bsd-3-clause |
adam111316/SickGear | sickbeard/image_cache.py | 3 | 12210 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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,... | gpl-3.0 |
yapdns/yapdnsbeat | vendor/github.com/elastic/beats/packetbeat/tests/system/test_0020_mysql_send_options.py | 13 | 1625 | from packetbeat import BaseTest
"""
Tests for the mysql's send_request and send_response
options.
"""
class Test(BaseTest):
def test_default_settings(self):
"""
Should not include request and response by
default.
"""
self.render_config_template(
mysql_ports=[3... | mit |
aperigault/ansible | test/lib/ansible_test/_internal/sanity/sanity_docs.py | 55 | 1790 | """Sanity test for documentation of sanity tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ..sanity import (
SanityVersionNeutral,
SanityMessage,
SanityFailure,
SanitySuccess,
sanity_get_tests,
)
from ..config import (
SanityCon... | gpl-3.0 |
ajayuranakar/django-blog | lib/python2.7/site-packages/pip/__init__.py | 73 | 8049 | #!/usr/bin/env python
import os
import optparse
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
from pip.util import get_installed_distributions, get_prog
from pip.vcs import git, mercurial, subversion, bazaar # noqa
from pip.baseparser import crea... | gpl-3.0 |
JoaoRodrigues/pdb-tools | pdbtools/pdb_reatom.py | 2 | 5829 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 João Pedro Rodrigues
#
# 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
#
# Unl... | apache-2.0 |
shizhai/wprobe | staging_dir/host/bin/scons-time-2.1.0.py | 25 | 50493 | #!/usr/bin/env python
#
# scons-time - run SCons timings and collect statistics
#
# A script for running a configuration through SCons with a standard
# set of invocations to collect timing and memory statistics and to
# capture the results in a consistent set of output files for display
# and analysis.
#
#
# Copyrigh... | gpl-2.0 |
foreni-packages/golismero | thirdparty_libs/nltk/sem/util.py | 12 | 9844 | # Natural Language Toolkit: Semantic Interpretation
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
#
# Copyright (C) 2001-2012 NLTK Project
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Utility functions for batch-processing sentences: parsing and
extraction of the semantic representation of... | gpl-2.0 |
Ms2ger/presto-testo | core/standards/html-parsing/dse/update.py | 4 | 2195 | import sys
import subprocess
try:
import json
except ImportError:
import simplejson as json
import killableprocess
class GitError(Exception):
pass
def git(command, *args):
command_line = ["git", command] + list(args)
sys.stderr.write("Running command %s\n"%" ".join(command_line))
proc = killa... | bsd-3-clause |
MongooseHelix/android_kernel_htc_mecha-3.0 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
alanjw/GreenOpenERP-Win-X86 | openerp/addons/portal_stock/__openerp__.py | 437 | 1600 | # -*- 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 |
ehashman/oh-mainline | vendor/packages/twisted/twisted/cred/checkers.py | 60 | 9324 | # -*- test-case-name: twisted.test.test_newcred -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import os
from zope.interface import implements, Interface, Attribute
from twisted.internet import defer
from twisted.python import failure, log
from twisted.cred import error, credentials
c... | agpl-3.0 |
slyphon/pants | tests/python/pants_test/backend/python/tasks/checkstyle/test_variable_names.py | 7 | 5322 | # 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)
from pants.backend.p... | apache-2.0 |
N3cr0t1cN1nja/Wolf-Recon-Framework | Wolf Recon Framework/core/Nmap.py | 1 | 2496 | #!/bin/bash
import socket
import subprocess
import ipaddress
import nmap
import pexpect
from core.flowcontrol import WriteFileFunction
# Function to parse raw NMAP results into readable format
def reportscan(argument, IP):
output = " "
nm = nmap.PortScanner()
nm.scan(hosts=IP, arguments=argument)
output += (nm.com... | gpl-3.0 |
akash1808/glance | glance/hacking/checks.py | 10 | 5737 | # Copyright (c) 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 or agreed ... | apache-2.0 |
Multiposting/mongoengine | tests/migration/turn_off_inheritance.py | 30 | 1903 | # -*- coding: utf-8 -*-
import unittest
from mongoengine import Document, connect
from mongoengine.connection import get_db
from mongoengine.fields import StringField
__all__ = ('TurnOffInheritanceTest', )
class TurnOffInheritanceTest(unittest.TestCase):
def setUp(self):
connect(db='mongoenginetest')
... | mit |
datapythonista/pandas | pandas/tests/dtypes/test_generic.py | 6 | 4327 | from warnings import catch_warnings
import numpy as np
import pytest
from pandas.core.dtypes import generic as gt
import pandas as pd
import pandas._testing as tm
class TestABCClasses:
tuples = [[1, 2, 2], ["red", "blue", "red"]]
multi_index = pd.MultiIndex.from_arrays(tuples, names=("number", "color"))
... | bsd-3-clause |
juanamari94/mlaas-example | models.py | 1 | 2418 | from sklearn.model_selection import train_test_split
from sklearn.metrics import f1_score
import data_parser
class BaseModel:
def __init__(self, model):
self.model = model
def train(self):
return self.model.fit(self.x_train, self.y_train)
class SupervisedBinaryClassificationModel(BaseModel)... | mit |
abenzbiria/clients_odoo | openerp/addons/base/tests/test_expression.py | 260 | 29589 | import unittest2
import openerp
from openerp.osv.expression import get_unaccent_wrapper
from openerp.osv.orm import BaseModel
import openerp.tests.common as common
class test_expression(common.TransactionCase):
def _reinit_mock(self):
self.query_list = list()
def _mock_base_model_where_calc(self, mo... | agpl-3.0 |
martin-mann/bioconda-recipes | recipes/peptide-shaker/1.15.0/peptide-shaker.py | 18 | 3271 | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... | mit |
bjornlevi/5thpower | nefndaralit/env/lib/python3.6/site-packages/pip/commands/check.py | 336 | 1382 | import logging
from pip.basecommand import Command
from pip.operations.check import check_requirements
from pip.utils import get_installed_distributions
logger = logging.getLogger(__name__)
class CheckCommand(Command):
"""Verify installed packages have compatible dependencies."""
name = 'check'
usage =... | mit |
twaddington/django-olcc | django_olcc/urls.py | 1 | 1095 | from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic.simple import direct_to_template
# Enable the django admin
admin.autodiscover()
urlpatterns = pat... | mit |
agile4you/pyjector | runtests.py | 1 | 236470 | #! /usr/bin/env python
# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base64 encoding of a zip file, this zip file contains
# a fully functional basic pytest script.
#
# Pyt... | gpl-3.0 |
noobcoderT/ryu-3.21 | ryu/services/protocols/bgp/info_base/rtc.py | 52 | 2467 | # Copyright (C) 2014 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 |
Stavitsky/neutron | neutron/db/allowedaddresspairs_db.py | 42 | 6265 | # Copyright 2013 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 |
RouxRC/weboob | modules/nolifetv/video.py | 7 | 1046 | # -*- coding: utf-8 -*-
# Copyright(C) 2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 opti... | agpl-3.0 |
daviddupont69/CouchPotatoServer | libs/sqlalchemy/orm/query.py | 18 | 129214 | # orm/query.py
# Copyright (C) 2005-2013 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
"""The Query class and support.
Defines the :class:`.Query` class, the central
construct... | gpl-3.0 |
jaggu303619/asylum | openerp/loglevels.py | 61 | 6204 | # -*- 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 |
Tepira/binwalk | src/binwalk/core/settings.py | 1 | 6151 | # Code for loading and accessing binwalk settings (extraction rules, signature files, etc).
import os
import binwalk.core.common as common
from binwalk.core.compat import *
class Settings:
'''
Binwalk settings class, used for accessing user and system file paths and general configuration settings.
Af... | mit |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py | 5 | 9818 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import six
from cryptography import utils
@six.add_metacla... | bsd-3-clause |
Canas/kaftools | kaftools/utils/shortcuts.py | 1 | 2226 | # -*- coding: utf-8 -*-
"""
kaftools.utils.shortcuts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides utility functions that are used within
kaftools that can be useful for external scripts.
"""
import time
import re
import numpy as np
import matplotlib.pyplot as plt
def plot_series(data, prediction, **kwargs... | mit |
Apoyhtari/Irc-Bot | beautifulsoup4-4.1.2/bs4/builder/_html5lib.py | 119 | 7746 | __all__ = [
'HTML5TreeBuilder',
]
import warnings
from bs4.builder import (
PERMISSIVE,
HTML,
HTML_5,
HTMLTreeBuilder,
)
from bs4.element import NamespacedAttribute
import html5lib
from html5lib.constants import namespaces
from bs4.element import (
Comment,
Doctype,
NavigableStr... | mit |
tempbottle/ironpython3 | Src/StdLib/Lib/test/test_thread.py | 84 | 8285 | import os
import unittest
import random
from test import support
thread = support.import_module('_thread')
import time
import sys
import weakref
from test import lock_tests
NUMTASKS = 10
NUMTRIPS = 3
_print_mutex = thread.allocate_lock()
def verbose_print(arg):
"""Helper function for printing out debugging outp... | apache-2.0 |
canvasnetworks/canvas | website/canvas/migrations/0152_category_tag_import.py | 2 | 20497 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from apps.tags.models import Tag
from canvas.redis_models import RedisSet
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
count =... | bsd-3-clause |
capooti/pootle | local_apps/pootle_app/models/signals.py | 6 | 1171 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 t... | gpl-2.0 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/test/test_ast.py | 9 | 7936 | import sys, itertools
import _ast
def to_tuple(t):
if t is None or isinstance(t, (basestring, int, long, complex)):
return t
elif isinstance(t, list):
return [to_tuple(e) for e in t]
result = [t.__class__.__name__]
if hasattr(t, 'lineno') and hasattr(t, 'col_offset'):
result.app... | mit |
AOKP/external_chromium_org | third_party/tlslite/tlslite/utils/cryptomath.py | 77 | 11785 | """cryptomath module
This module has basic math/crypto code."""
import os
import math
import base64
import binascii
# The sha module is deprecated in Python 2.6
try:
import sha
except ImportError:
from hashlib import sha1 as sha
# The md5 module is deprecated in Python 2.6
try:
import md5
except Import... | bsd-3-clause |
vrenaville/OCB | addons/payment_paypal/models/res_company.py | 422 | 1752 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class ResCompany(osv.Model):
_inherit = "res.company"
def _get_paypal_account(self, cr, uid, ids, name, arg, context=None):
Acquirer = self.pool['payment.acquirer']
company_id = self.pool['res.users'].browse(cr, uid, uid, context=co... | agpl-3.0 |
PyMySQL/Tornado-MySQL | tornado_mysql/constants/ER.py | 122 | 12223 |
ERROR_FIRST = 1000
HASHCHK = 1000
NISAMCHK = 1001
NO = 1002
YES = 1003
CANT_CREATE_FILE = 1004
CANT_CREATE_TABLE = 1005
CANT_CREATE_DB = 1006
DB_CREATE_EXISTS = 1007
DB_DROP_EXISTS = 1008
DB_DROP_DELETE = 1009
DB_DROP_RMDIR = 1010
CANT_DELETE_FILE = 1011
CANT_FIND_SYSTEM_REC = 1012
CANT_GET_STAT = 1013
CANT_GET_WD = 1... | mit |
Miaou/PyPlagia | pyplagia/sim.py | 1 | 5014 | #
# Tools for the SIM method.
# pyplagia, Pierre-Antoine BRAMERET (C) 2014
import tokenize
import token
import keyword
import builtins
import io
from itertools import permutations
#-------------------------------------------------------------------------------
# This one is used by sim and ilar.
# ... | gpl-3.0 |
mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/responder/responderaction.py | 1 | 18793 | #
# Copyright (c) 2008-2015 Citrix 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
kfoss/keras | keras/utils/dot_utils.py | 9 | 1741 | import pydot
from keras.layers.core import Merge
from keras.models import Model
from collections import Counter
class Grapher(object):
def __init__(self):
self.names = {}
self.class_counts = Counter()
def get_name(self, model):
"""
returns the name of the model instance. If mo... | mit |
rancher/rancher | tests/validation/tests/v3_api/test_hpa.py | 4 | 20277 | import pytest
from rancher import ApiError
from .common import * # NOQA
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
def test_create_hpa():
p_client = namespace["p_client"]
ns = namespace["ns"]
hpa, workload = create_hpa(p_client, ns)
p_client.delete(hpa, workload)
... | apache-2.0 |
zhengdejin/X1_Code | kernel-3.10/tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | apache-2.0 |
psi-rking/psi4 | psi4/driver/procrouting/wrappers_cfour.py | 7 | 36345 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
opensourcechipspark/platform_external_chromium_org | ppapi/generators/idl_outfile.py | 100 | 5856 | #!/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.
""" Output file objects for generator. """
import difflib
import os
import time
import sys
from idl_log import ErrOut, InfoOut, W... | bsd-3-clause |
EvanzzzZ/mxnet | example/memcost/inception_memcost.py | 15 | 4972 | # pylint: skip-file
import sys
sys.path.append('../../python/')
import mxnet as mx
import logging
def ConvFactory(data, num_filter, kernel, stride=(1,1), pad=(0, 0), name=None, suffix=''):
conv = mx.symbol.Convolution(data=data, num_filter=num_filter, kernel=kernel, stride=stride, pad=pad, name='conv_%s%s' %(name,... | apache-2.0 |
DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Lib/encodings/iso8859_4.py | 1 | 3615 | """ Python Character Mapping Codec generated from '8859-4.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(... | gpl-3.0 |
bstinsonmhk/fas | setup.py | 8 | 8423 | #!/usr/bin/python -tt
__requires__='TurboGears >= 1.0.4'
import os
import re
import glob
import subprocess
import shutil
from distutils.command.build import build as _build
from distutils.command.install_data import install_data as _install_data
from distutils.dep_util import newer
from setuptools import setup, find_... | gpl-2.0 |
RedlineResearch/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 |
google-research/tensorflow-coder | tf_coder/value_search/filtered_values_cache.py | 1 | 2201 | # Copyright 2021 The TF-Coder 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 applicable law or agreed to in... | apache-2.0 |
coingraham/lena | lambda/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
JoshuaGrams/godot | tools/scripts/makeargs.py | 23 | 1940 |
text="""
#define FUNC$numR(m_r,m_func,$argt)\\
virtual m_r m_func($argtp) { \\
if (Thread::get_caller_ID()!=server_thread) {\\
m_r ret;\\
command_queue.push_and_ret( visual_server, &VisualServer::m_func,$argp,&ret);\\
return ret;\\
} else {\\
return visual_server->m_func($argp);\\
}\\
}
#define FU... | mit |
t3dev/odoo | odoo/addons/test_impex/tests/test_export.py | 1 | 23265 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import itertools
import pstats
from cProfile import Profile
from odoo.tests import common
class CreatorCase(common.TransactionCase):
model_name = False
def __init__(self, *args, **kwargs):
super(Creat... | gpl-3.0 |
vvgelder/turret | lib/turret/subnets.py | 1 | 1066 | #!/usr/bin/python
import os
import mongo
class Subnets(mongo.Mongo):
@mongo.Format()
def subnetList(self, projection = { 'hosts': 0 }, format=False):
return self.searchDoc('subnets', {}, projection)
@mongo.Format()
def subnetAdd(self, subnet, description='', discovery=True, discoveryhost='lo... | apache-2.0 |
nimengyu2/dm37x-kernel-2.6.37-psp04.02.00.07 | tools/perf/scripts/python/sctop.py | 53 | 1923 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
Serag8/Bachelor | google_appengine/lib/django-1.5/django/core/management/commands/dbshell.py | 329 | 1243 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
option_lis... | mit |
surround-io/apitrace | specs/__init__.py | 12 | 1321 | ##########################################################################
#
# Copyright 2012 VMware, Inc.
# All Rights Reserved.
#
# 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 res... | mit |
hergin/DelTa | mt/ptcal/dcal.py | 1 | 5585 | '''*****************************************************************************
AToMPM - A Tool for Multi-Paradigm Modelling
Copyright (c) 2011 Raphael Mannadiar (raphael.mannadiar@mail.mcgill.ca)
This file is part of AToMPM.
AToMPM is free software: you can redistribute it and/or modify it under the
terms of the G... | gpl-3.0 |
taknevski/tensorflow-xsmm | tensorflow/contrib/distributions/python/kernel_tests/conditional_distribution_test.py | 135 | 3028 | # 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 |
jmr0/servo | tests/wpt/web-platform-tests/tools/py/testing/io_/test_capture.py | 163 | 14781 | from __future__ import with_statement
import os, sys
import py
needsdup = py.test.mark.skipif("not hasattr(os, 'dup')")
from py.builtin import print_
if sys.version_info >= (3,0):
def tobytes(obj):
if isinstance(obj, str):
obj = obj.encode('UTF-8')
assert isinstance(obj, bytes)
... | mpl-2.0 |
malderete/ninja-ide | ninja_ide/gui/dialogs/preferences/preferences_shortcuts.py | 8 | 13680 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | gpl-3.0 |
ksshanam/kubernetes | cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py | 24 | 47731 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | apache-2.0 |
skomski/duktape | tests/perf/test-reg-readwrite-plain.py | 12 | 7271 | def test():
a = 1
b = 2
c = 3
d = 4
i = 0
while i < 1e6:
# 100
a = a; a = b; a = c; a = d; b = a; b = b; b = c; b = d; c = a; c = b
a = a; a = b; a = c; a = d; b = a; b = b; b = c; b = d; c = a; c = b
a = a; a = b; a = c; a = d; b = a; b = b; b = c; b = d; c = a; c = b
a = a; a = b; a = c; a = d; b = a... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.