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 |
|---|---|---|---|---|---|
sbusso/rethinkdb | external/v8_3.30.33.16/tools/testrunner/objects/output.py | 105 | 2443 | # Copyright 2012 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... | agpl-3.0 |
yongshengwang/hue | desktop/core/ext-py/Django-1.6.10/build/lib/django/test/_doctest.py | 110 | 103163 | # This is a slightly modified version of the doctest.py that shipped with Python 2.5
# It incorporates changes that have been submitted to the Python ticket tracker
# as ticket #1521051. These changes allow for a DoctestRunner and Doctest base
# class to be specified when constructing a DoctestSuite.
# Module doctest.... | apache-2.0 |
kirca/odoo | openerpcommand/call.py | 16 | 1241 | """
Call an arbitrary model's method.
"""
import ast
import os
import pprint
import sys
import time
import xmlrpclib
import client
class Call(client.Client):
"""\
Call an arbitrary model's method.
Example:
> oe call res.users.read '[1, 3]' '[]' -u 1 -p admin
"""
# TODO The above docstring i... | agpl-3.0 |
cuemacro/findatapy | findatapy/util/dataconstants.py | 1 | 11166 | __author__ = 'saeedamen' # Saeed Amen
#
# Copyright 2016 Cuemacro
#
# 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 l... | apache-2.0 |
zerkrx/zerkbox | lib/youtube_dl/extractor/radiojavan.py | 43 | 2220 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
str_to_int,
)
class RadioJavanIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?radiojavan\.com/videos/video/(?P<id>[^/]+)/?'
_TEST = {
'url': 'http://www.radiojavan.... | gpl-3.0 |
mitchelljkotler/django | tests/test_runner/test_debug_sql.py | 210 | 4048 | import sys
import unittest
from django.db import connection
from django.test import TestCase
from django.test.runner import DiscoverRunner
from django.utils import six
from django.utils.encoding import force_text
from .models import Person
@unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so w... | bsd-3-clause |
cccfran/sympy | sympy/physics/unitsystems/systems/natural.py | 91 | 1785 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Naturalunit system.
The natural system comes from "setting c = 1, hbar = 1". From the computer
point of view it means that we use velocity and action instead of length and
time. Moreover instead of mass we use energy.
"""
from __future__ import division
from sympy... | bsd-3-clause |
Deledrius/korman | korman/exporter/animation.py | 1 | 39175 | # This file is part of Korman.
#
# Korman 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.
#
# Korman is distributed i... | gpl-3.0 |
fbossy/SickRage | lib/chardet/gb2312prober.py | 53 | 1690 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | gpl-3.0 |
schleichdi2/OpenNfr_E2_Gui-6.0 | lib/python/Plugins/Extensions/Infopanel/bootvideo.py | 2 | 8876 | from boxbranding import getMachineBrand, getMachineName
from os import path
from Components.Console import Console
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.ConfigList import ConfigListScreen, ConfigList
from Components.config import ... | gpl-2.0 |
i386x/doit | tests/test_support/test_app/test_config.py | 1 | 21039 | # -*- coding: utf-8 -*-
#! \file ./tests/test_support/test_app/test_config.py
#! \author Jiří Kučera, <sanczes@gmail.com>
#! \stamp 2016-12-13 15:57:50 (UTC+01:00, DST+00:00)
#! \project DoIt!: Tools and Libraries for Building DSLs
#! \license MIT
#! \versio... | mit |
tonk/ansible | test/lib/ansible_test/_internal/cloud/tower.py | 7 | 7417 | """Tower plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import time
from ..util import (
display,
ApplicationError,
is_shippable,
SubprocessError,
ConfigParser,
)
from ..util_common import (
run_command,
)
fr... | gpl-3.0 |
t1g0r/npyscreen | npyscreen/wgmultiselecttree.py | 15 | 1474 | from . import wgmultilinetree as multilinetree
from . import wgcheckbox as checkbox
import weakref
class MultiSelectTree(multilinetree.SelectOneTree):
_contained_widgets = checkbox.Checkbox
def set_up_handlers(self):
super(MultiSelectTree, self).set_up_handlers()
self.handlers.update({
... | bsd-2-clause |
chenchiyuan/gym | applications/weixin/models/menus.py | 3 | 2795 | # -*- coding: utf-8 -*-
# __author__ = chenchiyuan
from __future__ import division, unicode_literals, print_function
from collections import OrderedDict
from applications.weixin.models.apps import App
from applications.weixin.models.rules import Rule
from libs.models.mixins import QuerysetMixin
from libs.models.models... | bsd-3-clause |
yencarnacion/jaikuengine | .google_appengine/lib/PyAMF-0.6.1/pyamf/adapters/_google_appengine_ext_db.py | 27 | 10846 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Google App Engine adapter module.
Sets up basic type mapping and class mappings for using the Datastore API
in Google App Engine.
@see: U{Datastore API on Google App Engine<http://
code.google.com/appengine/docs/python/datastore>}
@since: 0.3.... | apache-2.0 |
teamotrinidad/plugin.video.cheguevara | commonfunctionsdummy.py | 40 | 17612 | '''
Parsedom for XBMC plugins
Copyright (C) 2010-2011 Tobias Ussing And Henrik Mosgaard Jensen
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
(a... | gpl-2.0 |
timj/scons | test/CacheDir/debug.py | 5 | 5305 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | mit |
SysTheron/adhocracy | src/adhocracy/lib/tiles/__init__.py | 2 | 1325 | import logging
from adhocracy import model
import badge_tiles as badge
import comment_tiles as comment
import decision_tiles as decision
import delegation_tiles as delegation
import event_tiles as event
import instance_tiles as instance
import milestone_tiles as milestone
import page_tiles as page
import poll_tiles a... | agpl-3.0 |
openstack/watcher | watcher/applier/manager.py | 2 | 1446 | # -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
# Copyright (c) 2016 Intel Corp
#
# Authors: Jean-Emile DARTOIS <jean-emile.dartois@b-com.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 Licen... | apache-2.0 |
jonathanmeier5/teamstore | tests/dashboard/test_product.py | 7 | 5663 | from __future__ import unicode_literals
import pytest
from django import forms
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_text
from mock import Mock
from saleor.dashboard.product.forms import (ProductClassForm,
ProductClassSelectorF... | bsd-3-clause |
twisted/mantissa | xmantissa/test/test_signup.py | 1 | 8937 |
from twisted.trial import unittest
from axiom import store, userbase
from axiom.item import Item
from axiom.attributes import inmemory, integer
from axiom.plugins import mantissacmd
from xmantissa import signup, offering
from xmantissa.plugins import free_signup
from xmantissa.product import Product, Installation
... | mit |
translate/translate | translate/lang/test_hy.py | 2 | 1448 | from translate.lang import factory
def test_punctranslate():
"""Tests that we can translate punctuation."""
language = factory.getlanguage("hy")
assert language.punctranslate("") == ""
assert language.punctranslate("abc efg") == "abc efg"
assert language.punctranslate("abc efg.") == "abc efg։"
... | gpl-2.0 |
EvanK/ansible | lib/ansible/modules/remote_management/oneview/oneview_san_manager.py | 146 | 7717 | #!/usr/bin/python
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# 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 |
realsaiko/odoo | addons/report_intrastat/__init__.py | 377 | 1079 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
laborautonomo/poedit | deps/boost/tools/build/v2/tools/midl.py | 18 | 5657 | # Copyright (c) 2005 Alexey Pakhunov.
# Copyright (c) 2011 Juraj Ivancic
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
# Microsoft Interface Definition Language (MIDL) related routines
fro... | mit |
linsalrob/EdwardsLab | crAssphage/NCBI_SRA_Submission.py | 1 | 6447 | """
Submit my data to the SRA.
"""
import os
import sys
import argparse
from roblib import bcolors
__author__ = 'Rob Edwards'
our_data = {
'library_strategy' : 'AMPLICON',
'library_source' : 'METAGENOMIC',
'library_selection' : 'PCR',
'library_layout' : 'SINGLE',
'platform' ... | mit |
aptana/Pydev | bundles/org.python.pydev.jython/Lib/encodings/cp1253.py | 9 | 5558 | """ Python Character Mapping Codec generated from 'CP1253.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... | epl-1.0 |
NickDaly/GemRB-MultipleConfigs | gemrb/GUIScripts/bg2/GUIOPT7.py | 5 | 4063 | # GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later versi... | gpl-2.0 |
zakuro9715/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/invalid_models/models.py | 30 | 26190 | """
26. Invalid models
This example exists purely to point out errors in models.
"""
from django.contrib.contenttypes import generic
from django.db import models
class FieldErrors(models.Model):
charfield = models.CharField()
charfield2 = models.CharField(max_length=-1)
charfield3 = models.CharField(max_... | gpl-3.0 |
dwrpayne/zulip | zerver/management/commands/bankrupt_users.py | 7 | 1427 | from __future__ import absolute_import
from __future__ import print_function
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_update_message_flags
from zerver.models import UserProfile, Message, get_user_profile_by_email
class Command(BaseCommand):
help = """Bankrupt one or m... | apache-2.0 |
sbalde/edx-platform | lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py | 114 | 6711 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'SoftwareSecurePhotoVerification.window'
db.add_column('verify_student_softwaresecurephotover... | agpl-3.0 |
jaredjennings/snowy | wsgi/snowy/snowy/lib/piston/models.py | 11 | 4896 | import urllib, time, urlparse
# Django imports
from django.db.models.signals import post_save, post_delete
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from django.core.mail import send_mail, mail_admins
# Piston imports
from managers import TokenManager, C... | agpl-3.0 |
hachreak/invenio-demosite | invenio_demosite/base/recordext/functions/get_number_of_reviews.py | 7 | 1073 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2013, 2014 CERN.
#
# Invenio Demosite 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 (a... | gpl-2.0 |
Teaonly/easyLearning.js | TensorExpress/aten/src/ATen/gen.py | 1 | 15896 | import argparse
import os
import yaml
from collections import OrderedDict
import cwrap_parser
import nn_parse
import native_parse
import preprocess_declarations
import function_wrapper
import copy_wrapper
from code_template import CodeTemplate
# This file is the top-level entry point for code generation in ATen.
#... | mit |
Yuudachimoe/HikariChun-RedBot | lib/youtube_dl/extractor/screencast.py | 44 | 4330 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class ScreencastIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?screencast\.com/t/(?P<id>[a-zA-Z0-9]+... | gpl-3.0 |
EdisonResearch/fast-rcnn | tools/train_svms.py | 42 | 13247 | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""
Train post-hoc SVMs using the algorithm and ... | mit |
pacificclimate/pydap.responses.aaigrid | src/pydap/responses/aaigrid/__init__.py | 1 | 13427 | import os
from os.path import basename, sep
import logging
from tempfile import gettempdir, SpooledTemporaryFile
from itertools import imap, izip, chain, izip_longest, repeat
from zipfile import ZipFile, ZIP_DEFLATED
import re
import gdal
import osr
import numpy
from numpy import ma
from webob.exc import HTTPBadReques... | gpl-3.0 |
openstack/glance | glance/db/sqlalchemy/migrate_repo/versions/022_image_member_index.py | 3 | 2182 | # Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
phillxnet/rockstor-core | src/rockstor/storageadmin/views/share_acl.py | 2 | 2538 | """
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any la... | gpl-3.0 |
nclsHart/glances | glances/core/glances_snmp.py | 1 | 4872 | # -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
#
# Glances 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 3 of the Lic... | lgpl-3.0 |
wshallum/ansible | lib/ansible/modules/windows/win_chocolatey.py | 23 | 3537 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Trond Hindenes <trond@hindenes.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 L... | gpl-3.0 |
siripuramrk/namebench | nb_third_party/dns/reversename.py | 248 | 2931 | # Copyright (C) 2006, 2007, 2009, 2010 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... | apache-2.0 |
ramitalat/odoo | addons/hr_holidays/report/holidays_summary_report.py | 333 | 10372 | # -*- 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 |
Mitali-Sodhi/CodeLingo | Dataset/python/test_cert_verification (14).py | 126 | 1447 | # Copyright (c) 2013 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 |
jbedorf/tensorflow | tensorflow/python/kernel_tests/distributions/bijector_test.py | 13 | 11452 | # 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 |
Chilledheart/gyp | pylib/gyp/generator/make.py | 3 | 91125 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... | bsd-3-clause |
puhoy/storedDict | tests/test_storedDict.py | 1 | 1786 | import unittest
import json
import os
from storedDict import StoredDict
class TestStoredDict(unittest.TestCase):
def test_save_and_load(self):
val = 1
sd = StoredDict('testing.json')
sd['one'] = val
sd.commit()
sd = StoredDict('testing.json')
self.assertEqual(val, ... | mit |
nelmiux/CarnotKE | jyhton/ast/astview.py | 7 | 2075 | #!/usr/bin/env python
"""lispify_ast - returns a tuple representation of the AST
Uses 2.5's _ast, not other AST implementations in CPython, since these
are not used by the compilation phase. And that's what we're
interested in.
Since this is a tuple, we can directly compare, and this is going to
be handy when compari... | apache-2.0 |
JoeHsiao/bioformats | components/xsd-fu/python/generateDS/SWIG/testsuper.py | 33 | 41337 | #!/usr/bin/env python
import sys
import getopt
from xml.dom import minidom
from xml.dom import Node
#import yaml
#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://www-hep.colorado.edu/~fperez/ipython.
#
#from IPython.Shell import IPythonShellEmbed
#IPShell =... | gpl-2.0 |
kylelwm/ponus | venv/build/django/django/contrib/auth/urls.py | 104 | 1443 | # The views used below are normally mapped in django.contrib.admin.urls.py
# This URLs file is used to provide a reliable view deployment for test purposes.
# It is also provided as a convenience to those who want to deploy these URLs
# elsewhere.
from django.conf.urls import patterns, url
urlpatterns = patterns('',
... | mit |
Stanford-Online/edx-platform | openedx/core/djangoapps/certificates/tests/test_api.py | 14 | 4403 | from contextlib import contextmanager
from datetime import datetime, timedelta
import itertools
import ddt
import pytz
import waffle
from django.test import TestCase
from course_modes.models import CourseMode
from openedx.core.djangoapps.certificates import api
from openedx.core.djangoapps.certificates.config import ... | agpl-3.0 |
klahnakoski/JsonSchemaToMarkdown | vendor/tuid/sql.py | 3 | 2226 | # 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/.
#
from __future__ import absolute_import
from __future__ import division
from __future__ import un... | mpl-2.0 |
AudreyFrancisco/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/old/CompareRawSpectraTriggers.py | 42 | 6008 | #! /usr/bin/env python
from Helper import ReadHistList, MakeRatio, HistNotFoundException
from Graphics import Frame, Style
from SpectrumContainer import DataContainer
from ROOT import TCanvas, TLegend, TPaveText
from ROOT import kBlack, kRed, kBlue, kGreen, kOrange
gPlot = None
class Plot:
"""
Class represen... | bsd-3-clause |
carrerasrodrigo/django-post_office | post_office/south_migrations/0010_auto__add_field_log_exception_type.py | 10 | 4547 | # -*- 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 field 'Log.exception_type'
db.add_column(u'post_office_log', 'ex... | mit |
PulsePod/old-www-do-not-use | lib/python2.7/site-packages/flask/testsuite/ext.py | 563 | 5156 | # -*- coding: utf-8 -*-
"""
flask.testsuite.ext
~~~~~~~~~~~~~~~~~~~
Tests the extension import thing.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import unittest
try:
from imp import reload as reload_module
except ImportError:
reload... | mit |
micropython-IMU/micropython-fusion | remote/capture.py | 1 | 2477 | # capture.py Data capture for remote operation. Uses LCD display and uasyncio.
# Author: Peter Hinch
# Released under the MIT License (MIT)
# Copyright (c) 2018 Peter Hinch
# Requires:
# uasyncio (official or modified version)
# MPU9150 on X position
# Normally open pushbutton connected between pin Y7 and ground
# LCD... | mit |
petrjasek/superdesk-core | superdesk/data_updates/00006_20171124-195408_content_types.py | 2 | 2154 | # -*- coding: utf-8; -*-
# This file is part of Superdesk.
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
#
# Author : mugur
# Creation: 2017-11-24 19:54
from copy import deepcopy
fr... | agpl-3.0 |
heli522/scikit-learn | benchmarks/bench_random_projections.py | 397 | 8900 | """
===========================
Random projection benchmark
===========================
Benchmarks for random projections.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import collections
import numpy as np
import scipy.s... | bsd-3-clause |
otbrown/OpenBLAS | benchmark/scripts/NUMPY/cgemm.py | 15 | 1024 | #!/usr/bin/python
import os
import sys
import time
import numpy
from numpy.random import randn
def run_cgemm(N,l):
A = randn(N,N).astype('float32') + randn(N,N).astype('float32') * 1j;
B = randn(N,N).astype('float32') + randn(N,N).astype('float32') * 1j;
start = time.time();
for i in range(0,l):
ref = numpy.d... | bsd-3-clause |
russellhaering/hyde | hydeengine/site_post_processors.py | 2 | 8494 | from __future__ import with_statement
import os
import string
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
import codecs
class FolderFlattener:
... | mit |
undoware/neutron-drive | google_appengine/lib/grizzled/grizzled/net/__init__.py | 19 | 3602 | # $Id: f8ce5bf718c826df5fb3cd06701dc2bf6e144acb $
"""
Network-related methods and classes.
"""
from __future__ import absolute_import
__docformat__ = 'restructuredtext en'
# ---------------------------------------------------------------------------
# Imports
# -------------------------------------------------------... | bsd-3-clause |
jolevq/odoopub | addons/account/wizard/account_move_bank_reconcile.py | 385 | 2684 | # -*- 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 |
sharoonthomas/trytond-pos | sale.py | 1 | 22737 | # -*- coding: utf-8 -*-
"""
sale.py
"""
from datetime import datetime, timedelta
from sql import Literal
from trytond.model import fields
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
from trytond.rpc import RPC
from trytond.model import ModelView
from trytond.pyson import Eva... | bsd-3-clause |
alaski/nova | nova/api/openstack/compute/agents.py | 6 | 7174 | # 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 t... | apache-2.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/django/db/models/sql/constants.py | 126 | 1360 | """
Constants specific to the SQL storage portion of the ORM.
"""
from collections import namedtuple
import re
# Valid query types (a set is used for speedy lookups). These are (currently)
# considered SQL-specific; other storage systems may choose to use different
# lookup types.
QUERY_TERMS = set([
'exact', 'ie... | bsd-3-clause |
larsbutler/swift | swift/obj/replicator.py | 1 | 37876 | # Copyright (c) 2010-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 agree... | apache-2.0 |
shhui/nova | nova/api/openstack/compute/plugins/v3/server_password.py | 13 | 2588 | # Copyright (c) 2012 Nebula, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
vasyarv/edx-platform | lms/djangoapps/certificates/tests/test_api.py | 42 | 13565 | """Tests for the certificates Python API. """
from contextlib import contextmanager
import ddt
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from django.conf import settings
from mock import patch
from nose.plugins.attrib import attr
from opaque_keys.edx.locator impo... | agpl-3.0 |
zhiwliu/openshift-ansible | roles/lib_openshift/library/oc_scale.py | 6 | 64391 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
SteveDiamond/cvxpy | cvxpy/tests/test_interfaces.py | 2 | 11553 | """
Copyright 2013 Steven Diamond
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... | gpl-3.0 |
wuzhy/autotest | mirror/source.py | 2 | 7106 | # Copyright 2009 Google Inc. Released under the GPL v2
import os, re, time, urllib2, urlparse, HTMLParser
from autotest_lib.mirror import database
from autotest_lib.client.common_lib import utils
class source(object):
"""
Abstract Base Class for the source classes.
"""
def __init__(self, database):
... | gpl-2.0 |
ldtri0209/robotframework | src/robot/libdocpkg/javabuilder.py | 6 | 4693 | # Copyright 2008-2014 Nokia Solutions and 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 l... | apache-2.0 |
Kilhog/odoo | addons/hr_payroll/res_config.py | 441 | 1294 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
bjolivot/ansible | test/units/modules/packaging/os/test_apt.py | 80 | 1500 | import collections
import os
import sys
from ansible.compat.tests import mock
from ansible.compat.tests import unittest
try:
from ansible.modules.packaging.os.apt import (
expand_pkgspec_from_fnmatches,
)
except:
# Need some more module_utils work (porting urls.py) before we can test
# modules... | gpl-3.0 |
icdishb/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
YoQuieroSaber/votainteligente-portal-electoral | votainteligente/urls.py | 1 | 1101 | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.conf import settings
from django.conf.urls.i18n import i18n_patterns
admin.autodiscover()
admin.site.site_header = getattr(settings, 'ADMIN_HEADER', 'Vota Inteligente')
... | gpl-3.0 |
jmcarp/django | django/views/decorators/csrf.py | 586 | 2202 | from functools import wraps
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import available_attrs, decorator_from_middleware
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds... | bsd-3-clause |
putcn/Paddle | python/paddle/utils/predefined_net.py | 18 | 14269 | # Copyright (c) 2016 PaddlePaddle 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 applic... | apache-2.0 |
great-expectations/great_expectations | great_expectations/expectations/core/expect_table_row_count_to_equal.py | 1 | 6245 | from typing import Dict, List, Optional, Union
import numpy as np
import pandas as pd
from great_expectations.core.batch import Batch
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.execution_engine import ExecutionEngine, PandasExecutionEngine
from great... | apache-2.0 |
wkritzinger/asuswrt-merlin | release/src/router/samba36/lib/testtools/testtools/tests/test_helpers.py | 20 | 3580 | # Copyright (c) 2010 Jonathan M. Lange. See LICENSE for details.
from testtools import TestCase
from testtools.helpers import (
try_import,
try_imports,
)
from testtools.matchers import (
Equals,
Is,
)
class TestTryImport(TestCase):
def test_doesnt_exist(self):
# try_import('thin... | gpl-2.0 |
pbstark/permute | permute/data/__init__.py | 1 | 3720 | """Standard test data.
For more information, see
- http://www.wiley.com/legacy/wileychi/pesarin/material.html
"""
import os as _os
import numpy as np
from .. import data_dir
__all__ = ['load',
'kenya', ]
def load(f):
"""Load a data file located in the data directory.
Parameters
------... | bsd-2-clause |
HyperBaton/ansible | lib/ansible/modules/network/junos/junos_command.py | 21 | 14489 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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 |
ascott1/regulations-parser | regparser/layer/formatting.py | 3 | 5046 | import re
from regparser.layer.layer import Layer
from regparser.tree import struct
from regparser.tree.priority_stack import PriorityStack
from regparser.tree.xml_parser import tree_utils
class HeaderStack(PriorityStack):
"""Used to determine Table Headers -- indeed, they are complicated
enough to warrant t... | cc0-1.0 |
Intel-tensorflow/tensorflow | tensorflow/python/training/warm_starting_util.py | 14 | 23762 | # 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 |
Fullens/kodi | playtvfr.py | 297 | 8750 | import struct
import urllib2,urllib
import re
import json
import math
CRYPT_XXTEA_DELTA= 0x9E3779B9
headers = [('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),( 'Connection','Keep-Alive')]
class Crypt_XXTEA:
_key=None
def setKey(self,key):
if isinstance(key, basestring):
... | lgpl-2.1 |
ict-felix/stack | modules/resource/orchestrator/src/server/flask/methods.py | 1 | 3132 | from delegate.geni.v3.utils.tn import TNUtils
from flask import current_app
from flask import request
from flask import Response
from functools import wraps
CLI_UNAVAILABLE_MSG = "Method only available via REST API"
GUI_UNAVAILABLE_MSG = "Method only available via GUI"
def parse_output_json(output):
resp = Res... | apache-2.0 |
maninmotion/LittleSportsBiscuit | tests/engine.py | 1 | 5102 | from subprocess import call
from os import path
import hitchpostgres
import hitchselenium
import hitchpython
import hitchserve
import hitchredis
import hitchtest
import hitchsmtp
# Get directory above this file
PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..'))
class ExecutionEngine(hitchtest... | bsd-3-clause |
dga4654dan/UTM-Demo | V_1_0_2_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/encodings/base64_codec.py | 9 | 1778 | """ Python 'base64_codec' Codec - base64 content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs, base64
### Codec APIs
def base64_encode(i... | gpl-2.0 |
Ares42/Guidebox | Flask/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
cpang24/data-science-from-scratch | code/databases.py | 60 | 8165 | from __future__ import division
import math, random, re
from collections import defaultdict
class Table:
def __init__(self, columns):
self.columns = columns
self.rows = []
def __repr__(self):
"""pretty representation of the table: columns then rows"""
return str(self.columns) +... | unlicense |
akash1808/nova_test_latest | nova/virt/libvirt/driver.py | 4 | 303163 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... | apache-2.0 |
BonexGu/Blik2D-SDK | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/layers/python/layers/utils_test.py | 65 | 10705 | # 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... | mit |
sophgn/aosc-os-abbs | extra-libs/dbus-factory/autobuild/json_build.py | 1 | 1605 | #!/usr/bin/env python2
import os
PROXYER = '/usr/bin/dbus-generator'
def generate_source(json,target):
json_header = json.split('.in.json')[0]
outdir = ''
install_dir = ''
json_meta = []
if target == 'qml':
outdir += 'qml/'
t_list =[]
for i in json_header.split('.'):
... | gpl-2.0 |
kakunbsc/enigma2 | lib/python/Screens/MovieSelection.py | 10 | 14103 | from Screen import Screen
from Components.Button import Button
from Components.ActionMap import HelpableActionMap, ActionMap
from Components.MenuList import MenuList
from Components.MovieList import MovieList
from Components.DiskInfo import DiskInfo
from Components.Pixmap import Pixmap
from Components.Label import Labe... | gpl-2.0 |
rhndg/openedx | openedx/core/djangoapps/credit/migrations/0001_initial.py | 85 | 8897 | # -*- 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 'CreditCourse'
db.create_table('credit_creditcourse', (
... | agpl-3.0 |
dreamsxin/kbengine | kbe/src/lib/python/Lib/test/test_tokenize.py | 80 | 48357 | doctests = """
Tests for the tokenize module.
The tests can be really simple. Given a small fragment of source
code, print out a table with tokens. The ENDMARKER is omitted for
brevity.
>>> dump_tokens("1 + 1")
ENCODING 'utf-8' (0, 0) (0, 0)
NUMBER '1' (1, 0) (1, 1)
OP '+... | lgpl-3.0 |
t0x0/random | unlockerv.py | 2 | 3216 | #!/usr/bin/env python
# MIT License, Copyright 2015 t0x0
# Full text in 'LICENSE' file
# Will not work for any ransomware other than "Locker v*" by Poka Brightminds.
# Untested. Alpha code. Use at your own risk.
# Do not drink, recycled code in use. Code green. Feedback: me@t0x0.com
# Prerequisite: pycrypto - http... | mit |
0Chencc/CTFCrackTools | Lib/distutils/tests/test_bdist_wininst.py | 99 | 1044 | """Tests for distutils.command.bdist_wininst."""
import unittest
from test.test_support import run_unittest
from distutils.command.bdist_wininst import bdist_wininst
from distutils.tests import support
class BuildWinInstTestCase(support.TempdirManager,
support.LoggingSilencer,
... | gpl-3.0 |
ict-felix/stack | modules/resource/utilities/rspecs/serm/request_formatter.py | 1 | 4625 | from core.utils.urns import URNUtils
from rspecs.tnrm.request_formatter import DEFAULT_XS,\
TNRMv3RequestFormatter, DEFAULT_XMLNS, DEFAULT_SHARED_VLAN,\
DEFAULT_REQ_SCHEMA_LOCATION
from lxml import etree
DEFAULT_FELIX = "http://ict-felix.eu/serm_request"
class SERMv3RequestFormatter(TNRMv3RequestFormatter):
... | apache-2.0 |
allwinnertech/platform_external_chromium | chrome/common/extensions/docs/server/chromeextensionsdocs.py | 64 | 15204 | #!/usr/bin/python
# Copyright (c) 2010 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 cgi
import logging
import re
import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.