repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
lispc/Paddle | v1_api_demo/quick_start/dataprovider_emb.py | 10 | 1953 | # Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
asadziach/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py | 92 | 4535 | # 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 |
tareqalayan/pytest | _pytest/monkeypatch.py | 1 | 9043 | """ monkeypatching and mocking functionality. """
from __future__ import absolute_import, division, print_function
import os
import sys
import re
import six
from _pytest.fixtures import fixture
RE_IMPORT_ERROR_NAME = re.compile("^No module named (.*)$")
@fixture
def monkeypatch():
"""The returned ``monkeypatch... | mit |
mpobrien/see | see.py | 1 | 6339 | #!/usr/bin/env python
"""
see
A human alternative to dir().
>>> from see import see
>>> help(see)
Copyright (c) 2009 Liam Cooke
http://inky.github.com/see/
Licensed under the GNU General Public License v3. {{{
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU... | gpl-3.0 |
bkillenit/AbletonAPI | python-api-materials/code/Hack_LiveCurses/rpyc/utils/ssh.py | 3 | 10267 | import os
from subprocess import Popen, PIPE
from rpyc.lib import safe_import
from rpyc.lib.compat import BYTES_LITERAL
signal = safe_import("signal")
# modified from the stdlib pipes module for windows
_safechars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@%_-+=:,./'
_funnychars = '"`$\\'
def s... | mit |
crepererum/invenio | invenio/legacy/bibdocfile/config.py | 12 | 2801 | # 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) any later version.
#
# Invenio is d... | gpl-2.0 |
JASchilz/RoverMUD | simple_universe/attachments/ooc_commands.py | 1 | 1072 | from basics import BaseAttachment
class OOCComands(BaseAttachment):
character = False
def __init__(self, character):
self.character = character
self.action_matrix = [
["help", self.do_help,
"Open the help screen, or receive help on a specific command. \
... | apache-2.0 |
ylatuya/Flumotion | flumotion/test/test_component.py | 4 | 5295 | # -*- Mode: Python; test-case-name: flumotion.test.test_component -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Publi... | gpl-2.0 |
appliedx/edx-platform | common/lib/capa/capa/safe_exec/tests/test_lazymod.py | 152 | 1667 | """Test lazymod.py"""
import sys
import unittest
from capa.safe_exec.lazymod import LazyModule
class ModuleIsolation(object):
"""
Manage changes to sys.modules so that we can roll back imported modules.
Create this object, it will snapshot the currently imported modules. When
you call `clean_up()`,... | agpl-3.0 |
nophead/Skeinforge50plus | fabmetheus_utilities/geometry/geometry_utilities/evaluate_fundamentals/_math.py | 13 | 2590 | """
Boolean geometry utilities.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities import euclidean
import math
__author__ ... | agpl-3.0 |
kushG/osf.io | website/addons/dataverse/views/crud.py | 1 | 13076 | # -*- coding: utf-8 -*-
import os
import httplib
import logging
import datetime
import requests
from bs4 import BeautifulSoup
from flask import request, make_response
from framework.flask import redirect
from framework.exceptions import HTTPError
from framework.utils import secure_filename
from framework.auth.utils ... | apache-2.0 |
dsolimando/Hot | hot-jython-modules/src/main/resources/test/test_inspect.py | 9 | 19658 | import sys
import types
import unittest
import inspect
import datetime
from test.test_support import TESTFN, run_unittest, is_jython
from test import inspect_fodder as mod
from test import inspect_fodder2 as mod2
from test import test_support
# Functions tested in this suite:
# ismodule, isclass, ismethod, isfunctio... | gpl-3.0 |
SublimeText/PackageDev | plugins/settings/known_settings.py | 1 | 29813 | import collections
import logging
import os
import re
import textwrap
import time
import weakref
import sublime
from sublime_lib import encodings, ResourcePath
from ..lib.weakmethod import WeakMethodProxy
from ..lib import get_setting
from .region_math import VALUE_SCOPE, get_value_region_at, get_last_key_name_from
... | mit |
AndreyKedo/My_project_blog | node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | gpl-3.0 |
mcgonagle/ansible_f5 | library_old/bigip_gtm_facts.py | 4 | 16069 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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
# ... | apache-2.0 |
ntt-sic/keystone | keystone/openstack/common/db/sqlalchemy/migration.py | 6 | 10075 | # coding: utf-8
#
# Copyright (c) 2013 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
#
# Unle... | apache-2.0 |
ghickman/django | django/core/management/commands/shell.py | 6 | 4104 | import os
import warnings
from django.core.management.base import BaseCommand
from django.utils.deprecation import RemovedInDjango20Warning
class Command(BaseCommand):
help = "Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available."
requires_system_checks = False
... | bsd-3-clause |
cbertinato/pandas | pandas/io/excel/_openpyxl.py | 1 | 14098 | from pandas.io.excel._base import ExcelWriter
from pandas.io.excel._util import _validate_freeze_panes
class _OpenpyxlWriter(ExcelWriter):
engine = 'openpyxl'
supported_extensions = ('.xlsx', '.xlsm')
def __init__(self, path, engine=None, mode='w', **engine_kwargs):
# Use the openpyxl module as t... | bsd-3-clause |
saurabh6790/medsynaptic-lib | core/doctype/property_setter/property_setter.py | 34 | 2382 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def autoname(self):
self.doc.name = self.doc.doc_type + "-" \
+ (self.doc.f... | mit |
PanDAWMS/panda-mon-qa | pandamonqa/qasuite/BSXPath.py | 3 | 80212 | # -*- coding: utf-8 -*-
"""
BSXPath.py: XPathEvaluator Extension for BeautifulSoup
"""
__version__ = '0.01e' # based on JavaScript-XPath 0.1.11 (c) 2007 Cybozu Labs, Inc. (http://coderepos.org/share/wiki/JavaScript-XPath)
__date__ = '2009-04-12'
__license__ = 'MIT-style license'
__author__ = 'furyu' ... | apache-2.0 |
RRZE-HPC/pycachesim | setup.py | 1 | 4792 | #!/usr/bin/env python
from __future__ import absolute_import
from setuptools.extension import Extension
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
import os
import io
import re
#import numpy
here = os.path.abspath(os.... | agpl-3.0 |
martinwicke/tensorflow | tensorflow/python/client/device_lib.py | 149 | 1308 | # 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 |
wxthon/googletest | scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
peterm-itr/edx-platform | lms/djangoapps/mobile_api/tests.py | 8 | 1648 | """
Tests for mobile API utilities
"""
import ddt
from rest_framework.test import APITestCase
from courseware.tests.factories import UserFactory
from student import auth
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from .utils i... | agpl-3.0 |
kbdick/RecycleTracker | recyclecollector/scrap/gdata-2.0.18/src/gdata/contentforshopping/client.py | 29 | 31884 | #!/usr/bin/python
#
# Copyright (C) 2010-2011 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... | gpl-3.0 |
kalahbrown/HueBigSQL | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/tests/__init__.py | 44 | 1749 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2009-2013 Canonical Ltd.
#
# 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 ... | apache-2.0 |
40223136/w11-2 | static/Brython3.1.0-20150301-090019/Lib/browser/object_storage.py | 627 | 1315 | import pickle
class __UnProvided():
pass
class ObjectStorage():
def __init__(self, storage):
self.storage = storage
def __delitem__(self, key):
del self.storage[pickle.dumps(key)]
def __getitem__(self, key):
return pickle.loads(self.storage[pickle.dumps(key)])
def __se... | gpl-3.0 |
andrewyoung1991/abjad | abjad/tools/layouttools/test/test_layouttools_set_line_breaks_by_line_duration_ge.py | 2 | 2235 | # -*- encoding: utf-8 -*-
from abjad import *
def test_layouttools_set_line_breaks_by_line_duration_ge_01():
r'''Iterate classes in expr and accumulate duration.
Add line break after every total le line duration.
'''
staff = Staff()
staff.append(Measure((2, 8), "c'8 d'8"))
staff.append(Measur... | gpl-3.0 |
Maspear/odoo | addons/hw_proxy/__openerp__.py | 313 | 1675 | # -*- 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 |
yorvic/.vim | bundle/python-mode/pylibs/pylama/checkers/pylint/logilab/common/modutils.py | 1 | 21802 | # -*- coding: utf-8 -*-
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Genera... | gpl-3.0 |
ImpalaToGo/ImpalaToGo | thirdparty/gtest-1.6.0/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | apache-2.0 |
blacklin/kbengine | kbe/res/scripts/common/Lib/ensurepip/__init__.py | 67 | 6388 | import os
import os.path
import pkgutil
import sys
import tempfile
__all__ = ["version", "bootstrap"]
_SETUPTOOLS_VERSION = "2.1"
_PIP_VERSION = "1.5.6"
# pip currently requires ssl support, so we try to provide a nicer
# error message when that is missing (http://bugs.python.org/issue19744)
_MISSING_SSL_MESSAGE ... | lgpl-3.0 |
roqu3/Kernel-2.6.35.14-P500 | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | 1744 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(... | gpl-2.0 |
zhoffice/minos | client/package.py | 5 | 8146 | import argparse
import glob
import hashlib
import os
import pprint
import subprocess
import yaml
import deploy_config
from log import Log
from tank_client import TankClient
def check_directory(path):
if not os.path.exists(path):
Log.print_critical(
'Directory doesn''t exist: ' + path)
if not os.path... | apache-2.0 |
kennedyshead/home-assistant | tests/components/nut/test_config_flow.py | 2 | 11140 | """Test the Network UPS Tools (NUT) config flow."""
from unittest.mock import patch
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.nut.const import DOMAIN
from homeassistant.const import CONF_RESOURCES, CONF_SCAN_INTERVAL
from .util import _get_mock_pynutclient
from t... | apache-2.0 |
moreati/pandashells | pandashells/lib/arg_lib.py | 7 | 6681 | from pandashells.lib import config_lib
def _check_for_recognized_args(*args):
"""
Raise an error if unrecognized argset is specified
"""
allowed_arg_set = set([
'io_in',
'io_out',
'example',
'xy_plotting',
'decorating',
])
in_arg_set = set(args)
unr... | bsd-2-clause |
andybak/hendrix | hendrix/test/testproject/settings.py | 4 | 1047 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
ALLOWED_HOSTS = []
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N... | mit |
mm112287/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_case.py | 738 | 51689 | import difflib
import pprint
import pickle
import re
import sys
import warnings
import weakref
import inspect
from copy import deepcopy
from test import support
import unittest
from .support import (
TestEquality, TestHashing, LoggingResult,
ResultWithNoStartTestRunStopTestRun
)
class Test(object):
"Ke... | gpl-3.0 |
avedaee/DIRAC | Interfaces/scripts/dirac-wms-job-parameters.py | 8 | 1186 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-wms-job-delete
# Author : Stuart Paterson
########################################################################
"""
Retrieve parameters associated to the given DIRAC job
"""
__RCSID__ = "$I... | gpl-3.0 |
sdague/home-assistant | homeassistant/components/aprs/device_tracker.py | 17 | 5575 | """Support for APRS device tracking."""
import logging
import threading
import aprslib
from aprslib import ConnectionError as AprsConnectionError, LoginError
import geopy.distance
import voluptuous as vol
from homeassistant.components.device_tracker import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_G... | apache-2.0 |
tanglei528/glance | glance/tests/unit/common/test_property_utils.py | 1 | 23549 | # Copyright 2013 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 req... | apache-2.0 |
ppasq/geonode | geonode/base/management/commands/delete_orphaned_thumbs.py | 18 | 1091 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
mykoz/ThinkStats2 | code/thinkstats2.py | 68 | 68825 | """This file contains code for use with "Think Stats" and
"Think Bayes", both by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
"""This file contains class definitions for:
H... | gpl-3.0 |
paulorauber/nn | examples/rnn.py | 1 | 2389 | import numpy as np
from sklearn.utils import check_random_state
from nn.model.recurrent import RecurrentNetwork
random_state = check_random_state(None)
def nback(n, k, length):
"""Random n-back targets given n, number of digits k and sequence length"""
Xi = random_state.randint(k, size=length)
yi = np.ze... | mit |
MoamerEncsConcordiaCa/tensorflow | tensorflow/contrib/ndlstm/python/lstm1d_test.py | 94 | 4122 | # 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 |
cldershem/osf.io | website/mailchimp_utils.py | 16 | 2747 | # -*- coding: utf-8 -*-
import mailchimp
from framework import sentry
from framework.tasks import app
from framework.auth.core import User
from framework.tasks.handlers import queued_task
from framework.auth.signals import user_confirmed
from framework.transactions.context import transaction
from website import set... | apache-2.0 |
k4cg/Rezeptionistin | plugins/temperature.py | 1 | 1851 | # coding: utf8
import socket
import urllib2
import json
from plugin import Plugin
class Temperature(Plugin):
def __init__(self, config=None):
try:
self.wunderground = config.get('Temperature', 'wunderground')
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
print "Temperature w... | mit |
blockc/fabric | bddtests/peer/configuration_pb2.py | 17 | 4136 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: peer/configuration.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflectio... | apache-2.0 |
sbidoul/pip | tests/unit/test_locations.py | 4 | 5324 | """
locations.py tests
"""
import getpass
import os
import shutil
import sys
import tempfile
from unittest.mock import Mock
import pytest
from pip._internal.locations import SCHEME_KEYS, get_scheme
if sys.platform == 'win32':
pwd = Mock()
else:
import pwd
def _get_scheme_dict(*args, **kwargs):
scheme ... | mit |
2013Commons/HUE-SHARK | desktop/core/ext-py/Django-1.2.3/django/contrib/messages/storage/base.py | 399 | 6134 | from django.conf import settings
from django.utils.encoding import force_unicode, StrAndUnicode
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
class Message(StrAndUnicode):
"""
Represents an actual message that can be stored in any of the supported
storage class... | apache-2.0 |
Drvanon/Game | venv/lib/python3.3/site-packages/werkzeug/serving.py | 309 | 27668 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... | apache-2.0 |
shootstar/novatest | nova/api/openstack/compute/plugins/v3/rescue.py | 4 | 3531 | # Copyright 2011 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 a... | apache-2.0 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/.install/.backup/lib/googlecloudapis/container/v1/container_v1_messages.py | 4 | 19560 | """Generated message classes for container version v1.
The Google Container Engine API is used for building and managing container
based applications, powered by the open source Kubernetes technology.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from protorpc import messages as _messages
... | apache-2.0 |
t-wissmann/qutebrowser | qutebrowser/misc/savemanager.py | 1 | 8427 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
les69/calvin-base | calvin/actorstore/systemactors/net/UDPListener.py | 2 | 3328 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson 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 ... | apache-2.0 |
guozhangwang/kafka | tests/kafkatest/services/log_compaction_tester.py | 3 | 4139 | # 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 use ... | apache-2.0 |
agopalak/football_pred | pre_proc/proc_data.py | 1 | 4667 |
import sys
import yaml
import re
import datetime as DT
import logging
from rainbow_logging_handler import RainbowLoggingHandler
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn_pandas import DataFrameMapper
# Capturing current module. Needed to call getattr on this module
this_m... | mit |
Kongsea/tensorflow | tensorflow/python/eager/graph_only_ops.py | 69 | 2363 | # 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 |
petrutlucian94/nova | nova/tests/unit/virt/xenapi/test_volumeops.py | 65 | 24052 | # Copyright (c) 2012 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
#
# Unless required by applicable ... | apache-2.0 |
amir-qayyum-khan/edx-platform | common/lib/xmodule/xmodule/assetstore/assetmgr.py | 148 | 2171 | """
Asset Manager
Interface allowing course asset saving/retrieving.
Handles:
- saving asset in the BlobStore -and- saving asset metadata in course modulestore.
- retrieving asset metadata from course modulestore -and- returning URL to asset -or- asset bytes.
Phase 1: Checks to see if an asset's metadata can be f... | agpl-3.0 |
terhorst/psmcpp | test/unit/scrm_sim.py | 2 | 4001 | #!/usr/bin/env python2.7
from __future__ import print_function, division
from subprocess import check_output
from math import log
import random
import numpy as np
import itertools
import os
import json
from collections import Counter, namedtuple, defaultdict
from phylogenies import leaves, newick2tree, parent_of
from ... | gpl-3.0 |
level12/blazeweb | tests/apps/blazewebtestapp/components/tests/views.py | 2 | 5636 | from blazeweb.globals import rg
from blazeweb.content import getcontent
from blazeweb.utils import redirect
from blazeweb.views import View, forward, jsonify
from werkzeug.exceptions import ServiceUnavailable
from formencode.validators import UnicodeString, Int
class Rvb(View):
def default(self):
# this ... | bsd-3-clause |
daviddoria/PointGraphsPhase1 | Utilities/vtkTclTest2Py/mccases.py | 10 | 1065 | """This is python equivalent of Wrapping/Tcl/vtktesting/mccases.tcl.
Used for setting vertex values for clipping, cutting, and contouring tests.
This script is used while running python tests translated from Tcl."""
def case1 ( scalars, IN, OUT, caseLabel ):
scalars.InsertValue(0,IN )
scalars.InsertValue(1,OUT... | bsd-3-clause |
nicklhy/mxnet | tests/nightly/dist_lenet.py | 52 | 1839 | #!/usr/bin/env python
# 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
# "L... | apache-2.0 |
jamiefolsom/edx-platform | lms/djangoapps/teams/management/commands/reindex_course_team.py | 34 | 2408 | """ Management command to update course_teams' search index. """
from django.core.management import BaseCommand, CommandError
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from optparse import make_option
from textwrap import dedent
from teams.models import CourseTeam
class C... | agpl-3.0 |
Ali-aqrabawi/ezclinic | lib/django/contrib/auth/management/commands/changepassword.py | 65 | 2685 | from __future__ import unicode_literals
import getpass
from django.contrib.auth import get_user_model
from django.contrib.auth.password_validation import validate_password
from django.core.exceptions import ValidationError
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT... | mit |
DaniilLeksin/gc | wx/tools/Editra/src/syntax/_inno.py | 3 | 7749 | ###############################################################################
# Name: inno.py #
# Purpose: Syntax configuration module for Inno Setup Scripts #
# Author: Cody Precord <cprecord@editra.org> #
... | apache-2.0 |
mylukin/Creeper | requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | apache-2.0 |
thefinn93/CouchPotatoServer | libs/git/ref_container.py | 122 | 2242 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
zstackio/zstack-woodpecker | integrationtest/vm/virtualrouter/test_update_vm_cpu_memory2.py | 2 | 1813 | '''
Test change cpu and memory configuration when VM is running
@author: quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
#import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpe... | apache-2.0 |
mdshuai/UATFramework | steps/common.py | 3 | 3982 | '''Common test methods'''
from behave import *
@given(u'"{host}" hosts from dynamic inventory')
def step_impl(context, host):
context.inventory = "dynamic"
context.target_host = host
@given(u'"{host}" hosts from static inventory')
def step_impl(context, host):
context.inventory = "static"
context.ta... | gpl-2.0 |
vabs22/zulip | docs/conf.py | 5 | 9917 | # -*- coding: utf-8 -*-
#
# zulip-contributor-docs documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 17 16:24:04 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | apache-2.0 |
PlayUAV/MissionPlanner | Lib/site-packages/numpy/ma/bench.py | 51 | 6658 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
# encoding: utf-8
import timeit
#import IPython.ipapi
#ip = IPython.ipapi.get()
#from IPython import ipmagic
import numpy
#from numpy import ma
#from numpy.ma import filled
#from numpy.ma.testutils import assert_equal
... | gpl-3.0 |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/tensorflow/contrib/metrics/python/metrics/classification.py | 23 | 2583 | # 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 |
asajeffrey/servo | components/script/dom/bindings/codegen/parser/tests/test_empty_sequence_default_value.py | 15 | 1132 | import WebIDL
def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface X {
const sequence<long> foo = [];
};
""")
results = parser.finish()
except Exception as x:
threw = True
harness.ok(threw, "Constant canno... | mpl-2.0 |
Tiotao/morpherpy | env/Lib/site-packages/sqlalchemy/util/_collections.py | 7 | 24509 | # util/_collections.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Collection classes and helpers."""
import itertools
import weakref
import ope... | mit |
amazinger2013/OpenSesame | libqtopensesame/sketchpad_elements/_textline.py | 2 | 2960 | #-*- coding:utf-8 -*-
"""
This file is part of openexp.
openexp 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.
openexp is distributed in ... | gpl-3.0 |
pubnub/Zopkio | zopkio/reporters/html_reporter.py | 3 | 10389 | # Copyright 2014 LinkedIn Corp.
#
# 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.... | apache-2.0 |
jindongh/kombu | kombu/transport/virtual/exchange.py | 33 | 4580 | """
kombu.transport.virtual.exchange
================================
Implementations of the standard exchanges defined
by the AMQ protocol (excluding the `headers` exchange).
"""
from __future__ import absolute_import
from kombu.utils import escape_regex
import re
class ExchangeType(object):
"""Implements t... | bsd-3-clause |
alexeyum/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 297 | 8265 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
gcd0318/django | django/core/files/images.py | 429 | 2428 | """
Utility functions for handling images.
Requires Pillow as you might imagine.
"""
import struct
import zlib
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def ... | bsd-3-clause |
yize/grunt-tps | tasks/lib/python/Lib/python2.7/test/test_whichdb.py | 91 | 1799 | #! /usr/bin/env python
"""Test script for the whichdb module
based on test_anydbm.py
"""
import os
import test.test_support
import unittest
import whichdb
import glob
_fname = test.test_support.TESTFN
# Silence Py3k warning
anydbm = test.test_support.import_module('anydbm', deprecated=True)
def _delete_files():
... | mit |
heihei1252/lightblue-0.4 | src/mac/_macutil.py | 68 | 9048 | # Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... | gpl-3.0 |
jtrebosc/JTutils | TSpy/zeroim3D.py | 1 | 1091 | # -*- coding: utf-8 -*-
import sys
import os
PYTHONPATH=os.getenv("PYTHONPATH","not_defined")
if "not_defined" in PYTHONPATH:
MSG("cannot acces to PYTHONPATH environment. It's required for accessing to brukerPARIO lib" )
EXIT()
#add the Library path for importing brukerPARIO
sys.path.append(PYTHONPATH)
import bruke... | bsd-3-clause |
dstockwell/catapult | third_party/Paste/paste/util/threadedprint.py | 50 | 8210 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
threadedprint.py
================
:author: Ian Bicking
:date: 12 Jul 2004
Multi-threaded printing; allows the output produced via print to be
se... | bsd-3-clause |
RoanokeHobby/Robots | CamJamRobot/9-avoidance.py | 1 | 4715 | # CamJam EduKit 3 - Robotics
# Worksheet 9 – Obstacle Avoidance
# Copyright (c) 2016 CamJam-EduKit
# The MIT License (MIT)
import RPi.GPIO as GPIO # Import the GPIO Library
import time # Import the Time library
# Set the GPIO modes
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# Set variables for the GPIO motor pin... | gpl-3.0 |
noironetworks/neutron | neutron/tests/unit/common/moved_globals_code1.py | 9 | 1026 | # 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 |
aburan28/blaze | blaze/tests/test_get_set.py | 7 | 1665 | from __future__ import absolute_import, division, print_function
import blaze
from blaze.datadescriptor import dd_as_py
import numpy as np
import unittest
from blaze.py2help import skip
from blaze.tests.common import MayBeUriTest
class getitem(unittest.TestCase):
caps={'compress': False} # the default is non-co... | bsd-3-clause |
chokribr/invenio | invenio/legacy/bibclassify/engine.py | 4 | 27111 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2013, 2014, 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; either version 2 of th... | gpl-2.0 |
sharpbitmessage/PyBitmessage | regenerateaddresses.py | 1 | 8348 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'regenerateaddresses.ui'
#
# Created: Thu Jan 24 15:52:24 2013
# by: PyQt4 UI code generator 4.9.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
ex... | mit |
emchristiansen/gtest-sbt-cpp | test/gtest_test_utils.py | 408 | 10444 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/gaussian_process/tests/test_kernels.py | 3 | 12567 | """Testing for kernels for Gaussian processes."""
# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
from sklearn.externals.funcsigs import signature
import numpy as np
from sklearn.gaussian_process.kernels import _approx_fprime
from sklearn.metrics.pairwise \
import PAIRWISE_K... | bsd-3-clause |
supersven/intellij-community | python/lib/Lib/site-packages/django/utils/unittest/compatibility.py | 575 | 2096 | import os
import sys
try:
from functools import wraps
except ImportError:
# only needed for Python 2.4
def wraps(_):
def _wraps(func):
return func
return _wraps
__unittest = True
def _relpath_nt(path, start=os.path.curdir):
"""Return a relative version of a path"""
if... | apache-2.0 |
jay-tyler/ansible | lib/ansible/playbook/taggable.py | 128 | 3278 | # (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 |
pselle/calibre | src/calibre/ebooks/lrf/input.py | 14 | 14450 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import textwrap, operator
from copy import deepcopy, copy
from lxml import etree
f... | gpl-3.0 |
EliasTouil/simpleBlog | simpleBlog/Lib/sre_compile.py | 123 | 19817 | # -*- coding: utf-8 -*-
#
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import _sre, sys
import sre_parse... | gpl-3.0 |
EmadMokhtar/halaqat | students/forms.py | 1 | 6022 | from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Div, Layout
from django import forms
from django.utils.translation import ugettext_lazy as _
from students.models import Student
class StudentForm(forms.ModelForm):
dob = forms.DateField(widget=forms.DateInput(
... | mit |
punchagan/zulip | zerver/views/zephyr.py | 2 | 2717 | import base64
import logging
import re
import shlex
import subprocess
from typing import Optional
import orjson
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _
from zerver.decorator import authenticated_json_view
from zerver.lib.ccac... | apache-2.0 |
maurizi/otm-core | opentreemap/exporter/user.py | 12 | 4354 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import csv
import json
from datetime import datetime
from contextlib import contextmanager
from django.core.exceptions import ValidationError
from django.db.models import Q
from tre... | agpl-3.0 |
Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/numpy/distutils/fcompiler/lahey.py | 229 | 1438 | from __future__ import division, absolute_import, print_function
import os
from numpy.distutils.fcompiler import FCompiler
compilers = ['LaheyFCompiler']
class LaheyFCompiler(FCompiler):
compiler_type = 'lahey'
description = 'Lahey/Fujitsu Fortran 95 Compiler'
version_pattern = r'Lahey/Fujitsu Fortran... | artistic-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.