repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
2014c2g12/c2g12
refs/heads/master
c2wp/exts/w1/.leo_shadow/xc2_w1_python1.py
76
#@+leo-ver=4-thin #@+node:2014python.20140224210642.3167:@shadow c2_w1_python1.py #@-node:2014python.20140224210642.3167:@shadow c2_w1_python1.py #@-leo
damienmg/bazel
refs/heads/master
examples/py_native/bin.py
20
# pylint: disable=superfluous-parens """A tiny example binary for the native Python rules of Bazel.""" from examples.py_native.lib import GetNumber from fib import Fib print("The number is %d" % GetNumber()) print("Fib(5) == %d" % Fib(5))
andreafrancia/trash-cli
refs/heads/master
tests/list/test_trash_dirs_selector.py
1
import unittest from trashcli.list import TrashDirsSelector from trashcli.trash import trash_dir_found class TestTrashDirsSelector(unittest.TestCase): def setUp(self): self.selector = TrashDirsSelector(['current-user-dirs'], ['all-user-dirs']) def test_defau...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/s3/__init__.py
14
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 without res...
willingc/oh-mainline
refs/heads/master
vendor/packages/twisted/doc/web/examples/getpage.py
21
from twisted.internet import reactor from twisted.web.client import getPage from twisted.python.util import println import sys getPage(sys.argv[1]).addCallbacks( callback=lambda value:(println(value),reactor.stop()), errback=lambda error:(println("an error occurred", error),reactor.stop())) reactor.run()
gangadharkadam/office_erp
refs/heads/develop
erpnext/setup/doctype/item_group/test_item_group.py
40
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe from frappe.utils.nestedset import NestedSetRecursionError, NestedSetMultipleRootsError, \ NestedSetChildExistsError, ...
nekulin/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_future.py
56
# Test various flavors of legal and illegal future statements import unittest from test import test_support import re rx = re.compile('\((\S+).py, line (\d+)') def get_error_location(msg): mo = rx.search(str(msg)) return mo.group(1, 2) class FutureTest(unittest.TestCase): def test_future1(self): ...
kalail/gutter
refs/heads/master
gutter/client/encoding.py
3
# -*- coding: utf-8 -*- from __future__ import absolute_import # External Libraries from durabledict.encoding import PickleEncoding import jsonpickle as pickle class JsonPickleEncoding(PickleEncoding): @staticmethod def encode(data): return pickle.dumps(data) @staticmethod def decode(data):...
letsignit/azure-deploy
refs/heads/master
splunk-on-ubuntu/scripts/dobackup.py
119
#!/usr/bin/env python3 #      The MIT License (MIT) # #      Copyright (c) 2016 Microsoft. 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 without restr...
bourdibay/EbayAlertor
refs/heads/master
Alertor/Alerts/AlertsDiskIO.py
1
import json import os import uuid import pickle from Alerts.Alert import Alert from AlertsParameters.Categories.Category import Category class AlertsDiskIO(object): def __init__(self): super().__init__() home = os.path.expanduser("~") self.alertsDirectory = os.path.join(home, "EbayAlerto...
waveform80/gpio-zero
refs/heads/master
docs/examples/whos_home_leds.py
2
from gpiozero import PingServer, LEDBoard from gpiozero.tools import negated from signal import pause status = LEDBoard( mum=LEDBoard(red=14, green=15), dad=LEDBoard(red=17, green=18), alice=LEDBoard(red=21, green=22) ) statuses = { PingServer('192.168.1.5'): status.mum, PingServer('192.168.1.6'):...
simgunz/anki
refs/heads/main
ftl/duplicate-string.py
1
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import os import json import re import sys import copy import shutil from fluent.syntax import parse, serialize from fluent.syntax.ast import Message, TextElement, Identifier, Pattern, Junk # clone an existing ftl string as a new key # eg: # $ python duplicate-string.py \...
hguemar/cinder
refs/heads/master
cinder/tests/zonemanager/test_brcd_fc_zone_driver.py
1
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 OpenStack Foundation # # 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 # # ...
SaschaMester/delicium
refs/heads/master
tools/telemetry/catapult_base/__init__.py
14
# Copyright 2015 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. # All files in this directory should be moved to catapult/base/ after moving # to the new repo.
flingone/frameworks_base_cmds_remoted
refs/heads/matchstick-kk
libs/boost/libs/python/pyste/tests/varsUT.py
13
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import _vars class VarsTest(unittest.TestCase): def test...
ThomasWo/go-forwarder
refs/heads/master
admin.py
1
#!/usr/bin/env python import cgi import datetime import logging import models import webapp2 from google.appengine.ext import ndb from google.appengine.api import users class AdminPage(webapp2.RequestHandler): """Render the admin page. Currently a stub, but will expect at some point when we want to add a real admin...
thu-ml/zhusuan
refs/heads/master
tests/variational/utils.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import tensorflow as tf def _kl_normal_normal(mean1=0., std1=1., mean2=0., std2=1.): return tf.log(std2 / std1) + (std1**2 + (mean1 - mean2)**2) / \ ...
amadeusproject/amadeuslms
refs/heads/master
goals/urls.py
1
""" Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ...
clay584/chuck
refs/heads/master
chuck/inventory/migrations/0004_auto_20150410_0018.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('inventory', '0003_auto_20150410_0014'), ] operations = [ migrations.AlterField( model_name='inventory', ...
holmes/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/comments/feeds.py
310
from django.conf import settings from django.contrib.syndication.views import Feed from django.contrib.sites.models import Site from django.contrib import comments from django.utils.translation import ugettext as _ class LatestCommentFeed(Feed): """Feed of latest comments on the current site.""" def title(sel...
nexusz99/boto
refs/heads/develop
boto/sdb/db/manager/__init__.py
173
# Copyright (c) 2006,2007,2008 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,...
CouchPotato/CouchPotatoV1
refs/heads/master
library/markupsafe/tests.py
10
import gc import unittest from markupsafe import Markup, escape class MarkupTestCase(unittest.TestCase): def test_markup_operations(self): # adding two strings should escape the unsafe one unsafe = '<script type="application/x-some-script">alert("foo");</script>' safe = Markup('<em>userna...
richard-willowit/odoo
refs/heads/master
addons/account_tax_python/__manifest__.py
46
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': "Define Taxes as Python Code", 'summary': """ Allows to use python code to define taxes""", 'description': """ A tax defined as python code consists in two snippets of python code wh...
AnhellO/DAS_Sistemas
refs/heads/development
Ago-Dic-2019/IvanMedina/pythonCrash/countingToTwenty.py
1
''' Juan Ivan Medina Martinez 4.3 ''' def makeList(nElementsList): list=[] i=1 while(i<=nElementsList): list.append(i) i=i+1 return list def printList(list): for element in list: print element if __name__ == "__main__": list=makeList(20) printList(list)
iivic/BoiseStateX
refs/heads/master
common/lib/xmodule/xmodule/modulestore/store_utilities.py
124
import re import logging from collections import namedtuple import uuid def _prefix_only_url_replace_regex(pattern): """ Match urls in quotes pulling out the fields from pattern """ return re.compile(ur""" (?x) # flags=re.VERBOSE (?P<quote>\\?['"]) # the op...
spaceone/pyjs
refs/heads/master
examples/asteroids/game_model.py
6
# Copyright 2009 Joe Rumsey (joe@rumsey.org) # Copyright 2012 Charles Law (charles.law@gmail.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 obtain a copy of the License at # # http://www.apache.org/licen...
Healthedata1/Slides
refs/heads/gh-pages
node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
1417
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
zhukaixy/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_dict.py
77
import unittest from test import support import collections, random, string import collections.abc import gc, weakref import pickle class DictTest(unittest.TestCase): def test_invalid_keyword_arguments(self): class Custom(dict): pass for invalid in {1 : 2}, Custom({1 : 2}): ...
vvv1559/intellij-community
refs/heads/master
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodItemAccess.py
31
'{0[spam][foo][10]} {foo.baz[bar]]}'.format(create_dict(), foo=42)
atulsaini/portfolio
refs/heads/gh-pages
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
1417
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
fnp/edumed
refs/heads/master
curriculum/migrations/0008_auto__del_field_competencelevel_description__del_field_section_name__d.py
1
# -*- 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): # Deleting field 'CompetenceLevel.description' db.delete_column(u'curriculum_competencelevel', 'description'...
MER-GROUP/intellij-community
refs/heads/master
python/testData/inspections/PyNoneFunctionAssignmentInspection/noType.py
83
__author__ = 'ktisha' def foo(x): return x b = foo()
danieldresser/cortex
refs/heads/master
test/IECoreMaya/ToMayaParticleConverterTest.py
12
########################################################################## # # Copyright (c) 2010, Image Engine Design 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: # # * Redistribu...
soundcloud/selenium
refs/heads/master
py/test/selenium/webdriver/common/frame_switching_tests.py
5
#!/usr/bin/python # # Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "Li...
sanjeevtripurari/hue
refs/heads/master
desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/constants/ER.py
118
"""MySQL ER Constants These constants are error codes for the bulk of the error conditions that may occur. """ HASHCHK = 1000 NISAMCHK = 1001 NO = 1002 YES = 1003 CANT_CREATE_FILE = 1004 CANT_CREATE_TABLE = 1005 CANT_CREATE_DB = 1006 DB_CREATE_EXISTS = 1007 DB_DROP_EXISTS = 1008 DB_DROP_DELETE = 1009 DB_DROP_RMDIR =...
trnewman/VT-USRP-daughterboard-drivers_python
refs/heads/master
usrp/firmware/include/generate_regs.py
13
#!/usr/bin/env python import os, os.path import re import sys # set srcdir to the directory that contains Makefile.am try: srcdir = os.environ['srcdir'] except KeyError, e: srcdir = "." srcdir = srcdir + '/' def open_src (name, mode): global srcdir return open (os.path.join (srcdir, name), mode) d...
aplanas/rally
refs/heads/master
rally/plugins/common/scenarios/requests/http_requests.py
15
# 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, software # d...
sgerhart/ansible
refs/heads/maintenance_policy_module
lib/ansible/executor/process/__init__.py
2520
# (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...
Eksmo/calibre
refs/heads/master
src/calibre/ebooks/metadata/rar.py
1
#!/usr/bin/env python __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' ''' Read metadata from RAR archives ''' import os from calibre.ptempfile import PersistentTemporaryFile, TemporaryDirectory from calibre.libunrar import extract_member, names...
akopytov/cavium-mysql
refs/heads/5.7
storage/ndb/mcc/config_parser.py
32
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope t...
repotvsupertuga/repo
refs/heads/master
instal/plugin.video.youtube/resources/lib/youtube/helper/utils.py
7
from resources.lib.kodion.items import VideoItem __author__ = 'bromix' import re from resources.lib import kodion from resources.lib.kodion import utils from resources.lib.youtube.helper import yt_context_menu __RE_SEASON_EPISODE_MATCHES__ = [re.compile(r'Part (?P<episode>\d+)'), r...
Radamanthe/VulkanSamples
refs/heads/master
tests/gtest-1.7.0/test/gtest_output_test.py
496
#!/usr/bin/env python # # Copyright 2008, 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...
carl34/storm
refs/heads/master
storm-client/src/py/storm/ttypes.py
2
#!/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 # "...
petewarden/tensorflow
refs/heads/master
tensorflow/examples/speech_commands/freeze_test.py
14
# 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...
yanghao/wechat
refs/heads/master
lib/wechat.py
1
# -*- coding:utf-8 -*- import os import time import logging from hashlib import sha1 from httplib2 import Http from urllib import urlencode import json import requests from lock import Lock class WeChatError(Exception): pass class Token(object): def __get__(self, obj, objtype): if obj.access_token == Non...
myhro/debian-linux-kernel-gzip
refs/heads/master
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/boto/exception.py
117
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 without res...
boundarydevices/android_external_chromium_org
refs/heads/cm-12.0
chrome/common/net/PRESUBMIT.py
11
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Chromium presubmit script for src/chrome/common/net. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on ...
djf604/viewer
refs/heads/master
models.py
1
from django.db import models from django.contrib.auth.models import User class Project(models.Model): name = models.CharField(max_length=64, verbose_name="Project Name") description = models.CharField(max_length=2048, verbose_name="Project Description") creation_date = m...
denny820909/builder
refs/heads/master
lib/python2.7/site-packages/SQLAlchemy-0.7.0-py2.7-linux-x86_64.egg/sqlalchemy/orm/sync.py
22
# orm/sync.py # Copyright (C) 2005-2011 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 """private module containing functions used for copying data between instances based on j...
brianwoo/django-tutorial
refs/heads/master
build/Django/tests/template_tests/syntax_tests/test_comment.py
521
from django.test import SimpleTestCase from ..utils import setup class CommentSyntaxTests(SimpleTestCase): @setup({'comment-syntax01': '{# this is hidden #}hello'}) def test_comment_syntax01(self): output = self.engine.render_to_string('comment-syntax01') self.assertEqual(output, 'hello') ...
KoreaUSeoul/SYSU-Software-2015
refs/heads/master
server/models/memo.py
2
# -*- coding: utf-8 -*- from .. import db from datetime import datetime, timedelta class Memo(db.Model): """Memo model in CORE.""" id = db.Column(db.Integer, primary_key=True) """ID is an unique number to identify each :class:`Memo`.""" title = db.Column(db.String(32)) """Its title, which will ...
unnikrishnankgs/va
refs/heads/master
venv/lib/python3.5/site-packages/google/protobuf/internal/factory_test1_pb2.py
4
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/factory_test1.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from googl...
xfournet/intellij-community
refs/heads/master
python/testData/codeInsight/smartEnter/unclosedParametersListAndTrailingEmptyLines.py
79
def fun<caret>c(
bbansalWolfPack/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/infinite-redirects.py
228
def main(request, response): location = "%s://%s:%s/%s" % (request.url_parts.scheme, request.url_parts.netloc, request.url_parts.port, request.url_parts.path) page = "alternate"; type = 302; mix = 0; ...
asm666/sympy
refs/heads/master
sympy/matrices/expressions/adjoint.py
120
from __future__ import print_function, division from sympy.core import Basic from sympy.functions import adjoint, conjugate from sympy.matrices.expressions.transpose import transpose from sympy.matrices.expressions.matexpr import MatrixExpr class Adjoint(MatrixExpr): """ The Hermitian adjoint of a matrix exp...
dan1/horizon-x509
refs/heads/master
openstack_dashboard/test/integration_tests/tests/test_users.py
15
# 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, software # d...
bsmrstu-warriors/Moytri---The-Drone-Aider
refs/heads/master
Lib/xml/dom/NodeFilter.py
455
# This is the Python mapping for interface NodeFilter from # DOM2-Traversal-Range. It contains only constants. class NodeFilter: """ This is the DOM2 NodeFilter interface. It contains only constants. """ FILTER_ACCEPT = 1 FILTER_REJECT = 2 FILTER_SKIP = 3 SHOW_ALL = 0x...
qwertyjune/BethSaidaBible
refs/heads/master
venv/lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_flatpages.py
102
from __future__ import unicode_literals from unittest import skipUnless from django.apps import apps from django.conf import settings from .base import SitemapTestsBase class FlatpagesSitemapTests(SitemapTestsBase): @skipUnless(apps.is_installed('django.contrib.flatpages'), "django.contrib.fla...
bufferoverflow/thrift
refs/heads/master
contrib/parse_profiling.py
43
#!/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 # "Li...
KiranJKurian/XScheduler
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
2935
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
uzumaxy/pyvalid
refs/heads/master
pyvalid/validators/__iterable.py
1
import warnings try: from collections.abc import Iterable except ImportError: from collections import Iterable from pyvalid import accepts from pyvalid.validators import AbstractValidator class IterableValidator(AbstractValidator): """This class performs validation on the content of the iterable to chec...
Atheros1/PyBitmessage
refs/heads/master
src/bitmessageqt/bitmessage_icons_rc.py
21
# -*- coding: utf-8 -*- # Resource object code # # Created: Sa 21. Sep 13:45:58 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x03\x66\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
Topher-the-Geek/bazel
refs/heads/master
third_party/py/mock/tests/testmock.py
108
# Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ from tests.support import ( callable, unittest2, inPy3k, is_instance, next ) import copy import pickle import sys import mock from mock import ( call, DEFAULT, pat...
kaushik94/tardis
refs/heads/master
tardis/io/decay.py
1
import pandas as pd from pyne import nucname, material from astropy import units as u class IsotopeAbundances(pd.DataFrame): _metadata = ["time_0"] def __init__(self, *args, **kwargs): if "time_0" in kwargs: time_0 = kwargs["time_0"] kwargs.pop("time_0") else: ...
quantumlib/OpenFermion
refs/heads/master
src/openfermion/utils/operator_utils_test.py
1
# 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, software # distribu...
google-code/android-scripting
refs/heads/master
python/src/Doc/includes/sqlite3/text_factory.py
31
import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() # Create the table con.execute("create table person(lastname, firstname)") AUSTRIA = u"\xd6sterreich" # by default, rows are returned as Unicode cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() assert row[0] == AUSTRIA # but we can make py...
synsun/robotframework
refs/heads/master
src/robot/running/timeouts/windows.py
1
# Copyright 2008-2015 Nokia Solutions and Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
nvoron23/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/build/gyp/test/ios/app-bundle/TestApp/check_no_signature.py
241
#!/usr/bin/python import os import subprocess import sys p = os.path.join(os.environ['BUILT_PRODUCTS_DIR'],os.environ['EXECUTABLE_PATH']) proc = subprocess.Popen(['codesign', '-v', p], stderr=subprocess.STDOUT, stdout=subprocess.PIPE) o = proc.communicate()[0].strip() if "code object is not si...
astagi/django-cms
refs/heads/develop
cms/utils/urlutils.py
3
# -*- coding: utf-8 -*- from cms.utils.conf import get_cms_setting from django.conf import settings from django.core.urlresolvers import reverse from django.utils.http import urlencode from cms.utils.compat.urls import urlparse from cms.utils.compat.dj import force_unicode import re # checks validity of absolute / rel...
silvau/Addons_Odoo
refs/heads/master
module_reload/reimport.py
1
# MIT Licensed # Copyright (c) 2009-2010 Peter Shinners <pete@shinners.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 t...
indictranstech/Das_Erpnext
refs/heads/develop
erpnext/patches/v5_0/stock_entry_update_value.py
109
import frappe def execute(): for d in frappe.db.get_all("Stock Entry"): se = frappe.get_doc("Stock Entry", d.name) se.set_total_incoming_outgoing_value() se.db_update()
Shihta/python-novaclient
refs/heads/shihta0
novaclient/tests/fixture_data/server_groups.py
1
# 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, software # distributed under t...
benlau/moblin-image-creator.jaunty
refs/heads/master
libs/paths.py
2
PREFIX = "@PATH_PREFIX@" PKGDATADIR = "@PATH_PKGDATADIR@" SYSCONFDIR = "@PATH_SYSCONFDIR@" LOCALSTATEDIR = "@PATH_LOCALSTATEDIR@"
martinohanlon/minecraft-starwars
refs/heads/master
planet.py
1
import mcpi.minecraft as minecraft import mcpi.block as block import mcpi.minecraftstuff as mcstuff from time import sleep class Planet(): def __init__(self, pos, radius, blockType, blockData = 0): self.mc = minecraft.Minecraft.create() self.pos = pos self.radius = radius ...
huggingface/transformers
refs/heads/master
src/transformers/models/convbert/__init__.py
2
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
t3dev/odoo
refs/heads/master
addons/gamification/__manifest__.py
8
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Gamification', 'version': '1.0', 'sequence': 160, 'category': 'Human Resources', 'depends': ['mail', 'web_kanban_gauge'], 'description': """ Gamification process ==================== The...
Bristol-Braille/canute-ui
refs/heads/master
ui/bookmarks/reducers.py
1
from frozendict import FrozenOrderedDict from collections import OrderedDict from ..book.reducers import BookReducers from .. import state_helpers class BookmarksReducers(): def delete_bookmark(self, state, n): width, height = state_helpers.dimensions(state) # adjust for title height -= 1 ...
chudaol/edx-platform
refs/heads/master
lms/envs/load_test.py
111
""" Settings for load testing. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from .aws import * # Disable CSRF for load testing EXCLUDE_CSRF = lambda elem: elem not in [ 'djan...
gtko/CouchPotatoServer
refs/heads/develop
libs/apscheduler/jobstores/mongodb_store.py
132
""" Stores jobs in a MongoDB database. """ import logging from apscheduler.jobstores.base import JobStore from apscheduler.job import Job try: import cPickle as pickle except ImportError: # pragma: nocover import pickle try: from bson.binary import Binary from pymongo.connection import Connection ex...
oberlin/panoptes
refs/heads/master
panoptes/__init__.py
4
VERSION = (0, 1, 0) __version__ = ".".join([str(v) for v in VERSION])
chuajiesheng/google-python-exercises
refs/heads/master
basic/solution/mimic.py
208
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ """Mimic pyquick exercise -- optional extra exercise. Google's Python Class Read in the ...
anistark/mozillians
refs/heads/master
vendor-local/lib/python/south/tests/deps_a/migrations/0004_a.py
174
from south.db import db from django.db import models class Migration: depends_on = [('deps_b', '0003_b')] def forwards(self): pass def backwards(self): pass
lele1122/pelican-plugins
refs/heads/master
org_reader/__init__.py
59
from .org_reader import *
cpennington/edx-platform
refs/heads/master
lms/djangoapps/mobile_api/tests/test_model.py
4
""" Tests for Mobile API Configuration Models """ from datetime import datetime import ddt from django.test import TestCase from pytz import UTC from mobile_api.models import AppVersionConfig, MobileApiConfig @ddt.ddt class TestAppVersionConfigModel(TestCase): """ Tests for app version configuration model...
abhitopia/tensorflow
refs/heads/master
tensorflow/contrib/framework/python/ops/arg_scope.py
13
# 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...
ceph/qemu-kvm
refs/heads/master
scripts/qapi-types.py
13
# # QAPI types generator # # Copyright IBM, Corp. 2011 # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. from ordereddict import OrderedDict from qapi import * import sys import os import getopt impor...
UWPCE-PythonCert/IntroPython2016
refs/heads/master
students/smandava/session6/test_codingbat.py
3
"""Nov 26, 2016 Test cases for Coding bat exercises.""" from sm_codingbat import sum_double, parrot_trouble, string_times # Test cases for sum_double. def test_sum_double_same(): assert sum_double(5, 5) == 20 def test_sum_double_diff(): assert sum_double(5, 6) == 11 def test_sum_double_same_false(): a...
ufo-kit/concert
refs/heads/master
concert/tests/regressions/test_209.py
1
from concert.base import FSMError from concert.tests import TestCase from concert.quantities import q from concert.devices.motors.base import RotationMotor as BaseRotationMotor from concert.devices.motors.dummy import RotationMotor class ImproperlyImplemented(BaseRotationMotor): def __init__(self): super(...
brianlorenz/COSMOS_IMACS_Redshifts
refs/heads/master
PlotCodes/Plot_O3Hb_ssfr.py
1
#Creates a BPT diagram for all objects, and a second figure that shows objects for which single lines are low import numpy as np import matplotlib.pyplot as plt from astropy.io import ascii import sys, os, string import pandas as pd from astropy.io import fits import collections #Folder to save the figures figout = '/...
AlphaSmartDog/DeepLearningNotes
refs/heads/master
Note-6 A3CNet/Note-6.4 HS300指数增强/sonnet/python/modules/rnn_core.py
9
# Copyright 2017 The Sonnet 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 applicable l...
tiwillia/openshift-tools
refs/heads/stg
web/zagg/zagg.py
12
# vim: expandtab:tabstop=4:shiftwidth=4 ''' python-flask wsgi REST API for receiving zagg-sender metrics ''' # Reason: disable pylint import-error because our libs/deps aren't loaded on jenkins. # Status: temporary until we start testing in a container where our stuff is installed. # pylint: disable=import-error from ...
dshatil/ofc
refs/heads/master
ofc/hand.py
1
from card import Card class Hand(object): def __init__(self): # creates an empty hand self._cards = [] def __len__(self): # return number of cards return len(self._cards) def __iter__(self): return iter(self._cards) def add(self, card): # adds a card to the hand self._cards.append(c...
restless/django-mptt
refs/heads/master
tests/myapp/models.py
1
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible import mptt from mptt.fields import TreeForeignKey, TreeOneToOneField, TreeManyToManyField from mptt.models import MPTTModel from mptt.managers import TreeManager from django.db.models.que...
jheard-tw/onaji
refs/heads/master
setup.py
1
# sample ./setup.py file from setuptools import setup setup( name="onaji", description="A tool for creating regression tests through logging data during pytest runs.", url="https://github.com/teamworksapp/onaji", author="Jefferson Heard", author_email="jheard@teamworks.com", license = "MIT", ...
cdeil/rootpy
refs/heads/master
rootpy/tree/tests/test_tree.py
1
import ROOT from rootpy.math.physics.vector import LorentzVector from rootpy.tree import Tree, TreeModel, TreeChain from rootpy.io import open as ropen, TemporaryFile from rootpy.types import FloatCol, IntCol from random import gauss, randint, random from nose.tools import assert_raises, assert_almost_equal, with_setup...
meabsence/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/shutil.py
45
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os.path import abspath import fnmatch import collections import errno import tarfile try: import bz2 _BZ2_SUPPORTE...
rue89-tech/edx-platform
refs/heads/master
lms/djangoapps/class_dashboard/urls.py
163
""" Class Dashboard API endpoint urls. """ from django.conf.urls import patterns, url from django.conf import settings COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN urlpatterns = patterns( '', # Json request data for metrics for entire course url(r'^{}/all_sequential_open_distrib$'.format(settings.COURS...
synweap15/pyload
refs/heads/stable
module/plugins/hoster/UpstoreNet.py
13
# -*- coding: utf-8 -*- import re from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UpstoreNet(SimpleHoster): __name__ = "UpstoreNet" __type__ = "hoster" __version__ = "0.07" __status__ = "testing" _...
zeeshanali/blaze
refs/heads/master
blaze/tests/test_array_opening.py
7
from __future__ import absolute_import, division, print_function import os import tempfile import unittest import warnings import blaze from blaze.datadescriptor import dd_as_py # A CSV toy example csv_buf = u"""k1,v1,1,False k2,v2,2,True k3,v3,3,False """ csv_schema = "{ f0: string; f1: string; f2: int16; f3: bool...