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
mozilla/peekaboo
bin/update/deploy.py
1
3513
""" Deploy this project in dev/stage/production. Requires commander_ which is installed on the systems that need it. .. _commander: https://github.com/oremj/commander This script is supposed to work in Python 2.6. The only outside dependency is `virtualenv-2.7`. """ import os import sys sys.path.append(os.path.dir...
mpl-2.0
ar7z1/ansible
lib/ansible/module_utils/online.py
73
3824
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import sys from ansible.module_utils.basic import env_fallback from ansible.module_utils.urls import fetch_url...
gpl-3.0
mrshu/scikit-learn
sklearn/preprocessing.py
1
40726
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # License: BSD from collections import Sequence import warnings import numbers import numpy as np imp...
bsd-3-clause
sergiocorato/knowledge
document_choose_directory/controllers/binary.py
13
1670
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
jsvine/spectra
spectra/__init__.py
1
4083
from .core import COLOR_SPACES, Color, Scale from ._version import __version__ def lab(L, a, b): """ Create a spectra.Color object in the CIELAB color space. :param float L: L coordinate. :param float a: a coordinate. :param float b: b coordinate. :rtype: Color :returns: A spectra.Color o...
mit
Alucard24/Alucard-Kernel-LG-G5
scripts/rt-tester/rt-tester.py
1106
5305
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
foobnix/foobnix
foobnix/gui/window.py
3
3652
#-*- coding: utf-8 -*- ''' Created on 25 сент. 2010 @author: ivan ''' import logging from gi.repository import Gtk from gi.repository import Gdk from foobnix.fc.fc import FC from foobnix.gui.service.path_service import get_foobnix_resourse_path_by_name from foobnix.util import const from foobnix.gui.state import Lo...
gpl-3.0
Juniper/neutron
neutron/tests/unit/database_stubs.py
20
7014
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011, Cisco Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
apache-2.0
NEricN/RobotCSimulator
Python/App/Lib/test/test_dictviews.py
43
7519
import unittest from test import test_support class DictSetTest(unittest.TestCase): def test_constructors_not_callable(self): kt = type({}.viewkeys()) self.assertRaises(TypeError, kt, {}) self.assertRaises(TypeError, kt) it = type({}.viewitems()) self.assertRaises(TypeError...
apache-2.0
stutivarshney/Bal-Aveksha
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/db/backends/mysql/base.py
27
15759
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings from django.conf import settings...
gpl-3.0
doganov/edx-platform
cms/djangoapps/contentstore/views/program.py
27
2158
"""Programs views for use with Studio.""" from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import Http404, JsonResponse from django.utils.decorators import method_decorator from django.views.generic import View from...
agpl-3.0
ketjow4/NOV
Lib/site-packages/numpy/polynomial/tests/test_polynomial.py
54
16718
"""Tests for polynomial module. """ from __future__ import division import numpy as np import numpy.polynomial.polynomial as poly from numpy.testing import * def trim(x) : return poly.polytrim(x, tol=1e-6) T0 = [ 1] T1 = [ 0, 1] T2 = [-1, 0, 2] T3 = [ 0, -3, 0, 4] T4 = [ 1, 0, -8, 0, 8] T5 = [ 0...
gpl-3.0
tdtrask/ansible
lib/ansible/modules/monitoring/newrelic_deployment.py
27
4370
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Matt Coddington <coddington@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version':...
gpl-3.0
greenoaktree/pfp
pfp/fields.py
1
46379
#!/usr/bin/env python # encoding: utf-8 from intervaltree import IntervalTree,Interval import json import math import re import six import struct import pfp.errors as errors import pfp.utils as utils import pfp.bitwrap as bitwrap import pfp.functions as functions BIG_ENDIAN = ">" LITTLE_ENDIAN = "<" def true(): re...
mit
Jeebeevee/DouweBot_JJ15
plugins_org/weather.py
4
4119
"weather, thanks to wunderground" from util import hook, http @hook.api_key('wunderground') @hook.command(autohelp=False) def weather(inp, chan='', nick='', reply=None, db=None, api_key=None): ".weather <location> [dontsave] | @<nick> -- gets weather data from Wunderground "\ "http://wunderground.com...
unlicense
nhicher/ansible
lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py
36
7523
#!/usr/bin/python # 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', 'status': ['preview'], ...
gpl-3.0
anryko/ansible
lib/ansible/modules/cloud/openstack/os_keystone_domain.py
52
5166
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # 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
drpeteb/scipy
scipy/weave/ast_tools.py
97
7418
from __future__ import absolute_import, print_function import token import symbol import parser def issequence(t): return isinstance(t, (list, tuple)) def int_to_symbol(i): """ Convert numeric symbol or token to a desriptive name. """ try: return symbol.sym_name[i] except KeyError: ...
bsd-3-clause
OpenUpgrade/OpenUpgrade
addons/analytic_user_function/__openerp__.py
260
2015
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
2ndQuadrant/ansible
lib/ansible/modules/storage/netapp/na_ontap_cluster.py
26
10668
#!/usr/bin/python # (c) 2017, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
polimediaupv/edx-platform
common/djangoapps/track/tests/test_contexts.py
119
1330
# pylint: disable=missing-docstring,maybe-no-member from unittest import TestCase from track import contexts class TestContexts(TestCase): COURSE_ID = 'test/course_name/course_run' ORG_ID = 'test' def test_course_id_from_url(self): self.assert_parses_course_id_from_url('http://foo.bar.com/cour...
agpl-3.0
AltSchool/dynamic-rest
tests/migrations/0001_initial.py
2
6894
# -*- coding: utf-8 -*- # flake8: noqa # Generated by Django 1.9 on 2016-01-27 16:29 from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ mig...
mit
omnirom/android_external_chromium-org
tools/profile_chrome/systrace_controller.py
59
2926
# 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. import threading import zlib from profile_chrome import controllers from profile_chrome import util from pylib import cmd_helper _SYSTRACE_OPTIONS = [ ...
bsd-3-clause
emidln/django_roa
env/lib/python2.7/site-packages/django/views/generic/create_update.py
245
8935
from django.forms.models import ModelFormMetaclass, ModelForm from django.template import RequestContext, loader from django.http import Http404, HttpResponse, HttpResponseRedirect from django.core.xheaders import populate_xheaders from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured from django....
bsd-3-clause
ravibhure/ansible
lib/ansible/modules/storage/netapp/netapp_e_snapshot_images.py
42
8818
#!/usr/bin/python # (c) 2016, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
gcode-mirror/audacity
lib-src/lv2/sord/waflib/Tools/c_tests.py
330
4280
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib import Task from waflib.Configure import conf from waflib.TaskGen import feature,before_method,after_method import sys LIB_CODE=''' #ifdef _MSC_VER #define testEXP...
gpl-2.0
whitehorse-io/encarnia
pyenv/lib/python2.7/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] # ...
mit
civisanalytics/ansible
test/units/module_utils/ec2/test_aws.py
51
2972
# -*- coding: utf-8 -*- # (c) 2015, Allen Sanabria <asanabria@linuxdynasty.org> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
gpl-3.0
bjoernricks/kaizen
kaizen/utils/__init__.py
1
1170
# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80: # kaizen - Continuously improve, build and manage free software # # Copyright (C) 2011 Björn Ricks <bjoern.ricks@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as publishe...
gpl-2.0
jxtech/teambition-api
teambition/api/stagetemplates.py
3
1971
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from optionaldict import optionaldict from teambition.api.base import TeambitionAPI class StageTemplates(TeambitionAPI): def get(self): """ 获取用户自定义的阶段模板 详情请参考 http://docs.teambition.com/wiki/stages-...
mit
scikit-nano/scikit-nano
sknano/apps/nanogen_gui/_pyqt4_ui_swnt_generator.py
2
25180
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'swnt_generator.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf...
bsd-2-clause
gitlouie/Lectures
Python/Functions/memory.py
5
1027
# Before continuing, we should examine Python's memory model x = 10 # The id() function returns the memory address (or some other unique identifier) of a binding print "id(x):", id(x) y = x print "id(y):", id(y) # What gets printed? # So y and x are bound to the same value in memory. Is that what you get for primitiv...
mit
viki9698/jizhanggroup
djangoappengine/conf/project_template/project_name/settings.py
27
5321
# Django settings for {{ project_name }} project. # Initialize App Engine and import the default settings (DB backend, etc.). # If you want to use a different backend you have to remove all occurences # of "djangoappengine" from this file. from djangoappengine.settings_base import * ADMINS = ( # ('Your Name', 'yo...
bsd-3-clause
DoctorJellyface/powerline
powerline/bindings/qtile/widget.py
34
1638
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) from libqtile.bar import CALCULATED from libqtile.widget import TextBox from powerline import Powerline class QTilePowerline(Powerline): def do_setup(self, obj): obj.powerline = self class Powerli...
mit
BYK/fb2goog
gdata/core.py
103
8239
#!/usr/bin/env python # # Copyright (C) 2010 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...
mpl-2.0
dictoss/active-task-summary
ats/libs.py
1
2855
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import time import datetime import logging import csv import six from datetime import date from django.apps import apps from django.utils import timezone logger = logging.getLogger(__name__) ats_settings = apps.get_app_config('ats') def get_user_rea...
bsd-2-clause
wilyuhm/xtratag
insta_api.py
1
1918
#A small web app for searching multiple tags on instagram #Takes input in the form of a list of tags, returns oembed code for displaying #images on a webpage import requests import json from collections import defaultdict import settings #settings.py includes the following: client_id = settings.client_id client_secre...
mit
meabsence/python-for-android
python3-alpha/python3-src/Lib/lib2to3/fixes/fix_imports.py
203
5684
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
apache-2.0
ioram7/keystone-federado-pgid2013
build/sqlalchemy/test/orm/inheritance/_poly_fixtures.py
1
9894
from sqlalchemy import Integer, String, ForeignKey, func, desc, and_, or_ from sqlalchemy.orm import interfaces, relationship, mapper, \ clear_mappers, create_session, joinedload, joinedload_all, \ subqueryload, subqueryload_all, polymorphic_union, aliased,\ class_mapper from sqlalchemy import exc as sa_exc...
apache-2.0
stableShip/shadowsocks
shadowsocks/local.py
1015
2248
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 clowwindy # # 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 r...
apache-2.0
trondhindenes/ansible
lib/ansible/modules/network/aci/aci_encap_pool_range.py
15
12359
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', 'status': ['preview'], ...
gpl-3.0
tectronics/mythbox
resources/lib/twisted/twisted/test/test_task.py
56
20565
# Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.python.compat import set from twisted.trial import unittest from twisted.internet import interfaces, task, reactor, defer, error # Be compatible with any jerks who used our private stuff Clock = task.Clock from twisted.p...
gpl-2.0
mattnenterprise/servo
components/script/dom/bindings/codegen/parser/tests/test_constructor_no_interface_object.py
52
1525
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" [Constructor, NoInterfaceObject] interface TestConstructorNoInterfaceObject { }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have t...
mpl-2.0
wojons/rethinkdb
external/gtest_1.6.0/scripts/upload_gtest.py
1963
2851
#!/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...
agpl-3.0
ankravch/flask-restful
examples/todo_simple.py
21
1332
from flask import Flask, request from flask_restful import Resource, Api app = Flask(__name__) api = Api(app) todos = {} class TodoSimple(Resource): """ You can try this example as follow: $ curl http://localhost:5000/todo1 -d "data=Remember the milk" -X PUT $ curl http://localhost:5000/todo1...
bsd-3-clause
futurice/vdsm
vdsm/network/errors.py
2
1272
# # Copyright 2011-2014 Red Hat, Inc. # # 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 distributed ...
gpl-2.0
vinchoi/fishplay
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.py
151
5669
# -*- coding: utf-8 -*- """ SOCKS support for urllib3 ~~~~~~~~~~~~~~~~~~~~~~~~~ This contrib module contains provisional support for SOCKS proxies from within urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and SOCKS5. To enable its functionality, either install PySocks or install this module w...
gpl-3.0
cyanjc321/ardupilot
Tools/autotest/jsb_sim/runsim.py
167
12772
#!/usr/bin/env python # run a jsbsim model as a child process import sys, os, pexpect, socket import math, time, select, struct, signal, errno sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'pysim')) import util, atexit, fdpexpect from pymavlink import fgFDM class control_state(o...
gpl-3.0
openwsn-berkeley/coap
tests/func/test_multiple_CON.py
1
1178
import logging import testUtils as utils import time import threading from conftest import IPADDRESS1, \ RESOURCE, \ DUMMYVAL,\ OSCORECLIENTCONTEXT from coap import coapDefines as d, \ coapOption as o, \ ...
bsd-3-clause
dcsch/pyif
pyif/grammar.py
1
12193
from . import action from .parser import NOUN_TOKEN, HELD_TOKEN, MULTI_TOKEN, MULTIHELD_TOKEN, MULTIEXCEPT_TOKEN, MULTIINSIDE_TOKEN, TOPIC_TOKEN, CREATURE_TOKEN from .debug import log class Verb: def __init__(self, grammar, verb_tokens): self.grammar = grammar self.verb_tokens = verb_tokens ...
mit
kochbeck/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/classifier/autoclass.py
9
1327
# Natural Language Toolkit - AutoClass # automatic class value generator # # Author: Sumukh Ghodke <sumukh dot ghodke at gmail dot com> # # URL: <http://nltk.sf.net> # This software is distributed under GPL, for license information see LICENSE.TXT class AutoClass: def __init__(self, name): self.name = nam...
gpl-3.0
OleLL/Lacourdeshit
login.py
1
1600
def login_user(username, password): """ This method tries to login a user, if it has success, it will return a json with information about username availability and password availability and a json with all cookies, if password and username were correct, these cookies can be used to make more intera...
unlicense
saymedia/python-danga-gearman
dangagearman/task.py
2
4342
import random import uuid # Constant that indicates to gearmand the task should be interpeted as unique iff the arg matches. UNIQ_DATA_CHAR = '-' class Task(object): hooks = ('on_complete', 'on_fail', 'on_retry', 'on_status', 'on_post') def __init__(self, func, arg, uniq=None, background=False, high_priority...
mit
craigmaloney/twistedtwister
create-upload.py
5
1538
#! /usr/bin/env python '''Helper script for bundling up a game in a ZIP file. This script will bundle all game files into a ZIP file which is named as per the argument given on the command-line. The ZIP file will unpack into a directory of the same name. The script ignores: - CVS or SVN subdirectories - any dotfiles...
gpl-2.0
aequitas/home-assistant
homeassistant/components/openevse/sensor.py
7
3250
"""Support for monitoring an OpenEVSE Charger.""" import logging from requests import RequestException import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( TEMP_CELSIUS, CONF_HOST, ENERGY_KILO_WA...
apache-2.0
clumsy1991/M8_GPE_Kernel
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
qitianchan/flaskbb
flaskbb/message/forms.py
4
2608
# -*- coding: utf-8 -*- """ flaskbb.message.forms ~~~~~~~~~~~~~~~~~~~~~ It provides the forms that are needed for the message views. :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ from flask_login import current_user from flask_wtf import Form from wtfor...
bsd-3-clause
antfu/biconfigs
tests/test_biconfigs.py
1
3233
import biconfigs import time import pytest import datetime write_count = 0 def test_callbacks_sync(): global write_count write_count = 0 def before_save(config): if config.get('abort_save', False): return False config = biconfigs.Biconfigs( before_save=before_save, ...
mit
azureplus/hue
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Cipher/common.py
115
16599
# -*- coding: utf-8 -*- # # SelfTest/Hash/common.py: Common code for Crypto.SelfTest.Hash # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedicat...
apache-2.0
knittledan/solr_lxml_Example
thirdParty/amazonproduct/processors/_lxml.py
2
2307
""" XPath based paginators for lxml.etree and lxml.objectify based processors. """ from amazonproduct.processors import BaseResultPaginator class XPathPaginator (BaseResultPaginator): """ Result paginator using XPath expressions to extract page and result information from XML. """ ...
mit
zhanqxun/cv_fish
win32/Demos/timer_demo.py
4
2271
# -*- Mode: Python; tab-width: 4 -*- # # This module, and the timer.pyd core timer support, were written by # Sam Rushing (rushing@nightmare.com) import timer import time # Timers are based on Windows messages. So we need # to do the event-loop thing! import win32event, win32gui # glork holds a simple...
apache-2.0
theo-l/django
django/conf/locale/de_CH/formats.py
16
1336
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORM...
bsd-3-clause
alcobar/asuswrt-merlin
release/src/router/samba36/lib/dnspython/examples/reverse.py
74
1336
#!/usr/bin/env python # Usage: reverse.py <zone_filename>... # # This demo script will load in all of the zones specified by the # filenames on the command line, find all the A RRs in them, and # construct a reverse mapping table that maps each IP address used to # the list of names mapping to that address. The table...
gpl-2.0
mujiansu/arangodb
3rdParty/V8-4.3.61/build/gyp/test/win/gyptest-cl-optimizations.py
247
3416
#!/usr/bin/env python # 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. """ Make sure optimization settings are extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.Te...
apache-2.0
rolando-contrib/scrapy
scrapy/http/request/__init__.py
6
2938
""" This module implements the Request class which is used to represent HTTP requests in Scrapy. See documentation in docs/topics/request-response.rst """ import six from w3lib.url import safe_url_string from scrapy.http.headers import Headers from scrapy.utils.python import to_bytes from scrapy.utils.trackref import...
bsd-3-clause
ccn-2m/django
django/db/models/aggregates.py
521
2101
""" Classes to represent the definitions of aggregate functions. """ class Aggregate(object): """ Default Aggregate definition. """ def __init__(self, lookup, **extra): """Instantiate a new aggregate. * lookup is the field on which the aggregate operates. * extra is a diction...
bsd-3-clause
KWARC/mwetoolkit
bin/old/indexlib-hacked.py
1
10320
import sys import array import codecs import xml.sax import gc from bin.libs.xmlhandler.corpusXMLHandler import CorpusXMLHandler from xmlhandler.classes.sentence import Sentence from xmlhandler.classes.word import Word from util import verbose gc.set_debug(gc.DEBUG_LEAK) NGRAM_LIMIT=16 # TODO: Unify this with patt...
gpl-3.0
mganeva/mantid
qt/python/mantidqt/project/projectsaver.py
1
5274
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the mantidqt package ...
gpl-3.0
jamesylgan/szechuantech
python-scripts/pycparser/_ast_gen.py
22
8675
#----------------------------------------------------------------- # _ast_gen.py # # Generates the AST Node classes from a specification given in # a configuration file # # The design of this module was inspired by astgen.py from the # Python 2.5 code-base. # # Eli Bendersky [http://eli.thegreenplace.net] # License: BS...
mit
pubudu538/product-private-paas
components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/thrift/transport/TTwisted.py
19
6528
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
camptocamp/ngo-addons-backport
addons/account_asset/report/__init__.py
445
1074
# -*- 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
DaveBackus/Data_Bootcamp
Code/Lab/googlefinance.py
1
3562
""" This file demonstrates how to read minute level data from the Google finance api """ import datetime as dt import numpy as np import pandas as pd import pandas_datareader as pdr import requests as r import sys from io import StriongIO def retrieve_single_timeseries(ticker, secs=60, ndays=5): """ Grabs da...
mit
popazerty/EG-2
lib/python/Screens/NetworkSetup.py
4
140093
from boxbranding import getBoxType, getMachineBrand, getMachineName from os import path as os_path, remove, unlink, rename, chmod, access, X_OK from shutil import move import time from enigma import eTimer from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.Standby import TryQuitM...
gpl-2.0
direvus/ansible
lib/ansible/modules/cloud/google/gce_net.py
32
18212
#!/usr/bin/python # Copyright 2013 Google 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', 'status': ['preview'], ...
gpl-3.0
LIBOTAO/keras
keras/layers/core.py
1
23220
# -*- coding: utf-8 -*- from __future__ import absolute_import, division import theano import theano.tensor as T import numpy as np from .. import activations, initializations, regularizers, constraints from ..utils.theano_utils import shared_zeros, floatX from ..utils.generic_utils import make_tuple from ..regulariz...
mit
QiJune/Paddle
python/paddle/trainer_config_helpers/evaluators.py
7
25289
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
smendez/lean
paart/apps/infrastructure/links.py
2
3745
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from agencies.permissions import PERMISSION_AGENCY_EDIT, PERMISSION_AGENCY_VIEW from navigation.classes import Link from .icons import (icon_projects, icon_project_edit, icon_project_delete, icon_project_view, icon_age...
gpl-3.0
difcareer/Mobile-Security-Framework-MobSF
StaticAnalyzer/migrations/0001_initial.py
33
4971
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='StaticAnalyzerAndroid', fields=[ ('id', models....
gpl-3.0
ebu/PlugIt
tests/proxy_internal/test_plugit.py
1
12013
from _utils import TestBase import json import uuid class TestPlugIt(TestBase): @classmethod def setup_class(self): super(TestPlugIt, self).setup_class() from plugit_proxy.plugIt import PlugIt self.plugIt = PlugIt('http://0.0.0.0/') myself = self def _doQuery(url...
bsd-3-clause
dingocuster/scikit-learn
sklearn/metrics/regression.py
175
16953
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
bsd-3-clause
max0d41/kazoo
kazoo/client.py
2
49800
"""Kazoo Zookeeper Client""" import inspect import logging import os import re import warnings from collections import defaultdict, deque from functools import partial from os.path import split from kazoo.exceptions import ( AuthFailedError, ConfigurationError, ConnectionClosedError, ConnectionLoss, ...
apache-2.0
maciek263/django2
myvenv/Lib/site-packages/pip/_vendor/progress/spinner.py
404
1341
# -*- 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
AllanYangZhou/oppia
core/domain/user_jobs_continuous_test.py
1
41847
# coding: utf-8 # # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
ZhaoCJ/django
tests/model_fields/test_imagefield.py
4
16020
from __future__ import unicode_literals import os import shutil from unittest import skipIf from django.core.exceptions import ImproperlyConfigured from django.core.files import File from django.core.files.images import ImageFile from django.test import TestCase from django.utils._os import upath try: from .mode...
bsd-3-clause
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Dropbox/FilesAndMetadata/__init__.py
4
2525
from temboo.Library.Dropbox.FilesAndMetadata.ChunkedUpload import ChunkedUpload, ChunkedUploadInputSet, ChunkedUploadResultSet, ChunkedUploadChoreographyExecution from temboo.Library.Dropbox.FilesAndMetadata.CommitChunkedUpload import CommitChunkedUpload, CommitChunkedUploadInputSet, CommitChunkedUploadResultSet, Commi...
apache-2.0
xtfxme/uwsgi
contrib/uwsgi-cache-monitor.py
2
4594
import mmap import os import struct import array import time import sys from optparse import OptionParser class Cache: def __init__(self, filename, cache_slots, block_size=65536, sample_sleep=1): self.block_size = block_size self.cache_slots = cache_slots self.key_size = 2048 sel...
gpl-2.0
sneaker-rohit/PI2-ns-3
utils/python-unit-tests.py
155
6316
import unittest from ns.core import Simulator, Seconds, Config, int64x64_t import ns.core import ns.network import ns.internet import ns.mobility import ns.csma import ns.applications class TestSimulator(unittest.TestCase): def testScheduleNow(self): def callback(args): self._args_received = ...
gpl-2.0
imtapps/django-dynamic-validation
dynamic_validation/templatetags/dynamic_validation_tags.py
1
1727
from django.template import Library, Node, Variable from django.template.base import TemplateSyntaxError, VariableDoesNotExist from dynamic_validation import models register = Library() __all__ = ('violations_for', ) @register.tag def violations_for(parser, token): """ usage: {% violations_for trigge...
bsd-2-clause
PetaVision/projects
momentLearn/scripts/recon_simple.py
2
1138
import os, sys lib_path = os.path.abspath("/home/slundquist/workspace/PetaVision/plab/") sys.path.append(lib_path) from plotRecon import plotRecon from plotReconError import plotReconError #For plotting #import matplotlib.pyplot as plt outputDir = "/nh/compneuro/Data/momentLearn/output/simple_momentum_out/" skipFrame...
epl-1.0
alexlo03/ansible
lib/ansible/module_utils/network/f5/bigip.py
20
3737
# -*- coding: utf-8 -*- # # Copyright (c) 2017 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 import time try: from f5.bigip import ManagementRoot from icontrol...
gpl-3.0
awalls-cx18/gnuradio
gr-blocks/python/blocks/qa_file_source.py
6
5402
#!/usr/bin/env python # # Copyright 2018 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
harayz/raspberry_pwn
src/pexpect-2.3/pxssh.py
14
14565
"""This class extends pexpect.spawn to specialize setting up SSH connections. This adds methods for login, logout, and expecting the shell prompt. $Id: pxssh.py 487 2007-08-29 22:33:29Z noah $ """ from pexpect import * import pexpect import time __all__ = ['ExceptionPxssh', 'pxssh'] # Exception classes used by this...
gpl-3.0
dmsurti/reynolds-blender
reynolds_blender/add_block.py
1
4877
#------------------------------------------------------------------------------ # Reynolds-Blender | The Blender add-on for Reynolds, an OpenFoam toolbox. #------------------------------------------------------------------------------ # Copyright| #-----------------------------------------------------------------------...
gpl-3.0
mensi/cydra
cydra/web/themes.py
1
3596
# -*- coding: utf-8 -*- # # Copyright 2012 Manuel Stocker <mensi@mensi.ch> # # This file is part of Cydra. # # Cydra 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...
gpl-3.0
katestrykermcm/katemcmanus-byte1
lib/flask/__init__.py
345
1672
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ __version__ = '0.10' # utilities we import from Werkzeug and J...
apache-2.0
bobthekingofegypt/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/tokenizertotree.py
483
1965
from __future__ import absolute_import, division, unicode_literals import sys import os import json import re import html5lib from . import support from . import test_tokenizer p = html5lib.HTMLParser() unnamespaceExpected = re.compile(r"^(\|\s*)<html ([^>]+)>", re.M).sub def main(out_path): if not os.path.ex...
mpl-2.0
JamesMGreene/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/dashboard.py
140
2786
# Copyright (C) 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 of conditions and the...
bsd-3-clause
bruceSz/git_syncer
gsyncer/monitor/monitor-sample.py
1
1493
import re from wsgiref.simple_server import make_server def hello_world_app(environ,start_response): status = '200 OK' headers = [('Content-type','text/plain')] print environ start_response(status,headers) return ["hello world"] def event_analyst(environ,start_response): status = '200...
apache-2.0
watonyweng/nova
nova/conductor/tasks/base.py
56
1639
# 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 # d...
apache-2.0
damdam-s/OpenUpgrade
addons/l10n_nl/__init__.py
424
1413
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2009 Veritos - Jan Verlaan - www.veritos.nl # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # con...
agpl-3.0