code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | edespino/gpdb | src/test/tinc/tincrepo/mpp/models/regress/mpp_tc/regress_mpp_test_case.py | Python | apache-2.0 | 6,282 |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | Chibin/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/load/__init__.py | Python | apache-2.0 | 1,772 |
from logan.runner import run_app, configure_app
import sys
import base64
import os
KEY_LENGTH = 40
CONFIG_TEMPLATE = """
from fabric_bolt.core.settings.base import *
CONF_ROOT = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(... | brajput24/fabric-bolt | fabric_bolt/utils/runner.py | Python | mit | 1,251 |
# For Capstone Engine. AUTO-GENERATED FILE, DO NOT EDIT [mips_const.py]
MIPS_OP_INVALID = 0
MIPS_OP_REG = 1
MIPS_OP_IMM = 2
MIPS_OP_MEM = 3
MIPS_REG_INVALID = 0
MIPS_REG_PC = 1
MIPS_REG_0 = 2
MIPS_REG_1 = 3
MIPS_REG_2 = 4
MIPS_REG_3 = 5
MIPS_REG_4 = 6
MIPS_REG_5 = 7
MIPS_REG_6 = 8
MIPS_REG_7 = 9
MIPS_REG_8 = 10
MIPS_... | 0vercl0k/rp | src/third_party/capstone/bindings/python/capstone/mips_const.py | Python | mit | 17,669 |
# -*- coding: utf-8 -*-
#
# 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
... | MetrodataTeam/incubator-airflow | tests/contrib/operators/test_sftp_operator.py | Python | apache-2.0 | 9,161 |
def func():
value = "not-none"
if value is not None:
print("Not none")
else: # Is none
print("None") | siosio/intellij-community | python/testData/intentions/PyInvertIfConditionIntentionTest/commentsInlineIf_after.py | Python | apache-2.0 | 130 |
#!/usr/bin/env python
from datetime import date
import os
import re
SRC_DIR = 'src/main/java/'
ABSTRACT = re.compile(r'public abstract class Abstract')
TYPE = re.compile(r'class [A-Za-z0-9]+(<[^>]+?(?: extends ([A-Za-z0-9_]+))?>)?')
TARGET = re.compile(r'\s[A-Z][A-Za-z0-9_]+<[A-Z][A-Za-z0-9_]+(?:<.+?>)?, (([A-Z][A-... | lockerfish/assertj-android | generate-assertions-java.py | Python | apache-2.0 | 4,345 |
from distutils.core import setup
from distutils.extension import Extension
setup(
name='wordcloud',
version='1.1.3',
url='https://github.com/amueller/word_cloud',
description='A little word cloud generator',
license='MIT',
ext_modules=[Extension("wordcloud.query_integral_image",
... | asgeirrr/word_cloud | setup.py | Python | mit | 469 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.wsgi}.
"""
__metaclass__ = type
from sys import exc_info
import tempfile
import traceback
import warnings
from zope.interface.verify import verifyObject
from twisted.python.compat import intToBytes, urlquote, _PY3
f... | EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/src/twisted/web/test/test_wsgi.py | Python | mit | 74,813 |
#!@PYTHON@
# -*- mode: python; coding: utf-8; -*-
#
# This file is part of Invenio.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
#
# Invenio 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; ei... | zenodo/invenio | invenio/legacy/elmsubmit/scripts/elmsubmit.py | Python | gpl-2.0 | 2,040 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio 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) any later... | zenodo/invenio | invenio/modules/search/signals.py | Python | gpl-2.0 | 1,169 |
from django.dispatch import Signal
form_invalid = Signal(providing_args=["form"])
form_valid = Signal(providing_args=["form", "entry"])
| orlenko/bccf | src/mezzanine/forms/signals.py | Python | unlicense | 138 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | percyfal/luigi | test/task_test.py | Python | apache-2.0 | 3,356 |
class MyClass(object):
def __init__(self):
self.__private_var = 42
self._private_var = 11
self.instance_var = 12
def foo(self):
self.<caret>
obj = MyClass() | siosio/intellij-community | python/testData/codeInsight/mlcompletion/underscoreTypeTwoStart.py | Python | apache-2.0 | 199 |
"""
Shim to maintain backwards compatibility with old IPython.qt imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
from IPython.utils.shimmodule import ShimModule, ShimWarning
warn("The `IPython.qt` package has been ... | kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/IPython/qt.py | Python | artistic-2.0 | 744 |
from os.path import join as pjoin, abspath, dirname, pardir
import django
SECRET_KEY = 'SECRET'
PROJ_ROOT = abspath(pjoin(dirname(__file__), pardir))
DATA_ROOT = pjoin(PROJ_ROOT, 'data')
THUMBNAIL_PREFIX = 'test/cache/'
THUMBNAIL_DEBUG = True
THUMBNAIL_LOG_HANDLER = {
'class': 'sorl.thumbnail.log.ThumbnailLogHand... | lampslave/sorl-thumbnail | tests/settings/default.py | Python | bsd-3-clause | 1,335 |
from .between import between # noqa
from .domain import domain # noqa
from .email import email # noqa
from .extremes import Max, Min # noqa
from .i18n import fi_business_id, fi_ssn # noqa
from .iban import iban # noqa
from .ip_address import ipv4, ipv6 # noqa
from .length import length # noqa
from .mac_address ... | cytec/SickRage | lib/validators/__init__.py | Python | gpl-3.0 | 551 |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.compat import (
compat_getenv,
compat_setenv,
compat_etree_fromstrin... | fluxw42/youtube-dl | test/test_compat.py | Python | unlicense | 5,492 |
from datetime import datetime, timedelta
from twitter.common.lang import total_ordering
# TODO(wickman) Do something that won't break if this is running over NYE?
_CURRENT_YEAR = str(datetime.now().year)
class Level(object):
DEBUG = 0
INFO = 10
WARNING = 20
ERROR = 30
FATAL = 40
@total_ordering... | Yasumoto/commons | src/python/twitter/common/log/parsers.py | Python | apache-2.0 | 3,099 |
# 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... | ivano666/tensorflow | tensorflow/python/kernel_tests/scalar_strict_test.py | Python | apache-2.0 | 5,013 |
from ..sourcefile import SourceFile
def create(filename, contents=b""):
assert isinstance(contents, bytes)
return SourceFile("/", filename, "/", contents=contents)
def items(s):
return [
(item.item_type, item.url)
for item in s.manifest_items()
]
def test_name_is_non_test():
non... | wldcordeiro/servo | tests/wpt/web-platform-tests/tools/manifest/tests/test_sourcefile.py | Python | mpl-2.0 | 5,974 |
"""
Acceptance tests for the Import and Export pages
"""
from abc import abstractmethod
from bok_choy.promise import EmptyPromise
from .base_studio_test import StudioLibraryTest, StudioCourseTest
from ...fixtures.course import XBlockFixtureDesc
from ...pages.studio.import_export import ExportLibraryPage, ExportCoursePa... | beni55/edx-platform | common/test/acceptance/tests/studio/test_import_export.py | Python | agpl-3.0 | 11,718 |
from nose.tools import * # noqa
import mock
from tests.base import get_default_metaschema
from framework.auth.decorators import Auth
from website.addons.base.testing import models
from website.addons.dataverse.model import AddonDataverseNodeSettings
from website.addons.dataverse.tests.factories import (
Dataver... | zachjanicki/osf.io | website/addons/dataverse/tests/test_model.py | Python | apache-2.0 | 3,530 |
# -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and HTML, but it does not rewrite the
XML or HTML to reflect a new encoding; th... | znoland3/zachdemo | venvdir/lib/python3.4/site-packages/bs4/dammit.py | Python | mit | 29,774 |
# Used for perf measurements. Defines a simple function and makes 100 calls in a row.
# I ran 10K calls, total 1 million invocations, total time is around 250ms on my laptop (64bit 2.7GHz, Release mode, running .exe directly, no debugger);
# 0.4 microseconds per call.
m = 5
def addm(x, y):
x + y + m
x = addm(1... | kouweizhong/XLParser | lib/Irony/Irony.Samples/SourceSamples/MiniPython/PerfTest.py | Python | mpl-2.0 | 1,852 |
from django.conf.urls import patterns, url
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import FacebookProvider
from . import views
urlpatterns = default_urlpatterns(FacebookProvider)
urlpatterns += patterns('',
url('^facebook/login/token/$', views.login_by_token,
... | tejesh95/Zubio.in | zubio/allauth/socialaccount/providers/facebook/urls.py | Python | mit | 435 |
from os import listdir, open as os_open, close as os_close, write as os_write, O_RDWR, O_NONBLOCK
from fcntl import ioctl
from boxbranding import getBoxType, getBrandOEM
import struct
from config import config, ConfigSubsection, ConfigInteger, ConfigYesNo, ConfigText, ConfigSlider
from Tools.Directories import pathExi... | devclone/enigma2-9f38fd6 | lib/python/Components/InputDevice.py | Python | gpl-2.0 | 9,159 |
# 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... | nanditav/15712-TensorFlow | tensorflow/contrib/learn/python/learn/utils/checkpoints.py | Python | apache-2.0 | 2,001 |
# Copyright 2016, 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... | royalharsh/grpc | src/python/grpcio_tests/tests/unit/_empty_message_test.py | Python | bsd-3-clause | 5,056 |
#!/usr/bin/env python
#
#===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LLVM-LICENSE.TXT for details.
#
#===---------------------------------... | trizt/osquery | tools/formatting/git-clang-format.py | Python | bsd-3-clause | 18,615 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio 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) a... | Panos512/invenio | modules/webaccess/lib/external_authentication_openid.py | Python | gpl-2.0 | 6,658 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | unicef-zambia/zambia-ureport | zambiaureport/users/migrations/0001_initial.py | Python | bsd-3-clause | 2,693 |
"""Stack loss data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain. """
TITLE = __doc__
SOURCE = """
Brownlee, K. A. (1965), "Statistical Theory and Methodology in
Science and Engineering", 2nd edition, New York:Wiley.
"""
DESCRSHORT = """Stack loss plant data of Brownlee (19... | hlin117/statsmodels | statsmodels/datasets/stackloss/data.py | Python | bsd-3-clause | 1,907 |
"""
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | chenyyx/scikit-learn-doc-zh | examples/zh/applications/plot_tomography_l1_reconstruction.py | Python | gpl-3.0 | 5,478 |
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | paninetworks/neutron | neutron/plugins/ml2/drivers/type_gre.py | Python | apache-2.0 | 3,250 |
# 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... | vivekanand1101/neutron | neutron/tests/api/test_allowed_address_pair.py | Python | apache-2.0 | 5,586 |
from django.db.models.signals import post_save, pre_save
from django.test import TestCase
from .models import Account, Employee, Person, Profile, ProxyEmployee
class UpdateOnlyFieldsTests(TestCase):
def test_update_fields_basic(self):
s = Person.objects.create(name='Sara', gender='F')
self.assert... | mattseymour/django | tests/update_only_fields/tests.py | Python | bsd-3-clause | 9,560 |
#!/usr/bin/env python3
# Copyright (C) 2017 Michel Rottleuthner <michel.rottleuthner@haw-hamburg.de>
#
# 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.
import sys
import pexpect
from testrunner impor... | jia200x/RIOT | tests/xtimer_usleep_short/tests/01-run.py | Python | lgpl-2.1 | 832 |
__author__ = 'keyvan&ramin'
from opencog.atomspace import AtomSpace, TruthValue
import quad_reader
DEFAULT_TV = TruthValue(1,1)
def map_from_path(quad_dump_path, atomspace):
quads = quad_reader.extract_quads(quad_dump_path)
for quad in quads:
try:
value = int(quad.value)
value... | eddiemonroe/opencog | opencog/python/freebase/quad_mapper.py | Python | agpl-3.0 | 2,238 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import join
import re
from urllib import unquote
from base64 import standard_b64decode
from binascii import unhexlify
from bottle import route, request, HTTPError
from webinterface import PYLOAD, DL_ROOT, JS
try:
from Crypto.Cipher import AES
except:
... | LePastis/pyload | module/web/cnl_app.py | Python | gpl-3.0 | 4,421 |
#! /usr/bin/env python
# ----------------------------------------------------------------------
# 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... | mcanthony/nupic | src/nupic/data/CategoryFilter.py | Python | agpl-3.0 | 2,276 |
#!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | Russell-IO/ansible | lib/ansible/modules/network/avi/avi_useraccountprofile.py | Python | gpl-3.0 | 4,860 |
#**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | victor-gonzalez/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/Draw/DrawRawSpectrumFit.py | Python | bsd-3-clause | 2,015 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | poiesisconsulting/openerp-restaurant | portal_project/tests/test_access_rights.py | Python | agpl-3.0 | 14,973 |
"""
This module has the mock object definitions used to hold reference geometry
for the GEOS and GDAL tests.
"""
import json
import os
from django.utils.functional import cached_property
# Path where reference test data is located.
TEST_DATA = os.path.join(os.path.dirname(__file__), 'data')
def tuplize(seq):
"T... | camilonova/django | tests/gis_tests/test_data.py | Python | bsd-3-clause | 2,588 |
import builtins
import imp
from importlib.test.import_ import test_relative_imports
from importlib.test.import_ import util as importlib_util
import marshal
import os
import py_compile
import random
import stat
import sys
import unittest
import textwrap
from test.support import (
EnvironmentVarGuard, TESTFN, check... | invisiblek/python-for-android | python3-alpha/python3-src/Lib/test/test_import.py | Python | apache-2.0 | 24,643 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import openerp
from openerp.report.interface import report_int
import openerp.tools as tools
from openerp.tools.safe_eval import safe_eval as eval
from lxml import etree
from openerp.report import render, report_sxw
imp... | vileopratama/vitech | src/openerp/report/printscreen/ps_list.py | Python | mit | 11,008 |
import math, random, datetime
def perform_ignore_interrupt(f):
while True:
try:
return f()
except IOError as ex:
if ex.errno != errno.EINTR:
raise
# end_date should be of the format YYYY-MM-DD - default is today
# interval should be of the format NUMBER (day... | KSanthanam/rethinkdb | test/rdb_workloads/stress_workloads/x_stress_util.py | Python | agpl-3.0 | 3,021 |
import multiprocessing
import time
import random
import sys
#
# Functions used by test code
#
def calculate(func, args):
result = func(*args)
return '%s says that %s%s = %s' % (
multiprocessing.current_process().name,
func.__name__, args, result
)
def calculatestar(args):
return c... | Kiddinglife/kidding-engine | python/Doc/includes/mp_pool.py | Python | lgpl-3.0 | 3,892 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.sitemaps import Sitemap
from django.core.urlresolvers import reverse
from django.utils.translation import get_language, activate
from oscar.core.loading import get_model
Product = get_model('catalogue', 'Product')
Category = get_model('catalo... | ahmetdaglarbas/e-commerce | sites/sandbox/apps/sitemaps.py | Python | bsd-3-clause | 1,779 |
# 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... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/python/kernel_tests/norm_op_test.py | Python | apache-2.0 | 4,814 |
# basic tuple functionality
x = (1, 2, 3 * 4)
print(x)
try:
x[0] = 4
except TypeError:
print("TypeError")
print(x)
try:
x.append(5)
except AttributeError:
print("AttributeError")
print(x[1:])
print(x[:-1])
print(x[2:3])
print(x + (10, 100, 10000))
| drrk/micropython | tests/basics/tuple1.py | Python | mit | 266 |
"""
This module implements an example server for the OpenID library. Some
functionality has been omitted intentionally; this code is intended to
be instructive on the use of this library. This server does not
perform actual user authentication and serves up only one OpenID URL,
with the exception of IDP-generated id... | mzdaniel/oh-mainline | vendor/packages/python-openid/examples/djopenid/server/views.py | Python | agpl-3.0 | 9,294 |
import datetime
import os
import re
import time
from pprint import pformat
from urllib import urlencode, quote
from urlparse import urljoin
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
# The mod_python version is more efficient, so try importing it first.
fr... | tjsavage/sfcsdatabase | sfcs/django/http/__init__.py | Python | bsd-3-clause | 23,818 |
# Generated by h2py from /include/sys/types.h
_SYS_TYPES_H = 1
# Included from features.h
_FEATURES_H = 1
__USE_ANSI = 1
__FAVOR_BSD = 1
_ISOC9X_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L
_XOPEN_SOURCE = 500
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
_BSD_SOURCE = 1... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-atheos/TYPES.py | Python | gpl-2.0 | 2,682 |
#
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 Licens... | tsdmgz/ansible | lib/ansible/utils/module_docs_fragments/dellos9.py | Python | gpl-3.0 | 2,591 |
from sympy.core.logic import _fuzzy_group
from sympy.logic.boolalg import conjuncts
from sympy.assumptions import Q, ask
class AskHandler(object):
"""Base class that all Ask Handlers must inherit"""
pass
class CommonHandler(AskHandler):
"""Defines some useful methods common to most Handlers """
@st... | grevutiu-gabriel/sympy | sympy/assumptions/handlers/common.py | Python | bsd-3-clause | 3,168 |
def lab(): pass
lab = 1
print(l<caret>ab)
| asedunov/intellij-community | python/testData/refactoring/rename/renameShadowingVariable.py | Python | apache-2.0 | 42 |
# 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 ... | balajikris/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/credentials.py | Python | mit | 731 |
#!/usr/bin/env python
#
# 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.
"""Provides a convenient wrapper for spawning a test lighttpd instance.
Usage:
lighttpd_server PATH_TO_DOC_ROOT
"""
import co... | s20121035/rk3288_android5.1_repo | external/chromium_org/build/android/lighttpd_server.py | Python | gpl-3.0 | 9,421 |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | danialbehzadi/Nokia-RM-1013-2.0.0.11 | webkit/Tools/Scripts/webkitpy/tool/steps/revertrevision.py | Python | gpl-3.0 | 1,769 |
#!/usr/bin/env python
# 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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | migua1204/jikexueyuan | 极客学院/BusStopBoard/node_modules/.3.4.0@node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | Python | apache-2.0 | 65,937 |
SUCCESS = 0
ERROR = 1
UNKNOWN_ERROR = 2
VIRTUALENV_NOT_FOUND = 3
NO_MATCHES_FOUND = 23
| ktan2020/legacy-automation | win/Lib/site-packages/pip-1.3.1-py2.7.egg/pip/status_codes.py | Python | mit | 87 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Onset detection
===============
.. autosummary::
:toctree: generated/
onset_detect
onset_backtrack
onset_strength
onset_strength_multi
"""
import numpy as np
import scipy
from ._cache import cache
from . import core
from . import util
from .util.e... | bmcfee/librosa | librosa/onset.py | Python | isc | 19,286 |
import time
from cloudshell.cp.aws.common import retry_helper
class SubnetWaiter(object):
PENDING = 'pending'
AVAILABLE = 'available'
INSTANCE_STATES = [PENDING,
AVAILABLE]
def __init__(self, delay=10, timeout=10):
"""
:param delay: the time in seconds between ... | QualiSystems/AWS-Shell | package/cloudshell/cp/aws/domain/services/waiters/subnet.py | Python | isc | 1,404 |
import pkg_resources
from tiget.conf import settings
class GitError(Exception): pass
def get_config(name):
repo = settings.core.repository
if repo is None:
raise GitError('no repository found')
return repo.config[name]
def is_repo_initialized():
repo = settings.core.repository
if repo... | natano/tiget | tiget/git.py | Python | isc | 872 |
# Author: Alexander Sirotin / sirotin@gmail.com
# Copyright (c) 2017 Alexander Sirotin.
# Licensed under MIT license:
# https://opensource.org/licenses/mit-license.php
# Your use is on an "AS-IS" basis, and subject to the terms and conditions of this license.
from tests_common import TestBase, setup_logger
import sys
... | sirotin/at-a-glance-of-a-key | simple-python-testing-framework/tests/test_python_version.py | Python | mit | 658 |
# vim: set fileencoding=utf-8
import decimal
import datetime
DEFAULT_VAT = {
'S1': decimal.Decimal('1.20'), # Standard
'P1': decimal.Decimal('1.20'),
'SL': decimal.Decimal('1.05'), # Reduced
'PL': decimal.Decimal('1.05'),
'S0': decimal.Decimal('1'), # 0%
'P0': decimal.Decimal('1'),
'SE'... | lukegb/ehacktivities | eactivities/utils.py | Python | mit | 3,341 |
import _plotly_utils.basevalidators
class WidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="width", parent_name="scatter3d.error_x", **kwargs):
super(WidthValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/scatter3d/error_x/_width.py | Python | mit | 438 |
import json
import slscrypt
def hello(event, context):
body = {
"message": slscrypt.get('test'),
"input": event
}
response = {
"statusCode": 200,
"body": json.dumps(body)
};
return response
| marcy-terui/serverless-crypt | handler.py | Python | mit | 243 |
from setuptools import setup
setup(name='haios',
version='0.1',
description='Image Search Engine',
url='https://github.com/haikentcode/haios',
author='HITESH KUMAR REGAR (haikent)',
author_email='hiteshnitj16@gmail.com',
license='MIT',
packages=['descriptor','distance','spider... | haikentcode/haios | haios/setup.py | Python | mit | 356 |
# Django settings for FamilyFeed project.
import os.path
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'... | vorushin/FamilyFeed | settings.py | Python | mit | 5,785 |
# coding: utf-8
from sqlalchemy import Column, DateTime, ForeignKey, Integer, Text, text
from sqlalchemy.orm import relationship
from Houdini.Data import Base
metadata = Base.metadata
class Ban(Base):
__tablename__ = 'ban'
PenguinID = Column(ForeignKey(u'penguin.ID', ondelete=u'CASCADE', onupdate=u'CASCADE... | TunnelBlanket/Houdini | Houdini/Data/Ban.py | Python | mit | 936 |
"""Testing the StringEnum class."""
import ezenum as eze
def test_basic():
"""Just check it out."""
rgb = eze.StringEnum(['Red', 'Green', 'Blue'])
assert rgb.Red == 'Red'
assert rgb.Green == 'Green'
assert rgb.Blue == 'Blue'
assert rgb[0] == 'Red'
assert rgb[1] == 'Green'
assert rgb[2... | shaypal5/ezenum | tests/test_string_enum.py | Python | mit | 408 |
import re
import requests
import logging
logger = logging.getLogger(__name__)
class JsUnPacker(object):
"""
It takes the javascript file's url which contains the port numbers for
the encrypted strings. The file has to be unpacked to a readable form just like
http://matthewfl.com/unPacker.html does. T... | pgaref/HTTP_Request_Randomizer | http_request_randomizer/requests/parsers/js/UnPacker.py | Python | mit | 1,507 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Entry
@admin.register(Entry)
class EntryAdmin(admin.ModelAdmin):
fieldsets = [
('Regular Expression',
{'fields': ['pattern', 'test_string']}),
('Other Information',
{'fields': ['user', 'date_added']}),
... | mkhuthir/learnPython | Book_learning-python-r1.1/ch10/regex/entries/admin.py | Python | mit | 443 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .envconf import *
from .path import *
__version__ = '0.3.5'
| achedeuzot/django-envconf | envconf/__init__.py | Python | mit | 131 |
from distutils.core import setup, Extension;
# matey extension module
matey_module = Extension(
"_matey",
extra_compile_args=["-Wno-unused-variable"],
sources=["src/mateymodule.c", "src/matrix.c"]
);
# distribution
setup(name="matey",
version="0.0",
description="Numerical linear algebra for pyrates, aaarrggh... | benrbray/matey | matey_pyc/setup.py | Python | mit | 453 |
#!/usr/bin/env python
import networkx as nx
import pandas as pd
import numpy as np
def mention_graph_no_sentiment():
df = pd.read_pickle('pickles/with_corenlp_mentions.p')
G = nx.DiGraph()
for n, row in df.iterrows():
speaker = row['speaker']
mentions = row['corenlp_mentions']
... | dcalacci/love-in-the-time-of-communism | src/mention_graph.py | Python | mit | 401 |
# coding: utf-8
'''
Usage: gh <command> [<args>...]
gh <command> (-h|--help)
supported commands are:
gh fork <repo> forks user/repo
gh create <repo> creates a new repo
gh pull <repo> <base> <head> create a pull request
gh list_keys list user keys
gh create_key <title> [<public_key_path>] add a key to gi... | ywangd/stash | bin/gh.py | Python | mit | 6,911 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from lxml.html import fromstring, make_links_absolute, tostring
from urlparse import parse_qs, urlparse
import cookielib, json, importlib, re, urllib, urllib2
RE_URL = re.compile(r"""(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[... | cuteredcat/aukro | aukro/parser.py | Python | mit | 2,291 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.matlab
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Matlab and related languages.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, defa... | tmm1/pygments.rb | vendor/pygments-main/pygments/lexers/matlab.py | Python | mit | 31,893 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py | Python | mit | 1,314 |
import clr
import xmlutil
clr.AddReference('System.Xml')
from System.Xml import *
d = XmlDocument()
d.Load('C:\Program Files (x86)\IronPython 2.7\Tutorial\load.xml')
n = d.SelectNodes('//Puzzle/SavedGames/Game/@caption')
for e in n:
print e.Value
for e in xmlutil.Walk(d):
print e.Name, e.Value
| kenwilcox/PlayingWithIronPython | PythonLibs.py | Python | mit | 307 |
from __future__ import unicode_literals
class SmeltingRecipe:
def __init__(self, data):
self.input = data["input"]
def __str__(self):
return "Smelt {0}".format(self.input)
class BrewingRecipe:
def __init__(self, data):
self.base = data["base"]
self.modifier = data["modif... | randomdude999/mcinfo | mcinfo/recipes.py | Python | mit | 5,016 |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.autograd as autograd
import torchvision.datasets as dset
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torchvision.utils import save_image
import numpy as np
clas... | pianomania/infoGAN-pytorch | trainer.py | Python | mit | 4,627 |
import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="text",
parent_name="choroplethmapbox.legendgrouptitle",
**kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotl... | plotly/plotly.py | packages/python/plotly/plotly/validators/choroplethmapbox/legendgrouptitle/_text.py | Python | mit | 452 |
"""AMQPStorm Exception."""
AMQP_ERROR_MAPPING = {
311: ('CONTENT-TOO-LARGE',
'The client attempted to transfer content larger than the '
'server could accept at the present time. The client may '
'retry at a later time.'),
312: ('NO-ROUTE', 'Undocumented AMQP Soft Error'),
31... | eandersson/amqpstorm | amqpstorm/exception.py | Python | mit | 4,732 |
import sys
import os
import time
import resetMbed
import serialMonitor
# Program the mbed, restart it, launch a serial monitor to record streaming logs
def runMbedProgramWithLogging(argv):
for arg in argv:
if 'startup=1' in arg:
time.sleep(10)
# If a bin file was given as argument, program ... | tarquasso/softroboticfish6 | fish/pi/runMbedProgramWithLogging.py | Python | mit | 1,134 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-04-10 07:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_squashed_0008'),
]
operations = [
migrations.RemoveField(
... | opennode/nodeconductor | waldur_core/core/migrations/0002_remove_organization.py | Python | mit | 398 |
#!/usr/bin/env python
#The MIT License (MIT)
#Copyright (c) 2016 Massimiliano Patacchiola
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ... | mpatacchiola/deepgaze | deepgaze/motion_detection.py | Python | mit | 7,320 |
import tkinter
import sys
import getopt
import time
import threading
import os
import random
import enum
import racemap
import racecar
import racecolor
def callback(event):
""" Reacts to a user click on the window """
# switch on the status
global status
# if still initializing, ignore the click and don't do a... | kinnla/racetrack | racetrack.py | Python | mit | 8,945 |
from __future__ import print_function
import sys
import contextlib
from collections import OrderedDict, deque
import numpy
import six
import theano
from theano import tensor
from theano import printing
from theano.gof.graph import Constant
from theano.tensor.shared_randomstreams import RandomStateSharedVariable
from t... | rizar/attention-lvcsr | libs/blocks/blocks/utils/__init__.py | Python | mit | 18,117 |
#!/usr/bin/env python
import h5py
import numpy
import argparse
import cPickle
from fuel.datasets.hdf5 import H5PYDataset
def pack(f, name, dataset_pathes):
datasets = [cPickle.load(open(path)) for path in dataset_pathes]
data = sum(datasets, [])
dtype = h5py.special_dtype(vlen=numpy.dtype('int32'))
t... | rizar/actor-critic-public | bin/pack_to_hdf5.py | Python | mit | 2,224 |
from multiupload.fields import MultiUploadMetaField, MultiUploadMetaInput
from django import forms
from dal import autocomplete
from . import models
# Django 2 fix (https://github.com/Chive/django-multiupload/issues/31)
class PatchedMultiUploadMetaInput(MultiUploadMetaInput):
def render(self, name, value, attrs=... | WebArchivCZ/Seeder | Seeder/harvests/forms.py | Python | mit | 3,363 |
#!/usr/bin/env python3.6
import os, argparse, subprocess, tempfile, shutil, exifread, re
from datetime import datetime
def main():
parser = argparse.ArgumentParser()
parser.add_argument("project")
args = parser.parse_args()
home = os.path.join(os.path.expanduser("~"), "Videos", "Mine", "WIP")
des... | samhutchins/tools | video_production/stitch-timelapse.py | Python | mit | 2,855 |
#!/usr/bin/env python
import sys, logging, getpass, subprocess, os, json
# List of Heroku App ids to update
_heroku_app_ids = None
_HEROKU_APP_IDS_ENV_KEY = "HEROKU_APP_IDS"
def get_heroku_app_ids():
global _heroku_app_ids
# Lazy load
if _heroku_app_ids is None:
env = os.environ.get(_HEROKU_APP_ID... | AdmitHub/heroku-auto-ssl | hooks/heroku-auto-ssl/hook.py | Python | mit | 8,401 |
# https://www.hackerrank.com/challenges/angry-professor
t = int(input().strip())
for a0 in range(t):
n, k = map(int, input().strip().split(' '))
a = list(map(int, input().strip().split(' ')))
print('YES' if not sum([i <= 0 for i in a[0:n]]) >= k else 'NO')
| denisrmp/hacker-rank | hacker-rank/implementation/angry_professor.py | Python | mit | 264 |
import imageio
import pylib as py
# ==============================================================================
# = param =
# ==============================================================================
py.arg('--save_path', default='pics/cele... | LynnHo/DCGAN-LSGAN-WGAN-WGAN-GP-Tensorflow | make_gif.py | Python | mit | 1,392 |
# -*- coding: utf-8 -*-
"""
Optimization algorithms for OT
"""
# Author: Remi Flamary <remi.flamary@unice.fr>
# Titouan Vayer <titouan.vayer@irisa.fr>
#
# License: MIT License
import numpy as np
from scipy.optimize.linesearch import scalar_search_armijo
from .lp import emd
from .bregman import sinkhorn
# The... | rflamary/POT | ot/optim.py | Python | mit | 12,806 |