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
lauromoraes/redes
MyTCPRequestHandler.py
1
1443
import logging import socket import threading import SocketServer import time from recvall import * from calc import * logging.basicConfig( level = logging.DEBUG, format = "%(name)s: %(message)s", ) class MyTCPRequestHandler(SocketServer.BaseRequestHandler): def __init__(self, request, client_address, server): se...
gpl-2.0
Axam/nsx-web
nailgun/nailgun/test/unit/test_node_nic_handler.py
2
15780
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
apache-2.0
amenonsen/ansible
test/units/modules/network/junos/test_junos_ping.py
48
4884
# (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 dis...
gpl-3.0
drawks/ansible
lib/ansible/modules/remote_management/redfish/idrac_redfish_facts.py
10
4810
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2019 Dell EMC Inc. # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'status': ['preview'], ...
gpl-3.0
stuntman723/rap-analyzer
rap_analyzer/lib/python2.7/site-packages/django/contrib/gis/shortcuts.py
197
1129
import zipfile from io import BytesIO from django.conf import settings from django.http import HttpResponse from django.template import loader def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = BytesIO() zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) zf.writestr('d...
mit
gcblue/gcblue
bin/Lib/test/test_xml_etree.py
33
55012
# xml.etree test. This file contains enough tests to make sure that # all included components work as they should. # Large parts are extracted from the upstream test suite. # IMPORTANT: the same doctests are run from "test_xml_etree_c" in # order to ensure consistency between the C implementation and the # Python imp...
bsd-3-clause
pubnative/redash
redash/handlers/widgets.py
3
2188
import json from flask import request from redash import models from redash.permissions import require_permission, require_admin_or_owner, require_access, view_only from redash.handlers.base import BaseResource class WidgetListResource(BaseResource): @require_permission('edit_dashboard') def post(self): ...
bsd-2-clause
barbarubra/Don-t-know-What-i-m-doing.
python/src/Lib/test/test_typechecks.py
58
3078
"""Unit tests for __instancecheck__ and __subclasscheck__.""" import unittest from test import test_support class ABC(type): def __instancecheck__(cls, inst): """Implement isinstance(inst, cls).""" return any(cls.__subclasscheck__(c) for c in set([type(inst), inst.__class__]))...
apache-2.0
EloYGomeZ/android-kenel-3.4.0
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
gauribhoite/personfinder
env/google_appengine/lib/django-1.4/setup.py
8
4020
from distutils.core import setup from distutils.command.install_data import install_data from distutils.command.install import INSTALL_SCHEMES import os import sys class osx_install_data(install_data): # On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../ # which is wrong. Python 2...
apache-2.0
openbadges/badgecheck
openbadges/verifier/actions/input.py
3
1306
from .action_types import SET_INPUT_TYPE, SET_PROFILE_ID, STORE_INPUT, STORE_ORIGINAL_RESOURCE def store_input(badge_input): """ Emits an action that encapsulates user input provided and instructs that it be stored in the state. :param badge_input: string :return: dict """ return { ...
apache-2.0
rgerkin/neuroConstruct
lib/jython/Lib/wsgiref/headers.py
229
5879
"""Manage HTTP Response Headers Much of this module is red-handedly pilfered from email.message in the stdlib, so portions are Copyright (C) 2001,2002 Python Software Foundation, and were written by Barry Warsaw. """ from types import ListType, TupleType # Regular expression that matches `special' characters in para...
gpl-2.0
youfou/wxpy
tests/api/messages/test_message.py
1
2800
from datetime import datetime from tests.conftest import wait_for_message from wxpy import * def sent_message(sent_msg, msg_type, receiver): assert isinstance(sent_msg, SentMessage) assert sent_msg.type == msg_type assert sent_msg.receiver == receiver assert sent_msg.bot == receiver.bot assert se...
mit
bcorwin/twilio-python
twilio/rest/exceptions.py
40
2547
# -*- coding: utf-8 -*- import sys from six import u # Backwards compatibility. from ..version import __version__, __version_info__ from ..exceptions import TwilioException class TwilioRestException(TwilioException): """ A generic 400 or 500 level exception from the Twilio API :param int status: the HTTP ...
mit
Immortalin/python-for-android
python3-alpha/python3-src/Lib/test/test_bytes.py
48
47606
"""Unit tests for the bytes and bytearray types. XXX This is a mess. Common tests should be moved to buffer_tests.py, which itself ought to be unified with string_tests.py (and the latter should be modernized). """ import os import re import sys import copy import functools import pickle import tempfile import unitt...
apache-2.0
bgris/ODL_bgris
lib/python3.5/site-packages/chardet/langhebrewmodel.py
2763
11318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
gpl-3.0
phektus/Django-Google-AppEngine-OpenId-Auth
django/contrib/gis/gdal/envelope.py
321
7044
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
bsd-3-clause
xin-cai/openwhisk
tools/json/validate.py
5
1341
#!/usr/bin/python """Validate that a string conforms to a json schema. usage: validate.py obj schema where obj and schema are both strings. prints 'true' if validate succeeds, 'false' otherwise /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the N...
apache-2.0
ensemblr/llvm-project-boilerplate
include/llvm/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
1
18097
#!/usr/bin/env python #===- lib/asan/scripts/asan_symbolize.py -----------------------------------===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===----------------------------------------...
mit
wazo-pbx/xivo-auth
wazo_auth/services/email.py
1
4200
# Copyright 2018-2020 The Wazo Authors (see the AUTHORS file) # SPDX-License-Identifier: GPL-3.0-or-later import time import smtplib from collections import namedtuple from email import utils as email_utils from email.mime.text import MIMEText from wazo_auth.services.helpers import BaseService EmailDestination = n...
gpl-3.0
kurtrwall/cfgov-refresh
_lib/wordpress_initiative_processor.py
3
1748
import sys import json import os.path import requests import dateutil.parser def posts_at_url(url): current_page = 1 max_page = sys.maxint while current_page <= max_page: url = os.path.expandvars(url) resp = requests.get(url, params={'page':current_page, 'count': '-1'}) resul...
cc0-1.0
tunneln/CarnotKE
jyhton/Lib/test/test_posix.py
8
18006
"Test posix functions" from test import test_support # Skip these tests if there is no posix module. posix = test_support.import_module('posix') import errno import sys import time import os import pwd import shutil import stat import sys import tempfile import unittest import warnings _DUMMY_SYMLINK = os.path.join...
apache-2.0
allevato/swift
utils/pass-pipeline/src/pass_pipeline_library.py
77
2942
import pass_pipeline as ppipe import passes as p def simplifycfg_silcombine_passlist(): return ppipe.PassList([ p.SimplifyCFG, p.SILCombine, p.SimplifyCFG, ]) def highlevel_loopopt_passlist(): return ppipe.PassList([ p.LowerAggregateInstrs, p.SILCombine, ...
apache-2.0
gcode-mirror/audacity
lib-src/lv2/lilv/waflib/Options.py
330
5458
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,tempfile,optparse,sys,re from waflib import Logs,Utils,Context cmds='distclean configure build install clean uninstall check dist distcheck'.split() options={} comma...
gpl-2.0
Rangozhang/Twitch-plays-LSD-neural-net
classify.py
6
2510
################################################################################ # INIT ################################################################################ import numpy as np import theano import theano.tensor as T import lasagne as ...
mit
yoseforb/lollypop
src/fullscreen.py
1
9247
#!/usr/bin/python # Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # 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 your opti...
gpl-3.0
elfnor/sverchok
nodes/layout/wifi_in.py
3
4068
# ##### 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-3.0
daviwesley/Empire
lib/stagers/hop_php.py
22
2123
from lib.common import helpers class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Launcher', 'Author': ['@harmj0y'], 'Description': ('Generates a hop.php redirector for an Empire listener.'), 'Comments': [ '' ...
bsd-3-clause
darmaa/odoo
addons/mrp/report/bom_structure.py
66
2475
## -*- 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 GN...
agpl-3.0
vfuse/nixstatsagent
nixstatsagent/plugins/mdstat.py
2
1272
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import plugins import json class Plugin(plugins.BasePlugin): __name__ = 'mdstat' def run(self, config): ''' Monitor software raid status using mdadm pip install mdstat ''' data = os.popen('sudo mdjson').read() ...
bsd-3-clause
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/scipy/odr/tests/test_odr.py
14
13045
from __future__ import division, print_function, absolute_import # Scipy imports. import numpy as np from numpy import pi from numpy.testing import (assert_array_almost_equal, assert_equal, assert_warns) from pytest import raises as assert_raises from scipy.odr import Data, Model, ODR, RealD...
mit
stclair/wes-cms
django/middleware/gzip.py
321
1455
import re from django.utils.text import compress_string from django.utils.cache import patch_vary_headers re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(object): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header accordingly, so that cac...
bsd-3-clause
EvanK/ansible-modules-extras
notification/pushover.py
59
3528
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.com> # All rights reserved. # # 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 F...
gpl-3.0
protochron/aurora
src/main/python/apache/thermos/monitoring/disk.py
8
2533
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
batxes/4c2vhic
SHH_INV_models/SHH_INV_models_final_output_0.2_-0.1_10000/SHH_INV_models30420.py
2
17571
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
jamessy/select-sc
node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py
526
54812
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import filecmp import gyp.common import gyp.xcodeproj_file import errno import os import sys import posixpath import re import shutil import subprocess import temp...
mit
mcheatham/computationalEnvironmentODP
bin/kernels.py
1
3923
#!/usr/bin/env python3 from bs4 import BeautifulSoup from requests import get from bs4.element import Tag ignore = {'Lisp Machines, Inc.', 'Symbolics', 'Texas Instruments', 'Xerox'} levels = {} levels['Apple Inc.'] = {3} levels['On S/360, S/370, and successor mainframes'] = {3} levels['On other hardware platforms']...
mit
mgaitan/scipy
scipy/signal/tests/test_spectral.py
41
31224
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy.testing import assert_raises, assert_approx_equal, \ assert_, run_module_suite, TestCase,\ assert_allclose, assert_array_equal,\ a...
bsd-3-clause
wagnerand/zamboni
mkt/feed/tests/test_views.py
3
16300
# -*- coding: utf-8 -*- import json from nose.tools import eq_, ok_ from django.core.urlresolvers import reverse import mkt.carriers import mkt.regions from addons.models import Preview from mkt.api.tests.test_oauth import RestOAuth from mkt.collections.constants import COLLECTIONS_TYPE_BASIC from mkt.collections.mo...
bsd-3-clause
zstackorg/zstack-woodpecker
integrationtest/vm/simulator/iam2/test_iam2_project_affinity_group_cascade_delete.py
2
2762
''' @author: fangxiao ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.iam2_operations as iam2_ops import zstackwoodpecker.operations.affinitygroup_operations as ag_ops import zstackw...
apache-2.0
toomoresuch/pysonengine
eggs/ipython-0.10.1-py2.6.egg/IPython/external/path.py
7
32139
""" path.py - An object representing a path to a file or directory. Example: from IPython.external.path import path d = path('/home/guido/bin') for f in d.files('*.py'): f.chmod(0755) This module requires Python 2.2 or later. URL: http://www.jorendorff.com/articles/python/path Author: Jason Orendorff <jas...
mit
kimjaejoong/nova
nova/tests/functional/v3/test_floating_ips_bulk.py
33
3980
# Copyright 2014 IBM 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 applicable law or agreed...
apache-2.0
suiyuan2009/tensorflow
tensorflow/python/platform/logging_test.py
211
1133
# 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
dmordom/nipype
nipype/interfaces/tests/test_base.py
3
20220
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os import tempfile import shutil from nipype.testing import (assert_equal, assert_not_equal, assert_raises, assert_true, assert_false, with_setup, package_check, ...
bsd-3-clause
yantrabuddhi/atomspace
tests/cython/guile/test_pattern.py
3
2608
from unittest import TestCase from opencog.atomspace import AtomSpace, TruthValue, Atom from opencog.atomspace import types, is_a, get_type, get_type_name from opencog.scheme_wrapper import load_scm, scheme_eval, scheme_eval_h # We are poking atoms into this from the scm files, so we want # them to still be there, l...
agpl-3.0
ShinyROM/android_external_chromium_org
build/android/PRESUBMIT.py
59
1751
# Copyright (c) 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. """Presubmit script for android buildbot. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmit API b...
bsd-3-clause
rlefevre1/hpp-rbprm-corba
script/tools/quaternion.py
12
15064
# Copyright (c) 2013 CNRS # Author: Jorrit T'Hooft # # This file is part of hpp-corbaserver. # hpp-corbaserver 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 y...
lgpl-3.0
dariox2/CADL
test/testyida6b.py
1
4901
# # test shuffle_batch - 6b # # generates a pair of files (color+bn) # pending: make the tuple match # print("Loading tensorflow...") import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import os from libs import utils import datetime tf.set_random_seed(1) def create_input_pipeline_yida(f...
apache-2.0
sandeepkoduri/GAE-html-to-pdf
libs/PIL/TarIO.py
21
1241
# # The Python Imaging Library. # $Id$ # # read files from within a tar file # # History: # 95-06-18 fl Created # 96-05-28 fl Open files in binary mode # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredrik Lundh 1995-96. # # See the README file for information on usage and redistribution. # from PIL impor...
mit
luisgg/iteexe
nevow/zomnesrv.py
14
3211
import time from nevow import wsgi from twisted.internet import protocol, reactor from twisted.protocols import basic from twisted.python import log IN_KEY = 'STDIN_FILENAME=' IN_KEY_LEN = len(IN_KEY) class ZomneProtocol(basic.NetstringReceiver): def connectionMade(self): self.environ = {} def s...
gpl-2.0
xinjiguaike/edx-platform
common/lib/xmodule/xmodule/capa_module.py
37
9775
"""Implements basics of Capa, including class CapaModule.""" import json import logging import sys import re from lxml import etree from pkg_resources import resource_string import dogstats_wrapper as dog_stats_api from .capa_base import CapaMixin, CapaFields, ComplexEncoder from capa import responsetypes from .progr...
agpl-3.0
d8ahazard/shooter-cm9-deviltoast
scripts/build-all.py
1250
9474
#! /usr/bin/env python # Copyright (c) 2009-2011, Code Aurora Forum. 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 # n...
gpl-2.0
dentaku65/pelisalacarta
python/main-classic/channels/enlacia.py
4
14634
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para enlacia # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os,sys from ...
gpl-3.0
CartoDB/cartoframes
cartoframes/viz/layout.py
1
9384
from . import constants from .map import Map from .html import HTMLLayout from ..utils.utils import get_center, get_credentials from ..utils.metrics import send_metrics from .kuviz import KuvizPublisher class Layout: """Create a layout of visualizations in order to compare them. Args: maps (list of :...
bsd-3-clause
xsthunder/acm
util/quickpow.py
2
1827
from math import * def qp(x,p,mod=0):#quickpow if(type(x) != type(2) or type(p)!=type(2) or type(mod)!=type(2)): print("qp :err type%s %s %s"%(type(x),type(p),type(mod))) return b = 1 while(p>0): if(p&1==1): b*=x p>>=1 x*=x if(mod>0): ...
mit
obulpathi/poppy
scripts/providers/akamai/purge_status.py
3
2406
# Copyright (c) 2015 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
jazkarta/edx-platform
common/djangoapps/django_locale/middleware.py
81
3736
# TODO: This file is imported from the stable Django 1.8 branch. Remove this file # and re-import this middleware from Django once the codebase is upgraded. [PLAT-671] # pylint: disable=invalid-name, missing-docstring "This is the locale selecting middleware that will look at accept headers" from django.conf import se...
agpl-3.0
micbou/ycmd
ycmd/request_validation.py
5
2598
# Copyright (C) 2014 Google Inc. # # This file is part of ycmd. # # ycmd 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. # # ycmd is di...
gpl-3.0
alphacsc/alphacsc
examples/csc/plot_lfp_data.py
1
3791
""" ============================== CSC to learn LFP spiking atoms ============================== Here, we show how CSC can be used to learn spiking atoms from Local Field Potential (LFP) data [1]. [1] Hitziger, Sebastian, et al. Adaptive Waveform Learning: A Framework for Modeling Variability in Neurophysiolo...
bsd-3-clause
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/_pyio.py
5
91130
""" Python implementation of the io module. """ import os import abc import codecs import errno import stat import sys # Import _thread instead of threading to reduce startup cost from _thread import allocate_lock as Lock if sys.platform in {'win32', 'cygwin'}: from msvcrt import setmode as _setmode else: _set...
gpl-3.0
b0ttl3z/SickRage
lib/imdb/parser/http/searchPersonParser.py
76
3764
""" parser.http.searchPersonParser module (imdb package). This module provides the HTMLSearchPersonParser class (and the search_person_parser instance), used to parse the results of a search for a given person. E.g., when searching for the name "Mel Gibson", the parsed page would be: http://akas.imdb.com/find?q=Me...
gpl-3.0
israeleriston/scientific-week
backend/venv/lib/python3.5/site-packages/sqlalchemy/orm/interfaces.py
27
22073
# orm/interfaces.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 """ Contains various base classes used throughout the ORM. Defines some key base...
mit
acmihal/Cinnamon
files/usr/lib/cinnamon-looking-glass/lookingglass_proxy.py
12
3941
from gi.repository import Gio, Gtk, GObject, Gdk, Pango, GLib LG_DBUS_NAME = "org.Cinnamon.LookingGlass" LG_DBUS_PATH = "/org/Cinnamon/LookingGlass" class LookingGlassProxy: def __init__ (self): self._signals = [] self._statusChangeCallbacks = [] self._proxy = None Gio.bus_watch_na...
gpl-2.0
AlessioCasco/gandi-dyndns
gandi-dyndns.py
1
9763
#!/usr/bin/env python # -*- coding: utf-8 -*- """ gandi-dyndns @author: AlessioCasco """ from bottle import route, run, request, response from optparse import OptionParser import logging as log import xmlrpclib import json import sys import re gandi_fqdn_ip = {} @route('/ping', method=['GET', 'POST']) def ping(): ...
mit
wooyek/flask-social-blueprint
example/sqla/website/settings/base.py
5
2741
# coding=utf-8 # Created 2014 by Janusz Skonieczny import logging import os SRC_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) # ============================================================================ # a flask settings # http://flask.pocoo.org/docs/config/#configuring-from-files # =======...
mit
KokareIITP/django
tests/str/tests.py
149
1245
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from unittest import skipIf from django.test import TestCase from django.utils import six from .models import Article, InternationalArticle class SimpleTests(TestCase): @skipIf(six.PY3, "tests a __str__ method returning unicode un...
bsd-3-clause
digideskio/merchant
billing/models/paylane_models.py
7
1253
# -*- coding: utf-8 -*- # vim:tabstop=4:expandtab:sw=4:softtabstop=4 from django.db import models class PaylaneTransaction(models.Model): transaction_date = models.DateTimeField(auto_now_add=True) amount = models.FloatField() customer_name = models.CharField(max_length=200) customer_email = models.Ch...
bsd-3-clause
st135yle/django-site
dbenv/lib/python3.4/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py
46
2880
import threading from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.libgeos import ( CONTEXT_PTR, error_h, lgeos, notice_h, ) class GEOSContextHandle(GEOSBase): """ Python object representing a GEOS context handle. """ ptr_type = CONTEXT_PTR destructor = lgeos.fini...
mit
socialsweethearts/django-allauth
allauth/socialaccount/providers/foursquare/views.py
71
1366
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import FoursquareProvider class FoursquareOAuth2Adapter(OAu...
mit
frouty/odoogoeen
openerp/addons/base/ir/wizard/__init__.py
64
1073
# -*- coding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
MattsFleaMarket/python-for-android
python3-alpha/python3-src/Lib/test/test_file.py
59
11895
import sys import os import unittest from array import array from weakref import proxy import io import _pyio as pyio from test.support import TESTFN, run_unittest from collections import UserList class AutoFileTests(unittest.TestCase): # file tests for which a test file is automatically set up def setUp(se...
apache-2.0
florian-dacosta/OpenUpgrade
addons/hr_timesheet/wizard/__init__.py
381
1079
# -*- 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
gappleto97/Senior-Project
common/peers.py
1
16088
from multiprocessing import Queue import multiprocessing, os, pickle, select, socket, sys, time, rsa, traceback from common.safeprint import safeprint from common.bounty import * global ext_port global ext_ip global port global myPriv global myPub global propQueue ext_port = -1 ext_ip = "" port = 44565 myPub, myPriv =...
mit
remb0/CouchPotatoServer
libs/guessit/transfo/post_process.py
4
2521
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
crazy-canux/django
tests/gis_tests/utils.py
327
1377
from unittest import skip from django.conf import settings from django.db import DEFAULT_DB_ALIAS def no_backend(test_func, backend): "Use this decorator to disable test on specified backend." if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend: @skip("This test is skipped on...
bsd-3-clause
fuhongliang/erpnext
erpnext/controllers/status_updater.py
6
10062
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, comma_or from frappe import msgprint, _, throw from frappe.model.document import Document def validate_stat...
agpl-3.0
Curso-OpenShift/Formulario
OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/db/backends/postgresql/client.py
47
2120
import os import subprocess from django.core.files.temp import NamedTemporaryFile from django.db.backends.base.client import BaseDatabaseClient from django.utils.six import print_ def _escape_pgpass(txt): """ Escape a fragment of a PostgreSQL .pgpass file. """ return txt.replace('\\', '\\\\').replace...
gpl-3.0
yanchen036/tensorflow
tensorflow/contrib/remote_fused_graph/pylib/python/ops/remote_fused_graph_ops_test.py
96
2585
# Copyright 2017 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
arangodb/arangodb
3rdParty/V8/v7.9.317/test/wasm-spec-tests/testcfg.py
1
1810
# Copyright 2017 the V8 project 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 os from testrunner.local import testsuite from testrunner.objects import testcase proposal_flags = [{ 'name': 'reference-types...
apache-2.0
hayderimran7/zulip
bots/jabber_mirror.py
42
2049
#!/usr/bin/env python # Copyright (C) 2014 Zulip, Inc. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, m...
apache-2.0
pascalmouret/treeio-achievements
achievements/views.py
1
13734
""" Here are the functions which actually prepare the data and render the pages. Most of the functions here are very similar since tree.io is, more or less, following the CRUD (Create, Retrieve, Update, Delete) pattern. The only thing special are the MassForms, which are quite common in tree.io and I only adapted the c...
bsd-2-clause
Aristocles/CouchPotatoServer
libs/guessit/transfo/guess_weak_episodes_rexps.py
94
2184
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
chiefspace/udemy-rest-api
udemy_rest_api_section6/env/lib/python3.4/site-packages/jinja2/defaults.py
130
1323
# -*- coding: utf-8 -*- """ jinja2.defaults ~~~~~~~~~~~~~~~ Jinja default filters and tags. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import range_type from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner # defaults for ...
gpl-2.0
sgarrity/bedrock
tests/functional/newsletter/test_newsletter_landing.py
4
2552
# 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/. import pytest from selenium.common.exceptions import TimeoutException from pages.newsletter.developer import DeveloperN...
mpl-2.0
magnushiie/geopy
geopy/geocoders/photon.py
11
8382
""" :class:`.Photon` geocoder. """ from geopy.compat import urlencode, string_compare from geopy.geocoders.base import ( Geocoder, DEFAULT_FORMAT_STRING, DEFAULT_TIMEOUT, DEFAULT_SCHEME ) from geopy.location import Location from geopy.util import logger __all__ = ("Photon", ) class Photon(Geocoder)...
mit
javierTerry/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py
384
2324
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
emonty/ansible
lib/ansible/plugins/action/gather_facts.py
14
5775
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import time from ansible import constants as C from ansible.executor.module_common import...
gpl-3.0
ruddra/django-oscar
oscar/templatetags/history_tags.py
6
1843
import urlparse from django import template from django.db.models import get_model from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import resolve, Resolver404 from oscar.apps.customer import history Site = get_model('sites', 'Site') register = template.Library() @register.inc...
bsd-3-clause
jeffbaumes/jeffbaumes-vtk
Examples/Medical/Python/Medical3.py
13
7546
#!/usr/bin/env python # This example reads a volume dataset, extracts two isosurfaces that # represent the skin and bone, creates three orthogonal planes # (saggital, axial, coronal), and displays them. import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the renderer, the re...
bsd-3-clause
hynek/pyopenssl
doc/conf.py
4
8243
# -*- coding: utf-8 -*- # # pyOpenSSL documentation build configuration file, created by # sphinx-quickstart on Sat Jul 16 07:12:22 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
apache-2.0
apixandru/intellij-community
python/lib/Lib/site-packages/django/utils/tree.py
310
5778
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ from django.utils.copycompat 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 ...
apache-2.0
inspyration/odoo
addons/portal/wizard/share_wizard.py
158
9630
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 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
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/django/contrib/gis/db/backends/postgis/const.py
528
1484
""" PostGIS to GDAL conversion constant definitions """ # Lookup to convert pixel type values from GDAL to PostGIS GDAL_TO_POSTGIS = [None, 4, 6, 5, 8, 7, 10, 11, None, None, None, None] # Lookup to convert pixel type values from PostGIS to GDAL POSTGIS_TO_GDAL = [1, 1, 1, 3, 1, 3, 2, 5, 4, None, 6, 7, None, None] # ...
gpl-3.0
JerryLead/spark
examples/src/main/python/ml/decision_tree_classification_example.py
123
3003
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
mrosenbladt/yaml-cpp.new-api
test/gmock-1.7.0/test/gmock_leak_test.py
779
4384
#!/usr/bin/env python # # Copyright 2009, 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...
mit
thecodinghub/news-for-good
news/Lib/fnmatch.py
27
3166
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The function...
bsd-3-clause
codeforamerica/skillcamp
ENV/lib/python2.7/site-packages/gunicorn/http/unreader.py
153
2024
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os from gunicorn import six # Classes that can undo reading data from # a given type of data source. class Unreader(object): def __init__(self): self.buf = six.BytesIO()...
mit
Friday811/tf-tacyt
authorization/Response.py
2
2184
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' This library offers an API to use Tacyt in a python environment. Copyright (C) 2015 Eleven Paths ''' import json from authorization import Error class Response(object): ''' This class models a response from any of the endpoints in the Tacyt API. It consi...
lgpl-2.1
hzy001/ansible
v1/ansible/runner/connection_plugins/accelerate.py
109
15527
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
ramiro/scrapy
tests/test_http_cookies.py
38
2178
from six.moves.urllib.parse import urlparse from unittest import TestCase from scrapy.http import Request, Response from scrapy.http.cookies import WrappedRequest, WrappedResponse class WrappedRequestTest(TestCase): def setUp(self): self.request = Request("http://www.example.com/page.html", \ ...
bsd-3-clause