repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Laimiux/mydeatree | refs/heads/master | django/contrib/gis/gdal/tests/test_geom.py | 154 | from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, \
OGRException, OGRIndexError, SpatialReference, CoordTransform, \
GDAL_VERSION
from django.utils import unittest
from django.contrib.gis.geometry.test_data import TestDataMixin
class OGRGeomTest(unittest.TestCase, TestDataMixin):
"This tests th... |
diversys/wubi | refs/heads/master | src/urlgrabber/progress.py | 26 | # This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it w... |
steveb/heat | refs/heads/master | heat/tests/convergence/scenarios/update_replace_rollback.py | 11 | #
# 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
# ... |
DMLoy/ECommerceBasic | refs/heads/master | bin/bin/activate/lib/python2.7/site-packages/setuptools/command/install_lib.py | 454 | from distutils.command.install_lib import install_lib as _install_lib
import os
class install_lib(_install_lib):
"""Don't add compiled flags to filenames of non-Python files"""
def _bytecode_filenames (self, py_filenames):
bytecode_files = []
for py_file in py_filenames:
if not py_... |
shastikk/youtube-dl | refs/heads/master | devscripts/gh-pages/add-version.py | 174 | #!/usr/bin/env python3
from __future__ import unicode_literals
import json
import sys
import hashlib
import os.path
if len(sys.argv) <= 1:
print('Specify the version number as parameter')
sys.exit()
version = sys.argv[1]
with open('update/LATEST_VERSION', 'w') as f:
f.write(version)
versions_info = jso... |
SatoshiNXSimudrone/sl4a-damon-clone | refs/heads/master | python/src/Demo/pdist/cvslock.py | 47 | """CVS locking algorithm.
CVS locking strategy
====================
As reverse engineered from the CVS 1.3 sources (file lock.c):
- Locking is done on a per repository basis (but a process can hold
write locks for multiple directories); all lock files are placed in
the repository and have names beginning with "#cvs.... |
j2sol/ansible-modules-core | refs/heads/devel | database/mysql/mysql_variables.py | 48 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql variables
(c) 2013, Balazs Pocze <banyek@gawker.com>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU G... |
nirmeshk/oh-mainline | refs/heads/master | vendor/packages/django-extensions/django_extensions/tests/utils.py | 47 | # -*- coding: utf-8 -*-
UTILS_TRUNCATE_LETTERS_TESTS = """
>>> from django_extensions.utils.text import truncate_letters
>>> truncate_letters("hello tests", 100)
u'hello tests'
>>> truncate_letters("hello tests", 5)
u'hello...'
>>> for i in range(10,-1,-1): truncate_letters("hello tests", i),i
(u'hello test...', 10)
(... |
shipci/boto | refs/heads/develop | tests/unit/ec2/test_address.py | 3 | from tests.compat import mock, unittest
from boto.ec2.address import Address
class AddressTest(unittest.TestCase):
def setUp(self):
self.address = Address()
self.address.connection = mock.Mock()
self.address.public_ip = "192.168.1.1"
def check_that_attribute_has_been_set(self, name, ... |
msmolens/VTK | refs/heads/slicer-v6.3.0-2015-07-21-426987d | ThirdParty/Twisted/twisted/web/distrib.py | 63 | # -*- test-case-name: twisted.web.test.test_distrib -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Distributed web servers.
This is going to have to be refactored so that argument parsing is done
by each subprocess and not by the main web server (i.e. GET, POST etc.).
"""
# System Im... |
EE/bestja | refs/heads/master | addons/bestja_volunteer_fpbz/models.py | 2 | # -*- coding: utf-8 -*-
from openerp import models, fields
class DriversLicense(models.Model):
_name = 'volunteer.drivers_license'
name = fields.Char(required=True, string=u"nazwa")
class Volunteer(models.Model):
_inherit = 'res.users'
drivers_license = fields.Many2many(
'volunteer.drivers_... |
Fat-Zer/FreeCAD_sf_master | refs/heads/master | src/Mod/Path/PathScripts/post/jtech_post.py | 13 | # ***************************************************************************
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
gpetukhov/pybb | refs/heads/master | pybb/signals.py | 1 | from django.db.models.signals import post_save
from django.contrib.auth.models import User
from pybb.subscription import notify_topic_subscribers
from pybb.models import Post, Topic, Profile, ReadTracking
def post_saved(instance, **kwargs):
notify_topic_subscribers(instance)
profile = instance.user.pybb_pro... |
enzochiau/tablib | refs/heads/develop | tablib/packages/xlwt/examples/row_styles_empty.py | 20 | #!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman
__rev_id__ = """$Id: row_styles_empty.py 3309 2008-03-14 11:04:30Z chris $"""
from pyExcelerator import *
w = Workbook()
ws = w.add_sheet('Hey, Dude')
for i in range(6, 80):
fnt = Font()
fnt.height = i*20
style = XF... |
run2/citytour | refs/heads/master | 4symantec/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.py | 101 | # Copyright 2014 Donald Stufft
#
# 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, so... |
raiden-network/raiden | refs/heads/develop | raiden/tests/unit/test_raiden_event_handler.py | 1 | from typing import cast
from unittest.mock import Mock, call, patch
from uuid import UUID, uuid4
from raiden.constants import LOCKSROOT_OF_NO_LOCKS, RoutingMode
from raiden.network.proxies.token_network import ParticipantDetails, ParticipantsDetails
from raiden.raiden_event_handler import PFSFeedbackEventHandler, Raid... |
gunchleoc/django | refs/heads/master | tests/template_tests/filter_tests/test_dictsort.py | 342 | from django.template.defaultfilters import dictsort
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_sort(self):
sorted_dicts = dictsort(
[{'age': 23, 'name': 'Barbara-Ann'},
{'age': 63, 'name': 'Ra Ra Rasputin'},
{'name': 'Jonny B... |
leo524/7mos-fourm | refs/heads/master | node_modules/nodebb-plugin-markdown/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/modeline.py | 292 | # -*- coding: utf-8 -*-
"""
pygments.modeline
~~~~~~~~~~~~~~~~~
A simple modeline parser (based on pymodeline).
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
__all__ = ['get_filetype_from_buffer']
modeline_re = re.compil... |
d1hotpep/openai_gym | refs/heads/master | gym/envs/doom/doom_take_cover.py | 2 | import logging
from gym.envs.doom import doom_env
logger = logging.getLogger(__name__)
class DoomTakeCoverEnv(doom_env.DoomEnv):
"""
------------ Training Mission 8 - Take Cover ------------
This map is to train you on the damage of incoming missiles.
It is a rectangular map with monsters firing miss... |
alash3al/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/hello/gyptest-disable-regyp.py | 501 | #!/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.
"""
Verifies that Makefiles don't get rebuilt when a source gyp file changes and
the disable_regeneration generator flag is set.
"""
import... |
VoIP-co-uk/sftf | refs/heads/master | UserAgentBasicTestSuite/case302bye.py | 2 | #
# Copyright (C) 2004 SIPfoundry Inc.
# Licensed by SIPfoundry under the GPL license.
#
# Copyright (C) 2004 SIP Forum
# Licensed to SIPfoundry under a Contributor Agreement.
#
#
# This file is part of SIP Forum User Agent Basic Test Suite which
# belongs to the SIP Forum Test Framework.
#
# SIP Forum User Agent Basic... |
wiki-ai/wikiclass | refs/heads/master | articlequality/utilities/weighted_sum.py | 3 | """
``$ articlequality weighted_sum -h``
::
Extracts probabilities assigned to each class from the output of
revscoring score utility and outputs the weighted sum of the article
quality predicted where each class is represented as a weight sorted
in a yaml config file.
Usage:
weighted_sum <... |
pawaranand/phr_frappe | refs/heads/develop | frappe/tests/test_geo_ip.py | 37 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
import unittest
class TestGeoIP(unittest.TestCase):
def test_geo_ip(self):
return
from frappe.sessions import get_geo_ip_country
self.assertEquals(get_geo_ip_country("223.29.223.255"), "India")
... |
farooqsheikhpk/Aspose_Cells_Cloud | refs/heads/master | SDKs/Aspose.Cells-Cloud-SDK-for-Python/asposecellscloud/models/Font.py | 4 | #!/usr/bin/env python
class Font(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.
... |
Mlieou/lXXtcode | refs/heads/master | leetcode/python/ex_642.py | 3 | class TrieNode(object):
def __init__(self):
self.child = dict()
self.is_word = False
class Trie(object):
def __init__(self):
self.root = TrieNode()
def insert(self, word):
p = self.root
for c in word:
if c not in p.child:
p.child[... |
NetApp/manila | refs/heads/master | manila/hacking/checks.py | 1 | # Copyright (c) 2012, Cloudscaling
# 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... |
mbernasocchi/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_category.py | 38 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_category.py
-------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************************... |
ryfeus/lambda-packs | refs/heads/master | Pandas_numpy/source/pandas/core/reshape/api.py | 14 | # flake8: noqa
from pandas.core.reshape.concat import concat
from pandas.core.reshape.reshape import melt
from pandas.core.reshape.merge import (
merge, ordered_merge, merge_ordered, merge_asof)
from pandas.core.reshape.pivot import pivot_table, crosstab
from pandas.core.reshape.tile import cut, qcut
|
CodeDJ/qt5-hidpi | refs/heads/master | qt/qtwebkit/Source/ThirdParty/gtest/test/run_tests_util.py | 228 | # Copyright 2008 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 foll... |
gdimitris/ChessPuzzlerBackend | refs/heads/master | Virtual_Environment/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py | 469 | import functools
from pip._vendor.requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
from .filewrapper import CallbackFileWrapper
class CacheControlAdapter(HTTPAdapter):
invalidating_methods = set(['PUT', 'DELETE'])
def __init__(self, cache=None,
... |
vnc-biz/openerp-server | refs/heads/master | openerp/report/pyPdf/xmp.py | 14 | import re
import datetime
import decimal
from generic import PdfObject
from xml.dom import getDOMImplementation
from xml.dom.minidom import parseString
RDF_NAMESPACE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
DC_NAMESPACE = "http://purl.org/dc/elements/1.1/"
XMP_NAMESPACE = "http://ns.adobe.com/xap/1.0/"... |
hesam-setareh/nest-simulator | refs/heads/master | topology/pynest/tests/test_plotting.py | 9 | # -*- coding: utf-8 -*-
#
# test_plotting.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, ... |
jowinter/qemu-trustzone | refs/heads/for-mainline | tests/qemu-iotests/iotests.py | 4 | # Common utilities and Python wrappers for qemu-iotests
#
# Copyright (C) 2012 IBM Corp.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) ... |
dionysio/django-haystack | refs/heads/master | example_project/regular_app/search_indexes.py | 12 | from haystack import indexes
from regular_app.models import Dog
# More typical usage involves creating a subclassed `SearchIndex`. This will
# provide more control over how data is indexed, generally resulting in better
# search.
class DogIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(doc... |
crobby/sahara | refs/heads/master | sahara/tests/unit/utils/test_keymgr.py | 10 | # Copyright (c) 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
bakhtout/odoo-educ | refs/heads/8.0 | addons/purchase_requisition/wizard/bid_line_qty.py | 374 | # -*- 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... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-billing/azure_bdist_wheel.py | 241 | """
"wheel" copyright (c) 2012-2017 Daniel Holth <dholth@fastmail.fm> and
contributors.
The MIT License
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 limi... |
Freso/beets | refs/heads/master | beetsplug/convert.py | 1 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Jakob Schnitzer.
#
# 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 ... |
divya-csekar/flask-microblog-server | refs/heads/master | flask/Lib/site-packages/flask/testsuite/helpers.py | 405 | # -*- coding: utf-8 -*-
"""
flask.testsuite.helpers
~~~~~~~~~~~~~~~~~~~~~~~
Various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import flask
import unittest
from logging import StreamHandler
from flask.testsuite import FlaskTestCase,... |
rfuentess/RIOT | refs/heads/master | tests/build_system_cflags_spaces/tests/01-run.py | 22 | #!/usr/bin/env python3
# Copyright (C) 2019 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
"""
Test for passing `CFLAGS` with spaces to the application.
It also tests th... |
mathspace/django | refs/heads/master | tests/string_lookup/models.py | 281 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def... |
ademmers/ansible | refs/heads/devel | test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/connection/persistent.py | 47 | # 2017 Red Hat Inc.
# (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 = """author: Ansible Core Team
connection: persistent
short_description: Use ... |
liangwang/m5 | refs/heads/master | src/mem/slicc/ast/TypeDeclAST.py | 1 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... |
s40523144/2016fallcp_hw | refs/heads/gh-pages | course/task2.py | 19 | # 我們能夠利用 Python 程式進行簡單的 2D 繪圖嗎?
# 機械設計工程師在那些情況下, 會用到 2D 繪圖?
# 我們需要 2D 靜態繪圖? 還是 2D 動態繪圖?
# 2D 繪圖之於機械設計工程師, 是設? 還是計?
# 我們能用 Python 程式繪出日本國旗嗎? 英國國旗? 美國國旗? 中華民國國旗? 中國國旗? 畫這些國旗要幹什?
# 我們能用 Python 程式畫出平面四連桿機構的動態模擬嗎? 曲柄滑塊呢? 其他的平面多連桿的動態模擬? 模擬機構運動要幹什?
# 可以算出這些平面連桿機構上某一特定點, 在機構運動過程中所通過的座標或掃掠過的輪廓嗎?
|
godfather1103/WeiboRobot | refs/heads/master | python27/1.0/lib/ctypes/test/test_delattr.py | 337 | import unittest
from ctypes import *
class X(Structure):
_fields_ = [("foo", c_int)]
class TestCase(unittest.TestCase):
def test_simple(self):
self.assertRaises(TypeError,
delattr, c_int(42), "value")
def test_chararray(self):
self.assertRaises(TypeError,
... |
bjornlevi/5thpower | refs/heads/master | nefndaralit/env/lib/python3.6/site-packages/certifi/core.py | 105 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
certifi.py
~~~~~~~~~~
This module returns the installation location of cacert.pem.
"""
import os
import warnings
class DeprecatedBundleWarning(DeprecationWarning):
"""
The weak security bundle is being deprecated. Please bother your service
provider to g... |
jellysheep/pyload | refs/heads/stable | module/plugins/hoster/MegaFilesSe.py | 15 | # -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class MegaFilesSe(DeadHoster):
__name__ = "MegaFilesSe"
__type__ = "hoster"
__version__ = "0.03"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?megafiles\.se/\w{12}'
__config__ ... |
jayceyxc/hue | refs/heads/master | apps/jobsub/src/jobsub/forms.py | 38 | #!/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... |
clobrano/personfinder | refs/heads/master | app/pytz/zoneinfo/Canada/Atlantic.py | 9 | '''tzinfo timezone information for Canada/Atlantic.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Atlantic(DstTzInfo):
'''Canada/Atlantic timezone definition. See datetime.tzinfo for details'''
zone = 'Canada/Atlantic'
... |
OliverEvans96/rte_matrix | refs/heads/master | factorizations/SVD_vs_SVDsparse.py | 1 | # File Name: SVD_vs_SVDsparse.py
# Description:
# Author: Christopher Parker
# Created: Sun Apr 30, 2017 | 07:10P EDT
# Last Modified: Sun Apr 30, 2017 | 08:46P EDT
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-
# GNU GPL LICENSE #
#-#-#-#... |
XiaosongWei/chromium-crosswalk | refs/heads/master | build/write_buildflag_header.py | 38 | #!/usr/bin/env python
# Copyright 2015 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.
# This writes headers for build flags. See buildflag_header.gni for usage of
# this system as a whole.
#
# The parameters are passed in... |
woodbunny/JIT-ASLR-kernel | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
percyfal/bokeh | refs/heads/master | bokeh/util/tests/test_deprecation.py | 14 | import pytest
from mock import patch
import bokeh.util.deprecation as dep
def foo(): pass
def test_bad_arg_type():
for x in [10, True, foo, [], (), {}]:
with pytest.raises(ValueError):
dep.deprecated(x)
@patch('warnings.warn')
def test_message(mock_warn):
dep.deprecated('test')
assert... |
LiveTex/Livetex-Tools | refs/heads/master | tools/externs-extractor/extractors/recordsExtractor.py | 2 | import re
from utils import *
from entities.record import Record
def __extractTag(text):
"""
Extracts tag from record.
@tag
@param {string} text.
@return {string} tag.
"""
return re.match('@\w+', text).group(0)
def __extractType(text, tag):
"""
Extracts type... |
Varentsov/servo | refs/heads/master | tests/wpt/web-platform-tests/xhr/resources/inspect-headers.py | 20 | def get_response(raw_headers, filter_value, filter_name):
result = ""
for line in raw_headers.headers:
if line[-2:] != '\r\n':
return "Syntax error: missing CRLF: " + line
line = line[:-2]
if ':' not in line:
return "Syntax error: no colon found: " + line
... |
rolandmansilla/microblog | refs/heads/master | flask/lib/python2.7/site-packages/blinker/__init__.py | 57 | from blinker.base import (
ANY,
NamedSignal,
Namespace,
Signal,
WeakNamespace,
receiver_connected,
signal,
)
__all__ = [
'ANY',
'NamedSignal',
'Namespace',
'Signal',
'WeakNamespace',
'receiver_connected',
'signal',
]
__version__ = '1.4'
|
fabioz/PyDev.Debugger | refs/heads/master | third_party/pep8/lib2to3/lib2to3/fixer_base.py | 305 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import logging
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_imp... |
asedunov/intellij-community | refs/heads/master | python/testData/formatter/unaryMinus_after.py | 3989 | -1
|
steven-albanese/FAHMunge | refs/heads/master | setup.py | 2 | """Some tools for munging FAH trajectories
"""
from __future__ import print_function
DOCLINES = __doc__.split("\n")
import os
import sys
import shutil
import tempfile
import subprocess
from distutils.ccompiler import new_compiler
try:
from setuptools import setup, Extension
except ImportError:
from distutils.... |
ktan2020/legacy-automation | refs/heads/master | win/Lib/distutils/emxccompiler.py | 59 | """distutils.emxccompiler
Provides the EMXCCompiler class, a subclass of UnixCCompiler that
handles the EMX port of the GNU C compiler to OS/2.
"""
# issues:
#
# * OS/2 insists that DLLs can have names no longer than 8 characters
# We put export_symbols in a def-file, as though the DLL can have
# an arb... |
skipmodea1/plugin.video.xbmctorrent | refs/heads/master | resources/site-packages/html5lib/treewalkers/etree.py | 658 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import gettext
_ = gettext.gettext
import re
from six import text_type
from . im... |
kirbyfan64/hy | refs/heads/master | hy/models/cons.py | 7 | # Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use,... |
crossroadchurch/paul | refs/heads/master | tests/functional/openlp_plugins/images/test_imagetab.py | 1 | # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... |
manasi24/jiocloud-tempest-qatempest | refs/heads/master | tempest/api/volume/admin/test_volumes_backup.py | 11 | # Copyright 2014 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... |
caotianwei/django | refs/heads/master | tests/admin_inlines/urls.py | 810 | from django.conf.urls import url
from . import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
|
vitmod/enigma2-1 | refs/heads/master | lib/python/Plugins/SystemPlugins/FastScan/plugin.py | 59 | # -*- coding: utf-8 -*-
from os import path as os_path, walk as os_walk, unlink as os_unlink
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.config import config, ConfigSelection, ConfigYesNo, getConfigListEntry, ConfigSubsection,... |
gwpy/gwpy.github.io | refs/heads/master | docs/0.11.0/plotter/colors-1.py | 7 | from __future__ import division
import numpy
from matplotlib import (pyplot, rcParams)
from matplotlib.colors import to_hex
from gwpy.plotter import colors
rcParams.update({
'text.usetex': False,
'font.size': 15
})
th = numpy.linspace(0, 2*numpy.pi, 512)
names = [
'gwpy:geo600',
'gwpy:kagra',
'... |
nfedera/rg3-youtube-dl | refs/heads/master | youtube_dl/extractor/wistia.py | 3 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,
int_or_none,
)
class WistiaIE(InfoExtractor):
_VALID_URL = r'https?://(?:fast\.)?wistia\.net/embed/iframe/(?P<id>[a-z0-9]+)'
_API_URL = 'http://fast.wistia.com/embed/... |
varunarya10/nova_test_latest | refs/heads/master | nova/api/openstack/compute/plugins/v3/preserve_ephemeral_rebuild.py | 34 | # Copyright 2015 IBM Corp.
#
# 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 t... |
petteyg/intellij-community | refs/heads/master | python/lib/Lib/encodings/iso8859_14.py | 593 | """ Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... |
partofthething/home-assistant | refs/heads/dev | homeassistant/components/risco/alarm_control_panel.py | 15 | """Support for Risco alarms."""
import logging
from homeassistant.components.alarm_control_panel import (
FORMAT_NUMBER,
AlarmControlPanelEntity,
)
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_CUSTOM_BYPASS,
SUPPORT_ALARM_ARM_HOME,
S... |
bincyber/beesly | refs/heads/master | beesly/utils.py | 1 | from hashlib import sha256
from distutils.spawn import find_executable
import re
import subprocess
from flask import request
import requests
def get_ec2_metadata():
"""
Returns the following AWS EC2 metadata as a dictionary:
* region
* availability zone
* image id
* instance type
... |
vuteam/BlackHole-New | refs/heads/master | lib/python/Components/ServiceList.py | 2 | from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from skin import parseColor, parseFont
from enigma import eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect
from Tools.LoadPixmap import LoadPixmap
from Tools.TextBoundary import getTextBoundarySize
from Tool... |
tswast/google-cloud-python | refs/heads/master | texttospeech/tests/system/v1beta1/test_system_tts_v1beta1.py | 2 | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
tariqqrasheedd/AudioXBlock | refs/heads/master | audio/__init__.py | 2 | from .audio import AudioXBlock |
drewet/androguard | refs/heads/master | androguard/decompiler/dad/tests/rpo_test.py | 24 | """Tests for rpo."""
import sys
sys.path.append('.')
import unittest
from androguard.decompiler.dad import graph
from androguard.decompiler.dad import node
class NodeTest(node.Node):
def __init__(self, name):
super(NodeTest, self).__init__(name)
def __str__(self):
return '%s (%d)' % (self.n... |
kevin-coder/tensorflow-fork | refs/heads/master | tensorflow/python/data/experimental/__init__.py | 1 | # 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... |
sean-/ansible | refs/heads/devel | v1/ansible/runner/action_plugins/synchronize.py | 86 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012-2013, Timothy Appnel <tim@appnel.com>
#
# 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... |
dpfg/kicker-scorer-api | refs/heads/master | shell.py | 2 | #!/usr/bin/env python
import os
import readline
from pprint import pprint
from flask import *
from app import *
# from utils import *
# from db import *
# from models import *
os.environ['PYTHONINSPECT'] = 'True'
|
lunafeng/django | refs/heads/master | django/db/backends/sqlite3/base.py | 323 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... |
orgito/ansible | refs/heads/devel | lib/ansible/plugins/action/net_get.py | 19 | # (c) 2018, Ansible 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 di... |
kinwahlai/phantomjs-ghostdriver | refs/heads/master | src/breakpad/src/tools/gyp/test/copies/gyptest-all.py | 137 | #!/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.
"""
Verifies file copies using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('copies.gyp', ... |
caseyching/Impala | refs/heads/cdh5-trunk | thirdparty/gtest-1.6.0/scripts/gen_gtest_pred_impl.py | 412 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
sumpfgottheit/pdu1800_data_provider | refs/heads/master | pygame32/pygame/tests/run_tests__tests/failures1/__init__.py | 6353 | # empty
|
ganeti/ganeti | refs/heads/master | lib/impexpd/__init__.py | 1 | #
#
# 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... |
biskett/mic | refs/heads/master | mic/3rdparty/pykickstart/errors.py | 14 | #
# errors.py: Kickstart error handling.
#
# Chris Lumens <clumens@redhat.com>
#
# 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. This program is distributed in the hope that it
# wil... |
vvv1559/intellij-community | refs/heads/master | python/testData/inspections/PyNumpyType/Empty.py | 69 | def empty(shape, dtype=None, order='C'): # real signature unknown; restored from __doc__
"""
empty(shape, dtype=float, order='C')
Return a new array of given shape and type, without initializing entries.
Parameters
----------
shape : int or tuple of int
Shape of the... |
superhuahua/xunfengES | refs/heads/master | celerynode/vuldb/pyasn1/compat/octets.py | 96 | from sys import version_info
if version_info[0] <= 2:
int2oct = chr
ints2octs = lambda s: ''.join([ int2oct(x) for x in s ])
null = ''
oct2int = ord
octs2ints = lambda s: [ oct2int(x) for x in s ]
str2octs = lambda x: x
octs2str = lambda x: x
isOctetsType = lambda s: isinstance(s, str)
... |
lmr/autotest | refs/heads/master | database_legacy/migrations/022_implement_sync_count.py | 6 | DOWN_SQL = """
ALTER TABLE jobs ADD COLUMN synchronizing tinyint(1) default NULL;
ALTER TABLE autotests ADD COLUMN synch_type smallint(6) NOT NULL;
UPDATE autotests SET synch_type = 1;
UPDATE autotests SET synch_type = 2 WHERE sync_count > 1;
ALTER TABLE jobs ADD COLUMN synch_type int(11) default NULL;
UPDATE jobs SET ... |
gangadhar-kadam/mic-wnframework | refs/heads/master | webnotes/widgets/query_report.py | 3 | # Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com)
#
# MIT License (MIT)
#
# 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 lim... |
Therp/partner-contact | refs/heads/8.0 | base_location/models/better_zip.py | 26 | # -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# This program is free software: you can redist... |
ropik/chromium | refs/heads/master | ppapi/PRESUBMIT.py | 8 | # Copyright (c) 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.
import os
import re
import sys
import subprocess
def RunCmdAndCheck(cmd, err_string, output_api, cwd=None):
results = []
p = subprocess.Popen(cmd, ... |
bjolivot/ansible | refs/heads/devel | lib/ansible/modules/network/illumos/ipadm_addr.py | 20 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@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 L... |
BigDataforYou/movie_recommendation_workshop_1 | refs/heads/master | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/click/globals.py | 234 | from threading import local
_local = local()
def get_current_context(silent=False):
"""Returns the current click context. This can be used as a way to
access the current context object from anywhere. This is a more implicit
alternative to the :func:`pass_context` decorator. This function is
prima... |
chandps/Hackerrank | refs/heads/master | sandbox/caterpilar.py | 3 | from collections import deque
"""
1 <= a[i] <= 10E9
"""
def caterpilar(A, s):
n = len(A)
head = 0
total = 0
for back in range(n):
while head < n and total + A[head] <= s:
total += A[head]
head += 1
if total == s:
return True
total -= A[back]... |
webspinner/webspinner-gae-cms | refs/heads/master | gdata/Crypto/PublicKey/ElGamal.py | 228 | #
# ElGamal.py : ElGamal encryption/decryption and signatures
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warrant... |
a-parhom/edx-platform | refs/heads/master | common/test/acceptance/tests/studio/test_studio_acid_xblock.py | 14 | """
Acceptance tests for Studio related to the acid xblock.
"""
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage
from common.test.acceptance.pages.studio.overview import CourseOutlinePage
from common.test.acceptanc... |
achanda/flocker | refs/heads/master | flocker/provision/_ssh/_monkeypatch.py | 14 | # Copyright (c) Twisted Matrix Laboratories.
"""
Monkey patch twisted.conch.ssh.transport.SSHClientTransport to support
``diffie-hellman-group-exchange-sha256``.
https://clusterhq.atlassian.net/browse/FLOC-2134
This is adapted from the patch at http://twistedmatrix.com/trac/ticket/7672
"""
from twisted.conch.ssh.tr... |
dulaccc/django-accounting | refs/heads/master | accounting/apps/books/migrations/0003_auto_20141029_1606.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('books', '0002_auto_20141029_1606'),
('people', '0001_initial'),
]
operations = [
migrations.AddField(
mo... |
it-projects-llc/website-addons | refs/heads/13.0 | stock_picking_barcode/__init__.py | 2 | # License MIT (https://opensource.org/licenses/MIT).
from . import models
from . import controllers
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.