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
myles/formspree
formspree/log.py
10
1107
import sys import os import datetime import settings _LEVEL_MAP = { 'debug': 4, 'info': 3, 'warning': 2, 'error': 1 } def _header(level): return settings.SERVICE_NAME+":"+level+' '+datetime.datetime.now().isoformat()+" |" def _handler_stats(handler): stats = handler.request.method+" "+\ ...
agpl-3.0
tsfs/Vybrid-Linux
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
elelsee/pycfn-elasticsearch
pycfn_elasticsearch/vendored/docutils/languages/zh_tw.py
148
2771
# -*- coding: utf-8 -*- # $Id: zh_tw.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Joe YS Jaw <joeysj@users.sourceforge.net> # 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...
apache-2.0
ville-k/tensorflow
tensorflow/examples/tutorials/monitors/iris_monitors.py
86
3191
# 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 appl...
apache-2.0
RomanticStrings/lilypond-git
scripts/auxiliar/texi-langutils.py
8
9223
#!/usr/bin/env python # texi-langutils.py # WARNING: this script can't find files included in a different directory import sys import re import getopt import os import langdefs def read_pipe (command): print command pipe = os.popen (command) output = pipe.read () if pipe.close (): print "pip...
gpl-3.0
tpircher/pycrc
pycrc/__main__.py
1
1333
#!/usr/bin/env python # pycrc -- parameterisable CRC calculation utility and C source code generator # # Copyright (c) 2006-2017 Thomas Pircher <tehpeh-web@tty1.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softwa...
mit
jstnlef/pika
pika/connection.py
9
60804
"""Core connection objects""" import ast import sys import collections import logging import math import platform import threading import urllib import warnings if sys.version_info > (3,): import urllib.parse as urlparse else: import urlparse from pika import __version__ from pika import callback from pika im...
bsd-3-clause
Omegaphora/external_chromium-trace
trace-viewer/third_party/pywebsocket/src/test/test_endtoend.py
29
18570
#!/usr/bin/env python # # 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...
bsd-3-clause
botswana-harvard/edc-meta-data
edc_metadata/tests/test_view_mixin.py
2
5753
from django.http.request import HttpRequest from django.test import TestCase, tag from django.views.generic.base import ContextMixin from edc_appointment.constants import INCOMPLETE_APPT from edc_appointment.creators import UnscheduledAppointmentCreator from edc_appointment.models import Appointment from edc_base impor...
gpl-2.0
godaddy/Thespian
examples/multi_system/act6/app.py
1
2982
from thespian.actors import * from datetime import timedelta from encoder import EncodeThis, Encoded, Encoder, Base64Encoder, Rot13Encoder from morse import MorseEncoder class Acceptor(ActorTypeDispatcher): def __init__(self, *args, **kw): super(Acceptor, self).__init__(*args, **kw) # The analyze...
mit
brodyberg/autorest
Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py
3
4620
# coding=utf-8 # -------------------------------------------------------------------------- # -------------------------------------------------------------------------- from msrest.serialization import Model class StorageAccountProperties(Model): """StorageAccountProperties :param provisioning_state: Gets t...
mit
zasdfgbnm/tensorflow
tensorflow/contrib/opt/python/training/variable_clipping_optimizer.py
133
5903
# 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
shepdelacreme/ansible
lib/ansible/modules/cloud/amazon/lightsail.py
40
15620
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
Passw/gn_GFW
build/android/gyp/proguard.py
1
3458
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import os import sys from util import build_utils from util import proguard_util _DANGEROUS_OPTIMIZATIONS = [ ...
gpl-3.0
SoftwareHeritage/swh-web-ui
swh/web/common/migrations/0003_saveoriginrequest_loading_task_status.py
1
1761
# Copyright (C) 2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU Affero General Public License version 3, or any later version # See top-level LICENSE file for more information # flake8: noqa from __future__ import unicode_literals from djan...
agpl-3.0
ojengwa/odoo
addons/mail/res_partner.py
379
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
mahak/nova
nova/tests/functional/regressions/test_bug_1522536.py
2
2162
# Copyright 2016 HPE, 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 writing, s...
apache-2.0
wolf31o2/catalyst
modules/catalyst/target/tinderbox.py
2
1230
""" builder class for the tinderbox target """ from generic_stage import * import catalyst.util from catalyst.error import * from catalyst.spawn import cmd class tinderbox_target(generic_stage_target): depends = ('system', 'stage3') def __init__(self): generic_stage_target.__init__(self) self.required_value...
gpl-2.0
lyusupov/Argus
src/init/ColorduinoPutChar.py
1
5002
#!/usr/bin/env python # -*- coding: utf-8 -*- # import serial import struct from time import sleep from sys import argv font = [] font += [ 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00] # /* 0 */ font += [ 0x00, 0x08, 0x38, 0x08, 0x08, 0x08, 0x08, 0x00] # /* 1 */ font += [ 0x00, 0x38, 0x44, 0x08, 0x10, 0x20, 0x7C, ...
gpl-2.0
alikins/ansible
lib/ansible/utils/module_docs_fragments/nxos.py
10
4355
# # (c) 2015, Peter Sprygada <psprygada@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 Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
kevalds51/sympy
sympy/simplify/tests/test_ratsimp.py
62
1792
from sympy import ratsimpmodprime, ratsimp, Rational, sqrt, pi, log, erf from sympy.abc import x, y, z, t, a, b, c, d, e, f, g, h, i, k def test_ratsimp(): f, g = 1/x + 1/y, (x + y)/(x*y) assert f != g and ratsimp(f) == g f, g = 1/(1 + 1/x), 1 - 1/(x + 1) assert f != g and ratsimp(f) == g f, ...
bsd-3-clause
gurch101/rosalind
subs.py
1
1044
""" Given two strings s and t, t is a substring of s if t is contained as a contiguous collection of symbols in s (as a result, t must be no longer than s). The position of a symbol in a string is the total number of symbols found to its left, including itself (e.g., the positions of all occurrences of 'U' in "AUGCUUC...
mit
kernelmilowill/PDMQBACKTEST
vn.ksotp/pyscript/generate_td_functions.py
25
10306
# encoding: UTF-8 __author__ = 'CHENXY' from string import join from ksotp_struct import structDict def processCallBack(line): orignalLine = line line = line.replace('\tvirtual void ', '') # 删除行首的无效内容 line = line.replace('{};\n', '') # 删除行尾的无效内容 content = line.split('(') cb...
mit
foss-transportationmodeling/rettina-server
flask/local/lib/python2.7/site-packages/whoosh/matching/mcore.py
91
18841
# Copyright 2010 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
apache-2.0
pelikanchik/edx-platform
lms/djangoapps/open_ended_grading/staff_grading_service.py
3
14909
""" This module provides views that proxy to the staff grading backend service. """ import json import logging from django.conf import settings from django.http import HttpResponse, Http404 from django.utils.translation import ugettext as _ from xmodule.course_module import CourseDescriptor from xmodule.open_ended_g...
agpl-3.0
Shrhawk/edx-platform
common/djangoapps/student/tests/test_bulk_email_settings.py
113
5761
""" Unit tests for email feature flag in student dashboard. Additionally tests that bulk email is always disabled for non-Mongo backed courses, regardless of email feature flag, and that the view is conditionally available when Course Auth is turned on. """ import unittest from django.conf import settings from django....
agpl-3.0
cwolferh/heat-scratch
heat/engine/parameters.py
1
22206
# # 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
Antergos/Cnchi
src/pages/dialogs/luks_settings.py
1
7627
#!/usr/bin/env python # -*- coding: utf-8 -*- # # luks_settings.py # # Copyright © 2013-2018 Antergos # # This file is part of Cnchi. # # Cnchi 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 ...
gpl-3.0
flipjack/suventa
allauth/socialaccount/adapter.py
42
6784
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.core.exceptions import ValidationError from ..utils import (import_attribute, email_address_exists, valid_email_or_none) fro...
bsd-3-clause
LeartS/odoo
addons/hr_timesheet_sheet/__openerp__.py
30
3042
# -*- 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
projectcalico/calico-nova
nova/tests/unit/api/ec2/test_api.py
17
24071
# Copyright 2010 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 compliance with the License. You may obtain # a ...
apache-2.0
pouyana/teireader
webui/applications/grid/controllers/appadmin.py
19
22872
# -*- coding: utf-8 -*- # ########################################################## # ## make sure administrator is on localhost # ########################################################### import os import socket import datetime import copy import gluon.contenttype import gluon.fileutils try: import pygraphvi...
mit
Ban3/Limnoria
plugins/Misc/config.py
6
4087
### # Copyright (c) 2004-2005, Jeremiah Fincher # 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 co...
bsd-3-clause
4DD8A19D69F5324F9D49D17EF78BBBCC/_disc_rete_optimi_zation_
coloring/orsolve.py
1
1912
# -*- coding: utf-8 -*- """ Created on Wed Mar 11 15:12:13 2015 @author: meow """ from ortools.constraint_solver import pywrapcp from networkx import nx def graph_coloring_problem_or(G,limit,fixed): n = G.number_of_nodes() solver = pywrapcp.Solver("Graph coloring") xs = [solver.IntVar(0,limit-1) for...
gpl-2.0
shendo/peerz
peerz/api.py
1
5606
# Peerz - P2P python library using ZeroMQ sockets and gevent # Copyright (C) 2014-2015 Steve Henderson # # 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...
gpl-3.0
FelipeEcker/XenGT-Preview-kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
ZuluPro/libcloud
libcloud/test/dns/test_rackspace.py
12
25938
# 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
UstadMobile/exelearning-extjs5-mirror
twisted/protocols/htb.py
17
8591
# -*- test-case-name: twisted.test.test_htb -*- # # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Hierarchical Token Bucket traffic shaping. Patterned after U{Martin Devera's Hierarchical Token Bucket traffic shaper for the Linux kernel<http://luxik.cdi.cz/~devik/qos/htb/>}. @se...
gpl-2.0
nelmiux/CarnotKE
jyhton/src/templates/simpleprettyspec.py
19
4587
# copyright 2004-2005 Samuele Pedroni import sys import types import cStringIO class MiniIndentPrinter: def __init__(self,output): self.out = output self.col = 0 self.indent_step = 4 def writeln(self,text): self.out.write(' '*self.col) self.out.write(text) ...
apache-2.0
Cysu/Person-Reid
scripts/learnattr.py
1
19552
#!/usr/bin/python2 # -*- coding: utf-8 -*- import os import numpy import attrconf_old as attrconf import bodyconf from reid.utils.cache_manager import CacheManager cachem = CacheManager(os.path.join('..', 'cache'), 'attr') @cachem.save('raw') def load_data(datasets): """Load images, corresponding body parts ma...
mit
sahiljain/catapult
telemetry/telemetry/internal/platform/system_info_unittest.py
24
2258
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.internal.platform import gpu_device from telemetry.internal.platform import gpu_info from telemetry.internal.platform import s...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/230_test_rgbimg.py
24
1645
# Testing rgbimg module import rgbimg, os, uu from test.test_support import verbose, unlink, findfile class error(Exception): pass print 'RGBimg test suite:' def testimg(rgb_file, raw_file): rgb_file = findfile(rgb_file) raw_file = findfile(raw_file) width, height = rgbimg.sizeofimage(rgb_file) ...
gpl-3.0
epam-mooc/edx-platform
common/djangoapps/student/migrations/0021_remove_askbot.py
188
11582
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models ASKBOT_AUTH_USER_COLUMNS = ( 'website', 'about', 'gold', 'email_isvalid', 'real_name', 'location', 'reputation', 'gravatar', 'bronze', 'last_seen', ...
agpl-3.0
tlatzko/spmcluster
.tox/docs/lib/python2.7/site-packages/pygments/lexers/_scilab_builtins.py
43
52405
# -*- coding: utf-8 -*- """ pygments.lexers._scilab_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Builtin list for the ScilabLexer. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ # Autogenerated commands_kw = ( 'abort', 'apropos...
bsd-2-clause
ByteInternet/libcloud
setup.py
1
5905
# 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
homme/ansible-modules-core
cloud/google/gce.py
98
18338
#!/usr/bin/python # Copyright 2013 Google 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 vers...
gpl-3.0
christiancg/indoor
venv/bin/activate_this.py
669
1129
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
apache-2.0
cihaterdal/limbo-android
jni/qemu/scripts/analyse-9p-simpletrace.py
333
9058
#!/usr/bin/env python # Pretty print 9p simpletrace log # Usage: ./analyse-9p-simpletrace <trace-events> <trace-pid> # # Author: Harsh Prateek Bora import os import simpletrace symbol_9p = { 6 : 'TLERROR', 7 : 'RLERROR', 8 : 'TSTATFS', 9 : 'RSTATFS', 12 : 'TLOPEN', 13 : 'RLOPEN', ...
gpl-2.0
erichegt/askbot-devel
askbot/deps/django_authopenid/models.py
10
2916
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import User from django.db import models import hashlib, random, sys, os, time __all__ = ['Nonce', 'Association', 'UserAssociation', 'UserPasswordQueueManager', 'UserPasswordQueue'] class Nonce(models.Model): """ op...
gpl-3.0
nicobustillos/odoo
addons/base_action_rule/__init__.py
438
1098
# -*- 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...
agpl-3.0
subrata4096/qfs-original
benchmarks/mstress/mstress_cleanup.py
11
1691
#!/usr/bin/env python # # $Id$ # # Copyright 2012 Quantcast Corp. # # 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 applic...
apache-2.0
pr-omethe-us/PyKED
setup.py
2
2445
from setuptools import setup from codecs import open from os import path import sys here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'pyked', '_version.py')) as version_file: exec(version_file.read()) with open(path.join(here, 'README.md')) as readme_file: readme = readme_file.read() wi...
bsd-3-clause
liberorbis/libernext
env/lib/python2.7/site-packages/IPython/parallel/tests/test_launcher.py
12
7017
"""Tests for launchers Doesn't actually start any subprocesses, but goes through the motions of constructing objects, which should test basic config. Authors: * Min RK """ #------------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distrib...
gpl-2.0
nurupo/toxme.se
barcode.py
2
1567
import qrcode import qrcode.image.svg import xml.etree.ElementTree as ET import io MAX_QR_CACHE_ENTRIES = 256 class QRImage(qrcode.image.svg.SvgPathFillImage): YUU_CACHE = {} QR_PATH_STYLE = "fill:#000;fill-opacity:1;fill-rule:nonzero;stroke:none" BACKGROUND_COLOUR = "rgba(255,255,255,0.9)" def _svg(...
bsd-3-clause
glomium/django-bmf
djangobmf/core/views/related.py
2
2141
#!/usr/bin/python # ex:set fileencoding=utf-8: from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from rest_framework.exceptions import NotFound from rest_framework.generics import GenericAPIView from rest_framework.mixins import ListModelMixin from djangobmf.core.pagina...
bsd-3-clause
wpt-on-tv-tf/wpt-tools
manifest/sourcefile.py
16
9471
import os import urlparse from fnmatch import fnmatch try: from xml.etree import cElementTree as ElementTree except ImportError: from xml.etree import ElementTree import html5lib import vcs from item import Stub, ManualTest, WebdriverSpecTest, RefTest, TestharnessTest from utils import rel_path_to_url, is_bla...
bsd-3-clause
apple/llvm-project
lldb/test/API/tools/lldb-vscode/breakpoint-events/TestVSCode_breakpointEvents.py
4
5906
""" Test lldb-vscode setBreakpoints request """ import unittest2 import vscode from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil import lldbvscode_testcase import os class TestVSCode_breakpointEvents(lldbvscode_testcase.VSCodeTestCaseBase): mydir ...
apache-2.0
jrichte43/ProjectEuler
Problem-0417/solutions.py
1
1397
__problem_title__ = "Reciprocal cycles II" __problem_url___ = "https://projecteuler.net/problem=417" __problem_description__ = "A unit fraction contains 1 in the numerator. The decimal " \ "representation of the unit fractions with denominators 2 to 10 are " \ "given...
gpl-3.0
OnePaaS/kafka
tests/kafkatest/services/mirror_maker.py
35
8125
# 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
deployfu/gitosis
gitosis/test/util.py
28
1692
from nose.tools import eq_ as eq import errno import os import shutil import stat import sys def mkdir(*a, **kw): try: os.mkdir(*a, **kw) except OSError, e: if e.errno == errno.EEXIST: pass else: raise def maketemp(): tmp = os.path.join(os.path.dirname(__fi...
gpl-2.0
Demolisty24/AlexaFood-Backend
venv/Lib/site-packages/pip/_vendor/progress/spinner.py
510
1314
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software 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 P...
mit
ShiYw/Sigil
3rdparty/python/Modules/_decimal/tests/bignum.py
52
1043
# # These tests require gmpy and test the limits of the 32-bit build. The # limits of the 64-bit build are so large that they cannot be tested # on accessible hardware. # import sys from decimal import * from gmpy import mpz _PyHASH_MODULUS = sys.hash_info.modulus # hash values to use for positive and negative infin...
gpl-3.0
ipernet/zulip
zerver/filters.py
124
1058
from __future__ import absolute_import from django.views.debug import SafeExceptionReporterFilter from django.http import build_request_repr class ZulipExceptionReporterFilter(SafeExceptionReporterFilter): def get_post_parameters(self, request): filtered_post = SafeExceptionReporterFilter.get_post_paramet...
apache-2.0
havt/odoo
addons/product_margin/wizard/__init__.py
444
1078
# -*- 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...
agpl-3.0
camagenta/youtube-dl
youtube_dl/extractor/espn.py
106
1940
from __future__ import unicode_literals from .common import InfoExtractor class ESPNIE(InfoExtractor): _VALID_URL = r'https?://espn\.go\.com/(?:[^/]+/)*(?P<id>[^/]+)' _WORKING = False _TESTS = [{ 'url': 'http://espn.go.com/video/clip?id=10365079', 'info_dict': { 'id': 'FkYWtma...
unlicense
jek/flatland
tests/markup/test_tag_context.py
2
8877
from tests.markup._util import alternate_expectation, desired_output def simple_schema(): from flatland import Form, String class SmallForm(Form): name = "test" valued = String empty = String return SmallForm({u'valued': u'val'}) ### value @desired_output('xhtml', simple_sche...
mit
NewpTone/stacklab-nova
nova/virt/vmwareapi/vmware_images.py
9
6899
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack 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 # # htt...
apache-2.0
DevinDewitt/pyqt5
examples/sql/relationaltablemodel.py
3
4110
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-3.0
bhenne/MoSP
mosp_examples/message_example.py
1
2993
#!/bin/env python """ A simple example for the usage of Person.send() - random movement - output to visual player, which is executed as child process - you may try the other commented monitor examples - you can choose a single or multiple monitors - print a message send to another person """ import sy...
gpl-3.0
pedrobaeza/odoo
addons/website_mail/tests/__init__.py
121
1117
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 20123TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
qdzheng/obfsproxy
obfsproxy/transports/b64.py
16
2437
#!/usr/bin/python # -*- coding: utf-8 -*- """ This module contains an implementation of the 'b64' transport. """ from obfsproxy.transports.base import BaseTransport import base64 import obfsproxy.common.log as logging log = logging.get_obfslogger() def _get_b64_chunks_from_str(string): """ Given a 'string...
bsd-3-clause
robbiet480/python-social-auth
social/backends/shopify.py
19
3353
""" Shopify OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/shopify.html """ import imp import six from social.utils import handle_http_errors from social.backends.oauth import BaseOAuth2 from social.exceptions import AuthFailed, AuthCanceled class ShopifyOAuth2(BaseOAuth2): """Shopify OA...
bsd-3-clause
alexandrebarachant/mne-python
mne/commands/utils.py
12
1293
"""Some utility functions for commands (e.g. for cmdline handling) """ # Authors: Yaroslav Halchenko <debian@onerussian.com> # # License: BSD (3-clause) import imp import os import re from optparse import OptionParser import mne def get_optparser(cmdpath, usage=None): """Create OptionParser with cmd source spe...
bsd-3-clause
wrouesnel/ansible-modules-extras
cloud/vmware/vmware_vswitch.py
49
6532
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
TamiaLab/carnetdumaker
apps/accounts/forms.py
1
4746
""" Forms for the user accounts app. """ from django import forms from django.utils.translation import ugettext_lazy as _ from django.core.files.images import get_image_dimensions from .models import UserProfile from .settings import (AVATAR_HEIGHT_SIZE_PX, AVATAR_WIDTH_SIZE_PX, ...
agpl-3.0
saadbinakhlaq/django-oscar
oscar/apps/catalogue/categories.py
8
1484
from django.db.models import get_model Category = get_model('catalogue', 'category') def create_from_sequence(bits): """ Create categories from an iterable """ if len(bits) == 1: # Get or create root node name = bits[0] try: # Category names should be unique at the...
bsd-3-clause
tonyzhong84/Home-assistant-broadlink-RM2
custom_components/remote/broadlink.py
1
2046
from homeassistant.helpers.entity import Entity import voluptuous as vol import homeassistant.components.remote as remote import homeassistant.helpers.config_validation as cv from homeassistant.components.remote import (DOMAIN) DATA_BROADLINK = 'broadlink' DEPENDENCIES = ['broadlink'] SERVICE_LEARN = 'broadlink_lear...
mit
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/services/webapp/tests/test_forgiving_vocabulary.py
1
1080
# Copyright 2009 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). __metaclass__ = type from zope.schema.vocabulary import SimpleTerm from lp.services.webapp.vocabulary import ForgivingSimpleVocabulary from lp.testing import TestCase class Tes...
agpl-3.0
Winand/pandas
pandas/tests/frame/test_api.py
1
14736
# -*- coding: utf-8 -*- from __future__ import print_function import pytest # pylint: disable-msg=W0612,E1101 from copy import deepcopy import sys from distutils.version import LooseVersion from pandas.compat import range, lrange, long from pandas import compat from numpy.random import randn import numpy as np fr...
bsd-3-clause
Winand/pandas
pandas/tests/groupby/test_categorical.py
14
23584
# -*- coding: utf-8 -*- from __future__ import print_function from datetime import datetime import pytest import numpy as np from numpy import nan import pandas as pd from pandas import (Index, MultiIndex, CategoricalIndex, DataFrame, Categorical, Series, Interval) from pandas.util.testing import...
bsd-3-clause
tejasnikumbh/Algorithms
ArraysAndSorting/FindTheMedian.py
1
1474
# Importing standard libraries import sys ''' QuickSelect Function that selects kth position element in sorted array using quickSort Params : a - array to be sorted start - start position of to be sorted subset end - end position of to be sorted subset pos - the k where w...
bsd-2-clause
ypkang/Dato-Core
src/unity/python/graphlab/meta/asttools/tests/test_symbol_visitor.py
13
1317
''' Created on Aug 5, 2011 @author: sean ''' from __future__ import print_function import unittest import ast from graphlab.meta.asttools.visitors.symbol_visitor import get_symbols class Test(unittest.TestCase): def assertHasSymbols(self, codestring, expected_symbols, ctxts=(ast.Load, ast.Store)): root...
agpl-3.0
zhuwenping/python-for-android
python-modules/twisted/twisted/web/proxy.py
49
9554
# -*- test-case-name: twisted.web.test.test_proxy -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Simplistic HTTP proxy support. This comes in two main variants - the Proxy and the ReverseProxy. When a Proxy is in use, a browser trying to connect to a server (say, www.yahoo....
apache-2.0
bonitadecker77/python-for-android
python3-alpha/python3-src/Lib/wsgiref/handlers.py
51
20582
"""Base classes for server/gateway implementations""" from .util import FileWrapper, guess_scheme, is_hop_by_hop from .headers import Headers import sys, os, time __all__ = [ 'BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler', 'IISCGIHandler', 'read_environ' ] # Weekday and month names for HTTP ...
apache-2.0
rixrix/servo
tests/wpt/harness/wptrunner/browsers/chrome.py
6
2810
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from .base import Browser, ExecutorBrowser, require_arg from .webdriver import ChromedriverLocalServer from ..executors ...
mpl-2.0
leorochael/odoo
addons/subscription/__openerp__.py
261
1885
# -*- 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
kamyu104/django
django/contrib/postgres/forms/ranges.py
393
3005
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import ugettext_lazy as _ __all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField...
bsd-3-clause
devsar/ae-people
apps/core/middleware.py
1
1403
import re import logging import traceback from google.appengine.api.mail import EmailMessage from django.conf import settings class UserMiddleware: def process_request(self, request): url = request.get_full_path() match = re.search(r"/user/(?P<username>[\w\d\_]+)/.*", url) ...
apache-2.0
emeryberger/eon
eon/tinyos/tools/src/sf/parsebundles.py
1
6994
#!/usr/bin/python import os; import sys; import socket; if (len(sys.argv) != 3): print("Usage : "+sys.argv[0] + " <infile> <outfile>"); sys.exit(1); ifile = file(sys.argv[1],"r"); ofile = file(sys.argv[2],"w"); rawdata = ifile.readlines(); bundles = []; def parsedataline(line): toks = line.split(' '); chr...
gpl-2.0
p990-slimrom/platform_external_chromium
chrome/common/extensions/docs/build/build.py
65
8905
#!/usr/bin/python # Copyright (c) 2009 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. """Docbuilder for extension docs.""" import os import os.path import shutil import sys import time import urllib from subprocess impo...
bsd-3-clause
BabeNovelty/numpy
numpy/distutils/fcompiler/vast.py
184
1775
from __future__ import division, absolute_import, print_function import os from numpy.distutils.fcompiler.gnu import GnuFCompiler compilers = ['VastFCompiler'] class VastFCompiler(GnuFCompiler): compiler_type = 'vast' compiler_aliases = () description = 'Pacific-Sierra Research Fortran 90 Compiler' ...
bsd-3-clause
simleo/openmicroscopy
examples/Training/python/Connect_To_OMERO.py
2
2915
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014 University of Dundee & Open Microscopy Environment. # All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # """ FOR TRAINING PURPOSES ONLY! """ from Parse_OMERO_Properties import USERNAME, PASSWORD, HO...
gpl-2.0
ttadano/ALM
tools/interface/VASP.py
1
14333
# # VASP.py # # Interface to VASP (https://www.vasp.at) # # Copyright (c) 2014 Terumasa Tadano # # This file is distributed under the terms of the MIT license. # Please see the file 'LICENCE.txt' in the root directory # or http://opensource.org/licenses/mit-license.php for information. # from __future__ import print_fu...
mit
vijay03/optfs
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
mogujie/TeamTalk
win-client/3rdParty/src/json/scons-tools/substinfile.py
258
3216
import re from SCons.Script import * # the usual scons stuff you get in a SConscript def generate(env): """ Add builders and construction variables for the SubstInFile tool. Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT from the source to the target. The values of...
apache-2.0
ecaldwell/POSTMan-Chrome-Extension
tests/selenium/pmtests/postman_tests_requests_preview.py
93
14983
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.select import Select from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys import selenium.webdriver.chrome.service as service import tracebac...
apache-2.0
point97/hapifis
server/apps/survey/migrations/0065_auto__add_field_option_min__add_field_option_max.py
1
15295
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Option.min' db.add_column(u'survey_option', 'min', self.gf('django.db....
gpl-3.0
jfrygeo/solutions-geoprocessing-toolbox
suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/tools/get_variable_statistics.py
2
8483
# -*- coding: utf-8 -*- import arcpy import mds import mds.messages import numpy class GetVariableStatistics(object): def __init__(self): """Define the tool (tool name is the name of the class).""" self.label = "Get Variable Statistics" self.description = "Calculates statistics for a variab...
apache-2.0
odoousers2014/LibrERP
l10n_ch_base_bank/__openerp__.py
3
1549
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by t...
agpl-3.0
jshum/dd-agent
tests/checks/integration/test_pgbouncer.py
39
2504
# stdlib import time from types import ListType # 3p from nose.plugins.attrib import attr try: import psycopg2 as pg except ImportError: pg = None # project from tests.checks.common import AgentCheckTest @attr(requires='pgbouncer') class TestPgbouncer(AgentCheckTest): CHECK_NAME = 'pgbouncer' def t...
bsd-3-clause