gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" Utility functions and objects to ease Python 3 compatibility. """ import sys import re import codecs import warnings try: from functools import wraps assert wraps except ImportError: # No-op wraps decorator def wraps(f): def dec(newf): return newf return dec def cast_b...
import pybullet import gym, gym.spaces, gym.utils import numpy as np import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) os.sys.path.insert(0, parentdir) import pybullet_data class XmlBasedRobot: """ Base class for mujoco...
# 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 ...
#! /usr/bin/env python """ Module with frame/cube filtering functionalities """ from __future__ import division __author__ = 'C. Gomez @ ULg' __all__ = ['frame_filter_highpass', 'frame_filter_lowpass', 'cube_filter_highpass', 'cube_filter_iuwt', 'frame_filter_gaussian2d', ...
from django.test import override_settings from django.test import TestCase from mock import call from mock import MagicMock from mock import Mock from mock import patch from sqlalchemy.engine import Engine from kolibri.core.content.utils.sqlalchemybridge import Bridge from kolibri.core.content.utils.sqlalchemybridge i...
# # 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 discord from discord.ext import commands import asyncio import time import clashroyale lastTag = '0' creditIcon = "https://i.imgur.com/TP8GXZb.png" credits = "Bot by GR8 | Titan" BOTCOMMANDER_ROLES = ["Family Representative", "Clan Manager", "Clan Deputy", "Co-Leader", "Hub Officer", "adm...
import unittest from test import support import contextlib import socket import urllib.request import sys import os import email.message import time support.requires('network') class URLTimeoutTest(unittest.TestCase): # XXX this test doesn't seem to test anything useful. TIMEOUT = 30.0 def setUp(self)...
# Copyright 2012 OpenStack Foundation # 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 ...
""" Testing for the approximate neighbor search using Locality Sensitive Hashing Forest module (sklearn.neighbors.LSHForest). """ # Author: Maheshakya Wijewardena, Joel Nothman import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_a...
# -*- coding: utf-8 -*- import os import re import glob import base64 import codecs import mimetypes import jinja2 import markdown import pygments import tempfile import sys from pygments.lexers import get_lexer_by_name from pygments.formatters import HtmlFormatter from subprocess import * BASE_DIR = os.path.dirna...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from code import Code from model import PropertyType import cpp_util import schema_util import util_cc_helper from cpp_namespace_environment import CppNa...
# Copyright (c) 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 ...
#!/usr/bin/env python from sys import argv from string import strip from os import listdir,path from optparse import OptionParser from datetime import datetime import tarfile _author__ = "Jesse Zaneveld" __copyright__ = "Copyright 2007-2012, The Cogent Project" __credits__ = ["Jesse Zaneveld", "Rob Knight"] __licens...
#!/usr/bin/env python # Copyright (c) 2005 Trent Mick # License: MIT License """Test specially formated cmdln_*.py files Each cmdln_*.py implemented a cmdln.Cmdln subclass and its module docstring is an 'expect' script to test running it. Usage: Run all cmdln_*.py tests: python test_cmdln.py As part...
"""SCons.Tool.mwcc Tool-specific initialization for the Metrowerks CodeWarrior compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,...
# !/usr/bin/env python # -*- coding: utf-8 -*- import multiprocessing import time import random import os import string from flask import Flask from flask import jsonify from flask import request as flask_request from flask import render_template from flask import abort from flask import Response from flask import mak...
import re from dataclasses import dataclass, fields from typing import Callable, Optional, Union, cast from mitmproxy.coretypes import serializable from mitmproxy.net.http import encoding from mitmproxy.net.http.headers import Headers, assemble_content_type, parse_content_type from mitmproxy.utils import strutils, typ...
from unittest import TestCase from beautiful_date import Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sept, Oct, Dec, hours, days, Nov from gcsa.attachment import Attachment from gcsa.attendee import Attendee, ResponseStatus from gcsa.conference import ConferenceSolution, EntryPoint, SolutionType, ConferenceSolutionCreateR...
# see https://blog.alexandruioan.me/2017/01/31/the-2017-university-of-bristol-arm-hackathon for more details import math from http.server import BaseHTTPRequestHandler, HTTPServer, urllib from sys import argv # import matplotlib.pyplot as plt import serial import threading import queue import numpy as np import time q...
# 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 # distributed under the Li...
import numpy as np import pandas as pd import datetime as dt import pkg_resources as pkg class PyCrop(object): """ Simple Crop model class """ def __init__(self, doyp): """ Initialise the class :rtype : object """ self.irrigation = GetData.get_irrigatio...
# 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 ...
# coding=utf-8 ''' xiami music provider. ''' import json import logging import urllib import urllib2 from replay import h logger = logging.getLogger('listenone.' + __name__) # https://github.com/Flowerowl/xiami def caesar(location): num = int(location[0]) avg_len = int(len(location[1:]) / num) remainde...
#!/usr/bin/env python import unittest, random from common import * from ctypes import * def addMiRange(mi, r1, r2): ibd.Mi_AddValidRange(mi, c_long(r1), c_long(r2)) newMii = ibd.Mii_New newMii.restype = ctypes.c_void_p delMii = ibd.Mii_Delete newMiri = ibd.Miri_New newMiri.restype = ctypes.c_void_p delMiri = ib...
# # 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...
# -*- test-case-name: twisted.conch.test.test_cftp -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementation module for the I{cftp} command. """ from __future__ import division, print_function import os, sys, getpass, struct, tty, fcntl, stat import fnmatch, pwd, glob from twisted...
import pytest import py from textwrap import dedent pytest_plugins = "pytester", def test_version(): import pytest_cache assert pytest_cache.__version__ def test_cache_reportheader(testdir): p = testdir.makepyfile(""" def test_hello(): pass """) cachedir = p.dirpath(".cache") ...
"""Test the Yeelight config flow.""" from unittest.mock import patch import pytest from homeassistant import config_entries from homeassistant.components import dhcp, ssdp, zeroconf from homeassistant.components.yeelight.config_flow import MODEL_UNKNOWN, CannotConnect from homeassistant.components.yeelight.const impo...
# -------------------------------------------------------------------- __all__ = ['PetscConfig', 'setup', 'Extension', 'config', 'build', 'build_src', 'build_ext', 'clean', 'test', 'sdist', 'log', ] # --------------------------------------------------------------...
import os import uuid ### arast ### import client import assembly #### Single Files ##### class FileInfo(dict): def __init__(self, filename=None, shock_url=None, shock_id=None, name=None, create_time=None, metadata=None, direct_url=None, keep_name=False, *args): dict.__init__(self, *args...
# Copyright 2012-2014 The Meson development team # 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 python # -*- coding: utf-8 -*- import sys from mock import Mock, patch, call from preggy import expect from materialgirl import Materializer from materialgirl.storage.memory import InMemoryStorage from tests.base import TestCase class TestMaterialGirl(TestCase): @staticmethod def woots_gener...
#!/usr/bin/python from neutrino import nparser, token, ast, data import unittest ar = lambda *e: ast.Array(e) df = lambda i, v, b: ast.LocalDeclaration(i, False, v, b) lm = lambda s, b: ast.Lambda([ast.Method(s, b)]) lt = ast.Literal nd = lambda n, v: ast.NamespaceDeclaration([], n, v) md = lambda s, b: ast.MethodDec...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import re import time import urllib import urlparse from datetime import datetime, timedelta from django.conf import settings from django.contrib.auth.models import User from django.contrib.staticfiles.storage import staticfiles_storage from django.core.urlresolvers import reverse from django.template import defaultfi...
import sqlite3 import datetime import math import triangulate_events import sys sys.path.append('../') import events import settings """ @author(s): Nathan Heidt This parses the meteor events and detects simulataneous events TODO: - This is linked to work on the local database, when porting this over to ...
# Copyright 2020 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
import sys from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.exc import IntegrityError, DatabaseError, ProgrammingError import vmcatcher.databaseDefinition as model import os import re import logging import optparse import smimeX509validation from vmcatcher.__version__ import ...
# -*- coding: utf-8 -*-} import math import logging from tahiti.app_auth import requires_auth, requires_permission from flask import request, current_app, g as flask_globals from flask_restful import Resource from sqlalchemy import or_ from http import HTTPStatus from marshmallow.exceptions import ValidationError fro...
#! /usr/bin/env python """Test script for the bsddb C module by Roger E. Masse Adapted to unittest format and expanded scope by Raymond Hettinger """ import os, sys import copy import bsddb import dbhash # Just so we know it's imported import unittest from test import test_support from sets import Set class TestBSD...
""" Here we access geojson held in a textfile - it is then used to perform the following tasks reqd for the GIS programming assignment..... Specifically, we want to do the following: Create a single polygon from the Union of all the polygons. Compute the centroid of the single polygon. Extract the...
# 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 -*- ''' Installation of Composer Packages ================================= These states manage the installed packages for composer for PHP. Note that either composer is installed and accessible via a bin directory or you can pass the location of composer in the state. .. code-block:: yaml ge...
# Copyright The PyTorch Lightning team. # # 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 i...
# Copyright (c) 2018 Niklas Rosenstein # # 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, d...
#!/usr/bin/env python3 import sys import shutil import os import fnmatch import unittest import argparse import time import threading import signal import psutil import re import multiprocessing from multiprocessing import Process, Pipe, cpu_count from multiprocessing.queues import Queue from multiprocessing.managers ...
import hashlib import os import posixpath import re from urllib import unquote from urlparse import urlsplit, urlunsplit, urldefrag from django.conf import settings from django.core.cache import (get_cache, InvalidCacheBackendError, cache as default_cache) from django.core.exceptions imp...
# -*- coding: utf-8 -*- from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError from taggit.managers import TaggableManager from opps.core.models import Publishable, BaseBox, BaseConfig class Infograph...
# Copyright 2014 Antoine "hashar" Musso # Copyright 2014 Wikimedia Foundation 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 # # Unle...
# # 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 (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # Copyright (c) 2017-2018, NVIDIA 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 a...
from __future__ import unicode_literals import getpass import os import shlex import subprocess try: import unittest2 as unittest except ImportError: import unittest import six from storm import Storm from storm.parsers.ssh_uri_parser import parse from storm import __version__ # derived from http://www.cy...
"""Support for SmartThings Cloud.""" from __future__ import annotations import asyncio from collections.abc import Iterable import importlib import logging from aiohttp.client_exceptions import ClientConnectionError, ClientResponseError from pysmartapp.event import EVENT_TYPE_DEVICE from pysmartthings import Attribut...
# 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...
# -*- coding: utf-8 -*- """The output mediator object.""" import glob import os import pytz from plaso.engine import path_helper from plaso.formatters import default from plaso.formatters import manager as formatters_manager from plaso.formatters import winevt_rc from plaso.formatters import yaml_formatters_file from...
# 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...
""" Module for managing quotas on POSIX-like systems. """ import logging import salt.utils.path import salt.utils.platform from salt.exceptions import CommandExecutionError, SaltInvocationError log = logging.getLogger(__name__) # Define a function alias in order not to shadow built-in's __func_alias__ = {"set_": "...
#!/usr/bin/env python3 """Test runner for typeshed. Depends on pytype being installed. If pytype is installed: 1. For every pyi, do nothing if it is in pytype_exclude_list.txt. 2. Otherwise, call 'pytype.io.parse_pyi'. Option two will load the file and all the builtins, typeshed dependencies. This will also d...
# -*- coding: utf-8 -*- from struct import pack, unpack from ambari_ws4py.exc import FrameTooLargeException, ProtocolException from ambari_ws4py.compat import py3k, ord, range # Frame opcodes defined in the spec. OPCODE_CONTINUATION = 0x0 OPCODE_TEXT = 0x1 OPCODE_BINARY = 0x2 OPCODE_CLOSE = 0x8 OPCODE_PING = 0x9 OPCO...
# coding: utf-8 """ Standalone file utils. Nothing in this module should have an knowledge of config or the layout and structure of the site and pages in the site. """ from __future__ import unicode_literals import logging import markdown import os import pkg_resources import shutil import sys import yaml import fn...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Oakcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the pruning code. WARNING: This test uses 4GB of disk space. This test takes 30 mins or more (up ...
''' Created on Feb 15, 2013 @author: eric ''' from collections import namedtuple import random from osgeo import gdal, ogr BoundingBox = namedtuple('BoundingBox', ['min_x', 'min_y','max_x', 'max_y']) def extents(database, table_name, where=None, lat_col='_db_lat', lon_col='_db_lon'): '''Return the bounding...
""" terminal reporting of the full testing process. This is a good source for looking at the various reporting hooks. """ from __future__ import absolute_import, division, print_function import itertools from _pytest.main import EXIT_OK, EXIT_TESTSFAILED, EXIT_INTERRUPTED, \ EXIT_USAGEERROR, EXIT_NOTESTSCOLLECTED...
from django.contrib.auth.decorators import login_required from django.shortcuts import * from models import * from forms import SpojUserForm, CodeGroupForm from django.core.mail import send_mail from django.utils import simplejson as json from django.views.decorators.csrf import csrf_exempt class Story(object): ...
import collections import datetime import enum import json import math import time import warnings import zlib from email.utils import parsedate from http.cookies import SimpleCookie from multidict import CIMultiDict, CIMultiDictProxy from . import hdrs, payload from .helpers import HeadersMixin, rfc822_formatted_tim...
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # Copyright (c) 2013 Hewlett-Pa...
""" This module groups and sorts Statements for presentation in downstream tools while aggregating the statements' statistics/metrics into the groupings. While most usage of this module will be via the top-level function `group_and_sort_statements`, alternative usages (including custom statement data, multiple stateme...
from collections import deque from queue import PriorityQueue from node import Node from board import Board from time import process_time class Solver(object): """Solves a puzzle using one of the following methods: BFS --> Breadth First Search DFS --> Depth First Search AST --> A-star search ...
#### PATTERN | COMMONSENSE ######################################################################### # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern ####################################...
# 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...
import traceback import time import io from copy import copy from PyQt5 import QtGui, QtCore, QtWidgets, uic from settings import tmsettings from functools import partial from const import * from event import TelepatContextAddEvent, TelepatContextUpdateEvent, ExceptionEvent from conneditor import ConnectionEditor from ...
import re, random, py from rpython.rlib.rsre import rsre_core, rsre_char from rpython.rlib.rsre.rpy import get_code, VERSION def get_code_and_re(regexp): return get_code(regexp), re.compile(regexp) def test_get_code_repetition(): c1 = get_code(r"a+") c2 = get_code(r"a+") assert c1 == c2 class TestM...
import sys import os import types import jsonpickle import collections import tensorflow as tf ADAM = 'adam' SGD = 'sgd' RMSPROP = 'rmsprop' ADADELTA = 'adadelta' ADAGRAD = 'adagrad' MOMENTUM = 'momentum' NESTEROV = 'nesterov' class Optimizer(object): """Optimizer class to encapsulate (all) optimizers from its...
from __future__ import print_function import json from fds.galaxy_fds_client_exception import GalaxyFDSClientException class FDSLifecycleConfig(dict): ''' lifecycle config like this: { "rules": [ { "id": 0, "enabled": true, "prefix": "log", "actions": { "nonCurren...
from django.template.base import TemplateSyntaxError from django.template.context import Context from django.template.loader_tags import BlockContext, BlockNode from django.test import SimpleTestCase from ..utils import SilentAttrClass, SilentGetItemClass, SomeClass, setup basic_templates = { 'basic-syntax01': 's...
#!/usr/bin/env python from PIL import Image import math import sys import heapq from collections import deque import control cmdRight = None cmdLeft = None cmdDown = None cmdUp = None cmdStop = None def setupDeviceProxy(devicePath): control.setup(devicePath) global cmdRight global cmdLeft global cmd...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Copyright 2011 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 re...
"""Implementation of beam search with penalties.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import numpy as np import tensorflow as tf from tensorflow.python.util import nest from layers import common_layers # Assuming EOS_ID is 1 EOS...
from sympy import ( Symbol, diff, Derivative, Rational, roots, S, sqrt, hyper, cos, gamma, conjugate, factorial, pi, oo, zoo, binomial, RisingFactorial, legendre, assoc_legendre, chebyshevu, chebyshevt, chebyshevt_root, chebyshevu_root, laguerre, assoc_laguerre, laguerre_poly, hermite, gegenbauer, jacob...
"""Asynchronous Advantage Actor-Critic (A3C) algorithm for reinforcement learning.""" from deepchem.models import TensorGraph from deepchem.models.tensorgraph import TFWrapper from deepchem.models.tensorgraph.layers import Feature, Weights, Label, Layer import numpy as np import tensorflow as tf import collections imp...
import logging import os.path import shutil import socket import salt.config import salt.modules.network as network import salt.utils.path from salt._compat import ipaddress from salt.exceptions import CommandExecutionError from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock...
from __future__ import unicode_literals import datetime import uuid from copy import deepcopy from django.core.exceptions import FieldError from django.db import DatabaseError, connection, models, transaction from django.db.models import TimeField, UUIDField from django.db.models.aggregates import ( Avg, Count, M...
# -*- coding: utf-8 -*- """ Created on Tue Jul 5 18:11:33 2016 @author: johnlewisiii """ import math import os import statistics import sys from importlib import reload import emcee import matplotlib as mpl import matplotlib.cm as cm import matplotlib.colors as colors import matplotlib.pyplot as plt import numpy as ...
#!/usr/bin/env python3 import argparse import os import subprocess import sys def setup(): global args, workdir programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget'] if args.kvm: programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils'] elif args.docker: dockers = ['docker.io',...
#!/usr/bin/env python # reference: c041828_ISO_IEC_14496-12_2005(E).pdf ################################################## # reader and writer ################################################## import struct from io import BytesIO def skip(stream, n): stream.seek(stream.tell() + n) def skip_zeros(stream, n): ...
#!/usr/bin/env python """ Usage: ssmrandom {recv|send|rawsend} [options]+ [host IP(only for recv)]+ Common options: -h print this message -v print version information -g SSM multicast group (in 232.0.0.0/8) -i local bind address -p port -f stay in the foreground ...
# 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...
import sublime import sublime_plugin from collections import OrderedDict from operator import itemgetter from datetime import datetime from time import time from bisect import bisect from zipfile import ZipFile from tempfile import mkstemp import stat import os import threading import subprocess import sys import re ...
#!/usr/bin/python -tt ''' File: learning.py Date: July 2, 2014 Description: this script takes as a list of word pairs, as well as the vector representations of those words, and sets up a regression problem to learn the parameters in our composition function. Usage: python learning.py wordVectorsIn ParametersOut < tra...
# # dp.py -- Data pipeline and reduction routines # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import numpy from collections import OrderedDict from ginga import A...
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop from corehq.apps.reminders.models import REMINDER_TYPE_ONE_TIME from corehq.apps.reports.commconnect import div, CommConnectReport from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn, DataTabl...
"""Support for a ScreenLogic heating device.""" import logging from screenlogicpy.const import DATA as SL_DATA, EQUIPMENT, HEAT_MODE from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( ATTR_PRESET_MODE, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, C...
"""Tests Holocron CLI.""" import logging import pathlib import subprocess import sys import textwrap import mock import pytest import yaml @pytest.fixture(autouse=True) def _fake_root_logger(monkeypatch): """Prevent modifying global root instance.""" monkeypatch.setattr(logging, "root", logging.getLogger("...
from test import test_support import unittest import codecs import locale import sys, StringIO, _testcapi def coding_checker(self, coder): def check(input, expect): self.assertEqual(coder(input), (expect, len(input))) return check class Queue(object): """ queue: write bytes at one end, read by...
# Copyright (c) 2014 Tom Carroll # # 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, distri...
from sqlalchemy import and_ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import join from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.orm import aliased from sqlalchemy.orm import joinedload from sq...
#!/usr/bin/env python ################################################################################### # # Copyright (c) 2010-2016 Motsai # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softwa...
''' mrtparse.py - MRT format data parser Copyright (C) 2019 Tetsumune KISO 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 applic...