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
tedelhourani/ansible
lib/ansible/modules/system/setup.py
49
7733
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # 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': '...
gpl-3.0
stacywsmith/ansible
test/units/parsing/test_dataloader.py
47
3823
# (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
mechacoin/mechacoin
qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py
305
5784
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
mit
ah744/ScaffCC_RKQC
rkqc/tools/gui/items/EquivalenceCheckItem.py
3
3266
# RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org) # Copyright (C) 2009-2011 The RevKit Developers <revkit@informatik.uni-bremen.de> # # 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 Founda...
bsd-2-clause
fidomason/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/colorama/initialise.py
484
1297
# 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...
lgpl-3.0
benrudolph/commcare-hq
corehq/apps/hqpillow_retry/filters.py
1
1993
from collections import defaultdict from django.db.models.aggregates import Count from corehq.apps.reports.filters.base import BaseSingleOptionFilter, CheckboxFilter, BaseDrilldownOptionFilter from django.utils.translation import ugettext_noop as _ from pillow_retry.models import PillowError class PillowErrorFilter(B...
bsd-3-clause
tumbl3w33d/ansible
lib/ansible/modules/network/ios/ios_ping.py
18
5820
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', 'status': ['preview'], ...
gpl-3.0
xzregg/yunwei
yw/views/fileobj.py
2
8961
# coding:utf-8 from ..Global import * import os import sys import glob import re import json import time from ..models import fileobj, hosts from .control import GetCmdRet def GetFileObjPath(name, ishost=True): #from ..Global import FileObjectsDir obj = 'hosts' if ishost else 'groups' path = os.path.joi...
lgpl-3.0
inonit/django-chemtrails
tests/contrib/permissions/test_utils.py
1
33686
# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser, Group, Permission from django.contrib.contenttypes.models import ContentType from django.db.models import QuerySet from django.test import TestCase from chemtrails.contrib.permissions import ut...
mit
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/lib2to3/tests/data/py2_test_grammar.py
285
30980
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. # NOTE: When you run this test as a script from the command line, you # get warnings about certain hex/oct constants. Since those are # issued by the parser, you can't suppress them by adding a # filterwarnings() call to this...
mit
stevekuznetsov/ansible
contrib/inventory/rackhd.py
77
2361
#!/usr/bin/env python import json import requests import os import argparse import types RACKHD_URL = 'http://localhost:8080' class RackhdInventory(object): def __init__(self, nodeids): self._inventory = {} for nodeid in nodeids: self._load_inventory_data(nodeid) inventory = {...
gpl-3.0
1tush/reviewboard
reviewboard/webapi/tests/test_file_diff_comment.py
10
5219
from __future__ import unicode_literals from django.utils import six from reviewboard.webapi.resources import resources from reviewboard.webapi.tests.base import BaseWebAPITestCase from reviewboard.webapi.tests.mimetypes import filediff_comment_list_mimetype from reviewboard.webapi.tests.mixins import (BasicTestsMeta...
mit
SINGROUP/pycp2k
pycp2k/classes/_each162.py
1
1114
from pycp2k.inputsection import InputSection class _each162(InputSection): def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None self.Md = None self.Pint = None self.Meta...
lgpl-3.0
tony/kivy
kivy/input/provider.py
23
1082
''' Motion Event Provider ===================== Abstract class for the implementation of a :class:`~kivy.input.motionevent.MotionEvent` provider. The implementation must support the :meth:`~MotionEventProvider.start`, :meth:`~MotionEventProvider.stop` and :meth:`~MotionEventProvider.update` methods. ''' __all__ = ('M...
mit
Flexget/Flexget
flexget/plugins/daemon/web_server.py
3
3903
from loguru import logger from flexget.api import api_app from flexget.config_schema import register_config_key from flexget.event import event from flexget.ui.v1 import register_web_ui as register_web_ui_v1 from flexget.ui.v2 import register_web_ui as register_web_ui_v2 from flexget.utils.tools import get_config_hash...
mit
ghmajx/asuswrt-merlin
release/src/router/samba-3.6.13/source4/scripting/python/samba/tests/samba3.py
20
8485
#!/usr/bin/env python # Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 # # 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 Licens...
gpl-2.0
rmfitzpatrick/ansible
lib/ansible/modules/network/netscaler/netscaler_ssl_certkey.py
27
11840
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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
sergiorua/libcloud
libcloud/compute/drivers/voxel.py
58
10960
# 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 ...
apache-2.0
poldracklab/fmriprep
fmriprep/cli/parser.py
1
24895
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Parser.""" import sys from .. import config def _build_parser(): """Build parser object.""" from functools import partial from pathlib import Path from argparse import ( Argumen...
bsd-3-clause
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/ctypes/test/test_wintypes.py
48
1473
import sys import unittest if not sys.platform.startswith('win'): raise unittest.SkipTest('Windows-only test') from ctypes import * from ctypes import wintypes class WinTypesTest(unittest.TestCase): def test_variant_bool(self): # reads 16-bits from memory, anything non-zero is True for true_v...
gpl-2.0
rooi/CouchPotatoServer
libs/tornado/locale.py
160
21946
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2009 Facebook # # 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 ...
gpl-3.0
slipstream/SlipStreamClient
client/src/main/python/slipstream/wrappers/BaseWrapper.py
1
25777
""" SlipStream Client ===== Copyright (C) 2014 SixSq Sarl (sixsq.com) ===== 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 ...
apache-2.0
futurice/vdsm
vdsm_hooks/checkimages/before_vm_start.py
5
4691
#!/usr/bin/python import os import sys import traceback import fcntl import struct import hooking BLKGETSIZE64 = 0x80081272 # Obtain device size in bytes FORMAT = 'L' TIMEPERGIB = 0.02 # Approximate qemu-img check time (in seconds) to check 1GiB GIB = 10 ** 9 # GiB ''' checkimages vdsm hook ===================== ...
gpl-2.0
ataylor32/django
tests/template_tests/test_engine.py
199
3971
import os from django.template import Context from django.template.engine import Engine from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango110Warning from .utils import ROOT, TEMPLATE_DIR OTHER_DIR = os.path.join(ROOT, 'other_templates') @ignore_warnings(cat...
bsd-3-clause
blrm/openshift-tools
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/test/unit/test_oc_group.py
17
7827
''' Unit tests for oc group ''' import copy import os import six import sys import unittest import mock # Removing invalid variable names for tests so that I can # keep them brief # pylint: disable=invalid-name,no-name-in-module # Disable import-error b/c our libraries aren't loaded in jenkins # pylint: disable=impo...
apache-2.0
waseem18/oh-mainline
vendor/packages/sphinx/sphinx/pycode/pgen2/tokenize.py
32
16435
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. # All rights reserved. """Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line o...
agpl-3.0
nrwahl2/ansible
lib/ansible/modules/cloud/amazon/elb_application_lb_facts.py
26
10370
#!/usr/bin/python # Copyright: 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', 'status': ['preview'], ...
gpl-3.0
glo/ee384b
opencv/tests/python/test_adaptors.py
5
3898
#!/usr/bin/env python """A simple TestCase class for testing the adaptors.py module. 2007-11-xx, Vicent Mas <vmas@carabos.com> Carabos Coop. V. 2007-11-08, minor modifications for distribution, Mark Asbach <asbach@ient.rwth-aachen.de> """ import unittest import os import PIL.Image import numpy import cvtestutils i...
lgpl-2.1
philanthropy-u/edx-platform
openedx/core/djangoapps/oauth_dispatch/models.py
4
4648
""" Specialized models for oauth_dispatch djangoapp """ from datetime import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ from django_mysql.models import ListCharField from oauth2_provider.settings import oauth2_settings from organizations.models import Organization fr...
agpl-3.0
drawcode/yaml-cpp.new-api
test/gmock-1.7.0/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...
mit
cunningchloe/gwiki
extensions/ConfirmEdit/captcha.py
47
7848
#!/usr/bin/python # # Script to generate distorted text images for a captcha system. # # Copyright (C) 2005 Neil Harris # # 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 ...
gpl-2.0
Johnzero/OE7
openerp/addons/web/tests/test_js.py
69
1238
import urlparse from openerp import sql_db, tools from qunitsuite.suite import QUnitSuite class WebSuite(QUnitSuite): def __init__(self): url = urlparse.urlunsplit([ 'http', 'localhost:{port}'.format(port=tools.config['xmlrpc_port']), '/web/tests', 'mod=*&sou...
agpl-3.0
aksareen/balrog
scripts/dump-json.py
3
1144
#!/usr/bin/env python from os import path import sys import simplejson as json # Our parent directory should contain the auslib module, so we add it to the # PYTHONPATH to make things easier on consumers. sys.path.append(path.join(path.dirname(__file__), "..")) from auslib.db import AUSDatabase if __name__ == "__m...
mpl-2.0
BadgerMaps/django-allauth
allauth/socialaccount/providers/angellist/provider.py
75
1034
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class AngelListAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('angellist_url') ...
mit
ZenDevelopmentSystems/scikit-learn
examples/covariance/plot_mahalanobis_distances.py
348
6232
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
bsd-3-clause
hlin117/scikit-learn
sklearn/neighbors/lof.py
33
12186
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np from warnings import warn from scipy.stats import scoreatpercentile from .base import NeighborsBase from .base import KNeighborsMixin from .bas...
bsd-3-clause
RannyeriDev/Solfege
solfege/mpd/mpdutils.py
4
3482
# GNU Solfege - free ear training software # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2011 Tom Cato Amundsen # # 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...
gpl-3.0
gdevanla/hyde
hydeengine/site_post_processors.py
40
9772
from __future__ import with_statement import os, re, string, subprocess, codecs from django.conf import settings from django.template.loader import render_to_string from file_system import File from datetime import datetime from hydeengine.templatetags.hydetags import xmldatetime import commands class YUICompressor:...
mit
tex0l/JukeBox
display_LCDd_2x40.py
1
5980
from __future__ import unicode_literals # !/usr/bin/env python # -*- coding: utf-8 -*- from lcdproc.server import Server from threading import Thread, Event, Timer, Lock import time import logging from unidecode import unidecode import music_player class LockableServer(Server): """ A subclass of lcdproc Server...
apache-2.0
HalCanary/skia-hc
infra/bots/recipes/android_compile.py
3
5523
# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import math DEPS = [ 'recipe_engine/context', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/raw_io', ...
bsd-3-clause
moandcompany/luigi
test/helpers.py
6
5988
# -*- 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
caktus/ibid
ibid/lib/dcwords.py
2
17546
#!/usr/bin/env python # Copyright (c) 2009, Stefano Rivera # Released under terms of the MIT/X/Expat Licence. See COPYING for details. # Speaks NMDC protocol. Not widely tested. # Assumes the hub uses UTF-8. Client interface uses unicode() # Currently only implements chat, not file transfer # a chatroom of None == pub...
gpl-3.0
skg-net/ansible
lib/ansible/modules/network/nxos/nxos_snmp_traps.py
61
7281
#!/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
aegm/pcvs
fabfile.py
1
5579
# -*- coding: utf-8 -*- """Fabfile de procedimientos de deployment. En el presente fabfile se desarrolla una serie de procedimientos que automatizan las actividades de deployment para el presente proyecto. """ import os from fabric.api import * from fabric.colors import * # Definimos algunos datos sobre dónde y con...
bsd-3-clause
dalanlan/calico-docker
calico_containers/tests/unit/endpoint_test.py
9
1335
# Copyright 2015 Metaswitch Networks # # 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 w...
apache-2.0
ajose01/rethinkdb
external/v8_3.30.33.16/tools/push-to-trunk/script_test.py
95
2294
#!/usr/bin/env python # Copyright 2014 the V8 project authors. 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...
agpl-3.0
soldag/home-assistant
homeassistant/components/mqtt/light/schema_template.py
3
17037
"""Support for MQTT Template lights.""" import logging import voluptuous as vol from homeassistant.components import mqtt from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FLASH, ATTR_HS_COLOR, ATTR_TRANSITION, ATTR_WHITE_VALUE, SUPPORT_BR...
apache-2.0
larsks/cobbler-larsks
koan/text_wrap.py
21
13867
"""Text wrapping and filling. (note: repackaged in koan because it's not present in RHEL3) """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> __revision__ = "$Id: textwrap.py,v 1.32.8.2 2004/05/13 01:48:15 gward Exp $" impor...
gpl-2.0
rockneurotiko/django
django/db/models/query.py
7
67989
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import sys import warnings from collections import OrderedDict, deque from django.conf import settings from django.core import exceptions from django.db import ( DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ...
bsd-3-clause
googleapis/googleapis-gen
google/firestore/v1beta1/firestore-v1beta1-py/google/firestore_v1beta1/services/firestore/pagers.py
1
15845
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
jotes/pontoon
pontoon/machinery/views.py
1
12755
import json import logging import requests import xml.etree.ElementTree as ET from urllib.parse import quote from caighdean import Translator from caighdean.exceptions import TranslationError from uuid import uuid4 from django.conf import settings from django.http import JsonResponse from django.shortcuts import ren...
bsd-3-clause
mdileep/mutatorMath.gui
Flask/PythonWeb/views.py
2
1674
from flask import render_template,Response from PythonWeb import app from PythonWeb import lib from PythonWeb import business from datetime import datetime def renderTemplate(htmlPage,navActive): return render_template(htmlPage, now=datetime.now(),sessionId=lib.getNewSessionId(),active=navActive) @app.route('/gui...
gpl-3.0
noodle-learns-programming/python-social-auth
social/apps/pyramid_app/views.py
75
1091
from pyramid.view import view_config from social.utils import module_member from social.actions import do_auth, do_complete, do_disconnect from social.apps.pyramid_app.utils import psa, login_required @view_config(route_name='social.auth', request_method='GET') @psa('social.complete') def auth(request): return d...
bsd-3-clause
chengdh/openerp-ktv
openerp/pychart/area_doc.py
15
3581
# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: plots(type:list) default="Used only internally by pychart.". loc(type:(x,y)) default="The location of the bottom-left corner of the chart. @cindex chart location @cindex location, chart ". y_grid_style(...
agpl-3.0
johankaito/fufuka
microblog/old-flask/lib/python2.7/site-packages/wtforms/widgets/html5.py
153
2214
""" Widgets for various HTML5 input types. """ from .core import Input __all__ = ( 'ColorInput', 'DateInput', 'DateTimeInput', 'DateTimeLocalInput', 'EmailInput', 'MonthInput', 'NumberInput', 'RangeInput', 'SearchInput', 'TelInput', 'TimeInput', 'URLInput', 'WeekInput', ) class SearchInput(Input): "...
apache-2.0
aldian/tensorflow
tensorflow/python/saved_model/utils_test.py
62
5133
# 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
binoculars/osf.io
addons/box/tests/utils.py
12
6250
# -*- coding: utf-8 -*- import mock from contextlib import contextmanager from addons.base.tests.base import OAuthAddonTestCaseMixin, AddonTestCase from addons.box.models import Provider from addons.box.tests.factories import BoxAccountFactory class BoxAddonTestCase(OAuthAddonTestCaseMixin, AddonTestCase): ADDO...
apache-2.0
lucasrangit/twitter-winner
twitter-winner/oauthlib/oauth2/rfc6749/endpoints/resource.py
6
3200
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals from oauthlib.common import Request, log from .base import BaseEndpoint, cat...
mit
wesm/statsmodels
scikits/statsmodels/sandbox/km_class.py
5
11704
#a class for the Kaplan-Meier estimator import numpy as np from math import sqrt import matplotlib.pyplot as plt class KAPLAN_MEIER(object): def __init__(self, data, timesIn, groupIn, censoringIn): raise RuntimeError('Newer version of Kaplan-Meier class available in survival2.py') #store the inputs...
bsd-3-clause
mhotwagner/abackend
abackend-env/lib/python3.5/site-packages/wheel/test/test_signatures.py
565
1120
from wheel import signatures from wheel.signatures import djbec, ed25519py from wheel.util import binary def test_getlib(): signatures.get_ed25519ll() def test_djbec(): djbec.dsa_test() djbec.dh_test() def test_ed25519py(): kp0 = ed25519py.crypto_sign_keypair(binary(' '*32)) kp = ed25519p...
mit
ArtsiomCh/tensorflow
tensorflow/contrib/cluster_resolver/python/training/tpu_cluster_resolver_test.py
21
3916
# 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 applicable ...
apache-2.0
readbeyond/aeneas
aeneas/tests/long_test_task_misc.py
5
10851
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, A...
agpl-3.0
y-tsutsu/mondja
mondja/middleware.py
1
1342
from django.contrib.auth.models import User from django.shortcuts import redirect from django.urls import reverse from django.utils.deprecation import MiddlewareMixin from mondja.pydenticon_wrapper import create_identicon class MondjaMiddleware(MiddlewareMixin): def __init__(self, get_response=None): sel...
bsd-3-clause
SolaWing/ycmd
ycmd/tests/bindings/cpp_bindings_raises_exception_test.py
5
6258
# Copyright (C) 2018 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # # ycmd...
gpl-3.0
cmu-db/db-webcrawler
library/admin.py
2
2022
from django.contrib import admin from models import * class DependencyInline(admin.StackedInline): model = Dependency extra = 3 class ProjectTypeAdmin(admin.ModelAdmin): list_display = [ 'name', 'filename', 'deployer_class' ] ## CLASS class RepositorySourceAdmin(admin.ModelAdmin): list_display = [ 'n...
apache-2.0
Bismarrck/tensorflow
tensorflow/python/keras/engine/topology_test.py
1
44915
# 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
lincolnloop/django-categories
categories/south_migrations/0010_add_field_categoryrelation_category.py
14
4801
# encoding: 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): # Changing field 'Category.parent' db.alter_column('categories_category', 'parent_id', self.gf('mptt.fields.TreeFor...
apache-2.0
zederson/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/packages/ordered_dict.py
1093
8936
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
lgpl-2.1
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/scipy/special/tests/test_basic.py
17
132165
# this program corresponds to special.py ### Means test is not done yet # E Means test is giving error (E) # F Means test is failing (F) # EF Means test is giving error and Failing #! Means test is segfaulting # 8 Means test runs forever ### test_besselpoly ### test_mathieu_a ### test_mathieu_even_coef ##...
mit
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
python-packages/pyRiemann-0.2.2/pyriemann/utils/mean.py
2
5426
import numpy from .base import sqrtm, invsqrtm, powm, logm, expm ############################################################### # Means ############################################################### def mean_riemann(covmats, tol=10e-9, maxiter=50, init=None): """Return the mean covariance matrix according to t...
bsd-3-clause
petabyte/bedrock
bedrock/thunderbird/urls.py
5
2312
# 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/. from django.conf.urls import patterns, url import views import bedrock.releasenotes.views from bedrock.releasenotes impo...
mpl-2.0
incaser/odoo-odoo
addons/base_gengo/__openerp__.py
312
2117
# -*- 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
ghjm/ansible
hacking/build-ansible.py
21
2905
#!/usr/bin/env python3 # coding: utf-8 # PYTHON_ARGCOMPLETE_OK # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type imp...
gpl-3.0
karan/warehouse
tests/unit/accounts/test_services.py
2
6915
# 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 # distributed under the Li...
apache-2.0
glenngillen/dotfiles
.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/jedilsp/parso/python/parser.py
2
8227
from parso.python import tree from parso.python.token import PythonTokenTypes from parso.parser import BaseParser NAME = PythonTokenTypes.NAME INDENT = PythonTokenTypes.INDENT DEDENT = PythonTokenTypes.DEDENT class Parser(BaseParser): """ This class is used to parse a Python file, it then divides them into ...
mit
sdopoku/flask-hello-world
venv/lib/python2.7/site-packages/setuptools/command/install_egg_info.py
357
3833
from setuptools import Command from setuptools.archive_util import unpack_archive from distutils import log, dir_util import os, shutil, pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .egg-info directory for the package" user_...
gpl-2.0
hobinyoon/hadoop-1.1.2
src/contrib/hod/testing/main.py
182
2928
#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 thi...
apache-2.0
h2oai/h2o-dev
h2o-py/tests/testdir_hdfs/pyunit_INTERNAL_HDFS_orc_parser.py
4
3281
from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils #---------------------------------------------------------------------- # Purpose: This test will test orc-parser in HDFS parsing multiple # orc files collected by Tom K. #------------------...
apache-2.0
kho0810/flaskr
lib/sqlalchemy/dialects/mysql/__init__.py
33
1171
# mysql/__init__.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import base, mysqldb, oursql, \ pyodbc, zxjdbc, mysqlconnector, pymysql...
apache-2.0
filipefigcorreia/asaanalyzer
asaanalyser/common/model.py
1
37599
# -*- coding: utf-8 -*- from sys import stdout import sqlite3 import math import csv from datetime import timedelta from util import parse_date, total_seconds, groupby CONSIDER_ONLY_COMPLETED_TASKS = False # this is ok because nothing significant is missing from incomplete tasks class ASADatabase(object): def __i...
mit
joopert/home-assistant
homeassistant/components/kira/__init__.py
19
4242
"""KIRA interface to receive UDP packets from an IR-IP bridge.""" import logging import os import pykira import voluptuous as vol from voluptuous.error import Error as VoluptuousError import yaml from homeassistant.const import ( CONF_CODE, CONF_DEVICE, CONF_HOST, CONF_NAME, CONF_PORT, CONF_SE...
apache-2.0
savoirfairelinux/ring-daemon
doc/dbus-api/tools/xincludator.py
30
1291
#!/usr/bin/python from sys import argv, stdout, stderr import codecs, locale import os import xml.dom.minidom stdout = codecs.getwriter('utf-8')(stdout) NS_XI = 'http://www.w3.org/2001/XInclude' def xincludate(dom, base, dropns = []): remove_attrs = [] for i in xrange(dom.documentElement.attributes.length):...
gpl-3.0
ZachMassia/platformio
platformio/builder/scripts/nxplpc.py
3
1885
# Copyright 2014-2016 Ivan Kravets <me@ikravets.com> # # 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...
apache-2.0
jmcorgan/gnuradio
gr-digital/python/digital/qa_ofdm_sync_sc_cfb.py
55
7134
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your opt...
gpl-3.0
madjelan/scikit-learn
sklearn/linear_model/tests/test_omp.py
272
7752
# Author: Vlad Niculae # Licence: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equa...
bsd-3-clause
axelspringer/ansible-modules-core
cloud/rackspace/rax_files_objects.py
41
18551
#!/usr/bin/python # (c) 2013, Paul Durivage <paul.durivage@rackspace.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
pducks32/intergrala
python/sympy/sympy/physics/quantum/tests/test_gate.py
28
11621
from sympy import exp, symbols, sqrt, I, pi, Mul, Integer, Wild from sympy.matrices import Matrix from sympy.physics.quantum.gate import (XGate, YGate, ZGate, random_circuit, CNOT, IdentityGate, H, X, Y, S, T, Z, SwapGate, gate_simp, gate_sort, CNotGate, TGate, HadamardGate, PhaseGate, UGate, CGate) fr...
mit
tushortz/Zilch
tests/scorer_test.py
1
1159
import unittest from zilch.die import Die from zilch.scorer import Scorer class TestScorerMethod(unittest.TestCase): def test_score_one_of_a_kind(self): die_value = Die(6).get_value() value = Scorer().score_one_of_a_kind(die_value).score self.assertEqual(value, 0) die_value = Die...
mit
Maccimo/intellij-community
python/helpers/pydev/build_tools/build_binaries_osx.py
9
2204
from __future__ import unicode_literals import os import subprocess import sys from build import BINARY_DIRS, remove_binaries miniconda64_envs = os.getenv('MINICONDA64_ENVS') python_installations = [ r'%s/py27_64/bin/python' % miniconda64_envs, r'%s/py35_64/bin/python' % miniconda64_envs, r'%s/py36_64/b...
apache-2.0
yenliangl/bitcoin
test/functional/test_framework/netutil.py
16
5102
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Linux network utilities. Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-10...
mit
scion-network/scion
src/scion/service/scion_management.py
1
7030
#!/usr/bin/env python __author__ = 'Michael Meisinger' from pyon.public import log, CFG, BadRequest, EventPublisher, Conflict, Unauthorized, AssociationQuery, NotFound, PRED, OT, ResourceQuery, RT from pyon.util.containers import is_valid_identifier, parse_ion_ts, BASIC_VALID from ion.service.identity_management_ser...
bsd-2-clause
mcsosa121/cafa
cafaenv/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py
227
3637
import logging from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, router, transaction from django.utils import timezone from django.utils.encoding import force_text from django.utils.functional import c...
mit
dslomov/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/views.py
71
10263
import re import urlparse from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME # Avoid shadowing the login() view below. from django.contrib.auth import login as auth_login from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm ...
apache-2.0
shaunstanislaus/ZeroNet
src/lib/pybitcointools/test_stealth.py
36
4274
import bitcoin as bc import sys import unittest class TestStealth(unittest.TestCase): def setUp(self): if sys.getrecursionlimit() < 1000: sys.setrecursionlimit(1000) self.addr = 'vJmtjxSDxNPXL4RNapp9ARdqKz3uJyf1EDGjr1Fgqs9c8mYsVH82h8wvnA4i5rtJ57mr3kor1EVJrd4e5upACJd58...
gpl-2.0
Simran-B/arangodb
3rdParty/V8-4.3.61/test/mjsunit/testcfg.py
13
4019
# Copyright 2008 the V8 project authors. 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 of conditi...
apache-2.0
mrjacobagilbert/gnuradio
gr-utils/modtool/cli/disable.py
6
1119
# # Copyright 2018 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Disable blocks module """ import click from ..core import get_block_candidates, ModToolDisable from ..tools import SequenceCompleter from .base import common_params, block_name, ...
gpl-3.0
ononeor12/python-social-auth
social/actions.py
63
4788
from social.p3 import quote from social.utils import sanitize_redirect, user_is_authenticated, \ user_is_active, partial_pipeline_data, setting_url def do_auth(backend, redirect_name='next'): # Clean any partial pipeline data backend.strategy.clean_partial_pipeline() # Save any d...
bsd-3-clause
djrscally/eve-wspace
evewspace/Recruitment/migrations/0001_initial.py
18
14593
# -*- 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 model 'Interest' db.create_table('Recruitment_interest', ( ('id', self.gf('django.db.mo...
gpl-3.0
k0ste/ansible
lib/ansible/executor/powershell/module_manifest.py
4
16789
# (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 import base64 import errno import json import os import pkgutil import random import re from distutils.versio...
gpl-3.0
gsehub/edx-platform
openedx/core/djangoapps/content/block_structure/tests/test_models.py
13
7435
""" Unit tests for Block Structure models. """ # pylint: disable=protected-access import ddt from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.test import TestCase from django.utils.timezone import now from itertools import product from mock import patch, Mock from uuid...
agpl-3.0