repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ghchinoy/tensorflow
tensorflow/contrib/distributions/python/ops/relaxed_bernoulli.py
35
9112
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
denisff/python-for-android
python3-alpha/python3-src/Lib/lib2to3/tests/support.py
146
1713
"""Support code for test_*.py files""" # Author: Collin Winter # Python imports import unittest import sys import os import os.path import re from textwrap import dedent # Local imports from lib2to3 import pytree, refactor from lib2to3.pgen2 import driver test_dir = os.path.dirname(__file__) proj_dir = os.path.normp...
apache-2.0
timm/timmnix
pypy3-v5.5.0-linux64/lib-python/3/test/test_devpoll.py
3
3573
# Test case for the select.devpoll() function # Initial tests are copied as is from "test_poll.py" import os, select, random, unittest, sys from test.support import TESTFN, run_unittest, cpython_only try: select.devpoll except AttributeError: raise unittest.SkipTest("select.devpoll not defined -- skipping te...
mit
cloudcomputinghust/IoT
platform_manager/api/views.py
1
16318
from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from rest_framework.views import APIView from . import models # from .utils import restrict_search from django.http import HttpResponse import json import http.client import os.path from wsgiref.util import FileWrapper from .models...
mit
lucashmorais/x-Bench
mozmill-env/python/Lib/doctest.py
44
105210
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! r"""Module doctest -- a framework for running examples in docstrings. In...
mit
silentfuzzle/calibre
src/calibre/gui2/book_details.py
11
27090
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import cPickle from binascii import unhexlify from functools import partial from PyQt5.Qt import (QPixmap, QSize, QWidget...
gpl-3.0
KohlsTechnology/ansible
lib/ansible/modules/network/slxos/slxos_facts.py
15
13814
#!/usr/bin/python # # (c) 2018 Extreme Networks 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 late...
gpl-3.0
pedrobaeza/odoo
addons/l10n_fr/l10n_fr.py
39
2117
# -*- 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
Tinche/ubuntu-make
tests/__init__.py
14
1532
# -*- coding: utf-8 -*- # Copyright (C) 2014 Canonical # # Authors: # Didier Roche # # 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; version 3. # # This program is distributed in the hope that ...
gpl-3.0
ryansb/boto
boto/ec2/placementgroup.py
150
2002
# Copyright (c) 2010 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, modify, m...
mit
coderbone/SickRage
lib/unidecode/x017.py
252
4190
data = ( '[?]', # 0x00 '[?]', # 0x01 '[?]', # 0x02 '[?]', # 0x03 '[?]', # 0x04 '[?]', # 0x05 '[?]', # 0x06 '[?]', # 0x07 '[?]', # 0x08 '[?]', # 0x09 '[?]', # 0x0a '[?]', # 0x0b '[?]', # 0x0c '[?]', # 0x0d '[?]', # 0x0e '[?]', # 0x0f '[?]', # 0x10 '[?]', # 0x11 '[?]'...
gpl-3.0
lnielsen/invenio
invenio/base/scripts/demosite.py
1
4961
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013, 2014 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 opt...
gpl-2.0
Revanth47/addons-server
src/olympia/amo/tests/test_middleware.py
4
3972
# -*- coding: utf-8 -*- from django import test from django.test.client import RequestFactory import pytest from commonware.middleware import ScrubRequestOnException from mock import patch from pyquery import PyQuery as pq from olympia.amo.tests import TestCase from olympia.amo.middleware import AuthenticationMiddle...
bsd-3-clause
photoninger/ansible
lib/ansible/modules/files/iso_extract.py
101
6645
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be> # Copyright: (c) 2016, Matt Robinson <git@nerdoftheherd.com> # Copyright: (c) 2017, Dag Wieers <dag@wieers.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.g...
gpl-3.0
jandrest2018/TWJ-2017-A
04 Angular/C-Web/node_modules/node-gyp/gyp/tools/pretty_gyp.py
2618
4756
#!/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. """Pretty-prints the contents of a GYP file.""" import sys import re # Regex to remove comments when we're counting braces. COMMENT_RE = ...
mit
firemark/pixelopolis
docsrc/conf.py
1
3489
# Pixelopolis documentation build configuration file, created by # sphinx-quickstart on Sun May 24 16:38:18 2020. import os import sys sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ needs_sphinx = '1.0' extensions = [ 'sphinx.ext.githubpages'...
mit
cloudbase/neutron
neutron/conf/wsgi.py
9
1262
# Copyright 2011 OpenStack Foundation. # 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
aldian/tensorflow
tensorflow/contrib/keras/api/keras/preprocessing/__init__.py
132
1094
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
percyfal/snakemakelib
snakemakelib/report/picard.py
1
25057
# Copyright (c) 2014 Per Unneberg import os import sys import re import csv import texttable as tt import collections from snakemakelib.report.utils import Template import matplotlib matplotlib.use('Agg') from pylab import * import matplotlib.pyplot as plt import numpy as np # http://stackoverflow.com/questions/217090...
mit
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/nltk/corpus/reader/api.py
17
17161
# Natural Language Toolkit: API for Corpus Readers # # Copyright (C) 2001-2012 NLTK Project # Author: Steven Bird <sb@ldc.upenn.edu> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ API for corpus readers. """ import os import re from...
agpl-3.0
willprice/weboob
modules/creditmutuel/module.py
7
3016
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Julien Veyssier # Copyright(C) 2012-2013 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, eithe...
agpl-3.0
endorphinl/horizon
horizon/test/helpers.py
17
13705
# 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
DiUS/build-lights
light-controller/lib/daemonize.py
2
8525
# From: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """Disk And Execution MONitor (Daemon) Configurable daemon behaviors: 1.) The current working directory set to the "/" directory. 2.) The current file creation mode mask set to 0. 3.) Close all open files (1024). 4.) Redirect standar...
gpl-3.0
timfel/squeakvm
processors/ARM/gdb-8.3.1/gdb/copyright.py
7
11517
#! /usr/bin/env python # Copyright (C) 2011-2019 Free Software Foundation, Inc. # # This file is part of GDB. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, ...
mit
bdestombe/flopy-1
flopy/utils/modpathfile.py
2
20645
""" Module to read MODPATH output files. The module contains two important classes that can be accessed by the user. * EndpointFile (ascii endpoint file) * PathlineFile (ascii pathline file) """ import numpy as np from ..utils.flopy_io import loadtxt class PathlineFile(): """ PathlineFile Class. Par...
bsd-3-clause
initOS/server-tools
base_import_match/models/base_import.py
9
10254
# -*- coding: utf-8 -*- # © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models from openerp import SUPERUSER_ID # TODO remove in v10 class BaseImportMatch(models.Model): _name = "base_import.m...
agpl-3.0
LipuFei/team-hipchat-bot
bot/hipchat_db.py
1
3336
import json import logging import time import leveldb from twisted.internet import reactor from twisted.web.client import getPage class HipchatUserDb(object): def __init__(self, bot, server, token, db_path): self._logger = logging.getLogger(self.__class__.__name__) self.bot = bot self.s...
mit
OptiPop/external_skia
tools/misc_utils.py
68
7711
# Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module to host the VerboseSubprocess, ChangeDir, and ReSearch classes. """ import os import re import subprocess def print_subprocess_args(prefix, *args, **kwargs): """Print o...
bsd-3-clause
mrunge/openstack_horizon
setup.py
608
1045
#!/usr/bin/env python # 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/licenses/LICENSE-2.0 # # Unle...
apache-2.0
maxiee/MyCodes
KalmanAndBesianFiltersInPython/MyKalman/sensor.py
1
1504
import matplotlib.pyplot as plt import matplotlib.pylab as pylab import numpy.random as random import math class OneDSensor(object): def __init__(self, x0=0, # 初始位置 velocity=1, measurement_variance=0.0, process_variance=0.0): self.x = x0 self.veloci...
gpl-3.0
agry/NGECore2
scripts/mobiles/rori/squall_female.py
2
1568
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobil...
lgpl-3.0
Versent/ansible
v1/ansible/utils/display_functions.py
147
2184
# (c) 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) any lat...
gpl-3.0
grepme/CMPUT410Lab01
virt_env/virt1/lib/python2.7/site-packages/FormEncode-1.3.0a1-py2.7.egg/formencode/tests/test_subclassing.py
3
9115
# -*- coding: utf-8 -*- import unittest from formencode.api import is_validator, FancyValidator, Invalid from formencode.compound import CompoundValidator, All from formencode.validators import Int class CustomValidator(FancyValidator): """A custom validator based directly on FancyValidator.""" messages = ...
apache-2.0
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/numpy/lib/tests/test_format.py
33
30021
from __future__ import division, absolute_import, print_function r''' Test the .npy file format. Set up: >>> import sys >>> from io import BytesIO >>> from numpy.lib import format >>> >>> scalars = [ ... np.uint8, ... np.int8, ... np.uint16, ... np.int16, ... ...
mit
ivanod/nemesys-qos
nemesys/arp.py
9
13681
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2013 Fondazione Ugo Bordoni. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
gpl-3.0
uncled1023/pygments
Pygments/pygments-lib/pygments/lexers/graph.py
25
2370
# -*- coding: utf-8 -*- """ pygments.lexers.graph ~~~~~~~~~~~~~~~~~~~~~ Lexers for graph query languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, this...
bsd-2-clause
jhurt/ReportLab
tests/test_graphics_images.py
6
2101
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details """ Tests for RLG Image shapes. """ from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name__) import os import unittest from reportlab.graphics.shapes import Image, Drawing from reportl...
bsd-3-clause
chengjf/database-interface-doc-management
flask-demo/flask/Lib/site-packages/sqlalchemy/inspection.py
81
3093
# sqlalchemy/inspect.py # Copyright (C) 2005-2015 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 """The inspection module provides the :func:`.inspect` function, which deliver...
apache-2.0
horance-liu/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/hybrid_layer.py
144
1595
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
meta-it/misc-addons
web_sessions_management/http.py
1
2172
# -*- encoding: utf-8 -*- # # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This program is free software: you can redistribute it and/or modify # it unde...
lgpl-3.0
lihui7115/ChromiumGStreamerBackend
native_client_sdk/src/build_tools/generate_make.py
61
8678
# Copyright (c) 2012 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 json import os import sys import buildbot_common import build_version import getos from buildbot_common import ErrorExit from easy_template impor...
bsd-3-clause
ThirdProject/android_external_chromium_org
tools/perf/benchmarks/endure.py
23
1390
# 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. from telemetry import test from measurements import endure class _EndureBenchmark(test.Test): test = endure.Endure # Default options for endure benchm...
bsd-3-clause
s3h10r/avaon
django-avaon/acore/views/visualize.py
1
6406
""" statistics - heatmaps of impacts """ from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template import loader,Context,RequestContext from django.conf import settings import logging logger = logging.getLogger(__name__) # --...
gpl-2.0
BT-jmichaud/reporting-engine
report_custom_filename/model/ir_actions_report_xml.py
3
1670
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 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
danielvdao/TheAnimalFarm
venv/lib/python2.7/site-packages/pip/_vendor/requests/api.py
637
4333
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
gpl-2.0
stevehof/location-ninja
lib/examples/auth/auth.py
2
6376
import os from flask import Flask, url_for, redirect, render_template, request from flask.ext.sqlalchemy import SQLAlchemy from wtforms import form, fields, validators from flask.ext import admin, login from flask.ext.admin.contrib import sqla from flask.ext.admin import helpers, expose # Create Flask application app...
gpl-3.0
Kongsea/tensorflow
tensorflow/python/summary/text_summary.py
19
2872
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
DinoCow/airflow
airflow/contrib/hooks/sagemaker_hook.py
7
1288
# # 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...
apache-2.0
batxes/4c2vhic
Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models19402.py
2
18203
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
puttarajubr/commcare-hq
custom/_legacy/mvp_docs/models.py
2
2585
import dateutil from couchdbkit import ResourceNotFound from couchdbkit.ext.django.loading import get_db from casexml.apps.case.models import CommCareCase from couchforms.models import XFormInstance class IndicatorDocument(object): def is_update(self, doc_dict): """Checks to see whether doc_dict shows an...
bsd-3-clause
idatux/idatuxft
engine/xml/xslt/TextElement.py
9
2357
######################################################################## # # File Name: TextElement.py # # """ Implementation of the XSLT Spec text stylesheet element. WWW: http://4suite.com/4XSLT e-mail: support@4suite.com Copyright (c) 1999-2000 Fourthought Inc, USA. All Rights Reserved. See htt...
gpl-3.0
duqiao/django
django/contrib/gis/geos/prototypes/coordseq.py
485
3049
from ctypes import POINTER, c_double, c_int, c_uint from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( GEOSException, last_arg_byref, ) # ## Error-checking routines specific to coordinate sequences. ## def check_cs_op(result, fu...
bsd-3-clause
michaelpacer/dynd-python
dynd/tests/test_array_construct.py
2
45514
import sys import unittest from datetime import date from dynd import nd, ndt class TestScalarConstructor(unittest.TestCase): def test_access_array(self): a = nd.array(1) self.assertEqual(a.access_flags, 'readwrite') a = nd.array(1, access='rw') self.assertEqual(a.access_flags, 'rea...
bsd-2-clause
joequery/django
tests/auth_tests/test_forms.py
228
26909
from __future__ import unicode_literals import datetime import re from django import forms from django.contrib.auth.forms import ( AdminPasswordChangeForm, AuthenticationForm, PasswordChangeForm, PasswordResetForm, ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget, SetPasswordForm, UserChangeForm, Use...
bsd-3-clause
venmo/ansible
lib/ansible/plugins/action/assemble.py
39
6003
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com> # Stephen Fromm <sfromm@gmail.com> # Brian Coca <briancoca+dev@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 publish...
gpl-3.0
Haibo-Wang-ORG/pytest
testing/python/fixture.py
16
87137
import pytest, py, sys from _pytest import python as funcargs from _pytest.python import FixtureLookupError from _pytest.pytester import get_public_names from textwrap import dedent def test_getfuncargnames(): def f(): pass assert not funcargs.getfuncargnames(f) def g(arg): pass assert funcargs.getfunc...
mit
andrewgailey/robogen
robogen/rgkit/backup bots/kamikaze112213.py
1
6184
# kamikaze112213 by hephaestus # http://robotgame.org/viewrobot/5830 import rg import operator class Robot: def act(self, game): adjacent_robots = self.get_adjacent_robots(game) adjacent_friendlies = self.get_adjacent_robots(game, operator.__eq__) adjacent_enemies = self.get_adjacent_robo...
unlicense
tjcsl/cslbot
cslbot/commands/issue.py
1
4125
# -*- coding: utf-8 -*- # Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson # # 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 Softw...
gpl-2.0
wmvanvliet/mne-python
mne/io/tests/test_compensator.py
8
4250
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import os.path as op import numpy as np from numpy.testing import assert_allclose import pytest from mne import Epochs, read_evokeds, pick_types from mne.io.compensator import make_compensator, get_current_comp from mne.io import r...
bsd-3-clause
weolar/miniblink49
third_party/skia/tools/skp/page_sets/skia_gamedeksiam_nexus10.py
32
1251
# 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. # pylint: disable=W0401,W0614 from telemetry import story from telemetry.page import page as page_module from telemetry.page import shared_page_state clas...
apache-2.0
srimai/odoo
addons/portal_gamification/__openerp__.py
381
1571
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
black-knight/EtikTak
etiktak/model/stores/admin.py
1
1966
# Copyright (c) 2012, Daniel Andersen (dani_ande@yahoo.dk) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # l...
bsd-3-clause
lagooned/emacs
elpa/treemacs-20200901.1550/treemacs-single-file-git-status.py
3
2696
from subprocess import Popen, PIPE, DEVNULL import sys # There are 3+ command line arguments: # 1) the file to update # 2) the file's previous state, to check if things changed at all # 3) the file's parents that need to be updated as well FILE = sys.argv[1] OLD_STATE = sys.argv[2] PARENTS = [p for p in sys.argv[3:]]...
apache-2.0
ohsu-computational-biology/euler
services/api/manifest.py
1
1651
#!/usr/bin/env python """ Formulate manifest for exacloud """ from flask import send_file, abort from json import dumps import urllib import requests import StringIO from flask import current_app as app def create(params, PROXY_TARGET, _check_projects): """ create an exacloud manifest """ # if 'filters' not ...
mit
agconti/Shopify-Django
venv/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/feeds.py
308
1841
from __future__ import absolute_import from django.contrib.gis import feeds from .models import City class TestGeoRSS1(feeds.Feed): link = '/city/' title = 'Test GeoDjango Cities' def items(self): return City.objects.all() def item_link(self, item): return '/city/%s/' % item.pk ...
mit
sloanyang/depends
third_party/logilab/astng/scoped_nodes.py
14
34565
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # copyright 2003-2010 Sylvain Thenault, all rights reserved. # contact mailto:thenault@gmail.com # # This file is part of logilab-astng. # # logilab-astng is free software: you can redi...
gpl-2.0
DIRACGrid/DIRAC
src/DIRAC/DataManagementSystem/scripts/dirac_admin_user_quota.py
2
1472
#!/usr/bin/env python """ Show storage quotas for specified users or for all registered users if nobody is specified Usage: dirac-admin-user-quota [user1 ...] Example: $ dirac-admin-user-quota ------------------------------ Username | Quota (GB) ------------------------------ atsareg | ...
gpl-3.0
LazoCoder/Pokemon-Terminal
tests/test_database.py
1
4401
#!/usr/bin/env python3 # To run the tests, use: python3 -m pytest --capture=sys from pokemonterminal.database import Database from tests.test_utils import region_dict, get_region, make_extra_counts, MAX_ID def test_first_database(): print('{} items in first database.'.format(len(Database()))) def test_second_...
gpl-3.0
caphrim007/ansible-modules-extras
cloud/rackspace/rax_mon_notification_plan.py
153
6060
#!/usr/bin/python # 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 distributed...
gpl-3.0
karllessard/tensorflow
tensorflow/python/keras/utils/metrics_utils.py
5
21073
# 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
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/scipy/io/matlab/tests/test_streams.py
9
5460
""" Testing """ from __future__ import division, print_function, absolute_import import os import sys import zlib from io import BytesIO if sys.version_info[0] >= 3: cStringIO = BytesIO else: from cStringIO import StringIO as cStringIO from tempfile import mkstemp from contextlib import contextmanager im...
mit
sstone/bitcoin
test/functional/feature_nulldummy.py
10
7178
#!/usr/bin/env python3 # Copyright (c) 2016-2020 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 NULLDUMMY softfork. Connect to a single node. Generate 2 blocks (save the coinbases for later). G...
mit
blindsighttf2/Astron
test/common/unittests.py
4
6582
import unittest, subprocess, tempfile, os, threading from socket import socket, AF_INET, SOCK_STREAM from astron import * class ConfigTest(unittest.TestCase): class ConfigRunner(object): DAEMON_PATH = './astrond' def __init__(self, config): self.config = config self.process...
bsd-3-clause
cisco-open-source/selenium
py/test/selenium/webdriver/common/opacity_tests.py
15
2086
#!/usr/bin/python # Copyright 2008-2012 WebDriver committers # Copyright 2008-2012 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...
apache-2.0
Esri/geoprocessing-tools-for-hadoop
requests/packages/charade/euckrprober.py
2931
1675
######################## 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...
apache-2.0
mariaantoanelam/Licenta
Lib/test/test_compile.py
6
3114
from test_support import verbose, TestFailed if verbose: print "Testing whether compiler catches assignment to __debug__" try: compile('__debug__ = 1', '?', 'single') except SyntaxError: pass import __builtin__ prev = __builtin__.__debug__ setattr(__builtin__, '__debug__', 'sure') setattr(__builtin__, '_...
mit
wang1352083/pythontool
python-2.7.12-lib/distutils/tests/test_install_headers.py
141
1269
"""Tests for distutils.command.install_headers.""" import sys import os import unittest import getpass from distutils.command.install_headers import install_headers from distutils.tests import support from test.test_support import run_unittest class InstallHeadersTestCase(support.TempdirManager, ...
mit
chippey/gaffer
python/GafferUI/Viewer.py
1
10321
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
bsd-3-clause
James-Firth/steam-download-notifier
steamapi/app.py
1
5327
__author__ = 'SmileyBarry' from .core import APIConnection, SteamObject, store from .decorators import cached_property, INFINITE class SteamApp(SteamObject): def __init__(self, appid, name=None, owner=None): self._id = appid if name is not None: import time self._cache = d...
mit
mtreinish/os-testr
os_testr/subunit2html.py
23
21784
#!/usr/bin/python """ Utility to convert a subunit stream to an html results file. Code is adapted from the pyunit Html test runner at http://tungwaiyip.info/software/HTMLTestRunner.html Takes two arguments. First argument is path to subunit log file, second argument is path of desired output file. Second argument is ...
apache-2.0
kevclarx/ansible
lib/ansible/modules/windows/win_dotnet_ngen.py
78
1924
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Peter Mounce <public@neverrunwithscissors.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...
gpl-3.0
knifeyspoony/pyswf
swf/geom.py
2
14457
import math SNAP = 0.001 class Vector2(object): def __init__(self, x=0.0, y=0.0): self.x = x self.y = y class Vector3(object): def __init__(self, x=0, y=0, z=0): self.x = x self.y = y self.z = z def clone(self): return Vector3(self.x, self.y, s...
mit
YOTOV-LIMITED/mysql-server
storage/ndb/mcc/config_parser.py
32
4606
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in the hope t...
gpl-2.0
ARM-software/lisa
external/devlib/devlib/connection.py
3
15639
# Copyright 2019 ARM Limited # # 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
Vimos/scikit-learn
benchmarks/bench_covertype.py
57
7378
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
bsd-3-clause
gennad/Django-nonrel-stub-for-Google-App-Engine
django/contrib/comments/views/comments.py
306
5359
from django import http from django.conf import settings from utils import next_redirect, confirmation_view from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.shortcuts import render_to_response from django.template import RequestContext from django.template....
bsd-3-clause
potatolondon/django-nonrel-1-4
django/contrib/formtools/tests/wizard/forms.py
90
7471
from django import forms, http from django.conf import settings from django.test import TestCase from django.template.response import TemplateResponse from django.utils.importlib import import_module from django.contrib.auth.models import User from django.contrib.formtools.wizard.views import (WizardView, ...
bsd-3-clause
jymannob/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/screencast.py
12
4228
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, compat_parse_qs, compat_urllib_request, ) class ScreencastIE(InfoExtractor): _VALID_URL = r'https?://www\.screencast\.com/t/(?P<id>[a-zA-Z0-9]+)' _TES...
gpl-3.0
abzaloid/maps
django-project/bin/activate_this.py
1076
1137
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
mit
shinken-debian-modules/shinken-mod-perfdata-host
module/module.py
2
4305
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
agpl-3.0
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py
1009
2281
import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_boundary. """ return uuid4().hex...
gpl-2.0
vtorshyn/voltdb-shardit-src
voltdb-3.7/lib/python/XMLUtils.py
2
1080
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2013 VoltDB Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your...
apache-2.0
paweljasinski/ironpython3
Src/StdLib/Lib/unittest/test/test_setups.py
81
16426
import io import sys import unittest def resultFactory(*_): return unittest.TestResult() class TestSetups(unittest.TestCase): def getRunner(self): return unittest.TextTestRunner(resultclass=resultFactory, stream=io.StringIO()) def runTests(self, *cases...
apache-2.0
Judystudy/gooderp_addons
auto_backup/models/backup_scheduler.py
6
7744
# -*- coding: utf-8 -*- ############################################################################## # # odoo, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # Copyright (C) 2012-2015 Mrshelly@gmail.com upgrade to 7.0 # Copyright (C) 2014 ...
agpl-3.0
Lasagne/Recipes
modelzoo/resnet50.py
1
6996
# ResNet-50, network from the paper: # "Deep Residual Learning for Image Recognition" # http://arxiv.org/pdf/1512.03385v1.pdf # License: see https://github.com/KaimingHe/deep-residual-networks/blob/master/LICENSE # Download pretrained weights from: # https://s3.amazonaws.com/lasagne/recipes/pretrained/imagenet/resnet5...
mit
centwave/jg82ksgvqkuan
django/conf/locale/id/formats.py
355
1818
# -*- 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 N Y' DATETIME_FORMAT = "j N Y, G.i.s" TIME_FORMAT = 'G.i.s' YEAR_MONTH_...
bsd-3-clause
astaff/ansible
lib/ansible/module_utils/urls.py
125
31558
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
nmrao/robotframework
src/robot/utils/compress.py
25
1512
# 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
felipenaselva/felipe.repository
plugin.video.neptune/resources/lib/modules/playcount.py
5
8985
# -*- coding: utf-8 -*- ''' Neptune Rising Add-on Copyright (C) 2016 Poseidon This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your opt...
gpl-2.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_pow.py
133
4623
import test.test_support, unittest class PowTest(unittest.TestCase): def powtest(self, type): if type != float: for i in range(-1000, 1000): self.assertEqual(pow(type(i), 0), 1) self.assertEqual(pow(type(i), 1), type(i)) self.assertEqual(pow(type...
mit