gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import glob import gzip import os import sqlite3 import traceback from opensextant.utility import ensure_dirs CATALOGS = {"googlebooks": "G"} def _ignoreable(text, mn, mx): if len(text) < mn or len(text) > mx: # print("Ignore short or long") return True if text[-1].isdigit(): # Igno...
"""Config flow to configure Xiaomi Aqara.""" import logging from socket import gaierror import voluptuous as vol from xiaomi_gateway import MULTICAST_PORT, XiaomiGateway, XiaomiGatewayDiscovery from homeassistant import config_entries from homeassistant.components import zeroconf from homeassistant.const import CONF_...
# -*- coding: utf-8 -*- # Copyright 2015 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 requir...
# This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, and by any # means. # # In jurisdictions that rec...
# # The Python Imaging Library. # $Id$ # # SGI image file handling # # See "The SGI Image File Format (Draft version 0.97)", Paul Haeberli. # <ftp://ftp.sgi.com/graphics/SGIIMAGESPEC> # # # History: # 2017-22-07 mb Add RLE decompression # 2016-16-10 mb Add save method without compression # 1995-09-10 fl Created #...
import datetime import urllib from django.forms import widgets from django.forms.utils import flatatt from django import forms from django.utils.encoding import force_unicode, python_2_unicode_compatible, force_text from django.utils.safestring import mark_safe from django.utils.html import conditional_escape, html_sa...
"""(disabled by default) support for testing pytest and pytest plugins.""" import gc import importlib import os import platform import re import subprocess import sys import time import traceback from collections.abc import Sequence from fnmatch import fnmatch from weakref import WeakKeyDictionary import py import py...
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# 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. """Provides a variety of device interactions based on adb. Eventually, this will be based on adb_wrapper. """ # pylint: disable=W0613 import logging import...
""" Selectors for the Posix event loop. """ from __future__ import unicode_literals, absolute_import import sys import abc import errno import select import six __all__ = [ 'AutoSelector', 'PollSelector', 'SelectSelector', 'Selector', 'fd_to_int', ] def fd_to_int(fd): assert isinstance(fd, in...
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from textwrap import dedent import pytest from pants.backend.go.util_rules import ( assembly, build_pkg, first_party_pkg, go_mod, i...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # pylint: disable=invalid-name from math import cos, sin import pytest import numpy as np from numpy.testing import assert_allclose import astropy.units as u from astropy.tests.helper import assert_quantity_allclose from astropy.modeling import models ...
# 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...
# Copyright (c) 2018,2019 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Tools and calculations for interpolating specifically to a grid.""" import numpy as np from .points import (interpolate_to_points, inverse_distance_to_points, ...
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
"""Test APRS device tracker.""" from unittest.mock import Mock, patch import aprslib import homeassistant.components.aprs.device_tracker as device_tracker from homeassistant.const import EVENT_HOMEASSISTANT_START from tests.common import get_test_home_assistant DEFAULT_PORT = 14580 TEST_CALLSIGN = "testcall" TEST_...
from sympy.core import pi, oo, symbols, Function, Rational, Integer, GoldenRatio, EulerGamma, Catalan, Lambda, Dummy from sympy.functions import Piecewise, sin, cos, Abs, exp, ceiling, sqrt from sympy.utilities.pytest import raises from sympy.printing.jscode import JavascriptCodePrinter from sympy.utilities.lambdify im...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
from __future__ import division, print_function, absolute_import import os import sys import functools from textwrap import TextWrapper from collections import defaultdict from plumbum.lib import six, getdoc from plumbum.cli.terminal import get_terminal_size from plumbum.cli.switches import (SwitchError, UnknownSwitch...
#!/usr/bin/env python import argparse import atexit import copy import os import shutil import subprocess import sys import tempfile import warnings import django from django.apps import apps from django.conf import settings from django.db import connection, connections from django.test import TestCase, TransactionTes...
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
"""The Hyperion component.""" from __future__ import annotations import asyncio from contextlib import suppress import logging from typing import Any, Callable, cast from awesomeversion import AwesomeVersion from hyperion import client, const as hyperion_const from homeassistant.components.light import DOMAIN as LIG...
# Copyright 2010 Google 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, publish, dis- # trib...
import os import unicodedata from defcon import Font, UnicodeData, Component from defcon.tools import unicodeTools # Tool that walks a directory of UFOs and makes them componted again. This is very strict, things have to match 100%, # but it does get you some of the way done for recomponenting a font. # It relies on ...
import sys, time, os, array, optparse usage = "usage: %prog [options] BSMAP_MAPPING_FILES" parser = optparse.OptionParser(usage=usage) parser.add_option("-o", "--out", dest="outfile", metavar="FILE", help="output file name. (required)", default="") parser.add_option("-d", "--ref", dest="reffile", metavar="FILE", help=...
class Scope(object): def __init__(self, name=None, parent=None): self.name = name self.parent = parent self.types = {} def find(self, name): if name in self.types: return self.types[name] if self.parent is not None: return self.parent.find(name) ...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Tests that verify MMDS related functionality.""" import json import random import string import time import pytest from framework.artifacts import DEFAULT_DEV_NAME, NetIfaceConfig from framework.builder i...
# -*- coding: utf-8 -*- from __future__ import with_statement import shutil from os.path import join from cms.utils.conf import get_cms_setting from djangocms_text_ckeditor.models import Text from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.files.uploadedfile...
""" Created on Thu Oct 5 16:44:23 2017 @author: Christian Bender This Python library contains some useful functions to deal with prime numbers and whole numbers. Overview: isPrime(number) sieveEr(N) getPrimeNumbers(N) primeFactorization(number) greatestPrimeFactor(number) smallestPrimeFactor(number) getPrime(n) ge...
# # Copyright 2012, Couchbase, 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 l...
""" Drop-in replacement for ``django.conf.settings`` that provides a consistent access method for settings defined in applications, the project or Django itself. Settings can also be made editable via the admin. """ from __future__ import unicode_literals from future.builtins import bytes, str from functools import p...
from basic import Basic from sympify import _sympify from cache import cacheit from symbol import Symbol, Wild from sympy import mpmath from math import log as _log def integer_nthroot(y, n): """ Return a tuple containing x = floor(y**(1/n)) and a boolean indicating whether the result is exact (that is, ...
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework 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 ...
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: - address family: - AF_INET: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> - socket type: - SOCK_S...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
import os import re import shutil import sys from vee import log from vee.cli import style, style_note, style_warning from vee.envvars import join_env_path from vee.package import Package from vee.pipeline.generic import GenericBuilder from vee.subproc import call from vee.utils import find_in_tree python_version = ...
# Copyright 2013 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 by applicable law or agre...
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps based on Fourier transforms and Count Sketches. """ # Author: Andreas Mueller <[email protected]> # Daniel Lopez-Sanchez (TensorSketch) <[email protected]> # License: BSD 3 clause import warnings import n...
"""Support to interact with a Music Player Daemon.""" from datetime import timedelta import logging import os import voluptuous as vol from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, MEDIA_TYPE_PLA...
# pylint: disable=protected-access, unused-argument # pylint: disable=no-value-for-parameter from unittest import TestCase import radical.entk.exceptions as ree import radical.entk from radical.entk.execman.rp.task_processor import resolve_placeholders from radical.entk.execman.rp.task_processor import resolve_argu...
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
# coding: utf-8 # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
# # 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...
# Copyright 2014 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 agreed t...
import os import re import shutil import pytest from click.testing import CliRunner from freezegun import freeze_time from great_expectations import DataContext from great_expectations.cli.v012 import cli from great_expectations.data_context.util import file_relative_path from great_expectations.util import gen_direc...
# # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # # 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 a...
import csv import matplotlib.pyplot as plt import numpy as np from src.algorithms.slp import haversine, median from src.utils.geo import GeoCoord class EstimatorCurve: ''' The EstimatorCurve class is used to assess the confidence of a predicted location for SLP. Attributes: w_stdev (numpy arr): A...
import mock from oslo.config import cfg import testtools import webtest from neutron.api import extensions from neutron.api.v2 import attributes from neutron.common import config from neutron.common import exceptions from neutron import context from neutron.db import api as db from neutron.db import quota_db from neut...
from django import template from django.template.loader import render_to_string from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.utils.encoding import smart_text import comments register = template.Library() class BaseCommentNode(template.Node): """ Bas...
# # 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...
# ___ __ ___ _ _ ___ # || \/ | ||=|| \\// ||=|| # || | || || // || || # Ignore warnings for yaml usage. import warnings import ruamel.yaml warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning) import email.utils import time from datetime import datetime as Datetime import pytz import hum...
""" This module contains the functions that create most of data files for a particular region of New Zealand. It assumes that you have the created the following files for a region <region> already:: |- data/ |- processed/ |- rents.csv |- rental_areas.geojson |- rental_ar...
# -*- coding: utf-8 -*- """ pygments.lexers._sourcemodbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names of SourceMod functions. It is able to re-generate itself. Do not edit the FUNCTIONS list by hand. :copyright: Copyright 2006-2011 by the Pygments team, see AUTHORS. :li...
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2009, Jean-Michel Sizun # Copyright 2009 Frank Scholz <[email protected]> import os.path import time from twisted.internet import threads from twisted.web import server, static from twisted.web.error import PageRedirec...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Simon Dodsley ([email protected]) # 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',...
# -*- coding: utf-8 -*- # BSD 3-Clause License # # Copyright (c) 2017, ColoredInsaneAsylums # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the ab...
from pandac.PandaModules import * from toontown.toonbase.ToonBaseGlobal import * from DistributedMinigame import * from direct.interval.IntervalGlobal import * from direct.fsm import ClassicFSM, State from direct.fsm import State from toontown.safezone import Walk from toontown.toonbase import ToontownTimer from direct...
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ import base64 import binascii import cgi import collections import html from urllib.parse import unquote from django.conf import settings from django.core.ex...
''' The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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, ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ ################################################################################ # # Copyright (c) 2016 Wojciech Migda # All rights reserved # Distributed under the terms of the MIT license # ##############################################################################...
import numpy from gtfspy.routing.label import LabelTimeWithBoardingsCount, merge_pareto_frontiers, compute_pareto_front, \ LabelVehLegCount, LabelTime, LabelTimeBoardingsAndRoute, LabelTimeAndRoute from gtfspy.routing.connection import Connection class NodeProfileMultiObjective: """ In the multi-objectiv...
# Copyright 2015 - StackStorm, 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 ...
import atexit from contextlib import contextmanager from selenium.common.exceptions import ( NoAlertPresentException, NoSuchWindowException, TimeoutException, UnexpectedAlertPresentException, WebDriverException) from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from sele...
import unittest from datetime import date, datetime, time, timedelta from decimal import Decimal from operator import attrgetter, itemgetter from uuid import UUID from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( BinaryField, BooleanField, Case, Count, De...
""" Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.1.2-pre.0 Contact: [email protected] Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from swaggyjenkins.m...
# 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) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
# 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This script is for downloading and maintaining a local copy of all of the XML files of PLOS articles. By default it doesn't rely on access to the PLOS's internal network (but can use it if available). Diagram of relevant systems here: https://confluence.plos.org/confl...
#!/usr/bin/env python # (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP """ Detect running daemons then configure and start the agent. """ import argparse from glob import glob import json import logging import os import pwd import socket import subprocess import sys import agent_config import mona...
import enum from graphql.language import ast from graphql.language.parser import parse from ..query import Node, Field, Link, merge class NodeVisitor: def visit(self, obj): visit_method = getattr(self, 'visit_{}'.format(obj.kind)) if visit_method is None: raise NotImplementedError('...
"""Hierarchical Agglomerative Clustering These routines perform some hierarchical agglomerative clustering of some input data. Authors : Vincent Michel, Bertrand Thirion, Alexandre Gramfort, Gael Varoquaux License: BSD 3 clause """ from heapq import heapify, heappop, heappush, heappushpop import warnings i...
"""Dictionary Of Keys based matrix""" from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['dok_matrix', 'isspmatrix_dok'] import functools import operator import numpy as np from scipy._lib.six import zip as izip, xrange from scipy._lib.six import iter...
# Copyright (c) 2014-present PlatformIO <[email protected]> # # 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...
from etk.timeseries.annotation.utility import date_cell, text_cell, empty_cell, blank_cell, number_cell, row_key, column_key, column_orientation import logging class rectangular_block: def __init__(self): self.upper_row = 0 self.lower_row = 0 self.left_col = 0 self.right_col = 0 ...
#!/usr/bin/env python3 # Copyright (c) 2020 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Compact, self-contained ELF implementation for bitcoin-core security checks. ''' import struct import types fr...
import psycopg2 import psycopg2.extras #import DB.classification.Analysis_3 as A import DB.classification.detect_events as D import DB.classification.RandomForestModel as RMF import DB.classification.models as BC # Database user credentials DATABASE = "seads" USER = "seadapi" TABLE = "data_raw" def query(parsed_ur...
# -*- coding: utf-8 -*- import itsdangerous import mock import pytest import unittest from future.moves.urllib.parse import urlparse, parse_qs from uuid import UUID from api.base.settings.defaults import API_BASE from framework.auth.cas import CasResponse from osf.models import OSFUser, Session, ApiOAuth2PersonalToken...
from django.contrib.auth.models import User, Group, Permission from django.contrib.contenttypes.models import ContentType from django.db.models.query import QuerySet from django.test import TestCase from guardian.shortcuts import get_perms_for_model from guardian.core import ObjectPermissionChecker from guardian.short...
import gen import os import sys import string from string import Template from gen import Gen from nysa.ibuilder.lib import utils from nysa.ibuilder.lib import verilog_utils as vutils class GenMemInterconnect(Gen): def __init__(self): return def gen_script (self, tags = {}, buf = "", user_paths = [], debug=...
"""Support for Radarr.""" import logging import time from datetime import datetime, timedelta import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import ( CONF_API_KEY, CONF_HOST, CONF_PORT, CONF_MONITORED_CONDITIONS, CONF_SSL, ) f...
import logging from django.conf import settings from django.core.exceptions import PermissionDenied from django.utils import timezone from wagtail.core.log_actions import log from wagtail.core.signals import page_published logger = logging.getLogger("wagtail.core") class PublishPagePermissionError(PermissionDenie...
#!/usr/bin/env python # # test_multibytecodec.py # Unit test for multibytecodec itself # from test import support from test import test_multibytecodec_support from test.support import TESTFN import unittest, io, codecs, sys, os import _multibytecodec ALL_CJKENCODINGS = [ # _codecs_cn 'gb2312', 'gbk', 'gb18030',...
import linalg import numpy from itertools import chain import warnings from scipy.optimize import leastsq from math import degrees def find_plane_of_ring(centered_ring_coords): ''' Returns the normal to the plane of best fit of a ring system Accepts: A numpy array of the coordinates of the atoms i...
import os import numpy as np from ..utils.importing import import_module_from_source class ImageClassifier(object): """ ImageClassifier workflow. This workflow is used to train image classification tasks, typically when the dataset cannot be stored in memory. Submissions need to contain two fil...
import itertools try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict from wtforms.compat import with_metaclass, iteritems, itervalues from wtforms.meta import DefaultMeta __all__ = ( 'BaseForm', 'Form', ) class BaseForm(object): """ Base Form Clas...
from nose.tools import eq_, ok_ from nose.plugins.skip import SkipTest # Skip test on PY3 from flask.ext.admin._compat import PY2, as_unicode if not PY2: raise SkipTest('Peewee is not Python 3 compatible') import peewee from wtforms import fields from flask.ext.admin import form from flask.ext.admin._compat imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/server/server.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, th...
""" This is an auxiliary script that is used to compute valid PLL values to set the CPU frequency to a given value. The algorithm here appears as C code for the machine.freq() function. """ from __future__ import print_function import re class MCU: def __init__( self, range_sysclk, range_m, range_n, ran...
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from datetime import datetime from uuid import UUID from sentry.coreapi import ( APIError, APIUnauthorized, Auth, ClientApiHelper, InvalidFingerprint, InvalidTimestamp, get_interface ) from sentry.testutils import TestCase class Ba...
from __future__ import print_function import math import numpy as np from scipy import linalg, stats from .linalg_decomp_1 import tiny2zero #univariate standard normal distribution #following from scipy.stats.distributions with adjustments sqrt2pi = math.sqrt(2 * np.pi) logsqrt2pi = math.log(sqrt2pi) class StandardN...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import re from oauthlib.oauth2 import MissingCodeError try: from urllib.parse import quote_plus, parse_qsl except ImportError: from urllib import quote_plus from urlparse import parse_qsl import pytest import mock ...
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <[email protected]> # This program is published under a GPLv2 license from __future__ import print_function import os import subprocess import time import scapy.modules.six as six from threading i...
# -*- coding: utf8 -*- import re import os import socket import time try: import ujson as json except ImportError: import json import datetime try: import ConfigParser except ImportError: import configparser as ConfigParser import shutil import subprocess import tempfile import codecs import signal impo...
from itertools import groupby from functools import cmp_to_key from operator import itemgetter import time import hashlib import uuid from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.urlresolvers import reverse from django.db import models from django.dispat...
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS 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 constants import getpass import json import os import shutil import sys import tempfile import time if __name__ == '__main_...
"""ClusterMsgs module: Message types for Cluster rendering""" # This module is intended to supply routines and dataformats common to # both ClusterClient and ClusterServer. from pandac.PandaModules import * from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import PyDatagr...
# coding: utf-8 # # Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103 from ....external.qt.QtGui import QMainWindow from ....external.qt.QtTest import QTest from ....external.qt.QtCore import Qt from ....external.qt.QtGui import QItemSelectionModel from mock import MagicMock, patch import pytest from ..layer_tree_widget import (Laye...