text stringlengths 475 200k |
|---|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, 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.apach... |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
'Action'
import gtk
from tryton.gui.window.view_form.screen import Screen
import tryton.rpc as rpc
import tryton.common as common
from tryton.pyson import PYSONDecoder
import get... |
#!/usr/bin/python
import os
import sys
import string
import config
import up2dateUtils
from repoBackends import urlUtils
def getMirrors(source, defaultMirrorUrl=None):
cfg = config.initUp2dateConfig()
mirrorPath = "/etc/sysconfig/rhn/mirrors/"
mirrorType = ""
if cfg.has_key("mirrorLocation"):
... |
#!/usr/bin/env python
#
# 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.
#
# Written (W) 2012 Heiko Strathmann
# Copyrigh... |
"""Line-like geometrical entities.
Contains
========
LinearEntity3D
Line3D
Ray3D
Segment3D
"""
from __future__ import print_function, division
from sympy.core import S, Dummy, nan
from sympy.functions.elementary.trigonometric import acos
from sympy.simplify.simplify import simplify
from sympy.solvers import solve
fr... |
"""
Parse a css document into a python class that can be used to apply the
style to a BeautifulSoup document.
"""
import re
class Selector(object):
"""
Represent a css selector.
The __call__ method takes a BeautifulSoup node as argument end
return True if the selector applies to the node.
"""
... |
#!/usr/bin/env python
import os
import sys
from setuptools import setup
def publish():
os.system('python setup.py sdist upload')
if sys.argv[-1] == 'publish':
publish()
sys.exit()
current_version = sys.version_info[:2]
optional_requirements = []
if current_version < (2, 7) or current_version == (3, 1) ... |
# Copyright (C) 2016 Custodia Project Contributors - see LICENSE file
import yaml
from requests.exceptions import HTTPError
from custodia.client import CustodiaSimpleClient
class CustodiaSimpleConstructor(object):
yaml_tag = u'!custodia/simple'
def __init__(self, url):
self.client = CustodiaSimple... |
"""
This class is defined to override standard pickle functionality
The goals of it follow:
-Serialize lambdas and nested functions to compiled byte code
-Deal with main module correctly
-Deal with other non-serializable objects
It does not include an unpickler, as standard python unpickling suffices.
This module wa... |
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
from string import Template
import six
from .errors import ConfigurationError
log = logging.getLogger(__name__)
def interpolate_environment_variables(config, section, environment):
def process_item(name, config_dict)... |
from __future__ import absolute_import
# If there is a constants.[pyd|so|dylib] in the main directory, it will be imported instead of the constants.py file.
# It should be removed as it is from the older version of CoolProp
from . import constants
if constants.__file__.rsplit('.', 1)[1] not in ['pyc','pyo','py']:
... |
from datetime import timedelta
from pandas.compat import long, zip
from pandas import compat
import re
import warnings
import numpy as np
from pandas.core.dtypes.generic import ABCSeries
from pandas.core.dtypes.common import (
is_integer,
is_period_arraylike,
is_timedelta64_dtype,
is_datetime64_dtype)... |
# 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 cloud_storage_test_base
import gpu_rasterization_expectations
import optparse
import page_sets
from telemetry.util import image_util
test_harness_s... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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
... |
import pytest
from financial_data_utils.options.yahoo.finance import Finance
from financial_data_utils.options.yahoo.service import Service
import datetime
class TestFinance :
def setup_method (self,method) :
self.yf = Finance()
self.yql = Service()
@pytest.mark.usefixtures("lasttrade_reques... |
import matplotlib.image as mpimg
import numpy as np
import cv2
from skimage.feature import hog
from scipy.ndimage.measurements import label
from regionOfInterest import region_of_interest
import matplotlib.pyplot as plt
def convert_color(img, conv='RGB2YCrCb'):
if conv == 'RGB2YCrCb':
return cv2.cvtColor(... |
import email
import logging
from jinja2 import Environment, FileSystemLoader, Template
from jinja2.exceptions import TemplateNotFound
import os
import shutil
import subprocess
from tempfile import TemporaryDirectory
from fantail import __version__
from fantail.plugins.registry import load_plugins
from fantail.fileutil... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ..compat import mock
from .base import CommandTestCase
from gandi.cli.commands import record
class RecordTestCase(CommandTestCase):
def test_list(self):
result = self.invoke_with_exceptions(record.list, ['iheartcli.com'])
sel... |
from __future__ import print_function
from LogAnalyzer import Test,TestResult
import DataflashLog
class TestPerformance(Test):
'''check performance monitoring messages (PM) for issues with slow loops, etc'''
def __init__(self):
Test.__init__(self)
self.name = "PM"
def run(self, logdata,... |
from RGT.XML.SVG.Filters.baseFilterNode import BaseFilterNode
from types import StringType
from RGT.XML.SVG.basicSvgNode import BasicSvgNode
class FeMorphologyNode(BaseFilterNode):
svgNodeType = BasicSvgNode.SVG_FE_MORPHOLOGY_NODE
ATTRIBUTE_IN = 'in'
ATTRIBUTE_OPERATOR = 'operator'
ATTRIBUT... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# fMBT, free Model Based Testing tool
# Copyright (c) 2012, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is distribut... |
import json
import bottle
app = bottle.Bottle()
@app.route('/one_form')
def one_form():
return '''
<!doctype html>
<html>
<head></head>
<body>
<form action='/dump_params' method='post' id='formid' name='formname'>
<input type='text' name='textf' value='textv' />
<input type='submit' value='Go'... |
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.utils.decorators import method_decorator
from django.views.generic import View
from silk.auth import login_possibly_required, permissions_possibly_required
from silk.models import Request
class Raw(View):
@method_dec... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# -*- coding: utf-8 -*-
"""Instant Gratification -- Computing Units
:copyright: Copyright 2013 by Tiago Antao
:license: GNU Affero General Public License, see LICENSE for details
.. moduleauthor:: Tiago Antao <[EMAIL]>
"""
class Compute:
"""A mapping computing unit.
A general unit will proce... |
from builtins import map
from past.builtins import basestring
import copy
import re
import numpy as np
import pandas as pd
import sportsref
RUSH_OPTS = {
'left end': 'LE', 'left tackle': 'LT', 'left guard': 'LG',
'up the middle': 'M', 'middle': 'M',
'right end': 'RE', 'right tackle': 'RT', 'right guard':... |
"""test max branch
"""
__revision__ = ''
def stupid_function(arg):
"""reallly stupid function"""
if arg == 1:
print 1
elif arg == 2:
print 2
elif arg == 3:
print 3
elif arg == 4:
print 4
elif arg == 5:
print 5
elif arg == 6:
print 6
elif... |
########################################################################
# $HeadURL$
# File : SiteSEMapping.py
########################################################################
""" The SiteSEMapping module performs the necessary CS gymnastics to
resolve site and SE combinations. These manipulations are... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from guildwars2api.base import BaseClient
from .resources import (
Event,
EventName,
MapName,
WorldName,
EventDetail,
GuildDetail,
Item,
ItemDetail,
Recipe,
RecipeDetail,
Skin,
SkinDetail,
Continent,
... |
import dpkt
from .pcapload import HttpReplayPcapParser
from .log import HttpReplayLog
from .rules import HttpReplayRules
class HttpReplayUri:
def __init__(self, uri):
self.uri = uri
self.lst = []
def __str__(self):
return self.uri
def dump(self):
import hashlib
pr... |
# (c) 2016, Dag Wieers <[EMAIL]>
#
# 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.
#
# Ansib... |
#!/usr/bin/env python
# Copyright (c) 2017 Okinawa Open Laboratory and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE... |
from django.contrib.auth import get_user_model
from rest_framework import serializers
from rest_framework.reverse import reverse
from .models import Sprint, Task
# Fetch the user model
User = get_user_model()
class SprintSerializer(serializers.ModelSerializer):
# Get own links
links = serializers.SerializerMethodF... |
# 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... |
#!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""
Demo script showing detections in sample ima... |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source
##
## 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 2
## of the License, or... |
# -*- coding: utf-8 -*-
import datetime
from django.core.exceptions import ValidationError
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
from activities.models import Activity, Episode
from media.managers import BuzzManager, PollManager, FollowUpQuerySet
... |
#!/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... |
'''
$Id: interface.py 54 2010-02-22 02:33:10Z nikratio $
Copyright (c) 2010, Nikolaus Rath <[EMAIL]>
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... |
#!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
'thriftpy',
'packtools<=2.5.3',
'requests',
'lxml',
'doaj_client',
'scieloh5m5',
'xylose',
'articlemetaapi<=1.26.5',
'publicationstatsapi>=1.2.1',
'accessstatsapi>=1.2.1',
'citedbyapi>=1.1... |
from astropy.io import fits
from skimage import transform as tf
import astropy.wcs as wcs
import numpy as np
def pyhastrom(WarpHDU, TemplateHDU, anchors = 5, order = 2):
normal = np.linspace(0,1,anchors)
naxis = WarpHDU.header.get('NAXIS', 0)
if naxis == 1:
xx = normal
elif naxis == 2:
... |
# Copyright 2009 Kieran Elliott <[EMAIL]>
#
# Media Rover 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.
#
# Media Rover is distribut... |
from django import forms
from django.forms.widgets import RadioSelect
from django.contrib.auth import authenticate
from django.utils.text import slugify
from django.contrib.auth.models import User
from xbrowse_server.base.models import Family, Individual, ANALYSIS_STATUS_CHOICES, COLLABORATOR_TYPES, ProjectPhenotype, ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 John Hampton <[EMAIL]>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: John Hampton <[EMAIL]>
__author__ = 'John Hampton <[EMAIL]>'
import sys
i... |
from __future__ import absolute_import
from django.core.mail import get_connection
from django.core.mail.message import EmailMultiAlternatives
__title__ = 'fobi.contrib.plugins.form_handlers.mail.helpers'
__author__ = 'Artur Barseghyan <[EMAIL]>'
__copyright__ = '2014-2017 Artur Barseghyan'
__license__ = 'GPL 2.0/LGP... |
# -*- coding: utf-8 -*-
"""
Autor: Jorge A. Toro [[EMAIL]]
"""
import sys, os
ROOT_PATH = os.path.dirname(__file__)
sys.path.append(ROOT_PATH)
import web
from urls import urls
import view, config
from view import render
app = web.application(urls, locals())
if web.config.get('_sesion') is None:
session = web.... |
from collections import deque
import unittest
from test import support, seq_tests
import gc
import weakref
import copy
import pickle
from io import StringIO
import random
import struct
BIG = 100000
def fail():
raise SyntaxError
yield 1
class BadCmp:
def __eq__(self, other):
raise RuntimeError
cl... |
# coding=utf-8
import json
import sqlite3
from os import path
DATABASE = path.sep.join(('databases', 'content.db'))
VERSION = 1
class transaction(object):
def __init__(self, connection):
self.connection = connection
def __enter__(self):
self.connection.execute('BEGIN')
return self.c... |
from django import template
from django.template.loader import render_to_string
from django.contrib.comments.templatetags.comments import BaseCommentNode
from django.contrib import comments
from threadedcomments.util import annotate_tree_properties, fill_tree as real_fill_tree
register = template.Library()
class Base... |
# 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... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "mesh3d"
_path_str = "mesh3d.stream"
_valid_props = {"maxpoints", "token"}
# maxpoints
... |
"""
Defines the URL routes for the Team API.
"""
from django.conf import settings
from django.conf.urls import url
from .views import (
MembershipDetailView,
MembershipListView,
TeamsDetailView,
TeamsListView,
TopicDetailView,
TopicListView
)
TEAM_ID_PATTERN = r'(?P<team_id>[a-z\d_-]+)'
TOPIC... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Author: Lorenzo Battistini <[EMAIL]>
# Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2013 Agile Business Group sagl (<http:/... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
from Screen import Screen
from Screens.Setup import getConfigMenuItem, Setup
from Screens.InputBox import PinInput
from Screens.MessageBox import MessageBox
from Components.ServiceEventTracker import ServiceEventTracker
from Components.ActionMap import NumberActionMap
from Components.ConfigList import ConfigListScreen
... |
#!/usr/bin/python
#
# Copyright 2013 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 b... |
# 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... |
# -*- Python -*-
import os
import platform
import re
import subprocess
import tempfile
import lit.formats
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import ToolSubst
from lit.llvm.subst import FindTool
# Configuration file for the 'lit' test runner.
# name: The name of this test suite.
co... |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import six
from django.db.models import Q
from django.utils.translation impo... |
#!/usr/bin/env python
from spider import *
class CambridgeSpider(Spider):
def __init__(self):
Spider.__init__(self)
self.school = 'cambridge'
def doWork(self):
r = requests.get('http://www.cl.cam.ac.uk/teaching/1415/lecturers.html')
soup = BeautifulSoup(r.text)
fil... |
# Copyright (c) 2018 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 app... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This is a script written to add the template "orphan" to the pages that aren't linked by other pages.
It can give some strange Errors sometime, I hope that all of them are fixed in this version.
These command line parameters can be used to specify which pages to work on:
... |
import os
import weakref
import logging
logger = logging.getLogger(__name__)
from core import cons
from core import events
from core import utils
from core.config import conf
from core.api import api
from PySide.QtGui import *
from PySide.QtCore import *
import media
import signals
from list_model import SimpleListM... |
#!/usr/bin/env python
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def CheckSort(listElement):
if sorted(listElement) == listElement:
return 0
else:
return 1
class TestLesson5a(unittest.TestCase):
def setUp(self):
self.browser = ... |
#!/usr/bin/env python
# Copyright (C) 2017 SignalFx, Inc. All rights reserved.
#
# A simple example showing how to execute a SignalFx SignalFlow computation
# from Python and dump its data, metadata and event output to the console.
import argparse
import os
import sys
sys.path.insert(0, os.path.join(
os.path.dir... |
"""Calxeda: power.py """
# Copyright (c) 2012-2013, Calxeda 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... |
# Copyright 2009 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... |
"""Functions used by least-squares algorithms."""
from math import copysign
import numpy as np
from numpy.linalg import norm
from scipy.linalg import cho_factor, cho_solve, LinAlgError
from scipy.sparse import issparse
from scipy.sparse.linalg import LinearOperator, aslinearoperator
EPS = np.finfo(float).eps
# Fu... |
# Copyright (c) 2016 Intracom S.A. Telecom Solutions. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this distribution,
# and is available at http://www.eclipse.org/legal/epl-v10.html
import logging
import o... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Zdenko Podobný
# Author: Zdenko Podobný
#
# 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/LIC... |
# -*- coding: utf-8 -*-
"""Tests for scheduling and timer management."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 Will Hutcheson
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
import pytest
from cwmud.core.timing import (AlreadyExists, d... |
from itertools import starmap, repeat, count, islice
# La fonction map peut prendre plusieurs itérables en paramètres
# Il faut juste que la fonction appliquée par map, prennent en paramètre le même nombre d'arguments
print("[map] :", *map(lambda x, y, z: x+y+z,
['1', '2', '3'], ['A', 'B', 'C'],... |
#!/usr/bin/env python
#
# Copyright 2006,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import random
from gnuradio import gr, gr_unittest, digital, blocks
def make_random_int_list(L, min, max):
result = []
for x in ra... |
# Copyright 2014 Cloudbase Solutions Srl
# 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 r... |
from decimal import Decimal
from typing import TYPE_CHECKING
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.uix.checkbox import CheckBox
from kivy.uix.label import Label
from kivy.uix.widget import Widget
from kivy.clock impo... |
""" Submit specified job scripts
Config comes from a file, specified as --config argument. Some configuration options (listed below)
can also be given at the command line, where they will override the configuration file.
See config/submit.yaml for a full list of configuration options.
Usage:
submit.py... |
# -*- encoding: utf-8 -*-
'''
Hubble Nova plugin for using iptables to verify firewall rules
:maintainer: HubbleStack / avb76
:maturity: 2016.7.0
:platform: Linux
:requires: SaltStack
This audit module requires yaml data to execute. Running hubble.audit will
search the local directory for any .yaml files and it will ... |
"""
amqproto.replies
~~~~~~~~~~~~~~~~
AMQP replies (connection or channel exceptions).
"""
# pylint: disable=redefined-builtin
import attr
from . import methods
class BaseReply(Exception):
"""
Base class for all replies, synchronous and asynchronous.
"""
@attr.s(str=True)
class Reply(BaseReply):
... |
from datetime import datetime
from flask import request, url_for, redirect
from udata import search
from udata.api import api, API, errors
from udata.auth import admin_permission, current_user
from udata.core.badges import api as badges_api
from udata.core.followers.api import FollowAPI
from udata.utils import multi_... |
#! python
import os
import sys
__version_info = {} # keep a reference to parse VERSION once
def get_version_info():
# read from VERSION
# return dictionary filled with content of version
if not __version_info:
this_file_dir = os.path.dirname(os.path.abspath(__file__))
version_file = os.pat... |
# Copyright (C) 2015 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... |
# 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... |
# -*- coding: utf-8 -*-
from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr
from ServiceReference import resolveAlternate
from Components.Element import cached
class ServiceName(Converter, object):
NAME = 0
PROVIDER = 1
REFERENCE = 2
ED... |
from h2o.estimators.xgboost import *
from tests import pyunit_utils
def xgboost_insurance_gaussian_small():
assert H2OXGBoostEstimator.available()
# Import big dataset to ensure run across multiple nodes
training_frame = h2o.import_file(pyunit_utils.locate("smalldata/testng/insurance_train1.csv"))
te... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
***************************************************************************
r.external.all.py
---------------------
Date : July 2009
Copyright : (C) 2009 by Lorenzo Masini
Email : rugginoso at develer dot co... |
import match4server
from Messages import Message, MessageType
import Messages
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, QTimer
class ServerConnector(QObject):
messageReceived = pyqtSignal(Message)
def __init__(self):
super(ServerConnector, self).__init__()
self.createMessageType... |
import sys
import pytest
import yaml
sys.path.append('.')
from python2_consul.file import File
@pytest.fixture(scope='session')
def valid_yaml_file(tmpdir_factory):
fn = tmpdir_factory.mktemp('temp_dir').join('valid.yaml')
fn.write("key: value")
return str(fn)
@pytest.fixture(scope='session')
def director... |
#!/usr/bin/env python3
import os
import sys
import re
import argparse
from datetime import datetime
from sqlalchemy import Column, DateTime, String, Integer
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
# colors. yay!
from colorama... |
#Python 2
import sys
# setdefaultencoding is removed during Python start. Get it back.
# See http://stackoverflow.com/questions/2276200/changing-default-encoding-of-python
reload(sys) # Reload does the trick!
sys.setdefaultencoding('utf-8')
from docutils import nodes, core, io
from docutils.parsers.rst import... |
"""
Copyright 2006 ThoughtWorks, 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, sof... |
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import gevent
import argparse
import os
import sys
#import discovery.services as services
import discoveryclient.client as client
import uuid
import time
import signal
class TestDiscService():
def __init__(self, args_str=None):
self.arg... |
# 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... |
# This program is free software; you can redistribute it and/or modify
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ... |
import pytest
@pytest.fixture
def no_ds(monkeypatch):
"""Ensure DJANGO_SETTINGS_MODULE is unset"""
monkeypatch.delenv('DJANGO_SETTINGS_MODULE')
pytestmark = pytest.mark.usefixtures('no_ds')
def test_no_ds(testdir):
testdir.makepyfile("""
import os
def test_env():
assert 'D... |
#!/usr/bin/python
#
# Copyright 2012 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 b... |
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
# Michel Mooij, [EMAIL]
"""
Tool Description
================
This module provides a waf wrapper (i.e. waftool) around the C/C++ source code
checking tool 'cppcheck'.
See http://cppcheck.sourceforge.net/ for more information on the cppcheck tool
itself.
Note that many ... |
__doc__="""Maps the system name to OS version etc"""
import re
from Products.DataCollector.plugins.CollectorPlugin import SnmpPlugin, GetMap
from Products.DataCollector.plugins.DataMaps import MultiArgs
class AIXBase(SnmpPlugin):
maptype = "AIXBase"
relname = "aixbase"
modname = "ZenPacks.community.AIX.A... |
import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import GoogleProvider
class GoogleOAuth2Adapter(OAuth2Adapter):
provider_id = GoogleProvider.id
access_token_url = 'https://accounts.google.com/o/oauth2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.