gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# 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...
# -*- coding: utf-8 -*- import time, re, HTMLParser import hf, lxml, logging, datetime from sqlalchemy import * from lxml import etree class dCacheMoverInfo(hf.module.ModuleBase): config_keys = { 'watch_jobs': ('Colon separated list of the jobs to watch on the pools', ''), 'pool_match_regex': ('Wat...
import random import arcade import math import numpy # Adapted from this tutorial: # http://gamedevelopment.tutsplus.com/tutorials/how-to-create-a-custom-2d-physics-engine-the-basics-and-impulse-resolution--gamedev-6331 # The tutorial has a lot of mistakes in the code, which is kind of annoying. # Don't use this typ...
# 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) 2016-2022, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
#!/usr/bin/env python # 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, software...
########################################### # VCZ calibration (coarse landscape) FLUX dance 1 ########################################### file_cfg = gc.generate_config(in_filename=input_file, out_filename=config_fn, mw_pulse_duration=20, ...
# 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...
# 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 sys import os import logging import pdb import code from time import sleep from java.io import BufferedWriter, OutputStreamWriter, FileOutputStream import anyjson import fbconsole from os import path from utils import ignore_exception, filter_dict REPL_DEBUG = True SOCKET_PATH = "/tmp/spade" CURDIR = path...
import hashlib import functools import itertools import re import uuid from contextlib import contextmanager from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.core.cache import cache, caches, _create_cache from django.utils import encoding, translation from django.conf import settings ...
import json import csv import sys import uuid if len(sys.argv) != 2: print('Usage: ./makeJson.py <state>') st = sys.argv[1] outputFile = "../docs/data/data-%s.json" % st linksFile = "../data/%s/weights-%s.csv" % (st, st) senatorsFile = "../data/%s/senator-info-%s.json" % (st, st) summaryFile = "../data/%s/summar...
""" Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS. Licensed under the Apache 2.0 License (see LICENSE file). plotting.py ~~~~~~~~~~~ Functionality to plot model data. """ import os import re import plotly.offline as pltly import jinja2 from calliope.exceptions import warn from calliope.analysis....
"""piddletest.py This module puts the various PIDDLE backends through their paces. """ from rdkit.sping import pagesizes from rdkit.sping.pid import * # The original code imported letters, a more generic lisit. This is no longer supported. from string import ascii_letters as LETTERS import math backends = ['PDF', '...
import numpy as np import tensorflow as tf from tensorflow.contrib import rnn def _print_success_message(): print('Tests Passed') def test_create_lookup_tables(create_lookup_tables): with tf.Graph().as_default(): test_text = ''' Moe_Szyslak Moe's Tavern Where the elite meet to drink ...
""" Compiler-side implementation of the Numba typed-list. """ import operator from enum import IntEnum from llvmlite import ir from numba.core.extending import ( overload, overload_method, overload_attribute, register_jitable, intrinsic, register_model, models, lower_builtin, ) from n...
# # Copyright 2015-2019 University of Southern California # Distributed under the Apache License, Version 2.0. See LICENSE for more info. # """Filesystem-backed object bulk storage for Hatrac. This module handles only low-level byte storage. Object and object-version lifecycle and authorization is handled by the cal...
import numpy as np import argparse from tqdm import tqdm import json class QualAnalysis(object): def __init__(self): self.kb_facts = self.read_kb_facts(kb_file) if use_kb else None self.text_kb_facts = self.read_text_kb_facts(text_kb_file) if use_text else None self.questions = self.read_...
from __future__ import with_statement __all__ = ['FriendlyCURL', 'threadCURLSingleton', 'url_parameters', 'CurlHTTPConnection', 'CurlHTTPSConnection', 'CurlHTTPResponse',] import contextlib import logging import os import os.path import pickle import tempfile import shutil try: import threading as _thr...
#!/usr/bin/env python3 # dividedramsey.py # Glenn G. Chappell # Date: 26 Aug 2016 # Requires Python 3. """Compute k-divided Ramsey numbers & related extremal graphs. Command-line usage: dividedramsey.py [OPTIONS] k a b Compute and print the generalized Ramsey number R*_k(a, b), along with extremal graphs, using "DO...
from Lexeme import Lexeme class Node(): Error = [] def __init__(self, lx): self.index = 0 self.lexemes = lx self.nextLexeme = self.lexemes[0] self.prevLexeme = None return def parseError(self, err): self.Error.append(err) return def lookahead(se...
import collections import sys import config import time, datetime, pigpio from datetime import timedelta import argparse import ephem # Debug statements to help diagnose issues when Python wont run this script # print(sys.executable) # import os # print(os.getcwd()) # print(sys.path) # import platform # print(platfor...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astropy is a package intended to contain core functionality and some common tools needed for performing astronomy and astrophysics research with Python. It also provides an index for other astronomy packages and tools for managing them. """ import os ...
# Copyright 2014 Mirantis 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...
#!/usr/bin/env python # 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. """ Unit tests for the contents of device_utils.py (mostly DeviceUtils). """ # pylint: disable=C0321 # pylint: disable=W0212 # pylint:...
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2009 Edgewall Software # Copyright (C) 2006 Matthew Good <matt@matt-good.net> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac...
#! /usr/bin/python import os, sys, re, ConfigParser from ldap_helper import ldap_connect, get_ldap_attribute from sh_helper import run_command, prompt_user from cgi import escape from subprocess import Popen, PIPE, STDOUT import shlex doc_root = {'hg.mozilla.org': '/repo_local/mozilla', 'hg.ecmascript.org...
"""Support for Harmony Hub devices.""" import json import logging import voluptuous as vol from homeassistant.components import remote from homeassistant.components.remote import ( ATTR_ACTIVITY, ATTR_DELAY_SECS, ATTR_DEVICE, ATTR_HOLD_SECS, ATTR_NUM_REPEATS, DEFAULT_DELAY_SECS, SUPPORT_AC...
from __future__ import absolute_import, division, print_function import socket import random import docker import docker.errors import logging import os import tempfile from ..container_manager import ( create_model_container_label, parse_model_container_label, ContainerManager, CLIPPER_DOCKER_LABEL, CLIPPER_...
# -*- 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...
#/usr/bin/python # -*- coding: utf-8 -*- """ .. currentmodule:: pylayers.antprop.radionode .. autosummary:: :members: """ from __future__ import print_function import doctest import os import glob import os import sys import doctest import numpy as np if sys.version_info.major==2: import ConfigParser as cp ...
# coding=utf-8 """ hangman.view ~~~~~~~~~~~~ View layer, printing and prompting. """ from __future__ import absolute_import import click from ._compat import zip from .utils import FlashMessage, GameOverNotificationComplete # DRAW COMPONENT BLOCK # ------------------------------------------------------------------...
# -*- coding:utf-8 -*- from __future__ import ( absolute_import, division, print_function, unicode_literals ) import pytest from django.db import connection from django.db.models import F from django.test import TestCase from django_mysql.models.handler import Handler from django_mysql.utils import index_name fro...
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Ri...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2019 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Admin model views for PersistentIdentifier.""" import uuid from flask import curr...
#!/usr/bin/env python # external from sympy import sin, cos, symbols from sympy.physics.mechanics import (dynamicsymbols, ReferenceFrame, Point, RigidBody, Particle, inertia) from numpy import radians from numpy.testing import assert_allclose # local from ..shapes import Cylinder ...
# 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 ...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import ast import it...
# -*- coding: utf-8 -*- # Copyright 2011 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 require...
#!/usr/bin/env python2 import sys import requests import argparse import os.path from datetime import datetime import xml.etree.ElementTree as et from xml.dom import minidom import random if ( len( sys.argv ) < 2 ): print "\nMissing parameters. Run \"%s -h\" for help.\n" %(sys.argv[0]); exit(); parser = argp...
"""Support to select an option from a list.""" import logging import typing import voluptuous as vol from homeassistant.const import ( ATTR_EDITABLE, CONF_ICON, CONF_ID, CONF_NAME, SERVICE_RELOAD, ) from homeassistant.core import callback from homeassistant.helpers import collection import homeass...
#!/usr/bin/env python # Copyright 2008-2015 Nokia Solutions and Networks # # 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...
# # 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 (c) 2015 Hewlett-Packard Development Company, L.P. # # 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 # 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...
''' Copyright 2015 University of Auckland 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 agre...
# # Copyright (c) SAS Institute 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 w...
import logging from functools import wraps from io import FileIO from os import path from urlparse import parse_qs, urlparse from iso8601 import parse_date from munch import munchify from restkit import BasicAuth, Resource, request from restkit.errors import ResourceNotFound from retrying import retry from simplej...
# Copyright 2012 Cloudera 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, so...
#!/usr/bin/env python ''' NAME latex2png - Converts LaTeX source to PNG file SYNOPSIS latex2png [options] INFILE DESCRIPTION This filter reads LaTeX source text from the input file INFILE (or stdin if INFILE is -) and renders it to PNG image file. Typically used to render math equations. Requ...
# Copyright 2012 Nebula, 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 ...
# Python Tools for Visual Studio # Copyright(c) Microsoft Corporation # 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 # # THI...
from glob import glob import json import pandas import requests import numpy import pickle import os import re home = os.environ["HOME"] base = "%s/data/pubmed" %os.environ["LAB"] outfolder = "%s/methods" %(base) repo_folder = "%s/repos" %(base) scripts = "%s/SCRIPT/python/repofish/analysis/methods" %(home) if not os...
from unittest.mock import Mock from io import BytesIO import tarfile import os from tests.base_case import ChatBotTestCase from chatterbot.trainers import UbuntuCorpusTrainer class UbuntuCorpusTrainerTestCase(ChatBotTestCase): """ Test the Ubuntu Corpus trainer class. """ def setUp(self): sup...
"""Compatible Relaxation""" __docformat__ = "restructuredtext en" import numpy import scipy from scipy.linalg import norm from scipy.sparse import isspmatrix, csr_matrix, spdiags from pyamg.relaxation import gauss_seidel __all__ = ['CR','binormalize'] def CR(S, method='habituated',maxiter=20): """Use Compatibl...
from __future__ import unicode_literals import os import sys import json import time import click import errno import shutil import select import tarfile import zipfile import hashlib import tempfile import sysconfig import subprocess from io import open from contextlib import contextmanager WIN = sys.platform.starts...
# 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 ...
# -*- coding: utf-8 -*- # # Unit tests for string functions from tdda.referencetest.checkfiles # from __future__ import absolute_import from __future__ import unicode_literals from __future__ import division import unittest from tdda.referencetest.checkfiles import FilesComparison class TestInternals(unittest.Tes...
""" """ import unittest from freezegun import freeze_time import json import datetime from flask import Flask from flask.ext.restful import fields from flask.ext.restful import marshal from flask.ext.restful.fields import MarshallingException from acmapi.fields import Date from acmapi.fields import root_fields from...
# 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/python import os, sys, inspect, subprocess, tempfile # Include the parent directory in the search path. cmd_folder = os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0]) if cmd_folder not in sys.path: sys.path.insert(0, cmd_folder) from common import dbConn, DEFAULT_TAG, BACKUP...
from itertools import chain from ModestMaps.Core import Coordinate import math import pyproj merc_proj = pyproj.Proj(init='epsg:3857') latlng_proj = pyproj.Proj(proj='latlong') def serialize_coord(coord): return '%d/%d/%d' % (coord.zoom, coord.column, coord.row) def deserialize_coord(coord_string): fields...
from __future__ import absolute_import try: from itertools import zip_longest as izip_longest, repeat # pylint: disable=E0611 except ImportError: from itertools import izip_longest as izip_longest, repeat # pylint: disable=E0611 import logging import sys import time import six from six.moves import queue f...
from __future__ import division from datetime import datetime, date import json import time from flask import request from sqlalchemy.ext.mutable import Mutable from sqlalchemy.ext.compiler import compiles from sqlalchemy import types, desc from sqlalchemy.orm import backref from sqlalchemy import event, DDL from dat...
#!/usr/bin/env python3 """This script is used to create the experimental data look up tables for the atom class. In order to run this script simply needs to know where you want the generated files to live. usage: python3 generate_atomicinfo.py <output_directory> """ #Knobs that you may want to tweak pm2bohr = ...
# Copyright (c) 2007-8, Playful Invention Company. # Copyright (c) 2008-11, Walter Bender # Copyright (c) 2011 Collabora Ltd. <http://www.collabora.co.uk/> # 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...
""" This module provides functionality for tracking bridge stability metrics, using the model introduced in [1] and implemented in [2]. [1] Karsten Loesing, An Analysis of Tor Bridge Stability. Technical Report. The Tor Project, October 2011. https://metrics.torproject.org/papers/bridge-stability-2011-10-31.pdf [2] h...
from bika.lims.content.analysis import Analysis from bika.lims.testing import BIKA_FUNCTIONAL_TESTING from bika.lims.tests.base import BikaFunctionalTestCase from bika.lims.utils.analysisrequest import create_analysisrequest from bika.lims.workflow import doActionFor from plone.app.testing import login, logout from plo...
# # This file is part of Gruvi. Gruvi is free software available under the # terms of the MIT license. See the file "LICENSE" that was provided # together with this source file for the licensing terms. # # Copyright (c) 2012-2017 the Gruvi authors. See the file "AUTHORS" for a # complete list. from __future__ import a...
# Copyright 2022. ThingsBoard # # 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 ...
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import ( assertGreaterEqual, expect_warnings, get_params, gettestcases, expe...
# Copyright 2013 IBM Corp. # # 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...
#!/usr/bin/env python3 # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import functools import logging import multiprocessing import optparse import os import re import shutil import sys import time impo...
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 (a...
# 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 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 unittest import time from requests.exceptions import RequestException from testcases import WebserverTestCase from locust.stats import RequestStats, StatsEntry, global_stats from locust.core import HttpLocust, Locust, TaskSet, task from locust.inspectlocust import get_task_ratio_dict from locust.rpc.protocol i...
from gi.repository import Gtk, Gdk, GLib import cairo import math import shm import user_config as conf import pickle from shm import navigation_desires from var_util import SmoothVar from misc.log import with_logging MAX_ZOOM = 8 MIN_ZOOM = 0.3 REFRESH = 1./25 #effectively sets the draw framerate @with_logging cla...
# Copyright 2020 The TensorFlow Probability 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 o...
#! /usr/bin/env python import os import sys sadm_path = os.path.join( os.environ['HOME'], 'sadm' ) sys.path.append( sadm_path ) sys.path.append( os.path.join( sadm_path, 'lib' ) ) sys.path.append( os.path.join( sadm_path, 'buildscripts' ) ) import ircbot import irclib import command import sadm_config import buildi...
# Copyright 2014 eBay Inc. # # Author: Ron Rickard <rrickard@ebaysf.com> # # 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 require...
"""HTML5 Push Messaging notification service.""" from datetime import datetime, timedelta from functools import partial import json import logging import time from urllib.parse import urlparse import uuid from aiohttp.hdrs import AUTHORIZATION import jwt from py_vapid import Vapid from pywebpush import WebPusher impor...
import logging import numpy as np # type: ignore from numpy import insert, dot # type: ignore from numpy.linalg import inv # type: ignore from typing import List, Tuple, Union from opentrons.calibration_storage.types import AttitudeMatrix from opentrons.config import feature_flags as ff mod_log = logging.getLogger...
# Copyright 2010 OpenStack LLC. # 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 (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
# Copyright (c) 2015-2017 Cisco Systems, Inc. # # 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, modify, merge...
# Copyright (C) 2015 Junzi Sun (TU Delft) # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distribute...
#!/usr/bin/env python import eventlet import errno import imp import logging import os import os.path import sys from daemon.daemon import DaemonContext from daemon.runner import DaemonRunner, make_pidlockfile from django.conf import settings as django_settings from django.core.management import call_command from even...
""" Test the pipeline module. """ from tempfile import mkdtemp import shutil import time import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regex from sklearn.utils.testing import asse...
from functools import partial from itertools import chain import pytest import numpy as np from sklearn.metrics.cluster import adjusted_mutual_info_score from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import rand_score from sklearn.metrics.cluster import completeness_score from s...
#!/usr/bin/env python # -*- coding: utf-8 -*- # acertmgr - acme api v2 functions (implements RFC8555) # Copyright (c) Rudolf Mayerhofer, 2019. # available under the ISC license, see LICENSE import copy import json import re import time from acertmgr import tools from acertmgr.authority.acme import ACMEAuthority as A...
# -*- test-case-name: twisted.test.test_pcp -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Producer-Consumer Proxy. """ from zope.interface import implements from twisted.internet import interfaces class BasicProducerConsumerProxy: """ I can act as a man in the mi...
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Copyright 2021 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://w...
# # 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...
import re from PySide import QtGui from datetime import datetime def lataaTied(tiednimi): f = open(tiednimi, 'r') html_doc=f.read() f.close() return html_doc def tallennaTied(tiednimi,sisalto): print "tallennus" f = open(tiednimi, 'a') f.write(sisalto.encode("utf-8")) f.close() cl...
#!/usr/bin/env python # Copyright 2016 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...
import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities import google.cloud.proto.spanner.admin.instance.v1.spanner_instance_admin_pb2 as google_dot_cloud_dot_proto_dot_spanner_dot_admin_dot_instance_dot_v1_dot_spanner__instance__admin__pb2 impor...
""" Copyright (c) 2016-2018 Ad Schellevis <ad@opnsense.org> 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, ...
#!/usr/bin/python #-*-coding:utf-8-*- #By Giggle Liu from numpy import * from lattice import Lattice from bzone import BZone from group import C6vGroup,C4vGroup,C3vGroup __all__=['Honeycomb_Lattice','Square_Lattice','Triangular_Lattice','Chain','construct_lattice','resize_lattice'] class Honeycomb_Lattice(Lattice): ...
from django.core.urlresolvers import reverse from django.forms.models import modelformset_factory from django.shortcuts import get_object_or_404 from django.http import HttpResponseRedirect, HttpResponse from django.views.generic import simple from django.views.generic import list_detail, simple from django.views.gener...