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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
import zipfile
import config
import store
import common
from db import db_session, Source
import crypto_util
# Set environment variable so config.py uses a test environment
os.environ['SECUREDROP_ENV'] = 'test'
class TestStore(unittest.TestCase)... | mark-in/securedrop-app-code | tests/test_unit_store.py | Python | agpl-3.0 | 1,563 |
"""Model managers for Reversion."""
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback.
from django.contrib.contenttypes.models import ContentType
from django.db import models
class VersionManager(models.Manager):
"""Manager for Version models."""
def get_for_obj... | jaredjennings/snowy | wsgi/snowy/snowy/lib/reversion/managers.py | Python | agpl-3.0 | 2,511 |
#!/usr/bin/env python
"""
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... | cjcjameson/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/access_methods/ao_memory.py | Python | apache-2.0 | 2,282 |
import os
import pytest
from pyleus.cli.storm_cluster import _get_storm_cmd_env
from pyleus.cli.storm_cluster import STORM_JAR_JVM_OPTS
from pyleus.cli.storm_cluster import StormCluster
from pyleus.cli.storm_cluster import TOPOLOGY_BUILDER_CLASS
from pyleus.testing import mock
class TestGetStormCmdEnd(object):
... | jirafe/pyleus | tests/cli/storm_cluster_test.py | Python | apache-2.0 | 1,989 |
from math import exp
from collections import defaultdict
@outputSchema("scaled: double")
def logistic_scale(val, logistic_param):
return -1.0 + 2.0 / (1.0 + exp(-logistic_param * val))
@outputSchema("t: (item_A, item_B, dist: double, raw_weight: double)")
def best_path(paths):
return sorted(paths, key=lambda ... | ShadySQL/mortar-recsys | udfs/jython/recsys.py | Python | apache-2.0 | 1,151 |
# definitions which are not being deprecated from wagtail.admin.forms
from .models import ( # NOQA
DIRECT_FORM_FIELD_OVERRIDES, FORM_FIELD_OVERRIDES, WagtailAdminModelForm,
WagtailAdminModelFormMetaclass, formfield_for_dbfield)
from .pages import WagtailAdminPageForm # NOQA
| zerolab/wagtail | wagtail/admin/forms/__init__.py | Python | bsd-3-clause | 285 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-18 12:59
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
import wagtail.search.index
class Migration(migrations.Migration):
initial = True
dependencies = [
('taggit', '0002_auto_20150616_... | kaedroho/wagtail | wagtail/tests/search/migrations/0001_initial.py | Python | bsd-3-clause | 3,247 |
#!/usr/bin/env python
from nose.tools import *
from networkx import *
from networkx.generators.random_graphs import *
class TestGeneratorsRandom():
def smoke_test_random_graph(self):
seed = 42
G=gnp_random_graph(100,0.25,seed)
G=binomial_graph(100,0.25,seed)
G=erdos_renyi_graph(100,... | beni55/networkx | networkx/generators/tests/test_random_graphs.py | Python | bsd-3-clause | 4,826 |
from __future__ import unicode_literals
from .. import Provider as PhoneNumberProvider
class Provider(PhoneNumberProvider):
formats = (
# Mobile
# Government website: http://www.uke.gov.pl/numeracja-843
'50# ### ###',
'51# ### ###',
'53# ### ###',
'57# ### ###',
... | deanishe/alfred-fakeum | src/libs/faker/providers/phone_number/pl_PL/__init__.py | Python | mit | 937 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
lasoverlapPro.py
---------------------
Date : October 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
*************... | pavlova-marina/QGIS | python/plugins/processing/algs/lidar/lastools/lasoverlapPro.py | Python | gpl-2.0 | 4,596 |
##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | pneerincx/easybuild-framework | easybuild/toolchains/linalg/__init__.py | Python | gpl-2.0 | 1,340 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | david-ragazzi/nupic | nupic/encoders/coordinate.py | Python | gpl-3.0 | 6,560 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | david-ragazzi/nupic | nupic/research/monitor_mixin/metric.py | Python | gpl-3.0 | 2,865 |
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import matp... | harterj/moose | python/mms/ConvergencePlot.py | Python | lgpl-2.1 | 3,697 |
"""Test the Advantage Air Sensor Platform."""
from datetime import timedelta
from json import loads
from homeassistant.components.advantage_air.const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from homeassistant.components.advantage_air.sensor import (
ADVANTAGE_AIR_SERVICE_SET_TIME_TO,
ADVANTAGE_AIR_SET_COUNTDOWN... | aronsky/home-assistant | tests/components/advantage_air/test_sensor.py | Python | apache-2.0 | 4,781 |
""" This provides some useful code used by other modules. This is not to be
used by the end user which is why it is hidden. """
import string, sys
class LinkError(Exception):
pass
def refine_import_err(mod_name, extension_name, exc):
""" Checks to see if the ImportError was because the library
itself was... | b3c/VTK-5.8 | Wrapping/Python/vtk/__helper.py | Python | bsd-3-clause | 981 |
"""
A sub-package for efficiently dealing with polynomials.
Within the documentation for this sub-package, a "finite power series,"
i.e., a polynomial (also referred to simply as a "series") is represented
by a 1-D numpy array of the polynomial's coefficients, ordered from lowest
order term to highest. For example, a... | simongibbons/numpy | numpy/polynomial/__init__.py | Python | bsd-3-clause | 6,788 |
import os
import re
import sys
def ReadFileAsLines(filename):
"""Reads a file, removing blank lines and lines that start with #"""
file = open(filename, "r")
raw_lines = file.readlines()
file.close()
lines = []
for line in raw_lines:
line = line.strip()
if len(line) > 0 and not... | endlessm/chromium-browser | third_party/angle/src/tests/gles_conformance_tests/generate_gles_conformance_tests.py | Python | bsd-3-clause | 2,098 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This package contains various command line wrappers to programs used in
pymatgen that do not have Python equivalents.
"""
| gVallverdu/pymatgen | pymatgen/command_line/__init__.py | Python | mit | 237 |
"""Tests for distutils.command.build_scripts."""
import os
import unittest
from distutils.command.build_scripts import build_scripts
from distutils.core import Distribution
import sysconfig
from distutils.tests import support
from test.test_support import run_unittest
class BuildScriptsTestCase(suppor... | ktan2020/legacy-automation | win/Lib/distutils/tests/test_build_scripts.py | Python | mit | 3,712 |
# -*- coding: utf-8 -*-
#
# synapsecollection.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 Licen... | SepehrMN/nest-simulator | pynest/examples/synapsecollection.py | Python | gpl-2.0 | 5,672 |
#!/usr/bin/env python
"""
The LibVMI Library is an introspection library that simplifies access to
memory in a target virtual machine or in a file containing a dump of
a system's physical memory. LibVMI is based on the XenAccess Library.
Copyright 2011 Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000... | jie-lin/libvmi | tools/pyvmi/examples/process-list.py | Python | gpl-3.0 | 1,982 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Anusha Hegde <anushah@vmware.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_version':... | roadmapper/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_serial_port.py | Python | gpl-3.0 | 19,614 |
# Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | allmende/synnefo | snf-django-lib/snf_django/lib/api/urls.py | Python | gpl-3.0 | 1,762 |
# Copyright 2013 Mirantis 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 ... | vijayendrabvs/ssl-python-neutronclient | neutronclient/tests/unit/test_cli20_servicetype.py | Python | apache-2.0 | 2,313 |
# stdlib
from collections import defaultdict
import time
# 3p
import psutil
# project
from checks import AgentCheck
from config import _is_affirmative
from utils.platform import Platform
DEFAULT_AD_CACHE_DURATION = 120
DEFAULT_PID_CACHE_DURATION = 120
ATTR_TO_METRIC = {
'thr': 'threads',
'cpu... | pfmooney/dd-agent | checks.d/process.py | Python | bsd-3-clause | 12,036 |
try:
from astropy.models import ParametricModel,Parameter,_convert_input,_convert_output
import numpy as np
class PowerLawModel(ParametricModel):
param_names = ['scale', 'alpha']
def __init__(self, scale, alpha, param_dim=1):
self._scale = Parameter(name='scale', val=scale, mcl... | vlas-sokolov/pyspeckit | pyspeckit/spectrum/models/astropy_models.py | Python | mit | 1,575 |
# Copyright 2018 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... | yanchen036/tensorflow | tensorflow/contrib/data/python/ops/iterator_ops_test.py | Python | apache-2.0 | 4,700 |
# 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 code
import cpp_util
from model import Platforms
from schema_util import CapitalizeFirstLetter
from schema_util import JsFunctionNameToClassName
... | boundarydevices/android_external_chromium_org | tools/json_schema_compiler/cpp_bundle_generator.py | Python | bsd-3-clause | 11,513 |
# Copyright Niall Douglas 2005.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from voidptr_ext import *
Check for correct conversion
>>> use(get())
Check that None is conver... | alexa-infra/negine | thirdparty/boost-python/libs/python/test/voidptr.py | Python | mit | 1,168 |
#
# (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 ve... | roadmapper/ansible | lib/ansible/plugins/terminal/dellos6.py | Python | gpl-3.0 | 3,474 |
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Get FileServers',
# list of one or more authors for the module
... | EmpireProject/Empire | lib/modules/python/situational_awareness/network/active_directory/get_fileservers.py | Python | bsd-3-clause | 4,433 |
# Volatility
# Copyright (c) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | Cisco-Talos/pyrebox | volatility/volatility/plugins/overlays/windows/vista_sp12_x64_syscalls.py | Python | gpl-2.0 | 43,395 |
# 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... | hfp/tensorflow-xsmm | tensorflow/contrib/optimizer_v2/rmsprop_test.py | Python | apache-2.0 | 19,033 |
##########################################################################
#
# Copyright (c) 2014, Image Engine Design 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:
#
# * Redistrib... | lucienfostier/gaffer | python/GafferSceneUI/DeleteOptionsUI.py | Python | bsd-3-clause | 2,461 |
# -*- test-case-name: twisted.pb.test.test_promise -*-
from twisted.python import util, failure
from twisted.internet import defer
id = util.unsignedID
EVENTUAL, FULFILLED, BROKEN = range(3)
class Promise:
"""I am a promise of a future result. I am a lot like a Deferred, except
that my promised result is us... | tquilian/exelearningTest | twisted/pb/promise.py | Python | gpl-2.0 | 3,532 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# MicroPython documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 21 11:42:03 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... | vriera/micropython | docs/conf.py | Python | mit | 9,675 |
"""
Boolean geometry utilities.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
import sys
__author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
... | dob71/x2swn | skeinforge/fabmetheus_utilities/geometry/geometry_utilities/evaluate_fundamentals/print.py | Python | gpl-3.0 | 984 |
from openerp.osv import osv, fields
from openerp.tools.translate import _
from openerp.addons.point_of_sale.point_of_sale import pos_session
class pos_session_opening(osv.osv_memory):
_name = 'pos.session.opening'
_columns = {
'pos_config_id' : fields.many2one('pos.config', string='Point of Sale', ... | addition-it-solutions/project-all | addons/point_of_sale/wizard/pos_session_opening.py | Python | agpl-3.0 | 5,032 |
# Copyright 2014, Rackspace, US, 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 w... | takeshineshiro/horizon | openstack_dashboard/api/rest/__init__.py | Python | apache-2.0 | 1,343 |
# 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... | cg31/tensorflow | tensorflow/contrib/framework/python/ops/prettyprint_ops.py | Python | apache-2.0 | 6,195 |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the getchaintips RPC.
- introduce a network split
- work on chains of different lengths
- join th... | litecoin-project/litecoin | test/functional/rpc_getchaintips.py | Python | mit | 2,291 |
import unittest
import time
from datetime import datetime
from app import create_app, db
from app.models import User, AnonymousUser, Role, Permission
class UserModelTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
self... | Ginray/my-flask-blog | tests/test_user_model.py | Python | mit | 5,437 |
from ..libmp.backend import xrange
from .functions import defun, defun_wrapped, defun_static
@defun
def stieltjes(ctx, n, a=1):
n = ctx.convert(n)
a = ctx.convert(a)
if n < 0:
return ctx.bad_domain("Stieltjes constants defined for n >= 0")
if hasattr(ctx, "stieltjes_cache"):
stieltjes_c... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/sympy/mpmath/functions/zeta.py | Python | agpl-3.0 | 35,983 |
# Copyright 2017 gRPC authors.
#
# 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... | endlessm/chromium-browser | third_party/grpc/src/src/python/grpcio_tests/tests/unit/_cython/_common.py | Python | bsd-3-clause | 4,044 |
#!/usr/bin/python2.4
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | nguyentran/openviber | tools/swtoolkit/test/environment_tools_test.py | Python | mit | 10,313 |
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import step, world
from common import *
############### ACTIONS ####################
@step('There are no courses$')
def no_courses(step):
world.clear_courses()
create_studio_user()
@... | Stanford-Online/edx-platform | cms/djangoapps/contentstore/features/courses.py | Python | agpl-3.0 | 2,137 |
# Copyright 2018 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... | ghchinoy/tensorflow | tensorflow/contrib/eager/python/examples/densenet/densenet_test.py | Python | apache-2.0 | 12,967 |
#!/usr/bin/python
#
# (c) 2018 Extreme Networks 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 late... | thaim/ansible | lib/ansible/modules/network/exos/exos_facts.py | Python | mit | 5,863 |
# 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... | ghchinoy/tensorflow | tensorflow/contrib/sparsemax/python/ops/sparsemax.py | Python | apache-2.0 | 3,656 |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | cytec/SickRage | lib/github/PaginatedList.py | Python | gpl-3.0 | 7,862 |
import os
import shutil
import tempfile
import vmprof
import prof_six as six
from _prof_imports import TreeStats, CallTreeStat
class VmProfProfile(object):
""" Wrapper class that represents VmProf Python profiling backend with API matching
the cProfile.
"""
def __init__(self):
self.stats... | siosio/intellij-community | python/helpers/profiler/vmprof_profiler.py | Python | apache-2.0 | 2,691 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 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/test_dtd.py | Python | mpl-2.0 | 20,624 |
# 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... | cg31/tensorflow | tensorflow/tensorboard/scripts/generate_testdata.py | Python | apache-2.0 | 7,184 |
#!/usr/bin/env python
#
# Copyright 2009 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tornado/escape.py | Python | bsd-2-clause | 14,393 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, re
from frappe.website.website_generator import WebsiteGenerator
from frappe.website.render import clear_cache
from frappe.utils import today, cint, global_dat... | gangadharkadam/shfr | frappe/website/doctype/blog_post/blog_post.py | Python | mit | 3,543 |
class PayPalFailure(Exception): pass | AlphaCluster/NewsBlur | vendor/paypal/pro/exceptions.py | Python | mit | 36 |
name0_1_1_0_0_2_0 = None
name0_1_1_0_0_2_1 = None
name0_1_1_0_0_2_2 = None
name0_1_1_0_0_2_3 = None
name0_1_1_0_0_2_4 = None | siosio/intellij-community | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_1/_pkg0_1_1/_pkg0_1_1_0/_pkg0_1_1_0_0/_mod0_1_1_0_0_2.py | Python | apache-2.0 | 128 |
__version__="0.12.5"
| nzsquirrell/p2pool-myriad | oldstuff/SOAPpy/version.py | Python | gpl-3.0 | 22 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | jaggu303619/asylum | openerp/addons/mail/wizard/invite.py | Python | agpl-3.0 | 4,418 |
from django.apps import AppConfig
class WagtailAdminAppConfig(AppConfig):
name = 'wagtail.wagtailadmin'
label = 'wagtailadmin'
verbose_name = "Wagtail admin"
| WQuanfeng/wagtail | wagtail/wagtailadmin/apps.py | Python | bsd-3-clause | 172 |
import logging
access_logger = logging.getLogger('aiohttp.access')
client_logger = logging.getLogger('aiohttp.client')
internal_logger = logging.getLogger('aiohttp.internal')
server_logger = logging.getLogger('aiohttp.server')
web_logger = logging.getLogger('aiohttp.web')
ws_logger = logging.getLogger('aiohttp.websoc... | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/aiohttp/log.py | Python | apache-2.0 | 326 |
#!/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.
# This helps you preview the apps and extensions docs.
#
# ./preview.py --help
#
# There are two modes: server- and render- mode... | ds-hwang/chromium-crosswalk | chrome/common/extensions/docs/server2/preview.py | Python | bsd-3-clause | 4,795 |
# -*- coding: utf-8 -*-
import os
import httplib
import logging
import functools
from modularodm.exceptions import ValidationValueError
from framework.exceptions import HTTPError
from framework.analytics import update_counter
from website.addons.osfstorage import settings
logger = logging.getLogger(__name__)
LOCA... | ticklemepierce/osf.io | website/addons/osfstorage/utils.py | Python | apache-2.0 | 3,726 |
#!/usr/bin/python
# (c) 2017, NetApp, 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',
'status': ['preview'],
... | tsdmgz/ansible | lib/ansible/modules/storage/netapp/sf_account_manager.py | Python | gpl-3.0 | 8,755 |
#!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Woody Marvel <marvel@us.ibm.com>
# Li Ge <lge@us.ibm.com>
# Positive Test:
# Test Description:
# 1. Create a domain
# 2. Destroy the domain by id
import sys
import re
import time
from XmTestLib import *
# Create a domain (de... | flexiant/xen | tools/xm-test/tests/destroy/05_destroy_byid_pos.py | Python | gpl-2.0 | 735 |
import os
import re
import subprocess
import sys
import urlparse
from wptrunner.update.sync import LoadManifest
from wptrunner.update.tree import get_unique_name
from wptrunner.update.base import Step, StepRunner, exit_clean, exit_unclean
from .tree import Commit, GitTree, Patch
import github
from .github import GitH... | meh/servo | tests/wpt/update/upstream.py | Python | mpl-2.0 | 13,551 |
from __future__ import absolute_import, division
import time
import os
try:
unicode
except NameError:
unicode = str
from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked
class SQLiteLockFile(LockBase):
"Demonstrate SQL-based locking."
testdb = None
def __init__(self, path, t... | allieus/pylockfile | lockfile/sqlitelockfile.py | Python | mit | 5,541 |
from django.db import models, DEFAULT_DB_ALIAS, connection
from django.contrib.auth.models import User
from django.conf import settings
class Animal(models.Model):
name = models.CharField(max_length=150)
latin_name = models.CharField(max_length=150)
count = models.IntegerField()
weight = models.FloatF... | mzdaniel/oh-mainline | vendor/packages/Django/tests/regressiontests/fixtures_regress/models.py | Python | agpl-3.0 | 5,411 |
def func(a1):
"""
Parameters:
a1 (:class:`MyClass`): used to call :def:`my_function` and access :attr:`my_attr`
Raises:
:class:`MyException`: thrown in case of any error
""" | asedunov/intellij-community | python/testData/docstrings/typeReferences.py | Python | apache-2.0 | 206 |
"""Tests for parabolic cylinder functions.
"""
import numpy as np
from numpy.testing import assert_allclose, assert_equal
import scipy.special as sc
def test_pbwa_segfault():
# Regression test for https://github.com/scipy/scipy/issues/6208.
#
# Data generated by mpmath.
#
w = 1.022765672113168671... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/special/tests/test_pcf.py | Python | mit | 664 |
#!/usr/bin/env python
#
# Copyright 2008 Jose Fonseca
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This ... | dpimenov/tvdb_api | tests/gprof2dot.py | Python | unlicense | 53,218 |
# -*- test-case-name: twisted.test.test_twistd -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
The Twisted Daemon: platform-independent interface.
@author: Christopher Armstrong
"""
from twisted.application import app
from twisted.python.runtime import platformType
if platf... | sorenh/cc | vendor/Twisted-10.0.0/twisted/scripts/twistd.py | Python | apache-2.0 | 721 |
#! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... | cherrishes/weilai | xingxing/protobuf/python/lib/Python3.4/google/protobuf/pyext/descriptor_cpp2_test.py | Python | apache-2.0 | 2,506 |
# 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/contrib/distributions/python/kernel_tests/transformed_distribution_test.py | Python | apache-2.0 | 12,624 |
import decimal
try:
import thread
except ImportError:
import dummy_thread as thread
from threading import local
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import util
from django.db.transaction import TransactionManagementError
from django.utils import datet... | liqi328/rjrepaircompany | django/db/backends/__init__.py | Python | bsd-3-clause | 31,617 |
def foo():
pass \
\
\ | akosyakov/intellij-community | python/testData/formatter/trailingBlankLinesWithBackslashesAtFunctionEndNoNewLine.py | Python | apache-2.0 | 25 |
from django.conf import settings
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
def send_validation(strategy, backend, code):
url = '{0}?verification_code={1}'.format(
reverse('social:complete', args=(backend.name,)),
code.code
)
url = strategy.request.... | aneumeier/userprofile | userprofile/mail.py | Python | mit | 494 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | fharenheit/template-spark-app | src/main/python/mllib/hypothesis_testing_kolmogorov_smirnov_test_example.py | Python | apache-2.0 | 1,658 |
# coding: utf8
{
'!langcode!': 'fr',
'!langname!': 'Français',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résultats d\'un JOI... | pouyana/teireader | webui/applications/grid/languages/fr.py | Python | mit | 7,935 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.db import models
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
rank = models.IntegerField()
class Meta:
ordering = ('name',)
class Song(models.Model):
band = models.ForeignK... | oinopion/django | tests/admin_ordering/models.py | Python | bsd-3-clause | 899 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... | cortext/crawtextV2 | ~/venvs/crawler/lib/python2.7/site-packages/yaml/tokens.py | Python | mit | 2,573 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pyramid_sms documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
#... | websauna/pyramid_sms | docs/conf.py | Python | isc | 8,451 |
# coding=utf-8
from django.utils.functional import SimpleLazyObject
from mongo_auth import get_user as mongo_auth_get_user
def get_user(request):
if not hasattr(request, '_cached_user'):
request._cached_user = mongo_auth_get_user(request)
return request._cached_user
class AuthenticationMiddleware(ob... | sv1jsb/django-angular | mongo_auth/middleware.py | Python | isc | 1,264 |
# -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__release__ = '2.0rc4'
__version__ = '$Id: e26392a530582f286edf2d99e729218b2e93405e $'
import datetime
imp... | hperala/kontuwikibot | pywikibot/__init__.py | Python | mit | 26,829 |
# import libraries
import urllib.request
from feedgen.feed import FeedGenerator
from post_parser import post_title, post_author, post_time, post_files_num
from misc import is_number
# info
baseurl = 'http://phya.snu.ac.kr/xe/underbbs/'
url ='http://phya.snu.ac.kr/xe/index.php?mid=underbbs&category=372' # notices + gen... | seungwonpark/SNU_physics_board_rss | update_general.py | Python | mit | 1,781 |
#!/usr/bin/env python
__version__= "$Version: $"
__rcsid__="$Id: $"
import matplotlib
#matplotlib.use('WX')
from wx import MilliSleep
from wx import SplashScreen, SPLASH_CENTRE_ON_SCREEN, SPLASH_TIMEOUT
import os
import sys
import warnings
from . import zpickle
from .utils import *
from .dialogs.waxy import *
from ... | bblais/plasticity | plasticity/run.py | Python | mit | 17,982 |
import requests
import json
def test_api_endpoint_existence(todolist_app):
with todolist_app.test_client() as client:
resp = client.get('/tasks')
assert resp.status_code == 200
def test_task_creation(todolist_app):
with todolist_app.test_client() as client:
resp = client.jpost(
'/tasks', {
"title": "F... | inkmonk/flask-sqlalchemy-booster | tests/test_view_boosters/test_todo_list_api/test_api.py | Python | mit | 775 |
########################################
# Automatically generated, do not edit.
########################################
from pyvisdk.thirdparty import Enum
EventCategory = Enum(
'error',
'info',
'user',
'warning',
)
| xuru/pyvisdk | pyvisdk/enums/event_category.py | Python | mit | 239 |
import requests
import csv
from configparser import ConfigParser
config = ConfigParser()
config.read("config.cfg")
token = config.get("auth", "token")
domain = config.get("instance", "domain")
headers = {"Authorization" : "Bearer %s" % token}
source_course_id = 311693
csv_file = ""
payload = {'migration_type': 'course_... | tylerclair/canvas_admin_scripts | course_copy_csv.py | Python | mit | 684 |
import math
import re
from collections import defaultdict
def matches(t1, t2):
t1r = "".join([t[-1] for t in t1])
t2r = "".join([t[-1] for t in t2])
t1l = "".join([t[0] for t in t1])
t2l = "".join([t[0] for t in t2])
t1_edges = [t1[0], t1[-1], t1r, t1l]
t2_edges = [t2[0], t2[-1], t2[0][::-1],... | BrendanLeber/adventofcode | 2020/20-jurassic_jigsaw/code.py | Python | mit | 5,544 |
def is_isogram(s):
""" Determine if a word or phrase is an isogram.
An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
Examples of isograms:
- lumberjacks
- background
- downstream
"""
from collections import Counter
s = s.lower().strip(... | developerQuinnZ/this_will_work | student-work/hobson_lane/exercism/python/isogram/isogram.py | Python | mit | 428 |
import argparse
from PGEnv import PGEnvironment
from PGAgent import PGAgent
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--gym_environment', type=str, default='Pong-v0',
help='OpenAI Gym Environment to be used (default to Pong-v0)')
parser.add_... | YuMao1993/DRL | PG/main.py | Python | mit | 2,270 |
from feature import *
from pymongo import MongoClient
from bson.binary import Binary as BsonBinary
import pickle
import os
from operator import itemgetter
import time
import sys
imagelocation = "" #Input Image path
indir = "" #Directory Path
client = MongoClient('mongodb://localhost:27017')
db = client.coil #Inser... | devashishp/Content-Based-Image-Retrieval | optimized.py | Python | mit | 3,209 |
#PROJECT
from outcome import Outcome
from odds import Odds
class Bin:
def __init__(
self,
*outcomes
):
self.outcomes = set([outcome for outcome in outcomes])
def add_outcome(
self,
outcome
):
self.outcomes.add(outcome)
def __str__(self):
re... | ddenhartog/itmaybeahack-roulette | bin.py | Python | mit | 4,662 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""The Tornado web framework.
核心模块, 参考示例使用代码:
- 重要模块:
- tornado.web
- tornado.ioloop # 根据示例,可知入口在此.参看: ioloop.py
- tornado.httpserver
The Tornado web framework looks a bit like web.py (http://webpy.org/) or
Google's webapp (http://cod... | hhstore/tornado-annotated | src/tornado-1.0.0/tornado/web.py | Python | mit | 66,814 |
"""
This script exposes a class used to read the Shapefile Index format
used in conjunction with a shapefile. The Index file gives the record
number and content length for every record stored in the main shapefile.
This is useful if you need to extract specific features from a shapefile
without reading the entire file.... | taylorhutchison/ShapefileReaderPy | ShapefileIndexReader.py | Python | mit | 1,778 |
# coding: utf-8
from app.api_client.error import HTTPError
from app.helpers.login_helpers import generate_buyer_creation_token
from dmapiclient.audit import AuditTypes
from dmutils.email import generate_token, EmailError
from dmutils.forms import FakeCsrf
from ...helpers import BaseApplicationTest
from lxml import htm... | AusDTO/dto-digitalmarketplace-buyer-frontend | tests/app/views/test_login.py | Python | mit | 14,240 |
#! /usr/bin/env python3
import asyncio
import subprocess
import numpy as np
import time
comm = None
class Camera:
def __init__(self, notify):
self._process = None
self._now_pos = np.array([0., 0., 0.])
self._running = False
self._notify = notify
@asyncio.coroutine
def con... | AlphaLambdaMuPi/CamDrone | camera3.py | Python | mit | 937 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from django.core.files import File
from six import with_metaclass
from django.utils.module_loading import import_string
from rest_framework_tus import signals
from .settings import TUS_SAVE_HANDLER_CLASS
class ... | dirkmoors/drf-tus | rest_framework_tus/storage.py | Python | mit | 1,346 |