repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
kawamon/hue
refs/heads/master
desktop/core/ext-py/django-extensions-1.8.0/django_extensions/utils/deprecation.py
8
# -*- coding: utf-8 -*- from __future__ import absolute_import from django.utils.deprecation import RemovedInNextVersionWarning class MarkedForDeprecationWarning(RemovedInNextVersionWarning): pass
KirarinSnow/Google-Code-Jam
refs/heads/master
Qualification Round 2009/A.py
1
#!/usr/bin/env python # # Problem: Alien Language # Language: Python # Author: KirarinSnow # Usage: python thisfile.py <input.in >output.out import re lth, wds, case = map(int, raw_input().split()) words = [raw_input() for i in range(wds)] for i in range(case): test = raw_input().replace(')', ']').replace('(',...
jasonlcrane/sked
refs/heads/master
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/ninja_syntax.py
2485
# This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that alr...
softlayer/softlayer-cinder-driver
refs/heads/master
slos/test/fixtures/Account.py
1
getIscsiNetworkStorage = [{'id': 2, 'capacityGb': 1, 'username': 'foo', 'password': 'bar', 'billingItem': {'id': 2}, 'serviceResourceBackendIpAddress': '10.0.0.2'}]
farodin91/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/_pytest/doctest.py
174
""" discover and run doctests in modules and test files.""" from __future__ import absolute_import import traceback import pytest from _pytest._code.code import TerminalRepr, ReprFileLocation, ExceptionInfo from _pytest.python import FixtureRequest def pytest_addoption(parser): parser.addini('doctest_optionfla...
DeCarabas/millie
refs/heads/master
test.py
1
#!/usr/local/bin/python3 import locale from collections import namedtuple from pathlib import Path from subprocess import run, PIPE from time import perf_counter def read_test_spec(path): spec = {} with open(path) as file: for line in file: if (not line) or line[0] != '#': ...
mathdd/numpy
refs/heads/master
numpy/f2py/f2py2e.py
174
#!/usr/bin/env python """ f2py2e - Fortran to Python C/API generator. 2nd Edition. See __usage__ below. Copyright 1999--2011 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRAN...
be-cloud-be/horizon-addons
refs/heads/9.0
server-tools/setup/base_name_search_improved/setup.py
7073
import setuptools setuptools.setup( setup_requires=['setuptools-odoo'], odoo_addon=True, )
hansenDise/scrapy
refs/heads/master
scrapy/commands/shell.py
107
""" Scrapy Shell See documentation in docs/topics/shell.rst """ from threading import Thread from scrapy.commands import ScrapyCommand from scrapy.shell import Shell from scrapy.http import Request from scrapy.utils.spider import spidercls_for_request, DefaultSpider class Command(ScrapyCommand): requires_proj...
raiden-network/raiden
refs/heads/develop
raiden/tests/utils/client.py
1
from raiden.constants import TRANSACTION_INTRINSIC_GAS from raiden.network.rpc.client import EthTransfer, JSONRPCClient from raiden.tests.utils.factories import HOP1 from raiden.utils.typing import Address def burn_eth(rpc_client: JSONRPCClient, amount_to_leave: int = 0) -> None: """Burns all the ETH on the accou...
rlmh/OpenShadingLanguage
refs/heads/master
testsuite/testshade-expr/run.py
12
#!/usr/bin/env python command += testshade ("-v -g 64 64 -od uint8 -o result out.tif -expr 'result=color(u,v,0)'") outputs = [ "out.txt", "out.tif" ]
Weuxel/cjdns
refs/heads/master
node_build/dependencies/libuv/build/gyp/test/win/gyptest-link-mapfile.py
254
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure mapfile settings are extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.TestGyp...
dmoliveira/networkx
refs/heads/master
networkx/algorithms/tests/test_dag.py
18
#!/usr/bin/env python from itertools import combinations from nose.tools import * from networkx.testing.utils import assert_edges_equal import networkx as nx class TestDAG: def setUp(self): pass def test_topological_sort1(self): DG = nx.DiGraph() DG.add_edges_from([(1, 2), (1, 3), (2...
phdowling/scikit-learn
refs/heads/master
sklearn/decomposition/incremental_pca.py
199
"""Incremental Principal Components Analysis.""" # Author: Kyle Kastner <kastnerkyle@gmail.com> # License: BSD 3 clause import numpy as np from scipy import linalg from .base import _BasePCA from ..utils import check_array, gen_batches from ..utils.extmath import svd_flip, _batch_mean_variance_update class Increme...
ericMayer/tekton-master
refs/heads/master
backend/venv/lib/python2.7/site-packages/pip/status_codes.py
408
SUCCESS = 0 ERROR = 1 UNKNOWN_ERROR = 2 VIRTUALENV_NOT_FOUND = 3 PREVIOUS_BUILD_DIR_ERROR = 4 NO_MATCHES_FOUND = 23
tsteward/the-blue-alliance
refs/heads/master
datafeeds/datafeed_fms.py
12
import logging from datafeeds.datafeed_base import DatafeedBase from datafeeds.fms_event_list_parser import FmsEventListParser from datafeeds.fms_team_list_parser import FmsTeamListParser from models.event import Event from models.team import Team class DatafeedFms(DatafeedBase): FMS_EVENT_LIST_URL = "https://...
pygeek/django
refs/heads/master
django/contrib/admin/views/decorators.py
230
from functools import wraps from django.utils.translation import ugettext as _ from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth.views import login from django.contrib.auth import REDIRECT_FIELD_NAME def staff_member_required(view_func): """ Decorator for views that check...
switchboardOp/ansible
refs/heads/devel
test/units/modules/network/eos/__init__.py
12133432
i5o/openshot-sugar
refs/heads/master
openshot/windows/fontselector.py
3
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/). # # OpenShot Video Editor 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...
logicchains/ParticleBench
refs/heads/master
Py.py
1
from OpenGL.GL import * from OpenGL.arrays import vbo from OpenGL.GLUT import * from OpenGL.GLU import * #import pygame #from pygame.locals import * TITLE = "ParticleBench" WIDTH = 800 HEIGHT = 600 MIN_X = -80 MAX_X = 80 MIN_Y = -90 MAX_Y = 50 MIN_DEPTH = 50 MAX_DEPTH = 250 START_RANGE = 15 START_X = (MIN_X + (MIN_...
MatrixGamesHub/mtxPython
refs/heads/master
src/mtxNet/rendererService/constants.py
112
# # Autogenerated by Thrift Compiler (0.10.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException import sys from .ttypes imp...
D4wN/brickv
refs/heads/master
src/brickv/bindings/bricklet_co2.py
1
# -*- coding: utf-8 -*- ############################################################# # This file was automatically generated on 2015-11-17. # # # # Bindings Version 2.1.6 # # ...
mkmelin/bedrock
refs/heads/master
tests/pages/contribute/events.py
11
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from selenium.webdriver.common.by import By from pages.contribute.base import ContributeBasePage class ContributeEven...
louistin/fullstack
refs/heads/master
Python/others/return.py
1
#!/usr/bin/python def func(): return 0, 1, 2, 3 value = func() print(value[0]) print(value[3])
tectronics/kochief
refs/heads/master
kochief/cataloging/__init__.py
12133432
orione7/plugin.video.streamondemand-pureita
refs/heads/master
servers/vodlocker.py
12133432
fengbaicanhe/intellij-community
refs/heads/master
python/testData/resolve/multiFile/fromQualifiedPackageImportFile/mypackage/child/testfile.py
12133432
sebastien-forestier/NIPS2017
refs/heads/master
ros/nips2017/src/nips2017/ergo/ergo.py
1
import rospy import rosnode import json from sensor_msgs.msg import Joy from nips2017.srv import * from nips2017.msg import * from poppy_msgs.srv import ReachTarget, ReachTargetRequest, SetCompliant, SetCompliantRequest from sensor_msgs.msg import Joy, JointState from std_msgs.msg import Bool from rospkg import RosPack...
n0n0x/fabtools-python
refs/heads/master
fabtools/shorewall.py
14
""" Shorewall firewall ================== """ from socket import gethostbyname import re from fabric.api import hide, settings from fabtools.utils import run_as_root def status(): """ Get the firewall status. """ with settings(hide('running', 'stdout', 'warnings'), warn_only=True): res = ru...
etherkit/OpenBeacon2
refs/heads/master
client/macos/venv/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py
11
from __future__ import absolute_import import datetime import hashlib import json import logging import os.path import sys from pip._vendor.packaging import version as packaging_version from pip._vendor.six import ensure_binary from pip._internal.index.collector import LinkCollector from pip._internal.index.package_...
lzw120/django
refs/heads/master
build/lib/django/contrib/gis/tests/relatedapp/tests.py
198
from __future__ import absolute_import from datetime import date from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint from django.contrib.gis.db.models import Collect, Count, Extent, F, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.tests.utils import mysql, orac...
fyfcauc/android_external_chromium-org
refs/heads/du44
third_party/tlslite/tlslite/utils/Cryptlib_TripleDES.py
359
"""Cryptlib 3DES implementation.""" from cryptomath import * from TripleDES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_TripleDES(key, mode, IV) class Cryptlib_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mode,...
schleichdi2/OpenNfr_E2_Gui-6.0
refs/heads/master
lib/python/Screens/TextBox.py
13
from Screens.Screen import Screen from Components.ActionMap import ActionMap from Components.ScrollLabel import ScrollLabel class TextBox(Screen): def __init__(self, session, text = ""): Screen.__init__(self, session) self.text = text self["text"] = ScrollLabel(self.text) self["actions"] = ActionMap(["OkCan...
michalliu/OpenWrt-Firefly-Libraries
refs/heads/master
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/idle_test/test_grep.py
50
""" !Changing this line will break Test_findfile.test_found! Non-gui unit tests for idlelib.GrepDialog methods. dummy_command calls grep_it calls findfiles. An exception raised in one method will fail callers. Otherwise, tests are mostly independent. *** Currently only test grep_it. """ import unittest from test.test_s...
jonboiser/kolibri
refs/heads/develop
kolibri/core/deviceadmin/utils.py
4
import io import logging import os import re import sys from datetime import datetime from django import db from django.conf import settings import kolibri from kolibri.utils.conf import KOLIBRI_HOME # Import db instead of db.connections because we want to use an instance of # connections that might be updated from o...
zeyuanxy/fast-rcnn
refs/heads/master
lib/datasets/inria.py
3
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import datasets import datasets.inria import os import datasets.imdb im...
EUDAT-B2SHARE/invenio-old
refs/heads/next
modules/bibindex/lib/bibindex_regression_tests.py
1
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 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 ## ...
Acehaidrey/incubator-airflow
refs/heads/master
airflow/sensors/external_task_sensor.py
1
# # 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...
nilbody/h2o-3
refs/heads/master
py/h2o.py
2
import sys, os, getpass, logging, time, inspect, requests, json, pprint import h2o_test_utils from h2o_test_utils import log, log_rest import h2o_print as h2p class H2O(object): # static (class) variables ipaddr_from_cmd_line = None debugger = False json_url_history = [] python_test_name = inspect....
anthonydillon/horizon
refs/heads/master
openstack_dashboard/enabled/_1010_compute_panel_group.py
43
from django.utils.translation import ugettext_lazy as _ # The slug of the panel group to be added to HORIZON_CONFIG. Required. PANEL_GROUP = 'compute' # The display name of the PANEL_GROUP. Required. PANEL_GROUP_NAME = _('Compute') # The slug of the dashboard the PANEL_GROUP associated with. Required. PANEL_GROUP_DASH...
sassoftware/conary-policy
refs/heads/master
policy/metadata.py
2
# # Copyright (c) SAS Institute 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 w...
nallath/PostProcessingPlugin
refs/heads/master
scripts/ColorChange.py
2
# This PostProcessing Plugin script is released # under the terms of the AGPLv3 or higher from ..Script import Script #from UM.Logger import Logger # from cura.Settings.ExtruderManager import ExtruderManager class ColorChange(Script): def __init__(self): super().__init__() def getSettingDataString(s...
ihatevim/spotbot
refs/heads/master
plugins/coin.py
4
from util import hook import random @hook.command(autohelp=False) def coin(inp, me=None): """coin [amount] -- Flips [amount] of coins.""" if inp: try: amount = int(inp) except (ValueError, TypeError): return "Invalid input!" else: amount = 1 if amount ...
r0e/servo
refs/heads/master
tests/wpt/web-platform-tests/fetch/nosniff/resources/css.py
207
def main(request, response): outcome = request.GET.first("outcome", "f") type = request.GET.first("type", None) content = "/* nothing to see here */" response.add_required_headers = False response.writer.write_status(200) response.writer.write_header("x-content-type-options", "nosniff") re...
aethaniel/Espruino
refs/heads/master
scripts/serial_monitor_bytes.py
8
#!/usr/bin/python # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain on...
Mlieou/leetcode_python
refs/heads/master
leetcode/python/ex_376.py
3
class Solution(object): def wiggleMaxLength(self, nums): """ :type nums: List[int] :rtype: int """ if len(nums) < 2: return len(nums) prev_diff = nums[1] - nums[0] if prev_diff != 0: longest = 2 else: longest = 1 for ...
AzamYahya/shogun
refs/heads/develop
applications/easysvm/esvm/parse.py
31
""" This module contains code to parse the input arguments to the command line: - easysvm.py - datagen.py """ ############################################################################################# # # # This program is ...
larrybradley/astropy
refs/heads/remote-tests
astropy/io/fits/scripts/fitsdiff.py
8
# Licensed under a 3-clause BSD style license - see LICENSE.rst import argparse import glob import logging import os import sys from astropy.io import fits from astropy.io.fits.util import fill from astropy import __version__ log = logging.getLogger('fitsdiff') DESCRIPTION = """ Compare two FITS image files and re...
tylesmit/openstack-dashboard
refs/heads/master
django-openstack/bootstrap.py
191
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
krother/maze_run
refs/heads/master
leftovers/chapter10_data_structures.py
1
""" """ import pygame from pygame import image, Rect from pygame.locals import KEYDOWN from collections import namedtuple from part1 import draw_grid from chapter08_load_tile_positions import load_tile_positions from chapter08_load_tile_positions import TILE_POSITION_FILE, TILE_IMAGE_FILE, SIZE from chapter09_event_...
jollyrogue/demdb
refs/heads/master
backend/libs/apipublic.py
1
#!/usr/bin/env python3 ''' Library to hold the API logic functions. ''' from flask_restful import Resource class DemDbApiPublic(Resource): def get(self): return {'msg': 'Welcome to the public Democracy Database API v0.1!'}
CO600GOL/Game_of_life
refs/heads/develop
ProjectConway/projectconway/testing/test_views/test_tutorial4.py
1
from pyramid.testing import DummyRequest from projectconway.views.tutorial4 import tutorial4_view class TestTutorial4(object): ''' Tests all the views releated to the fourth tutorial page. ''' def test_tutorial4_view(self): ''' Tests the tutorial-4 view to ensure it functions correctly...
erudit/zenon
refs/heads/master
tests/functional/apps/userspace/journal/information/test_views.py
1
from django.contrib.contenttypes.models import ContentType from django.urls import reverse from django.test import TestCase from base.test.factories import UserFactory from base.test.testcases import Client from erudit.models import JournalInformation from erudit.test.factories import JournalFactory from apps.userspac...
cyanna/edx-platform
refs/heads/master
common/djangoapps/terrain/browser.py
84
""" Browser set up for acceptance tests. """ # pylint: disable=no-member # pylint: disable=unused-argument from lettuce import before, after, world from splinter.browser import Browser from logging import getLogger from django.core.management import call_command from django.conf import settings from selenium.common.e...
eventql/eventql
refs/heads/master
deps/3rdparty/spidermonkey/mozjs/testing/mozbase/mozfile/mozfile/__init__.py
24
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from mozfile import *
mdanielwork/intellij-community
refs/heads/master
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/typeCommentInstanceAttributeDocstring_after.py
19
class MyClass: """Docstring.""" attr = None # type: [int] def __init__(self): self.attr = 42 self.attr
4ndr345/BDv3
refs/heads/master
bladedesigner/unittest/distribution/chebyshev.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= # BladeDesigner # Copyright (C) 2014 Andreas Kührmann [andreas.kuehrmann@gmail.com] # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
gilsondev/cajadoarquitetura
refs/heads/master
cajadoarquitetura/core/__init__.py
12133432
smajda/cookiecutter-django-crud-app
refs/heads/master
{{cookiecutter.app_name}}/__init__.py
12133432
none-da/zeshare
refs/heads/master
django_messages_framework/api.py
1
from django_messages_framework import constants from django_messages_framework.storage import default_storage from django.utils.functional import lazy, memoize __all__ = ( 'add_message', 'get_messages', 'debug', 'info', 'success', 'warning', 'error', ) class MessageFailure(Exception): pass def add_mess...
joyxu/autotest
refs/heads/master
tko/parsers/test/new_scenario.py
4
#!/usr/bin/python """Create new scenario test instance from an existing results directory. This automates creation of regression tests for the results parsers. There are 2 primary use cases for this. 1) Bug fixing: Parser broke on some input in the field and we want to start with a test that operates on that input an...
xyuanmu/XX-Net
refs/heads/master
python3.8.2/Lib/urllib/error.py
35
"""Exception classes raised by urllib. The base exception class is URLError, which inherits from OSError. It doesn't define any behavior of its own, but is the base class for all exceptions defined in this package. HTTPError is an exception class that is also a valid HTTP response instance. It behaves this way beca...
ningchi/scikit-learn
refs/heads/master
sklearn/covariance/graph_lasso_.py
7
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
Mythirion/VirtualRobot
refs/heads/master
porc/setup (2).py
12
#!/usr/bin/env python import os import sys import requests from codecs import open try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() packages = [ 'requests', 'requests.pa...
Newman101/scipy
refs/heads/master
scipy/optimize/_lsq/trf.py
56
"""Trust Region Reflective algorithm for least-squares optimization. The algorithm is based on ideas from paper [STIR]_. The main idea is to account for presence of the bounds by appropriate scaling of the variables (or equivalently changing a trust-region shape). Let's introduce a vector v: | ub[i] - x[i]...
JamesShaeffer/QGIS
refs/heads/master
tests/src/python/test_qgslegendpatchshapewidget.py
31
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLegendPatchShapeWidget. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later vers...
djo938/pyshell
refs/heads/master
pyshell/utils/test/postprocess_test.py
3
#!/usr/bin/env python -t # -*- coding: utf-8 -*- # Copyright (C) 2015 Jonathan Delvaux <pyshell@djoproject.net> # 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...
qiuminxu/tensorboard
refs/heads/master
tensorboard/plugins/debugger/numerics_alert.py
3
# 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...
LostItem/roundware-server
refs/heads/develop
roundwared/audiotrack.py
2
# Roundware Server is released under the GNU Affero General Public License v3. # See COPYRIGHT.txt, AUTHORS.txt, and LICENSE.txt in the project root directory. # TODO: Figure out how to get the main pipeline to send EOS # when all audiotracks are finished (only happens # when repeat is off) # TODO: Reimplement pan...
rchav/vinerack
refs/heads/master
saleor/product/urls.py
19
from django.conf.urls import url from . import views urlpatterns = [ url(r'^(?P<slug>[a-z0-9-]+?)-(?P<product_id>[0-9]+)/$', views.product_details, name='details'), url(r'^category/(?P<path>[a-z0-9-_/]+?)-(?P<category_id>[0-9]+)/$', views.category_index, name='category') ]
cchurch/ansible
refs/heads/devel
lib/ansible/modules/utilities/logic/include_tasks.py
45
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ...
bobwalker99/Pydev
refs/heads/master
plugins/org.python.pydev.refactoring/tests/python/codegenerator/generatedocstring/testGenerateDocstringJumpToEmpty.py
8
def function(): "" return True##| ##r def function(): "##|" return True
upiterbarg/mpmath
refs/heads/master
mpmath/libmp/libmpc.py
7
""" Low-level functions for complex arithmetic. """ import sys from .backend import MPZ, MPZ_ZERO, MPZ_ONE, MPZ_TWO, BACKEND from .libmpf import (\ round_floor, round_ceiling, round_down, round_up, round_nearest, round_fast, bitcount, bctable, normalize, normalize1, reciprocal_rnd, rshift, lsh...
flashycud/timestack
refs/heads/master
django/contrib/gis/db/backends/spatialite/client.py
623
from django.db.backends.sqlite3.client import DatabaseClient class SpatiaLiteClient(DatabaseClient): executable_name = 'spatialite'
pvital/patchew
refs/heads/master
tests/__init__.py
12133432
bigswitch/tempest
refs/heads/master
tempest/services/network/json/__init__.py
12133432
usc-isi/essex-baremetal-support
refs/heads/master
smoketests/run_tests.py
17
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this...
asedunov/intellij-community
refs/heads/master
python/lib/Lib/encodings/cp1257.py
593
""" Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.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...
bugsnag/bugsnag-python
refs/heads/master
example/django21/demo/__init__.py
12133432
leekchan/django_test
refs/heads/master
django/contrib/staticfiles/templatetags/__init__.py
12133432
brianlsharp/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/f2py/tests/test_mixed.py
59
import os import math from numpy.testing import * from numpy import array import util def _path(*a): return os.path.join(*((os.path.dirname(__file__),) + a)) class TestMixed(util.F2PyTest): sources = [_path('src', 'mixed', 'foo.f'), _path('src', 'mixed', 'foo_fixed.f90'), _path...
pombredanne/bulbs2
refs/heads/master
bulbs2/utils/signals/slugs.py
2
from django.conf import settings from django.template.defaultfilters import slugify as _slugify MAX_SLUG_LENGTH = getattr(settings, "MAX_SLUG_LENGTH", 50) def slugify(value, length=MAX_SLUG_LENGTH): """runs the given value through django's slugify filter and slices it to a given length :param value: the va...
PPCDroid/external-qemu
refs/heads/master
gen-charmap.py
3
#!/usr/bin/python # # a python script used to generate some C constant tables from a key charmap file # # usage: # progname file.kcm > charmap-tab.h # import sys, os, string, re header = """\ #include "android_charmap.h" /* the following is automatically generated by the 'gen-charmap.py' script * do not touch. th...
QInfer/python-qinfer
refs/heads/master
src/qinfer/_due.py
5
# emacs: at the end of the file # ex: set sts=4 ts=4 sw=4 et: # pylint: skip-file # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### # """ Stub file for a guaranteed safe import of duecredit constructs: if duecredit is not available. To use it, place it into your project codebase to be impo...
roks0n/nomadboard
refs/heads/master
nomadboard/nomadboard/scraper/tests.py
341
# Create your tests here.
iFighting/OpenTLD
refs/heads/master
datasets/minbox.py
14
import csv import sys import cv2 def box_size(b): return min(b[2]-b[0],b[3]-b[1]) boxes = csv.reader(open(sys.argv[1],'rb'),delimiter=',') min_box=1000000 for box in boxes: if (box[0] != 'NaN'): box = map(float,box) if (box_size(box) < min_box): min_box = box_size(box) print min_box
igemsoftware2017/USTC-Software-2017
refs/heads/master
tests/core/tasks/myplugin/models.py
69
from django.db import models # noqa # Create your models here.
konstruktoid/ansible-upstream
refs/heads/devel
lib/ansible/modules/system/sysctl.py
42
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, David "DaviXX" CHANIAL <david.chanial@gmail.com> # (c) 2014, James Tanner <tanner.jc@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclas...
andresriancho/django-moth
refs/heads/master
moth/views/vulnerabilities/core/headers.py
1
from django.shortcuts import render from moth.views.base.vulnerable_template_view import VulnerableTemplateView class EchoHeadersView(VulnerableTemplateView): description = title = 'Echoes all request headers' url_path = 'echo-headers.py' KNOWN_HEADERS = ('CONTENT_LENGTH',) def is_http_header(self, ...
SAM-IT-SA/odoo
refs/heads/8.0
openerp/addons/base/tests/test_ir_actions.py
291
import unittest2 from openerp.osv.orm import except_orm import openerp.tests.common as common from openerp.tools import mute_logger class TestServerActionsBase(common.TransactionCase): def setUp(self): super(TestServerActionsBase, self).setUp() cr, uid = self.cr, self.uid # Models ...
mattias-ohlsson/anaconda
refs/heads/master
pyanaconda/script.py
1
# # script.py - non-interactive, script based anaconda interface # # Copyright (C) 2011 # Red Hat, Inc. 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; either version 2 o...
ryfeus/lambda-packs
refs/heads/master
Opencv_pil/source36/setuptools/py33compat.py
34
import dis import array import collections try: import html except ImportError: html = None from setuptools.extern import six from setuptools.extern.six.moves import html_parser __metaclass__ = type OpArg = collections.namedtuple('OpArg', 'opcode arg') class Bytecode_compat: def __init__(self, code): ...
Epirex/android_external_chromium_org
refs/heads/cm-11.0
build/android/pylib/host_driven/setup.py
27
# 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. """Setup for instrumentation host-driven tests.""" import logging import os import sys import types import test_case import test_info_collection import tes...
ubuntu-gr/OlesOiGlosses
refs/heads/master
paradeigma.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- ''' * * Για εκτέλεση του προγράμματος: * python paradeigma.py * * Αποτέλεσμα: * Γεια σου, κόσμε! * Εκτέλεση if: Αληθές και όχι ψευδές! * Εκτέλεση βρόγχου: 0 1 2 3 4 5 6 7 8 9 * Αυτή είναι μια υπορουτίνα με αριθμό 5. ''' def subroutine(number): print ("Αυτή ...
badlogicmanpreet/nupic
refs/heads/master
src/nupic/swarming/hypersearch/errorcodes.py
50
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
apanju/GMIO_Odoo
refs/heads/8.0
addons/account_bank_statement_extensions/__init__.py
442
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
songfj/calibre
refs/heads/master
src/calibre/gui2/convert/snb_output.py
24
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2010, Li Fanxi <lifanxi@freemindworld.com>' __docformat__ = 'restructuredtext en' from calibre.gui2.convert.snb_output_ui import Ui_Form from calibre.gui2.convert import Widget newline_model = None class PluginWidget(Widget, Ui_Form): TITLE = _('SN...
JST9723/stj-fusion-byte1
refs/heads/master
lib/werkzeug/wsgi.py
312
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import sys import posixpath import mimetypes from itert...
snowchan/flasky
refs/heads/master
app/api_1_0/decorators.py
150
from functools import wraps from flask import g from .errors import forbidden def permission_required(permission): def decorator(f): @wraps(f) def decorated_function(*args, **kwargs): if not g.current_user.can(permission): return forbidden('Insufficient permissions') ...
simalytics/askbot-devel
refs/heads/master
askbot/deps/django_authopenid/models.py
10
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import User from django.db import models import hashlib, random, sys, os, time __all__ = ['Nonce', 'Association', 'UserAssociation', 'UserPasswordQueueManager', 'UserPasswordQueue'] class Nonce(models.Model): """ op...