repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
huguesv/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32com/client/build.py | 7 | 23485 | """Contains knowledge to build a COM object definition.
This module is used by both the @dynamic@ and @makepy@ modules to build
all knowledge of a COM object.
This module contains classes which contain the actual knowledge of the object.
This include parameter and return type information, the COM dispid and CLSID, et... | apache-2.0 |
johngian/remo | vendor-local/lib/python/tablib/packages/openpyxl/shared/date_time.py | 61 | 5956 | # file openpyxl/shared/date_time.py
# Copyright (c) 2010 openpyxl
#
# 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, cop... | bsd-3-clause |
ofanoyi/scrapy | scrapy/contrib/spiders/feed.py | 18 | 5599 | """
This module implements the XMLFeedSpider which is the recommended spider to use
for scraping from an XML feed.
See documentation in docs/topics/spiders.rst
"""
from scrapy.spider import Spider
from scrapy.item import BaseItem
from scrapy.http import Request
from scrapy.utils.iterators import xmliter, csviter
from ... | bsd-3-clause |
pamu/FooService | FooService1/project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 604 | 3207 | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | apache-2.0 |
korbenzhang/vim-ycm-win | third_party/requests/requests/packages/urllib3/response.py | 316 | 10537 | # urllib3/response.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
import zlib
import io
from .exceptions import DecodeError
from .packages.six ... | apache-2.0 |
benslavin/heroku-buildpack-python | vendor/virtualenv-1.7.2/virtualenv_embedded/distribute_setup.py | 20 | 16313 | #!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... | mit |
scottdangelo/RemoveVolumeMangerLocks | cinder/volume/drivers/netapp/dataontap/nfs_7mode.py | 1 | 8344 | # Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Ben Swartzlander. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Bob Callaw... | apache-2.0 |
prds21/repository-barrialTV | lib/mechanize/_testcase.py | 136 | 5086 | import os
import shutil
import subprocess
import tempfile
import unittest
class SetupStack(object):
def __init__(self):
self._on_teardown = []
def add_teardown(self, teardown):
self._on_teardown.append(teardown)
def tear_down(self):
for func in reversed(self._on_teardown):
... | gpl-2.0 |
mixtile/loftq-linux | tools/perf/util/setup.py | 97 | 1405 | #!/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 |
openstack/networking-plumgrid | networking_plumgrid/neutronclient/policy/policy_tag.py | 1 | 5554 | # Copyright 2016 OpenStack Foundation.
# 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 requ... | apache-2.0 |
fredkingham/blog-of-fred | django/template/debug.py | 83 | 3586 | from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone import lo... | bsd-3-clause |
atopuzov/nitro-python | nssrc/com/citrix/netscaler/nitro/resource/config/network/__init__.py | 4 | 1557 | __all__ = ['Interface', 'arp', 'arpparam', 'bridgegroup', 'bridgegroup_binding', 'bridgegroup_nsip6_binding', 'bridgegroup_nsip_binding', 'bridgegroup_vlan_binding', 'bridgetable', 'channel', 'channel_binding', 'channel_interface_binding', 'ci', 'fis', 'fis_binding', 'fis_channel_binding', 'fis_interface_binding', 'for... | apache-2.0 |
rduivenvoorde/QGIS | python/plugins/db_manager/dlg_field_properties.py | 30 | 3597 | # -*- coding: utf-8 -*-
"""
***************************************************************************
dlg_field_properties.py
---------------------
Date : April 2012
Copyright : (C) 2012 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
******... | gpl-2.0 |
RobCranfill/weewx | bin/weedb/__init__.py | 6 | 5597 | #
# Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Middleware that sits above DBAPI and makes it a little more database independent.
Weedb generally follows the MySQL exception model. Specifically:
- Operations on a non-existent database result in... | gpl-3.0 |
gohin/django | django/contrib/staticfiles/management/commands/runserver.py | 248 | 1361 | from django.conf import settings
from django.contrib.staticfiles.handlers import StaticFilesHandler
from django.core.management.commands.runserver import \
Command as RunserverCommand
class Command(RunserverCommand):
help = "Starts a lightweight Web server for development and also serves static files."
d... | bsd-3-clause |
nmartensen/pandas | pandas/io/formats/common.py | 16 | 1094 | # -*- coding: utf-8 -*-
"""
Common helper methods used in different submodules of pandas.io.formats
"""
def get_level_lengths(levels, sentinel=''):
"""For each index in each level the function returns lengths of indexes.
Parameters
----------
levels : list of lists
List of values on for level... | bsd-3-clause |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/27NodeBrick/cantilever_different_Poisson/NumberOfDivision4/PoissonRatio0.15/compare_essi_version.py | 409 | 1085 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
# automatically find the script directory.
# script_dir=sys.argv[1]
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own command line color function
# ... | cc0-1.0 |
j-griffith/cinder | cinder/db/sqlalchemy/migrate_repo/versions/102_add_replication_status_to_groups_table.py | 4 | 1082 | # Copyright (C) 2017 Dell Inc. or its subsidiaries.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 |
TeamEOS/external_chromium_org | mojo/tools/pylib/transitive_hash.py | 43 | 2767 | # Copyright 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.
import logging
import subprocess
import sys
from hashlib import sha256
from os.path import basename, realpath
_logging = logging.getLogger()
# Based on/ta... | bsd-3-clause |
bglassy/OpenBazaar | node/data_uri.py | 17 | 2605 | import mimetypes
import re
import urllib
MIMETYPE_REGEX = r'[\w]+\/[\w\-\+\.]+'
_MIMETYPE_RE = re.compile('^{}$'.format(MIMETYPE_REGEX))
CHARSET_REGEX = r'[\w\-\+\.]+'
_CHARSET_RE = re.compile('^{}$'.format(CHARSET_REGEX))
DATA_URI_REGEX = (
r'data:' +
r'(?P<mimetype>{})?'.format(MIMETYPE_REGEX) +
r'(?:... | mit |
TheWardoctor/Wardoctors-repo | script.module.schism.common/lib/bs4/__init__.py | 23 | 20421 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup uses a pluggable XML or HTML parser to parse a
(possibly invalid) document into a tree representation. Beautiful Soup
provides methods and Pythonic idioms that make it easy to navigate,
search,... | apache-2.0 |
vprime/puuuu | env/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/creation.py | 117 | 4498 | from django.conf import settings
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
from django.utils.functional import cached_property
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_ops = 'GIST_GEOMETRY_OPS'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND... | mit |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.5/tests/regressiontests/i18n/contenttypes/tests.py | 50 | 1132 | # coding: utf-8
from __future__ import unicode_literals
import os
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django.test.utils import override_settings
from django.utils._os import upath
from django.utils import six
from django.utils import translation
@override... | apache-2.0 |
yasoob/youtube-dl-GUI | youtube_dl/extractor/telegraaf.py | 12 | 2995 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_iso8601,
try_get,
)
class TelegraafIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?telegraaf\.nl/video/(?P<id>\d+)'
_TEST = {
'url': '... | mit |
ianatpn/nupictest | nupic/encoders/scalar.py | 2 | 25504 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
zmike/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_msgutil.py | 413 | 54959 | #!/usr/bin/env python
#
# Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mpl-2.0 |
axinging/chromium-crosswalk | tools/perf/measurements/repaint_unittest.py | 14 | 2776 | # Copyright 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.
from telemetry import decorators
from telemetry.page import page as page_module
from telemetry.testing import options_for_unittests
from telemetry.testing im... | bsd-3-clause |
JoshRosen/spark | examples/src/main/python/ml/polynomial_expansion_example.py | 123 | 1522 | #
# 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 |
friend0/tower | tower/map/space.py | 1 | 4589 | # coding=utf-8
"""
Region will serve as an abstract base class (ABC) to implement a standard interface amongst both Map and Surface objects
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import abc
import collections
from future.utils import with_metaclass
from builtins imp... | isc |
cewood/ansible-modules-core | utilities/helper/accelerate.py | 7 | 27481 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Cammarata <jcammarata@ansible.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 ... | gpl-3.0 |
louietsai/python-for-android | python-modules/twisted/twisted/manhole/telnet.py | 81 | 3504 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Telnet-based shell."""
# twisted imports
from twisted.protocols import telnet
from twisted.internet import protocol
from twisted.python import log, failure
# system imports
import string, copy, sys
from cStringIO import StringIO
... | apache-2.0 |
pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/flask_cors/decorator.py | 4 | 4937 | # -*- coding: utf-8 -*-
"""
decorator
~~~~
This unit exposes a single decorator which should be used to wrap a
Flask route with. It accepts all parameters and options as
the CORS extension.
:copyright: (c) 2016 by Cory Dolphin.
:license: MIT, see LICENSE for more details.
"""
from functools... | mit |
sarahn/ganeti | lib/utils/__init__.py | 2 | 22871 | #
#
# Copyright (C) 2006, 2007, 2010, 2011 Google 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.
#
# This progr... | gpl-2.0 |
pengshp/GitPython | git/test/test_config.py | 7 | 8370 | # test_config.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.test.lib import (
TestCase,
fixture_path,
assert_equal,
)
from gitdb.test.l... | bsd-3-clause |
tensorflow/models | official/nlp/data/create_xlnet_pretraining_data_test.py | 1 | 10930 | # Copyright 2021 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 |
getavalon/core | docs/source/conf.py | 3 | 5010 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Avalon documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 20 20:12:06 2017.
#
# 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
# aut... | mit |
phdowling/scikit-learn | sklearn/preprocessing/label.py | 137 | 27165 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Joel Nothman <joel.nothman@gmail.com>
# Hamzeh Alsalhi <ha258@cornell.edu>
# Licens... | bsd-3-clause |
VisTrails/VisTrails | vistrails/db/versions/v0_8_1/translate/v0_8_0.py | 2 | 4302 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
anselal/antminer-monitor | antminermonitor/app.py | 1 | 3074 | from flask import Flask
from antminermonitor.blueprints.asicminer import antminer, antminer_json
from antminermonitor.blueprints.user import user
from antminermonitor.extensions import login_manager, migrate
from antminermonitor.blueprints.asicminer.models.miner import Miner
from antminermonitor.blueprints.asicminer.m... | gpl-3.0 |
peterm-itr/edx-platform | common/djangoapps/geoinfo/tests/test_middleware.py | 12 | 5360 | """
Tests for CountryMiddleware.
"""
from mock import patch
import pygeoip
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.utils import override_settings
from django.test.client import RequestFactory
from geoinfo.middleware import CountryMiddleware
fr... | agpl-3.0 |
dschien/simple-MC | simplemc/__init__.py | 1 | 3544 | '''
simple-MC: Main module
Copyright 2014, Dan Schien
Licensed under MIT.
'''
import importlib
import xlrd
__author__ = 'schien'
NAME = 'name'
TYPE = 'type'
PARAM_A = 'param_a'
PARAM_B = 'param_b'
PARAM_C = 'param_c'
MODULE = 'module'
LABEL = 'label'
UNIT = 'unit'
TABLE_STRUCT = {
NAME: 0,
MODULE: 1,
... | mit |
jiangwei1221/django-virtualenv-demo | env/lib/python2.7/site-packages/django/core/paginator.py | 141 | 5021 | import collections
from math import ceil
from django.utils import six
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0,
allow_empty_first... | unlicense |
hogarthj/ansible | lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py | 66 | 10078 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
SwagColoredKitteh/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_pastebin.py | 173 | 3845 | # encoding: utf-8
import sys
import pytest
class TestPasteCapture:
@pytest.fixture
def pastebinlist(self, monkeypatch, request):
pastebinlist = []
plugin = request.config.pluginmanager.getplugin('pastebin')
monkeypatch.setattr(plugin, 'create_new_paste', pastebinlist.append)
re... | mpl-2.0 |
sordonia/hed-qs | baselines/VMM/vmm_builder.py | 3 | 1080 | """
__author__ Alessandro Sordoni
"""
import logging
import cPickle
import os
import sys
import argparse
from Common.psteff import *
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
def build(session_file, epsilon):
D = 5
pstree = PST(D)
f = open(session_file, 'r')
for num, ... | bsd-3-clause |
ahamilton55/ansible | lib/ansible/modules/net_tools/omapi_host.py | 30 | 12355 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to configure DHCPd hosts using OMAPI protocol
(c) 2016, Loic Blot <loic.blot@unix-experience.fr>
Sponsored by Infopro Digital. http://www.infopro-digital.com/
Sponsored by E.T.A.I. http://www.etai.fr/
This file is part of Ansible
Ansible is free software: ... | gpl-3.0 |
wakatime/wakatime | tests/test_dependencies.py | 1 | 16387 | # -*- coding: utf-8 -*-
from wakatime.main import execute
from wakatime.packages import requests
import logging
import os
import time
import shutil
from testfixtures import log_capture
from wakatime.compat import is_py26, u
from wakatime.constants import SUCCESS
from wakatime.exceptions import NotYetImplemented
from... | bsd-3-clause |
code-sauce/tensorflow | tensorflow/contrib/framework/python/ops/__init__.py | 86 | 1252 | # 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 |
381426068/MissionPlanner | Lib/site-packages/scipy/special/tests/test_orthogonal_eval.py | 61 | 4547 | import numpy as np
from numpy.testing import assert_
import scipy.special.orthogonal as orth
from scipy.special._testutils import FuncData
def test_eval_chebyt():
n = np.arange(0, 10000, 7)
x = 2*np.random.rand() - 1
v1 = np.cos(n*np.arccos(x))
v2 = orth.eval_chebyt(n, x)
assert_(np.allclose(v1, ... | gpl-3.0 |
cr1901/HDMI2USB-litex-firmware | targets/nexys_video/video.py | 1 | 4745 | from litevideo.input import HDMIIn
from litevideo.output import VideoOut
from litex.soc.cores.frequency_meter import FrequencyMeter
from litescope import LiteScopeAnalyzer
from targets.utils import csr_map_update, period_ns
from targets.nexys_video.net import NetSoC as BaseSoC
class VideoSoC(BaseSoC):
csr_peri... | bsd-2-clause |
danfairs/django-lazysignup | custom_user_tests/migrations/0001_initial.py | 2 | 2861 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
import django.utils.timezone
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = ... | bsd-3-clause |
googleads/google-ads-python | google/ads/googleads/v6/errors/types/function_parsing_error.py | 1 | 1514 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
bmander/dancecontraption | django/db/utils.py | 78 | 6129 | import inspect
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
DEFAULT_DB_ALIAS = 'default'
# Define some exceptions that mirror the PEP249 interface.
# We will rethrow any backend-specific errors using these
# commo... | bsd-3-clause |
BakanovKirill/Medicine | src/medicine/settings.py | 1 | 5625 | # Django settings for medicine project.
import os
from django.conf import global_settings
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROJECT_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../../')
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
... | mit |
hale36/SRTV | sickbeard/notifiers/nma.py | 18 | 2488 | import sickbeard
from sickbeard import logger, common
from pynma import pynma
class NMA_Notifier:
def test_notify(self, nma_api, nma_priority):
return self._sendNMA(nma_api, nma_priority, event="Test", message="Testing NMA settings from SickRage",
force=True)
def notify_... | gpl-3.0 |
tracierenea/gnuradio | gr-filter/python/filter/gui/pyqt_filter_stacked.py | 58 | 111310 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyqt_filter_stacked.ui'
#
# Created: Wed Aug 8 11:42:47 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
ex... | gpl-3.0 |
synasius/django | tests/utils_tests/test_lazyobject.py | 38 | 11862 | from __future__ import unicode_literals
import copy
import pickle
import sys
import warnings
from unittest import TestCase
from django.utils import six
from django.utils.functional import LazyObject, SimpleLazyObject, empty
from .models import Category, CategoryInfo
class Foo(object):
"""
A simple class wi... | bsd-3-clause |
VitalPet/odoo | addons/portal/wizard/portal_wizard.py | 22 | 9618 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
runarberg/servo | tests/wpt/web-platform-tests/referrer-policy/generic/tools/common_paths.py | 238 | 1823 | import os, sys, json, re
script_directory = os.path.dirname(os.path.abspath(__file__))
generic_directory = os.path.abspath(os.path.join(script_directory, '..'))
template_directory = os.path.abspath(os.path.join(script_directory,
'..',
... | mpl-2.0 |
kromain/chromium-tools | third_party/boto/pyami/copybot.py | 102 | 4273 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | bsd-3-clause |
sam-falvo/kestrel | cores/S16X4B/rtl/nmigen/interfaces.py | 1 | 3319 | from nmigen import Signal
# Unprefixed opcodes are 100% backward compatible with S16X4A.
# New addition is the use of opcode 8 as an escape prefix.
# Additionally, opcode 9 is reserved as a prefix for future
# use.
OPC_NOP = 0
OPC_LIT = 1
OPC_FWM = 2
OPC_SWM = 3
OPC_ADD = 4
OPC_AND = 5
OPC_XOR = 6
OPC_ZGO = 7
OPC_pre... | mpl-2.0 |
neocortex/paletti | paletti/utils.py | 1 | 3459 | import numpy as np
def rgb2lab(image):
""" Transforms an RGB-image to a LAB-image. """
return xyz2lab(rgb2xyz(image))
def lab2rgb(image):
""" Transforms a LAB-image to an RGB-image. """
return xyz2rgb(lab2xyz(image))
def rgb2xyz(image):
""" Transforms an RGB-mage to a XYZ-image. """
image ... | mit |
xwolf12/scikit-learn | sklearn/linear_model/randomized_l1.py | 95 | 23365 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | bsd-3-clause |
indolentriffraff/fihndos | cogs/customcmds.py | 1 | 40126 | import math
import re
import json
from github import Github
from PythonGists import PythonGists
from discord.ext import commands
from cogs.utils.checks import cmd_prefix_len, load_config
'''Module for custom commands adding, removing, and viewing.'''
class Customcmds:
def __init__(self, bot):
... | gpl-3.0 |
CellarD0-0r/whatever | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | 1361 | 45045 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... | mit |
eiginn/passpie | passpie/table.py | 3 | 1435 | from tabulate import tabulate
import click
class Table(object):
def __init__(self, headers,
table_format='rst',
colors=None,
hidden=None,
missing=None,
hidden_string="*****"):
self.headers = headers
self.colors =... | mit |
garnaat/boto | boto/ec2/spotinstancerequest.py | 170 | 7288 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# w... | mit |
vmarkovtsev/django | tests/migrations/test_optimizer.py | 118 | 22678 | # -*- coding: utf-8 -*-
from django.db import migrations, models
from django.db.migrations.optimizer import MigrationOptimizer
from django.test import SimpleTestCase
from .models import CustomModelBase, EmptyManager
class OptimizerTests(SimpleTestCase):
"""
Tests the migration autodetector.
"""
def... | bsd-3-clause |
awatts/boto | tests/compat.py | 115 | 1560 | # Copyright (c) 2014 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 |
csitarichie/boost_msm_bare_metal | boost/tools/build/v2/tools/darwin.py | 49 | 2455 | # Copyright (C) Christopher Currie 2003. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as to
# its suitability for any purpose.
# Ple... | gpl-2.0 |
curtisstpierre/django | django/contrib/admin/checks.py | 72 | 38589 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from itertools import chain
from django.contrib.admin.utils import (
NotRelationField, flatten, get_fields_from_path,
)
from django.core import checks
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from django.forms... | bsd-3-clause |
Shaps/ansible | test/support/network-integration/collections/ansible_collections/cisco/ios/plugins/doc_fragments/ios.py | 47 | 3576 | # -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r"""options:
provider:
description... | gpl-3.0 |
awni/tensorflow | tensorflow/python/training/adam.py | 5 | 6642 | # 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 by applicable law or a... | apache-2.0 |
rgaino/three.js | utils/exporters/blender/addons/io_three/exporter/__init__.py | 178 | 2661 | import os
import sys
import traceback
from .. import constants, logger, exceptions, dialogs
from . import scene, geometry, api, base_classes
def _error_handler(func):
def inner(filepath, options, *args, **kwargs):
level = options.get(constants.LOGGING, constants.DEBUG)
version = options.get('... | mit |
sanguinariojoe/FreeCAD | src/Mod/Fem/femexamples/constraint_transform_beam_hinged.py | 8 | 7322 | # ***************************************************************************
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... | lgpl-2.1 |
wkl/linux-509 | tools/perf/python/twatch.py | 1565 | 1316 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
Greennut/ostproject | pygments/formatters/img.py | 14 | 18051 | # -*- coding: utf-8 -*-
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from commands import getstatusoutput
from pygments.formatter import F... | bsd-3-clause |
victor-gil-sepulveda/PhD-ANMPythonHelpers | anmichelpers/tools/tools.py | 1 | 3490 | """
Created on 9/2/2015
@author: victor
"""
import numpy
import math
import prody
try:
from pyproct.data.handler.sourceGenerator import SourceGenerator
from pyproct.data.handler.protein.proteinEnsembleDataLoader import ProteinEnsembleDataLoader
except:
print "[WARNING] pyProCT was not found. Some function... | mit |
Alwnikrotikz/marinemap | lingcod/openid/middleware.py | 3 | 2397 | # -*- coding: utf-8 -*-
# Copyright 2007, 2008,2009 by Benoît Chesneau <benoitc@e-engura.org>
#
# 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... | bsd-3-clause |
mnunezdm/cazasteroides | karmaserver/modules/selection/provider/__init__.py | 1 | 3116 | ''' EFES Provider module '''
from karmaserver.modules.selection.provider.evaluator import ObservationEvaluator
from karmaserver.modules.selection.provider.filter import ObservationFilter
from karmaserver.modules.selection.provider.eraser import ObservationEraser
from karmaserver.modules.selection.provider.selector impo... | mit |
cruzegoodin/TSC-ShippingDetails | flask/lib/python2.7/site-packages/sqlalchemy/sql/type_api.py | 21 | 37851 | # sql/types_api.py
# Copyright (C) 2005-2015 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
"""Base types API.
"""
from .. import exc, util
from . import operators
from .vi... | bsd-3-clause |
NathanW2/QGIS | python/plugins/processing/tools/system.py | 16 | 3475 | # -*- coding: utf-8 -*-
"""
***************************************************************************
py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************************... | gpl-2.0 |
shaufi10/odoo | addons/document/content_index.py | 430 | 6619 | # -*- 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 |
puzan/ansible | test/units/modules/cloud/amazon/test_s3.py | 49 | 1262 | import pytest
boto = pytest.importorskip("boto")
import unittest
import ansible.modules.cloud.amazon.s3 as s3
from ansible.module_utils.six.moves.urllib.parse import urlparse
class TestUrlparse(unittest.TestCase):
def test_urlparse(self):
actual = urlparse("http://test.com/here")
self.assertEqual... | gpl-3.0 |
sorenk/ansible | lib/ansible/modules/cloud/ovirt/ovirt_mac_pools.py | 73 | 5430 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
foolprooflabs/JackB03 | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
qma/pants | src/python/pants/help/help_formatter.py | 4 | 2867 | # 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 textwrap import... | apache-2.0 |
veselosky/schemazoid | schemazoid/micromodels/models.py | 1 | 6716 | import six
from .fields import Field
class MetaModel(type):
"""The metaclass for :class:`~schemazoid.micromodels.Model`.
The main function of this metaclass
is to move all of fields into the ``_clsfields`` variable on the class.
"""
def __new__(cls, name, bases, attrs):
fields = {}
... | apache-2.0 |
LumPenPacK/NetworkExtractionFromImages | osx_build/nefi2_osx_amd64_xcode_2015/site-packages/networkx/utils/tests/test_heaps.py | 64 | 3979 | from nose.tools import *
import networkx as nx
from networkx.utils import *
class X(object):
def __eq__(self, other):
raise self is other
def __ne__(self, other):
raise self is not other
def __lt__(self, other):
raise TypeError('cannot compare')
def __le__(self, other):
... | bsd-2-clause |
arju88nair/projectCulminate | venv/lib/python3.5/site-packages/urllib3/util/request.py | 205 | 3705 | from __future__ import absolute_import
from base64 import b64encode
from ..packages.six import b, integer_types
from ..exceptions import UnrewindableBodyError
ACCEPT_ENCODING = 'gzip,deflate'
_FAILEDTELL = object()
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=... | apache-2.0 |
csrocha/OpenUpgrade | addons/account_analytic_plans/account_analytic_plans.py | 123 | 23336 | # -*- 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 |
ianyh/heroku-buildpack-python-opencv | vendor/.heroku/lib/python2.7/test/test_strptime.py | 50 | 25849 | """PyUnit testing against strptime"""
import unittest
import time
import locale
import re
import sys
from test import test_support
from datetime import date as datetime_date
import _strptime
class getlang_Tests(unittest.TestCase):
"""Test _getlang"""
def test_basic(self):
self.assertEqual(_strptime._... | mit |
samdowd/drumm-farm | drumm_env/lib/python2.7/site-packages/django/utils/translation/trans_null.py | 467 | 1408 | # These are versions of the functions in django.utils.translation.trans_real
# that don't actually do anything. This is purely for performance, so that
# settings.USE_I18N = False can use this module rather than trans_real.py.
from django.conf import settings
from django.utils.encoding import force_text
def ngettext... | mit |
tiagofrepereira2012/tensorflow | tensorflow/python/tools/optimize_for_inference.py | 106 | 4714 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
subena-io/subena | base.py | 1 | 1245 | #!/usr/local/bin/python2.7
# -*- coding: utf-8-sig -*-
import argparse
import logging
import os
import sqlalchemy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm.session import sessionmaker
#if no env variable has been defined, a default one is set
if not(os.environ.has_key("SUBDB")):
... | apache-2.0 |
arenadata/ambari | ambari-server/src/main/resources/stacks/ADH/1.4/services/GIRAPH/package/scripts/giraph.py | 2 | 1493 | """
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 use this ... | apache-2.0 |
paulcronk/psinsights | psinsights/error.py | 1 | 1641 | ###############################################################################
# Copyright 2012 FastSoft Inc.
# Copyright 2012 Devin Anderson <danderson (at) fastsoft (dot) com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You m... | apache-2.0 |
willium/browser-extension | tools/addon-sdk-1.16/python-lib/cuddlefish/tests/test_preflight.py | 37 | 5860 | # 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/.
import os, shutil
import simplejson as json
import unittest
import hashlib
import base64
from cuddlefish import preflig... | mit |
Danfocus/Flexget | flexget/plugins/cli/win32_service.py | 4 | 2727 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import argparse
import logging
import os
import socket
import sys
import flexget
from flexget import options
from flexget.event import event
from flexget.terminal import c... | mit |
PeterWangPo/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/common.py | 203 | 3229 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.