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 |
|---|---|---|---|---|---|
mancoast/CPythonPyc_test | cpython/220_test_grammar.py | 4 | 16767 | # Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
from test_support import *
import sys
print '1. Parser'
print '1.1 Tokens'
print '1.1.1 Backslashes'
# Backslash means line continuation:
x = 1 \
+ 1
if x != 2: raise TestFailed, 'backslash for line continuation'
# Backsl... | gpl-3.0 |
kalahbrown/HueBigSQL | desktop/core/ext-py/kazoo-2.0/kazoo/protocol/states.py | 50 | 6304 | """Kazoo State and Event objects"""
from collections import namedtuple
class KazooState(object):
"""High level connection state values
States inspired by Netflix Curator.
.. attribute:: SUSPENDED
The connection has been lost but may be recovered. We should
operate in a "safe mode" until... | apache-2.0 |
leorochael/odoo | addons/auth_oauth/res_config.py | 23 | 3436 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
rekbun/browserscope | categories/reflow/test_set.py | 9 | 8336 | #!/usr/bin/python2.5
# -*- coding: utf-8 -*-
#
# Copyright 2009 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 requir... | apache-2.0 |
mitar/django | django/contrib/gis/db/models/manager.py | 505 | 3578 | from django.db.models.manager import Manager
from django.contrib.gis.db.models.query import GeoQuerySet
class GeoManager(Manager):
"Overrides Manager to return Geographic QuerySets."
# This manager should be used for queries on related fields
# so that geometry columns on Oracle and MySQL are selected
... | bsd-3-clause |
js0701/chromium-crosswalk | tools/telemetry/telemetry/internal/util/webpagereplay.py | 8 | 11593 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Start and stop Web Page Replay."""
import atexit
import logging
import os
import re
import signal
import subprocess
import sys
import tempfile
import url... | bsd-3-clause |
mark-rushakoff/FlackOverstow | grabber.py | 1 | 1835 | #!/usr/bin/env python
__author__ = "Mark Rushakoff"
__license__ = "MIT"
import sys
import urllib2
import re
import StringIO
import gzip
try:
import simplejson as json
except ImportError:
try:
import json
except ImportError:
sys.stderr.write("simplejson or json required for operation. Abo... | mit |
imankulov/sentry | tests/sentry/api/serializers/test_tagvalue.py | 5 | 1234 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.api.serializers import serialize
from sentry.models import EventUser, TagValue
from sentry.testutils import TestCase
class TagValueSerializerTest(TestCase):
def test_with_user(self):
user = self.create_user()
project = se... | bsd-3-clause |
dbravender/raven-python | raven/utils/json.py | 17 | 2664 | """
raven.utils.json
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import codecs
import datetime
import uuid
try:
import simplejson as json
except ImportError:
import... | bsd-3-clause |
ayushgoel/FixGoogleContacts | phonenumbers/data/region_SC.py | 1 | 2109 | """Auto-generated file, do not edit by hand. SC metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_SC = PhoneMetadata(id='SC', country_code=248, international_prefix='0[0-2]',
general_desc=PhoneNumberDesc(national_number_pattern='[24689]\\d{5,6}', possible_number_pa... | mit |
sxlijin/tfs_updater | lib/urllib3/exceptions.py | 374 | 3274 | # urllib3/exceptions.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
## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
... | gpl-3.0 |
ddico/odoo | addons/l10n_hr/__manifest__.py | 1 | 1748 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contributions:
# Tomislav Bošnjaković, Storm Computers d.o.o. :
# - ac... | agpl-3.0 |
TyberiusPrime/nikola | nikola/data/themes/base/messages/messages_ar.py | 6 | 1620 | # -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "",
"(active)": "",
"Also available in:": "أيضا متوفر في:",
"Archive": "الأرشيف",
"Authors": "",
"Categories": "فئات",
"Comments": "التّعليقات",
"LANGUAGE": "العربيّة",
"Languag... | mit |
detiber/ansible | test/units/modules/cloud/openstack/test_os_server.py | 55 | 6456 | import mock
import pytest
import yaml
import inspect
import collections
from ansible.modules.cloud.openstack import os_server
class AnsibleFail(Exception):
pass
class AnsibleExit(Exception):
pass
def params_from_doc(func):
'''This function extracts the docstring from the specified function,
parse... | gpl-3.0 |
amarzavery/AutoRest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/fixtures/acceptancetestsazurespecials/operations/subscription_in_credentials_operations.py | 9 | 12318 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
dlazz/ansible | lib/ansible/modules/system/reboot.py | 2 | 2704 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Nuos/python-docx | tests/opc/test_coreprops.py | 7 | 7910 | # encoding: utf-8
"""
Unit test suite for the docx.opc.coreprops module
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import pytest
from datetime import datetime
from docx.opc.coreprops import CoreProperties
from docx.oxml import parse_xml
class DescribeCoreProper... | mit |
minlexx/pyevemon | esi_client/models/delete_fleets_fleet_id_squads_squad_id_forbidden.py | 1 | 3083 | # coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class DeleteFleetsFleetIdSquadsSquadIdForbidden(object):
"""... | gpl-3.0 |
deshipu/micropython | tests/wipy/time.py | 67 | 2937 | import time
DAYS_PER_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
def is_leap(year):
return (year % 4) == 0
def test():
seconds = 0
wday = 5 # Jan 1, 2000 was a Saturday
for year in range(2000, 2049):
print("Testing %d" % year)
yday = 1
for month in range(1, ... | mit |
rohit21122012/DCASE2013 | runs/2016/dnn2016verylarge/src/sound_event_detection.py | 38 | 6092 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy
def event_detection(feature_data, model_container, hop_length_seconds=0.01, smoothing_window_length_seconds=1.0, decision_threshold=0.0, minimum_event_length=0.1, minimum_event_gap=0.1):
"""Sound event detection
Parameters
----------
feature... | mit |
PrzemyslawUrbanczyk/pu_zadanie1 | fixture/contact.py | 1 | 10214 | import re
from model.contact import Contact
class ContactHelper:
def __init__(self, app):
self.app = app
def return_to_home_page(self):
wd = self.app.wd
wd.find_element_by_link_text("home page").click()
def create(self, contact):
wd = self.app.wd
# init contact ... | apache-2.0 |
Korkki/django | tests/model_fields/test_imagefield.py | 181 | 16062 | from __future__ import unicode_literals
import os
import shutil
from unittest import skipIf
from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from django.core.files.images import ImageFile
from django.test import TestCase
from django.utils._os import upath
try:
from .mode... | bsd-3-clause |
shepdelacreme/ansible | lib/ansible/modules/database/proxysql/proxysql_mysql_users.py | 16 | 16081 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (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 = '''
---
module: proxysql_mysql_users
versi... | gpl-3.0 |
hongliuliao/log_monitor | dependency/googletest/googlemock/test/gmock_output_test.py | 986 | 5999 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
ogrisel/numpy | numpy/polynomial/tests/test_polyutils.py | 9 | 2958 | """Tests for polyutils module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.polyutils as pu
from numpy.testing import *
class TestMisc(TestCase) :
def test_trimseq(self) :
for i in range(5) :
tgt = [1]
res = pu.tr... | bsd-3-clause |
Lab603/PicEncyclopedias | jni-build/jni-build/jni/include/tensorflow/contrib/learn/python/learn/tests/multioutput_test.py | 5 | 1679 | # 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... | mit |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/setuptools/command/setopt.py | 458 | 5080 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import distutils
import os
from setuptools import Command
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, lo... | bsd-3-clause |
RatulGhosh/pybrain | pybrain/rl/explorers/discrete/discretesde.py | 26 | 2189 | __author__ = "Thomas Rueckstiess, ruecksti@in.tum.de"
from pybrain.rl.explorers.discrete.discrete import DiscreteExplorer
from pybrain.rl.learners.valuebased.interface import ActionValueTable, ActionValueNetwork
from copy import deepcopy
from numpy import random, array
class DiscreteStateDependentExplorer(DiscreteE... | bsd-3-clause |
urosgruber/dd-agent | checks.d/mesos_master.py | 5 | 13366 | """Mesos Master check
Collects metrics from mesos master node, only the leader is sending metrics.
"""
# 3rd party
import requests
# project
from checks import AgentCheck, CheckException
class MesosMaster(AgentCheck):
GAUGE = AgentCheck.gauge
MONOTONIC_COUNT = AgentCheck.monotonic_count
SERVICE_CHECK_NA... | bsd-3-clause |
wavefrontHQ/python-client | wavefront_api_client/models/response_container_service_account.py | 1 | 4422 | # coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... | apache-2.0 |
wdv4758h/ZipPy | edu.uci.python.test/regressiontests/test_grammar.py | 1 | 33140 | # Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
#from test.support import run_unittest, check_syntax_error
# Currently test.support cannot be imported
import unittest
#import sys
# testing import *
#from sys import *
class TokenTests(unittest.TestCase):
def testBack... | bsd-3-clause |
chaffra/sympy | sympy/physics/quantum/dagger.py | 116 | 2242 | """Hermitian conjugation."""
from __future__ import print_function, division
from sympy.core import Expr
from sympy.functions.elementary.complexes import adjoint
__all__ = [
'Dagger'
]
class Dagger(adjoint):
"""General Hermitian conjugate operation.
Take the Hermetian conjugate of an argument [1]_. Fo... | bsd-3-clause |
BenHenning/oppia | core/controllers/base_test.py | 11 | 9041 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
awkspace/ansible | lib/ansible/modules/network/panos/panos_restart.py | 11 | 2810 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
tengyifei/grpc | test/core/http/test_server.py | 30 | 2921 | #!/usr/bin/env python2.7
# Copyright 2015, 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 lis... | bsd-3-clause |
denova/TaskBoard | taskboard/settings.py | 2 | 2192 | """
Django settings for taskboard project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | unlicense |
sovietspy2/uzletiProject | python/Lib/ctypes/util.py | 3 | 7264 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys, os
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
... | gpl-3.0 |
z01nl1o02/tests | text/mlpbase.py | 1 | 8554 | import os,sys,pdb,pickle
import numpy as np
import cv2
import theano
import theano.tensor as T
import random
#you may try several times to get a good model and the init 'cost' may be quite large, 78 .e.g.
class Layer(object):
"""
a layer is a maxtrix with row = output of this layer and col = output of
prev... | gpl-2.0 |
Learningtribes/edx-platform | common/djangoapps/third_party_auth/tasks.py | 47 | 6565 | # -*- coding: utf-8 -*-
"""
Code to manage fetching and storing the metadata of IdPs.
"""
from celery.task import task
import datetime
import dateutil.parser
import logging
from lxml import etree
import requests
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from third_party_auth.models import SAMLConfiguration... | agpl-3.0 |
wpoely86/vsc-base | lib/vsc/utils/run.py | 2 | 31071 | #
# Copyright 2009-2013 Ghent University
#
# This file is part of vsc-base,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (http:... | lgpl-2.1 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Tools/framer/framer/member.py | 50 | 1933 | from framer import template
from framer.util import cstring, unindent
T_SHORT = "T_SHORT"
T_INT = "T_INT"
T_LONG = "T_LONG"
T_FLOAT = "T_FLOAT"
T_DOUBLE = "T_DOUBLE"
T_STRING = "T_STRING"
T_OBJECT = "T_OBJECT"
T_CHAR = "T_CHAR"
T_BYTE = "T_BYTE"
T_UBYTE = "T_UBYTE"
T_UINT = "T_UINT"
T_ULONG = "T_ULONG"
T_STRING_INPLAC... | mit |
danielvdao/TheAnimalFarm | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py | 93 | 12036 | '''SSL with SNI-support for Python 2.
This needs the following packages installed:
* pyOpenSSL (tested with 0.13)
* ndg-httpsclient (tested with 0.3.2)
* pyasn1 (tested with 0.1.6)
To activate it call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3`.
This can be done in a ``sitecustomize`` module, or at any ot... | gpl-2.0 |
jamessergeant/pylearn2 | pylearn2/utils/utlc.py | 49 | 7347 | """Several utilities for experimenting upon utlc datasets"""
# Standard library imports
import logging
import os
import inspect
import zipfile
from tempfile import TemporaryFile
# Third-party imports
import numpy
import theano
from pylearn2.datasets.utlc import load_ndarray_dataset, load_sparse_dataset
from pylearn2.u... | bsd-3-clause |
pmisik/buildbot | master/buildbot/scripts/tryserver.py | 5 | 1481 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
madoodia/codeLab | python/Built-in_Functions.py | 1 | 15493 | ######################################### Built-in Functions #########################################
abs(x) # Return the absolute value of a number
# .........................................
all(iterable) # Return True if all elements of the iterable are true
# equivalent to:
def all(iterable):
for element i... | mit |
pmrowla/goonbcs | goonbcs/models.py | 1 | 3450 | # Copyright (c) 2013 Peter Rowlands
from __future__ import absolute_import
from flask.ext.security import UserMixin, RoleMixin
from . import db
class Conference(db.Model):
"""A college football conference"""
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(255), unique=True)
... | mit |
acuicultor/Radioactive-kernel-HAM | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
draugiskisprendimai/odoo | addons/website/tests/test_views.py | 144 | 9831 | # -*- coding: utf-8 -*-
import itertools
import unittest2
from lxml import etree as ET, html
from lxml.html import builder as h
from openerp.tests import common
def attrs(**kwargs):
return dict(('data-oe-%s' % key, str(value)) for key, value in kwargs.iteritems())
class TestViewSaving(common.TransactionCase):
... | agpl-3.0 |
ryuunosukeyoshi/PartnerPoi-Bot | lib/pip/_vendor/appdirs.py | 327 | 22368 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# ... | gpl-3.0 |
jbenden/ansible | test/integration/targets/module_precedence/lib_with_extension/ping.py | 102 | 2144 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, 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... | gpl-3.0 |
krafczyk/spack | var/spack/repos/builtin/packages/kim-api/package.py | 2 | 2073 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
charany1/googlecl | src/debug_util.py | 2 | 2144 | # Copyright (C) 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 or agreed to in writ... | mit |
adit-chandra/tensorflow | tensorflow/python/compiler/tensorrt/test/biasadd_matmul_test.py | 7 | 4543 | # Copyright 2018 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 |
SummerLW/Perf-Insight-Report | third_party/gsutil/gslib/cat_helper.py | 28 | 3005 | # -*- coding: utf-8 -*-
# Copyright 2014 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... | bsd-3-clause |
HalcyonChimera/osf.io | osf/management/commands/osf_shell.py | 13 | 8191 | """Enhanced python shell.
Includes all features from django-extension's shell_plus command plus OSF-specific
niceties.
By default, sessions run in a transaction, so changes won't be commited until
you execute `commit()`.
All models are imported by default, as well as common OSF and Django objects.
To add more object... | apache-2.0 |
timmie/cartopy | lib/cartopy/mpl/ticker.py | 3 | 10493 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of cartopy.
#
# cartopy 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 3 of the License, or
# (at your option)... | gpl-3.0 |
mheap/ansible | lib/ansible/utils/helpers.py | 109 | 1614 | # (c) 2016, Ansible by Red Hat <info@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 your option) any later v... | gpl-3.0 |
jose36/plugin.video.ProyectoLuzDigital | servers/zippyshare.py | 34 | 2012 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para zippyshare
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core im... | apache-2.0 |
15Dkatz/pants | src/python/pants/util/desktop.py | 4 | 1516 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.util.osut... | apache-2.0 |
samthor/intellij-community | plugins/hg4idea/testData/bin/hgext/convert/gnuarch.py | 94 | 12716 | # gnuarch.py - GNU Arch support for the convert extension
#
# Copyright 2008, 2009 Aleix Conchillo Flaque <aleix@member.fsf.org>
# and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from common import NoRepo, commandline... | apache-2.0 |
exelearning/iteexe | exe/webui/imagewithtextblock.py | 15 | 5926 | # ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
#
# 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 versio... | gpl-2.0 |
zouzhberk/ambaridemo | demo-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/package/scripts/tez_client.py | 4 | 1154 | """
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 |
GitHublong/hue | desktop/core/ext-py/Django-1.6.10/django/utils/unittest/main.py | 219 | 9392 | """Unittest main program"""
import sys
import os
import types
from django.utils.unittest import loader, runner
try:
from django.utils.unittest.signals import installHandler
except ImportError:
installHandler = None
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
CATCHBREAK = ... | apache-2.0 |
FreeFighter77/venom-xbmc-addons-beta | plugin.video.vstream/resources/hosters/trash/filebase.py | 4 | 2905 | from resources.lib.jsunpacker import cJsUnpacker
from resources.lib.parser import cParser
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.util import cUtil
from resources.hosters.hoster import iHoster
class cHoster(iHoster):
def __init__(self):
self.__sDisplayName = 'Fi... | gpl-2.0 |
haoxli/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_frame-src_cross-origin_multi_allowed_two-manual.py | 30 | 2515 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "frame-src " + url2 + ... | bsd-3-clause |
SUSE/azure-sdk-for-python | azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/catalog/models/usql_package.py | 4 | 1951 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
maxamillion/ansible | lib/ansible/plugins/test/files.py | 170 | 1518 | # (c) 2015, Ansible, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... | gpl-3.0 |
sarthfrey/Texty | lib/requests/packages/urllib3/util/ssl_.py | 196 | 11401 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
# Maps the leng... | apache-2.0 |
sridevikoushik31/openstack | nova/api/openstack/compute/contrib/consoles.py | 2 | 3828 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | apache-2.0 |
heromod/migrid | mig/edpickle.py | 1 | 2501 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# edpickle - a simple pickled object editor.
# Copyright (C) 2009 Jonas Bardino
#
# This file is part of MiG.
#
# MiG 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-2.0 |
albertomurillo/ansible | lib/ansible/modules/network/fortios/fortios_router_multicast_flow.py | 21 | 8926 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... | gpl-3.0 |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/files/etc/apps/headphones/lib/unidecode/x09c.py | 253 | 4659 | data = (
'Huan ', # 0x00
'Quan ', # 0x01
'Ze ', # 0x02
'Wei ', # 0x03
'Wei ', # 0x04
'Yu ', # 0x05
'Qun ', # 0x06
'Rou ', # 0x07
'Die ', # 0x08
'Huang ', # 0x09
'Lian ', # 0x0a
'Yan ', # 0x0b
'Qiu ', # 0x0c
'Qiu ', # 0x0d
'Jian ', # 0x0e
'Bi ', # 0x0f
'E ', # 0x10
'Yan... | gpl-2.0 |
NewAcropolis/api | app/routes/venues/rest.py | 1 | 3126 | import os
from flask import (
Blueprint,
current_app,
jsonify,
request
)
from flask_jwt_extended import jwt_required
from app.dao.venues_dao import (
dao_create_venue,
dao_get_venues,
dao_update_venue,
dao_get_venue_by_id
)
from app.errors import register_errors
from app.routes.venues... | mit |
bestrauc/seqan | util/py_lib/clang/cindex.py | 36 | 57281 | #===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | bsd-3-clause |
Ariaban/Memoriz | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | 241 | 63805 | # 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.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import copy
import gyp.common... | artistic-2.0 |
wtorcasoGB/flask | flask/views.py | 149 | 5644 | # -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
from ._compat import with_metaclass
http_method_funcs =... | bsd-3-clause |
justingrayston/jaikuengine | common/test/user.py | 30 | 2821 | # 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 or agreed to in writing, ... | apache-2.0 |
ifcharming/voltdb2.1 | tools/vis.py | 1 | 5697 | #!/usr/bin/env python
# This is a visualizer which pulls TPC-C benchmark results from the MySQL
# databases and visualizes them. Four graphs will be generated, latency graph on
# sinigle node and multiple nodes, and throughput graph on single node and
# multiple nodes.
#
# Run it without any arguments to see what argu... | gpl-3.0 |
klahnakoski/jx-sqlite | vendor/mo_collections/unique_index.py | 1 | 5570 | # encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divis... | mpl-2.0 |
NetEaseGame/AutomatorX | atx/__main__.py | 3 | 7018 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# USAGE
# python -matx -s ESLKJXX gui
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import argparse
import functools
import json
import sys
import six
import inspect
from contextlib import contextmana... | apache-2.0 |
mhils/mitmproxy | test/mitmproxy/test_flow.py | 2 | 4799 | import io
import pytest
import mitmproxy.io
from mitmproxy import flow
from mitmproxy import flowfilter
from mitmproxy import options
from mitmproxy.exceptions import FlowReadException
from mitmproxy.io import tnetstring
from mitmproxy.test import taddons, tflow
from . import tservers
class TestSerialize:
def ... | mit |
afonsinoguimaraes/repository.magellan | plugin.video.SportsDevil/lib/utils/xppod.py | 17 | 2758 | #!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# 2014 - Anonymous
def decode(string):
import base64
s = ''
str = _reverse(string)
for x in range(0,len(str)):
s += _decode_char(str[x])
return base64.b64decode(s)
def _reverse(s):
string = ''
length = len(s)-3
while length > ... | gpl-2.0 |
Brocade-OpenSource/OpenStack-DNRM-Nova | nova/api/openstack/compute/plugins/v3/flavor_rxtx.py | 14 | 2990 | # 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 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... | apache-2.0 |
jamespcole/home-assistant | tests/util/test_yaml.py | 1 | 17357 | """Test Home Assistant yaml loader."""
import io
import os
import unittest
import logging
from unittest.mock import patch
import pytest
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util import yaml
from homeassistant.config import YAML_CONFIG_FILE, load_yaml_config_file
from tests.common... | apache-2.0 |
lmorchard/django | tests/auth_tests/test_decorators.py | 279 | 4124 | from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.test.client impo... | bsd-3-clause |
patrickcurl/ztruck | dj/lib/python2.7/site-packages/django/templatetags/i18n.py | 82 | 17673 | from __future__ import unicode_literals
import re
import sys
from django.conf import settings
from django.template import Library, Node, TemplateSyntaxError, Variable
from django.template.base import (
TOKEN_TEXT, TOKEN_VAR, TokenParser, render_value_in_context,
)
from django.template.defaulttags import token_kwa... | apache-2.0 |
GauriGNaik/servo | components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py | 134 | 5560 | def firstArgType(method):
return method.signatures()[0][1][0].type
def WebIDLTest(parser, harness):
parser.parse("""
dictionary Dict {
};
callback interface Foo {
};
interface Bar {
// Bit of a pain to get things that have dictionary types
void passDict(optional Di... | mpl-2.0 |
jiangjinjinyxt/vnpy | vnpy/api/ksgold/pyscript/generate_td_functions.py | 40 | 10308 | # encoding: UTF-8
__author__ = 'CHENXY'
from string import join
from ksgold_struct import structDict
def processCallBack(line):
orignalLine = line
line = line.replace('\tvirtual void ', '') # 删除行首的无效内容
line = line.replace('{};\n', '') # 删除行尾的无效内容
content = line.split('(')
c... | mit |
Grirrane/odoo | addons/l10n_ae/__openerp__.py | 8 | 1512 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
tgcion/code-Tigercon | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
soapy/soapy | soapy/pyqtgraph/opengl/shaders.py | 51 | 16009 | try:
from OpenGL import NullFunctionError
except ImportError:
from OpenGL.error import NullFunctionError
from OpenGL.GL import *
from OpenGL.GL import shaders
import re
## For centralizing and managing vertex/fragment shader programs.
def initShaders():
global Shaders
Shaders = [
ShaderProgram... | gpl-3.0 |
gdetor/SI-RF-Structure | Statistics/clear_data.py | 1 | 5369 | # Copyright (c) 2014, Georgios Is. Detorakis (gdetor@gmail.com) and
# Nicolas P. Rougier (nicolas.rougier@inria.fr)
# 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. Redis... | gpl-3.0 |
stewartsmith/bzr | bzrlib/_rio_py.py | 2 | 2703 | # Copyright (C) 2009 Canonical Ltd
#
# 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 distributed in ... | gpl-2.0 |
Vegasvikk/django-cms | cms/signals/apphook.py | 12 | 3522 | # -*- coding: utf-8 -*-
import sys
from django.core.management import color_style
from django.core.urlresolvers import clear_url_caches
from django.core.signals import request_finished
from cms.models import Title
DISPATCH_UID = 'cms-restart'
def apphook_pre_title_checker(instance, **kwargs):
"""
Store the ... | bsd-3-clause |
cheral/orange3 | doc/development/source/orange-demo/orangedemo/OWLearningCurveB.py | 2 | 13882 | import sys
from collections import OrderedDict
from functools import reduce
import numpy
import sklearn.cross_validation
from PyQt4.QtGui import QTableWidget, QTableWidgetItem
import Orange.data
import Orange.classification
from Orange.widgets import widget, gui, settings
from Orange.evaluation.testing import Resul... | bsd-2-clause |
josjevv/django-cms | cms/south_migrations/0054_new_publisher_data.py | 63 | 20437 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for page in orm['cms.Page'].objects.filter(publisher_is_draft=True):
title... | bsd-3-clause |
hujiajie/pa-chromium | chrome/app/nibs/PRESUBMIT.py | 126 | 3062 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script to verify that XIB changes are done with the right version.
See http://dev.chromium.org/developers/design-documents/mac-xib-files fo... | bsd-3-clause |
liangjiaxing/sympy | sympy/vector/tests/test_coordsysrect.py | 43 | 12190 | from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.scalar import BaseScalar
from sympy import sin, cos, pi, ImmutableMatrix as Matrix, \
symbols, simplify, zeros
from sympy.vector.functions import express
from sympy.vector.point import Point
from sympy.vector.vector import Vector
from sympy.... | bsd-3-clause |
bolkedebruin/airflow | tests/providers/segment/hooks/test_segment.py | 1 | 2017 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
vietpn/ghost-nodejs | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/autumn.py | 364 | 2144 | # -*- coding: utf-8 -*-
"""
pygments.styles.autumn
~~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.to... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.