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
allancarlos123/Solfege-5.0
tools/mk-classhier-graph.py
3
4488
#!/usr/bin/python import re import sys import os import textwrap if len(sys.argv) == 1 or sys.argv[1] == '-h': print "\nUsage:" print "\t./tools/classhier.py file1.py file2.py ...\n" print "\n\t".join(textwrap.wrap("\tGenerate a nice graph of the class hierarchy in the files supplied as arguments.")) ...
gpl-3.0
lrowe/rdflib
test/test_finalnewline.py
8
1093
from rdflib import ConjunctiveGraph, URIRef import rdflib.plugin from rdflib.py3compat import b def testFinalNewline(): """ http://code.google.com/p/rdflib/issues/detail?id=5 """ import sys import platform if getattr(sys, 'pypy_version_info', None) or platform.system() == 'Java': from...
bsd-3-clause
jendap/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/bijectors/scale_tril_test.py
33
2411
# 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
massmutual/scikit-learn
sklearn/ensemble/tests/test_bagging.py
13
25689
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Author: Gilles Louppe # License: BSD 3 clause import numpy as np from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.te...
bsd-3-clause
apache/allura
Allura/allura/tests/unit/__init__.py
2
1567
# 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 (t...
apache-2.0
artwr/airflow
airflow/contrib/hooks/aws_dynamodb_hook.py
20
2370
# -*- 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
JulienMcJay/eclock
windows/Python27/Lib/site-packages/pip/_vendor/distlib/index.py
166
19159
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread except ImportErr...
gpl-2.0
nyasara/azuremono-docker
IronPython-2.7.4/Lib/unittest/suite.py
60
10112
"""TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda: None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ ...
mit
gdub/django
django/contrib/gis/db/models/lookups.py
226
10608
from __future__ import unicode_literals import re from django.core.exceptions import FieldDoesNotExist from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import Col, Expression from django.db.models.lookups import Lookup from django.utils import six gis_lookups = {} class GISLookup...
bsd-3-clause
dribnet/dagbldr
examples/mnist_conditional_vae/mnist_conditional_vae.py
1
4379
from collections import OrderedDict import numpy as np import theano from dagbldr.datasets import fetch_binarized_mnist from dagbldr.optimizers import adam from dagbldr.utils import add_datasets_to_graph, get_params_and_grads from dagbldr.utils import convert_to_one_hot from dagbldr.utils import load_last_checkpoint, ...
bsd-3-clause
manipopopo/tensorflow
tensorflow/python/kernel_tests/where_op_test.py
7
7335
# 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
mottosso/mindbender-setup
bin/windows/python36/Lib/unittest/test/testmock/testhelpers.py
4
27384
import unittest from unittest.mock import ( call, _Call, create_autospec, MagicMock, Mock, ANY, _CallList, patch, PropertyMock ) from datetime import datetime class SomeClass(object): def one(self, a, b): pass def two(self): pass def three(self, a=None): pass class AnyT...
mit
ageron/tensorflow
tensorflow/python/ops/ctc_ops.py
5
45792
# 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
allenp/odoo
addons/auth_oauth/res_config.py
40
1624
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import osv, fields import logging _logger = logging.getLogger(__name__) class base_config_settings(osv.TransientModel): _inherit = 'base.config.settings' _columns = { 'auth_oauth_googl...
gpl-3.0
ychfan/tensorflow
tensorflow/compiler/tests/dynamic_stitch_test.py
123
3401
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
SPKian/Testing2
erpnext/setup/doctype/email_digest/quotes.py
7
2338
# -*- coding: utf-8 -*- from __future__ import unicode_literals import random def get_random_quote(): quotes = [ ("Start by doing what's necessary; then do what's possible; and suddenly you are doing the impossible.", "Francis of Assisi"), ("The best and most beautiful things in the world cannot be seen or even t...
agpl-3.0
gitprouser/appengine-bottle-skeleton
lib/requests/packages/urllib3/filepost.py
292
2321
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarrassingly-simple replacement for mimetools.choose_...
apache-2.0
willingc/oh-mainline
vendor/packages/distribute/setuptools/tests/server.py
62
1503
"""Basic http server for tests to simulate PyPI or custom indexes """ import urllib2 import sys from threading import Thread from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler class IndexServer(HTTPServer): """Basic single-threaded http server simulating a package index ...
agpl-3.0
webcube/django-hyperadmin
hyperadmin/resources/models/autoload.py
2
6899
''' Maps django model admin entries to model resources. Usage:: from hyperadmin.resources.models.autload import DjangoCTModelAdminLoader from django.contrib.admin import site as admin_site from hyperadmin import site as root_endpoint loader = DjangoCTModelAdminLoader(root_endpoint, admin_site) ...
bsd-3-clause
chienlieu2017/it_management
odoo/addons/stock/tests/test_shipment.py
27
2475
# -*- coding: utf-8 -*- from odoo.addons.stock.tests.common2 import TestStockCommon class TestInventory(TestStockCommon): def test_shipment(self): # TDE NOTE: this test replaces test/shipment.yml present until saas-10 # TDE TODO # pickign.action_confirm -> confirm moves # picking...
gpl-3.0
codeforamerica/pittsburgh-purchasing-suite
purchasing/data/importer/state.py
2
3847
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from purchasing.database import db, get_or_create from sqlalchemy.exc import IntegrityError, InvalidRequestError from purchasing.data.importer import ( extract, convert_empty_to_none, determine_company_contact ) from purchasing.utils...
bsd-3-clause
tumbl3w33d/ansible
test/lib/ansible_test/_internal/cloud/aws.py
17
3947
"""AWS plugin for integration tests.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ..util import ( ApplicationError, display, is_shippable, ConfigParser, ) from . import ( CloudProvider, CloudEnvironment, CloudEnvironmentConfig, ...
gpl-3.0
EdgarSun/Django-Demo
django/template/defaultfilters.py
150
29467
"""Default variable filters.""" import re from decimal import Decimal, InvalidOperation, ROUND_HALF_UP import random as random_module try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.template.base import Variable, Library from d...
mit
Juniper/ceilometer
ceilometer/ipmi/platform/ipmitool.py
1
4472
# Copyright 2014 Intel 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,...
apache-2.0
AICP/external_chromium_org
tools/generate_stubs/generate_stubs_unittest.py
9
11918
#!/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. """Unittest for the generate_stubs.py. Since generate_stubs.py is a code generator, it is hard to do a very good test. Instead of...
bsd-3-clause
PongPi/isl-odoo
addons/project/tests/__init__.py
260
1089
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
behrtam/xpython
exercises/luhn/luhn_test.py
2
2570
import unittest from luhn import Luhn # Tests adapted from `problem-specifications//canonical-data.json` @ v1.6.1 class LuhnTest(unittest.TestCase): def test_single_digit_strings_can_not_be_valid(self): self.assertIs(Luhn("1").valid(), False) def test_a_single_zero_is_invalid(self): self.as...
mit
Maronato/aosalunos
misago/migrations/0027_auto__add_field_thread_prefix.py
3
39176
# -*- 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): # Adding field 'Thread.prefix' db.add_column(u'misago_thread', 'prefix', self.gf('djan...
gpl-2.0
yanikou19/pymatgen
pymatgen/core/tests/test_periodic_table.py
1
12207
# coding: utf-8 from __future__ import division, unicode_literals import unittest import pickle import collections from pymatgen.core.periodic_table import Element, Specie, DummySpecie, \ PeriodicTable, get_el_sp from copy import deepcopy class ElementTestCase(unittest.TestCase): def test_init(self): ...
mit
wrigri/libcloud
libcloud/dns/drivers/luadns.py
23
9009
import sys try: import simplejson as json except ImportError: import json from libcloud.common.luadns import LuadnsResponse, LuadnsConnection from libcloud.common.luadns import LuadnsException from libcloud.dns.base import DNSDriver, Zone, Record from libcloud.dns.types import Provider, RecordType from libclo...
apache-2.0
marcoantoniooliveira/labweb
oscar/apps/partner/south_migrations/0013_auto__chg_field_partneraddress_first_name__chg_field_partneraddress_ti.py
13
22660
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'PartnerAddress.first_name' ...
bsd-3-clause
qiqjiao/study
jsoncpp/tags/svn-release-0.6.0-rc2/scons-tools/substinfile.py
258
3216
import re from SCons.Script import * # the usual scons stuff you get in a SConscript def generate(env): """ Add builders and construction variables for the SubstInFile tool. Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT from the source to the target. The values of...
lgpl-3.0
joelvanvelden/dd-agent
checks.d/php_fpm.py
34
4348
# 3p import requests # project from checks import AgentCheck from util import headers class PHPFPMCheck(AgentCheck): """ Tracks basic php-fpm metrics via the status module Requires php-fpm pools to have the status option. See http://www.php.net/manual/de/install.fpm.configuration.php#pm.status-path f...
bsd-3-clause
atheed/servo
tests/wpt/harness/wptrunner/executors/pytestrunner/runner.py
58
3384
# 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/. """Provides interface to deal with pytest. Usage:: session = webdriver.client.Session("127.0.0.1", "4444", "/") ...
mpl-2.0
probablytom/tomwallis.net
venv/lib/python2.7/site-packages/django/contrib/admin/models.py
84
3028
from __future__ import unicode_literals from django.db import models from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.admin.utils import quote from django.core.urlresolvers import reverse, NoReverseMatch from django.utils.translation import ugettext, ugett...
artistic-2.0
btovar/autopyfactory
autopyfactory/plugins/queue/batchsubmit/CondorGT5.py
1
1156
#!/bin/env python # # AutoPyfactory batch plugin for Condor # from CondorGRAM import CondorGRAM from autopyfactory import jsd class CondorGT5(CondorGRAM): id = 'condorgt5' """ This class is expected to have separate instances for each PandaQueue object. """ def __init__(self, apfqueue, confi...
apache-2.0
armikhael/software-center
test/test_reinstall_purchased.py
1
3517
#!/usr/bin/python import sys sys.path.insert(0,"../") import apt_pkg import apt import logging import json import unittest import xapian from softwarecenter.enums import XapianValues from softwarecenter.db.database import StoreDatabase from softwarecenter.db.update import add_from_purchased_but_needs_reinstall_data...
gpl-3.0
jostep/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py
70
49865
# 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
zooko/egtp
common/crypto/Python/randsource.py
1
1809
# # Copyright (c) 2000 Autonomous Zone Industries # This file is licensed under the # GNU Lesser General Public License v2.1. # See the file COPYING or visit http://www.gnu.org/ for details. # import evilcryptopp __doc__ = evilcryptopp._randsource_doc get = evilcryptopp._randsource_get import time import sys ...
agpl-3.0
varchild/android_kernel_htc_msm8660
scripts/gcc-wrapper.py
484
3824
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011, 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 above ...
gpl-2.0
HybridF5/nova
nova/tests/unit/objects/test_instance_pci_requests.py
32
7584
# 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 # d...
apache-2.0
vmindru/ansible
lib/ansible/modules/network/ingate/ig_unit_information.py
52
3988
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ingate Systems AB # 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 = { 'status': ['preview'], ...
gpl-3.0
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/site-packages/pip/_vendor/packaging/requirements.py
17
4441
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import string import re from pip._vendor.pyparsing import stringStart, st...
gpl-3.0
tiagochiavericosta/edx-platform
common/djangoapps/student/migrations/0050_auto__add_manualenrollmentaudit.py
84
17352
# -*- 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 'ManualEnrollmentAudit' db.create_table('student_manualenr...
agpl-3.0
henocdz/python-social-auth
social/backends/podio.py
83
1246
""" Podio OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/podio.html """ from social.backends.oauth import BaseOAuth2 class PodioOAuth2(BaseOAuth2): """Podio OAuth authentication backend""" name = 'podio' AUTHORIZATION_URL = 'https://podio.com/oauth/authorize' ACCESS_TOKEN_URL ...
bsd-3-clause
vmthunder/nova
nova/api/openstack/compute/contrib/extended_server_attributes.py
21
4406
# 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-2.0 # # Unless required by applicable law or a...
apache-2.0
hkhamm/django_rest_tutorial_2
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
gberryproject/gberry
gberry-lib/gtest/test/gtest_uninitialized_test.py
2901
2480
#!/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...
gpl-3.0
tdudz/elements
qa/rpc-tests/bip65-cltv.py
62
3311
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test the CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic # from test_framework.test_framework import Bit...
mit
aESeguridad/GERE
venv/lib/python2.7/site-packages/sqlalchemy/testing/config.py
38
2469
# testing/config.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import collections requirements = None db = None db_url = None db_opts = None fil...
gpl-3.0
DavidNorman/tensorflow
tensorflow/python/autograph/utils/tensors.py
14
2063
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mick-d/nipype
nipype/interfaces/ants/legacy.py
1
13965
# -*- coding: utf-8 -*- # NOTE: This implementation has been superceeded buy the antsApplyTransform # implmeentation that more closely follows the strucutre and capabilities # of the antsApplyTransform program. This implementation is here # for backwards compatibility. """ANTS Apply Transforms in...
bsd-3-clause
NewpTone/stacklab-cinder
cinder/tests/fake_flags.py
1
1721
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
googlei18n/fontuley
src/third_party/fontTools/Lib/fontTools/ttLib/tables/_h_e_a_d.py
7
2373
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval, num2binary, binary2num from . import DefaultTable import time import calendar headFormat = """ > # big endian tableVersion: 16....
apache-2.0
lshain-android-source/external-chromium_org-tools-gyp
test/subdirectory/gyptest-SYMROOT-default.py
399
1260
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
bsd-3-clause
theoryno3/luigi
examples/terasort.py
8
3446
# -*- 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
j0gurt/ggrc-core
src/ggrc_basic_permissions/migrations/versions/20141217235626_51e046bb002_ensure_all_audit_leads_have_program_.py
7
1449
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Ensure all Audit Leads have Program Editor role or better Revision ID: 51e046bb002 Revises: 581a9621fac1 Create Date: 2014-12-17 23:56:26.323023 """ # revision identifiers, used by Alembic. revision =...
apache-2.0
fromwarriors/pirol.bioactivity
setup.py
1
1029
# -*- coding: utf-8 -*- # (c) 2013 Maciej Szymkiewicz # Licensed under the MIT license: http://opensource.org/licenses/MIT from setuptools import setup, find_packages version = None requires = [ ] setup( name='pirol.bioactivity', version=version, description='', packages=find_packages(exclude=['tests'...
mit
Tibo-R/jamplaygen
boilerplate/tests.py
12
19360
''' Run the tests using testrunner.py script in the project root directory. Usage: testrunner.py SDK_PATH TEST_PATH Run unit tests for App Engine apps. SDK_PATH Path to the SDK installation TEST_PATH Path to package containing test modules Options: -h, --help show this help message and exit ''' import unitt...
lgpl-3.0
trenton3983/Artificial_Intelligence_for_Humans
vol2/vol2-python-examples/lib/aifh/pso.py
6
7032
#!/usr/bin/env python """ Artificial Intelligence for Humans Volume 2: Nature-Inspired Algorithms Python Version http://www.aifh.org http://www.jeffheaton.com Code repository: https://github.com/jeffheaton/aifh Copyright 2014 by Jeff Heaton Licensed under the Apache License, Versi...
apache-2.0
HyperBaton/ansible
lib/ansible/modules/system/gather_facts.py
45
1904
#!/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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
wwjiang007/flink
flink-python/pyflink/fn_execution/beam/beam_operations_slow.py
5
4643
################################################################################ # 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...
apache-2.0
uwosh/uwosh.themebase
uwosh/theme/portlets/calltoaction.py
1
2251
#XXX Legacy!!! Remove at your own risk!!! from zope import schema from zope.component import getMultiAdapter from zope.formlib import form from zope.interface import implements import re from plone.app.portlets.portlets import base from plone.memoize.instance import memoize from plone.portlets.interfaces import IPortle...
gpl-2.0
appsembler/edx-platform
openedx/core/djangoapps/content/course_overviews/migrations/0002_add_course_catalog_fields.py
81
1065
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course_overviews', '0001_initial'), ] operations = [ migrations.AddField( model_name='courseoverview', ...
agpl-3.0
contolini/owning-a-home
test/browser_testing/features/pages/base.py
6
4664
from pprint import pprint from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import StaleElementReferenceException from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.action_chains import ActionChains from selen...
cc0-1.0
drawks/ansible
lib/ansible/module_utils/network/nos/nos.py
79
4786
# # (c) 2018 Extreme Networks 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. # # Ans...
gpl-3.0
sivaprakashniet/push_pull
p2p/lib/python2.7/site-packages/kombu/transport/SLMQ.py
24
6028
""" kombu.transport.SLMQ ==================== SoftLayer Message Queue transport. """ from __future__ import absolute_import import socket import string from anyjson import loads, dumps import os from kombu.five import Empty, text_t from kombu.utils import cached_property # , uuid from kombu.utils.encoding import...
bsd-3-clause
MikeLing/shogun
examples/undocumented/python/kernel_comm_ulong_string.py
5
1425
#!/usr/bin/env python from tools.load import LoadMatrix lm=LoadMatrix() traindat =lm.load_dna('../data/fm_train_dna.dat') testdat = lm.load_dna('../data/fm_test_dna.dat') parameter_list = [[traindat,testdat,3,0,False ],[traindat,testdat,4,0,False]] def kernel_comm_ulong_string (fm_train_dna=traindat,fm_test_dna=test...
gpl-3.0
J-Rios/Python-Scripts
Scripts/lines_occurrences.py
1
3078
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #################################################################################################### ### Libraries ### from sys import argv from sys import exit #################################################################################################### ### Fu...
gpl-3.0
daftshady/dropbeat
dropbeat/youtube.py
1
2801
"""Wraps youtube api and data pipelines. """ import json import urllib import traceback import requests from bs4 import BeautifulSoup from celeryapp import app class Youtube(object): @staticmethod def search_from_html(keyword): """Get search result by parsing youtube HTML. Youtube api v3 la...
mit
rdnetto/linux-TF101
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
rohitsaboo/bazel
third_party/py/gflags/tests/flags_modules_for_testing/module_bar.py
139
4840
#!/usr/bin/env python # Copyright (c) 2009, 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 l...
apache-2.0
cztchoice/cztchoice-gtask-porter
uritemplate/__init__.py
195
4780
# Early, and incomplete implementation of -04. # import re import urllib RESERVED = ":/?#[]@!$&'()*+,;=" OPERATOR = "+./;?|!@" EXPLODE = "*+" MODIFIER = ":^" TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE) VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part...
apache-2.0
wbinek/I-Simpa
currentRelease/SystemScript/moveto_vertex/__init__.py
4
1507
# -*- coding: cp1252 -*- import uictrl as ui import uilocale import os ScriptFolder=ui.application.getapplicationpath()["systemscript"]+"moveto_vertex"+os.sep _=uilocale.InstallUiModule(ScriptFolder,ui.application.getlocale()) class manager: def __init__(self): self.movetoothergroupeventid=ui.application...
gpl-3.0
marcoscaceres/bedrock
bedrock/base/helpers.py
20
2023
import datetime import urllib import urlparse from django.contrib.staticfiles.storage import staticfiles_storage from django.template import defaultfilters from django.utils.encoding import smart_str from django.utils.html import strip_tags from jingo import register import jinja2 from .urlresolvers import reverse ...
mpl-2.0
xiandiancloud/ji
lms/djangoapps/instructor/features/bulk_email.py
23
6774
""" Define steps for bulk email acceptance test. """ # pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step from lettuce.django import mail from nose.tools import assert_in, assert_true, assert_equal # pylint: disable=E0611 from django.core.management import call_command from django.conf imp...
agpl-3.0
amosboldor/data-structures
src/test_linked_list.py
1
3798
"""Test LinkedList class.""" import pytest LIST_DATA = [ ['string'], [123], [[]], [{}] ] DATA = [ [1, 1], [[1, 2, 3], 3], ['string', 'g'] ] @pytest.fixture def new_list(): """Define new instance of LinkedList class.""" from linked_list import LinkedList this_list = LinkedLi...
mit
tempbottle/kbengine
kbe/src/lib/python/Lib/asyncio/windows_utils.py
64
6066
""" Various Windows specific bits and pieces """ import sys if sys.platform != 'win32': # pragma: no cover raise ImportError('win32 only') import socket import itertools import msvcrt import os import subprocess import tempfile import _winapi __all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', 'PipeHandle'] #...
lgpl-3.0
notthetup/openshift-iojs
bin/iojs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
240
90755
# 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. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
apache-2.0
pskrz/ansible
lib/ansible/executor/task_queue_manager.py
52
9846
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 # (at your option) an...
gpl-3.0
QuantConnect/Lean
Algorithm.Python/BasicSetAccountCurrencyAlgorithm.py
3
1702
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Licen...
apache-2.0
rajrakeshdr/pychess
lib/pychess/Variants/blindfold.py
21
1640
from pychess.Utils.const import * from pychess.Utils.Board import Board class BlindfoldBoard(Board): variant = BLINDFOLDCHESS class BlindfoldChess: __desc__ = _("Classic chess rules with hidden figurines\n" + "http://en.wikipedia.org/wiki/Blindfold_chess") name = _("Blindfold") cecp...
gpl-3.0
jerryz1982/neutron
neutron/tests/unit/cmd/test_ovs_cleanup.py
8
3417
# Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
fx2003/tensorflow-study
TensorFlow实战/models/cognitive_mapping_and_planning/tfcode/nav_utils.py
14
18657
# 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...
mit
Instagram/django
tests/modeltests/validation/test_unique.py
51
6076
import datetime from django.conf import settings from django.core.exceptions import ValidationError from django.db import connection from django.test import TestCase from django.utils import unittest from models import (CustomPKModel, UniqueTogetherModel, UniqueFieldsModel, UniqueForDateModel, ModelToValidate, Po...
bsd-3-clause
himleyb85/django
docs/_ext/djangodocs.py
30
10681
""" Sphinx plugins for Django documentation. """ import json import os import re from docutils import nodes from docutils.parsers.rst import directives from sphinx import addnodes from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.domains.std import Cmdoption from sphinx.util.compat import Directive fr...
bsd-3-clause
natefoo/ansible-modules-extras
notification/mqtt.py
44
4873
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, 2014, Jan-Piet Mens <jpmens () 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...
gpl-3.0
gencer/sentry
tests/sentry/api/endpoints/test_organization_stats.py
1
2054
from __future__ import absolute_import import functools import sys from django.core.urlresolvers import reverse from sentry import tsdb from sentry.testutils import APITestCase class OrganizationStatsTest(APITestCase): def test_simple(self): self.login_as(user=self.user) org = self.create_orga...
bsd-3-clause
jazkarta/edx-platform-for-isc
cms/djangoapps/contentstore/management/commands/tests/test_export_convert_format.py
65
2267
""" Test for export_convert_format. """ from unittest import TestCase from django.core.management import call_command, CommandError from tempfile import mkdtemp import shutil from path import path from contentstore.management.commands.export_convert_format import Command, extract_source from xmodule.tests.helpers impor...
agpl-3.0
huangciyin/youtube-dl
youtube_dl/extractor/tumblr.py
8
2648
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, ) class TumblrIE(InfoExtractor): _VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/((post)|(video))/(?P<id>\d*)($|/)' _TESTS = [{ 'url': 'http://t...
unlicense
MayB/zulip
zilencer/management/commands/create_deployment.py
114
2130
from __future__ import absolute_import from optparse import make_option import sys from django.core.management.base import BaseCommand from zerver.models import get_realm from zerver.lib.create_user import random_api_key from zerver.management.commands.create_realm import Command as CreateRealm from zilencer.models ...
apache-2.0
pypingou/pagure
tests/test_pagure_flask_api_project_update_watch.py
1
9607
# -*- coding: utf-8 -*- """ (c) 2018 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon <pingou@pingoured.fr> """ from __future__ import unicode_literals, absolute_import import copy import datetime import unittest import shutil import sys import time import os import json from mock import patch, MagicMock ...
gpl-2.0
apanju/odoo
addons/product/report/product_pricelist.py
341
5151
# -*- 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
zhangf911/common
test/diffmerge/differ_test.py
5
1268
import unittest from biicode.common.diffmerge.differ import similarity, compute_diff from biicode.common.diffmerge.differ import text_unified_diff from biicode.common.diffmerge.compare import compare class DifferTest(unittest.TestCase): def test_string_similarity(self): base = '\n'.join([str(i) for i in...
mit
sdlBasic/sdlbrt
win32/mingw/opt/lib/python2.7/shelve.py
225
8078
"""Manage shelves of pickled objects. A "shelf" is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the "pickle" module can handle. This includes most class instances, recursive data type...
lgpl-2.1
pu239ppy/authentic2
authentic2/auth2_auth/auth2_openid/views.py
1
17020
import urllib from django_authopenid.forms import OpenidDissociateForm, AssociateOpenID from django_authopenid.forms import OpenidSigninForm from django_authopenid import DjangoOpenIDStore from django_authopenid.models import UserAssociation from django_authopenid.utils import * from django_authopenid.views import ass...
agpl-3.0
TeamWin/android_kernel_samsung_j7elte
scripts/exynos_checkpatch_helper.py
169
2237
""" exynos_checkpatch_helper.py - a helper script for exynos_checkpatch.sh Dept : S/W Solution Dev Team Author : Solution3 Power Part Update : 2014.12.08 """ import subprocess as sp import sys def print_log(color, log): colored_log = '' if color == 'r': colored_log = "\033[31m" + log + "\033...
gpl-2.0
sirio81/vmcli
vmcli.py
1
4386
#!/usr/bin/python3 from libvmcli import error from libcluster import Cluster from libguest import Guest from time import sleep from docopt import docopt import sys import os h = ''' Usage: vmcli.py --cluster=<name> guest find <guest_name> vmcli.py --cluster=<name> guest start <guest_name> [<host_name>] vmcli.p...
lgpl-2.1
johnbachman/emcee
src/emcee/moves/red_blue.py
2
4008
# -*- coding: utf-8 -*- import numpy as np from ..state import State from .move import Move __all__ = ["RedBlueMove"] class RedBlueMove(Move): """ An abstract red-blue ensemble move with parallelization as described in `Foreman-Mackey et al. (2013) <https://arxiv.org/abs/1202.3665>`_. Args: ...
mit
asm-products/movie-database-service
ani/lib/python2.7/site-packages/django/utils/formats.py
103
7931
import decimal import datetime import unicodedata from django.conf import settings from django.utils import dateformat, numberformat, datetime_safe from django.utils.importlib import import_module from django.utils.encoding import force_str from django.utils.functional import lazy from django.utils.safestring import m...
agpl-3.0