repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
mingzhaodotname/teletraan
refs/heads/master
deploy-agent/deployd/client/base_client.py
6
# Copyright 2016 Pinterest, 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...
hugs/django
refs/heads/master
django/contrib/gis/tests/test_gdal_envelope.py
9
import unittest from django.contrib.gis.gdal import Envelope, OGRException class EnvelopeTest(unittest.TestCase): def test01_init(self): "Testing Envelope initilization." e1 = Envelope((0, 0, 5, 5)) e2 = Envelope(0, 0, 5, 5) e3 = Envelope(0, '0', '5', 5) # Thanks to ww for this ...
NexusIS/libcloud
refs/heads/trunk
libcloud/backup/drivers/gce.py
31
# 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 us...
zefredzocohen1/maps-ci
refs/heads/master
public1/assets/plugins/ionicons/builder/generate.py
357
from subprocess import call import os import json BUILDER_PATH = os.path.dirname(os.path.abspath(__file__)) ROOT_PATH = os.path.join(BUILDER_PATH, '..') FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts') CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css') SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss') LESS_FOLDER_...
gengue/django
refs/heads/master
tests/forms_tests/tests/test_fields.py
5
# -*- coding: utf-8 -*- """ ########## # Fields # ########## Each Field class does some sort of validation. Each Field has a clean() method, which either raises django.forms.ValidationError or returns the "clean" data -- usually a Unicode object, but, in some rare cases, a list. Each Field's __init__() takes at least...
taaviteska/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex/3_squashed_5.py
266
from django.db import migrations class Migration(migrations.Migration): replaces = [ ("migrations", "3_auto"), ("migrations", "4_auto"), ("migrations", "5_auto"), ] dependencies = [("migrations", "2_auto")] operations = [ migrations.RunPython(migrations.RunPython.noo...
patochectp/navitia
refs/heads/dev
source/tyr/tests/tests_default_settings.py
5
import os # Path to the directory where the configuration file of each instance of ed are defined INSTANCES_DIR = os.path.join(os.path.dirname(__file__), 'fixtures') # Validate the presence of a mx record on the domain EMAIL_CHECK_MX = False # Validate the email by connecting to the smtp server, but doesn't send an ...
axelkennedal/dissen
refs/heads/master
dissenEnv/lib/python3.5/site-packages/django/core/management/sql.py
399
from __future__ import unicode_literals from django.apps import apps from django.db import models def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_cascade=False): """ Returns a list of the SQL statements used to flush the database. If only_django is True, then only table n...
sridevikoushik31/openstack
refs/heads/T11906
nova/tests/test_libvirt_vif.py
7
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 Nicira, 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 #...
philipbl/home-assistant
refs/heads/dev
homeassistant/components/sensor/glances.py
4
""" Support gathering system information of hosts which are running glances. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.glances/ """ import logging from datetime import timedelta import requests import voluptuous as vol from homeassistant.co...
marcelometal/thumbor
refs/heads/master
thumbor/detectors/local_detector.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from os.path import join, dirname, abspath, isabs import cv2 import...
githubutilities/LeetCode
refs/heads/master
Python/plus-one.py
3
# Time: O(n) # Space: O(1) # # Given a non-negative number represented as an array of digits, plus one to the number. # # The digits are stored such that the most significant digit is at the head of the list. class Solution: """ :type digits: List[int] :rtype: List[int] """ def plusOne(self, dig...
arenadata/bigtop
refs/heads/branch-adh-2.0
bigtop-packages/src/charm/hadoop/layer-hadoop-plugin/reactive/apache_bigtop_plugin.py
12
# 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...
technologiescollege/s2a_fr
refs/heads/portable
s2a/Python/Lib/test/test_atexit.py
135
import sys import unittest import StringIO import atexit from imp import reload from test import test_support class TestCase(unittest.TestCase): def setUp(self): s = StringIO.StringIO() self.save_stdout = sys.stdout self.save_stderr = sys.stderr sys.stdout = sys.stderr = self.subst_...
eonpatapon/neutron
refs/heads/master
neutron/plugins/embrane/plugins/embrane_ml2_plugin.py
59
# Copyright 2014 Embrane, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
mmetak/streamlink
refs/heads/master
src/streamlink/packages/requests_file.py
6
""" Copyright 2015 Red Hat, 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 wri...
humanitiesplusdesign/athanasius_old
refs/heads/master
wsgi-scripts/config_example.py
1
host = "localhost" user = "ourbricks_user" database = "rofl" pw = "foobar"
edx/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/test_footer.py
4
""" Tests related to the basic footer-switching based off SITE_NAME to ensure edx.org uses an edx footer but other instances use an Open edX footer. """ import unittest from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from openedx.core.djangoapps.them...
kiwicopple/MyMDb
refs/heads/master
venv/Lib/site-packages/docutils/writers/odf_odt/pygmentsformatter.py
244
# $Id: pygmentsformatter.py 5853 2009-01-19 21:02:02Z dkuhlman $ # Author: Dave Kuhlman <dkuhlman@rexx.com> # Copyright: This module has been placed in the public domain. """ Additional support for Pygments formatter. """ import pygments import pygments.formatter class OdtPygmentsFormatter(pygments.formatter.For...
macopedia/hr
refs/heads/8.0
__unported__/hr_expense_sequence/__init__.py
14
# -*- encoding: utf-8 -*- ############################################################################## # # HR Expense Sequence module for OpenERP # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you can red...
paran0ids0ul/infernal-twin
refs/heads/master
build/pillow/Tests/test_lib_pack.py
11
from helper import unittest, PillowTestCase, py3 from PIL import Image class TestLibPack(PillowTestCase): def pack(self): pass # not yet def test_pack(self): def pack(mode, rawmode): if len(mode) == 1: im = Image.new(mode, (1, 1), 1) else: ...
google/earthengine-api
refs/heads/master
python/ee/tests/apifunction_test.py
1
#!/usr/bin/env python """Test for the ee.apifunction module.""" import types import unittest import ee from ee import apitestcase class ApiFunctionTest(apitestcase.ApiTestCase): def testAddFunctions(self): """Verifies that addition of static and instance API functions.""" # Check instance vs static ...
anirudhSK/chromium
refs/heads/master
tools/perf/metrics/speedindex_unittest.py
3
# 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. # These tests access private methods in the speedindex module. # pylint: disable=W0212 import json import os import unittest from telemetry.core import bit...
EasonYi/zulip
refs/heads/master
zerver/test_events.py
116
# -*- coding: utf-8 -*- from django.test import TestCase from zerver.models import ( get_client, get_realm, get_stream, get_user_profile_by_email, Message, Recipient, ) from zerver.lib.actions import ( apply_events, create_stream_if_needed, do_add_alert_words, do_add_realm_emoji, do_add_re...
softmixt/grayscale
refs/heads/master
grayscale/__init__.py
1
from grayscale.core.processor import Processor
droolsjbpm/drools
refs/heads/master
drools-decisiontables/src/main/resources/python-dt/pydt_test.py
44
import pydt test_fact = { "Age" : 42, "Risk" : "'HIGH'", "PolicyType" : "'COMPREHENSIVE'" } test_table = { "condition_headers" : [ ["A" , "Age"], ["B", "Risk =="], ["C", "PolicyType =="]], "action_headers" : [ ["F","Premium"], ["G","Log"]], "data" : [ {"row" : 2, "A" : "> 2", "B" : "'HIGH'", "C"...
ShassAro/ShassAro
refs/heads/master
Bl_project/blVirtualEnv/lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/storage.py
85
from datetime import datetime from importlib import import_module import os import tempfile from django.http import HttpRequest, HttpResponse from django.conf import settings from django.contrib.auth.models import User from django.core.files.storage import FileSystemStorage from django.core.files.uploadedfile import S...
mayk93/CLRS
refs/heads/master
Algorithms/QuickSelect-Example.py
1
''' Taken from Rosseta - http://rosettacode.org/wiki/Quickselect_algorithm#Python Not my code. Educational purposes. ''' import random def partition(vector, left, right, pivotIndex): pivotValue = vector[pivotIndex] vector[pivotIndex], vector[right] = vector[right], vector[pivotIndex] # Move pivot to end ...
gomyhr/elveg2osm
refs/heads/master
elveg2osm.py
1
#! /usr/bin/env python2 import sys import os import osmapis import csv import numpy as np import geographiclib.geodesic as gg import collections # Add useful (for our purpose) methods to the osmapis.OSM class class ElvegOSM(osmapis.OSM): def __init__(self, items=()): # First call the parent's __init__ ...
DavisDevelopment/app_engine_demo
refs/heads/master
lib/werkzeug/testsuite/routing.py
145
# -*- coding: utf-8 -*- """ werkzeug.testsuite.routing ~~~~~~~~~~~~~~~~~~~~~~~~~~ Routing tests. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug import routing as r from werkzeu...
weaver-viii/h2o-3
refs/heads/master
h2o-py/tests/testdir_algos/gbm/pyunit_irisGBM.py
3
import sys sys.path.insert(1, "../../../") import h2o ###################################################### # # Sample Running GBM on iris_wheader.csv def irisGBM(ip,port): # Connect to a pre-existing cluster # connect to localhost:54321 # Import training data train = h2o.import_file(path=h2o.locate("smal...
FatBumbleee/namebench
refs/heads/master
nb_third_party/dns/rrset.py
215
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
herilalaina/scikit-learn
refs/heads/master
sklearn/linear_model/logistic.py
2
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> # Lars Buitinck # Simon Wu <s8wu@uwaterloo.ca> # ...
jrief/django-filer
refs/heads/serialize-payload
filer/utils/files.py
10
#-*- coding: utf-8 -*- from __future__ import unicode_literals import os from django.utils.text import get_valid_filename as get_valid_filename_django from django.template.defaultfilters import slugify from django.core.files.uploadedfile import SimpleUploadedFile class UploadException(Exception): pass def hand...
TeamWin/kernel_samsung_lt02ltetmo
refs/heads/android-4.4
tools/perf/util/setup.py
4998
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
talishte/ctigre
refs/heads/master
env/lib/python2.7/site-packages/mezzanine/pages/defaults.py
56
""" Default settings for the ``mezzanine.pages`` app. Each of these can be overridden in your project's settings module, just like regular Django settings. The ``editable`` argument for each controls whether the setting is editable via Django's admin. Thought should be given to how a setting is actually used before ma...
Donkyhotay/MoonPy
refs/heads/master
zope/publisher/tests/basetestiapplicationrequest.py
1
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation 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. # T...
elsigh/browserscope
refs/heads/master
third_party/mox/mox.py
9
#!/usr/bin/python2.4 # # Copyright 2008 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...
relekang/accio
refs/heads/master
accio/deployments/apps.py
1
from django.apps import AppConfig class DeploymentsConfig(AppConfig): name = 'accio.deployments'
JoelBondurant/RandomCodeSamples
refs/heads/master
python/routeCounter.py
1
f = open("routes.txt","rt") maxLen = 0 for x in f: rtes = x.split("\t")[2] a = len(rtes) b = len(rtes.replace(",","")) c = a - b if (c > maxLen): maxLen = c print(maxLen) f.close()
jnerin/ansible
refs/heads/devel
lib/ansible/modules/clustering/k8s/k8s_scale.py
12
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Chris Houseknecht <@chouseknecht> # 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', ...
BadlybadGames/RPGame-3.0
refs/heads/master
src/entity/projectiles.py
1
import math import constants import entity from cocos import collision_model as cm from cocos.euclid import Vector2 import game import util class Projectile(entity.WorldEntity): image = "arrow.png" etype = "projectile" name = "Projectile" friendly = False mask_collision = 0b000 mask_event = ...
gtema/homeautomation-backend
refs/heads/master
homeautomation/schemas.py
1
from marshmallow import fields, ValidationError from flask_marshmallow import Marshmallow from .models import User, Role, StockProductCategory, StockProduct,\ StockProductItem ma = Marshmallow() def must_not_be_blank(data): if not data: raise ValidationError('Data not provided') class UserSchema(m...
lgscofield/odoo
refs/heads/8.0
openerp/tests/addons/test_translation_import/tests/test_term_count.py
323
# -*- coding: utf-8 -*- import openerp from openerp.tests import common class TestTermCount(common.TransactionCase): def test_count_term(self): """ Just make sure we have as many translation entries as we wanted. """ openerp.tools.trans_load(self.cr, 'test_translation_import/i18n/...
clouserw/zamboni
refs/heads/master
mkt/translations/tests/test_widgets.py
19
from nose.tools import eq_ from pyquery import PyQuery as pq import mkt.site.tests from mkt.translations import models, widgets class TestWidget(mkt.site.tests.TestCase): def test_avoid_purified_translation(self): # Even if we pass in a LinkifiedTranslation the widget switches to a # normal Tran...
tiexinliu/odoo_addons
refs/heads/8.0
smile_scm/tools/osutil.py
5
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
alogg/dolfin
refs/heads/master
demo/pde/subdomains-poisson/python/demo_subdomains-poisson.py
3
# Copyright (C) 2011 Marie E. Rognes # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
robbiet480/home-assistant
refs/heads/dev
tests/components/ssdp/test_init.py
5
"""Test the SSDP integration.""" import asyncio from unittest.mock import Mock, patch import aiohttp import pytest from homeassistant.components import ssdp from homeassistant.generated import ssdp as gn_ssdp from tests.common import mock_coro async def test_scan_match_st(hass): """Test matching based on ST.""...
Vassy/odoo
refs/heads/master
addons/purchase/wizard/__init__.py
439
# -*- 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...
tadebayo/myedge
refs/heads/master
myvenv/Lib/site-packages/packaging/requirements.py
140
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import string import re from pyparsing import stringStart, stringEnd, ori...
ngageoint/scale
refs/heads/master
scale/metrics/migrations/0009_revert_datetime.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2019-07-25 14:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('metrics', '0008_occurred_datetime'), ] operations = [ migrations.AlterFiel...
gibxxi/nzbToMedia
refs/heads/master
libs/requests/packages/urllib3/fields.py
1007
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
sunlianqiang/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/buffer_tests.py
91
# Tests that work for both bytes and buffer objects. # See PEP 3137. import struct import sys class MixinBytesBufferCommonTests(object): """Tests that work for both bytes and buffer objects. See PEP 3137. """ def marshal(self, x): """Convert x into the appropriate type for these tests.""" ...
xhochy/arrow
refs/heads/master
dev/archery/archery/benchmark/google.py
2
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
t-abe/chainer
refs/heads/master
chainer/function_set.py
5
import numpy import warnings from chainer import cuda from chainer import link class FunctionSet(link.Chain): """Set of links (as "parameterized functions"). FunctionSet is a subclass of :class:`~chainer.Chain`. Function registration is done just by adding an attribute to :class:` object. .. d...
mozilla/kuma
refs/heads/master
kuma/wiki/tests/test_models.py
1
import time from datetime import date, datetime, timedelta from unittest import mock from urllib.parse import urlparse from xml.sax.saxutils import escape import pytest from constance import config from constance.test import override_config from django.conf import settings from django.core.exceptions import Validation...
samuelmaudo/yepes
refs/heads/master
yepes/utils/unidecode/x061.py
252
data = ( 'Qiao ', # 0x00 'Chou ', # 0x01 'Bei ', # 0x02 'Xuan ', # 0x03 'Wei ', # 0x04 'Ge ', # 0x05 'Qian ', # 0x06 'Wei ', # 0x07 'Yu ', # 0x08 'Yu ', # 0x09 'Bi ', # 0x0a 'Xuan ', # 0x0b 'Huan ', # 0x0c 'Min ', # 0x0d 'Bi ', # 0x0e 'Yi ', # 0x0f 'Mian ', # 0x10 'Yon...
ddzialak/boto
refs/heads/develop
boto/ec2/spotdatafeedsubscription.py
152
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
MaryanMorel/faker
refs/heads/master
faker/providers/phone_number/sl_SI/__init__.py
21
from __future__ import unicode_literals from .. import Provider as PhoneNumberProvider class Provider(PhoneNumberProvider): formats = ( '040 ### ###', '041 ### ###', '031 ### ###', '030 ### ###', '070 ### ###', '01 #### ###', '02 #### ###', '04 #### ...
valdecdev/odoo
refs/heads/master
addons/payment_transfer/__init__.py
616
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import models import controllers
theonion/django-bulbs
refs/heads/master
bulbs/utils/fields.py
1
from rest_framework import serializers class RichTextField(serializers.CharField): def __init__(self, *args, **kwargs): self.field_size = kwargs.pop("field_size", None) super(RichTextField, self).__init__(*args, **kwargs)
40223236/2015cd_midterm_1
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/copy.py
628
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
Changaco/oh-mainline
refs/heads/master
vendor/packages/twisted/doc/historic/2003/pycon/deferex/deferex-listing2.py
40
def successCallback(result): myResult = result + 1 print myResult return myResult ... adder.callRemote("add", 1, 1).addCallback(successCallback)
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/pydocfodder.py
195
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
ValFadeev/ansible-modules-core
refs/heads/devel
cloud/rackspace/rax_queue.py
157
#!/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...
bert9bert/statsmodels
refs/heads/master
statsmodels/sandbox/tsa/examples/try_ld_nitime.py
34
'''Levinson Durbin recursion adjusted from nitime ''' from statsmodels.compat.python import range import numpy as np from statsmodels.tsa.stattools import acovf def levinson_durbin_nitime(s, order=10, isacov=False): '''Levinson-Durbin recursion for autoregressive processes ''' #from nitime ## if sx...
dataewan/deep-learning
refs/heads/master
tv-script-generation/problem_unittests.py
68
import numpy as np import tensorflow as tf from tensorflow.contrib import rnn def _print_success_message(): print('Tests Passed') def test_create_lookup_tables(create_lookup_tables): with tf.Graph().as_default(): test_text = ''' Moe_Szyslak Moe's Tavern Where the elite meet to drink ...
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/testData/optimizeImports/oneOfMultiple.after.py
84
import sys print sys.argv
maxive/erp
refs/heads/master
addons/purchase/tests/common.py
2
# -*- coding: utf-8 -*- from datetime import timedelta from odoo import fields from odoo.addons.stock.tests.common2 import TestStockCommon from odoo import tools from odoo.modules.module import get_module_resource class TestPurchase(TestStockCommon): def _create_make_procurement(self, product, product_qty, date...
786228836/linux
refs/heads/master
tools/perf/scripts/python/export-to-postgresql.py
293
# export-to-postgresql.py: export perf data to a postgresql database # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # Thi...
tbachman/group-based-policy
refs/heads/master
setup.py
463
#!/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...
Nic30/hwtLib
refs/heads/master
hwtLib/examples/arithmetic/vhdl_vector_auto_casts.py
1
from hwt.hdl.types.bits import Bits from hwt.interfaces.std import Signal from hwt.synthesizer.unit import Unit from hwtLib.examples.base_serialization_TC import BaseSerializationTC class VhdlVectorAutoCastExample(Unit): def _declr(self): std_logic = Bits(1) std_logic_vector_0 = Bits(1, force_vec...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-3.0/Lib/textwrap.py
1
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> __revision__ = "$Id: textwrap.py 63335 2008-05-16 00:03:33Z alexandre.vassalotti $" import string, re __all__ = ['TextWrapper', 'wrap', 'fill'...
Epirex/android_kernel_samsung_golden
refs/heads/kk4.4-2
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
SSG-DRD-IOT/commercial-iot-security-system
refs/heads/master
opencv/tutorials/gui/mouse/mouseEvents_advanced.py
1
import cv2 import numpy as np drawing = False # true if mouse is pressed mode = True # if True, draw rectangle. press 'm' to toggle to curve ix, iy = -1, -1 # mouse callback function def draw_shape(event, x, y, flags, param): global ix, iy, drawing, mode if event == cv2.EVENT_LBUTTONDOWN: drawing =...
efiring/scipy
refs/heads/master
scipy/spatial/__init__.py
24
""" ============================================================= Spatial algorithms and data structures (:mod:`scipy.spatial`) ============================================================= .. currentmodule:: scipy.spatial Nearest-neighbor Queries ======================== .. autosummary:: :toctree: generated/ ...
axsauze/eventsfinder
refs/heads/master
django/views/debug.py
99
from __future__ import unicode_literals import datetime import os import re import sys import types from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound, HttpRequest, build_request_repr) from d...
redbear/micropython
refs/heads/redbear-duo
tests/extmod/ure_split_empty.py
18
# test splitting with pattern matches that can be empty # # CPython 3.5 issues a FutureWarning for these tests because their # behaviour will change in a future version. MicroPython just stops # splitting as soon as an empty match is found. import ure as re r = re.compile(" *") s = r.split("a b c foobar") print...
charbeljc/hr
refs/heads/8.0
__unported__/hr_employee_state/__init__.py
23
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, eit...
lihui7115/ChromiumGStreamerBackend
refs/heads/master
chrome/tools/build/appid.py
186
#!/usr/bin/env python # Copyright (c) 2011 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. """ appid.py -- Chromium appid header file generation utility. """ import optparse import sys GENERATED_APPID_INCLUDE_FILE_CONTEN...
vuntz/glance
refs/heads/master
glance/tests/unit/v1/test_upload_utils.py
3
# Copyright 2013 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 requ...
GuidoZhang/PyVC
refs/heads/master
PyVC/env/Lib/posixpath.py
50
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, and is a...
uyaly/test
refs/heads/master
pageobject/account/Page_Account_SCEO_ADD.py
1
# coding:utf-8 from utils.ly_selenium import ly # 导入4.11二次封装的类 class Page_Account_SCEO_ADD(ly): '''超级总监新增''' # 新增界面输入项 loginid_loc = ("id", '_easyui_textbox_input1') password_loc = ("id", '_easyui_textbox_input5') password1_loc = ("id", '_easyui_textbox_input6') name_loc = ("id", '_easyui_tex...
pdee/pdee
refs/heads/master
python-libs/rope/refactor/functionutils.py
79
import rope.base.exceptions import rope.base.pyobjects from rope.base.builtins import Lambda from rope.base import worder class DefinitionInfo(object): def __init__(self, function_name, is_method, args_with_defaults, args_arg, keywords_arg): self.function_name = function_name sel...
xzoert/dedalus
refs/heads/master
dedalus/ui/requests/ResourceListRequest.py
1
from . import Request class ResourceListRequest(Request): def start(self,client,tagFilter,limit,timeout,pageSize,doneFunction,pageFunction): self.client=client self.tagFilter=tagFilter self.pageSize=pageSize self.limit=limit self.timeout=timeout self.resources=None self.doneFunction=doneFunction s...
jamesbeebop/CouchPotatoServer
refs/heads/master
couchpotato/core/plugins/userscript/__init__.py
81
from .main import Userscript def autoload(): return Userscript()
adw0rd/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/contrib/gis/db/backends/spatialite/models.py
403
""" The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. """ from django.db import models from django.contrib.gis.db.backends.base import SpatialRefSysMixin class GeometryColumns(models.Model): """ The 'geometry_columns' table from SpatiaLite. """ f_table_name = models.CharField(ma...
hellfu/ns3-mestrado
refs/heads/master
wutils.py
47
import os import os.path import re import sys import subprocess import shlex # WAF modules from waflib import Options, Utils, Logs, TaskGen, Build, Context from waflib.Errors import WafError # these are set from the main wscript file APPNAME=None VERSION=None bld=None def get_command_template(env, arguments=()): ...
urban48/debpackager
refs/heads/master
debpackager/packages/general/general.py
1
from debpackager.packages.general_package import GeneralPackage class General(GeneralPackage): def __init__(self, kwargs): super(General, self).__init__(**kwargs)
msebire/intellij-community
refs/heads/master
python/helpers/pydev/tests_pydevd_python/test_debugger.py
6
''' The idea is that we record the commands sent to the debugger and reproduce them from this script (so, this works as the client, which spawns the debugger as a separate process and communicates to it as if it was run from the outside) Note that it's a python script but it'll spawn a process to run a...
tartavull/google-cloud-python
refs/heads/master
speech/google/__init__.py
194
# Copyright 2016 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 or agreed to in writing, ...
GREO/gnuradio-git
refs/heads/master
gnuradio-core/src/python/gnuradio/gruimpl/crc.py
12
# # Copyright 2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later versi...
nurav/balrog
refs/heads/master
auslib/util/timestamp.py
5
import time def getMillisecondTimestamp(): t = int(time.time() * 1000) return t
nlloyd/SubliminalCollaborator
refs/heads/master
libs/twisted/lore/docbook.py
60
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ DocBook output support for Lore. """ import os, cgi from xml.dom import minidom as dom from twisted.lore import latex class DocbookSpitter(latex.BaseLatexSpitter): currentLevel = 1 def writeNodeData(self, node): self.writ...
LLNL/spack
refs/heads/develop
var/spack/repos/builtin/packages/interproscan/package.py
3
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Interproscan(Package): """InterProScan is the software package that allows sequences ...
backupchecker/backupchecker
refs/heads/master
backupchecker/generatelist/generatelistfortar.py
1
# -*- coding: utf-8 -*- # Copyright © 2015-2017 Carl Chenet <chaica@backupcheckerproject.org> # 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 # any later vers...
minrk/sympy
refs/heads/master
sympy/simplify/epathtools.py
6
"""Tools for manipulation of expressions using paths. """ from sympy.core import Basic class EPath(object): """ Manipulate expressions using paths. EPath grammar in EBNF notation:: literal ::= /[A-Za-z_][A-Za-z_0-9]*/ number ::= /-?\d+/ type ::= literal attribut...
jendap/tensorflow
refs/heads/master
tensorflow/contrib/slim/python/slim/nets/vgg_test.py
25
# 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...
Seinlin/nv7fire-external-chromium
refs/heads/master
testing/gtest/scripts/upload_gtest.py
1963
#!/usr/bin/env python # # Copyright 2009, 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...
paweljasinski/ironpython3
refs/heads/master
Src/StdLib/Lib/concurrent/futures/__init__.py
247
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Execute computations asynchronously using threads or processes.""" __author__ = 'Brian Quinlan (brian@sweetapp.com)' from concurrent.futures._base import (FIRST_COMPLETED, FI...