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
wangjun/shortUrl-1
shortUrl/app.py
2
1658
#coding:UTF-8 """ 短网址生成器 @author:yubang 2015-06-06 """ from flask import Blueprint,render_template,make_response,request,abort,redirect from werkzeug.contrib.cache import SimpleCache from models import Session,UrlModel import hashlib,json sApp=Blueprint("shortUrl",__name__) cache=SimpleCache() @sApp.route("/") def...
apache-2.0
spasiva/pocztowy_konwerter
konwerter.py
1
7143
#!/usr/bin/python3 # # Copyright (C) 2017 Łukasz Kopacz # # This file is part of Pocztowy konwerter. # # Pocztowy konwerter 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 #...
gpl-3.0
codenrhoden/ceph-deploy
ceph_deploy/cli.py
3
5392
import pkg_resources import argparse import logging import textwrap import os import sys import ceph_deploy from ceph_deploy import exc, validate from ceph_deploy.util import log from ceph_deploy.util.decorators import catches LOG = logging.getLogger(__name__) __header__ = textwrap.dedent(""" -^- / \\ |...
mit
tiankangkan/paper_plane
treasure/sync_db.py
1
1031
import sys import os def current_file_directory(): return os.path.dirname(os.path.realpath(__file__)) BASE_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(BASE_DIR) from paper_plane import django_models_init from treasure.models import FileMapping from k_util.hash_util import...
gpl-3.0
Benrflanders/Pytris
pyglet/canvas/carbon.py
39
8766
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' from pyglet import app from base import Display, Screen, ScreenMode, Canvas from pyglet.libs.darwin import * from pyglet.libs.darwin import _oscheck class CarbonDisplay(Display): # TODO: CarbonDisplay could be per display d...
mit
dabrze/CheckMyBlob
GatherData/ignored_res.py
1
4949
ELEMENTS_ELECTRONS = { "H":1, "HE":2, "LI":3, "BE":4, "B":5, "C":6, "N":7, "O":8, "F":9, "NE":10, "NA":11, "MG":12, "AL":13, "SI":14, "P":15, "S":16, "CL":17, "AR":18, "K":19, "CA":20, "SC":21, "TI":22, "V":23, "CR":24, "MN":25, "FE":26, "CO":27, "NI":28, "CU":29, "ZN":30, "GA":31, "GE":32, "AS":33, "SE":3...
mit
City-of-Bloomington/green-rental
requests/packages/charade/latin1prober.py
50
5387
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer....
agpl-3.0
Zord13appdesa/python-for-android
python-build/python-libs/gdata/src/gdata/sample_util.py
133
7858
#!/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 applicable ...
apache-2.0
hastexo/edx-configuration-old
playbooks/roles/gh_mirror/files/repos_from_orgs.py
79
3314
#!/usr/bin/python # Given a list of repos in a yaml # file will create or update mirrors # # Generates /var/tmp/repos.json from # a yaml file containing a list of # github organizations import yaml import sys import requests import json import subprocess import os import logging import fcntl from os.path imp...
agpl-3.0
apple/llvm-project
lldb/test/API/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
8
3110
""" Test lldb data formatter subsystem. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class DataFormatterDisablingTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): # Call super's setUp(...
apache-2.0
gtsapelas/TRANSrisk_fcm_project
TRANSrisk_fcm_project/settings_management/base_settings.py
1
4279
""" Django settings for TRANSrisk_fcm_project project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ ...
mit
Softmotions/edx-platform
openedx/core/lib/xblock_utils.py
80
15736
""" Functions that can are used to modify XBlock fragments for use in the LMS and Studio """ import datetime import json import logging import static_replace import uuid import markupsafe from lxml import html, etree from contracts import contract from django.conf import settings from django.utils.timezone import UTC...
agpl-3.0
njase/numpy
numpy/f2py/__init__.py
63
2038
#!/usr/bin/env python """Fortran to Python Interface Generator. """ from __future__ import division, absolute_import, print_function __all__ = ['run_main', 'compile', 'f2py_testing'] import sys from . import f2py2e from . import f2py_testing from . import diagnose run_main = f2py2e.run_main main = f2py2e.main de...
bsd-3-clause
cleech/linux
Documentation/sphinx/rstFlatTable.py
377
13488
#!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- # pylint: disable=C0330, R0903, R0912 u""" flat-table ~~~~~~~~~~ Implementation of the ``flat-table`` reST-directive. :copyright: Copyright (C) 2016 Markus Heiser :license: GPL Version 2, June 1991 see linux/COPYING for details. ...
gpl-2.0
Dhanayan123/indivo_server
indivo/views/pha.py
3
15345
""" .. module:: views.pha :synopsis: Indivo view implementations for userapp-related calls. .. moduleauthor:: Daniel Haas <daniel.haas@post.harvard.edu> .. moduleauthor:: Ben Adida <ben@adida.net> """ import urllib, urlparse import logging from base import * from oauth.djangoutils import extract_request from oaut...
gpl-3.0
mfherbst/spack
var/spack/repos/builtin/packages/fastjar/package.py
5
1599
############################################################################## # 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
lundjordan/slaveapi
slaveapi/web/__init__.py
1
1275
from flask import Flask from .results import Results from .slave import Reboot, Slave, ShutdownBuildslave, GetUptime, GetLastActivity from .slave import Disable, AWSTerminateInstance from .slaves import Slaves app = Flask(__name__) app.add_url_rule("/results", view_func=Results.as_view("results"), methods=["GET"]) a...
mpl-2.0
olegnev/dx-toolkit
src/python/dxpy/bindings/dxanalysis.py
2
6417
# Copyright (C) 2013-2015 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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.a...
apache-2.0
jreese/nib
nib/yaml.py
2
1111
from __future__ import absolute_import, division, print_function, unicode_literals import re import yaml document_marker = re.compile(r'^---\s*$', re.M) try: from yaml import CSafeLoader as SafeLoader from yaml import CSafeDumper as SafeDumper except ImportError: from yaml import SafeLoader, SafeDumper ...
mit
JohnLunzer/flexx
docs/scripts/uiexample.py
1
6956
""" Small sphinx extension to show a UI example + result """ import os import sys import hashlib import warnings import subprocess import importlib.util from sphinx.util.compat import Directive from docutils import nodes from flexx import app THIS_DIR = os.path.abspath(os.path.dirname(__file__)) ROOT_DIR = os.path....
bsd-2-clause
bharmon/rvibackend
web/sota/migrations/0005_auto_20141009_2207.py
8
1345
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sota', '0004_auto_20141009_2152'), ] operations = [ migrations.CreateModel( name='Retry', fields=[ ...
mpl-2.0
OryanMo/itchy-broccoli
populatetables.py
1
3174
#!/usr/bin/python3 import selenium.webdriver.support.ui as ui from time import sleep from selenium import webdriver import sqlite3 from datetime import datetime from pyvirtualdisplay import Display from pathlib import Path db = sqlite3.connect('/root/itchy-broccoli/db/moviedb.db') cinemas = db.cursor() #cursor.execut...
gpl-3.0
cnewcome/sos
sos/plugins/ssh.py
12
1157
# Copyright (C) 2007 Red Hat, Inc., Eugene Teo <eteo@redhat.com> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # Thi...
gpl-2.0
taaviteska/django
tests/cache/tests.py
13
91107
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import tempfile import threading import time import unittest import warnings from unittest import mock from django.conf import settings from django.core...
bsd-3-clause
artwr/airflow
airflow/sensors/s3_prefix_sensor.py
5
3458
# -*- coding: utf-8 -*- # # 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
RichardLitt/wyrd-django-dev
django/conf/locale/fr/formats.py
13
1594
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i:s' DATE...
bsd-3-clause
telwertowski/QGIS
tests/src/python/test_qgsserver_response.py
45
2326
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServerResponse. From build dir, run: ctest -R PyQgsServerResponse -V .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of t...
gpl-2.0
arante/pyloc
py3/py344-tutor/ch11-stdlib2/lists_tools.py
2
1961
#! /usr/bin/env python3 # # lists_tools.py # Tools for working with lists. # # Author: Billy Wilson Arante # Created: 03/31/2016 PHT # Citation: https://docs.python.org/3.4/tutorial/stdlib2.html # def array_mod(): """The array module. It provides an array() object that is like a list that stores only ...
gpl-3.0
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/html/entities.py
48
75315
"""HTML character entity references.""" __all__ = ['html5', 'name2codepoint', 'codepoint2name', 'entitydefs'] # maps the HTML entity name to the Unicode code point name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital ...
apache-2.0
anybox/anybox.buildbot.odoo
anybox/buildbot/openerp/utils.py
1
3465
import os import hashlib import subprocess BUILD_UTILS_PATH = os.path.join(os.path.split(__file__)[0], 'build_utils') # can be overridden from command line tools such as update-mirrors, # for the version that has the buildbot hooks. vcs_binaries = dict(bzr='bzr', hg='hg', git='git') def ez_hash(url): """Return...
agpl-3.0
onto/sonata
sonata/preferences.py
1
38992
""" This module provides a user interface for changing configuration variables. Example usage: import preferences ... prefs = preferences.Preferences() prefs.on_prefs_real(self.window, self.prefs_window_response, tab callbacks...) """ import gettext import gtk from consts import consts from config import Config fro...
gpl-3.0
jfmartinez64/test
couchpotato/core/media/_base/searcher/__init__.py
42
3170
from .main import Searcher def autoload(): return Searcher() config = [{ 'name': 'searcher', 'order': 20, 'groups': [ { 'tab': 'searcher', 'name': 'searcher', 'label': 'Basics', 'description': 'General search options', 'options': [ ...
gpl-3.0
tedder/ansible
lib/ansible/modules/network/f5/bigip_selfip.py
14
26814
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2016, 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
x303597316/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/gdal/tests/test_ds.py
109
11098
import os from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA from django.utils import unittest from django.utils.unittest import skipUnless if HAS_GDAL: from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, O...
apache-2.0
ltilve/ChromiumGStreamerBackend
tools/usb_gadget/mouse_gadget.py
101
5065
# 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. """Implementation of a USB HID mouse. Two classes are provided by this module. The MouseFeature class implements the core functionality of a HID mouse and c...
bsd-3-clause
nborggren/zipline
tests/risk/test_risk_cumulative.py
4
5028
# # Copyright 2015 Quantopian, 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
newvem/pytz
pytz/zoneinfo/Mexico/BajaNorte.py
9
6571
'''tzinfo timezone information for Mexico/BajaNorte.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class BajaNorte(DstTzInfo): '''Mexico/BajaNorte timezone definition. See datetime.tzinfo for details''' zone = 'Mexico/BajaNor...
mit
sunqb/oa_qian
flask/Lib/encodings/koi8_u.py
593
14018
""" Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='stri...
apache-2.0
mkasick/android_kernel_samsung_jfltespr
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # 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. import errno, os FUTEX_WAIT = 0...
gpl-2.0
acercado/jd-ph-cms
jd-ph-cms/myuser/migrations/0001_initial.py
1
1377
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-29 10:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='MyUser'...
bsd-3-clause
SrNetoChan/QGIS
python/plugins/processing/modeler/ModelerParameterDefinitionDialog.py
31
11770
# -*- coding: utf-8 -*- """ *************************************************************************** ModelerParameterDefinitionDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******...
gpl-2.0
kvar/ansible
test/units/modules/storage/netapp/test_netapp_e_hostgroup.py
23
9082
# (c) 2018, NetApp 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 from ansible.modules.storage.netapp.netapp_e_hostgroup import NetAppESeriesHostGroup from units.modules.utils impo...
gpl-3.0
napkindrawing/ansible
lib/ansible/modules/network/cloudengine/ce_sflow.py
26
52254
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
Daniel-CA/odoo
addons/payment/tests/common.py
392
1822
# -*- coding: utf-8 -*- from openerp.tests import common class PaymentAcquirerCommon(common.TransactionCase): def setUp(self): super(PaymentAcquirerCommon, self).setUp() self.payment_acquirer = self.registry('payment.acquirer') self.payment_transaction = self.registry('payment.transactio...
agpl-3.0
zehortigoza/ardupilot
mk/PX4/Tools/genmsg/src/genmsg/deps.py
216
3993
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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 ...
gpl-3.0
swapnakrishnan2k/tp-qemu
qemu/tests/qemu_img.py
5
26931
import os import time import re import logging import commands import shutil import tempfile from autotest.client.shared import error from autotest.client.shared import utils from virttest import utils_misc from virttest import env_process from virttest import storage from virttest import data_dir from virttest impor...
gpl-2.0
vipul-sharma20/oh-mainline
vendor/packages/python-social-auth/social/backends/twilio.py
81
1384
""" Amazon auth backend, docs at: http://psa.matiasaguirre.net/docs/backends/twilio.html """ from re import sub from social.p3 import urlencode from social.backends.base import BaseAuth class TwilioAuth(BaseAuth): name = 'twilio' ID_KEY = 'AccountSid' def get_user_details(self, response): ""...
agpl-3.0
joebowen/LogMyRocket_API
LogMyRocket/libraries/sys_packages/docutils/docutils/parsers/rst/languages/it.py
128
3270
# $Id: it.py 7119 2011-09-02 13:00:23Z milde $ # Authors: Nicola Larosa <docutils@tekNico.net>; # Lele Gaifax <lele@seldati.it> # Copyright: This module has been placed in the public domain. # Beware: the italian translation of the reStructuredText documentation # at http://docit.bice.dyndns.org/static/ReST, ...
gpl-3.0
takeshineshiro/python-mode
pymode/libs/pylama/main.py
7
2528
"""Pylama's shell support.""" from __future__ import absolute_import, with_statement import sys from os import walk, path as op from .config import parse_options, CURDIR, setup_logger from .core import LOGGER, run from .async import check_async def check_path(options, rootdir=None, candidates=None, code=None): ...
lgpl-3.0
manahl/arctic
arctic/chunkstore/tools/tools.py
1
1508
from itertools import groupby import pymongo from arctic.chunkstore.chunkstore import SYMBOL, SEGMENT, START def segment_id_repair(library, symbol=None): """ Ensure that symbol(s) have contiguous segment ids Parameters ---------- library: arctic library symbol: None, str, list of str ...
lgpl-2.1
kebugcheckex/radon
apache_monitor/backend/logfilter.py
1
2862
# URL Filter for Log Monitor import urllib.parse import config import dbo import messaging import utils cacheable_params = None host_ignore_list = None url_ignore_pattern = None agent_ignore_pattern = None def load_cacheable_param(): global cacheable_params cacheable_params = dbo.load_string_list('cacheable...
gpl-3.0
mfortner/MyPythonKoans
python3/koans/about_proxy_object_project.py
7
4377
#!/usr/bin/env python # -*- coding: utf-8 -*- # Project: Create a Proxy Class # # In this assignment, create a proxy class (one is started for you # below). You should be able to initialize the proxy object with any # object. Any attributes called on the proxy object should be forwarded # to the target object. As e...
mit
mlabru/ptracks
model/newton/cine/prc_dir_ponto.py
1
3353
#!/usr/bin/env python # -*- coding: utf-8 -*- """ --------------------------------------------------------------------------------------------------- prc_dir_ponto revision 0.2 2015/nov mlabru pep8 style conventions revision 0.1 2014/nov mlabru initial version (Linux/Python) --------------------------------------...
gpl-3.0
zlsun/XX-Net
code/default/python27/1.0/lib/bdb.py
144
21714
"""Debugger basics""" import fnmatch import sys import os import types __all__ = ["BdbQuit","Bdb","Breakpoint"] class BdbQuit(Exception): """Exception to give up completely""" class Bdb: """Generic Python debugger base class. This class takes care of details of the trace facility; a derived class...
bsd-2-clause
shane-breeze/DMPlots
python/signalModel.py
1
1512
import os import glob import re from Utils import getLimitsFromFile class SignalModel: def __init__(self, path): """ Initalise: * _path = stats output for this signal model * _model = name of signal model (taken from the path) """ path = path.replace('\n','') ...
gpl-3.0
al1221/ghost-openshift
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/token.py
365
5662
# -*- coding: utf-8 -*- """ pygments.token ~~~~~~~~~~~~~~ Basic token types and the standard tokens. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ class _TokenType(tuple): parent = None def split(self): buf = [] ...
mit
andela-bojengwa/talk
venv/lib/python2.7/site-packages/pip/_vendor/distlib/resources.py
210
9664
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import bisect import io import logging import os import pkgutil import shutil import sys import types...
mit
flexiant/xen
tools/python/xen/web/SrvBase.py
44
3290
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
moazzemi/HAMEX
cpu/gem5/ext/ply/test/yacc_noerror.py
174
1473
# ----------------------------------------------------------------------------- # yacc_noerror.py # # No p_error() rule defined. # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import token...
mit
apark263/tensorflow
tensorflow/python/client/timeline_test.py
6
8542
# 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
gangadhar-kadam/adb-erp
accounts/doctype/pos_setting/pos_setting.py
6
2060
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
agpl-3.0
kramwens/order_bot
venv/lib/python2.7/site-packages/tests/test_validation.py
14
2219
# -*- coding: utf-8 -*- import unittest from nose.tools import assert_equal, assert_true from six import b, u from twilio.util import RequestValidator class ValidationTest(unittest.TestCase): def setUp(self): token = "1c892n40nd03kdnc0112slzkl3091j20" self.validator = RequestValidator(token) ...
mit
hojel/epubia
epubgen.py
3
7248
# -*- coding: utf-8 -*- # ePUB generator with Cheetah template # input: {'title', 'author', 'isbn', 'cover_url', 'chapter'} import sys __program__ = sys.modules['__main__'].__program__ __version__ = sys.modules['__main__'].__version__ OPS_DIR = 'OPS' import re IMG_PTN = re.compile('<img [^>]*src="(.*?)"',re.M) C...
mit
golden1232004/vnpy
vn.event/eventEngine.py
44
6651
# encoding: UTF-8 # 系统模块 from Queue import Queue, Empty from threading import Thread # 第三方模块 from PyQt4.QtCore import QTimer # 自己开发的模块 from eventType import * ######################################################################## class EventEngine: """ 事件驱动引擎 事件驱动引擎中所有的变量都设置为了私有,这是为了防止不小心 从外部修改了...
mit
jbeluch/hyde
tests/test_path_util.py
49
1823
""" uses py.test sudo easy_install py http://codespeak.net/py/dist/test.html """ from hydeengine.path_util import PathUtil def test_filter_hidden_inplace(): # Empty lists are not modified. empty_item_list = [] PathUtil.filter_hidden_inplace(empty_item_list) assert empty_item_list == [] # .ht...
mit
marcli/sos
sos/plugins/foreman.py
2
1257
# Copyright (C) 2013 Red Hat, Inc., Lukas Zapletal <lzap@redhat.com> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #...
gpl-2.0
maheshp/novatest
nova/tests/test_virt_disk_vfs_guestfs.py
8
7221
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012 Red Hat, 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...
apache-2.0
andersroos/rankedftw
main/update.py
1
16666
import json import socket from collections import deque from datetime import timedelta from logging import getLogger, INFO, WARNING from time import sleep from django.db import transaction from common.utils import utcnow, to_unix, StoppableThread from main.battle_net import BnetClient, ApiLadder from main.client import...
agpl-3.0
megmogmog1965/awscostchart
server/util.py
1
6428
#!/usr/bin/env python # encoding: utf-8 ''' Created on Aug 4, 2016 :author: Yusuke Kawatsu ''' # built-in modules. import os import copy import time import shutil import codecs import sqlite3 import tempfile import datetime # installed modules. from flask import request # my modules. from http_error import make_ht...
mit
cdrooom/odoo
addons/payment/models/payment_acquirer.py
2
25513
# -*- coding: utf-'8' "-*-" import logging from openerp.osv import osv, fields from openerp.tools import float_round, float_repr from openerp.tools.translate import _ _logger = logging.getLogger(__name__) def _partner_format_address(address1=False, address2=False): return ' '.join((address1 or '', address2 or ...
agpl-3.0
andyzsf/django
django/template/response.py
13
6220
from django.http import HttpResponse from django.template import loader, Context, RequestContext from django.utils import six class ContentNotRenderedError(Exception): pass class SimpleTemplateResponse(HttpResponse): rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks'] def __in...
bsd-3-clause
SteveXiSong/ECE757-SnoopingPredictions
src/arch/x86/isa/insts/simd128/floating_point/compare/compare_and_write_mask.py
91
4403
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
lihui7115/ChromiumGStreamerBackend
chrome/common/extensions/docs/server2/PRESUBMIT.py
36
2930
# 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. """Presubmit script for changes affecting extensions docs server See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more de...
bsd-3-clause
roopali8/keystone
keystone/contrib/example/core.py
11
3664
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
looker/sentry
src/sentry/db/deletion.py
4
4242
from __future__ import absolute_import from datetime import timedelta from django.db import connections, router from django.utils import timezone from sentry.utils import db class BulkDeleteQuery(object): def __init__(self, model, project_id=None, dtfield=None, days=None, order_by=None): self.model = mo...
bsd-3-clause
jiangzhixiao/odoo
addons/account_voucher/report/account_voucher_sales_receipt.py
326
5808
############################################################################## # # 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 Public L...
agpl-3.0
openbmc/openbmc-test-automation
lib/gen_plug_in_utils.py
1
23809
#!/usr/bin/env python r""" This module provides functions which are useful to plug-in call point programs. """ import sys import os import re import collections import gen_print as gp import gen_valid as gv import gen_misc as gm import gen_cmd as gc import func_args as fa PLUG_VAR_PREFIX = os.environ.get("PLUG_VAR_...
apache-2.0
tudennis/LeetCode---kamyu104-11-24-2015
Python/string-compression.py
2
2111
# Time: O(n) # Space: O(1) # Given an array of characters, compress it in-place. # The length after compression must always be smaller than or equal to the original array. # Every element of the array should be a character (not int) of length 1. # After you are done modifying the input array in-place, return the new ...
mit
Shrews/PyGerrit
webapp/django/utils/tree.py
24
5759
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ from copy import deepcopy class Node(object): """ A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being either leaf nodes or other Node instances. ...
apache-2.0
dmort27/pylid
pylid/langs/el.py
1
736889
#!/usr/bin/env python # -*- coding: utf-8 -*- import pylid from collections import Counter el = pylid.PyLID(3) el.total_ngrams = 207365496 el.lang = 'el' el.ngrams = Counter({ u'\u03b1\u03b9#': 1833955, u'#\u03c4\u03b7': 1792914, u'#\u03ba\u03b1': 1652081, u'#\u03c4\u03bf': 1512455, u'\u03bf\u03c5...
mit
sebalix/OpenUpgrade
addons/account_anglo_saxon/invoice.py
50
13086
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) # 2004-2010 Tiny SPRL (<http://tiny.be>). # 2009-2010 Veritos (http://veritos.nl). # All Rights Reserved # # This program is free software: you can redistri...
agpl-3.0
microhh/microhh
kernel_tuner/statistics.py
5
1185
import matplotlib.pyplot as pl import numpy as np import json import glob pl.close('all') pl.ion() def get_timings(kernel_name, gridsizes): dt = np.zeros_like(gridsizes, dtype=float) for i,gridsize in enumerate(gridsizes): with open( '{0}_{1:03d}.json'.format(kernel_name, gridsize) ) as f: ...
gpl-3.0
hassoon3/odoo
addons/delivery/__init__.py
376
1103
# -*- 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
loopingz/nuxeo-drive
nuxeo-drive-client/nxdrive/tests/test_conflicts.py
3
6920
import os import time from nxdrive.tests.common import OS_STAT_MTIME_RESOLUTION from nxdrive.tests.common import IntegrationTestCase from nxdrive.client import LocalClient from nose.plugins.skip import SkipTest class TestConflicts(IntegrationTestCase): def setUp(self): super(TestConflicts, self).setUp()...
lgpl-2.1
seem-sky/cocos2d-x-samples
samples/SwiftTetris/cocos2d/tools/particle/convert_YCoordFlipped.py
124
2224
#!/usr/bin/python #ConvertYCoordFlipped.py import plistlib import os.path import argparse import glob import shutil #keys in dictionary metaDataKey = 'metaData' yCoordFlippedConvertedKey = 'yCoordFlippedConverted' yCoordFlippedKey = 'yCoordFlipped' #check if the particle file has been converted def checkFlippedConve...
mit
leandrodemarcovedelago/thesis-aco
CspAco.py
1
2628
#!/usr/bin/env python #-*- encoding: utf-8 -*- import time import networkx as nx from Functions import buildGraph, cost, updatePheromone, isSolution, \ buildSaturatedGraph, sensTotal import Ant import sys def runExperiment(samples, scenario1, tau_min, tau_max): g, numPaths, numSol...
gpl-3.0
totalgee/supercollider
editors/sced/scedwin/py/LogPanel.py
44
1478
# sced (SuperCollider mode for gedit) # # Copyright 2012 Jakob Leben # Copyright 2009 Artem Popov and other contributors (see AUTHORS) # # sced 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, ei...
gpl-3.0
edmstudio/ansible
lib/ansible/plugins/lookup/flattened.py
103
2506
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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)...
gpl-3.0
ahmedaljazzar/edx-platform
openedx/features/enterprise_support/api.py
1
24868
""" APIs providing support for enterprise functionality. """ import logging from functools import wraps from django.conf import settings from django.contrib.auth.models import User from django.core.cache import cache from django.urls import reverse from django.shortcuts import redirect from django.template.loader impo...
agpl-3.0
SPxiaomin/NodeJs_Practice
Express4_3/nodejs-demo/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/murphy.py
135
2751
# -*- coding: utf-8 -*- """ pygments.styles.murphy ~~~~~~~~~~~~~~~~~~~~~~ Murphy's style from CodeRay. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment,...
mit
stewartsmith/bzr
bzrlib/tests/test_ignores.py
2
8440
# Copyright (C) 2006-2011 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distribute...
gpl-2.0
django-extensions/django-extensions
tests/db/fields/test_uniq_field_mixin_compat.py
1
5584
# -*- coding: utf-8 -*- try: from unittest import mock except ImportError: import mock import six from django.db import models from django.test import TestCase from tests.testapp.models import ( DummyRelationModel, InheritedFromPostWithUniqFieldCompat, PostWithUniqFieldCompat, ReverseModelCompat, Secon...
mit
kharts/kastodi
resources/lib/google/protobuf/internal/descriptor_pool_test1_pb2.py
43
20686
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/descriptor_pool_test1.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from goog...
gpl-2.0
drnextgis/QGIS
tests/src/python/test_qgsnullsymbolrenderer.py
5
3380
# -*- coding: utf-8 -*- """ *************************************************************************** test_qgsnullsymbolrenderer.py ----------------------------- Date : April 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at gmail dot ...
gpl-2.0
PLyczkowski/Sticky-Keymap
2.74/scripts/addons_contrib/oscurart_mesh_thread.py
2
3106
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-2.0
ambikeshwar1991/sandhi-2
module/gr36/grc/gui/Preferences.py
40
2905
""" Copyright 2008 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ...
gpl-3.0
rojkov/taskqueue
tests/test_confparser.py
1
1196
import unittest import io import taskqueue.confparser TEST_CONFIG = """ [DEFAULT] non_override = defvalue key1 = value1 override = defvalue [section] key1 = section_value1 key2 = section_value2 """ class TestConfigParser(unittest.TestCase): """Tests for ConfigParser.""" def setUp(self): pass d...
gpl-2.0
greeenSY/Tstream
tstream-server/bin/jstorm.py
1
15194
#!/usr/bin/python import os import sys import random import subprocess as sub import getopt def identity(x): return x def cygpath(x): command = ["cygpath", "-wp", x] p = sub.Popen(command,stdout=sub.PIPE) output, errors = p.communicate() lines = output.split("\n") return lines[0] if sys.plat...
apache-2.0
wavelets/alpha
pau/presenters/widgets.py
3
1085
from paucore.utils.presenters import html def file_upload_progress(image_name='', uploaded=False): hide_progress = 'hide' text_class = '' if uploaded: hide_progress = 'plain' text_class = ' text-success' return html.div(class_='file-related yui3-u', *[ html.div(class_='hide', ...
mit
pli3/enigma2-git
lib/python/Screens/Scart.py
30
1774
from Screen import Screen from MessageBox import MessageBox from Components.AVSwitch import AVSwitch from Tools import Notifications class Scart(Screen): def __init__(self, session, start_visible=True): Screen.__init__(self, session) self.msgBox = None self.notificationVisible = None self.avswitch = AVSwitch...
gpl-2.0