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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# summarize_tests.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... | sdiazpier/nest-simulator | testsuite/summarize_tests.py | Python | gpl-2.0 | 3,966 |
# 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... | strint/tensorflow | tensorflow/contrib/learn/python/learn/graph_actions_test.py | Python | apache-2.0 | 35,811 |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | glove747/liberty-neutron | neutron/tests/unit/agent/linux/test_external_process.py | Python | apache-2.0 | 11,219 |
# -*- coding: utf-8 -*-
"""
github3.gists.comment
---------------------
Module containing the logic for a GistComment
"""
from __future__ import unicode_literals
from ..models import BaseComment
from ..users import User
class GistComment(BaseComment):
"""This object represents a comment on a gist.
Two co... | h4ck3rm1k3/github3.py | github3/gists/comment.py | Python | bsd-3-clause | 961 |
import time
import os
import sys
import hashlib
import gc
import shutil
import platform
import errno
import logging
try:
import cPickle as pickle
except:
import pickle
from parso._compatibility import FileNotFoundError
LOG = logging.getLogger(__name__)
_PICKLE_VERSION = 30
"""
Version number (integer) for ... | archifix/settings | sublime/Packages/Jedi - Python autocompletion/dependencies/parso/cache.py | Python | mit | 4,791 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path import splitext
from thumbor.ext.filters import _alpha
... | MaTriXy/thumbor | thumbor/filters/watermark.py | Python | mit | 2,292 |
class NotFound(object):
pass | siddhika1889/Pydev-Editor | tests/pysrc/extendable/grammar3/relative.py | Python | epl-1.0 | 32 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
transaction_ids = fields.Many2many('payment.transaction'... | t3dev/odoo | addons/payment/models/account_invoice.py | Python | gpl-3.0 | 4,255 |
# -*- python -*-
# test_host_specific_configuration.py - Unit tests for
# swift_build_support.host_specific_configuration
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exc... | jckarter/swift | utils/swift_build_support/tests/test_host_specific_configuration.py | Python | apache-2.0 | 27,447 |
"""Auto-generated file, do not edit by hand. IO metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IO = PhoneMetadata(id='IO', country_code=246, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='3\\d{6}', possible_number_pattern='\\d{7... | roubert/python-phonenumbers | python/phonenumbers/data/region_IO.py | Python | apache-2.0 | 1,488 |
#
# 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
# ... | dims/heat | heat/tests/convergence/scenarios/update_replace_rollback.py | Python | apache-2.0 | 1,550 |
# 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... | frreiss/tensorflow-fred | tensorflow/python/autograph/converters/return_statements_test.py | Python | apache-2.0 | 5,879 |
# 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... | annarev/tensorflow | tensorflow/python/feature_column/feature_column_lib.py | Python | apache-2.0 | 1,597 |
# $Id$
# Christopher Lee clee@users.sourceforge.net
# based upon pdfmetrics.py by Andy Robinson
from . import fontinfo
from . import latin1MetricsCache
##############################################################
#
# PDF Metrics
# This is a preamble to give us a stringWidth function.
# loads and caches AFM files... | bp-kelley/rdkit | rdkit/sping/PS/psmetrics.py | Python | bsd-3-clause | 17,605 |
#!/usr/bin/env python
#
# Copyright 2012 Facebook
#
# 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... | andyaguiar/tornado | tornado/concurrent.py | Python | apache-2.0 | 18,212 |
# coding: utf-8
#
# Copyright 2015 The Oppia 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 requi... | sdulal/oppia | core/domain/classifier_services_test.py | Python | apache-2.0 | 10,135 |
def foo(a, /, b):
print(a, b)
def egg():
a = 1
b = 2
foo(a, b)<caret> | siosio/intellij-community | python/testData/multipleArgumentsCompletion/slashParameter.after.py | Python | apache-2.0 | 87 |
# -*- coding: utf-8 -*-
from gluon import current
#from gluon.html import *
from gluon.storage import Storage
from s3 import S3CustomController
THEME = "historic.CRMT"
# =============================================================================
class index(S3CustomController):
""" Custom Home Page """
d... | flavour/eden | modules/templates/historic/CRMT/controllers.py | Python | mit | 3,111 |
# encoding: utf-8
import os
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
app_dir_name = os.path.basename(os.path.dirname(os.path.dirname(__file__)))
class Migration(SchemaMigration):
def forwards(self, orm):
if app_dir_name == 'forum':
... | stianrh/askbot-nordic | askbot/migrations/0014_rename_schema_from_forum_to_askbot.py | Python | gpl-3.0 | 55,671 |
# -*- coding: utf-8 -*-
from openerp import models, api
class sale_order_line(models.Model):
_inherit = "sale.order.line"
@api.one
def button_confirm(self):
if self.product_id.recurring_invoice and self.order_id.project_id:
invoice_line_ids = [((0, 0, {
'product_id': ... | odoousers2014/odoo | addons/account_analytic_analysis/sale_order.py | Python | agpl-3.0 | 1,018 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... | 0dataloss/pyrax | samples/cloud_loadbalancers/session_persistence.py | Python | apache-2.0 | 1,492 |
"""
Hacks for the Django 1.0/1.0.2 releases.
"""
from django.conf import settings
from django.db.backends.creation import BaseDatabaseCreation
from django.db.models.loading import cache
from django.core import management
from django.core.management.commands.flush import Command as FlushCommand
from django.utils.datast... | edisonlz/fruit | web_project/base/site-packages/south/hacks/django_1_0.py | Python | apache-2.0 | 3,274 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import story
from telemetry import page as page_module
from telemetry import value
from telemetry.value import skip... | Chilledheart/chromium | tools/telemetry/telemetry/value/skip_unittest.py | Python | bsd-3-clause | 1,626 |
from collections import namedtuple
import cx_Oracle
from django.db import models
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo as BaseFieldInfo, TableInfo,
)
from django.utils.functional import cached_property
FieldInfo = namedtuple('FieldInfo', BaseFieldInfo._fields + ... | ar4s/django | django/db/backends/oracle/introspection.py | Python | bsd-3-clause | 14,220 |
"""
General image database
An image database creates a list of relative image path called image_set_index and
transform index to absolute image path. As to training, it is necessary that ground
truth and proposals are mixed together for training.
roidb
basic format [image_index]
['image', 'height', 'width', 'flipped',
... | deepakkumar1984/sia-cog | vis/rcnn/dataset/imdb.py | Python | mit | 13,177 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
# Copyright: (c) 2017, Sébastien DA ROCHA <sebastien@da-rocha.net>
# 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_... | alxgu/ansible | lib/ansible/modules/system/iptables.py | Python | gpl-3.0 | 26,931 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | Jorge-Rodriguez/ansible | lib/ansible/modules/network/f5/bigip_gtm_server.py | Python | gpl-3.0 | 61,691 |
import sys
import os
import platform
import re
import imp
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import idlever
from idlelib import WindowList
from idlelib import SearchDialog
from idlelib import GrepDialog
from idle... | sdlBasic/sdlbrt | win32/mingw/opt/lib/python2.7/idlelib/EditorWindow.py | Python | lgpl-2.1 | 66,626 |
from typing import TypeVar, Dict, Iterable, Any
T = TypeVar("T")
def foo(values: Dict[T, Iterable[Any]]):
for e in []:
values.setdefault(e, undefined) | allotria/intellij-community | python/testData/inspections/PyTypeCheckerInspection/UnresolvedReceiverGeneric.py | Python | apache-2.0 | 165 |
# Copyright 2013 OpenStack Foundation
#
# 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... | atheendra/access_keys | keystone/token/providers/uuid.py | Python | apache-2.0 | 929 |
# -*- coding: utf-8 -*-
# Basic exporter for svg icons
from os import listdir
from os.path import isfile, join, dirname, realpath
import subprocess
import sys
import rsvg
import cairo
last_svg_path = None
last_svg_data = None
SCRIPT_FOLDER = dirname(realpath(__file__)) + '/'
theme_dir_base = SCRIPT_FOLDER + '../..... | MrMaidx/godot | misc/scripts/svgs_2_pngs.py | Python | mit | 4,991 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from... | sameerparekh/pants | src/python/pants/backend/codegen/targets/java_protobuf_library.py | Python | apache-2.0 | 1,867 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017, Thierry Sallé (@tsalle)
# 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
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'commu... | ravibhure/ansible | lib/ansible/modules/monitoring/grafana_dashboard.py | Python | gpl-3.0 | 11,537 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | dbremner/bite-project | deps/mrtaskman/server/models/tasks.py | Python | apache-2.0 | 15,327 |
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# for py2/py3 compatibility
from __future__ import print_function
import signal
from . import base
from testrunner.local import utils
class SignalProc(... | weolar/miniblink49 | v8_7_5/tools/testrunner/testproc/sigproc.py | Python | apache-2.0 | 1,059 |
from ..broker import Broker
class SubnetBroker(Broker):
controller = "subnets"
def show(self, **kwargs):
"""Shows the details for the specified subnet.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
... | infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_8_0/subnet_broker.py | Python | apache-2.0 | 68,120 |
import re
import numpy as np
from scipy import special
from .common import with_attributes, safe_import
with safe_import():
from scipy.special import cython_special
FUNC_ARGS = {
'airy_d': (1,),
'airy_D': (1,),
'beta_dd': (0.25, 0.75),
'erf_d': (1,),
'erf_D': (1+1j,),
'exprel_d': (1e-6,)... | WarrenWeckesser/scipy | benchmarks/benchmarks/cython_special.py | Python | bsd-3-clause | 1,956 |
# encoding: UTF-8
__author__ = 'CHENXY'
from string import join
from sgit_struct import structDict
def processCallBack(line):
orignalLine = line
line = line.replace(' virtual void ', '') # 删除行首的无效内容
line = line.replace('{};\n', '') # 删除行尾的无效内容
content = line.split('(')
cbNa... | lukesummer/vnpy | vn.sgit/pyscript/generate_md_functions.py | Python | mit | 11,152 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 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; either version 2 of the
## ... | kaplun/Invenio-OpenAIRE | modules/bibformat/lib/elements/bfe_cited_by.py | Python | gpl-2.0 | 2,193 |
"""HTTP Headers constants."""
from .multidict import upstr
METH_ANY = upstr('*')
METH_CONNECT = upstr('CONNECT')
METH_HEAD = upstr('HEAD')
METH_GET = upstr('GET')
METH_DELETE = upstr('DELETE')
METH_OPTIONS = upstr('OPTIONS')
METH_PATCH = upstr('PATCH')
METH_POST = upstr('POST')
METH_PUT = upstr('PUT')
METH_TRACE = ups... | kehao95/Wechat_LearnHelper | src/env/lib/python3.5/site-packages/aiohttp/hdrs.py | Python | gpl-3.0 | 3,148 |
#!/usr/bin/env python
#
# Migration Stream Analyzer
#
# Copyright (c) 2015 Alexander Graf <agraf@suse.de>
#
# 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 of the Lic... | gongleiarei/qemu | scripts/analyze-migration.py | Python | gpl-2.0 | 20,683 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 t... | bluemini/kuma | vendor/packages/translate/storage/xml_name.py | Python | mpl-2.0 | 2,748 |
"""Tests for the Volumio integration."""
| jawilson/home-assistant | tests/components/volumio/__init__.py | Python | apache-2.0 | 41 |
# 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/distributions/python/ops/geometric.py | Python | bsd-2-clause | 7,545 |
#!/usr/bin/python
"""
A general tool for converting data from the
dictionary format to an (n x k) python list that's
ready for training an sklearn algorithm
n--no. of key-value pairs in dictonary
k--no. of features being extracted
dictionary keys are names of persons in dataset
dictiona... | harish-garg/Machine-Learning | udacity/enron/ud120-projects-master/tools/feature_format.py | Python | mit | 4,390 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | wulczer/ansible | lib/ansible/inventory/ini.py | Python | gpl-3.0 | 7,628 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
# 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_ve... | alxgu/ansible | lib/ansible/modules/network/aci/mso_schema_site_vrf_region.py | Python | gpl-3.0 | 6,343 |
#!/usr/bin/env python
from modshogun import LongIntFeatures
from numpy import array, int64, all
# create dense matrix A
matrix=array([[1,2,3],[4,0,0],[0,0,0],[0,5,0],[0,0,6],[9,9,9]], dtype=int64)
parameter_list = [[matrix]]
# ... of type LongInt
def features_dense_longint_modular (A=matrix):
a=LongIntFeatures(A)
... | AzamYahya/shogun | examples/undocumented/python_modular/features_dense_longint_modular.py | Python | gpl-3.0 | 606 |
# Copyright Anne M. Archibald 2008
# Released under the scipy license
from __future__ import division, print_function, absolute_import
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_, run_module_suite)
import numpy as np
from scipy.spatial impo... | giorgiop/scipy | scipy/spatial/tests/test_kdtree.py | Python | bsd-3-clause | 24,475 |
import unittest
import pystache
from pystache import Renderer
from examples.nested_context import NestedContext
from examples.complex import Complex
from examples.lambdas import Lambdas
from examples.template_partial import TemplatePartial
from examples.simple import Simple
from pystache.tests.common import EXAMPLES_... | zzeleznick/zDjango | venv/lib/python2.7/site-packages/pystache/tests/test_simple.py | Python | mit | 2,785 |
__author__ = 'bromix'
from .directory_item import DirectoryItem
from .. import constants
class SearchHistoryItem(DirectoryItem):
def __init__(self, context, query, image=None, fanart=None):
if image is None:
image = context.create_resource_path('media/search.png')
pass
Di... | azumimuo/family-xbmc-addon | zips/plugin.video.youtube/resources/lib/kodion/items/search_history_item.py | Python | gpl-2.0 | 1,259 |
# -*- coding: utf-8 -*-
## $Id: webmessage_webinterface.py,v 1.13 2008/03/12 16:48:08 tibor Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 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 t... | kaplun/Invenio-OpenAIRE | modules/bibexport/lib/bibexport_method_fieldexporter_webinterface.py | Python | gpl-2.0 | 22,858 |
## This file is part of Invenio.
## Copyright (C) 2009, 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; either version 2 of the
## License, or (at your option) any later versio... | NikolaYolov/invenio_backup | modules/bibmerge/lib/bibmerge_merger.py | Python | gpl-2.0 | 13,389 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# 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__ = ty... | hryamzik/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_account_facts.py | Python | gpl-3.0 | 2,100 |
#!/usr/bin/env python
# (c) 2013, Jesse Keating <jesse.keating@rackspace.com,
# Paul Durivage <paul.durivage@rackspace.com>,
# Matt Martz <matt@sivel.net>
#
# 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 Pu... | anryko/ansible | contrib/inventory/rax.py | Python | gpl-3.0 | 16,904 |
thing = "hello from formerly_testcoll_pkg.submod.thing"
| j-carl/ansible | test/integration/targets/collections/collection_root_user/ansible_collections/testns/othercoll/plugins/module_utils/formerly_testcoll_pkg/submod.py | Python | gpl-3.0 | 56 |
from __future__ import division, absolute_import, print_function
import sys, re, inspect, textwrap, pydoc
import sphinx
import collections
from .docscrape import NumpyDocString, FunctionDoc, ClassDoc
if sys.version_info[0] >= 3:
sixu = lambda s: s
else:
sixu = lambda s: unicode(s, 'unicode_escape')
class Sp... | opotowsky/cyclus.github.com | source/numpydoc/docscrape_sphinx.py | Python | bsd-3-clause | 9,437 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class XNXXIE(InfoExtractor):
_VALID_URL = r'https?://(?:video|www)\.xnxx\.com/video-?(?P<id>[0-9a-z]+)/'
_TESTS = [{
'url': 'http://www.xnxx.com/video-55awb78/sky... | Tithen-Firion/youtube-dl | youtube_dl/extractor/xnxx.py | Python | unlicense | 1,596 |
"""Tests for the fido component."""
| fbradyirl/home-assistant | tests/components/fido/__init__.py | Python | apache-2.0 | 36 |
class A(object):
def __init__(self, bar):
self._x = 1 ; self._bar = bar
def __getX(self):
return self._x
def __setX(self, x):
self._x = x
def __delX(self):
pass
x1 = property(__getX, __setX, __delX, "doc of x1")
x2 = property(__setX) # should return
x3 = property(__getX, __getX) # shou... | caot/intellij-community | python/testData/inspections/PyPropertyDefinitionInspection25/src/prop_test.py | Python | apache-2.0 | 1,700 |
from __future__ import absolute_import
from django.conf.urls import patterns, include
from . import views, customadmin, admin
urlpatterns = patterns('',
(r'^test_admin/admin/doc/', include('django.contrib.admindocs.urls')),
(r'^test_admin/admin/secure-view/$', views.secure_view),
(r'^test_admin/admin/',... | dex4er/django | tests/admin_views/urls.py | Python | bsd-3-clause | 617 |
from enigma import eTimer
from Converter import Converter
class ConditionalShowHide(Converter, object):
def __init__(self, argstr):
Converter.__init__(self, argstr)
args = argstr.split(',')
self.invert = "Invert" in args
self.blink = "Blink" in args
if self.blink:
self.blinktime = len(args) == 2 and args... | popazerty/EG-2 | lib/python/Components/Converter/ConditionalShowHide.py | Python | gpl-2.0 | 1,460 |
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# Copyright (c) 2013, Michael Scherer <misc@zarb.org>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.tx... | alxgu/ansible | lib/ansible/plugins/connection/funcd.py | Python | gpl-3.0 | 3,533 |
import unittest
import unittest.mock
import random
import time
import pickle
import warnings
from functools import partial
from math import log, exp, pi, fsum, sin
from test import support
class TestBasicOps:
# Superclass with tests common to all generators.
# Subclasses must arrange for self.gen to retrieve t... | jiangzhuo/kbengine | kbe/src/lib/python/Lib/test/test_random.py | Python | lgpl-3.0 | 31,638 |
"""Defines serializers used by the Team API."""
from copy import deepcopy
from django.contrib.auth.models import User
from django.db.models import Count
from django.conf import settings
from django_countries import countries
from rest_framework import serializers
from openedx.core.lib.api.serializers import Collapsed... | solashirai/edx-platform | lms/djangoapps/teams/serializers.py | Python | agpl-3.0 | 7,981 |
from dogpile.cache.region import register_backend
register_backend(
"dogpile.cache.null", "dogpile.cache.backends.null", "NullBackend")
register_backend(
"dogpile.cache.dbm", "dogpile.cache.backends.file", "DBMBackend")
register_backend(
"dogpile.cache.pylibmc", "dogpile.cache.backends.memcached",
"Pyl... | ctrlaltdel/neutrinator | vendor/dogpile/cache/backends/__init__.py | Python | gpl-3.0 | 856 |
"""
Utilities for dealing with JSON.
"""
import simplejson
from xmodule.modulestore import EdxJSONEncoder
class EscapedEdxJSONEncoder(EdxJSONEncoder):
"""
Class for encoding edx JSON which will be printed inline into HTML
templates.
"""
def encode(self, obj):
"""
Encodes JSON tha... | Semi-global/edx-platform | openedx/core/lib/json_utils.py | Python | agpl-3.0 | 533 |
def f():
a = 1
b = 1
foo(a, b)
def foo(a_new, b_new):
print(a_new + b_new * 123) | caot/intellij-community | python/testData/refactoring/extractmethod/Statement.after.py | Python | apache-2.0 | 98 |
"""
Amazon auth backend, docs at:
http://psa.matiasaguirre.net/docs/backends/twilio.html
"""
from re import sub
from social.p3 import urlencode
from social.backends.base import BaseAuth
class TwilioAuth(BaseAuth):
name = 'twilio'
ID_KEY = 'AccountSid'
def get_user_details(self, response):
""... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/social/backends/twilio.py | Python | agpl-3.0 | 1,384 |
"""
Tests for open ended grading interfaces
./manage.py lms --settings test test lms/djangoapps/open_ended_grading
"""
import ddt
import json
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import RequestFactory
... | ahmadiga/min_edx | lms/djangoapps/open_ended_grading/tests.py | Python | agpl-3.0 | 22,144 |
mapsize = 35
def test(x, y):
if <weak_warning descr="Simplify chained comparison">0 <= x < <caret>mapsize and y >= 0 and y < mapsize</weak_warning>:
return 1 | asedunov/intellij-community | python/testData/inspections/ChainedComparison5.py | Python | apache-2.0 | 164 |
from networkx.algorithms.chordal.chordal_alg import *
| LumPenPacK/NetworkExtractionFromImages | win_build/nefi2_win_amd64_msvc_2015/site-packages/networkx/algorithms/chordal/__init__.py | Python | bsd-2-clause | 56 |
from django.conf import settings
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
from django.utils.functional import cached_property
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_ops = 'GIST_GEOMETRY_OPS'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND... | edisonlz/fruit | web_project/base/site-packages/django/contrib/gis/db/backends/postgis/creation.py | Python | apache-2.0 | 4,498 |
from __future__ import division
# When true division is the default, get rid of this and add it to
# test_long.py instead. In the meantime, it's too obscure to try to
# trick just part of test_long into using future division.
import sys
import random
import math
import unittest
from test.test_support import run_unitt... | teeple/pns_server | work/install/Python-2.7.4/Lib/test/test_long_future.py | Python | gpl-2.0 | 9,026 |
from .sitemap import * | grupydf/grupybr-template | {{cookiecutter.repo_name}}/.plugins/sitemap/__init__.py | Python | gpl-3.0 | 22 |
"""
Tools for sending email.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the int... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/core/mail/__init__.py | Python | bsd-3-clause | 5,072 |
import re
from django.conf import settings
from django.http import HttpResponsePermanentRedirect
class SecurityMiddleware(object):
def __init__(self):
self.sts_seconds = settings.SECURE_HSTS_SECONDS
self.sts_include_subdomains = settings.SECURE_HSTS_INCLUDE_SUBDOMAINS
self.content_type_no... | BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/middleware/security.py | Python | mit | 1,753 |
"""add post media
Revision ID: 04da9abf37e2
Revises: 2e3a2882e5a4
Create Date: 2017-08-08 15:15:50.911420
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '04da9abf37e2'
down_revision = '2e3a2882e5a4'
branch_labels = None
depends_on = None
def upgrade():
o... | codl/forget | migrations/versions/04da9abf37e2_add_post_media.py | Python | isc | 683 |
# Generated by Django 2.0.13 on 2020-01-04 17:21
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import modoboa.limits.models
class Migration(migrations.Migration):
replaces = [
('limits', '0001_initial'),
('limits', '0002_auto_20151114... | modoboa/modoboa | modoboa/limits/migrations/0001_squashed_0004_auto_20160413_1312.py | Python | isc | 2,070 |
'''
Copyright (c) 2017 Yogesh Khatri
This file is part of mac_apt (macOS Artifact Parsing Tool).
Usage or distribution of this software/code is subject to the
terms of the MIT License.
'''
import io
import os
import logging
import nska_deserialize as nd
from plugins.helpers import macinfo
import plu... | ydkhatri/mac_apt | plugins/safari.py | Python | mit | 30,422 |
#!/usr/bin/env python
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter as ADHF
from sys import stdout, stderr, exit, maxint, argv
from os.path import join, dirname, basename, isfile
from itertools import izip, chain
from bisect import insort
import logging
import json
import re
import matplotlib; ma... | danydoerr/PSyCHO | scripts/visualize_overlapping_sbs.py | Python | mit | 12,540 |
import abc
try:
import collections.abc as collectionsabc
except ImportError:
import collections as collectionsabc
import decimal
import io
import json
import locale
import os
import os.path
import subprocess
import threading
import time
def parse_version_string():
path = os.path.abspath(__file__)
while... | fenhl/lazyjson | lazyjson/__init__.py | Python | mit | 15,325 |
from pyh import *
list=[[1,'Lucy',25],[2,'Tom',30],[3,'Lily',20]]
page = PyH('Test')
page<<div(style="text-align:center")<<h4('Test table')
mytab = page << table(border="1",cellpadding="3",cellspacing="0",style="margin:auto")
tr1 = mytab << tr(bgcolor="lightgrey")
tr1 << th('id') + th('name')+th('age')
for i in range(l... | MiracleWong/PythonBasic | PyH/demo.py | Python | mit | 635 |
from app import Handler
from handlers.auth import Auth
class LogoutHandler(Handler):
def get(self):
Auth.logout(self.response)
self.redirect("/")
| diegopettengill/multiuserblog | handlers/logout.py | Python | mit | 168 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/example/example.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 imp... | nubbel/swift-tensorflow | PythonGenerated/tensorflow/core/example/example_pb2.py | Python | mit | 4,799 |
from abc import ABCMeta, abstractmethod
import numpy as np
class Illustration2VecBase(object):
__metaclass__ = ABCMeta
def __init__(self, net, tags=None, threshold=None):
self.net = net
if tags is not None:
self.tags = np.array(tags)
self.index = {t: i for i, t in enu... | rezoo/illustration2vec | i2v/base.py | Python | mit | 5,296 |
# Copyright (c) 2015-2019 Jack Morton <jhm@jemscout.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | jhm-/nhlscrappo | nhlscrappo/fetcher.py | Python | mit | 7,149 |
class Stats:
"""
Contains the stats that a character or monster may have.
The stats tied to an agent are:
* Health: The amount of damage the agent can withstand. The agent dies when their health falls to zero. This is
the only stat that will persist after a battle ends.
* Stamina: An... | MikeHoffert/caladbolg-engine | caladbolg/agents/stats.py | Python | mit | 1,898 |
class URIError(Exception):
pass
| sergeyglazyrindev/amigrations | amigrations/adapters/exceptions.py | Python | mit | 36 |
from select_multiple_field.models import SelectMultipleField
class CommaSeparatedCharField(SelectMultipleField):
def contribute_to_class(self, cls, name, **kwargs):
"""Contribute to the Model subclass.
We just set our custom get_FIELD_display(),
which returns a comma-separated list of di... | Lcaracol/ideasbox.lan | ideasbox/fields.py | Python | mit | 778 |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 10 17:27:49 2016
@author: camacho
"""
import Kernel;reload(Kernel);kl = Kernel
import numpy as np
from time import time
import inspect as i
##### LIKELIHOOD
def likelihood(kernel, x, xcalc, y, yerr): #covariance matrix calculations
K = np.zeros((len(x),len(x)))... | jdavidrcamacho/Tests_GP | 01 - Trials and attempts/Cheat_attempt/Likelihood.py | Python | mit | 3,613 |
# This file is part of pyplink.
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Louis-Philippe Lemieux Perreault
#
# 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, includ... | lemieuxl/pyplink | pyplink/tests/__main__.py | Python | mit | 1,406 |
#!/usr/bin/env python
import doctest
import unittest
import sys
def test_suite(docs):
suite = unittest.TestSuite()
for doc in docs:
suite.addTest(doctest.DocFileSuite(doc, optionflags=flags()))
return suite
def flags():
flags = doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS
if sys.version_i... | nsi-iff/should-dsl | run_examples.py | Python | mit | 630 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-27 17:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0008_sponsor_primary_sponsor'),
]
operations = [
migrations.CreateMo... | davidjrichardson/uwcs-zarya | blog/migrations/0009_footer.py | Python | mit | 666 |
from __future__ import unicode_literals
from django.apps import AppConfig
class ToolboxConfig(AppConfig):
name = 'toolbox'
| california-civic-data-coalition/django-calaccess-downloads-website | toolbox/apps.py | Python | mit | 130 |
# -*- coding: utf-8 -*-
from rdflib import Namespace
ONTOLEX = Namespace("http://www.w3.org/ns/lemon/ontolex#")
LEXINFO = Namespace("http://www.lexinfo.net/ontology/2.0/lexinfo#")
DECOMP = Namespace("http://www.w3.org/ns/lemon/decomp#")
ISOCAT = Namespace("http://www.isocat.org/datcat/")
LIME = Namespace("http://www.w... | wimmuskee/ontolex-db | format/namespace.py | Python | mit | 343 |
from __future__ import absolute_import
from pyti import catch_errors
from pyti.function_helper import fill_for_noncomputable_vals
from six.moves import range
def linear_weighted_moving_average(data, period):
"""
Linear Weighted Moving Average.
Formula:
LWMA = SUM(DATA[i]) * i / SUM(i)
"""
cat... | kylejusticemagnuson/pyti | pyti/linear_weighted_moving_average.py | Python | mit | 700 |
class Solution:
def maxNumEdgesToRemove(self, n: int, edges: List[List[int]]) -> int:
parent = list(range(n + 1))
def findParent(i):
while parent[i] != i:
parent[i] = parent[parent[i]]
i = parent[i]
return i
def union(u, v):
... | jiadaizhao/LeetCode | 1501-1600/1579-Remove Max Number of Edges to Keep Graph Fully Traversable/1579-Remove Max Number of Edges to Keep Graph Fully Traversable.py | Python | mit | 1,211 |
# orm/interfaces.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Contains various base classes used throughout the ORM.
Defines the now depreca... | sauloal/PiCastPy | sqlalchemy/orm/interfaces.py | Python | mit | 28,330 |
import cgi
import email.utils
import hashlib
import getpass
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
import pip
from pip.backwardcompat import urllib, urlparse, raw_input
from pip.exceptions import InstallationError, HashMismatch
from pip.util import (splitext, rmt... | ppyordanov/HCI_4_Future_Cities | Server/src/virtualenv/Lib/site-packages/pip/download.py | Python | mit | 22,573 |