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 |
|---|---|---|---|---|---|
inspyration/odoo | openerp/addons/base/ir/ir_needaction.py | 455 | 2704 | # -*- 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 |
ntt-sic/cinder | cinder/tests/test_wsgi.py | 3 | 10311 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
adviti/melange | thirdparty/google_appengine/google/appengine/_internal/django/core/mail/message.py | 23 | 11568 | import mimetypes
import os
import random
import time
from email import Charset, Encoders
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from email.Utils import formatdate, getaddresses, formataddr
from google.appengi... | apache-2.0 |
MyKings/xunfeng | vulscan/vuldb/crack_jenkins.py | 2 | 3299 | # coding:utf-8
# author:wolf
import urllib2
import re
import json
def get_plugin_info():
plugin_info = {
"name": "Jenkins控制台弱口令",
"info": "攻击者通过此漏洞可以访问查看项目代码信息,通过script功能可执行命令直接获取服务器权限。",
"level": "高危",
"type": "弱口令",
"author": "wolf@YSRC",
"url": "https://www.secpul... | gpl-3.0 |
TaliesinSkye/evennia | src/typeclasses/models.py | 1 | 52630 | """
This is the *abstract* django models for many of the database objects
in Evennia. A django abstract (obs, not the same as a Python metaclass!) is
a model which is not actually created in the database, but which only exists
for other models to inherit from, to avoid code duplication. Any model can
import and inherit... | bsd-3-clause |
maloep/romcollectionbrowser | resources/lib/xbmc.py | 1 | 35342 | ## @package xbmc
# Various classes and functions to interact with XBMC.
#
"""
Various classes and functions to interact with Kodi.
"""
from builtins import str
from builtins import object
import os
import xbmcgui as _xbmcgui
_loglevel = 1
_settings = {'external_filemanaging': 'true'}
_filename = 'dummy.l... | gpl-2.0 |
jaredly/pyjamas | pygtkweb/demos/047-treeviewdnd.py | 13 | 4001 | #!/usr/bin/env python
# example treeviewdnd.py
import pygtk
pygtk.require('2.0')
import gtk
class TreeViewDnDExample:
TARGETS = [
('MY_TREE_MODEL_ROW', gtk.TARGET_SAME_WIDGET, 0),
('text/plain', 0, 1),
('TEXT', 0, 2),
('STRING', 0, 3),
]
# close the window and quit
... | apache-2.0 |
dhorelik/django-cms | cms/admin/forms.py | 35 | 30651 | # -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth import get_user_model, get_permission_codename
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.exceptions import Validation... | bsd-3-clause |
AnimeshSinha1309/WebsiteEdunet | WebsiteEdunet/env/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py | 317 | 6189 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def _b64_decode... | mit |
tactcomplabs/gc64-hmcsim | test/sst/6.0.0/goblin_singlestream2.py | 1 | 2128 | import sst
# Define SST core options
sst.setProgramOption("timebase", "1ps")
sst.setProgramOption("stopAtCycle", "0 ns")
# Define the simulation components
comp_cpu = sst.Component("cpu", "miranda.BaseCPU")
comp_cpu.addParams({
"verbose" : 0,
"generator" : "miranda.SingleStreamGenerator",
"generatorParams.verbose"... | bsd-2-clause |
cordoval/myhdl-python | example/cookbook/stopwatch/TimeCount.py | 6 | 1628 | from myhdl import *
def TimeCount(tens, ones, tenths, startstop, reset, clock):
""" 3 digit time counter in seconds and tenths of a second.
tens: most significant digit of the seconds
ones: least significant digit of the seconds
tenths: tenths of a second
startstop: input that starts or stops the... | lgpl-2.1 |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/sklearn/neighbors/graph.py | 208 | 7031 | """Nearest Neighbors graph functions"""
# Author: Jake Vanderplas <vanderplas@astro.washington.edu>
#
# License: BSD 3 clause (C) INRIA, University of Amsterdam
import warnings
from .base import KNeighborsMixin, RadiusNeighborsMixin
from .unsupervised import NearestNeighbors
def _check_params(X, metric, p, metric_... | gpl-2.0 |
cntnboys/cmput410-project | venv/lib/python2.7/site-packages/setuptools/tests/test_develop.py | 148 | 2816 | """develop tests
"""
import os
import shutil
import site
import sys
import tempfile
from setuptools.command.develop import develop
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo',
packages=['foo'],
use_2to3=True,
)
"""
INIT_PY = """print "foo"
"""
clas... | apache-2.0 |
sudarkoff/ansible | test/units/playbook/test_taggable.py | 293 | 4452 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
ManjiriBirajdar/coala | tests/misc/ShellTest.py | 11 | 3511 | from contextlib import ExitStack
import os
import sys
from tempfile import NamedTemporaryFile
import unittest
from coalib.misc.Shell import run_interactive_shell_command, run_shell_command
class RunShellCommandTest(unittest.TestCase):
@staticmethod
def construct_testscript_command(scriptname):
retur... | agpl-3.0 |
ananthonline/grpc | tools/distrib/python/submit.py | 44 | 3760 | #!/usr/bin/env python2.7
# Copyright 2015, 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 lis... | bsd-3-clause |
Titulacion-Sistemas/PythonTitulacion-EV | Lib/site-packages/pywin32-219-py2.7-win32.egg/test/test_win32wnet.py | 17 | 5947 | import unittest
import win32wnet
import win32api
import netbios
from pywin32_testutil import str2bytes
RESOURCE_CONNECTED = 0x00000001
RESOURCE_GLOBALNET = 0x00000002
RESOURCE_REMEMBERED = 0x00000003
RESOURCE_RECENT = 0x00000004
RESOURCE_CONTEXT = 0x00000005
RESOURCETYPE_ANY = 0x00000000
RESOURCETYPE_DISK = 0x0000000... | mit |
pombredanne/django-tenant-schemas | examples/tenant_tutorial/customers/views.py | 9 | 1718 | from django.contrib.auth.models import User
from django.db.utils import DatabaseError
from django.views.generic import FormView
from customers.forms import GenerateUsersForm
from customers.models import Client
from random import choice
class TenantView(FormView):
form_class = GenerateUsersForm
template_name =... | mit |
thaskell1/volatility | volatility/plugins/linux/enumerate_files.py | 12 | 2031 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
jazkarta/edx-platform-for-isc | cms/djangoapps/contentstore/features/grading.py | 12 | 6983 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from common import *
from terrain.steps import reload_the_page
from selenium.common.exceptions import InvalidElementStateException
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from contentstore.u... | agpl-3.0 |
Lyleo/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/python3/docutils/parsers/rst/languages/en.py | 4 | 3277 | # $Id$
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each language: one in docutils/langua... | mit |
be-cloud-be/horizon-addons | horizon/school_course_description/__init__.py | 1 | 1024 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2015 be-cloud.be
# Jerome Sonnet <jerome.sonnet@be-cloud.be>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
dmerejkowsky/twittback | twittback/test/test_edit.py | 1 | 1694 | import types
import twittback.edit
import pytest
def setup_edit_test(tweet_factory, repository, mocker, *, nvim_returncode):
tweet_1 = tweet_factory.make_tweet(42, "First tweet!", date="2017-07-07")
tweet_2 = tweet_factory.make_tweet(57, "Second tweet", date="2017-08-02")
repository.add_tweets([tweet_1,... | mit |
rhcarvalho/kombu | kombu/transport/django/__init__.py | 1 | 1865 | """Kombu transport using the Django database as a message store."""
from __future__ import absolute_import
from django.conf import settings
from django.core import exceptions as errors
from kombu.five import Empty
from kombu.transport import virtual
from kombu.utils.encoding import bytes_to_str
from kombu.utils.json ... | bsd-3-clause |
bitcoinec/bitcoinec | contrib/devtools/optimize-pngs.py | 111 | 3391 | #!/usr/bin/env python
# Copyright (c) 2014-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.
'''
Run this script every time you change one of the png files. Using pngcrush, it will optimize the png fi... | mit |
thanhacun/odoo | addons/account/ir_sequence.py | 336 | 2454 | # -*- 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 |
zammitjames/NLPS | example.py | 1 | 2411 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from nlps import nlps
# James Zammit
title = "Steve Jobs Biography"
text = "Steven Paul Jobs was born on February 24, 1955, in San Francisco, California, to Joanne Schieble (later Joanne Simpson) and Abdulfattah 'John' Jandali, two University of Wisconsin graduate students wh... | mit |
amitsela/beam | sdks/python/apache_beam/io/__init__.py | 4 | 1583 | #
# 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 |
adjackura/compute-image-tools | image_test/configuration/linux/redhat.py | 3 | 3112 | #!/usr/bin/env python3
# Copyright 2018 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 ... | apache-2.0 |
FlymeOS/tools | smaliparser/reject.py | 2 | 9326 | '''
Created on Jun 5, 2014
@author: tangliuxiang
'''
import Smali
import utils
import re
import sys
import os
import SmaliEntry
import Replace
import SAutoCom
import tempfile
import LibUtils
from formatters.log import Paint
class reject(object):
REJ_BEGIN = '<<<<<<<'
REJ_SPLIT = '======='
REJ_END = '>>>... | apache-2.0 |
kapilt/cloud-custodian | c7n/resources/shield.py | 5 | 5811 | # Copyright 2015-2017 Capital One Services, 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 by applicable law or agreed ... | apache-2.0 |
tfrancart/schemaorg | lib/rdflib/plugin.py | 22 | 9342 | """
Plugin support for rdf.
There are a number of plugin points for rdf: parser, serializer,
store, query processor, and query result. Plugins can be registered
either through setuptools entry_points or by calling
rdf.plugin.register directly.
If you have a package that uses a setuptools based setup.py you can add th... | apache-2.0 |
robwarm/gpaw-symm | gpaw/test/td_na2.py | 1 | 2589 | from ase import Atoms
from ase.units import Bohr
from gpaw import GPAW
from gpaw.tddft import TDDFT, photoabsorption_spectrum, \
LinearAbsorbingBoundary, P4AbsorbingBoundary, PML
from gpaw.test import equal
import os
# Sodium dimer, Na2
d = 1.5
atoms = Atoms(symbols='Na2',
positions=[( 0, 0, d),
... | gpl-3.0 |
fabrique/django-sortedm2m | test_project/settings.py | 1 | 3023 | # Django settings for testsite project.
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ... | bsd-3-clause |
showell/zulip | tools/lib/test_server.py | 1 | 3491 | import os
import subprocess
import sys
import time
from contextlib import contextmanager
from typing import Iterator, Optional
# Verify the Zulip venv is available.
from tools.lib import sanity_check
sanity_check.check_venv(__file__)
import django
import requests
MAX_SERVER_WAIT = 180
TOOLS_DIR = os.path.dirname(o... | apache-2.0 |
40223148/2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/_strptime.py | 518 | 21683 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | gpl-3.0 |
morenopc/edx-platform | common/djangoapps/track/tests/test_middleware.py | 11 | 4977 | import re
from mock import patch
from mock import sentinel
from django.contrib.auth.models import User
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from eventtracking imp... | agpl-3.0 |
bonitadecker77/python-for-android | python3-alpha/python3-src/Lib/distutils/tests/test_core.py | 138 | 3027 | """Tests for distutils.core."""
import io
import distutils.core
import os
import shutil
import sys
import test.support
from test.support import captured_stdout, run_unittest
import unittest
from distutils.tests import support
# setup script that uses __file__
setup_using___file__ = """\
__file__
from distutils.core... | apache-2.0 |
Drooids/odoo | addons/product_expiry/__init__.py | 442 | 1053 | ##############################################################################
#
# 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 |
Maximilian-Reuter/SickRage-1 | lib/github/Repository.py | 21 | 92750 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Christopher Gilbert <christopher.john.gilbert@gmail.com> #
# Copyright 2012 Steve English <steve.english@naveta... | gpl-3.0 |
raven47git/flask | flask/_compat.py | 22 | 2934 | # -*- coding: utf-8 -*-
"""
flask._compat
~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY... | bsd-3-clause |
willthames/ansible | lib/ansible/modules/cloud/webfaction/webfaction_app.py | 63 | 6444 | #!/usr/bin/python
#
# Create a Webfaction application using Ansible and the Webfaction API
#
# Valid application types can be found by looking here:
# http://docs.webfaction.com/xmlrpc-api/apps.html#application-types
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015, with contributions... | gpl-3.0 |
ajshastri/pygooglevoice | setup.py | 39 | 1037 | from distutils.core import setup
README = """Python Google Voice
====================
Joe McCall & Justin Quick
Exposing the Google Voice "API" to the Python language
-------------------------------------------------------
Google Voice for Python Allows you to place calls, send sms, download voicemail, and check t... | bsd-3-clause |
dantebarba/docker-media-server | plex/Subliminal.bundle/Contents/Libraries/Shared/pysrt/srtfile.py | 18 | 10501 | # -*- coding: utf-8 -*-
import os
import sys
import codecs
try:
from collections import UserList
except ImportError:
from UserList import UserList
from itertools import chain
from copy import copy
from pysrt.srtexc import Error
from pysrt.srtitem import SubRipItem
from pysrt.compat import str
BOMS = ((codec... | gpl-3.0 |
briancurtin/libcloud | libcloud/test/compute/test_rimuhosting.py | 46 | 4370 | # 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 |
aeron15/ruffus | ruffus/test/test_regex_error_messages.py | 5 | 18879 | #!/usr/bin/env python
from __future__ import print_function
"""
test_regex_error_messages.py
test product, combine, permute, combine_with_replacement
Includes code from python.unittest with the following copyright notice:
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-... | mit |
EmanueleCannizzaro/scons | test/Alias/action.py | 1 | 4351 | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 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, including
# without limitation the rights to us... | mit |
andela-earinde/bellatrix-py | app/js/lib/lib/modules/locale.py | 79 | 99412 | """ Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for pass... | mit |
robertwbrandt/ZarafaAdmin | bin/zarafa-permissions.py | 2 | 7579 | #!/usr/bin/env python
"""
Python wrapper for zarafa-admin --type group --details group
"""
import argparse, textwrap, fnmatch, datetime
import xml.etree.cElementTree as ElementTree
import subprocess
from multiprocessing import Process, Queue
# Import Brandt Common Utilities
import sys, os
sys.path.append( os.path.real... | gpl-3.0 |
m-labs/milkymist | cores/softusb/navre_regress/test_opcodes/test_ANDI.py | 5 | 3274 | #! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | lgpl-3.0 |
SaschaMester/delicium | third_party/closure_linter/closure_linter/errors.py | 99 | 4184 | #!/usr/bin/env python
# Copyright 2007 The Closure Linter 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
#
#... | bsd-3-clause |
willkg/pytest-wholenodeid | pytest_wholenodeid.py | 1 | 1244 | import sys
from _pytest.terminal import TerminalReporter
import pytest
__version__ = '0.2'
__releasedate__ = '20150826'
class WholeNodeIDTerminalReporter(TerminalReporter):
def _getfailureheadline(self, rep):
if hasattr(rep, 'location'):
fspath, lineno, domain = rep.location
# U... | bsd-3-clause |
jeffreymingyue/ansible | lib/ansible/plugins/callback/osx_say.py | 144 | 2882 |
# (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any la... | gpl-3.0 |
Elettronik/SickRage | lib/rtorrent/lib/xmlrpc/basic_auth.py | 95 | 2681 | #
# Copyright (c) 2013 Dean Gardiner, <gardiner91@gmail.com>
#
# 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, mod... | gpl-3.0 |
ACBL-Bridge/Bridge-Application | Logic/card_value.py | 1 | 1433 | from simple_deck import *
from verbose import *
class CardValue:
#Dictionary of values of the cards used for the ACBL API.
trueval = {'c2': 1,
'c3': 2,
'c4': 3,
'c5': 4,
'c6': 5,
'c7': 6,
'c8': 7,
'c9': 8,
... | mit |
ZhangXinNan/tensorflow | tensorflow/python/kernel_tests/pool_test.py | 24 | 14407 | # 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 |
tgalal/yowsup | yowsup/layers/protocol_acks/protocolentities/ack_incoming.py | 70 | 1304 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .ack import AckProtocolEntity
class IncomingAckProtocolEntity(AckProtocolEntity):
'''
<ack t="{{TIMESTAMP}}" from="{{FROM_JID}}" id="{{MESSAGE_ID}}" class="{{message | receipt | ?}}">
</ack>
'''
def __init__(self, _id, _class, _from,... | gpl-3.0 |
Orochimarufan/youtube-dl | youtube_dl/extractor/ondemandkorea.py | 62 | 2036 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
js_to_json,
)
class OnDemandKoreaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ondemandkorea\.com/(?P<id>[^/]+)\.html'
_GEO_COUNTRIES = ['US', 'CA']
_TEST = {
... | unlicense |
Jaccorot/django-cms | cms/south_migrations/0053_auto__add_field_title_published__add_field_title_publisher_is_draft__a.py | 63 | 20404 | # -*- 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):
# Adding field 'Title.published'
db.add_column(u'cms_title', 'published',... | bsd-3-clause |
robertjpayne/rethinkdb | test/scenarios/kill_secondary.py | 12 | 3268 | #!/usr/bin/env python
# Copyright 2010-2016 RethinkDB, all rights reserved.
import os, sys, time
from pprint import pformat
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import rdb_unittest, scenario_common, utils, vcoptparse, workload_runner
from utils import pri... | apache-2.0 |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/test/test_winsound.py | 60 | 9242 | # Ridiculously simple test of the winsound module for Windows.
import unittest
from test import support
support.requires('audio')
import time
import os
import subprocess
winsound = support.import_module('winsound')
ctypes = support.import_module('ctypes')
import winreg
def has_sound(sound):
"""Find out if a part... | apache-2.0 |
Karm/qpid-proton | examples/python/direct_recv.py | 33 | 2189 | #!/usr/bin/env python
#
# 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
# "... | apache-2.0 |
rajalokan/glance | releasenotes/source/conf.py | 2 | 9174 | # -*- 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 |
cainmatt/django | tests/user_commands/management/commands/hal.py | 372 | 1024 | from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Useless command."
def add_arguments(self, parser):
parser.add_argument('args', metavar='app_label', nargs='*',
help='Specify the app label(s) to works on.')
parser.add_argument('-... | bsd-3-clause |
BT-rmartin/server-tools | module_prototyper/models/ir_model_fields.py | 26 | 1926 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it a... | agpl-3.0 |
dragonflypl/material-start | node_modules/protractor/node_modules/accessibility-developer-tools/scripts/parse_aria_schemas.py | 381 | 3069 | import json
import re
import urllib
import xml.etree.ElementTree as ET
def parse_attributes():
schema = urllib.urlopen('http://www.w3.org/MarkUp/SCHEMA/aria-attributes-1.xsd')
tree = ET.parse(schema)
for node in tree.iter():
node.tag = re.sub(r'{.*}', r'', node.tag)
type_map = {
'stat... | mit |
bikong2/django | tests/model_fields/test_field_flags.py | 154 | 7318 | from django import test
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.db import models
from django.db.models.fields.related import (
ForeignKey, ForeignObject, ForeignObjectRel, ManyToManyField, ManyToOneRel,
OneToOneField,
)
from .models import AllField... | bsd-3-clause |
todddeluca/python-vagrant | vagrant/test.py | 2 | 3435 | """
A TestCase class, tying together the Vagrant class and removing some of the boilerplate involved in writing tests
that leverage vagrant boxes.
"""
from unittest import TestCase
from vagrant import Vagrant, stderr_cm
__author__ = 'nick'
class VagrantTestCase(TestCase):
"""
TestCase class to control vagrant boxe... | mit |
ricardogsilva/PyWPS | tests/test_describe.py | 1 | 11512 | import unittest
from collections import namedtuple
from pywps import Process, Service, LiteralInput, ComplexInput, BoundingBoxInput
from pywps import LiteralOutput, ComplexOutput, BoundingBoxOutput
from pywps import E, WPS, OWS, OGCTYPE, Format, NAMESPACES, OGCUNIT
from pywps.inout.literaltypes import LITERAL_DATA_TYPE... | mit |
ojii/sandlib | lib/lib-python/2.7/test/test_typechecks.py | 136 | 3166 | """Unit tests for __instancecheck__ and __subclasscheck__."""
import unittest
from test import test_support
class ABC(type):
def __instancecheck__(cls, inst):
"""Implement isinstance(inst, cls)."""
return any(cls.__subclasscheck__(c)
for c in set([type(inst), inst.__class__]))... | bsd-3-clause |
RaRe-Technologies/gensim | gensim/test/svd_error.py | 3 | 7390 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
"""USAGE: %(program)s MATRIX.mm [CLIP_DOCS] [CLIP_TERMS]
Check truncated SVD error for the algo in gensim, using a given corpus. This script
runs the decomposition with several internal parameters (number of r... | lgpl-2.1 |
omaciel/robottelo | tests/upgrades/test_remoteexecution.py | 1 | 11012 | """Test for Remote Execution related Upgrade Scenario's
:Requirement: Upgraded Satellite
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: API
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from nailgun import entities
from robottelo.constants import DEFAULT_LOC, DEFAULT_ORG, DISTR... | gpl-3.0 |
Tesora-Release/tesora-trove | trove/guestagent/datastore/db2/system.py | 3 | 2554 | # Copyright 2015 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
mfherbst/spack | lib/spack/spack/test/flag_handlers.py | 2 | 7054 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
zhangyake/python-itchat | test/songCloudImage.py | 1 | 2058 | '''
通过用户id 获取网易云音乐用户听歌历史
歌曲云图
'''
import time
from os import path
from selenium import webdriver
import numpy as np
from bs4 import BeautifulSoup
from PIL import Image
from wordcloud import WordCloud
class SongCloudImage(object):
baseUrl = 'http://music.163.com/#/user/songs/rank?id={}'
def __init__(self, ... | mit |
manassolanki/erpnext | erpnext/setup/install.py | 9 | 2924 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from erpnext.accounts.doctype.cash_flow_mapper.default_cash_flow_mapper import DEFAULT_MAPPERS
from .default_success_acti... | gpl-3.0 |
Paulius-Maruska/python-isign | src/isign/connection.py | 1 | 1919 | from typing import Dict, Union
import requests
from .environment import (
get_default_environment,
ISignEnvironment,
)
from .error import ISignError
class ISignConnection:
def __init__(self,
access_token: str,
user_agent: str = "Python iSign",
environme... | mit |
vhumpa/dogtail | dogtail/wrapped.py | 2 | 1083 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import Accessibility
"""
Superclasses for application wrappers
Subclass these classes if you want to create application wrappers, e.g.:
http://svn.gnome.org/viewvc/dogtail-tests/trunk/appwrappers/dogtail/appwrap... | gpl-2.0 |
USCDataScience/polar.usc.edu | html/team3-a3/app.py | 1 | 3694 | from flask import Flask, jsonify, send_from_directory, redirect, request
import requests
import os
url = 'http://54.183.25.174:9200/polar.usc.edu/_search?q=*:*&size=10000&fields='
#res = requests.get()
#result = res.json()['hits']['hits']
#print len(result)
data = []
with open('datasize.json', 'rb') as f:
data = e... | apache-2.0 |
marckuz/django | django/contrib/auth/urls.py | 568 | 1036 | # The views used below are normally mapped in django.contrib.admin.urls.py
# This URLs file is used to provide a reliable view deployment for test purposes.
# It is also provided as a convenience to those who want to deploy these URLs
# elsewhere.
from django.conf.urls import url
from django.contrib.auth import views
... | bsd-3-clause |
hoffmabc/OpenBazaar-Server | db/tests/test_datastore.py | 2 | 3513 | import unittest
import os
from db import datastore
from protos.objects import Profile, Listings
from protos.countries import CountryCode
class DatastoreTest(unittest.TestCase):
def setUp(self):
datastore.create_database("test.db")
datastore.DATABASE = "test.db"
self.test_hash = "87e0555568... | mit |
ohio813/androguard | androguard/decompiler/dad/dataflow.py | 34 | 20280 | # This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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://... | apache-2.0 |
ryanbay/node-gyp | gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
shminer/kernel-msm-3.18 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 1891 | 3300 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
eHealthAfrica/rapidpro | temba/utils/management/commands/test_db.py | 1 | 30746 | from __future__ import unicode_literals, division, print_function
import json
import math
import pytz
import random
import resource
import six
import sys
import time
import uuid
from collections import defaultdict
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import U... | agpl-3.0 |
michaelhowden/eden | modules/geopy/geocoders/openmapquest.py | 32 | 2503 | try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
import gluon.contrib.simplejson as json # fallback to pure-Python module
from urllib import urlencode
from urllib2 import urlopen
from geopy.geocoders.base import Geocoder
from geopy.util import logger,... | mit |
loretoparisi/nupic | tests/integration/nupic/opf/opf_experiment_results_test.py | 12 | 15515 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
aliyun/aliyun-oss-python-sdk | tests/test_server_side_encryotion.py | 1 | 19249 | # -*- coding: utf-8 -*-
from .common import *
from oss2.models import ServerSideEncryptionRule, PartInfo
from oss2 import (SERVER_SIDE_ENCRYPTION_KMS, SERVER_SIDE_ENCRYPTION_AES256,
SERVER_SIDE_ENCRYPTION_SM4, KMS_DATA_ENCRYPTION_SM4)
from oss2.headers import (OSS_SERVER_SIDE_ENCRYPTION, OSS_SERVER_S... | mit |
lancezlin/ml_template_py | lib/python2.7/site-packages/numpy/core/generate_numpy_api.py | 32 | 7417 | from __future__ import division, print_function
import os
import genapi
from genapi import \
TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi
import numpy_api
# use annotated api when running under cpychecker
h_template = r"""
#if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_AR... | mit |
drincruz/luigi | examples/top_artists.py | 66 | 9167 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
tlodge/homehub.nox | src/nox/webapps/webserver/dummywebpage.py | 10 | 5957 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is dist... | gpl-3.0 |
eduNEXT/edunext-platform | lms/djangoapps/ccx/migrations/0005_change_ccx_coach_to_staff.py | 5 | 3525 | # -*- coding: utf-8 -*-
import logging
import six
from ccx_keys.locator import CCXLocator
from django.contrib.auth.models import User
from django.db import migrations
from django.http import Http404
from lms.djangoapps.courseware.courses import get_course_by_id
from lms.djangoapps.instructor.access import allow_acc... | agpl-3.0 |
pythonprobr/pypratico | gui/rc4.py | 1 | 1556 | #!/usr/bin/env python3
def rc4(chave, entrada, loops=1):
''' Algoritmo compatível com o RC4 '''
kbox = list(range(256)) # criar caixa para chave
for i, car in enumerate(chave): # copiar chave e vetor
kbox[i] = car
j = len(chave)
for i in range(j, 256): # repetir ate preencher
... | gpl-2.0 |
alexpilotti/python-keystoneclient | keystoneclient/v3/contrib/oauth1/core.py | 8 | 2565 | # 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 the... | apache-2.0 |
Shengliang/mbed | workspace_tools/host_tests/host_tests_plugins/module_copy_mps2.py | 55 | 5528 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 |
kaspermunch/MultiPurpose | MultiPurpose/NWAlign/DPMatrix.py | 1 | 1966 | """DPMatrix.py
This class models a dynamic progamming matrix for use in sequence
alignment models. The design of this class is based on the description of
dynamic programming matrices in:
Durbin et al. 1998. Biological Sequence Analysis. Cambridge University
Press.
Classes:
* DPMatrix
* DPMatrixCell
"... | gpl-2.0 |
molobrakos/home-assistant | homeassistant/components/emulated_roku/config_flow.py | 10 | 1964 | """Config flow to configure emulated_roku component."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
from .const import CONF_LISTEN_PORT, DEFAULT_NAME, DEFAULT_PORT, DOMAIN
@callback
def configured_servers(hass):
... | apache-2.0 |
heidsoft/VirtualBox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py | 11 | 10521 | ## @file
# Patch value into the binary file.
#
# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be f... | gpl-2.0 |
Bachaco-ve/odoo | addons/auth_crypt/auth_crypt.py | 179 | 4021 | import logging
from passlib.context import CryptContext
import openerp
from openerp.osv import fields, osv
from openerp.addons.base.res import res_users
res_users.USER_PRIVATE_FIELDS.append('password_crypt')
_logger = logging.getLogger(__name__)
default_crypt_context = CryptContext(
# kdf which can be verified... | agpl-3.0 |
xuxiao19910803/edx | lms/djangoapps/mobile_api/video_outlines/views.py | 121 | 4888 | """
Video Outlines
We only provide the listing view for a video outline, and video outlines are
only displayed at the course level. This is because it makes it a lot easier to
optimize and reason about, and it avoids having to tackle the bigger problem of
general XBlock representation in this rather specialized format... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.