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 |
|---|---|---|---|---|---|
jjmleiro/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/geoapp/test_regress.py | 47 | 4031 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import no_mysql, no_spatialite
from django.contrib.gis.shortcuts import render_to_kmz
from django.contrib.gis.tests.utils im... | apache-2.0 |
Cuuuurzel/KiPyCalc | sympy/vector/tests/test_dyadic.py | 94 | 4076 | from sympy import sin, cos, symbols, pi, ImmutableMatrix as Matrix, \
simplify
from sympy.vector import (CoordSysCartesian, Vector, Dyadic,
DyadicAdd, DyadicMul, DyadicZero,
BaseDyadic, express)
A = CoordSysCartesian('A')
def test_dyadic():
a, b = symbols... | mit |
sinhrks/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 294 | 3417 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
bakerlover/lab5 | main/model.py | 2 | 2082 | # -*- coding: utf-8 -*-
import os
from google.appengine.api import app_identity
from google.appengine.ext import ndb
import modelx
import util
# The timestamp of the currently deployed version
TIMESTAMP = long(os.environ.get('CURRENT_VERSION_ID').split('.')[1]) >> 28
class Base(ndb.Model, modelx.BaseX):
create... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/pip/_vendor/packaging/_structures.py | 906 | 1809 | # Copyright 2014 Donald Stufft
#
# 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, so... | agpl-3.0 |
powerjg/gem5-ci-test | configs/example/ruby_gpu_random_test.py | 10 | 6423 | #
# Copyright (c) 2010-2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# 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 co... | bsd-3-clause |
igrechuhin/omim | 3party/protobuf/python/google/protobuf/text_encoding.py | 81 | 4696 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | apache-2.0 |
python-acoustics/Sea | Sea/adapter/components/Component2DPlate.py | 2 | 3440 | """
Adapter classes for :class:`Sea.model.components.Component2DPlate`
"""
import Sea
from ComponentStructural import ComponentStructural
from ..subsystems import SubsystemStructuralLong, SubsystemStructuralBend, SubsystemStructuralShear
class SubsystemLong(SubsystemStructuralLong, Sea.model.components.Component2DPla... | bsd-3-clause |
jmhsi/justin_tinker | data_science/courses/learning_dl_packages/models/research/qa_kg/util/misc.py | 10 | 2515 | # 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 applicab... | apache-2.0 |
Hydriz/Balchivist | balchivist/archiver.py | 1 | 9178 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2018 Hydriz Scholz
# 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 option) any later... | gpl-3.0 |
rickerc/nova_audit | nova/tests/test_crypto.py | 33 | 10137 | # Copyright 2011 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 |
yawnosnorous/python-for-android | python-build/python-libs/xmpppy/doc/examples/bot.py | 87 | 3135 | #!/usr/bin/python
# -*- coding: koi8-r -*-
# $Id: bot.py,v 1.2 2006/10/06 12:30:42 normanr Exp $
import sys
import xmpp
commands={}
i18n={'ru':{},'en':{}}
########################### user handlers start ##################################
i18n['en']['HELP']="This is example jabber bot.\nAvailable commands: %s"
def help... | apache-2.0 |
arnaud-morvan/QGIS | python/plugins/processing/algs/gdal/Dissolve.py | 2 | 8511 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Dissolve.py
---------------------
Date : Janaury 2015
Copyright : (C) 2015 by Giovanni Manghi
Email : giovanni dot manghi at naturalgis dot pt
**********... | gpl-2.0 |
nikhilprathapani/python-for-android | python3-alpha/python3-src/Lib/socket.py | 46 | 13835 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | apache-2.0 |
dakerfp/AutobahnPython | autobahn/autobahn/wamp1/protocol.py | 17 | 82907 | ###############################################################################
##
## 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 |
routeflow/AutomaticConfigurationRouteFlow | pox/tests/unit/openflow/libopenflow_01_test.py | 23 | 16017 | #!/usr/bin/env python
import unittest
import sys
import os.path
from copy import copy
sys.path.append(os.path.dirname(__file__) + "/../../..")
from pox.openflow.libopenflow_01 import *
from pox.datapaths.switch import *
def extract_num(buf, start, length):
""" extracts a number from a raw byte string. Assumes netw... | apache-2.0 |
Whatang/DrumBurp | src/Widgets/measureTabs_plugin.py | 1 | 1611 | # Copyright 2011-12 Michael Thomas
#
# See www.whatang.org for more information.
#
# This file is part of DrumBurp.
#
# DrumBurp 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,... | gpl-3.0 |
simonvh/pyDNase | pyDNase/footprinting/__init__.py | 1 | 10664 | # Copyright (C) 2013 Jason Piper - j.piper@warwick.ac.uk
#
# 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 option) any later version.
#
# This prog... | gpl-3.0 |
gechong/XlsxWriter | xlsxwriter/test/comparison/test_hyperlink04.py | 8 | 2663 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
shinglyu/servo | tests/wpt/web-platform-tests/html/tools/update_html5lib_tests.py | 88 | 5363 | import sys
import os
import hashlib
import urllib
import itertools
import re
import json
import glob
import shutil
try:
import genshi
from genshi.template import MarkupTemplate
from html5lib.tests import support
except ImportError:
print """This script requires the Genshi templating library and html5l... | mpl-2.0 |
TaizoAyase/FSECplotter2 | test/pyqt/dialogs/test_integrator_dialog.py | 1 | 3057 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
from glob import glob
from unittest import TestCase
from nose.tools import ok_, eq_, raises
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtTest import QTest
from FSECplotter import *
from FSECplotter.pyqt.models import L... | gpl-2.0 |
nmrao/robotframework | src/robot/testdoc.py | 11 | 9803 | #!/usr/bin/env python
# Copyright 2008-2015 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 r... | apache-2.0 |
decause/pyglet-remy | tests/image/CHECKERBOARD.py | 33 | 1163 | #!/usr/bin/env python
'''Test that the checkerboard pattern looks correct.
One window will open, it should show one instance of the checkerboard
pattern in two levels of grey.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet.gl import *
from pyglet import image
from pyglet.... | bsd-3-clause |
GovReady/readthedocs.org | readthedocs/oauth/utils.py | 4 | 7942 | import logging
from allauth.socialaccount.models import SocialToken
from django.conf import settings
from requests_oauthlib import OAuth1Session, OAuth2Session
from .models import GithubProject, GithubOrganization, BitbucketProject, BitbucketTeam
from readthedocs.restapi.client import api
log = logging.getLogger(__... | mit |
amisrs/angular-flask | angular_flask/lib/python2.7/site-packages/requests/compat.py | 289 | 2433 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import charade as chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.... | mit |
udo-tech-team/shadowsocks-1 | shadowsocks/shell.py | 652 | 12736 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | apache-2.0 |
mohamed-ali/scikit-tensor | sktensor/pyutils.py | 4 | 1611 | def inherit_docstring_from(cls):
def docstring_inheriting_decorator(fn):
fn.__doc__ = getattr(cls, fn.__name__).__doc__
return fn
return docstring_inheriting_decorator
def is_sequence(obj):
"""
Helper function to determine sequences
across Python 2.x and 3.x
"""
try:
... | gpl-3.0 |
davidharrigan/django | tests/m2m_multiple/tests.py | 227 | 2370 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, Category
class M2MMultipleTests(TestCase):
def test_multiple(self):
c1, c2, c3, c4 = [
Category.objects.create(name=name)
for name in ["Sports", "N... | bsd-3-clause |
harmy/kbengine | kbe/src/lib/python/Lib/test/test_pow.py | 177 | 4593 | import test.support, unittest
class PowTest(unittest.TestCase):
def powtest(self, type):
if type != float:
for i in range(-1000, 1000):
self.assertEqual(pow(type(i), 0), 1)
self.assertEqual(pow(type(i), 1), type(i))
self.assertEqual(pow(type(0), ... | lgpl-3.0 |
mellis13/moose | framework/contrib/nsiqcppstyle/rules/RULE_6_5_B_do_not_use_macro_for_constants.py | 43 | 2094 | """
Do not use macro for the constants.
if the constants is defined by macro. this rule reports a violation.
Instead, use enum or const variables.
However, it's ok to write a macro function.
And.. If the macro is start with underbar,
it regards this macro is defined for the special purpose
and it doesn't report a viol... | lgpl-2.1 |
ankitrgadiya/cs50 | project/miki/miki/__init__.py | 1 | 1049 | import os
from flask import Flask, redirect
def create_app(test_config=None):
"""
Application Factory function
"""
# Create app instance and configure it
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev',
DATABASE=os.path.join(app.i... | gpl-3.0 |
MobinRanjbar/hue | desktop/core/ext-py/jdcal-1.0/jdcal.py | 19 | 14903 | # -*- coding:utf-8 -*-
"""Functions for converting between Julian dates and calendar dates.
A function for converting Gregorian calendar dates to Julian dates, and
another function for converting Julian calendar dates to Julian dates
are defined. Two functions for the reverse calculations are also
defined.
Different ... | apache-2.0 |
n0m4dz/odoo | addons/project/wizard/project_task_delegate.py | 142 | 6479 | # -*- 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_networks.py | 7 | 3000 | from novaclient.v1_1 import networks
from novaclient.tests import utils
from novaclient.tests.v1_1 import fakes
cs = fakes.FakeClient()
class NetworksTest(utils.TestCase):
def test_list_networks(self):
fl = cs.networks.list()
cs.assert_called('GET', '/os-networks')
[self.assertTrue(isin... | mit |
louisgag/BlenderAndMBDyn | plot.py | 2 | 1366 | # --------------------------------------------------------------------------
# BlenderAndMBDyn
# Copyright (C) 2015 G. Douglas Baldwin - http://www.baldwintechnology.com
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This file is part of Blender... | gpl-3.0 |
mshahbaz/exabgp | dev/self/load/api-internet.py | 2 | 2256 | #!/usr/bin/env python
import sys
import time
import random
def write (data):
sys.stdout.write(data + '\n')
sys.stdout.flush()
def main ():
if len(sys.argv) < 2:
print "%s <number of routes> <updates per second thereafter>"
sys.exit(1)
initial = sys.argv[1]
thereafter = sys.argv[2]
if not initial.isdigit(... | bsd-3-clause |
cloudera/hue | desktop/core/ext-py/jaeger-client-4.0.0/tests/test_metrics.py | 2 | 2914 | # Copyright (c) 2016 Uber Technologies, 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 to ... | apache-2.0 |
GoogleCloudPlatform/err-stackdriver | charts/timeseries.py | 1 | 8301 | # Copyright 2015 Google 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 applicable law or agreed... | apache-2.0 |
phil-r/chaos | tests/github_api/prs_test.py | 1 | 1520 | import unittest
from github_api import prs, API
class TestPRMethods(unittest.TestCase):
def test_statuses_returns_passed_travis_build(self):
statuses = [{"state": "success",
"description": "The Travis CI build passed"}]
pr = "/repos/test/blah"
class Mocked(API):
... | mit |
wardi/ckanext-bcgov | ckanext/bcgov/scripts/save_users.py | 6 | 1093 | # Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
'''
This script import current users from an environment and
Save it to a json file.
This information can be used later to create the users on the same
or another environment.
'''
import json
impo... | agpl-3.0 |
ClearCorp-dev/odoo | addons/account_accountant/__init__.py | 892 | 1046 | # -*- 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 |
boneknuckleskin/libforensics | code/lf/win/shell/link/objects.py | 13 | 52049 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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 License, or
# (at your option) any later ver... | gpl-3.0 |
MatthewWilkes/mw4068-packaging | src/melange/src/soc/models/mentor.py | 2 | 1664 | #!/usr/bin/env python2.5
#
# Copyright 2008 the Melange authors.
#
# 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 appl... | apache-2.0 |
Jonekee/chromium.src | third_party/closure_linter/closure_linter/tokenutil.py | 108 | 19916 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | bsd-3-clause |
michaelni/audacity | lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Tools/glib2.py | 330 | 8170 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Task,Utils,Options,Errors,Logs
from waflib.TaskGen import taskgen_method,before_method,after_method,feature
@taskgen_method
def add_marshal_file(s... | gpl-2.0 |
amdw/dotsandboxes | fig_3by3samplegame.py | 1 | 1966 | #!/usr/bin/env python3
# Copyright 2016 Andrew Medworth (github@medworth.org.uk)
#
# This program 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 License, or
# (at your option) ... | agpl-3.0 |
KonishchevDmitry/vkfeed | vkfeed/tools/html_parser.py | 16 | 8734 | '''A convenient class for parsing HTML pages.'''
from __future__ import unicode_literals
from HTMLParser import HTMLParser
import logging
import re
from vkfeed.core import Error
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.INFO)
class HTMLPageParser(HTMLParser):
'''A convenient class for parsing HTM... | bsd-2-clause |
sabi0/intellij-community | python/lib/Lib/csv.py | 87 | 15210 |
"""
csv.py - read/write/investigate CSV files
"""
import re
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \
... | apache-2.0 |
vinegret/youtube-dl | youtube_dl/extractor/nzz.py | 20 | 1409 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
extract_attributes,
)
class NZZIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?nzz\.ch/(?:[^/]+/)*[^/?#]+-ld\.(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.nzz.ch/zuerich/... | unlicense |
kaarolch/ansible | lib/ansible/playbook/become.py | 63 | 4030 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
rcharp/toyota-flask | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/constants.py | 3008 | 1335 | ######################## 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 |
cchurch/ansible | test/units/modules/net_tools/nios/test_nios_nsgroup.py | 52 | 4511 | # 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 distributed in the hope that ... | gpl-3.0 |
SUSE/kiwi | kiwi/privileges.py | 1 | 1256 | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... | gpl-3.0 |
Endika/python-digitalocean | digitalocean/SSHKey.py | 11 | 2610 | # -*- coding: utf-8 -*-
from .baseapi import BaseAPI, GET, POST, DELETE, PUT
class SSHKey(BaseAPI):
def __init__(self, *args, **kwargs):
self.id = ""
self.name = None
self.public_key = None
self.fingerprint = None
super(SSHKey, self).__init__(*args, **kwargs)
@classme... | lgpl-3.0 |
NeCTAR-RC/nova | nova/tests/functional/api_sample_tests/test_limits.py | 9 | 1785 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 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... | apache-2.0 |
quantifiedcode-bot/invenio-search | invenio_search/errors.py | 20 | 1734 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012,
# 2013, 2015 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; ei... | gpl-2.0 |
benfinke/ns_python | build/scripts-2.7/get_config.py | 3 | 57309 | #!/usr/bin/env python
#
# Copyright (c) 2008-2015 Citrix Systems, 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
#
... | apache-2.0 |
varigit/VAR-SOM-AM33-SDK7-Kernel | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/boto/ec2/autoscale/instance.py | 151 | 2428 | # Copyright (c) 2009 Reza Lotun http://reza.lotun.name/
#
# 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, ... | mit |
bbgw/Klampt | Python/demos/vistemplate.py | 2 | 2256 | #!/usr/bin/python
import sys
from klampt import *
from klampt import visualization
from klampt import coordinates
from klampt import so3
import time
import math
if __name__ == "__main__":
print "vistemplate.py: This example demonstrates how to run the visualization framework"
if len(sys.argv)<=1:
prin... | bsd-3-clause |
ampax/edx-platform | cms/lib/xblock/test/test_runtime.py | 148 | 2238 | """
Tests of edX Studio runtime functionality
"""
from urlparse import urlparse
from mock import Mock
from unittest import TestCase
from cms.lib.xblock.runtime import handler_url
class TestHandlerUrl(TestCase):
"""Test the LMS handler_url"""
def setUp(self):
super(TestHandlerUrl, self).setUp()
... | agpl-3.0 |
pkuyym/Paddle | python/paddle/fluid/tests/unittests/test_assign_op.py | 5 | 1035 | # Copyright (c) 2018 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 app... | apache-2.0 |
40323120/2016springcd_aG2 | static/plugin/liquid_tags/b64img.py | 312 | 3085 | """
Image Tag
---------
This implements a Liquid-style image tag for Pelican,
based on the liquid img tag which is based on the octopress image tag [1]_
Syntax
------
{% b64img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %}
Examples
--------
{% b64img /images/ni... | agpl-3.0 |
pdellaert/ansible | lib/ansible/module_utils/network/nxos/facts/legacy/base.py | 8 | 24988 | # -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import platform
import re
from ansible.module_utils.network.nxos.nxos import run_commands, get_config, get_capabilities
from ansible.module_utils.network.nxos.utils.utils imp... | gpl-3.0 |
jnfrye/local_plants_book | scripts/observations/analyze/species_data_analyzer.py | 1 | 4641 | import pandas as pd
import argparse
from difflib import get_close_matches
import PyFloraBook.in_out.data_coordinator as dc
# ---------------- GLOBALS ----------------
# These are the weights used to create the final score (a weighted avg)
WEIGHTS = {
"CalFlora": 1,
"OregonFlora": 1,
"CPNWH_OR": ... | mit |
nttks/edx-platform | lms/djangoapps/bulk_email/tests/test_forms.py | 45 | 12615 | # -*- coding: utf-8 -*-
"""
Unit tests for bulk-email-related forms.
"""
from django.conf import settings
from mock import patch
from nose.plugins.attrib import attr
from bulk_email.models import CourseAuthorization, CourseEmailTemplate
from bulk_email.forms import CourseAuthorizationAdminForm, CourseEmailTemplateForm... | agpl-3.0 |
riklaunim/django-custom-multisite | django/contrib/gis/db/backends/postgis/models.py | 403 | 1970 | """
The GeometryColumns and SpatialRefSys models for the PostGIS backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
class GeometryColumns(models.Model):
"""
The 'geometry_columns' table from the PostGIS. See the PostGIS
documentation at Ch. 4.2.2.
... | bsd-3-clause |
vwvww/servo | components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py | 170 | 1701 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
[TreatNonCallableAsNull] callback Function = any(any... arguments);
interface TestTreatNonCallableAsNull1 {
attribute Function? onfoo;
attribute Function onbar;
};
""")
results = parser.finish()
... | mpl-2.0 |
palfrey/coherence | coherence/upnp/core/DIDLLite.py | 1 | 34516 | # Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2005, Tim Potter <tpot@samba.org>
# Copyright 2006, Frank Scholz <coherence@beebits.net>
"""
TODO:
- use more XPath expressions in fromElement() methods
"""
import os
import string
import urllib
from datetime import dateti... | mit |
miroag/mfs | ci/appveyor-download.py | 1 | 3807 | #!/usr/bin/env python
"""
Use the AppVeyor API to download Windows artifacts.
Taken from: https://bitbucket.org/ned/coveragepy/src/tip/ci/download_appveyor.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""
f... | mit |
liaoch/linux-xlnx | scripts/checkkconfigsymbols.py | 216 | 4661 | #!/usr/bin/env python
"""Find Kconfig identifiers that are referenced but not defined."""
# (c) 2014 Valentin Rothberg <valentinrothberg@gmail.com>
# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
#
# Licensed under the terms of the GNU GPL License version 2
import os
import re
from subprocess import Popen, PI... | gpl-2.0 |
andreparrish/python-for-android | python-modules/twisted/twisted/web/xmlrpc.py | 49 | 19640 | # -*- test-case-name: twisted.web.test.test_xmlrpc -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A generic resource for publishing objects via XML-RPC.
Maintainer: Itamar Shtull-Trauring
"""
# System Imports
import sys, xmlrpclib, urlparse
# Sibling Imports
from twisted.... | apache-2.0 |
HolgerPeters/scikit-learn | examples/cluster/plot_digits_agglomeration.py | 377 | 1694 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Feature agglomeration
=========================================================
These images how similar features are merged together using
feature agglomeration.
"""
print(__doc__)
# Code source: Gaël Varoquaux
#... | bsd-3-clause |
jerome-nexedi/dream | dream/simulation/JobMA.py | 5 | 1587 | # ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM 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 Founda... | gpl-3.0 |
ptisserand/ansible | lib/ansible/modules/database/mysql/mysql_variables.py | 78 | 5632 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Balazs Pocze <banyek@gawker.com>
# Certain parts are taken from Mark Theunissen's mysqldb module
#
# 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
__metac... | gpl-3.0 |
indictranstech/internal-frappe | frappe/utils/user.py | 1 | 8109 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _dict
import frappe.share
class User:
"""
A user object is created at the beginning of every request with details of the use.
The globa... | mit |
youprofit/shogun | examples/undocumented/python_modular/distance_hammingword_modular.py | 26 | 1551 | #!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
traindna = lm.load_dna('../data/fm_train_dna.dat')
testdna = lm.load_dna('../data/fm_test_dna.dat')
testdat = lm.load_labels('../data/fm_test_real.dat')
parameter_list = [[traindna,testdna,testdat,4,0,False,False],
[traindna,testdna,testdat,3,0... | gpl-3.0 |
sigma-random/asuswrt-merlin | release/src/router/samba36/source3/build/charset.py | 19 | 2022 | # tests for charsets for Samba3
from Configure import conf
@conf
def CHECK_SAMBA3_CHARSET(conf, crossbuild=False):
'''Check for default charsets for Samba3
'''
if conf.CHECK_ICONV(define='HAVE_NATIVE_ICONV'):
default_dos_charset=False
default_display_charset=False
default_unix_char... | gpl-2.0 |
lesoros/earthcoin_p2pool | p2pool/util/expiring_dict.py | 237 | 5233 | from __future__ import division
import time
import weakref
from p2pool.util import deferral
class Node(object):
def __init__(self, contents, prev=None, next=None):
self.contents, self.prev, self.next = contents, prev, next
def insert_before(self, contents):
self.prev.next = self.prev = n... | gpl-3.0 |
MD-Studio/MDStudio | mdstudio/mdstudio/tests/api/test_converter.py | 1 | 4204 | import datetime
from unittest import TestCase
import pytz
from mdstudio.api.converter import convert_obj_to_json
class ConverterTest(TestCase):
def test_convert_obj_to_json_date_time(self):
document = {
'date': datetime.datetime(2017, 10, 26, 9, 16, tzinfo=pytz.utc),
'f': '2017-... | apache-2.0 |
AkaZuko/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/views/course.py | 2 | 64077 | ''' -- imports from python libraries -- '''
# from datetime import datetime
import datetime
import json
''' -- imports from installed packages -- '''
from django.http import HttpResponseRedirect # , HttpResponse uncomment when to use
from django.http import HttpResponse
from django.http import Http404
from django.sho... | agpl-3.0 |
dsfsdgsbngfggb/odoo | addons/lunch/tests/__init__.py | 260 | 1077 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
raju249/oppia | core/jobs_registry.py | 2 | 2820 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
rhinstaller/pykickstart | tests/commands/module.py | 2 | 3241 | #
# Martin Kolman <mkolman@redhat.com>
#
# Copyright 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be use... | gpl-2.0 |
newswangerd/ansible | lib/ansible/vars/manager.py | 13 | 35816 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
onitake/ansible | contrib/inventory/lxc_inventory.py | 79 | 2560 | #!/usr/bin/env python
#
# (c) 2015-16 Florian Haas, hastexo Professional Services GmbH
# <florian@hastexo.com>
# Based in part on:
# libvirt_lxc.py, (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the... | gpl-3.0 |
zzicewind/nova | nova/db/sqlalchemy/migrate_repo/versions/216_havana.py | 44 | 64425 | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
jeffmacinnes/pyneal | tests/pyneal_tests/test_resultsServer.py | 1 | 2920 | import os
from os.path import join
import sys
import socket
import json
import numpy as np
import pyneal_helper_tools as helper_tools
# get dictionary with relevant paths for tests within this module
paths = helper_tools.get_pyneal_test_paths()
if paths['pynealDir'] not in sys.path:
sys.path.insert(0, paths[... | mit |
reachalpineswift/frappe-bench | frappe/email/email_body.py | 8 | 8351 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.pdf import get_pdf
from frappe.email.smtp import get_outgoing_email_account
from frappe.utils import get_url, scrub_urls, strip, expand_relative_ur... | mit |
silentfuzzle/calibre | src/calibre/gui2/store/stores/nexto_plugin.py | 15 | 3905 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 3 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011-2013, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
import re
import urllib
from c... | gpl-3.0 |
lfz/Guided-Denoise | Attackset/fgsm_ensv3_resv2_inresv2_random/nets/resnet_v1.py | 33 | 15274 | # 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 applicable ... | apache-2.0 |
studio666/gnuradio | gr-digital/examples/gen_whitener.py | 58 | 1814 | #!/usr/bin/env python
#
# Copyright 2011,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your opt... | gpl-3.0 |
stpx/canto-curses | plugins/theme-default.py | 2 | 2716 | # Canto Default Theme
# Defined as a plugin to use as a base for other themes.
FORCE_COLORS = False
FORCE_STYLE = False
from canto_next.plugins import check_program
check_program("canto-curses")
from canto_curses.story import StoryPlugin
from canto_curses.tag import TagPlugin
from canto_curses.theme import prep_fo... | gpl-2.0 |
jonge-democraten/website | create_local_settings.py | 1 | 1573 | #!/usr/bin/env python3
import codecs
import os
import random
import shutil
import string
import tempfile
LOCAL_SETTINGS_PATH = './website/local_settings.py'
LOCAL_SETTINGS_EXAMPLE_PATH = './website/local_settings_example.py'
def main():
if os.path.exists(LOCAL_SETTINGS_PATH):
print('ERROR: ' + LOCAL_SET... | mit |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/django/utils/lru_cache.py | 94 | 7648 | try:
from functools import lru_cache
except ImportError:
# backport of Python's 3.3 lru_cache, written by Raymond Hettinger and
# licensed under MIT license, from:
# <http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/>
# Should be removed when Django only sup... | mit |
hfp/tensorflow-xsmm | tensorflow/compiler/tests/xla_ops_test.py | 10 | 12658 | # 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 |
adeverteuil/backup | backup/test/test_snapshot.py | 1 | 10125 | # Alexandre's backup script
# Copyright © 2014 Alexandre A. de Verteuil
#
# 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 option) any ... | gpl-3.0 |
emil-mi/exercises-in-programming-style | 32-trinity/tf-32-reactive.py | 17 | 1545 | #!/usr/bin/env python
import sys, re, operator, collections
class WordFrequenciesModel:
""" Models the data. In this case, we're only interested
in words and their frequencies as an end result """
freqs = {}
def __init__(self):
self._observers = []
def register(self, obs):
self._o... | mit |
naparuba/kunai | data/global-configuration/packs/mongodb/collectors/pymongo/bulk.py | 17 | 25864 | # Copyright 2014-2015 MongoDB, 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 to in writin... | mit |
thiagolcmelo/segregation | segregation/muraki/models.py | 1 | 2276 | from django.db import models
# Create your models here.
class Alloy(models.Model):
name = models.CharField("Alloy's name", max_length = 30)
alloy_size = (
('d', 'Double'),
('d', 'Ternary')
)
def __str__(self):
return self.name
class Parameter(models.Model):
alloy = mod... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.