repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
tefino/blackadder-cinc | examples/swig-samples/python/streaming/sock_recv.py | #!/usr/bin/env python
#-
# Copyright (C) 2011 Oy L M Ericsson Ab, NomadicLab
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# Alternatively, this software may be distributed und... |
ubuntu-core/snapcraft | snapcraft/internal/sources/_tar.py | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... |
rplevka/robottelo | robottelo/cli/syncplan.py | """
Usage::
hammer sync-plan [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
create Create a sync plan
delete Destroy a sync plan
info ... |
mbkulik/ubuntu-make | umake/frameworks/dart.py | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distributed in the hope that ... |
josephmfaulkner/stoqs | stoqs/loaders/IOOS/__init__.py | #!/usr/bin/env python
__author__ = 'Mike McCann'
__copyright__ = '2011'
__license__ = 'GPL v3'
__contact__ = 'mccann at mbari.org'
__doc__ = '''
Contains class for common routines for loading all CANON data
Mike McCann
MBARI 22 April 2012
@undocumented: __doc__ parser
@status: production
@license: GPL
'''
... |
edx/edx-platform | openedx/core/djangoapps/theming/tests/test_storage.py | """
Tests for comprehensive theme static files storage classes.
"""
import re
from unittest.mock import patch
import ddt
from django.conf import settings
from django.test import TestCase, override_settings
from openedx.core.djangoapps.theming.helpers import Theme, get_theme_base_dir, get_theme_base_dirs
from opened... |
LLNL/spack | var/spack/repos/builtin/packages/r-isoband/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RIsoband(RPackage):
"""Generate Isolines and Isobands from Regularly Spaced Elevation Grid... |
EmreAtes/spack | var/spack/repos/builtin/packages/r-numderiv/package.py | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
apple/swift-lldb | packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py | """
Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class SyntheticCappingTestCas... |
floodlight/floodlight | example/mininet/dhcp_linear_npt.py | #!/usr/bin/python
import json
import httplib
import os
import subprocess
import time
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.topo import Topo
from mininet.util import irange
HOME_FOLDER = os.getenv('HO... |
airbnb/superset | superset/migrations/versions/43df8de3a5f4_dash_json.py | # 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 u... |
0x90sled/python-client | neovim/api/window.py | """API for working with Nvim windows."""
from .common import Remote, RemoteMap
__all__ = ('Window')
class Window(Remote):
"""A remote Nvim window."""
def __init__(self, session, code_data):
"""Initialize from session and code_data immutable object.
The `code_data` contains serialization i... |
srajag/nova | nova/tests/cells/test_cells_rpcapi.py | # Copyright (c) 2012 Rackspace Hosting
# 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 req... |
rtucker-mozilla/WhistlePig | vendor-local/lib/python/tastypie/models.py | import hmac
import time
from django.conf import settings
from django.db import models
from tastypie.utils import now
try:
from hashlib import sha1
except ImportError:
import sha
sha1 = sha.sha
class ApiAccess(models.Model):
"""A simple model for use with the ``CacheDBThrottle`` behaviors."""
iden... |
vlukes/sfepy | sfepy/homogenization/coefs_perfusion.py | from __future__ import absolute_import
import numpy as nm
from sfepy.base.base import assert_, get_default, Struct
from sfepy.homogenization.coefs_base import CorrMiniApp, CoefN
import six
from six.moves import range
class CorrRegion( CorrMiniApp ):
def __init__( self, name, problem, kwargs ):
CorrMiniAp... |
GafferHQ/gaffer | python/GafferTest/BoxTest.py | ##########################################################################
#
# Copyright (c) 2013-2015, 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:
#
# * Redi... |
uranusjr/django | tests/test_client/tests.py | """
Testing using the Test Client
The test client is a class that can act like a simple
browser for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
of the contexts and temp... |
hujiajie/pa-chromium | native_client_sdk/src/build_tools/tests/verify_filelist_test.py | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_TOOLS_DIR = os.path.dirname(SCR... |
huhongbo/dd-agent | checks.d/consul.py | # stdlib
from collections import defaultdict
from datetime import datetime, timedelta
from itertools import islice
from urlparse import urljoin
# project
from checks import AgentCheck
# 3p
import requests
class ConsulCheck(AgentCheck):
CONSUL_CHECK = 'consul.up'
HEALTH_CHECK = 'consul.check'
CONSUL_CAT... |
theo-l/django | django/db/models/functions/text.py | from django.db import NotSupportedError
from django.db.models.expressions import Func, Value
from django.db.models.fields import IntegerField
from django.db.models.functions import Coalesce
from django.db.models.lookups import Transform
class BytesToCharFieldConversionMixin:
"""
Convert CharField results from... |
mollstam/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/idlelib/configDialog.py | """IDLE Configuration Dialog: support user customization of IDLE by GUI
Customize font faces, sizes, and colorization attributes. Set indentation
defaults. Customize keybindings. Colorization and keybindings can be
saved as user defined sets. Select startup options including shell/editor
and default window size. ... |
pvrgoku/Plugin.Video.Goku | tools/updater.py | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# PalcoTV Updater v0.2 (21.10.2014)
# Version 0.3.0 (18.10.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plugintools de Jesús (www... |
benneely/duke-data-service-dredd | dredd/dredd_scripts/15_provenance_activities.py | import dredd_hooks as hooks
import imp
import os
import json
import uuid
import pprint
#if you want to import another module for use in this workflow
utils = imp.load_source("utils",os.path.join(os.getcwd(),'utils.py'))
###############################################################################
###################... |
swdunlop/AndBug | lib/andbug/cmd/exit.py | ## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
## published by the Free Software Foundation.
##
## AndBug is distributed in the hope that it will be useful, but W... |
blueburningcoder/nupic | tests/swarming/nupic/swarming/experiments/field_threshold_temporal/description.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
Fat-Zer/FreeCAD_sf_master | src/Mod/Fem/femexamples/examplesgui.py | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * *
# * Th... |
rbruyere/appengine-mapreduce | python/test/mapreduce gcs/pipeline/models.py | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
paxapy/zulip | zerver/management/commands/email_mirror.py | #!/usr/bin/env python
"""
Forward messages sent to the configured email gateway to Zulip.
For zulip.com, messages to that address go to the Inbox of emailgateway@zulip.com.
Zulip voyager configurations will differ.
Messages meant for Zulip have a special recipient form of
<stream name>+<regenerable stream token... |
Eyepea/aiohttp | examples/fake_server.py | import asyncio
import pathlib
import socket
import ssl
import aiohttp
from aiohttp import web
from aiohttp.resolver import DefaultResolver
from aiohttp.test_utils import unused_port
def http_method(method, path):
def wrapper(func):
func.__method__ = method
func.__path__ = path
return func... |
goldmedal/spark | python/pyspark/sql/udf.py | #
# 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... |
cryptickp/heat | heat/tests/neutron/test_neutron_network_gateway.py | #
# Copyright 2013 NTT Corp.
# 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 ap... |
zarnold/transitfeed | tests/transitfeed/testutil.py | #!/usr/bin/python2.5
# Copyright (C) 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
tensorflow/tensorflow | tensorflow/python/data/kernel_tests/tf_record_dataset_test.py | # 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... |
vortex-ape/scikit-learn | sklearn/ensemble/weight_boosting.py | """Weight Boosting
This module contains weight boosting estimators for both classification and
regression.
The module structure is the following:
- The ``BaseWeightBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regression and classification
only differ from each ot... |
allmende/synnefo | snf-cyclades-app/synnefo/db/tests.py | # 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... |
hogarthj/ansible | lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# 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': ['previe... |
pwnieexpress/raspberry_pwn | src/pentest/sqlmap/waf/bigip.py | #!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.enums import HTTP_HEADER
from lib.core.settings import WAF_ATTACK_VECTORS
__product__ = "BIG-IP Application Security Manager (F5 Networks)"
def dete... |
jawilson/home-assistant | homeassistant/components/hlk_sw16/__init__.py | """Support for HLK-SW16 relay switches."""
import logging
from hlk_sw16 import create_hlk_sw16_connection
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, CONF_SWITCHES
from homeassistant.core import callback
import homeas... |
nihilus/flare-ida | python/flare/IDB_MSDN_Annotator/__init__.py | """
IDAPython script to annotate IDB files with information extracted from the
MSDN documentation including functions, arguments and constants.
Authors: Moritz Raabe, William Ballenthin
Copyright 2014 Mandiant, A FireEye Company
Mandiant licenses this file to you under the Apache License, Version
2.0 (the "License");... |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/tests/plotting/test_boxplot_method.py | #!/usr/bin/env python
# coding: utf-8
import nose
import itertools
import string
from distutils.version import LooseVersion
from pandas import Series, DataFrame, MultiIndex
from pandas.compat import range, lzip
import pandas.util.testing as tm
from pandas.util.testing import slow
import numpy as np
from numpy import... |
cpcloud/numba | numba/cuda/cudadrv/runtime.py | """
CUDA Runtime wrapper.
This provides a very minimal set of bindings, since the Runtime API is not
really used in Numba except for querying the Runtime version.
"""
import ctypes
import functools
import sys
from numba.core import config
from numba.cuda.cudadrv.driver import ERROR_MAP, make_logger
from numba.cuda.c... |
lucienfostier/gaffer | python/GafferUI/ViewUI.py | ##########################################################################
#
# Copyright (c) 2015, 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... |
mit-crpg/openmc | examples/parameterized_custom_source/build_xml.py | import openmc
# Create a single material
iron = openmc.Material()
iron.set_density('g/cm3', 5.0)
iron.add_element('Fe', 1.0)
mats = openmc.Materials([iron])
mats.export_to_xml()
# Create a 5 cm x 5 cm box filled with iron
box = openmc.model.rectangular_prism(10.0, 10.0, boundary_type='vacuum')
cell = openmc.Cell(fill... |
shabab12/edx-platform | common/djangoapps/contentserver/test/test_contentserver.py | """
Tests for StaticContentServer
"""
import copy
import datetime
import ddt
import logging
import unittest
from uuid import uuid4
from django.conf import settings
from django.test import RequestFactory
from django.test.client import Client
from django.test.utils import override_settings
from mock import patch
from ... |
nanditav/15712-TensorFlow | tensorflow/python/summary/writer/writer_cache.py | # 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... |
Karm/qpid-proton | examples/python/reactor/reactor-logger.py | #!/usr/bin/python
#
# 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
# "Lice... |
mammique/django | tests/regressiontests/pagination/tests.py | from __future__ import absolute_import, unicode_literals
from datetime import datetime
from django.core.paginator import (Paginator, EmptyPage, InvalidPage,
PageNotAnInteger)
from django.test import TestCase
from django.utils import six
from django.utils import unittest
from .models import Article
from .custom i... |
ProfessionalIT/maxigenios-website | sdk/google_appengine/google/appengine/api/capabilities/__init__.py | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
wrouesnel/ansible | lib/ansible/vars/manager.py | # (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... |
goofwear/raspberry_pwn | src/pentest/metagoofil/hachoir_core/log.py | import os, sys, time
import hachoir_core.config as config
from hachoir_core.i18n import _
class Log:
LOG_INFO = 0
LOG_WARN = 1
LOG_ERROR = 2
level_name = {
LOG_WARN: "[warn]",
LOG_ERROR: "[err!]",
LOG_INFO: "[info]"
}
def __init__(self):
self.__buffer = {}... |
cliqz/socorro | socorro/unittest/external/postgresql/test_server_status.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import os
import socorro
from nose.plugins.attrib import attr
from nose.tools import eq_
from socorro.e... |
crmccreary/openerp_server | openerp/addons/project_retro_planning/project_retro_planning.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
xiandiancloud/edxplaltfom-xusong | common/test/acceptance/tests/helpers.py | """
Test helper functions and base classes.
"""
import json
import unittest
import functools
import requests
from path import path
from bok_choy.web_app_test import WebAppTest
def skip_if_browser(browser):
"""
Method decorator that skips a test if browser is `browser`
Args:
browser (str): name of... |
sonali0901/zulip | analytics/tests/test_views.py | from __future__ import absolute_import
from django.utils.timezone import get_fixed_timezone, utc
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.timestamp import ceiling_to_hour, ceiling_to_day, \
datetime_to_timestamp
from zerver.models import Realm, UserProfile, Client, get_realm, \
get_use... |
gkotton/vmware-nsx | vmware-nsx/neutron/tests/unit/vmware/nsxlib/test_lsn.py | # Copyright 2013 VMware, 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 writing, ... |
hujiajie/chromium-crosswalk | tools/telemetry/third_party/webpagereplay/replay.py | #!/usr/bin/env python
# Copyright 2010 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... |
davidam/python-examples | scikit/plot_precision_recall.py | """
================
Precision-Recall
================
Example of Precision-Recall metric to evaluate classifier output quality.
Precision-Recall is a useful measure of success of prediction when the
classes are very imbalanced. In information retrieval, precision is a
measure of result relevancy, while recall is a m... |
pyfisch/servo | tests/wpt/web-platform-tests/tools/ci/taskcluster-run.py | #!/usr/bin/env python
import argparse
import gzip
import logging
import os
import shutil
import subprocess
import sys
browser_specific_args = {
"firefox": ["--install-browser"]
}
def find_wptreport(args):
parser = argparse.ArgumentParser()
parser.add_argument('--log-wptreport', action='store')
retur... |
lewiskan/heron | heron/tools/explorer/src/python/help.py | # Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
rjmi004/phpsh | src/tests.py | import unittest
from phpsh import PhpshState, line_encode, do_sugar
class TestPhpsh(unittest.TestCase):
def setUp(self):
self.ps = PhpshState(
cmd_incs=set(),
do_color=False,
do_echo=False,
codebase_mode='none',
do_autocomplete=False,
... |
nbei/CLRS | C09-Medians-and-Order-Statistics/problems/weighted_median.py | #!/usr/bin/env python
# coding=utf-8
import math
def select(items, n):
med = median(items)
smaller = [item for item in items if item < med]
larger = [item for item in items if item > med]
if len(smaller) == n:
return med
elif len(smaller) > n:
return select(smaller, n)
... |
dbbhattacharya/kitsune | vendor/packages/pylint/test/regrtest_data/precedence_test.py | """
# package/__init__.py
class AudioTime(object):
DECIMAL = 3
# package/AudioTime.py
class AudioTime(object):
pass
# test.py
from package import AudioTime
# E0611 - No name 'DECIMAL' in module 'AudioTime.AudioTime'
print AudioTime.DECIMAL
"""
__revision__ = 0
from package import AudioTime
... |
hunch/hunch-gift-app | django/db/backends/mysql/introspection.py | from django.db.backends import BaseDatabaseIntrospection
from MySQLdb import ProgrammingError, OperationalError
from MySQLdb.constants import FIELD_TYPE
import re
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDa... |
rrooij/youtube-dl | youtube_dl/extractor/aol.py | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
url_or_none,
)
class AolIE(InfoExtractor):
IE_NAME = 'aol.com'
_V... |
sjperkins/tensorflow | tensorflow/compiler/tests/variable_ops_test.py | # 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... |
minorua/QGIS | python/plugins/db_manager/db_plugins/postgis/sql_dictionary.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
sql_dictionary.py
---------------------
Date : April 2012
Copyright : (C) 2012 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
************... |
treefrogframework/FrameworkBenchmarks | frameworks/Python/starlette/app.py | import asyncio
import asyncpg
import os
import jinja2
from starlette.applications import Starlette
from starlette.responses import HTMLResponse, UJSONResponse, PlainTextResponse
from starlette.routing import Route
from random import randint
from operator import itemgetter
from urllib.parse import parse_qs
READ_ROW_SQ... |
Chilledheart/chromium | tools/telemetry/telemetry/value/trace_unittest.py | # 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 shutil
import tempfile
import unittest
from telemetry import story
from telemetry import page as page_module
from telemetry.testing import ... |
theo-l/django | tests/postgres_tests/test_array.py | import decimal
import enum
import json
import unittest
import uuid
from django import forms
from django.core import checks, exceptions, serializers, validators
from django.core.exceptions import FieldError
from django.core.management import call_command
from django.db import IntegrityError, connection, models
from dja... |
JacobJacob/pyew | gcluster.py | #!/usr/bin/env python
"""
A program's clusterization tool based on Pyew
Copyright (C) 2010, Joxean Koret
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your... |
rafaelsilvag/SDNRouter | test/syslog-1.py | #!/usr/bin/env python
import os
import sys
import time
import syslog
def _prefixed (level,message):
now = time.strftime('%a, %d %b %Y %H:%M:%S',time.localtime())
return "%s %-8s %-6d %s" % (now,level,os.getpid(),message)
syslog.openlog("ExaBGP")
# When the parent dies we are seeing continual newlines, so we only ... |
zenodo/invenio | invenio/modules/dashboard/settings.py | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 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... |
ddico/odoo | addons/sale/controllers/onboarding.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http
from odoo.http import request
class OnboardingController(http.Controller):
@http.route('/sales/sale_quotation_onboarding_panel', auth='user', type='json')
def sale_quotation_onboarding(se... |
me-no-dev/Arduino | tools/build.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# build.py — build a sketch using arduino-builder
#
# Wrapper script around arduino-builder which accepts some ESP8266-specific
# options and translates them into FQBN
#
# Copyright © 2016 Ivan Grokhotkov
#
# Permission is hereby granted, free of charge, to any person obt... |
adviti/melange | thirdparty/google_appengine/tools/bulkload_client.py | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
Jgarcia-IAS/SAT | openerp/addons/mail/mail_followers.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
vasyvas/deepdive | examples/spouse_example/postgres/json_extractor/udf/ext_has_spouse.py | #! /usr/bin/env python
# File: udf/ext_has_spouse.py
# Sample input data (piped into STDIN):
'''
{"p1_text":"Michelle Obama","p1_mention_id":"118238@10_7","p2_text":"Barack Obama","p2_mention_id":"118238@10_1","sentence_id":"118238@10"}
{"p1_text":"Barack Obama","p1_mention_id":"118238@10_1","p2_text":"Michelle Obama"... |
Weil0ng/gem5 | src/cpu/o3/FuncUnitConfig.py | # Copyright (c) 2010 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
DenL/pogom-webhook | pogom/pgoapi/protos/POGOProtos/Settings/Master/PokemonUpgradeSettings_pb2.py | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Settings/Master/PokemonUpgradeSettings.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 g... |
shenhequnying/ceph-deploy | ceph_deploy/tests/test_remotes.py | from mock import patch
from ceph_deploy.hosts import remotes
from ceph_deploy.hosts.remotes import platform_information
class FakeExists(object):
def __init__(self, existing_paths):
self.existing_paths = existing_paths
def __call__(self, path):
for existing_path in self.existing_paths:
... |
jmcorgan/gnuradio | gr-digital/examples/ofdm/uhd_interface.py | #!/usr/bin/env python
#
# Copyright 2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... |
marratj/ansible | test/units/modules/network/nxos/test_nxos_pim_interface.py | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
drpngx/tensorflow | tensorflow/contrib/estimator/python/estimator/dnn_test.py | # 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... |
a-doumoulakis/tensorflow | tensorflow/python/util/nest_test.py | # 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... |
tomchristie/django | tests/backends/mysql/tests.py | import unittest
from contextlib import contextmanager
from django.core.exceptions import ImproperlyConfigured
from django.db import connection
from django.test import TestCase, override_settings
@contextmanager
def get_connection():
new_connection = connection.copy()
yield new_connection
new_connection.c... |
lucidbard/NewsBlur | apps/rss_feeds/migrations/0006_feed_fetch_history.py | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'FeedFetchHistory'
db.create_table('rss_feeds_feedfetchhistory', (
('id', self.... |
wh1100717/AutobahnPython | examples/twisted/websocket/echo/client.py | ###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
#... |
Drvanon/Game | venv/lib/python3.3/site-packages/sqlalchemy/dialects/mysql/__init__.py | # mysql/__init__.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
from . import base, mysqldb, oursql, \
pyodbc, zxjdb... |
jokey2k/sentry | tests/sentry/web/frontend/test_remove_project.py | from __future__ import absolute_import
import mock
from django.core.urlresolvers import reverse
from sentry.models import Project, ProjectStatus
from sentry.testutils import TestCase, PermissionTestCase
class RemoveProjectPermissionTest(PermissionTestCase):
def setUp(self):
super(RemoveProjectPermissio... |
dslutz/qemu | tests/acceptance/machine_arm_n8x0.py | # Functional test that boots a Linux kernel and checks the console
#
# Copyright (c) 2020 Red Hat, Inc.
#
# Author:
# Thomas Huth <thuth@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
import os
from avocado import skipUnle... |
sonaht/ansible | test/units/parsing/yaml/test_loader.py | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o... |
Micronaet/micronaet-mx | stock/wizard/stock_return_picking.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
mdhaber/scipy | scipy/ndimage/setup.py | import os
from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration
from numpy import get_include
from scipy._build_utils import numpy_nodepr_api
def configuration(parent_package='', top_path=None):
config = Configuration('ndimage', parent_package, top_path)
include_dirs = ... |
rjshade/grpc | src/python/grpcio_tests/tests/unit/beta/_face_interface_test.py | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
t3dev/odoo | addons/partner_autocomplete/models/res_partner_autocomplete_sync.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class ResPartnerAutocompleteSync(models.Model):
_name = 'res.partner.autocomplete.sync'
_description = 'Partner Autocomp... |
synmnstr/flexx | flexx/webruntime/mshtml.py | """ Web runtime based on MSHTML, i.e. Microsofts Trident engine.
"""
import os
import sys
def get_ie_exe():
""" Get the path of the Internet Explorer executable
If the path could not be found, returns None. You may still be able
to launch using "iexplore" though.
"""
paths = []
# Co... |
alawnchen/django-registration | registration/__init__.py | VERSION = (1, 3, 0, 'alpha', 0)
def get_version():
"Returns a PEP 386-compliant version number from VERSION."
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha releases... |
Maximilian-Reuter/SickRage-1 | tests/sickrage_tests/providers/__init__.py | # coding=utf-8
"""
Tests for SickRage providers
"""
import unittest
from generic_provider_tests import GenericProviderTests
from nzb_provider_tests import NZBProviderTests
from torrent_provider_tests import TorrentProviderTests
if __name__ == '__main__':
print('=====> Running all test in "sickrage_tests.provider... |
sahildua2305/eden | modules/tests/staff/create_staff_certificate.py | """ Sahana Eden Automated Test - HRM001 Create Volunteer Certificate
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the ... |
ScottBuchanan/eden | modules/tests/staff/add_staff_participants.py | """ Sahana Eden Module Automated Tests - HRM007 Add Staff Participants
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.