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
ncopa/uwsgi
t/pypy/t_continulet2.py
21
1406
""" safer test for continulet with partial writes check to enable continulets you only need to call uwsgi_pypy_setup_continulets() soon after startup: uwsgi --pypy-wsgi-file t/pypy/t_continulet2.py --http-socket :9090 --pypy-home /opt/pypy --pypy-eval "uwsgi_pypy_setup_continulets()" --async 8 """ import uwsgi def...
gpl-2.0
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/chardet/euctwfreq.py
290
31621
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
apache-2.0
grossws/ansible-modules-core
cloud/openstack/os_image.py
68
6384
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either vers...
gpl-3.0
crackcell/www-entity-mining
software/game/17173.com/crawler.py
1
1873
#!/usr/bin/env python # -*- encoding: utf-8; indent-tabs-mode: nil -*- """ crawler ~~~~~~~ desc :copyright: (c) 2015 Menglong TAN. """ import os import sys import re import urllib2 import time import BeautifulSoup import logging logger = logging.getLogger(__file__) logger.setLevel(logging.DEBUG) ch ...
bsd-3-clause
hacklab-fi/hhlevents
hhlevents/apps/hhlregistrations/models.py
3
6401
import datetime import uuid from glob import glob from os.path import basename from django.db import models from django_markdown.models import MarkdownField from django_markdown.fields import MarkdownFormField from happenings.models import Event as HappeningsEvent from happenings.utils.next_event import get_next_event ...
bsd-3-clause
waldocarter/p2pool
SOAPpy/SOAPBuilder.py
289
22852
""" ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provid...
gpl-3.0
Eddy0402/Environment
vim/ycmd/third_party/requests/requests/status_codes.py
926
3200
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
gpl-3.0
Wonjuseo/Project101
others/sine_RNN.py
1
4425
import tensorflow as tf import numpy as np from sklearn.model_selection import train_test_split from sklearn.utils import shuffle def sin(x, T=100): return np.sin(2.0*np.pi*x/T) def problem(T=100,ampl=0.05): x = np.arange(0,2*T+1) noise = ampl*np.random.uniform(low=-1.0,high=1.0,size=len(x)) ...
apache-2.0
rossburton/yocto-autobuilder
lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/test/unit/test_commands_fs.py
4
6660
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
isandlaTech/cohorte-devtools
org.cohorte.eclipse.runner.basic/files/jython/Lib/encodings/cp1255.py
593
12722
""" Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
apache-2.0
JungeAlexander/cocoscore
ci/bootstrap.py
1
2124
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import os import sys from os.path import abspath from os.path import dirname from os.path import exists from os.path import join if __name__ == "__main__": base_path = dirname(dirname(abspath(__...
mit
w1kke/pylearn2
pylearn2/linear/conv2d.py
43
9224
""" .. todo:: WRITEME """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" import functools import numpy as np from theano.compat.six.moves i...
bsd-3-clause
wiredrive/wtframework
wtframework/wtf/testobjects/tests/test_watched_test_case.py
1
5126
########################################################################## # This file is part of WTFramework. # # WTFramework 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 L...
gpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/xml/dom/pulldom.py
322
11974
import xml.sax import xml.sax.handler import types try: _StringTypes = [types.StringType, types.UnicodeType] except AttributeError: _StringTypes = [types.StringType] START_ELEMENT = "START_ELEMENT" END_ELEMENT = "END_ELEMENT" COMMENT = "COMMENT" START_DOCUMENT = "START_DOCUMENT" END_DOCUMENT = "END_DOCUMENT" ...
gpl-2.0
ljmanso/AGM2
tools/agmdsr/src/genericworker.py
1
3256
# # Copyright (C) 2017 by YOUR NAME HERE # # This file is part of RoboComp # # RoboComp 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...
gpl-3.0
raphaelvalentin/Utils
ngspice/syntax/nport.py
1
5197
from ngspice.syntax import * from functions.science import flatten from rawdata import touchstone from interpolate import interp1d __all__ = ['Nport'] class VCVSx(Netlist): __name__ = "vcvs" __type__ = "instance" __indent__ = "" def __init__(self, name='E1', nodes=('in', 'out', 'sensp', 'sensm...
gpl-2.0
Joergen/olympia
apps/users/tests/test_user_utils.py
16
2665
import fudge import mock from nose.tools import eq_ from django.conf import settings import amo.tests from users.models import BlacklistedName from users.utils import EmailResetCode, autocreate_username class TestEmailResetCode(amo.tests.TestCase): def test_parse(self): id = 1 mail = 'nobody@mo...
bsd-3-clause
kylef/pyppp
pyppp/django/forms.py
1
3810
from django import forms from django.conf import settings from django.http import HttpResponseRedirect from django.views.decorators.cache import never_cache from django.contrib.auth import authenticate, REDIRECT_FIELD_NAME from django.contrib.formtools.wizard import FormWizard from pyppp.django import login from pyppp...
bsd-2-clause
bjko/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/text.py
193
2207
# Copyright (C) 2009 Google Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # 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...
bsd-3-clause
iamahuman/angr
tests/test_bindiff.py
3
2109
import nose import angr import logging l = logging.getLogger("angr.tests.test_bindiff") import os test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests') # todo make a better test def test_bindiff_x86_64(): binary_path_1 = os.path.join(test_location, 'x86_64', '...
bsd-2-clause
google/nerfactor
nerfactor/models/base.py
1
5484
# Copyright 2021 Google 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
tsgit/invenio
modules/bibdocfile/lib/bibdocfile_web_tests.py
8
5273
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2012 CERN. ## ## Invenio 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...
gpl-2.0
ArcherSys/ArcherSys
eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/encodings/shift_jisx0213.py
816
1059
# # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
mit
blueyed/jedi
scripts/wx_check.py
27
1669
#! /usr/bin/env python """ Depends: ``objgraph`` (third party Python library) ``wx._core`` is a very nice module to test Jedi's speed and memory performance on big Python modules. Its size is ~16kLOC (one file). It also seems to look like a typical big Python modules. A mix between a lot of different Python things. Y...
mit
dials/dials
command_line/apply_mask.py
1
3188
import pickle from dxtbx.format.image import ImageBool from iotbx.phil import parse import dials.util help_message = """ This program augments a experiments JSON file with one or more masks specified by the user. Its only function is to input the mask file paths to the experiments JSON file, but means that the use...
bsd-3-clause
chirpradio/chirpradio-volunteers
site-packages/django/contrib/auth/__init__.py
9
3163
import datetime from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module SESSION_KEY = '_auth_user_id' BACKEND_SESSION_KEY = '_auth_user_backend' REDIRECT_FIELD_NAME = 'next' def load_backend(path): i = path.rfind('.') module, attr = path[:i], path[i+1:] try...
mit
hubert667/AIR
build/kombu/kombu/utils/debug.py
39
1668
""" kombu.utils.debug ================= Debugging support. """ from __future__ import absolute_import import logging from functools import wraps from kombu.five import items from kombu.log import get_logger __all__ = ['setup_logging', 'Logwrapped'] def setup_logging(loglevel=logging.DEBUG, loggers=['kombu.conne...
gpl-3.0
ZobairAlijan/osf.io
website/notifications/views.py
23
3893
import httplib as http from flask import request from framework import sentry from framework.auth.decorators import must_be_logged_in from framework.exceptions import HTTPError from website.notifications import utils from website.notifications.constants import NOTIFICATION_TYPES from website.notifications.model impo...
apache-2.0
darkryder/django
django/middleware/http.py
49
1203
from django.utils.cache import get_conditional_response from django.utils.deprecation import MiddlewareMixin from django.utils.http import http_date, parse_http_date_safe, unquote_etag class ConditionalGetMiddleware(MiddlewareMixin): """ Handles conditional GET operations. If the response has an ETag or L...
bsd-3-clause
brian-l/django-1.4.10
django/http/__init__.py
41
30763
from __future__ import absolute_import import datetime import os import re import sys import time import warnings from pprint import pformat from urllib import urlencode, quote from urlparse import urljoin, urlparse try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: ...
bsd-3-clause
CodingCat/mxnet
example/neural-style/end_to_end/data_processing.py
52
3074
# 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
larsbergstrom/servo
tests/wpt/web-platform-tests/eventsource/resources/cors-cookie.py
248
1220
from datetime import datetime def main(request, response): last_event_id = request.headers.get("Last-Event-Id", "") ident = request.GET.first('ident', "test") cookie = "COOKIE" if ident in request.cookies else "NO_COOKIE" origin = request.GET.first('origin', request.headers["origin"]) credentials =...
mpl-2.0
Newman101/hamster
wafadmin/Configure.py
7
8914
#!/usr/bin/env python2 # encoding: utf-8 import os,shlex,sys,time try:import cPickle except ImportError:import pickle as cPickle import Environment,Utils,Options,Logs from Logs import warn from Constants import* try: from urllib import request except: from urllib import urlopen else: urlopen=request.urlopen conf_te...
gpl-3.0
WGBH/django-textplusstuff
textplusstuff/datastructures.py
1
5466
from __future__ import unicode_literals import json from django.utils.encoding import force_text from django.utils.safestring import mark_safe from .parser import ( MarkdownFlavoredTextNode, ModelStuffNode, TextPlusStuffLexer, TextPlusStuffParser ) class TextPlusStuff(object): def __init__(self...
mit
QinerTech/QinerApps
openerp/addons/stock_calendar/procurement.py
10
17675
from datetime import datetime from dateutil.relativedelta import relativedelta from openerp import api from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT from openerp import SUPERUSER_ID from psycopg2 import Oper...
gpl-3.0
faridani/pyDoc
Unidecode/unidecode/x06c.py
252
4643
data = ( 'Lu ', # 0x00 'Mu ', # 0x01 'Li ', # 0x02 'Tong ', # 0x03 'Rong ', # 0x04 'Chang ', # 0x05 'Pu ', # 0x06 'Luo ', # 0x07 'Zhan ', # 0x08 'Sao ', # 0x09 'Zhan ', # 0x0a 'Meng ', # 0x0b 'Luo ', # 0x0c 'Qu ', # 0x0d 'Die ', # 0x0e 'Shi ', # 0x0f 'Di ', # 0x10 'Min...
mit
Srisai85/scikit-learn
examples/linear_model/plot_iris_logistic.py
283
1678
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
bsd-3-clause
eigenmethod/esia-connector
examples/flask_app.py
2
1600
import os from flask import Flask, request from esia_connector.client import EsiaSettings, EsiaAuth def get_test_file(name): return os.path.join(os.path.dirname(__file__), 'res', name) TEST_SETTINGS = EsiaSettings(esia_client_id='YOUR SYSTEM ID', redirect_uri='http://localhost:500...
bsd-3-clause
takis/odoo
addons/account/ir_sequence.py
336
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
horazont/aiosasl
tests/test_stringprep.py
1
5198
######################################################################## # File name: test_stringprep.py # This file is part of: aiosasl # # LICENSE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software ...
lgpl-3.0
mezz64/home-assistant
homeassistant/components/flume/const.py
16
1051
"""The Flume component.""" DOMAIN = "flume" PLATFORMS = ["sensor"] DEFAULT_NAME = "Flume Sensor" FLUME_TYPE_SENSOR = 2 FLUME_QUERIES_SENSOR = { "current_interval": {"friendly_name": "Current", "unit_of_measurement": "gal/m"}, "month_to_date": {"friendly_name": "Current Month", "unit_of_measurement": "gal"}, ...
apache-2.0
ShanghaiTimes/Audacity2015
lib-src/lv2/lv2/waflib/Tools/d.py
278
2076
#! /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 Utils,Task,Errors from waflib.TaskGen import taskgen_method,feature,extension from waflib.Tools import d_scan,d_config from waflib.Tools.ccroot import link_...
gpl-2.0
popazerty/enigma2-obh
lib/python/Screens/BpGreen.py
8
8702
from Screens.Screen import Screen from Screens.Standby import TryQuitMainloop from Screens.MessageBox import MessageBox from Screens.Console import Console from Components.ActionMap import ActionMap from Components.config import config, ConfigText, configfile from Components.Sources.List import List from Components.Lab...
gpl-2.0
rknLA/sms-tools
software/models/sprModel.py
25
6096
# functions that implement analysis and synthesis of sounds using the Sinusoidal plus Residual Model # (for example usage check the examples models_interface) import numpy as np from scipy.signal import blackmanharris, triang from scipy.fftpack import fft, ifft import math import dftModel as DFT import sineModel as SM...
agpl-3.0
prophile/jacquard
jacquard/directory/base.py
1
1451
"""Base class for directory implementations.""" import abc import collections UserEntry = collections.namedtuple("UserEntry", "id join_date tags") UserEntry.__doc__ = """ Description of attributes of a single user. Internally this is a `collections.namedtuple`. """ UserEntry.id.__doc__ = """String user ID.""" User...
mit
zulip/zulip
zproject/wsgi.py
6
1917
""" WSGI config for zulip project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
apache-2.0
mjudsp/Tsallis
sklearn/tests/test_random_projection.py
141
14040
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.metrics import euclidean_distances from sklearn.random_projection import johnson_lindenstrauss_min_dim from sklearn.random_projection import gaussian_random_matrix from sklearn.random_projection import sparse_random_matrix from...
bsd-3-clause
zeroblade1984/Yureka-64bit
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
UfSoft/trac-google-search
tracext/google/search/__init__.py
1
3529
# -*- coding: utf-8 -*- # vim: sw=4 ts=4 fenc=utf-8 et # ============================================================================== # Copyright © 2008 UfSoft.org - Pedro Algarvio <ufs@ufsoft.org> # # Please view LICENSE for additional licensing information. # ========================================================...
bsd-3-clause
tooxie/shiva-server
var/restideas.py
2
4888
# -*- coding: utf-8 -*- """ cat /dev/brain ============== Just a series of thoughts about how the Flask-Restless' API could be modified to allow for the creation of non db-backed resources. None of this has been through any serious thought about fesibility, they are just random ideas. """ from flask import Flask from ...
mit
topxiaoke/myedx
common/lib/xmodule/xmodule/tests/test_imageannotation.py
20
2928
# -*- coding: utf-8 -*- """Test for Image Annotation Xmodule functional logic.""" import unittest from mock import Mock from lxml import etree from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.imageannotation_module import ImageAnnotationModule from . import get_test_system...
agpl-3.0
mugizico/scikit-learn
sklearn/externals/joblib/__init__.py
36
4795
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
omg-insa/server
django/core/cache/backends/filebased.py
229
4947
"File-based cache backend" import os import time import shutil try: import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache from django.utils.hashcompat import md5_constructor class FileBasedCache(BaseCache): def __init__(self, dir, params): ...
bsd-3-clause
skymill/automated-ebs-snapshots
automated_ebs_snapshots/command_line_options.py
1
3302
""" Command line options """ import argparse import sys import os.path from ConfigParser import SafeConfigParser from automated_ebs_snapshots.valid_intervals import VALID_INTERVALS settings = SafeConfigParser() settings.read('{}/settings.conf'.format( os.path.dirname(os.path.realpath(__file__)))) parser = argpa...
apache-2.0
o3project/ryu-oe
ryu/tests/switch/run_mininet.py
8
1231
#!/usr/bin/env python import sys from mininet.cli import CLI from mininet.link import Link from mininet.net import Mininet from mininet.node import RemoteController from mininet.node import OVSSwitch from mininet.node import UserSwitch from mininet.term import makeTerm from oslo.config import cfg from ryu import ver...
apache-2.0
pombredanne/dask
dask/tests/test_async.py
1
5236
from __future__ import absolute_import, division, print_function from operator import add from copy import deepcopy import dask import pytest from dask.async import * fib_dask = {'f0': 0, 'f1': 1, 'f2': 1, 'f3': 2, 'f4': 3, 'f5': 5, 'f6': 8} def test_start_state(): dsk = {'x': 1, 'y': 2, 'z': (inc, 'x'), 'w'...
bsd-3-clause
rosmo/boto
boto/cloudsearch2/search.py
135
16222
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
mit
nwiizo/workspace_2017
ansible-modules-extras/messaging/rabbitmq_parameter.py
48
4920
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <oss@chathamfinancial.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...
mit
Nagriar/mongo-connector
tests/test_mongo_connector.py
32
4841
# Copyright 2013-2014 MongoDB, 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 writin...
apache-2.0
dennis-sheil/commandergenius
project/jni/python/src/Mac/Modules/folder/folderscan.py
34
2053
# Scan an Apple header file, generating a Python file of generator calls. import sys from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner_OSX LONG = "Folders" SHORT = "folder" OBJECT = "NOTUSED" def main(): input = LONG + ".h" output = SHORT + "gen.py" defs...
lgpl-2.1
readevalprint/mezzanine
mezzanine/pages/tests.py
5
21542
from __future__ import unicode_literals from django.contrib.sites.models import Site from future.builtins import str from unittest import skipUnless from django.apps import apps from django.core.checks import Warning from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser f...
bsd-2-clause
nagordon/mechpy
mechpy/composites.py
1
71681
# coding: utf-8 ''' Module for composite material analysis Hyer-Stress Analysis of Fiber-Reinforced Composite Materials Herakovich-Mechanics of Fibrous Composites Daniel-Engineering Mechanics of Composite Materials Kollar-Mechanics of COmposite Structures NASA- Basic Mechancis of Lamianted Composites ht...
mit
ASlave2Audio/Restaurant-App
mingw/bin/lib/lib-tk/test/test_ttk/test_functions.py
21
16402
# -*- encoding: utf-8 -*- import sys import unittest import ttk class MockTclObj(object): typename = 'test' def __init__(self, val): self.val = val def __str__(self): return unicode(self.val) class MockStateSpec(object): typename = 'StateSpec' def __init__(self, *args): ...
mit
sadleader/odoo
addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
337
3000
# -*- 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
AmrThabet/CouchPotatoServer
libs/caper/matcher.py
81
4952
# Copyright 2013 Dean Gardiner <gardiner91@gmail.com> # # 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 a...
gpl-3.0
JshWright/home-assistant
tests/components/config/test_group.py
10
4081
"""Test Z-Wave config panel.""" import asyncio import json from unittest.mock import patch from homeassistant.bootstrap import async_setup_component from homeassistant.components import config from tests.common import mock_http_component_app VIEW_NAME = 'api:config:group:config' @asyncio.coroutine def test_get_dev...
apache-2.0
onesfreedom/pybuilder
src/unittest/python/plugins/python/pymetrics_plugin_tests.py
7
1316
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2015 PyBuilder Team # # 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/l...
apache-2.0
happyleavesaoc/home-assistant
tests/components/sensor/test_rest.py
12
8043
"""The tests for the REST switch platform.""" import unittest from unittest.mock import patch, Mock import requests from requests.exceptions import Timeout, MissingSchema, RequestException import requests_mock from homeassistant.setup import setup_component import homeassistant.components.sensor as sensor import home...
apache-2.0
dak180/warzone2100
tools/trac/plugins/ticketnotifications/newticketnotification/admin.py
11
3305
# vim: set et sts=4 sw=4 encoding=utf8: # -*- coding: utf-8 -*- from model import * from trac.admin.api import IAdminPanelProvider from trac.core import * from trac.util.translation import _ from trac.web.chrome import ITemplateProvider class NewTicketNotificationAdmin(Component): """Allows to setup a list of e-...
gpl-2.0
BambooL/jeeves
test/jeevesdb/tests.py
2
25029
from django.db import models from django.utils import unittest from django.test import TestCase import JeevesLib from jeevesdb import JeevesModel from testdb.models import Animal, Zoo, AnimalWithPolicy, AnimalWithPolicy2 import nose.tools as nt def parse_vars_row(vs): d = {} for entry in vs.split(';')[1:-1]...
mit
cloudbase/cinder
cinder/volume/drivers/hitachi/hbsd_common.py
7
32287
# Copyright (C) 2014, Hitachi, Ltd. # # 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...
apache-2.0
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/boto/ec2/keypair.py
17
4352
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
gpl-2.0
broferek/ansible
test/units/modules/network/onyx/test_onyx_lldp.py
23
2383
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
pedro2d10/SickRage-FR
lib/chardet/utf8prober.py
52
2709
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
StoneyJackson/unzipR
unzipr.py
1
4368
# unzipR - A library for recursively extracting files. # Copyright (C) 2014 Stoney Jackson <dr.stoney@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
gpl-3.0
ssbarnea/ansible
lib/ansible/modules/pause.py
31
3063
#!/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 DOCUMENTATION = ''' --- module: pause short_description: Pause playbook execution description: ...
gpl-3.0
alexforencich/xfcp
lib/eth/tb/eth_mac_1g_fifo/test_eth_mac_1g_fifo.py
2
8831
#!/usr/bin/env python """ Copyright (c) 2020 Alex Forencich 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, merg...
mit
msebire/intellij-community
python/lib/Lib/site-packages/django/conf/locale/nb/formats.py
685
1657
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FOR...
apache-2.0
adamchainz/ansible
test/units/module_utils/test_known_hosts.py
63
5338
# -*- coding: utf-8 -*- # (c) 2015, Michael Scherer <mscherer@redhat.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 ...
gpl-3.0
mith1979/ansible_automation
applied_python/applied_python/lib/python2.7/site-packages/dns/hash.py
108
2395
# Copyright (C) 2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMIN...
apache-2.0
drano/django-mailer
mailer/models.py
2
8261
import base64 import logging import pickle from datetime import datetime from django.core.mail import EmailMessage from django.db import models PRIORITIES = ( ("1", "high"), ("2", "medium"), ("3", "low"), ("4", "deferred"), ) class MessageManager(models.Manager): def high_priority(self): ...
mit
postlund/home-assistant
tests/components/sonarr/test_sensor.py
1
30602
"""The tests for the Sonarr platform.""" from datetime import datetime import time import unittest import pytest import homeassistant.components.sonarr.sensor as sonarr from homeassistant.const import DATA_GIGABYTES from tests.common import get_test_home_assistant def mocked_exception(*args, **kwargs): """Mock...
apache-2.0
fernand/scipy
scipy/_lib/tests/test__util.py
84
1450
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal, assert_ from scipy._lib._util import _aligned_zeros def test__aligned_zeros(): niter = 10 def check(shape, dtype, order, align): err_msg = repr((shape, dtype, order, align)) ...
bsd-3-clause
alephu5/Soundbyte
environment/lib/python3.3/site-packages/numpy/lib/tests/test_polynomial.py
8
4631
from __future__ import division, absolute_import, print_function ''' >>> p = np.poly1d([1.,2,3]) >>> p poly1d([ 1., 2., 3.]) >>> print(p) 2 1 x + 2 x + 3 >>> q = np.poly1d([3.,2,1]) >>> q poly1d([ 3., 2., 1.]) >>> print(q) 2 3 x + 2 x + 1 >>> print(np.poly1d([1.89999+2j, -3j, -5.12345678, 2+1j])) ...
gpl-3.0
nysan/yocto-autobuilder
lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/conch/ssh/service.py
69
1408
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ The parent class for all the SSH services. Currently implemented services are ssh-userauth and ssh-connection. Maintainer: Paul Swartz """ from twisted.python import log class SSHService(log.Logger): name = None # this is the ssh name...
gpl-2.0
aio-libs/aioredis
aioredis/connection.py
1
59561
import asyncio import errno import inspect import io import os import socket import ssl import threading import time import warnings from distutils.version import StrictVersion from itertools import chain from typing import ( Any, Iterable, List, Mapping, Optional, Set, Tuple, Type, ...
mit
Pablo126/SSBW
Entrega1/lib/python3.5/site-packages/django/contrib/postgres/forms/ranges.py
132
3063
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...
gpl-3.0
dashpay/dash
test/functional/wallet_hd.py
2
5990
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test Hierarchical Deterministic wallet function.""" import sys import shutil import os from test_framework...
mit
pim89/youtube-dl
youtube_dl/extractor/franceinter.py
45
2040
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import month_by_name class FranceInterIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?franceinter\.fr/emissions/(?P<id>[^?#]+)' _TEST = { 'url': 'https://www.franceinter.fr/emissions/affaires-...
unlicense
timvandermeij/servo
tests/wpt/css-tests/css21_dev/xhtml1print/support/fonts/makegsubfonts.py
1616
14125
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
SOKP/external_chromium_org
native_client_sdk/src/tools/sel_ldr.py
43
5010
#!/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. """Wrapper script for launching application within the sel_ldr. """ import optparse import os import subprocess import sys import cre...
bsd-3-clause
wkschwartz/django
tests/gis_tests/geoapp/test_sitemaps.py
62
2501
import zipfile from io import BytesIO from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from .models import City, Country @modify_settings(INSTALLED_APPS={'append': ['django.contrib.sites', '...
bsd-3-clause
StefanRijnhart/stock-logistics-warehouse
__unported__/stock_available_sale/product.py
6
10213
# -*- coding: utf-8 -*- ############################################################################## # # This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
40223139/2015cdaa5-12
static/Brython3.1.1-20150328-091302/Lib/atexit.py
743
1049
"""allow programmer to define multiple exit functions to be executedupon normal program termination. Two public functions, register and unregister, are defined. """ class __loader__(object): pass def _clear(*args,**kw): """_clear() -> None Clear the list of previously registered exit functions.""" ...
gpl-3.0
Changaco/oh-mainline
vendor/packages/Django/django/utils/itercompat.py
99
1466
""" Providing iterator functions that are not in all version of Python we support. Where possible, we try to use the system-native version and only fall back to these implementations if necessary. """ import collections import itertools import sys import warnings def is_iterable(x): "A implementation independent...
agpl-3.0
SamiHiltunen/invenio-demosite
invenio_demosite/testsuite/regression/test_testutils.py
7
4298
# -*- coding: utf-8 -*- # # This file is part of Invenio Demosite. # Copyright (C) 2006, 2007, 2008, 2010, 2011 CERN. # # Invenio Demosite 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 th...
gpl-2.0
KublaikhanGeek/scrapy
tests/test_downloadermiddleware.py
54
4275
from twisted.trial.unittest import TestCase from twisted.python.failure import Failure from scrapy.http import Request, Response from scrapy.spiders import Spider from scrapy.core.downloader.middleware import DownloaderMiddlewareManager from scrapy.utils.test import get_crawler from tests import mock class ManagerTe...
bsd-3-clause
dhuang/incubator-airflow
airflow/contrib/operators/file_to_wasb.py
16
2200
# -*- coding: utf-8 -*- # # 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
gazpachoking/Flexget
flexget/plugins/filter/require_field.py
2
1102
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from flexget import plugin from flexget.config_schema import one_or_more from flexget.event import event log = logging.getLogger('require_field') class F...
mit
toast38coza/ansible-modules
library/kong_plugin.py
1
3447
#!/usr/bin/python import requests class KongPlugin: def __init__(self, base_url, api_name): self.base_url = "{}/apis/{}/plugins" . format(base_url, api_name) self.api = api_name def list(self): return requests.get(self.base_url) def _get_plugin_id(self, name, plugins_li...
mit