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
jelugbo/tundex
cms/djangoapps/contentstore/views/tests/test_course_index.py
6
15799
""" Unit tests for getting the list of courses and the course outline. """ import json import lxml import datetime from contentstore.tests.utils import CourseTestCase from contentstore.utils import reverse_course_url, add_instructor from contentstore.views.access import has_course_access from contentstore.views.course...
agpl-3.0
lra/boto
boto/dynamodb/layer2.py
135
33814
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without ...
mit
riyazwalikar/pythonscripts
wp_attachenum/wp_attachenum.py
1
1546
import sys import requests from bs4 import BeautifulSoup def enumusers(url,p): r = requests.get(url + '/?attachment_id=' + str(p), allow_redirects=False) if r.status_code == 200: soup = BeautifulSoup(r.text) div=soup.find('div',{'class':'attachment'}) p ...
gpl-3.0
alaski/nova
nova/policy.py
1
8251
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
tonnrueter/pymca_devel
PyMca/PCAModule.py
1
32607
#/*########################################################################## # Copyright (C) 2004-2012 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. # # This toolkit is free software; you can redistribute it and/or m...
gpl-2.0
CalciferZh/AMCParser
3Dviewer.py
1
7204
import pygame import numpy as np import time import transforms3d.euler as euler from amc_parser import * from OpenGL.GL import * from OpenGL.GLU import * class Viewer: def __init__(self, joints=None, motions=None): """ Display motion sequence in 3D. Parameter --------- joints: Dict returned fr...
mit
HDT3213/Duang
Duang/mainWindow.py
2
1686
from PyQt4 import QtCore, QtGui import sys from scene import * from view import * class MainWindow(QtGui.QMainWindow): interval = 40 def __init__(self, *args, **kwargs): QtGui.QMainWindow.__init__(self, *args, **kwargs) self.scene = QtGui.QGraphicsScene(self) self.resize(width + 20, self.scene.height + 20) ...
gpl-3.0
superdesk/Live-Blog
documentor/libraries/docutils-0.9.1-py3.2/docutils/languages/ja.py
52
1908
# -*- coding: utf-8 -*- # $Id: ja.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Hisashi Morita <hisashim@kt.rim.or.jp> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Tw...
agpl-3.0
ekasitk/sahara
sahara/plugins/cdh/client/services.py
1
19488
# Copyright (c) 2014 Intel 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 applicable law or agreed to in...
apache-2.0
skykiny/shadowsocks
shadowsocks/manager.py
925
9692
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
Dm47021/Android_kernel_f6mt_aosp_jb-rebase
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (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(os.envir...
gpl-2.0
akurtakov/Pydev
plugins/org.python.pydev.core/pysrc/_pydev_imps/_pydev_SimpleXMLRPCServer.py
14
21572
#Just a copy of the version in python 2.5 to be used if it's not available in jython 2.1 """Simple XML-RPC Server. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to hand...
epl-1.0
40223227/2015cdbg6w0622-40223227-
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testcallable.py
739
4234
# Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ import unittest from unittest.test.testmock.support import is_instance, X, SomeClass from unittest.mock import ( Mock, MagicMock, NonCallableMagicMock, NonCallableM...
gpl-3.0
home-assistant/home-assistant
tests/components/philips_js/test_device_trigger.py
5
2191
"""The tests for Philips TV device triggers.""" import pytest import homeassistant.components.automation as automation from homeassistant.components.philips_js.const import DOMAIN from homeassistant.setup import async_setup_component from tests.common import ( assert_lists_same, async_get_device_automations, ...
apache-2.0
BancDelTempsDAW/symfony
vendor/doctrine/orm/docs/en/conf.py
2448
6497
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # 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 # autogenerated file. ...
mit
yu-george/MarkFlip
MarkFlip.py
1
2434
import codecs import re mdFileUrl = 'test.md' outData = [] htmlStart = '''<!DOCTYPE HTML> <html lang='en'> <head> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> <link rel='stylesheet' href='markflip.css' type='text/css' /> <title>Generated by MarkFlip</title> </head> <body> ''' htmlEnd = '...
unlicense
asolntsev/selenium
py/test/selenium/webdriver/marionette/mn_context_tests.py
39
1135
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
EventGhost/EventGhost
plugins/WinUsbTest/__init__.py
2
1470
# -*- coding: utf-8 -*- # # This file is a plugin for EventGhost. # Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/> # # EventGhost is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either v...
gpl-2.0
NPC360/NPC360
wsgi/yesnoerr.py
1
1946
yeslist = [ "yes", "yasss", "yea", "yeah", "yep", "yeppers", "sure", "yizzir", "sounds good", "let's do it", "no problem", "let's go", "absolutely", "hell yea", "hell yes", "ok", "a little", "good", "great", "of course", "alright", ...
mit
mikedchavez1010/XX-Net
python27/1.0/lib/crypto/py3AES.py
7
34062
#!/usr/bin/python3 # # aes.py: implements AES - Advanced Encryption Standard # from the SlowAES project, http://code.google.com/p/slowaes/ # # Copyright (c) 2008 Josh Davis ( http://www.josh-davis.org ), # Alex Martelli ( http://www.aleax.it ) # # Ported from C code written by Laurent Haan # ( http://www.p...
bsd-2-clause
calvinchengx/django-haystack
haystack/query.py
2
24043
import operator import re import warnings from django.conf import settings from haystack.backends import SQ from haystack.constants import REPR_OUTPUT_SIZE, ITERATOR_LOAD_PER_QUERY, DEFAULT_OPERATOR from haystack.exceptions import NotRegistered class SearchQuerySet(object): """ Provides a way to specify searc...
bsd-3-clause
JohnDenker/brython
www/src/Lib/test/test_importlib/util.py
34
4274
from contextlib import contextmanager import imp import os.path from test import support import unittest import sys CASE_INSENSITIVE_FS = True # Windows is the only OS that is *always* case-insensitive # (OS X *can* be case-sensitive). if sys.platform not in ('win32', 'cygwin'): changed_name = __file__.upper() ...
bsd-3-clause
larsoner/mne-python
tutorials/preprocessing/plot_40_artifact_correction_ica.py
3
30767
# -*- coding: utf-8 -*- """ .. _tut-artifact-ica: Repairing artifacts with ICA ============================ This tutorial covers the basics of independent components analysis (ICA) and shows how ICA can be used for artifact repair; an extended example illustrates repair of ocular and heartbeat artifacts. .. contents...
bsd-3-clause
tophua/spark1.52
python/pyspark/storagelevel.py
11
2822
# # 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
erjohnso/ansible
test/units/modules/cloud/google/test_gcp_url_map.py
158
6086
import unittest from ansible.modules.cloud.google.gcp_url_map import _build_path_matchers, _build_url_map_dict class TestGCPUrlMap(unittest.TestCase): """Unit tests for gcp_url_map module.""" params_dict = { 'url_map_name': 'foo_url_map_name', 'description': 'foo_url_map description', ...
gpl-3.0
savoirfairelinux/django
tests/template_tests/syntax_tests/i18n/test_filters.py
133
2071
from django.test import SimpleTestCase from django.utils import translation from ...utils import setup class I18nFiltersTests(SimpleTestCase): libraries = { 'custom': 'template_tests.templatetags.custom', 'i18n': 'django.templatetags.i18n', } @setup({'i18n32': '{% load i18n %}{{ "hu"|lan...
bsd-3-clause
phenoxim/cinder
cinder/tests/unit/backup/test_chunkeddriver.py
2
20207
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
dcantrell/no
no.py
1
3287
#!/usr/bin/python # # no.py - Forbid installation of certain packages on yum systems # Copyright (C) 2010 David Cantrell <david.l.cantrell@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 Found...
gpl-2.0
MarcusTan/yncn-grid
venv/lib/python2.7/site-packages/flask/testsuite/views.py
561
5068
# -*- coding: utf-8 -*- """ flask.testsuite.views ~~~~~~~~~~~~~~~~~~~~~ Pluggable views. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import flask.views import unittest from flask.testsuite import FlaskTestCase from werkzeug.http import par...
mit
richpolis/siveinpy
env/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py
355
6215
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None ...
mit
extremewaysback/django
tests/test_client/tests.py
29
30690
# -*- coding: utf-8 -*- """ Testing using the Test Client The test client is a class that can act like a simple browser for testing purposes. It allows the user to compose GET and POST requests, and obtain the response that the server gave to those requests. The server Response objects are annotated with the details ...
bsd-3-clause
katiecheng/Bombolone
env/lib/python2.7/site-packages/werkzeug/contrib/iterio.py
89
8239
# -*- coding: utf-8 -*- r""" werkzeug.contrib.iterio ~~~~~~~~~~~~~~~~~~~~~~~ This module implements a :class:`IterIO` that converts an iterator into a stream object and the other way round. Converting streams into iterators requires the `greenlet`_ module. To convert an iterator into a stream...
bsd-3-clause
weiting-chen/manila
manila/compute/__init__.py
9
1150
# Copyright 2014 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 by applicable law...
apache-2.0
djoproject/pyshell
pyshell/utils/test/key_test.py
3
5574
#!/usr/bin/env python -t # -*- coding: utf-8 -*- # Copyright (C) 2015 Jonathan Delvaux <pyshell@djoproject.net> # 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...
gpl-3.0
Stanford-Online/edx-analytics-pipeline
edx/analytics/tasks/warehouse/load_internal_reporting_events.py
1
86821
"""EXPERIMENTAL: Load most events into warehouse for internal reporting purposes. This combines segment events and tracking log events, and defines a common (wide) representation for all events to share, sparsely. Requires definition of a Record enumerating these columns, and also a mapping from event values to colu...
agpl-3.0
jswope00/GAI
common/lib/symmath/symmath/symmath_check.py
67
12559
#!/usr/bin/python # -*- coding: utf-8 -*- # # File: symmath_check.py # Date: 02-May-12 (creation) # # Symbolic mathematical expression checker for edX. Uses sympy to check for expression equality. # # Takes in math expressions given as Presentation MathML (from ASCIIMathML), converts to Content MathML using Snuggl...
agpl-3.0
rnavarro/vitess
py/vtproto/vttest_pb2.py
11
7546
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: vttest.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 reflection as _reflec...
apache-2.0
guoxf/linux
scripts/rt-tester/rt-tester.py
1106
5305
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
jhawkesworth/ansible-modules-core
utilities/logic/fail.py
198
1458
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <dag@wieers.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 Lice...
gpl-3.0
fernandozamoraj/py_sandbox
py101/autocorrect.py
1
4097
import unittest MIN_SCORE = .7 g_words = [] def print1(line): pass #print(line); def is_possible_replacement(target_word, possible_word): global MIN_SCORE score = 0 print1('*'*40) if(target_word[0] == possible_word[0]): score += 100 if(target_word...
apache-2.0
sublime1809/django
tests/m2m_regress/tests.py
23
3734
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from django.utils import six from .models import (SelfRefer, Tag, TagCollection, Entry, SelfReferChild, SelfReferChildSibling, Worksheet, RegressionModelSplit) class M2MRegressionTests(TestCase...
bsd-3-clause
cmdunkers/DeeperMind
PythonEnv/lib/python2.7/site-packages/theano/misc/pycuda_utils.py
7
2472
import pycuda.gpuarray from theano.sandbox import cuda if cuda.cuda_available is False: raise ImportError('Optional theano package cuda disabled') def to_gpuarray(x, copyif=False): """ take a CudaNdarray and return a pycuda.gpuarray.GPUArray :type x: CudaNdarray :param x: The array to transform to p...
bsd-3-clause
ncdesouza/bookworm
env/lib/python2.7/site-packages/werkzeug/testsuite/internal.py
146
2940
# -*- coding: utf-8 -*- """ werkzeug.testsuite.internal ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Internal tests. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from datetime import datetime from warnings import filterwarnings, resetwarnings from werkz...
gpl-3.0
stscieisenhamer/glue
doc/redirect.py
5
2172
# This Sphinx plugin comes from https://github.com/openstack/nova-specs and was # originally licensed under a Creative Commons Attribution 3.0 Unported License. # The full text for this license can be found here: # # http://creativecommons.org/licenses/by/3.0/legalcode # A simple sphinx plugin which creates HTML redi...
bsd-3-clause
parrondo/arctic
tests/integration/scripts/test_list_libraries.py
5
1033
from mock import patch, call import pytest from arctic.scripts import arctic_list_libraries from ...util import run_as_main def test_list_library(mongo_host, library, library_name): with patch('arctic.scripts.arctic_list_libraries.print') as p: run_as_main(arctic_list_libraries.main, "--host", mongo_hos...
lgpl-2.1
TomKita/ansible-modules-extras
notification/hipchat.py
9
5616
#!/usr/bin/python # -*- coding: utf-8 -*- DOCUMENTATION = ''' --- module: hipchat version_added: "1.2" short_description: Send a message to hipchat. description: - Send a message to hipchat options: token: description: - API token. required: true room: description: - ID or name of the ro...
gpl-3.0
Tehsmash/nova
nova/tests/unit/api/openstack/compute/contrib/test_extended_virtual_interfaces_net.py
34
3799
# Copyright 2013 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 app...
apache-2.0
gauravbose/digital-menu
tests/migrations/test_executor.py
31
21893
from django.apps.registry import apps as global_apps from django.db import connection from django.db.migrations.executor import MigrationExecutor from django.db.migrations.graph import MigrationGraph from django.db.utils import DatabaseError from django.test import TestCase, modify_settings, override_settings from .te...
bsd-3-clause
rahulxxarora/Jango
jango/search.py
1
1049
import re import wikipedia import sys import jangopath flag = 0 query = "" f = open(jangopath.HOME_DIR + '/ans.txt','w') for arg in sys.argv: if flag==1: query = query + arg + " " if arg.lower()=="for" or arg.lower()=="about": flag = 1 def strip_non_ascii(string): ''' Returns the string without...
mit
udragon/ldc
ldc/test/test_ldcldap.py
1
1472
#!/usr/bin/python import unittest import uuid import ldc class TestLDCLdapInterface(unittest.TestCase): def test_ldcusers(self): rand_str = str(uuid.uuid4()) ldc.ldap.users.add(rand_str, rand_str, "password", "12345", "100", "/home/users/" + rand_str, "/bin/bash") assert ldc.ldap.users.get...
gpl-2.0
correl/Transmission-XBMC
resources/lib/basictypes/wx/wxcopyreg.py
4
3196
"""wxcopyreg -- functions for storing/restoring simple wxPython data types to pickle-friendly formats importing this module installs the functions automatically! """ import pickle, zlib from wxPython.wx import * ## def bind( classObject, outFunction, inFunction ): """Bind get and set state for the classObject""" ...
mit
cryptojuice/flask-scrypt
flask_scrypt.py
1
3509
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Flask-Scrypt flask extension provides scrypt password hashing and random salt generation. Hashes and Salts are base64 encoded. """ from __future__ import print_function, unicode_literals import sys import base64 import hmac from os import urandom from werkzeug.security...
mit
ryfeus/lambda-packs
HDF4_H5_NETCDF/source2.7/numpy/polynomial/hermite_e.py
17
58086
""" Objects for dealing with Hermite_e series. This module provides a number of objects (mostly functions) useful for dealing with Hermite_e series, including a `HermiteE` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in ...
mit
Lukc/ospace-lukc
client-ai/ai_main.py
1
3091
# # Copyright 2001 - 2011 Ludek Smid [http://www.ospace.net/] # # This file is part of Outer Space. # # Outer Space 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 # (...
gpl-2.0
atuljain/odoo
addons/hr/__init__.py
382
1092
# -*- 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
glwu/python-for-android
python-modules/pybluez/bluetooth/btcommon.py
68
13317
import sys import struct import binascii L2CAP=0 RFCOMM=3 PORT_ANY=0 # Service Class IDs SDP_SERVER_CLASS = "1000" BROWSE_GRP_DESC_CLASS = "1001" PUBLIC_BROWSE_GROUP = "1002" SERIAL_PORT_CLASS = "1101" LAN_ACCESS_CLASS = "1102" DIALUP_NET_CLASS = "1103" IRMC_SYNC_CLASS = "1104" OBEX_OBJPUSH_CLASS = "1105" OBEX_FILET...
apache-2.0
wkschwartz/django
django/utils/ipv6.py
129
1350
import ipaddress from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ def clean_ipv6_address(ip_str, unpack_ipv4=False, error_message=_("This is not a valid IPv6 address.")): """ Clean an IPv6 address string. Raise ValidationErr...
bsd-3-clause
rowemoore/odoo
addons/sale_order_dates/sale_order_dates.py
223
5308
# -*- 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
benfinkelcbt/CPD200
CPD200-Lab13-Python/googleapiclient/schema.py
82
9317
# 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 ...
gpl-3.0
loulich/Couchpotato
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/iprima.py
32
3608
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from random import random from math import floor from .common import InfoExtractor from ..compat import ( compat_urllib_request, ) from ..utils import ( ExtractorError, ) class IPrimaIE(InfoExtractor): _VALID_URL = r'https?://play...
gpl-3.0
lakshayg/tensorflow
tensorflow/examples/how_tos/reading_data/fully_connected_preloaded_var.py
100
6359
# 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
koson/MissionPlannerKMTI
Lib/xml/etree/ElementTree.py
40
56165
# # ElementTree # $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $ # # light-weight XML support for Python 2.3 and later. # # history (since 1.2.6): # 2005-11-12 fl added tostringlist/fromstringlist helpers # 2006-07-05 fl merged in selected changes from the 1.3 sandbox # 2006-07-05 fl removed support for ...
gpl-3.0
Taketrung/betfair.py
betfair/models.py
2
14047
# -*- coding: utf-8 -*- from __future__ import absolute_import from schematics.types import IntType from schematics.types import LongType from schematics.types import FloatType from schematics.types import StringType from schematics.types import BooleanType from schematics.types.compound import DictType from schemati...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/django/core/management/__init__.py
26
14905
from __future__ import unicode_literals import os import pkgutil import sys from collections import OrderedDict, defaultdict from importlib import import_module import django from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.manageme...
gpl-3.0
JinXinDeep/tensorflow
tensorflow/python/kernel_tests/bias_op_test.py
8
4045
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
jezdez/kuma
vendor/packages/logilab/common/decorators.py
93
8868
# copyright 2003-2013 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 General Public License as publ...
mpl-2.0
kif/dahu
plugins/id31/__init__.py
1
6007
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Data Analysis plugin tailored for ID31 * integrate_simple: simple demo of a simple integrator * integrate: a more advanced options """ __authors__ = ["Jérôme Kieffer"] __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron ...
gpl-2.0
randomtask1155/gpdb
gpMgmt/bin/gppylib/util/ssh_utils.py
20
10885
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2008. All Rights Reserved. # # This file contains ssh Session class and support functions/classes. import cmd import os import sys import socket import threading from gppylib.commands.base import WorkerPool, REMOTE, ExecutionError from gppylib.commands.unix import ...
apache-2.0
kxliugang/edx-platform
common/djangoapps/config_models/__init__.py
220
2002
""" Model-Based Configuration ========================= This app allows other apps to easily define a configuration model that can be hooked into the admin site to allow configuration management with auditing. Installation ------------ Add ``config_models`` to your ``INSTALLED_APPS`` list. Usage ----- Create a sub...
agpl-3.0
rahushen/ansible
lib/ansible/modules/windows/win_regedit.py
24
6538
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Adam Keech <akeech@chathamfinancial.com>, Josh Ludwig <jludwig@chathamfinancial.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # fi...
gpl-3.0
mdrumond/tensorflow
tensorflow/examples/adding_an_op/zero_out_op_1.py
190
1053
# 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
kevin-coder/tensorflow-fork
tensorflow/python/ops/ragged/ragged_expand_dims_op_test.py
13
4920
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
alcides/rdflib
test/test_sparql/test_sparql_recurse.py
1
2965
from rdflib.graph import ConjunctiveGraph from rdflib.term import URIRef, Literal from rdflib.namespace import RDFS from rdflib.sparql.Algebra import RenderSPARQLAlgebra from StringIO import StringIO import unittest, sys import nose testContent = """ @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix dc: <http://pu...
bsd-3-clause
neoareslinux/neutron
neutron/services/service_base.py
13
3183
# Copyright 2012 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
donNewtonAlpha/onos
tools/test/topos/onosnet.py
4
8616
#!/usr/bin/python import itertools import os import signal import sys from argparse import ArgumentParser from subprocess import call from threading import Thread from time import sleep import gratuitousArp from mininet.cli import CLI from mininet.examples.controlnet import MininetFacade from mininet.link import TCLin...
apache-2.0
msegado/edx-platform
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
13
15077
""" Tests for the wrapping layer that provides the XBlock API using XModule/Descriptor functionality """ # For tests, ignore access to protected members # pylint: disable=protected-access import webob import ddt from factory import ( BUILD_STRATEGY, Factory, lazy_attribute, LazyAttributeSequence, p...
agpl-3.0
pylixm/sae-django-demo
django1.7-sae/site-packages/django/db/backends/postgresql_psycopg2/operations.py
63
9574
from __future__ import unicode_literals from django.conf import settings from django.db.backends import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(DatabaseOperations, self).__init__(connection) def date_extract_sql(self, lookup_type...
apache-2.0
Arzie/deluge
deluge/ui/gtkui/pluginmanager.py
2
4510
# -*- coding: utf-8 -*- # # Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # ...
gpl-3.0
numenta/nupic
tests/integration/nupic/opf/opf_checkpoint_test/experiments/backwards_compatibility/base.py
20
15012
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2012-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
waheedahmed/edx-platform
lms/djangoapps/shoppingcart/tests/test_models.py
11
57845
""" Tests for the Shopping Cart Models """ from decimal import Decimal import datetime import sys import json import copy import smtplib from boto.exception import BotoServerError # this is a super-class of SESError and catches connection errors from mock import patch, MagicMock from nose.plugins.attrib import attr ...
agpl-3.0
wadoon/smvtools
smvtools/smvstutseq.py
1
2968
#!/usr/bin/python3 # smvtools -- Tools around NuSMV and NuXMV # Copyright (C) 2014-2016 - Alexander Weigl # # 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 #...
gpl-3.0
louyihua/edx-platform
common/djangoapps/microsite_configuration/backends/database.py
41
7974
""" Microsite backend that reads the configuration from the database """ from mako.template import Template from util.cache import cache from django.conf import settings from django.dispatch import receiver from django.db.models.signals import post_save from util.memcache import fasthash from util.url import strip_po...
agpl-3.0
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/closured/lib/python2.7/encodings/mac_latin2.py
647
8565
""" Python Character Mapping Codec generated from 'LATIN2.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,erro...
apache-2.0
nburn42/tensorflow
tensorflow/contrib/specs/python/specs_ops.py
44
6689
# 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
Tony-Zhang03/scribe
lib/py/scribe/ttypes.py
35
2620
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from thrift.Thrift import * import fb303.ttypes from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class Resu...
apache-2.0
akshatharaj/django
django/db/models/fields/related_lookups.py
287
6153
from django.db.models.lookups import ( Exact, GreaterThan, GreaterThanOrEqual, In, LessThan, LessThanOrEqual, ) class MultiColSource(object): contains_aggregate = False def __init__(self, alias, targets, sources, field): self.targets, self.sources, self.field, self.alias = targets, sources, field...
bsd-3-clause
rnyberg/pyfibot
pyfibot/modules/available/module_btc.py
1
2168
# -*- encoding: utf-8 -*- from __future__ import unicode_literals, print_function, division import logging log = logging.getLogger("cryptocoin") def command_ltc(bot, user, channel, args): """Display current LRC exchange rates from BTC-E""" r = bot.get_url("https://btc-e.com/api/2/ltc_usd/ticker") j = r.j...
bsd-3-clause
kittiu/sale-workflow
sale_exception_nostock/tests/test_dropshipping_skip_check.py
35
1548
# Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # 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 la...
agpl-3.0
y12uc231/edx-platform
common/lib/xmodule/xmodule/peer_grading_module.py
7
29051
import json import logging from datetime import datetime from lxml import etree from pkg_resources import resource_string from xblock.fields import Dict, String, Scope, Boolean, Float, Reference from xmodule.capa_module import ComplexEncoder from xmodule.fields import Date, Timedelta from xmodule.modulestore.exceptio...
agpl-3.0
shahin/deepdive
ddlib/test/with_ddlib.py
3
1693
#! /usr/bin/env python # File: udf/ext_has_spouse_features.py import sys, json import ddlib # For each input tuple # TODO: Sample Data and the input schema. # sample json for row in sys.stdin: # Unpack input into tuples. # obj = json.loads(row) words, lemmas = obj["words"], obj["lemma"] span1 = ddlib.Span(...
apache-2.0
mosquito/docker-compose
compose/service.py
4
27979
from __future__ import unicode_literals from __future__ import absolute_import from collections import namedtuple import logging import re import sys from operator import attrgetter import six from docker.errors import APIError from docker.utils import create_host_config, LogConfig from . import __version__ from .con...
apache-2.0
eestay/edx-platform
common/lib/xmodule/xmodule/video_module/video_handlers.py
17
12983
""" Handlers for video module. StudentViewHandlers are handlers for video module instance. StudioViewHandlers are handlers for video descriptor instance. """ import json import logging from webob import Response from xblock.core import XBlock from xmodule.exceptions import NotFoundError from xmodule.fields import R...
agpl-3.0
mattattack7/canvas-contrib
API_Examples/reports/provisioning_report/python/pull_provisioning_report.py
4
4267
#!/usr/bin/env python import requests import time, json, os import re,pprint # Change this to match your access token token="<access_token>" # This should be your account number. This is the number you see when logged into canvas # as an admin. i.e. https://schoolname.insructure.com/accounts/SOME_NUMBER_HERE ACCOUNT...
agpl-3.0
apporc/nova
nova/api/openstack/compute/legacy_v2/contrib/createserverext.py
100
1156
# 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 ...
apache-2.0
gauravbose/digital-menu
digimenu2/django/contrib/sessions/backends/db.py
37
2943
import logging from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, router, transaction from django.utils import timezone from django.utils.encoding import force_text class SessionStore(SessionBase): ...
bsd-3-clause
dankcoin/dankcoin
contrib/devtools/optimize-pngs.py
126
3201
#!/usr/bin/env python ''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text). #pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text ''' import os impor...
mit
gorjuce/odoo
addons/l10n_in_hr_payroll/__openerp__.py
374
2622
# -*- encoding: 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 G...
agpl-3.0
hjanime/VisTrails
vistrails/packages/controlflow/conditional.py
1
7838
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
mrkm4ntr/incubator-airflow
airflow/contrib/operators/gcp_compute_operator.py
7
4822
# # 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...
apache-2.0
jcurbelo/networkx
networkx/linalg/laplacianmatrix.py
12
7749
"""Laplacian matrix of graphs. """ # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx from networkx.utils import not_implemented_for __author__ = "\n".join(['Aric ...
bsd-3-clause