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 |
|---|---|---|---|---|---|
sestrella/ansible | test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/vars/custom_vars.py | 58 | 1487 | # Copyright 2019 RedHat, 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 i... | gpl-3.0 |
hongliuliao/simple_flow | dependency/ehttp/deps/googletest/googlemock/scripts/upload.py | 2511 | 51024 | #!/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 |
rhertzog/django | django/views/generic/dates.py | 64 | 25785 | from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils import timezone
from django.utils.encoding import force_str, force_text
from django.utils.func... | bsd-3-clause |
marineam/nagcat | python/twirrdy/protocol.py | 1 | 5838 | # Copyright 2010 ITA Software, 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 wr... | apache-2.0 |
sander76/home-assistant | homeassistant/components/mythicbeastsdns/__init__.py | 14 | 1633 | """Support for Mythic Beasts Dynamic DNS service."""
from datetime import timedelta
import mbddns
import voluptuous as vol
from homeassistant.const import (
CONF_DOMAIN,
CONF_HOST,
CONF_PASSWORD,
CONF_SCAN_INTERVAL,
)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import home... | apache-2.0 |
TRESCLOUD/odoo | addons/account_followup/tests/__init__.py | 175 | 1128 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
phihag/adhocracy | src/adhocracy/lib/cache/invalidate.py | 4 | 2235 | import logging
from adhocracy import model
from adhocracy.lib.cache.util import clear_tag
log = logging.getLogger(__name__)
def invalidate_badge(badge):
log.debug('invalidate_badge %s' % badge)
clear_tag(badge)
def invalidate_userbadges(userbadges):
clear_tag(userbadges)
invalidate_user(userbadges.... | agpl-3.0 |
cristiana214/cristianachavez214-cristianachavez | python-build/python-libs/gdata/samples/oauth/2_legged_oauth.py | 128 | 2463 | #!/usr/bin/python
#
# Copyright (C) 2009 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 |
UOMx/edx-platform | common/lib/xmodule/xmodule/library_content_module.py | 17 | 27284 | # -*- coding: utf-8 -*-
"""
LibraryContent: The XBlock used to include blocks from a library in a course.
"""
import json
from lxml import etree
from copy import copy
from capa.responsetypes import registry
from gettext import ngettext
from lazy import lazy
from .mako_module import MakoModuleDescriptor
from opaque_key... | agpl-3.0 |
michael-yin/scrapy | scrapy/tests/test_link.py | 27 | 1978 | import unittest
import warnings
from scrapy.link import Link
class LinkTest(unittest.TestCase):
def _assert_same_links(self, link1, link2):
self.assertEqual(link1, link2)
self.assertEqual(hash(link1), hash(link2))
def _assert_different_links(self, link1, link2):
self.assertNotEqual(l... | bsd-3-clause |
camptocamp/c2c-rd-addons | chricar_partner_id_number/models/res_partner_id_number.py | 4 | 2265 | # -*- coding: utf-8 -*-
# Python source code encoding : https://www.python.org/dev/peps/pep-0263/
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL
# http://tiny.be
# Copyrig... | agpl-3.0 |
MountainWei/nova | nova/tests/unit/test_baserpc.py | 23 | 1619 | #
# Copyright 2013 - Red Hat, 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 ... | apache-2.0 |
Teagan42/home-assistant | tests/components/graphite/test_init.py | 3 | 8824 | """The tests for the Graphite component."""
import socket
import unittest
from unittest import mock
from unittest.mock import patch
import homeassistant.components.graphite as graphite
from homeassistant.const import (
EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP,
EVENT_STATE_CHANGED,
STATE_OFF,... | apache-2.0 |
singhj/locality-sensitive-hashing | mapreduce/third_party/simplejson/encoder.py | 9 | 15826 | #!/usr/bin/env python
"""Implementation of JSONEncoder
"""
import re
try:
from mapreduce.third_party.simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from mapreduce.third_party.simplejson._speedups import make_encoder... | mit |
evernote/zing | tests/models/translationproject.py | 1 | 2411 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
# Copyright (C) Zing contributors.
#
# This file is a part of the Zing project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
... | gpl-3.0 |
o3RocketCommunications/o3rocketcommunications.github.io | serve--watch/serve/bower_components/bootstrap/test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | apache-2.0 |
collex100/odoo | addons/product_margin/wizard/product_margin.py | 338 | 3457 | # -*- 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 |
stevegaron/android-kernel-tuna | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
NeCTAR-RC/nova | nova/objects/instance_fault.py | 18 | 4204 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
rancher/linux | tools/perf/scripts/python/sched-migration.py | 1910 | 11965 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
happyboy310/keras | examples/babi_rnn.py | 59 | 8095 | from __future__ import absolute_import
from __future__ import print_function
from functools import reduce
import re
import tarfile
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets.data_utils import get_file
from keras.layers.embeddings import Embedding
from keras.layers.core import D... | mit |
LukeMurphey/splunk-google-drive | src/bin/google_drive_app/cffi/api.py | 6 | 41800 | import sys, types
from .lock import allocate_lock
from .error import CDefError
from . import model
try:
callable
except NameError:
# Python 3.1
from collections import Callable
callable = lambda x: isinstance(x, Callable)
try:
basestring
except NameError:
# Python 3.x
basestring = str
_un... | apache-2.0 |
RomanOsadchuk/GoStory | stories/migrations/0002_auto_20140925_1026.py | 1 | 1708 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('stories', '0001_initial')... | gpl-3.0 |
vsuorant/CARTAvis | carta/scripts/deploy-viz2.py | 7 | 2797 | #!/usr/bin/python
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.console import confirm
import os, os.path
from fabric.contrib.files import exists
from fabric.contrib.project import rsync_project
print "Hello from deploy-viz2.py"
# older instructions...
#
# intended usage:
# 1) c... | gpl-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/django/core/serializers/xml_serializer.py | 95 | 15035 | """
XML serializer.
"""
from __future__ import unicode_literals
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import base
from django.db import DEFAULT_DB_A... | agpl-3.0 |
theguardian/CherryStrap | lib/simplejson/tests/test_item_sort_key.py | 140 | 1127 | from unittest import TestCase
import simplejson as json
from operator import itemgetter
class TestItemSortKey(TestCase):
def test_simple_first(self):
a = {'a': 1, 'c': 5, 'jack': 'jill', 'pick': 'axe', 'array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'}
self.assertEqual(
... | gpl-2.0 |
dsajkl/123 | common/lib/xmodule/xmodule/modulestore/tests/test_xml.py | 30 | 4708 | """
Tests around our XML modulestore, including importing
well-formed and not-well-formed XML.
"""
import os.path
import unittest
from glob import glob
from mock import patch
from xmodule.modulestore.xml import XMLModuleStore
from xmodule.modulestore import ModuleStoreEnum
from xmodule.tests import DATA_DIR
from opaq... | agpl-3.0 |
eayunstack/rally | rally/plugins/openstack/scenarios/nova/networks.py | 17 | 2123 | # Copyright 2015: Mirantis 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 b... | apache-2.0 |
robhudson/warehouse | tests/packaging/test_helpers.py | 3 | 1226 | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
dermoth/mongrel2 | examples/ws/python/echo.py | 2 | 3129 | import simplejson as json
from mongrel2 import handler
import wsutil
import sys
import time
import re
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D480"
conn = handler.Connection(sender_id, "tcp://192.168.0.1:9990",
"tcp://192.168.0.1:9989")
CONNECTION_TIMEOUT=5
closingMessages={}
badUnic... | bsd-3-clause |
jostep/tensorflow | tensorflow/user_ops/ackermann_test.py | 148 | 1394 | # 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 |
Guneet-Dhillon/mxnet | example/kaggle-ndsb1/submission_dsb.py | 52 | 5048 | # 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 |
dhamaniasad/mythbox | resources/lib/twisted/twisted/trial/test/test_pyunitcompat.py | 61 | 6669 | # Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# Maintainer: Jonathan Lange
import sys
import traceback
from zope.interface import implements
from twisted.python import reflect
from twisted.python.failure import Failure
from twisted.trial import util
from twisted.trial.unittest ... | gpl-2.0 |
kantai/passe-framework-prototype | django/core/management/commands/startproject.py | 322 | 1680 | from django.core.management.base import copy_helper, CommandError, LabelCommand
from django.utils.importlib import import_module
import os
import re
from random import choice
class Command(LabelCommand):
help = "Creates a Django project directory structure for the given project name in the current directory."
... | bsd-3-clause |
joecheng511/try-wagtail | mysite/blog/migrations/0016_auto_20170516_1058.py | 1 | 1295 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-16 02:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', ... | apache-2.0 |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/site-packages/wx-2.8-msw-unicode/wxPython/xrc.py | 6 | 2729 | ## This file reverse renames symbols in the wx package to give
## them their wx prefix again, for backwards compatibility.
##
## Generated by BuildRenamers in config.py
# This silly stuff here is so the wxPython.wx module doesn't conflict
# with the wx package. We need to import modules from the wx package
# here, th... | agpl-3.0 |
jamesbeebop/evennia | evennia/server/portal/mssp.py | 4 | 7117 | """
MSSP - Mud Server Status Protocol
This implements the MSSP telnet protocol as per
http://tintin.sourceforge.net/mssp/. MSSP allows web portals and
listings to have their crawlers find the mud and automatically
extract relevant information about it, such as genre, how many
active players and so on.
"""
from dja... | bsd-3-clause |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/python-ldap-2.3.13/Demo/rename.py | 40 | 1049 | import ldap
from getpass import getpass
# Create LDAPObject instance
l = ldap.initialize('ldap://localhost:1389',trace_level=1)
print 'Password:'
cred = getpass()
try:
# Set LDAP protocol version used
l.set_option(ldap.OPT_PROTOCOL_VERSION,3)
# Try a bind to provoke failure if protocol version is not support... | gpl-2.0 |
algorhythms/LeetCode | 654 Maximum Binary Tree.py | 1 | 2331 | #!/usr/bin/python3
"""
Given an integer array with no duplicates. A maximum tree building on this array
is defined as follow:
The root is the maximum number in the array.
The left subtree is the maximum tree constructed from left part subarray divided
by the maximum number.
The right subtree is the maximum tree constr... | mit |
Yingmin-Li/keras | keras/optimizers.py | 24 | 7290 | from __future__ import absolute_import
import theano
import theano.tensor as T
import numpy as np
from .utils.theano_utils import shared_zeros, shared_scalar, floatX
from six.moves import zip
def clip_norm(g, c, n):
if c > 0:
g = T.switch(T.ge(n, c), g * c / n, g)
return g
def kl_divergence(p, p_ha... | mit |
ccrook/Quantum-GIS | python/plugins/processing/algs/qgis/ImportIntoSpatialite.py | 5 | 7626 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ImportIntoSpatialite.py
---------------------
Date : October 2016
Copyright : (C) 2016 by Mathieu Pellerin
Email : nirvn dot asia at gmail dot com
******... | gpl-2.0 |
krattai/noo-ebs | ref_code/mosquitto-1.4.7/test/lib/08-ssl-connect-cert-auth.py | 7 | 2313 | #!/usr/bin/env python
# Test whether a client produces a correct connect and subsequent disconnect when using SSL.
# Client must provide a certificate.
# The client should connect to port 1888 with keepalive=60, clean session set,
# and client id 08-ssl-connect-crt-auth
# It should use the CA certificate ssl/test-roo... | bsd-2-clause |
intgr/django | django/utils/regex_helper.py | 35 | 12621 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
import warnings
from django.utils.depre... | bsd-3-clause |
lk1ngaa7/httpie | httpie/compat.py | 46 | 5930 | """
Python 2.6, 2.7, and 3.x compatibility.
"""
import sys
is_py2 = sys.version_info[0] == 2
is_py26 = sys.version_info[:2] == (2, 6)
is_py27 = sys.version_info[:2] == (2, 7)
is_py3 = sys.version_info[0] == 3
is_pypy = 'pypy' in sys.version.lower()
is_windows = 'win32' in str(sys.platform).lower()
if is_py2:
b... | bsd-3-clause |
B-MOOC/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/factories.py | 16 | 21208 | """
Factories for use in tests of XBlocks.
"""
import functools
import inspect
import pprint
import pymongo.message
import threading
import traceback
from collections import defaultdict
from decorator import contextmanager
from uuid import uuid4
from factory import Factory, Sequence, lazy_attribute_sequence, lazy_att... | agpl-3.0 |
criccomini/airflow | airflow/contrib/kubernetes/pod_launcher.py | 7 | 7626 | # 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 |
rickerc/horizon_audit | horizon/tabs/views.py | 10 | 5777 | from django import http
from django.views import generic
from horizon import exceptions
from horizon import tables
from horizon.tabs.base import TableTab # noqa
class TabView(generic.TemplateView):
"""
A generic class-based view for displaying a :class:`horizon.tabs.TabGroup`.
This view handles selecti... | apache-2.0 |
butterscotchstallion/daily-programmer | pangrams/test/test_pangram.py | 2 | 1084 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pangram import Pangram
class TestPangram:
def test_is_pangram_fox(self):
input_string = "The quick brown fox jumps over the lazy dog."
expected = True
pangram = Pangram()
actual = pangram.is_pangram(input_string)
assert ex... | mit |
zhmcclient/python-zhmcclient | tests/unit/zhmcclient/test_virtual_function.py | 1 | 12827 | # Copyright 2016-2017 IBM Corp. 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 |
StartE/cuda-convnet2 | layer.py | 162 | 82481 | # 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 |
quodlibet/quodlibet | tests/test_util_dbusutils.py | 4 | 4728 | # Copyright 2012 Christoph Reiter <reiter.christoph@gmail.com>
#
# 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.
from t... | gpl-2.0 |
fresskarma/tinyos-1.x | contrib/nestfe/nesc/apps/TestPIRDetectNoReg/parseInput.py | 2 | 4249 | # $Id: parseInput.py,v 1.2 2005/07/19 17:47:46 phoebusc Exp $
## Parses input file of OscopeMsgs
# Supports:
# 1) Default TinyOS packets of OscopeMsgs
# (with 10 samples or even 11 samples per packet)
# 2) Telos packets of OscopeMsgs
# 3) GGB dumped output
# See PIRDataFormat.txt for details on these data formats
#
... | bsd-3-clause |
gregsymons/jenkins-job-builder | tests/builder/test_builder.py | 6 | 1623 | # vim: set fileencoding=utf-8 :
#
# - Copyright 2014 Guido Günther <agx@sigxcpu.org>
#
# 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... | apache-2.0 |
hcsturix74/django | tests/null_fk/models.py | 166 | 1323 | """
Regression tests for proper working of ForeignKey(null=True).
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class SystemDetails(models.Model):
details = models.TextField()
class SystemInfo(models.Model):
system_details = models.ForeignKey(SystemDetails)
... | bsd-3-clause |
laiqiqi886/kbengine | kbe/res/scripts/common/Lib/test/test_errno.py | 88 | 1171 | """Test the errno module
Roger E. Masse
"""
import errno
from test import support
import unittest
std_c_errors = frozenset(['EDOM', 'ERANGE'])
class ErrnoAttributeTests(unittest.TestCase):
def test_for_improper_attributes(self):
# No unexpected attributes should be on the module.
for error_co... | lgpl-3.0 |
xxsergzzxx/python-for-android | python3-alpha/extra_modules/gdata/youtube/__init__.py | 297 | 25623 | #!/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 |
koalo/linux | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
aldariz/Sick-Beard | lib/subliminal/api.py | 30 | 6464 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import io
import logging
import operator
import os.path
import babelfish
from .providers import ProviderPool
from .subtitle import get_subtitle_path
logger = logging.getLogger(__name__)
def list_subtitles(videos, languages, providers... | gpl-3.0 |
aaxelb/osf.io | addons/owncloud/routes.py | 32 | 1695 | # -*- coding: utf-8 -*-
from framework.routing import Rule, json_renderer
from addons.owncloud import views
# JSON endpoints
api_routes = {
'rules': [
Rule(
[
'/project/<pid>/owncloud/user-auth/',
'/project/<pid>/node/<nid>/owncloud/user-auth/',
],
... | apache-2.0 |
GodBlessPP/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/_strptime.py | 518 | 21683 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | gpl-3.0 |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/psrc/household_x_zone/workerDDD_travel_time_hbw_am_drive_alone_from_home_to_work.py | 2 | 3321 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.abstract_variables.abstract_travel_time_variable import abstract_travel_time_variable
class workerDDD_travel_time_hbw_am_drive_alone_from_home_to_work(abstract_travel_time_variable... | gpl-2.0 |
fausecteam/ctf-gameserver | src/ctf_gameserver/web/forms.py | 1 | 1229 | from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.forms import AuthenticationForm, PasswordResetForm
from .scoring.models import GameControl
class TeamAuthenticationForm(AuthenticationForm):
"""
Custom variant of the login form that replaces "Username" ... | isc |
pombredanne/erpnext | erpnext/controllers/item_variant.py | 6 | 6048 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr, flt
import json
class ItemVariantExistsError(frappe.ValidationError): pass
class Inva... | agpl-3.0 |
bolster/suds | suds/sax/element.py | 175 | 36480 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
ericstaal/domoticz | plugin/hosola/plugin.py | 1 | 18218 | # HOSOLA
#
# Description: HOSOLA / OMNIK solar inverter
#
# Author: elgringo
#
# History:
# 1.0.0 01-07-2017 Initial version
# 1.0.1 31-07-2017 Updated with new API
# 1.0.2 22-05-2018 Onheartbeat debug level to 8
# 1.0.3 12-06-2018 Connection bugfix when set to nonen, outstanding messages cleared
... | mit |
sachinbiradar9/MS-Apriori | msapriori.py | 1 | 5537 | import itertools
import re
from sys import argv
print 'Computing frequent item sets.'
transaction_file = argv[1]
parameter_file = argv[2]
output_file = argv[3]
def fileParser(transaction_file, parameter_file):
T = []
with open(transaction_file,'r') as trans:
for row in trans:
transarr = ... | gpl-3.0 |
NoBodyCam/TftpPxeBootBareMetal | nova/tests/api/openstack/compute/contrib/test_hypervisors.py | 9 | 19105 | # Copyright (c) 2012 OpenStack, LLC
# 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 requir... | apache-2.0 |
mhugo/QGIS | python/pyplugin_installer/plugindependencies.py | 47 | 4476 | # coding=utf-8
"""Parse plugin metadata for plugin_dependencies
.. 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... | gpl-2.0 |
htwenhe/DJOA | env/Lib/site-packages/django/views/defaults.py | 12 | 3567 | from django import http
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.utils import six
from django.utils.encoding import force_text
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore ne... | mit |
ampax/edx-platform | lms/djangoapps/course_api/blocks/transformers/tests/test_block_depth.py | 35 | 2059 | """
Tests for BlockDepthTransformer.
"""
# pylint: disable=protected-access
import ddt
from unittest import TestCase
from openedx.core.lib.block_structure.tests.helpers import ChildrenMapTestMixin
from openedx.core.lib.block_structure.block_structure import BlockStructureModulestoreData
from ..block_depth import Blo... | agpl-3.0 |
raniel86/startsymfonies | src/Utils/commands/get_symfonies.py | 2 | 2167 | #!/usr/bin/python
import os
import subprocess
import sys
# check for directory in argument
if len(sys.argv) != 3:
print 'Invalid arguments, usage: ./get_symfonies.py [DIR_TO_SCAN] [PHP_EXECUTABLE]'
sys.exit(1)
d = sys.argv[1]
phpExecutables = sys.argv[2]
# check for valid directory
if not os.path.isdir(d):
... | gpl-3.0 |
vu3rdd/flud | flud/test/FludFileOpTest.py | 2 | 5154 | #!/usr/bin/python
"""
FludFileOpTest.py, (c) 2003-2006 Alen Peacock. This program is distributed
under the terms of the GNU General Public License (the GPL), version 3.
System tests for FludFileOperations
"""
import sys, os, time, logging, tempfile, shutil
from twisted.internet import reactor
sys.path.append(os.p... | gpl-3.0 |
Yahvuh/Eliza | Flask/Lib/types.py | 97 | 5360 | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | gpl-2.0 |
xianggong/m2c_unit_test | test/operator/equal_uchar2uchar2/compile.py | 1861 | 4430 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... | gpl-2.0 |
preo/ansible-modules-core | cloud/amazon/s3.py | 13 | 21017 | #!/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 distributed... | gpl-3.0 |
2014c2g4/2015cda0623 | 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 |
SmokinCaterpillar/pypet | pypet/tests/integration/merge_test.py | 2 | 30562 | __author__ = 'Robert Meyer'
import numpy as np
from pypet.parameter import Parameter
from pypet.utils.explore import cartesian_product
from pypet.environment import Environment
from pypet import pypetconstants
import logging
import os
import time
from scipy.stats import pearsonr
from pypet.tests.testutils.ioutils im... | bsd-3-clause |
tomaslaz/Analysis-Toolkit | thirdparty/JPype-0.5.4.2/examples/rmi.py | 4 | 1213 | #*****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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... | gpl-3.0 |
fabaff/ansible | lib/ansible/plugins/strategy/__init__.py | 8 | 30223 | # (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 |
eayun/ovirt-engine | packaging/setup/plugins/ovirt-engine-provisiondb/ovirt-engine-common/provisioning/database.py | 4 | 3623 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, 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
#
# Unl... | apache-2.0 |
pi-one/fint | fint.py | 1 | 13907 | #!/opt/local/bin/python
# coding: utf-8
"""
fint.py - v0.1 - 2012.03.15
Author : Jan Goebel - goebel@pi-one.net
Licence : GPL v2
Example Usage:
# To find an executable that was compiled on a certain date
python fint.py -m /path/to/search/ --compileTime 2012:03:25 -f *.exe
# To find files wi... | gpl-2.0 |
germanovm/vdsm | vdsm_hooks/vmfex/before_vm_migrate_destination.py | 5 | 4070 | #!/usr/bin/python
import os
import sys
import traceback
import fcntl
from xml.dom import minidom
try:
# 3.0 compat
import libvirtconnection
libvirtconnection
except ImportError:
# 3.1 compat
from vdsm import libvirtconnection
'''
Placed in before_vm_migrate_destination
vmfex hook on migration des... | gpl-2.0 |
davidwaroquiers/custodian | custodian/nwchem/jobs.py | 2 | 2294 | # coding: utf-8
from __future__ import unicode_literals, division
"""
This module implements basic kinds of jobs for Nwchem runs.
"""
__author__ = "Shyue Ping Ong"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "ongsp@ucsd.edu"
__status__ = "Beta"
__date__ = "5/20/13"
import subprocess
import s... | mit |
shyamjvs/perf-tests | verify/verify-flags-underscore.py | 2 | 8068 | #!/usr/bin/env python3
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
alanquillin/ryu | ryu/services/protocols/bgp/info_base/vpnv6.py | 52 | 1827 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 |
endorphinl/horizon | openstack_dashboard/api/rest/policy.py | 51 | 1723 | #
# 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
# ... | apache-2.0 |
bclau/nova | nova/virt/baremetal/db/migration.py | 25 | 1255 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
jmcarbo/openerp7 | openerp/addons/base/res/res_partner.py | 9 | 40591 | # -*- 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 |
kbdick/RecycleTracker | recyclecollector/scrap/gdata-2.0.18/build/lib.linux-x86_64-2.7/gdata/service.py | 78 | 69609 | #!/usr/bin/python
#
# Copyright (C) 2006,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... | gpl-3.0 |
yanheven/glance | glance/db/sqlalchemy/migrate_repo/versions/029_location_meta_data_pickle_to_string.py | 17 | 2607 | # Copyright 2013 Rackspace Hosting
# 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 require... | apache-2.0 |
bdh1011/cupeye | venv/lib/python2.7/site-packages/sqlalchemy/dialects/sybase/pysybase.py | 80 | 3208 | # sybase/pysybase.py
# Copyright (C) 2010-2015 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
"""
.. dialect:: sybase+pysybase
:name: Python-Sybase
:dbapi: Sybase
... | bsd-3-clause |
morelab/weblabdeusto | server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment12/server_config.py | 968 | 1526 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
weblab_xilinx_experiment_xilinx_device = 'FPGA'
weblab_xilinx_experiment_port_number = 1
# This should be something like this:
# import os as _os
# xilinx_home = _os.getenv('XILINX_HOME')
# if xilinx_home == None:
# if _os.name == 'nt':
# xilinx_home = r'C:... | bsd-2-clause |
t794104/ansible | lib/ansible/modules/network/nxos/nxos_feature.py | 94 | 8046 | #!/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 |
chaosphere2112/Spring-16 | cdat/cdat/TextEdit/TextStyleEditor.py | 1 | 5621 | import vcs
import TextStylePreview as text_style_preview
from PySide import QtCore, QtGui
from cdat.Base import BaseSaveWindow
class TextStyleEditorWidget(BaseSaveWindow.BaseSaveWindowWidget):
def __init__(self):
super(TextStyleEditorWidget, self).__init__()
self.setPreview(text_style_preview.Text... | mit |
dgros/dgros.github.io | talkmap.py | 205 | 1188 |
# # Leaflet cluster map of talk locations
#
# (c) 2016-2017 R. Stuart Geiger, released under the MIT license
#
# Run this from the _talks/ directory, which contains .md files of all your talks.
# This scrapes the location YAML field from each .md file, geolocates it with
# geopy/Nominatim, and uses the getorg librar... | mit |
Adenilson/servo | tests/wpt/harness/wptrunner/config.py | 196 | 1851 | # 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/.
import ConfigParser
import os
import sys
from collections import OrderedDict
here = os.path.split(__file__)[0]
class C... | mpl-2.0 |
mkl-/scioncc | src/ion/services/test/test_identity_management_service.py | 3 | 10227 | #!/usr/bin/env python
__author__ = 'Michael Meisinger'
from nose.plugins.attrib import attr
import gevent
from pyon.util.int_test import IonIntegrationTestCase
from pyon.core.exception import Unauthorized
from pyon.public import BadRequest, NotFound, get_ion_ts_millis, Inconsistent, Unauthorized
from interface.serv... | bsd-2-clause |
yuyuyu101/VirtualBox-NetBSD | src/libs/libxml2-2.6.31/check-xinclude-test-suite.py | 347 | 5333 | #!/usr/bin/python
import sys
import time
import os
import string
sys.path.insert(0, "python")
import libxml2
#
# the testsuite description
#
DIR="xinclude-test-suite"
CONF="testdescr.xml"
LOG="check-xinclude-test-suite.log"
log = open(LOG, "w")
os.chdir(DIR)
test_nr = 0
test_succeed = 0
test_failed = 0
test_error =... | gpl-2.0 |
pablorecio/resistencia-1812 | guadaboard/main_layout_functions.py | 4 | 6272 | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# This file is part of Resistencia Cadiz 1812.
#
# 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, e... | gpl-3.0 |
density215/d215-miniblog | django/contrib/localflavor/be/forms.py | 246 | 2885 | """
Belgium-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
class BEPostalCodeField(RegexField):
"""
A form field that validat... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.