repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
nolanliou/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/sample_stats_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... |
dinesh-github/django-paypal-driver | refs/heads/master | paypal/views.py | 3 | # -*- coding: utf-8 -*-
from decimal import Decimal, ROUND_UP
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from django.conf import settings
from django.shortcuts... |
dendisuhubdy/tensorflow | refs/heads/master | tensorflow/contrib/saved_model/python/saved_model/reader.py | 132 | # 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... |
philoniare/horizon | refs/heads/master | openstack_dashboard/contrib/sahara/content/data_processing/data_plugins/views.py | 25 | # 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 the... |
predicthq/sdk-py | refs/heads/master | predicthq/endpoints/decorators.py | 1 | import functools
from collections import defaultdict
from predicthq.endpoints.schemas import ResultSet, Model, SchematicsDataError
from predicthq.exceptions import ValidationError
def _to_url_params(data, glue=".", separator=","):
"""
Converts data dictionary to url parameters
"""
params = {}
for... |
Juniper/nova | refs/heads/master | nova/tests/fixtures.py | 1 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
OpenKore/OpenKore | refs/heads/master | src/scons-local-3.0.1/scons-local-3.0.1/SCons/Tool/ldc.py | 6 | from __future__ import print_function
"""SCons.Tool.ldc
Tool-specific initialization for the LDC compiler.
(https://github.com/ldc-developers/ldc)
Developed by Russel Winder (russel@winder.org.uk)
2012-05-09 onwards
Compiler variables:
DC - The name of the D compiler to use. Defaults to ldc2.
DPATH - List ... |
jk1/intellij-community | refs/heads/master | python/lib/Lib/compiler/syntax.py | 369 | """Check for errs in the AST.
The Python parser does not catch all syntax errors. Others, like
assignments with invalid targets, are caught in the code generation
phase.
The compiler package catches some errors in the transformer module.
But it seems clearer to write checkers that use the AST to detect
errors.
"""
... |
tuffery/Frog2 | refs/heads/master | frowns/FrownsError.py | 2 | # A handle little Frowns exception error
# that frowns code can throw
class FrownsError(Exception):
pass
|
nikkisquared/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/util.py | 497 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
ehashman/oh-mainline | refs/heads/master | vendor/packages/irc/scripts/testbot.py | 13 | #! /usr/bin/env python
#
# Example program using irc.bot.
#
# Joel Rosdahl <joel@rosdahl.net>
"""A simple example bot.
This is an example bot that uses the SingleServerIRCBot class from
irc.bot. The bot enters a channel and listens for commands in
private messages and channel traffic. Commands in channel messages
a... |
rtruxal/metagoofil | refs/heads/master | hachoir_core/field/static_field_set.py | 93 | from hachoir_core.field import FieldSet, ParserError
class StaticFieldSet(FieldSet):
"""
Static field set: format class attribute is a tuple of all fields
in syntax like:
format = (
(TYPE1, ARG1, ARG2, ...),
(TYPE2, ARG1, ARG2, ..., {KEY1=VALUE1, ...}),
...
)
... |
mark-ignacio/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/postdiffforrevert.py | 130 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... |
KyleAMoore/KanjiNani | refs/heads/master | Android/.buildozer/android/platform/build/dists/KanjiNani/crystax_python/crystax_python/site-packages/kivy/input/postproc/calibration.py | 16 | '''
Calibration
===========
.. versionadded:: 1.9.0
Recalibrate input device to a specific range / offset.
Let's say you have 3 1080p displays, the 2 firsts are multitouch. By default,
both will have mixed touch, the range will conflict with each others: the 0-1
range will goes to 0-5760 px (remember, 3 * 1920 = 576... |
wallarelvo/keeper | refs/heads/master | keeper/blob.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
DISCLAIMER
This is crap code that works. I wrote it 3 years ago.
"""
import cv2
import numpy as np
from point import Point
class Blob:
def __init__(self, centroid, convexHull, convexHullArea,\
contour, contourArea):
self.centroid = centr... |
leshchevds/ganeti | refs/heads/master | test/py/ganeti.cli_unittest.py | 1 | #!/usr/bin/python
#
# Copyright (C) 2008, 2011, 2012, 2013 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:
#
# 1. Redistributions of source code must retain the above copyright noti... |
switchboardOp/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py | 16 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
svenstaro/ansible | refs/heads/devel | lib/ansible/plugins/connection/lxd.py | 133 | # (c) 2016 Matt Clay <matt@mystile.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) any later version.
#
... |
Greennut/ostproject | refs/heads/master | django/utils/unittest/util.py | 751 | """Various utility functions."""
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
return result[:_MAX_LENGTH] + ' [truncated]...'... |
bbc/kamaelia | refs/heads/master | Code/Python/Kamaelia/Kamaelia/Apps/Compose/PipelineWriter.py | 12 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... |
j0yu/TDD-for-CG | refs/heads/master | ps_maya/__init__.py | 1 | ## @package ps_maya
#
# Main Maya package containing procedures and functions exclusive to Maya only
import os
import unittest
import pymel.core as pm
import psMaya_mainMenu
## Procedure to run the unit tests for Maya functions
#
# 1. Error test for parameters
# 2. Run each unit test for maya, extend the list per e... |
Tyler2004/pychess | refs/heads/master | testing/draw.py | 21 | import unittest
from pychess.Savers import pgn
from pychess.Utils.lutils import ldraw
class DrawTestCase(unittest.TestCase):
def setUp(self):
with open('gamefiles/3fold.pgn') as f1:
self.PgnFile1 = pgn.load(f1)
with open('gamefiles/bilbao.pgn') as f2:
self.PgnFil... |
mathdd/numpy | refs/heads/master | doc/source/f2py/setup_example.py | 136 | from __future__ import division, absolute_import, print_function
from numpy.distutils.core import Extension
ext1 = Extension(name = 'scalar',
sources = ['scalar.f'])
ext2 = Extension(name = 'fib2',
sources = ['fib2.pyf', 'fib1.f'])
if __name__ == "__main__":
from numpy.distutils... |
bjlittle/iris | refs/heads/pre-commit-ci-update-config | docs/iris/example_code/General/projections_and_annotations.py | 3 | """
Plotting in different projections
=================================
This example shows how to overlay data and graphics in different projections,
demonstrating various features of Iris, Cartopy and matplotlib.
We wish to overlay two datasets, defined on different rotated-pole grids.
To display both together, we m... |
ywcui1990/nupic | refs/heads/master | src/nupic/frameworks/opf/prediction_metrics_manager.py | 10 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
sideffect0/django-tastypie | refs/heads/master | tests/core/models.py | 19 | import datetime
from django.contrib.auth.models import User
from django.db import models
from tastypie.utils import now, aware_datetime
class DateRecord(models.Model):
date = models.DateField()
username = models.CharField(max_length=20)
message = models.CharField(max_length=20)
class Note(models.Model):... |
ahtn/keyplus | refs/heads/master | host-software/keyplus/keycodes/lang_map/Tamil0.py | 1 | # Copyright 2018 jem@seethis.link
# Licensed under the MIT license (http://opensource.org/licenses/MIT)
from hid_keycodes import *
lang = 'Tamil'
country = 'India'
scancode_map = {
KC_0: ('0', ')', '', '௦', '', ''),
KC_1: ('1', '!', '', '௧', '', ''),
KC_2: ('2', '@', '', '௨', '', ''),
KC_3: ('3', '#', '... |
chromium/chromium | refs/heads/master | tools/android/dependency_analysis/print_class_dependencies.py | 7 | #!/usr/bin/env python3
# Copyright 2020 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.
"""Command-line tool for printing class-level dependencies."""
import argparse
from dataclasses import dataclass
from typing import Li... |
cudamat/cudamat | refs/heads/master | examples/rbm_numpy.py | 6 | from __future__ import division
import time
import numpy as np
import util
# load data
util.load('mnist.dat', globals())
dat = dat/255.
# training parameters
epsilon = 0.01
momentum = 0.9
num_epochs = 10
batch_size = 64
num_batches = dat.shape[1]//batch_size
# model parameters
num_vis = dat.shape[0]
num_hid = 1024
... |
interDist/pasportaservo | refs/heads/_master | core/views.py | 1 | from copy import copy
from datetime import datetime
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import authenticate, get_user_model, login
from django.contrib.auth.views import (
PasswordChangeDoneView as PasswordChangeDoneBuiltinView,
PasswordChangeView as Pas... |
cupen/django-xadmin | refs/heads/django1.8 | tests/xtests/site/models.py | 30 | from django.db import models
class ModelA(models.Model):
name = models.CharField(max_length=64) |
decathorpe/enerpy | refs/heads/master | enerpy/lists.py | 1 | """
enerpy/lists.py
This module contains everything needed for calculations on lists.
"""
from decimal import Decimal as D
from enerpy import Node, Num, Fnc, enerfy
from enerpy import FUNCS_ONE_ARG1, FUNCS_TWO_ARG, FUNCS_VAR_ARG
from enerpy.extras import FUNCS_ONE_ARG2
FUNCS_ONE_ARG = FUNCS_ONE_ARG1 + FUNCS_ONE_ARG2... |
barrazamiguel/pydrez | refs/heads/master | escenas/ganasteLosDesafios.py | 1 | # -*- encoding: utf-8 -*-
import pilasengine
from tts import leer
from sonido import Sonido
class GanasteLosDesafios(pilasengine.escenas.Escena):
def iniciar(self, pilas):
marronOscuro = pilas.colores.Color(77, 38, 22)
self.fondo = pilas.fondos.FondoMozaico("imagenes/fondo/fondoJuego.jpg")
... |
wilmarcardonac/fisher-mcmc | refs/heads/master | analyzer/analyze_adjusting_DEA_MODEL_II.py | 2 | from getdist import loadMCSamples,plots
number_of_parameters = 11
samples = loadMCSamples('../output/mcmc_output',settings={'ignore_rows':2})
g = plots.getSinglePlotter()
g.settings.rcSizes(axes_fontsize = 2,lab_fontsize = 7)
g.triangle_plot(samples,filled=True)
g.export('triangle_figure.pdf')
bestfit = samples.... |
benrudolph/commcare-hq | refs/heads/master | corehq/apps/hqcase/management/commands/ptop_fast_reindex_reportxforms.py | 2 | from corehq.apps.hqcase.management.commands.ptop_fast_reindexer import ElasticReindexer
from corehq.pillows.reportxform import ReportXFormPillow
from couchforms.models import XFormInstance
from django.conf import settings
class Command(ElasticReindexer):
help = "Fast reindex of case elastic index by using the cas... |
SciDAP/cwltool | refs/heads/master | cwltool/pack.py | 1 | import copy
from typing import Any, Callable, Dict, Text, Union, cast
from schema_salad.ref_resolver import Loader
from six.moves import urllib
from .process import shortname, uniquename
def flatten_deps(d, files): # type: (Any, Set[Text]) -> None
if isinstance(d, list):
for s in d:
flatten... |
cgaspoz/l10n-switzerland | refs/heads/8.0 | l10n_ch_credit_control_payment_slip_report/credit_control_communication_report.py | 10 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville, Nicolas Bessi Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License ... |
bigswitch/neutron | refs/heads/master | neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_phys.py | 7 | # Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... |
leansoft/edx-platform | refs/heads/master | common/djangoapps/util/file.py | 114 | """
Utility methods related to file handling.
"""
from datetime import datetime
import os
from pytz import UTC
from django.core.exceptions import PermissionDenied
from django.core.files.storage import DefaultStorage, get_valid_filename
from django.utils.translation import ugettext as _
from django.utils.translation i... |
AndroidSecurityTools/lobotomy | refs/heads/master | framework/brains/dex2jar/d2j.py | 4 | from datetime import datetime
from framework.logging.logger import Logger
from framework.enums.enums import D2JEnum
from subprocess import Popen, CalledProcessError
from blessings import Terminal
t = Terminal()
class D2J(object):
def __init__(self, directory, apk):
super(D2J, self).__init__()
se... |
coderbone/SickRage-alt | refs/heads/master | lib/reprlib/__init__.py | 54 | from __future__ import absolute_import
import sys
if sys.version_info[0] < 3:
from repr import *
else:
raise ImportError('This package should not be accessible on Python 3. '
'Either you are trying to run from the python-future src folder '
'or your installation of p... |
kissbac/upm | refs/heads/master | examples/python/sx1276-fsk.py | 5 | #!/usr/bin/python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 l... |
lavish205/olympia | refs/heads/master | src/olympia/amo/tests/test_redirects.py | 3 | # -*- coding: utf-8 -*-
"""Check all our redirects from remora to zamboni."""
from django.db import connection
from olympia import amo
from olympia.addons.models import Category
from olympia.amo.tests import TestCase
class TestRedirects(TestCase):
fixtures = ['ratings/test_models', 'addons/persona', 'base/global... |
GhostThrone/django | refs/heads/master | tests/foreign_object/models/person.py | 182 | import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Country(models.Model):
# Table Column Fields
name = models.CharField(max_length=50)
def __str__(self):
return self.name
@python_2_unicode_compatible
cla... |
remyroy/uwsgi | refs/heads/master | examples/bootstrap3.py | 34 | import sys
import uwsgi
sys.meta_path.insert(0, uwsgi.SymbolsZipImporter("django_zip:djenv/lib/python2.6/site-packages"))
sys.meta_path.insert(0, uwsgi.SymbolsZipImporter("djapp_zip"))
|
JaSpa/swift | refs/heads/master | utils/swift_build_support/swift_build_support/migration.py | 44 | # swift_build_support/migration.py - Migrating build-script -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt fo... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/.install/.backup/lib/surface/deployment_manager/manifests/describe.py | 3 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
thehub/hubplus | refs/heads/master | apps/plus_user/middleware.py | 1 |
from apps.plus_permissions.default_agents import get_anon_user
class AnonUserMiddleware(object) :
def process_request(self, request):
if not request.user.is_authenticated() :
request.user = get_anon_user()
return None
|
2014c2g14/c2g14 | refs/heads/master | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/support.py | 770 | import unittest
class TestEquality(object):
"""Used as a mixin for TestCase"""
# Check for a valid __eq__ implementation
def test_eq(self):
for obj_1, obj_2 in self.eq_pairs:
self.assertEqual(obj_1, obj_2)
self.assertEqual(obj_2, obj_1)
# Check for a valid __ne__ impl... |
joshlk/scrapy | refs/heads/master | scrapy/tests/test_log.py | 12 | from cStringIO import StringIO
from twisted.python import log as txlog, failure
from twisted.trial import unittest
from scrapy import log
from scrapy.spider import Spider
from scrapy.settings import default_settings
class LogTest(unittest.TestCase):
def test_get_log_level(self):
default_log_level = geta... |
Thoshh/wapad | refs/heads/master | lib/python2.7/site-packages/django/contrib/postgres/apps.py | 484 | from django.apps import AppConfig
from django.db.backends.signals import connection_created
from django.db.models import CharField, TextField
from django.utils.translation import ugettext_lazy as _
from .lookups import Unaccent
from .signals import register_hstore_handler
class PostgresConfig(AppConfig):
name = ... |
kerneltask/micropython | refs/heads/master | tests/perf_bench/bm_float.py | 15 | # Source: https://github.com/python/pyperformance
# License: MIT
# Artificial, floating point-heavy benchmark originally used by Factor.
from math import sin, cos, sqrt
class Point(object):
__slots__ = ("x", "y", "z")
def __init__(self, i):
self.x = x = sin(i)
self.y = cos(i) * 3
se... |
geekaia/edx-platform | refs/heads/master | common/test/acceptance/pages/studio/textbooks.py | 103 | """
Course Textbooks page.
"""
from .course_page import CoursePage
class TextbooksPage(CoursePage):
"""
Course Textbooks page.
"""
url_path = "textbooks"
def is_browser_on_page(self):
return self.q(css='body.view-textbooks').present
|
kaiserroll14/301finalproject | refs/heads/master | main/win/main/requests/packages/chardet/charsetprober.py | 3126 | ######################## 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... |
BMJHayward/django | refs/heads/master | django/contrib/gis/db/backends/spatialite/operations.py | 257 | """
SQL functions reference lists:
http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html
http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html
http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
"""
import re
import sys
from django.contrib.gis.db.backends.base.operations import \
... |
eeshangarg/zulip | refs/heads/master | tools/documentation_crawler/documentation_crawler/settings.py | 2 | # Scrapy settings for documentation_crawler project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/topics/dow... |
NickWoodhams/flask-admin | refs/heads/master | flask_admin/tests/test_tools.py | 45 | from nose.tools import eq_, ok_
from flask_admin import tools
def test_encode_decode():
eq_(tools.iterdecode(tools.iterencode([1, 2, 3])), (u'1', u'2', u'3'))
eq_(tools.iterdecode(tools.iterencode([',', ',', ','])), (u',', u',', u','))
eq_(tools.iterdecode(tools.iterencode(['.hello.,', ',', ','])), (u'... |
drtuxwang/system-config | refs/heads/mac-fix | bin/pyprof.py | 1 | #!/usr/bin/env python3
"""
Profile Python 3.x program.
"""
import argparse
import glob
import os
import pstats
import signal
import sys
from typing import List
import command_mod
import subtask_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespa... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/ipykernel/comm/__init__.py | 26 | from .manager import *
from .comm import *
|
LCOGT/whatsup | refs/heads/master | whatsup/apps.py | 1 | from django.apps import AppConfig
class WhatsupConfig(AppConfig):
name = 'whatsup'
|
Lispython/adrest | refs/heads/develop | example/api/api.py | 2 | """ Create Api and resources. """
from adrest.api import Api
from adrest.views import ResourceView
from adrest.resources.rpc import RPCResource
from . import rpc
api = Api(version='0.1')
api.register(RPCResource, scheme=rpc)
@api.register
class AuthorResource(ResourceView):
""" Get authors from db. """
c... |
kronicz/ecommerce-2 | refs/heads/master | lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/srs.py | 471 | from ctypes import POINTER, c_char_p, c_int, c_void_p
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (
const_string_output, double_output, int_output, srs_output, string_output,
void_output,
)
# Shortcut generation for routines with known... |
kastnerkyle/protobuf-py3 | refs/heads/master | python/google/protobuf/message.py | 2 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
gskachkov/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/__init__.py | 6014 | # Required for Python to search this directory for module files
|
ecoal95/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/minimize_window/user_prompts.py | 40 | # META: timeout=long
import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
from tests.support.helpers import document_hidden
def minimize(session):
return session.transport.send(
"POST", "session/{session_id}/window/minimize".format(**vars(session)))
@pyte... |
butchman0922/gourmet | refs/heads/master | gourmet/gtk_extras/ratingWidget.py | 1 | import gtk, gtk.gdk
import gobject
import gourmet.gglobals as gglobals
import os.path
from gettext import gettext as _
import tempfile
try:
from PIL import Image
except ImportError:
import Image
PLUS_ONE_KEYS = ['plus',
'greater',
#'Up',
#'Right',
... |
michael-donat/ansible | refs/heads/devel | lib/ansible/cli/__init__.py | 62 | # (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... |
norayr/unisubs | refs/heads/staging | apps/auth/migrations/0002_auto__add_customuser.py | 5 | # encoding: 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 model 'CustomUser'
db.create_table('auth_customuser', (
('picture', self.gf('djan... |
RealTimeWeb/wikisite | refs/heads/master | MoinMoin/action/__init__.py | 1 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - Action Implementation
Actions are triggered by the user clicking on special links on the page
(e.g. the "edit" link). The name of the action is passed in the "action"
CGI parameter.
The sub-package "MoinMoin.action" contains external actions, you can
... |
zhaoxin54430/zhaoxin_test | refs/heads/master | scripts/dl_cleanup.py | 180 | #!/usr/bin/env python
"""
# OpenWrt download directory cleanup utility.
# Delete all but the very last version of the program tarballs.
#
# Copyright (C) 2010 Michael Buesch <mb@bu3sch.de>
# Copyright (C) 2013 OpenWrt.org
"""
import sys
import os
import re
import getopt
# Commandline options
opt_dryrun = False
def ... |
ric2b/Vivaldi-browser | refs/heads/master | chromium/third_party/yasm/run_yasm.py | 3 | # Copyright 2014 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.
"""A wrapper to run yasm.
Its main job is to provide a Python wrapper for GN integration, and to write
the makefile-style output yasm generates in stdout to... |
dgoodwin/kubernetes | refs/heads/master | cluster/juju/return-node-ips.py | 583 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... |
mxOBS/deb-pkg_trusty_chromium-browser | refs/heads/master | tools/telemetry/telemetry/core/user_agent.py | 36 | # Copyright 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.
UA_TYPE_MAPPING = {
'desktop':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) '
'AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/40.0.2... |
liucode/tempest-master | refs/heads/master | tempest/services/volume/json/extensions_client.py | 9 | # Copyright 2012 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... |
tpo/ansible | refs/heads/devel | test/support/windows-integration/plugins/modules/win_lineinfile.py | 68 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_linein... |
wbhuber/local_swift_branch | refs/heads/master | test/probe/test_container_sync.py | 25 | #!/usr/bin/python -u
# 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
# ... |
ddbeck/NaNoGenMo2014 | refs/heads/master | novelist/game.py | 1 | # -*- coding: utf-8 -*-
import collections
from copy import deepcopy
import random
from astropy.time import Time, TimeDelta
JD_FUTURE_OFFSET = 112131.75
JD_TICK_RATE = 1.0833
Adjacencies = collections.namedtuple('Adjacencies', 'up down left right')
class Sector(object):
def __init__(self, x, y):
self.... |
bdrumheller/drf-image-upload | refs/heads/master | quickstart/migrations/0004_image_url.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-30 06:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quickstart', '0003_auto_20170830_0602'),
]
operations = [
migrations.AddFie... |
tboyce021/home-assistant | refs/heads/dev | tests/components/tado/test_climate.py | 21 | """The sensor tests for the tado platform."""
from .util import async_init_integration
async def test_air_con(hass):
"""Test creation of aircon climate."""
await async_init_integration(hass)
state = hass.states.get("climate.air_conditioning")
assert state.state == "cool"
expected_attributes = ... |
BassantMorsi/finderApp | refs/heads/master | lib/python2.7/site-packages/numpy/core/tests/test_unicode.py | 33 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.compat import asbytes, unicode, sixu
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal)
# Guess the UCS length for this python interpreter
if sys.version_info[... |
shuangshuangwang/spark | refs/heads/master | python/pyspark/ml/tests/test_evaluation.py | 8 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
marios-zindilis/musicbrainz-django-models | refs/heads/master | musicbrainz_django_models/tests/test_editor_collection_type.py | 1 | from django.test import TestCase
from django.core.exceptions import ValidationError
from ..models import editor_collection_type
class test_editor_collection_type(TestCase):
def setUp(self):
self.subject = editor_collection_type(name='Name')
def test__editor_collection_type__instance(self):
se... |
jeffery-do/Vizdoombot | refs/heads/master | doom/lib/python3.5/site-packages/networkx/generators/tests/test_stochastic.py | 47 | from nose.tools import assert_true, assert_equal, raises
import networkx as nx
def test_stochastic():
G=nx.DiGraph()
G.add_edge(0,1)
G.add_edge(0,2)
S=nx.stochastic_graph(G)
assert_true(nx.is_isomorphic(G,S))
assert_equal(sorted(S.edges(data=True)),
[(0, 1, {'weight': 0.5}),
... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/building/corellia/filler_building_corellia_style_06.py | 85615 | import sys
def setup(core, object):
return |
tudorbarascu/QGIS | refs/heads/master | cmake/FindLibPython.py | 101 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
# 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... |
chrisndodge/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/course_nav.py | 26 | """
Course navigation page object
"""
import re
from bok_choy.page_object import PageObject, unguarded
from bok_choy.promise import EmptyPromise
class CourseNavPage(PageObject):
"""
Navigate sections and sequences in the courseware.
"""
url = None
def is_browser_on_page(self):
return se... |
adrienbrault/python-plexapi | refs/heads/master | setup.py | 6 | #!/usr/bin/python
"""
Install PlexAPI
"""
from distutils.core import setup
from setuptools import find_packages
# Fetch the current version
with open('plexapi/__init__.py') as handle:
for line in handle.readlines():
if line.startswith('VERSION'):
VERSION = line.split('=')[1].strip(" '\n")
setu... |
tinloaf/home-assistant | refs/heads/dev | homeassistant/components/tradfri/__init__.py | 4 | """
Support for IKEA Tradfri.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/ikea_tradfri/
"""
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
import homeassista... |
peregrinius/web2py-liscio | refs/heads/master | languages/plural-en.py | 146 | #!/usr/bin/env python
{
# "singular form (0)": ["first plural form (1)", "second plural form (2)", ...],
'account': ['accounts'],
'book': ['books'],
'is': ['are'],
'man': ['men'],
'miss': ['misses'],
'person': ['people'],
'quark': ['quarks'],
'shop': ['shops'],
'this': ['these'],
'was': ['were'],
'woman': ['women'],
}
|
TranscranialOrchestra/BitCollector | refs/heads/master | src/2.7/Web/app/main/forms.py | 2 | from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, BooleanField, SelectField,\
SubmitField
from wtforms.validators import Required, Length, Email, Regexp
from wtforms import ValidationError
class GenerateConfiguration(Form):
name = StringField('Real name', validators=[Length(0, 64)]... |
Data-Scientist/LP01_DSWAC_0706 | refs/heads/master | classification/simrank_reduce.py | 1 | #!/usr/bin/python
# coding=utf8
import sys
BETA = 0.8
def main():
if len(sys.argv) < 2:
sys.stderr.write("Missing args: %s\n" % ":".join(sys.argv))
sys.exit(1)
# These are the known labels in the data and hence the sources of rank
with open(sys.argv[1]) as f:
sources = set(f.read().splitlines()... |
delinhabit/django | refs/heads/master | tests/template_tests/test_parser.py | 288 | """
Testing some internals of the template processing. These are *not* examples to be copied in user code.
"""
from __future__ import unicode_literals
from unittest import TestCase
from django.template import Library, TemplateSyntaxError
from django.template.base import (
TOKEN_BLOCK, FilterExpression, Parser, To... |
wakermahmud/sync-engine | refs/heads/master | migrations/versions/024_remote_folders_and_inbox_tags_split.py | 8 | """more folder names, separate remote folders and inbox tags
Revision ID: 4c1eb89f6bed
Revises: 4c529b9bc68d
Create Date: 2014-05-01 02:20:00.936927
"""
# revision identifiers, used by Alembic.
revision = '4c1eb89f6bed'
down_revision = '4e04f752b7ad'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.o... |
hzanoli/AliPhysics | refs/heads/master | PWGJE/EMCALJetTasks/Tracks/analysis/write/MonteCarloWriter.py | 41 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... |
oouyang/fxos-certsuite | refs/heads/master | mcts/web-platform-tests/tests/tools/pywebsocket/src/test/test_util.py | 449 | #!/usr/bin/env python
#
# Copyright 2011, 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... |
christianurich/VIBe2UrbanSim | refs/heads/master | 3rdparty/opus/src/opus_core/store/delimited_storage.py | 2 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
import os
import re
import csv
from glob import glob
from numpy import array, dtype
from opus_core.opus_error import OpusError
from opus_core... |
kemalakyol48/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/badsyntax_future3.py | 383 | """This is a test"""
from __future__ import nested_scopes
from __future__ import rested_snopes
def f(x):
def g(y):
return x + y
return g
result = f(2)(4)
|
fujunwei/chromium-crosswalk | refs/heads/master | chrome/common/extensions/docs/server2/manifest_features_test.py | 122 | #!/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.
import unittest
from manifest_features import ConvertDottedKeysToNested
class ManifestFeaturesTest(unittest.TestCase):
def testConv... |
salguarnieri/intellij-community | refs/heads/master | python/testData/quickFixes/AddMethodQuickFixTest/addMethodReplacePass_after.py | 83 | class A:
def y(self):
pass
a = A()
a.y()
|
farooqsheikhpk/Aspose_Words_Cloud | refs/heads/master | SDKs/Aspose.Words-Cloud-SDK-for-Python/asposewordscloud/models/DocumentFormat.py | 4 | #!/usr/bin/env python
class DocumentFormat(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.