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
opsschool/coursebuilder
models/config.py
2
9670
# Copyright 2012 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
Education-Numerique/api
lxxl/services/graph/activities/thumbnail.py
1
1736
from lxxl.lib import router, output from lxxl.lib.app import Error, Controller from lxxl.lib.storage import Db, DbError from lxxl.model.activities import Activity, Factory as ActivityFactory from lxxl.model.blob import Factory as BlobFactory class Thumbnail(router.Root): def save(self, environ, params): ...
agpl-3.0
xcodecraft/qssdb
deps/cpy/cpy.py
32
1609
# encoding=utf-8 ################################# # Author: ideawu # Link: http://www.ideawu.net/ ################################# import sys, os import signal def __sigint__(n, f): sys.exit(0) signal.signal(signal.SIGINT, __sigint__); def usage(): print ('Cpy - A C-like scripting language.') print...
bsd-3-clause
HalcyonChimera/osf.io
osf/models/__init__.py
2
2810
from osf.models.metaschema import RegistrationSchema # noqa from osf.models.base import Guid, BlackListGuid # noqa from osf.models.user import OSFUser, Email # noqa from osf.models.contributor import Contributor, RecentlyAddedContributor # noqa from osf.models.session import Session # noqa from osf.models.institut...
apache-2.0
sbalde/edxplatform
lms/djangoapps/courseware/tests/test_navigation.py
36
11884
""" This test file will run through some LMS test scenarios regarding access and navigation of the LMS """ import time from mock import patch from nose.plugins.attrib import attr from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from coursewa...
agpl-3.0
safwanrahman/mozillians
vendor-local/lib/python/tablib/packages/openpyxl/writer/drawings.py
116
8268
# coding=UTF-8 ''' Copyright (c) 2010 openpyxl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publ...
bsd-3-clause
hojel/youtube-dl
youtube_dl/extractor/cloudy.py
122
3420
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_parse, compat_HTTPError, ) from ..utils import ( ExtractorError, HEADRequest, remove_end, ) class CloudyIE(InfoExtractor): _IE_DESC = ...
unlicense
anirudhSK/chromium
chrome/common/extensions/docs/server2/gcs_file_system_provider.py
60
3838
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import environment from caching_file_system import CachingFileSystem from empty_dir_file_system import EmptyDirFileSystem from extensions_paths im...
bsd-3-clause
Tkkg1994/IronKernel
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
agustinhenze/nikola.debian
tests/test_compile_markdown.py
12
2790
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import sys import io import shutil import tempfile import unittest from os import path from nikola.plugins.compile.markdown import CompileMarkdown from .base import BaseTestCase, FakeSite class CompileMarkdownTests(BaseTestCase): def se...
mit
katonori/cxxtags_sqlite3
test/inheritance/test.py
2
15943
#!/usr/bin/python import sys import os import sqlite3 sys.path.append("../../src/") import cxxtags_util as cxxtags sys.path.append("../util/") import clang.cindex # for kind types err = 0 ans_idx = 0 def test_one(db, q): global err global ans_idx res = list(db.execute(q).fetchall()) if len(res) == 0:...
bsd-3-clause
yufengg/tensorflow
tensorflow/contrib/keras/python/keras/utils/conv_utils.py
24
5555
# 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
ininex/geofire-python
resource/lib/python2.7/site-packages/requests/adapters.py
356
19740
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib...
mit
Alwnikrotikz/veromix-plasmoid
gtk/SliderWidget.py
3
9590
# -*- coding: utf-8 -*- # Copyright (C) 2012 Nik Lutz <nik.lutz@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 3 of the License, or # (at your option) any later vers...
gpl-3.0
mlavin/django
tests/model_fields/test_datetimefield.py
87
3393
import datetime from django.db import models from django.test import ( SimpleTestCase, TestCase, override_settings, skipUnlessDBFeature, ) from django.test.utils import requires_tz_support from django.utils import timezone from .models import DateTimeModel class DateTimeFieldTests(TestCase): def test_datet...
bsd-3-clause
nirmeshk/oh-mainline
vendor/packages/twisted/twisted/python/util.py
18
31153
# -*- test-case-name: twisted.python.test.test_util -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import os, sys, hmac, errno, new, inspect, warnings try: import pwd, grp except ImportError: pwd = grp = None try: from os import setgroups, getgroups except ImportError: setg...
agpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/scons-2.3.1/SCons/Tool/MSCommon/common.py
6
9240
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction...
gpl-2.0
google/neural-light-transport
third_party/xiuminglib/xiuminglib/os.py
1
13150
import os from os.path import join, exists, isdir, dirname from shutil import rmtree, copy2, copytree from glob import glob from .log import get_logger logger = get_logger() from .imprt import preset_import from .interact import format_print def _is_cnspath(path): return isinstance(path, str) and path.startswit...
apache-2.0
mortcanty/earthengine
src/Crypto/Hash/MD2.py
124
2734
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
mit
bitcoinclassic/bitcoinclassic
qa/rpc-tests/abandonconflict.py
2
7519
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * try: ...
mit
MarkusH/django-osm-field
tests/test_fields.py
1
10045
# -*- coding: utf-8 -*- import copy from unittest import skipIf import django from django.db import models from django.test import SimpleTestCase, TestCase from osm_field.fields import LatitudeField, Location, LongitudeField, OSMField from osm_field.validators import validate_latitude, validate_longitude from osm_fi...
mit
sighill/shade_app
apis/raw/001_raw/001_cleaner.py
1
1564
# 001_cleaner.py ##################################################################### ################################## # Import des modules et ajout du path de travail pour import relatif import sys sys.path.insert(0 , 'D:/Projets/shade_django/apis/') from voca import AddLog , StringFormatter , OutFileCreate...
mit
cocagne/multi-paxos-example
sync_strategy.py
2
1170
# This module provides a simple implementation of a catch-up mechanism # that synchronizes the peer with the current state of the multi-paxos # chain when it detects that the peer has fallen behind. # import random from twisted.internet import task class SimpleSynchronizationStrategyMixin (object): sync_del...
mit
crosswalk-project/blink-crosswalk-efl
Source/devtools/scripts/generate_devtools_html.py
9
3173
#!/usr/bin/env python # # Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this...
bsd-3-clause
levilucio/SyVOLT
ECore_Copier_MM/transformation-Large/HepackageOUTeClassifiersSolveRefEPackageEClassifierEPackageEClassifier.py
1
5036
from core.himesis import Himesis class HepackageOUTeClassifiersSolveRefEPackageEClassifierEPackageEClassifier(Himesis): def __init__(self): """ Creates the himesis graph representing the AToM3 model HepackageOUTeClassifiersSolveRefEPackageEClassifierEPackageEClassifier. """ # Flag...
mit
SchumyHao/rt-thread
bsp/stm32f0x/rtconfig.py
26
3462
import os # toolchains options ARCH='arm' CPU='cortex-m0' CROSS_TOOL='keil' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = '...
gpl-2.0
omegamoon/rockchip-rk3188-mk908
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
roam/machete
machete/vendor/marshmallow/fields.py
1
25137
# -*- coding: utf-8 -*- """Field classes for formatting and validating the serialized object. """ # Adapted from https://github.com/twilio/flask-restful/blob/master/flask_restful/fields.py. # See the `NOTICE <https://github.com/sloria/marshmallow/blob/master/NOTICE>`_ # file for more licensing information. from __futu...
bsd-2-clause
Semi-global/edx-platform
lms/djangoapps/instructor/access.py
83
2634
""" Access control operations for use by instructor APIs. Does not include any access control, be sure to check access before calling. TO DO sync instructor and staff flags e.g. should these be possible? {instructor: true, staff: false} {instructor: true, staff: true} """ import logging from djan...
agpl-3.0
GluonsAndProtons/gluon
proton/proton/cmd/register.py
2
5614
import threading import Queue import json from oslo_log import log as logging from oslo_log._i18n import _LE from oslo_log._i18n import _LW from oslo_log._i18n import _LI from oslo_config import cfg from requests import get, put, post, delete LOG = logging.getLogger(__name__) class MyData: pass RegData = MyData(...
apache-2.0
sudheesh001/oh-mainline
vendor/packages/oauthlib/oauthlib/oauth2/rfc6749/endpoints/base.py
87
1729
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals import functools import logging from ..errors import TemporarilyUnavailableE...
agpl-3.0
run2/citytour
4symantec/Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.py
478
3098
from __future__ import absolute_import, division import time import os import sys import errno from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class MkdirLockFile(LockBase): """Lock file by creating a directory.""" def __init__(self, path, threaded=True, ...
mit
salrashid123/gcpsamples
id_token/iam_svc_tokens/main.py
1
3398
import logging import os import sys import json import time import pprint from apiclient.discovery import build import httplib2 from oauth2client.service_account import ServiceAccountCredentials from oauth2client.client import GoogleCredentials from apiclient import discovery custom_claim = "some custom_claim" audien...
apache-2.0
kingvuplus/b-p
lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py
15
24855
from Screens.Satconfig import NimSelection from Screens.Screen import Screen from Screens.TextBox import TextBox from Screens.MessageBox import MessageBox from Plugins.Plugin import PluginDescriptor from Components.ActionMap import ActionMap, NumberActionMap from Components.NimManager import nimmanager from Components....
gpl-2.0
wofanli/trex-core
scripts/external_libs/zmq/tests/__init__.py
26
6734
# Copyright (c) PyZMQ Developers. # Distributed under the terms of the Modified BSD License. import functools import sys import time from threading import Thread from unittest import TestCase import zmq from zmq.utils import jsonapi try: import gevent from zmq import green as gzmq have_gevent = True exc...
apache-2.0
michaelpacer/linkchecker
linkcheck/log.py
9
3994
# -*- coding: iso-8859-1 -*- # Copyright (C) 2003-2014 Bastian Kleineidam # # 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 versi...
gpl-2.0
TRox1972/youtube-dl
youtube_dl/extractor/theweatherchannel.py
67
3203
# coding: utf-8 from __future__ import unicode_literals from .theplatform import ThePlatformIE from ..utils import ( determine_ext, parse_duration, ) class TheWeatherChannelIE(ThePlatformIE): _VALID_URL = r'https?://(?:www\.)?weather\.com/(?:[^/]+/)*video/(?P<id>[^/?#]+)' _TESTS = [{ 'url': '...
unlicense
v-iam/azure-sdk-for-python
azure-servicefabric/azure/servicefabric/models/deployed_application_health_state_chunk.py
2
2186
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
cbpygit/pypmj
projects/scattering/photonic_crystals/slabs/hexagonal/half_spaces/hex_plane_tools.py
1
4284
from scipy.linalg import expm, norm import numpy as np def rot_mat(axis, theta): return expm(np.cross(np.eye(3), axis/norm(axis)*theta)) def rotate_vector(v, axis, theta): M = rot_mat(axis, theta) return np.tensordot(M,v,axes=([0],[1])).T #np.dot(M, v) def rotate_around_z(v, theta): return rotate_ve...
gpl-3.0
TinLe/Diamond
src/collectors/sockstat/test/testsockstat.py
12
1982
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportError: ...
mit
alexeyum/scikit-learn
sklearn/mixture/tests/test_dpgmm.py
261
4490
import unittest import sys import numpy as np from sklearn.mixture import DPGMM, VBGMM from sklearn.mixture.dpgmm import log_normalize from sklearn.datasets import make_blobs from sklearn.utils.testing import assert_array_less, assert_equal from sklearn.mixture.tests.test_gmm import GMMTester from sklearn.externals.s...
bsd-3-clause
repotvsupertuga/repo
plugin.video.laliga/resources/lib/modules/livestreamerXBMCLocalProxy.py
5
5647
""" XBMCLocalProxy 0.1 Copyright 2011 Torben Gerkensmeyer Modified for Livestreamer by your mom 2k15 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 opti...
gpl-2.0
araeden/notepad-plus-plus
scintilla/scripts/FileGenerator.py
56
6667
#!/usr/bin/env python # FileGenerator.py - implemented 2013 by Neil Hodgson neilh@scintilla.org # Released to the public domain. # Generate or regenerate source files based on comments in those files. # May be modified in-place or a template may be generated into a complete file. # Requires Python 2.5 or later ...
gpl-2.0
BT-rmartin/odoo
addons/account_payment/__init__.py
436
1279
# -*- 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
taotie12010/bigfour
common/test/acceptance/accessibility/test_lms_dashboard_axs.py
68
1293
""" Accessibility tests for LMS dashboard page. Run just this test with: SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility -t test_lms_dashboard_axs.py """ from ..tests.lms.test_lms_dashboard import BaseLmsDashboardTest class LmsDashboardAxsTest(BaseLmsDashboardTest): """ Class to test lms stude...
agpl-3.0
yinquan529/people-harigopal.gollamudi-glmark2
waflib/Tools/xlcxx.py
14
1252
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib.Tools import ccroot,ar from waflib.Configure import conf def find_xlcxx(conf): cxx=conf.find_program(['xlc++_r','xlc++'],var='CXX') cxx=conf.cmd_to_list(cxx) co...
gpl-3.0
VizGrimoire/GrimoireLib
testing/test_data_source_api.py
3
23318
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Bitergia # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later...
gpl-3.0
JoshAshby/seshat
seshat/actions.py
1
3451
#!/usr/bin/env python """ Actions allow you to write code that looks like:: class RandomController(BaseController): def GET(self): return Redirect("/") which I think looks a lot nicer than:: class RandomController(BaseController): def GET(self): self.head.status = "303 SEE OTHER" ...
gpl-3.0
rolandgeider/wger
wger/core/views/user.py
1
20020
# -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager 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 ...
agpl-3.0
tal-nino/shinken
libexec/discovery/vmware_discovery_runner.py
21
7653
#!/usr/bin/env python # # Copyright (C) 2009-2010: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel <h.goebel@goebel-consult.de> # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or m...
agpl-3.0
adelina-t/nova
nova/tests/fixtures.py
10
13936
# 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 compliance with the License. You may obtain # a ...
apache-2.0
beingzy/user_recommender_framework
groupwise_distance_learning/tests/test_helper_func.py
1
2232
""" functions for developing Author: Yi Zhang <beingzy@gmail.com> Date: 2016/03/10 """ import os import os.path from os.path import dirname, abspath, join import pandas as pd def get_file_parent_dir_path(level=1): """ return the path of the parent directory of current file """ current_dir_path = dirname(absp...
gpl-3.0
moonbury/notebooks
github/MatplotlibCookbook/Chapter 8/wx-supershape-1.py
3
1121
import wx, numpy from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.figure import Figure def supershape_radius(phi, a, b, m, n1, n2, n3): theta = .25 * m * phi cos = numpy.fabs(numpy.cos(theta) / a) ** n2 sin = numpy.fabs(numpy.sin(theta) / b) ** n3 r = (cos + sin) ** (-1. / n1) r ...
gpl-3.0
princeofdarkness76/thefuck
tests/rules/test_pacman.py
17
3711
import pytest from mock import patch from thefuck.rules import pacman from thefuck.rules.pacman import match, get_new_command from tests.utils import Command pacman_cmd = getattr(pacman, 'pacman', 'pacman') PKGFILE_OUTPUT_SUDO = 'core/sudo 1.8.13-13/usr/bin/sudo' PKGFILE_OUTPUT_CONVERT = 'extra/imagemagick 6.9.1.0-1...
mit
darmaa/odoo
addons/l10n_at/__init__.py
438
1050
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
agpl-3.0
TedaLIEz/sentry
src/sentry/api/serializers/models/project.py
15
1312
from __future__ import absolute_import from sentry.api.serializers import Serializer, register from sentry.models import OrganizationMemberType, Project, Team @register(Project) class ProjectSerializer(Serializer): def get_attrs(self, item_list, user): organization = item_list[0].team.organization ...
bsd-3-clause
nkhumphreys/django-documentregister
documentregister/documents/tests.py
1
7760
from django.test import TestCase from django.core.urlresolvers import reverse from documents.models import DocumentType, Document from documents.forms import DocumentRegistrationForm from django_webtest import WebTest class DocumentModelTest(TestCase): def setUp(self): self.dt = DocumentType.objects.crea...
mit
google/apis-client-generator
src/googleapis/codegen/data_value.py
14
2733
#!/usr/bin/python2.7 # Copyright 2012 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 requi...
apache-2.0
dials/dials
command_line/slice_sequence.py
1
8896
from os.path import basename, splitext from dxtbx.model.experiment_list import ExperimentList import dials.util from dials.algorithms.refinement.refinement_helpers import calculate_frame_numbers from dials.array_family import flex from dials.util import Sorry from dials.util.multi_dataset_handling import generate_exp...
bsd-3-clause
GetSomeBlocks/Score_Soccer
resources/lib/twisted/twisted/conch/client/options.py
60
4254
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # from twisted.conch.ssh.transport import SSHClientTransport, SSHCiphers from twisted.python import usage import sys class ConchOptions(usage.Options): optParameters = [['user', 'l', None, 'Log in using this user name.'], ...
mit
anggorodewanto/oppia
core/storage/base_model/gae_models.py
14
19647
# Copyright 2014 The Oppia 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
applift/vitess
test/mysqlctl.py
12
3110
#!/usr/bin/env python # Copyright 2017 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
urbn/kombu
kombu/__init__.py
1
4315
"""Messaging library for Python.""" from __future__ import absolute_import, unicode_literals import os import re import sys if sys.version_info < (2, 7): # pragma: no cover raise Exception('Kombu 4.0 requires Python versions 2.7 or later.') from collections import namedtuple # noqa __version__ = '4.6.6' __aut...
bsd-3-clause
RedHatInsights/insights-core
insights/parsers/tests/test_journal_since_boot.py
1
1683
from insights.parsers.journal_since_boot import JournalSinceBoot from insights.tests import context_wrap MSGINFO = """ -- Logs begin at Wed 2017-02-08 15:18:00 CET, end at Tue 2017-09-19 09:12:59 CEST. -- May 18 15:13:34 lxc-rhel68-sat56 jabberd/sm[11057]: session started: jid=rhn-dispatcher-sat@lxc-rhel6-sat56.redhat...
apache-2.0
TylerTemp/md-video
md_video.py
1
7634
""" Video block for python-markdown This is aimed to provide best output even without this extension Title is case insensitive, title is no use, can also be `[video]`. This is only to avoid the quick reference link Format: [Video: Title of the Video] ![poster](http://link.to.poster/link.png) [download.m...
mit
vipulkanade/EventbriteDjango
lib/python2.7/site-packages/django/contrib/admin/widgets.py
345
14769
""" Form Widget classes specific to the Django admin site. """ from __future__ import unicode_literals import copy from django import forms from django.contrib.admin.templatetags.admin_static import static from django.core.urlresolvers import reverse from django.db.models.deletion import CASCADE from django.forms.uti...
mit
xindus40223115/w16b_test
static/Brython3.1.0-20150301-090019/Lib/types.py
756
3167
""" 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-3.0
kernc/networkx
networkx/algorithms/operators/tests/test_binary.py
40
8646
from nose.tools import * import networkx as nx from networkx import * from networkx.testing import * def test_union_attributes(): g = nx.Graph() g.add_node(0, x=4) g.add_node(1, x=5) g.add_edge(0, 1, size=5) g.graph['name'] = 'g' h = g.copy() h.graph['name'] = 'h' h.graph['attr'] = 'at...
bsd-3-clause
tvibliani/odoo
addons/l10n_be_intrastat/l10n_be_intrastat.py
258
7828
# -*- encoding: utf-8 -*- ############################################################################## # # Odoo, Open Source Business Applications # Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
nhomar/odoo
addons/stock_invoice_directly/__openerp__.py
260
1618
# -*- 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
numerigraphe/odoo
addons/hr_attendance/wizard/__init__.py
375
1073
# -*- 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
sometallgit/AutoUploader
Python27/Lib/lib-tk/tkCommonDialog.py
193
1418
# base class for tk common dialogues # # this module provides a base class for accessing the common # dialogues available in Tk 4.2 and newer. use tkFileDialog, # tkColorChooser, and tkMessageBox to access the individual # dialogs. # # written by Fredrik Lundh, May 1997 # from Tkinter import * class Dialog: com...
mit
gencer/sentry
src/sentry/south_migrations/0362_auto__add_userip__add_unique_userip_user_ip_address.py
1
89359
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): # Flag to indicate if this migration is too risky # to run online and needs to be coordinated for offline ...
bsd-3-clause
credativUK/OCB
addons/mail/mail_followers.py
29
8937
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
tempbottle/Rusthon
regtests/go/chan-transfer-speed.py
5
2442
# based on the go test by Dennis Francis # https://github.com/dennisfrancis/gopherjs-channeltransfer-speed import "github.com/gopherjs/gopherjs/js" data_chan = go.channel(int) document = js.Global.Get("document") def main(): js.Global.Get("window").Set("onload", setup) def setup(): go( receive() ) bt = docum...
bsd-3-clause
zackmdavis/swift
test/unit/proxy/controllers/test_info.py
23
12505
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
mrry/tensorflow
tensorflow/contrib/lookup/__init__.py
16
1202
# 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
apiaryio/heroku-buildpack-python-scons
vendor/distribute-0.6.36/setuptools/command/install.py
216
4065
import setuptools, sys, glob from distutils.command.install import install as _install from distutils.errors import DistutilsArgError class install(_install): """Use easy_install to install the package, w/dependencies""" user_options = _install.user_options + [ ('old-and-unmanageable', None, "Try not ...
mit
G33KS44n/mysql-5.6
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug884737_test.py
24
4796
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
gpl-2.0
BeDjango/intef-openedx
lms/djangoapps/lti_provider/views.py
94
5813
""" LTI Provider view functions """ from django.conf import settings from django.http import HttpResponseBadRequest, HttpResponseForbidden, Http404 from django.views.decorators.csrf import csrf_exempt import logging from lti_provider.outcomes import store_outcome_parameters from lti_provider.models import LtiConsumer...
agpl-3.0
TedaLIEz/sentry
tests/sentry/api/endpoints/test_organization_index.py
26
1622
from __future__ import absolute_import from django.core.urlresolvers import reverse from exam import fixture from sentry.models import Organization from sentry.testutils import APITestCase class OrganizationsListTest(APITestCase): @fixture def path(self): return reverse('sentry-api-0-organizations')...
bsd-3-clause
IECS/MansOS
tools/IDE/src/Settings.py
1
2586
# -*- coding: utf-8 -*- # # Copyright (c) 2008-2012 the MansOS team. 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, # ...
mit
startcode/apollo
modules/tools/map_gen/map_gen_two_lanes_right_ext.py
4
8664
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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 ...
apache-2.0
hustnn/shadowsocks
shadowsocks/crypto/util.py
1032
4287
#!/usr/bin/env python # # 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 by applicable law or ...
apache-2.0
openmotics/gateway
src/gateway/api/serializers/group_action.py
1
1889
# Copyright (C) 2020 OpenMotics BV # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribu...
agpl-3.0
julienbaley/zhtools
test/test_zhtools/test_transliteration/test_transliteration.py
1
1506
from zhtools.transliteration import Transliteration import unittest class TestTransliteration(unittest.TestCase): def test_split_syllables(self): self.assertEqual(Transliteration("wo3bu4zhi1dao4").text, ["wo3", "bu4", "zhi1", "dao4"]) self.assertEqual(Transliteration("zhe...
gpl-3.0
adkerr/tempest
tempest/api/compute/volumes/test_volumes_list.py
2
4824
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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.apach...
apache-2.0
thepaul/uftrace
tests/t098_dump_tid.py
1
2454
#!/usr/bin/env python from runtest import TestBase import subprocess as sp TDIR='xxx' class TestCase(TestBase): def __init__(self): TestBase.__init__(self, 'fork', """ uftrace file header: magic = 4674726163652100 uftrace file header: version = 4 uftrace file header: header size = 40 uftr...
gpl-2.0
hnjamba/onaclone
onadata/apps/viewer/migrations/0001_initial.py
13
11100
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ParsedInstance' db.create_table('odk_viewer_parsedinstance', ( ('id', self.gf(...
bsd-2-clause
h4ck3rm1k3/orca-sonar
src/orca/generator.py
1
46495
# Orca # # Copyright 2009 Sun Microsystems Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libr...
lgpl-2.1
SeedScientific/polio
source_data/migrations/0095_auto__del_unique_sourceregion_region_string__del_unique_sourceregion_r.py
1
75619
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'SourceRegion', fields ['region_string', 'documen...
agpl-3.0
joequery/django
django/contrib/gis/utils/wkt.py
589
1923
""" Utilities for manipulating Geometry WKT. """ from django.utils import six def precision_wkt(geom, prec): """ Returns WKT text of the geometry according to the given precision (an integer or a string). If the precision is an integer, then the decimal places of coordinates WKT will be truncated t...
bsd-3-clause
OpenTransitTools/utils
ott/utils/parse/cmdline/db_cmdline.py
1
1334
from .base_cmdline import * def is_spatial(parser): parser.add_argument( '--is_geospatial', '-geo', '-g', action="store_true", help="add geometry columns" ) def db_parser(prog_name='bin/loader', tables=['Could be (Decarative) Base.metadata.sorted_tables'], url_require...
mpl-2.0
torotil/dbuild.py
drupy/objects.py
1
17114
from copy import deepcopy, copy import os.path import urllib.parse import urllib.request import hashlib import json import setuptools.archive_util import shutil import collections import re from functools import partial from glob import glob def addDefaults(config, defaults): queue = [(config, defaults)] whi...
gpl-3.0
dudymas/webassets-browserify
webassets_browserify/__init__.py
2
1663
from webassets.filter import ExternalTool, option __all__ = ['Browserify'] class Browserify(ExternalTool): """Use Browserify to bundle assets. Requires the Browserify executable to be available externally. You can install it using `Node Package Manager <http://npmjs.org/>`_:: $ npm install -g b...
mit
alanmeadows/aic-helm
common/utils/values/values.py
3
4193
#! /usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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/...
apache-2.0
jos4uke/getSeqFlankBlatHit
lib/python2.7/site-packages/numpy/ma/tests/test_subclassing.py
47
8281
# pylint: disable-msg=W0611, W0612, W0511,R0201 """Tests suite for MaskedArray & subclassing. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_subclassing.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ from __future__ import division, absolute_import, print_function __author__...
gpl-2.0
MikeCurrington/LedPinky
main.py
1
4174
import xml.etree.ElementTree as ET import ConfigParser import SimpleHTTPServer import SocketServer import os from LedWiz import LedWiz from LedHttp import LedHttp from gpio import ArcadeGpio from GameData import GameData from PinMap import PinMap from DeviceManager import DeviceManager from Sequencer import Sequencer ...
mit
neiudemo1/django
django/contrib/gis/gdal/geometries.py
337
24056
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
bsd-3-clause
rkokkelk/CouchPotatoServer
libs/suds/xsd/doctor.py
204
6308
# 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 ...
gpl-3.0