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 |
|---|---|---|---|---|---|
dirtycoder/opbeat_python | tests/contrib/flask/flask_tests.py | 2 | 4558 | from flask import Flask
from django.test import TestCase
from opbeat.contrib.flask import Opbeat
from tests.helpers import get_tempstoreclient
def create_app():
app = Flask(__name__)
@app.route('/an-error/', methods=['GET', 'POST'])
def an_error():
raise ValueError('hello world')
return ... | bsd-3-clause |
PyCQA/pylint | tests/functional/p/postponed_evaluation_pep585_error.py | 2 | 3904 | """Test PEP 585 without postponed evaluation. Everything should fail.
This check requires Python 3.7 or Python 3.8!
Testing with 3.8 only, to support TypedDict.
"""
# pylint: disable=missing-docstring,unused-argument,unused-import,too-few-public-methods,invalid-name,inherit-non-class,unsupported-binary-operation,unuse... | gpl-2.0 |
stefanfoulis/django-filer-test | filer/models/filer_file_storage.py | 2 | 1383 | from django.core.files.storage import FileSystemStorage
from django.utils.text import get_valid_filename as get_valid_filename_django
from django.template.defaultfilters import slugify
from django.utils.encoding import force_unicode, smart_str
import os
import datetime
from filer.settings import FILER_PUBLICMEDIA_PREFI... | mit |
MechanisM/musicdb | musicdb/common/management/commands/initial_import_fixups.py | 1 | 3570 | from django.core.management.base import NoArgsCommand
from musicdb.classical.models import *
class Command(NoArgsCommand):
def handle_noargs(self, **options):
work_pairs = (
('felix-mendelssohn', ('string-quartet-in-e-flat', 'string-quartet-in-e-flat-1')),
('ludvig-van-beethoven',... | agpl-3.0 |
lgiordani/punch | tests/script/test_complex_serializers.py | 1 | 2035 | import pytest
pytestmark = pytest.mark.slow
version_file_content = """
major = 1
minor = 0
patch = 0
"""
config_file_content = """
__config_version__ = 1
GLOBALS = {
'serializer': {
'semver': {
'search': 'Next Release',
'replace': '{{major}}.{{minor}}.{{patch}}'
}
},
... | isc |
michaelBenin/sqlalchemy | lib/sqlalchemy/sql/naming.py | 1 | 5728 | # sqlalchemy/naming.py
# Copyright (C) 2005-2014 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
"""Establish constraint and index naming conventions.
"""
from .schema import ... | mit |
nsnam/ns-3-dev-git | bindings/python/ns3modulegen_core_customizations.py | 7 | 19495 | from __future__ import print_function
import sys
import re
from pybindgen.typehandlers import base as typehandlers
from pybindgen import ReturnValue, Parameter
from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper
from pybindgen.typehandlers.codesink import MemoryCodeSink
from pybindgen.t... | gpl-2.0 |
janocat/odoo | addons/l10n_ma/__init__.py | 430 | 1071 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
ojengwa/grr | client/comms.py | 2 | 43816 | #!/usr/bin/env python
"""This class handles the GRR Client Communication.
Tests are in lib/communicator_test.py
"""
import hashlib
import os
import pdb
import posixpath
import Queue
import sys
import threading
import time
import traceback
import urllib2
from M2Crypto import BIO
from M2Crypto import EVP
from M2Cr... | apache-2.0 |
fanglinfang/myuw | myuw/migrations/0002_auto__add_unique_usernotices_notice_hash_user__add_field_categorylinks.py | 1 | 6154 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Eh, I'm not so worried about tracking user notices that this is a problem
db.clear_table(u'myuw_mobile_use... | apache-2.0 |
bpshetty/erpnext | erpnext/patches/v5_8/tax_rule.py | 65 | 1087 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("accounts", "doctype", "tax_rule")
customers = frappe.db.sql("""select name, default_taxes_and_cha... | gpl-3.0 |
apanju/GMIO_Odoo | addons/mrp/report/__init__.py | 378 | 1122 | # -*- 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 |
jspraul/bite-project | deps/gdata-python-client/src/gdata/health/__init__.py | 263 | 7090 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
jainaman224/zenodo | tests/unit/records/test_records_templates.py | 8 | 2697 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo 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 v... | gpl-2.0 |
jn2840/bitcoin | share/qt/extract_strings_qt.py | 1 | 1875 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' for... | mit |
anthonyfok/frescobaldi | frescobaldi_app/logtool/__init__.py | 1 | 3820 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | gpl-2.0 |
grnet/synnefo | snf-astakos-app/astakos/im/migrations/old/0057_auto__del_field_resource_allow_in_projects__add_field_resource_ui_visi.py | 10 | 25856 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_column('im_resource', 'allow_in_projects', 'ui_visible')
# Adding field 'Resource.api_visible'
... | gpl-3.0 |
joshgeller/PyPardot | pypardot/objects/opportunities.py | 1 | 3806 | class Opportunities(object):
"""
A class to query and use Pardot opportunities.
Opportunity field reference: http://developer.pardot.com/kb/api-version-3/object-field-references/#opportunity
"""
def __init__(self, client):
self.client = client
def query(self, **kwargs):
"""
... | mit |
dmsimard/ansible | lib/ansible/plugins/lookup/first_found.py | 1 | 7109 | # (c) 2013, seth vidal <skvidal@fedoraproject.org> red hat, inc
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
name: first_found
a... | gpl-3.0 |
chrys87/orca-beep | src/orca/speechdispatcherfactory.py | 1 | 20607 | # Copyright 2006, 2007, 2008, 2009 Brailcom, o.p.s.
#
# Author: Tomas Cerha <cerha@brailcom.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or ... | lgpl-2.1 |
ecd/xhtml2pdf | xhtml2pdf/paragraph2.py | 52 | 26820 | #!/bin/env/python
# -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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
#
# U... | apache-2.0 |
CantemoInternal/django-rest-swagger | tests/cigar_example/cigar_example/restapi/urls.py | 19 | 1313 | from django.conf.urls import patterns, url
from rest_framework.routers import DefaultRouter
from cigar_example.restapi import views as views
router = DefaultRouter()
router.register(r'cigars', views.CigarViewSet)
router.register(r'artisan_cigars', views.ArtisanCigarViewSet)
urlpatterns = patterns(
'',
# Exa... | bsd-2-clause |
andres-root/bitcoinxt | qa/rpc-tests/test_framework/mininode.py | 126 | 36289 | # mininode.py - Bitcoin P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.c... | mit |
cleett/plyer | plyer/platforms/android/gps.py | 3 | 2608 | '''
Android GPS
-----------
'''
from plyer.facades import GPS
from plyer.platforms.android import activity
from jnius import autoclass, java_method, PythonJavaClass
Looper = autoclass('android.os.Looper')
LocationManager = autoclass('android.location.LocationManager')
Context = autoclass('android.content.Context')
... | mit |
mrares/incubator-airflow | airflow/contrib/operators/ssh_operator.py | 6 | 4238 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
vertelab/odoo-smart | project_gtd/__init__.py | 6 | 1130 | # -*- 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 |
cvium/Flexget | flexget/plugins/modify/path_select.py | 13 | 4423 | from __future__ import unicode_literals, division, absolute_import
import logging
import os
import random
from collections import namedtuple
from flexget import plugin
from flexget.event import event
from flexget.config_schema import parse_size, parse_percent
from flexget.config_schema import one_or_more
log = loggin... | mit |
mattesno1/Sick-Beard | lib/sqlalchemy/dialects/maxdb/base.py | 15 | 42802 | # maxdb/base.py
# Copyright (C) 2005-2012 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
"""Support for the MaxDB database.
This dialect is *not* ported to SQLAlchemy 0.6 or 0.... | gpl-3.0 |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/labeled_tensor/python/ops/io_ops.py | 172 | 6373 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
LaoZhongGu/kbengine | kbe/res/scripts/common/Lib/plat-aix4/IN.py | 108 | 3622 | # Generated by h2py from /usr/include/netinet/in.h
# Included from net/nh.h
# Included from sys/machine.h
LITTLE_ENDIAN = 1234
BIG_ENDIAN = 4321
PDP_ENDIAN = 3412
BYTE_ORDER = BIG_ENDIAN
DEFAULT_GPR = 0xDEADBEEF
MSR_EE = 0x8000
MSR_PR = 0x4000
MSR_FP = 0x2000
MSR_ME = 0x1000
MSR_FE = 0x0800
MSR_FE0 = 0x0800
MSR_SE = ... | lgpl-3.0 |
teto/ns-3-dev-git | doc/tutorial/source/conf.py | 1 | 7057 | # -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 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.
#
# All co... | gpl-2.0 |
kemalakyol48/python-for-android | python3-alpha/extra_modules/gdata/apps/migration/__init__.py | 119 | 8582 | #!/usr/bin/python2.4
#
# Copyright 2008 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 require... | apache-2.0 |
alisidd/tensorflow | tensorflow/contrib/keras/python/keras/layers/pooling_test.py | 24 | 6087 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
mwmuni/LIGGGHTS_GUI | OpenGL/platform/glx.py | 9 | 3820 | """GLX (x-windows)-specific platform features"""
import ctypes, ctypes.util
from functools import wraps
from OpenGL.platform import baseplatform, ctypesloader
class GLXPlatform( baseplatform.BasePlatform ):
"""Posix (Linux, FreeBSD, etceteras) implementation for PyOpenGL"""
# On Linux (and, I assume, most GLX ... | gpl-3.0 |
madhurrajn/samashthi | lib/django/contrib/messages/storage/session.py | 478 | 1714 | import json
from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import (
MessageDecoder, MessageEncoder,
)
from django.utils import six
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
... | bsd-3-clause |
shawnwanderson/cmput404-project | venv/lib/python2.7/site-packages/django/contrib/gis/gdal/raster/band.py | 308 | 5382 | from ctypes import byref, c_int
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis.shortcuts import numpy
from django.utils import six
from django.utils.encoding import force_tex... | gpl-3.0 |
jigarkb/Programming | LeetCode/037-H-SudokuSolver.py | 2 | 2012 | # Write a program to solve a Sudoku puzzle by filling the empty cells.
#
# Empty cells are indicated by the character '.'.
#
# You may assume that there will be only one unique solution.
class Solution(object):
def solveSudoku(self, board):
"""
:type board: List[List[str]]
:rtype: void Do ... | mit |
benschmaus/catapult | dashboard/dashboard/benchmark_health_report_test.py | 2 | 5261 | # Copyright 2017 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 datetime
import unittest
import webapp2
import webtest
from google.appengine.ext import ndb
from dashboard import benchmark_health_report
from dash... | bsd-3-clause |
sestrella/ansible | lib/ansible/modules/packaging/os/apk.py | 13 | 11168 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Kevin Brebanov <https://github.com/kbrebanov>
# Based on pacman (Afterburn <https://github.com/afterburn>, Aaron Bull Schaefer <aaron@elasticdog.com>)
# and apt (Matthew Williams <matthew@flowroute.com>) modules.
#
# GNU General Public License v3.0+ (see COPYING or... | gpl-3.0 |
ZacariasBendeck/youtube-dl | youtube_dl/extractor/telebruxelles.py | 150 | 2352 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TeleBruxellesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?telebruxelles\.be/(news|sport|dernier-jt)/?(?P<id>[^/#?]+)'
_TESTS = [{
'url': 'http://www.telebruxelles.be/news/auditions-devant-parlement... | unlicense |
super3/PyDev | Books/source/catanimation.py | 7 | 1034 | import pygame, sys
from pygame.locals import *
pygame.init()
FPS = 30 # frames per second setting
fpsClock = pygame.time.Clock()
# set up the window
DISPLAYSURF = pygame.display.set_mode((400, 300), 0, 32)
pygame.display.set_caption('Animation')
WHITE = (255, 255, 255)
catImg = pygame.image.load('cat.png')
catx = 1... | mit |
bakhtout/odoo-educ | openerp/modules/graph.py | 260 | 7763 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
0x0mar/phpsploit | deps/SocksiPy-branch-1.02/socks.py | 65 | 16177 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. 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
... | gpl-3.0 |
amith01994/intellij-community | python/testData/inspections/PyCompatibilityInspection/argumentsUnpackingGeneralizations.py | 33 | 1128 | def foo(*args, **kwargs):
print(args, kwargs)
foo(0,
*[1],
<warning descr="Python versions < 3.5 do not allow positional arguments after *expression">2</warning>,
<warning descr="Python versions < 3.5 do not allow duplicate *expressions">*[3]</warning>,
<warning descr="Python versions < 3.5 do not... | apache-2.0 |
opcode0x90/pyew | vstruct/defs/windows/win_6_1_i386/win32k.py | 18 | 198521 | # Version: 6.1
# Architecture: i386
import vstruct
from vstruct.primitives import *
ETW_THREAD_FLAG = v_enum()
ETW_THREAD_FLAG.ETW_THREAD_FLAG_HAD_INPUT = 0
ETW_THREAD_FLAG.ETW_THREAD_FLAG_HAD_VISIBLE_WINDOWS = 1
ETW_THREAD_FLAG.ETW_THREAD_FLAG_HAS_NEW_INPUT = 2
ETW_THREAD_FLAG.ETW_THREAD_FLAG_MAX = 3
TO... | gpl-2.0 |
enthought/pikos | pikos/recorders/abstract_recorder.py | 1 | 1322 | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Package: Pikos toolkit
# File: recorders/abstract_recorder.py
# License: LICENSE.TXT
#
# Copyright (c) 2012, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------... | bsd-3-clause |
MungoRae/home-assistant | homeassistant/components/sensor/comfoconnect.py | 7 | 4183 | """
Platform to control a Zehnder ComfoAir Q350/450/600 ventilation unit.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor.comfoconnect/
"""
import logging
from homeassistant.components.comfoconnect import (
DOMAIN, ComfoConnectBridge, ATTR_CU... | apache-2.0 |
mpetyx/pychatbot | SemanticWebApproach/RoboWriter/allegrordf-1.0.1/franz/miniclient/request.py | 1 | 6234 | import StringIO, pycurl, urllib, cjson, locale
from threading import Lock
class Pool:
def __init__(self, create):
self.create = create
self.lock = Lock()
self.pool = []
def get(self):
self.lock.acquire()
try:
if len(self.pool): return self.pool.pop()
... | apache-2.0 |
aubreystarktoller/django-babik-card-primitives | setup.py | 1 | 1665 | import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def fi... | bsd-3-clause |
simonkrogmann/planets | gui/object_3D.py | 1 | 4105 | # -*- coding: cp1252 -*-
import vector
import time
class Planet3D:
"""ein 3D-Objekt für das graphics-Modul, dass mit einem Planeten verbunden ist"""
def __init__(self, Parent, Planet):
self.Parent = Parent
self.Planet = Planet
self.Planet.Register(self)
self.Positions = [Planet[... | mit |
Novasoft-India/OperERP-AM-Motors | openerp/tools/sql.py | 455 | 1173 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
sebastien-j/gensim | gensim/corpora/mmcorpus.py | 85 | 1588 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Corpus in the Matrix Market format.
"""
import logging
from gensim import interfaces, matutils
from gensim.corpora import Indexe... | gpl-3.0 |
allenlavoie/tensorflow | tensorflow/python/kernel_tests/sparse_reorder_op_test.py | 94 | 5261 | # 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 |
nfedera/rg3-youtube-dl | youtube_dl/extractor/googleplus.py | 38 | 2568 | # coding: utf-8
from __future__ import unicode_literals
import re
import codecs
from .common import InfoExtractor
from ..utils import unified_strdate
class GooglePlusIE(InfoExtractor):
IE_DESC = 'Google Plus'
_VALID_URL = r'https://plus\.google\.com/(?:[^/]+/)*?posts/(?P<id>\w+)'
IE_NAME = 'plus.google'... | unlicense |
pombredanne/teamwork | exts/w2/static/Brython2.0.0-20140209-164925/Lib/sys.py | 92 | 3227 | # hack to return special attributes
from _sys import *
from javascript import JSObject
has_local_storage=__BRYTHON__.has_local_storage
has_json=__BRYTHON__.has_json
argv = ['__main__']
base_exec_prefix = __BRYTHON__.brython_path
base_prefix = __BRYTHON__.brython_path
builtin_module_names=__BRYTHON__.builtin_module... | gpl-2.0 |
Fireblend/chromium-crosswalk | chrome/common/extensions/docs/server2/host_file_system_provider.py | 16 | 4861 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from caching_file_system import CachingFileSystem
from gitiles_file_system import GitilesFileSystem
from local_file_system import LocalFileSystem
from offlin... | bsd-3-clause |
cs564/heron | third_party/setuptools/pkg_resources.py | 11 | 101160 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | apache-2.0 |
shsingh/ansible | lib/ansible/module_utils/common/removed.py | 38 | 2146 | # Copyright (c) 2018, Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import sys
from ansible.module_utils._tex... | gpl-3.0 |
Awesomeomics/webserver | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
garg10may/youtube-dl | youtube_dl/extractor/vbox7.py | 92 | 2298 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
ExtractorError,
)
class Vbox7IE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?vbox7\.com/play:(... | unlicense |
wbc2010/django1.2.5 | django/db/backends/dummy/base.py | 64 | 1511 | """
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import *
from django.db.back... | bsd-3-clause |
Ca1ne/Enoch316 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
Aloomaio/googleads-python-lib | examples/ad_manager/v201805/product_package_item_service/get_product_package_items_for_product_package.py | 1 | 2302 | #!/usr/bin/env python
#
# Copyright 2016 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 requir... | apache-2.0 |
gmatteo/pymatgen | pymatgen/io/gaussian.py | 2 | 59623 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module implements input and output processing from Gaussian.
"""
import re
import warnings
import numpy as np
import scipy.constants as cst
from monty.io import zopen
from pymatgen.core.composition ... | mit |
orbitfp7/nova | nova/cmd/conductor.py | 2 | 1558 | # Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
tripathi62674/flask | docs/conf.py | 140 | 9573 | # -*- coding: utf-8 -*-
#
# Flask documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 6 15:24:58 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.
#
# All c... | bsd-3-clause |
jobsafran/mediadrop | mediadrop/controllers/media.py | 9 | 15969 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
janocat/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py | 384 | 3903 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
sgraham/nope | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/html.py | 64 | 10721 | """HTML reporting for Coverage."""
import os, re, shutil
import coverage
from coverage.backward import pickle, write_encoded
from coverage.misc import CoverageException, Hasher
from coverage.phystokens import source_token_lines
from coverage.report import Reporter
from coverage.templite import Templite
# Disable pyl... | bsd-3-clause |
baidu/palo | build-support/run_clang_format.py | 2 | 5703 | #!/usr/bin/env python
# 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
# "Li... | apache-2.0 |
dhenrygithub/QGIS | python/plugins/processing/gui/ContextAction.py | 6 | 1440 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ContextAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 |
AladdinSonni/youtube-dl | youtube_dl/extractor/veoh.py | 128 | 4851 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
int_or_none,
ExtractorError,
)
class VeohIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?veoh\.com/(?:watch|iphone/#_Watch)/(?P<id>... | unlicense |
etzhou/edx-platform | lms/djangoapps/branding/migrations/0002_auto__add_brandingapiconfig.py | 84 | 5295 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'BrandingApiConfig'
db.create_table('branding_brandingapic... | agpl-3.0 |
smithfarm/s3-tests | s3tests/functional/test_s3.py | 1 | 203153 | from cStringIO import StringIO
import boto.exception
import boto.s3.connection
import boto.s3.acl
import bunch
import datetime
import time
import email.utils
import isodate
import nose
import operator
import socket
import ssl
import os
import requests
import base64
import hmac
import sha
import pytz
import json
import ... | mit |
pachterlab/kma | inst/pre-process/tests/test_intron_ops.py | 1 | 19345 | # intron ops
# Copyright (C) 2015 Harold Pimentel
#
# 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 is ... | gpl-2.0 |
ar7z1/ansible | lib/ansible/modules/cloud/openstack/os_subnets_facts.py | 24 | 4467 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
tisnik/fabric8-analytics-common | dashboard/src/jacoco_to_codecov.py | 1 | 4579 | """Module to convert JaCoCo coverage report into the report compatible with Pycov utility."""
import csv
def format_coverage_line(text, statements, missed, coverage, missed_lines=False):
"""Format one line with code coverage report of one class or for a summary."""
format_string = "{:80} {:3d} {:3d} {:3... | apache-2.0 |
fladi/sorl-thumbnail | tests/runtests.py | 1 | 1833 | #!/usr/bin/env python
from __future__ import unicode_literals
import os
import sys
from os.path import abspath, dirname, join as pjoin
import django
from django.conf import settings
def runtests(verbosity=1, interactive=True, failfast=True, settings_module='settings.default'):
here = abspath(dirname(__file__))
... | bsd-3-clause |
Fireblend/chromium-crosswalk | build/android/pylib/instrumentation/instrumentation_parser_test.py | 79 | 4061 | #!/usr/bin/env python
# Copyright 2015 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.
"""Unit tests for instrumentation.InstrumentationParser."""
import unittest
from pylib.instrumentation import instrumentation_parser... | bsd-3-clause |
benthomasson/ansible | lib/ansible/modules/network/cloudengine/ce_bfd_view.py | 7 | 20499 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
dimara/ganeti | lib/outils.py | 10 | 5229 | #
#
# Copyright (C) 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... | bsd-2-clause |
cesarmarinhorj/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/png_unittest.py | 124 | 5663 | # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
#
# 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 lis... | bsd-3-clause |
huiyiqun/check_mk | cmk_base/core.py | 1 | 9266 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 |
keithlee/shakeAppPyDev | django/http/multipartparser.py | 87 | 22774 | """
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
import cgi
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils.datastructures import MultiValueDict
fro... | bsd-3-clause |
pfalcon/picotui | picotui/editorext.py | 1 | 5118 | #
# Extended VT100 terminal text editor, etc. widgets
# Copyright (c) 2015 Paul Sokolovsky
# Distributed under MIT License
#
import sys
import os
from .editor import *
# Edit single line, quit on Enter/Esc
class LineEditor(Editor):
def handle_cursor_keys(self, key):
if super().handle_cursor_keys(key):
... | mit |
edespino/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/crash/test_failover_recovery_mode.py | 7 | 8700 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | apache-2.0 |
jfisher-usgs/DigitalLibrary | files/form_addFolder.py | 1 | 1306 | ## Script (Python) "form_addFolder"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = container.REQUEST
REQUEST = context.REQUEST
publicStatus = ''
if not context.anonymousHasPermission(context):
publicStat... | gpl-2.0 |
balister/gnuradio | gr-blocks/python/blocks/qa_tag_gate.py | 39 | 1480 | #!/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 |
willingc/pythondotorg | jobs/migrations/0001_initial.py | 10 | 6301 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import markupfield.fields
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | apache-2.0 |
anthropo-lab/XP | EPHEMER/insider_trading_project/insider_trading/consumers.py | 1 | 7993 | from channels import Group as channelsGroup
from channels.sessions import channel_session
import random
from .models import Group as OtreeGroup, Subsession as OtreeSubsession, Constants
import json
import channels
import logging
from otree import constants_internal
import django.test
from otree.common_internal import ... | gpl-3.0 |
PulsePod/evepod | lib/python2.7/site-packages/pip/vcs/git.py | 473 | 7898 | import tempfile
import re
import os.path
from pip.util import call_subprocess
from pip.util import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.log import logger
from pip.backwardcompat import url2pathname, urlparse
urlsplit = urlparse.urlsplit
urlunsplit = urlparse.urlunsplit
class Git(Versi... | apache-2.0 |
lordeko/android_kernel_samsung_hlte | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
icarito/sugar | src/jarabe/journal/listmodel.py | 1 | 10564 | # Copyright (C) 2009, Tomeu Vizoso
#
# 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 distributed in ... | gpl-3.0 |
40223101/2015cda_g1 | static/Brython3.1.1-20150328-091302/Lib/subprocess.py | 728 | 67282 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""subprocess - Subpr... | gpl-3.0 |
geodrinx/gearthview | ext-libs/twisted/python/test/test_fakepwd.py | 43 | 14092 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.fakepwd}.
"""
try:
import pwd
except ImportError:
pwd = None
try:
import spwd
except ImportError:
spwd = None
import os
from operator import getitem
from twisted.trial.unittest import TestCase
fro... | gpl-3.0 |
Schibum/sndlatr | gae/babel/messages/plurals.py | 151 | 6696 | # -*- coding: utf-8 -*-
"""
babel.messages.plurals
~~~~~~~~~~~~~~~~~~~~~~
Plural form definitions.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from babel.core import default_locale, Locale
from operator import itemgetter
# XXX: remove this file, dupl... | apache-2.0 |
slagle/ansible-modules-extras | packaging/dpkg_selections.py | 88 | 2405 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 |
MuffinMedic/znc-weblog | weblog.py | 1 | 5161 | import znc
import os
def is_safe_path(basedir, path):
return os.path.abspath(path).startswith(basedir)
class weblog(znc.Module):
module_types = [znc.CModInfo.GlobalModule]
description = "Allowings viewing of log files from the ZNC webadmin"
wiki_page = "Weblog"
def OnLoad(self, args, message):
... | gpl-3.0 |
hforge/itools | test/test_html.py | 3 | 16999 | # -*- coding: UTF-8 -*-
# Copyright (C) 2004, 2006-2010 J. David Ibáñez <jdavid.ibp@gmail.com>
# Copyright (C) 2006 Hervé Cauwelier <herve@oursours.net>
# Copyright (C) 2008 David Versmisse <versmisse@lil.univ-littoral.fr>
# Copyright (C) 2008 Romain Gauthier <romain.gauthier@itaapy.com>
# Copyright (C) 2008 Sylvain Ta... | gpl-3.0 |
40123148/w17b | static/Brython3.1.3-20150514-095342/Lib/test/regrtest.py | 718 | 65317 | #! /usr/bin/python3.3
"""
Usage:
python -m test [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
If no arguments or options are provided, finds all files matching
the pattern "test_*" in the Lib/test subdirectory and runs
them in alphabetical order ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.