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 |
|---|---|---|---|---|---|
hfp/tensorflow-xsmm | tensorflow/python/util/tf_stack.py | 25 | 3807 | # 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 |
spallavolu/scikit-learn | sklearn/utils/sparsefuncs.py | 220 | 11424 | # Authors: Manoj Kumar
# Thomas Unterthiner
# License: BSD 3 clause
import scipy.sparse as sp
import numpy as np
from .fixes import sparse_min_max, bincount
from .sparsefuncs_fast import csr_mean_variance_axis0 as _csr_mean_var_axis0
from .sparsefuncs_fast import csc_mean_variance_axis0 as _csc_mean_var_axis... | bsd-3-clause |
rklabs/scrapy | scrapy/downloadermiddlewares/cookies.py | 128 | 3330 | import os
import six
import logging
from collections import defaultdict
from scrapy.exceptions import NotConfigured
from scrapy.http import Response
from scrapy.http.cookies import CookieJar
from scrapy.utils.python import to_native_str
logger = logging.getLogger(__name__)
class CookiesMiddleware(object):
"""Th... | bsd-3-clause |
VikingDen/jira | docs/conf.py | 8 | 7887 | # -*- coding: utf-8 -*-
#
# JIRA Python Client documentation build configuration file, created by
# sphinx-quickstart on Thu May 3 17:01:50 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 fi... | bsd-2-clause |
beck/django | tests/template_tests/filter_tests/test_slugify.py | 324 | 1430 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import slugify
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class SlugifyTests(SimpleTestCase):
"""
Running slugify on a pre-escaped string le... | bsd-3-clause |
andrius-preimantas/odoo | addons/website_forum/models/forum.py | 6 | 32098 | # -*- coding: utf-8 -*-
from datetime import datetime
import openerp
from openerp import tools
from openerp import SUPERUSER_ID
from openerp.addons.website.models.website import slug
from openerp.osv import osv, fields
from openerp.tools import html2plaintext
from openerp.tools.translate import _
class KarmaError(V... | agpl-3.0 |
MichSchli/QuestionAnsweringGCN | models/tensorflow_components/graph/assignment_view.py | 1 | 1394 | import tensorflow as tf
class AssignmentView:
def __init__(self):
self.variables = {}
self.variables["total_vertex_count"] = tf.placeholder(tf.int32)
self.variables["vertex_indices"] = tf.placeholder(tf.int32)
self.variables["from_range"] = tf.placeholder(tf.int32)
def get_al... | mit |
Habatchii/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/cp1254.py | 93 | 14065 | """ Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def d... | apache-2.0 |
oihane/odoomrp-wip | mrp_operations_start_without_material/__openerp__.py | 6 | 1441 | # -*- coding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the L... | agpl-3.0 |
ronojoy/BDA_py_demos | demos_ch5/demo5_2.py | 19 | 3326 | """Bayesian Data Analysis, 3rd ed
Chapter 5, demo 2
Hierarchical model for SAT-example data (BDA3, p. 102)
"""
from __future__ import division
import numpy as np
from scipy.stats import norm
import scipy.io # For importing a matlab file
import matplotlib.pyplot as plt
# Edit default plot settings (colours from colo... | gpl-3.0 |
Tangxuguo/Django_SNS | osf/restapi/serializers.py | 1 | 1410 | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from accounts.models import *
from album.models import *
from comment.models import *
from notification.models import *
from post.models import *
from tag.models import *
# accout
class UserSerializer(serializers.HyperlinkedMode... | gpl-3.0 |
myang321/django | tests/generic_views/test_detail.py | 284 | 8387 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
from django.views.generic.base import View
from django.views.gen... | bsd-3-clause |
lokeshh/stem | test/unit/descriptor/export.py | 8 | 3212 | """
Unit tests for stem.descriptor.export.
"""
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import stem.prereq
import test.runner
from stem.descriptor.export import export_csv, export_csv_file
from test.mocking import (
get_relay_server_descriptor,
get_brid... | lgpl-3.0 |
amitdeutsch/oppia | extensions/rules/real.py | 7 | 1336 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
siddhika1889/Pydev-Dependencies | pysrc/pydev_ipython/version.py | 142 | 1227 | # encoding: utf-8
"""
Utilities for version comparison
It is a bit ridiculous that we need these.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the f... | epl-1.0 |
danakj/chromium | third_party/markupsafe/__init__.py | 371 | 8205 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
from markupsafe._compat import text_type, string_types, int_types, \
unichr, PY2
__all__ = ['Markup', 'soft_unicod... | bsd-3-clause |
topdk-jnz/php-code-to-inject-into-docker | vendor/doctrine/orm/docs/en/conf.py | 2448 | 6497 | # -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | gpl-2.0 |
Dahlgren/HTPC-Manager | libs/concurrent/futures/thread.py | 104 | 4605 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ThreadPoolExecutor."""
from __future__ import with_statement
import atexit
import threading
import weakref
import sys
from concurrent.futures import _base
try:
import queue
except ImportError:
... | mit |
twobraids/configman | configman/converters.py | 2 | 18916 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, division, print_function
import sys
import re
import datetime
import types
impor... | mpl-2.0 |
raoulbq/scipy | scipy/_lib/_numpy_compat.py | 71 | 1488 | """Functions copypasted from newer versions of numpy.
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy._lib._version import NumpyVersion
if NumpyVersion(np.__version__) > '1.7.0.dev':
_assert_warns = np.testing.assert_warns
else:
def _assert... | bsd-3-clause |
yohanko88/gem5-DC | util/batch/batch.py | 90 | 7895 | # Copyright (c) 2006 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 list ... | bsd-3-clause |
adiwgno/tes | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
vmarkovtsev/django | tests/view_tests/tests/test_csrf.py | 253 | 3203 | from django.test import Client, SimpleTestCase, override_settings
from django.utils.translation import override
@override_settings(ROOT_URLCONF="view_tests.urls")
class CsrfViewTests(SimpleTestCase):
def setUp(self):
super(CsrfViewTests, self).setUp()
self.client = Client(enforce_csrf_checks=True... | bsd-3-clause |
dudonwai/dudonsblog | Lib/site-packages/django/contrib/gis/gdal/envelope.py | 477 | 7009 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | mit |
simod/geonode | geonode/services/enumerations.py | 7 | 1968 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
# 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 ... | gpl-3.0 |
janusnic/dj-21v | unit_14/mysite/userprofiles/utils.py | 6 | 2613 | from django.core.exceptions import ImproperlyConfigured
# -*- coding: utf-8 -*-
import functools
try:
import urlparse
except ImportError:
from urllib import parse as urlparse # python3 support
from django.core.exceptions import SuspiciousOperation
def default_redirect(request, fallback_url, **kwargs):
"""
E... | mit |
quinonez/three.js | utils/converters/msgpack/msgpack/fallback.py | 641 | 26403 | """Fallback pure Python implementation of msgpack"""
import sys
import array
import struct
if sys.version_info[0] == 3:
PY3 = True
int_types = int
Unicode = str
xrange = range
def dict_iteritems(d):
return d.items()
else:
PY3 = False
int_types = (int, long)
Unicode = unicode
... | mit |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/scipy/ndimage/io.py | 47 | 1096 | from __future__ import division, print_function, absolute_import
_have_pil = True
try:
from scipy.misc.pilutil import imread as _imread
except ImportError:
_have_pil = False
__all__ = ['imread']
# Use the implementation of `imread` in `scipy.misc.pilutil.imread`.
# If it weren't for the different names of... | mit |
keedio/hue | desktop/core/ext-py/Django-1.6.10/tests/model_inheritance/tests.py | 40 | 13501 | from __future__ import absolute_import, unicode_literals
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase
from django.test.utils import CaptureQueriesContext
from django.utils import six
from .models import (Chef, CommonIn... | apache-2.0 |
CVL-dev/cvl-fabric-launcher | pyinstaller-2.1/PyInstaller/bindepend.py | 9 | 27811 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | gpl-3.0 |
bdupharm/sqlalchemy | test/orm/test_deferred.py | 2 | 29273 | import sqlalchemy as sa
from sqlalchemy import testing, util
from sqlalchemy.orm import mapper, deferred, defer, undefer, Load, \
load_only, undefer_group, create_session, synonym, relationship, Session,\
joinedload, defaultload, aliased, contains_eager, with_polymorphic
from sqlalchemy.testing import eq_, Asse... | mit |
Medium/phantomjs-1 | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/logtesting.py | 124 | 9435 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
bblacey/FreeCAD-MacOS-CI | src/Mod/Import/App/SCL/AggregationDataTypes.py | 29 | 27474 | # Copyright (c) 2011, Thomas Paviot (tpaviot@gmail.com)
# All rights reserved.
# This file is part of the StepClassLibrary (SCL).
#
# 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 mus... | lgpl-2.1 |
CSC301H-Fall2013/JuakStore | site-packages/build/lib/django/core/management/__init__.py | 99 | 18224 | import collections
import os
import sys
from optparse import OptionParser, NO_DEFAULT
import imp
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.core.management.color import color_style
from dj... | mit |
credativ/pulp | server/pulp/server/db/model/criteria.py | 7 | 15518 | from types import NoneType
import copy
import re
import sys
import pymongo
from pulp.common.dateutils import parse_iso8601_datetime
from pulp.server import exceptions as pulp_exceptions
from pulp.server.db.model.base import Model
class Criteria(Model):
def __init__(self, filters=None, sort=None, limit=None, ski... | gpl-2.0 |
fairwaves/umtrx_scripts | python_lib/umtrx_lms.py | 1 | 40513 | #!/usr/bin/env python
#
# Copyright 2012 Fairwaves
#
# 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.
#
# This program is... | bsd-3-clause |
GabrielNicolasAvellaneda/dd-agent | agent.py | 22 | 11230 | #!/opt/datadog-agent/embedded/bin/python
'''
Datadog
www.datadoghq.com
----
Make sense of your IT Data
Licensed under Simplified BSD License (see LICENSE)
(C) Boxed Ice 2010 all rights reserved
(C) Datadog, Inc. 2010-2014 all rights reserved
'''
# set up logging before importing any other c... | bsd-3-clause |
Jandersoft/openshift-ansible | roles/lib_zabbix/library/zbx_mediatype.py | 19 | 5963 | #!/usr/bin/env python
'''
Ansible module for mediatype
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix mediatype ansible module
#
#
# Copyright 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... | apache-2.0 |
hclerdim/cooperative-urbaine | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | 3506 | #Copyright (c) 2010 Fabien Potencier
#
#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, distrib... | mit |
bytedance/fedlearner | web_console_v2/api/test/fedlearner_webconsole/job/yaml_formatter_test.py | 1 | 6423 | # Copyright 2021 The FedLearner 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 |
emory-libraries/findingaids | findingaids/fa/tests/models.py | 1 | 16453 | # file findingaids/fa/tests/models.py
#
# Copyright 2012 Emory University Library
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | apache-2.0 |
koldunovn/folium | docs/conf.py | 9 | 7719 | # -*- coding: utf-8 -*-
#
# Folium documentation build configuration file, created by
# sphinx-quickstart on Sun May 19 19:39:34 2013.
#
# 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 ... | mit |
andrewleech/SickRage | lib/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
lordmuffin/aws-cfn-plex | functions/credstash/pip/_vendor/requests/packages/urllib3/util/connection.py | 365 | 4744 | from __future__ import absolute_import
import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is... | mit |
willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/gunicorn/selectors.py | 107 | 18997 | """Selectors module.
This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
The following code adapted from trollius.selectors.
"""
from abc import ABCMeta, abstractmethod
from collections import namedtuple, Mapping
import math
import select
import sys
from gunicor... | mit |
abridgett/boto | tests/integration/redshift/test_layer1.py | 133 | 5384 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. 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 restriction, including
# without limitation the rights ... | mit |
kinnou02/navitia | source/sql/alembic/versions/538bc4ea9cd1_multiple_comments.py | 4 | 2894 | """multiple comments
Remove all comment column and add 2 new tables:
* one comment table
* one table to make the link between pt object and the comments
Revision ID: 538bc4ea9cd1
Revises: 29fc422c56cb
Create Date: 2015-05-05 11:03:45.982893
"""
# revision identifiers, used by Alembic.
revision = '538bc4ea9cd... | agpl-3.0 |
currychou/1 | static/Brython3.1.3-20150514-095342/Lib/bisect.py | 1261 | 2595 | """Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | gpl-3.0 |
trdean/grEME | gr-blocks/python/blocks/qa_ctrlport_probes.py | 8 | 7371 | #!/usr/bin/env python
#
# Copyright 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 option)
# ... | gpl-3.0 |
citassa1985/youtube-dl | youtube_dl/extractor/musicplayon.py | 150 | 2670 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class MusicPlayOnIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?musicplayon\.com/play(?:-touch)?\?(?:v|pl=100&play)=(?P<id>\d+)'
_TEST = {
'url': 'http://en.mu... | unlicense |
nanuxbe/django-modeltranslation | modeltranslation/utils.py | 7 | 5531 | # -*- coding: utf-8 -*-
from contextlib import contextmanager
from django.utils import six
from django.utils.encoding import force_text
from django.utils.translation import get_language as _get_language
from django.utils.translation import get_language_info
from django.utils.functional import lazy
from modeltranslati... | bsd-3-clause |
aristanetworks/arista-ovs-nova | nova/tests/xenapi/test_vm_utils.py | 1 | 6730 | import mox
from nova import context
from nova import db
from nova import exception
from nova.tests.xenapi import stubs
from nova.virt.xenapi import driver as xenapi_conn
from nova.virt.xenapi import fake
from nova.virt.xenapi import vm_utils
from nova.virt.xenapi import volume_utils
import unittest
class GetInstanceF... | apache-2.0 |
pmeier82/SpikePlot | spikeplot/plot_xvf_tensor.py | 1 | 3432 | # -*- coding: utf-8 -*-
#
# spikeplot - plot_xvf_tensor.py
#
# Philipp Meier <pmeier82 at googlemail dot com>
# 2011-09-29
#
"""plot the xi vs f tensor in a grid"""
__docformat__ = 'restructuredtext'
__all__ = ['xvf_tensor']
##---IMPORTS
from .common import save_figure, check_plotting_handle, plt
##---FUNCTION
... | mit |
dursk/django | django/core/serializers/xml_serializer.py | 184 | 15662 | """
XML serializer.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import bas... | bsd-3-clause |
songmonit/CTTMSONLINE_V8 | addons/crm_profiling/__init__.py | 438 | 1089 | # -*- 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... | agpl-3.0 |
thresholdsoftware/asylum-v2.0 | openerp/addons/point_of_sale/wizard/pos_open_statement.py | 48 | 4238 | # -*- 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 |
soarpenguin/ansible | test/runner/lib/config.py | 43 | 7640 | """Configuration classes."""
from __future__ import absolute_import, print_function
import os
import sys
from lib.util import (
CommonConfig,
is_shippable,
docker_qualify_image,
)
from lib.metadata import (
Metadata,
)
class EnvironmentConfig(CommonConfig):
"""Configuration common to all comma... | gpl-3.0 |
photoninger/ansible | test/units/modules/network/aireos/aireos_module.py | 73 | 2510 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
PaulWay/insights-core | insights/tools/perf.py | 2 | 5493 | #!/usr/bin/env python
import argparse
import json
import logging
import multiprocessing as mp
import os
import signal
import time
from collections import defaultdict
from random import sample
from insights.core import archives
from insights.core import load_package
from insights.core.evaluators import MultiEvaluator,... | apache-2.0 |
johnkeepmoving/oss-ftp | python27/win32/Lib/site-packages/setuptools/tests/test_packageindex.py | 377 | 7625 | """Package Index Tests
"""
import sys
import os
import unittest
import pkg_resources
from setuptools.compat import urllib2, httplib, HTTPError, unicode, pathname2url
import distutils.errors
import setuptools.package_index
from setuptools.tests.server import IndexServer
class TestPackageIndex(unittest.TestCase):
d... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/scipy/sparse/linalg/eigen/arpack/setup.py | 6 | 1388 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.system_info import get_info, NotFoundError
from numpy.distutils.misc_util import Configuration
from scipy._build_utils i... | agpl-3.0 |
mitake/linux | tools/perf/util/setup.py | 4998 | 1330 | #!/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 |
konstruktoid/ansible-upstream | lib/ansible/modules/network/aruba/aruba_config.py | 50 | 15163 | #!/usr/bin/python
#
# Copyright: Ansible Team
# 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',
'status': ['preview'],
... | gpl-3.0 |
jamesblunt/edx-platform | openedx/core/djangoapps/content/course_structures/tests.py | 54 | 8934 | import json
from xmodule_django.models import UsageKey
from xmodule.modulestore.django import SignalHandler
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from openedx.core.djangoapps.content.course_structures.models imp... | agpl-3.0 |
nevercast/home-assistant | homeassistant/components/device_tracker/owntracks.py | 3 | 3174 | """
homeassistant.components.device_tracker.owntracks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OwnTracks platform for the device tracker.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.owntracks/
"""
import json
import logging
im... | mit |
hastexo/edx-platform | lms/djangoapps/course_goals/views.py | 2 | 4467 | """
Course Goals Views - includes REST API
"""
import analytics
from django.contrib.auth import get_user_model
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.http import JsonResponse
from edx_rest_framework_extensions.authentication impo... | agpl-3.0 |
zhDai/CToFun | 简单购物模式/pb_.py | 1 | 8322 | #_*_ coding:utf-8 _*_
import sys,os,getpass
#######################################################################
def start_screen():
print ('''
*****************************************************************************
If you have one account,then choose "登录(L)";if none, please choose "注册(R)"
... | gpl-2.0 |
dsnopek/anki-sync-server | AnkiServer/__init__.py | 1 | 1558 |
# AnkiServer - A personal Anki sync server
# Copyright (C) 2013 David Snopek
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any... | agpl-3.0 |
gqwest-erp/server | openerp/addons/account_sequence/__init__.py | 433 | 1104 | # -*- 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 |
SAM-IT-SA/odoo | addons/im_livechat/im_livechat.py | 239 | 12432 | # -*- 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 |
mtr/ttpd | lib/TTP/PayExMessage.py | 1 | 5449 | #! /usr/bin/python
# -*- coding: latin-1 -*-
# $Id: Message.py 662 2007-02-06 13:59:26Z mtr $
"""
An implementation of the TUC Transfer Protocol.
This module contains a TTP message class and an XML parser that
transforms XML into a TTP message.
Copyright (C) 2004, 2007 by Lingit AS
Modified 25-may-2007, Kristian Ska... | gpl-3.0 |
scs/uclinux | user/python/python-2.4.4/Lib/test/list_tests.py | 12 | 15389 | """
Tests common to list and UserList.UserList
"""
import sys
import os
import unittest
from test import test_support, seq_tests
class CommonTest(seq_tests.CommonTest):
def test_init(self):
# Iterable arg is optional
self.assertEqual(self.type2test([]), self.type2test())
# Init clears p... | gpl-2.0 |
ArcherSys/ArcherSys | eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/encodings/cp424.py | 593 | 12311 | """ Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.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='... | mit |
Tatsh-ansible/ansible | test/units/executor/test_task_result.py | 45 | 5605 | # (c) 2016, James Cammarata <jimi@sngx.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | gpl-3.0 |
pepetreshere/odoo | addons/product_margin/tests/test_product_margin.py | 2 | 2591 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestProductMargin(AccountTestInvoicingCommon):
def test_product_mar... | agpl-3.0 |
eenchev/idea-note-taking-app | env/lib/python2.7/site-packages/psycopg2/tz.py | 23 | 4424 | """tzinfo implementations for psycopg2
This module holds two different tzinfo implementations that can be used as
the 'tzinfo' argument to datetime constructors, directly passed to psycopg
functions or used to set the .tzinfo_factory attribute in cursors.
"""
# psycopg/tz.py - tzinfo implementation
#
# Copyright (C) 2... | mit |
freyes/flask-hello-world | alembic/env.py | 1 | 2048 | from __future__ import with_statement
import os
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 ... | apache-2.0 |
rjshade/grpc | src/python/grpcio_health_checking/grpc_version.py | 5 | 1658 | # Copyright 2016, 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 of conditions and the f... | bsd-3-clause |
chris-hudson/impromptica | impromptica/probdata.py | 1 | 7390 | """Probability data from various sources.
In this module, the "Essen corpus" refers to a corpus of 6,217 European folk
songs from the Essen Folksong Collection. The songs are available at
http://kern.ccarh.org/cgi-bin/ksbrowse?l=/essen and the list of songs used to
train the monophonic key and meter programs is publis... | mit |
adw0rd/lettuce | tests/integration/lib/Django-1.2.5/django/core/serializers/pyyaml.py | 204 | 1948 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
from StringIO import StringIO
import decimal
import yaml
from django.db import models
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as... | gpl-3.0 |
Tejas-Subramanya/RYU_MEC | ryu/services/protocols/bgp/operator/commands/show/rib.py | 17 | 2482 | from route_formatter_mixin import RouteFormatterMixin
from ryu.services.protocols.bgp.operator.command import Command
from ryu.services.protocols.bgp.operator.command import CommandsResponse
from ryu.services.protocols.bgp.operator.command import STATUS_ERROR
from ryu.services.protocols.bgp.operator.command import STA... | apache-2.0 |
HwisooSo/gemV-update | tests/testing/results.py | 7 | 9555 | #!/usr/bin/env python2
#
# Copyright (c) 2016 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 implementati... | bsd-3-clause |
Avira/pootle | pootle/apps/contact/views.py | 6 | 3679 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django.core.urlre... | gpl-3.0 |
fkorotkov/pants | tests/python/pants_test/base/test_build_root.py | 11 | 2183 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import uni... | apache-2.0 |
with-git/tensorflow | tensorflow/contrib/layers/python/layers/summaries_test.py | 112 | 3834 | # 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 |
iAmMrinal0/reddit | MessageArchiveSimple/messagearchivesimple.py | 2 | 1943 | #/u/Goldensights
import praw
import time
import datetime
'''USER CONFIG'''
USERNAME = ""
#This is the bot's Username. In order to send mail, he must have some amount of Karma.
PASSWORD = ""
#This is the bot's Password.
USERAGENT = ""
#This is a short description of what the bot does. For example "/u/GoldenSights'... | mit |
softlayer/softlayer-python | SoftLayer/CLI/order/item_list.py | 2 | 5699 | """List package items."""
# :license: MIT, see LICENSE for more details.
import click
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.managers import ordering
from SoftLayer.utils import lookup
COLUMNS = ['category', 'keyName', 'description', 'priceId']
COLUMNS_ITEM_PRICES = ... | mit |
kdwink/intellij-community | python/lib/Lib/site-packages/django/core/management/commands/makemessages.py | 73 | 15487 | import fnmatch
import glob
import os
import re
import sys
from itertools import dropwhile
from optparse import make_option
from subprocess import PIPE, Popen
from django.core.management.base import CommandError, BaseCommand
from django.utils.text import get_text_list
pythonize_re = re.compile(r'(?:^|\n)\s*//')
plural... | apache-2.0 |
CydarLtd/ansible | lib/ansible/modules/system/lvol.py | 63 | 17123 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>, Alexander Bulimov <lazywolf0@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 So... | gpl-3.0 |
PetrDlouhy/django | tests/m2m_intermediary/models.py | 128 | 1260 | """
Many-to-many relationships via an intermediary table
For many-to-many relationships that need extra fields on the intermediary
table, use an intermediary model.
In this example, an ``Article`` can have multiple ``Reporter`` objects, and
each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position``
f... | bsd-3-clause |
murfz/Sick-Beard | lib/hachoir_parser/audio/8svx.py | 90 | 3949 | """
Audio Interchange File Format (AIFF) parser.
Author: Victor Stinner
Creation: 27 december 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet,
UInt16, UInt32, Float80, TimestampMac32,
RawBytes, NullBytes,
String, Enum, PascalString32)
from lib.hachoir_core.endia... | gpl-3.0 |
SOKP/external_chromium_org | third_party/cython/src/Cython/Compiler/Builtin.py | 90 | 20358 | #
# Builtin Definitions
#
from Symtab import BuiltinScope, StructOrUnionScope
from Code import UtilityCode
from TypeSlots import Signature
import PyrexTypes
import Options
# C-level implementations of builtin types, functions and methods
iter_next_utility_code = UtilityCode.load("IterNext", "ObjectHandling.c")
ge... | bsd-3-clause |
fhaoquan/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/colorama/initialise.py | 484 | 1297 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).rese... | lgpl-3.0 |
tlksio/tlksio | env/lib/python3.4/site-packages/future/backports/http/cookies.py | 78 | 21569 | ####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that bot... | mit |
NicovincX2/Python-3.5 | Algorithmique/Algorithme/Algorithme de tri/Tri par fusion (Merge sort)/merge_sort2.py | 1 | 1238 | # -*- coding: utf-8 -*-
import os
""" Merge Sort
----------
Uses divide and conquer to recursively divide and sort the list
Time Complexity: O(n log n)
Space Complexity: O(n) Auxiliary
Stable: Yes
Psuedo Code: CLRS. Introduction to Algorithms. 3rd ed. """
def merge(left, right):
"""
... | gpl-3.0 |
esteinig/netviewP | program/linux/0.7/netview.py | 1 | 28716 | #!/usr/bin/env python
# NetView P v.0.7 - Linux
# Dependencies: PLINK
# Eike Steinig
# Zenger Lab, JCU
# https://github.com/esteinig/netview
import os
import time
import shutil
import argparse
import subprocess
import numpy as np
import multiprocessing as mp
import scipy.sparse.csgraph as csg
import scipy.spatial.dist... | gpl-2.0 |
tjsavage/rototutor_djangononrel | django/views/decorators/http.py | 94 | 6854 | """
Decorators for views based on HTTP headers.
"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from calendar import timegm
from datetime import timedelta
from email.Utils import formatdate
from django.utils.decorators import decorato... | bsd-3-clause |
styxit/HTPC-Manager | libs/cherrypy/lib/profiler.py | 88 | 6501 | """Profiler tools for CherryPy.
CherryPy users
==============
You can profile any of your pages as follows::
from cherrypy.lib import profiler
class Root:
p = profile.Profiler("/path/to/profile/dir")
def index(self):
self.p.run(self._index)
index.exposed = Tr... | mit |
citizen-stig/pyjtt | pyjtt/gui.py | 1 | 26426 | from datetime import timedelta, datetime
import queue
from urllib import error
from functools import partial
import logging
from PyQt5 import QtWidgets, QtCore, QtGui
from pyjtt import base_classes, core, utils, workers
from pyjtt.widgets import login_window, main_window, worklog_window
__author__ = "Nikolay Golub (... | gpl-3.0 |
wilebeast/FireFox-OS | B2G/gecko/testing/marionette/client/marionette/keys.py | 39 | 2581 | # copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License Version 2.0 = uthe "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http //www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.