repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
slashk/goldstone-server | refs/heads/master | goldstone/core/pagination.py | 2 | """Default pagination."""
# Copyright 2015 Solinea, Inc.
#
# Licensed under the Solinea Software License Agreement (goldstone),
# Version 1.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.solinea.com/goldstone/LICENSE.pdf
... |
liangjiaxing/sympy | refs/heads/master | sympy/strategies/core.py | 94 | """ Generic SymPy-Independent Strategies """
from __future__ import print_function, division
from sympy.core.compatibility import get_function_name
identity = lambda x: x
def exhaust(rule):
""" Apply a rule repeatedly until it has no effect """
def exhaustive_rl(expr):
new, old = rule(expr), expr
... |
Aristocles/CouchPotatoServer | refs/heads/master | libs/requests/packages/urllib3/connectionpool.py | 316 | # urllib3/connectionpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import sys
import errno
import logging
from socket import error as SocketError, timeout... |
pymedusa/Medusa | refs/heads/master | ext/boto/sqs/batchresults.py | 191 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Eucalyptus Systems, 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... |
foxichu/etherkeeper | refs/heads/master | etherkeeper/etherpad/migrations/0002_auto__chg_field_padauthor_folder__chg_field_padauthor_author.py | 2 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'PadAuthor.folder'
db.alter_column(u'etherpad_padauthor... |
alilotfi/django | refs/heads/master | django/test/__init__.py | 341 | """
Django Unit Test and Doctest framework.
"""
from django.test.client import Client, RequestFactory
from django.test.testcases import (
LiveServerTestCase, SimpleTestCase, TestCase, TransactionTestCase,
skipIfDBFeature, skipUnlessAnyDBFeature, skipUnlessDBFeature,
)
from django.test.utils import (
ignore... |
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v6/enums/types/call_placeholder_field.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
cleydson/scrapy | refs/heads/master | scrapy/utils/reqser.py | 110 | """
Helper functions for serializing (and deserializing) requests.
"""
import six
from scrapy.http import Request
from scrapy.utils.python import to_unicode, to_native_str
def request_to_dict(request, spider=None):
"""Convert Request object to a dict.
If a spider is given, it will try to find out the name o... |
bilalliberty/android_kernel_htc_liberty-villec2 | refs/heads/cm-11.0 | 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... |
Christewart/bitcoin | refs/heads/master | test/functional/rpc_zmq.py | 13 | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test for the ZMQ RPC methods."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... |
aredo/httpie | refs/heads/master | tests/test_stream.py | 49 | import pytest
from httpie.compat import is_windows
from httpie.output.streams import BINARY_SUPPRESSED_NOTICE
from utils import http, TestEnvironment
from fixtures import BIN_FILE_CONTENT, BIN_FILE_PATH
class TestStream:
# GET because httpbin 500s with binary POST body.
@pytest.mark.skipif(is_windows,
... |
marmyshev/transitions | refs/heads/master | openlp/plugins/alerts/lib/alertstab.py | 1 | # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... |
billputer/howl | refs/heads/master | tests/simple_http_test.py | 1 | """
simple_http_test.py
simple test for debugging
"""
import unittest, simplejson
from test_utils import WebCase, print_timing
class TestSimple(WebCase):
"""Simple test for debugging purposes"""
def testSimple(self):
"""Sends an HTTP request to 'player/status/'"""
self.getPage("player/status/", method = ... |
enochd/RMG-Py | refs/heads/master | external/cclib/progress/qt4progress.py | 24 | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision: 238 $"
from PyQt4 import QtGui,QtCore
class Qt4Progress(QtGui.QProgressDialog):
def __init__(self, title, parent=None):
QtGui.QPr... |
dcroc16/skunk_works | refs/heads/master | google_appengine/google/appengine/api/logservice/log_service_pb.py | 4 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
kittiu/odoo | refs/heads/8.0 | addons/crm/crm.py | 267 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
msiedlarek/grpc | refs/heads/master | src/python/grpcio/grpc/framework/alpha/__init__.py | 40 | # Copyright 2015, 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... |
slisson/intellij-community | refs/heads/master | python/testData/debug/test4.py | 68 | xval = 0
xvalue1 = 1
xvalue2 = 2
print(xvalue1 + xvalue2)
|
drammock/mne-python | refs/heads/main | examples/visualization/meg_sensors.py | 10 | """
.. _ex-plot-meg-sensors:
======================================
Plotting sensor layouts of MEG systems
======================================
Show sensor layouts of different MEG systems.
"""
# Author: Eric Larson <[email protected]>
#
# License: BSD (3-clause)
import os.path as op
import mne
from mne.io ... |
joopert/home-assistant | refs/heads/dev | tests/helpers/test_storage.py | 4 | """Tests for the storage helper."""
import asyncio
from datetime import timedelta
import json
from unittest.mock import patch, Mock
import pytest
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.helpers import storage
from homeassistant.util import dt
from tests.common import async_fire_ti... |
nhicher/ansible | refs/heads/devel | lib/ansible/modules/network/routing/net_static_route.py | 65 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
axbaretto/beam | refs/heads/master | sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/reporters/ureports/text_writer.py | 2 | # Copyright (c) 2015-2016 Claudiu Popa <[email protected]>
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
"""Text formatting drivers for ureports"""
from __future__ import print_function
from pylint.reporters.ur... |
Behemyth/LifeSim | refs/heads/master | LifeSim/Libraries/bullet/Demos/NativeClient/bin_html/httpd.py | 39 | #!/usr/bin/python
#
# Copyright (c) 2011, The Native Client 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 tiny web server.
This is intended to be used for testing, and only run from within the examples
directory.
"""
import... |
wkentaro/chainer | refs/heads/master | tests/chainer_tests/links_tests/loss_tests/test_black_out.py | 5 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import links
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'dtype': [numpy.float16, numpy.float32, numpy.float64]
}))
class TestBlackOut(unittest.TestCase):
bat... |
lttng/lttng-ci | refs/heads/master | automation/update_standalone.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 - Michael Jeanson <[email protected]>
#
# 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
#... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pygments-2.0.2/pygments/lexers/_mapping.py | 43 | # -*- coding: utf-8 -*-
"""
pygments.lexers._mapping
~~~~~~~~~~~~~~~~~~~~~~~~
Lexer mapping definitions. This file is generated by itself. Everytime
you change something on a builtin lexer definition, run this script from
the lexers folder to update it.
Do not alter the LEXERS dictionary by ha... |
marissazhou/django | refs/heads/master | tests/save_delete_hooks/models.py | 409 | """
Adding hooks before/after saving and deleting
To execute arbitrary code around ``save()`` and ``delete()``, just subclass
the methods.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Person(... |
LockScreen/Backend | refs/heads/master | venv/lib/python2.7/site-packages/requests/packages/urllib3/packages/six.py | 2374 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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... |
un33k/robotframework | refs/heads/master | src/robot/utils/error.py | 11 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
timhughes/gnome15 | refs/heads/master | src/gnome15/util/g15cairo.py | 8 | # Gnome15 - Suite of tools for the Logitech G series keyboards and headsets
# Copyright (C) 2010 Brett Smith <[email protected]>
# Copyright (C) 2013 Nuno Araujo <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... |
blacklin/kbengine | refs/heads/master | kbe/src/lib/python/Lib/functools.py | 68 | """functools.py - Tools for working with functions and callable objects
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>,
# Raymond Hettinger <python at rcn.com>,
# and Łukasz Langa <lukasz... |
zouyapeng/horizon_change | refs/heads/juno | openstack_dashboard/dashboards/project/routers/extensions/routerrules/tabs.py | 11 | # Copyright 2013
#
# 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 writi... |
annatisch/autorest | refs/heads/master | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/auto_rest_parameter_grouping_test_service.py | 3 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
NexusIS/libcloud | refs/heads/trunk | docs/examples/compute/vsphere/connect_host.py | 56 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.VSPHERE)
driver = cls(host='192.168.1.100',
username='admin', password='admin')
print(driver.list_nodes())
# ...
|
snakeleon/YouCompleteMe-x86 | refs/heads/master | third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_api/test_unicode.py | 27 | # -*- coding: utf-8 -*-
"""
All character set and unicode related tests.
"""
from jedi import Script
from jedi._compatibility import u, unicode
def test_unicode_script():
""" normally no unicode objects are being used. (<=2.7) """
s = unicode("import datetime; datetime.timedelta")
completions = Script(s).... |
toshimasa-nasu/hbase | refs/heads/master | hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase.py | 47 | #
# Autogenerated by Thrift Compiler (0.9.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
... |
Adel-Magebinary/odoo | refs/heads/8.0 | addons/website_google_map/__init__.py | 1350 | import controllers
|
bigzz/linaro-aarch64 | refs/heads/arm64-v3.10 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
timeyyy/PyUpdater | refs/heads/master | pyupdater/vendor/PyInstaller/hooks/hook-tables.py | 10 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
ArianeFire/HaniCam | refs/heads/master | Hanicam/OpenCV/opencv-3.1.0/samples/python/hist.py | 5 | #!/usr/bin/env python
''' This is a sample for histogram plotting for RGB images and grayscale images for better understanding of colour distribution
Benefit : Learn how to draw histogram of images
Get familier with cv2.calcHist, cv2.equalizeHist,cv2.normalize and some drawing functions
Level : Beginner or... |
vmrob/needy | refs/heads/master | needy/sources/download.py | 1 | from __future__ import print_function
import io
import os
import binascii
import hashlib
import socket
import shutil
import sys
import tarfile
import tempfile
import time
import zipfile
import logging
try:
import urllib.request as urllib2
except ImportError:
import urllib2
from ..source import Source
class... |
e-democracy/edem.group.member.invite.csv | refs/heads/master | edem/group/__init__.py | 85 | # See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
|
ilmanzo/scratch_extensions | refs/heads/master | venv/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/sax.py | 1835 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... |
Forritarar-FS/Kastali | refs/heads/master | pythonHus/room44.py | 1 | from . import room
from tkinter import *
def do():
leid = room.grunnur(44)
print("Velkominn í herbergi 44.")
print("")
svar = input("Viltu fara í annað herbergi? [j/n] ").lower()
if(svar[0]=='j'):
print("")
herbVal = input("Í hvaða herbergi viltu fara: 43,34 eða 54? ")
if(herbVal=="43"):
leid.go("w")
el... |
AlexAsh/pygame15 | refs/heads/master | controller/mouse.py | 1 | """Handling mouse application actions"""
class MouseController:
"""Handling mouse application actions: press, release and move"""
MOUSE_BUTTON_LEFT = 1
def __init__(self, models):
self.status = ""
self.models = models
def release(self, event):
"""Handle mouse button release"... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/modules/network/aci/aci_bd_to_l3out.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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'],
... |
cogeorg/econlib | refs/heads/master | networkx/algorithms/tests/test_distance_measures.py | 66 | #!/usr/bin/env python
from nose.tools import *
import networkx
class TestDistance:
def setUp(self):
G=networkx.Graph()
from networkx import convert_node_labels_to_integers as cnlti
G=cnlti(networkx.grid_2d_graph(4,4),first_label=1,ordering="sorted")
self.G=G
def test_eccentric... |
tsl143/addons-server | refs/heads/master | src/olympia/migrations/626-override-outdated-jetpack-compat.py | 9 | from olympia import amo
from addons.models import Addon, CompatOverride, CompatOverrideRange
def run():
addons = (
Addon.objects
.filter(type=amo.ADDON_EXTENSION, appsupport__app=amo.FIREFOX.id,
_current_version__files__jetpack_version__isnull=False)
.exclude(_current_versi... |
supriyantomaftuh/pip | refs/heads/develop | pip/_vendor/distlib/util.py | 224 | #
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... |
Huskerboy/startbootstrap-freelancer | refs/heads/master | freelancer_env/Lib/site-packages/pip/_vendor/packaging/version.py | 1151 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... |
edx/edx-platform | refs/heads/master | openedx/core/djangoapps/site_configuration/migrations/0004_add_site_values_field.py | 4 | # Generated by Django 1.11.28 on 2020-02-19 16:50
import collections
import jsonfield.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('site_configuration', '0003_auto_20200217_1058'),
]
operations = [
migrations.AddField(
mo... |
cs-au-dk/Artemis | refs/heads/master | WebKit/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py | 2 | # Copyright (c) 2009 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 ... |
Rocamadour7/ml_tutorial | refs/heads/master | 04. SVM/breast-cancer-example.py | 1 | import numpy as np
from sklearn import preprocessing, svm
from sklearn.model_selection import train_test_split
import pandas as pd
df = pd.read_csv('../03. KNN/breast-cancer-wisconsin.data.csv')
df.replace('?', -99999, inplace=True)
df.drop(['id'], 1, inplace=True)
X = np.array(df.drop(['class'], 1))
y = np.array(df[... |
fhueske/flink | refs/heads/master | flink-python/pyflink/common/tests/test_configuration.py | 26 | ################################################################################
# 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... |
openhatch/new-mini-tasks | refs/heads/master | vendor/packages/Django/scripts/manage_translations.py | 41 | #!/usr/bin/env python
#
# This python file contains utility scripts to manage Django translations.
# It has to be run inside the django git root directory.
#
# The following commands are available:
#
# * update_catalogs: check for new strings in core and contrib catalogs, and
# output how much string... |
OpenAgInitiative/openag-brain | refs/heads/master | nodes/sensor_persistence.py | 4 | #!/usr/bin/python
"""
The `sensor_persistence.py` module listens for measurements of the ambient
conditions of an environment and writes those measurements to the CouchDB
instance. There should be exactly one instance of this module per environment
in the system.
"""
import sys
import time
import rospy
import rostopi... |
sanjeevtripurari/hue | refs/heads/master | desktop/libs/libzookeeper/src/libzookeeper/conf.py | 24 | #!/usr/bin/env python
# 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 ma... |
gEt-rIgHt-jR/voc | refs/heads/master | tests/builtins/test_slice.py | 4 | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class SliceTests(TranspileTestCase):
pass
class BuiltinSliceFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["slice"]
not_implemented = [
'test_bool',
'test_bytearray',
'test_bytes',
'... |
kogotko/carburetor | refs/heads/master | openstack_dashboard/dashboards/admin/flavors/urls.py | 2 | # 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... |
FranMachio/plugin.video.Machio.fran | refs/heads/master | servers/bayfiles.py | 35 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para bayfiles
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core... |
kurgm/Bitmap2OTF | refs/heads/master | bitmap2otf/dotshape.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import re
def _intorfloat(v):
vi = int(v)
if v == vi:
return vi
return v
def _vec2string(x, y, suf=""):
i... |
si618/pi-time | refs/heads/master | node_modules/grunt-pylint/tasks/lib/astroid/tests/testdata/python2/data/noendingnewline.py | 42 | import unittest
class TestCase(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
def tearDown(self):
unittest.TestCase.tearDown(self)
def testIt(self):
self.a = 10
self.xxx()
def xxx(self):
if False:
pass
print 'a'
... |
truetone/AutobahnPython | refs/heads/master | examples/websocket/echo_wsgi/server.py | 26 | ###############################################################################
##
## Copyright 2012 Tavendo GmbH
##
## 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... |
kifcaliph/odoo | refs/heads/8.0 | addons/base_geolocalize/models/res_partner.py | 239 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
rahushen/ansible | refs/heads/devel | lib/ansible/plugins/lookup/credstash.py | 96 | # (c) 2015, Ensighten <[email protected]>
# (c) 2017 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
DOCUMENTATION = """
lookup: credstash
version_added: "2.0"
... |
drexly/tonginBlobStore | refs/heads/master | lib/django/contrib/sessions/backends/cache.py | 227 | from django.conf import settings
from django.contrib.sessions.backends.base import CreateError, SessionBase
from django.core.cache import caches
from django.utils.six.moves import range
KEY_PREFIX = "django.contrib.sessions.cache"
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
... |
psgganesh/sparkplug | refs/heads/master | packages/Sparkplug/Admin/src/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/setup.py | 2462 | #!/usr/bin/env python
# Copyright (c) 2009 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.
from setuptools import setup
setup(
name='gyp',
version='0.1',
description='Generate Your Projects',
author='Chromium Authors',
a... |
Limags/MissionPlanner | refs/heads/master | Lib/email/utils.py | 53 | # Copyright (C) 2001-2010 Python Software Foundation
# Author: Barry Warsaw
# Contact: [email protected]
"""Miscellaneous utilities."""
__all__ = [
'collapse_rfc2231_value',
'decode_params',
'decode_rfc2231',
'encode_rfc2231',
'formataddr',
'formatdate',
'getaddresses',
... |
apache/airflow | refs/heads/main | airflow/providers/google/cloud/transfers/gcs_to_bigquery.py | 2 | #
# 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... |
ahb0327/intellij-community | refs/heads/master | python/testData/inspections/PyUnboundLocalVariableInspection/DefaultArgument.py | 83 | def f():
z = 2
def g(z=z): #pass
return z
return g
|
carsonmcdonald/selenium | refs/heads/master | py/test/selenium/webdriver/common/window_switching_tests.py | 60 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
Ballz0fSteel/Umeko | refs/heads/master | lib/youtube_dl/extractor/toypics.py | 50 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
import re
class ToypicsIE(InfoExtractor):
IE_DESC = 'Toypics video'
_VALID_URL = r'https?://videos\.toypics\.net/view/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://videos.toypics.net/view/514/chancebulged,-2-1/',... |
mrg666/android_kernel_icon | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
wong2/sentry | refs/heads/master | tests/sentry/metrics/test_statsd.py | 27 | from __future__ import absolute_import
from mock import patch
from sentry.metrics.statsd import StatsdMetricsBackend
from sentry.testutils import TestCase
class StatsdMetricsBackendTest(TestCase):
def setUp(self):
self.backend = StatsdMetricsBackend(prefix='sentrytest.')
@patch('statsd.StatsClient.... |
Aloomaio/googleads-python-lib | refs/heads/master | examples/adwords/v201806/misc/upload_media_bundle.py | 1 | #!/usr/bin/env python
#
# Copyright 2016 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 requir... |
vmindru/ansible | refs/heads/devel | test/units/modules/network/iosxr/test_iosxr_system.py | 59 | # (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... |
neerajvashistha/pa-dude | refs/heads/master | lib/python2.7/site-packages/numpy/compat/_inspect.py | 114 | """Subset of inspect module from upstream python
We use this instead of upstream because upstream inspect is slow to import, and
significanly contributes to numpy import times. Importing this copy has almost
no overhead.
"""
from __future__ import division, absolute_import, print_function
import types
__all__ = ['g... |
etos/django | refs/heads/master | django/contrib/sessions/exceptions.py | 931 | from django.core.exceptions import SuspiciousOperation
class InvalidSessionKey(SuspiciousOperation):
"""Invalid characters in session key"""
pass
class SuspiciousSession(SuspiciousOperation):
"""The session may be tampered with"""
pass
|
deeplook/bokeh | refs/heads/master | sphinx/source/docs/user_guide/source_examples/plotting_line_missing_points.py | 63 | from bokeh.plotting import figure, output_file, show
output_file("line.html")
p = figure(plot_width=400, plot_height=400)
# add a line renderer with a NaN
nan = float('nan')
p.line([1, 2, 3, nan, 4, 5], [6, 7, 2, 4, 4, 5], line_width=2)
show(p)
|
fabiobatalha/crossrefapi | refs/heads/master | tests/test_restful.py | 1 | # coding: utf-8
import unittest
from crossref import restful
from crossref import VERSION
class RestfulTest(unittest.TestCase):
"""
These tests are testing the API live integration, the main purpouse of these
testes is to validate the JSON structure of the API results.
These tests may lead to connec... |
dbarbier/ot-svn | refs/heads/master | python/doc/sphinxext/numpydoc/docscrape.py | 3 | """Extract reference documentation from the NumPy source tree.
"""
from __future__ import division, absolute_import, print_function
import inspect
import textwrap
import re
import pydoc
from warnings import warn
import collections
class Reader(object):
"""A line-based string reader.
"""
def __init__(... |
ecosoft-odoo/odoo | refs/heads/8.0 | addons/web_diagram/controllers/__init__.py | 1214 | from . import main
|
EarToEarOak/Wild-Find | refs/heads/master | wildfind/harrier/database.py | 1 | #!/usr/bin/env python
#
#
# Wild Find
#
#
# Copyright 2014 - 2017 Al Brown
#
# Wildlife tracking and mapping
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation
#
# This program is dist... |
kevinxucs/p2pool | refs/heads/master | p2pool/p2p.py | 21 | from __future__ import division
import math
import random
import sys
import time
from twisted.internet import defer, protocol, reactor
from twisted.python import failure, log
import p2pool
from p2pool import data as p2pool_data
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import deferral, p2proto... |
bcherry/bcherry | refs/heads/master | oldstuff/python/space/shot.py | 1 |
class Shot:
def __init__(self, |
YuriGural/erpnext | refs/heads/master | erpnext/docs/temp.py | 33 | import os, re
for basepath, folders, files in os.walk("."):
for f in files:
if f.endswith(".html") or f.endswith(".md"):
with open(os.path.join(basepath, f), "r") as c:
content = c.read()
for path in re.findall("""{{.?docs_base_url.?}}([^'"\)]*)""", content):
print path
|
eigentor/tommiblog | refs/heads/master | vendor/psy/psysh/test/tools/vis.py | 710 | """
vis.py
======
Ctypes based module to access libbsd's strvis & strunvis functions.
The `vis` function is the equivalent of strvis.
The `unvis` function is the equivalent of strunvis.
All functions accept unicode string as input and return a unicode string.
Constants:
----------
* to select alternate encoding for... |
MIPS/external-chromium_org | refs/heads/dev-mips-jb-kitkat | build/android/pylib/utils/apk_helper.py | 62 | # Copyright (c) 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.
"""Module containing utilities for apk packages."""
import re
from pylib import cmd_helper
def GetPackageName(apk_path):
"""Returns the package nam... |
gautamMalu/rootfs_xen_arndale | refs/heads/master | usr/lib/python2.7/email/encoders.py | 263 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: [email protected]
"""Encodings and related functions."""
__all__ = [
'encode_7or8bit',
'encode_base64',
'encode_noop',
'encode_quopri',
]
import base64
from quopri import encodestring as _encodestring
d... |
dhalleine/tensorflow | refs/heads/master | tensorflow/contrib/slim/python/slim/evaluation_test.py | 2 | # Copyright 2016 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 agree... |
satvikdhandhania/vit-11 | refs/heads/master | build/lib.linux-x86_64-2.7/moca/urls.py | 3 | from django.conf.urls.defaults import patterns, url, include
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
(r'^log/', include('requestlog.urls')),
(r'^admin/', include(admin.site.urls)),
# Pass anything that does... |
DeepThoughtTeam/tensorflow | refs/heads/master | tensorflow/python/client/session.py | 1 | # Copyright 2015 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 a... |
rameshbabu79/fabric | refs/heads/master | bddtests/events_pb2.py | 46 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: events.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... |
rayNymous/nupic | refs/heads/master | src/nupic/regions/KNNAnomalyClassifierRegion.py | 12 | # ----------------------------------------------------------------------
# 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... |
funkring/fdoo | refs/heads/8.0-fdoo | addons/mass_mailing/wizard/mail_compose_message.py | 308 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class MailComposeMessage(osv.TransientModel):
"""Add concept of mass mailing campaign to the mail.compose.message wizard
"""
_inherit = 'mail.compose.message'
_columns = {
'mass_mailing_campaign_id': fields.many2one(
'ma... |
bmanojlovic/ansible | refs/heads/devel | lib/ansible/modules/system/gluster_volume.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Taneli Leppä <[email protected]>
#
# This file is part of Ansible (sort of)
#
# 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 o... |
aosagie/spark | refs/heads/master | python/pyspark/ml/linalg/__init__.py | 4 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
mspark93/VTK | refs/heads/master | ThirdParty/Twisted/twisted/web/test/test_resource.py | 43 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.resource}.
"""
from twisted.trial.unittest import TestCase
from twisted.web.error import UnsupportedMethod
from twisted.web.resource import (
NOT_FOUND, FORBIDDEN, Resource, ErrorPage, NoResource, ForbiddenResourc... |
Thhhza/XlsxWriter | refs/heads/master | examples/unicode_polish_utf8.py | 9 | ##############################################################################
#
# A simple example of converting some Unicode text to an Excel file using
# the XlsxWriter Python module.
#
# This example generates a spreadsheet with some Polish text from a file
# with UTF8 encoded text.
#
# Copyright 2013-2015, John Mc... |
jeremiahyan/odoo | refs/heads/master | addons/website_form/controllers/main.py | 1 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import json
from psycopg2 import IntegrityError
from werkzeug.exceptions import BadRequest
from odoo import http, SUPERUSER_ID, _
from odoo.http import request
from odoo.tools import plaintext2html
from o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.