repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
leechuck/abercoin
refs/heads/master
share/qt/extract_strings_qt.py
2945
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
MoritzS/django
refs/heads/master
django/core/management/commands/shell.py
18
import os import select import sys from django.core.management import BaseCommand, CommandError from django.utils.datastructures import OrderedSet class Command(BaseCommand): help = ( "Runs a Python interactive interpreter. Tries to use IPython or " "bpython, if one of them is available. Any stan...
JRock007/boxxy
refs/heads/master
dist/Boxxy server.app/Contents/Resources/lib/python2.7/numpy/distutils/tests/gen_ext/setup.py
135
#!/usr/bin/env python from __future__ import division, print_function fib3_f = ''' C FILE: FIB3.F SUBROUTINE FIB(A,N) C C CALCULATE FIRST N FIBONACCI NUMBERS C INTEGER N REAL*8 A(N) Cf2py intent(in) n Cf2py intent(out) a Cf2py depend(n) a DO I=1,N IF (I.EQ.1) THEN A(I) ...
hfp/tensorflow-xsmm
refs/heads/master
tensorflow/python/keras/engine/base_layer_test.py
3
# Copyright 2018 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...
benrudolph/commcare-hq
refs/heads/master
custom/apps/wisepill/management/commands/delete_duplicate_device_events.py
3
from django.core.management.base import BaseCommand, CommandError from optparse import make_option from django.conf import settings from couchforms.models import XFormInstance from dimagi.utils.parsing import string_to_datetime, json_format_datetime class Command(BaseCommand): args = "<domain xmlns from_date to_da...
BuildingLink/sentry
refs/heads/master
tests/sentry/tasks/test_activity.py
6
from __future__ import absolute_import import mock from sentry.plugins import NotificationPlugin from sentry.testutils import PluginTestCase from sentry.models import Activity class BasicPreprocessorPlugin(NotificationPlugin): def notify_about_activity(self, activity): pass def is_enabled(self, pr...
poryfly/scikit-learn
refs/heads/master
sklearn/utils/arpack.py
265
""" This contains a copy of the future version of scipy.sparse.linalg.eigen.arpack.eigsh It's an upgraded wrapper of the ARPACK library which allows the use of shift-invert mode for symmetric matrices. Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ #...
yawnosnorous/python-for-android
refs/heads/master
python-modules/twisted/twisted/trial/test/novars.py
162
# fodder for test_script, which parses files for emacs local variable # declarations. This one is supposed to have none. # The class declaration is irrelevant class Bar(object): pass
pepeportela/edx-platform
refs/heads/master
lms/djangoapps/grades/signals/handlers.py
1
""" Grades related signals. """ from contextlib import contextmanager from logging import getLogger from crum import get_current_user from django.dispatch import receiver from xblock.scorable import ScorableXBlockMixin, Score from courseware.model_data import get_score, set_score from eventtracking import tracker fro...
foobarbazblarg/stayclean
refs/heads/master
stayclean-2020-november/editme.py
1
# Each day after you post a signup post, copy its 6-character ID to this array. signupPageSubmissionIds = [ 'jhu0s4', 'jie4g7', 'jizuv0', 'jjop7e', 'jk9yui', 'jkvz2a', 'jlgppi' ] signupPageFlaskPort = 8929 challengePageSubmissionId = 'jm1xis' challengePageFlaskPort = 8928 thisMonthName = "November" nextMonthName = "Dec...
SUSE/kiwi
refs/heads/master
kiwi/tasks/system_prepare.py
1
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any la...
m0ppers/arangodb
refs/heads/devel
3rdParty/V8/V8-5.0.71.39/build/gyp/test/lib/TestMac.py
151
# Copyright (c) 2014 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. """ TestMac.py: a collection of helper function shared between test on Mac OS X. """ import re import subprocess __all__ = ['Xcode', 'CheckFileType'] def Chec...
Acidburn0zzz/tornado
refs/heads/master
maint/scripts/custom_fixers/fix_future_imports.py
108
"""Updates all source files to import the same set of __future__ directives. """ from lib2to3 import fixer_base from lib2to3 import pytree from lib2to3.pgen2 import token from lib2to3.fixer_util import FromImport, Name, Comma, Newline # copied from fix_tuple_params.py def is_docstring(stmt): return isinstance(stmt...
SanderMertens/opensplice
refs/heads/master
testsuite/tests/dds2734/ospl_netw_conn/dds2734_test_scenario.py
3
# Add the path to the STAX/Python framework: import os import re import sys sys.path.append("../stax/python") from test_errors import TestError from base_test_scenario import BaseTestScenario #=============================================================================== class DDS2734Parser: """Helper clas...
romain-intel/bcc
refs/heads/master
tools/syncsnoop.py
5
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # syncsnoop Trace sync() syscall. # For Linux, uses BCC, eBPF. Embedded C. # # Written as a basic example of BCC trace & reformat. See # examples/hello_world.py for a BCC trace with default output example. # # Copyright (c) 2015 Brendan Gregg. #...
kouk/boto
refs/heads/develop
tests/integration/codedeploy/test_codedeploy.py
99
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
DMLoy/ECommerceBasic
refs/heads/master
lib/python2.7/site-packages/pip/download.py
78
import cgi import getpass import hashlib import mimetypes import os import platform import re import shutil import socket import ssl import sys import tempfile import pip from pip.backwardcompat import (urllib, urllib2, httplib, urlparse, string_types, get_http_message_param, ...
stvstnfrd/edx-platform
refs/heads/master
import_shims/lms/student/signals/__init__.py
4
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh.""" # pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long from import_shims.warn import warn_deprecated_import warn_deprecated_import('student.signals', 'common.djangoapps.student.signa...
Ronak6892/servo
refs/heads/master
python/mach/mach/base.py
98
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import absolute_import, unicode_literals class CommandContext(object): """Holds run-time state so ...
thepiper/standoff
refs/heads/master
venv/lib/python2.7/site-packages/pip/req/req_uninstall.py
249
from __future__ import absolute_import import logging import os import sys import tempfile from pip.compat import uses_pycache, WINDOWS, cache_from_source from pip.exceptions import UninstallationError from pip.utils import (rmtree, ask, is_local, dist_is_local, renames, normalize_path) from pi...
jpmckinney/inventory
refs/heads/master
inventory/management/commands/__init__.py
2
import logging import signal import sys from multiprocessing import Process from optparse import make_option import requests import requests_cache from django.core.management.base import BaseCommand from logutils.colorize import ColorizingStreamHandler from inventory.scrapers import catalogs class Handler(Colorizin...
paplorinc/intellij-community
refs/heads/master
python/testData/inspections/PyUnboundLocalVariableInspection/DefinedInTryAndExcept.py
83
def f(g): try: x = g() except Exception: x = g() finally: pass print(x) #pass
mdaniel/intellij-community
refs/heads/master
python/helpers/py2only/docutils/parsers/rst/directives/admonitions.py
126
# $Id: admonitions.py 7681 2013-07-12 07:52:27Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Admonition directives. """ __docformat__ = 'reStructuredText' from docutils.parsers.rst import Directive from docutils.parsers.rst import states, di...
gojira/tensorflow
refs/heads/master
tensorflow/python/grappler/model_analyzer.py
39
# 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...
mdelcambre/metro_disruption_data
refs/heads/master
src/upload.py
1
from ckanapi import RemoteCKAN from .client_secrets import api_key ua = 'ckanapiexample/1.0 (+http://example.com/my/website)' def upload_resource(filepath): mysite = RemoteCKAN('http://data.codefordc.org', apikey=api_key, user_agent=ua) mysite.action.resource_update( id='3c505827-08d1-47a3...
Weihonghao/ECM
refs/heads/master
Vpy34/lib/python3.5/site-packages/tensorflow/contrib/session_bundle/exporter_test.py
14
# 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...
cliffe/SecGen
refs/heads/master
modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/nturl2path.py
228
"""Convert a NT pathname to a file URL and vice versa.""" def url2pathname(url): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.""" # e.g. # ///C|/foo/bar/spam.foo # becomes # C:\foo\bar\spam.foo import string, urlli...
Tatsh-ansible/ansible
refs/heads/devel
lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_launch.py
9
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0...
jlspyaozhongkai/Uter
refs/heads/master
third_party_build/Python-2.7.9/lib/python2.7/test/test_symtable.py
117
""" Test the API of the symtable module. """ import symtable import unittest from test import test_support TEST_CODE = """ import sys glob = 42 class Mine: instance_var = 24 def a_method(p1, p2): pass def spam(a, b, *var, **kw): global bar bar = 47 x = 23 glob def internal(): ...
admire93/alask
refs/heads/master
tests/conftest.py
1
# -*- coding: utf-8 -*- from pytest import fixture from flask import _request_ctx_stack, g from sqlalchemy.orm import sessionmaker from $PROJECT_NAME.web.app import app from $PROJECT_NAME.db import get_session, Base, get_engine @fixture def f_session(request): with app.test_request_context() as _ctx: Ses...
samthor/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/conf/urls/defaults.py
320
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver from django.core.exceptions import ImproperlyConfigured __all__ = ['handler404', 'handler500', 'include', 'patterns', 'url'] handler404 = 'django.views.defaults.page_not_found' handler500 = 'django.views.defaults.server_error' def include(arg, na...
willthames/ansible
refs/heads/devel
lib/ansible/modules/network/lenovo/cnos_conditional_command.py
59
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # # 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 # ...
larsyencken/shelly
refs/heads/master
shelly_cmd/repeat.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # repeat.py # shelly # """ Repeat a command a given number of times (or, infinitely). """ import sys import optparse import subprocess def repeat(cmd_args, n=None): run = lambda: subprocess.Popen([' '.join(cmd_args)], stdout=sys.stdout, stderr=sys.st...
saurabh6790/omn-app
refs/heads/master
buying/doctype/supplier_quotation/test_supplier_quotation.py
30
# 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 webnotes import webnotes.defaults class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_order(self): from bu...
vmarkovtsev/django
refs/heads/master
tests/template_tests/filter_tests/test_force_escape.py
352
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import force_escape from django.test import SimpleTestCase from django.utils.safestring import SafeData from ..utils import setup class ForceEscapeTests(SimpleTestCase): """ Force_escape is applied immediatel...
shlee89/athena
refs/heads/master
tools/test/topos/onos.py
2
#!/usr/bin/env python # TODO add onos-app-fwd to features # TODO check if service is running... i think this might already be done by mn from mininet.node import Controller, OVSSwitch, CPULimitedHost, RemoteController from mininet.net import Mininet from mininet.cli import CLI from mininet.topo import LinearTopo, Top...
mapr/hue
refs/heads/hue-3.9.0-mapr
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/admin_generator.py
35
# -*- coding: utf-8 -*- import re import sys import optparse from django.db.models.loading import get_models from django.db import models from django.core.management.base import BaseCommand from django.conf import settings from django_extensions.management.color import color_style from django_extensions.management.u...
tejasnikumbh/ThesisCode
refs/heads/master
lib/python2.7/site-packages/numpy/ma/__init__.py
76
""" ============= Masked Arrays ============= Arrays sometimes contain invalid or missing data. When doing operations on such arrays, we wish to suppress invalid values, which is the purpose masked arrays fulfill (an example of typical use is given below). For example, examine the following array: >>> x = np.array(...
suppandi/flask
refs/heads/master
tests/test_blueprints.py
143
# -*- coding: utf-8 -*- """ tests.blueprints ~~~~~~~~~~~~~~~~ Blueprints (and currently modules) :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask from flask._compat import text_type from werkzeug.http import parse_cache_control_...
fernandog/Medusa
refs/heads/optimized
ext/feedparser/http.py
43
from __future__ import absolute_import, unicode_literals, with_statement import datetime import gzip import re import struct import zlib try: import urllib.parse import urllib.request except ImportError: from urllib import splithost, splittype, splituser from urllib2 import build_opener, HTTPDigestAut...
egabancho/invenio
refs/heads/pu
invenio/modules/messages/config.py
4
## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option...
yosukesuzuki/let-me-notify
refs/heads/master
project/kay/utils/handlers.py
10
# -*- coding: utf-8 -*- """ An extended CGIHandler corresponds with a buggy behaviour with os.environ. :Copyright: (c) 2009 Accense Technology, Inc. All rights reserved. :license: BSD, see LICENSE for more details. """ from wsgiref.handlers import CGIHandler class KayHandler(CGIHandler): """ wsgiref.handlers.CG...
FHannes/intellij-community
refs/heads/master
python/testData/inspections/PyUnusedLocalInspection/unusedFunction.py
19
def foo(): def <weak_warning descr="Local function 'bar' is not used">bar</weak_warning>(): pass #fail def baz(cond): def bzz(): pass #pass if cond: return bzz else: return None def bar(): def <weak_warning descr="Local function 'bar1' is not used">bar1</weak_warning>():pass #fail...
DecipherOne/Troglodyte
refs/heads/master
Trog Build Dependencies/Python26/Lib/bsddb/test/test_all.py
1
"""Run all test cases. """ import sys import os import unittest try: # For Pythons w/distutils pybsddb import bsddb3 as bsddb except ImportError: # For Python 2.3 import bsddb if sys.version_info[0] >= 3 : charset = "iso8859-1" # Full 8 bit class cursor_py3k(object) : def __init__(s...
doganaltunbay/odoo
refs/heads/8.0
addons/base_action_rule/base_action_rule.py
33
# -*- 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 GNU...
sam81/pysoundanalyser
refs/heads/master
pysoundanalyser/win_spectrogram_plot.py
1
# -*- coding: utf-8 -*- # Copyright (C) 2010-2017 Samuele Carcagno <sam.carcagno@gmail.com> # This file is part of pysoundanalyser # pysoundanalyser 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 Foundatio...
Qwaz/solved-hacking-problem
refs/heads/master
SCTF/2017 Finals/iem/rnd_map.py
1
import pickle import random import os.path def genRndMap(seed=None, size=4096): if seed: random.seed(seed) return [random.randint(0, 0xfff) for _ in range(size)] def permutation(m): l, r = m & 0xfff, m >> 12 for i in range(8): l, r = r, rndMap[r] ^ l return r | (l << 12) rndMap ...
theoryno3/scikit-learn
refs/heads/master
examples/decomposition/plot_incremental_pca.py
244
""" =============== Incremental PCA =============== Incremental principal component analysis (IPCA) is typically used as a replacement for principal component analysis (PCA) when the dataset to be decomposed is too large to fit in memory. IPCA builds a low-rank approximation for the input data using an amount of memo...
rh-lab-q/rpg
refs/heads/master
rpg/plugins/project_builder/setuptools.py
5
from rpg.command import Command from rpg.plugin import Plugin from rpg.utils import str_to_pkgname import logging import re class SetuptoolsPlugin(Plugin): def extracted(self, project_dir, spec, sack): if (project_dir / "setup.py").is_file(): with (project_dir / "setup.py").open() as f: ...
gminds/rapidnewsng
refs/heads/master
django/conf/locale/gl/formats.py
231
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = '...
cancro7/gem5
refs/heads/master
src/arch/x86/isa/insts/simd64/integer/data_reordering/extract_and_insert.py
91
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
joedeller/pymine
refs/heads/master
drawcsv2.py
1
#! /usr/bin/python # Joe Deller 2014 # Draw items in Minecraft using a specified file # Level : Advanced # Uses : Libraries, variables, loops, operators, logic, files, lists # Usage : ./drawcsv2.py [datafile.csv] [+/- difference from ground level] # Build the minecraft structure specified on the command line # Some...
GbalsaC/bitnamiP
refs/heads/master
lms/djangoapps/mobile_api/course_info/__init__.py
223
""" Course info API """
gimite/personfinder
refs/heads/master
app/vendors/unidecode/x06a.py
252
data = ( 'Di ', # 0x00 'Zhuang ', # 0x01 'Le ', # 0x02 'Lang ', # 0x03 'Chen ', # 0x04 'Cong ', # 0x05 'Li ', # 0x06 'Xiu ', # 0x07 'Qing ', # 0x08 'Shuang ', # 0x09 'Fan ', # 0x0a 'Tong ', # 0x0b 'Guan ', # 0x0c 'Ji ', # 0x0d 'Suo ', # 0x0e 'Lei ', # 0x0f 'Lu ', # 0x1...
mandeepdhami/nova
refs/heads/master
nova/tests/unit/test_block_device.py
5
# Copyright 2011 Isaku Yamahata # 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 b...
rjschwei/boto
refs/heads/master
boto/sdb/queryresultset.py
48
# Copyright (c) 2006,2007 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...
emilk/sproxel
refs/heads/master
distro/common/lib/getopt.py
63
"""Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by GNU software may be us...
kun--hust/libcloud_with_cn
refs/heads/development
libcloud/common/base.py
4
# 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 ...
sahilshekhawat/sympy
refs/heads/master
sympy/printing/tree.py
106
from __future__ import print_function, division def pprint_nodes(subtrees): """ Prettyprints systems of nodes. Examples ======== >>> from sympy.printing.tree import pprint_nodes >>> print(pprint_nodes(["a", "b1\\nb2", "c"])) +-a +-b1 | b2 +-c """ def indent(s, type=1...
google/llvm-propeller
refs/heads/bb-clusters
llvm/utils/update_mir_test_checks.py
10
#!/usr/bin/env python3 """Updates FileCheck checks in MIR tests. This script is a utility to update MIR based tests with new FileCheck patterns. The checks added by this script will cover the entire body of each function it handles. Virtual registers used are given names via FileCheck patterns, so if you do want to ...
nlharris/narrative
refs/heads/master
src/biokbase/Jnomics/jnomics_api/JnomicsData.py
7
# # Autogenerated by Thrift Compiler (0.9.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport ...
ramcn/demo3
refs/heads/master
venv/lib/python3.4/site-packages/django/conf/locale/fi/formats.py
115
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G.i' DATET...
gitdlam/random-crap
refs/heads/master
match_left_right.py
1
# input "left.txt" list of names # input "right.txt" list of names # input "ignore.txt" list of names (from output common_words100.py ran for both lists, plus manual edits) # input "common.txt" list of names (from output common_words100.py ran for both lists, plus manual edits) # output ALL of "left.txt" in origina...
googleapis/python-error-reporting
refs/heads/master
tests/unit/gapic/__init__.py
962
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
GainCompliance/ndb_audit
refs/heads/master
setup.py
1
import sys from setuptools import find_packages, setup try: from semantic_release import setup_hook setup_hook(sys.argv) except ImportError: pass with open('README.rst', 'r') as readme_file: long_description = readme_file.read() setup( name='ndb_audit', packages=find_packages( exclu...
OpenGenus/cosmos
refs/heads/master
code/online_challenges/src/project_euler/problem_010/problem_010.py
3
def main(): n = 2000000 sum = 0 prime = [True] * n for p in range(2, n): if prime[p]: sum += p for i in range(p * p, n, p): prime[i] = False print(sum) if __name__ == "__main__": main()
tinkhaven-organization/odoo
refs/heads/8.0
addons/decimal_precision/tests/test_qweb_float.py
335
# -*- coding: utf-8 -*- from openerp.tests import common class TestFloatExport(common.TransactionCase): def setUp(self): super(TestFloatExport, self).setUp() self.Model = self.registry('decimal.precision.test') def get_converter(self, name): converter = self.registry('ir.qweb.field.flo...
johanherman/arteria-core
refs/heads/master
tests/routes_tests.py
3
from unittest import TestCase import arteria from arteria.web.routes import RouteService import mock class RoutesServiceTest(TestCase): def test_help_doc_generated(self): app_svc = mock.MagicMock() route_svc = RouteService(app_svc, debug=False) routes = [ ("/route0", TestHandler...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/mobile/shared_warren_scientist_s02.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_warren_scientist_s02.iff" result.attribute_template_id = 9 re...
tmpgit/intellij-community
refs/heads/master
python/testData/mover/commentUp_afterDown.py
83
def f(): if True: a = 1 else: a = 2 #comment
KeyWeeUsr/kivy
refs/heads/master
examples/widgets/bubble_test.py
21
''' Bubble ====== Test of the widget Bubble. ''' from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.uix.button import Button from kivy.lang import Builder from kivy.uix.bubble import Bubble Builder.load_string(''' <cut_copy_paste> size_hint: (None, None) size: (160, 120) pos_...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/operations/_route_filter_rules_operations.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
samliu/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/testing/python/metafunc.py
166
# -*- coding: utf-8 -*- import re import _pytest._code import py import pytest from _pytest import python as funcargs class TestMetafunc: def Metafunc(self, func): # the unit tests of this class check if things work correctly # on the funcarg level, so we don't need a full blown # initilia...
nozuono/calibre-webserver
refs/heads/master
src/calibre/devices/eb600/__init__.py
142
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
40223119/-2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/browser/html.py
750
from _html import *
OsirisSPS/osiris-sps
refs/heads/master
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/test/test_codeccallbacks.py
36
import test.test_support, unittest import sys, codecs, htmlentitydefs, unicodedata class PosReturn: # this can be used for configurable callbacks def __init__(self): self.pos = 0 def handle(self, exc): oldpos = self.pos realpos = oldpos if realpos<0: realpos = ...
dblia/nosql-ganeti
refs/heads/couch
lib/client/gnt_backup.py
3
# # # Copyright (C) 2006, 2007, 2010, 2011 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This progr...
cyclus/cycaless
refs/heads/develop
tests/test_regression.py
1
#! /usr/bin/env python import os import json import hashlib import urllib import uuid from nose.tools import assert_true from nose import with_setup from cyclus_tools import run_cyclus, compare_determ, compare_nondeterm sim_files = {} fetchdir = "fetch" def setup(): global sim_files if not os.path.isdir(fet...
janebeckman/gpdb
refs/heads/master
gpMgmt/bin/gppylib/test/unit/test_unit_gpmfr.py
25
import imp import os import io from threading import Event from mock import * from gp_unittest import * from gppylib.commands.base import CommandResult DDBOOST_CONFIG_REMOTE_INFO= """ Data Domain Hostname:ddremote Data Domain Boost Username:metro Data Domain default log level:WARNING Data Domain default log size:50 "...
octgn/OCTGN-UFS
refs/heads/master
src/scripts/actions.py
1
import re from operator import itemgetter #--------------------------------------------------------------------------- # Constants #--------------------------------------------------------------------------- phases = [ 'It is currently in the Pre-game Setup Phase', "It is now {}'s READY Step", "...
TwoBitAlchemist/wysiweb
refs/heads/master
components/admin.py
13848
from django.contrib import admin # Register your models here.
fadybinadnan/BOTNet-2017.4-
refs/heads/master
botnet/modules/builtin/tv.py
1
import json import threading from datetime import date, datetime from .. import BaseResponder from ..lib import MemoryCache, parse_command, get_url class APIError(Exception): pass class TheTVDB(object): version = '2.1.1' def __init__(self, config_get): self.config_get = config_get # ca...
BitWriters/Zenith_project
refs/heads/master
zango/lib/python3.5/site-packages/django/db/models/query.py
45
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import sys import warnings from collections import OrderedDict, deque from django.conf import settings from django.core import exceptions from django.db import ( DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ...
EDUlib/edx-platform
refs/heads/master
lms/djangoapps/discussion/rest_api/tests/test_render.py
5
""" Tests for content rendering """ from unittest import TestCase import ddt from lms.djangoapps.discussion.rest_api.render import render_body def _add_p_tags(raw_body): """Return raw_body surrounded by p tags""" return f"<p>{raw_body}</p>" @ddt.ddt class RenderBodyTest(TestCase): """Tests for rende...
omo/hasb.ug
refs/heads/master
hasbug/ownership.py
2
# -*- coding: utf-8 -*- import types import hasbug.store as store import hasbug.validation as validation import hasbug.user import hasbug.shortener OWNERSHIP_UPPER_LIMIT = 10 class Belongings(object): def __init__(self, ownerhips): self._ownerhips = ownerhips @property def shortener_hosts(self):...
moreati/django-allauth
refs/heads/master
allauth/socialaccount/providers/oauth/models.py
4209
# Create your models here.
ppasq/geonode
refs/heads/master
geonode/api/paginator.py
9
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ver...
GhostThrone/django
refs/heads/master
tests/from_db_value/tests.py
399
from django.db import connection from django.db.models import Max from django.test import TestCase from .models import Cash, CashModel class FromDBValueTest(TestCase): def setUp(self): CashModel.objects.create(cash='12.50') def test_simple_load(self): instance = CashModel.objects.get() ...
rebeling/pattern
refs/heads/master
pattern/server/cherrypy/cherrypy/lib/http.py
173
import warnings warnings.warn('cherrypy.lib.http has been deprecated and will be removed ' 'in CherryPy 3.3 use cherrypy.lib.httputil instead.', DeprecationWarning) from cherrypy.lib.httputil import *
peastman/deepchem
refs/heads/master
deepchem/rl/tests/test_rl_reload.py
3
import deepchem as dc import tensorflow as tf import numpy as np from deepchem.models.optimizers import Adam class RouletteEnvironment(dc.rl.Environment): def __init__(self): super(RouletteEnvironment, self).__init__([(1,)], 38) self._state = [np.array([0])] def step(self, action): if action == 37: ...
AccelAI/accel.ai
refs/heads/master
flask-aws/lib/python2.7/site-packages/botocore/docs/__init__.py
26
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
varunarya10/heat
refs/heads/master
heat/db/sqlalchemy/migrate_repo/versions/018_resource_id_uuid.py
4
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
fitermay/intellij-community
refs/heads/master
python/helpers/pydev/pydev_run_in_console.py
2
''' Entry point module to run a file in the interactive console. ''' import os import sys from pydevconsole import do_exit, InterpreterInterface, process_exec_queue, start_console_server from _pydev_bundle.pydev_console_utils import BaseStdIn from _pydev_imps._pydev_saved_modules import threading from _pydev_bundle im...
quake0day/oj
refs/heads/master
combine.py
1
class Solution: """ @param n: Given the range of numbers @param k: Given the numbers of combinations @return: All the combinations of k numbers out of 1..n """ def dfs(self, pos, k, n , start, ans, vec): if pos == k: temp = vec[:] ans.append(temp) return for i...
cherry-wb/SideTools
refs/heads/master
examples/mainwindows/sdi/sdi.py
1
#!/usr/bin/env python ############################################################################ # # Copyright (C) 2004-2005 Trolltech AS. All rights reserved. # # This file is part of the example classes of the Qt Toolkit. # # This file may be used under the terms of the GNU General Public # License...
Frankkkkk/arctic
refs/heads/master
tests/unit/store/test_pickle_store.py
1
import pandas as pd from six.moves import cPickle import pytest import sys from os import path from bson.binary import Binary from bson.objectid import ObjectId from distutils.version import LooseVersion from mock import create_autospec, sentinel, Mock, call from arctic._compression import compress, decompress, compre...
ludovicchabant/Wikked
refs/heads/master
wikked/views/read.py
1
import urllib.parse from flask import ( render_template, request, abort) from flask_login import current_user from wikked.utils import split_page_url, PageNotFoundError from wikked.views import add_auth_data, add_navigation_data from wikked.web import app, get_wiki from wikked.webimpl import ( url_from_viewarg,...
scue/LenovoK860i_4.2_opensource_kernel
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
ijt/cmakelists_parsing
refs/heads/master
cmakelists_parsing/parsing.py
1
from collections import namedtuple import re from cmakelists_parsing import list_utils QuotedString = namedtuple('QuotedString', 'contents comments') _Arg = namedtuple('Arg', 'contents comments') _Command = namedtuple('Command', 'name body comment') BlankLine = namedtuple('BlankLine', '') class File(list): """To...
iamang/namebench
refs/heads/master
nb_third_party/dns/rdtypes/dsbase.py
248
# Copyright (C) 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 "AS IS" AND NOMIN...