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 |
|---|---|---|---|---|---|
jhbsz/OSI-OS | contrib/wpa/wpa_supplicant/examples/p2p/p2p_group_add.py | 29 | 5810 | #!/usr/bin/python
# Tests p2p_group_add
######### MAY NEED TO RUN AS SUDO #############
import dbus
import sys, os
import time
import gobject
import getopt
import threading
from dbus.mainloop.glib import DBusGMainLoop
def usage():
print "Usage:"
print " %s -i <interface_name> [-p <persistent>] \ " \
% sys.argv[0... | bsd-3-clause |
puckipedia/youtube-dl | youtube_dl/extractor/elpais.py | 128 | 2110 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import unified_strdate
class ElPaisIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^.]+\.)?elpais\.com/.*/(?P<id>[^/#?]+)\.html(?:$|[?#])'
IE_DESC = 'El País'
_TEST = {
'url': 'http://blogs.elpa... | unlicense |
icebluechao/stuttgart_kernel | 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 |
benthomasson/ansible | lib/ansible/plugins/connection/netconf.py | 22 | 6114 | #
# (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 |
Livefyre/django-cms | cms/test_utils/project/placeholderapp/south_migrations/0001_initial.py | 46 | 10010 | # -*- 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 model 'Example1'
db.create_table(u'placeholderapp_example1', (
... | bsd-3-clause |
ehealthafrica-ci/kivy | kivy/input/postproc/ignorelist.py | 59 | 1365 | '''
Ignore list
===========
Ignore touch on some areas of the screen
'''
__all__ = ('InputPostprocIgnoreList', )
from kivy.config import Config
from kivy.utils import strtotuple
class InputPostprocIgnoreList(object):
'''
InputPostprocIgnoreList is a post-processor which removes touches in the
Ignore li... | mit |
edmstudio/ansible | lib/ansible/galaxy/api.py | 10 | 6504 | #!/usr/bin/env python
########################################################################
#
# (C) 2013, James Cammarata <jcammarata@ansible.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 ... | gpl-3.0 |
costypetrisor/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
mytoh/shadowsocks-android | gfwlist/gen.py | 304 | 1535 | #!/usr/bin/python
# -*- encoding: utf8 -*-
import itertools
import math
import sys
import IPy
def main():
china_list_set = IPy.IPSet()
for line in sys.stdin:
line_params = line.split("|")
if len(line_params) < 5 or line_params[2] != "ipv4" or line_params[1] != "CN":
continue
... | gpl-3.0 |
open-synergy/event | event_registration_partner_unique/tests/test_event.py | 1 | 1524 | # -*- coding: utf-8 -*-
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from .. import exceptions
from openerp.tests.common import TransactionCase
class DuplicatedPartnerCase(TransactionCase):
def setUp(self):
super(DuplicatedPartnerCase... | agpl-3.0 |
Tsjerk/MartiniTools | gmx/tpr/topology.py | 1 | 6714 | import versions
from ftypes import FFParam, Ilist
from tprio import *
class Block(ListWithNames):
def __init__(self,tpr):
self.extend([
("dummy", Tuple(tpr, 256, Integer) if tpr.version < 44 else None),
("nr", Integer(tpr)),
("nra", Integer(tpr) if tpr.version < ... | gpl-2.0 |
40223119/2015w13 | static/Brython3.1.3-20150514-095342/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 |
binarydud/django-oscar | src/oscar/apps/dashboard/pages/app.py | 49 | 1113 | from django.conf.urls import url
from oscar.core.application import Application
from oscar.core.loading import get_class
class FlatPageManagementApplication(Application):
name = None
default_permissions = ['is_staff', ]
list_view = get_class('dashboard.pages.views', 'PageListView')
create_view = get... | bsd-3-clause |
3dfxsoftware/cbss-addons | survey/wizard/survey_send_invitation.py | 19 | 10658 | # -*- 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 ... | gpl-2.0 |
defionscode/ansible | lib/ansible/modules/packaging/os/yum_repository.py | 21 | 24040 | #!/usr/bin/python
# encoding: utf-8
# (c) 2015-2016, Jiri Tyr <jiri.tyr@gmail.com>
#
# 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 |
Edraak/circleci-edx-platform | common/djangoapps/terrain/stubs/lti.py | 44 | 12380 | """
Stub implementation of LTI Provider.
What is supported:
------------------
1.) This LTI Provider can service only one Tool Consumer at the same time. It is
not possible to have this LTI multiple times on a single page in LMS.
"""
from uuid import uuid4
import textwrap
import urllib
from oauthlib.oauth1.rfc5849 ... | agpl-3.0 |
aimas/TuniErp-8.0 | addons/hr_gamification/__openerp__.py | 1 | 1679 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/lib/third_party/dns/rdtypes/IN/APL.py | 248 | 5525 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
Luthaf/cymbalum | scripts/ci/check-whitespaces.py | 4 | 1416 | #!/usr/bin/env python
# coding=utf-8
import os
import sys
ROOT = os.path.join(os.path.dirname(__file__), "..")
DIRECTORIES = ["benches", "doc", "examples", "scripts", "src", "tests"]
IGNORED_EXTENSIONS = [
"xyz",
# website and documentation files
"svg", "html", "js",
# Binary files
"ttf", "eot", "w... | bsd-2-clause |
adrienbrault/home-assistant | homeassistant/components/wink/__init__.py | 3 | 32284 | """Support for Wink hubs."""
from datetime import timedelta
import json
import logging
import os
import time
from aiohttp.web import Response
from pubnubsubhandler import PubNubSubscriptionHandler
import pywink
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.con... | mit |
darach/cassandra | pylib/cqlshlib/pylexotron.py | 38 | 18820 | # 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 |
TalShafir/ansible | lib/ansible/module_utils/ldap.py | 78 | 2327 | # -*- coding: utf-8 -*-
# Copyright: (c) 2016, Peter Sagerson <psagers@ignorare.net>
# Copyright: (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
# Copyright: (c) 2017-2018 Keller Fuchs (@KellerFuchs) <kellerfuchs@hashbang.sh>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from... | gpl-3.0 |
rosudrag/Freemium-winner | VirtualEnvironment/Lib/site-packages/flask/testsuite/reqctx.py | 1 | 5967 | # -*- coding: utf-8 -*-
"""
theflasktest.testsuite.reqctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the request context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
try:
from greenlet import greenlet
except ImportError:
greenlet... | mit |
Mvrcu/catch-the-money | final_project.py | 1 | 11237 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Main.py
import os
import sys
import random
import pygame as pg
CAPTION = "Catch the falling funds with your wallet!"
SCREEN_SIZE = (850, 600)
TRANSPARENT = (0, 0, 0, 0)
# This global constant serves as a very useful convenience for me.
DIRECT_DICT = {... | gpl-3.0 |
sensepost/Snoopy | snoopy/server/transforms/fetchTweetsByLocation.py | 4 | 2424 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# glenn@sensepost.com
# Snoopy // 2012
# By using this code you agree to abide by the supplied LICENSE.txt
from Maltego import *
import logging
import requests
import json
import stawk_db
import re
logging.basicConfig(level=logging.DEBUG,filename='/tmp/maltego_logs.txt',form... | mit |
bbqlinux/pyparted | src/parted/alignment.py | 2 | 5275 | #
# geometry.py
# Python bindings for libparted (built on top of the _ped Python module).
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at ... | gpl-2.0 |
jboy/nim-pymod | tests/00-pymod_basics/002-expect_1/test_expect_1.py | 1 | 5550 | import pytest
def test_0_compile_pymod_test_mod(pmgen_py_compile):
pmgen_py_compile(__name__)
def test_cfloatExpect1(pymod_test_mod):
pymod_test_mod.cfloatExpect1(1.0)
def test_cdoubleExpect1(pymod_test_mod):
pymod_test_mod.cdoubleExpect1(1.0)
def test_cshortExpect1(pymod_test_mod):
pymod_test_mo... | mit |
enormandeau/Scripts | fasta_remove.py | 1 | 2142 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Extract sequences from a fasta file if their name is not in a 'remove' file.
Remove file contains one sequence name per line.
Usage:
%program <input_file> <remove_file> <output_file>"""
# Importing modules
import gzip
import sys
# Defining classes
class Fasta(o... | gpl-3.0 |
ubuntu-core/snapcraft | tests/unit/pluginhandler/test_plugin_loader.py | 1 | 3041 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017-2018,2020 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distribute... | gpl-3.0 |
redreamality/semanticizer | semanticizer/wpm/namespace.py | 3 | 5589 | # Copyright 2012-2013, University of Amsterdam. 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) any later version.
#
# This program... | gpl-3.0 |
chand3040/cloud_that | lms/envs/test_static_optimized.py | 18 | 1648 | """
Settings used when generating static assets for use in tests.
For example, Bok Choy uses two different settings files:
1. test_static_optimized is used when invoking collectstatic
2. bok_choy is used when running CMS and LMS
Note: it isn't possible to have a single settings file, because Django doesn't
support bo... | agpl-3.0 |
amith01994/intellij-community | python/lib/Lib/site-packages/django/core/cache/backends/memcached.py | 78 | 6968 | "Memcached cache backend"
import time
from threading import local
from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError
from django.utils import importlib
class BaseMemcachedCache(BaseCache):
def __init__(self, server, params, library, value_not_found_exception):
super(BaseMemca... | apache-2.0 |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/interfaces/interface/mpls/config/__init__.py | 1 | 13581 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
siggame/Joueur.py | games/stumped/game_object.py | 1 | 2542 | # GameObject: An object in the game. The most basic class that all game classes should inherit from automatically.
# DO NOT MODIFY THIS FILE
# Never try to directly create an instance of this class, or modify its member variables.
# Instead, you should only be reading its variables and calling its functions.
from typ... | mit |
kaiweifan/horizon | openstack_dashboard/dashboards/project/instances/workflows/create_instance.py | 5 | 27722 | # 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 |
michaelBenin/sqlalchemy | test/dialect/postgresql/test_query.py | 1 | 34275 | # coding: utf-8
from sqlalchemy.testing.assertions import eq_, assert_raises, \
assert_raises_message, is_, AssertsExecutionResults, \
AssertsCompiledSQL, ComparesTables
from sqlalchemy.testing import engines, fixtures
from sqlalchemy import testing
from sqlalchemy import Table, Column,... | mit |
ryneeverett/mezzanine | mezzanine/utils/cache.py | 3 | 4108 | from __future__ import unicode_literals
from hashlib import md5
from inspect import getmro
from time import time
from django.core.cache import cache
from django.utils.lru_cache import lru_cache
from django.utils.cache import _i18n_cache_key_suffix
from django.utils.module_loading import import_string
from mezzanine.... | bsd-2-clause |
TheTimmy/spack | var/spack/repos/builtin/packages/poamsa/package.py | 3 | 2159 | ##############################################################################
# Copyright (c) 2013-2017, 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 |
UC3Music/songbook-tools | song-directory-transpose.py | 1 | 9369 | #!/usr/bin/env python
import sys, os
import mmap # Thanks Steven @ http://stackoverflow.com/questions/4940032/search-for-string-in-txt-file-python
import subprocess
import readline
readline.set_completer_delims(' \t\n;')
readline.parse_and_bind("tab: complete")
readline.parse_and_bind("set match-hidden-files off"... | unlicense |
tjduigna/exatomic | exatomic/qe/pw/classes.py | 10 | 2496 | # -*- coding: utf-8 -*-
#'''
#Classes for pw.x
#=======================================
#'''
#import pprint
#from exatomic import Universe
#from exatomic.frame import _min_frame_from_atom
#from exqe.classes import classes
#
#
#class PWInput:
# '''
# '''
# _order = ['control', 'system', 'electrons', 'ions', 'ce... | apache-2.0 |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/lib2to3/fixes/fix_isinstance.py | 5 | 1660 | # Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed. This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.
eg. isinstance(x... | gpl-2.0 |
hkchenhongyi/django | django/contrib/gis/sitemaps/kml.py | 398 | 2544 | from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.sitemaps import Sitemap
from django.core import urlresolvers
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
de... | bsd-3-clause |
ben-hopps/nupic | tests/unit/nupic/regions/record_sensor_region_test.py | 35 | 3069 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, 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 |
JshWright/home-assistant | homeassistant/components/automation/event.py | 2 | 1901 | """
Offer event listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/docs/automation/trigger/#event-trigger
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback, CoreState
from homeassista... | apache-2.0 |
roadhead/satchmo | satchmo/discount/templatetags/satchmo_discounts.py | 2 | 6729 | try:
from decimal import Decimal
except:
from django.utils._decimal import Decimal
from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.co... | bsd-3-clause |
AnhellO/DAS_Sistemas | Ago-Dic-2020/aguirre-juarez-david/practica-3/abstract_factory.py | 1 | 1613 | import os
class ClearConsole:
def clear(self):
pass
class PrintColor:
def set_color(self, color):
pass
def print(self, str):
pass
class WindowsClearConsole(ClearConsole):
def clear(self):
return os.system("cls")
class LinuxClearConsole(ClearConsole):
def clear(self):
return os.system("clear")
... | mit |
ESOedX/edx-platform | common/djangoapps/track/shim.py | 2 | 3557 | """Map new event context values to old top-level field values. Ensures events can be parsed by legacy parsers."""
from __future__ import absolute_import
import json
from .transformers import EventTransformerRegistry
CONTEXT_FIELDS_TO_INCLUDE = [
'username',
'session',
'ip',
'agent',
'host',
... | agpl-3.0 |
kant/inasafe | safe/metadata/test/test_metadata.py | 2 | 2066 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Exception Classes.**
Custom exception classes for the IS application.
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Publi... | gpl-3.0 |
jsoref/django | tests/template_backends/test_dummy.py | 306 | 3603 | # coding: utf-8
from __future__ import unicode_literals
from django.forms import CharField, Form, Media
from django.http import HttpRequest
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.template.backends.dummy import ... | bsd-3-clause |
opennode/opennode-knot | version.py | 5 | 2715 | # -*- coding: utf-8 -*-
# Author: Douglas Creager <dcreager@dcreager.net>
# This file is placed into the public domain.
# Calculates the current version number. If possible, this is the
# output of “git describe”, modified to conform to the versioning
# scheme that setuptools uses. If “git describe” returns an error... | gpl-3.0 |
myles/couchdb-python | couchdb/tools/dump.py | 1 | 2449 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from base64 import b64decode
from email.MIMEBase import MIMEBase
from email.MIMEMul... | bsd-3-clause |
gram526/VTK | ThirdParty/Twisted/twisted/names/secondary.py | 39 | 5723 | # -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
__all__ = ['SecondaryAuthority', 'SecondaryAuthorityService']
from twisted.internet import task, defer
from twisted.names import dns
from twisted.names import common
from twisted.names impor... | bsd-3-clause |
cognitive-catalyst/Lightning | python/nlcTreeBuilder.py | 3 | 4253 | # Copyright IBM
# 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... | apache-2.0 |
vadimtk/chrome4sdp | third_party/WebKit/Tools/Scripts/webkitpy/common/version_check.py | 70 | 1733 | # Copyright (c) 2011 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 |
hsaputra/tensorflow | tensorflow/contrib/specs/python/specs.py | 122 | 4976 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
psdh/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/dispatch.py | 652 | 14786 | # Copyright 2012, 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 f... | mpl-2.0 |
YunYinORG/find | config.exmaple.py | 2 | 1526 | #!/usr/bin/env python
# coding=utf-8
# 数据库信息
DB_TYPE = 'mysql'
try:
import sae.const
IS_SAE = True
DB_NAME = sae.const.MYSQL_DB # 数据库名
DB_USER = sae.const.MYSQL_USER # 用户名
DB_PWD = sae.const.MYSQL_PASS # 密码
DB_HOST = sae.const.MYSQL_HOST # 主库域名(可读写)
DB_PORT = int(sae.const.MYS... | apache-2.0 |
jtyr/ansible-modules-extras | monitoring/airbrake_deployment.py | 57 | 3911 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Bruce Pennypacker <bruce@pennypacker.org>
#
# 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... | gpl-3.0 |
UniversalMasterEgg8679/ansible | test/units/parsing/vault/test_vault.py | 34 | 16056 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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 So... | gpl-3.0 |
yangchandle/django_ecommerce | env/lib/python3.5/site-packages/pip/req/req_set.py | 14 | 32320 | from __future__ import absolute_import
from collections import defaultdict
from itertools import chain
import logging
import os
from pip._vendor import pkg_resources
from pip._vendor import requests
from pip.compat import expanduser
from pip.download import (is_file_url, is_dir_url, is_vcs_url, url_to_path,
... | mit |
ramcn/demo3 | venv/lib/python3.4/site-packages/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py | 64 | 5240 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import json
import logging
from .base import GrantTypeBase
from .. import errors, utils
from ..request_validator import RequestValidator
log = logging.getL... | mit |
mrquim/mrquimrepo | plugin.program.indigo/libs/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-2.0 |
cowai/jottalib | tests/test_jottacloud.py | 2 | 3100 | # -*- encoding: utf-8 -*-
'Tests for jottacloud.py'
#
# This file is part of jottalib.
#
# jottalib 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 |
nuuuboo/odoo | addons/mail/wizard/invite.py | 268 | 5847 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-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 |
Endika/odoo | addons/analytic_user_function/__openerp__.py | 260 | 2015 | # -*- 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 |
windyuuy/opera | chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/changelog.py | 122 | 4368 | # Copyright (C) 2011 Patrick Gansterer <paroga@paroga.com>
#
# 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 |
ashwyn/eden-message_parser | modules/pygsm/textsmshandler.py | 62 | 9906 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import errors, traceback, message
import re, datetime, time
import StringIO
import pytz
from smshandler import SmsHandler
class TextSmsHandler(SmsHandler):
SCTS_FMT = "%y/%m/%d,%H:%M:%S"
CMGL_MATCHER=re.compile(r'^\+CMGL: (\d+),"(.+?)","(.+?)",... | mit |
pulkitpagare/Mobile-Security-Framework-MobSF | DynamicAnalyzer/tools/pyWebProxy/socket_wrapper.py | 37 | 4249 | #!/usr/bin/env python
'''
owtf is an OWASP+PTES-focused try to unite great tools & facilitate pentesting
Copyright (c) 2013, Abraham Aranguren <name.surname@gmail.com> http://7-a.org
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the f... | gpl-3.0 |
markastern/hbcal | tests/tests_hebrew_calendar/test_reltime.py | 1 | 8611 | # Copyright 2015 Mark Stern
#
# This file is part of Hbcal.
#
# Hbcal 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.
#
# Hbcal is distributed in the hope that it will be useful,
# but WITHOUT ANY ... | gpl-2.0 |
codesmart-co/bit | bit/migrations/versions/4ad33f99723a_.py | 1 | 2133 | """empty message
Revision ID: 4ad33f99723a
Revises: 743a0a1b5bc9
Create Date: 2017-08-17 14:36:49.229000
"""
# revision identifiers, used by Alembic.
revision = '4ad33f99723a'
down_revision = '743a0a1b5bc9'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
# ### commands au... | apache-2.0 |
minghuascode/pyj | examples/lightout/lightout.py | 2 | 2702 | # Copyright (C) 2009, Radoslav Kirov
#
# Lightout game, by Radoslav Kirov
import pyjd # this is dummy in pyjs.
from pyjamas.ui.FlowPanel import FlowPanel
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.SimplePanel import SimplePanel
from pyjamas.ui.Button import Button
from pyjamas.ui.CheckBox import CheckB... | apache-2.0 |
zephyrproject-rtos/zephyr | scripts/tracing/trace_capture_usb.py | 6 | 3389 | #!/usr/bin/env python3
#
# Copyright (c) 2019 Intel Corporation.
#
# SPDX-License-Identifier: Apache-2.0
"""
Script to capture tracing data with USB backend.
"""
import usb.core
import usb.util
import argparse
import sys
def parse_args():
global args
parser = argparse.ArgumentParser(
description=__doc... | apache-2.0 |
yongtang/tensorflow | tensorflow/python/kernel_tests/distributions/uniform_test.py | 47 | 10551 | # 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 |
tapanagupta/mi-instrument | mi/instrument/teledyne/workhorse/particles.py | 8 | 35830 | import re
import time
from datetime import datetime
from mi.core.log import get_logger
from mi.core.common import BaseEnum
from mi.core.time_tools import timegm_to_float
from mi.core.instrument.data_particle import CommonDataParticleType, DataParticle, DataParticleKey
NEWLINE = '\r\n'
log = get_logger()
class Workh... | bsd-2-clause |
tonycao/IntroToHadoopAndMR__Udacity_Course | ProblemStatement2/Python/P2Q1_Mapper_Old.py | 4 | 3397 | #!/usr/bin/python
# URL that generated this code:
# http://txt2re.com/index-python.php3?s=10.223.157.186%20-%20-%20[15/Jul/2009:15:50:35%20-0700]%20%22GET%20/assets/js/lowpro.js%20HTTP/1.1%22%20200%2010469&4&-56&-139&-57&-140&-58&2&60&-137&29&61&3&-63&-62&20&18&-138&24&64&13
import sys
import re
txt = ['10.190.174.1... | apache-2.0 |
nok/sklearn-porter | tests/estimator/regressor/MLPRegressor/MLPRegressorJSTest.py | 1 | 9499 | # -*- coding: utf-8 -*-
from unittest import TestCase
import numpy as np
from sklearn.neural_network.multilayer_perceptron import MLPRegressor
from tests.estimator.regressor.Regressor import Regressor
from tests.language.JavaScript import JavaScript
class MLPRegressorJSTest(JavaScript, Regressor, TestCase):
N... | mit |
aurelieladier/openturns | python/test/t_InverseChiSquare_std.py | 1 | 6233 | #! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
allDistributions = [InverseChiSquare(10.5), InverseChiSquare(15.0)]
for n in range(len(allDistributions)):
distribution = allDistributions[n]
print("Distribution... | lgpl-3.0 |
pranner/CMPUT410-Lab6-Django | v1/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py | 75 | 17069 | from __future__ import unicode_literals
import datetime
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (lookup_field, display_for_field,
display_for_value, label_for_field)
from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST... | apache-2.0 |
nelmiux/CarnotKE | jyhton/lib-python/2.7/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py | 73 | 12423 | """Suite Standard Suite: Common terms that most applications should support
Level 1, version 1
Generated from /System/Library/CoreServices/Finder.app
AETE/AEUT resource version 0/144, language 0, script 0
"""
import aetools
import MacOS
_code = 'CoRe'
from StdSuites.Standard_Suite import *
class Standard_Suite_Even... | apache-2.0 |
mikeboers/Nitrogen | nitrogen/imgsizer.py | 1 | 7970 |
from __future__ import division
import math
import os
import logging
import Image as image
from cStringIO import StringIO
import datetime
import hashlib
import sys
import base64
import struct
from urlparse import urlparse
from urllib2 import urlopen
from subprocess import call
from .request import Request, Response
... | bsd-3-clause |
nitzmahone/ansible | lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py | 25 | 3756 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Russell Teague <rteague2 () csc.com>
# 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_versio... | gpl-3.0 |
sargas/scipy | scipy/spatial/distance.py | 3 | 72559 | """
=====================================================
Distance computations (:mod:`scipy.spatial.distance`)
=====================================================
.. sectionauthor:: Damian Eads
Function Reference
------------------
Distance matrix computation from a collection of raw observation vectors
stored in... | bsd-3-clause |
adaur/SickRage | lib/tornado/platform/caresresolver.py | 193 | 3092 | from __future__ import absolute_import, division, print_function, with_statement
import pycares
import socket
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.netutil import Resolver, is_valid_ip
class CaresResolver(Resolver):
"""Name resolver based on the c-ares library.
This is a non... | gpl-3.0 |
afaheem88/rally | rally/task/sla.py | 10 | 4319 | # Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_1_0/custom_fields_broker.py | 19 | 7329 | from ..broker import Broker
class CustomFieldsBroker(Broker):
controller = "custom_fields"
def list(self, **kwargs):
"""Returns list of custom fields defined for requested model or list of custom fields defined for model object if id parameter is passed.
**Inputs**
| ``api ... | apache-2.0 |
aweinstock314/aweinstock-ctf-writeups | csaw_quals_2015/re300_ftp_sploit.py | 1 | 1043 | #!/usr/bin/env python
# nc 54.175.183.202 12012
from pwn import *
import IPython
host = 'localhost' if '--live' not in sys.argv else '54.175.183.202'
p1 = remote(host, 12012)
p1.sendline('USER blankwall')
print(p1.recvuntil(['Please send password for user blankwall']))
p1.sendline('PASS cookie')
print(p1.recvuntil([... | agpl-3.0 |
xs2maverick/adhocracy3.mercator | src/adhocracy_frontend/adhocracy_frontend/scaffolds/adhocracy/version.py | 26 | 3208 | # -*- coding: utf-8 -*-
# Author: Douglas Creager <dcreager@dcreager.net>
# This file is placed into the public domain.
# Calculates the current version number. If possible, this is the
# output of “git describe”, modified to conform to the versioning
# scheme that setuptools uses. If “git describe” returns an error
#... | agpl-3.0 |
pshen/ansible | lib/ansible/modules/cloud/cloudstack/cs_ip_address.py | 60 | 7162 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.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 Public License as published by
# the Free So... | gpl-3.0 |
mewtaylor/django | django/contrib/gis/gdal/feature.py | 439 | 4153 | from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
fro... | bsd-3-clause |
hslee16/ansible-modules-extras | cloud/openstack/os_keystone_domain.py | 75 | 5392 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
rackstar17/oppia | core/domain/summary_services.py | 1 | 18447 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
Orav/kbengine | kbe/src/lib/python/Lib/email/mime/audio.py | 5 | 2747 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Anthony Baxter
# Contact: email-sig@python.org
"""Class representing audio/* type MIME documents."""
__all__ = ['MIMEAudio']
import sndhdr
from io import BytesIO
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart... | lgpl-3.0 |
ghorn/casadi | docs/examples/python/implicit_runge-kutta.py | 2 | 5148 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | lgpl-3.0 |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/sqlalchemy/ext/associationproxy.py | 31 | 33423 | # ext/associationproxy.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Py... | mit |
gecos-team/gecosws-config-assistant | gecosws_config_assistant/util/JSONUtil.py | 1 | 1672 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# This file is part of Guadalinex
#
# This software 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, ... | gpl-2.0 |
Midnighter/nadist | docs/conf.py | 1 | 1386 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext... | bsd-3-clause |
analyseuc3m/ANALYSE-v1 | common/lib/xmodule/xmodule/seq_module.py | 12 | 17301 | """
xModule implementation of a learning sequence
"""
# pylint: disable=abstract-method
import collections
import json
import logging
from pkg_resources import resource_string
import warnings
from lxml import etree
from xblock.core import XBlock
from xblock.fields import Integer, Scope, Boolean, String
from xblock.fr... | agpl-3.0 |
SRabbelier/Melange | thirdparty/google_appengine/lib/django_1_2/django/core/cache/backends/base.py | 46 | 4723 | "Base Cache class."
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRuntimeWarning):
pass
# Memcached does not accept keys longer than this.
MEMCACHE_MAX_KEY_LENGTH = 250
cl... | apache-2.0 |
edxnercel/edx-platform | lms/lib/courseware_search/test/test_lms_search_initializer.py | 23 | 5404 | """
Tests for the lms_search_initializer
"""
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.partitions.partitions import Group, UserPartition
from xmodule.modulestore.django import modulestore
from courseware.tests.factories import UserFactory
from courseware.tests.test_masque... | agpl-3.0 |
marc-sensenich/ansible | lib/ansible/modules/storage/netapp/na_elementsw_network_interfaces.py | 8 | 10980 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or
# https://www.gnu.org/licenses/gpl-3.0.txt)
'''
Element Software Node Network Interfaces - Bond 1G and 10G configuration
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METAD... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.