repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
adoosii/edx-platform | openedx/core/djangoapps/content/course_overviews/migrations/0003_add_cert_html_view_enabled.py | 66 | 3418 | # -*- 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 'CourseOverview.cert_html_view_enabled'
# The default val... | agpl-3.0 |
thejens/luigi | luigi/notifications.py | 1 | 12373 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
avanzosc/avanzosc6.1 | avanzosc_account_extension/account_move.py | 1 | 2329 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Avanzosc - Avanced Open Source Consulting
# Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
kswiat/django | tests/file_storage/models.py | 25 | 1134 | """
Storing files according to a custom storage system
``FileField`` and its variations can take a ``storage`` argument to specify how
and where files should be stored.
"""
import os
import random
import tempfile
from django.db import models
from django.core.files.storage import FileSystemStorage
temp_storage_loca... | bsd-3-clause |
evansde77/cirrus | tests/unit/cirrus/documentation_utils_test.py | 1 | 3593 | """
documentation utils tests
"""
import mock
import os
import tempfile
import unittest
from requests_toolbelt import MultipartEncoder
from cirrus.documentation_utils import doc_artifact_name
from cirrus.documentation_utils import build_docs
from cirrus.documentation_utils import build_doc_artifact
from cirrus.docum... | apache-2.0 |
peihe/incubator-beam | sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes_it_test.py | 9 | 2594 | #
# 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 |
sudarkoff/ansible | lib/ansible/galaxy/api.py | 10 | 6504 | #!/usr/bin/env python
########################################################################
#
# (C) 2013, James Cammarata <jcammarata@ansible.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 ... | gpl-3.0 |
minhphung171093/OpenERP_V7 | openerp/addons/event_moodle/__openerp__.py | 54 | 2654 | # -*- 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 |
sacnayak/ssnayak-viz | lib/oauth2client/clientsecrets.py | 52 | 5238 | # Copyright 2014 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 ... | apache-2.0 |
vijeth-aradhya/coala-bears | bears/generate_package.py | 7 | 6620 | import argparse
import glob
import os
import shutil
from string import Template
import subprocess
import sys
import time
from bears import VERSION
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.collecting.Importers import iimport_objects
from coalib.parsing.Globbing import glo... | agpl-3.0 |
yanirs/servo | python/mach/mach/decorators.py | 96 | 11718 | # 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, unicode_literals
import argparse
import collections
import inspect
import types... | mpl-2.0 |
fxia22/ASM_xf | PythonD/lib/python2.4/rlcompleter.py | 13 | 5261 | """Word completion for GNU readline 2.0.
This requires the latest extension to the readline module. The completer
completes keywords, built-ins and globals in a selectable namespace (which
defaults to __main__); when completing NAME.NAME..., it evaluates (!) the
expression up to the last dot and completes its attribut... | gpl-2.0 |
CORDEA/analysis_of_oricon_special-girls | get_ranking.py | 1 | 2171 | #!/usr/bin/env python
# encoding:utf-8
#
# Copyright [2015] [Yoshihiro Tanaka]
# 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 requir... | apache-2.0 |
zhoulingjun/django | django/conf/locale/fr/formats.py | 504 | 1454 | # -*- 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 = 'j F Y'
TIME_FORMAT = 'H:i'
DATETI... | bsd-3-clause |
amit-shar/elasticsearch | dev-tools/upgrade-tests.py | 118 | 15291 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
mahound/Cyanogenmod_kernel_samsung_loganreltexx | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
jfhumann/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/_base.py | 715 | 13699 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent formatting
# fr... | mpl-2.0 |
b-daniels/apitools | apitools/base/py/base_cli.py | 1 | 4412 | #!/usr/bin/env python
"""Base script for generated CLI."""
import atexit
import code
import logging
import os
import readline
import rlcompleter
import sys
from google.apputils import appcommands
import gflags as flags
from apitools.base.py import encoding
from apitools.base.py import exceptions
__all__ = [
'Co... | apache-2.0 |
txt2tags/old | txt2tags-2.4.py | 5 | 158426 | #!/usr/bin/env python
# txt2tags - generic text conversion tool
# http://txt2tags.sf.net
#
# Copyright 2001, 2002, 2003, 2004, 2005, 2006 Aurelio Marinho Jargas
#
# 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 Fre... | gpl-2.0 |
alvarovmz/PyLinkedIn | linkedin/Location.py | 1 | 1823 | # WARNING: this file is generated automaticaly.
# Do not modify it manually, your work would be lost.
# Copyright 2012 Alvaro Vila
# alvarovmz@gmail.com
# This file is part of PyLinkedIn.
# PyLinkedIn is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
... | gpl-3.0 |
eek6/squeakspace | test/proxy/test2.py | 1 | 1220 | #!/usr/bin/python2.7
import httplib as ht
import json
import client_path
import squeakspace.proxy.client.client as client
import test_params
conn = ht.HTTPConnection(test_params.server_address, test_params.server_port)
cl = client.Client(conn)
user1 = 'alice'
pass1 = 'secret_password'
passphrase1 = 'secret_passph... | gpl-3.0 |
arthuc01/Molecular-Pathways-from-molecular-similarity | mol-similarity-pathways.py | 1 | 1816 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 30 10:52:04 2015
@author: chxcja
Can we reconstruct a biosynthetic pathway simply from the structures.
It turns out the answer is no - but you can get large contiguous parts of the
pathway - but there needs to be chemical insight into identifying unrealistic
chemical o... | mit |
Dark5ide/mycroft-core | test/unittests/util/test_format_pt.py | 1 | 14032 | #
# Copyright 2019 Mycroft AI 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 writ... | apache-2.0 |
windyuuy/opera | chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py | 188 | 3699 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
# Copyright (C) 2010 ProFUSION embedded systems
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
cloudant/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Scanner/C.py | 61 | 4864 | """SCons.Scanner.C
This module implements the depenency scanner for C/C++ code.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files... | apache-2.0 |
iurisilvio/flask-admin | examples/peewee/app.py | 36 | 2087 | from flask import Flask
import peewee
import flask_admin as admin
from flask_admin.contrib.peewee import ModelView
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
db = peewee.SqliteDatabase('test.sqlite', check_same_thread=False)
class BaseModel(peewee.Model):
class Meta:
database = db
... | bsd-3-clause |
feliperfranca/django-nonrel-example | django/views/defaults.py | 291 | 1663 | from django import http
from django.views.decorators.csrf import requires_csrf_token
from django.template import Context, RequestContext, loader
# This can be called when CsrfViewMiddleware.process_view has not run, therefore
# need @requires_csrf_token in case the template needs {% csrf_token %}.
@requires_csrf_toke... | bsd-3-clause |
double12gzh/nova | nova/tests/unit/fake_policy.py | 3 | 17460 | # Copyright (c) 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
shepdelacreme/ansible | lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py | 27 | 4642 | #!/usr/bin/python
#
# Copyright (c) 2016 Julien Stroheker, <juliens@microsoft.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
tdubourg/downsizing-game | game.py | 1 | 3166 | #!/usr/bin/python
from judge import Judge
from clock import Clock
from player import DummyPlayer
from transactions import Resources
from utils import l
from player import DummyPlayer, CheaterPlayer
from random import choice
from utils import d, l, e
class Game(object):
"""
Game class creates players, initi... | lgpl-3.0 |
kennethlove/django | django/utils/baseconv.py | 95 | 2984 | # Copyright (c) 2010 Taurinus Collective. All rights reserved.
# Copyright (c) 2009 Simon Willison. All rights reserved.
# Copyright (c) 2002 Drew Perttula. All rights reserved.
#
# License:
# Python Software Foundation License version 2
#
# See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF... | bsd-3-clause |
GRArmstrong/invenio-inspire-ops | modules/miscutil/lib/filedownloadutils_tests.py | 2 | 1849 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
rakshit-agrawal/sonnet | sonnet/python/modules/attention.py | 10 | 7926 | # Copyright 2017 The Sonnet 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 l... | apache-2.0 |
noironetworks/nova | nova/tests/functional/db/test_host_mapping.py | 44 | 4436 | # 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
# d... | apache-2.0 |
fourkbomb/hsceebs | app.py | 1 | 4059 | # hsc-countdown
# Copyright (C) 2016 Simon Shields
#
# 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) any later version.
#
# This pro... | agpl-3.0 |
jlombacher/pyqtgraph | pyqtgraph/opengl/GLGraphicsItem.py | 37 | 10090 | from OpenGL.GL import *
from OpenGL import GL
from ..Qt import QtGui, QtCore
from .. import Transform3D
from ..python2_3 import basestring
GLOptions = {
'opaque': {
GL_DEPTH_TEST: True,
GL_BLEND: False,
GL_ALPHA_TEST: False,
GL_CULL_FACE: False,
},
'translucent': {
... | mit |
jiasir/openstack-trove | lib/charmhelpers/contrib/storage/linux/utils.py | 1 | 1624 | import os
import re
from stat import S_ISBLK
from subprocess import (
check_call,
check_output,
call
)
def is_block_device(path):
'''
Confirm device at path is a valid block device node.
:returns: boolean: True if path is a block device, False if not.
'''
if not os.path.exists(path):... | mit |
kanteshraj/ansible | test/units/inventory/test_inventory.py | 23 | 3487 | # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | gpl-3.0 |
kchodorow/tensorflow | tensorflow/python/kernel_tests/sparse_concat_op_test.py | 138 | 13011 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
HaebinShin/tensorflow | tensorflow/python/kernel_tests/attention_ops_test.py | 26 | 7600 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_state_snapshot_py3.py | 1 | 2285 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
nikitabrazhnik/flask2 | Module 3/Chapter10/Chapter 10/webapp/controllers/rest/parsers.py | 11 | 1408 | from flask.ext.restful import reqparse
user_post_parser = reqparse.RequestParser()
user_post_parser.add_argument('username', type=str, required=True)
user_post_parser.add_argument('password', type=str, required=True)
post_get_parser = reqparse.RequestParser()
post_get_parser.add_argument('page', type=int, location=['... | mit |
Wingless-Archangel/CustomCommand | Python Practice/learn_django/lib/python3.6/site-packages/setuptools/dist.py | 10 | 37517 | __all__ = ['Distribution']
import re
import os
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsSetupError)
from distutils.util import rfc822_escape
import six
f... | gpl-3.0 |
ros/ros | core/roslib/test/test_roslib_stacks.py | 1 | 9175 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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... | bsd-3-clause |
kevinge314gh/tornado | tornado/test/curl_httpclient_test.py | 107 | 4477 | from __future__ import absolute_import, division, print_function, with_statement
from hashlib import md5
from tornado.escape import utf8
from tornado.httpclient import HTTPRequest
from tornado.stack_context import ExceptionStackContext
from tornado.testing import AsyncHTTPTestCase
from tornado.test import httpclient_... | apache-2.0 |
syphar/django | tests/invalid_models_tests/test_deprecated_fields.py | 51 | 1489 | from django.core import checks
from django.db import models
from django.test import SimpleTestCase
from django.test.utils import isolate_apps
@isolate_apps('invalid_models_tests')
class DeprecatedFieldsTests(SimpleTestCase):
def test_IPAddressField_deprecated(self):
class IPAddressModel(models.Model):
... | bsd-3-clause |
barneyElDinosaurio/thefuck | tests/rules/test_mvn_unknown_lifecycle_phase.py | 5 | 3617 | import pytest
from thefuck.rules.mvn_unknown_lifecycle_phase import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='mvn cle', stdout='[ERROR] Unknown lifecycle phase "cle". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>... | mit |
hasadna/django | tests/regressiontests/utils/module_loading.py | 15 | 6449 | import os
import sys
import imp
from zipimport import zipimporter
from django.utils import unittest
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
from django.utils._os import upath
class DefaultLoader(unittest.TestCase):
def setUp(self):
sys... | bsd-3-clause |
jguyomard/phantomjs | src/breakpad/src/tools/gyp/test/subdirectory/gyptest-top-default.py | 240 | 1374 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... | bsd-3-clause |
cristianveron/HACKERS-ADDONS | 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):
... | gpl-2.0 |
mbareta/edx-platform-ft | lms/djangoapps/mobile_api/users/tests.py | 13 | 17688 | """
Tests for users API
"""
# pylint: disable=no-member
import datetime
import ddt
from mock import patch
from nose.plugins.attrib import attr
import pytz
from django.conf import settings
from django.utils import timezone
from django.template import defaultfilters
from django.test import RequestFactory
from milestones... | agpl-3.0 |
jeremyplichta/pi-halloween | eyes.py | 1 | 2560 | import threading
import logging
from os import listdir
from os.path import isfile, join
import random
import time
import time
import RPi.GPIO as GPIO
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-10s) %(asctime)s %(message)s',
)
class Eyes(threading.Thread):
... | mit |
10clouds/edx-platform | lms/djangoapps/certificates/tests/test_create_fake_cert.py | 27 | 2031 | """Tests for the create_fake_certs management command. """
from django.test import TestCase
from django.core.management.base import CommandError
from nose.plugins.attrib import attr
from opaque_keys.edx.locator import CourseLocator
from student.tests.factories import UserFactory
from certificates.management.commands i... | agpl-3.0 |
ldolberg/network_awareness | Linux Service/src/awareness_deamon/driver.py | 1 | 1632 | #!/usr/bin/python
import redis
import config
import json
import logger
r = redis.StrictRedis(host=config.redis['host'], port=config.redis['port'], db=0)
class NotLoggedException(Exception):pass
def program_cleanup():
print "Service Going Down"
return 0
#TODO Change name
def reload_service_config():
pass
def par... | gpl-3.0 |
theflofly/tensorflow | tensorflow/python/ops/sort_ops_test.py | 30 | 4940 | # 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 |
weolar/miniblink49 | third_party/WebKit/Tools/Scripts/webkitpy/common/net/networktransaction.py | 190 | 2926 | # Copyright (C) 2010 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 ... | apache-2.0 |
girving/tensorflow | tensorflow/contrib/boosted_trees/estimator_batch/custom_export_strategy_test.py | 47 | 9513 | # 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 |
bohlian/frappe | frappe/core/doctype/role/role.py | 11 | 1252 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Role(Document):
def before_rename(self, old, new, merge=False):
if old in ("Guest", "Administrator", "System Ma... | mit |
sterwill/aiohttp | examples/srv.py | 14 | 5441 | #!/usr/bin/env python3
"""Simple server written using an event loop."""
import argparse
import logging
import os
import sys
try:
import ssl
except ImportError: # pragma: no cover
ssl = None
import asyncio
import aiohttp
import aiohttp.server
assert sys.version >= '3.3', 'Please use Python 3.3 or higher.'
... | apache-2.0 |
valentin-krasontovitsch/ansible | lib/ansible/plugins/inventory/yaml.py | 90 | 6837 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
inventory: yaml
version_added: "2.4"
short_description: Uses a speci... | gpl-3.0 |
tongwang01/tensorflow | tensorflow/contrib/graph_editor/examples/edit_graph_example.py | 182 | 1494 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
derekjchow/models | tutorials/image/cifar10_estimator/cifar10.py | 8 | 3805 | # 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 |
sebrandon1/nova | nova/tests/unit/api/openstack/compute/test_flavor_swap.py | 1 | 2153 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
sam-tsai/django-old | tests/regressiontests/admin_util/tests.py | 10 | 6976 | from datetime import datetime
import unittest
from django.conf import settings
from django.db import models
from django.utils.formats import localize
from django.test import TestCase
from django.contrib import admin
from django.contrib.admin.util import display_for_field, label_for_field, lookup_field
from django.con... | bsd-3-clause |
wjingzhe/A_ParkourJingz | cocos2d/tools/gen-prebuilt/excopy.py | 94 | 3283 | #!/usr/bin/python
# ----------------------------------------------------------------------------
# extend methods for copy files/dirs
#
# Copyright 2014 (C) zhangbin
#
# License: MIT
# ----------------------------------------------------------------------------
import os
import shutil
def copy_files_in_dir(src, dst):... | mit |
davoclavo/openag_brain | src/openag_brain/peripherals/atlas_ec.py | 4 | 2625 | """
This module consists of code for interacting with the Atlas electrical
conductivity (EC) sensor.
"""
"""
IMPORTANT: Need to configure FTDI on raspi for this module to work properly.
See: https://github.com/OpenAgInitiative/openag_atlas_ph_python/blob/master/README.md
"""
import rospy
import time
from atlas_device... | gpl-3.0 |
maciekcc/tensorflow | tensorflow/contrib/stateless/__init__.py | 48 | 1515 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
aydevosotros/TFG-AntonioMolina | TFG/RBFNN/RBFNN.py | 1 | 7224 | '''
Created on Jun 14, 2014
Based of a RBFNN for python written by Thomas Rueckstiess.
http://www.rueckstiess.net/research/snippets/show/72d2363e
Added by Antonio Molina:
- K-means clustering
@author: antonio
'''
from enum import Enum
from scipy import *
import numpy as np
from scipy.linalg import norm, pinv
fro... | gpl-2.0 |
BrotherPhil/django | tests/humanize_tests/tests.py | 336 | 13163 | from __future__ import unicode_literals
import datetime
from decimal import Decimal
from unittest import skipIf
from django.contrib.humanize.templatetags import humanize
from django.template import Context, Template, defaultfilters
from django.test import TestCase, modify_settings, override_settings
from django.utils... | bsd-3-clause |
tdtrask/ansible | lib/ansible/modules/cloud/vultr/vr_account_facts.py | 39 | 3338 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# 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 |
rmfitzpatrick/ansible | lib/ansible/plugins/action/iosxr_config.py | 46 | 4184 | #
# (c) 2017, Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is... | gpl-3.0 |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32/Demos/win32gui_devicenotify.py | 6 | 3909 | # Demo RegisterDeviceNotification etc. Creates a hidden window to receive
# notifications. See serviceEvents.py for an example of a service doing
# that.
import sys, time
import win32gui, win32con, win32api, win32file
import win32gui_struct, winnt
# These device GUIDs are from Ioevent.h in the Windows SDK. Ideally ... | apache-2.0 |
zstackorg/zstack-woodpecker | integrationtest/vm/virtualrouter/eip/test_create_eip_vm.py | 2 | 2949 | '''
Test create EIP for a VM.
Test step:
1. Create a VM
2. Create a EIP with VM's nic
3. Check the EIP connectibility
4. Destroy VM
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_... | apache-2.0 |
Zocket/goodeal | goodeal/settings.py | 1 | 2366 | """
Django settings for goodeal project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | mit |
marxin/tapiriik | tapiriik/web/views/payments/__init__.py | 15 | 5444 | from tapiriik.settings import PP_WEBSCR, PP_RECEIVER_ID, PAYMENT_CURRENCY
from tapiriik.auth import User
from tapiriik.payments import Payments, ExternalPaymentProvider
from tapiriik.web.views.ab import ab_experiment_complete, ab_register_experiment
from django.views.decorators.csrf import csrf_exempt
from django.views... | apache-2.0 |
benjiboi214/mmpl-wagtail | site/home/templatetags/home_tags.py | 1 | 5484 | import datetime
from django import template
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from home.models import Social, Copyright, AboutFooter, Logo, \
Page, BlogPageMediaItem, AboutPageContactItem, MediaItem
register = template.Library()
@register.simple_tag(takes_co... | mit |
sviete/AIS-EXT | mopidy_ais_ext/stt/server.py | 1 | 3252 | from mopidy_ais_ext.ai import parser
from mopidy_ais_ext.status import ui
from mopidy_ais_ext.config import settings
import BaseHTTPServer
import threading
import logging
logger = logging.getLogger(__name__)
class SttServer():
def __init__(self):
self.server_address = ('localhost', 8000)
self.ht... | apache-2.0 |
wallarelvo/roshelper | examples/functions_node_rospy.py | 1 | 1732 | import rospy
from std_msgs.msg import String
from std_msgs.msg import Int64
from std_srvs.srv import SetBool, SetBoolRequest, SetBoolResponse
str_pub = rospy.Publisher("/test_node_string", String, queue_size=1)
int_pub_1 = rospy.Publisher("/test_node_int", Int64, queue_size=1)
int_pub_2 = rospy.Publisher("/another_te... | gpl-3.0 |
karlproject/karl.external_link_ticket | setup.py | 1 | 2319 | # Copyright (C) 2008-2009 Open Society Institute
# Thomas Moroz: tmoroz@sorosny.org
#
# 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. You may not use, modify or distribu... | gpl-2.0 |
soldag/home-assistant | tests/components/netatmo/test_media_source.py | 13 | 2552 | """Test Local Media Source."""
import ast
import pytest
from homeassistant.components import media_source
from homeassistant.components.media_source import const
from homeassistant.components.media_source.models import PlayMedia
from homeassistant.components.netatmo import DATA_CAMERAS, DATA_EVENTS, DOMAIN
from homea... | apache-2.0 |
spvkgn/youtube-dl | youtube_dl/extractor/malltv.py | 6 | 3298 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
dict_get,
float_or_none,
int_or_none,
merge_dicts,
parse_duration,
try_get,
)
class MallTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|sk)\.)?mall\.tv/(?... | unlicense |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/openmdao.main-0.13.0-py2.7.egg/openmdao/main/test/test_derivatives.py | 1 | 124912 | """
Basic unit testing of OpenMDAO's derivative capability.
"""
from cStringIO import StringIO
from nose import SkipTest
import re
import unittest
from mock import Mock
from numpy import zeros, array, random
import numpy as np
from openmdao.lib.architectures.api import MDF, CO
from openmdao.lib.optproblems.api impor... | gpl-2.0 |
rogeriofalcone/treeio | identities/migrations/0003_related_accessentity.py | 1 | 12943 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Migrate Conta... | mit |
rolandmansilla/microblog | flask/lib/python2.7/site-packages/pip/_vendor/pyparsing.py | 28 | 156250 | # module pyparsing.py
#
# Copyright (c) 2003-2015 Paul T. McGuire
#
# 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, cop... | bsd-3-clause |
Tiglas/pickup-planner | request_handler/flask/lib/python2.7/site-packages/flask/testsuite/basic.py | 406 | 43777 | # -*- coding: utf-8 -*-
"""
flask.testsuite.basic
~~~~~~~~~~~~~~~~~~~~~
The basic functionality.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
import uuid
import flask
import pickle
import unittest
from datetime import datetime
from threading i... | mit |
ValFadeev/ansible-modules-core | files/unarchive.py | 49 | 13065 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Dylan Martin <dmartin@seattlecentral.edu>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the t... | gpl-3.0 |
AltSchool/django-allauth | allauth/socialaccount/providers/dropbox/tests.py | 2 | 1269 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from allauth.socialaccount.tests import OAuth2TestsMixin
from allauth.tests import MockedResponse, TestCase
from .provider import DropboxOAuth2Provider
class DropboxOAuth2Tests(OAuth2TestsMixin, TestCase):
provider_id = DropboxOAuth2Pr... | mit |
onitake/ansible | lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py | 27 | 9051 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Dimension Data
# Authors:
# - Aimon Bustardo <aimon.bustardo@dimensiondata.com>
# - Bert Diwa <Lamberto.Diwa@dimensiondata.com>
# - Adam Friedman <tintoy@tintoy.io>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licen... | gpl-3.0 |
lmazuel/ansible | lib/ansible/modules/cloud/vmware/vmware_portgroup.py | 70 | 5736 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
jamielennox/tempest | tempest/api_schema/response/compute/version.py | 16 | 2153 | # Copyright 2014 NEC Corporation. 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 |
pjliddy/bwarealty | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | mit |
sietse/pyietflib | TestSuite/rfc6350TestSuite/smoke_GET.py | 3 | 1282 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-----------------------------------------------------------------------------
"""ERChime department acceptance test."""
__author__ = ('Lance Finn Helsten',)
__version__ = '1.0'
__copyright__ = """Copyright 2011 Lance Finn Helsten (helsten@acm.org)"""
__license__ = """
Lice... | apache-2.0 |
dbaeck/aspino | tests/satModels.checker.py | 2 | 1615 | def decodeModels(string):
models = []
model = set()
for line in string.split("\n"):
line = line.strip()
if len(line) == 0: continue
if line[0] == 'v':
model = model | set(line[2:].split(" "))
elif line[0] == 'c' and len(model) > 0:
models.append(model... | apache-2.0 |
shadowbq/dot.atom | home/.atom/packages/wakatime/lib/wakatime-master/wakatime/packages/requests/packages/urllib3/util/retry.py | 699 | 9924 | import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
Each retry attempt will create a new Re... | mit |
weaver-viii/h2o-3 | h2o-py/tests/testdir_algos/glm/pyunit_link_functions_gaussianGLM.py | 3 | 1458 | import sys
sys.path.insert(1, "../../../")
import h2o
import pandas as pd
import zipfile
import statsmodels.api as sm
def link_functions_gaussian(ip,port):
print("Read in prostate data.")
h2o_data = h2o.import_file(path=h2o.locate("smalldata/prostate/prostate_complete.csv.zip"))
h2o_data.head()
... | apache-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/pandas/tests/indexes/period/test_setops.py | 15 | 10772 | import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pandas.core.indexes.period as period
from pandas import period_range, PeriodIndex, Index, date_range
def _permute(obj):
return obj.take(np.random.permutation(len(obj)))
class TestPeriodIndex(object):
def setup_me... | mit |
Archcady/mbed-os | tools/export/ds5_5/__init__.py | 10 | 2065 | """
mbed SDK
Copyright (c) 2011-2016 ARM Limited
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 |
chyeh727/django | django/db/models/deletion.py | 144 | 14337 | from collections import Counter, OrderedDict
from itertools import chain
from operator import attrgetter
from django.db import IntegrityError, connections, transaction
from django.db.models import signals, sql
from django.utils import six
class ProtectedError(IntegrityError):
def __init__(self, msg, protected_ob... | bsd-3-clause |
atsidaev/gdb-z80 | gdb/testsuite/gdb.python/py-prettyprint.py | 41 | 9081 | # Copyright (C) 2008-2014 Free Software Foundation, 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 3 of the License, or
# (at your option) any later version.
#
# This progr... | gpl-2.0 |
ity/pants | tests/python/pants_test/jvm/subsystems/test_jvm.py | 4 | 2607 | # coding=utf-8
# Copyright 2015 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 functools
fr... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.