repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pratikmallya/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/forms_tests/tests/tests.py | 50 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
from django.forms import Form, ModelForm, FileField, ModelChoiceField, CharField
from django.forms.models import ModelFormMetaclas... |
battlemidget/conjure-up | refs/heads/master | conjureup/app_config.py | 1 | """ application config
"""
from types import SimpleNamespace
bootstrap = SimpleNamespace(
# Is bootstrap running
running=False,
# Attached output
output=None
)
app = SimpleNamespace(
# Juju bootstrap details
bootstrap=bootstrap,
# The conjure-up UI framework
ui=None,
# Contains ... |
jruiperezv/ANALYSE | refs/heads/master | common/djangoapps/course_modes/migrations/0007_add_description.py | 25 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseMode.description'
db.add_column('course_modes_coursemode', 'description',
... |
thnee/ansible | refs/heads/devel | test/lib/ansible_test/_internal/csharp_import_analysis.py | 15 | """Analyze C# import statements."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
from .util import (
display,
)
from .data import (
data_context,
)
def get_csharp_module_utils_imports(powershell_targets, csharp_targets):
"""Return a diction... |
nikolas/django-threadedcomments | refs/heads/master | threadedcomments/migrations/0002_auto_20150521_2011.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('threadedcomments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='threadedcomment',
... |
jefby/kubernetes | refs/heads/master | examples/celery-rabbitmq/celery-app-add/run_tasks.py | 471 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
javelinanddart/Canuck | refs/heads/lp-devel2 | tools/perf/util/setup.py | 4998 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
dkalashnik/tempest | refs/heads/master | tools/check_uuid.py | 31 | #!/usr/bin/env python
# Copyright 2014 Mirantis, 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 a... |
syci/domsense-agilebg-addons | refs/heads/master | hr_analytic_plans/__init__.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it and/or ... |
Plain-Andy-legacy/android_external_chromium_org | refs/heads/lp-5.1r1 | tools/run-bisect-manual-test.py | 25 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run Manual Test Bisect Tool
An example usage:
tools/run-bisect-manual-test.py -g 201281 -b 201290
On Linux platform, follow the in... |
sunzuolei/youtube-dl | refs/heads/master | youtube_dl/extractor/cinemassacre.py | 55 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
from .bliptv import BlipTVIE
class CinemassacreIE(InfoExtractor):
_VALID_URL = 'https?://(?:www\.)?cinemassacre\.com/(?P<date_y>[0-9]{4})/(?P<date_m>[0-9]{2})/(?P<date_d>[0-9]... |
Debith/py3traits | refs/heads/master | src/pytraits/combiner.py | 1 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
'''
Copyright 2014-2015 Teppo Perä
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
Un... |
Lekanich/intellij-community | refs/heads/master | python/testData/intentions/afterConvertDictComp.py | 73 | dict([(k, chr(k + 65)) for k in range(10)]) |
afrolov1/nova | refs/heads/master | nova/virt/__init__.py | 16 | # Copyright (c) 2010 Citrix Systems, 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 ... |
robovm/robovm-studio | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/BuiltinBaseClass.py | 83 | def test():
class MyInt(int):
pass
def f(x):
"""
:type x: MyInt
"""
i = MyInt(2)
f(i)
|
indradhanush/filesync-server | refs/heads/master | lib/ubuntuone/monitoring/tests/test_reactor.py | 6 | # Copyright 2008-2015 Canonical
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed... |
BurtBiel/azure-cli | refs/heads/master | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt_vmss/lib/version.py | 12 | #---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------... |
jpardobl/comtrend_stats | refs/heads/master | tests.py | 1 | from comtrend_stats import read
import logging
logging.basicConfig(level=logging.DEBUG)
ROUTER_IP = "192.168.1.1"
ROUTER_USER = "1234"
ROUTER_PASSWORD = "password"
def main():
print(read(ROUTER_IP, ROUTER_USER, ROUTER_PASSWORD))
if __name__ == "__main__":
main()
|
rmaz/buck | refs/heads/master | python-dsl/buck_parser/__main__.py | 4 | # Copyright 2018-present Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
nathanlnw/TJ_COMBINE_gghypt_A_local | refs/heads/master | examples/module/rtconfig_lm3s.py | 84 | # bsp name
BSP = 'lm3s8962'
# toolchains
EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
PREFIX = 'arm-none-eabi-'
CC = PREFIX + 'gcc'
CXX = PREFIX + 'g++'
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
LINK = PREFIX + 'gcc'
TARGET_EXT = 'so'
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREF... |
jasontlam/snorkel | refs/heads/master | snorkel/contrib/brat/utils.py | 1 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
from urllib2 import urlopen, URLError, HTTPError
def download(url, outfname):
"""
Download target URL
:param url:
:param outfname... |
synasius/django | refs/heads/master | django/contrib/gis/db/backends/base/adapter.py | 484 | class WKTAdapter(object):
"""
This provides an adaptor for Geometries sent to the
MySQL and Oracle database backends.
"""
def __init__(self, geom):
self.wkt = geom.wkt
self.srid = geom.srid
def __eq__(self, other):
if not isinstance(other, WKTAdapter):
return... |
Azulinho/ansible | refs/heads/devel | test/units/modules/network/eos/test_eos_config.py | 17 | # (c) 2016 Red Hat 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
# (at your option) any later version.
#
# Ansible is dis... |
TommyHanusa/BadCharacterGenerator | refs/heads/master | BadCharacterGenerator.py | 1 | #!/usr/bin/env python34
# written by @tommyhanusa contact at tommyhanusa@gmail.com
from tkinter import *
from PIL import Image,ImageTk
import os # for files
import sys # for files
import random # for random stuff
#print("**************************")
class ShittyCharGen:
app = None # My tk referance (Tkinter ... |
supersven/intellij-community | refs/heads/master | python/testData/inspections/PyProtectedMemberInspection/trueNegative.py | 83 | __author__ = 'ktisha'
class A:
def __init__(self):
self._a = 1
def foo(self):
self.b= 1
class B(A):
def __init__(self):
A.__init__(self)
self.b = self._a
|
dipspb/ardupilot | refs/heads/master | Tools/autotest/__init__.py | 96 | """Autotests tools suite"""
|
JeremyAgost/gemrb | refs/heads/master | gemrb/GUIScripts/iwd2/QuitGame.py | 11 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2007 The GemRB Project
#
# 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) ... |
odubno/microblog | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/bdist_wininst.py | 111 | import distutils.command.bdist_wininst as orig
class bdist_wininst(orig.bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
"""
Supplement reinitialize_command to work around
http://bugs.python.org/issue20819
"""
cmd = self.distribution.reinitializ... |
r0e/servo | refs/heads/master | tests/wpt/harness/wptrunner/wptmanifest/tests/test_parser.py | 190 | # 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/.
import unittest
from cStringIO import StringIO
from .. import parser
# There aren't many tests here because it turns ... |
colinligertwood/odoo | refs/heads/master | openerp/addons/base/tests/test_osv.py | 446 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
GbalsaC/bitnamiP | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/__init__.py | 1429 | """Modules copied from Python 3 standard libraries, for internal use only.
Individual classes and functions are found in d2._backport.misc. Intended
usage is to always import things missing from 3.1 from that module: the
built-in/stdlib objects will be used if found.
"""
|
40223142/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/__main__.py | 737 | """Main entry point"""
import sys
if sys.argv[0].endswith("__main__.py"):
import os.path
# We change sys.argv[0] to make help message more useful
# use executable without path, unquoted
# (it's just a hint anyway)
# (if you have spaces in your executable you get what you deserve!)
executable = ... |
Smarsh/django | refs/heads/master | django/contrib/localflavor/us/forms.py | 83 | """
USA-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits... |
migueldiascosta/pymatgen | refs/heads/master | pymatgen/electronic_structure/__init__.py | 25 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This package contains electronic structure related tools and analyses.
"""
|
labcodes/django | refs/heads/master | django/apps/config.py | 55 | import os
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from django.utils.module_loading import module_has_submodule
MODELS_MODULE_NAME = 'models'
class AppConfig:
"""Class representing a Django application and its configuration."""
def __init__(self, app_name,... |
youdonghai/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/main.py | 250 | """
Main program for 2to3.
"""
from __future__ import with_statement
import sys
import os
import difflib
import logging
import shutil
import optparse
from . import refactor
def diff_texts(a, b, filename):
"""Return a unified diff of two strings."""
a = a.splitlines()
b = b.splitlines()
return diffl... |
jainayush975/zulip | refs/heads/master | zerver/migrations/0009_add_missing_migrations.py | 46 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0008_preregistrationuser_upper_email_idx'),
]
operations = [
migrations.AlterField(
model_name='userpr... |
cgstudiomap/cgstudiomap | refs/heads/develop | main/parts/odoo/addons/l10n_br/__init__.py | 430 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... |
llonchj/sentry | refs/heads/master | src/sentry/api/base.py | 2 | from __future__ import absolute_import
__all__ = ['DocSection', 'Endpoint', 'StatsMixin']
import logging
import time
from datetime import datetime, timedelta
from django.conf import settings
from django.utils.http import urlquote
from django.views.decorators.csrf import csrf_exempt
from enum import Enum
from pytz im... |
frew/simpleproto | refs/heads/master | scons-local-1.1.0/SCons/Tool/rmic.py | 1 | """SCons.Tool.rmic
Tool-specific initialization for rmic.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission ... |
nfedera/rg3-youtube-dl | refs/heads/master | youtube_dl/extractor/npr.py | 72 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlencode
from ..utils import (
int_or_none,
qualities,
)
class NprIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?npr\.org/player/v2/mediaPlayer\.html\?.*\bid=(?P<id>\d+)'
_TESTS =... |
Xykon/pycom-micropython-sigfox | refs/heads/master | tests/float/int_power.py | 100 | # negative power should produce float
x = 2
print(x ** -2)
x = 3
x **= -2
print('%.5f' % x)
|
ClimateImpactLab/pipelines | refs/heads/master | pipelines/climate/__init__.py | 1 | from __future__ import absolute_import
from pipelines.climate.jobs import *
|
smunaut/gnuradio | refs/heads/master | grc/python/Platform.py | 7 | __doc__ = """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 opt... |
jj-umn/tools-iuc | refs/heads/master | tools/tbl2gff3/tbl2gff3.py | 12 | #!/usr/bin/env python
import argparse
import collections
import csv
import sys
from BCBio import GFF
from Bio.Seq import Seq
from Bio.SeqFeature import FeatureLocation, SeqFeature
from Bio.SeqRecord import SeqRecord
def c(row, v, default=None):
if v is None:
return default
try:
_ = int(v)
... |
Jeff-Tian/mybnb | refs/heads/master | Python27/Lib/test/test_future5.py | 13 | # Check that multiple features can be enabled.
from __future__ import unicode_literals, print_function
import sys
import unittest
from . import test_support
class TestMultipleFeatures(unittest.TestCase):
def test_unicode_literals(self):
self.assertIsInstance("", unicode)
def test_print... |
teserak/peewee | refs/heads/master | playhouse/gfk.py | 18 | """
Provide a "Generic ForeignKey", similar to Django. A "GFK" is composed of two
columns: an object ID and an object type identifier. The object types are
collected in a global registry (all_models), so all you need to do is subclass
``gfk.Model`` and your model will be added to the registry.
Example:
class Tag(Mo... |
tuanthng/apitrace | refs/heads/master | specs/cglapi.py | 5 | ##########################################################################
#
# Copyright 2008-2009 VMware, 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 withou... |
katrid/django | refs/heads/master | django/contrib/sites/requests.py | 695 | from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class RequestSite(object):
"""
A class that shares the primary interface of Site (i.e., it has
``domain`` and ``name`` attributes) but gets its data from a Django
HttpReq... |
domenicosolazzo/practice-django | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/where.py | 70 | from django.db.models.constants import LOOKUP_SEP
from django.db.models.fields import FieldDoesNotExist
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.where import Constraint, WhereNode
from django.contrib.gis.db.models.fields import GeometryField
class GeoConstraint(Constraint):
... |
combatopera/pym2149 | refs/heads/trunk | pym2149/test_reg.py | 1 | # Copyright 2014, 2018, 2019, 2020 Andrzej Cichocki
# This file is part of pym2149.
#
# pym2149 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... |
sanjeevtripurari/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/conf/locale/ru/formats.py | 118 | # -*- 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:s'
D... |
databricks/spark-avro | refs/heads/branch-4.0 | dev/merge_pr.py | 8 | #!/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... |
trhd/cmdln | refs/heads/master | examples/p4.py | 4 | #!/usr/bin/env python
import sys
import cmdln
class Client(cmdln.Cmdln):
name = "p4"
def get_optparser(self):
parser = cmdln.Cmdln.get_optparser(self)
parser.add_option("-c", dest="client")
parser.add_option("-C", dest="charset")
parser.add_option("-d", dest="dir")
pa... |
hamyuan/ggrc-self-test | refs/heads/master | src/ggrc/assets.py | 4 |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By:
# Maintained By:
"""Manage "static" assets
The actual list of stylesheets and javascripts to compile is in
`assets/assets.yaml`.
When developin... |
najalbert/miniature-octo-archer | refs/heads/master | stock_ticker.py | 1 | class StockTicker(object):
pass
|
anastue/netforce | refs/heads/stable-3.1 | netforce_account/netforce_account/models/account_transfer.py | 4 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, modify, merge, publ... |
wkrzemien/DIRAC | refs/heads/integration | WorkloadManagementSystem/Agent/PilotStatusAgent.py | 2 | ########################################################################
# File : PilotStatusAgent.py
# Author : Stuart Paterson
########################################################################
""" The Pilot Status Agent updates the status of the pilot jobs in the
PilotAgents database.
"""
from __fut... |
dvberkel/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_union.py | 134 | import WebIDL
import itertools
import string
# We'd like to use itertools.chain but it's 2.6 or higher.
def chain(*iterables):
# chain('ABC', 'DEF') --> A B C D E F
for it in iterables:
for element in it:
yield element
# We'd like to use itertools.combinations but it's 2.6 or higher.
def c... |
openxc/web-logging-example | refs/heads/master | util.py | 1 | import errno
import os
from datetime import datetime
from functools import partial
FILENAME_DATE_FORMAT = '%Y-%m-%d-%H'
def generate_filename(settings, d=None):
d = d or datetime.now()
return "%s/%s.json" % (settings['trace_folder'],
d.strftime(FILENAME_DATE_FORMAT))
def massage_record(record,... |
OpenAcademy-OpenStack/nova-scheduler | refs/heads/master | nova/tests/virt/disk/__init__.py | 16 | # Copyright 2012 Michael Still
# 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... |
yagweb/pythonnet | refs/heads/master | demo/helloform.py | 8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import clr
SWF = clr.AddReference("System.Windows.Forms")
print (SWF.Location)
import System.Windows.Forms as WinForms
from System.Drawing import Size, Point
class HelloApp(WinForms.Form):
"""A simple hello world app that demonstrates the essentials of
winfor... |
agoose77/hivesystem | refs/heads/master | tutorial/canvas/start3/spydermodels/coltextbox/to_coloredtextbox.py | 4 | from coloredtextbox import coloredtextbox
def to_coloredtextbox(ctb):
textcolor = ctb.textcolor.r / 255.0, ctb.textcolor.g / 255.0, ctb.textcolor.b / 255.0, ctb.textcolor.a / 255.0
boxcolor = ctb.boxcolor.r / 255.0, ctb.boxcolor.g / 255.0, ctb.boxcolor.b / 255.0, ctb.boxcolor.a / 255.0
return coloredtextb... |
jyotikamboj/container | refs/heads/master | dj-tests/template_tests/filter_tests/test_removetags.py | 55 | from django.template.defaultfilters import removetags
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.safestring import mark_safe
from ..utils import setup
@ignore_warnings(category=RemovedInDjango20Warning)
class RemovetagsTests... |
jscott413/maidsinharlem | refs/heads/master | flask/lib/python2.7/site-packages/migrate/tests/fixture/warnings.py | 75 | # lifted from Python 2.6, so we can use it in Python 2.5
import sys
class WarningMessage(object):
"""Holds the result of a single showwarning() call."""
_WARNING_DETAILS = ("message", "category", "filename", "lineno", "file",
"line")
def __init__(self, message, category, filename... |
jyotica/hangman | refs/heads/master | Structure of hangman.py | 1 | #displays the sturcture of the hangman according to the number of mistakes made
def display_onscreen(self, mistakes):
hangman_graphics_display = ['''
^
+===|
! |
|
|
|
|
=========''', '''
^
+===|
! |
O |
|
|
|
========='''... |
kctan0805/vdpm | refs/heads/master | share/gdal/gdal-2.0.0/swig/python/samples/ogr2vrt.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: ogr2vrt.py 29016 2015-04-25 19:04:46Z rouault $
#
# Project: OGR Python samples
# Purpose: Create OGR VRT from source datasource
# Author: Frank Warmerdam, warmerdam@pobox.com
#
#####... |
fperez/sympy | refs/heads/master | sympy/polys/galoispolys.py | 1 | """Univariate polynomials with coefficients in Galois fields. """
from sympy.core.numbers import igcdex
def zp_inv(a, p):
"""Compute multiplicative inverse over GF(p). """
s, t, g = igcdex(a, p)
if g == 1:
return s % p
else:
raise ZeroDivisionError("modular division")
def zp_pow(a, n... |
tsdmgz/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_ucs.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
from nose.plugins.skip imp... |
myt00seven/svrg | refs/heads/master | para_gpu/vgg_net_ssvrg.py | 1 | import sys
sys.path.append('./lib')
import theano
theano.config.on_unused_input = 'warn'
import theano.tensor as T
import numpy as np
from layers import DataLayer, ConvPoolLayer, DropoutLayer, FCLayer, SoftmaxLayer
class VggNet(object):
def __init__(self, config):
self.config = config
batch_si... |
Opentrons/labware | refs/heads/master | update-server/tests/buildroot/conftest.py | 3 | import collections
import os
import json
import re
import subprocess
from unittest import mock
import zipfile
import pytest
from otupdate import buildroot
HERE = os.path.abspath(os.path.dirname(__file__))
@pytest.fixture
def downloaded_update_file(request, extracted_update_file):
"""
Return the path to a z... |
tmetsch/pytkgen | refs/heads/master | examples/rsa_ui.py | 1 | #! /usr/bin/env python3
#
# Copyright (c) 2011. All rights reserved.
#
# This library 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 2.1 of the License, or (at your option) any later ... |
ManuSchmi88/landlab | refs/heads/master | landlab/components/stream_power/stream_power.py | 3 | # -*- coding: utf-8 -*-
from __future__ import print_function
import warnings
import numpy as np
from landlab import Component
from landlab.core.model_parameter_dictionary import MissingKeyError
from landlab.field.scalar_data_fields import FieldError
from landlab.utils.decorators import use_file_name_or_kwds
try:
... |
mattclay/ansible | refs/heads/devel | test/support/integration/plugins/modules/ec2_ami_info.py | 38 | #!/usr/bin/python
# Copyright: Ansible Project
# 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'],
... |
mozilla-b2g/fxos-certsuite | refs/heads/master | mcts/webapi_tests/wip/contacts/__init__.py | 7 | from contacts_test import *
|
patrikpettersson/rest-engine | refs/heads/master | lib/passlib/tests/test_context_deprecated.py | 20 | """tests for passlib.context
this file is a clone of the 1.5 test_context.py,
containing the tests using the legacy CryptPolicy api.
it's being preserved here to ensure the old api doesn't break
(until Passlib 1.8, when this and the legacy api will be removed).
"""
#====================================================... |
sirex/django-pipeline | refs/heads/master | pipeline/compilers/less.py | 5 | import os.path
from pipeline.conf import settings
from pipeline.compilers import SubProcessCompiler
class LessCompiler(SubProcessCompiler):
output_extension = 'css'
def match_file(self, filename):
return filename.endswith('.less')
def compile_file(self, content, path):
command = '%s %s ... |
ishay2b/tensorflow | refs/heads/segnet | tensorflow/contrib/layers/python/layers/feature_column.py | 1 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
zaibacu/wutu-compiler | refs/heads/master | wutu_compiler/core/service.py | 1 | def create_service_js(stream, module):
"""
Creates AngularJS service from module
:param stream:
:param module:
:return:
"""
from wutu_compiler.utils import get_implemented_methods
from wutu_compiler.core.grammar import Provider, Function, Object, SimpleDeclare, String, Expression, unwrap... |
smartschat/cort | refs/heads/master | cort/coreference/multigraph/__init__.py | 12 | __author__ = 'martscsn'
|
lmcinnes/pynndescent | refs/heads/master | pynndescent/sparse_nndescent.py | 1 | # Author: Leland McInnes <leland.mcinnes@gmail.com>
# Enough simple sparse operations in numba to enable sparse UMAP
#
# License: BSD 3 clause
from __future__ import print_function
import locale
import numpy as np
import numba
from pynndescent.utils import (
tau_rand_int,
make_heap,
new_build_candidates,
... |
hfutsuchao/Python2.6 | refs/heads/master | mysite/manage.py | 2 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
igboyes/virtool | refs/heads/master | virtool/jobs/__init__.py | 2 | def is_running_or_waiting(document):
latest_state = document["status"][-1]["state"]
return latest_state == "waiting" or latest_state == "running"
|
heurezjusz/Athenet | refs/heads/master | athenet/layers/pool.py | 2 | """Pooling layer."""
from theano.tensor.signal.pool import pool_2d
from athenet.layers import Layer
class PoolingLayer(Layer):
"""Pooling layer."""
def __init__(self, poolsize, stride=None, mode='max', padding=(0, 0),
input_layer_name=None, name='pool'):
"""Create pooling layer.
... |
lsinfo3/onos | refs/heads/overview | tools/test/topos/attmpls.py | 19 | #!/usr/bin/env python
"""
"""
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.node import Node
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.util i... |
AyoubZahid/odoo | refs/heads/9.0 | addons/sale/report/invoice_report.py | 44 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api, fields, models, _
class AccountInvoiceReport(models.Model):
_inherit = 'account.invoice.report'
team_id = fields.Many2one('crm.team', string='Sales Team')
def _select(self):
... |
gspilio/nova | refs/heads/master | nova/virt/xenapi/imageupload/glance.py | 7 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
woylaski/notebook | refs/heads/master | graphic/kivy-master/examples/widgets/lists/list_composite.py | 56 | from kivy.adapters.dictadapter import DictAdapter
from kivy.uix.listview import ListItemButton, ListItemLabel, \
CompositeListItem, ListView
from kivy.uix.gridlayout import GridLayout
from fixtures import integers_dict
class MainView(GridLayout):
'''Uses :class:`CompositeListItem` for list item views com... |
subutai/cortipy | refs/heads/master | cortipy/exceptions.py | 5 | # The MIT License (MIT)
#
# Copyright (c) 2015 Numenta, Inc.
#
# 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, mod... |
urandu/rethinkdb | refs/heads/next | external/v8_3.30.33.16/tools/external-reference-check.py | 50 | #!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import os
import sys
DECLARE_FILE = "src/assembler.h"
REGISTER_FILE = "src/serialize.cc"
DECLARE_RE = re.compile("\s*stati... |
toastdriven/piecrust | refs/heads/master | piecrust/uris.py | 1 | class UriHandler(object):
def construct(self, **kwargs):
pass
def destruct(self, uri):
pass
|
asoplata/dynasim-benchmark-brette-2007 | refs/heads/master | Brian2/brian2_benchmark_COBAHH_clocksyn_lodens_32000.py | 2 | """
# Notes:
- This simulation seeks to emulate the COBAHH benchmark simulations of (Brette
et al. 2007) using the Brian2 simulator for speed benchmark comparison to
DynaSim. However, this simulation includes CLOCK-DRIVEN synapses, for direct
comparison to DynaSim's clock-driven architecture. The synaptic connec... |
dasmith/IsisWorld | refs/heads/ODE | src/isis_objects/generators.py | 1 | """
Defining a new object.
1: Begin with this template.
class object_name(IsisObject,IsisVisual,IsisSpatial,IsisFunctional):
def __init__(self, **kwargs):
self.model = "name_of_egg_file"
# either
self.generate_scale_between()
# OR a fixed scale
self.sca... |
pczhaoyun/obtainfo | refs/heads/master | zinnia/views/mixins/entry_preview.py | 6 | """Preview mixins for Zinnia views"""
from django.http import Http404
from django.utils.translation import ugettext as _
from zinnia.managers import PUBLISHED
class EntryPreviewMixin(object):
"""
Mixin implementing the preview of Entries.
"""
def get_object(self, queryset=None):
"""
... |
enachb/freetel-code | refs/heads/master | src/libctb-0.16/python/src/ctb.py | 4 | import wxctb, sys, re
DCD = wxctb.LinestateDcd
CTS = wxctb.LinestateCts
DSR = wxctb.LinestateDsr
DTR = wxctb.LinestateDtr
RING = wxctb.LinestateRing
RTS = wxctb.LinestateRts
NULL = wxctb.LinestateNull
def abstract():
import inspect
caller = inspect.getouterframes(inspect.currentframe())[1][3]
raise NotImp... |
epssy/hue | refs/heads/master | desktop/libs/libsolr/setup.py | 31 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... |
luthfii/xsched | refs/heads/master | tools/python/xen/xm/cpupool.py | 40 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/pylint/test/functional/no_self_use_py3.py | 15 | # pylint: disable=missing-docstring,no-init,unused-argument,invalid-name,too-few-public-methods
class A:
def __init__(self):
self.store = {}
def get(self, key, default=None):
return self.store.get(key, default)
class B(A):
def get_memo(self, obj):
return super().get(obj)
|
edwardzhou1980/bite-project | refs/heads/master | deps/gdata-python-client/src/gdata/tlslite/utils/Python_RSAKey.py | 239 | """Pure-Python RSA implementation."""
from cryptomath import *
import xmltools
from ASN1Parser import ASN1Parser
from RSAKey import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if (n and not e) or (e and not n):
raise AssertionError()
... |
louisq/staticguru | refs/heads/master | repos/git.py | 1 | """
The MIT License (MIT)
Copyright (c) 2016-2017 Louis-Philippe Querel l_querel@encs.concordia.ca
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 limitatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.