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 |
|---|---|---|---|---|---|
0x46616c6b/ansible | lib/ansible/plugins/action/iosxr.py | 15 | 4388 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
TalShafir/ansible | contrib/inventory/rax.py | 27 | 16821 | #!/usr/bin/env python
# (c) 2013, Jesse Keating <jesse.keating@rackspace.com,
# Paul Durivage <paul.durivage@rackspace.com>,
# Matt Martz <matt@sivel.net>
#
# 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 Pu... | gpl-3.0 |
nttks/edx-platform | biz/djangoapps/ga_login/tests/test_views.py | 1 | 37037 | import ddt
import json
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.utils.crypto import get_random_string
from biz.djangoapps.ga_contract.models import ContractAuth
from biz.djangoapps.ga_invitation.mod... | agpl-3.0 |
3lnc/elasticsearch-dsl-py | test_elasticsearch_dsl/test_integration/test_index.py | 1 | 3113 | from elasticsearch_dsl import Document, Index, Text, Keyword, Date, analysis, IndexTemplate
class Post(Document):
title = Text(analyzer=analysis.analyzer('my_analyzer', tokenizer='keyword'))
published_from = Date()
def test_index_template_works(write_client):
it = IndexTemplate('test-template', 'test-*')
... | apache-2.0 |
sarthakmeh03/django | tests/sitemaps_tests/test_utils.py | 11 | 1832 | from django.contrib.sitemaps import (
SitemapNotFound, _get_sitemap_full_url, ping_google,
)
from django.core.exceptions import ImproperlyConfigured
from django.test import mock, modify_settings, override_settings
from django.utils.six.moves.urllib.parse import urlencode
from .base import SitemapTestsBase
class ... | bsd-3-clause |
sarthakmeh03/django | tests/update/models.py | 282 | 1196 | """
Tests for the update() queryset method that allows in-place, multi-object
updates.
"""
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class DataPoint(models.Model):
name = models.CharField(max_length=20)
... | bsd-3-clause |
jesramirez/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 |
OsirisSPS/osiris-sps | client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/bsddb/test/test_queue.py | 75 | 4118 | """
TestCases for exercising a Queue DB.
"""
import os, string
from pprint import pprint
import unittest
from test_all import db, verbose, get_new_database_path
#----------------------------------------------------------------------
class SimpleQueueTestCase(unittest.TestCase):
def setUp(self):
self.fil... | gpl-3.0 |
stefan-caraiman/cloudbase-init-ci | argus/config/ci.py | 1 | 5208 | # Copyright 2016 Cloudbase Solutions Srl
#
# 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 l... | apache-2.0 |
bijandhakal/pattern | examples/03-en/03-parse.py | 21 | 2095 | import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.en import parse, pprint, tag
# The en module contains a fast regular expressions-based parser.
# A parser identifies words in a sentence, word part-of-speech tags (e.g. noun, verb)
# and groups of words that belong to... | bsd-3-clause |
rlkelly/StockPy | Test/StockPy_HMM.py | 3 | 4878 | import pandas.io.data as web
import datetime as dt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.widgets as wd
import sklearn.hmm as lrn
def stkHMM(lrndata, n_components):
model = lrn.GaussianHMM(n_components, covariance_type="tied", n_iter=20)
model.fit([lrndata])
... | gpl-2.0 |
shastah/spacewalk | client/tools/rhncfg/config_common/cfg_exceptions.py | 17 | 1790 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
devs1991/test_edx_docmode | lms/djangoapps/verified_track_content/tests/test_forms.py | 28 | 1632 | """
Test for forms helpers.
"""
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from verified_track_content.forms import VerifiedTrackCourseForm
class TestVerifiedTrackCourseForm(SharedModuleStoreTestCase):
"""
Test fo... | agpl-3.0 |
priorknowledge/loom | loom/test/test_crossvalidate.py | 1 | 1686 | # Copyright (c) 2014, Salesforce.com, 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... | bsd-3-clause |
ravimalik20/CryptoLibSHA-256 | Testing/test.py | 1 | 3109 | #! /usr/bin/python
#/*==========================================================================================
#||
#|| Copyright (C) 2013 Ravi Malik
#||
#|| 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 So... | gpl-2.0 |
tonytan4ever/canary | canary/tasks/taskflow/driver.py | 1 | 3783 | # Copyright (c) 2015 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
guorendong/iridium-browser-ubuntu | third_party/mesa/src/scons/llvm.py | 12 | 8552 | """llvm
Tool-specific initialization for LLVM
"""
#
# Copyright (c) 2009 VMware, Inc.
#
# 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 ... | bsd-3-clause |
makermade/arm_android-19_arm-linux-androideabi-4.8 | lib/python2.7/email/mime/message.py | 573 | 1286 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Class representing message/* MIME documents."""
__all__ = ['MIMEMessage']
from email import message
from email.mime.nonmultipart import MIMENonMultipart
class MIMEMessage(MIMENonMultipart):
"""Class... | gpl-2.0 |
TUBAME/migration-tool | src/tubame.portability/resources/tubame-search-modules/src/migration/jbmst_search_java.py | 2 | 11779 | # -*- coding: utf-8 -*-
"""
jbmst_search_java.py
Created on 2013/06/28
Copyright (C) 2011-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:... | apache-2.0 |
jiegec/gnuradio | gr-wxgui/python/wxgui/waterfallsink2.py | 92 | 1483 | #
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
matsumoto-r/synciga | src/third_party/jsoncpp/source/makerelease.py | 169 | 15483 | """Tag the sandbox for release, make source and doc tarballs.
Requires Python 2.6
Example of invocation (use to test the script):
python makerelease.py --platform=msvc6,msvc71,msvc80,msvc90,mingw -ublep 0.6.0 0.7.0-dev
When testing this script:
python makerelease.py --force --retag --platform=msvc6,msvc71,msvc80,min... | bsd-3-clause |
bop/foundation | lib/python2.7/site-packages/django/http/__init__.py | 41 | 30763 | from __future__ import absolute_import
import datetime
import os
import re
import sys
import time
import warnings
from pprint import pformat
from urllib import urlencode, quote
from urlparse import urljoin, urlparse
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
... | gpl-2.0 |
ATIX-AG/ansible | lib/ansible/modules/network/f5/bigip_smtp.py | 18 | 16716 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
dikien/Machine-Learning-Newspaper | nytimes/step4_analysis_unsupervised_2.py | 1 | 3602 | # -*- coding: UTF-8 -*-
from sklearn.metrics import accuracy_score
from time import time
import numpy as np
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import preprocessing
from sklearn.feature_selection import SelectPercentile, f_classif, chi2
import matplotlib.pyplot as plt... | bsd-3-clause |
burnpanck/chaco | chaco/colormapped_selection_overlay.py | 3 | 6043 | """ Defines the ColormappedSelectionOverlay class.
"""
from numpy import logical_and
# Enthought library imports
from traits.api import Any, Bool, Float, Instance, Property, Enum
# Local imports
from abstract_overlay import AbstractOverlay
from colormapped_scatterplot import ColormappedScatterPlot
class ColormappedS... | bsd-3-clause |
lgeiger/ide-python | lib/debugger/VendorLib/vs-py-debugger/pythonFiles/jedi/debug.py | 8 | 3428 | from jedi._compatibility import encoding, is_py3, u
import os
import time
def _lazy_colorama_init():
"""
Lazily init colorama if necessary, not to screw up stdout is debug not
enabled.
This version of the function does nothing.
"""
pass
_inited=False
try:
if os.name == 'nt':
# Do... | mit |
boundarydevices/android_external_chromium_org | tools/perf/page_sets/startup_pages.py | 9 | 1474 | # 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.
# pylint: disable=W0401,W0614
from telemetry.page.actions.all_page_actions import *
from telemetry.page import page as page_module
from telemetry.page import ... | bsd-3-clause |
kuiwei/edx-platform | lms/djangoapps/courseware/tests/test_view_authentication.py | 12 | 17212 | import datetime
import pytz
from mock import patch
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
# Need access to internal func to put users in the right group
from courseware.access import has_access
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCa... | agpl-3.0 |
rxwen/local_wget_site_converter | bs4/builder/_lxml.py | 36 | 6297 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
TreeBuilder,
XML)
from b... | mit |
cswiercz/sympy | sympy/integrals/tests/test_failing_integrals.py | 71 | 3488 | # A collection of failing integrals from the issues.
from __future__ import division
from sympy import (
integrate, Integral, exp, oo, pi, sign, sqrt, sin, cos,
tan, S, log, gamma, sinh,
)
from sympy.utilities.pytest import XFAIL, SKIP, slow, skip, ON_TRAVIS
from sympy.abc import x, k, c, y, R, b, h, a, m
... | bsd-3-clause |
android-ia/platform_external_chromium_org | native_client_sdk/src/build_tools/tests/test_server.py | 170 | 2165 | # Copyright (c) 2012 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 multiprocessing
import os
import SimpleHTTPServer
class LocalHTTPServer(object):
"""Class to start a local HTTP server as a child process."""
... | bsd-3-clause |
waseem18/oh-mainline | vendor/packages/PyYaml/tests/lib/test_canonical.py | 60 | 1135 |
import yaml, canonical
def test_canonical_scanner(canonical_filename, verbose=False):
data = open(canonical_filename, 'rb').read()
tokens = list(yaml.canonical_scan(data))
assert tokens, tokens
if verbose:
for token in tokens:
print token
test_canonical_scanner.unittest = ['.canon... | agpl-3.0 |
Achuth17/scikit-learn | sklearn/neighbors/setup.py | 308 | 1219 | import os
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('neighbors', parent_package, top_path)
libraries = []
if os.name == 'posix':
libraries.append('m')
config.add_extension('ball_tree',
... | bsd-3-clause |
stanxii/ngb | node.js/app/bower_components/socket.io/support/expresso/deps/jscoverage/js/build/win32/pgomerge.py | 79 | 1628 | #!/usr/bin/python
# Usage: pgomerge.py <binary basename> <dist/bin>
# Gathers .pgc files from dist/bin and merges them into
# $PWD/$basename.pgd using pgomgr, then deletes them.
# No errors if any of these files don't exist.
import sys, os, os.path, subprocess
if not sys.platform == "win32":
raise Exception("This ... | mit |
raajitr/django_hangman | env/lib/python2.7/site-packages/rest_framework/decorators.py | 20 | 4560 | """
The most important decorator in this module is `@api_view`, which is used
for writing function-based views with REST framework.
There are also various decorators for setting the API policies on function
based views, as well as the `@detail_route` and `@list_route` decorators, which are
used to annotate methods on ... | mit |
DreadPirateRobert/stock_visualiser | stock_visualiser_virtualenv/lib/python3.5/site-packages/pip/vcs/__init__.py | 344 | 12374 | """Handles all VCS (version control) support"""
from __future__ import absolute_import
import errno
import logging
import os
import shutil
import sys
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.exceptions import BadCommand
from pip.utils import (display_path, backup_dir, call_subprocess,
... | mit |
JI007/flasky | app/auth/views.py | 2 | 5996 | from flask import render_template, redirect, request, url_for, flash
from flask.ext.login import login_user, logout_user, login_required, \
current_user
from . import auth
from .. import db
from ..models import User
from ..email import send_email
from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\
... | mit |
kevinmel2000/sl4a | python/src/Lib/plat-mac/Carbon/Folders.py | 81 | 9308 | # Generated from 'Folders.h'
def FOUR_CHAR_CODE(x): return x
true = True
false = False
kOnSystemDisk = -32768L
kOnAppropriateDisk = -32767
kSystemDomain = -32766
kLocalDomain = -32765
kNetworkDomain = -32764
kUserDomain = -32763
kClassicDomain = -32762
kCreateFolder = true
kDontCreateFolder = false
kSystemFolderType =... | apache-2.0 |
facebookresearch/ParlAI | parlai/chat_service/services/websocket/websocket_manager.py | 1 | 10460 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Websocket Manager Module Contains implementation of the WebsocketManager which helps run
ParlAI via websockets.
"""
i... | mit |
xsyntrex/selenium | py/test/selenium/webdriver/common/interactions_tests.py | 3 | 8356 | # 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 |
40223211/cadpw16 | wsgi/pybean.py | 562 | 8617 | #coding: utf-8
import sqlite3
from pkg_resources import parse_version
__version__ = "0.2.1"
__author__ = "Mickael Desfrenes"
__email__ = "desfrenes@gmail.com"
# Yen 2013.04.08, 將 Python2 的 .next() 改為 next(), 以便在 Python 3 中使用
class SQLiteWriter(object):
"""
In frozen mode (the default), the writer will not a... | gpl-3.0 |
Glorf/servo | tests/wpt/css-tests/css-text-decor-3_dev/html/support/generate-text-emphasis-position-property-tests.py | 841 | 3343 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-position-property-001 ~ 006
which cover all possible values of text-emphasis-position property with
all combination of three main writing modes and two orientations. Only
test files are generated by this script. It also out... | mpl-2.0 |
dmitry-r/incubator-airflow | airflow/contrib/auth/backends/ldap_auth.py | 22 | 10752 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
chennqqi/splayer | Test/Update_Unittest/web/scripts/patchgen.py | 18 | 2508 | #!/usr/bin/python
#create patch files for ShooterPlayer
#
#
#
import glob
import optparse
import os
import re
import shutil
import sys
import hashlib
import subprocess
def filemd5(fileName):
m = hashlib.md5()
try:
fd = open(fileName,"rb")
except IOError:
print "Unabl... | gpl-2.0 |
bastibl/gnuradio | gr-blocks/python/blocks/qa_mute.py | 7 | 3056 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or... | gpl-3.0 |
zhuwenping/python-for-android | python-build/python-libs/gdata/tests/gdata_tests/apps_test.py | 128 | 22040 | #!/usr/bin/python
#
# Copyright (C) 2007 SIOS Technology, 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 appli... | apache-2.0 |
blueskycoco/sam | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
affo/nova | nova/tests/unit/compute/test_compute_mgr.py | 2 | 164687 | # 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
# d... | apache-2.0 |
AudioGod/DTS-Eagle-Integration_CAF-Android-kernel | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
pythonprobr/pythonpro-website | pythonpro/domain/tests/test_topic_interaction_aggregate.py | 1 | 3504 | from datetime import datetime
from typing import List
import pytest
import pytz
from django.urls import reverse
from django.utils import timezone
from freezegun import freeze_time
from model_bakery import baker
from pythonpro.dashboard.models import TopicInteraction
from pythonpro.dashboard.templatetags.dashboard_tag... | agpl-3.0 |
mzizzi/aenea | server/osx/server_osx.py | 1 | 16816 | #!/usr/bin/python
# This file is part of Aenea
#
# Aenea is free software: you can redistribute it and/or modify it under
# the terms of version 3 of the GNU Lesser General Public License as
# published by the Free Software Foundation.
#
# Aenea is distributed in the hope that it will be useful, but WITHOUT
# ANY WARR... | lgpl-3.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/build/gyp/test/intermediate_dir/gyptest-intermediate-dir.py | 243 | 1398 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... | apache-2.0 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/ctypes-1.0.2/ctypes/test/test_strings.py | 15 | 6775 | import unittest
from ctypes import *
class StringArrayTestCase(unittest.TestCase):
def test(self):
BUF = c_char * 4
buf = BUF("a", "b", "c")
self.failUnlessEqual(buf.value, "abc")
self.failUnlessEqual(buf.raw, "abc\000")
buf.value = "ABCD"
self.failUnlessEqual(buf.... | apache-2.0 |
codeforberlin/wfs-downloader | wfs_downloader/download.py | 1 | 4730 | from __future__ import print_function
import argparse
import os
import yaml
import sys
try:
# py2
from urllib import urlretrieve
import urllib
except ImportError:
# py3
from urllib.request import urlretrieve
import urllib.request
from lxml import etree
def main():
parser = argparse.Argu... | mit |
ErikKringen/kafka | tests/kafkatest/services/zookeeper.py | 8 | 5816 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
rossburton/yocto-autobuilder | lib/python2.7/site-packages/python_dateutil-1.5-py2.7.egg/dateutil/tzwin.py | 304 | 5828 | # This code was originally contributed by Jeffrey Harris.
import datetime
import struct
import _winreg
__author__ = "Jeffrey Harris & Gustavo Niemeyer <gustavo@niemeyer.net>"
__all__ = ["tzwin", "tzwinlocal"]
ONEWEEK = datetime.timedelta(7)
TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
TZ... | gpl-2.0 |
capsid/capsid-pipeline | setup.py | 1 | 1980 | #!/usr/bin/env python
# Copyright 2011(c) The Ontario Institute for Cancer Reserach. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the GNU Public License v3.0.
#
# You should have received a copy of the GNU General Public License along with
# this program... | gpl-3.0 |
miaoski/stemtokstop | tinysegmenter.py | 2 | 23035 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript
# (c) 2008 Taku Kudo <taku@chasen.org>
# TinySegmenter is freely distributable under the terms of a new BSD licence.
# For details, see http://lilyx.net/pages/tinysegmenter_licence.txt
# "TinySegmenter... | apache-2.0 |
MattFaus/CrowdTube-Connector | lib/gdata-2.0.18/tests/all_tests_cached.py | 41 | 1091 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | mit |
belokop-an/agenda-tools | code/MaKaC/webinterface/pages/links.py | 1 | 7493 | import MaKaC.webinterface.wcomponents as wcomponents
import MaKaC.webinterface.urlHandlers as urlHandlers
import MaKaC.webinterface.navigation as navigation
from MaKaC.webinterface.pages.conferences import WPConferenceBase,WPConferenceDefaultDisplayBase
class WPLinkBase( WPConferenceBase ):
def __init__( sel... | gpl-2.0 |
OpenWhere/scrapy | scrapy/middleware.py | 68 | 2901 | import logging
from collections import defaultdict
from scrapy.exceptions import NotConfigured
from scrapy.utils.misc import load_object
from scrapy.utils.defer import process_parallel, process_chain, process_chain_both
logger = logging.getLogger(__name__)
class MiddlewareManager(object):
"""Base class for impl... | bsd-3-clause |
GeorgEncinas/backtraking | path/generation_data.py | 1 | 2555 | import numpy as np
from dfs.vertex import Vertex
from dfs.edge import Edge
from dfs.graph import Graph
class Generator_Data():
def __init__(self):
self.graph = Graph()
self.come_back = False
def generate_node(self, data):
'''
data_sensor = data["distance_sensor"]
time ... | mit |
heat-extras/heat-lib | lib/boot-config/elements/heat-config-cfn-init/install.d/hook-cfn-init.py | 11 | 2527 | #!/usr/bin/env python
#
# 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 |
zstackio/zstack-utility | bm-instance-agent/bm_instance_agent/api/controllers/v2/__init__.py | 1 | 1632 | from pecan import expose
from pecan.rest import RestController
from bm_instance_agent.api.controllers.v2 import console
from bm_instance_agent.api.controllers.v2 import default_route
from bm_instance_agent.api.controllers.v2 import nic
from bm_instance_agent.api.controllers.v2 import password
from bm_instance_agent.ap... | apache-2.0 |
popazerty/bnigma2 | lib/python/Screens/Screen.py | 14 | 4499 | from Tools.Profile import profile
profile("LOAD:GUISkin")
from Components.GUISkin import GUISkin
profile("LOAD:Source")
from Components.Sources.Source import Source
profile("LOAD:GUIComponent")
from Components.GUIComponent import GUIComponent
profile("LOAD:eRCInput")
from enigma import eRCInput
class Screen(dict, GUI... | gpl-2.0 |
EricNeedham/assignment-1 | venv/lib/python2.7/site-packages/jinja2/testsuite/security.py | 415 | 6204 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.security
~~~~~~~~~~~~~~~~~~~~~~~~~
Checks the sandbox and other security features.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import E... | mit |
tensorflow/neural-structured-learning | research/carls/dynamic_embedding_ops_test.py | 1 | 10884 | # 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 agreed to in writing, ... | apache-2.0 |
rlindner81/pyload | module/plugins/hoster/PromptfileCom.py | 1 | 1896 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster
class PromptfileCom(SimpleHoster):
__name__ = "PromptfileCom"
__type__ = "hoster"
__version__ = "0.18"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?promptfile\.com/'
__config__ = [("... | gpl-3.0 |
wangd/rhythmbox | plugins/jamendo/JamendoConfigureDialog.py | 1 | 1924 | # -*- coding: utf-8 -*-
# JamendoConfigureDialog.py
#
# Copyright (C) 2007 - Guillaume Desmottes
#
# 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, or (at your option)
# any la... | gpl-2.0 |
CoolCloud/python-oauth2 | docs/examples/base_server.py | 5 | 2404 | from wsgiref.simple_server import make_server
import oauth2
import oauth2.grant
import oauth2.error
import oauth2.store.memory
import oauth2.tokengenerator
import oauth2.web.wsgi
# Create a SiteAdapter to interact with the user.
# This can be used to display confirmation dialogs and the like.
class ExampleSiteAdapter... | mit |
kamijawa/ogc_server | soap_server.py | 2 | 4194 | # -*- coding: utf-8 -*-
import os, sys
import json
import datetime
from gevent import pywsgi
import gevent
from pysimplesoap.server import SoapDispatcher, WSGISOAPHandler
import exceptions
import time
import socket
import urllib, urllib2, urlparse
from socket import error
import errno
import cgi
import configobj
from l... | mit |
twobob/buildroot-kindle | output/build/host-python-2.7.2/Lib/sets.py | 262 | 19050 | """Classes to represent arbitrary sets (including sets of sets).
This module implements sets using dictionaries whose values are
ignored. The usual operations (union, intersection, deletion, etc.)
are provided as both methods and operators.
Important: sets are not sequences! While they support 'x in s',
'len(s)', a... | gpl-2.0 |
mozilla/MozDef | alerts/lib/celery_scheduler/periodic_task.py | 3 | 4871 | # Copyright 2013 Regents of the University of Michigan
# 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
import datetime
import celery.schedules
from ... | mpl-2.0 |
mpasternak/pyglet-fix-issue-552 | pyglet/gl/glu.py | 45 | 25679 | # ----------------------------------------------------------------------------
# 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:
#
# * Redistribu... | bsd-3-clause |
Donkyhotay/MoonPy | zope/i18n/locales/tests/test_docstrings.py | 1 | 1459 | ##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | gpl-3.0 |
apollo13/ansible | test/integration/targets/old_style_cache_plugins/plugins/cache/redis.py | 83 | 4391 | # (c) 2014, Brian Coca, Josh Drake, et al
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
cache: redis
short_description: Use Redis... | gpl-3.0 |
coberger/DIRAC | Workflow/Modules/UploadOutputs.py | 5 | 3457 | # ##WARNING###WARNING###WARNING###WARNING###WARNING###WARNING###WARNING###WARNING###WARNING###WARNING###WARNING #
# Under development #
# ##WARNING###WARNING###WARNING###WARNING###WARNING###WARNING###WARNING###WARNING###WARNING#... | gpl-3.0 |
omefire/bitcoin | qa/rpc-tests/rpcbind_test.py | 120 | 5610 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test for -rpcbind, as well as -rpcallowip and -rpcconnect
# Add python-bitcoinrpc to module search path:
im... | mit |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-irix6/AL.py | 16 | 1478 | RATE_48000 = 48000
RATE_44100 = 44100
RATE_32000 = 32000
RATE_22050 = 22050
RATE_16000 = 16000
RATE_11025 = 11025
RATE_8000 = 8000
SAMPFMT_TWOSCOMP= 1
SAMPFMT_FLOAT = 32
SAMPFMT_DOUBLE = 64
SAMPLE_8 = 1
SAMPLE_16 = 2
# SAMPLE_24 is the low 24 bits of a long,... | gpl-2.0 |
flavour/cedarbluff | modules/facebook.py | 16 | 20141 | #!/usr/bin/env python
#
# Copyright 2010 Facebook
#
# 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... | mit |
prefetchnta/questlab | bin/x64bin/python/36/Lib/unittest/case.py | 1 | 58415 | """Test case implementation"""
import sys
import functools
import difflib
import logging
import pprint
import re
import warnings
import collections
import contextlib
import traceback
from . import result
from .util import (strclass, safe_repr, _count_diff_all_purpose,
_count_diff_has... | lgpl-2.1 |
lamby/pkg-python-django-debug-toolbar | debug_toolbar/panels/redirects.py | 9 | 1482 | from __future__ import absolute_import, unicode_literals
from django.core.handlers.wsgi import STATUS_CODE_TEXT
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import Panel
class RedirectsPanel(Panel):
"""
Panel that intercepts redirects ... | bsd-3-clause |
JFriel/honours_project | venv/lib/python2.7/site-packages/nltk/metrics/paice.py | 7 | 14427 | # Natural Language Toolkit: Agreement Metrics
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Lauri Hallila <laurihallila@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
#
"""Counts Paice's performance statistics for evaluating stemming algorithms.
What is required:
- A dictionary ... | gpl-3.0 |
avalentino/qtsix | qtsix/uic.py | 1 | 3628 | # -*- coding: utf-8 -*-
# Copyright (c) 2011-2015 Antonio Valentino <antonio.valentino@tiscali.it>
# 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... | bsd-3-clause |
jjo31/ATHAM-Fluidity | python/GFD_basisChange_tools.py | 6 | 16085 | # Copyright (C) 2012 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a full list
# of copyright holders.
#
# Prof. C Pain
# Applied Modelling and Computation Group
# Department of Earth Science and Engineering
# Imperial College London
#
# ... | lgpl-2.1 |
adrienbrault/home-assistant | homeassistant/components/hangouts/const.py | 7 | 2415 | """Constants for Google Hangouts Component."""
import voluptuous as vol
from homeassistant.components.notify import ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET
import homeassistant.helpers.config_validation as cv
DOMAIN = "hangouts"
CONF_2FA = "2fa"
CONF_AUTH_CODE = "authorization_code"
CONF_REFRESH_TOKEN = "refresh_token"... | mit |
yigepodan/robotframework-selenium2library | test/lib/mockito/mockito.py | 70 | 3297 | #!/usr/bin/env python
# coding: utf-8
import verification
from mocking import mock, TestDouble
from mock_registry import mock_registry
from verification import VerificationError
__copyright__ = "Copyright 2008-2010, Mockito Contributors"
__license__ = "MIT"
__maintainer__ = "Mockito Maintainers"
__email__ = "mockito-... | apache-2.0 |
npadmana/filehandler | ndfilehandler.py | 1 | 2625 | #
# Python code to read and write "filehander files", which are
# simply directories with files in them for each "keyword".
#
from __future__ import print_function
__author__ = "Martin White"
__version__ = "1.0"
__email__ = "mwhite@berkeley.edu"
import numpy as N
import glob
import re
import os
def read_file_help... | mit |
aseemmittal/LibreHatti | src/librehatti/prints/helper.py | 5 | 1184 | #To convert digits into words
def num2eng(n):
"""
This function converts numerals into words.
argument:number
return:words
"""
words = ''
units = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven',
'Eight', 'Nine','Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen',
... | gpl-2.0 |
gtko/Sick-Beard | lib/requests/packages/urllib3/exceptions.py | 65 | 1979 | # urllib3/exceptions.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
... | gpl-3.0 |
jiankers/weevely3 | modules/net/curl.py | 12 | 5302 | from core.vectors import PhpCode, ShellCmd, ModuleExec, PhpFile, Os
from core.module import Module
from core import modules
from core import messages
from core.loggers import log
import os
class Curl(Module):
"""Perform a curl-like HTTP request."""
aliases = [ 'curl' ]
def init(self):
self.regi... | gpl-3.0 |
arunsingh/selenium | py/selenium/webdriver/remote/webelement.py | 20 | 17448 | # 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 |
mfalesni/cfme_tests | cfme/tests/physical_infrastructure/ui/test_physical_server_list.py | 2 | 2062 | # -*- coding: utf-8 -*-
import pytest
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.physical.provider.lenovo import LenovoProvider
pytestmark = [pytest.mark.tier(3), pytest.mark.provider([LenovoProvider], scope="module")]
@pytest.fixture(scope="module")
def physical_server_collection(app... | gpl-2.0 |
simod/geonode | geonode/base/migrations/0029_auto_20171114_0341.py | 7 | 3099 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0028_resourcebase_is_approved'),
]
operations = [
migrations.AlterField(
model_name='resourcebase',
... | gpl-3.0 |
gabeharms/firestorm | indra/llcorehttp/tests/test_llcorehttp_peer.py | 2 | 14000 | #!/usr/bin/env python
"""\
@file test_llsdmessage_peer.py
@author Nat Goodspeed
@date 2008-10-09
@brief This script asynchronously runs the executable (with args) specified on
the command line, returning its result code. While that executable is
running, we provide dummy local services for use by C... | lgpl-2.1 |
dermute/ansible | lib/ansible/plugins/lookup/env.py | 251 | 1071 | # (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | gpl-3.0 |
neumerance/cloudloon2 | horizon/test/helpers.py | 9 | 7377 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
jotes/boto | tests/unit/cloudformation/test_stack.py | 114 | 9168 | #!/usr/bin/env python
import datetime
import xml.sax
import unittest
import boto.handler
import boto.resultset
import boto.cloudformation
SAMPLE_XML = b"""
<DescribeStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
<DescribeStacksResult>
<Stacks>
<member>
<Tags>
... | mit |
programadorjc/django | tests/gis_tests/geos_tests/test_geos_mutation.py | 183 | 5388 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
import unittest
from unittest import skipUnless
from django.contrib.gis.geos import (
HAS_GEOS, LinearRing, LineString, MultiPoint, Point, P... | bsd-3-clause |
libvirt/autotest | client/common_lib/enum.py | 12 | 1928 | """\
Generic enumeration support.
"""
__author__ = 'showard@google.com (Steve Howard)'
class Enum(object):
"""\
Utility class to implement Enum-like functionality.
>>> e = Enum('String one', 'String two')
>>> e.STRING_ONE
0
>>> e.STRING_TWO
1
>>> e.choices()
[(0, 'String one'), (1... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.