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 |
|---|---|---|---|---|---|
HTCKernels/One-SV-cricket-k2plccl | scripts/gcc-wrapper.py | 74 | 3544 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... | gpl-2.0 |
TalShafir/ansible | lib/ansible/modules/cloud/amazon/route53_health_check.py | 56 | 13079 | #!/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 distributed... | gpl-3.0 |
gdimitris/FleetManagerBackend | virtual_env/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py | 474 | 1597 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).rese... | mit |
Distrotech/mozjs | js/src/testing/mozbase/mozprocess/mozprocess/pid.py | 6 | 2314 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import mozinfo
import shlex
import subprocess
import sys
# determine the platform-spec... | mpl-2.0 |
abhishek-ch/hue | desktop/core/ext-py/Django-1.6.10/tests/backends/tests.py | 46 | 40386 | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import absolute_import, unicode_literals
import copy
import datetime
from decimal import Decimal
import threading
from django.conf import settings
from django.core.management.color import no_style
from django.db import (connec... | apache-2.0 |
hhbyyh/spark | sql/hive/src/test/resources/data/scripts/cat.py | 105 | 1040 | #
# 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 |
40223136/2015cdag1man | static/Brython3.1.3-20150514-095342/Lib/_markupbase.py | 891 | 14598 | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the html.parser module. It has no
documented public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.com... | gpl-3.0 |
willbarton/regulations-site | regulations/generator/node_types.py | 4 | 3965 | #vim: set encoding=utf-8
from itertools import takewhile
APPENDIX = u'appendix'
INTERP = u'interp'
REGTEXT = u'regtext'
SUBPART = u'subpart'
EMPTYPART = u'emptypart'
def transform_part(p):
""" Transform a part of the id of a node. """
return p.replace('(', '').replace(')', '')
def to_markup_id(id_parts):
... | cc0-1.0 |
x684867/nemesis | src/node/tools/gyp/pylib/gyp/MSVSUtil.py | 63 | 7421 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
_TARGET_TYPE_EXT = {
'executable': '.exe',
'shared_library': '.dll'
}
... | mit |
holygits/incubator-airflow | airflow/utils/operator_helpers.py | 31 | 1556 | # -*- 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 |
powellc/hacklabs-wiki | hacklabs-wiki/apps/wiki/views/article.py | 1 | 31553 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import difflib
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.db import transaction
from django.shortcuts import render_to_response, redirect, get_obj... | bsd-3-clause |
xchenum/quantum | quantum/plugins/linuxbridge/common/exceptions.py | 3 | 2051 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Cisco Systems, 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... | apache-2.0 |
rentongzhang/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_server.py | 299 | 1320 | import os
import unittest
import urllib2
import json
import wptserve
from base import TestUsingServer, doc_root
class TestFileHandler(TestUsingServer):
def test_not_handled(self):
with self.assertRaises(urllib2.HTTPError) as cm:
resp = self.request("/not_existing")
self.assertEquals(c... | mpl-2.0 |
alephdata/aleph | aleph/views/base_api.py | 1 | 7989 | import logging
from babel import Locale
from functools import lru_cache
from flask import Blueprint, request, current_app
from flask_babel import gettext, get_locale
from elasticsearch import TransportError
from followthemoney import model
from followthemoney.exc import InvalidData
from jwt import ExpiredSignatureError... | mit |
spark8103/ops17 | app/deploy/views.py | 1 | 1713 | # coding: utf-8
from flask import render_template, redirect, request, url_for, flash, \
jsonify
from flask_login import login_required, current_user
from . import deploy
from .. import db, flash_errors
from ..models import User, Module, Deploy, DeploySchema
from .forms import AddDeployForm
deploy_schema = DeploySc... | mit |
vlvkobal/netdata | collectors/python.d.plugin/python_modules/pyyaml2/constructor.py | 4 | 25176 | # SPDX-License-Identifier: MIT
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
from error import *
from nodes import *
import datetime
import binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
class BaseConstructor(object):
yaml_constructors = {... | gpl-3.0 |
daviddeng/azrael | doc/conf.py | 1 | 10560 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# azrael documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 26 16:34:54 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | agpl-3.0 |
KousikaGanesh/purchaseandInventory | openerp/addons/sale_crm/report/__init__.py | 54 | 1087 | # -*- 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 |
2014c2g9/c2g9 | wsgi/static/Brython2.1.0-20140419-113919/Lib/test/test_int.py | 765 | 12587 | import sys
import unittest
from test.support import run_unittest
L = [
('0', 0),
('1', 1),
('9', 9),
('10', 10),
('99', 99),
('100', 100),
('314', 314),
(' 314', 314),
('314 ', 314),
(' \t\t 314 \t\t ', 314),
(repr(sys.maxsize... | gpl-2.0 |
TheBoegl/letsencrypt | letsencrypt/configuration.py | 1 | 4669 | """Let's Encrypt user-supplied configuration."""
import copy
import os
from six.moves.urllib import parse # pylint: disable=import-error
import zope.interface
from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import interfaces
from letsencrypt import le_util
class NamespaceConfig(ob... | apache-2.0 |
grdlok/UStar-dl | src/youtube_dl/extractor/veehd.py | 4 | 2308 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
compat_urlparse,
get_element_by_id,
clean_html,
)
class VeeHDIE(InfoExtractor):
_VALID_URL = r'https?://veehd\.com/video/(?P<id>\d+)'
_TEST = {
'url': 'http://veehd.com/... | unlicense |
dperezde/little-penguin | linux/tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
pombredanne/pants | src/python/pants/backend/jvm/tasks/jar_create.py | 13 | 2997 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | apache-2.0 |
jvkops/django | docs/_ext/ticket_role.py | 401 | 1183 | """
An interpreted text role to link docs to Trac tickets.
To use: :ticket:`XXXXX`
Based on code from psycopg2 by Daniele Varrazzo.
"""
from docutils import nodes, utils
from docutils.parsers.rst import roles
def ticket_role(name, rawtext, text, lineno, inliner, options=None, content=None):
if options is None:
... | bsd-3-clause |
MarcusTan/yncn-grid | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py | 1730 | 2278 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... | mit |
perkinslr/pypyjs | addedLibraries/twisted/web/test/test_distrib.py | 41 | 15230 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.distrib}.
"""
from os.path import abspath
from xml.dom.minidom import parseString
try:
import pwd
except ImportError:
pwd = None
from zope.interface.verify import verifyObject
from twisted.python import log, ... | mit |
elenaoat/AutobahnPython | autobahn/autobahn/utf8validator.py | 14 | 5028 | ###############################################################################
##
## Copyright 2011-2013 Tavendo GmbH
##
## Note:
##
## This code is a Python implementation of the algorithm
##
## "Flexible and Economical UTF-8 Decoder"
##
## by Bjoern Hoehrmann
##
## bjoern@hoehrmann.d... | apache-2.0 |
DoubleNegativeVisualEffects/gaffer | python/GafferTest/CompoundPathFilterTest.py | 5 | 4377 | ##########################################################################
#
# Copyright (c) 2012, Image Engine Design 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:
#
# * Red... | bsd-3-clause |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_openshift/src/ansible/oc_pvc.py | 60 | 1107 | # pylint: skip-file
# flake8: noqa
#pylint: disable=too-many-branches
def main():
'''
ansible oc module for pvc
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type... | apache-2.0 |
twz915/django | tests/gis_tests/gis_migrations/test_commands.py | 21 | 2492 | from django.core.management import call_command
from django.db import connection
from django.test import TransactionTestCase, skipUnlessDBFeature
@skipUnlessDBFeature("gis_enabled")
class MigrateTests(TransactionTestCase):
"""
Tests running the migrate command in Geodjango.
"""
available_apps = ["gis_... | bsd-3-clause |
rhertzog/django | django/contrib/gis/geos/point.py | 89 | 5969 | import warnings
from ctypes import c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils... | bsd-3-clause |
wong2/sentry | src/sentry/migrations/0130_auto__del_field_project_owner.py | 36 | 26056 | # -*- 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):
# Deleting field 'Project.owner'
db.delete_column(u'sentry_project', 'owner_id')
def backwards(self, o... | bsd-3-clause |
mrkm4ntr/incubator-airflow | tests/providers/google/cloud/sensors/test_bigquery_dts.py | 4 | 1941 | #
# 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... | apache-2.0 |
nikhil18/lightning-kernel-bacon | 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 |
renhaoqi/gem5-stable | src/mem/slicc/symbols/Symbol.py | 92 | 3064 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
jamesmcm/luigi | luigi/contrib/postgres.py | 4 | 13746 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
Tisseo/navitia | source/tyr/tyr/api.py | 2 | 3547 | #!/usr/bin/env python
#coding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help u... | agpl-3.0 |
40223249-1/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/external_import.py | 742 | 2985 | import os
from browser import doc
import urllib.request
## this module is able to download modules that are external to
## localhost/src
## so we could download from any URL
class ModuleFinder:
def __init__(self, path_entry):
print("external_import here..")
#print(path_entry)
self._module=... | agpl-3.0 |
bsipocz/bokeh | tests/glyphs/Patches.py | 43 | 1055 | import numpy as np
from bokeh.document import Document
from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid
from bokeh.models.glyphs import Patches
from bokeh.plotting import show
N = 9
x = np.linspace(-2, 2, N)
y = x**2
xpts = np.array([-.09, -.12, .0, .12, .09])
ypts = np.array([-.1, .... | bsd-3-clause |
don-github/edx-platform | common/lib/xmodule/xmodule/tests/test_annotator_token.py | 222 | 1060 | """
This test will run for annotator_token.py
"""
import unittest
from xmodule.annotator_token import retrieve_token
class TokenRetriever(unittest.TestCase):
"""
Tests to make sure that when passed in a username and secret token, that it will be encoded correctly
"""
def test_token(self):
"""... | agpl-3.0 |
sktjdgns1189/android_kernel_samsung_SHW-M240S | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
calvingit21/h2o-2 | py/testdir_single_jvm/test_rf_covtype_fvec.py | 9 | 7065 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_rf as h2o_rf, h2o_import as h2i, h2o_exec, h2o_jobs, h2o_gbm
paramDict = {
'response': 'C55',
'cols': None,
# 'ignored_cols_by_name': 'C1,C2,C6,C7,C8',
'ignored_cols_by_name': None,
'classification'... | apache-2.0 |
boyuegame/kbengine | kbe/res/scripts/common/Lib/idlelib/Percolator.py | 82 | 3244 | from idlelib.WidgetRedirector import WidgetRedirector
from idlelib.Delegator import Delegator
class Percolator:
def __init__(self, text):
# XXX would be nice to inherit from Delegator
self.text = text
self.redir = WidgetRedirector(text)
self.top = self.bottom = Delegator(text)
... | lgpl-3.0 |
hanleybrand/mdid3-core-a-goof-around | mdid3/util/models.py | 1 | 1408 | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.conf import settings
from django.contrib.auth.models import Group
class OwnedWrapperManager(models.Manager):
"""
Allows retrieval of a wrapper object by specifyin... | bsd-3-clause |
orekyuu/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/db/backends/base.py | 258 | 10674 | """
Base/mixin classes for the spatial backend database operations and the
`SpatialRefSys` model the backend.
"""
import re
from django.conf import settings
from django.contrib.gis import gdal
class BaseSpatialOperations(object):
"""
This module holds the base `BaseSpatialBackend` object, which is
instanti... | apache-2.0 |
useEvil/flickr-photo-sync | flickrphotosync/photosync/management/commands/authenticate.py | 1 | 1262 | import os
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from photosync.flickr import Flickr
from photosync.helpers import *
class Command(BaseCommand):
args = '<photoset photoset ...>'
help = 'Imports photos froma photoset on Flickr'
flickr = Flickr()... | mit |
vjmac15/Lyilis | lib/youtube_dl/extractor/jove (VJ Washington's conflicted copy 2017-08-29).py | 50 | 3075 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate
)
class JoveIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?jove\.com/video/(?P<id>[0-9]+)'
_CHAPTERS_URL = 'http://www.jove.com/video-chapters?videoid={vide... | gpl-3.0 |
DedMemez/ODS-August-2017 | shtiker/OptionsPage.py | 1 | 44949 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.shtiker.OptionsPage
from panda3d.core import AntialiasAttrib, FrameRateMeter, Lens, TextNode, Vec4
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.gui.DirectGui import *
from direct.showbase import PythonUtil
from direc... | apache-2.0 |
wuhengzhi/chromium-crosswalk | infra/scripts/legacy/scripts/slave/runtest.py | 18 | 24264 | #!/usr/bin/env python
# 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.
"""A tool used to run a Chrome test executable and process the output.
This script is used by the buildbot slaves. It must be run ... | bsd-3-clause |
Viktor-Evst/luigi | luigi/task_register.py | 56 | 7529 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
ns950/calibre | src/calibre/utils/fonts/sfnt/cff/constants.py | 14 | 11601 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
numenta/nupic.research | projects/vernon_continual/run.py | 3 | 1775 | # Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
glenn-edgar/local_scda | flask_web/werkzeug/testsuite/contrib/securecookie.py | 10 | 1724 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the secure cookie.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.utils import... | mit |
upverter/closure-linter | closure_linter/checker.py | 18 | 3963 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | apache-2.0 |
MiLk/ansible | lib/ansible/modules/database/misc/redis.py | 70 | 10882 | #!/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 |
pplatek/odoo | addons/product_margin/__init__.py | 444 | 1092 | # -*- 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 |
facebookresearch/ParlAI | parlai/agents/transformer/polyencoder.py | 1 | 22686 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# hack to make sure -m transformer/generator works as expected
"""
Poly-encoder Agent.
"""
from parlai.core.params impor... | mit |
joelpinheiro/safebox-smartcard-auth | Client/veclient/lib/python2.7/site-packages/setuptools/command/install_lib.py | 111 | 2089 | import distutils.command.install_lib as orig
import os
class install_lib(orig.install_lib):
"""Don't add compiled flags to filenames of non-Python files"""
def run(self):
self.build()
outfiles = self.install()
if outfiles is not None:
# always compile, in case we have any e... | gpl-2.0 |
xzh86/scikit-learn | sklearn/ensemble/tests/test_forest.py | 57 | 35265 | """
Testing for the forest module (sklearn.ensemble.forest).
"""
# Authors: Gilles Louppe,
# Brian Holt,
# Andreas Mueller,
# Arnaud Joly
# License: BSD 3 clause
import pickle
from collections import defaultdict
from itertools import product
import numpy as np
from scipy.sparse import csr_... | bsd-3-clause |
napkindrawing/ansible | lib/ansible/modules/network/nxos/nxos_snmp_location.py | 55 | 5795 | #!/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 |
wangjun/pyload | module/common/pylgettext.py | 36 | 1396 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gettext import *
_searchdirs = None
origfind = find
def setpaths(pathlist):
global _searchdirs
if isinstance(pathlist, list):
_searchdirs = pathlist
else:
_searchdirs = list(pathlist)
def addpath(path):
global _searchdirs
if _s... | gpl-3.0 |
js850/PyGMIN | pygmin/takestep/particle_exchange.py | 1 | 1928 | import numpy as np
import random
from pygmin.takestep.generic import Takestep
__all__ = ["ParticleExchange"]
class ParticleExchange(Takestep):
"""Implement a takestep move which swaps two un-like atoms
Choose a random atom from group A and a random atom from group B
and exchange their xyz coordinate... | gpl-3.0 |
jmighion/ansible | contrib/inventory/consul_io.py | 7 | 18671 | #!/usr/bin/env python
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.com>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | gpl-3.0 |
lbishal/scikit-learn | examples/linear_model/plot_sgd_comparison.py | 112 | 1819 | """
==================================
Comparing various online solvers
==================================
An example showing how different online solvers perform
on the hand-written digits dataset.
"""
# Author: Rob Zinkov <rob at zinkov dot com>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot a... | bsd-3-clause |
kukuruza/tf-faster-rcnn | tools/trainval_vgg16_net.py | 1 | 4040 | # --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Xinlei Chen, based on code from Ross Girshick
# --------------------------------------------------------
import _init_paths
from model.train_val_vgg16 import get_... | mit |
yashsharan/sympy | sympy/physics/vector/point.py | 35 | 15193 | from __future__ import print_function, division
from sympy.core.compatibility import range
from .vector import Vector, _check_vector
from .frame import _check_frame
__all__ = ['Point']
class Point(object):
"""This object represents a point in a dynamic system.
It stores the: position, velocity, and accelera... | bsd-3-clause |
wangyang59/tf_models | video_prediction/prediction_input_flo.py | 1 | 3630 | # 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 applicab... | apache-2.0 |
paaschpa/badcomputering | pygments/styles/pastie.py | 75 | 2473 | # -*- coding: utf-8 -*-
"""
pygments.styles.pastie
~~~~~~~~~~~~~~~~~~~~~~
Style similar to the `pastie`_ default style.
.. _pastie: http://pastie.caboo.se/
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style impor... | bsd-3-clause |
dadawangweb/ukl-gsvc-web | app/api_1_0/webModifySqlAPI.py | 3 | 3719 | # -*- coding: utf-8 -*-
"""
webModifySqlAPI
~~~~~~~~~~~~~~
为web应用与后台数据库操作(插入,更新,删除操作)的接口
api_functions 中的DataApiFunc.py为其接口函数汇聚点,所有全局变量设置都在此;所有后台函数调用都在此设置
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2015 by Armin kissf lu.
:license: ukl, see LICENSE for more detail... | mit |
wallnerryan/quantum_migrate | quantum/tests/unit/ryu/test_ryu_db.py | 2 | 2565 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# 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... | apache-2.0 |
bverburg/CouchPotatoServer | libs/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | gpl-3.0 |
TRESCLOUD/odoopub | addons/account_followup/report/account_followup_report.py | 382 | 4561 | # -*- 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 |
ostwald/scrapi | scrapi/base/__init__.py | 1 | 6976 | # Classes for scrAPI Harvesters
from __future__ import unicode_literals
import abc
import json
import logging
from datetime import timedelta, date
import six
from furl import furl
from lxml import etree
from scrapi import util
from scrapi import registry
from scrapi import settings
from scrapi.base.schemas import OA... | apache-2.0 |
lanniaoershi/android_kernel_oneplus_msm8994 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
MayankGo/ec2-api | ec2api/i18n.py | 3 | 1345 | # Copyright 2014 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 agreed to in writing, s... | apache-2.0 |
back-to/streamlink | src/streamlink/stream/streamprocess.py | 3 | 5721 | import logging
import subprocess
from operator import itemgetter
from streamlink.stream import Stream
from streamlink.stream.wrappers import StreamIOThreadWrapper
from streamlink.compat import devnull, which
from streamlink.exceptions import StreamError
import time
import tempfile
log = logging.getLogger(__name__)
... | bsd-2-clause |
CloudWareChile/OpenChile | openerp/addons/account/project/report/account_journal.py | 9 | 2134 | # -*- 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 |
sszlm/MissionPlanner | Lib/site-packages/scipy/lib/lapack/tests/test_esv.py | 57 | 4762 | import numpy as np
from numpy.testing import TestCase, assert_array_almost_equal, dec, \
assert_equal
from common import FUNCS_TP, FLAPACK_IS_EMPTY, CLAPACK_IS_EMPTY, FUNCS_FLAPACK, \
FUNCS_CLAPACK, PREC
SYEV_ARG = np.array([[1,2,3],[2,2,3],[3,3,6]])
SYEV_REF = np.array([-... | gpl-3.0 |
AnderEnder/ansible-modules-extras | packaging/os/homebrew_cask.py | 28 | 18277 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# This module 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 |
ahmed-mahran/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/md.py | 33 | 82562 | #!/usr/bin/env python
#
# Generated Mon May 2 14:23:33 2011 by parse_xsd.py version 0.4.
#
import saml2
from saml2 import SamlBase
import xmldsig as ds
import xmlenc as xenc
from saml2 import saml
NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:metadata'
class EntityIDType_(SamlBase):
"""The urn:oasis:names:tc:SAML... | apache-2.0 |
automl/ChaLearn_Automatic_Machine_Learning_Challenge_2015 | 004_flora.py | 1 | 18625 | import argparse
import os
from joblib import Parallel, delayed
import numpy as np
import autosklearn
import autosklearn.data
import autosklearn.data.competition_data_manager
from autosklearn.pipeline.regression import SimpleRegressionPipeline
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add... | bsd-2-clause |
RGU5Android/PythonLectureNotes | HomeWork/10-06-14/stack.py | 1 | 1993 | #!/usr/bin/python
import sys
def push(stack_list, input):
stack_list.append(input)
def pop(stack_array):
if len(stack_array) == 0:
return 0
else:
value = stack_array.pop()
return value
def peep(stack_array):
value = len(stack_array)
if value == 0:
return 0
else... | gpl-2.0 |
klahnakoski/esShardBalancer | mo_times/timer.py | 3 | 1832 | # 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __fu... | mpl-2.0 |
silenceli/nova | nova/storage/linuxscsi.py | 8 | 4994 | # (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 re... | apache-2.0 |
GeassDB/shadowsocks | tests/test_udp_src.py | 1009 | 2482 | #!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... | apache-2.0 |
foone/7gen | code/vxpinstaller.py | 1 | 1446 | #!/usr/env python
#md2_to_vxp: Converts Quake 2 MD2 files to v3dmm expansions (VXPs)
#Copyright (C) 2004-2015 Foone Turing
#
#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 Li... | gpl-2.0 |
raymondnijssen/QGIS | python/plugins/processing/gui/AlgorithmExecutor.py | 9 | 4271 | # -*- coding: utf-8 -*-
"""
***************************************************************************
AlgorithmExecutor.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... | gpl-2.0 |
ykaneko/quantum | quantum/plugins/cisco/db/nexus_db_v2.py | 1 | 4553 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Cisco Systems, 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-... | apache-2.0 |
Yichuans/ccv | models/menu.py | 6 | 7307 | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
# ----------------------------------------------------------------------------------------------------------------------
# Customize your APP title, subtitle and menus here
# ----------------------------------------... | gpl-3.0 |
Karel-van-de-Plassche/bokeh | tests/integration/interaction/test_pan_tool.py | 10 | 1864 | from __future__ import absolute_import, print_function
from bokeh.io import save
from bokeh.plotting import figure
from selenium.common.exceptions import StaleElementReferenceException
from tests.integration.utils import has_no_console_errors
import pytest
pytestmark = pytest.mark.integration
def make_plot(tools='p... | bsd-3-clause |
gargleblaster/trading-with-python | cookbook/reconstructVXX/reconstructVXX.py | 77 | 3574 | # -*- coding: utf-8 -*-
"""
Reconstructing VXX from futures data
author: Jev Kuznetsov
License : BSD
"""
from __future__ import division
from pandas import *
import numpy as np
import os
class Future(object):
""" vix future class, used to keep data structures simple """
def __init__(self,serie... | bsd-3-clause |
imsparsh/python-for-android | python3-alpha/python3-src/Lib/queue.py | 51 | 9242 | """A multi-producer, multi-consumer queue."""
from time import time as _time
try:
import threading as _threading
except ImportError:
import dummy_threading as _threading
from collections import deque
import heapq
__all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']
class Empty(Exception):
"... | apache-2.0 |
fadybinadnan/BOTNet-2017.4- | tests/test_reload.py | 2 | 3425 | import time
from botnet.config import Config
def make_admin_config(command_prefix='.'):
config = {
'module_config': {
'botnet': {
'admin': {
'admins': [
'nick4'
]
}
}
}
}
... | mit |
cuoretech/dowork | dowork/lib/session.py | 1 | 1875 | from pyramid.httpexceptions import HTTPFound
from StringIO import StringIO
import json
from oneid import OneID
import simplejson
from urllib2 import urlopen
## This will verify if the user has logged on OneID AND in our system
def isUserLoggedOn(request):
if request.session != {}:
if request.session["uid"... | apache-2.0 |
nfallen/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/etree_lxml.py | 1724 | 14031 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | mpl-2.0 |
aaltinisik/OCBAltinkaya | addons/share/wizard/__init__.py | 448 | 1067 | # -*- 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 |
linuxlizard/pymake | test_recipe.py | 1 | 9389 | #!/usr/bin/env python3
# Regression tests for pymake.py
#
# Test Makefile recipe tokenizing
#
# davep 24-Sep-2014
import sys
# require Python 3.x
if sys.version_info.major < 3:
raise Exception("Requires Python 3.x")
import hexdump
from pymake import *
from run_tests import run_tests_list
import vline
def big_rec... | gpl-2.0 |
ma3lstrom/manga-cork | mangacork/views.py | 1 | 6036 | import logging
from flask import render_template, request, redirect, session, url_for
from flask.ext.login import (login_user, logout_user)
from . import app, db, login_manager
from .utils import (increment_page_number, build_img_path, is_last_page)
from .models import LastPage, Comments, User
from .forms import Sig... | mit |
TeachAtTUM/edx-platform | openedx/core/djangoapps/verified_track_content/tests/test_forms.py | 25 | 1656 | """
Test for forms helpers.
"""
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from openedx.core.djangoapps.verified_track_content.forms import VerifiedTrackCourseForm
class TestVerifiedTrackCourseForm(SharedModuleStoreTestCa... | agpl-3.0 |
aman-iitj/scipy | scipy/weave/base_info.py | 98 | 4855 | """
base_info holds classes that define the information
needed for building C++ extension modules for Python that
handle different data types. The information includes
such as include files, libraries, and even code snippets.
base_info -- base class for cxx_info, blitz_info, etc.
info_list -- ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.