gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
import base64
from enum import Enum, unique
from typing import Any, Mapping
from flask import redirect, request
from six.moves.urllib_parse import urlsplit, urlunsplit
from werkzeug.wrappers import Response as WerkzeugResponse
from eduid_common.api.decorators import require_user
from eduid_c... | |
# Copyright (c) 2012 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
from .sklearntools import fit_predict, shrinkd, LinearCombination, BaseDelegatingEstimator, \
STSimpleEstimator, AlreadyFittedEstimator, growd
from sklearn.base import clone
from toolz.dicttoolz import valmap, dissoc
from .line_search import golden_section_search, zoom_search, zoom
import numpy as np
from sklearn.e... | |
#
# scancodes, ripped straight from /usr/include/linux/input.h
#
EV_VERSION = 0x010000
EV_SYN = 0x00
EV_KEY = 0x01
EV_REL = 0x02
EV_ABS = 0x03
EV_MSC = 0x04
EV_SW = 0x05
EV_LED = 0x11
EV_SND = 0x12
EV_REP = 0x14
EV_FF = 0x15
EV_PWR = 0x16
EV_FF_STATUS = 0x17
EV_MAX = 0x1f
EV_CNT = (EV_MAX+1)
SYN_REPORT = 0
SYN_CONFIG =... | |
from __future__ import absolute_import, division, print_function
import pytest
pytest.importorskip('numpy')
import dask.array as da
from dask.array.utils import assert_eq as _assert_eq
from dask.core import get_deps
from dask.context import set_options
import numpy as np
# temporary until numpy functions migrated
tr... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
from __future__ import with_statement
import pprint
from globalVars import *
import re
import os
import time
__author__ = 'elhassouni'
# Variable Globals ###################################################################################################
# Variable
path = '/media/elhassouni/donnees/Noeud-plante-pro... | |
#!/usr/bin/env python3
#import getopt
import argparse
from . import emails
import sys
import re
import os
import subprocess
import time
import signal
from collections import defaultdict
#import our libs
from .emails import EmailTemplate
from .utils import Utils
from .display import Display
from .gather import Gather
... | |
# Copyright 2012 Pedro Navarro Perez
# 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... | |
# 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 ... | |
#-*-encoding=UTF8-*-
import pygame
from pygame.locals import *
import time
import datetime
import sys
import os
import glob
import subprocess
import RPi.GPIO as GPIO
__VERSION__='1'
__RELEASE__='0'
os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"
os.environ["SDL_MOUSEDRV"] = ... | |
# 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 ... | |
"""passlib.tests -- tests for passlib.pwd"""
#=============================================================================
# imports
#=============================================================================
# core
import itertools
import logging; log = logging.getLogger(__name__)
# site
# pkg
from passlib.tests.u... | |
# Copyright (c) 2013 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 ... | |
from js9 import j
def input(job):
for arg in ['filesystems', 'arbds']:
if job.model.args.get(arg, []) != []:
raise j.exceptions.Input("{} should not be set as input".format(arg))
nodes = job.model.args.get('nodes', [])
nrserver = job.model.args.get('nrServer', 0)
if len(nodes) == ... | |
from __future__ import unicode_literals, division, absolute_import, with_statement
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
from future.moves.urllib.parse import quote
import os
import re
import threading
import logging
from xml.etree.ElementT... | |
"""
Copyright (c) 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from atomic_reactor.utils.cachito import (
CachitoAPI, CachitoAPIInvalidRequest, CachitoAPIReques... | |
import sys
sys.path.insert(0, "../..")
from Cube import *
from Machine import *
if sys.version_info[0] >= 3:
raw_input = input
#Define global variables
globalVarCount = {} #10000
globalVarCount[BOOL] = INITIALGLOBALBOOL
globalVarCount[INT] = INITIALGLOBALINT
globalVarCount[FLOAT] = INITIALGLOBALFLOAT
globalVarC... | |
"""Config flow for Universal Devices ISY994 integration."""
import logging
from urllib.parse import urlparse
from pyisy.configuration import Configuration
from pyisy.connection import Connection
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.components import ss... | |
# 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... | |
from sqlalchemy import testing, desc, select, func, exc, cast, Integer
from sqlalchemy.orm import (
mapper, relationship, create_session, Query, attributes, exc as orm_exc,
Session, backref, configure_mappers)
from sqlalchemy.orm.dynamic import AppenderMixin
from sqlalchemy.testing import (
AssertsCompiledS... | |
# 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... | |
import os
import sys
import struct
import weakref
import hashlib
import itertools
import collections
import cPickle as pickle
import logging
l = logging.getLogger("claripy.ast")
import ana
WORKER = bool(os.environ.get('WORKER', False))
md5_unpacker = struct.Struct('2Q')
#pylint:enable=unused-argument
#pylint:disabl... | |
#!/usr/bin/env python
" quantumRandom.py "
from math import log as _log, ceil as _ceil, floor as _floor
from random import Random
from urllib import urlencode, quote as urlquote
from urllib2 import Request, urlopen
import sys
bitsPerFloat = sys.float_info.mant_dig
try:
import json
except ImportError:
import simple... | |
# -*- coding: utf-8 -*-
'''
Created on 27.09.2014
@author: Simon Gwerder
'''
from thesaurus.mapsemnet import MapOSMSemanticNet
from thesaurus.rdfgraph import RDFGraph
from utilities import utils
from utilities.configloader import ConfigLoader
from utilities.translator import Translator
from filter import Filter
cl... | |
'''
Created on 2016/11/3
:author: hubo
'''
from __future__ import print_function
from vlcp.config import manager
from vlcp.scripts.script import ScriptModule
import vlcp.service.sdn.viperflow as viperflow
import vlcp.service.kvdb.objectdb as objectdb
from vlcp.server.module import depend, call_api
from vlcp.utils.co... | |
"""Rest API for Home Assistant."""
import asyncio
from http import HTTPStatus
import json
import logging
from aiohttp import web
from aiohttp.web_exceptions import HTTPBadRequest
import async_timeout
import voluptuous as vol
from homeassistant.auth.permissions.const import POLICY_READ
from homeassistant.bootstrap imp... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2016 Fedele Mantuano (https://twitter.com/fedelemantuano)
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/lice... | |
#!/usr/bin/env python
# Copyright 2014-2020 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... | |
# CCopyright 2017-present Adtran, 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 wri... | |
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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... | |
from __future__ import division
import numpy as np
from numpy import pi, exp, sqrt, cos, sin
import os
import h5py
try:
import pyfftw
pyfftw.interfaces.cache.enable()
except ImportError:
pass
class Boussinesq2d(object):
""" 2D Boussinesq code in vorticity-streamfunction/buoyancy formulation """
... | |
from object import Object
import colander, deform
from cms import dbutil
from bson.objectid import ObjectId
from cms.htmlutil import html_to_text
import widgets
import permissions
import repoze.workflow
import zope.interface
from pyramid import security
from interfaces import IContent, ITrash
import pyes
import loggin... | |
"""
Models for working with remote translation data stored in a VCS.
"""
import logging
import os
import scandir
import shutil
from itertools import chain
from datetime import datetime
from django.utils import timezone
from django.utils.functional import cached_property
from pontoon.base import MOZILLA_REPOS
from po... | |
'''Partial Regression plot and residual plots to find misspecification
Author: Josef Perktold
License: BSD-3
Created: 2011-01-23
update
2011-06-05 : start to convert example to usable functions
2011-10-27 : docstrings
'''
from statsmodels.compat.python import lrange, string_types, lzip, range
import numpy as np
imp... | |
#!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | |
#!/usr/bin/env python
"""This modules contains tests for Angular components."""
from grr.gui import runtests_test
from grr.lib import aff4
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
class CollectionTableDirectiveTest(test_lib.GRRSeleniumTest):
"""Test for angular collect... | |
'''
This module wraps maya.cmds to accept special pymel arguments.
There are a number of pymel objects which must be converted to a "mel-friendly"
representation. For example, in versions prior to 2009, some mel commands (ie, getAttr) which expect
string arguments will simply reject custom classes, even if they have a... | |
import urllib.request
import json
class WS:
def extract(l_url, m_url=''):
"""
This is a generator.
Its job is to take urls and return their html
data.
The first value is the main url if you need it.
And the second is the products url.
Here if I have produc... | |
# -*- coding: utf-8 -*-
import itertools
import httplib as http
import logging
import math
import os
import urllib
from django.apps import apps
from flask import request, send_from_directory
from framework import utils, sentry
from framework.auth.decorators import must_be_logged_in
from framework.auth.forms import Si... | |
#!/usr/local/bin/python
from azure.mgmt.keyvault.models import Sku
from azure.mgmt.keyvault.models import VaultCreateOrUpdateParameters, VaultProperties, SkuName, AccessPolicyEntry, \
Permissions, KeyPermissions, SecretPermissions, CertificatePermissions
from azure.keyvault import KeyVaultClient, KeyVaultAuthentica... | |
#!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print... | |
import datetime
from dateutil import tz
import os
import re
import shutil
from .. import util
from ..util import compat
from . import revision
from ..runtime import migration
from contextlib import contextmanager
_sourceless_rev_file = re.compile(r'(?!\.\#|__init__)(.*\.py)(c|o)?$')
_only_source_rev_file = re.compile... | |
# 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... | |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from builtins import range, next, zip, map
from future.utils import viewvalues
import sys
if sys.version < '3':
text_type = unicode
binary_type = str
shelve_key = lambda x: x.encode()
int_type = long
else:
text_type = str
binary_type = bytes
unicode ... | |
# Copyright (c) 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-2.0
#
# Unless required by applicable ... | |
#
# CanvasObject.py -- base class for shapes drawn on ginga canvases.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import math
import numpy
from collections import namedtuple
from ginga.misc import Callback, Bunch
from ginga import trcalc, colors
from ... | |
# pylint: disable=invalid-name,unused-variable,invalid-name
"""Bitserial conv2d schedule on x86"""
import tvm
from topi.util import get_const_int
from .. import generic, tag
from ..nn.bitserial_conv2d import bitserial_conv2d, _get_schedule, _get_workload
from ..nn.bitserial_conv2d import SpatialPackNCHW, SpatialPackNHW... | |
# 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... | |
# -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import json
import os
from datetime import datetime
from .hooks import dispatch_hook, HOOKS
from .structures import CaseInsensitiveDict
from .status_codes import codes
from .auth import HTT... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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.apach... | |
import logging
import numpy as np
import scipy.sparse
from typing import List, Optional, Dict, Text, Set, Any
from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
from rasa.nlu.extractors.extractor import EntityTagSpec
from rasa.nlu.utils import bilou_utils
from rasa.nlu.utils.bilou_ut... | |
import ast
import json
import httplib
import itertools
from urllib2 import urlopen, URLError
from urlparse import urljoin
from time import time
from copy import deepcopy
from os import path
import logging
import threading
from rauth import OAuth2Service
from requests.adapters import HTTPAdapter
from requests.exception... | |
'''Module for accessing MWR.
This module provides an advanced, easy-to-use API for
accessing and mutating the Microsoft Windows Registry.'''
################################################################################
__version__ = '$Revision: 0 $'
__date__ = 'March 19, 2007'
__author__ = 'Stephen "Zero" Chappel... | |
import unittest
from datetime import datetime
import logging
import mock
from ..util import LogCapture
from ...exception import HarvestError
from ...importer import harvest
def make_item(identifier):
item = mock.Mock()
item.identifier = identifier
return item
def make_format(prefix):
format_ = mock... | |
#!/usr/bin/env python
"""
Python program that generates various statistics for one or more virtual machines
A list of virtual machines can be provided as a comma separated list.
"""
from __future__ import print_function
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vmodl, vim
from datetime i... | |
from __future__ import print_function
from six.moves import xrange
import six.moves.cPickle as pickle
import gzip
import os
import numpy
import theano
def prepare_data(seqs, labels, maxlen=None):
"""Create the matrices from the datasets.
This pad each sequence to the same lenght: the lenght of the
long... | |
"""The tests for the Sun helpers."""
# pylint: disable=protected-access
import unittest
from unittest.mock import patch
from datetime import timedelta, datetime
from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET
import homeassistant.util.dt as dt_util
import homeassistant.helpers.sun as sun
from test... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2013, Open Source Robotics Foundation, 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 mus... | |
#!/usr/bin/env python
import sys
import os
import datetime
import glob
import shutil
from pmagpy import pmag
from pmagpy import ipmag
from pmagpy import version
from pmagpy import contribution_builder as cb
from programs import thumbnails
VERBOSE = True
def error_log(msg, loc="", program="", con_id=""):
con_id = ... | |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | |
import copy
import pickle
from django.http import (QueryDict, HttpResponse, SimpleCookie, BadHeaderError,
parse_cookie)
from django.utils import unittest
class QueryDictTests(unittest.TestCase):
def test_missing_key(self):
q = QueryDict('')
self.assertRaises(KeyError, q.__getitem__, 'foo'... | |
# -*- coding: utf-8 -*-
'''Base TestCase class for OSF unittests. Uses a temporary MongoDB database.'''
import abc
import datetime as dt
import functools
import logging
import re
import unittest
import uuid
import blinker
import httpretty
import mock
import pytest
from django.test.utils import override_settings
from ... | |
from datetime import datetime as dt, date as d, time as t, timedelta as td
import pytest
from gfit2mfp.utils import DateRange
def test_create_date_range():
obj = DateRange(1, 2)
assert obj.start == 1
assert obj.end == 2
@pytest.mark.parametrize(
'start, end, other_start, other_end',
# just us... | |
#!/usr/bin/env python
# GYB: Generate Your Boilerplate (improved names welcome; at least
# this one's short). See -h output for instructions
from __future__ import print_function
import os
import re
import sys
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import textwrap
imp... | |
import re
import time
import codecs
import xml
import requests
import json
from bs4 import BeautifulSoup
from requests.models import PreparedRequest
import requests.exceptions
def checkrank(num):
def getrank(func):
def wrapper(self, cirno, username, args):
rank = cirno.userdict[username]['ran... | |
import os
from datetime import datetime, date
from django.core.files.base import File
from django.core.files.storage import default_storage
from django.conf import settings
from django.utils.encoding import force_str, force_text
from django.utils import timezone
from django.utils.translation import ugettext as _
from ... | |
"""Offer state listening automation rules."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any
import voluptuous as vol
from homeassistant import exceptions
from homeassistant.const import CONF_ATTRIBUTE, CONF_FOR, CONF_PLATFORM, MATCH_ALL
from homeassistant.cor... | |
# Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | |
# ******************************************************************************
# Cloud jukebox
# Copyright Paul Dardeau, SwampBits LLC, 2014
# BSD license -- see LICENSE file for details
#
# (1) create a directory for the jukebox (e.g., ~/jukebox)
#
# This cloud jukebox uses an abstract object storage system.
# (2) c... | |
import os.path
import shutil
import socket
import ssl
import tempfile
from test import LONG_TIMEOUT, SHORT_TIMEOUT, onlySecureTransport, withPyOpenSSL
import pytest
import trustme
import urllib3.exceptions
from dummyserver.server import DEFAULT_CA, HAS_IPV6, get_unreachable_address
from dummyserver.testcase import HT... | |
import collections
import numpy as np
from warnings import warn
from . import constants
from .html import HTMLMap
from .basemaps import Basemaps
from .kuviz import KuvizPublisher
from ..utils.utils import get_center, get_credentials
from ..utils.metrics import send_metrics
WORLD_BOUNDS = [[-180, -90], [180, 90]]
c... | |
from typing import Any, Dict, Mapping, Optional, Tuple, Text
from django.utils.translation import ugettext as _
from django.conf import settings
from django.template.defaultfilters import slugify
from django.core.files import File
from django.http import HttpRequest
from django.db.models import Sum
from jinja2 import ... | |
#! /usr/bin/env python3
import sys
import math
from mule.plotting.Plotting import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
#mule_plotting_usetex(False)
groups = ['runtime.timestepping_method... | |
from __future__ import unicode_literals
import ConfigParser as configparser
import io
import itertools
import logging
import os.path
import re
from mopidy.config import keyring
from mopidy.config.schemas import * # noqa
from mopidy.config.types import * # noqa
from mopidy.utils import path, versioning
logger = log... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
%prog mcscan.txt all.bed layout.csv
Illustrate MCscan multiple collinearity alignments. Use layout.csv to indicate
the positions of tracks. For example:
#x, y, rotation, ha, va, color, ratio
0.5, 0.6, 0, left, center, g
0.25, 0.7, 45, center, center, m
With the row ... | |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import itertools
import logging
from abc import ABC, ABCMeta
from dataclasses import dataclass
from enum import Enum
from pathlib import PurePath
from t... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
''' Polyglot API definition '''
# pylint: disable=no-name-in-module, import-error
import json
import logging
# from polyglot.element_manager import http
import http
import polyglot.nodeserver_helpers as nshelpers
_LOGGER = logging.getLogger(__name__)
CONFIG = {}
PGLOT = None
def load(pglot, user_config):
''' set... | |
# 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 except in compliance with the License. You may obtain
# a ... | |
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.lockfile}.
"""
import os, errno
from twisted.trial import unittest
from twisted.python import lockfile
from twisted.python.reflect import requireModule
from twisted.python.runtime ... | |
import json
import types
import collection as COL
import graph as GR
from document import Document
from graph import Graph
from query import AQLQuery
from theExceptions import CreationError, UpdateError
class Database(object) :
def __init__(self, connection, name) :
"meant to be called by the connection only"
... | |
"""Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# License: BSD 3 clause
fr... | |
import pickle
import time
from microservice.tests.microservice_test_case import MicroserviceTestCase
from unittest.mock import call
from microservice.core import settings, communication
from microservice.tests import microservices_for_testing
class TestAsynchronousLocalService(MicroserviceTestCase):
# Timer to... | |
from threading import Lock
import time as tm
from rospy.rostime import Duration, Time
import rospy
from python_qt_binding.QtCore import QTranslator, QObject
from helper_functions import prepare_number_for_representation, topic_statistics_state_to_string, \
ALIVE_TIMER_CALLBACK, MAXIMUM_OFFLINE_TIME, WARNING_TIME... | |
#!/usr/bin/python2.4
#
# Copyright 2009 Empeeric LTD. 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 requir... | |
from datetime import date, datetime, time
from warnings import warn
from django.db import models
from django.db.models import fields
from south.db import generic
from south.db.generic import delete_column_constraints, invalidate_table_constraints, copy_column_constraints
from south.exceptions import ConstraintDropped
... | |
"""section builder
Provides a set of functions to build a basic MPEG2-TS PSI section.
"""
CRC32 = [
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c... | |
# -*- coding: utf-8 -*-
# Copyright (C) Mesosphere, Inc. See LICENSE file for details.
import argparse
import logging
import os
import platform
import sys
import time
import uuid
import kazoo.exceptions
import kazoo.handlers.threading
from kazoo.client import KazooClient
from kazoo.client import KazooState
from ret... | |
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from drf_yasg.utils import swagger_serializer_method
from rest_framework import serializers
from rest_framework.validators import UniqueTogetherValidator
from timezone_field.rest_framework import TimeZoneSerializerField
from dc... | |
# NOTE: this file tests the new `io` library backported from Python 3.x.
# Similar tests for the builtin file object can be found in test_file2k.py.
from __future__ import print_function
import sys
import os
import unittest
from array import array
from weakref import proxy
import io
import _pyio as pyio
from test.t... | |
import subprocess
import os
### Auxiliary functions.
def run_bash_command(cmd):
str_output = subprocess.check_output(cmd, shell=True)
return str_output
def write_textfile(filepath, lines, append=False, with_newline=True):
mode = 'a' if append else 'w'
with open(filepath, mode) as f:
for lin... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import re, os, string, datetime, shutil, textwrap
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound, Http404
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse as ur... | |
# file eulfedora/server.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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 random as rd
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
plt.style.use("ggplot")
from math import *
import numpy as np
import pickle as pkl
import skimage as ski
from skimage.color import rgb2gray
from scipy import misc
from PIL import Image
import PIL.ImageOps
from sk... | |
# 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 except in compliance with the License. You may obtain
# a ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.