text stringlengths 475 200k |
|---|
# Copyright 2019 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... |
#!/usr/bin/python
# coding=utf-8
import argparse
import atexit
import json
import os
import sys
from bson import SON
from mongo_orchestration.daemon import Daemon
work_dir = os.environ.get('MONGO_ORCHESTRATION_HOME', os.getcwd())
pid_file = os.path.join(work_dir, 'server.pid')
log_file = os.path.join(work_dir, 'ser... |
"""
Django settings for the diagnostic_feedback project.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
# Build paths inside the project like this: os.path.join(B... |
# Copyright 2014 Dirk Pranke. 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 a... |
"""
WSGI config for djember project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... |
# 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... |
#
# 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... |
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
#
# (c) 2016 Red Hat Inc.
#
# Copyright (c) 2017 Dell 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) an... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014-2016, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# Thi... |
from pyvirtualdisplay import Display
from selenium.webdriver.support.ui import Select
from selenium import webdriver
from bs4 import BeautifulSoup
keys=webdriver.common.keys.Keys
def scroll_element_into_view(driver, element):
"""Scroll element into view"""
y = element.location['y']
driver.execute_script('... |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
""" Contains Imagenette and Imagewoof datasets """
import os
from os.path import dirname, basename
import tempfile
import logging
import urllib.request
import tarfile
from io import BytesIO
import PIL
import tqdm
import numpy as np
from sklearn.preprocessing import LabelEncoder
from . import ImagesOpenset
logger =... |
"""
Created on Apr 7, 2015
@author: ayan
"""
from __future__ import absolute_import, division, print_function
from gridded.pysgrid.read_netcdf import NetCDFDataset, find_grid_topology_var
from .write_nc_test_files import roms_sgrid, wrf_sgrid
"""
Test NetCDF Dataset With Nodes.
"""
def test_finding_node_variab... |
# -*- coding: iso-8859-1 -*-
from time import time
from boxbranding import getImageVersion
from enigma import eConsoleAppContainer
from Components.Console import Console
from Components.PackageInfo import PackageInfoHandler
from Components.Language import language
from Components.Sources.List import List
from Compone... |
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Inv... |
# 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 ... |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... |
import pathlib
from typing import Optional
from cumulusci.core.exceptions import TaskOptionsError
from cumulusci.core.utils import process_bool_arg, process_list_arg
from cumulusci.salesforce_api.metadata import ApiDeploy
from cumulusci.salesforce_api.package_zip import MetadataPackageZipBuilder
from cumulusci.tasks.s... |
#!/usr/bin/env python
# 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 l... |
"""website URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... |
# 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... |
"""
Copyright (c) 2015 Marshall Farrier
license http://opensource.org/licenses/MIT
lib/ui/handlers.py
Handlers for edit menu
"""
from bson.codec_options import CodecOptions
import datetime as dt
from functools import partial
import json
from pymongo.errors import BulkWriteError
from ..dbschema import SPREADS
from ... |
#!/usr/bin/env python
#
# Copyright 2013 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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... |
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, steps
from nose.tools import assert_in, assert_true # pylint: disable=no-name-in-module
from common import i_am_registered_for_the_course, visit_scenario_item
from problems_setup import add_problem_to_course, answer... |
# Code for chapter 03 - Semantic Errors
import random
XMAX, YMAX = 19, 16
def create_grid_string(dots, xsize, ysize):
"""
Creates a grid of size (xx, yy)
with the given positions of dots.
"""
grid = ""
for y in range(ysize):
for x in range(xsize):
grid += "." if (x, y) i... |
#!/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.
""" Lexer for PPAPI IDL
The lexer uses the PLY library to build a tokenizer which understands both
WebIDL and Pepper tokens.
WebI... |
# Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... |
# This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, 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 b... |
"""
Dashboard search
"""
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL
class DashboardSearchPage(PageObject):
"""
Dashboard page featuring a search form
"""
search_bar_selector = '#dashboard-search-bar'
url = "{base}/dashboard".format(base=BASE... |
from __future__ import absolute_import
import logging
import tempfile
import os.path
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip.utils import call_subprocess
from pip.utils import display_path, rmtree
from pip.vcs import v... |
# -*- coding: utf-8 -*-
"""
ccp.client
~~~~~~~~~~~~
This module implements the Changelog API.
:license: MIT, see LICENSE for more details.
"""
import sys
import requests
import json
from time import time
import logging
from pkg_resources import get_distribution
API_HOST = "localhost"
API_PORT = 5000
SEVERITY = di... |
#
# Copyright (C) 2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... |
from decimal import Decimal
from exceptions import ValueError
from itertools import chain
from django.core.exceptions import ValidationError, MultipleObjectsReturned
from django.core.urlresolvers import reverse
from django.forms import Form
from django.forms.fields import BooleanField, CharField, DecimalField, IntegerF... |
#
# 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... |
from functools import total_ordering
from lhc.order import natural_key
class ChromosomeIdentifier:
def __init__(self, chromosome: str):
self.chromosome = chromosome
self.parts = tuple(natural_key(chromosome))
def __str__(self):
return self.chromosome
def __hash__(self):
r... |
from gi.repository import Gtk, Gdk
from pychess.System import conf
from pychess.System.prefix import addDataPrefix
from pychess.Utils.const import BLACK
from pychess.Utils.Move import toSAN, toFAN
from pychess.widgets.Background import hexcol
__title__ = _("Move History")
__active__ = True
__icon__ = addDataPrefix("g... |
import os
import re
from ctypes import c_char_p
from django.core.validators import ipv4_re
from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS
from django.contrib.gis.geoip.prototypes import (
GeoIPRecord, GeoIPTag, GeoIP_open, GeoIP_delete, GeoIP_database_info,
GeoIP_lib_version, GeoIP_record_by_addr... |
# 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... |
__all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
TreeBuilder,
XML)
from bs4.dammit import UnicodeDammit... |
import logging
from datetime import timedelta
from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from oscar.core.loading import get_model
ProductAlert = get_model('customer', 'ProductAlert')
logger = logging.getLogger(__name__)
class Command(... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
"""
# Integrating PayPal
### 1. Validate Currency Support
Example:
from frappe.integrations.utils import get_payment_gateway_controller
controller = get_payment_gateway_controller(... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <[EMAIL]>
# 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',
... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pandas as pd
import numpy as np
from .geom import geom
from matplotlib.patches import Rectangle
import matplotlib.colors as colors
import matplotlib.colorbar as colorbar
class geom_tile(geom):
DEFAU... |
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2010 Toms Bauģis <toms.baugis at gmail.com>
# This file is part of Project Hamster.
# Project Hamster 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 vers... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import gdb
import pwndbg.abi
import pwndbg.arch
import pwndbg.events
import pwndbg.memory
import pwndbg.regs
#: Total numb... |
data = (
'Ming ', # 0x00
'Sheng ', # 0x01
'Shi ', # 0x02
'Yun ', # 0x03
'Mian ', # 0x04
'Pan ', # 0x05
'Fang ', # 0x06
'Miao ', # 0x07
'Dan ', # 0x08
'Mei ', # 0x09
'Mao ', # 0x0a
'Kan ', # 0x0b
'Xian ', # 0x0c
'Ou ', # 0x0d
'Shi ', # 0x0e
'Yang ', # 0x0f
'Zheng ', # 0... |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... |
# Copyright 2012 Nebula, 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 agree... |
from curtsies import fmtstr
from ..monitor import Monitor
import pymongo
import bson.json_util
import re
import arrow
class BlogSaver:
def __init__(self, **kwargs):
self.db_address = kwargs.get("db_address", "mongo:27017")
self.db_name = kwargs.get("db_name", "news_crawler")
def save(self, article=None):
... |
import json
import logging
import os
import shutil
import zipfile
from django.conf import settings
from django.db.models import Q
from lxml import etree
import amo
from addons.models import AddonUser
from amo.celery import task
from lib.crypto.packaged import sign_file
from versions.compare import version_int
from v... |
#!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
#!/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.
"""Build NaCl tools (e.g. sel_ldr and ncval) at a given revision."""
import build_utils
import optparse
import os
import shutil
im... |
# Copyright 2015, Kay Hayen, mailto:[EMAIL]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... |
"""
These are tests for the refactored choicemodels MNL codebase.
"""
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from patsy import dmatrix
from choicemodels import MultinomialLogit
from choicemodels.tools import MergedChoiceTable
@pytest.fixture
def obs():
... |
from typing import Iterable, Optional
from warnings import warn
import PIL.Image as PILImage
import numpy as np
from menpo.base import MenpoDeprecationWarning, Vectorizable, copy_landmarks_and_path
from menpo.landmark import Landmarkable
from menpo.shape import PointCloud, bounding_box
from menpo.transform import (
... |
"""Translation helper functions."""
from __future__ import unicode_literals
import locale
import os
import re
import sys
import gettext as gettext_module
from threading import local
import warnings
from django.utils.importlib import import_module
from django.utils.datastructures import SortedDict
from django.utils.en... |
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it u... |
"""
This module contains EXPERIMENTAL support for storing a Whoosh index's files in
the Google App Engine blobstore. This will use a lot of RAM since all files are
loaded into RAM, but it potentially useful as a workaround for the lack of file
storage in Google App Engine.
Use at your own risk, but please report any p... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2010 TUBITAK/UEKAE
#
# 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 option)
# any later version.
#
# ... |
import unittest
import networkx as nx
from python_cypher import python_cypher
class TestPythonCypher(unittest.TestCase):
def test_upper(self):
"""Test we can parse a CREATE... RETURN query."""
g = nx.MultiDiGraph()
query = 'CREATE (n:SOMECLASS) RETURN n'
test_parser = python_cyphe... |
from __future__ import absolute_import, division, print_function
import time
import pytest
from pyros.client import PyrosClient
from pyros.server.ctx_server import pyros_ctx
pyros_interfaces_ros = pytest.importorskip("pyros_interfaces_ros") # , minversion="0.4") # TODO : make version avialable in pyros_interfaces_... |
# Copyright 2011 Hakan Kjellerstrand [EMAIL]
#
# 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... |
""" Python 'base64_codec' Codec - base64 content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg ([EMAIL]).
"""
import codecs, base64
### Codec APIs
def base64_encode(input,err... |
# Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test the C{I...Endpoint} implementations that wrap the L{IReactorTCP},
L{IReactorSSL}, and L{IReactorUNIX} interfaces found in
L{twisted.internet.endpoints}.
"""
from errno import EPERM
from zope.interface import implements
from twi... |
import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
BOARD_NAME = 'lpc5410x'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'D:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin'
elif CROSS_TOOL == 'keil':
... |
# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class sales_team_configuration(osv.TransientModel):
_name = 'sale.config.settings'
_inherit = ['sale.config.settings']
def set_group_multi_salesteams(self, cr, uid, ids, context=None):
""" This method is automatically called by res_conf... |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... |
"""
Objects for dealing with Hermite series.
This module provides a number of objects (mostly functions) useful for
dealing with Hermite series, including a `Hermite` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in the
d... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved.
# Pedro Tarrafeta <[EMAIL]>
# Ignacio Ibeas <[EM... |
__author__ = 'tom'
from PyQt4.QtGui import *
from BAL.Interface.DeviceFrame import LAUNCH, EX_DEV, DeviceFrame
from lxml.etree import Element, SubElement, XML
import rospkg
class RosLaunch(DeviceFrame):
def __init__(self, frame, data):
DeviceFrame.__init__(self, EX_DEV, frame, data)
self._pkg = ''... |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
# -*- coding: utf-8 -*-
import openerp
class m(openerp.osv.osv.Model):
""" This model exposes a few methods that will raise the different
exceptions that must be handled by the server (and its RPC layer)
and the clients.
"""
_name = 'test.exceptions.model'
def generate_except_osv(self,... |
# (c) 2012-2014, Michael DeHaan <[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.
... |
#!/usr/bin/env python
import sys
#Finding 'Next Link' on a given web page
def get_next_link(s):
start_link = s.find("href=")
if start_link == -1: #If no links are found then give an error!
end_quote = 0
link = "no_links"
return link, end_quote
else:
start_quote = s.find('... |
# -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping import LEX... |
# line 1
def wrap(foo=None):
def wrapper(func):
return func
return wrapper
# line 7
def replace(func):
def insteadfunc():
print('hello')
return insteadfunc
# line 13
@wrap()
@wrap(wrap)
def wrapped():
pass
# line 19
@replace
def gone():
pass
# line 24
oll = lambda m: m
# lin... |
import unittest
import shelve
import glob
from test import support
from collections import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
self.d = {}
def __... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013, Matt Hite <[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
# (a... |
# -*- 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... |
from twitter.common.string import ScanfParser
try:
from twitter.common import log
except ImportError:
log = None
class ProcessHandle(object):
"""
ProcessHandle interface. Methods that must be exposed by whatever process
monitoring mechanism you use.
"""
def cpu_time(self):
"""
Total cpu ... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVirtualLayerTask.
.. note:: 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 option) any later version.
"... |
import re
import fnmatch
import pandas as pd
# three days
EXPIRE = 259200
def get_re(pattern):
if type(pattern) == str:
return re.compile(fnmatch.translate(pattern), flags=re.IGNORECASE)
elif type(pattern) == list:
return re.compile("|".join(fnmatch.translate(pattern)),
... |
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2010 Advanced Micro Devices, 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 co... |
from os.path import basename
from urlparse import urlparse, parse_qs
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _lazy, ugettext as _
from wikimarkup.parser import Parser, ALLOWED_TAGS
from kitsune.gallery.models import Im... |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
# Copyright (C) 2013 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/LICEN... |
# Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... |
# -*- coding: utf-8 -*-
#
# 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
#... |
"""Unit tests for platform/plant.py."""
from datetime import datetime, timedelta
import pytest
from homeassistant.components import recorder
import homeassistant.components.plant as plant
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
CONDUCTIVITY,
LIGHT_LUX,
STATE_OK,
STATE_PROBLEM,
... |
"""
Copyright (c) 2003-2010 Gustavo Niemeyer <[EMAIL]>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <[EMAIL]>"
__license__ = "PSF License"
import itertools
import datetime
import calendar
import thread
import sys
__all__ = ["rrule", "rruleset", "rrule... |
"""
webhook_notification.py
Implementation of the datatypes used in OneDrive webhook notification, which is absent
from official OneDrive Python SDK.
:copyright: (c) Xiangyu Bu <[EMAIL]>
:license: MIT
"""
from .. import od_dateutils
class WebhookNotification:
""" https://dev.onedrive.com/resources/webhookNoti... |
# (c) 2015, Marius Gedminas <[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.
#
# ... |
# 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class PixelTestsPage(page_module.Page):
def __init_... |
#
# 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... |
from nose.tools import assert_equal, assert_true, assert_false, raises
import networkx as nx
def test_dominating_set():
G = nx.gnp_random_graph(100, 0.1)
D = nx.dominating_set(G)
assert_true(nx.is_dominating_set(G, D))
D = nx.dominating_set(G, start_with=0)
assert_true(nx.is_dominating_set(G, D))
... |
from __future__ import unicode_literals
from cgi import escape
from wtforms.compat import text_type, string_types, iteritems
__all__ = (
'CheckboxInput', 'FileInput', 'HiddenInput', 'ListWidget', 'PasswordInput',
'RadioInput', 'Select', 'SubmitInput', 'TableWidget', 'TextArea',
'TextInput', 'Option'
)
... |
"""
Support for GPSD.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.gpsd/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_LATITUDE, ATTR_LONGITUD... |
"""
A presentation layer for generating LaTeX Qtree output.
"""
import copy
class Qtree(object):
r"""
A qtree is rendered as a root with some branches:
ROOT
/ \
b1 b2 ...
"""
def __init__(self, root, branches=[]):
"""
@arg root: A string which is rendered as "ROOT" in t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.