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 |
|---|---|---|---|---|---|
weimingtom/python-for-android | python3-alpha/python3-src/Lib/test/test_ftplib.py | 47 | 29722 | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import time
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase
from test im... | apache-2.0 |
dav1x/ansible | lib/ansible/playbook/base.py | 26 | 22559 | # (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 |
ewandor/home-assistant | homeassistant/components/climate/heatmiser.py | 2 | 3549 | """
Support for the PRT Heatmiser themostats using the V3 protocol.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.heatmiser/
"""
import logging
import voluptuous as vol
from homeassistant.components.climate import (
ClimateDevice, PLATFORM... | apache-2.0 |
futuresystems/big-data-stack | docs/source/conf.py | 3 | 11682 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Big Data Stack documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 8 10:57:01 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | apache-2.0 |
dbentley/pants | src/python/pants/option/option_value_container.py | 4 | 4819 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
from pa... | apache-2.0 |
h4wkmoon/shinken | shinken/modulesmanager.py | 1 | 13170 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you c... | agpl-3.0 |
halvertoluke/edx-platform | openedx/core/djangoapps/credit/tests/test_serializers.py | 30 | 1810 | """ Tests for Credit API serializers. """
# pylint: disable=no-member
from __future__ import unicode_literals
from django.test import TestCase
from openedx.core.djangoapps.credit import serializers
from openedx.core.djangoapps.credit.tests.factories import CreditProviderFactory, CreditEligibilityFactory
from student... | agpl-3.0 |
odoocn/odoomrp-wip | quality_control_mrp_operations/models/mrp.py | 20 | 6984 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
TRESCLOUD/odoopub | addons/account/installer.py | 381 | 8404 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
paulsmith/geodjango | django/contrib/gis/measure.py | 1 | 12194 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# 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 notice,
#... | bsd-3-clause |
ran5515/DeepDecision | tensorflow/contrib/tensor_forest/python/kernel_tests/finished_nodes_op_test.py | 80 | 6006 | # 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 |
melon-li/openstack-dashboard | openstack_dashboard/contrib/sahara/content/data_processing/clusters/tables.py | 25 | 5403 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
TheWardoctor/Wardoctors-repo | script.module.master.common/lib/js2py/host/jseval.py | 33 | 1522 | from js2py.base import *
import inspect
try:
from js2py.translators.translator import translate_js
except:
pass
@Js
def Eval(code):
local_scope = inspect.stack()[3][0].f_locals['var']
global_scope = this.GlobalObject
# todo fix scope - we have to behave differently if called through variable other ... | apache-2.0 |
napkindrawing/ansible | lib/ansible/modules/network/eos/eos_user.py | 20 | 12545 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
heli522/scikit-learn | examples/ensemble/plot_bias_variance.py | 357 | 7324 | """
============================================================
Single estimator versus bagging: bias-variance decomposition
============================================================
This example illustrates and compares the bias-variance decomposition of the
expected mean squared error of a single estimator again... | bsd-3-clause |
regiesoriano/rs_kernel_msm | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
bigdataelephants/scikit-learn | benchmarks/bench_multilabel_metrics.py | 11 | 7284 | #!/usr/bin/env python
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function
from timeit import timeit
from functools import partial
import itertools
import argparse
import sys
import matplotlib.pyplot as plt
import scipy.sparse as... | bsd-3-clause |
11craft/django-twoscoops-project | project_name/project_name/settings/base.py | 1 | 7145 | """Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project fold... | mit |
amenonsen/ansible | test/units/modules/network/f5/test_bigip_snmp_community.py | 22 | 9593 | # -*- 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
gusDuarte/sugar | extensions/deviceicon/volume.py | 3 | 4866 | # Copyright (C) 2008 One Laptop Per Child
#
# 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 version.
#
# This program is distribu... | gpl-2.0 |
lesglaneurs/lesglaneurs | lesglaneurs/settings/settings.py | 1 | 3966 | # -*- coding: utf-8 -*-
"""
Django settings for lesglaneurs project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: o... | gpl-3.0 |
rowemoore/odoo | addons/hr_contract/hr_contract.py | 302 | 5377 | # -*- 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 |
Panos-Bletsos/spark-cost-model-optimizer | examples/src/main/python/ml/word2vec_example.py | 122 | 1776 | #
# 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 us... | apache-2.0 |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py | 360 | 2852 | """
urllib3 - Thread-safe connection pooling and re-using.
"""
from __future__ import absolute_import
import warnings
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import encode_multipart_formdata
from .poolmanager imp... | agpl-3.0 |
leki75/ansible | lib/ansible/modules/network/avi/avi_cloudproperties.py | 49 | 3631 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
waheedahmed/edx-platform | common/djangoapps/util/tests/test_keyword_sub_utils.py | 27 | 4274 | """
Tests for keyword_substitution.py
"""
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from ddt import ddt, file_data
from mock import patch
from util.date_utils import get_default_... | agpl-3.0 |
52ai/django-ccsds | tests/test_client_regress/tests.py | 6 | 67078 | # -*- coding: utf-8 -*-
"""
Regression tests for the Test Client, especially the customized assertions.
"""
from __future__ import unicode_literals
import itertools
import os
from django.contrib.auth.models import User
from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.core.urlresolve... | bsd-3-clause |
theo-l/django | tests/null_fk_ordering/models.py | 27 | 1229 | """
Regression tests for proper working of ForeignKey(null=True). Tests these bugs:
* #7512: including a nullable foreign key reference in Meta ordering has
unexpected results
"""
from django.db import models
# The first two models represent a very simple null FK ordering case.
class Author(models.Model):
n... | bsd-3-clause |
szaghi/MaTiSSe | release/MaTiSSe-0.3.4/matisse/utils/source_editor.py | 1 | 20230 | #!/usr/bin/env python
"""
source_editor.py, module definition of SourceEditor class.
"""
# modules loading
# standard library modules: these should be present in any recent python distribution
import os
import re
import sys
# modules not in the standard library
import markdown
from .mdx_mathjax import MathJaxExtension
... | gpl-3.0 |
savoirfairelinux/OpenUpgrade | addons/l10n_fr/report/__init__.py | 424 | 1475 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
aksaxena80/test | tensorflow/python/kernel_tests/pooling_ops_test.py | 5 | 36678 | """Functional tests for pooling operations."""
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
from tensorflow.python.kernel_tests import gradient_checker as gc
from tensorflow.python.ops import gen_nn_ops
def GetInceptionMaxPoolShapes():
"""Itera... | apache-2.0 |
codeforsanjose/MobilityMapApi | src/sa_api_v2/cache.py | 1 | 21745 | from collections import defaultdict
from django.conf import settings
from django.core import cache as django_cache
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from . import utils
import logging
logger = logging.getLogger('sa_api_v2.cache')
# A sentinel object to... | gpl-3.0 |
qtumproject/qtum | test/functional/p2p_feefilter.py | 1 | 4085 | #!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of feefilter messages."""
from decimal import Decimal
import time
from test_framework... | mit |
mjfarmer/scada_py | env/lib/python2.7/site-packages/IPython/testing/ipunittest.py | 28 | 6468 | """Experimental code for cleaner support of IPython syntax with unittest.
In IPython up until 0.10, we've used very hacked up nose machinery for running
tests with IPython special syntax, and this has proved to be extremely slow.
This module provides decorators to try a different approach, stemming from a
conversation... | gpl-3.0 |
sylvan5/pygame | pyrpg/pyrpg25/pyrpg25.py | 1 | 39302 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
from pygame.locals import *
import codecs
import os
import random
import struct
import sys
SCR_RECT = Rect(0, 0, 640, 480)
GS = 32
DOWN,LEFT,RIGHT,UP = 0,1,2,3
STOP, MOVE = 0, 1 # 移動タイプ
PROB_MOVE = 0.005 # 移動確率
TRANS_COLOR = (190,179,145) # マップチップの透明色
sou... | mit |
maartenq/ansible | lib/ansible/modules/network/cloudengine/ce_interface_ospf.py | 43 | 30841 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
arjunsinghy96/coala | tests/core/BearTest.py | 11 | 8640 | import datetime
from itertools import permutations
from os.path import abspath, exists, isfile, join, getmtime
import shutil
import unittest
from dependency_management.requirements.PipRequirement import PipRequirement
from freezegun import freeze_time
import requests
import requests_mock
from coalib.core.Bear impo... | agpl-3.0 |
sinkuri256/python-for-android | python-build/python-libs/gdata/build/lib/atom/url.py | 280 | 4277 | #!/usr/bin/python
#
# Copyright (C) 2008 Google 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 ... | apache-2.0 |
agrc/AddressPointEditor | ui-tests/tests/test_find_address.py | 4 | 1102 | import unittest
import time
import basetest
class MapClick(basetest.BaseTest):
def setUp(self):
super(MapClick, self).setUp()
self.addressBox = self.browser.find_element_by_css_selector('.find-address .text-box input.dijitInputInner')
self.zipBox = self.browser.find_element_by_css... | mit |
vadimtk/chrome4sdp | components/test/data/autofill/merge/tools/reserialize_profiles_from_query.py | 162 | 1177 | #!/usr/bin/env python
# Copyright 2013 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 sys
from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType
def main():
"""Serializes the output of the ... | bsd-3-clause |
cgwalters/lorax | src/pylorax/__init__.py | 1 | 14465 | #
# __init__.py
#
# Copyright (C) 2010-2014 Red Hat, Inc.
#
# 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 version.
#
# This pr... | gpl-2.0 |
40223151/2014c2g9 | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/pprint.py | 96 | 12700 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... | gpl-2.0 |
seem-sky/kbengine | kbe/res/scripts/common/Lib/cgitb.py | 90 | 12041 | """More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to fi... | lgpl-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_vpn_sites_configuration_operations.py | 1 | 8349 | # 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 may ... | mit |
pandeylab/pyquant | pyquant/tests/test_peaks.py | 1 | 6061 | __author__ = 'chris'
import os
import unittest
import numpy as np
import six
import six.moves.cPickle as pickle
from pyquant.tests.utils import timer
from pyquant.tests.mixins import FileMixins, GaussianMixin
from pyquant import peaks
from pyquant import PEAK_FINDING_DERIVATIVE, PEAK_FINDING_REL_MAX, PEAK_FIT_MODE_FA... | mit |
mdanielwork/intellij-community | python/helpers/py3only/docutils/utils/math/tex2unichar.py | 50 | 34481 | # -*- coding: utf-8 -*-
# LaTeX math to Unicode symbols translation dictionaries.
# Generated with ``write_tex2unichar.py`` from the data in
# http://milde.users.sourceforge.net/LUCR/Math/
# Includes commands from: wasysym, stmaryrd, mathdots, mathabx, esint, bbold, amsxtra, amsmath, amssymb, standard LaTeX
mathacce... | apache-2.0 |
andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/requests_oauthlib-0.5.0-py2.7.egg/requests_oauthlib/compliance_fixes/facebook.py | 95 | 1119 | from json import dumps
try:
from urlparse import parse_qsl
except ImportError:
from urllib.parse import parse_qsl
from oauthlib.common import to_unicode
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if 'applica... | gpl-2.0 |
Maximilian-Reuter/SickRage-1 | lib/github/StatsParticipation.py | 74 | 2654 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | gpl-3.0 |
Liyier/learning_log | env/Lib/site-packages/django/urls/resolvers.py | 39 | 21589 | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""
from __future__ import unicode_literals
import functools... | mit |
bikashgupta11/javarobot | src/main/resources/jython/Lib/distutils/core.py | 75 | 9019 | """distutils.core
The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script). Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""
__revision__ = "$Id$"... | gpl-3.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/scipy/optimize/_tstutils.py | 138 | 1322 | ''' Parameters used in test and benchmark methods '''
from __future__ import division, print_function, absolute_import
from random import random
from scipy.optimize import zeros as cc
def f1(x):
return x*(x-1.)
def f2(x):
return x**2 - 1
def f3(x):
return x*(x-1.)*(x-2.)*(x-3.)
def f4(x):
if x... | mit |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/area_address/state/__init__.py | 1 | 107399 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
mruddy/bitcoin | test/functional/feature_settings.py | 30 | 3812 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various command line arguments and configuration file parameters."""
import json
from pathlib im... | mit |
veteman/thepython2blob | quaternion.py | 1 | 9336 | #Copyright 2015 B. Johan G. Svensson
#Licensed under the terms of the MIT license (see LICENSE).
from __future__ import division
import math
def real():
return Quaternion(1, 0, 0, 0)
def imag():
return Quaternion(0, 1, 0, 0)
def imag_i():
return Quaternion(0, 1, 0, 0)
def imag_j():
... | mit |
xfournet/intellij-community | python/testData/inspections/PyTypeCheckerInspection/AgainstTypingProtocolDefinition.py | 10 | 1379 | from typing import Protocol, Type
class Proto(Protocol):
def proto(self, i: int) -> None:
pass
class Concrete1:
def proto(self, i: int) -> None:
pass
class Concrete2(Proto):
def proto(self, i: int) -> None:
pass
class Concrete3:
def proto(self, i: str) -> None:
pa... | apache-2.0 |
ferabra/edx-platform | common/test/acceptance/pages/lms/auto_auth.py | 66 | 3293 | """
Auto-auth page (used to automatically log in during testing).
"""
import re
import urllib
from bok_choy.page_object import PageObject, unguarded
from . import AUTH_BASE_URL
class AutoAuthPage(PageObject):
"""
The automatic authorization page.
When allowed via the django settings file, visiting
th... | agpl-3.0 |
huanchenz/STX-h-store | third_party/python/boto/sdb/item.py | 11 | 6997 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | gpl-3.0 |
gonicus/gosa | backend/src/tests/backend/objects/test_factory.py | 1 | 7681 | # This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import unittest
from tests.GosaTestCase import *
from gosa.backend.objects.factory import *
@slow
... | lgpl-2.1 |
Grahack/blockly | appengine/storage.py | 186 | 2617 | """Blockly Demo: Storage
Copyright 2012 Google Inc.
https://developers.google.com/blockly/
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 |
jerome-jh/pm_2016 | do.py | 1 | 6101 | #!/usr/bin/env python3
import numpy as np
import itertools as it
import copy
import sys
import subprocess
import socket
north = 0
east = 1
south = 2
west = 3
ne = 4
se = 5
so = 6
no = 7
valeurs = {
'A': 1,
'B': 3,
'C': 3,
'D': 2,
'E': 1,
'F': 4,
'G': 2,
'H': 4,
'I': 1,
'J': 6,
'K': 5,
'L': 1,... | mit |
mrfuxi/django | tests/template_tests/syntax_tests/test_verbatim.py | 521 | 1658 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class VerbatimTagTests(SimpleTestCase):
@setup({'verbatim-tag01': '{% verbatim %}{{bare }}{% endverbatim %}'})
def test_verbatim_tag01(self):
output = self.engine.render_to_string('verb... | bsd-3-clause |
gameduell/duell | bin/win/python2.7.9/Lib/cgitb.py | 135 | 12180 | """More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to fi... | bsd-2-clause |
shastikk/youtube-dl | youtube_dl/extractor/weibo.py | 154 | 1786 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class WeiboIE(InfoExtractor):
"""
The videos in Weibo come from different sites, this IE just finds the link
to the external video and returns it.
"""
_VALID_URL = r'https?://video\.weibo\.com/v/w... | unlicense |
premanandchandrasekar/boto | boto/ec2/elb/healthcheck.py | 185 | 3775 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 wi... | mit |
ryfeus/lambda-packs | Tensorflow_OpenCV_Nightly/source/tensorflow/python/framework/subscribe.py | 33 | 11056 | # 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... | mit |
hezuoguang/ZGVL | WLServer/site-packages/django/contrib/sessions/middleware.py | 215 | 2031 | import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
from django.utils.importlib import import_module
class SessionMiddleware(object):
def process_request(self, request):
engine = import_module(settings.SESSION_ENGINE)
... | apache-2.0 |
mrbox/django | django/utils/timesince.py | 409 | 2671 | from __future__ import unicode_literals
import calendar
import datetime
from django.utils.html import avoid_wrapping
from django.utils.timezone import is_aware, utc
from django.utils.translation import ugettext, ungettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')),
... | bsd-3-clause |
Ensighten/Diamond | src/collectors/sidekiqweb/test/testsidekiqweb.py | 31 | 2044 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from sidekiqweb import Sid... | mit |
yongshengwang/hue | desktop/core/ext-py/Django-1.6.10/django/views/generic/list.py | 110 | 7014 | from __future__ import unicode_literals
from django.core.paginator import Paginator, InvalidPage
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, ContextMixin, View
c... | apache-2.0 |
adviti/melange | thirdparty/google_appengine/google/appengine/api/blobstore/blobstore_service_pb.py | 2 | 34553 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | apache-2.0 |
Eric-Zhong/odoo | addons/lunch/wizard/__init__.py | 440 | 1053 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
whiteclover/white | white/lib/paginator.py | 4 | 3198 | #!/usr/bin/env python
# 2015 Copyright (C) White
#
# 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, version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
#... | gpl-2.0 |
DasIch/django | django/conf/locale/sl/formats.py | 504 | 2118 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
fzalkow/scikit-learn | doc/tutorial/text_analytics/skeletons/exercise_02_sentiment.py | 256 | 2406 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
daira/tahoe-lafs-debian | setuptools-0.6c16dev6.egg/setuptools/command/build_py.py | 7 | 7462 | import os.path, sys, fnmatch
from distutils.command.build_py import build_py as _build_py
from distutils.util import convert_path
from glob import glob
class build_py(_build_py):
"""Enhanced 'build_py' command that includes data files with packages
The data files are specified via a 'package_data' argument to... | gpl-2.0 |
jiajiechen/mxnet | example/reinforcement-learning/ddpg/replay_mem.py | 52 | 3261 | # 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 |
spinza/bitcoin | qa/rpc-tests/forknotify.py | 6 | 2178 | #!/usr/bin/env python
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test -alertnotify
#
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import Auth... | mit |
alkadis/vcv | src/adhocracy/migration/versions/003_Offline_Tally.py | 4 | 1459 | from datetime import datetime
from sqlalchemy import *
from migrate import *
meta = MetaData()
poll_table = Table('poll', meta,
Column('id', Integer, primary_key=True),
Column('begin_time', DateTime, default=datetime.utcnow),
Column('end_time', DateTime, nullable=True),
Column('begin_user_id', Intege... | agpl-3.0 |
timkrentz/SunTracker | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/plugins/twisted_trial.py | 2 | 2093 |
from zope.interface import implements
from twisted.trial.itrial import IReporter
from twisted.plugin import IPlugin
class _Reporter(object):
implements(IPlugin, IReporter)
def __init__(self, name, module, description, longOpt, shortOpt, klass):
self.name = name
self.module = modul... | mit |
depet/scikit-learn | sklearn/cross_decomposition/pls_.py | 2 | 28547 | """
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..utils import check_arrays
from ..externals import six
import warnings
from abc import ... | bsd-3-clause |
heathseals/CouchPotatoServer | couchpotato/core/plugins/release/main.py | 27 | 20504 | from inspect import ismethod, isfunction
import os
import time
import traceback
from CodernityDB.database import RecordDeleted, RecordNotFound
from couchpotato import md5, get_db
from couchpotato.api import addApiView
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.encoding import ... | gpl-3.0 |
nopjmp/SickRage | lib/tmdb_api/test_tmdb_api.py | 52 | 5468 | """
test.py contains unit tests for tmdbsimple.py
Fill in Global Variables below before running tests.
Created by Celia Oakley on 2013-11-05
"""
import unittest
import sys
from tmdb_api import TMDB
#
# Global Variables (fill in or put in keys.py)
#
TMDB_API_KEY = 'edc5f123313769de83a71e157758030b'
try:
from k... | gpl-3.0 |
Voxel8/OctoPrint | src/octoprint/server/api/job.py | 29 | 1955 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
from flask import request, m... | agpl-3.0 |
c2corg/v6_api | c2corg_api/views/validation.py | 1 | 22830 | import functools
from c2corg_api.models import DBSession, article, image
from c2corg_api.models.area import AREA_TYPE
from c2corg_api.models.association import Association, \
updatable_associations, association_keys
from c2corg_api.models.book import BOOK_TYPE
from c2corg_api.models.document import Document
from c... | agpl-3.0 |
patmcb/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/LoginTest.py | 384 | 1320 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
oboking/gitinspector | gitinspector/clone.py | 48 | 1473 | # coding: utf-8
#
# Copyright © 2014 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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 |
Serag8/Bachelor | google_appengine/lib/django-1.5/django/template/loaders/app_directories.py | 114 | 2362 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.u... | mit |
XiaodunServerGroup/medicalmooc | common/lib/xmodule/xmodule/conditional_module.py | 6 | 10252 | """Conditional module is the xmodule, which you can use for disabling
some xmodules by conditions.
"""
import json
import logging
from lazy import lazy
from lxml import etree
from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.modulestore import Location
from xmodule.seq_module... | agpl-3.0 |
ricardogsilva/QGIS | tests/src/python/test_qgsexpressionlineedit.py | 45 | 2233 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsExpressionLineEdit
.. note:: 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 version.
... | gpl-2.0 |
glove747/liberty-neutron | neutron/server/wsgi_pecan.py | 9 | 1749 | #!/usr/bin/env python
# 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 wr... | apache-2.0 |
1tush/sentry | src/sentry/web/frontend/project_issue_tracking.py | 17 | 2914 | from __future__ import absolute_import
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.utils.safestring import mark_safe
from sentry import constants
from sentry.models import OrganizationMemberType
from sentry.plugins import plugins, IssueTrackingPlugin
from sentry.web.fr... | bsd-3-clause |
mrquim/mrquimrepo | script.module.exodus/lib/resources/lib/sources/en/videoscraper.py | 5 | 3162 | # -*- coding: utf-8 -*-
"""
Exodus Add-on
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 progra... | gpl-2.0 |
robertwb/incubator-beam | learning/katas/python/Common Transforms/Aggregation/Smallest/tests.py | 7 | 1182 | # 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"); y... | apache-2.0 |
40423105/2017springcd_hw | plugin/liquid_tags/video.py | 296 | 2360 | """
Video Tag
---------
This implements a Liquid-style video tag for Pelican,
based on the octopress video tag [1]_
Syntax
------
{% video url/to/video [width height] [url/to/poster] %}
Example
-------
{% video http://site.com/video.mp4 720 480 http://site.com/poster-frame.jpg %}
Output
------
<video width='720' hei... | agpl-3.0 |
nclsHart/glances | glances/plugins/glances_percpu.py | 1 | 4722 | # -*- 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 |
atsao72/sympy | sympy/utilities/tests/test_iterables.py | 58 | 26629 | from __future__ import print_function
from textwrap import dedent
from sympy import (
symbols, Integral, Tuple, Dummy, Basic, default_sort_key, Matrix,
factorial, true)
from sympy.combinatorics import RGS_enum, RGS_unrank, Permutation
from sympy.core.compatibility import range
from sympy.utilities.iterables im... | bsd-3-clause |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pandas/tests/frame/test_convert_to.py | 6 | 7374 | # -*- coding: utf-8 -*-
import pytest
import numpy as np
from pandas import compat
from pandas import (DataFrame, Series, MultiIndex, Timestamp,
date_range)
import pandas.util.testing as tm
from pandas.tests.frame.common import TestData
class TestDataFrameConvertTo(TestData):
def test_to_d... | agpl-3.0 |
niknow/BankCSVtoQif | bankcsvtoqif/tests/banks/test_swedbank.py | 1 | 2368 | # -*- coding: utf-8 -*-
# BankCSVtoQif - Smart conversion of csv files from a bank to qif
# Copyright (C) 2015-2016 Nikolai Nowaczyk
#
# 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 v... | gpl-2.0 |
liorvh/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/urlfetcher.py | 165 | 2420 | # Copyright (C) 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 ... | bsd-3-clause |
dpm76/Bot1 | bot1/playground/pilot_basic_test.py | 1 | 1119 | '''
Created on 6 nov. 2018
@author: david
'''
import logging
from engine.driver import Driver, StepMotor
from piloting.pilot import BasicPilot
from sensor.wheel import WheelMotion
from sensor.imu6050 import Imu6050
TRAVEL_LENGTH = 160
logging.basicConfig(level=logging.INFO)
def move(pilot, turnAngle):
logging... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.