repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
mancoast/CPythonPyc_test | fail/314_test_int.py | import sys
import unittest
from test.support import run_unittest
L = [
('0', 0),
('1', 1),
('9', 9),
('10', 10),
('99', 99),
('100', 100),
('314', 314),
(' 314', 314),
('314 ', 314),
(' \t\t 314 \t\t ', 314),
(repr(sys.maxsize... |
Czocher/zebra-supervisor | judge/forms.py | # -*- coding: utf-8 -*-
"""This module contains forms used in the judge app."""
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Submission, PrintRequest
class SubmissionForm(forms.ModelForm):
"""Submission creation form class."""
source = forms.CharFiel... |
eerorika/ansible | contrib/inventory/nsot.py | #!/bin/env python
'''
nsot
====
Ansible Dynamic Inventory to pull hosts from NSoT, a flexible CMDB by Dropbox
Features
--------
* Define host groups in form of NSoT device attribute criteria
* All parameters defined by the spec as of 2015-09-05 are supported.
+ ``--list``: Returns JSON hash of host groups -> ho... |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/site-packages/idlexlib/idlefork/idlelib/PyShell.py | #! /usr/bin/env python3
import getopt
import os
import os.path
import re
import socket
import subprocess
import sys
import threading
import time
import tokenize
import io
import linecache
from code import InteractiveInterpreter
from platform import python_version, system
try:
from tkinter import *
except ImportE... |
detrout/telepathy-mixer | mixer/channel/contact_list.py | # telepathy-mixer - a MXit connection manager for Telepathy
#
# Copyright (C) 2008 Ralf Kistner <ralf.kistner@gmail.com>
#
# Adapted from telepathy-butterfly,
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... |
xujun10110/NoSQLMap | nsmmongo.py | #!/usr/bin/python
#NoSQLMap Copyright 2014 Russell Butturini
#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... |
kennethlyn/elbe | elbepack/dbaction.py | #!/usr/bin/env python
#
# ELBE - Debian Based Embedded Rootfilesystem Builder
# Copyright (C) 2013 Linutronix GmbH
#
# This file is part of ELBE.
#
# ELBE 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, eithe... |
akhmadMizkat/odoo | addons/payment_buckaroo/tests/test_buckaroo.py | # -*- coding: utf-8 -*-
from lxml import objectify
import urlparse
import openerp
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_buckaroo.controllers.main import BuckarooController
from opener... |
kynikos/wiki-scripts | tests/with_api/test_site.py | #! /usr/bin/env python3
import pytest
from ws.client.api import LoginFailed
# TODO: pytest attribute
#@attr(speed="slow")
@pytest.mark.skip(reason="The api fixture was removed.")
class test_site:
"""
Tests intended mostly for detecting changes in the ArchWiki configuration.
"""
props_data = {
"gene... |
KaiRo-at/socorro | socorro/external/fs/fs_new_crash_source.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/.
from configman import Namespace, RequiredConfig
from configman.converters import class_converter
from functools import ... |
keitaroinc/ckanext-datarequests | ckanext/datarequests/auth.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of CKAN Data Requests Extension.
# CKAN Data Requests Extension is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as published by
# the F... |
lino-framework/welfare | lino_welfare/projects/gerd/tests/dumps/18.8.0/vatless_accountinvoice.py | # -*- coding: UTF-8 -*-
logger.info("Loading 30 objects to table vatless_accountinvoice...")
# fields: voucher_ptr, project, partner, payment_term, match, bank_account, your_ref, due_date, amount
loader.save(create_vatless_accountinvoice(1,116,220,None,u'',1,u'',date(2014,6,21),'10.00'))
loader.save(create_vatless_acco... |
openstax/openstax-cms | news/migrations/0030_auto_20180521_1137.py | # Generated by Django 2.0.2 on 2018-05-21 16:37
from django.db import migrations
import news.models
import snippets.models
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('news', '0029_pressindex_mentions'),
]
operations = [
... |
sameetb-cuelogic/edx-platform-test | pavelib/tests.py | """
Unit test tasks
"""
import os
import sys
from paver.easy import sh, task, cmdopts, needs, call_task
from pavelib.utils.test import suites
from pavelib.utils.envs import Env
from optparse import make_option
try:
from pygments.console import colorize
except ImportError:
colorize = lambda color, text: text #... |
scraperwiki/databaker | databaker/jupybakecsv.py | # encoding: utf-8
# HTML preview of the dimensions and table (will be moved to a function in databakersolo)
import io, os, collections, re, warnings, csv, datetime
import databaker.constants
from databaker.jupybakeutils import ConversionSegment
template = databaker.constants.template
try: import pandas
except Impor... |
eduNEXT/edunext-platform | openedx/features/course_experience/waffle.py | """
Miscellaneous waffle switches that both LMS and Studio need to access
"""
from edx_toggles.toggles import LegacyWaffleSwitchNamespace
# Namespace
WAFFLE_NAMESPACE = u'course_experience'
# Switches
# .. toggle_name: course_experience.enable_about_sidebar_html
# .. toggle_implementation: WaffleSwitch
# .. toggle_... |
gaubert/gmvault | src/sandbox/gmvault_multiprocess.py | '''
Gmvault: a tool to backup and restore your gmail account.
Copyright (C) <since 2011> <guillaume Aubert (guillaume dot aubert at gmail do com)>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Fr... |
mzdaniel/oh-mainline | vendor/packages/django-model-utils/model_utils/fields.py | from datetime import datetime
from django.db import models
from django.conf import settings
from model_utils import Choices
class AutoCreatedField(models.DateTimeField):
"""
A DateTimeField that automatically populates itself at
object creation.
By default, sets editable=False, default=datetime.now.... |
shoopio/shoop | shuup/simple_cms/admin_module/form_parts.py | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import s... |
proge/openerp-pt_br | l10n_br_sale/sale.py | # -*- encoding: utf-8 -*-
import decimal_precision as dp
from osv import fields, osv
from tools.translate import _
class sale_order(osv.osv):
_inherit = 'sale.order'
def onchange_partner_id(self, cr, uid, ids, part, shop_id=False, fiscal_operation_category_id=False):
result = super(sale_order, self)... |
enjaz/enjaz | core/migrations/0017_add_2019_2020_years.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from datetime import datetime
start_2019_2020 = datetime(2019, 6, 2)
end_2019_2020 = datetime(2020, 6, 1)
def add_year(apps, schema_editor):
StudentClubYear = apps.get_model('core', 'StudentClubYear')
St... |
clalancette/oz | tests/ozutil/test_ozutil.py | #!/usr/bin/python
import sys
import os
try:
import py.test
except ImportError:
print('Unable to import py.test. Is py.test installed?')
sys.exit(1)
# Find oz
prefix = '.'
for i in range(0,3):
if os.path.isdir(os.path.join(prefix, 'oz')):
sys.path.insert(0, prefix)
break
else:
... |
bmwiedemann/linuxcnc-mirror | src/hal/user_comps/vismach/max5gui.py | #!/usr/bin/python
#
# Visulization model of Chris's MAX-NC mill, as modified to 5-axis
#
# Copyright 2007 John Kasunich
# Derived from a work by John Kasunich, Jeff Epler, and Chris Radek
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... |
sbinet/cxx-root | bindings/pyroot/ROOTaaS/iPyROOT/__init__.py | from IPython import display
from IPython import get_ipython
from IPython.core.extensions import ExtensionManager
import ROOT
import utils
def iPythonize():
utils.setStyle()
for capture in utils.captures: capture.register()
ExtensionManager(get_ipython()).load_extension("ROOTaaS.iPyROOT.cppmagic")
Exten... |
igemsoftware/SYSU-Software-2015 | docs/conf.py | # -*- coding: utf-8 -*-
#
# CORE documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 17 18:19:40 2015.
#
# 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
# autogenerated file.
#
# All ... |
clearcare/servant | setup.py | from setuptools import setup, find_packages
setup(
name='servant',
packages=find_packages(exclude=['test', 'examples', 'examples.*']),
version = '0.1.4',
description = 'A library for building services',
author='Brian Zambrano',
author_email='brianz@clearcareonline.com',
url='https://github.... |
smmosquera/serge | test/testactor.py | """Tests for Actors"""
import unittest
import os
import pymunk
from helper import *
import serge.actor
import serge.visual
import serge.world
import serge.zone
class TestActor(unittest.TestCase):
"""Tests for the Actor"""
def setUp(self):
"""Set up the tests"""
serge.visual.Register.clearIt... |
teamCarel/EyeTracker | src/shared_modules/plugin.py | '''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2017 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
-----------------------------------... |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/npu/test_collective_base_npu.py | # Copyright (c) 2019 PaddlePaddle 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 appli... |
tcpcloud/contrail-controller | src/config/svc-monitor/svc_monitor/services/loadbalancer/drivers/ha_proxy/driver.py | #
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
import uuid
import svc_monitor.services.loadbalancer.drivers.abstract_driver as abstract_driver
from vnc_api.vnc_api import ServiceTemplate, ServiceInstance, ServiceInstanceType
from vnc_api.vnc_api import ServiceScaleOutType, ServiceInstanceInterf... |
alexwoolford/backtesting_the_dow | prototype/run_scenarios_using_api.py | #!/usr/bin/env python
import itertools
import urllib
import requests
import datetime as datetime
import logging
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
def get_scenarios():
"""
Creates a list of all the combinations of transaction_costs, transaction_sizes, fal... |
jsirois/pants | src/python/pants/backend/python/goals/coverage_py_integration_test.py | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import sqlite3
from pathlib import Path
from textwrap import dedent
from pants.base.build_environment import get_buildroot
from pants.testutil.pants_integration_test import PantsResult, r... |
elastic/examples | Machine Learning/Query Optimization/qopt/util.py | """General utilities."""
import csv
import datetime
import json
import sys
from timeit import default_timer
class Timer:
"""A context manager that times execution."""
def __enter__(self):
self.start = default_timer()
return self
def __exit__(self, *args):
self.end = default_tim... |
dhermes/gcloud-python | datastore/google/cloud/datastore/_gapic.py | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
nkgilley/home-assistant | tests/components/songpal/test_media_player.py | """Test songpal media_player."""
from datetime import timedelta
import logging
from songpal import (
ConnectChange,
ContentChange,
PowerChange,
SongpalException,
VolumeChange,
)
from homeassistant.components import media_player, songpal
from homeassistant.components.songpal.const import SET_SOUND_... |
AfricasTalkingLtd/Outreach | content/tutorials/python/intermediate/octopus/app/api/voice.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from app import (app, logging)
from flask import (make_response, request)
# globals
from app import settings
from app import AfricasTalkingGateway, AfricasTalkingGatewayException
username = "IanJuma"
apikey = "19d19757b8fa132c676109af3f79c246bffcb0835098d3eef5ce42dd84e... |
apporc/nova | nova/tests/unit/api/ec2/test_apirequest.py | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Unl... |
cloudera/hue | apps/hbase/src/hbase/views.py | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
kumina/django-powerdns-manager | docs/conf.py | # -*- coding: utf-8 -*-
#
# django-powerdns-manager documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 14 09:50:21 2010.
#
# 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
# autogenerat... |
USGSDenverPychron/pychron | pychron/database/orms/isotope/spec.py | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... |
Sutto/cloud-custodian | tests/test_sqs.py | # Copyright 2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
rememerme/marketplace-api | rememerme/marketplace/rest/phrase_decks/forms.py | '''
This file holds all of the forms for the cleaning and validation of
the parameters being used for friend requests.
Created on Dec 20, 2013
@author: Andrew Oberlin, Jake Gregg
'''
from django import forms
from rememerme.games.models import GameMember
from rememerme.games.rest.exceptions import ... |
dunkhong/grr | grr/server/grr_response_server/databases/mem_foreman_rules_test.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from absl.testing import absltest
from grr_response_server.databases import db_foreman_rules_test
from grr_response_server.databases import mem_test_base
from grr.t... |
isandlaTech/cohorte-devtools | qualifier/deploy/cohorte-home/repo/pelix/ipopo/core.py | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Core iPOPO implementation
:author: Thomas Calmant
:copyright: Copyright 2016, Thomas Calmant
:license: Apache License 2.0
:version: 0.6.4
..
Copyright 2016 Thomas Calmant
Licensed under the Apache License, Version 2.0 (the "License");
you may not... |
amwelch/a10sdk-python | a10sdk/core/interface/interface_trunk_ip_ospf_ospf_global.py | from a10sdk.common.A10BaseClass import A10BaseClass
class Network(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param broadcast: {"default": 0, "not-list": ["non-broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF broad... |
pidydx/grr | grr/endtoend_tests/memory.py | #!/usr/bin/env python
"""End to end tests for lib.flows.general.memory."""
import os
from grr.client.components.rekall_support import rekall_types as rdf_rekall_types
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import flow_runner
class AbstractTestAnalyze... |
apache/libcloud | libcloud/test/compute/test_gogrid.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 use ... |
eadgarchen/tensorflow | tensorflow/python/data/ops/dataset_ops.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... |
GandaG/fomod-editor | docs/source/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# FOMOD Designer documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 9 19:41:15 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... |
pkilambi/ceilometer | ceilometer/dispatcher/__init__.py | #
# Copyright 2013 IBM
#
# 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, softw... |
h2oai/h2o-3 | h2o-bindings/bin/custom/python/gen_gam.py | options = dict(
model_extensions=[
'h2o.model.extensions.ScoringHistoryGLM',
],
)
deprecated_params = dict(Lambda='lambda_')
def update_param(name, param):
if name == 'distribution':
param['values'].remove('custom')
return param
return None # param untouched
def class_extens... |
wallnerryan/quantum_migrate | quantum/db/migration/alembic_migrations/versions/38335592a0dc_nvp_portmap.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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... |
zero-os/0-orchestrator | pyclient/zeroos/orchestrator/client/VMDiskInfo.py | """
Auto-generated class for VMDiskInfo
"""
from . import client_support
class VMDiskInfo(object):
"""
auto-generated. don't touch.
"""
@staticmethod
def create(readIops, readThroughput, writeIops, writeThroughput):
"""
:type readIops: int
:type readThroughput: int
... |
HybridF5/tempest_debug | tempest/api/hybrid_cloud/compute/limits/test_limits_operations.py | import testtools
from oslo_log import log
from tempest.api.compute import base
import tempest.api.compute.limits.test_absolute_limits as AbsoluteLimitsTest
import tempest.api.compute.limits.test_absolute_limits_negative as AbsoluteLimitsNegativeTest
from tempest.common.utils import data_utils
from tempest.common impor... |
USGSDenverPychron/pychron | pychron/data_mapper/sources/usgs_vsc_source.py | # ===============================================================================
# Copyright 2016 ross
#
# 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/LICE... |
petrutlucian94/nova_dev | nova/network/floating_ips.py | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... |
rdo-infra/ci-config | ci-scripts/infra-setup/roles/rrcockpit/files/compare_rpms/forms.py | from flask_wtf import FlaskForm
from wtforms import BooleanField, SelectField, StringField, SubmitField
from wtforms.validators import URL, DataRequired
class WebDiffBuilds(FlaskForm):
control_baseurl = StringField('Control_BaseURL',
validators=[DataRequired(), URL()])
test_b... |
Cinntax/home-assistant | tests/components/camera/test_init.py | """The tests for the camera component."""
import asyncio
import base64
import io
from unittest.mock import patch, mock_open, PropertyMock
import pytest
from homeassistant.setup import setup_component, async_setup_component
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_ENTITY_PICTURE,
EVENT_HOMEAS... |
serendipiddy/Network-Visualization-and-Performance-Prediction | simple_switch_13_lldp.py | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... |
wikimedia/operations-debs-python-pykafka | pykafka/connection.py | from __future__ import division
"""
Author: Keith Bourgoin, Emmett Butler
"""
__license__ = """
Copyright 2015 Parse.ly, 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.o... |
scotwk/cloud-custodian | tests/test_cli.py | # Copyright 2016-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
FlyLu/rt-thread | tools/eclipse.py | #
# Copyright (c) 2006-2019, RT-Thread Development Team
#
# SPDX-License-Identifier: Apache-2.0
#
# Change Logs:
# Date Author Notes
# 2019-03-21 Bernard the first version
# 2019-04-15 armink fix project update error
#
import os
import sys
import glob
from utils import *
from utils ... |
queria/my-tempest | tempest/api/compute/servers/test_list_servers_negative.py | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
djkonro/client-python | kubernetes/client/models/v1_subject_access_review_status.py | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
Juniper/nova | nova/tests/unit/virt/libvirt/fake_libvirt_utils.py | # Copyright (c) 2011 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 applicab... |
OpenEdgeComputing/elijah-openstack | cloudlet-gateway/caas/extensions.py | # -*- coding: utf-8 -*-
"""Extensions module. Each extension is initialized in the app factory located in app.py."""
from flask_bcrypt import Bcrypt
from flask_caching import Cache
from flask_debugtoolbar import DebugToolbarExtension
from flask_jwt_extended import JWTManager
from flask_login import LoginManager
from fl... |
google/google-ctf | third_party/edk2/BaseTools/Source/Python/Table/TableDec.py | ## @file
# This file is used to create/update/query/erase table for dec datas
#
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distri... |
goose3/goose | tests/test_article.py | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... |
mgraffg/EvoDAG | EvoDAG/tests/test_function_selection.py | # Copyright 2017 Mario Graff Guerrero
# 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 wri... |
Manolaru/Python_train | Les_2/Task_7/test/test_add_group.py | # -*- coding: utf-8 -*-
import pytest
from fixture.application import Application
from model.group import Group
@pytest.fixture()
def app(request):
fixture = Application()
request.addfinalizer(fixture.destroy)
return fixture
def test_add_group(app):
app.session.login(username="admin",password="secre... |
KaranToor/MA450 | google-cloud-sdk/lib/surface/compute/backend_services/describe.py | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
cangencer/hazelcast-python-client | hazelcast/protocol/codec/replicated_map_contains_key_codec.py | from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.custom_codec import *
from hazelcast.util import ImmutableLazyDataList
from hazelcast.protocol.codec.replicated_map_message_type import *
REQUEST_TYPE = REPLICATEDMAP_CONTAINSKEY
RESPONSE_TYPE... |
crobby/sahara | sahara/service/engine.py | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
shreesundara/netsnmp | tests/test_objecttype_smiv2_pysnmp.py | import sys
if sys.version_info[0:2] < (2, 7) or \
sys.version_info[0:2] in ( (3, 0), (3, 1) ):
try:
import unittest2 as unittest
except ImportError:
import unittest
else:
import unittest
from pysmi.parser.smi import parserFactory
from pysmi.codegen.pysnmp import PySnmpCodeGen
from pysmi.c... |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/matplotlib/tests/test_cycles.py | import warnings
from matplotlib.testing.decorators import image_comparison, cleanup
from matplotlib.cbook import MatplotlibDeprecationWarning
import matplotlib.pyplot as plt
import numpy as np
from nose.tools import assert_raises
from cycler import cycler
@image_comparison(baseline_images=['color_cycle_basic'], rem... |
crchemist/scioncc | src/pyon/datastore/datastore_common.py | #!/usr/bin/env python
"""Common datastore definitions"""
__author__ = 'Michael Meisinger'
from putil.logging import log
from pyon.core.exception import BadRequest
from pyon.util.containers import get_safe, named_any, DotDict
class DataStore(object):
"""
Common definitions and base class for data stores
... |
rahuldan/sympy | sympy/calculus/util.py | from sympy import Order, S, log, limit
from sympy.core.basic import Basic
from sympy.core import Add, Mul, Pow
from sympy.logic.boolalg import And
from sympy.core.expr import AtomicExpr, Expr
from sympy.core.numbers import _sympifyit, oo
from sympy.core.sympify import _sympify
from sympy.sets.sets import (Interval, Int... |
safwanrahman/kitsune | kitsune/wiki/views.py | import json
import logging
import time
import re
from datetime import datetime
from functools import wraps
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django... |
Gadal/sympy | sympy/series/sequences.py | from __future__ import print_function, division
from sympy.core.basic import Basic
from sympy.core.mul import Mul
from sympy.core.singleton import S, Singleton
from sympy.core.symbol import Dummy, Symbol
from sympy.core.compatibility import (range, integer_types, with_metaclass,
i... |
iambibhas/django | django/db/models/query.py | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
from collections import deque, OrderedDict
import copy
import sys
import warnings
from django.conf import settings
from django.core import exceptions
from django.db import (connections, router, transaction, IntegrityError,
DJANGO_... |
srault95/netcall | netcall/green/__init__.py | """
Gevent versions of RPC client, service and load-balancer
Authors:
* Brian Granger
* Alexander Glyzov
Example
-------
To create a simple service::
from netcall.green import GreenRPCService
echo = GreenRPCService()
@echo.task
def echo(self, s):
return s
echo = Echo()
echo.bind(... |
kelle/astropy | astropy/utils/compat/numpy/tests/test_matmul.py | # coding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test matmul replacement.
"""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
import pytest
from ..core.multiarray import matmul, GE1P10
def test_import... |
amyvmiwei/chromium | webkit/tools/layout_tests/test_types/simplified_text_diff.py | # Copyright (c) 2006-2008 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.
"""Compares the text output to the expected text output while ignoring
positions and sizes of elements/text.
If the output doesn't match, returns F... |
souravsingh/khmer | sandbox/sweep-out-reads-with-contigs.py | #! /usr/bin/env python
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2011-2015, Michigan State University.
# Copyright (C) 2015, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pro... |
paulsnar/edaemon | application/cron/__init__.py | # coding: utf-8
import webapp2
import logging
from importlib import import_module
class CronHandler(webapp2.RequestHandler):
def get(self, task_name):
# self.response.write('Cron')
try:
job = import_module('.jobs.{0}'.format(task_name), __name__)
job.run()
self.... |
dario61081/koalixcrm | koalixcrm/crm/views/range_selection_form.py | # -*- coding: utf-8 -*-
from django.contrib.admin.widgets import *
class RangeSelectionForm(forms.Form):
"""
Form which allows to select the Range in which the work item can be registered
and which define which range of work items are loaded from the database and shown
to the user
"""
from_da... |
renatahodovan/fuzzinator | fuzzinator/reduce/picireny.py | # Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import logging
import os
from argparse import Namespace
from shut... |
srinathv/bokeh | bokeh/tests/test_bokeh_init.py | from __future__ import absolute_import
import unittest
class TestContents(unittest.TestCase):
def test_dir(self):
import bokeh
names = dir(bokeh)
self.assertTrue("__version__" in names)
self.assertTrue("__base_version__" in names)
self.assertTrue("license" in names)
... |
keishi/chromium | chrome/test/functional/popups.py | #!/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.
import os
import logging
import pyauto_functional # Must be imported before pyauto
import pyauto
import test_utils
class PopupsT... |
MarshallBrinn/geni-ch | tools/dbutils.py | # ----------------------------------------------------------------------
# Copyright (c) 2013-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including... |
thegmarlow/TagTrack- | examples/speed_control.py | import beaglebone_pru_adc as adc
import time
print 'Will start capture, keep it running for 10 seconds, then get timer value'
print 'This is used to compute the capture speed (time value of one timer unit)'
print 'Please wait...'
capture = adc.Capture()
capture.encoder0_pin = 0 # AIN0, aka P9_39
capture.encoder1_pin... |
Vespa314/bilibili-api | bili-monitor/main.py | # -*- coding: utf-8 -*-
"""
Created on Mon May 26 23:42:03 2014
@author: Administrator
"""
from bilibili import *
import os
def fileRename(title):
if title.find('/') >= 0:
title = title.replace('/','');
if title.find(':') >= 0:
title = title.replace(':','');
if title.find('?') >= 0:
... |
boltnev/iktomi | iktomi/web/filters.py | # -*- coding: utf-8 -*-
__all__ = ['match', 'method', 'static_files', 'prefix',
'subdomain', 'namespace', 'by_method']
import six
import logging
import os
from os import path
from six.moves.urllib.parse import unquote
from webob.exc import HTTPMethodNotAllowed, HTTPNotFound
from webob.static import FileAp... |
Cysu/open-reid | reid/evaluation_metrics/ranking.py | from __future__ import absolute_import
from collections import defaultdict
import numpy as np
from sklearn.metrics import average_precision_score
from ..utils import to_numpy
def _unique_sample(ids_dict, num):
mask = np.zeros(num, dtype=np.bool)
for _, indices in ids_dict.items():
i = np.random.choi... |
Mlieou/oj_solutions | leetcode/python/ex_358_logn.py | class Solution(object):
def rearrangeString(self, s, k):
"""
:type s: str
:type k: int
:rtype: str
"""
counter = collections.Counter(s)
heap = []
for c, v in counter.items():
heapq.heappush(heap, (-v, c))
waiting = collections.deque... |
kbrafford/pg | examples/textured_sphere.py | import pg
class Window(pg.Window):
def setup(self):
self.font = pg.Font(self, 1, '/Library/Fonts/Arial.ttf', 24)
self.wasd = pg.WASD(self)
self.wasd.look_at(pg.normalize((1, 0, 1)), (0, 0, 0))
self.context = pg.Context(pg.DirectionalLightProgram())
self.context.sampler = pg.... |
harveywwu/vnpy | beta/gateway/coincheckGateway/coincheckGateway.py | # encoding: UTF-8
'''
vn.coincheck的gateway接入
'''
from __future__ import print_function
import os
import json
from datetime import datetime
from copy import copy
from threading import Condition
from Queue import Queue
from threading import Thread
import json
from vnpy.api.coincheck import vncoincheck
from vnpy.trader.... |
nivekkagicom/uncrustify | tests/test_uncrustify/config.py | # Global state.
#
# * @author Ben Gardner October 2009
# * @author Guy Maurel October 2015
# * @author Matthew Woehlke June 2018
#
import os
test_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
# sorted by lexicographic order
all_tests = [
'c-sharp',
'c',
'cpp',
... |
wschoenell/chimera | src/chimera/interfaces/focuser.py | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# chimera - observatory automation system
# Copyright (C) 2006-2007 P. Henrique Silva <henrique@astro.ufsc.br>
# 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 S... |
zxtstarry/src | book/Recipes/wefd.py | try: from rsf.cluster import *
except: from rsf.proj import *
import fdmod,pplot
# ------------------------------------------------------------
# acoustic wave-equation modeling
#def awefd(odat,owfl,idat,velo,dens,sou,rec,custom,par):
# par['fdcustom'] = custom
#
# Flow( [odat,owfl],[idat,velo,dens,sou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.