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
thepiper/standoff
venv/lib/python2.7/site-packages/werkzeug/test.py
183
34152
# -*- coding: utf-8 -*- """ werkzeug.test ~~~~~~~~~~~~~ This module implements a client to WSGI applications for testing. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import mimetypes from time import time from...
gpl-3.0
cvley/gocaffe
caffe/python/caffe/test/test_coord_map.py
30
6894
import unittest import numpy as np import random import caffe from caffe import layers as L from caffe import params as P from caffe.coord_map import coord_map_from_to, crop def coord_net_spec(ks=3, stride=1, pad=0, pool=2, dstride=2, dpad=0): """ Define net spec for simple conv-pool-deconv pattern common t...
gpl-3.0
ShawnKoo/avplayer
libtorrent/dht_flood.py
40
1593
#! /usr/bin/env python import socket import sys from types import StringType, IntType, LongType, DictType, ListType, TupleType import random port = int(sys.argv[1]) # from BitTorrent 4.3.0 def encode_bencached(x,r): r.append(x.bencoded) def encode_int(x, r): r.extend(('i', str(x), 'e')) def encode_string(x...
gpl-3.0
luiseduardohdbackup/odoo
addons/account/report/account_financial_report.py
380
6365
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
Mega-DatA-Lab/mxnet
example/speech_recognition/main.py
44
17548
# 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
fortnight/Grammar_Game
Grammar_Game.py
1
13707
#!/usr/bin/python import sys import pygame from Buttons import Buttons from GameButton import GameButton from MenuButton import MenuButton from gi.repository import Gtk class Grammar_Game: def __init__(self): # Set up a clock for managing the frame rate. self.clock = pygame.time.Clock() s...
gpl-3.0
tensorflow/moonlight
moonlight/score/reader_test.py
1
19072
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
miyosuda/intro-to-dl-android
HandWriting/jni-build/jni/include/tensorflow/g3doc/how_tos/adding_an_op/zero_out_1_test.py
9
1213
# Copyright 2015 Google 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
diagramsoftware/odoomrp-wip
mrp_production_add_middle_stuff_operations/tests/test_add_middle_stuff_operations.py
6
3015
# -*- coding: utf-8 -*- # Copyright © 2017 Oihane Crucelaegui - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp.addons.mrp_production_add_middle_stuff.tests\ .test_mrp_production_add_middle_stuff import\ TestMrpProductionAddMiddleStuff class TestAddMiddleStuffOperations...
agpl-3.0
badjr/pysal
pysal/contrib/spint/tests/test_gravity_stats.py
8
12472
""" Tests for statistics for gravity-style spatial interaction models """ __author__ = 'toshan' import unittest import numpy as np import pandas as pd import gravity as grav import mle_stats as stats class SingleParameter(unittest.TestCase): """Unit tests statistics when there is a single parameters estimated""...
bsd-3-clause
psiwczak/openstack
nova/utils.py
1
53103
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
michaelbrooks/twitter-feels
twitter_feels/settings/prod.py
1
1165
""" Production settings. Based on https://github.com/rdegges/django-skel/blob/master/project_name/settings/prod.py """ from os import environ from common import * # Below are things we might need to deal with later ########## EMAIL CONFIGURATION ########## DATABASE CONFIGURATION ########## CACHE CONFIGURATION ########...
mit
gaddman/ansible
lib/ansible/modules/cloud/vmware/vmware_vmkernel_facts.py
43
7271
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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...
gpl-3.0
opoplawski/cobbler
cobbler/modules/authn_pam.py
14
4823
""" Authentication module that uses /etc/cobbler/auth.conf Choice of authentication module is in /etc/cobbler/modules.conf Copyright 2007-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Pu...
gpl-2.0
telminov/django-park-keeper
parkkeeper/forms.py
1
2880
# coding: utf-8 import json from django import forms from parkkeeper import models from croniter import croniter class BaseSchedule(forms.ModelForm): def clean_options_json(self): options_json = self.cleaned_data.get('options_json') if options_json: try: options = json...
mit
kived/kivy
examples/widgets/colorusage.py
21
1409
from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy.lang import Builder Builder.load_string(""" #:import hex kivy.utils.get_color_from_hex <Root>: cols: 2 canvas: Color: rgba: 1, 1, 1, 1 Rectangle: pos: self.pos size: self.size ...
mit
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/behave/runner.py
1
24139
# -*- coding: utf-8 -*- from __future__ import with_statement import contextlib import os.path import StringIO import sys import traceback import warnings import weakref from behave import matchers from behave.step_registry import setup_step_decorators from behave.formatter import formatters from behave.configuration...
bsd-3-clause
kaedroho/wagtail
wagtail/admin/tests/benches.py
19
2911
from __future__ import absolute_import, unicode_literals from django.test import TestCase from django.urls import reverse from django.utils import timezone from wagtail.core.models import Page, Site from wagtail.tests.benchmark import Benchmark from wagtail.tests.testapp.models import SingleEventPage, StreamPage from...
bsd-3-clause
adrianholovaty/django
django/contrib/gis/tests/distapp/models.py
406
1832
from django.contrib.gis.db import models class SouthTexasCity(models.Model): "City model on projected coordinate system for South Texas." name = models.CharField(max_length=30) point = models.PointField(srid=32140) objects = models.GeoManager() def __unicode__(self): return self.name class SouthTe...
bsd-3-clause
eyolfson/site-eyl
django_blog/hooks.py
1
1907
# Copyright 2014 Jon Eyolfson # # This file is distributed under the GPLv3 license import datetime import logging import markdown import os import pygit2 from django_blog.models import Post from django_gitolite.utils import home_dir logger = logging.getLogger('django_blog') def update_blog(push): repo_path = pu...
gpl-3.0
devGregA/code
scrapy/tests/test_utils_deprecate.py
14
9067
# -*- coding: utf-8 -*- from __future__ import absolute_import import inspect import unittest import warnings import mock from scrapy.utils.deprecate import create_deprecated_class class MyWarning(UserWarning): pass class SomeBaseClass(object): pass class NewName(SomeBaseClass): pass class WarnWhenS...
bsd-3-clause
AngelValera/bares-y-tapas-DAI
proyecto_DAI/urls.py
1
1515
"""proyecto_DAI URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
mit
cpatrick/ITK-RemoteIO
Examples/Filtering/MeanImageFilter.py
13
1378
#========================================================================== # # Copyright Insight Software Consortium # # 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...
apache-2.0
jlmadurga/django-oscar
src/oscar/apps/offer/admin.py
30
1188
from django.contrib import admin from oscar.core.loading import get_model ConditionalOffer = get_model('offer', 'ConditionalOffer') Condition = get_model('offer', 'Condition') Benefit = get_model('offer', 'Benefit') Range = get_model('offer', 'Range') class ConditionAdmin(admin.ModelAdmin): list_display = ('typ...
bsd-3-clause
glwu/python-for-android
python3-alpha/python3-src/Lib/lib2to3/fixes/fix_has_key.py
164
3222
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for has_key(). Calls to .has_key() methods are expressed in terms of the 'in' operator: d.has_key(k) -> k in d CAVEATS: 1) While the primary target of this fixer is dict.has_key(), the fixer will chan...
apache-2.0
gschizas/praw
praw/models/reddit/wikipage.py
1
10000
"""Provide the WikiPage class.""" from typing import Any, Dict, Generator, Optional, TypeVar, Union from ...const import API_PATH from ...util.cache import cachedproperty from ..listing.generator import ListingGenerator from .base import RedditBase from .redditor import Redditor _WikiPage = TypeVar("_WikiPage") Reddi...
bsd-2-clause
broferek/ansible
lib/ansible/modules/network/fortios/fortios_firewall_ssh_local_ca.py
13
11106
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 3 of the Lic...
gpl-3.0
gregcaporaso/qiime
tests/test_parallel/test_util.py
15
10835
#!/usr/bin/env python # File created on 13 Jul 2012 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "gregcaporaso@gmail.com" from ...
gpl-2.0
thresholdsoftware/asylum
openerp/addons/account/project/report/__init__.py
427
1175
# -*- 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
tokenly/bitsplit-server
util/entity.py
1
1359
""" ENTITY """ class Entity(object): """ ENTITY A wrapped for a data dictionary. Allows interface with data, but also allows extending to allow methods to manipulate data. """ def __init__(self, collection, data=None): if not data: data = {} super(Entity, self).__...
gpl-2.0
Health123/ansible
v1/ansible/runner/lookup_plugins/env.py
154
1282
# (c) 2012, Jan-Piet Mens <jpmens(at)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 later ver...
gpl-3.0
dbckz/ansible
lib/ansible/utils/color.py
54
3960
# (c) 2012-2014, 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) an...
gpl-3.0
Viq111/bluemars
unittest/gtest/test/gtest_env_var_test.py
2408
3487
#!/usr/bin/env python # # Copyright 2008, 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...
lgpl-2.1
futurepr0n/Books-solutions
Python-For-Everyone-Horstmann/Chapter6-Lists/P6.30.py
1
1303
# Write a function # def mergeSorted(a, b) # that merges two sorted lists, producing a new sorted list. Keep an index into each list, # indicating how much of it has been processed already. Each time, append the small- # est unprocessed element from either list, then advance the index. For example, if a is # 1 ...
mit
gramps-project/addons-source
AllNamesQuickview/AllNames.py
2
2397
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Douglas S. Blank # # 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...
gpl-2.0
googleinterns/contextual-query-rewrites
utils/test_translate_utils.py
1
1527
import unittest import translate_utils import os import shutil class TestRawData(unittest.TestCase): def test_translate_text(self): file = open("dummy_file.txt", 'w') file.write(" Ram \n") file.close() translate_utils.translate_data("dummy_file.txt", "dummy_output.txt") d...
apache-2.0
toomoresuch/pysonengine
eggs/Jinja2-2.5.5-py2.6.egg/jinja2/testsuite/regression.py
24
7621
# -*- coding: utf-8 -*- """ jinja2.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests corner cases and bugs. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import time import tempfile import unittest from jinja2.testsuite import JinjaTestCas...
mit
allanino/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/pylab.py
70
10245
""" This is a procedural interface to the matplotlib object-oriented plotting library. The following plotting commands are provided; the majority have Matlab(TM) analogs and similar argument. _Plotting commands acorr - plot the autocorrelation function annotate - annotate something in the figure arrow ...
agpl-3.0
DGtal-team/DGtal
wrap/tests/topology/test_KhalimskySpaceND.py
2
8287
import pytest import dgtal import copy @pytest.mark.parametrize("Type", [("Cell2D"), ("Cell3D")]) def test_Cell(Type): submodule = getattr(dgtal, "topology") # KhalimskyCell does not allow modification of its preCell data member, a KhalimskyPreCell Cell = getattr(submodule, Type) cell = Cell() asse...
lgpl-3.0
nvoron23/hadoop-20
src/contrib/thriftfs/gen-py/hadoopfs/ThriftHadoopFileSystem.py
8
189021
# # Autogenerated by Thrift Compiler (0.7.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from thrift.Thrift import * from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.pro...
apache-2.0
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/site-packages/sqlalchemy/types.py
34
1650
# types.py # Copyright (C) 2005-2016 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 """Compatibility namespace for sqlalchemy.sql.types. """ __all__ = ['TypeEngine', 'TypeDe...
gpl-3.0
apkbox/nano-rpc
third_party/googlemock/src/gtest/scripts/gen_gtest_pred_impl.py
412
21984
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
duongbaoduy/gtools
third_party/protobuf26/internal/enum_type_wrapper.py
292
3541
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
valhallasw/pywikibot-core
scripts/blockreview.py
2
13454
#!/usr/bin/python # -*- coding: utf-8 -*- """ This bot implements a blocking review process for de-wiki first. For other sites this bot script must be changed. This script is run by [[de:User:xqt]]. It should not be run by other users without prior contact. The following parameters are supported: - """ # # (C) xq...
mit
ahua/pythondotorg
downloads/managers.py
9
2011
from django.db.models import Manager from django.db.models.query import QuerySet class ReleaseQuerySet(QuerySet): def published(self): return self.filter(is_published=True) def draft(self): return self.filter(is_published=False) def downloads(self): """ For the main downloads lan...
apache-2.0
Solitarily/htc_kernel_rider_ics
scripts/gcc-wrapper.py
484
3824
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 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 ...
gpl-2.0
camptocamp/odoo
addons/product_email_template/models/invoice.py
37
1974
# -*- coding: utf-8 -*- from openerp.osv import osv class account_invoice(osv.Model): _inherit = 'account.invoice' def invoice_validate_send_email(self, cr, uid, ids, context=None): Composer = self.pool['mail.compose.message'] for invoice in self.browse(cr, uid, ids, context=context): ...
agpl-3.0
AutorestCI/azure-sdk-for-python
azure-mgmt-web/azure/mgmt/web/models/app_service_certificate_patch_resource.py
2
2600
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
yro/veda_worker
tests/test_intake.py
1
2088
import os import sys import unittest sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from veda_worker.__init__ import VedaWorker from veda_worker.abstractions import Video, Encode from veda_worker.config import WorkerSetup """ file intake test """ class TestIntake(unittest.TestCase): ...
gpl-3.0
mith1979/ansible_automation
applied_python/applied_python/lib/python2.7/site-packages/django/core/mail/__init__.py
230
4701
""" Tools for sending email. """ from __future__ import unicode_literals from django.conf import settings from django.utils.module_loading import import_string # Imported for backwards compatibility, and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the introduction o...
apache-2.0
grahamhayes/designate
designate/objects/rrdata_cname.py
8
1350
# Copyright (c) 2014 Rackspace Hosting # 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 req...
apache-2.0
sugartom/tensorflow-alien
tensorflow/python/training/training_util.py
68
5138
# 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
mythmon/airmozilla
airmozilla/manage/tests/views/test_urltransforms.py
12
4790
import json from nose.tools import eq_, ok_ from django.test.utils import override_settings from funfactory.urlresolvers import reverse from airmozilla.main.models import ( URLTransform, URLMatch ) from .base import ManageTestCase class TestURLTransforms(ManageTestCase): @override_settings(URL_TRANS...
bsd-3-clause
4rado/RepositoryForProject
Lib/site-packages/numpy/testing/tests/test_decorators.py
86
3215
import numpy as np from numpy.testing import * from numpy.testing.noseclasses import KnownFailureTest import nose def test_slow(): @dec.slow def slow_func(x,y,z): pass assert(slow_func.slow) def test_setastest(): @dec.setastest() def f_default(a): pass @dec.setastest(True) ...
gpl-3.0
RMKD/networkx
networkx/utils/tests/test_rcm.py
32
1305
from nose.tools import * from networkx.utils import reverse_cuthill_mckee_ordering import networkx as nx def test_reverse_cuthill_mckee(): # example graph from # http://www.boost.org/doc/libs/1_37_0/libs/graph/example/cuthill_mckee_ordering.cpp G = nx.Graph([(0, 3), (0, 5), (1, 2), (1, 4), (1, 6), (1, 9),...
bsd-3-clause
Chilledheart/chromium
tools/telemetry/third_party/gsutilz/third_party/boto/boto/configservice/exceptions.py
135
2528
# Copyright (c) 2015 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 ...
bsd-3-clause
Johnzero/OE7
openerp/addons-modules/point_of_sale/report/pos_payment_report.py
61
3430
# -*- 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
rschnapka/odoo
addons/document_webdav/dav_fs.py
54
36371
# -*- 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
uwevil/namebench
nb_third_party/dns/__init__.py
215
1293
# Copyright (C) 2003-2007, 2009 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...
apache-2.0
alanjw/GreenOpenERP-Win-X86
python/Lib/site-packages/unidecode/x0c7.py
253
4564
data = ( 'wek', # 0x00 'wet', # 0x01 'wep', # 0x02 'weh', # 0x03 'wi', # 0x04 'wig', # 0x05 'wigg', # 0x06 'wigs', # 0x07 'win', # 0x08 'winj', # 0x09 'winh', # 0x0a 'wid', # 0x0b 'wil', # 0x0c 'wilg', # 0x0d 'wilm', # 0x0e 'wilb', # 0x0f 'wils', # 0x10 'wilt', # 0x...
agpl-3.0
russelldavies/envparse
tests/test_casts.py
1
4940
# -*- coding: utf-8 -*- import pytest from envparse import Env, env, ConfigurationError, urlparse env_vars = dict( BLANK='', STR='foo', INT='42', FLOAT='33.3', BOOL_TRUE='1', BOOL_FALSE='0', PROXIED='{{STR}}', LIST_STR='foo,bar', LIST_STR_WITH_SPACES=' foo, bar', LIST_INT='1,...
mit
Melnick/Cnake
core/functions.py
1
1074
import os import shutil from unicurses import * from appdirs import * SEPARATOR = (os.name in ['ce', 'nt', 'dos']) and '\\' or '/'; def add_vector(a, b): return (a[0] + b[0], a[1] + b[1]); def w_log( path, attr = "a+", string = '' ): dir_path = user_log_dir("cnake"); path = "{}{}{}".format(dir_path, SEPARATOR...
mit
okuta/chainer
chainer/training/extensions/warmup_shift.py
6
2172
from __future__ import division from chainer.training import extension class WarmupShift(extension.Extension): """Trainer extension to gradually initialize an optimizer attribute. This extension changes an optimizer attribute evenly at the begining of one training. For example, suppose that this e...
mit
AuyaJackie/odoo
addons/purchase/__openerp__.py
259
3787
# -*- 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
nomnombtc/bitcoin
qa/rpc-tests/zmq_test.py
37
3264
#!/usr/bin/env python3 # Copyright (c) 2015-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 ZMQ interface # from test_framework.test_framework import BitcoinTestFramework from test_framew...
mit
Eksmo/calibre
src/cherrypy/_cperror.py
82
21755
"""Exception classes for CherryPy. CherryPy provides (and uses) exceptions for declaring that the HTTP response should be a status other than the default "200 OK". You can ``raise`` them like normal Python exceptions. You can also call them and they will raise themselves; this means you can set an :class:`HTTPError<ch...
gpl-3.0
kapy2010/treeherder
tests/seta/test_job_priorities.py
1
1445
import datetime import pytest from mock import patch from treeherder.seta.job_priorities import (SetaError, seta_job_scheduling) @pytest.mark.django_db() @patch('treeherder.seta.job_priorities.SETAJobPriorities._validate_request', return_value=None) @patch('treeherder.set...
mpl-2.0
petecummings/django-cms
cms/test_utils/util/static_analysis.py
22
1693
import os from django.utils import six from pyflakes import api from pyflakes.checker import Checker from pyflakes.reporter import Reporter def _pyflakes_report_with_nopyflakes(self, messageClass, node, *args, **kwargs): with open(self.filename, 'r') as code: if code.readlines()[node.lineno - 1].strip()....
bsd-3-clause
Esri/executive-dashboard
ExecutiveReportingScript/arcrest/cmp/community.py
6
10013
from __future__ import print_function from __future__ import absolute_import import json from ..packages.six.moves.urllib_parse import quote from ..agol import FeatureService from .._abstract.abstract import BaseCMP from ..security.security import AGOLTokenSecurityHandler, CommunityMapsSecurityHandler #################...
apache-2.0
jgerigmeyer/jquery-django-superformset
demo/demo/settings.py
1
2111
""" Django settings for demo project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
bsd-3-clause
pilou-/ansible
test/units/modules/network/netvisor/test_pn_dscp_map.py
15
2332
# Copyright: (c) 2018, Pluribus Networks # 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 json from units.compat.mock import patch from ansible.modules.network.netvisor import pn...
gpl-3.0
xupingmao/xnote
handlers/fs/fs_tools.py
1
1725
# -*- coding:utf-8 -*- # @author xupingmao <578749341@qq.com> # @since 2020/12/08 01:46:35 # @modified 2021/07/04 17:09:54 # -*- coding:utf-8 -*- # @since 2018-11-22 00:46:26 import os import re import math import time import web import xconfig import xutils import xauth import xmanager import xtables import random fro...
gpl-3.0
tgstation/tgstation
tools/HitboxExpander/__main__.py
15
2418
import os import sys import inspect import shutil import PIL.Image as Image current_dir = os.path.split(inspect.getfile(inspect.currentframe()))[0] def PngSave(im, file): # From http://blog.client9.com/2007/08/28/python-pil-and-png-metadata-take-2.html # these can be automatically added to Image.info dict # th...
agpl-3.0
fxia22/pointGAN
show_ae.py
1
1680
from __future__ import print_function from show3d_balls import * import argparse import os import random import numpy as np import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torc...
mit
openstack/horizon
openstack_dashboard/context_processors.py
2
4192
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
foyzur/gpdb
gpMgmt/bin/gpgenfsmap.py
21
8809
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2011. All Rights Reserved. ''' gpgenfsmap.py Generates a mapping of Servers, Filesystems, GPDB Filespaces and Storage Pools Options: -h, -?, --help Print this usage. -p --port Port to use to connect to DB. Defaults to $PGPORT -u --usernam...
apache-2.0
kevalds51/sympy
sympy/utilities/randtest.py
54
5488
""" Helpers for randomized testing """ from __future__ import print_function, division from random import uniform import random from sympy.core.numbers import I from sympy.simplify.simplify import nsimplify from sympy.core.containers import Tuple from sympy.core.numbers import comp from sympy.core.symbol import Symb...
bsd-3-clause
drawks/ansible
lib/ansible/modules/cloud/docker/docker_swarm_service.py
11
106822
#!/usr/bin/python # # (c) 2017, Dario Zanzico (git@dariozanzico.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 = {'status': ['preview'], 'suppor...
gpl-3.0
dguerri/git-upstream-old
git_upstream/tests/base.py
1
5187
# Copyright 2010-2011 OpenStack Foundation # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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/licens...
apache-2.0
ucrawler/cp-uc
libs/caper/group.py
81
9461
# 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
JackNokia/robotframework
src/robot/writer/htmltemplate.py
28
1604
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
Jbonnett/django-guardian
example_project/settings.py
7
3246
import django import os import sys from django.conf import global_settings abspath = lambda *p: os.path.abspath(os.path.join(*p)) DEBUG = True TEMPLATE_DEBUG = DEBUG SECRET_KEY = 'CHANGE_THIS_TO_SOMETHING_UNIQUE_AND_SECURE' TEST_SOUTH = 'GUARDIAN_TEST_SOUTH' in os.environ PROJECT_ROOT = abspath(os.path.dirname(__f...
bsd-2-clause
tanmaythakur/django
tests/migrations/test_state.py
96
43522
from django.apps.registry import Apps from django.contrib.contenttypes.fields import GenericForeignKey from django.db import models from django.db.migrations.exceptions import InvalidBasesError from django.db.migrations.operations import ( AddField, AlterField, DeleteModel, RemoveField, ) from django.db.migrations....
bsd-3-clause
imammedo/virt-test
kvm/tests/seabios.py
4
2102
import re, logging from autotest.client.shared import error from virttest import utils_misc @error.context_aware def run_seabios(test, params, env): """ KVM Seabios test: 1) Start guest with sga bios 2) Display and check the boot menu order 3) Start guest from the specified boot entry 4) Log i...
gpl-2.0
adamfisk/littleshoot-client
server/appengine/boto/ec2/cloudwatch/datapoint.py
11
1533
# Copyright (c) 2006-2009 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
kevinwilde/WildeBot
src/mybot/Lib/site-packages/click/exceptions.py
199
6788
from ._compat import PY2, filename_to_ui, get_text_stderr from .utils import echo class ClickException(Exception): """An exception that Click can handle and show to the user.""" #: The exit code for this exception exit_code = 1 def __init__(self, message): if PY2: if message is n...
mit
pigeonflight/strider-plone
docker/appengine/lib/jinja2-2.6/jinja2/meta.py
406
4144
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
mit
TheTimmy/spack
var/spack/repos/builtin/packages/xfd/package.py
3
1881
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
yajiedesign/mxnet
python/mxnet/gluon/probability/distributions/studentT.py
5
4166
# 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
OTL/genrb
scripts/genmsg_rb.py
1
2011
#! /usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, Takashi Ogura # # based on # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditi...
bsd-3-clause
google-research/google-research
rl_repr/tests/train_eval_offline_test.py
1
1293
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
feer56/Kitsune2
kitsune/users/models.py
11
23658
import hashlib import logging import random import re import time from datetime import datetime, timedelta from django.conf import settings from django.contrib.auth.models import User, Group from django.contrib.sites.models import Site from django.db import models from celery.task import task from statsd import stats...
bsd-3-clause
mentionllc/django-invitation
invitation/urls.py
1
1346
from django.conf import settings from django.conf.urls import * from django.views.generic import TemplateView if getattr(settings, 'INVITATION_USE_ALLAUTH', False): from allauth.account.forms import BaseSignupForm as RegistrationFormTermsOfService reg_backend = 'allauth.account.auth_backends.AuthenticationBac...
bsd-3-clause
rimbalinux/LMD3
django/contrib/auth/context_processors.py
12
1485
from django.core.context_processors import PermWrapper from django.utils.functional import lazy, memoize, SimpleLazyObject from django.contrib import messages def auth(request): """ Returns context variables required by apps that use Django's authentication system. If there is no 'user' attri...
bsd-3-clause
louietsai/python-for-android
python-modules/twisted/twisted/web/test/test_distrib.py
52
12485
# Copyright (c) 2008-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.distrib}. """ from os.path import abspath from xml.dom.minidom import parseString try: import pwd except ImportError: pwd = None from zope.interface.verify import verifyObject from twisted.python im...
apache-2.0
eugeneai/DME
src/icc/dme/fd/Exploration2.py
1
1877
from Numeric import * from mutils import * from biomass import * from free import * from spelper import * from logging import * def open1(name, mode): f=open(name, mode) f.write("from mutils import *\nfrom Numeric import *\n") return f next_data={ "low":(0,"middle"), "middle":(0,"high"), "high":(1,"low"), } de...
gpl-3.0
mapnik/OGCServer
tests/testGetMap.py
2
4933
import nose import os from ogcserver.configparser import SafeConfigParser from ogcserver.WMS import BaseWMSFactory from ogcserver.wms111 import ServiceHandler as ServiceHandler111 from ogcserver.wms130 import ServiceHandler as ServiceHandler130 from ogcserver.common import ColorFactory def _wms_services(mapfil...
bsd-3-clause
clumsy1991/M8_GPE_Kernel
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
Kiiv/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/nhl.py
21
5871
from __future__ import unicode_literals import re import json import os from .common import InfoExtractor from ..compat import ( compat_urlparse, compat_urllib_parse, compat_urllib_parse_urlparse ) from ..utils import ( unified_strdate, ) class NHLBaseInfoExtractor(InfoExtractor): @staticmethod ...
gpl-3.0
iychoi/syndicate
python/syndicate/ag/datasets/ftp.py
4
2044
#/usr/bin/python """ Copyright 2014 The Trustees of Princeton University 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 re...
apache-2.0