repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
gkawamoto/yowsup
refs/heads/master
yowsup/demos/sendclient/stack.py
9
from yowsup.stacks import YowStack from .layer import SendLayer from yowsup.layers import YowLayerEvent from yowsup.layers.auth import YowCryptLayer, YowAuthenticationProtocolLayer, AuthError from yowsup.layers.coder import YowCoderLayer from yowsup.layers.network ...
kingosticks/mopidy
refs/heads/develop
tests/models/test_legacy.py
4
import unittest from mopidy.models import ImmutableObject class Model(ImmutableObject): uri = None name = None models = frozenset() def __init__(self, *args, **kwargs): self.__dict__["models"] = frozenset(kwargs.pop("models", None) or []) super().__init__(self, *args, **kwargs) cla...
spirosmastorakis/ns-3-dev-ndnSIM
refs/heads/master
doc/models/source/conf.py
90
# -*- coding: utf-8 -*- # # ns-3 documentation build configuration file, created by # sphinx-quickstart on Tue Dec 14 09:00:39 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
codrut3/tensorflow
refs/heads/master
tensorflow/contrib/model_pruning/python/learning.py
32
# 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...
BCVisin/PhotoViewer
refs/heads/master
app_motion.py
1
from Tkinter import * import random import get_photos class MyApp(Tk): def __init__(self): Tk.__init__(self) #self.attributes('-zoomed', True) self.configure(bg='black') self.attributes("-fullscreen", True) self.configure(cursor="none") self.move_counter = 0 self.play_show = True self.screen_w...
gboudreau/CouchPotato
refs/heads/master
library/sqlalchemy/queue.py
18
"""An adaptation of Py2.3/2.4's Queue module which supports reentrant behavior, using RLock instead of Lock for its mutex object. This is to support the connection pool's usage of weakref callbacks to return connections to the underlying Queue, which can in extremely rare cases be invoked within the ``get()`` method o...
metarelate/metarelate
refs/heads/master
lib/metarelate/thread.py
1
# (C) British Crown Copyright 2015, Met Office # # This file is part of metarelate. # # metarelate 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 opt...
wesokes/django-query-builder
refs/heads/develop
querybuilder/tests/field_tests.py
2
import datetime from fleming import unix_time, floor from querybuilder.fields import SimpleField, LagDifferenceField, LeadDifferenceField, AllTime, SumField, Week from querybuilder.query import Query, QueryWindow from querybuilder.tests.models import Order from querybuilder.tests.query_tests import QueryTestCase cla...
caslei/TfModels
refs/heads/master
inception/inception/slim/scopes.py
28
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
edisonlz/fruit
refs/heads/master
web_project/base/site-packages/pygments/styles/emacs.py
75
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import ...
kaitheslayer/developingprojects
refs/heads/master
Iris/Main File.py
1
import re import win32com.client as wincl import pyowm import math ans = '' preans = '' def tr(x): return { 'how are you': 'speak("I do not feel emotions.")', 'add': 'add(ine)', 'multiply': 'multiply(ine)', 'divide': 'divide(ine)', 'power': 'po(ine)', 'minus': 'minu...
ThinkboxSoftware/Deadline
refs/heads/master
Custom/events/Zabbix/API/requests/packages/urllib3/util/connection.py
1
import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dropped(conn): ...
JioEducation/edx-platform
refs/heads/master
lms/djangoapps/instructor_analytics/tests/test_distributions.py
165
""" Tests for analytics.distributions """ from django.test import TestCase from nose.tools import raises from student.models import CourseEnrollment from student.tests.factories import UserFactory from opaque_keys.edx.locations import SlashSeparatedCourseKey from instructor_analytics.distributions import profile_dist...
vipul-sharma20/oh-mainline
refs/heads/master
vendor/packages/kombu/funtests/tests/test_sqla.py
30
from nose import SkipTest from funtests import transport class test_sqla(transport.TransportCase): transport = 'sqlalchemy' prefix = 'sqlalchemy' event_loop_max = 10 connection_options = {'hostname': 'sqla+sqlite://'} def before_connect(self): try: import sqlalchemy # noqa ...
dchud/sentinel
refs/heads/master
canary/ui/stats/__init__.py
1
# $Id$ _q_exports = [ '_q_index', 'query', ] from quixote.errors import AccessError from canary.qx_defs import NotLoggedInError from canary.ui.stats import stats_ui _q_index = stats_ui._q_index query = stats_ui.query def _q_access (request): if request.session.user == None: raise NotLoggedI...
P1sec/suricata
refs/heads/master
rust/gen-c-headers.py
2
#! /usr/bin/env python2 # This script will scan Rust source files looking for extern "C" # functions and generate C header files from them with a filename # based on the Rust filename. # # Usage: From the top suricata source directory: # # ./rust/gen-c-headers.py # from __future__ import print_function import sys...
robovm/robovm-studio
refs/heads/master
python/testData/addImport/newFirstImportInProjectGroupWithExistingBlankLineAbove/main.py
75
import sys import b print(sys, a, b)
iulian787/spack
refs/heads/develop
var/spack/repos/builtin/packages/admixtools/package.py
2
# 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 Admixtools(MakefilePackage): """The ADMIXTOOLS package implements 5 methods described in ...
gurneyalex/hr
refs/heads/8.0
__unported__/hr_worked_days_hourly_rate/tests/test_hr_worked_days.py
28
# -*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2014 Odoo Canada. 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 # ...
rhertzog/django
refs/heads/master
tests/test_client/auth_backends.py
315
from django.contrib.auth.backends import ModelBackend class TestClientBackend(ModelBackend): pass
cielpy/shadowsocks
refs/heads/master
shadowsocks/shell.py
652
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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 b...
Azure/azure-linux-extensions
refs/heads/master
DSC/httpclientfactory.py
5
#!/usr/bin/env python2 # # Copyright (C) Microsoft Corporation, All rights reserved. import os from curlhttpclient import CurlHttpClient from urllib2httpclient import Urllib2HttpClient PY_MAJOR_VERSION = 0 PY_MINOR_VERSION = 1 PY_MICRO_VERSION = 2 class HttpClientFactory: """Factory which returns the appropria...
google/mirandum
refs/heads/master
alerts/extralife/apps.py
1
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
EricSekyere/python
refs/heads/master
Silocean/0010/Test.py
37
__author__ = 'Tracy' import Image,ImageDraw,ImageFont,ImageFilter import random image = Image.new('RGB', (50*4, 50), (255,255,255)) font = ImageFont.truetype('DejaVuSansMono.ttf', 24) draw = ImageDraw.Draw(image) def randColor(): return (random.randint(64,255), random.randint(64,255), random.randint(64,255)) d...
kalafut/finiki
refs/heads/master
finiki.py
1
#!/usr/bin/env python3 import os from collections import OrderedDict from contextlib import contextmanager from flask import Flask, redirect, render_template, request import jinja2 import mistune app = Flask(__name__) markdown = mistune.Markdown(hard_wrap=True) try: ROOT = os.environ['FINIKI_ROOT'] except KeyEr...
SNeuhausen/training_management
refs/heads/master
models/concrete_degree/concrete_degree.py
1
# -*- coding: utf-8 -*- # /############################################################################# # # Stephan Neuhausen. # Copyright (C) 20014-TODAY Stephan Neuhausen iad.de. # # /############################################################################# from openerp import models, fields from openerp...
soerendip42/rdkit
refs/heads/master
rdkit/VLib/NodeLib/__init__.py
6
__all__=['SmartsMolFilter','SDSupply','SmartsRemover','SmilesDupeFilter', 'SmilesOutput']
SerpentCS/odoo
refs/heads/8.0
addons/l10n_es/__init__.py
307
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # 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 Fre...
VShangxiao/v2ex
refs/heads/master
mapreduce/operation/counters.py
21
#!/usr/bin/env python # # 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/licenses/LICENSE-2.0 # # Unless required by applicable law o...
yatish27/mase
refs/heads/master
python101/code/Tagger.py
14
"""This module contains code from Think Python by Allen B. Downey http://thinkpython.com Copyright 2012 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import math from Wobbler import * class Missed(Exception): """Exception raised when a turtle tries to tag someone too far away."""...
idovear/odoo
refs/heads/master
addons/website_livechat/models/website.py
380
from openerp.osv import osv, fields class website(osv.osv): _inherit = "website" _columns = { 'channel_id': fields.many2one('im_livechat.channel', string="Channel"), } class website_config_settings(osv.osv_memory): _inherit = 'website.config.settings' _columns = { 'channel_id': f...
dreamapplehappy/myblog
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/modeline.py
292
# -*- coding: utf-8 -*- """ pygments.modeline ~~~~~~~~~~~~~~~~~ A simple modeline parser (based on pymodeline). :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re __all__ = ['get_filetype_from_buffer'] modeline_re = re.compil...
npiganeau/odoo
refs/heads/master
addons/product_email_template/__openerp__.py
65
# -*- coding: utf-8 -*- { 'name': 'Product Email Template', 'depends': ['account'], 'author': 'OpenERP SA', 'category': 'Accounting & Finance', 'description': """ Add email templates to products to be send on invoice confirmation ================================================================== W...
markroxor/gensim
refs/heads/develop
gensim/models/atmodel.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2016 Radim Rehurek <[email protected]> # Copyright (C) 2016 Olavur Mortensen <[email protected]> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Author-topic model in Python. This module trains the author-topi...
ihsanudin/odoo
refs/heads/8.0
addons/portal_gamification/__init__.py
381
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
product-owner/2015scrum
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/binascii.py
620
"""A pure Python implementation of binascii. Rather slow and buggy in corner cases. PyPy provides an RPython version too. """ # borrowed from https://bitbucket.org/pypy/pypy/src/f2bf94943a41/lib_pypy/binascii.py class Error(Exception): pass class Done(Exception): pass class Incomplete(Exception): pass ...
rbian/virt-test
refs/heads/master
virttest/bootstrap.py
2
import logging import os import glob import shutil from autotest.client.shared import logging_manager, error from autotest.client import utils import utils_misc import data_dir import asset import cartesian_config import utils_selinux import defaults basic_program_requirements = ['7za', 'tcpdump', 'nc', 'ip', 'arping'...
hy-2013/scrapy
refs/heads/master
scrapy/utils/sitemap.py
146
""" Module for processing Sitemaps. Note: The main purpose of this module is to provide support for the SitemapSpider, its API is subject to change without notice. """ import lxml.etree class Sitemap(object): """Class to parse Sitemap (type=urlset) and Sitemap Index (type=sitemapindex) files""" def __in...
anorfleet/turntable
refs/heads/master
test/lib/python2.7/site-packages/scipy/stats/tests/test_fit.py
22
from __future__ import division, print_function, absolute_import import os import numpy as np from numpy.testing import dec from scipy import stats from test_continuous_basic import distcont # this is not a proper statistical test for convergence, but only # verifies that the estimate and true values don't differ ...
theonlynexus/gui2py
refs/heads/master
gui/controls/combobox.py
14
#!/usr/bin/python # -*- coding: utf-8 -*- "gui2py's ComboBox control (uses wx.ComboBox - wx.Choice is not used by now)" __author__ = "Mariano Reingart ([email protected])" __copyright__ = "Copyright (C) 2013- Mariano Reingart" # where applicable # Initial implementation was based on PythonCard's ComboBox c...
1stsetup/Marlin
refs/heads/Michel
buildroot/share/PlatformIO/scripts/mks_robin.py
10
import os Import("env") # Relocate firmware from 0x08000000 to 0x08007000 for define in env['CPPDEFINES']: if define[0] == "VECT_TAB_ADDR": env['CPPDEFINES'].remove(define) env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mk...
111pontes/ydk-py
refs/heads/master
cisco-ios-xe/ydk/models/cisco_ios_xe/_meta/_CISCO_IETF_FRR_MIB.py
1
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
Yoric/servo
refs/heads/master
tests/wpt/css-tests/tools/sslutils/pregenerated.py
470
class PregeneratedSSLEnvironment(object): """SSL environment to use with existing key/certificate files e.g. when running on a server with a public domain name """ ssl_enabled = True def __init__(self, logger, host_key_path, host_cert_path, ca_cert_path=None): self._ca_cert...
gorjuce/odoo
refs/heads/8.0
addons/payment_transfer/models/__init__.py
437
# -*- coding: utf-8 -*- import payment_acquirer
pocketbook-free/kernel_613
refs/heads/master
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <[email protected]> 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 ...
bop/rango
refs/heads/master
lib/python2.7/site-packages/django/contrib/messages/tests/middleware.py
556
from django import http from django.contrib.messages.middleware import MessageMiddleware from django.utils import unittest class MiddlewareTest(unittest.TestCase): def setUp(self): self.middleware = MessageMiddleware() def test_response_without_messages(self): """ Makes sure that the...
mahak/ansible
refs/heads/devel
hacking/build_library/build_ansible/errors.py
63
# coding: utf-8 # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type class DependencyError(Exception): """A depende...
sklnet/openhdf-enigma2
refs/heads/master
lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
21
from Plugins.Plugin import PluginDescriptor from GraphMultiEpg import GraphMultiEPG from Screens.ChannelSelection import BouquetSelector from enigma import eServiceCenter, eServiceReference from ServiceReference import ServiceReference from Screens.Screen import Screen from Components.ActionMap import ActionMap from Co...
fabianofranz/docker-registry
refs/heads/master
docker_registry/lib/rqueue.py
35
# -*- coding: utf-8 -*- # this module is a slight modification of Ted Nyman's QR # https://raw.github.com/tnm/qr/master/qr.py import logging from docker_registry.core import compat json = compat.json class NullHandler(logging.Handler): """A logging handler that discards all logging records.""" def emit(sel...
rollbar/pyrollbar
refs/heads/master
rollbar/test/starlette_tests/__init__.py
3
import sys import unittest2 def _load_tests(loader, tests, pattern): return unittest2.TestSuite() if sys.version_info < (3, 6): load_tests = _load_tests
geraintpalmer/ASQ
refs/heads/master
asq/tests/test_data_record.py
2
import unittest import asq class TestDataRecord(unittest.TestCase): def test_init_method(self): r = asq.DataRecord(2, 3, 2, 8, 1, 2) self.assertEqual(r.arrival_date, 2) self.assertEqual(r.wait, 0) self.assertEqual(r.service_start_date, 2) self.assertEqual(r.service_time, 3)...
rexshihaoren/algorithms
refs/heads/master
docs/conf.py
5
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # algorithms documentation build configuration file, created by # sphinx-quickstart on Thu Oct 8 22:36:00 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this #...
strint/tensorflow
refs/heads/master
tensorflow/python/debug/wrappers/framework.py
4
# 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...
llvm-mirror/openmp
refs/heads/master
runtime/test/affinity/format/check.py
13
import os import sys import argparse import re class Checks(object): class CheckError(Exception): pass def __init__(self, filename, prefix): self.checks = [] self.lines = [] self.check_no_output = False self.filename = filename self.prefix = prefix def readS...
rafaeldelucena/waterbutler
refs/heads/develop
waterbutler/providers/figshare/settings.py
7
try: from waterbutler import settings except ImportError: settings = {} config = settings.get('FIGSHARE_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'http://api.figshare.com/v1/my_data') VIEW_URL = config.get('VIEW_URL', 'http://figshare.com/')
detrout/pykolab
refs/heads/master
pykolab/cli/telemetry/cmd_examine_session.py
1
# -*- coding: utf-8 -*- # Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com) # # Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com> # # 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...
gstiebler/odemis
refs/heads/master
src/odemis/util/driver.py
1
# -*- coding: utf-8 -*- ''' Created on 5 Mar 2013 @author: Éric Piel Copyright © 2013 Éric Piel, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Odemis i...
mozilla/stoneridge
refs/heads/master
python/src/Doc/includes/sqlite3/collation_reverse.py
44
import sqlite3 def collate_reverse(string1, string2): return -cmp(string1, string2) con = sqlite3.connect(":memory:") con.create_collation("reverse", collate_reverse) cur = con.cursor() cur.execute("create table test(x)") cur.executemany("insert into test(x) values (?)", [("a",), ("b",)]) cur.execute("select x f...
WilliamYi96/Machine-Learning
refs/heads/master
LeetCode/0012.py
1
# Greedy algorithm class Solution: def intToRoman(self, num): nums = [1000,900, 500,400, 100, 90, 50, 40, 10, 9, 5, 4, 1 ] symbols = ['M', 'CM','D','CD','C','XC','L','XL','X','IX','V','IV','I'] mstr = '' for i in range(len(nums)): while num >= nums[i]: ...
google/llvm-propeller
refs/heads/bb-clusters
compiler-rt/test/sanitizer_common/android_commands/android_common.py
14
import os, sys, subprocess, tempfile import time ANDROID_TMPDIR = '/data/local/tmp/Output' ADB = os.environ.get('ADB', 'adb') verbose = False if os.environ.get('ANDROID_RUN_VERBOSE') == '1': verbose = True def host_to_device_path(path): rel = os.path.relpath(path, "/") dev = os.path.join(ANDROID_TMPDIR, ...
ttingchan/MerchanDolibarr
refs/heads/master
htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.py
157
# # jQuery File Tree # Python/Django connector script # By Martin Skou # import os import urllib def dirlist(request): r=['<ul class="jqueryFileTree" style="display: none;">'] try: r=['<ul class="jqueryFileTree" style="display: none;">'] d=urllib.unquote(request.POST.get('dir','c:\\temp')) f...
CodeDJ/qt5-hidpi
refs/heads/master
qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/runtests.py
121
# Copyright (C) 2010 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 of conditions and the ...
GoogleCloudPlatform/training-data-analyst
refs/heads/master
courses/machine_learning/deepdive2/structured/labs/serving/application/lib/werkzeug/wrappers/common_descriptors.py
10
from datetime import datetime from datetime import timedelta from .._compat import string_types from ..datastructures import CallbackDict from ..http import dump_age from ..http import dump_header from ..http import dump_options_header from ..http import http_date from ..http import parse_age from ..http import parse_...
Fl0rianFischer/sme_odoo
refs/heads/9.0
addons/mail_tip/__openerp__.py
19
# Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Mail Tips', 'category': 'Usability', 'description': """ OpenERP link module for web tips. ================================= """, 'version': '0.1', 'depends': ['web_tip', 'mail'], 'data': [ 'views/mail_...
socialwareinc/Diamond
refs/heads/master
src/collectors/smart/smart.py
56
# coding=utf-8 """ Collect data from S.M.A.R.T.'s attribute reporting. #### Dependencies * [smartmontools](http://sourceforge.net/apps/trac/smartmontools/wiki) """ import diamond.collector import subprocess import re import os from diamond.collector import str_to_bool class SmartCollector(diamond.collector.Coll...
nachandr/cfme_tests
refs/heads/master
cfme/tests/intelligence/test_download_report.py
2
import pytest from cfme import test_requirements from cfme.infrastructure.provider import InfraProvider from cfme.markers.env_markers.provider import ONE from cfme.utils.appliance.implementations.ui import navigate_to pytestmark = [test_requirements.report] @pytest.fixture(scope="module") def report(appliance): ...
beck/django
refs/heads/master
tests/migrations/test_migrations_fake_split_initial/0001_initial.py
315
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True operations = [ migrations.CreateModel( "Author", [ ("id", models.AutoField(primary_key=True)), ...
ttthy1/2017sejongAI
refs/heads/master
week13/regression/Linear Regression Example(random data).py
2
import numpy as np import matplotlib.pyplot as plt num_points = 50 vector_set = [] for i in range(num_points): x1 = np.random.normal(0.0,0.55) y1 = x1 * 0.1 +0.3+np.random.normal(0.0,0.03) vector_set.append([x1,y1]) x_data = [v[0] for v in vector_set] y_data = [v[1] for v in vector_set] plt....
vrv/tensorflow
refs/heads/master
tensorflow/contrib/memory_stats/python/kernel_tests/memory_stats_ops_test.py
30
# 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...
yoer/hue
refs/heads/master
desktop/core/ext-py/Paste-2.0.1/paste/debug/wdg_validate.py
50
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ Middleware that tests the validity of all generated HTML using the `WDG HTML Validator <http://www.htmlhelp.com/tools/validator/>`_ """ from cStri...
djw8605/condor
refs/heads/add-force
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/sendAll.py
10
#! /s/python-2.5/i386_rhel5/bin/python # # Starts a Skype File Transfer. # The open file dialog is set to the current directory. # The users to send to are searched through their Skype name and their # full name (display name actually). # # Requires at least Skype 2.0.0.27. # # (c) Copyright 2007, Vincent Oberle, vince...
abo-abo/edx-platform
refs/heads/master
common/djangoapps/student/tests/test_auto_auth.py
11
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from util.testing import UrlResetMixin from mock import patch from django.core.urlresolvers import reverse, NoReverseMatch class AutoAuthEnabledTestCase(UrlResetMixin, TestCase): """ Tests for th...
veger/ansible
refs/heads/devel
lib/ansible/modules/remote_management/ucs/ucs_wwn_pool.py
46
#!/usr/bin/python # -*- coding: utf-8 -*- # 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': ['preview'], ...
Acidburn0zzz/servo
refs/heads/master
tests/wpt/web-platform-tests/webdriver/tests/perform_actions/key_modifiers.py
41
import pytest from tests.perform_actions.support.keys import Keys @pytest.mark.parametrize("modifier", [Keys.SHIFT, Keys.R_SHIFT]) def test_shift_modifier_and_non_printable_keys(session, key_reporter, key_chain, modifier): key_chain \ .send_keys("foo") \ .key_down(modifier) \ .key_down(Ke...
jamielennox/keystone
refs/heads/master
keystone/common/sql/migrate_repo/versions/054_add_actor_id_index.py
11
# Copyright 2014 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 by applicable law or agreed to in writing, s...
sxlijin/tfs_updater
refs/heads/master
lib/chardet/sjisprober.py
1776
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
adam111316/SickGear
refs/heads/master
lib/sqlalchemy/connectors/pyodbc.py
80
# connectors/pyodbc.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import Connector from .. import util import sys import re class PyODBC...
prakritish/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_snmp_community.py
19
#!/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 distribut...
TobiasMue/paparazzi
refs/heads/master
sw/tools/stm32loader/stm32loader.py
79
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:si:et:enc=utf-8 # Author: Ivan A-R <[email protected]> # Project page: http://tuxotronic.org/wiki/projects/stm32loader # # This file is part of stm32loader. # # stm32loader is free software; you can redistribute it and/or modify it under # the terms of ...
Murillo/Hackerrank-Algorithms
refs/heads/master
Data Structures/Trees/tree-height-of-a-binary-tree.py
1
# Tree: Height of a Binary Tree # Developer: Murillo Grubler # https://www.hackerrank.com/challenges/tree-height-of-a-binary-tree/problem # Time complexity: O(n) class Node: def __init__(self, info): self.info = info self.left = None self.right = None self.level = None d...
BorgERP/borg-erp-6of3
refs/heads/master
verticals/garage61/acy_stock_sent_number/__init__.py
1
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Acysos S.L. (http://acysos.com) All Rights Reserved. # Ignacio Ibeas <[email protected]> # $Id$ # # This program i...
DirtyUnicorns/android_external_chromium_org
refs/heads/lollipop
tools/update_reference_build.py
41
#!/usr/bin/env python # # Copyright (c) 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. """Updates the Chrome reference builds. Before running this script, you should first verify that you are authenticated for SVN. ...
Pexego/alimentacion
refs/heads/7.0
rappel_management/rappel.py
2
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved # $Marta Vázquez Rodríguez$ <[email protected]> # # This program is free software: you can redistribute it and/or modify # it unde...
afbarnard/esal
refs/heads/master
esal/test/stories_test.py
1
# Tests features from stories # # Copyright (c) 2015 Aubrey Barnard. This is free software. See # LICENSE for details. import itertools as itools import unittest from . import data from .. import engine from .. import events from .. import sequences from .. import streams # Selection predicates def _has_warfarin...
jvkops/titanium_mobile
refs/heads/master
support/common/simplejson/tests/test_check_circular.py
414
from unittest import TestCase import simplejson as json def default_iterable(obj): return list(obj) class TestCheckCircular(TestCase): def test_circular_dict(self): dct = {} dct['a'] = dct self.assertRaises(ValueError, json.dumps, dct) def test_circular_list(self): lst = [...
guymakam/Kodi-Israel
refs/heads/master
plugin.video.MakoTV/resources/lib/crypto/cipher/icedoll.py
7
# -*- coding: iso-8859-1 -*- """ crypto.cipher.icedoll Modification of Rijndael to provide infinite error extension. The ith round of Rijndael is tapped and used to process the subsequent block. Changes to base Rijndael are marked with: '# --------------------------' For Rijndael with N round...
saurabh6790/pow-app
refs/heads/master
utilities/doctype/address/templates/pages/addresses.py
60
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals no_cache = True
sparkslabs/kamaelia_
refs/heads/master
Sketches/PT/BouncingCatGame/likesprite.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License,...
jefftc/changlab
refs/heads/master
web2py/gluon/storage.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <[email protected]> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Provides: - List; like list but returns None instead of IndexOutOfBounds - Storage; like dictionary allowi...
baroquebobcat/pants
refs/heads/master
contrib/go/src/python/pants/contrib/go/tasks/go_compile.py
1
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import functools imp...
JetBrains/intellij-community
refs/heads/master
python/testData/codeInsight/controlflow/Assert.py
83
assert isinstance(s, basestring), isinstance(x, int)
sayoun/workalendar
refs/heads/master
workalendar/usa/nevada.py
1
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from workalendar.core import FRI from .core import UnitedStates class Nevada(UnitedStates): """Nevada""" include_thanksgiving_friday = True thanksgiving_friday_label = "Fam...
jeremycline/pulp
refs/heads/master
server/test/unit/server/managers/auth/user/test_cud.py
8
import mock from ..... import base from pulp.server.auth.ldap_connection import LDAPConnection from pulp.server.db.model.auth import User, Role from pulp.server.db.model.criteria import Criteria from pulp.server.managers import factory as manager_factory from pulp.server.managers.auth.cert.cert_generator import Serial...
rmk135/objects
refs/heads/master
examples/miniapps/django/githubnavigator/__init__.py
2
"""Project package.""" from .containers import Container from . import settings container = Container() container.config.from_dict(settings.__dict__)
goodwinnk/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/localflavor/se/utils.py
108
import re import datetime def id_number_checksum(gd): """ Calculates a Swedish ID number checksum, using the "Luhn"-algoritm """ n = s = 0 for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']): tmp = ((n % 2) and 1 or 2) * int(c) if tmp > 9: tmp = sum([int(...
fengbaicanhe/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/localflavor/se/utils.py
108
import re import datetime def id_number_checksum(gd): """ Calculates a Swedish ID number checksum, using the "Luhn"-algoritm """ n = s = 0 for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']): tmp = ((n % 2) and 1 or 2) * int(c) if tmp > 9: tmp = sum([int(...
itsjeyd/edx-platform
refs/heads/master
openedx/core/djangoapps/header_control/__init__.py
66
""" This middleware is used for adjusting the headers in a response before it is sent to the end user. This middleware is intended to sit as close as possible to the top of the middleare list as possible, so that it is one of the last pieces of middleware to touch the response, and thus can most accurately adjust/cont...
iamutkarshtiwari/sympy
refs/heads/master
sympy/utilities/magic.py
123
"""Functions that involve magic. """ from __future__ import print_function, division def pollute(names, objects): """Pollute the global namespace with symbols -> objects mapping. """ from inspect import currentframe frame = currentframe().f_back.f_back try: for name, obj in zip(names, objects...
horance-liu/tensorflow
refs/heads/master
tensorflow/contrib/linear_optimizer/python/kernel_tests/sdca_ops_test.py
76
# 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...
ml-lab/NAMAS
refs/heads/master
tuning/SDecoder_test.py
9
# # Copyright (c) 2015, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # Author: Alexander M R...