repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
WillisXChen/django-oscar | refs/heads/master | oscar/lib/python2.7/site-packages/django/contrib/staticfiles/views.py | 581 | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import os
import posixpath
from django.conf import settings
from django.contrib.staticfiles import finders
from django.http import Http404
from django.utils.six.moves.url... |
dibaunaumh/tikal-corp-website | refs/heads/master | cms/migrations/0021_publisher2.py | 3 |
from south.db import db
from cms.models import *
from django.db import models
class Migration:
def forwards(self, orm):
# Adding field 'CMSPlugin.publisher_is_draft'
db.add_column('cms_cmsplugin', 'publisher_is_draft', orm['cms.cmsplugin:publisher_is_draft'])
# Addin... |
ddboline/pylearn2 | refs/heads/master | pylearn2/datasets/tests/test_cifar10.py | 45 | import unittest
import numpy as np
from pylearn2.datasets.cifar10 import CIFAR10
from pylearn2.space import Conv2DSpace
from pylearn2.testing.skip import skip_if_no_data
class TestCIFAR10(unittest.TestCase):
def setUp(self):
skip_if_no_data()
self.test = CIFAR10(which_set='test')
def test_to... |
anksp21/Community-Zenpacks | refs/heads/master | ZenPacks.community.LLDP/ZenPacks/community/LLDP/tests/__init__.py | 309 | # ##########################################################################
#
# This program is part of Zenoss Core, an open source monitoring platform.
# Copyright (C) 2008, Zenoss Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License vers... |
Zhongqilong/kbengine | refs/heads/master | kbe/src/lib/python/Lib/colorsys.py | 144 | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly... |
Aloomaio/kafka-python | refs/heads/master | test/test_fetcher.py | 1 | # pylint: skip-file
from __future__ import absolute_import
import pytest
from collections import OrderedDict
import itertools
import time
from kafka.client_async import KafkaClient
from kafka.consumer.fetcher import (
CompletedFetch, ConsumerRecord, Fetcher, NoOffsetForPartitionError
)
from kafka.consumer.subscr... |
shsingh/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_system_ntp.py | 21 | # Copyright 2019 Fortinet, 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
hellhovnd/django | refs/heads/master | tests/utils_tests/html.py | 4 | from __future__ import unicode_literals
from datetime import datetime
import os
from django.utils import html
from django.utils._os import upath
from django.utils.unittest import TestCase
class TestUtilsHtml(TestCase):
def check_output(self, function, value, output=None):
"""
Check that functio... |
charbeljc/OCB | refs/heads/8.0 | addons/pad_project/__init__.py | 441 | # -*- 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... |
cntnboys/410Lab6 | refs/heads/master | v1/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py | 78 | from django.db.models.sql import compiler
from django.utils.six.moves import zip_longest
class SQLCompiler(compiler.SQLCompiler):
def resolve_columns(self, row, fields=()):
values = []
index_extra_select = len(self.query.extra_select)
for value, field in zip_longest(row[index_extra_select:... |
IndieBeto/moggy | refs/heads/moggy | scripts/build-all.py | 1474 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... |
wildfireone/ghost | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_asybuiltins.py | 369 | # -*- coding: utf-8 -*-
"""
pygments.lexers._asybuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the asy-function names and asy-variable names of
Asymptote.
Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand.
TODO: perl/python script in Asymptote SVN similar to asy-list.pl but onl... |
NixaSoftware/CVis | refs/heads/master | venv/lib/python2.7/site-packages/pandas/tests/groupby/test_bin_groupby.py | 8 | # -*- coding: utf-8 -*-
import pytest
from numpy import nan
import numpy as np
from pandas.core.dtypes.common import _ensure_int64
from pandas import Index, isna
from pandas.util.testing import assert_almost_equal
import pandas.util.testing as tm
from pandas._libs import lib, groupby
def test_series_grouper():
... |
nthien/pulp | refs/heads/master | server/pulp/plugins/importer.py | 6 | import sys
class Importer(object):
"""
Base class for Pulp content importers for a single repository. Importers
must subclass this class in order for Pulp to identify it as a valid
importer during discovery.
"""
# -- plugin lifecycle -----------------------------------------------------
... |
cognitiveclass/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/course-settings.py | 33 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror, upload_file
from django.conf import settings
from nose.tools import assert_true, assert_false
TEST_ROOT = settings.COMMON_T... |
smmribeiro/intellij-community | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/GenericUserFunctions.py | 10 | def test():
def f1(xs):
"""
:type xs: collections.Iterable of T
"""
return iter(xs).next()
def f2(x, xs, z):
"""
:type x: T
:type xs: list of T
:type z: U
"""
return x in xs
def id(x):
"""
:type x: T
:r... |
otdw/ansible-modules-core | refs/heads/devel | cloud/openstack/os_server_facts.py | 17 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... |
christopher-henderson/Experiments | refs/heads/master | structures/BinaryTree/Node/__init__.py | 2 | from node import Node |
ningchi/scikit-learn | refs/heads/master | sklearn/utils/tests/test_metaestimators.py | 251 | from sklearn.utils.metaestimators import if_delegate_has_method
from nose.tools import assert_true
class Prefix(object):
def func():
pass
class MockMetaEstimator(object):
"""This is a mock meta estimator"""
a_prefix = Prefix()
@if_delegate_has_method(delegate="a_prefix")
def func(self):... |
olapaola/olapaola-android-scripting | refs/heads/master | python/src/Lib/multiprocessing/__init__.py | 52 | #
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 't... |
frank2/paranoia | refs/heads/master | lib/base/disk.py | 1 | #!/usr/bin/env python
import ctypes
import os
from paranoia.fundamentals import memmove
from paranoia.base.allocator import allocators, VirtualAllocator, VirtualAllocation, VirtualAddress
from paranoia.base.paranoia_agent import ParanoiaAgent, ParanoiaError
from paranoia.base.size import Size
__all__ = ['DiskError',... |
vv1133/home_web | refs/heads/master | django/contrib/gis/geos/coordseq.py | 219 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import c_double, c_uint, byref
from django.contrib.gis.geos.base import GEOSBase, numpy
from django.contrib.gis.geos.error impo... |
hfp/tensorflow-xsmm | refs/heads/master | tensorflow/python/keras/applications/resnet50.py | 11 | # 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... |
cschenck/blender_sim | refs/heads/master | fluid_sim_deps/blender-2.69/2.69/python/lib/python3.3/ctypes/macholib/framework.py | 320 | """
Generic framework path manipulation
"""
import re
__all__ = ['framework_info']
STRICT_FRAMEWORK_RE = re.compile(r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
(?P<shortname>\w+).framework/
(?:Versions/(?P<version>[^/]+)/)?
(?P=shortname)
(?:_(?P<suffix>[^_]+))?
)$
""")
def framework_info(filename):... |
tmeits/pybrain | refs/heads/master | examples/optimization/optimizers_for_rl.py | 26 | from __future__ import print_function
#!/usr/bin/env python
"""
Illustrating how to use optimization algorithms in a reinforcement learning framework.
"""
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import fListToString
from pybrain.rl.environments.cartpole.balancetask import BalanceTask
from pybra... |
kurli/blink-crosswalk | refs/heads/master | Source/build/scripts/make_element_lookup_trie.py | 34 | #!/usr/bin/env python
# Copyright (C) 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... |
837468220/python-for-android | refs/heads/master | python-build/python-libs/gdata/src/gdata/contacts/__init__.py | 134 | #!/usr/bin/python
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
chrisfranzen/django | refs/heads/master | tests/regressiontests/servers/tests.py | 2 | # -*- encoding: utf-8 -*-
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import os
try:
from urllib.request import urlopen, HTTPError
except ImportError: # Python 2
from urllib2 import urlopen, HTTPError
from django.core.exceptions import ImproperlyConfigured
from django.te... |
natenka/natenka.github.io | refs/heads/master | code_examples/python_with/with_sqlite3_conn_contextmanager.py | 2 | import contextlib
import sqlite3
@contextlib.contextmanager
def sqlite3_connection(db_name):
connection = sqlite3.connect(db_name)
yield connection
connection.close()
with sqlite3_connection('dhcp_snooping.db') as conn:
for row in conn.execute('select * from dhcp'):
print(row)
try:
conn.... |
hobinyoon/apache-cassandra-2.2.3-src | refs/heads/master | mtdb/plots/sstable-accesses/obsoloted/by-sstables-by-time/_gen-data-for-plot.py | 1 | #!/usr/bin/env python
# TODO: This will be obsoloted.
import os
import string
import sys
import datetime
sys.path.insert(0, "../../../util/python")
import Util
_fn_in = None
_fn_out = None
_simulated_time_in_year = None
class ReadCnt:
def __init__(self, r, fp, tp):
self.reads = r
self.bf_fp = fp
self.bf_tp ... |
joequery/django | refs/heads/master | tests/admin_views/views.py | 470 | from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponse
@staff_member_required
def secure_view(request):
return HttpResponse('%s' % request.POST)
@staff_member_required(redirect_field_name='myfield')
def secure_view2(request):
return HttpResponse('%s' % r... |
mfrey/baltimore | refs/heads/master | analysis/energydeadseriesanalysis.py | 1 | #!/usr/bin/env python2.7
import sys
import math
import logging
import operator
import functools
import numpy as np
from .analysis import Analysis
class EnergyDeadSeriesAnalysis(Analysis):
def __init__(self, scenario, location, repetitions, csv):
Analysis.__init__(self, scenario, location, "energy-dead-se... |
uroy9ch/portfolio | refs/heads/master | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... |
AtteqCom/zsl | refs/heads/master | tests/resource/resource_helper_test.py | 1 | from unittest.case import TestCase
from sqlalchemy.orm import Session
from tests.resource.resource_test_helper import UserModel, create_resource_test_data
from zsl import Zsl
from zsl.resource.resource_helper import filter_from_url_arg
from zsl.testing.db import IN_MEMORY_DB_SETTINGS
class ModelResourceTest(TestCas... |
d40223223/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py | 735 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... |
haoxli/crosswalk-test-suite | refs/heads/master | embeddingapi/embedding-build-android-tests/gradle/crosswalk_local_gradle_build_all_app.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
PlayUAV/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/distutils/command/build_ext.py | 76 | """ Modified version of build_ext that handles fortran source files.
"""
import os
import sys
from glob import glob
from distutils.dep_util import newer_group
from distutils.command.build_ext import build_ext as old_build_ext
from distutils.errors import DistutilsFileError, DistutilsSetupError,\
DistutilsError
f... |
wkhtmltopdf/qtwebkit | refs/heads/wk_master | Tools/Scripts/webkitpy/common/watchlist/changedlinepattern_unittest.py | 124 | # Copyright (C) 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 ... |
obulpathi/cloud | refs/heads/master | ml/language/python/entities.py | 1 | import mlapi
text = 'Tom Sawyer is a book written by a guy known as Mark Twain.'
result = mlapi.entities(text)
print(result)
|
rkokkelk/CouchPotatoServer | refs/heads/master | libs/pyasn1/codec/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
mosaic-cloud/mosaic-distribution-dependencies | refs/heads/development | dependencies/nodejs/0.8.22/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | 25 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... |
UniPiTechnology/evok | refs/heads/master | evok/evok.py | 1 | #!/usr/bin/python
import os
from collections import OrderedDict
import ConfigParser
import tornado.httpserver
import tornado.httpclient
import tornado.ioloop
import tornado.web
import schemas
from operator import methodcaller
from tornado import gen
from tornado.options import define, options
from tornado import web... |
ufosky-server/zulip | refs/heads/master | zerver/management/commands/expunge_db.py | 118 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.retention_policy import get_UserMessages_to_expunge
from zerver.models import Message
class Command(BaseCommand):
help = ('Expunge old UserMessages and Messages from the database, '
... |
befair/gasistafelice | refs/heads/master-dj17 | test/integration/http/test_urls.py | 1 | #!/usr/bin/env python2
import Cookie
import cookielib
import collections
import sys
import urllib
import urllib2
from os.path import realpath
LEGACY_REST_PREFIX = "gasistafelice/rest/"
verbose = False
def get_cookie(base_url):
""" Init the session with the backend and return the session cookie """
auth_url... |
CMSS-BCRDB/RDS | refs/heads/master | trove/cmd/common.py | 4 | # Copyright 2014 Rackspace Hosting
# 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 require... |
jason-vallet/graph-ryder-api | refs/heads/master | graphtulip/createPostCommentTagTlp.py | 1 | from tulip import *
from py2neo import *
import configparser
import os
config = configparser.ConfigParser()
config.read("config.ini")
# todo create a unique Createtlp to avoid code duplication
class CreatePostCommentTagTlp(object):
def __init__(self, start, end, force_fresh):
super(CreatePostCommentTagTl... |
physion/pyjnius | refs/heads/master | tests/test_enum.py | 6 | import unittest
from jnius.reflect import autoclass
class SimpleEnum(unittest.TestCase):
def test_enum(self):
SimpleEnum = autoclass('org.jnius.SimpleEnum')
self.assertTrue(SimpleEnum)
def test_value(self):
SimpleEnum = autoclass('org.jnius.SimpleEnum')
self.assertTrue(Simpl... |
lrr-tum/mmbwmon | refs/heads/master | vendor/fast-lib/vendor/mosquitto-1.4.12/test/broker/07-will-null-topic.py | 10 | #!/usr/bin/env python
import struct
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))
if cmd_subfolder not in sys.path:
sys.... |
birdonwheels5/p2pool-dgbSkein | refs/heads/master | p2pool/test/bitcoin/test_sha256.py | 275 | from __future__ import division
import unittest
import hashlib
import random
from p2pool.bitcoin import sha256
class Test(unittest.TestCase):
def test_all(self):
for test in ['', 'a', 'b', 'abc', 'abc'*50, 'hello world']:
#print test
#print sha256.sha256(test).hexdigest()
... |
Konubinix/weboob | refs/heads/master | modules/mareeinfo/module.py | 7 | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# This file is part of weboob.
#
# weboob 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 opt... |
jinnykoo/wuyisj | refs/heads/master | tests/unit/core/loading_tests.py | 6 | from os.path import dirname
import unittest
import django
from django.test import TestCase
from django.conf import settings
from django.test.utils import override_settings
import oscar
from oscar.core.loading import (
get_model, AppNotFoundError, get_classes, get_class, ClassNotFoundError)
from tests import tempo... |
onovy/Arduino | refs/heads/master | arduino-core/src/processing/app/i18n/python/requests/packages/charade/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... |
yaakov300/ForexApp | refs/heads/master | lib/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 2057 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from ._implementati... |
dgjustice/ansible | refs/heads/devel | lib/ansible/modules/system/lvol.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>, Alexander Bulimov <lazywolf0@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 So... |
Yas3r/OWASP-ZSC | refs/heads/master | lib/encoder/freebsd_x86/add_yourvalue.py | 100 | #!/usr/bin/env python
'''
OWASP ZSC | ZCR Shellcoder
ZeroDay Cyber Research
Z3r0D4y.Com
Ali Razmjoo
'''
def start(type,shellcode,job):
if 'chmod(' in job:
shellcode = 'N' + shellcode
if 'dir_create(' in job:
shellcode = 'N' + shellcode
if 'download_execute(' in job:
shellcode = 'N' + shellcode
if 'download(... |
rhinstaller/anaconda | refs/heads/master | pyanaconda/modules/payloads/source/nfs/nfs_interface.py | 5 | #
# DBus interface for the NFS source module.
#
# Copyright (C) 2020 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This progr... |
NREL/glmgen | refs/heads/develop | glmgen/convert_cyme_model.py | 1 | '''
Created on Nov 19, 2013
@author: fish334
'''
import pyodbc
import feeder
import os
import re
import csv
import shutil
import math
import cmath
import copy
import add_glm_object_dictionary
import warnings
#glm_parameters is a list containing all the user inputs for the object in a certain order as strings
... |
ntt-sic/heat | refs/heads/master | heat/tests/test_scheduler.py | 1 | # 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... |
Solban/UX_UI_study_materials | refs/heads/master | api/rest/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
Athrun29/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/instances/panel.py | 23 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
chris-chambers/llvm | refs/heads/sbbm | utils/lit/lit/util.py | 24 | import errno
import itertools
import math
import os
import platform
import signal
import subprocess
import sys
def to_bytes(str):
# Encode to UTF-8 to get binary data.
return str.encode('utf-8')
def to_string(bytes):
if isinstance(bytes, str):
return bytes
return to_bytes(bytes)
def convert_s... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/graph_objs/funnel/marker/colorbar/_title.py | 2 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "funnel.marker.colorbar"
_path_str = "funnel.marker.colorbar.title"
_valid_props = {"font", "s... |
Jgarcia-IAS/localizacion | refs/heads/master | openerp/report/int_to_text.py | 442 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
andrewyoung1991/abjad | refs/heads/master | abjad/tools/scoretools/test/test_scoretools_NoteHead_is_forced.py | 2 | # -*- encoding: utf-8 -*-
from abjad import *
def test_scoretools_NoteHead_is_forced_01():
note_head = scoretools.NoteHead(written_pitch="c'")
assert note_head.is_forced is None
note_head.is_forced = True
assert note_head.is_forced == True
note_head.is_forced = False
assert note_head.is_force... |
Intel-tensorflow/tensorflow | refs/heads/master | tensorflow/compiler/mlir/tfr/python/tfr_gen_test.py | 5 | # Copyright 2020 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... |
buntyke/Flask | refs/heads/master | microblog/flask/lib/python2.7/site-packages/pip/_vendor/html5lib/trie/_base.py | 1735 | from __future__ import absolute_import, division, unicode_literals
from collections import Mapping
class Trie(Mapping):
"""Abstract base class for tries"""
def keys(self, prefix=None):
keys = super().keys()
if prefix is None:
return set(keys)
# Python 2.6: no set compre... |
sahilshekhawat/sympy | refs/heads/master | sympy/tensor/__init__.py | 93 | """A module to manipulate symbolic objects with indices including tensors
"""
from .indexed import IndexedBase, Idx, Indexed
from .index_methods import get_contraction_structure, get_indices
|
B-MOOC/edx-platform | refs/heads/master | common/djangoapps/enrollment/errors.py | 84 | """All Error Types pertaining to Enrollment."""
class CourseEnrollmentError(Exception):
"""Generic Course Enrollment Error.
Describes any error that may occur when reading or updating enrollment information for a user or a course.
"""
def __init__(self, msg, data=None):
super(CourseEnrollmen... |
fzalkow/scikit-learn | refs/heads/master | examples/classification/plot_lda.py | 164 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... |
root-mirror/root | refs/heads/master | interpreter/llvm/src/utils/gdb-scripts/prettyprinters.py | 25 | from __future__ import print_function
import sys
import gdb.printing
class Iterator:
def __iter__(self):
return self
if sys.version_info.major == 2:
def next(self):
return self.__next__()
def children(self):
return self
def escape_bytes(val, l):
return '"' + val.string(encoding='Latin... |
romankagan/DDBWorkbench | refs/heads/master | python/lib/Lib/site-packages/django/contrib/comments/urls.py | 293 | from django.conf.urls.defaults import *
urlpatterns = patterns('django.contrib.comments.views',
url(r'^post/$', 'comments.post_comment', name='comments-post-comment'),
url(r'^posted/$', 'comments.comment_done', name='comments-comment-done'),
url(r'^flag/(\d+)/$', 'moderation.... |
unhammer/finfaktura | refs/heads/master | finfaktura/oppgradering.py | 2 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (C) 2005-2009 Håvard Gulldahl
# <havard@lurtgjort.no>
#
# Lisens: GPL2
#
# $Id$
###########################################################################
# endringer er en linjeskiftseparert stren... |
zasdfgbnm/tensorflow | refs/heads/master | tensorflow/contrib/keras/api/keras/datasets/__init__.py | 133 | # 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... |
drptbl/augmented-traffic-control | refs/heads/master | atc/atcd/tests/test_sqlite_manager.py | 18 | #
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
#
import pytest
import s... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/npe/npe_hutt_heavy_s01.py | 85615 | import sys
def setup(core, object):
return |
nwjs/chromium.src | refs/heads/nw45-log | third_party/blink/web_tests/external/wpt/content-security-policy/embedded-enforcement/support/echo-required-csp.py | 12 | import json
def main(request, response):
message = {}
header = request.headers.get("Test-Header-Injection");
message['test_header_injection'] = header if header else None
header = request.headers.get("Sec-Required-CSP");
message['required_csp'] = header if header else None
second_level_iframe... |
samfoo/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/serve/serve.py | 6 | # -*- coding: utf-8 -*-
import argparse
import json
import os
import signal
import socket
import sys
import threading
import time
import traceback
import urllib2
import uuid
from collections import defaultdict
from multiprocessing import Process, Event
from .. import localpaths
import sslutils
from wptserve import s... |
tayfun/django | refs/heads/master | tests/urlpatterns_reverse/included_no_kwargs_urls.py | 452 | from django.conf.urls import url
from .views import empty_view
urlpatterns = [
url(r'^inner-no-kwargs/([0-9]+)/', empty_view, name="inner-no-kwargs")
]
|
openstack/heat | refs/heads/master | heat/engine/clients/os/keystone/__init__.py | 1 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
amaas-fintech/amaas-core-sdk-python | refs/heads/master | amaascore/transactions/utils.py | 1 | from __future__ import absolute_import, division, print_function, unicode_literals
import inspect
from amaascore.transactions.cash_transaction import CashTransaction
from amaascore.transactions.enums import CASH_TRANSACTION_TYPES
from amaascore.transactions.position import Position
from amaascore.transactions.transact... |
justathoughtor2/atomicApe | refs/heads/encaged | cygwin/lib/python2.7/compiler/visitor.py | 267 | from compiler import ast
# XXX should probably rename ASTVisitor to ASTWalker
# XXX can it be made even more generic?
class ASTVisitor:
"""Performs a depth-first walk of the AST
The ASTVisitor will walk the AST, performing either a preorder or
postorder traversal depending on which method is called.
... |
EvanK/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_dns_nameserver.py | 21 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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
if sys.version_info < (2... |
windelbouwman/ppci-mirror | refs/heads/master | test/arch/test_armasm.py | 1 | import unittest
import io
from test_asm import AsmTestCaseBase
from ppci.binutils.layout import Layout
class ArmAssemblerTestCase(AsmTestCaseBase):
""" ARM-mode (not thumb-mode) instruction assembly test case """
march = 'arm'
def test_mov_imm(self):
self.feed('mov r4, 100')
self.check('6... |
staranjeet/fjord | refs/heads/master | vendor/packages/click/tests/test_arguments.py | 11 | # -*- coding: utf-8 -*-
import click
def test_nargs_star(runner):
@click.command()
@click.argument('src', nargs=-1)
@click.argument('dst')
def copy(src, dst):
click.echo('src=%s' % '|'.join(src))
click.echo('dst=%s' % dst)
result = runner.invoke(copy, ['foo.txt', 'bar.txt', 'dir']... |
tux-00/ansible | refs/heads/devel | lib/ansible/modules/cloud/webfaction/webfaction_app.py | 63 | #!/usr/bin/python
#
# Create a Webfaction application using Ansible and the Webfaction API
#
# Valid application types can be found by looking here:
# http://docs.webfaction.com/xmlrpc-api/apps.html#application-types
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015, with contributions... |
yasyf/bcferries | refs/heads/master | bcferries/bcferries.py | 1 | from api import BCFerriesAPI
from terminal import BCFerriesTerminal
from abstract import BCFerriesAbstractObject
from decorators import cacheable, fuzzy
from urlparse import urlparse
from geopy.distance import distance
import functools32, os
class BCFerries(BCFerriesAbstractObject):
DEFAULT_API_ROOT = 'http://mobil... |
postvakje/sympy | refs/heads/master | sympy/core/symbol.py | 9 | from __future__ import print_function, division
from sympy.core.assumptions import StdFactKB
from sympy.core.compatibility import string_types, range
from .basic import Basic
from .sympify import sympify
from .singleton import S
from .expr import Expr, AtomicExpr
from .cache import cacheit
from .function import Functi... |
vr2262/framer | refs/heads/master | vlc/vlc.py | 3 | #! /usr/bin/python
# Python ctypes bindings for VLC
#
# Copyright (C) 2009-2012 the VideoLAN team
# $Id: $
#
# Authors: Olivier Aubert <olivier.aubert at liris.cnrs.fr>
# Jean Brouwers <MrJean1 at gmail.com>
# Geoff Salmon <geoff.salmon at gmail.com>
#
# This library is free software; you can redistr... |
zmarano/compute-image-packages | refs/heads/master | packages/python-google-compute-engine/google_compute_engine/constants.py | 6 | #!/usr/bin/python
# Copyright 2017 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 appli... |
roadmapper/ansible | refs/heads/devel | lib/ansible/modules/network/routeros/routeros_facts.py | 19 | #!/usr/bin/python
# 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'],
'support... |
HadiOfBBG/pegasusrises | refs/heads/master | gcs-client/demo/cloudstorage/test_utils.py | 248 | # Copyright 2013 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... |
itai12312/workspaces | refs/heads/master | hellodjango/venv/lib/python2.7/os.py | 4 | /usr/lib/python2.7/os.py |
maxfu/legacy_android_kernel_exynos4210 | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
kireal/docker-registry | refs/heads/master | docker_registry/extras/cors.py | 29 | # -*- coding: utf-8 -*-
def boot(application, config):
if config and config['origins']:
try:
from flask.ext.cors import CORS
for i in config.keys():
application.config['CORS_%s' % i.upper()] = config[i]
CORS(application)
except Exception as e:
... |
j-carl/boto | refs/heads/develop | boto/gs/resumable_upload_handler.py | 153 | # Copyright 2010 Google 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, modify, merge, publish, dis-
# trib... |
digling/sinotibetan | refs/heads/master | helper-2016-10-05-coverage.py | 1 | from pystdb import *
from lingpy import *
wl = load_sinotibetan(tsv=True)
concepts = wl.concepts
btext = '# Missing words in the STDB Database\n'
texts = []
for t in wl.taxa:
text = '## Missing words for {0}\n'.format(t)
_text = []
words = wl.get_dict(taxa=t)
for c in concepts:
if c not in word... |
shakamunyi/tensorflow | refs/heads/master | tensorflow/python/estimator/inputs/inputs.py | 94 | # 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... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/plaato/sensor.py | 8 | """Support for Plaato Airlock sensors."""
import logging
from homeassistant.const import PERCENTAGE
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.entity import Entity
from . import (
ATTR_ABV,
ATTR_BATCH_VOLUME,
ATTR_B... |
iostrovok/js-bratok | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/xcode_emulation.py | 428 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import copy
import gyp.common... |
benoitsteiner/tensorflow-opencl | refs/heads/master | tensorflow/python/training/evaluation_test.py | 62 | # 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 applicable ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.