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
helldorado/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_role.py
7
4467
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.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': '1.1...
gpl-3.0
huahbo/pyamg
pyamg/krylov/_gmres.py
2
4669
from _gmres_mgs import gmres_mgs from _gmres_householder import gmres_householder __docformat__ = "restructuredtext en" __all__ = ['gmres'] def gmres(A, b, x0=None, tol=1e-5, restrt=None, maxiter=None, xtype=None, M=None, callback=None, residuals=None, orthog='mgs', **kwargs): ''' Generalized Mini...
mit
potatolondon/django-nonrel-1-4
tests/regressiontests/views/models.py
144
1202
""" Regression tests for Django built-in views. """ from django.db import models class Author(models.Model): name = models.CharField(max_length=100) def __unicode__(self): return self.name def get_absolute_url(self): return '/views/authors/%s/' % self.id class BaseArticle(models.Model):...
bsd-3-clause
SilentCircle/sentry
src/sentry/migrations/0026_auto__add_field_project_status.py
7
12176
# 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): # Adding field 'Project.status' db.add_column('sentry_project', 'status', self.gf('django.db.models.fields...
bsd-3-clause
kaiweifan/vse-lbaas-plugin-poc
quantum/db/migration/alembic_migrations/env.py
8
2967
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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/li...
apache-2.0
alexandrucoman/vbox-nova-driver
nova/compute/utils.py
1
18432
# Copyright (c) 2011 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 ...
apache-2.0
Sispheor/piclodio3
back/tests/test_views/test_web_radio_views/test_delete.py
1
1729
from rest_framework import status from rest_framework.reverse import reverse from rest_framework.test import APITestCase from restapi.models import AlarmClock from restapi.models.web_radio import WebRadio class TestDelete(APITestCase): def setUp(self): super(TestDelete, self).setUp() self.webrad...
mit
musashin/ezTorrent
eztorrent.py
1
11668
#!/usr/bin/python __author__ = 'Nicolas' import t411 import transmissionrpc import base64 import re from commandline import CmdLine, command import time import filesize import json import os TRANSMISSION_ADDRESS_FILE = 'transmission.json' #This is the file where the transmission server address is stored #https://api...
mit
FreezyExp/dndtools
dndtools/dnd/contacts/views.py
3
2891
# -*- coding: utf-8 -*- from django.core.mail.message import EmailMessage from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template.context import RequestContext from dnd.menu import menu_item, submenu_item, MenuItem fr...
mit
mena-devs/slack_data_collector
slackcollector/tests/test_collector.py
1
2654
# The MIT License (MIT) # Copyright (c) 2016 Mena-Devs # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, m...
mit
blrm/openshift-tools
ansible/roles/lib_openshift_3.2/library/oc_process.py
6
37409
#!/usr/bin/env python # pylint: disable=too-many-lines # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) ...
apache-2.0
3dfxmadscientist/cbss-server
addons/web/tests/test_menu.py
65
5763
# -*- coding: utf-8 -*- import collections import mock import unittest2 from ..controllers import main class Placeholder(object): def __init__(self, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) class LoadTest(unittest2.TestCase): def setUp(self): self.menu = main...
agpl-3.0
way2heavy/youtube-dl-1
youtube_dl/extractor/goshgay.py
127
1579
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_parse_qs, ) from ..utils import ( parse_duration, ) class GoshgayIE(InfoExtractor): _VALID_URL = r'https?://www\.goshgay\.com/video(?P<id>\d+?)($|/)' _TEST = { 'url'...
unlicense
40223125/w16btest1
static/Brython3.1.3-20150514-095342/Lib/queue.py
818
8835
'''A multi-producer, multi-consumer queue.''' try: import threading except ImportError: import dummy_threading as threading from collections import deque from heapq import heappush, heappop try: from time import monotonic as time except ImportError: from time import time __all__ = ['Empty', 'Full', 'Q...
agpl-3.0
lucernae/geonode
geonode/upload/tests/test_files.py
2
1660
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 OSGeo # # 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 ...
gpl-3.0
40223114/2015_g4
static/Brython3.1.0-20150301-090019/Lib/operator.py
674
7736
#!/usr/bin/env python3 """ Operator Interface This module exports a set of functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y. The function names are those used for special methods; variants without leading and trailing '__' are also p...
gpl-3.0
jgeskens/django
tests/admin_views/models.py
5
17704
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import tempfile import os from django.contrib.auth.models import User from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from ...
bsd-3-clause
gcsadovy/generalPY
final_project.py
1
2736
#final_project_code #gcsadovy #Garik Sadovy #takes a data series of coordinates of fisher sightings over a period of years #in kml files, returns statistics on clustering, and creates a weighted #overlay, then loading the data to a map #input arguments: directory containing kml files to be used, #beginning year,...
gpl-3.0
freddy77/linux
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
offtherailz/mapstore
mapcomposer/app/static/externals/openlayers/tools/shrinksafe.py
293
1498
#!/usr/bin/env python # # Script to provide a wrapper around the ShrinkSafe "web service" # <http://shrinksafe.dojotoolkit.org/> # # # We use this script for two reasons: # # * This avoids having to install and configure Java and the standalone # ShrinkSafe utility. # # * The current ShrinkSafe standalone utility...
gpl-3.0
luhn/AutobahnPython
examples/twisted/websocket/echo_site_tls/server.py
18
2328
############################################################################### ## ## Copyright (C) 2011-2013 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
florian-dacosta/OpenUpgrade
addons/delivery/stock.py
32
8892
# -*- 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
noironetworks/nova
nova/db/sqlalchemy/migrate_repo/versions/273_sqlite_foreign_keys.py
79
4690
# Copyright 2014 Rackspace Hosting # # 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
SickGear/SickGear
lib/sg_futures/futures/thread.py
2
7291
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ThreadPoolExecutor.""" import atexit from six import PY2 if PY2: from . import _base else: from concurrent.futures import _base import itertools import Queue as queue import threading import wea...
gpl-3.0
thechampanurag/django-oscar
tests/integration/catalogue/reviews/model_tests.py
35
4527
from django.test import TestCase from django.core.exceptions import ValidationError from oscar.core.compat import get_user_model from oscar.apps.catalogue.reviews import models from oscar.test.factories import create_product from oscar.test.factories import UserFactory User = get_user_model() class TestAnAnonymousR...
bsd-3-clause
fvalenza/pinocchio
python/bindings.py
1
3282
import pinocchio as se3 from pinocchio.utils import np, npl, rand, skew, zero from test_case import TestCase class TestSE3(TestCase): def setUp(self): self.R = rand([3, 3]) self.R, _, _ = npl.svd(self.R) self.p = rand(3) self.m = se3.SE3(self.R, self.p) def test_se3(self): ...
bsd-2-clause
jianglu/mojo
mojo/public/tools/mojom_fetcher/pylib/fetcher/repository.py
26
3776
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from fetcher.dependency import Dependency from fetcher.mojom_directory import MojomDirectory from fetcher.mojom_file import MojomFile from mojom.p...
bsd-3-clause
tkinz27/ansible
v1/ansible/runner/lookup_plugins/sequence.py
85
7309
# (c) 2013, Jayson Vantuyl <jayson@aggressive.ly> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
gpl-3.0
joetsoi/moonstone
python/assets/collide.py
1
1897
from collections import UserList, defaultdict from enum import IntEnum, auto from pathlib import Path, PureWindowsPath from resources.extract import grouper from settings import MOONSTONE_DIR class Colliders(UserList): def __init__(self, data=None): super().__init__(data) self.last_len = 0 ...
agpl-3.0
DataDog/integrations-core
gunicorn/tests/test_metadata.py
1
2636
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import pytest from datadog_checks.gunicorn import GUnicornCheck from .common import CHECK_NAME, CONTAINER_NAME, GUNICORN_VERSION, INSTANCE # TODO: Test metadata in e2e when we can collect metadata from the ag...
bsd-3-clause
haricot/djangocms-bs4forcascade
cmsplugin_bs4forcascade/bootstrap4/secondary_menu.py
1
2963
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.forms import widgets from django.utils.html import format_html from django.utils.translation import ugettext_lazy as _, get_language_from_request from cms.plugin_pool import plugin_pool from cms.models.pagemodel import Page from cmsplugin_casca...
mit
lihui7115/ChromiumGStreamerBackend
build/android/adb_logcat_printer.py
69
7089
#!/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. """Shutdown adb_logcat_monitor and print accumulated logs. To test, call './adb_logcat_printer.py <base_dir>' where <base_dir> c...
bsd-3-clause
appscode/chartify
hack/make.py
2
3759
#!/usr/bin/env python # http://stackoverflow.com/a/14050282 def check_antipackage(): from sys import version_info sys_version = version_info[:2] found = True if sys_version < (3, 0): # 'python 2' from pkgutil import find_loader found = find_loader('antipackage') is not None ...
apache-2.0
Jackysonglanlan/devops
IDEs/sublime/shared-pkgs/Packages/pygments/all/pygments/styles/algol_nu.py
37
2278
# -*- coding: utf-8 -*- """ pygments.styles.algol_nu ~~~~~~~~~~~~~~~~~~~~~~~~ Algol publication style without underlining of keywords. This style renders source code for publication of algorithms in scientific papers and academic texts, where its format is frequently used. It is based on the ...
mit
allanstone/InteligenciaArtificial
Tarea 1/Polinomios/Test/TestPolynomial.py
1
2436
#!/usr/bin/env python3 #-*- coding: utf-8 -*- """ .. module:: testPolynomial .. moduleauthor:: Garrido Valencia Alan :synopsis: Este es un modulo de pruebas unitarias para el modulo Polynomial. """ import unittest from ..Scripts.Polinomio import Polynomial from sympy import symbols class TestPolynomial(unittest.T...
mit
astrobin/astrobin
astrobin_apps_premium/management/commands/send_expiring_subscription_autorenew_notifications.py
1
1731
# Python from datetime import datetime, timedelta # Django from django.conf import settings from django.core.management.base import BaseCommand from django.core.urlresolvers import reverse # Third party from subscription.models import UserSubscription # AstroBin from astrobin_apps_notifications.utils import push_not...
agpl-3.0
yavalvas/yav_com
build/matplotlib/doc/mpl_examples/pylab_examples/annotation_demo.py
3
5582
""" Some examples of how to annotate points in figures. You specify an annotation point xy=(x,y) and a text point xytext=(x,y) for the annotated points and text location, respectively. Optionally, you can specify the coordinate system of xy and xytext with one of the following strings for xycoords and textcoords (def...
mit
krinkin/linux
scripts/gdb/linux/symbols.py
588
6302
# # gdb helper commands and functions for Linux kernel debugging # # load kernel and module symbols # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb import os import re from linux import module...
gpl-2.0
MiLk/portia
slyd/slyd/bot.py
1
5966
""" Bot resource Defines bot/fetch endpoint, e.g.: curl -d '{"request": {"url": "http://scrapinghub.com/"}}' http://localhost:9001/bot/fetch The "request" is an object whose fields match the parameters of a Scrapy request: http://doc.scrapy.org/en/latest/topics/request-response.html#scrapy.http.Request Retur...
bsd-3-clause
nttks/jenkins-test
lms/djangoapps/courseware/management/commands/tests/test_dump_course.py
12
8598
# coding=utf-8 """Tests for Django management commands""" import json from path import path import shutil from StringIO import StringIO import tarfile from tempfile import mkdtemp from django.conf import settings from django.core.management import call_command from django.test.utils import override_settings from dja...
agpl-3.0
flexiant/xen
tools/xm-test/lib/XmTestLib/block_utils.py
26
1410
#!/usr/bin/python # Copyright (c) 2006 XenSource Inc. # Author: Ewan Mellor <ewan@xensource.com> import time from XmTestLib import * import xen.util.blkif __all__ = [ "block_attach", "block_detach" ] def get_state(domain, devname): (path, number) = xen.util.blkif.blkdev_name_to_number(devname) s, o = tr...
gpl-2.0
kparal/anaconda
tests/lib/filelist.py
9
1953
# # filelist.py: method for determining which files to check # # Copyright (C) 2014 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; either version 2.1 of the License, or ...
gpl-2.0
bebby520/essay_devel
venv/lib/python2.7/site-packages/requests/packages/chardet/universaldetector.py
1776
6840
######################## 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...
apache-2.0
cdrttn/samba-regedit
lib/dnspython/tests/dnssec.py
56
9344
# Copyright (C) 2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMIN...
gpl-3.0
macs03/demo-cms
cms/lib/python2.7/site-packages/cms/plugin_rendering.py
4
8482
# -*- coding: utf-8 -*- from django.template import Template, Context from django.template.loader import render_to_string from django.utils import six from django.utils.safestring import mark_safe from cms.models.placeholdermodel import Placeholder from cms.plugin_processors import (plugin_meta_context_processor, mark...
mit
hogarthj/ansible
lib/ansible/modules/system/beadm.py
56
11657
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@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': '1.1', ...
gpl-3.0
darktears/chromium-crosswalk
tools/cr/cr/base/context.py
103
6668
# Copyright 2014 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. """Application context management for the cr tool. Contains all the support code to enable the shared context used by the cr tool. This includes the configu...
bsd-3-clause
sushantlp/wrdly
public/bower_components/jvectormap/converter/processor.py
130
20218
import sys import json import csv import shapely.wkb import shapely.geometry import shapely.ops import codecs import os import inspect import copy from osgeo import ogr from osgeo import osr from booleano.parser import Grammar, EvaluableParseManager, SymbolTable, Bind from booleano.operations import Variable class Ma...
gpl-3.0
saiwing-yeung/scikit-learn
examples/model_selection/plot_learning_curve.py
33
4505
""" ======================== Plotting Learning Curves ======================== On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can be found in ...
bsd-3-clause
fluks/youtube-dl
youtube_dl/extractor/vidme.py
36
2580
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, str_to_int, ) class VidmeIE(InfoExtractor): _VALID_URL = r'https?://vid\.me/(?:e/)?(?P<id>[\da-zA-Z]+)' _TEST = { 'url': 'https://vid.me/QNB', 'md...
unlicense
etzhou/edx-platform
lms/djangoapps/courseware/entrance_exams.py
34
6544
""" This file contains all entrance exam related utils/logic. """ from django.conf import settings from courseware.access import has_access from courseware.model_data import FieldDataCache, ScoresClient from opaque_keys.edx.keys import UsageKey from student.models import EntranceExamConfiguration from util.milestones_...
agpl-3.0
chienlieu2017/it_management
odoo/addons/mail/tests/test_invite.py
20
2267
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.mail.tests.common import TestMail from odoo.tools import mute_logger class TestInvite(TestMail): @mute_logger('odoo.addons.mail.models.mail_mail') def test_invite_email(self): mail_inv...
gpl-3.0
harshavardhana/minio-py
examples/list_buckets.py
3
1026
# -*- coding: utf-8 -*- # Minio Python Library for Amazon S3 Compatible Cloud Storage, (C) 2015 Minio, 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/licen...
apache-2.0
farhi-naz/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/ordered_dict.py
131
2984
# Copyright (c) 2009 Raymond Hettinger. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, ...
bsd-3-clause
apporc/cinder
cinder/tests/unit/volume/drivers/netapp/eseries/test_library.py
2
64492
# Copyright (c) 2014 Andrew Kerr # Copyright (c) 2015 Alex Meade # Copyright (c) 2015 Rushil Chugh # Copyright (c) 2015 Yogesh Kshirsagar # Copyright (c) 2015 Michael Price # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance w...
apache-2.0
dischinator/pyload
module/plugins/accounts/TurbobitNet.py
3
2354
# -*- coding: utf-8 -*- import re import time from module.plugins.internal.Account import Account from module.plugins.internal.misc import parse_html_form, set_cookie class TurbobitNet(Account): __name__ = "TurbobitNet" __type__ = "account" __version__ = "0.10" __status__ = "testing" __d...
gpl-3.0
andela-ooladayo/django
tests/reserved_names/tests.py
405
1686
from __future__ import unicode_literals import datetime from django.test import TestCase from .models import Thing class ReservedNameTests(TestCase): def generate(self): day1 = datetime.date(2005, 1, 1) Thing.objects.create(when='a', join='b', like='c', drop='d', alter='e', having='...
bsd-3-clause
cloudbase/nova-virtualbox
nova/tests/unit/api/openstack/compute/contrib/test_quota_classes.py
26
6784
# Copyright 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 requ...
apache-2.0
poussik/vcrpy
tests/integration/test_tornado.py
2
13097
# -*- coding: utf-8 -*- '''Test requests' interaction with vcr''' import json import pytest import vcr from vcr.errors import CannotOverwriteExistingCassetteException from assertions import assert_cassette_empty, assert_is_json tornado = pytest.importorskip("tornado") http = pytest.importorskip("tornado.httpclient"...
mit
nharraud/b2share
invenio/legacy/bibsort/scripts/bibsort.py
13
2546
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2010, 2011, 2012 CERN. # # Invenio 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 optio...
gpl-2.0
momentum/canteen
canteen_tests/test_adapters/test_abstract.py
2
33257
# -*- coding: utf-8 -*- """ abstract adapter tests ~~~~~~~~~~~~~~~~~~~~~~ tests abstract adapter classes, that enforce/expose interfaces known to the model engine proper. :author: Sam Gammon <sg@samgammon.com> :copyright: (c) Sam Gammon, 2014 :license: This software makes use of the MIT Open Source Li...
mit
zzacharo/inspire-next
tests/integration/workflows/test_arxiv_workflow.py
1
6964
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
Intel-tensorflow/tensorflow
tensorflow/python/kernel_tests/linalg/linear_operator_kronecker_test.py
14
9997
# 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
Jorge-Rodriguez/ansible
lib/ansible/modules/cloud/profitbricks/profitbricks_nic.py
59
8530
#!/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
yancharkin/games_nebula_goglib_scripts
konung_legend_of_the_north/settings.py
1
10548
import sys, os import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GLib import gettext import imp try: from ConfigParser import ConfigParser as ConfigParser except: from configparser import ConfigParser as ConfigParser nebula_dir = os.getenv('NEBULA_DIR') modules_dir = nebula_dir +...
gpl-3.0
nrego/westpa
lib/examples/nacl_openmm/openmm_propagator.py
4
8843
from __future__ import division, print_function; __metaclass__ = type import os import errno import random import time import numpy as np import west from west.propagators import WESTPropagator from west import Segment from west.states import BasisState, InitialState import simtk.openmm.openmm as openmm import simtk.u...
gpl-3.0
capturePointer/or-tools
examples/python/p_median.py
34
3462
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 ...
apache-2.0
rsalmaso/django-allauth
allauth/socialaccount/providers/gitlab/tests.py
2
1656
# -*- coding: utf-8 -*- from allauth.socialaccount.providers.gitlab.provider import GitLabProvider from allauth.socialaccount.tests import OAuth2TestsMixin from allauth.tests import MockedResponse, TestCase class GitLabTests(OAuth2TestsMixin, TestCase): provider_id = GitLabProvider.id def get_mocked_response...
mit
shaunbrady/boto
tests/integration/configservice/test_configservice.py
93
2081
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
mit
dmlc/mxnet
example/nce-loss/lstm_net.py
26
4926
# 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
abonaca/gary
gary/potential/custom.py
1
4179
# coding: utf-8 """ Potential used in Price-Whelan et al. (in prep.) TODO """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Third-party from astropy.constants import G import astropy.units as u import numpy as np # Project # from .cpotential import CCompositePotent...
mit
bregman-arie/ansible
lib/ansible/plugins/filter/network.py
37
11389
# # {c) 2017 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is ...
gpl-3.0
serl/hls-bba-testbed
vlc_test.py
1
4096
import sys, itertools from pylibs.test import Test, Player, BwChange, DelayChange, TcpDump from pylibs.generic import PlainObject server_url = 'http://192.168.100.10:3000/static' bigbuckbunny8_url = server_url + '/bbb8/play_size.m3u8' # rates: 350k 470k 630k 845k 1130k 1520k 2040k 2750k, duration (s): ~600 settings =...
mit
bitmazk/django-event-rsvp
event_rsvp/migrations/0006_auto__chg_field_event_max_seats_per_guest.py
1
7401
# flake8: noqa # -*- 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): # Changing field 'Event.max_seats_per_guest' db.alter_column('event_rsvp_event', 'max_seats_...
mit
xxd3vin/spp-sdk
opt/Python27/Lib/encodings/iso8859_6.py
593
11089
""" Python Character Mapping Codec iso8859_6 generated from 'MAPPINGS/ISO8859/8859-6.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
mit
jinie/sublime-wakatime
packages/wakatime/packages/pygments_py3/pygments/lexers/c_like.py
72
16179
# -*- coding: utf-8 -*- """ pygments.lexers.c_like ~~~~~~~~~~~~~~~~~~~~~~ Lexers for other C-like languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, inherit,...
bsd-3-clause
mozilla/addons-server
services/utils.py
4
3245
import logging import logging.config import os import posixpath import re import sys import MySQLdb as mysql import sqlalchemy.pool as pool from urllib.parse import urlencode from services.settings import settings import olympia.core.logger # This is not DRY: it's a copy of amo.helpers.user_media_path, to avoid a...
bsd-3-clause
jlegendary/youtube-dl
youtube_dl/extractor/kankan.py
124
1738
from __future__ import unicode_literals import re import hashlib from .common import InfoExtractor _md5 = lambda s: hashlib.md5(s.encode('utf-8')).hexdigest() class KankanIE(InfoExtractor): _VALID_URL = r'https?://(?:.*?\.)?kankan\.com/.+?/(?P<id>\d+)\.shtml' _TEST = { 'url': 'http://yinyue.kankan...
unlicense
liavkoren/djangoDev
django/contrib/gis/sitemaps/kml.py
49
2544
from django.apps import apps from django.core import urlresolvers from django.contrib.sitemaps import Sitemap from django.contrib.gis.db.models.fields import GeometryField from django.db import models class KMLSitemap(Sitemap): """ A minimal hook to produce KML sitemaps. """ geo_format = 'kml' de...
bsd-3-clause
johankaito/fufuka
microblog/old-flask/lib/python2.7/site-packages/werkzeug/test.py
116
34255
# -*- coding: utf-8 -*- """ werkzeug.test ~~~~~~~~~~~~~ This module implements a client to WSGI applications for testing. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import mimetypes from time import time from...
apache-2.0
yvaucher/l10n-italy
__unported__/l10n_it_ricevute_bancarie/wizard/__init__.py
12
1330
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 Andrea Cometa. # Email: info@andreacometa.it # Web site: http://www.andreacometa.it # Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2...
agpl-3.0
hammerlab/mhctools
test/test_mhc_formats.py
1
10284
from mhctools.parsing import ( parse_netmhcpan28_stdout, parse_netmhcpan3_stdout, parse_netmhc3_stdout, parse_netmhc4_stdout, ) def test_netmhc3_stdout(): """ Test parsing of NetMHC output of predictions of HLA-A*02:01 and HLA-A*02:03 for three epitopes: - CFTWNQMNL - SLYNTVATL - ...
apache-2.0
acenario/Payable
lib/python2.7/site-packages/setuptools/command/upload_docs.py
332
6811
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ import os import socket import zipfile import tempfile import sys import shutil from base64 import standard_b64encode from pkg_resources import iter_entry_points from distuti...
mit
moonso/genmod
genmod/utils/get_features.py
1
2303
from __future__ import (print_function) import logging from genmod.utils import INTERESTING_SO_TERMS, EXONIC_SO_TERMS def check_vep_annotation(variant): """ Return a set with the genes that vep has annotated this variant with. Vep annotates all variants but we are only interested in the exonic ones....
mit
wangxiangyu/horizon
openstack_dashboard/dashboards/admin/defaults/tabs.py
82
1417
# Copyright 2013 Kylin, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
USU-Robosub/Gilligan
rosWorkspace/Brain/src/utils.py
2
4579
import rospy import smach from Robosub.msg import HighLevelControl from SubImageRecognition.msg import ImgRecObject def move(direction, motion_type, value): move.msg.Direction = direction move.msg.MotionType = motion_type move.msg.Value = value move.pub.publish(move.msg) move.msg = HighLevelControl()...
apache-2.0
dhomeier/astropy
astropy/units/__init__.py
8
1312
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for defining and converting between different physical units. This code is adapted from the `pynbody <https://github.com/pynbody/pynbody>`_ units module written by Andrew Pontzen, who has granted the Ast...
bsd-3-clause
HopkinsIDD/EpiForecastStatMech
epi_forecast_stat_mech/iterative_estimator.py
1
10955
# Lint as: python3 """An iterative epi_forecast_stat_mech.estimator_base.Estimator.""" import collections import functools import pickle from epi_forecast_stat_mech import data_model from epi_forecast_stat_mech import estimator_base from epi_forecast_stat_mech import mask_time from epi_forecast_stat_mech import optim_...
gpl-3.0
Dangetsu/vnr
Frameworks/Sakura/py/libs/freem/game.py
1
5284
# coding: utf8 # game.py # 10/20/2013 jichi __all__ = 'GameApi', if __name__ == '__main__': # DEBUG import sys sys.path.append("..") import re from sakurakit import sknetio from sakurakit.skcontainer import uniquelist from sakurakit.skstr import unescapehtml #from sakurakit.skdebug import dwarn class GameApi(ob...
gpl-3.0
einarhuseby/arctic
tests/integration/tickstore/test_ts_delete.py
3
1908
from datetime import datetime as dt from mock import patch import numpy as np from pandas.util.testing import assert_frame_equal import pytest from arctic import arctic as m from arctic.date import DateRange, CLOSED_OPEN, mktz from arctic.exceptions import OverlappingDataException, \ NoDataFoundException def tes...
lgpl-2.1
jabesq/home-assistant
tests/components/zha/test_light.py
1
8829
"""Test zha light.""" import asyncio from unittest.mock import MagicMock, call, patch, sentinel from homeassistant.components.light import DOMAIN from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE from .common import ( async_enable_traffic, async_init_zigpy_device, async_test_device_join, ...
apache-2.0
admin-zhx/httpbin
httpbin/core.py
6
20354
# -*- coding: utf-8 -*- """ httpbin.core ~~~~~~~~~~~~ This module provides the core HttpBin experience. """ import base64 import json import os import random import time import uuid from flask import Flask, Response, request, render_template, redirect, jsonify as flask_jsonify, make_response, url_for from werkzeug....
isc
ldirer/scikit-learn
sklearn/feature_extraction/tests/test_text.py
8
35969
from __future__ import unicode_literals import warnings from sklearn.feature_extraction.text import strip_tags from sklearn.feature_extraction.text import strip_accents_unicode from sklearn.feature_extraction.text import strip_accents_ascii from sklearn.feature_extraction.text import HashingVectorizer from sklearn.fe...
bsd-3-clause
annajordanous/network-analysis
genre_relationships.py
2
7928
''' Created on Apr 9, 2014 @author: daniel-allington ''' # Creates a new database containing: (a) table of genre strings, with # absolute frequencies, in order of frequency, leaving out any below a # given threshold of frequency; (b) as a but for tags; (c) table of # users with tracks, giving (i) all genre strings as...
gpl-2.0
sqall01/alertR
shared_code/clients_sensor/lib/sensor/eventHandler.py
1
2632
#!/usr/bin/env python3 # written by sqall # twitter: https://twitter.com/sqall01 # blog: https://h4des.org # github: https://github.com/sqall01 # # Licensed under the GNU Affero General Public License, version 3. import logging import os from typing import List, Any from ..client import EventHandler from ..globalData...
agpl-3.0
dymkowsk/mantid
Framework/PythonInterface/test/python/plugins/algorithms/FilterLogByTimeTest.py
3
5672
from __future__ import (absolute_import, division, print_function) import unittest import numpy from mantid.simpleapi import * from mantid.kernel import * from mantid.api import * class FilterLogByTimeTest(unittest.TestCase): __ws = None ''' Log file contents. 2008-06-17T11:10:44 -0.86526 2008-06...
gpl-3.0
macloo/flasky
migrations/versions/38c4e85512a9_initial_migration.py
182
1163
"""initial migration Revision ID: 38c4e85512a9 Revises: None Create Date: 2013-12-27 01:23:59.392801 """ # revision identifiers, used by Alembic. revision = '38c4e85512a9' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust!...
mit
DailyActie/Surrogate-Model
01-codes/OpenMDAO-Framework-dev/openmdao.util/src/openmdao/util/grab_distrib.py
1
3791
#!/usr/bin/env python import logging import sys from pkg_resources import Requirement from setuptools.package_index import PackageIndex _logger = logging.getLogger() _pypi = 'http://pypi.python.org/simple' def _enable_console(level): """ Configure logging to receive log messages at the console. """ global...
mit
leiferikb/bitpop
src/third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py
188
3699
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # Copyright (C) 2010 ProFUSION embedded systems # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
gpl-3.0
soutys/aorn
tests/test_samplesstore.py
1
1983
# -*- coding: utf-8 -*- '''Samples storage module tests ''' from __future__ import with_statement, division, absolute_import, print_function import sys from tempfile import NamedTemporaryFile try: from io import StringIO except ImportError: from StringIO import StringIO from aorn.samplesstore import STDIN_F...
mit