src
stringlengths
721
1.04M
from __future__ import unicode_literals import json import os import random import contextlib import shutil import pytest import tempfile from pathlib import Path import pathlib from ...gold import GoldParse from ...pipeline import EntityRecognizer from ...en import English try: unicode except NameError: uni...
from py2deb import Py2deb from glob import glob version = "0.1.20" p=Py2deb("barriosquare") p.author="Chris J. Burris" p.mail="chris@chlitechno.com" p.description="Maemo application to access foursquare.com api functionality" p["/opt/barrioSquare"] = ["barriosq.py|barriosq","barrioConfig.py","barrioStyles.py","get-loc...
import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.pardir)) from imaplib import IMAP4, IMAP4_SSL from config import settings from models import Legislator from models import Message from models import MessageLegislator import email from email.parser import Parser fr...
import ConfigParser, sys, os, string from pygr.mapping import Collection import pygr.Data try: import hashlib except ImportError: import md5 as hashlib config = ConfigParser.ConfigParser({'testOutputBaseDir' : '.', 'smallSampleKey': ''}) config.read([ os.path.join(os.path.expanduser('~'), '.pygrrc'), os.path...
import inspect import logging import time import traceback from django.conf import settings from django.utils import timezone import six from silk.collector import DataCollector from silk.config import SilkyConfig from silk.models import _time_taken Logger = logging.getLogger('silk') # noinspection PyPep8Naming c...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Buron # Copyright 2015, TODAY Clouder SASU # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License with Attribution # ...
################################ # Author : septicmk # Date : 2015/07/23 19:20:39 # FileName : registration.py ################################ import numpy as np import math from MEHI.utils.tool import exeTime def _generate_H(imgA, imgB): ''' Usage: - calc the grey level histogram of ...
# Copyright 2008-2015 Nokia Solutions and Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
__author__ = 'yezhihua' #!/usr/bin/env python # -*- coding: utf-8 -*- #TODO: add UT import requests import common import os from pyquery import PyQuery import common import time import logging import sys import re import MySQLdb import database class CheckAction(): HTMLDIRBASE= "./html" TIMETABLEDIRBASE = "...
#!/usr/bin/python # Generate two minion input files, run them then compare dumptree outputs to # detect bugs in constraint propagators. import sys, os, getopt from constraint_test_common import * from multiprocessing import Pool, Manager import random #from sendemail import * import time (optargs, other)=getopt.gnu_...
# -*- coding: cp1252 -*- import vector import time class Planet3D: """ein 3D-Objekt für das graphics-Modul, dass mit einem Planeten verbunden ist""" def __init__(self, Parent, Planet): self.Parent = Parent self.Planet = Planet self.Planet.Register(self) self.Positions = [Planet[...
# -*- coding: utf-8 -*- # 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...
from examples.translation import to_cards, translate from pokertools import holecards def test_translation(): assert set(translate("66")) == { "6c 6d", "6c 6h", "6c 6s", "6d 6h", "6d 6s", "6h 6s" } assert set(translate("AKs")) == { "Ac Kc", "Ad Kd", "Ah Kh", "As Ks" } assert set(tr...
# Standard Library Imports import logging import requests # 3rd Party Imports # Local Imports from ..Alarm import Alarm from ..Utils import parse_boolean, get_static_map_url, reject_leftover_parameters, require_and_remove_key log = logging.getLogger('Discord') try_sending = Alarm.try_sending replace = Alarm.replace #...
""" Mercurial CVS support plugin Provides support for the Mercurial configuration management system. It integrates into GPS's VCS support, and uses the same menus as all other VCS systems supported by GPS. You can easily edit this file if you would like to customize the mercurial commands that are sent for each of th...
# -*- coding: utf-8 -*- import pytest from wasp_general.network.web.proto import WWebResponseProto, WWebRequestProto, WWebSessionProto, WWebPresenter from wasp_general.network.web.proto import WWebTargetRouteProto, WWebRouteMapProto, WWebErrorPresenter from wasp_general.network.web.proto import WWebServiceProto, WWeb...
# coding:utf-8 """ Tests for student activation and login """ from __future__ import absolute_import import json import unicodedata import ddt import six from django.conf import settings from django.contrib.auth.models import User from django.core import mail from django.core.cache import cache from django.http impor...
#! /usr/bin/env python ############################### # Imports taken from zbscapy ############################### # Import logging to suppress Warning messages import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) try: from scapy.all import * except ImportError: print 'This Requires Scapy To ...
# 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...
"""Test construction of the implicitly provided JinjaEnvironment, in the common.py module. """ from coffin.common import get_env from django.test.utils import override_settings def test_i18n(): with override_settings(USE_I18N=True): assert get_env().from_string('{{ _("test") }}').render() == 'test' cla...
import os import glob import time UNUSED = '/static-ngeo/UNUSED_CACHE_VERSION/build/' BUILD_PATH = '/app/geoportailv3_geoportal/static-ngeo/build' def get_built_filenames(pattern): return [os.path.basename(name) for name in glob.glob(BUILD_PATH + '/' + pattern)] def get_urls(request): main_js_url = UNUSED ...
# -*- coding: utf-8 -*- # # Pysparse documentation build configuration file, created by # sphinx-quickstart on Sat Nov 8 00:17:09 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickle...
#!/usr/bin/env python3 # tsuserver3, an Attorney Online server # # Copyright (C) 2016 argoneus <argoneuscze@gmail.com> # # 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 ...
# Copyright (C) 2003 - 2015 The Board of Regents of the University of Wisconsin System # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope...
# pylint: disable=bad-builtin from email.utils import formatdate from tempfile import TemporaryDirectory from django.core.mail import EmailMessage, SafeMIMEText, SafeMIMEMultipart, make_msgid from django.core.mail.utils import DNS_NAME from django.core.mail.backends.locmem import EmailBackend as LocMemEmailBackend fro...
#!/usr/bin/env python import sys import os # Use the current development version of Pyskool PYSKOOL_HOME = os.environ.get('PYSKOOL_HOME') if not PYSKOOL_HOME: sys.stderr.write('PYSKOOL_HOME is not set; aborting\n') sys.exit(1) if not os.path.isdir(PYSKOOL_HOME): sys.stderr.write('PYSKOOL_HOME=%s: directory...
#!/usr/bin/env python # # generateOctreeFromObj.py # Core3D # # Created by Julian Mayer on 16.11.07. # Copyright (c) 2010 A. Julian Mayer # # 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 wit...
# -*- coding: utf-8 -*- ''' .. module:: audiochan.utils.cascadicts :platform: Unix, Windows :synopsis: Implementation of Cascading dict collection. CascaDicts implement something like inheritance on dictionary level. Example:: In [2]: a = CascaDict({'level':0, 'name':'root'}) In [3]: b = a.cascade({...
""" Scikit-learn utilities for input validation. """ # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD 3 clause import warnings import numbers import numpy as np import scipy.sparse as sp...
from django.core.management.base import BaseCommand, CommandError from listings.models import Listing, User, Comment, Group import os, sys from django.utils import timezone from optparse import make_option from listings.lib import save_obj, get_fb_graph_api, get_word_bank, filter_listing from dateutil.parser import pa...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# 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. """Generates C++ source files from a mojom.Module.""" import mojom.generate.generator as generator import mojom.generate.module as mojom import mojom.genera...
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test descendant package tracking code.""" from decimal import Decimal from test_framework.messages im...
# vi: ts=4 expandtab # # Copyright (C) 2015 Red Hat, Inc. # # Author: Brent Baude <bbaude@redhat.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, as # published by the Free Software Foundation. # # This prog...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Script Name : sock5.py # Author : lovebull # Created : 2016/05/10 # Last Modified : 2016/05/10 # Version : 1.0.0 # Modifications : Added exceptions # # Description : from urllib import request import time from bs4 import BeautifulSoup import ...
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requ...
""" Working with PSID in python @author : Spencer Lyon <spencer.lyon@stern.nyu.edu> @date : 2015-02-04 09:02:56 use the read_csv option `usecols` to only keep what we need """ import re import os import gc import os.path import zipfile import requests import lxml.html import numpy as np import pandas as pd # ----...
import os.path as op import unittest import numpy as np import pyhrf from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_almost_equal, assert_array_less, assert_equal import shutil import pyhrf.graph as pgraph import pyhrf.sandbox.parcellation as pm from pyhrf.tools import assert_file_exist...
#!/usr/local/bin/python3 # # Create application and launch environment with dummy application running # import boto3 import time import webbrowser import argparse parser = argparse.ArgumentParser() parser.add_argument('region') parser.add_argument('vpcid') parser.add_argument('security_group') parser.add_argument('sub...
from rest_framework.serializers import ModelSerializer, SerializerMethodField, CharField from .models import Annotation, AnnotationType, Verification, ExportFormat from imagetagger.images.serializers import ImageSerializer class AnnotationTypeSerializer(ModelSerializer): class Meta: model = AnnotationTyp...
# coding=utf-8 # 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 ...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# -*- coding: utf-8 -*- #M3 -- Meka Robotics Robot Components #Copyright (c) 2010 Meka Robotics #Author: edsinger@mekabot.com (Aaron Edsinger) #M3 is free software: you can redistribute it and/or modify #it under the terms of the GNU Lesser General Public License as published by #the Free Software Foundation, either v...
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library from os import path import sys __all__ = ['libsvm', 'svm_problem', 'svm_parameter', 'toPyModel', 'gen_svm_nodearray', 'print_null', 'svm_node', 'C_SVC', 'EPSILON_SVR', 'LINEAR', 'NU_SVC', 'NU_SVR', 'ONE_CLASS', ...
# -*- coding: utf-8 -*- """QGIS Unit tests for the memory layer provider. .. note:: 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 2 of the License, or (at your option) any later vers...
from client import exceptions as ex from client.cli import ok from client.api import assignment from client.cli.common import messages from client.protocols import grading from client.protocols import scoring import argparse import client import logging import os.path LOGGING_FORMAT = '%(levelname)s | pid %(process)d ...
"""Particle filters. Particle filters describe criteria to select subsets of the particle in the system for use by various operations throughout HOOMD. To maintain high performance, filters are **not** re-evaluated on every use. Instead, each unique particular filter (defined by the class name and hash) is mapped to a...
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
import logging import newrelic.agent from kombu import (Exchange, Queue) from kombu.mixins import ConsumerMixin from treeherder.etl.common import fetch_json from treeherder.etl.tasks.pulse_tasks import (store_pulse_jobs, store_pulse_pushes) from .excha...
#! /usr/bin/env python3 ''' This script resizes the given image to multiple sizes and saves them to a dictionary This script is implemented with argparse. Usage: resizer-base.py [-h] -f SOURCE FILE -o OUTPUT DIRECTORY -s SIZE LIST -p POSTFIX [-n NEW NAME] Arguments SOURCE FILE must be a valid image file in a format p...
import sys import os import random as rnd import numpy as np from numpy import random as rv import route import gen import heapq class flowgen(object): ''' Flow generator class. Instantiates objects inside - for flow arrival, size of flow and throughput assignment. ''' def __init__(self,fptr,tm): self....
# coding: utf-8 # In[ ]: from __future__ import division import logging import os import xml.etree.ElementTree as ET from senpy.plugins import EmotionPlugin, SenpyPlugin from senpy.models import Results, EmotionSet, Entry, Emotion, Error logger = logging.getLogger(__name__) import numpy as np import math, itertoo...
AUTHOR = 'Zachary Priddy. (me@zpriddy.com)' TITLE = 'Motion/Door Triggered Lights' METADATA = { 'title': TITLE, 'author': AUTHOR, 'commands': ['execute'], 'interface': { 'sensors': { 'motion': { 'context': 'motion sensors to use to trigger light', 'filter': { 'mot...
from otp.distributed.OtpDoGlobals import * from direct.showbase.PythonUtil import invertDictLossless OTP_SERVER_ROOT_DO_ID = 4007 CHANNEL_CLIENT_BROADCAST = 4014 BAD_CHANNEL_ID = 0 BAD_ZONE_ID = 0 BAD_DO_ID = 0 CONTROL_MESSAGE = 4001 CONTROL_SET_CHANNEL = 2001 CONTROL_REMOVE_CHANNEL = 2002 CONTROL_SET_CON_NAME = 2004 C...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # Sandesh Client # from sandesh_connection import SandeshConnection from sandesh_logger import SandeshLogger from transport import TTransport from protocol import TXMLProtocol from sandesh_uve import SandeshUVETypeMaps class SandeshClient(object)...
# -*- coding: utf-8 -*- ''' We wanna be free to ride our machines without being hassled by The Man! And we wanna get loaded! And we wanna have a good time! And that's what we are gonna do. We are gonna have a good time... ''' # Import python libs from __future__ import absolute_import import os import imp import sys i...
import scrapy from scrapy import Request class CWACResultsSpider(scrapy.Spider): name = "cw-all-candidates" def start_requests(self): for i in range(40): if self.endpoint == 'archive': yield Request('https://web.archive.org/web/20160823114553/http://eciresults.ni...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Deepin, Inc. # 2011 Hou Shaohui # # Author: Hou Shaohui <houshao55@gmail.com> # Maintainer: Hou ShaoHui <houshao55@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Ge...
#!/usr/bin/env python3 import sys import os import sha256_wrapper def puaq(): print("Usage: %s archive-to-check [hash-file]" % os.path.basename(__file__)) sys.exit(1) def sha256sum_check(archive_file, hash_file): hash_file_contents = "" with open(hash_file, "r") as f: hash_file_contents = f...
# -*- coding: utf-8 -*- import os import json try: import configparser from configparser import ConfigParser except ImportError: import ConfigParser as configparser # noqa from ConfigParser import SafeConfigParser as ConfigParser # noqa import arrow import click import requests from .frames impor...
#!/usr/bin/env python # ScraperWiki Limited # Ian Hopkinson, 2013-06-17 # -*- coding: utf-8 -*- """ comb tests """ import sys sys.path.append('code') from pdftables import (comb, comb_extend, comb_from_uppers_and_lowers, find_minima) from nose.tools import assert_equal...
# Rationale: # * Learn computational thinking # * thought processes involved in formulating problems and their solutions # so that the solutions are represented in a form # that can be effectively carried out by an information-processing agent. # * compositional reasoning, pattern matching, procedural think...
''' Beaglebone/Beagleboard/Etc hardware-specific operations. LICENSING ------------------------------------------------- hwiopy: A common API for hardware input/output access. Copyright (C) 2014-2015 Nicholas Badger badg@nickbadger.com nickbadger.com This library is free software; you can redistribut...
import os import json import requests import re import unicodedata from checks import AgentCheck # http://code.activestate.com/recipes/577257-slugify-make-a-string-usable-in-a-url-or-filename/ _slugify_strip_re = re.compile(r'[^\w\s-]') _slugify_hyphenate_re = re.compile(r'[-\s]+') def _slugify(value): if not is...
# -*- coding: utf-8 -*- # * Authors: # * TJEBBES Gaston <g.t@majerti.fr> # * Arezki Feth <f.a@majerti.fr>; # * Miotte Julien <j.m@majerti.fr>; """ Project Type management """ from sqlalchemy import ( Table, Column, Integer, String, Boolean, ForeignKey, not_, ) from sqlalche...
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join, dirname import numpy as np from numpy.testing import assert_array_almost_equal, assert_equal, TestCase from scipy.fftpack.realtransforms import dct, idct, dst, idst # Matlab reference data MDATA = np.load...
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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 L...
"""The tests for the Scene component.""" import io import unittest from homeassistant.setup import setup_component from homeassistant.components import light, scene from homeassistant.util.yaml import loader as yaml_loader from tests.common import get_test_home_assistant from tests.components.light import common as c...
#!/usr/bin/env 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 "Li...
from django.template.loader import render_to_string import settings from xformmanager.models import FormDefModel, Metadata from receiver.models import Submission, Attachment def domain_summary(request, domain=None, detail_view=True): '''Domain Admin Summary Data''' if not domain: domain = request.ex...
from flask import Flask from passlib.hash import bcrypt from sixquiprend.config import * from sixquiprend.models.card import Card from sixquiprend.models.chosen_card import ChosenCard from sixquiprend.models.column import Column from sixquiprend.models.game import Game from sixquiprend.models.hand import Hand from sixq...
"""module to handle command files @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2012, Ansgar Burchardt <ansgar@debian.org> @license: GPL-2+ """ # 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 Soft...
# -*- coding: utf-8 -*- # vim: set et sts=4 sw=4 encoding=utf-8: # # This file is part of Warzone 2100. # Copyright (C) 2011 Warzone 2100 Project # # Warzone 2100 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 Foundatio...
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.translation import ugettext_lazy as _ from waldur_core.core.models import NameMixin from waldur_core.monitoring.managers import ( ...
# -*- coding: utf-8 -*- # File: gpu.py import os from .utils import change_env from . import logger from .nvml import NVMLContext from .concurrency import subproc_call __all__ = ['change_gpu', 'get_nr_gpu', 'get_num_gpu'] def change_gpu(val): """ Returns: a context where ``CUDA_VISIBLE_DEVICES=val`...
# Copyright 2010-2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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...
#!/usr/bin/env python # -*- coding: utf-8 # ---------------------------------------------------------------------- # Splits wavs into splits # ---------------------------------------------------------------------- # Ivan Vladimir Meza-Ruiz/ ivanvladimir at turing.iimas.unam.mx # 2013/IIMAS/UNAM # ----------------------...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/dialogs/conversion_error.ui' # # Created: Thu Jul 19 23:32:30 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try:...
#!/usr/bin/python """ Package constants """ ## MIT License ## ## Copyright (c) 2017, krishna bhogaonker ## 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 wit...
# -*- coding: utf-8 -*- ############################################################################## # # Add Bank Sort Code to banks in Odoo. # Copyright (C) 2014 OpusVL # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publishe...
import asyncio from contextlib import asynccontextmanager import pytest from mitmproxy.addons.proxyserver import Proxyserver from mitmproxy.proxy.protocol.http import HTTPMode from mitmproxy.proxy2 import layers from mitmproxy.proxy2.context import Address from mitmproxy.test import taddons class HelperAddon: d...
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
import mxnet as mx from mxnet.gluon import nn from mxnet import gluon import sys import utils import pdb,os,sys from importlib import import_module import logging import numpy as np trainBatchSize = 100 testBatchSize = 50 dataShape = (3,32,32) classNum = 10 pretrained = None checkpoints = 'checkpoints/' inputroot = "c...
import codecs import sys if len(sys.argv)!=2: print "Usage: import_final_results [results.csv]" quit() file_name = sys.argv[1] from django.conf import settings from django_bootstrap import bootstrap bootstrap(__file__) from result.models import AdmissionResult from application.models import Applicant, Submi...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutSandwichCode in the Ruby Koans # from runner.koan import * import re # For regular expression string comparisons class AboutWithStatements(Koan): def count_lines(self, file_name): try: file = open(file_name) try: ...
# coding=utf-8 from plugins.utils import get_used_plugins_by, get_latest_sensor_value from climate.models import RaindropValue def rain_level(sensor, number): """ Функция, определяющая 4 уровня осадков. Необходимо подстройка с учетом расположения, исполнения, угола наклона и пр. датчика дождя. Поэтом...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercises 11.7, 11.8 from Kane 1985.""" from __future__ import division from sympy import expand, solve, symbols, trigsimp, sin, cos, Matrix from sympy.physics.mechanics import ReferenceFrame, RigidBody, Point from sympy.physics.mechanics import dot, dynamicsymbols, ine...
#!/usr/bin/env python2.5 # # Copyright 2008 the Melange 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 applic...
#!/usr/bin/env python3 import socket from util import ip4n_range, ip4_range import unittest from framework import VppTestCase, VppTestRunner, running_extended_tests from template_bd import BridgeDomain from scapy.layers.l2 import Ether from scapy.packet import Raw from scapy.layers.inet import IP, UDP from scapy.laye...
#!/usr/bin/env python # coding: utf8 # from gevent import monkey # monkey.patch_all() import socket import os, sys import random, struct import logging from collections import deque, Counter, defaultdict logger = logging.getLogger(__file__) logger.addHandler(logging.StreamHandler(sys.stderr)) logger.setLevel(loggin...
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2010 Doug Hellmann. All rights reserved. # """Creating the schema in an sqlite3 database. """ #end_pymotw_header import sqlite3 db_filename = 'todo.db' def show_projects(conn): cursor = conn.cursor() cursor.execute('select name, description from proj...
from setuptools import find_packages from setuptools import setup setup( name='pre_commit', description=( 'A framework for managing and maintaining multi-language pre-commit ' 'hooks.' ), url='https://github.com/pre-commit/pre-commit', version='0.5.5', author='Anthony Sottile'...
""" Some non-core utility functions for GPs """ from __future__ import print_function import numpy as np import pylab try: import dill dill_available = 'yes' except ImportError: dill_available = 'no' #################################################################################################### def load(fi...
from unittest import TestCase from diffprivlib.mechanisms import DPMachine, DPMechanism class TestDPMechanism(TestCase): def setup_method(self, method): class TestMech(DPMechanism): def randomise(self, value): return value self.mech = TestMech def teardown_method...
"""Leetcode 295. Find Median from Data Stream Hard URL: https://leetcode.com/problems/find-median-from-data-stream/ Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value. For example, [2,3,4], the median i...
import os, inspect, json, re #needed for os files from django.conf import settings from glob import glob #Needed for directories import subprocess ...
# Module to run tests on initializing AbslineSystem # TEST_UNICODE_LITERALS import numpy as np import os, pdb import pytest from astropy import units as u from xastropy.igm import tau_eff as xit from xastropy.igm.fN import model as xifm from linetools.spectralline import AbsLine ''' def data_path(filename): da...
from __future__ import print_function, absolute_import, unicode_literals import numpy from numpy import sin, cos, arccos, dot, isclose, count_nonzero from scipy.spatial.distance import cosine, norm __author__ = 'calvin' def transform_to_similarity(v, s): if v.shape[0] < 2: raise ValueError('Cosine simila...
# 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...
import sys import os import logging from collections import OrderedDict from substance.monads import * from substance.logs import * from substance.shell import Shell from substance.engine import Engine from substance.link import Link from substance.box import Box from substance.db import DB from substance.constants im...