repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
etos/django
django/contrib/contenttypes/migrations/0002_remove_content_type_name.py
134
1103
from django.db import migrations, models def add_legacy_name(apps, schema_editor): ContentType = apps.get_model('contenttypes', 'ContentType') for ct in ContentType.objects.all(): try: ct.name = apps.get_model(ct.app_label, ct.model)._meta.object_name except LookupError: ...
bsd-3-clause
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/tests/python/integration/test_scan.py
2
1615
import tvm import numpy as np def test_scan(): m = tvm.var("m") n = tvm.var("n") X = tvm.placeholder((m, n), name="X") s_state = tvm.placeholder((m, n)) s_init = tvm.compute((1, n), lambda _, i: X[0, i]) s_update = tvm.compute((m, n), lambda t, i: s_state[t-1, i] + X[t, i]) res = tvm.scan(s...
apache-2.0
Xeralux/tensorflow
tensorflow/python/kernel_tests/transpose_op_test.py
33
18969
# 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
paolodedios/tensorflow
tensorflow/python/keras/distribute/sidecar_evaluator_test.py
6
10301
# Lint as: python3 # Copyright 2020 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 ...
apache-2.0
vbshah1992/microblog
flask/lib/python2.7/site-packages/wtforms/ext/django/templatetags/wtforms.py
104
2793
""" Template tags for easy WTForms access in Django templates. """ from __future__ import unicode_literals import re from django import template from django.conf import settings from django.template import Variable from ....compat import iteritems register = template.Library() class FormFieldNode(template.Node): ...
bsd-3-clause
thunderhoser/GewitterGefahr
gewittergefahr/scripts/compare_human_vs_machine_interpretn.py
1
26120
"""Compares human-generated vs. machine-generated interpretation map. This script handles 3 types of interpretation maps: - saliency - Grad-CAM - guided Grad-CAM """ import os.path import argparse import numpy import matplotlib matplotlib.use('agg') import matplotlib.pyplot as pyplot from gewittergefahr.gg_utils imp...
mit
almeidapaulopt/frappe
frappe/model/utils/user_settings.py
4
1811
# Settings saved per user basis # such as page_limit, filters, last_view import frappe, json from six import iteritems, string_types from frappe import safe_decode def get_user_settings(doctype, for_update=False): user_settings = frappe.cache().hget('_user_settings', '{0}::{1}'.format(doctype, frappe.session.user)...
mit
ondras/TeaJS
deps/v8/testing/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...
bsd-3-clause
phiros/testci
boards/qemu-i386/dist/term.py
104
4344
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2014 René Kijewski <rene.kijewski@fu-berlin.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 Foundation, either version 3 of the Licens...
lgpl-2.1
ncdesouza/bookworm
env/lib/python2.7/site-packages/werkzeug/testsuite/utils.py
146
11435
# -*- coding: utf-8 -*- """ werkzeug.testsuite.utils ~~~~~~~~~~~~~~~~~~~~~~~~ General utilities. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import unittest from datetime import datetime from functools import part...
gpl-3.0
jdmcbr/toolz
toolz/compatibility.py
15
1310
import operator import sys PY3 = sys.version_info[0] > 2 PY33 = sys.version_info[0] == 3 and sys.version_info[1] == 3 PY34 = sys.version_info[0] == 3 and sys.version_info[1] == 4 PYPY = hasattr(sys, 'pypy_version_info') __all__ = ('map', 'filter', 'range', 'zip', 'reduce', 'zip_longest', 'iteritems', 'iterk...
bsd-3-clause
curbthepain/revkernel_us990
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
OCA/stock-logistics-warehouse
stock_location_lockdown/models/stock_location.py
2
1124
# Copyright 2019 Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models, _ from odoo.exceptions import UserError class StockLocation(models.Model): _inherit = 'stock.location' block_stock_entrance = fields.Boolean( help="if this box is checked, putti...
agpl-3.0
zhaodelong/django
tests/template_tests/syntax_tests/test_list_index.py
521
2694
from django.test import SimpleTestCase from ..utils import setup class ListIndexTests(SimpleTestCase): @setup({'list-index01': '{{ var.1 }}'}) def test_list_index01(self): """ List-index syntax allows a template to access a certain item of a subscriptable object. """ ...
bsd-3-clause
openstack-infra/shade
shade/tests/functional/test_limits.py
1
1840
# 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 t...
apache-2.0
mlalic/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/mock.py
465
6715
# Copyright 2011, 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 of conditions and the f...
mpl-2.0
yan12125/youtube-dl
youtube_dl/extractor/plays.py
68
1841
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class PlaysTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?plays\.tv/(?:video|embeds)/(?P<id>[0-9a-f]{18})' _TESTS = [{ 'url': 'https://plays.tv/video/56af17f56c...
unlicense
marcore/edx-platform
lms/djangoapps/courseware/tests/test_courses.py
6
14072
# -*- coding: utf-8 -*- """ Tests for course access """ import itertools import ddt from django.conf import settings from django.test.utils import override_settings from django.core.urlresolvers import reverse from django.test.client import RequestFactory import mock from nose.plugins.attrib import attr from opaque_ke...
agpl-3.0
NSLS-II-CSX/CAAutoConfig
CAAutoConfig/files.py
1
2636
import xml.etree.ElementTree as ET from xml.dom import minidom # # Autoconfig class for archive XML files. # class CAFile: def __init__(self, filename = None): if filename is not None: self.openFile(filename); def openFile(self, filename): """Open archiver XML file""" self._tree = ET.parse(filena...
bsd-2-clause
gandreello/openthread
tools/harness-automation/cases/sed_9_2_17.py
16
1871
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread 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: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
aichi/Arduino-2
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/packages/six.py
2375
11628
"""Utilities for writing code that runs on Python 2 and 3""" #Copyright (c) 2010-2011 Benjamin Peterson #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 l...
lgpl-2.1
denisff/python-for-android
python3-alpha/extra_modules/bs4/builder/_lxml.py
46
5603
__all__ = [ 'LXMLTreeBuilderForXML', 'LXMLTreeBuilder', ] import collections from lxml import etree from bs4.element import Comment, Doctype, NamespacedAttribute from bs4.builder import ( FAST, HTML, HTMLTreeBuilder, PERMISSIVE, TreeBuilder, XML) from bs4.dammit import UnicodeDammit...
apache-2.0
thiderman/piper
test/test_version.py
1
1816
from piper.version import Version from piper.version import StaticVersion from piper.version import GitVersion import jsonschema import pytest import mock class StaticVersionTest: def setup_method(self, method): self.build = mock.Mock() self.v = '32.1.12' self.raw = { 'class':...
mit
jkonecki/autorest
AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/setup.py
2
1091
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
cparawhore/ProyectoSubastas
site-packages/django/contrib/gis/db/models/manager.py
83
3548
from django.db.models.manager import Manager from django.contrib.gis.db.models.query import GeoQuerySet class GeoManager(Manager): "Overrides Manager to return Geographic QuerySets." # This manager should be used for queries on related fields # so that geometry columns on Oracle and MySQL are selected ...
mit
iAmMrinal0/HTPC-Manager
libs/cherrypy/test/test_tutorials.py
42
7190
import sys import cherrypy from cherrypy.test import helper class TutorialTest(helper.CPWebCase): def setup_server(cls): conf = cherrypy.config.copy() def load_tut_module(name): """Import or reload tutorial module as needed.""" cherrypy.config.reset() ...
mit
joisig/grit-i18n
grit/shortcuts.py
62
2930
#!/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. '''Stuff to prevent conflicting shortcuts. ''' from grit import lazy_re class ShortcutGroup(object): '''Manages a list of cliq...
bsd-2-clause
amaozhao/basecms
cms/test_utils/project/pluginapp/plugins/meta/migrations_django/0001_initial.py
66
1385
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0001_initial'), ] operations = [ migrations.CreateModel( name='TestPluginModel', fields=[ ...
mit
PaesslerAG/django-performance-testing
django_performance_testing/test_runner.py
1
4462
# TODO: app.ready happens before the command is imported - how to test? from django.conf import settings from django.test import utils from django_performance_testing.serializer import \ Writer, get_datafile_path from django_performance_testing.utils import \ multi_context_manager, wrap_cls_method_in_ctx_manage...
bsd-3-clause
Northrend/mxnet
example/deep-embedded-clustering/autoencoder.py
18
10317
# 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
ronojoy/BDA_py_demos
demos_ch10/demo10_2.py
19
1606
"""Bayesian data analysis Chapter 10, demo 2 Importance sampling example """ from __future__ import division import numpy as np from scipy import stats import matplotlib.pyplot as plt # edit default plot settings (colours from colorbrewer2.org) plt.rc('font', size=14) plt.rc('lines', color='#377eb8', linewidth=2, m...
gpl-3.0
toshywoshy/ansible
lib/ansible/modules/network/f5/bigiq_regkey_license.py
38
15028
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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
heemanshu/swift_liberty
swift/common/middleware/name_check.py
26
5211
# Copyright (c) 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 agreed to ...
apache-2.0
rgayon/plaso
tests/parsers/networkminer.py
1
1713
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the NetworkMiner fileinfos parser.""" from __future__ import unicode_literals import unittest from plaso.parsers import networkminer from tests.parsers import test_lib class NetworkMinerUnitTest(test_lib.ParserTestCase): """Tests for the NetworkMiner f...
apache-2.0
mice-software/maus
third_party/build/scons-2.0.1/lib/scons-2.0.1/SCons/Tool/Subversion.py
61
2710
"""SCons.Tool.Subversion.py Tool-specific initialization for Subversion. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons F...
gpl-3.0
lawrencebenson/thefuck
tests/rules/test_mvn_no_command.py
3
3648
import pytest from thefuck.rules.mvn_no_command import match, get_new_command from tests.utils import Command @pytest.mark.parametrize('command', [ Command(script='mvn', stdout='[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<g...
mit
fabianvf/osf.io
website/addons/dataverse/model.py
3
12293
# -*- coding: utf-8 -*- from time import sleep import requests import urlparse import httplib as http import pymongo from modularodm import fields from framework.auth.core import _get_current_user from framework.auth.decorators import Auth from framework.exceptions import HTTPError from website.addons.base import ( ...
apache-2.0
sputnick-dev/weboob
modules/ing/pages/login.py
7
4343
# -*- coding: utf-8 -*- # Copyright(C) 2009-2014 Florent Fourcot, Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
agpl-3.0
woylaski/notebook
graphic/kivy-master/kivy/modules/_webdebugger.py
14
205693
# -*- coding: utf-8 -*- import threading import json from gc import get_objects, garbage from kivy.clock import Clock from kivy.cache import Cache from collections import OrderedDict from kivy.logger import Logger try: from flask import Flask, render_template_string, make_response except ImportError: Logger.e...
gpl-3.0
jjingrong/PONUS-1.2
venv/build/django/django/db/transaction.py
77
20601
""" This module implements a transaction manager that can be used to define transaction handling in a request or view function. It is used by transaction control middleware and decorators. The transaction manager can be in managed or in auto state. Auto state means the system is using a commit-on-save strategy (actual...
mit
dmpop/sonnenhut
src/sonnenhut/common.py
1
4924
import configparser import os import feedparser import requests from astral import Astral, GoogleGeocoder def getconfig(configfile='sonnenhut.ini'): """Read INI file or raise FileNotFoundError :param str configfile: filename (without path) to the INI file. Will be searched relativ...
gpl-3.0
AkA84/edx-platform
common/djangoapps/util/sandboxing.py
162
1617
import re from django.conf import settings # We'll make assets named this be importable by Python code in the sandbox. PYTHON_LIB_ZIP = "python_lib.zip" def can_execute_unsafe_code(course_id): """ Determine if this course is allowed to run unsafe code. For use from the ModuleStore. Checks the `course_i...
agpl-3.0
agogear/python-1
llluiop/0023/MyDjango/MyDjango/urls.py
37
1162
"""MyDjango URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/dev/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
mit
ollie314/browserscope
bin/reflow/analysis_downloader.py
9
6458
#!/usr/bin/python import code import getpass import os import sys import time sys.path.append('../../') sys.path.append('../../../google_appengine') sys.path.append('../../../google_appengine/lib/yaml/lib') sys.path.append('../../../google_appengine/lib/webob') sys.path.append('../../../google_appengine/lib/antlr3')...
apache-2.0
wildjan/Flask
Work/Trivia - Module 5/env/Lib/site-packages/pip/commands/search.py
344
4736
import sys import textwrap import pip.download from pip.basecommand import Command, SUCCESS from pip.util import get_terminal_size from pip.log import logger from pip.backwardcompat import xmlrpclib, reduce, cmp from pip.exceptions import CommandError from pip.status_codes import NO_MATCHES_FOUND from pip._vendor imp...
apache-2.0
Onirik79/aaritmud
src/commands/command_drop.py
1
6825
# -*- coding: utf-8 -*- # (TD) il drop all deve far cascare tutti gli oggetti no look list, per far evitare che i pg si riempiano #= IMPORT ====================================================================== from src.color import color_first_upper from src.command import get_command_syntax from src.enums...
gpl-2.0
optima-ict/odoo
addons/project/__openerp__.py
20
1726
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Project Management', 'version': '1.1', 'website': 'https://www.odoo.com/page/project-management', 'category': 'Project Management', 'sequence': 10, 'summary': 'Projects, Tasks', 'de...
agpl-3.0
ashcoding/titanium_mobile
support/android/debugger.py
37
2176
#!/usr/bin/env python # This server acts as an intermediary between # an ADB forwarded Titanium application w/ debugging # and a local debug server that is listening for a connection # TODO: this will work for on-device debugging import asyncore import socket import sys import time def debug(msg): print "[DEBUG] "+m...
apache-2.0
Designist/sympy
sympy/polys/domains/tests/test_quotientring.py
98
1433
"""Tests for quotient rings.""" from sympy import QQ, ZZ from sympy.abc import x, y from sympy.polys.polyerrors import NotReversible from sympy.utilities.pytest import raises from sympy.core.compatibility import range def test_QuotientRingElement(): R = QQ.old_poly_ring(x)/[x**10] X = R.convert(x) ass...
bsd-3-clause
cecep-edu/edx-platform
lms/djangoapps/courseware/entrance_exams.py
26
6823
""" This file contains all entrance exam related utils/logic. """ from courseware.access import has_access from courseware.model_data import FieldDataCache, ScoresClient from opaque_keys.edx.keys import UsageKey from opaque_keys.edx.locator import BlockUsageLocator from student.models import EntranceExamConfiguration ...
agpl-3.0
zaina/nova
nova/servicegroup/drivers/db.py
23
3982
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
apache-2.0
klahnakoski/jx-sqlite
jx_sqlite/expressions/string_op.py
3
1957
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import, divisi...
mpl-2.0
Pexego/odoo
addons/report_intrastat/__openerp__.py
116
1888
# -*- 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
akibsayyed/paimei
pydbgc.py
6
17889
#!c:\python\python.exe """ PyDbg Just-In-Time Debugger Copyright (C) 2006 Cody Pierce <codyrpierce@gmail.com> $Id: pydbgc.py 233 2009-02-12 19:01:53Z codyrpierce $ Description: This quick and dirty hack gives you a PyDbg command line console with WinDbg-esque commands. One of the cooler features of...
gpl-2.0
NeCTAR-RC/cinder
cinder/volume/qos_specs.py
3
10225
# Copyright (c) 2013 eBay Inc. # Copyright (c) 2013 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 # # ...
apache-2.0
ministryofjustice/open-data-platform
feedback/migrations/0001_initial.py
1
1478
# -*- 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 'Feedback' db.create_table(u'feedback_feedback', ( ...
mit
yongshengwang/hue
desktop/core/ext-py/pycrypto-2.6.1/build/lib.linux-x86_64-2.7/Crypto/PublicKey/pubkey.py
125
8221
# # pubkey.py : Internal functions for public key operations # # Part of the Python Cryptography Toolkit # # Written by Andrew Kuchling, Paul Swartz, and others # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent th...
apache-2.0
testeddoughnut/multistack
multistack/clients/cinder.py
1
1034
#!/usr/bin/env python # # Copyright 2014 M. David Bennett # # 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 a...
apache-2.0
ravibhure/ansible
test/units/modules/remote_management/oneview/test_oneview_fcoe_network.py
78
5988
# -*- coding: utf-8 -*- # # Copyright (2016-2017) Hewlett Packard Enterprise Development LP # # 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 License, or # (at your optio...
gpl-3.0
Vignesh2208/Awlsim
awlsim/common/subprocess.py
2
1548
# -*- coding: utf-8 -*- # # subprocess wrapper # # Copyright 2014 Michael Buesch <m@bues.ch> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your opti...
gpl-2.0
jwinzer/OpenSlides
server/tests/integration/motions/test_motions.py
1
39183
import json import pytest from django.contrib.auth import get_user_model from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient from openslides.core.config import config from openslides.core.models import Tag from openslides.motions.models import ( Category, ...
mit
Adai0808/scikit-learn
examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py
218
3893
""" ============================================== Feature agglomeration vs. univariate selection ============================================== This example compares 2 dimensionality reduction strategies: - univariate feature selection with Anova - feature agglomeration with Ward hierarchical clustering Both metho...
bsd-3-clause
3dfxmadscientist/odoo_vi
addons/account_analytic_plans/wizard/analytic_plan_create_model.py
384
2829
# -*- 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
kumarkrishna/sympy
sympy/physics/quantum/qft.py
58
6312
"""An implementation of qubits and gates acting on them. Todo: * Update docstrings. * Update tests. * Implement apply using decompose. * Implement represent using decompose or something smarter. For this to work we first have to implement represent for SWAP. * Decide if we want upper index to be inclusive in the co...
bsd-3-clause
wtgme/labeldoc2vec
build/lib.linux-x86_64-2.7/gensim/models/hdpmodel.py
3
22125
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012 Jonathan Esterhazy <jonathan.esterhazy at gmail.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html # # HDP inference code is adapted from the onlinehdp.py script by # Chong Wang (chongw at cs.princeton.edu). # http://www.c...
lgpl-2.1
tiexinliu/odoo_addons
smile_account_voucher_group/models/account_voucher.py
3
10231
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
crakensio/django_training
lib/python2.7/site-packages/docutils/core.py
117
29426
# $Id: core.py 7466 2012-06-25 14:56:51Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Calling the ``publish_*`` convenience functions (or instantiating a `Publisher` object) with component names will result in default behavior. For custom beha...
cc0-1.0
gandalfn/maia
cpp/codegen/h2def/defsparser.py
20
5793
# -*- Mode: Python; py-indent-offset: 4 -*- import os, sys import scmexpr from definitions import BoxedDef, EnumDef, FlagsDef, FunctionDef, \ InterfaceDef, MethodDef, ObjectDef, PointerDef, VirtualDef include_path = ['.'] class IncludeParser(scmexpr.Parser): """A simple parser that follows include statements...
lgpl-3.0
mlperf/training_results_v0.5
v0.5.0/google/cloud_v2.512/resnet-tpuv2-512/code/resnet/model/models/official/recommendation/neumf_model.py
4
19328
# 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
40223246/0622cdb-Final-TEST2-1
static/Brython3.1.3-20150514-095342/Lib/ui/slider.py
603
2394
from . import widget from browser import doc,html class Slider(widget.Widget): def __init__(self, id=None, label=False): self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all") widget.Widget.__init__(self, self._div_shell, 'slider', id) self._h...
gpl-3.0
horance-liu/tensorflow
tensorflow/contrib/data/python/kernel_tests/resample_test.py
23
2942
# 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
kapilt/ansible
contrib/inventory/rudder.py
195
10674
#!/usr/bin/env python # Copyright (c) 2015, Normation SAS # # Inspired by the EC2 inventory plugin: # https://github.com/ansible/ansible/blob/devel/contrib/inventory/ec2.py # # 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 Publ...
gpl-3.0
martinwicke/tensorflow
tensorflow/contrib/layers/python/layers/layers.py
2
92503
# 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
harisibrahimkv/django
django/db/models/fields/__init__.py
9
85004
import collections import copy import datetime import decimal import itertools import uuid import warnings from base64 import b64decode, b64encode from functools import total_ordering from django import forms from django.apps import apps from django.conf import settings from django.core import checks, exceptions, vali...
bsd-3-clause
tmerrick1/spack
var/spack/repos/builtin/packages/xorg-cf-files/package.py
5
1845
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
pheanex/ansible
lib/ansible/plugins/lookup/etcd.py
151
2323
# (c) 2013, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
rickerc/nova_audit
nova/virt/hyperv/constants.py
11
1818
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Cloudbase Solutions Srl # 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.ap...
apache-2.0
Dandandan/wikiprogramming
jsrepl/build/extern/python/unclosured/lib/python2.7/ntpath.py
81
18082
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames """Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import sys import stat import genericpath import warnings from genericpath import * __all__ ...
mit
jrha/aquilon
tests/verbose_text_test.py
2
2926
#!/usr/bin/env python2.6 # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License...
apache-2.0
JFDesigner/FBAlbumDownloader
mechanize/_response.py
134
17803
"""Response classes. The seek_wrapper code is not used if you're using UserAgent with .set_seekable_responses(False), or if you're using the urllib2-level interface HTTPEquivProcessor. Class closeable_response is instantiated by some handlers (AbstractHTTPHandler), but the closeable_response interface is only depende...
gpl-2.0
EtachGu/STAVisor
app/lib/Openlayerv3.11.1/closure-library/closure/bin/build/source_test.py
153
3653
#!/usr/bin/env python # # Copyright 2010 The Closure Library 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 ...
mit
wimnat/ansible
test/integration/targets/throttle/test_throttle.py
52
1076
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import sys import time # read the args from sys.argv throttledir, inventory_hostname, max_throttle = sys.argv[1:] # format/create additional vars max_throttle = int(max_throttle) throttledir = os.p...
gpl-3.0
seanli9jan/tensorflow
tensorflow/contrib/learn/python/learn/utils/input_fn_utils.py
42
5310
# 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
koteq/hlstats_inviter
includes/SteamGroupMembers.py
1
1459
import logging import urllib2 import xml.etree.ElementTree as ElementTree logger = logging.getLogger() class SteamGroupMembers(object): """ Retrives all members of the specified group. """ _members = None def __init__(self, group_id): self._group_id = group_id def __len__(self): ...
unlicense
RPGOne/Skynet
scikit-learn-0.18.1/sklearn/externals/joblib/numpy_pickle_compat.py
37
8440
"""Numpy pickle compatibility functions.""" import pickle import os import zlib from io import BytesIO from ._compat import PY3_OR_LATER from .numpy_pickle_utils import _ZFILE_PREFIX from .numpy_pickle_utils import Unpickler def hex_str(an_int): """Convert an int to an hexadecimal string.""" return '{0:#x}'...
bsd-3-clause
takis/django
tests/auth_tests/test_models.py
215
12615
import datetime from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth import get_user_model from django.contrib.auth.hashers import get_hasher from django.contrib.auth.models import ( AbstractUser, Group, Permission, User, UserManager, ) from django.contrib.contenttypes.models import Co...
bsd-3-clause
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/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...
apache-2.0
chubbymaggie/twittor
implant.py
18
5478
from tweepy import Stream from tweepy import OAuthHandler from tweepy import API from tweepy.streaming import StreamListener from uuid import getnode as get_mac import ctypes import json import threading import subprocess import base64 import platform api = None # These values are appropriately filled in the code CO...
mit
timvideos/flumotion
flumotion/test/test_manager_component.py
3
24386
# -*- Mode: Python; test-case-name: flumotion.test.test_manager_component -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or m...
lgpl-2.1
JT5D/scikit-learn
sklearn/metrics/cluster/bicluster/tests/test_bicluster_metrics.py
13
1145
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal from ..bicluster_metrics import _jaccard from ..bicluster_metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([True, True, True, True]) a3 ...
bsd-3-clause
MarkAYoder/bone101
examples/robot/python/balance.py
1
5744
#!/usr/bin/env python3 # Makes the robot balance # Based on: https://github.com/mcdeoliveira/pyctrl/raw/master/examples/rc_mip_balance.py import math import time import warnings import numpy as np import sys, tty, termios import threading import pyctrl def brief_warning(message, category, filename, lineno, line=None)...
lgpl-3.0
frankrousseau/weboob
modules/radiofrance/module.py
3
8819
# * -*- coding: utf-8 -*- # Copyright(C) 2011-2012 Johann Broudin, Laurent Bachelier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the...
agpl-3.0
mpgarate/OST-fauxra
questions/migrations/0005_auto_20141212_1629.py
1
1324
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import taggit.managers class Migration(migrations.Migration): dependencies = [ ('taggit', '0001_initial'), ('questions', '0004_answer_votes'), ] operations = [ migrations.Add...
mit
ynkjm/ryu
ryu/lib/packet/stream_parser.py
58
2384
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
apache-2.0
tatome/dip_test
testdip.py
2
1457
import dip import numpy as np import bz2 # data statfaculty = map(int, "1001011205411322223121252002013441001000102") def test_statfaculty(): # check that we get the same result as the R implementation on the # statfaculty data set. assert round(dip.dip(statfaculty)[0], 8) == 0.05952381 assert round(...
gpl-2.0
johnkeepmoving/oss-ftp
python27/win32/Tools/Scripts/pdeps.py
96
3937
#! /usr/bin/env python # pdeps # # Find dependencies between a bunch of Python modules. # # Usage: # pdeps file1.py file2.py ... # # Output: # Four tables separated by lines like '--- Closure ---': # 1) Direct dependencies, listing which module imports which other modules # 2) The inverse of (1) # 3) Indirect de...
mit
pabloborrego93/edx-platform
openedx/core/djangoapps/auth_exchange/views.py
12
7236
""" Views to support exchange of authentication credentials. The following are currently implemented: 1. AccessTokenExchangeView: 3rd party (social-auth) OAuth 2.0 access token -> 1st party (open-edx) OAuth 2.0 access token 2. LoginWithAccessTokenView: 1st party (open-edx) OAuth 2.0 access token -...
agpl-3.0
JoeWoo/grpc
tools/profile_analyzer/profile_analyzer.py
19
6864
#!/usr/bin/env python # Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list o...
bsd-3-clause
vbshah1992/microblog
flask/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/requests/packages/charade/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
bsd-3-clause
krzychb/rtd-test-bed
components/nghttp/nghttp2/mkcipherlist.py
16
12521
#!/usr/bin/env python # -*- coding: utf-8 -*- # This script read cipher suite list csv file [1] and prints out id # and name of black listed cipher suites. The output is used by # src/ssl.cc. # # [1] http://www.iana.org/assignments/tls-parameters/tls-parameters-4.csv # [2] http://www.iana.org/assignments/tls-paramete...
apache-2.0