repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
avoinsystems/odoo
refs/heads/8.0
addons/point_of_sale/test/test_frontend.py
309
import openerp.tests @openerp.tests.common.at_install(False) @openerp.tests.common.post_install(True) class TestUi(openerp.tests.HttpCase): def test_01_pos_basic_order(self): self.phantom_js("/", "openerp.Tour.run('pos_basic_order', 'test')", "openerp.Tour.tours.pos_basic_order", login="admin")
darrengarvey/procfs-snapshot
refs/heads/master
db.py
1
import os import sqlite3 from model import Library class Database(object): def __init__(self, path, overwrite=False): self.path = path if os.path.exists(path): if overwrite: os.unlink(path) self._create_db(path) else: self.c...
rsjohnco/rez
refs/heads/resources2
src/rez/package_maker__.py
2
from rez.utils.schema import Required, schema_keys from rez.utils.formatting import PackageRequest from rez.utils.data_utils import AttrDictWrapper from rez.package_resources_ import help_schema, _commands_schema from rez.package_repository import create_memory_package_repository from rez.packages_ import Package from ...
nelsonag/openmc
refs/heads/develop
tests/regression_tests/lattice/test.py
11
from tests.testing_harness import TestHarness def test_lattice(): harness = TestHarness('statepoint.10.h5') harness.main()
mhbu50/frappe
refs/heads/develop
frappe/utils/scheduler.py
5
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt """ Events: always daily monthly weekly """ from __future__ import unicode_literals, print_function import frappe import json import schedule import time import frappe.utils import os from frappe.utils import get_s...
brettlangdon/dd-agent
refs/heads/master
tests/core/test_emitter.py
40
# -*- coding: utf-8 -*- # 3p import unittest # project from emitter import remove_control_chars class TestEmitter(unittest.TestCase): def test_remove_control_chars(self): messages = [ (u'#és9df\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00>\x00\x01\x00\x00\x00\x06@\x00\x00\x...
Timurdov/bionic
refs/heads/master
bionic/Lib/distutils/__init__.py
1211
import os import sys import warnings import imp import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib # Important! To work on pypy, this must be a module that resides in the # lib-python/modified-x.y.z directory dirname = os.path.dirname distutils_path = o...
joanma100/agora-ciudadana
refs/heads/master
haystack/backends/__init__.py
9
# -*- coding: utf-8 -*- from copy import deepcopy from time import time from django.conf import settings from django.db.models import Q from django.db.models.base import ModelBase from django.utils import tree from django.utils.encoding import force_unicode from haystack.constants import DJANGO_CT, VALID_FILTERS, FILTE...
ChinaMassClouds/copenstack-server
refs/heads/master
openstack/src/ceilometer-2014.2.2/ceilometer/tests/compute/pollsters/test_instance.py
6
# # Copyright 2012 eNovance <licensing@enovance.com> # Copyright 2012 Red Hat, Inc # # Author: Julien Danjou <julien@danjou.info> # Author: Eoghan Glynn <eglynn@redhat.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 obta...
chrisseto/osf.io
refs/heads/feature/reviews
addons/base/apps.py
14
import os import glob import mimetypes from django.apps import AppConfig from mako.lookup import TemplateLookup from framework.routing import process_rules from framework.flask import app from website import settings from website.util import rubeus def _is_image(filename): mtype, _ = mimetypes.guess_type(filena...
jart/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/numerics_test.py
45
# 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...
salguarnieri/intellij-community
refs/heads/master
python/lib/Lib/encodings/cp1254.py
593
""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.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...
HuayraLinux/python-apt
refs/heads/master
tests/old/test_enhances.py
1
#!/usr/bin/python import apt cache = apt.Cache() for pkg in cache: if pkg.installed and pkg.installed.enhances: s = "%s enhances:" % pkg.name for or_list in pkg.installed.enhances: for enhances in or_list.or_dependencies: s += " %s" % enhances.name if (...
cycotech/WAR-app
refs/heads/master
env/lib/python3.5/site-packages/pkg_resources/__init__.py
17
# coding: utf-8 """ Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path opera...
ayoubg/gem5-graphics
refs/heads/master
gem5/tests/configs/simple-atomic.py
69
# Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
mogoweb/webkit_for_android5.1
refs/heads/master
webkit/Tools/Scripts/webkitpy/style/checker.py
15
# Copyright (C) 2009 Google Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # Copyright (C) 2010 ProFUSION embedded systems # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
JamesGuthrie/libcloud
refs/heads/trunk
libcloud/test/compute/test_voxel.py
46
# 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 use ...
lundskommun/resejamforaren
refs/heads/master
rjweb/admin.py
13848
from django.contrib import admin # Register your models here.
KaranToor/MA450
refs/heads/master
google-cloud-sdk/lib/third_party/yaml/parser.py
410
# The following YAML grammar is LL(1) and is parsed by a recursive descent # parser. # # stream ::= STREAM-START implicit_document? explicit_document* STREAM-END # implicit_document ::= block_node DOCUMENT-END* # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* # block_node_or_inden...
slisson/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/core/management/commands/startproject.py
322
from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module import os import re from random import choice class Command(LabelCommand): help = "Creates a Django project directory structure for the given project name in the current directory." ...
peterlada/backend
refs/heads/master
backend/users/__init__.py
1
# -*- coding: utf-8 -*- """ backend.users ~~~~~~~~~~~~~~ backend users package """ from ..core import Service from .models import User class UsersService(Service): __model__ = User
FrancescoCeruti/linux-show-player
refs/heads/master
lisp/modules/action_cues/index_action_cue.py
2
# -*- coding: utf-8 -*- # # This file is part of Linux Show Player # # Copyright 2012-2016 Francesco Ceruti <ceppofrancy@gmail.com> # # Linux Show Player 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 ...
tempbottle/servo
refs/heads/master
tests/wpt/css-tests/tools/pywebsocket/src/test/test_memorizingfile.py
496
#!/usr/bin/env python # # Copyright 2011, 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...
smharper/openmc
refs/heads/develop
openmc/cell.py
8
from collections import OrderedDict from collections.abc import Iterable from copy import deepcopy from math import cos, sin, pi from numbers import Real from xml.etree import ElementTree as ET import numpy as np from uncertainties import UFloat import openmc import openmc.checkvalue as cv from ._xml import get_text ...
iamOgunyinka/DjangoPython
refs/heads/master
lists/tests.py
1
from django.test import TestCase from lists.models import Item from django.core.urlresolvers import resolve from django.template.loader import render_to_string from django.http import HttpRequest from lists.views import home_page strn_r = 'A new list item' class HomePageTest( TestCase ): def test_root_url_resolves_...
HiroIshikawa/21playground
refs/heads/master
microblog/flask/lib/python3.5/site-packages/openid/extensions/__init__.py
173
"""OpenID Extension modules.""" __all__ = ['ax', 'pape', 'sreg'] from openid.extensions.draft import pape5 as pape
tomkralidis/geonode
refs/heads/master
geonode/layers/api/urls.py
6
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2020 OSGeo # # 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 ...
spaceone/pyjs
refs/heads/master
pyjswidgets/pyjamas/chart/GChartConsts.py
7
""" * Copyright 2007,2008,2009 John C. Gunther * Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> * * 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/lic...
lmazuel/azure-sdk-for-python
refs/heads/master
azure-servicefabric/azure/servicefabric/models/unprovision_application_type_description_info.py
1
# 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 ...
jhayworth/config
refs/heads/master
.emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/pip/_vendor/idna/idnadata.py
63
# This file is automatically generated by tools/idna-data __version__ = "11.0.0" scripts = { 'Greek': ( 0x37000000374, 0x37500000378, 0x37a0000037e, 0x37f00000380, 0x38400000385, 0x38600000387, 0x3880000038b, 0x38c0000038d, 0x38e000003a2, ...
zimmerman-zimmerman/OIPA
refs/heads/master
OIPA/api/export/serializers.py
2
from rest_framework import serializers import api.activity.serializers as activity_serializers import api.transaction.serializers as transaction_serializers from api.generics.fields import BoolToNumField, PointIATIField from api.generics.serializers import ( DynamicFieldsSerializer, SerializerNoValidation, SkipNul...
tzae/sorting
refs/heads/master
plot.py
2
# plot.py ## # Sorting algorithms visualized. # # This code uses python2, matplotlib and avconv. You may need to install them. # # The idea was taken from "The Glowing Python": # http://glowingpython.blogspot.com.es/2013/02/selection-sort-animated.html ## # This file manages the plotting of the algorithm. 'plot.py...
sajeeshcs/nested_quota_final
refs/heads/master
nova/tests/functional/v3/test_flavor_extraspecs.py
10
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.2/django/contrib/auth/middleware.py
289
from django.contrib import auth from django.core.exceptions import ImproperlyConfigured class LazyUser(object): def __get__(self, request, obj_type=None): if not hasattr(request, '_cached_user'): from django.contrib.auth import get_user request._cached_user = get_user(request) ...
flepied/pxemngr
refs/heads/master
pxe/views.py
1
#--------------------------------------------------------------- # Project : pxemngr # File : views.py # Copyright : 2009-2010 Splitted-Desktop Systems # Author : Frederic Lepied # Created On : Sun Feb 1 13:54:41 2009 # Purpose : http logic #------------------------------...
jmgc/swift
refs/heads/master
benchmark/scripts/compare_perf_tests.py
12
#!/usr/bin/python # -*- coding: utf-8 -*- # ===--- compare_perf_tests.py -------------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library...
tylertian/Openstack
refs/heads/master
openstack F/nova/nova/tests/api/openstack/compute/contrib/test_hosts.py
7
# Copyright (c) 2011 OpenStack, LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
msebire/intellij-community
refs/heads/master
python/testData/testRunner/env/pytest/test_with_markers/test_with_markers.py
30
import pytest @pytest.mark.slow def test_slow(): pass def test_fast(): pass
izyh/oweb
refs/heads/master
openrpi/views.py
6445
from django.shortcuts import render # Create your views here.
stone5495/NewsBlur
refs/heads/master
utils/munin/newsblur_classifiers.py
14
#!/usr/bin/env python from utils.munin.base import MuninGraph class NBMuninGraph(MuninGraph): @property def graph_config(self): return { 'graph_category' : 'NewsBlur', 'graph_title' : 'NewsBlur Classifiers', 'graph_vlabel' : '# of classifiers', 'graph_...
ProfessorX/Config
refs/heads/master
.PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/GdkAtomType.py
1
# encoding: utf-8 # module gtk._gtk # from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so # by generator 1.135 # no doc # imports import atk as __atk import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject from object import object class GdkAtomType(object): # no doc ...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/mobile/salacious_crumb.py
85615
import sys def setup(core, object): return
sgenoud/scikit-learn
refs/heads/master
examples/ensemble/plot_forest_iris.py
3
""" ==================================================================== Plot the decision surfaces of ensembles of trees on the iris dataset ==================================================================== Plot the decision surfaces of forests of randomized trees trained on pairs of features of the iris dataset. ...
phalax4/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/encodings/cp861.py
593
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.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_map) def decode(self,input,errors='strict'): ...
maksm90/minipic
refs/heads/master
minipic/op.py
1
import picmicro def _operand_reg(cpu, f, a): if a == 1: addr = (cpu.data[BSR].get() << 8) | f else: addr = f if f < 0x80 else (0x0f00 | f) return cpu.data[addr] def _result_reg(cpu, operand_reg, d): return cpu.data[picmicro.WREG] if d == 0 else operand_reg class Op: """ Abstract ...
kunci115/GetCode
refs/heads/master
algoritma/investmen.py
1
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Dec 30 19:08:34 2016 @author: root """ balance = int(raw_input()) year = 0 interest = 0 persen = 0.06 print "Penanaman modal pada tahun ke",year," ",balance while balance <= 20000: year = year + 1 b = balance * persen balance = balance + b ...
mcfi/MCFI
refs/heads/master
compiler/llvm-3.5.0.src/utils/sort_includes.py
53
#!/usr/bin/env python """Script to sort the top-most block of #include lines. Assumes the LLVM coding conventions. Currently, this script only bothers sorting the llvm/... headers. Patches welcome for more functionality, and sorting other header groups. """ import argparse import os def sort_includes(f): """Sort...
captain-pool/GSOC
refs/heads/master
E3_Streamer/experimental/stream_server.py
1
import socket from absl import logging from functools import partial import threading import datapacket_pb2 import tensorflow as tf from moviepy import editor class StreamClient(object): SYN = b'SYN' SYNACK = b'SYN/ACK' ACK = b'ACK' def __init__(self, client_socket, client_address, video_path): self.vide...
171121130/SWI
refs/heads/master
venv/Lib/site-packages/markdown/extensions/admonition.py
65
""" Admonition extension for Python-Markdown ======================================== Adds rST-style admonitions. Inspired by [rST][] feature with the same name. The syntax is (followed by an indented block with the contents): !!! [type] [optional explicit title] Where `type` is used as a CSS class name of the d...
gengliangwang/spark
refs/heads/master
python/pyspark/version.py
22
#!/usr/bin/env python3 # # 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 "L...
mgit-at/ansible
refs/heads/devel
test/units/executor/test_play_iterator.py
45
# (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...
HeartUnchange/aiospider
refs/heads/master
aiospider/spider.py
1
#!/usr/bin/python3 #-*- coding:utf-8 -*- ''' main part ''' import asyncio import sys from itertools import zip_longest from collections import namedtuple import traceback import aiohttp from .taskqueue import TaskQueue, makeTask from .log import logging DEFAULT_HEADER = {'user-agent': 'Mozilla/5.0 (X11; Linux x86_6...
ilo10/scikit-learn
refs/heads/master
examples/text/mlcomp_sparse_document_classification.py
292
""" ======================================================== Classification of text documents: using a MLComp dataset ======================================================== This is an example showing how the scikit-learn can be used to classify documents by topics using a bag-of-words approach. This example uses a s...
sreidy/roboticsclub.org
refs/heads/master
robocrm/migrations/0028_auto_20141226_1547.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('robocrm', '0027_auto_20141226_1527'), ] operations = [ migrations.AlterField( model_name='robouser', ...
djbaldey/django
refs/heads/master
tests/get_earliest_or_latest/models.py
540
from django.db import models class Article(models.Model): headline = models.CharField(max_length=100) pub_date = models.DateField() expire_date = models.DateField() class Meta: get_latest_by = 'pub_date' class Person(models.Model): name = models.CharField(max_length=30) birthday = m...
stochastic-technologies/impactstory-buildpack
refs/heads/master
vendor/pip-1.3.1/pip/vcs/mercurial.py
166
import os import tempfile import re import sys from pip.util import call_subprocess from pip.util import display_path, rmtree from pip.log import logger from pip.vcs import vcs, VersionControl from pip.download import path_to_url2 from pip.backwardcompat import ConfigParser class Mercurial(VersionControl): name =...
kubernetes-client/python
refs/heads/master
kubernetes/client/models/v1_iscsi_persistent_volume_source.py
1
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.18 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
open-synergy/vertical-association
refs/heads/8.0
membership_initial_fee/models/__init__.py
6
# -*- coding: utf-8 -*- # (c) 2015 Antiun Ingenieria S.L. - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import product_template from . import account_invoice
rohit21122012/DCASE2013
refs/heads/master
runs/2013/dnn_layerwise/bs512/dnn_5layer/src/files.py
38
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import wave import numpy import csv import cPickle as pickle import librosa import yaml def load_audio(filename, mono=True, fs=44100): """Load audio file into numpy array Supports 24-bit wav-format, and flac audio through librosa. Parameters -...
apporc/nova
refs/heads/master
nova/tests/unit/api/ec2/test_cinder_cloud.py
2
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License");...
racker/omnibus
refs/heads/master
source/otp_src_R14B02/lib/asn1/test/asn1_SUITE_data/Tst.py
3
Tst { 2 6 6 24 7 1 } DEFINITIONS IMPLICIT TAGS ::= BEGIN --EXPORTS SomeSet , Id0 , Aset,Id1 ,A,B,C, -- Uhh ,Foo ,Cho,Person,Hobbe,Robbe,X,Y; IMPORTS Fooo FROM Bobby; Robbe ::= SET { ttt TT } Koo ::= SET { c CHOICE { a INTEGER, b BOOLEAN }, s SET OF Id0 } Hobbe ::= [APPLICATION 1] SET { aaa [0] S...
ahmadiga/min_edx
refs/heads/master
lms/djangoapps/lms_xblock/migrations/0001_initial.py
110
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'XBlockAsidesConfig' db.create_table('lms_xblock_xblockasidesconfig', ( ('id', se...
hankcs/HanLP
refs/heads/master
plugins/hanlp_demo/hanlp_demo/zh/tf/train_msra_ner_albert.py
1
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-12-28 23:15 from hanlp.components.ner_tf import TransformerNamedEntityRecognizerTF from hanlp.datasets.ner.msra import MSRA_NER_CHAR_LEVEL_TRAIN, MSRA_NER_CHAR_LEVEL_DEV, MSRA_NER_CHAR_LEVEL_TEST from tests import cdroot cdroot() recognizer = TransformerNamedEntityR...
AlvaroRQ/prototipo
refs/heads/master
ownLibraries/object_detection/object_detection/utils/shape_utils_test.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...
scottkirkwood/mm2notes
refs/heads/master
mm2notes/mm2notes.py
1
#!/usr/bin/env python # -*- encoding: latin1 -*- # # -*- coding: utf-8 -*- # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
t0mk/ansible
refs/heads/devel
lib/ansible/modules/cloud/centurylink/clc_blueprint_package.py
16
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
yuruofeifei/mxnet
refs/heads/master
tools/launch.py
31
#!/usr/bin/env python # 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 # "L...
mwv/scikit-learn
refs/heads/master
doc/tutorial/machine_learning_map/svg2imagemap.py
360
#!/usr/local/bin/python """ This script converts a subset of SVG into an HTML imagemap Note *subset*. It only handles <path> elements, for which it only pays attention to the M and L commands. Futher, it only notices the "translate" transform. It was written to generate the examples in the documentation f...
mahak/nova
refs/heads/master
nova/api/openstack/compute/schemas/flavors.py
4
# Copyright 2017 NEC Corporation. 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 ...
bgris/ODL_bgris
refs/heads/master
lib/python3.5/cgi.py
3
#! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env w...
tiancj/emesene
refs/heads/master
emesene/test/test_ring_buffer.py
2
import os import sys import unittest sys.path.append(os.path.abspath('.')) from e3.common import RingBuffer class RingBufferTestCase(unittest.TestCase): ITEMS = [1, 2.4, False, None, "foo", [], (1,2,3)] def test_create(self): ring = RingBuffer() self.assertEquals(len(ring), 0) self....
AladdinSonni/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/committer_auth.py
118
# Copyright (C) 2011 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
tmpgit/intellij-community
refs/heads/master
python/testData/quickFixes/PyMakeFunctionFromMethodQuickFixTest/usageAssignment.py
75
class A: def m<caret>(self): print 1 b = A() a = b.m()
alistairlow/tensorflow
refs/heads/master
tensorflow/python/framework/versions_test.py
164
# 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...
sbkolate/sap_frappe_v6
refs/heads/master
frappe/patches/v4_0/enable_scheduler_in_system_settings.py
73
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils.scheduler import disable_scheduler, enable_scheduler from frappe.utils import cint def execute(): frappe.reload_doc("core", "doctype", "system_se...
moijes12/oh-mainline
refs/heads/master
vendor/packages/Django/django/db/models/loading.py
104
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule fro...
hongliang5623/sentry
refs/heads/master
src/sentry/api/serializers/models/activity.py
12
from __future__ import absolute_import from sentry.api.serializers import Serializer, register, serialize from sentry.models import Activity @register(Activity) class ActivitySerializer(Serializer): def serialize(self, obj, attrs, user): d = { 'id': str(obj.id), 'user': serialize(...
laayis/yowsup
refs/heads/master
yowsup/layers/stanzaregulator/__init__.py
69
from .layer import YowStanzaRegulator
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/loot/npc_loot/frequency_jammer_wire_generic.py
85615
import sys def setup(core, object): return
eliran-stratoscale/pyracktest
refs/heads/master
py/strato/racktest/infra/config.py
3
import yaml USER = None TEST_LOGS_DIR = "logs.racktest" def load(filename="/etc/racktest.conf"): with open(filename) as f: data = yaml.load(f.read()) if data is None: raise Exception("Configuration file must not be empty") globals().update(data) if USER is None: raise Exceptio...
jawilson/Flexget
refs/heads/master
flexget/plugins/cli/trakt.py
9
from __future__ import unicode_literals, division, absolute_import from flexget import options, plugin from flexget.event import event from flexget.manager import Session from flexget.plugins.internal.api_trakt import get_access_token, TraktUserAuth, delete_account, PIN_URL from flexget.terminal import TerminalTable, ...
danilito19/django
refs/heads/master
tests/signals/tests.py
311
from __future__ import unicode_literals from django.db import models from django.db.models import signals from django.dispatch import receiver from django.test import TestCase from django.utils import six from .models import Author, Book, Car, Person class BaseSignalTest(TestCase): def setUp(self): # Sa...
ssvsergeyev/ZenPacks.zenoss.AWS
refs/heads/develop
src/boto/tests/integration/cloudsearch2/test_cert_verification.py
118
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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 withou...
enthought/shiboken
refs/heads/master
tests/samplebinding/writableclassdict_test.py
6
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the Shiboken Python Bindings Generator project. # # Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). # # Contact: PySide team <contact@pyside.org> # # This program is free software; you can redistribute it and/or # modify it under the terms...
lsp84ch83/PyText
refs/heads/master
iwebshop/run_test.py
1
#!/usr/bin/env python # _*_ coding: utf-8 _*_ # @Time : 2018/6/8 11:28 # @Author : Soner # @version : 1.0.0 # @license : Copyright(C), Your Company from HTMLTestRunner import HTMLTestRunner from unittest import defaultTestLoader import time, os from iwebshop.modular import mail # 指定测试用例目录 test_dir = "./test_case...
mateusz880/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/testing/scripts/upload.py
2511
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
yannrouillard/weboob
refs/heads/master
modules/freemobile/__init__.py
4
# -*- coding: utf-8 -*- # Copyright(C) 2012 Florent Fourcot # # 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, either version 3 of the License, or # (at your op...
dneg/gaffer
refs/heads/master
python/GafferSceneTest/SeedsTest.py
3
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
emonty/ansible
refs/heads/devel
test/lib/ansible_test/_internal/http.py
68
""" Primitive replacement for requests to avoid extra dependency. Avoids use of urllib2 due to lack of SNI support. """ from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import time try: from urllib import urlencode except ImportError: # noinspection PyCompati...
alvin319/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/test/test_sax.py
40
# regression test for SAX 2.0 -*- coding: utf-8 -*- # $Id$ from xml.sax import make_parser, ContentHandler, \ SAXException, SAXReaderNotAvailable, SAXParseException try: make_parser() except SAXReaderNotAvailable: # don't try to test this module if we cannot create a parser r...
gramps-project/addons-source
refs/heads/master
LastChange/LastChangeReport.py
2
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Jakim Friant # Copyright (C) 2017 Paul Culley # # 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 ...
daxxi13/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/canalplus.py
16
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate, url_basename, qualities, ) class CanalplusIE(InfoExtractor): IE_DESC = 'canalplus.fr, piwiplus.fr and d8.tv' _VALID_URL = r'https?://(?:www\.(?P<site>canal...
tcpcloud/contrail-neutron-plugin
refs/heads/master
neutron_plugin_contrail/tests/loadbalancer/test_plugin.py
10
# # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # from neutron.extensions import loadbalancer from neutron.openstack.common import uuidutils from neutron.plugins.common import constants from neutron.tests.unit import test_api_v2 from neutron.tests.unit import test_api_v2_extension from neutron_plugi...
hexlism/xx_net
refs/heads/master
python27/1.0/lib/encodings/iso8859_3.py
593
""" Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.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,input,errors='...
UOMx/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/tests/test_import_static.py
208
""" Tests that check that we ignore the appropriate files when importing courses. """ import unittest from mock import Mock from xmodule.modulestore.xml_importer import import_static_content from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.tests import DATA_DIR class IgnoredFilesTestCase(uni...
mdavid/cherokee-webserver-svnclone
refs/heads/master
qa/056-ContentRange3.py
8
import random import string from base import * from util import * MAGIC = str_random (100) LENGTH = 100 OFFSET = 15 class Test (TestBase): def __init__ (self): TestBase.__init__ (self, __file__) self.name = "Content Range, end" self.request = "GET /Range100b2 HTTP/1.0\r\n" +\ ...
dhoffman34/django
refs/heads/master
django/contrib/gis/gdal/prototypes/ds.py
79
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from djang...
robdennis/sideboard
refs/heads/master
tests/plugins/manypackages/multi/env/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/tests/test_develop.py
66
"""develop tests """ import sys import os, shutil, tempfile, unittest import tempfile import site from StringIO import StringIO from distutils.errors import DistutilsError from setuptools.command.develop import develop from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribu...
brython-dev/brython
refs/heads/master
www/src/Lib/unittest/test/test_functiontestcase.py
108
import unittest from unittest.test.support import LoggingResult class Test_FunctionTestCase(unittest.TestCase): # "Return the number of tests represented by the this test object. For # TestCase instances, this will always be 1" def test_countTestCases(self): test = unittest.FunctionTestCase(lamb...
tzabian/fuego-pootle
refs/heads/master
pootle/install_dirs.py
4
import os CONFIG_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SOURCE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) WORKING_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def config_p...