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 |
|---|---|---|---|---|---|
FNST-OpenStack/horizon | openstack_dashboard/api/glance.py | 15 | 12358 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
troyleak/youtube-dl | youtube_dl/compat.py | 39 | 15655 | from __future__ import unicode_literals
import collections
import getpass
import optparse
import os
import re
import shutil
import socket
import subprocess
import sys
import itertools
try:
import urllib.request as compat_urllib_request
except ImportError: # Python 2
import urllib2 as compat_urllib_request
... | unlicense |
rprata/boost | tools/build/test/copy_time.py | 44 | 1949 | #!/usr/bin/python
#
# Copyright (c) 2008 Steven Watanabe
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test that the common.copy rule set the modification date of the new file to
# the current time.
import B... | gpl-2.0 |
arasdar/DL | uri-dl/uri-dl-hw-2/assignment2/cs231n/data_utils.py | 18 | 9178 | from __future__ import print_function
from builtins import range
from six.moves import cPickle as pickle
import numpy as np
import os
from scipy.misc import imread
import platform
def load_pickle(f):
version = platform.python_version_tuple()
if version[0] == '2':
return pickle.load(f)
elif versio... | unlicense |
aldariz/Sick-Beard | lib/hachoir_core/field/timestamp.py | 90 | 2941 | from lib.hachoir_core.tools import (humanDatetime, humanDuration,
timestampUNIX, timestampMac32, timestampUUID60,
timestampWin64, durationWin64)
from lib.hachoir_core.field import Bits, FieldSet
from datetime import datetime
class GenericTimestamp(Bits):
def __init__(self, parent, name, size, description=N... | gpl-3.0 |
yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/duplicity/backend.py | 1 | 24196 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | mit |
mdaniel/intellij-community | python/testData/inspections/PyDataclassInspection/mutatingFrozenInInheritance.py | 14 | 1404 | import attr
import dataclasses
@dataclasses.dataclass(frozen=True)
class A1:
a: int = 1
@dataclasses.dataclass(frozen=True)
class B1(A1):
b: str = "1"
<error descr="'A1' object attribute 'a' is read-only">A1().a</error> = 2
<error descr="'B1' object attribute 'a' is read-only">B1().a</error> = 2
<error desc... | apache-2.0 |
alexcuellar/odoo | addons/crm/report/crm_opportunity_report.py | 309 | 4879 | # -*- 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 |
ayushin78/coala | coalib/bearlib/aspects/docs.py | 31 | 1522 | from inspect import cleandoc
from coala_utils.decorators import (
enforce_signature, generate_consistency_check)
@generate_consistency_check('definition', 'example', 'example_language',
'importance_reason', 'fix_suggestions')
class Documentation:
"""
This class contains docume... | agpl-3.0 |
arbn/pysaml2 | tests/idp_conf_mdb.py | 3 | 3899 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from saml2 import BINDING_SOAP, BINDING_URI
from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_HTTP_POST
from saml2 import BINDING_HTTP_ARTIFACT
from saml2.saml import NAMEID_FORMAT_PERSISTENT
from saml2.saml import NAME_FORMAT_URI
from pathutils import full... | bsd-2-clause |
wisechengyi/pants | tests/python/pants_test/backend/codegen/ragel/java/test_ragel_gen.py | 2 | 2409 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from textwrap import dedent
from pants.backend.codegen.ragel.java.java_ragel_library import JavaRagelLibrary
from pants.backend.codegen.ragel.java.ragel_gen import RagelGen, cal... | apache-2.0 |
PrashntS/scikit-learn | sklearn/linear_model/ridge.py | 60 | 44642 | """
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# Fabian Pedregosa <fabian@fseoane.net>
# Michael Eickenberg <michael.eickenberg@nsup.org>
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
impor... | bsd-3-clause |
vijayendrabvs/hap | neutron/plugins/ml2/drivers/cisco/nexus/exceptions.py | 36 | 3102 | # Copyright (c) 2013 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 ... | apache-2.0 |
vasyarv/edx-platform | common/djangoapps/third_party_auth/tests/testutil.py | 17 | 7453 | """
Utilities for writing third_party_auth tests.
Used by Django and non-Django tests; must not have Django deps.
"""
from contextlib import contextmanager
from django.conf import settings
import django.test
import mock
import os.path
from third_party_auth.models import OAuth2ProviderConfig, SAMLProviderConfig, SAML... | agpl-3.0 |
maxis1314/pyutils | blog/views/base.py | 2 | 1087 | # coding: utf-8
from flask import Flask, session, redirect, url_for, request,abort
import config
config = config.rec()
def on_finish():
None
def currentUserGet():
if 'user' in session:
user = session['user']
return user['username']
else:
return None
def currentUserSet(username):... | apache-2.0 |
Peddle/hue | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_termcolors.py | 60 | 7696 | from django.utils import unittest
from django.utils.termcolors import (parse_color_setting, PALETTES,
DEFAULT_PALETTE, LIGHT_PALETTE, DARK_PALETTE, NOCOLOR_PALETTE, colorize)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAU... | apache-2.0 |
craigcitro/protorpc | demos/appstats/protorpc_appstats/main.py | 20 | 3270 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
jdar/phantomjs-modified | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py | 182 | 2132 | # Copyright (C) 2011 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
Rudloff/youtube-dl | youtube_dl/extractor/allocine.py | 21 | 3546 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
qualities,
unescapeHTML,
xpath_element,
)
class AllocineIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?allocine\.fr/(?P<... | unlicense |
gerddie/nipype | nipype/interfaces/afni/tests/test_auto_Warp.py | 5 | 1448 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.afni.preprocess import Warp
def test_Warp_inputs():
input_map = dict(args=dict(argstr='%s',
),
deoblique=dict(argstr='-deoblique',
),
environ=dict(nohash=True,
usedefault=True,
... | bsd-3-clause |
redhat-openstack/nova | nova/tests/api/openstack/compute/contrib/test_extended_availability_zone.py | 7 | 6694 | # Copyright 2011 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 |
nirmeshk/oh-mainline | vendor/packages/south/south/tests/__init__.py | 93 | 3189 | from __future__ import print_function
#import unittest
import os
import sys
from functools import wraps
from django.conf import settings
from south.hacks import hacks
# Make sure skipping tests is available.
try:
# easiest and best is unittest included in Django>=1.3
from django.utils import unittest
except I... | agpl-3.0 |
anpingli/openshift-ansible | roles/openshift_health_checker/library/search_journalctl.py | 56 | 4436 | #!/usr/bin/python
"""Interface to journalctl."""
from time import time
import json
import re
import subprocess
from ansible.module_utils.basic import AnsibleModule
class InvalidMatcherRegexp(Exception):
"""Exception class for invalid matcher regexp."""
pass
class InvalidLogEntry(Exception):
"""Excepti... | apache-2.0 |
ppapadeas/wprevents | vendor-local/lib/python/unidecode/x050.py | 252 | 4682 | data = (
'Chang ', # 0x00
'Chi ', # 0x01
'Bing ', # 0x02
'Zan ', # 0x03
'Yao ', # 0x04
'Cui ', # 0x05
'Lia ', # 0x06
'Wan ', # 0x07
'Lai ', # 0x08
'Cang ', # 0x09
'Zong ', # 0x0a
'Ge ', # 0x0b
'Guan ', # 0x0c
'Bei ', # 0x0d
'Tian ', # 0x0e
'Shu ', # 0x0f
'Shu ', # 0x10... | bsd-3-clause |
cedk/odoo | openerp/addons/base/ir/ir_ui_menu.py | 316 | 20548 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can ... | agpl-3.0 |
armageddion/Alfr3d-MKIV | run/waterFlowers.py | 1 | 3775 | #!/usr/bin/python
"""
This is the utility for watering flowers
"""
# Copyright (c) 2010-2016 LiTtl3.1 Industries (LiTtl3.1).
# All rights reserved.
# This source code and any compilation or derivative thereof is the
# proprietary information of LiTtl3.1 Industries and is
# confidential in nature.
# Use of this source... | gpl-2.0 |
morissette/devopsdays-hackathon-2016 | venv/lib/python2.7/site-packages/setuptools/compat.py | 456 | 2094 | import sys
import itertools
PY3 = sys.version_info >= (3,)
PY2 = not PY3
if PY2:
basestring = basestring
import __builtin__ as builtins
import ConfigParser
from StringIO import StringIO
BytesIO = StringIO
func_code = lambda o: o.func_code
func_globals = lambda o: o.func_globals
im_func... | gpl-3.0 |
jcmarks/jcmarks-mobile | lib/jinja2/filters.py | 329 | 30115 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import groupby
from jinja2.utils... | apache-2.0 |
tucbill/manila | manila/tests/test_api.py | 9 | 2659 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
pombreda/rst2pdf | rst2pdf/tests/input/sphinx-issue158/conf.py | 9 | 7188 | # -*- coding: utf-8 -*-
#
# issue158 documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 18 22:54:33 2009.
#
# 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.
#
# Al... | mit |
yutiansut/QUANTAXIS | config/update_all.py | 4 | 2795 | #!/usr/local/bin/python
#coding :utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2021 yutiansut/QUANTAXIS
#
# 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, includ... | mit |
UpYou/relay | receive_path.py | 1 | 5452 | #!/usr/bin/env python
#
# Copyright 2005,2006,2007 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 you... | gpl-3.0 |
flavio-casacurta/Nat2Py | Adabas/demo/Emptel/EmptelFind.py | 1 | 4121 | """ Find in Demo Employees file by NAME, DEPTartment or MAKE
Adapt DBID, FNR and AUTOFNR
Note: when using FIND with MAKE and AUTOFNR != 12, file number in
search criterium must be changed in searchfield() parms
$Date: 2008-08-29 16:48:48 +0200 (Fri, 29 Aug 2008) $
$Rev: 68 $
"""
# Copyright 2004-20... | mit |
Safihre/cherrypy | cherrypy/lib/cpstats.py | 2 | 22854 | """CPStats, a package for collecting and reporting on program statistics.
Overview
========
Statistics about program operation are an invaluable monitoring and debugging
tool. Unfortunately, the gathering and reporting of these critical values is
usually ad-hoc. This package aims to add a centralized place for gather... | bsd-3-clause |
lukaasp/libs | aws_xray_sdk/ext/django/conf.py | 1 | 2042 | import os
from django.conf import settings as django_settings
from django.test.signals import setting_changed
DEFAULTS = {
'AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1:2000',
'AUTO_INSTRUMENT': True,
'AWS_XRAY_CONTEXT_MISSING': 'RUNTIME_ERROR',
'PLUGINS': (),
'SAMPLING': True,
'SAMPLING_RULES': None,... | unlicense |
gsantovena/marathon | tools/github/github_pulls_stats.py | 2 | 2730 | #!/usr/bin/env python
import collections
import json
import os
import requests
from datetime import datetime
from tabulate import tabulate
IdleTimeRecord = collections.namedtuple('IdleTimeRecord', ['pull_request', 'idle_time'])
def created_at(pull_request):
# String format can parse: 2018-01-29T16:23:55Z, 2018-0... | apache-2.0 |
broadcomCM/android_kernel_samsung_bcm21553-common | tools/perf/scripts/python/failed-syscalls-by-pid.py | 944 | 1869 | # 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... | gpl-2.0 |
Krossom/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_dict.py | 140 | 3816 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.v... | apache-2.0 |
mercycorps/TolaActivity | indicators/queries/program_queries.py | 1 | 20199 | """Proxy models for Program annotations for Home Page and Program Page
ProgramMetrics - superset of classes for shared program annotation functions
ProgramForHomePage - classes to support the Country/Portfolio roll-up of Program metrics
ProgramForProgramPage - classes to support in depth single-program que... | apache-2.0 |
nateprewitt/pipenv | pipenv/patched/pip/_vendor/webencodings/mklabels.py | 512 | 1305 | """
webencodings.mklabels
~~~~~~~~~~~~~~~~~~~~~
Regenarate the webencodings.labels module.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
import json
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
def asser... | mit |
eckucukoglu/arm-linux-gnueabihf | arm-linux-gnueabihf/libc/usr/lib/python2.7/test/test_functools.py | 45 | 16981 | import functools
import sys
import unittest
from test import test_support
from weakref import proxy
import pickle
@staticmethod
def PythonPartial(func, *args, **keywords):
'Pure Python approximation of partial()'
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update... | gpl-2.0 |
petuum/public | app/NMF/script/run_local.py | 1 | 3310 | #!/usr/bin/env python
"""
This script starts a process locally, using <client-id> <hostfile> as inputs.
"""
import os
from os.path import dirname
import time
import sys
from optparse import OptionParser
if len(sys.argv) < 3:
print "usage: %s <client-id> <hostfile>" % sys.argv[0]
sys.exit(1)
# app_dir is 2 dirs... | bsd-3-clause |
argonemyth/sentry | src/sentry/db/models/manager.py | 15 | 8637 | """
sentry.db.models.manager
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import hashlib
import logging
import threading
import weakref
from django.conf imp... | bsd-3-clause |
redhat-cip/horizon | openstack_dashboard/api/neutron.py | 1 | 48033 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Cisco Systems, Inc.
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use... | apache-2.0 |
2014c2g4/2015cda0623 | static/Brython3.1.3-20150514-095342/Lib/_dummy_thread.py | 742 | 4769 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | gpl-3.0 |
lmr/autotest | cli/topic_common.py | 3 | 25562 | #
# Copyright 2008 Google Inc. All Rights Reserved.
#
"""
This module contains the generic CLI object
High Level Design:
The atest class contains attributes & method generic to all the CLI
operations.
The class inheritance is shown here using the command
'atest host create ...' as an example:
atest <-- host <-- hos... | gpl-2.0 |
servo/servo | tests/wpt/webgl/tests/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py | 51 | 3673 | #!/usr/bin/env python
# Copyright (c) 2016 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use... | mpl-2.0 |
eyeofhell/sigma | test.py | 2 | 1977 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# sigma tests.
# Copyright 2013 Grigory Petrov
# See LICENSE for details.
import sys
sys.dont_write_bytecode = True
import sigma
assert sigma.parse( """
#!/usr/bin/python
##{ print( "foo" )
##}
##@ This is TOC.
""".strip() ) == [
sigma.TagTxt( ... | gpl-3.0 |
Metaswitch/pjsip-upstream | pjsip-apps/src/py_pjsua/pjsua.py | 105 | 7589 | import py_pjsua
status = py_pjsua.create()
print "py status " + `status`
#
# Create configuration objects
#
ua_cfg = py_pjsua.config_default()
log_cfg = py_pjsua.logging_config_default()
media_cfg = py_pjsua.media_config_default()
#
# Logging callback.
#
def logging_cb1(level, str, len):
print str,
#
# Config... | gpl-2.0 |
carvalhomb/tsmells | guess/src/Lib/bisect.py | 4 | 2252 | """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-2.0 |
amenonsen/ansible | test/units/test_constants.py | 187 | 3203 | # -*- coding: utf-8 -*-
# (c) 2017 Toshio Kuratomi <tkuratomi@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 the License, or
# (at... | gpl-3.0 |
tschaume/pymatgen | dev_scripts/chemenv/plane_multiplicity.py | 5 | 1764 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Development script to get the multiplicity of the separation facets for some model coordination environments
"""
__author__ = "David Waroquiers"
__copyright__ = "Copyright 2012, The Materials Project"
__ve... | mit |
pyblish/pyblish-win | lib/Python27/Lib/bsddb/test/test_compat.py | 111 | 4532 | """
Test cases adapted from the test_bsddb.py module in Python's
regression test suite.
"""
import os, string
import unittest
from test_all import db, hashopen, btopen, rnopen, verbose, \
get_new_database_path
class CompatibilityTestCase(unittest.TestCase):
def setUp(self):
self.filename = get_n... | lgpl-3.0 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/python-daemon/daemon/version/__init__.py | 42 | 1256 | # -*- coding: utf-8 -*-
# daemon/version/__init__.py
# Part of python-daemon, an implementation of PEP 3143.
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version ... | apache-2.0 |
samuelhavron/heroku-buildpack-python | Python-3.4.3/Lib/site.py | 8 | 21164 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
This will append site-specific paths to the module sear... | mit |
EDUlib/edx-platform | openedx/core/djangoapps/content_libraries/management/commands/reindex_content_library.py | 4 | 3499 | """ Management command to update content libraries' search index """ # lint-amnesty, pylint: disable=cyclic-import
import logging
from textwrap import dedent
from django.core.management import BaseCommand
from opaque_keys.edx.locator import LibraryLocatorV2
from openedx.core.djangoapps.content_libraries.api import... | agpl-3.0 |
bosstb/HaberPush | youtube_dl/extractor/ondemandkorea.py | 62 | 2036 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
js_to_json,
)
class OnDemandKoreaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ondemandkorea\.com/(?P<id>[^/]+)\.html'
_GEO_COUNTRIES = ['US', 'CA']
_TEST = {
... | mit |
Bulochkin/tensorflow_pack | tensorflow/contrib/rnn/python/tools/checkpoint_convert_test.py | 30 | 4255 | # 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 |
gnuhub/intellij-community | python/testData/MockSdk3.4/python_stubs/_io.py | 41 | 52669 | # encoding: utf-8
# module _io calls itself io
# from (built-in)
# by generator 1.135
"""
The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. ... | apache-2.0 |
elmerdpadilla/iv | addons/mrp/report/mrp_report.py | 341 | 3839 | # -*- 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 |
ModdedPA/android_external_chromium_org | tools/omahaproxy.py | 164 | 2466 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chrome Version Tool
Scrapes Chrome channel information and prints out the requested nugget of
information.
"""
import json
imp... | bsd-3-clause |
berfinsari/metricbeat | lsbeat/vendor/github.com/elastic/beats/packetbeat/tests/system/test_0052_amqp_emit_receive.py | 11 | 2789 | from packetbeat import BaseTest
class Test(BaseTest):
def test_amqp_emit_receive(self):
self.render_config_template(
amqp_ports=[5672],
)
self.run_packetbeat(pcap="amqp_emit_receive.pcap",
debug_selectors=["amqp,tcp,publish"])
o... | gpl-3.0 |
jpenney/pdar | pdar/archive.py | 1 | 10151 | # This file is part of pdar.
#
# Copyright 2011 Jason Penney
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
IMIO/django-fixmystreet | django_fixmystreet/fixmystreet/feeds.py | 1 | 2830 | from django.contrib.syndication.views import Feed
from django.contrib.syndication.views import FeedDoesNotExist
from django.core.exceptions import ObjectDoesNotExist
from django_fixmystreet.fixmystreet.models import Report
class LatestReports(Feed):
title = "All FixMyStreet Reports"
link = "/reports/"
des... | agpl-3.0 |
3dfxsoftware/cbss-addons | ir_actions_report_xml_multicompany/model/__init__.py | 1 | 1267 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) Vauxoo (<http://vauxoo.com>).
# All Rights Reserved
###############Credits#########################################... | gpl-2.0 |
navrasio/mxnet | example/gluon/embedding_learning/data.py | 30 | 6391 | # 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 u... | apache-2.0 |
hale36/SRTV | sickbeard/scheduler.py | 12 | 4632 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.tv
# Git: https://github.com/SiCKRAGETV/SickRage.git
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | gpl-3.0 |
un33k/CouchPotatoServer | libs/ndg/httpsclient/utils.py | 71 | 15736 | """Utilities using NDG HTTPS Client, including a main module that can be used to
fetch from a URL.
"""
__author__ = "R B Wilkinson"
__date__ = "09/12/11"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.... | gpl-3.0 |
mavit/ansible | test/sanity/yamllint/yamllinter.py | 39 | 5698 | #!/usr/bin/env python
"""Wrapper around yamllint that supports YAML embedded in Ansible modules."""
from __future__ import absolute_import, print_function
import ast
import json
import os
import sys
from yamllint import linter
from yamllint.config import YamlLintConfig
def main():
"""Main program body."""
... | gpl-3.0 |
MapLarge/flat-file-feeds | feed_def_reader.py | 1 | 1420 | """
Module: feed_def_reader
Description: Reads in fed def file and controls the feed construction process
Authored by: MapLarge, Inc. (Scott Rowles)
Change Log:
"""
"""
Define all the imports for the feed_def_reader module
"""
import json
import sys
from website_feed_constructor import WebsiteFeedConstructor
from d... | mit |
waseem18/oh-mainline | vendor/packages/python-social-auth/social/pipeline/utils.py | 76 | 2057 | import six
SERIALIZABLE_TYPES = (dict, list, tuple, set, bool, type(None)) + \
six.integer_types + six.string_types + \
(six.text_type, six.binary_type,)
def partial_to_session(strategy, next, backend, request=None, *args, **kwargs):
user = kwargs.get('user')
social... | agpl-3.0 |
brunotougeiro/python | venv/Lib/encodings/idna.py | 215 | 9170 | # This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep)
import stringprep, re, codecs
from unicodedata import ucd_3_2_0 as unicodedata
# IDNA section 3.1
dots = re.compile("[\u002E\u3002\uFF0E\uFF61]")
# IDNA section 5
ace_prefix = b"xn--"
sace_prefix = "xn--"
# This assumes query strings, so AllowUnassig... | gpl-2.0 |
LeartS/odoo | addons/l10n_hr/__init__.py | 432 | 1164 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contrib... | agpl-3.0 |
timvideos/flumotion | flumotion/service/main.py | 3 | 3576 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | lgpl-2.1 |
efiring/scipy | scipy/fftpack/realtransforms.py | 5 | 14362 | """
Real spectrum tranforms (DCT, DST, MDCT)
"""
from __future__ import division, print_function, absolute_import
__all__ = ['dct', 'idct', 'dst', 'idst']
import numpy as np
from scipy.fftpack import _fftpack
from scipy.fftpack.basic import _datacopied
import atexit
atexit.register(_fftpack.destroy_ddct1_cache)
ate... | bsd-3-clause |
earthreader/libearth-dropbox | libearth_dropbox/__init__.py | 1 | 4610 | import os
from contextlib import closing
from StringIO import StringIO
try:
from urllib import parse as urlparse
except ImportError:
import urlparse
import dropbox
from libearth.repository import (FileNotFoundError, NotADirectoryError,
Repository, RepositoryKeyError)
__all__ =... | gpl-2.0 |
ampax/edx-platform | common/lib/capa/capa/inputtypes.py | 20 | 64985 | #
# File: courseware/capa/inputtypes.py
#
"""
Module containing the problem elements which render into input objects
- textline
- textbox (aka codeinput)
- schematic
- choicegroup (aka radiogroup, checkboxgroup)
- javascriptinput
- imageinput (for clickable image)
- optioninput (for option list)
- filesubmission (... | agpl-3.0 |
Plantain/sms-mailinglist | lib/googlecloudapis/bigquery/v2/bigquery_v2_messages.py | 5 | 57651 | """Generated message classes for bigquery version v2.
A data platform for customers to create, manage, share and query data.
"""
from protorpc import messages
from googlecloudapis.apitools.base.py import encoding
from googlecloudapis.apitools.base.py import extra_types
package = 'bigquery'
class BigqueryDatasets... | apache-2.0 |
ShineFan/odoo | openerp/tools/view_validation.py | 367 | 2303 | """ View validation code (using assertions, not the RNG schema). """
import logging
_logger = logging.getLogger(__name__)
def valid_page_in_book(arch):
"""A `page` node must be below a `book` node."""
return not arch.xpath('//page[not(ancestor::notebook)]')
def valid_field_in_graph(arch):
""" Children... | agpl-3.0 |
behzadnouri/scipy | scipy/optimize/tests/test_nonlin.py | 41 | 15160 | """ Unit tests for nonlinear solvers
Author: Ondrej Certik
May 2007
"""
from __future__ import division, print_function, absolute_import
from numpy.testing import assert_, dec, TestCase, run_module_suite
from scipy._lib.six import xrange
from scipy.optimize import nonlin, root
from numpy import matrix, diag, dot
from... | bsd-3-clause |
pistoolero/KFSE-Training-Service | application/vendor/guzzle/guzzle/docs/conf.py | 469 | 3047 | import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
primary_domain = 'php'
# -- General configuration -----------------------------------------------------... | mit |
credativUK/account-financial-tools | account_credit_control_dunning_fees/model/dunning.py | 31 | 4221 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 |
pieiscool/edited-hearthbreaker | hearthbreaker/proxies.py | 2 | 3242 | import hearthbreaker.game_objects
class ProxyCharacter:
def __init__(self, character_ref):
if type(character_ref) is str:
if character_ref.find(":") > -1:
[self.player_ref, self.minion_ref] = character_ref.split(':')
self.minion_ref = int(self.minion_ref)
... | mit |
bmmalone/pymisc-utils | pyllars/suppress_stdout_stderr.py | 1 | 1295 | import os
class suppress_stdout_stderr(object):
'''
A context manager for doing a "deep suppression" of stdout and stderr in
Python, i.e. will suppress all print, even if the print originates in a
compiled C/Fortran sub-function.
This will not suppress raised exceptions, since exceptions are p... | mit |
soapy/soapy | soapy/pyqtgraph/functions.py | 6 | 88378 | # -*- coding: utf-8 -*-
"""
functions.py - Miscellaneous functions with no other home
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
from __future__ import division
import warnings
import numpy as np
import decimal, re
import ctypes
import sys, struct
from ... | gpl-3.0 |
eugena/django | tests/servers/test_basehttp.py | 213 | 3129 | from io import BytesIO
from django.core.handlers.wsgi import WSGIRequest
from django.core.servers.basehttp import WSGIRequestHandler
from django.test import SimpleTestCase
from django.test.client import RequestFactory
from django.test.utils import captured_stderr
class Stub(object):
def __init__(self, **kwargs):... | bsd-3-clause |
mxOBS/deb-pkg_trusty_chromium-browser | mojo/public/third_party/jinja2/_stringdefs.py | 990 | 404291 | # -*- coding: utf-8 -*-
"""
jinja2._stringdefs
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project, original
implementation from Pygments.
:co... | bsd-3-clause |
sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/nose/plugins/attrib.py | 92 | 9660 | """Attribute selector plugin.
Oftentimes when testing you will want to select tests based on
criteria rather then simply by filename. For example, you might want
to run all tests except for the slow ones. You can do this with the
Attribute selector plugin by setting attributes on your test methods.
Here is an example:... | bsd-3-clause |
gchiii/am3517_evm-linux | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
muntasirsyed/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_renames.py | 326 | 2218 | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
re... | apache-2.0 |
SNAPPETITE/backend | flask/lib/python2.7/site-packages/sqlalchemy/engine/threadlocal.py | 55 | 4191 | # engine/threadlocal.py
# Copyright (C) 2005-2016 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
"""Provides a thread-local transactional wrapper around the root Engine class.... | mit |
tarc/gyp | test/mac/gyptest-xcode-env-order.py | 34 | 3368 | #!/usr/bin/env python
# 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.
"""
Verifies that dependent Xcode settings are processed correctly.
"""
import TestGyp
import TestMac
import subprocess
import sys
if sys... | bsd-3-clause |
uruz/django-rest-framework | tests/conftest.py | 84 | 1809 | def pytest_configure():
from django.conf import settings
settings.configure(
DEBUG_PROPAGATE_EXCEPTIONS=True,
DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'}},
SITE_ID=1,
SECRET_KEY='not very secret in tests',
... | bsd-2-clause |
danmcp/origin | vendor/github.com/google/certificate-transparency/python/utilities/log_list/cpp_generator.py | 17 | 3757 | import datetime
import base64
import hashlib
import math
def _write_cpp_header(f, include_guard):
year = datetime.date.today().year
f.write((
"// Copyright %(year)d The Chromium Authors. All rights reserved.\n"
"// Use of this source code is governed by a BSD-style license"
" that can b... | apache-2.0 |
johankaito/fufuka | microblog/flask/venv/lib/python2.7/site-packages/scipy/weave/tests/test_blitz_tools.py | 91 | 7141 | from __future__ import absolute_import, print_function
import time
import parser
import warnings
from numpy import (float32, float64, complex64, complex128,
zeros, random, array)
from numpy.testing import (TestCase, assert_equal,
assert_allclose, run_module_suite)
from ... | apache-2.0 |
jballanc/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/webclient_utils.py | 3 | 1880 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2011 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# 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 Fou... | gpl-2.0 |
georgemarshall/django | tests/template_tests/filter_tests/test_addslashes.py | 48 | 1203 | from django.template.defaultfilters import addslashes
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class AddslashesTests(SimpleTestCase):
@setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'})
... | bsd-3-clause |
DanielMe/papenburg-presentation | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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 easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
programadorjc/django | tests/select_related_onetoone/models.py | 274 | 2483 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(models.Model):
username = models.CharField(max_length=100)
email = models.EmailField()
def __str__(self):
return self.username
@python_2_unicode_compatible
class Us... | bsd-3-clause |
yamada-h/ryu | ryu/tests/unit/lib/test_stringify.py | 23 | 2008 | #!/usr/bin/env python
#
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.