gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from six.moves import range import json, subprocess, os from semantic_version import Version import frappe from frappe.utils import cstr import requests from frappe import _ impor...
""" Module for the management of upstart systems. The Upstart system only supports service starting, stopping and restarting. .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.start' is...
from StringIO import StringIO from urlparse import urlparse, parse_qs from urllib2 import URLError from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase as DjangoTestCase from django.utils import simplejson import moc...
# -*- coding: utf-8 -*- """ pygments.lexers.data ~~~~~~~~~~~~~~~~~~~~ Lexers for data file format. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, ExtendedRegexLexer, LexerContext, \ ...
# Copyright 2012 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 or agreed to in...
from mapbox_vector_tile.Mapbox.vector_tile_pb2 import tile from collections import namedtuple class StringTableOptimiser(object): """ Optimises the order of keys and values in the MVT layer string table. Counts the number of times an entry in the MVT string table (both keys and values) is used. Then ...
# -*- coding: utf-8 -*- ''' IPS pkg support for Solaris .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-override>`. This ...
# -*- coding: utf-8 -*- """ Code for interfacing with the Exoplanet Archive catalogs. """ from __future__ import division, print_function import os import logging from pkg_resources import resource_filename import pandas as pd from six.moves import urllib from .settings import PEERLESS_DATA_DIR __all__ = [ "...
# Copyright (c) 2009-2010, Cloud Matrix Pty. Ltd. # All rights reserved; available under the terms of the BSD License. """ Esky - keep frozen apps fresh ============================== Esky is an auto-update framework for frozen Python applications. It provides a simple API through which apps can find, fetch and i...
""" tmdb.py --- Jen Plugin for accessing tmdb data Copyright (C) 2017, Midraal 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 opt...
""" Imports the SpatialRefSys and GeometryColumns models dependent on the spatial database backend. """ import re from django.conf import settings # Checking for the presence of GDAL (needed for the SpatialReference object) from django.contrib.gis.gdal import HAS_GDAL, PYTHON23 if HAS_GDAL: from django.contrib.g...
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 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 # # ...
from django.core.mail import EmailMessage from django.core.cache import cache from django.template.loader import render_to_string from django.conf import settings from django.contrib.admin.models import LogEntry, CHANGE, ADDITION from django.contrib.contenttypes.models import ContentType from sponsors.models import Sp...
import unittest import numpy as np import pysal #from pysal.spreg.twosls_sp import BaseGM_Lag, GM_Lag import pysal.spreg.diagnostics as D from scipy import sparse as SP from functools import partial from pysal.contrib.handler import Model GM_Lag = partial(Model, mtype='GM_Lag') BaseGM_Lag = partial(Model, mtype='Base...
import mutagen import collections import uuid from .format import Vorbis, AAC, ID3 from . import Exceptions, Tag from . import Utilities from audio_pipeline import Constants class BaseAudioFile: audiofile_type = "BaseAudioFile" renameable_tags = {"item_code": "ITEMCODE", "barcode": "...
""" OpenstackDriver for Network based on BaseDriver """ from keystoneauth1.identity import v3 from keystoneauth1 import session from neutronclient.v2_0 import client from calplus.v1.network.drivers.base import BaseDriver, BaseQuota PROVIDER = "OPENSTACK" class OpenstackDriver(BaseDriver): """docstring f...
#!/usr/bin/env python # # Use the raw transactions API to spend icoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a icoind or iCoin-Q...
# ./smdx_gen.py # -*- coding: utf-8 -*- # PyXB bindings for NM:e92452c8d3e28a9e27abfc9994d2007779e7f4c9 # Generated 2013-10-27 00:48:37.033045 by PyXB version 1.2.3 # Namespace AbsentNamespace0 import pyxb import pyxb.binding import pyxb.binding.saxer import io import pyxb.utils.utility import pyxb.utils.domutils impo...
#: -*- encoding: utf-8 -*- from kivy.lang import Builder from kivy.metrics import sp from kivy.uix.widget import Widget from kivy.uix.boxlayout import BoxLayout from kivy.properties import (NumericProperty, AliasProperty, OptionProperty, ReferenceListProperty, BoundedNumericProperty, ListPr...
# -*- coding: utf-8 -*- # # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
"""Copyright 2009 Chris Davis 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 dist...
import sublime import sublime_plugin from .edit import Edit from .view import ViewMeta from .vim import Vim, VISUAL_MODES class ActualVim(ViewMeta): def __init__(self, view): super().__init__(view) if view.settings().get('actual_proxy'): return view.settings().set('actual_int...
#!/usr/bin/env python # Copyright 2013 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice...
"""Tests for the Config Entry Flow helper.""" import pytest from homeassistant import config_entries, data_entry_flow, setup from homeassistant.config import async_process_ha_core_config from homeassistant.helpers import config_entry_flow from tests.async_mock import Mock, patch from tests.common import ( MockCon...
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
import numpy as np import cv2 from autumn_utils.image_util import * def read_transformation_matrices (file_dir): in_file = open (file_dir, 'r') matrix_sequences = [] texture_sequences = [] matrix = [] for line in in_file: # Skip blank lines if len (line) < 4: ...
from datetime import datetime import json import os import time import endpoints from protorpc import messages, message_types, remote from google.appengine.api import urlfetch, memcache, taskqueue from google.appengine.ext import ndb from models import * from settings import WEB_CLIENT_ID from utils import getUserId ...
# 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/python2.4 # # Copyright (C) 2006 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
import unittest import datetime import decimal import Spartacus.Database class TestPostgreSQL96(unittest.TestCase): @classmethod def setUpClass(cls): cls.v_database = Spartacus.Database.PostgreSQL( "127.0.0.1", 5496, "spartacus", "spartacus", "spartacus" ) cls.v_database.Op...
#!/usr/bin/env python # coding=utf-8 ############################################################################### import os import sys import inspect import traceback import optparse import logging import configobj try: # python 2.6 import unittest2 as unittest except ImportError: import unittest try:...
# Copyright 2020 Google Research. 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...
import warnings from string import lowercase, uppercase import sympy import numpy as np from scipy.linalg import svdvals from aliased import aliased_function, _add_aliases_to_namespace, vectorize class Term(sympy.Symbol): """ A Term is a sympy.Symbol that is meant to represent a term in a regression mode...
# 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 # d...
# Copyright 2022 Google 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 by applicable law o...
from __future__ import absolute_import, unicode_literals from django.core.exceptions import ValidationError from django.forms import Form from django.forms.fields import IntegerField, BooleanField from django.forms.util import ErrorList from django.forms.widgets import Media, HiddenInput from django.utils.encoding imp...
#!/usr/bin/env python """ base actions of character/mob """ from basinboa import status from basinboa.message.broadcast import message_to_room, player_message_to_room from basinboa.command.cmds.inspect_cmds import look from basinboa.mobile.bag import Bag from basinboa.mobile.equipment import Equipment from basinboa.uni...
# BSD 3-Clause License # # Copyright (c) 2016-21, University of Liverpool # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notic...
# -*- coding: utf-8 -*- # Copyright 2013 Red Hat, 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 ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import unittest import os from pymatgen import Molecule from pymatgen.io.gaussian import GaussianInput, GaussianOutput from pymatgen.electronic_structure.core import Spin """ Created on Apr 17, 2012 """ __au...
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
"""' Various transformations for flow cytometry data. The forward transformations all refer to transforming the raw data off the machine (i.e. a log transformation is the forword and an exponential is its inverse). References: Bagwell. Cytometry Part A, 2005. Parks, Roederer, and Moore. Cytometry Part A, 2006. Trotter...
""" This file contains view functions for Flask-User forms. :copyright: (c) 2013 by Ling Thio :author: Ling Thio (ling.thio@gmail.com) :license: Simplified BSD License, see LICENSE.txt for more details.""" from datetime import datetime from flask import current_app, flash, redirect, render_template, reque...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base import serialize from twilio.base.exceptions import TwilioException from twilio.http.response import Response...
import sys try: from collections.abc import Mapping, MutableMapping except ImportError: from collections import Mapping, MutableMapping PY3 = sys.version_info >= (3, 0) class HTTPHeaderDict(MutableMapping): """ :param headers: An iterable of field-value pairs. Must not contain multiple field ...
# Copyright 2016 Capital One Services, 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 agreed to in...
#!/usr/bin/python2.7 # Copyright 2010 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 requi...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ nodeenv ~~~~~~~ Node.js virtual environment :copyright: (c) 2014 by Eugene Kalinin :license: BSD, see LICENSE for more details. """ import contextlib import io import sys import os import re import stat import logging import operator import optpar...
#!/usr/bin/python # 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 # "Licens...
#!/usr/local/bin/python # -*- coding: utf-8 -*- """ - LICENCE The MIT License (MIT) Copyright (c) 2016 Eleftherios Anagnostopoulos for Ericsson AB (EU FP7 CityPulse Project) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software...
#!/usr/bin/env python # -*- coding: utf-8 -*- '''General Python client for SCAN service, built on top of PyScanClient library, which uses a RESTful web service to manage and proceed scan jobs. The scan server host and port could be configured in configuration file, e.g.: phantasy.ini. The scan server was developed ...
""" Calculates mold growth indication from temperature and humidity. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.mold_indicator/ """ import logging import math import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHE...
# 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 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import logging from monty.json import MSONable from monty.io import zopen from pymatgen.core import Molecule from .utils import read_table_pattern, read_pattern, lower_and_check_unique # Classes for reading/m...
from functools import partial import threading from PyQt5.QtCore import Qt, pyqtSignal, QRegExp from PyQt5.QtGui import QRegExpValidator from PyQt5.QtWidgets import (QVBoxLayout, QLabel, QGridLayout, QPushButton, QHBoxLayout, QButtonGroup, QGroupBox, QTextEdit,...
import numpy as np import pandas as pd import datetime import matplotlib as mpl import matplotlib.pyplot as plt import pytest @pytest.fixture(scope="session", autouse=True) def remove_pandas_unit_conversion(): # Prior to pandas 1.0, it registered its own datetime converters, # but they are less powerful than...
import os from copy import copy from decimal import Decimal from django.utils.unittest import TestCase from django.contrib.gis.gdal import DataSource, OGRException from django.contrib.gis.tests.utils import mysql from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, InvalidDecimal, MissingFor...
""" Find intermediate evalutation results in assert statements through builtin AST. """ import ast import sys import _pytest._code import py from _pytest.assertion import util u = py.builtin._totext class AssertionError(util.BuiltinAssertionError): def __init__(self, *args): util.BuiltinAssertionError.__...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys vizdtestdir = sys.path[0] import urllib2 import xmltodict import json import requests import socket from lxml import etree from opserver.introspect_util import * from opserver_results import * from opserver.opserver_util import OpServerUt...
# 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. """Runs perf tests. Our buildbot infrastructure requires each slave to run steps serially. This is sub-optimal for android, where these steps can run indepe...
# coding=utf-8 # Copyright 2017 The DLT2T Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
#!/usr/local/bin/python """ cryptography_utilities.py @author Elliot and Erica """ import random BYTE_LENGTH = 8 def decimal_to_binary(decimal): """Convert an integer into a binary string. E.g. 5 -> '101'.""" return format(decimal, 'b') def binary_to_decimal(binary): """Convert a binary string into an...
# Copyright 2009 Shikhar Bhushan # Copyright 2011 Leonidas Poulopoulos # # 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...
# 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...
"""Test the VLC media player Telnet config flow.""" from __future__ import annotations from typing import Any from unittest.mock import patch from aiovlc.exceptions import AuthError, ConnectError import pytest from homeassistant import config_entries from homeassistant.components.vlc_telnet.const import DOMAIN from ...
# -*- test-case-name: xquotient.test.test_inbox -*- import itertools from datetime import timedelta from zope.interface import implements from twisted.python.components import registerAdapter from twisted.internet import defer from twisted.internet.task import coiterate from nevow import tags as T, inevow, athena f...
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
import os import re import sys from sipconstants import * path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(path+'/../')) from logConf import * # one sample # https://github.com/sparkslabs/kamaelia/blob/master/Code/Python/Kamaelia/Kamaelia/Protocol/SDP.py class SdpMsg(dict): def __i...
## # Copyright (c) 2008-2010 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import collections from importkit.yaml import validator from importkit.yaml.validator.tests.base import SchemaTest, raises, result class TestTypes(SchemaTest): def setUp(self): super().setUp() self....
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import datetime import logging import random import sys import traceback from catapult_base import cloud_storage from telemet...
try: set except NameError: from sets import Set as set from django import template from django.http import Http404 from django.core.paginator import Paginator, InvalidPage from django.conf import settings register = template.Library() DEFAULT_PAGINATION = getattr(settings, 'PAGINATION_DEFAULT_PAGINATION', 20...
from datetime import datetime from flask import render_template import json import requests import pandas as pd from settings import API_URL # to avoid truncation pd.set_option('display.max_colwidth', -1) def convert_times(date_from, date_to): date_from, date_to = str(date_from), str(date_to) dt_start = date...
#!/usr/bin/python # Copyright 2013 the Neutrino authors (see AUTHORS). # Licensed under the Apache License, Version 2.0 (see LICENSE). # Utilities for parsing command-line options into plankton. from . import codec import collections import re import sys # Parsing failed. class OptionSyntaxError(Exception): def...
"""Script to execute CPU and get a best move using Minimax algorithm""" import copy from common import board_full, win OPP = [1, 0] def eval_rc(board, player, glength, roc): """Returns row or column score""" score_sum = 0 clone_board = board if roc == "c": clone_board = [[board[j][i] for j ...
import itertools import logging import os import sys from contextlib import closing import flask from flask import render_template from flask import request from packaging.version import parse from sqlalchemy import Column from sqlalchemy import create_engine from sqlalchemy import Integer from sqlalchemy import Strin...
#!/usr/bin/env python """ Copyright 2016 Brian Quach Licensed under MIT (https://github.com/brianquach/udacity-nano-fullstack-conference/blob/master/LICENSE) # noqa """ import endpoints from protorpc import message_types from protorpc import remote from google.appengine.api import taskqueue from google.appengine.ext...
# Copyright 2020 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 agreed to in writing, ...
from abc import ABCMeta, abstractmethod import numpy as np from scipy import integrate class BaseDiscretizer(ABCMeta): """ Base class for the discretizer classes in pgmpy. The discretizer classes are used to discretize a continuous random variable distribution into discrete probability masses. P...
import numpy as np import pylab as pl from . import utils from sklearn.utils import check_X_y,check_array from sklearn.neural_network import MLPClassifier as MultilayerPerceptronClassifier from sklearn.utils.extmath import safe_sparse_dot from sklearn.svm import SVC from sklearn.linear_model import LogisticRegression ...
# -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2018, 2019, 2020, 2021, 2022 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """CWL v1.0 interface CLI implementation.""" import io import logging ...
#! /usr/bin/env python3 """The Tab Nanny despises ambiguous indentation. She knows no mercy. tabnanny -- Detection of ambiguous indentation For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function check() described below. Warning: The...
""" Support for monitoring an SABnzbd NZB client. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sabnzbd/ """ import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant...
import unittest try: from StringIO import StringIO except ImportError: from io import StringIO try: from ConfigParser import SafeConfigParser except ImportError: from configparser import ConfigParser as SafeConfigParser import yaml from confirm import generator, utils def config_from_config_string(c...
#!/usr/bin/env python # Copyright 2014, Rackspace US, 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 applicabl...
# 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. """This module contains constants used by cbuildbot and related code.""" import os def _FindSourceRoot(): """Try and find the root check out of th...
import logging from typing import Optional from . import JNISimProcedure from ...engines.soot.expressions import SimSootExpr_NewArray from ...engines.soot.values import SimSootValue_ArrayRef l = logging.getLogger('angr.procedures.java_jni.array_operations') # pylint: disable=arguments-differ,unused-argument # pylin...
#!/usr/bin/env python # Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. """ Classify an image using individual model files Use this script as an example to build your own tool """ import argparse import os import time import PIL.Image import numpy as np import scipy.misc from google.protobuf import te...
import random from core.exception import * from core.grid import * class NoAvailablePlaceError(CoreError): message = "No available place." class NoAvailableTargetError(CoreError): message = "No available target." class TurnState(object): NONE = 0x00 MARKED = 0x01 MISS = 0x02 HIT...
""" FuseCry encryption functions. Cry objects `enc` and `dec` methods are symetric encrypt/decrypt functions. Use `get_password_cry` and `get_rsa_cry` to generate proper Cry object. Examples: Generate new Cry object with user password: get_password_cry(password) Generate existing Cry object with use...
# 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...
import ntpath import os import posixpath import sys import pretend from pip._internal.utils import appdirs class TestUserCacheDir: def test_user_cache_dir_win(self, monkeypatch): @pretend.call_recorder def _get_win_folder(base): return "C:\\Users\\test\\AppData\\Local" monk...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals import json import os import re import runpy import sys # debugpy.__main__ should...
import pdb import time import os import sys import pygame import numpy as np from pygame.constants import K_w, K_a, K_d, K_s import copy class RayCastPlayer(): """ Loosely based on code from Lode's `Computer Graphics Tutorial`_. .. _Computer Graphics Tutorial: http://lodev.org/cgtutor/raycasting.html ...
import json import logging import os import sys import traceback from .Plugin import JigsawPlugin if sys.version_info[0] > 3 or (sys.version[0] == 3 and sys.version[1] >= 5): PY3 = True import importlib.util else: PY3 = False import imp class PluginLoader(object): """ The main plugin loader ...
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory # 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/...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2017-2021 AVSystem <avsystem@avsystem.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/...
#!/usr/bin/env python import logging from multiprocessing.dummy import Pool import os import time import sys import begin import coloredlogs from tqdm import tqdm from client import QueryClient, ModifyClient from ltu.engine.result import Result from ltu.engine.stat import Stat logger = logging.getLogger(__name__) l...
from corehq.apps.data_interfaces.models import ( AutomaticUpdateRule, MatchPropertyDefinition, CreateScheduleInstanceActionDefinition, ) from corehq.messaging.scheduling.models import ( Schedule, AlertSchedule, TimedSchedule, TimedEvent, SMSContent, ) from corehq.messaging.scheduling.sch...
import unittest import operator from collections import abc from g1.bases.collections import ( LoadingDict, LruCache, Multiset, Namespace, ) class LoadingDictTest(unittest.TestCase): def test_loading_dict(self): ks = [] def load(key): if key == 'no-such-key': ...