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 |
|---|---|---|---|---|---|
jjmiranda/edx-platform | common/djangoapps/enrollment/views.py | 34 | 28793 | """
The Enrollment API Views should be simple, lean HTTP endpoints for API access. This should
consist primarily of authentication, request validation, and serialization.
"""
import logging
from django.core.exceptions import ObjectDoesNotExist
from django.utils.decorators import method_decorator
from opaque_keys impo... | agpl-3.0 |
goksie/newfies-dialer | newfies/mod_mailer/admin.py | 4 | 1080 | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initia... | mpl-2.0 |
hgl888/chromium-crosswalk | tools/telemetry/telemetry/internal/actions/drag.py | 29 | 4397 | # Copyright 2015 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.
"""A Telemetry page_action that performs the "drag" action on pages.
Action parameters are:
- selector: If no selector is defined then the action attempts t... | bsd-3-clause |
niranjan94/open-event-orga-server | migrations/versions/e95a9cd83678_.py | 10 | 7089 | """empty message
Revision ID: e95a9cd83678
Revises: 3f145ecaf358
Create Date: 2016-12-21 13:17:24.682386
"""
# revision identifiers, used by Alembic.
revision = 'e95a9cd83678'
down_revision = '3f145ecaf358'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
### commands auto... | gpl-3.0 |
gwr/samba | source4/dsdb/tests/python/sam.py | 1 | 108681 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a port of the original in testprogs/ejs/ldap.js
import optparse
import sys
import os
sys.path.insert(0, "bin/python")
import samba
samba.ensure_external_module("testtools", "testtools")
samba.ensure_external_module("subunit", "subunit/python")
import samba.geto... | gpl-3.0 |
seanwestfall/django | tests/gis_tests/gdal_tests/test_driver.py | 335 | 1253 | import unittest
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.gdal import Driver, GDALException
valid_drivers = (
# vector
'ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN', 'Memory', 'CSV',
'GML', 'KML',
# raster
'GTiff', 'JPEG', 'MEM', 'PNG',
)
in... | bsd-3-clause |
AdamIsrael/PerfKitBenchmarker | perfkitbenchmarker/sample.py | 1 | 3009 | # Copyright 2014 PerfKitBenchmarker 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 appli... | apache-2.0 |
chongtianfeiyu/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/svn_utils.py | 68 | 17284 | import os
import re
import sys
from distutils import log
import xml.dom.pulldom
import shlex
import locale
import codecs
import unicodedata
import warnings
from setuptools.compat import unicode
from xml.sax.saxutils import unescape
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
from ... | lgpl-3.0 |
40223139/203739test | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/SDL.py | 603 | 1813 | from browser import document
SDL_INIT_VIDEO=0
SDL_GL_DOUBLEBUFFER=1
SDL_GL_DEPTH_SIZE=2
SDL_DOUBLEBUF=3
SDL_ANYFORMAT=4
SDL_ACTIVEEVENT=5
SDL_ALLEVENTS=5
SDL_KEYDOWN=6
SDL_KEYUP=7
SDL_MOUSEMOTION=8
SDL_MOUSEBUTTONDOWN=9
SDL_MOUSEBUTTONUP=10
SDL_JOYAXISMOTION=11
SDL_JOYBALLMOTION=12
SDL_JOYHATMOTION=13
SDL_JOYBUTTON... | gpl-3.0 |
jasonwee/videoOnCloud | ahkl/apache-cassandra-3.5/pylib/cqlshlib/test/cassconnect.py | 13 | 4872 | # 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 |
mengxn/tensorflow | tensorflow/contrib/graph_editor/tests/edit_test.py | 132 | 3104 | # 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 |
yoriyuki/nksnd | nksnd/lm/lm.py | 1 | 3383 | from __future__ import print_function
import codecs
import pickle
import os
import sys
import marisa_trie
from nksnd.utils import words
from nksnd.dictionaries import marisa_dict
from nksnd.graph import graph, viterbi
from nksnd.slm import slm
from nksnd.config import lmconfig, slm_config
def concat(files):
for f... | mit |
jetty840/ReplicatorG | skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/craft_plugins/lift.py | 6 | 8932 | """
This page is in the table of contents.
Lift will change the altitude of the cutting tool when it is on so that it will cut through the slab at the correct altitude. It will also lift the gcode when the tool is off so that the cutting tool will clear the top of the slab.
==Operation==
The default 'Activate Lift' c... | gpl-2.0 |
j2sol/ansible | lib/ansible/module_common.py | 2 | 31849 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
perrygeo/python-raster-stats | tests/test_zonal.py | 1 | 17991 | # test zonal stats
import os
import pytest
import simplejson
import json
import sys
import numpy as np
import rasterio
from rasterstats import zonal_stats, raster_stats
from rasterstats.utils import VALID_STATS
from rasterstats.io import read_featurecollection, read_features
from shapely.geometry import Polygon
from af... | bsd-3-clause |
hickford/youtube-dl | youtube_dl/extractor/vimple.py | 121 | 1911 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class SprutoBaseIE(InfoExtractor):
def _extract_spruto(self, spruto, video_id):
playlist = spruto['playlist'][0]
title = playlist['title']
video_id = playlist.get('videoId') or video_... | unlicense |
kaarolch/ansible | lib/ansible/modules/cloud/amazon/rds_param_group.py | 16 | 10691 | #!/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 |
talk-to/PjSip-Repo | tests/pjsua/scripts-sendto/999_asterisk_err.py | 42 | 1256 | # $Id$
import inc_sip as sip
import inc_sdp as sdp
# http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2008-June/003426.html:
#
# Report in pjsip mailing list on 27/6/2008 that this message will
# cause pjsip to respond with 500 and then second request will cause
# segfault.
complete_msg = \
"""INVITE sip:5001@19... | gpl-2.0 |
alheinecke/tensorflow-xsmm | tensorflow/contrib/training/python/training/bucket_ops_test.py | 22 | 16410 | # 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 |
hfp/tensorflow-xsmm | tensorflow/python/data/experimental/kernel_tests/serialization/group_by_window_serialization_test.py | 21 | 2446 | # 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 |
YYWen0o0/python-frame-django | django/conf/locale/ml/formats.py | 394 | 1815 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIM... | bsd-3-clause |
crystone/openstack-monitoring | openstack_monitoring/check_neutron_l3_ha_states.py | 1 | 4364 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# OpenStack Monitoring
# Copyright (C) 2015 Tobias Urdin
#
# 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/license... | gpl-2.0 |
jsj2008/kdegames | kajongg/src/intelligence.py | 1 | 17468 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2009-2012 Wolfgang Rohdewald <wolfgang@rohdewald.de>
kajongg 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 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/numpy/lib/tests/test_packbits.py | 22 | 3214 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_array_equal, assert_equal, assert_raises
def test_packbits():
# Copied from the docstring.
a = [[[1, 0, 1], [0, 1, 0]],
[[1, 1, 0], [0, 0, 1]]]
for dt in '?bBhHiIlLqQ':
ar... | apache-2.0 |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/distutils/tests/__init__.py | 165 | 1060 | """Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the command classes in... | gpl-3.0 |
zouyapeng/horizon | openstack_dashboard/dashboards/project/stacks/forms.py | 3 | 14708 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | apache-2.0 |
meabsence/python-for-android | python3-alpha/python3-src/setup.py | 43 | 84771 | # Autodetecting setup.py script for building the Python extensions
#
__version__ = "$Revision$"
import sys, os, imp, re, optparse
from glob import glob
import sysconfig
from distutils import log
from distutils import text_file
from distutils.errors import *
from distutils.core import Extension, setup
from distutils.... | apache-2.0 |
sean93park/mozjs24 | js/src/python/mozbuild/mozbuild/mach_commands.py | 3 | 25880 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, # You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals
import logging
import operator
import os
import sys
from mac... | mpl-2.0 |
Kazade/NeHe-Website | google_appengine/lib/django_0_96/django/middleware/transaction.py | 447 | 1090 | from django.db import transaction
class TransactionMiddleware(object):
"""
Transaction middleware. If this is enabled, each view function will be run
with commit_on_response activated - that way a save() doesn't do a direct
commit, the commit is done when a successful response is created. If an
exc... | bsd-3-clause |
jlerouge/crfpp-pivaj | python/test.py | 10 | 1861 | #!/usr/bin/ruby
import CRFPP
import sys
try:
# -v 3: access deep information like alpha,beta,prob
# -nN: enable nbest output. N should be >= 2
tagger = CRFPP.Tagger("-m ../model -v 3 -n2")
# clear internal context
tagger.clear()
# add context
tagger.add("Confidence NN")
tagger.add("i... | lgpl-2.1 |
BryanCutler/spark | python/pyspark/pandas/sql_processor.py | 1 | 10798 | #
# 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 |
goldsborough/.emacs | .emacs.d/.python-environments/default/lib/python3.5/heapq.py | 19 | 22930 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... | mit |
mlaitinen/odoo | addons/sale_stock/sale_stock.py | 118 | 26770 | # -*- 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 |
zuck/prometeo-erp | core/taxonomy/admin.py | 3 | 1176 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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 3 of the License, or (at your
option... | lgpl-3.0 |
CredoReference/edx-platform | common/djangoapps/course_modes/signals.py | 24 | 1561 | """
Signal handler for setting default course mode expiration dates
"""
from django.core.exceptions import ObjectDoesNotExist
from django.dispatch.dispatcher import receiver
from xmodule.modulestore.django import SignalHandler, modulestore
from .models import CourseMode, CourseModeExpirationConfig
@receiver(SignalH... | agpl-3.0 |
dpazel/music_rep | tests/search_tests/test_melodic_search.py | 1 | 14964 | import unittest
from search.melodicsearch.global_search_options import GlobalSearchOptions
from search.melodicsearch.melodic_search import MelodicSearch
from structure.LineGrammar.core.line_grammar_executor import LineGrammarExecutor
from timemodel.position import Position
class TestMelodicSearch(unittest.TestCase):... | mit |
joegomes/deepchem | examples/hopv/hopv_tf_progressive.py | 2 | 1173 | """
Script that trains progressive multitask models on HOPV dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import shutil
import numpy as np
import deepchem as dc
from hopv_datasets import load_hopv
# Only for debug!
np.random.seed(1... | mit |
CryptoExperts/wb_contest_submission_server | services/web-dev/app/funny_name_generator.py | 2 | 30192 | # Do not add/remove adjectives, unless you know what you are doing ;-)
adjectives = [
"admiring",
"adoring",
"affectionate",
"agitated",
"amazing",
"angry",
"awesome",
"blissful",
"boring",
"brave",
"bright",
"clever",
"cocky",
"compassionate",
"competent",
... | gpl-3.0 |
guanqun/stgit | stgit/commands/repair.py | 1 | 8429 | # -*- coding: utf-8 -*-
__copyright__ = """
Copyright (C) 2006, Karl Hasselström <kha@treskal.com>
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.
This program is distributed in the hope ... | gpl-2.0 |
frishberg/django | tests/admin_changelist/admin.py | 14 | 4042 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.core.paginator import Paginator
from .models import Child, Event, Parent, Swallow
site = admin.AdminSite(name="admin")
site.register(User, UserAdmin)
class CustomPaginator(Pagina... | bsd-3-clause |
kuri65536/python-for-android | python-modules/twisted/twisted/test/test_internet.py | 59 | 46415 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for lots of functionality provided by L{twisted.internet}.
"""
import os
import sys
import time
from twisted.trial import unittest
from twisted.internet import reactor, protocol, error, abstract, defer
from twisted.internet i... | apache-2.0 |
jupiturliu/googletest | test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
okfish/django-oscar | tests/integration/offer/range_tests.py | 6 | 9001 | from django.test import TestCase
from oscar.apps.offer import models
from oscar.apps.catalogue import models as catalogue_models
from oscar.test.factories import create_product
class TestWholeSiteRange(TestCase):
def setUp(self):
self.range = models.Range.objects.create(
name="All products",... | bsd-3-clause |
CityGrid/arsenal | server/arsenalweb/views/data_centers.py | 1 | 3106 | '''Arsenal data_centers UI'''
# Copyright 2015 CityGrid Media, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
arnaudsj/pybrain | pybrain/tools/svmdata.py | 8 | 4831 | __author__ = 'Michael Isik'
from pybrain.datasets import SupervisedDataSet
class SVMData(SupervisedDataSet):
""" Reads data files in LIBSVM/SVMlight format """
def __init__(self, filename=None):
SupervisedDataSet.__init__(self, 0, 0)
self.nCls = 0
self.nSamples = 0
self.class... | bsd-3-clause |
wmvanvliet/mne-python | mne/report.py | 1 | 88541 | """Generate self-contained HTML reports from MNE objects."""
# Authors: Alex Gramfort <alexandre.gramfort@inria.fr>
# Mainak Jas <mainak@neuro.hut.fi>
# Teon Brooks <teon.brooks@gmail.com>
#
# License: BSD (3-clause)
import base64
from io import BytesIO
from mne.proj import read_proj
import os
impor... | bsd-3-clause |
endolith/numpy | numpy/distutils/extension.py | 8 | 3360 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.
Overridden to support f2py.
"""
import re
from distutils.extension import Extension as old_Extension
cxx_ext_re = re.compile(r'.*[.](cpp|cxx|cc)\Z', re.I).match
fortran_pyf_ext_re = re.compile(r'.*[.](f9... | bsd-3-clause |
mysociety/yournextmp-popit | candidates/management/commands/candidates_add_twitter_images_to_queue.py | 2 | 3763 | from __future__ import print_function, unicode_literals
from django.core.files.temp import NamedTemporaryFile
from django.core.files import File
from django.core.management.base import BaseCommand
from django.db import transaction
from django.utils.translation import ugettext as _
from candidates.models import Multip... | agpl-3.0 |
craynot/django | tests/check_framework/test_security.py | 242 | 17428 | from django.conf import settings
from django.core.checks.security import base, csrf, sessions
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckSessionCookieSecureTest(SimpleTestCase):
@property
def func(self):
from django.core.checks.security.sessions i... | bsd-3-clause |
bpbhat77/xhtml2pdf | demo/cherrypy/demo-cherrypy.py | 154 | 2187 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
#############################################
## (C)opyright by Dirk Holtwick, 2008 ##
## All rights reserved ##
#############################################
import cherrypy as cp
import sx.pisa3 as pisa
import cStringIO as StringIO
try:
im... | apache-2.0 |
egnyte/python-egnyte | egnyte/tests/test_settings.py | 1 | 1292 | """
Test settings API
"""
import unittest
from egnyte import configuration, client
CONFIG_NAME = 'test_config.json'
class TestSettings(unittest.TestCase):
settings = None
def setUp(self):
self.config = configuration.load(CONFIG_NAME)
self.egnyte = client.EgnyteClient(self.config)
def te... | mit |
jhaux/tensorflow | tensorflow/contrib/lookup/lookup_ops.py | 1 | 26445 | # 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 |
joberreiter/pyload | module/plugins/hoster/LolabitsEs.py | 15 | 1594 | # -*- coding: utf-8 -*
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.utils import html_unescape
class LolabitsEs(SimpleHoster):
__name__ = "LolabitsEs"
__type__ = "hoster"
__version__ = "0.03"
__status__ = "testing"
__pattern__ = r'ht... | gpl-3.0 |
Denisolt/IEEE-NYIT-MA | local/lib/python2.7/site-packages/pip/req/req_uninstall.py | 510 | 6897 | from __future__ import absolute_import
import logging
import os
import tempfile
from pip.compat import uses_pycache, WINDOWS, cache_from_source
from pip.exceptions import UninstallationError
from pip.utils import rmtree, ask, is_local, renames, normalize_path
from pip.utils.logging import indent_log
logger = loggin... | gpl-3.0 |
taxpon/sverchok | nodes/modifier_change/holes_fill.py | 3 | 2991 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 is distrib... | gpl-3.0 |
t1g0r/npyscreen | npyscreen/wgcombobox.py | 15 | 3280 | #!/usr/bin/env python
import curses
from . import wgtextbox as textbox
from . import wgmultiline as multiline
from . import fmForm as Form
from . import fmPopup as Popup
from . import wgtitlefield as titlefield
class ComboBox(textbox.Textfield):
ENSURE_STRING_VALUE = False
def __init__(sel... | bsd-2-clause |
unreal666/outwiker | plugins/markdown/markdown/markdown_plugin_libs/pygments/lexers/_openedge_builtins.py | 31 | 48362 | # -*- coding: utf-8 -*-
"""
pygments.lexers._openedge_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the OpenEdgeLexer.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
OPENEDGEKEYWORDS = (
'ABSOLUTE',
'ABS',
... | gpl-3.0 |
villawang/SNAP | src/modules/pylsl/binaries-python2.6-win32/liblsl.py | 24 | 32193 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | bsd-3-clause |
ImAnyOne/SSR-Bash-Python | www/cgi-bin/check_flow.py | 7 | 2715 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import json
import cgi
f = file("/usr/local/shadowsocksr/mudb.json");
json = json.load(f);
# 接受表达提交的数据
form = cgi.FieldStorage()
# 解析处理提交的数据
getport = form['port'].value
#判断端口是否找到
portexist=0
#循环查找端口
for x in json:
#当输入的端口与json端口一样时视为找到
if(str(x[u"port"]) == str(ge... | gpl-3.0 |
donny/mako-mori | external/boto/ec2/networkinterface.py | 2 | 9944 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 |
ZerpaTechnology/AsenZor | static/js/brython/Lib/encodings/cp437.py | 37 | 35262 | """ Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,e... | lgpl-3.0 |
fangohr/ovf2vtk | ovf2vtk/Lib/omfread.py | 1 | 11215 | """Collection of routines used to read and parse the ovf file.
Part of ovf2vtk.
Hans Fangohr, hans.fangohr@physics.org
"""
import sys
import struct
try:
import numpy as Numeric
except ImportError:
print("This program needs Numpy. Please download and install. \
(http://sourceforge.net/projects/numpy).")
... | bsd-2-clause |
3nids/QGIS | python/plugins/db_manager/db_plugins/gpkg/sql_dictionary.py | 71 | 1200 | # -*- coding: utf-8 -*-
"""
***************************************************************************
sql_dictionary.py
---------------------
Date : April 2012
Copyright : (C) 2012 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
************... | gpl-2.0 |
habeanf/Open-Knesset | simple/management/commands/parse_gov_legislation_comm.py | 9 | 5949 | #encoding: utf-8
import urllib2
from BeautifulSoup import BeautifulStoneSoup
import re
import logging
logger = logging.getLogger("open-knesset.parse_gov_legislation_comm")
class ParseGLC:
"""Parse Government Legislation Committee decisions, from their webpage http://www.pmo.gov.il/PMO/vadot/hakika/"""
de... | bsd-3-clause |
DominoTree/servo | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/http11/connection.py | 37 | 13243 | # -*- coding: utf-8 -*-
"""
hyper/http11/connection
~~~~~~~~~~~~~~~~~~~~~~~
Objects that build hyper's connection-level HTTP/1.1 abstraction.
"""
import logging
import os
import socket
import base64
from collections import Iterable, Mapping
import collections
from hyperframe.frame import SettingsFrame
from .respons... | mpl-2.0 |
OpenBeta/beta | tests/test_api_routes.py | 1 | 1343 | import json
from apiserver.model import Route
import utils
def test_post(app, apiusers, db, default_headers, post_geojson):
with app.test_client() as client:
res = client.get('/routes?api_key=' + apiusers['valid'].api_key, default_headers['get'])
assert res.status_code == 200
ret = post_g... | gpl-3.0 |
joyxu/autotest | scheduler/drone_utility_unittest.py | 2 | 2981 | #!/usr/bin/python
"""Tests for drone_utility."""
import unittest
from cStringIO import StringIO
try:
import autotest.common as common
except ImportError:
import common
from autotest.client.shared.settings import settings
from autotest.client.shared.test_utils import mock
from autotest.scheduler import drone_... | gpl-2.0 |
geoserver/wps-remote | src/wpsremote/xmpp_data/configs/myservice/code/test.py | 1 | 3920 | # (c) 2016 Open Source Geospatial Foundation - all rights reserved
# (c) 2014 - 2015 Centre for Maritime Research and Experimentation (CMRE)
# (c) 2013 - 2014 German Aerospace Center (DLR)
# This code is licensed under the GPL 2.0 license, available at the root
# application directory.
import os
import sys
import time... | gpl-2.0 |
milkbikis/powerline-shell | powerline_shell/themes/default.py | 3 | 1896 | class DefaultColor(object):
"""
This class should have the default colors for every segment.
Please test every new segment with this theme first.
"""
# RESET is not a real color code. It is used as in indicator
# within the code that any foreground / background color should
# be cleared
... | mit |
MaDKaTZe/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/loggers/recordpatchevent.py | 119 | 4813 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
ghchinoy/tensorflow | tensorflow/contrib/opt/python/training/model_average_optimizer.py | 3 | 12203 | # 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 |
nii-cloud/dodai-compute | nova/tests/api/openstack/test_users.py | 3 | 5645 | # Copyright 2010 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 required b... | apache-2.0 |
CredoReference/edx-platform | openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py | 64 | 4065 | """
Intended to fix any inconsistencies that may arise during the rollout of the CohortMembership model.
Illustration: https://gist.github.com/efischer19/d62f8ee42b7fbfbc6c9a
"""
from django.core.management.base import BaseCommand
from django.db import IntegrityError
from openedx.core.djangoapps.course_groups.models i... | agpl-3.0 |
Sofcom/treeio | treeio/identities/views.py | 2 | 31419 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Identities module: views
"""
from treeio.identities.identicon import render_identicon
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.http import Htt... | mit |
ajoaoff/django | tests/gis_tests/gdal_tests/test_geom.py | 256 | 20748 | import json
import unittest
from binascii import b2a_hex
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.utils.six.moves import range
from ..test_data import TestDataMixin
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
if... | bsd-3-clause |
guiquanz/Dato-Core | src/unity/python/graphlab/test/test_ec2.py | 13 | 5867 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the DATO-PYTHON-LICENSE file for details.
'''
import ConfigParser
import unittest
import os
import tempfile
from moto import mock_ec2
import boto.ec2
import graphlab
from graph... | agpl-3.0 |
usc-isi/essex-baremetal-support | nova/image/fake.py | 9 | 9002 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# 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 |
rghe/ansible | test/runner/lib/cloud/foreman.py | 19 | 5473 | """Foreman plugin for integration tests."""
from __future__ import absolute_import, print_function
import os
from . import (
CloudProvider,
CloudEnvironment,
)
from ..util import (
find_executable,
display,
)
from ..docker_util import (
docker_run,
docker_rm,
docker_inspect,
docker_... | gpl-3.0 |
gamecredits-project/GameCredits | test/functional/test_framework/blocktools.py | 53 | 3932 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transactions."""
from .mininode import *
from .script import CSc... | mit |
demsey/openenigma2 | recipes/python/python-2.6.2/sitecustomize.py | 228 | 1125 | # OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
# GPLv2 or later
# Version: 20081123
# Features:
# * set proper default encoding
# * enable readline completion in the interactive interpreter
# * load command line history on startup
# * save command line history on exit
i... | mit |
SerenityS/android_kernel_samsung_msm8916 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/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 |
memtoko/django | django/contrib/gis/db/backends/base/models.py | 434 | 7111 | import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redu... | bsd-3-clause |
StevenBlack/phantomjs | src/qt/qtwebkit/Source/WebKit2/Scripts/webkit2/messages.py | 115 | 24325 | # Copyright (C) 2010, 2011 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
shrimpboyho/herblore | pyglet-1.1.4/pyglet/gl/wglext_nv.py | 9 | 71630 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | gpl-2.0 |
kytvi2p/Sigil | 3rdparty/python/Lib/turtledemo/lindenmayer.py | 164 | 2434 | #!/usr/bin/env python3
""" turtle-example-suite:
xtx_lindenmayer_indian.py
Each morning women in Tamil Nadu, in southern
India, place designs, created by using rice
flour and known as kolam on the thresholds of
their homes.
These can be described by Lindenmayer systems,
which can easily be implemented ... | gpl-3.0 |
naziris/HomeSecPi | RControlPanel.py | 1 | 13170 | # /*******************************************************
# *
# * Copyright (C) 2015-2016 Kyriakos Naziris <kyriakos@naziris.co.uk>
# * This is a thesis project of University of Portsmouth.
# *
# * This file is part of HomeSecPi.
# *
# * Feel free to use and modify the source code as long as
# * as you give ... | apache-2.0 |
rvanlaar/easy-transifex | src/transifex/transifex/teams/migrations/0002_add_reviewers_m2m_field.py | 2 | 12304 | # 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 M2M table for field reviewers on 'Team'
db.create_table('teams_team_reviewers', (
('i... | bsd-2-clause |
sarunya-w/CS402-PROJECT | Project/parallel_forest/v01/sctree.py | 2 | 3248 | """
GNU GENERAL PUBLIC LICENSE Version 2
Created on Thu Oct 16 17:33:47 2014
@author: Wasit
"""
from scmaster import mnode
import numpy as np
class tree(mnode):
def settree(self,root=mnode(0,0,0)):
self.theta=root.theta #vector array
self.tau=root.tau #scalar
self.H=root.H #scalar
... | mit |
waprin/gcloud-python | gcloud/monitoring/test_label.py | 6 | 4111 | # Copyright 2016 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 agree... | apache-2.0 |
asadziach/tensorflow | tensorflow/contrib/keras/python/keras/constraints_test.py | 55 | 3896 | # 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 |
Elandril/SickRage | lib/github/RateLimit.py | 74 | 2264 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | gpl-3.0 |
ivaano/zato | code/alembic/versions/0013_6e651e7a3c38_gh265_271_cassandra.py | 7 | 2344 | """gh265-271 Cassandra
Revision ID: 0013_6e651e7a3c38
Revises: 0012_c70a22206a1
Create Date: 2014-06-26 00:44:32
"""
# revision identifiers, used by Alembic.
revision = '0013_6e651e7a3c38'
down_revision = '0012_c70a22206a1'
from alembic import op
import sqlalchemy as sa
# Zato
from zato.common import CASSANDRA
fro... | gpl-3.0 |
HM2MC/Webfront | pylast/pylast.py | 9 | 126818 | # -*- coding: utf-8 -*-
#
# pylast - A Python interface to Last.fm (and other API compatible social networks)
#
# Copyright 2008-2010 Amr Hassan
#
# 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 a... | mit |
ynkjm/ryu | ryu/topology/dumper.py | 61 | 5564 | # Copyright (C) 2013 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 |
google-coral/pycoral | pycoral/pipeline/pipelined_model_runner.py | 1 | 6105 | # Lint as: python3
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 |
naparuba/kunai | data/global-configuration/packs/mongodb/collectors/pymongo/common.py | 17 | 21225 | # Copyright 2011-2015 MongoDB, 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 writi... | mit |
liberorbis/libernext | env/lib/python2.7/site-packages/IPython/core/tests/test_history.py | 7 | 7412 | # coding: utf-8
"""Tests for the IPython tab-completion machinery.
"""
#-----------------------------------------------------------------------------
# Module imports
#-----------------------------------------------------------------------------
# stdlib
import os
import sys
import tempfile
from datetime import dateti... | gpl-2.0 |
CiscoSystems/juju-vem | hooks/charmhelpers/fetch/__init__.py | 6 | 6419 | import importlib
from yaml import safe_load
from charmhelpers.core.host import (
lsb_release
)
from urlparse import (
urlparse,
urlunparse,
)
import subprocess
from charmhelpers.core.hookenv import (
config,
log,
)
import apt_pkg
CLOUD_ARCHIVE = """# Ubuntu Cloud Archive
deb http://ubuntu-cloud.arc... | apache-2.0 |
CanalTP/fabric_navitia | integration_tests/test_kraken/test_single.py | 2 | 4058 | # encoding: utf-8
import pytest
from ..test_common import skipifdev
from ..test_common.test_kraken import (_test_stop_restart_kraken,
_test_stop_start_apache,
_test_test_kraken_nowait_nofail
)
from ..u... | agpl-3.0 |
xzYue/odoo | addons/purchase_requisition/__init__.py | 378 | 1072 | ##############################################################################
#
# 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 Affero General Publ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.