src
stringlengths
721
1.04M
#!/usr/bin/env python # Copyright 2016 VMware, 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 ...
""" * metaTower v0.4.5 * http://www.metatower.com * * Copyright 2012, Andrew Mac * http://www.andrewmac.ca * Licensed under GPL v3. * See license.txt * or http://www.metatower.com/license.txt """ import mt, inspect class EventManager: class EventItem: def __init__(self, event, function, source):...
# -*- coding: utf-8 -*- # TAXIPP -- A French microsimulation model # By: IPP <taxipp@ipp.eu> # # Copyright (C) 2012, 2013, 2014, 2015 IPP # https://github.com/taxipp # # This file is part of TAXIPP. # # TAXIPP is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Publi...
#!/usr/bin/env python import re import unittest from imi.query import match __all__ = ['TestQuery'] class TestQuery(unittest.TestCase): def setUp(self): self.document = { 'a': 'b', 'c': ('d', 'e', 'f'), 'g': ['h', 'i', 'j'], 'k': {'l': 'm'}, ...
# -*- coding: utf-8 -*- # Copyright 2017 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp.tests.common import TransactionCase from datetime import datetime class BaseTest(TransactionCase): def setUp(self, *args, **kwargs): super(BaseTest, self).setUp(*arg...
""" Manage a data-transformation recipe Started April 2019 by David Megginson License: Public Domain """ import flask, hxl_proxy, hxl_proxy.dao, hxl_proxy.filters, logging, werkzeug class Recipe: """ Class to hold a HXL Proxy recipe. The recipe can come either from the request parameters, or from a saved rec...
import reversion from performanceplatform.client import DataSet as client from stagecraft.apps.datasets.models import DataGroup, DataSet, DataType from django.conf import settings INTERNAL_KEY = [ "_day_start_at", "_hour_start_at", "_week_start_at", "_month_start_at", "_quarter_start_at", "_upd...
import re from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream import HLSStream from streamlink.utils import parse_json @pluginmatcher(re.compile( r"https?://www\.cbsnews\.com/live/" )) class CBSNews(Plugin): _re_default_payload = re.compile(r"...
# 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...
import py from rpython.jit.metainterp.history import TargetToken, JitCellToken, TreeLoop from rpython.jit.metainterp.optimizeopt.util import equaloplists from rpython.jit.metainterp.optimizeopt.vector import (Pack, GenericCostModel, NotAProfitableLoop, VectorizingOptimizer, CostModel) from rpython.jit.metainte...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
# -*- coding: utf-8 -*- ############################################################################## # # Account Bank Match # Copyright (C) 2016 May # 1200 Web Development # http://1200wd.com/ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Af...
""" Copyright (c) 2017, Jairus Martin. Distributed under the terms of the MIT License. The full license is in the file LICENSE, distributed with this software. Created on Sept 18, 2017 @author: jrm """ from atom.api import Typed, Bool, set_default from .bridge import JavaBridgeObject, JavaMethod, JavaStaticMethod f...
from sympy.core import (S, pi, oo, Symbol, symbols, Rational, Integer, GoldenRatio, EulerGamma, Catalan, Lambda, Dummy, Eq) from sympy.functions import (Piecewise, sin, cos, Abs, exp, ceiling, sqrt, gamma, sign, Max, Min, factorial, beta) from sympy.sets import Range...
# Copyright 2020 Open Source Robotics 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 # # Unless required by applicable law...
__author__ = 'jitrixis' from Factory.machinery import * class Api: def __init__(self, device="wlan0"): self.__engine = Engine(device) pass def getIP(self, mac): r = self.__engine.getArpIP(mac) return r def getMAC(self, ip): r = self.__engine.getArpMAC(ip) ...
# !usr/bin/env python2 # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. # # @Author: Brian Cherinka # @Date: 2017-06-10 16:46:40 # @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu) # @Last modified time: 2018-11-14 19:37:22 from __future__ import absolute_import, division, print_function i...
# Django settings for Dicoweb project. # # This file is part of GNU Dico. # Copyright (C) 2008-2010, 2012 Wojciech Polak # # GNU Dico 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, or ...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # Copyright (C) 2014-2017 Anler Hernández ...
"""Defines the command line method for running a delete files task""" from __future__ import unicode_literals import json import logging import os import signal import sys from collections import namedtuple from django.core.management.base import BaseCommand from messaging.manager import CommandMessageManager from s...
# # 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...
'''Simple classifier model ''' from cortex.main import run from cortex.plugins import ModelPlugin import torch import torch.nn as nn import torch.nn.functional as F from cortex.built_ins.models.utils import update_encoder_args class MyClassifier(ModelPlugin): '''Basic image classifier. Classifies images ...
# # webgateway/webgateway_cache - web cache handler for webgateway # # Copyright (c) 2008, 2009 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle, which states you are # free to use it only f...
import sys import inspect import logging from nose2 import util from nose2.compat import unittest log = logging.getLogger(__name__) __unittest = True # # Layer suite class # class LayerSuite(unittest.BaseTestSuite): def __init__(self, tests=(), layer=None): super(LayerSuite, self).__init__(tests) ...
import argparse import logging import constants import os import utils import nltk from nltk import metrics """ total steps- - token comparison - fuzzy comparison """ init_term_1 = 0 init_term_2 = 0 def fuzzy_comparison(tokens_1,tokens_2,max_dist=1): """ compares the tokens based on fuzzy match """ matched ...
# coding: utf-8 from __future__ import unicode_literals from django.forms import CharField, Form, Media from django.http import HttpRequest from django.middleware.csrf import CsrfViewMiddleware, get_token from django.template import TemplateDoesNotExist, TemplateSyntaxError from django.template.backends.dummy...
from unittest import TestCase from gcsa.attendee import Attendee, ResponseStatus from gcsa.serializers.attendee_serializer import AttendeeSerializer class TestAttendeeSerializer(TestCase): def test_to_json(self): attendee = Attendee( email='mail@gmail.com', display_name='Guest', ...
#!/usr/bin/env python # # 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 requir...
""" 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 ...
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2010,2011,2012,2013,2014,2015,2016,2017,2018 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
# -*- coding: utf-8 -*- # # Guzzle documentation build configuration file, created by # sphinx-quickstart on Tue Mar 1 22:54:52 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
import inspect from django.conf import settings from elasticutils.contrib.django import MappingType from lily.search.base_mapping import BaseMapping class ModelMappings(object): mappings = [] model_to_mappings = {} app_to_mappings = {} @classmethod def scan(cls, apps_to_scan=settings.INSTALLED_...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br) # # This file is part of libSigNetSim. # # libSigNetSim 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 Fou...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .text import slugify # TODO Remove deprecated location from .models.slugs import AutoSlugField def uniquify_field_value(instance, field_name, value, max_length=None, queryset=None): """ Makes a char field value unique by append...
from __future__ import absolute_import, print_function, division import unittest import dill import glob import os import numpy as np from pysaliency.utils import LazyList, TemporaryDirectory, Cache, get_minimal_unique_filenames, atomic_directory_setup, build_padded_2d_array from test_helpers import TestWithData d...
"""Definition of the QueryInstructions content type """ from zope.interface import implements from Products.Archetypes import atapi from Products.ATContentTypes.content import folder from Products.ATContentTypes.content import schemata from uwosh.itdocs import itdocsMessageFactory as _ from uwosh.itdocs.interfaces i...
""" plot using a variety of cm vs inches conversions. The example shows how default unit instrospection works (ax1), how various keywords can be used to set the x and y units to override the defaults (ax2, ax3, ax4) and how one can set the xlimits using scalars (ax3, current units assumed) or units (conversions applie...
# # Copyright 2009-2016 Red Hat, Inc. # # 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 version. # # This program is distributed ...
#!/usr/bin/env python3 # written by sqall # twitter: https://twitter.com/sqall01 # blog: https://h4des.org # github: https://github.com/sqall01 # # Licensed under the GNU Affero General Public License, version 3. import time import urwid from typing import List from ..globalData import ManagerObjSensor, ManagerObjAle...
#*************************************************************************** #* * #* Copyright (c) 2011, 2012 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* * #* This program is free software; you can redistribute it and/or modify * #* it un...
#-*- coding: utf-8 -*- from django.contrib import admin from django.conf import settings from django.core.management import call_command from django.utils.translation import ugettext as _ from django.contrib.admin.util import quote from changerubrictypeadmin import ChangeTypeModelAdmin from sorl.thumbnail.admin impor...
import sys import os import numpy import logging import multiprocessing from apgl.predictors.LibSVM import LibSVM from sandbox.util.PathDefaults import PathDefaults from sandbox.util.Util import Util from sandbox.util.FileLock import FileLock from sandbox.util.Sampling import Sampling from sandbox.util.Evaluator impor...
#!/usr/bin/python #================================================== # run DATUNER #=================================================== import uuid, platform import sys, os, argparse, socket, pickle, subprocess, sqlite3, dispy, time from threading import Thread from datetime import datetime DATUNER_HOME = os.enviro...
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from copy import deepcopy import mock import pytest from datadog_checks.couchbase import Couchbase def test_camel_case_to_joined_lower(instance): couchbase = Couchbase('couchbase', {}, [instance]) ...
# -*- encoding: utf-8 -*- ############################################################################## # # MRP To Purchase module for Odoo # Copyright (C) 2015-Today Akretion (http://www.akretion.com) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # # This program is free software: you can re...
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocol...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import DEPS CONFIG_CTX = DEPS['gclient'].CONFIG_CTX ChromeInternalGitURL = DEPS['gclient'].config.ChromeInternalGitURL ChromiumGitURL = DEPS['gclient'].confi...
"""Web views.""" from typing import Any, Dict, List import time from aiohttp import web # noinspection PyPackageRequirements import aiohttp_jinja2 from irisett.sql import DBConnection from irisett import ( metadata, stats, contact, log, object_models, monitor_group, ) from irisett.monitor imp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Keypad documentation build configuration file, created by # sphinx-quickstart on Sun May 11 19:23:37 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # aut...
#__GENERATED_OBJECTS__ __feature_types = { 'gene' : GeneFeature, 'transcript' : TranscriptFeature, 'cds': CDSFeature, 'exon' : ExonFeature, 'repeat' : RepeatFeature, 'simple' : SimpleFeature, 'misc' : MiscFeature, 'variation' : VariationFeature, ...
""" Copyright (C) 2015, Thiago Pagonha, Plan Your Exchange, easy exchange to fit your budget This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the Li...
# coding=utf-8 # Copyright 2020 The SimCLR 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...
import sys import os,re import pdb # takes 3 arguments: unlabelled file, labelled file and model (ner/pos) #python format_checker_Assignement3.py pos_input.txt pos_output.txt pos // to verify output of pos model #python format_checker_Assignement3.py ner_input.txt ner_output.txt ner // to verify output of ner model w...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import os.path as op import sys import logging import re from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from pyfaidx import Fasta from Bio import AlignIO from maize.apps.base import eprint, sh, mkdir from maize.formats.base im...
import os.path boxes15 = [] f = file(os.path.join(os.path.dirname(__file__), 'boxes_15x15.data'), 'r') for line in f.readlines(): if not line: break [left, bottom, right, top] = [float(x) for x in line.split()] boxes15.append((left, bottom, right, top)) boxes3 = [] f = file(os.path.join(os.path.di...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.business import CommandExecutionException from tekton.gae.middleware.json_middleware import JsonResponse from rota_app import facade def index(): cmd = facade.list_rotas_cmd() rota_list = cmd() short_form=fac...
from django.shortcuts import render from django.contrib.auth.models import User from rest_framework.response import Response from rest_framework.decorators import api_view from rest_framework import status from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.authtoken.models import Token from...
import ephem from astropy.coordinates import EarthLocation from astropy.time import Time from astroplan import moon_illumination from icalendar import Calendar, Event from datetime import date, time, timedelta, datetime my_lat = '39.0209321' my_lon = '-77.01722708' my_elev = 122 date_start = '2017/01/01 00:00' obs =...
class PtCreator: ''' Create the PTSticher-input-file''' def __init__(self, output_dir, a, b, c): self.output_dir = output_dir # Disortion a, b, c self.a = a self.b = b self.c = c def init_file(self): # return first block of PTSticher-file string ...
from unittest import TestCase from ..core import Calendar from ..exceptions import ISORegistryError from ..registry import IsoRegistry class RegionCalendar(Calendar): 'Region' class SubRegionCalendar(Calendar): 'Sub Region' class NotACalendarClass: "Not a Calendar" class NonStandardRegistryTest(Tes...
# -*- 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...
# ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, Lucio Torre # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follow...
# 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. """ The Value hierarchy provides a way of representing the values measurements produce such that they can be merged across runs, grouped by page, and output t...
# -*- coding: utf-8 -*- import fauxfactory import pytest from cfme.common.provider import cleanup_vm from cfme.services.catalogs.service_catalogs import ServiceCatalogs from cfme.services import requests from cfme.services.catalogs.myservice import MyService from cfme.automate.simulation import simulate from cfme.auto...
import logging import sys if sys.version_info[0] < 3: import ConfigParser config = ConfigParser.RawConfigParser() else: import configparser config = configparser.RawConfigParser() config.read('pydPiper.cfg') def safeget(config, section, option, default=None): return config.has_option(section, opti...
"""Support for Zigbee Home Automation devices.""" import logging import voluptuous as vol from homeassistant import config_entries, const as ha_const import homeassistant.helpers.config_validation as cv from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE # Loading the config flow file will register t...
import threading import logging import operator import locked_queue import queen_dir import queen import worker # imports for high-level scheduling import random import job_list # configures debug logging? logging.basicConfig(filename='/tmp/hive.log', level=logging.DEBUG, format='%(asctime)s (%(threadName)-2s...
# Copyright 2002-2009, Distributed Systems Architecture Group, Universidad # Complutense de Madrid (dsa-research.org) # # 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 ...
# -*- coding: utf-8 -*- # (c) 2016-2017 Andreas Motl <andreas@getkotori.org> import arrow from arrow.parser import DateTimeParser from datetime import datetime, timedelta from twisted.logger import Logger from kotori.io.protocol.util import is_number from kotori.util.common import tdelta log = Logger() class QueryTr...
#!/usr/bin/env python3 # testMerkleTree.py """ Test package functionality at the Tree level. """ import os import shutil import sys import time import unittest from rnglib import SimpleRNG from xlattice import (HashTypes, check_hashtype, SHA1_HEX_NONE, SHA2_HEX_NONE, SHA3_HEX_NONE, ...
#!python3 def count_of_zeros(num): ''' (int) -> int Returns count of zero bits in the binary representation of the given integer num. >>> count_of_zeros(0) 1 >>> count_of_zeros(1) 0 >>> count_of_zeros(2) 1 >>> count_of_zeros(4) 2 >>> count_of_zero...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
# -*- coding: utf-8 -*- from marshmallow import ValidationError from pyramid.httpexceptions import HTTPNotFound from pyramid.httpexceptions import HTTPBadRequest from pyramid.view import view_defaults from pyramid.view import view_config from amnesia.utils import recaptcha from amnesia.utils.forms import render_form...
#!/usr/bin/python3 import requests import json import os import time import random as rand import subprocess #telegram bot stuff url = "https://api.telegram.org/bot%s/%s" token = open("token.txt").read().replace('\n', '') print(url % (token, "getUpdates")) path = os.path.dirname(__file__) #globals locked = [] aliase...
import aurora as au import aurora.autodiff as ad import numpy as np import numpy.testing as npt from aurora.ndarray import ndarray, gpu_op def test_dummy(): assert 1 == 1 def test_array_set(): ctx = ndarray.gpu(0) shape = (5000, 2000) # oneslike arr_x = ndarray.empty(shape, ctx=ctx) gpu_op.a...
# (C) British Crown Copyright 2013 - 2017, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
import pytest def test_default(): from vishnu.backend import Redis from vishnu.backend.config.redis import DEFAULT_HOST, DEFAULT_PORT, DEFAULT_DB config = Redis() assert config.host == DEFAULT_HOST assert config.port == DEFAULT_PORT assert config.db == DEFAULT_DB def test_custom_host(): ...
import yaml # Get base stats and values def get_base_attributes(): with open( 'data/base_stats.yaml', 'r' ) as ff: attributes = yaml.load( ff ) return attributes # Get Affiliations data def get_affiliations(): with open( 'data/affiliations.yaml', 'r' ) as f: affiliations_data = yaml.loa...
# -*- coding: utf-8 -*- """ *************************************************************************** GetScriptsAndModels.py --------------------- Date : June 2014 Copyright : (C) 2014 by Victor Olaya Email : volayaf at gmail dot com *********************...
#!/usr/bin/env python2 import os import sys import h5py import numpy import data _fields = { 'trip_id': 'S19', 'call_type': numpy.int8, 'origin_call': numpy.int32, 'origin_stand': numpy.int8, 'taxi_id': numpy.int16, 'timestamp': numpy.int32, 'day_type': numpy.int8, 'missing_data': nump...
# Copyright 2015, 2016 IBM Corp. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
"""Test the helper method for writing tests.""" import asyncio import collections from collections import OrderedDict from contextlib import contextmanager from datetime import timedelta import functools as ft from io import StringIO import json import logging import os import sys import threading import uuid from aio...
''' Copyright (c) 2019 Yogesh Khatri This file is part of mac_apt (macOS Artifact Parsing Tool). Usage or distribution of this software/code is subject to the terms of the MIT License. ''' from plugins.helpers.macinfo import * from plugins.helpers.writer import * from plugins.helpers.common im...
#! /usr/bin/env python # encoding: utf-8 """ Django settings for bongo project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ import os from config import * # Bu...
# encoding: utf-8 """ IO related utilities. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software....
#!/usr/local/bin/python3 # Filename: ExecuteServerStatus.py # Version 2.7 07/29/13 RV MiloCreek # Version 3.0 04.04.2016 IzK (Python3.4+) import Config import subprocess import xml.etree.ElementTree as ET import Validate import BuildResponse import time if (Config.i2c_demo()): from pyblinkm import BlinkM, Scripts...
import mdtraj as md import tempfile import logging import os import shutil from distutils.spawn import find_executable from mdtraj.utils.delay_import import import_ import mdtraj.utils try: from subprocess import getoutput # If python 3 except ImportError: from commands import getoutput # If python 2 logger...
# Copyright (C) 2009, Aleksey Lim # Copyright (C) 2018, James Cameron <quozl@laptop.org> # # 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) ...
# MIT License # # Copyright (c) 2016 Oliver Nagy # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, ...
""" Copyright 2017-present Airbnb, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
import logging log = logging.getLogger(__name__) from types import GeneratorType from functools import partial import numpy as np from atom.api import (Unicode, Enum, Event, Typed, Property, Float, Int, Bool, List) import enaml from enaml.application import deferred_call from enaml.core.api im...
from __future__ import unicode_literals import re import tempfile from django.contrib.gis import gdal from django.contrib.gis.db.models import Extent, MakeLine, Union from django.contrib.gis.geos import ( GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon, fromstr, ) from djan...
""" Bing (Images) @website https://www.bing.com/images @provide-api yes (http://datamarket.azure.com/dataset/bing/search), max. 5000 query/month @using-api no (because of query limit) @results HTML (using search portal) @stable no (HTML can change) @parse url, title, img_src ...
#!/home/haop/code/ReceiptOCR/Python/server/bin/python2.7 # # The Python Imaging Library # $Id$ # # this demo script illustrates pasting into an already displayed # photoimage. note that the current version of Tk updates the whole # image every time we paste, so to get decent performance, we split # the image into a se...
""" Click module to launch node LLD gathering """ from sys import exit import click from es_stats_zabbix import __version__ from es_stats_zabbix.exceptions import FailedExecution, NotFound from es_stats_zabbix.helpers.utils import do_request, log_to_listener, open_port CONTEXT_SETTINGS = dict(help_option_names=['-h',...
# Copyright (C) 2015 University of Nebraska at Omaha # Copyright (C) 2015 Thomas T. Gurney # # This file is part of dosocs2. # # dosocs2 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 ...
#!/usr/bin/env python import argparse import girder_client from girder_client import GirderClient import os import fnmatch import json import mimetypes from distutils.version import StrictVersion if StrictVersion(girder_client.__version__) < StrictVersion("2.0.0"): raise Exception("Girder 2.0.0 or new...
# 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 ...
""" Based on an input, trained classifier configuration, classify a number of media files, whose descriptor is computed by the configured descriptor generator. Input files that classify as the given label are then output to standard out. Thus, this script acts like a filter. """ import glob import json import logging i...
import math import random class Agent: def __init__(self, actions, options={}): self.rgen = random.SystemRandom() # cryptographically secure, unlike random self.actions = actions self.last_action = None def __choose_exploitative_action__(self): raise Exception('Not implemented!...